text: (function(){var a=this,b=a._,c=Array.prototype,d=Object.prototype,e=Function.prototype,f=c.push,g=c.slice,h=c.concat,i=d.toString,j=d.hasOwnProperty,k=Array.isArray,l=Object.keys,m=e.bind,n=function(a){return a instanceof n?a:this instanceof n?void(this._wrapped=a):new n(a)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=n),exports._=n):a._=n,n.VERSION="1.7.0";var o=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}};n.iteratee=function(a,b,c){return null==a?n.identity:n.isFunction(a)?o(a,b,c):n.isObject(a)?n.matches(a):n.property(a)},n.each=n.forEach=function(a,b,c){if(null==a)return a;b=o(b,c);var d,e=a.length;if(e===+e)for(d=0;d<e;d++)b(a[d],d,a);else{var f=n.keys(a);for(d=0,e=f.length;d<e;d++)b(a[f[d]],f[d],a)}return a},n.map=n.collect=function(a,b,c){if(null==a)return[];b=n.iteratee(b,c);for(var d,e=a.length!==+a.length&&n.keys(a),f=(e||a).length,g=Array(f),h=0;h<f;h++)d=e?e[h]:h,g[h]=b(a[d],d,a);return g};var p="Reduce of empty array with no initial value";n.reduce=n.foldl=n.inject=function(a,b,c,d){null==a&&(a=[]),b=o(b,d,4);var e,f=a.length!==+a.length&&n.keys(a),g=(f||a).length,h=0;if(arguments.length<3){if(!g)throw new TypeError(p);c=a[f?f[h++]:h++]}for(;h<g;h++)e=f?f[h]:h,c=b(c,a[e],e,a);return c},n.reduceRight=n.foldr=function(a,b,c,d){null==a&&(a=[]),b=o(b,d,4);var e,f=a.length!==+a.length&&n.keys(a),g=(f||a).length;if(arguments.length<3){if(!g)throw new TypeError(p);c=a[f?f[--g]:--g]}for(;g--;)e=f?f[g]:g,c=b(c,a[e],e,a);return c},n.find=n.detect=function(a,b,c){var d;return b=n.iteratee(b,c),n.some(a,function(a,c,e){if(b(a,c,e))return d=a,!0}),d},n.filter=n.select=function(a,b,c){var d=[];return null==a?d:(b=n.iteratee(b,c),n.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d)},n.reject=function(a,b,c){return n.filter(a,n.negate(n.iteratee(b)),c)},n.every=n.all=function(a,b,c){if(null==a)return!0;b=n.iteratee(b,c);var d,e,f=a.length!==+a.length&&n.keys(a),g=(f||a).length;for(d=0;d<g;d++)if(e=f?f[d]:d,!b(a[e],e,a))return!1;return!0},n.some=n.any=function(a,b,c){if(null==a)return!1;b=n.iteratee(b,c);var d,e,f=a.length!==+a.length&&n.keys(a),g=(f||a).length;for(d=0;d<g;d++)if(e=f?f[d]:d,b(a[e],e,a))return!0;return!1},n.contains=n.include=function(a,b){return null!=a&&(a.length!==+a.length&&(a=n.values(a)),n.indexOf(a,b)>=0)},n.invoke=function(a,b){var c=g.call(arguments,2),d=n.isFunction(b);return n.map(a,function(a){return(d?b:a[b]).apply(a,c)})},n.pluck=function(a,b){return n.map(a,n.property(b))},n.where=function(a,b){return n.filter(a,n.matches(b))},n.findWhere=function(a,b){return n.find(a,n.matches(b))},n.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=a.length===+a.length?a:n.values(a);for(var h=0,i=a.length;h<i;h++)(d=a[h])>f&&(f=d)}else b=n.iteratee(b,c),n.each(a,function(a,c,d){((e=b(a,c,d))>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},n.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=a.length===+a.length?a:n.values(a);for(var h=0,i=a.length;h<i;h++)(d=a[h])<f&&(f=d)}else b=n.iteratee(b,c),n.each(a,function(a,c,d){((e=b(a,c,d))<g||e===1/0&&f===1/0)&&(f=a,g=e)});return f},n.shuffle=function(a){for(var b,c=a&&a.length===+a.length?a:n.values(a),d=c.length,e=Array(d),f=0;f<d;f++)b=n.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},n.sample=function(a,b,c){return null==b||c?(a.length!==+a.length&&(a=n.values(a)),a[n.random(a.length-1)]):n.shuffle(a).slice(0,Math.max(0,b))},n.sortBy=function(a,b,c){return b=n.iteratee(b,c),n.pluck(n.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(c<d||void 0===d)return-1}return a.index-b.index}),"value")};var q=function(a){return function(b,c,d){var e={};return c=n.iteratee(c,d),n.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};n.groupBy=q(function(a,b,c){n.has(a,c)?a[c].push(b):a[c]=[b]}),n.indexBy=q(function(a,b,c){a[c]=b}),n.countBy=q(function(a,b,c){n.has(a,c)?a[c]++:a[c]=1}),n.sortedIndex=function(a,b,c,d){c=n.iteratee(c,d,1);for(var e=c(b),f=0,g=a.length;f<g;){var h=f+g>>>1;c(a[h])<e?f=h+1:g=h}return f},n.toArray=function(a){return a?n.isArray(a)?g.call(a):a.length===+a.length?n.map(a,n.identity):n.values(a):[]},n.size=function(a){return null==a?0:a.length===+a.length?a.length:n.keys(a).length},n.partition=function(a,b,c){b=n.iteratee(b,c);var d=[],e=[];return n.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},n.first=n.head=n.take=function(a,b,c){if(null!=a)return null==b||c?a[0]:b<0?[]:g.call(a,0,b)},n.initial=function(a,b,c){return g.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},n.last=function(a,b,c){if(null!=a)return null==b||c?a[a.length-1]:g.call(a,Math.max(a.length-b,0))},n.rest=n.tail=n.drop=function(a,b,c){return g.call(a,null==b||c?1:b)},n.compact=function(a){return n.filter(a,n.identity)};var r=function(a,b,c,d){if(b&&n.every(a,n.isArray))return h.apply(d,a);for(var e=0,g=a.length;e<g;e++){var i=a[e];n.isArray(i)||n.isArguments(i)?b?f.apply(d,i):r(i,b,c,d):c||d.push(i)}return d};n.flatten=function(a,b){return r(a,b,!1,[])},n.without=function(a){return n.difference(a,g.call(arguments,1))},n.uniq=n.unique=function(a,b,c,d){if(null==a)return[];n.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=n.iteratee(c,d));for(var e=[],f=[],g=0,h=a.length;g<h;g++){var i=a[g];if(b)g&&f===i||e.push(i),f=i;else if(c){var j=c(i,g,a);n.indexOf(f,j)<0&&(f.push(j),e.push(i))}else n.indexOf(e,i)<0&&e.push(i)}return e},n.union=function(){return n.uniq(r(arguments,!0,!0,[]))},n.intersection=function(a){if(null==a)return[];for(var b=[],c=arguments.length,d=0,e=a.length;d<e;d++){var f=a[d];if(!n.contains(b,f)){for(var g=1;g<c&&n.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},n.difference=function(a){var b=r(g.call(arguments,1),!0,!0,[]);return n.filter(a,function(a){return!n.contains(b,a)})},n.zip=function(a){if(null==a)return[];for(var b=n.max(arguments,"length").length,c=Array(b),d=0;d<b;d++)c[d]=n.pluck(arguments,d);return c},n.object=function(a,b){if(null==a)return{};for(var c={},d=0,e=a.length;d<e;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},n.indexOf=function(a,b,c){if(null==a)return-1;var d=0,e=a.length;if(c){if("number"!=typeof c)return d=n.sortedIndex(a,b),a[d]===b?d:-1;d=c<0?Math.max(0,e+c):c}for(;d<e;d++)if(a[d]===b)return d;return-1},n.lastIndexOf=function(a,b,c){if(null==a)return-1;var d=a.length;for("number"==typeof c&&(d=c<0?d+c+1:Math.min(d,c+1));--d>=0;)if(a[d]===b)return d;return-1},n.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=c||1;for(var d=Math.max(Math.ceil((b-a)/c),0),e=Array(d),f=0;f<d;f++,a+=c)e[f]=a;return e};var s=function(){};n.bind=function(a,b){var c,d;if(m&&a.bind===m)return m.apply(a,g.call(arguments,1));if(!n.isFunction(a))throw new TypeError("Bind must be called on a function");return c=g.call(arguments,2),d=function(){if(!(this instanceof d))return a.apply(b,c.concat(g.call(arguments)));s.prototype=a.prototype;var e=new s;s.prototype=null;var f=a.apply(e,c.concat(g.call(arguments)));return n.isObject(f)?f:e}},n.partial=function(a){var b=g.call(arguments,1);return function(){for(var c=0,d=b.slice(),e=0,f=d.length;e<f;e++)d[e]===n&&(d[e]=arguments[c++]);for(;c<arguments.length;)d.push(arguments[c++]);return a.apply(this,d)}},n.bindAll=function(a){var b,c,d=arguments.length;if(d<=1)throw new Error("bindAll must be passed function names");for(b=1;b<d;b++)c=arguments[b],a[c]=n.bind(a[c],a);return a},n.memoize=function(a,b){var c=function(d){var e=c.cache,f=b?b.apply(this,arguments):d;return n.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},n.delay=function(a,b){var c=g.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},n.defer=function(a){return n.delay.apply(n,[a,1].concat(g.call(arguments,1)))},n.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=!1===c.leading?0:n.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=n.now();h||!1!==c.leading||(h=j);var k=b-(j-h);return d=this,e=arguments,k<=0||k>b?(clearTimeout(g),g=null,h=j,f=a.apply(d,e),g||(d=e=null)):g||!1===c.trailing||(g=setTimeout(i,k)),f}},n.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=n.now()-g;j<b&&j>0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=n.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},n.wrap=function(a,b){return n.partial(b,a)},n.negate=function(a){return function(){return!a.apply(this,arguments)}},n.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},n.after=function(a,b){return function(){if(--a<1)return b.apply(this,arguments)}},n.before=function(a,b){var c;return function(){return--a>0?c=b.apply(this,arguments):b=null,c}},n.once=n.partial(n.before,2),n.keys=function(a){if(!n.isObject(a))return[];if(l)return l(a);var b=[];for(var c in a)n.has(a,c)&&b.push(c);return b},n.values=function(a){for(var b=n.keys(a),c=b.length,d=Array(c),e=0;e<c;e++)d[e]=a[b[e]];return d},n.pairs=function(a){for(var b=n.keys(a),c=b.length,d=Array(c),e=0;e<c;e++)d[e]=[b[e],a[b[e]]];return d},n.invert=function(a){for(var b={},c=n.keys(a),d=0,e=c.length;d<e;d++)b[a[c[d]]]=c[d];return b},n.functions=n.methods=function(a){var b=[];for(var c in a)n.isFunction(a[c])&&b.push(c);return b.sort()},n.extend=function(a){if(!n.isObject(a))return a;for(var b,c,d=1,e=arguments.length;d<e;d++){b=arguments[d];for(c in b)j.call(b,c)&&(a[c]=b[c])}return a},n.pick=function(a,b,c){var d,e={};if(null==a)return e;if(n.isFunction(b)){b=o(b,c);for(d in a){var f=a[d];b(f,d,a)&&(e[d]=f)}}else{var i=h.apply([],g.call(arguments,1));a=new Object(a);for(var j=0,k=i.length;j<k;j++)(d=i[j])in a&&(e[d]=a[d])}return e},n.omit=function(a,b,c){if(n.isFunction(b))b=n.negate(b);else{var d=n.map(h.apply([],g.call(arguments,1)),String);b=function(a,b){return!n.contains(d,b)}}return n.pick(a,b,c)},n.defaults=function(a){if(!n.isObject(a))return a;for(var b=1,c=arguments.length;b<c;b++){var d=arguments[b];for(var e in d)void 0===a[e]&&(a[e]=d[e])}return a},n.clone=function(a){return n.isObject(a)?n.isArray(a)?a.slice():n.extend({},a):a},n.tap=function(a,b){return b(a),a};var t=function(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;if(null==a||null==b)return a===b;a instanceof n&&(a=a._wrapped),b instanceof n&&(b=b._wrapped);var e=i.call(a);if(e!==i.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!=+a?+b!=+b:0==+a?1/+a==1/b:+a==+b;case"[object Date]":case"[object Boolean]":return+a==+b}if("object"!=typeof a||"object"!=typeof b)return!1;for(var f=c.length;f--;)if(c[f]===a)return d[f]===b;var g=a.constructor,h=b.constructor;if(g!==h&&"constructor"in a&&"constructor"in b&&!(n.isFunction(g)&&g instanceof g&&n.isFunction(h)&&h instanceof h))return!1;c.push(a),d.push(b);var j,k;if("[object Array]"===e){if(j=a.length,k=j===b.length)for(;j--&&(k=t(a[j],b[j],c,d)););}else{var l,m=n.keys(a);if(j=m.length,k=n.keys(b).length===j)for(;j--&&(l=m[j],k=n.has(b,l)&&t(a[l],b[l],c,d)););}return c.pop(),d.pop(),k};n.isEqual=function(a,b){return t(a,b,[],[])},n.isEmpty=function(a){if(null==a)return!0;if(n.isArray(a)||n.isString(a)||n.isArguments(a))return 0===a.length;for(var b in a)if(n.has(a,b))return!1;return!0},n.isElement=function(a){return!(!a||1!==a.nodeType)},n.isArray=k||function(a){return"[object Array]"===i.call(a)},n.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},n.each(["Arguments","Function","String","Number","Date","RegExp"],function(a){n["is"+a]=function(b){return i.call(b)==="[object "+a+"]"}}),n.isArguments(arguments)||(n.isArguments=function(a){return n.has(a,"callee")}),"function"!=typeof/./&&(n.isFunction=function(a){return"function"==typeof a||!1}),n.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},n.isNaN=function(a){return n.isNumber(a)&&a!==+a},n.isBoolean=function(a){return!0===a||!1===a||"[object Boolean]"===i.call(a)},n.isNull=function(a){return null===a},n.isUndefined=function(a){return void 0===a},n.has=function(a,b){return null!=a&&j.call(a,b)},n.noConflict=function(){return a._=b,this},n.identity=function(a){return a},n.constant=function(a){return function(){return a}},n.noop=function(){},n.property=function(a){return function(b){return b[a]}},n.matches=function(a){var b=n.pairs(a),c=b.length;return function(a){if(null==a)return!c;a=new Object(a);for(var d=0;d<c;d++){var e=b[d],f=e[0];if(e[1]!==a[f]||!(f in a))return!1}return!0}},n.times=function(a,b,c){var d=Array(Math.max(0,a));b=o(b,c,1);for(var e=0;e<a;e++)d[e]=b(e);return d},n.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},n.now=Date.now||function(){return(new Date).getTime()};var u={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},v=n.invert(u),w=function(a){var b=function(b){return a[b]},c="(?:"+n.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};n.escape=w(u),n.unescape=w(v),n.result=function(a,b){if(null!=a){var c=a[b];return n.isFunction(c)?a[b]():c}};var x=0;n.uniqueId=function(a){var b=++x+"";return a?a+b:b},n.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var y=/(.)^/,z={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},A=/\\|'|\r|\n|\u2028|\u2029/g,B=function(a){return"\\"+z[a]};n.template=function(a,b,c){!b&&c&&(b=c),b=n.defaults({},b,n.templateSettings);var d=RegExp([(b.escape||y).source,(b.interpolate||y).source,(b.evaluate||y).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(A,B),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(a){throw a.source=f,a}var h=function(a){return g.call(this,a,n)},i=b.variable||"obj";return h.source="function("+i+"){\n"+f+"}",h},n.chain=function(a){var b=n(a);return b._chain=!0,b};var C=function(a){return this._chain?n(a).chain():a};n.mixin=function(a){n.each(n.functions(a),function(b){var c=n[b]=a[b];n.prototype[b]=function(){var a=[this._wrapped];return f.apply(a,arguments),C.call(this,c.apply(n,a))}})},n.mixin(n),n.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=c[a];n.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],C.call(this,c)}}),n.each(["concat","join","slice"],function(a){var b=c[a];n.prototype[a]=function(){return C.call(this,b.apply(this._wrapped,arguments))}}),n.prototype.value=function(){return this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return n})}).call(this),function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){function c(a){var b=a.length,c=_.type(a);return"function"!==c&&!_.isWindow(a)&&(!(1!==a.nodeType||!b)||("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a))}function d(a,b,c){if(_.isFunction(b))return _.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return _.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(ha.test(b))return _.filter(b,a,c);b=_.filter(b,a)}return _.grep(a,function(a){return U.call(b,a)>=0!==c})}function e(a,b){for(;(a=a[b])&&1!==a.nodeType;);return a}function f(a){var b=na[a]={};return _.each(a.match(ma)||[],function(a,c){b[c]=!0}),b}function g(){Z.removeEventListener("DOMContentLoaded",g,!1),a.removeEventListener("load",g,!1),_.ready()}function h(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=_.expando+Math.random()}function i(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(ta,"-$1").toLowerCase(),"string"==typeof(c=a.getAttribute(d))){try{c="true"===c||"false"!==c&&("null"===c?null:+c+""===c?+c:sa.test(c)?_.parseJSON(c):c)}catch(a){}ra.set(a,b,c)}else c=void 0;return c}function j(){return!0}function k(){return!1}function l(){try{return Z.activeElement}catch(a){}}function m(a,b){return _.nodeName(a,"table")&&_.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function n(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function o(a){var b=Ja.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function p(a,b){for(var c=0,d=a.length;d>c;c++)qa.set(a[c],"globalEval",!b||qa.get(b[c],"globalEval"))}function q(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(qa.hasData(a)&&(f=qa.access(a),g=qa.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)_.event.add(b,e,j[e][c])}ra.hasData(a)&&(h=ra.access(a),i=_.extend({},h),ra.set(b,i))}}function r(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&_.nodeName(a,b)?_.merge([a],c):c}function s(a,b){var c=b.nodeName.toLowerCase();"input"===c&&xa.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function t(b,c){var d,e=_(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:_.css(e[0],"display");return e.detach(),f}function u(a){var b=Z,c=Na[a];return c||(c=t(a,b),"none"!==c&&c||(Ma=(Ma||_("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=Ma[0].contentDocument,b.write(),b.close(),c=t(a,b),Ma.detach()),Na[a]=c),c}function v(a,b,c){var d,e,f,g,h=a.style;return c=c||Qa(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||_.contains(a.ownerDocument,a)||(g=_.style(a,b)),Pa.test(g)&&Oa.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function w(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}function x(a,b){if(b in a)return b;for(var c=b[0].toUpperCase()+b.slice(1),d=b,e=Wa.length;e--;)if((b=Wa[e]+c)in a)return b;return d}function y(a,b,c){var d=Sa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function z(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=_.css(a,c+va[f],!0,e)),d?("content"===c&&(g-=_.css(a,"padding"+va[f],!0,e)),"margin"!==c&&(g-=_.css(a,"border"+va[f]+"Width",!0,e))):(g+=_.css(a,"padding"+va[f],!0,e),"padding"!==c&&(g+=_.css(a,"border"+va[f]+"Width",!0,e)));return g}function A(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Qa(a),g="border-box"===_.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=v(a,b,f),(0>e||null==e)&&(e=a.style[b]),Pa.test(e))return e;d=g&&(Y.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+z(a,b,c||(g?"border":"content"),d,f)+"px"}function B(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=qa.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&wa(d)&&(f[g]=qa.access(d,"olddisplay",u(d.nodeName)))):(e=wa(d),"none"===c&&e||qa.set(d,"olddisplay",e?c:_.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function C(a,b,c,d,e){return new C.prototype.init(a,b,c,d,e)}function D(){return setTimeout(function(){Xa=void 0}),Xa=_.now()}function E(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=va[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function F(a,b,c){for(var d,e=(bb[b]||[]).concat(bb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function G(a,b,c){var d,e,f,g,h,i,j,k=this,l={},m=a.style,n=a.nodeType&&wa(a),o=qa.get(a,"fxshow");c.queue||(h=_._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,k.always(function(){k.always(function(){h.unqueued--,_.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],j=_.css(a,"display"),"inline"===("none"===j?qa.get(a,"olddisplay")||u(a.nodeName):j)&&"none"===_.css(a,"float")&&(m.display="inline-block")),c.overflow&&(m.overflow="hidden",k.always(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Za.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(n?"hide":"show")){if("show"!==e||!o||void 0===o[d])continue;n=!0}l[d]=o&&o[d]||_.style(a,d)}else j=void 0;if(_.isEmptyObject(l))"inline"===("none"===j?u(a.nodeName):j)&&(m.display=j);else{o?"hidden"in o&&(n=o.hidden):o=qa.access(a,"fxshow",{}),f&&(o.hidden=!n),n?_(a).show():k.done(function(){_(a).hide()}),k.done(function(){var b;qa.remove(a,"fxshow");for(b in l)_.style(a,b,l[b])});for(d in l)g=F(n?o[d]:0,d,k),d in o||(o[d]=g.start,n&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function H(a,b){var c,d,e,f,g;for(c in a)if(d=_.camelCase(c),e=b[d],f=a[c],_.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),(g=_.cssHooks[d])&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function I(a,b,c){var d,e,f=0,g=ab.length,h=_.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Xa||D(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:_.extend({},b),opts:_.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:Xa||D(),duration:c.duration,tweens:[],createTween:function(b,c){var d=_.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(H(k,j.opts.specialEasing);g>f;f++)if(d=ab[f].call(j,a,k,j.opts))return d;return _.map(k,F,j),_.isFunction(j.opts.start)&&j.opts.start.call(a,j),_.fx.timer(_.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}function J(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(ma)||[];if(_.isFunction(c))for(;d=f[e++];)"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function K(a,b,c,d){function e(h){var i;return f[h]=!0,_.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||g||f[j]?g?!(i=j):void 0:(b.dataTypes.unshift(j),e(j),!1)}),i}var f={},g=a===ub;return e(b.dataTypes[0])||!f["*"]&&e("*")}function L(a,b){var c,d,e=_.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&_.extend(!0,a,d),a}function M(a,b,c){for(var d,e,f,g,h=a.contents,i=a.dataTypes;"*"===i[0];)i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function N(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];for(f=k.shift();f;)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(!(g=j[i+" "+f]||j["* "+f]))for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){!0===g?g=j[e]:!0!==j[e]&&(f=h[0],k.unshift(h[1]));break}if(!0!==g)if(g&&a.throws)b=g(b);else try{b=g(b)}catch(a){return{state:"parsererror",error:g?a:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}function O(a,b,c,d){var e;if(_.isArray(b))_.each(b,function(b,e){c||xb.test(a)?d(a,e):O(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==_.type(b))d(a,b);else for(e in b)O(a+"["+e+"]",b[e],c,d)}function P(a){return _.isWindow(a)?a:9===a.nodeType&&a.defaultView}var Q=[],R=Q.slice,S=Q.concat,T=Q.push,U=Q.indexOf,V={},W=V.toString,X=V.hasOwnProperty,Y={},Z=a.document,$="2.1.1",_=function(a,b){return new _.fn.init(a,b)},aa=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ba=/^-ms-/,ca=/-([\da-z])/gi,da=function(a,b){return b.toUpperCase()};_.fn=_.prototype={jquery:$,constructor:_,selector:"",length:0,toArray:function(){return R.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:R.call(this)},pushStack:function(a){var b=_.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return _.each(this,a,b)},map:function(a){return this.pushStack(_.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(R.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:T,sort:Q.sort,splice:Q.splice},_.extend=_.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||_.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(_.isPlainObject(d)||(e=_.isArray(d)))?(e?(e=!1,f=c&&_.isArray(c)?c:[]):f=c&&_.isPlainObject(c)?c:{},g[b]=_.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},_.extend({expando:"jQuery"+($+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===_.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!_.isArray(a)&&a-parseFloat(a)>=0},isPlainObject:function(a){return"object"===_.type(a)&&!a.nodeType&&!_.isWindow(a)&&!(a.constructor&&!X.call(a.constructor.prototype,"isPrototypeOf"))},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?V[W.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;(a=_.trim(a))&&(1===a.indexOf("use strict")?(b=Z.createElement("script"),b.text=a,Z.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(ba,"ms-").replace(ca,da)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,d){var e=0,f=a.length,g=c(a);if(d){if(g)for(;f>e&&!1!==b.apply(a[e],d);e++);else for(e in a)if(!1===b.apply(a[e],d))break}else if(g)for(;f>e&&!1!==b.call(a[e],e,a[e]);e++);else for(e in a)if(!1===b.call(a[e],e,a[e]))break;return a},trim:function(a){return null==a?"":(a+"").replace(aa,"")},makeArray:function(a,b){var d=b||[];return null!=a&&(c(Object(a))?_.merge(d,"string"==typeof a?[a]:a):T.call(d,a)),d},inArray:function(a,b,c){return null==b?-1:U.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d=[],e=0,f=a.length,g=!c;f>e;e++)!b(a[e],e)!==g&&d.push(a[e]);return d},map:function(a,b,d){var e,f=0,g=a.length,h=c(a),i=[];if(h)for(;g>f;f++)null!=(e=b(a[f],f,d))&&i.push(e);else for(f in a)null!=(e=b(a[f],f,d))&&i.push(e);return S.apply([],i)},guid:1,proxy:function(a,b){var c,d,e;return"string"==typeof b&&(c=a[b],b=a,a=c),_.isFunction(a)?(d=R.call(arguments,2),e=function(){return a.apply(b||this,d.concat(R.call(arguments)))},e.guid=a.guid=a.guid||_.guid++,e):void 0},now:Date.now,support:Y}),_.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){V["[object "+b+"]"]=b.toLowerCase()});var ea=function(a){function b(a,b,c,d){var e,f,g,h,i,j,l,n,o,p;if((b?b.ownerDocument||b:O)!==G&&F(b),b=b||G,c=c||[],!a||"string"!=typeof a)return c;if(1!==(h=b.nodeType)&&9!==h)return[];if(I&&!d){if(e=sa.exec(a))if(g=e[1]){if(9===h){if(!(f=b.getElementById(g))||!f.parentNode)return c;if(f.id===g)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(g))&&M(b,f)&&f.id===g)return c.push(f),c}else{if(e[2])return _.apply(c,b.getElementsByTagName(a)),c;if((g=e[3])&&v.getElementsByClassName&&b.getElementsByClassName)return _.apply(c,b.getElementsByClassName(g)),c}if(v.qsa&&(!J||!J.test(a))){if(n=l=N,o=b,p=9===h&&a,1===h&&"object"!==b.nodeName.toLowerCase()){for(j=z(a),(l=b.getAttribute("id"))?n=l.replace(ua,"\\$&"):b.setAttribute("id",n),n="[id='"+n+"'] ",i=j.length;i--;)j[i]=n+m(j[i]);o=ta.test(a)&&k(b.parentNode)||b,p=j.join(",")}if(p)try{return _.apply(c,o.querySelectorAll(p)),c}catch(a){}finally{l||b.removeAttribute("id")}}}return B(a.replace(ia,"$1"),b,c,d)}function c(){function a(c,d){return b.push(c+" ")>w.cacheLength&&delete a[b.shift()],a[c+" "]=d}var b=[];return a}function d(a){return a[N]=!0,a}function e(a){var b=G.createElement("div");try{return!!a(b)}catch(a){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function f(a,b){for(var c=a.split("|"),d=a.length;d--;)w.attrHandle[c[d]]=b}function g(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||W)-(~a.sourceIndex||W);if(d)return d;if(c)for(;c=c.nextSibling;)if(c===b)return-1;return a?1:-1}function h(a){return function(b){return"input"===b.nodeName.toLowerCase()&&b.type===a}}function i(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function j(a){return d(function(b){return b=+b,d(function(c,d){for(var e,f=a([],c.length,b),g=f.length;g--;)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function k(a){return a&&typeof a.getElementsByTagName!==V&&a}function l(){}function m(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function n(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=Q++;return b.first?function(b,c,f){for(;b=b[d];)if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[P,f];if(g){for(;b=b[d];)if((1===b.nodeType||e)&&a(b,c,g))return!0}else for(;b=b[d];)if(1===b.nodeType||e){if(i=b[N]||(b[N]={}),(h=i[d])&&h[0]===P&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function o(a){return a.length>1?function(b,c,d){for(var e=a.length;e--;)if(!a[e](b,c,d))return!1;return!0}:a[0]}function p(a,c,d){for(var e=0,f=c.length;f>e;e++)b(a,c[e],d);return d}function q(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function r(a,b,c,e,f,g){return e&&!e[N]&&(e=r(e)),f&&!f[N]&&(f=r(f,g)),d(function(d,g,h,i){var j,k,l,m=[],n=[],o=g.length,r=d||p(b||"*",h.nodeType?[h]:h,[]),s=!a||!d&&b?r:q(r,m,a,h,i),t=c?f||(d?a:o||e)?[]:g:s;if(c&&c(s,t,h,i),e)for(j=q(t,n),e(j,[],h,i),k=j.length;k--;)(l=j[k])&&(t[n[k]]=!(s[n[k]]=l));if(d){if(f||a){if(f){for(j=[],k=t.length;k--;)(l=t[k])&&j.push(s[k]=l);f(null,t=[],j,i)}for(k=t.length;k--;)(l=t[k])&&(j=f?ba.call(d,l):m[k])>-1&&(d[j]=!(g[j]=l))}}else t=q(t===g?t.splice(o,t.length):t),f?f(null,g,t,i):_.apply(g,t)})}function s(a){for(var b,c,d,e=a.length,f=w.relative[a[0].type],g=f||w.relative[" "],h=f?1:0,i=n(function(a){return a===b},g,!0),j=n(function(a){return ba.call(b,a)>-1},g,!0),k=[function(a,c,d){return!f&&(d||c!==C)||((b=c).nodeType?i(a,c,d):j(a,c,d))
  }];e>h;h++)if(c=w.relative[a[h].type])k=[n(o(k),c)];else{if(c=w.filter[a[h].type].apply(null,a[h].matches),c[N]){for(d=++h;e>d&&!w.relative[a[d].type];d++);return r(h>1&&o(k),h>1&&m(a.slice(0,h-1).concat({value:" "===a[h-2].type?"*":""})).replace(ia,"$1"),c,d>h&&s(a.slice(h,d)),e>d&&s(a=a.slice(d)),e>d&&m(a))}k.push(c)}return o(k)}function t(a,c){var e=c.length>0,f=a.length>0,g=function(d,g,h,i,j){var k,l,m,n=0,o="0",p=d&&[],r=[],s=C,t=d||f&&w.find.TAG("*",j),u=P+=null==s?1:Math.random()||.1,v=t.length;for(j&&(C=g!==G&&g);o!==v&&null!=(k=t[o]);o++){if(f&&k){for(l=0;m=a[l++];)if(m(k,g,h)){i.push(k);break}j&&(P=u)}e&&((k=!m&&k)&&n--,d&&p.push(k))}if(n+=o,e&&o!==n){for(l=0;m=c[l++];)m(p,r,g,h);if(d){if(n>0)for(;o--;)p[o]||r[o]||(r[o]=Z.call(i));r=q(r)}_.apply(i,r),j&&!d&&r.length>0&&n+c.length>1&&b.uniqueSort(i)}return j&&(P=u,C=s),p};return e?d(g):g}var u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N="sizzle"+-new Date,O=a.document,P=0,Q=0,R=c(),S=c(),T=c(),U=function(a,b){return a===b&&(E=!0),0},V="undefined",W=1<<31,X={}.hasOwnProperty,Y=[],Z=Y.pop,$=Y.push,_=Y.push,aa=Y.slice,ba=Y.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},ca="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",da="[\\x20\\t\\r\\n\\f]",ea="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",fa=ea.replace("w","w#"),ga="\\["+da+"*("+ea+")(?:"+da+"*([*^$|!~]?=)"+da+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+fa+"))|)"+da+"*\\]",ha=":("+ea+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ga+")*)|.*)\\)|)",ia=new RegExp("^"+da+"+|((?:^|[^\\\\])(?:\\\\.)*)"+da+"+$","g"),ja=new RegExp("^"+da+"*,"+da+"*"),ka=new RegExp("^"+da+"*([>+~]|"+da+")"+da+"*"),la=new RegExp("="+da+"*([^\\]'\"]*?)"+da+"*\\]","g"),ma=new RegExp(ha),na=new RegExp("^"+fa+"$"),oa={ID:new RegExp("^#("+ea+")"),CLASS:new RegExp("^\\.("+ea+")"),TAG:new RegExp("^("+ea.replace("w","w*")+")"),ATTR:new RegExp("^"+ga),PSEUDO:new RegExp("^"+ha),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+da+"*(even|odd|(([+-]|)(\\d*)n|)"+da+"*(?:([+-]|)"+da+"*(\\d+)|))"+da+"*\\)|)","i"),bool:new RegExp("^(?:"+ca+")$","i"),needsContext:new RegExp("^"+da+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+da+"*((?:-\\d)?\\d*)"+da+"*\\)|)(?=[^-]|$)","i")},pa=/^(?:input|select|textarea|button)$/i,qa=/^h\d$/i,ra=/^[^{]+\{\s*\[native \w/,sa=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ta=/[+~]/,ua=/'|\\/g,va=new RegExp("\\\\([\\da-f]{1,6}"+da+"?|("+da+")|.)","ig"),wa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{_.apply(Y=aa.call(O.childNodes),O.childNodes),Y[O.childNodes.length].nodeType}catch(a){_={apply:Y.length?function(a,b){$.apply(a,aa.call(b))}:function(a,b){for(var c=a.length,d=0;a[c++]=b[d++];);a.length=c-1}}}v=b.support={},y=b.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},F=b.setDocument=function(a){var b,c=a?a.ownerDocument||a:O,d=c.defaultView;return c!==G&&9===c.nodeType&&c.documentElement?(G=c,H=c.documentElement,I=!y(c),d&&d!==d.top&&(d.addEventListener?d.addEventListener("unload",function(){F()},!1):d.attachEvent&&d.attachEvent("onunload",function(){F()})),v.attributes=e(function(a){return a.className="i",!a.getAttribute("className")}),v.getElementsByTagName=e(function(a){return a.appendChild(c.createComment("")),!a.getElementsByTagName("*").length}),v.getElementsByClassName=ra.test(c.getElementsByClassName)&&e(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),v.getById=e(function(a){return H.appendChild(a).id=N,!c.getElementsByName||!c.getElementsByName(N).length}),v.getById?(w.find.ID=function(a,b){if(typeof b.getElementById!==V&&I){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},w.filter.ID=function(a){var b=a.replace(va,wa);return function(a){return a.getAttribute("id")===b}}):(delete w.find.ID,w.filter.ID=function(a){var b=a.replace(va,wa);return function(a){var c=typeof a.getAttributeNode!==V&&a.getAttributeNode("id");return c&&c.value===b}}),w.find.TAG=v.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==V?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){for(;c=f[e++];)1===c.nodeType&&d.push(c);return d}return f},w.find.CLASS=v.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==V&&I?b.getElementsByClassName(a):void 0},K=[],J=[],(v.qsa=ra.test(c.querySelectorAll))&&(e(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&J.push("[*^$]="+da+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||J.push("\\["+da+"*(?:value|"+ca+")"),a.querySelectorAll(":checked").length||J.push(":checked")}),e(function(a){var b=c.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&J.push("name"+da+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||J.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),J.push(",.*:")})),(v.matchesSelector=ra.test(L=H.matches||H.webkitMatchesSelector||H.mozMatchesSelector||H.oMatchesSelector||H.msMatchesSelector))&&e(function(a){v.disconnectedMatch=L.call(a,"div"),L.call(a,"[s!='']:x"),K.push("!=",ha)}),J=J.length&&new RegExp(J.join("|")),K=K.length&&new RegExp(K.join("|")),b=ra.test(H.compareDocumentPosition),M=b||ra.test(H.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},U=b?function(a,b){if(a===b)return E=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d||(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!v.sortDetached&&b.compareDocumentPosition(a)===d?a===c||a.ownerDocument===O&&M(O,a)?-1:b===c||b.ownerDocument===O&&M(O,b)?1:D?ba.call(D,a)-ba.call(D,b):0:4&d?-1:1)}:function(a,b){if(a===b)return E=!0,0;var d,e=0,f=a.parentNode,h=b.parentNode,i=[a],j=[b];if(!f||!h)return a===c?-1:b===c?1:f?-1:h?1:D?ba.call(D,a)-ba.call(D,b):0;if(f===h)return g(a,b);for(d=a;d=d.parentNode;)i.unshift(d);for(d=b;d=d.parentNode;)j.unshift(d);for(;i[e]===j[e];)e++;return e?g(i[e],j[e]):i[e]===O?-1:j[e]===O?1:0},c):G},b.matches=function(a,c){return b(a,null,null,c)},b.matchesSelector=function(a,c){if((a.ownerDocument||a)!==G&&F(a),c=c.replace(la,"='$1']"),!(!v.matchesSelector||!I||K&&K.test(c)||J&&J.test(c)))try{var d=L.call(a,c);if(d||v.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(a){}return b(c,G,null,[a]).length>0},b.contains=function(a,b){return(a.ownerDocument||a)!==G&&F(a),M(a,b)},b.attr=function(a,b){(a.ownerDocument||a)!==G&&F(a);var c=w.attrHandle[b.toLowerCase()],d=c&&X.call(w.attrHandle,b.toLowerCase())?c(a,b,!I):void 0;return void 0!==d?d:v.attributes||!I?a.getAttribute(b):(d=a.getAttributeNode(b))&&d.specified?d.value:null},b.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},b.uniqueSort=function(a){var b,c=[],d=0,e=0;if(E=!v.detectDuplicates,D=!v.sortStable&&a.slice(0),a.sort(U),E){for(;b=a[e++];)b===a[e]&&(d=c.push(e));for(;d--;)a.splice(c[d],1)}return D=null,a},x=b.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(1===e||9===e||11===e){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=x(a)}else if(3===e||4===e)return a.nodeValue}else for(;b=a[d++];)c+=x(b);return c},w=b.selectors={cacheLength:50,createPseudo:d,match:oa,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(va,wa),a[3]=(a[3]||a[4]||a[5]||"").replace(va,wa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||b.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&b.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return oa.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&ma.test(c)&&(b=z(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(va,wa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=R[a+" "];return b||(b=new RegExp("(^|"+da+")"+a+"("+da+"|$)"))&&R(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==V&&a.getAttribute("class")||"")})},ATTR:function(a,c,d){return function(e){var f=b.attr(e,a);return null==f?"!="===c:!c||(f+="","="===c?f===d:"!="===c?f!==d:"^="===c?d&&0===f.indexOf(d):"*="===c?d&&f.indexOf(d)>-1:"$="===c?d&&f.slice(-d.length)===d:"~="===c?(" "+f+" ").indexOf(d)>-1:"|="===c&&(f===d||f.slice(0,d.length+1)===d+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){for(;p;){for(l=b;l=l[p];)if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){for(k=q[N]||(q[N]={}),j=k[a]||[],n=j[0]===P&&j[1],m=j[0]===P&&j[2],l=n&&q.childNodes[n];l=++n&&l&&l[p]||(m=n=0)||o.pop();)if(1===l.nodeType&&++m&&l===b){k[a]=[P,n,m];break}}else if(s&&(j=(b[N]||(b[N]={}))[a])&&j[0]===P)m=j[1];else for(;(l=++n&&l&&l[p]||(m=n=0)||o.pop())&&((h?l.nodeName.toLowerCase()!==r:1!==l.nodeType)||!++m||(s&&((l[N]||(l[N]={}))[a]=[P,m]),l!==b)););return(m-=e)===d||m%d==0&&m/d>=0}}},PSEUDO:function(a,c){var e,f=w.pseudos[a]||w.setFilters[a.toLowerCase()]||b.error("unsupported pseudo: "+a);return f[N]?f(c):f.length>1?(e=[a,a,"",c],w.setFilters.hasOwnProperty(a.toLowerCase())?d(function(a,b){for(var d,e=f(a,c),g=e.length;g--;)d=ba.call(a,e[g]),a[d]=!(b[d]=e[g])}):function(a){return f(a,0,e)}):f}},pseudos:{not:d(function(a){var b=[],c=[],e=A(a.replace(ia,"$1"));return e[N]?d(function(a,b,c,d){for(var f,g=e(a,null,d,[]),h=a.length;h--;)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,d,f){return b[0]=a,e(b,null,f,c),!c.pop()}}),has:d(function(a){return function(c){return b(a,c).length>0}}),contains:d(function(a){return function(b){return(b.textContent||b.innerText||x(b)).indexOf(a)>-1}}),lang:d(function(a){return na.test(a||"")||b.error("unsupported lang: "+a),a=a.replace(va,wa).toLowerCase(),function(b){var c;do{if(c=I?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return(c=c.toLowerCase())===a||0===c.indexOf(a+"-")}while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===H},focus:function(a){return a===G.activeElement&&(!G.hasFocus||G.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return!1===a.disabled},disabled:function(a){return!0===a.disabled},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,!0===a.selected},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!w.pseudos.empty(a)},header:function(a){return qa.test(a.nodeName)},input:function(a){return pa.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:j(function(){return[0]}),last:j(function(a,b){return[b-1]}),eq:j(function(a,b,c){return[0>c?c+b:c]}),even:j(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:j(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:j(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:j(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},w.pseudos.nth=w.pseudos.eq;for(u in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})w.pseudos[u]=h(u);for(u in{submit:!0,reset:!0})w.pseudos[u]=i(u);return l.prototype=w.filters=w.pseudos,w.setFilters=new l,z=b.tokenize=function(a,c){var d,e,f,g,h,i,j,k=S[a+" "];if(k)return c?0:k.slice(0);for(h=a,i=[],j=w.preFilter;h;){(!d||(e=ja.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),d=!1,(e=ka.exec(h))&&(d=e.shift(),f.push({value:d,type:e[0].replace(ia," ")}),h=h.slice(d.length));for(g in w.filter)!(e=oa[g].exec(h))||j[g]&&!(e=j[g](e))||(d=e.shift(),f.push({value:d,type:g,matches:e}),h=h.slice(d.length));if(!d)break}return c?h.length:h?b.error(a):S(a,i).slice(0)},A=b.compile=function(a,b){var c,d=[],e=[],f=T[a+" "];if(!f){for(b||(b=z(a)),c=b.length;c--;)f=s(b[c]),f[N]?d.push(f):e.push(f);f=T(a,t(e,d)),f.selector=a}return f},B=b.select=function(a,b,c,d){var e,f,g,h,i,j="function"==typeof a&&a,l=!d&&z(a=j.selector||a);if(c=c||[],1===l.length){if(f=l[0]=l[0].slice(0),f.length>2&&"ID"===(g=f[0]).type&&v.getById&&9===b.nodeType&&I&&w.relative[f[1].type]){if(!(b=(w.find.ID(g.matches[0].replace(va,wa),b)||[])[0]))return c;j&&(b=b.parentNode),a=a.slice(f.shift().value.length)}for(e=oa.needsContext.test(a)?0:f.length;e--&&(g=f[e],!w.relative[h=g.type]);)if((i=w.find[h])&&(d=i(g.matches[0].replace(va,wa),ta.test(f[0].type)&&k(b.parentNode)||b))){if(f.splice(e,1),!(a=d.length&&m(f)))return _.apply(c,d),c;break}}return(j||A(a,l))(d,b,!I,c,ta.test(a)&&k(b.parentNode)||b),c},v.sortStable=N.split("").sort(U).join("")===N,v.detectDuplicates=!!E,F(),v.sortDetached=e(function(a){return 1&a.compareDocumentPosition(G.createElement("div"))}),e(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||f("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),v.attributes&&e(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||f("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),e(function(a){return null==a.getAttribute("disabled")})||f(ca,function(a,b,c){var d;return c?void 0:!0===a[b]?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),b}(a);_.find=ea,_.expr=ea.selectors,_.expr[":"]=_.expr.pseudos,_.unique=ea.uniqueSort,_.text=ea.getText,_.isXMLDoc=ea.isXML,_.contains=ea.contains;var fa=_.expr.match.needsContext,ga=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,ha=/^.[^:#\[\.,]*$/;_.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?_.find.matchesSelector(d,a)?[d]:[]:_.find.matches(a,_.grep(b,function(a){return 1===a.nodeType}))},_.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(_(a).filter(function(){for(b=0;c>b;b++)if(_.contains(e[b],this))return!0}));for(b=0;c>b;b++)_.find(a,e[b],d);return d=this.pushStack(c>1?_.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(d(this,a||[],!1))},not:function(a){return this.pushStack(d(this,a||[],!0))},is:function(a){return!!d(this,"string"==typeof a&&fa.test(a)?_(a):a||[],!1).length}});var ia,ja=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(_.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(!(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:ja.exec(a))||!c[1]&&b)return!b||b.jquery?(b||ia).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof _?b[0]:b,_.merge(this,_.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:Z,!0)),ga.test(c[1])&&_.isPlainObject(b))for(c in b)_.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=Z.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=Z,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):_.isFunction(a)?void 0!==ia.ready?ia.ready(a):a(_):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),_.makeArray(a,this))}).prototype=_.fn,ia=_(Z);var ka=/^(?:parents|prev(?:Until|All))/,la={children:!0,contents:!0,next:!0,prev:!0};_.extend({dir:function(a,b,c){for(var d=[],e=void 0!==c;(a=a[b])&&9!==a.nodeType;)if(1===a.nodeType){if(e&&_(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),_.fn.extend({has:function(a){var b=_(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(_.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=fa.test(a)||"string"!=typeof a?_(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&_.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?_.unique(f):f)},index:function(a){return a?"string"==typeof a?U.call(_(a),this[0]):U.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(_.unique(_.merge(this.get(),_(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}}),_.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return _.dir(a,"parentNode")},parentsUntil:function(a,b,c){return _.dir(a,"parentNode",c)},next:function(a){return e(a,"nextSibling")},prev:function(a){return e(a,"previousSibling")},nextAll:function(a){return _.dir(a,"nextSibling")},prevAll:function(a){return _.dir(a,"previousSibling")},nextUntil:function(a,b,c){return _.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return _.dir(a,"previousSibling",c)},siblings:function(a){return _.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return _.sibling(a.firstChild)},contents:function(a){return a.contentDocument||_.merge([],a.childNodes)}},function(a,b){_.fn[a]=function(c,d){var e=_.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=_.filter(d,e)),this.length>1&&(la[a]||_.unique(e),ka.test(a)&&e.reverse()),this.pushStack(e)}});var ma=/\S+/g,na={};_.Callbacks=function(a){a="string"==typeof a?na[a]||f(a):_.extend({},a);var b,c,d,e,g,h,i=[],j=!a.once&&[],k=function(f){for(b=a.memory&&f,c=!0,h=e||0,e=0,g=i.length,d=!0;i&&g>h;h++)if(!1===i[h].apply(f[0],f[1])&&a.stopOnFalse){b=!1;break}d=!1,i&&(j?j.length&&k(j.shift()):b?i=[]:l.disable())},l={add:function(){if(i){var c=i.length;!function b(c){_.each(c,function(c,d){var e=_.type(d);"function"===e?a.unique&&l.has(d)||i.push(d):d&&d.length&&"string"!==e&&b(d)})}(arguments),d?g=i.length:b&&(e=c,k(b))}return this},remove:function(){return i&&_.each(arguments,function(a,b){for(var c;(c=_.inArray(b,i,c))>-1;)i.splice(c,1),d&&(g>=c&&g--,h>=c&&h--)}),this},has:function(a){return a?_.inArray(a,i)>-1:!(!i||!i.length)},empty:function(){return i=[],g=0,this},disable:function(){return i=j=b=void 0,this},disabled:function(){return!i},lock:function(){return j=void 0,b||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return!i||c&&!j||(b=b||[],b=[a,b.slice?b.slice():b],d?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!c}};return l},_.extend({Deferred:function(a){var b=[["resolve","done",_.Callbacks("once memory"),"resolved"],["reject","fail",_.Callbacks("once memory"),"rejected"],["notify","progress",_.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return _.Deferred(function(c){_.each(b,function(b,f){var g=_.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&_.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?_.extend(a,d):d}},e={};return d.pipe=d.then,_.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b,c,d,e=0,f=R.call(arguments),g=f.length,h=1!==g||a&&_.isFunction(a.promise)?g:0,i=1===h?a:_.Deferred(),j=function(a,c,d){return function(e){c[a]=this,d[a]=arguments.length>1?R.call(arguments):e,d===b?i.notifyWith(c,d):--h||i.resolveWith(c,d)}};if(g>1)for(b=new Array(g),c=new Array(g),d=new Array(g);g>e;e++)f[e]&&_.isFunction(f[e].promise)?f[e].promise().done(j(e,d,f)).fail(i.reject).progress(j(e,c,b)):--h;return h||i.resolveWith(d,f),i.promise()}});var oa;_.fn.ready=function(a){return _.ready.promise().done(a),this},_.extend({isReady:!1,readyWait:1,holdReady:function(a){a?_.readyWait++:_.ready(!0)},ready:function(a){(!0===a?--_.readyWait:_.isReady)||(_.isReady=!0,!0!==a&&--_.readyWait>0||(oa.resolveWith(Z,[_]),_.fn.triggerHandler&&(_(Z).triggerHandler("ready"),_(Z).off("ready"))))}}),_.ready.promise=function(b){return oa||(oa=_.Deferred(),"complete"===Z.readyState?setTimeout(_.ready):(Z.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1))),oa.promise(b)},_.ready.promise();var pa=_.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===_.type(c)){e=!0;for(h in c)_.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,_.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(_(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};_.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType},h.uid=1,h.accepts=_.acceptData,h.prototype={key:function(a){if(!h.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=h.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,_.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(_.isEmptyObject(f))_.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,_.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{_.isArray(b)?d=b.concat(b.map(_.camelCase)):(e=_.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(ma)||[])),c=d.length;for(;c--;)delete g[d[c]]}},hasData:function(a){return!_.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var qa=new h,ra=new h,sa=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ta=/([A-Z])/g;_.extend({hasData:function(a){return ra.hasData(a)||qa.hasData(a)},data:function(a,b,c){return ra.access(a,b,c)},removeData:function(a,b){ra.remove(a,b)},_data:function(a,b,c){return qa.access(a,b,c)},_removeData:function(a,b){qa.remove(a,b)}}),_.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=ra.get(f),1===f.nodeType&&!qa.get(f,"hasDataAttrs"))){for(c=g.length;c--;)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=_.camelCase(d.slice(5)),i(f,d,e[d])));qa.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){ra.set(this,a)}):pa(this,function(b){var c,d=_.camelCase(a);if(f&&void 0===b){if(void 0!==(c=ra.get(f,a)))return c;if(void 0!==(c=ra.get(f,d)))return c;if(void 0!==(c=i(f,d,void 0)))return c}else this.each(function(){var c=ra.get(this,d);ra.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&ra.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){ra.remove(this,a)})}}),_.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=qa.get(a,b),c&&(!d||_.isArray(c)?d=qa.access(a,b,_.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=_.queue(a,b),d=c.length,e=c.shift(),f=_._queueHooks(a,b),g=function(){_.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return qa.get(a,c)||qa.access(a,c,{empty:_.Callbacks("once memory").add(function(){qa.remove(a,[b+"queue",c])})})}}),_.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?_.queue(this[0],a):void 0===b?this:this.each(function(){var c=_.queue(this,a,b);_._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&_.dequeue(this,a)})},dequeue:function(a){return this.each(function(){_.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=_.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};for("string"!=typeof a&&(b=a,a=void 0),a=a||"fx";g--;)(c=qa.get(f[g],a+"queueHooks"))&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var ua=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,va=["Top","Right","Bottom","Left"],wa=function(a,b){return a=b||a,"none"===_.css(a,"display")||!_.contains(a.ownerDocument,a)},xa=/^(?:checkbox|radio)$/i;!function(){var a=Z.createDocumentFragment(),b=a.appendChild(Z.createElement("div")),c=Z.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),Y.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",Y.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var ya="undefined";Y.focusinBubbles="onfocusin"in a;var za=/^key/,Aa=/^(?:mouse|pointer|contextmenu)|click/,Ba=/^(?:focusinfocus|focusoutblur)$/,Ca=/^([^.]*)(?:\.(.+)|)$/;_.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=qa.get(a);if(q)for(c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=_.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return typeof _!==ya&&_.event.triggered!==b.type?_.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(ma)||[""],j=b.length;j--;)h=Ca.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=_.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=_.event.special[n]||{},k=_.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&_.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&!1!==l.setup.call(a,d,o,g)||a.addEventListener&&a.addEventListener(n,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),_.event.global[n]=!0)},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=qa.hasData(a)&&qa.get(a);if(q&&(i=q.events)){for(b=(b||"").match(ma)||[""],j=b.length;j--;)if(h=Ca.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){for(l=_.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;f--;)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&!1!==l.teardown.call(a,o,q.handle)||_.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)_.event.remove(a,n+b[j],c,d,!0);_.isEmptyObject(i)&&(delete q.handle,qa.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,j,k,l,m=[d||Z],n=X.call(b,"type")?b.type:b,o=X.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||Z,3!==d.nodeType&&8!==d.nodeType&&!Ba.test(n+_.event.triggered)&&(n.indexOf(".")>=0&&(o=n.split("."),n=o.shift(),o.sort()),j=n.indexOf(":")<0&&"on"+n,b=b[_.expando]?b:new _.Event(n,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=o.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:_.makeArray(c,[b]),l=_.event.special[n]||{},e||!l.trigger||!1!==l.trigger.apply(d,c))){if(!e&&!l.noBubble&&!_.isWindow(d)){for(i=l.delegateType||n,Ba.test(i+n)||(g=g.parentNode);g;g=g.parentNode)m.push(g),h=g;h===(d.ownerDocument||Z)&&m.push(h.defaultView||h.parentWindow||a)}for(f=0;(g=m[f++])&&!b.isPropagationStopped();)b.type=f>1?i:l.bindType||n,k=(qa.get(g,"events")||{})[b.type]&&qa.get(g,"handle"),k&&k.apply(g,c),(k=j&&g[j])&&k.apply&&_.acceptData(g)&&(b.result=k.apply(g,c),!1===b.result&&b.preventDefault());return b.type=n,e||b.isDefaultPrevented()||l._default&&!1!==l._default.apply(m.pop(),c)||!_.acceptData(d)||j&&_.isFunction(d[n])&&!_.isWindow(d)&&(h=d[j],h&&(d[j]=null),_.event.triggered=n,d[n](),_.event.triggered=void 0,h&&(d[j]=h)),b.result}},dispatch:function(a){a=_.event.fix(a);var b,c,d,e,f,g=[],h=R.call(arguments),i=(qa.get(this,"events")||{})[a.type]||[],j=_.event.special[a.type]||{};if(h[0]=a,a.delegateTarget=this,!j.preDispatch||!1!==j.preDispatch.call(this,a)){for(g=_.event.handlers.call(this,a,i),b=0;(e=g[b++])&&!a.isPropagationStopped();)for(a.currentTarget=e.elem,c=0;(f=e.handlers[c++])&&!a.isImmediatePropagationStopped();)(!a.namespace_re||a.namespace_re.test(f.namespace))&&(a.handleObj=f,a.data=f.data,void 0!==(d=((_.event.special[f.origType]||{}).handle||f.handler).apply(e.elem,h))&&!1===(a.result=d)&&(a.preventDefault(),a.stopPropagation()));return j.postDispatch&&j.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(!0!==i.disabled||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?_(e,this).index(i)>=0:_.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||Z,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[_.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];for(g||(this.fixHooks[e]=g=Aa.test(e)?this.mouseHooks:za.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new _.Event(f),b=d.length;b--;)c=d[b],a[c]=f[c];return a.target||(a.target=Z),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==l()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===l()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&_.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return _.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){
  void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=_.extend(new _.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?_.event.trigger(e,null,b):_.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},_.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},_.Event=function(a,b){return this instanceof _.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&!1===a.returnValue?j:k):this.type=a,b&&_.extend(this,b),this.timeStamp=a&&a.timeStamp||_.now(),void(this[_.expando]=!0)):new _.Event(a,b)},_.Event.prototype={isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=j,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=j,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=j,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},_.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){_.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!_.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),Y.focusinBubbles||_.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){_.event.simulate(b,a.target,_.event.fix(a),!0)};_.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=qa.access(d,b);e||d.addEventListener(a,c,!0),qa.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=qa.access(d,b)-1;e?qa.access(d,b,e):(d.removeEventListener(a,c,!0),qa.remove(d,b))}}}),_.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),!1===d)d=k;else if(!d)return this;return 1===e&&(f=d,d=function(a){return _().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=_.guid++)),this.each(function(){_.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,_(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(!1===b||"function"==typeof b)&&(c=b,b=void 0),!1===c&&(c=k),this.each(function(){_.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){_.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?_.event.trigger(a,b,c,!0):void 0}});var Da=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Ea=/<([\w:]+)/,Fa=/<|&#?\w+;/,Ga=/<(?:script|style|link)/i,Ha=/checked\s*(?:[^=]|=\s*.checked.)/i,Ia=/^$|\/(?:java|ecma)script/i,Ja=/^true\/(.*)/,Ka=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,La={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};La.optgroup=La.option,La.tbody=La.tfoot=La.colgroup=La.caption=La.thead,La.th=La.td,_.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=_.contains(a.ownerDocument,a);if(!(Y.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||_.isXMLDoc(a)))for(g=r(h),f=r(a),d=0,e=f.length;e>d;d++)s(f[d],g[d]);if(b)if(c)for(f=f||r(a),g=g||r(h),d=0,e=f.length;e>d;d++)q(f[d],g[d]);else q(a,h);return g=r(h,"script"),g.length>0&&p(g,!i&&r(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,n=a.length;n>m;m++)if((e=a[m])||0===e)if("object"===_.type(e))_.merge(l,e.nodeType?[e]:e);else if(Fa.test(e)){for(f=f||k.appendChild(b.createElement("div")),g=(Ea.exec(e)||["",""])[1].toLowerCase(),h=La[g]||La._default,f.innerHTML=h[1]+e.replace(Da,"<$1></$2>")+h[2],j=h[0];j--;)f=f.lastChild;_.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));for(k.textContent="",m=0;e=l[m++];)if((!d||-1===_.inArray(e,d))&&(i=_.contains(e.ownerDocument,e),f=r(k.appendChild(e),"script"),i&&p(f),c))for(j=0;e=f[j++];)Ia.test(e.type||"")&&c.push(e);return k},cleanData:function(a){for(var b,c,d,e,f=_.event.special,g=0;void 0!==(c=a[g]);g++){if(_.acceptData(c)&&(e=c[qa.expando])&&(b=qa.cache[e])){if(b.events)for(d in b.events)f[d]?_.event.remove(c,d):_.removeEvent(c,d,b.handle);qa.cache[e]&&delete qa.cache[e]}delete ra.cache[c[ra.expando]]}}}),_.fn.extend({text:function(a){return pa(this,function(a){return void 0===a?_.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){m(this,a).appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=m(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?_.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||_.cleanData(r(c)),c.parentNode&&(b&&_.contains(c.ownerDocument,c)&&p(r(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(_.cleanData(r(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return _.clone(this,a,b)})},html:function(a){return pa(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!Ga.test(a)&&!La[(Ea.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Da,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(_.cleanData(r(b,!1)),b.innerHTML=a);b=0}catch(a){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,_.cleanData(r(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=S.apply([],a);var c,d,e,f,g,h,i=0,j=this.length,k=this,l=j-1,m=a[0],p=_.isFunction(m);if(p||j>1&&"string"==typeof m&&!Y.checkClone&&Ha.test(m))return this.each(function(c){var d=k.eq(c);p&&(a[0]=m.call(this,c,d.html())),d.domManip(a,b)});if(j&&(c=_.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(e=_.map(r(c,"script"),n),f=e.length;j>i;i++)g=c,i!==l&&(g=_.clone(g,!0,!0),f&&_.merge(e,r(g,"script"))),b.call(this[i],g,i);if(f)for(h=e[e.length-1].ownerDocument,_.map(e,o),i=0;f>i;i++)g=e[i],Ia.test(g.type||"")&&!qa.access(g,"globalEval")&&_.contains(h,g)&&(g.src?_._evalUrl&&_._evalUrl(g.src):_.globalEval(g.textContent.replace(Ka,"")))}return this}}),_.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){_.fn[a]=function(a){for(var c,d=[],e=_(a),f=e.length-1,g=0;f>=g;g++)c=g===f?this:this.clone(!0),_(e[g])[b](c),T.apply(d,c.get());return this.pushStack(d)}});var Ma,Na={},Oa=/^margin/,Pa=new RegExp("^("+ua+")(?!px)[a-z%]+$","i"),Qa=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)};!function(){function b(){g.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",g.innerHTML="",e.appendChild(f);var b=a.getComputedStyle(g,null);c="1%"!==b.top,d="4px"===b.width,e.removeChild(f)}var c,d,e=Z.documentElement,f=Z.createElement("div"),g=Z.createElement("div");g.style&&(g.style.backgroundClip="content-box",g.cloneNode(!0).style.backgroundClip="",Y.clearCloneStyle="content-box"===g.style.backgroundClip,f.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",f.appendChild(g),a.getComputedStyle&&_.extend(Y,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return null==d&&b(),d},reliableMarginRight:function(){var b,c=g.appendChild(Z.createElement("div"));return c.style.cssText=g.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",g.style.width="1px",e.appendChild(f),b=!parseFloat(a.getComputedStyle(c,null).marginRight),e.removeChild(f),b}}))}(),_.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Ra=/^(none|table(?!-c[ea]).+)/,Sa=new RegExp("^("+ua+")(.*)$","i"),Ta=new RegExp("^([+-])=("+ua+")","i"),Ua={position:"absolute",visibility:"hidden",display:"block"},Va={letterSpacing:"0",fontWeight:"400"},Wa=["Webkit","O","Moz","ms"];_.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=v(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=_.camelCase(b),i=a.style;return b=_.cssProps[h]||(_.cssProps[h]=x(i,h)),g=_.cssHooks[b]||_.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Ta.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(_.css(a,b)),f="number"),void(null!=c&&c===c&&("number"!==f||_.cssNumber[h]||(c+="px"),Y.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c))))}},css:function(a,b,c,d){var e,f,g,h=_.camelCase(b);return b=_.cssProps[h]||(_.cssProps[h]=x(a.style,h)),g=_.cssHooks[b]||_.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=v(a,b,d)),"normal"===e&&b in Va&&(e=Va[b]),""===c||c?(f=parseFloat(e),!0===c||_.isNumeric(f)?f||0:e):e}}),_.each(["height","width"],function(a,b){_.cssHooks[b]={get:function(a,c,d){return c?Ra.test(_.css(a,"display"))&&0===a.offsetWidth?_.swap(a,Ua,function(){return A(a,b,d)}):A(a,b,d):void 0},set:function(a,c,d){var e=d&&Qa(a);return y(a,c,d?z(a,b,d,"border-box"===_.css(a,"boxSizing",!1,e),e):0)}}}),_.cssHooks.marginRight=w(Y.reliableMarginRight,function(a,b){return b?_.swap(a,{display:"inline-block"},v,[a,"marginRight"]):void 0}),_.each({margin:"",padding:"",border:"Width"},function(a,b){_.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+va[d]+b]=f[d]||f[d-2]||f[0];return e}},Oa.test(a)||(_.cssHooks[a+b].set=y)}),_.fn.extend({css:function(a,b){return pa(this,function(a,b,c){var d,e,f={},g=0;if(_.isArray(b)){for(d=Qa(a),e=b.length;e>g;g++)f[b[g]]=_.css(a,b[g],!1,d);return f}return void 0!==c?_.style(a,b,c):_.css(a,b)},a,b,arguments.length>1)},show:function(){return B(this,!0)},hide:function(){return B(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){wa(this)?_(this).show():_(this).hide()})}}),_.Tween=C,C.prototype={constructor:C,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(_.cssNumber[c]?"":"px")},cur:function(){var a=C.propHooks[this.prop];return a&&a.get?a.get(this):C.propHooks._default.get(this)},run:function(a){var b,c=C.propHooks[this.prop];return this.pos=b=this.options.duration?_.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):C.propHooks._default.set(this),this}},C.prototype.init.prototype=C.prototype,C.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=_.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){_.fx.step[a.prop]?_.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[_.cssProps[a.prop]]||_.cssHooks[a.prop])?_.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},C.propHooks.scrollTop=C.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},_.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},_.fx=C.prototype.init,_.fx.step={};var Xa,Ya,Za=/^(?:toggle|show|hide)$/,$a=new RegExp("^(?:([+-])=|)("+ua+")([a-z%]*)$","i"),_a=/queueHooks$/,ab=[G],bb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=$a.exec(b),f=e&&e[3]||(_.cssNumber[a]?"":"px"),g=(_.cssNumber[a]||"px"!==f&&+d)&&$a.exec(_.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do{h=h||".5",g/=h,_.style(c.elem,a,g+f)}while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};_.Animation=_.extend(I,{tweener:function(a,b){_.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],bb[c]=bb[c]||[],bb[c].unshift(b)},prefilter:function(a,b){b?ab.unshift(a):ab.push(a)}}),_.speed=function(a,b,c){var d=a&&"object"==typeof a?_.extend({},a):{complete:c||!c&&b||_.isFunction(a)&&a,duration:a,easing:c&&b||b&&!_.isFunction(b)&&b};return d.duration=_.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in _.fx.speeds?_.fx.speeds[d.duration]:_.fx.speeds._default,(null==d.queue||!0===d.queue)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){_.isFunction(d.old)&&d.old.call(this),d.queue&&_.dequeue(this,d.queue)},d},_.fn.extend({fadeTo:function(a,b,c,d){return this.filter(wa).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=_.isEmptyObject(a),f=_.speed(b,c,d),g=function(){var b=I(this,_.extend({},a),f);(e||qa.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||!1===f.queue?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&!1!==a&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=_.timers,g=qa.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&_a.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&_.dequeue(this,a)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var b,c=qa.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=_.timers,g=d?d.length:0;for(c.finish=!0,_.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),_.each(["toggle","show","hide"],function(a,b){var c=_.fn[b];_.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(E(b,!0),a,d,e)}}),_.each({slideDown:E("show"),slideUp:E("hide"),slideToggle:E("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){_.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),_.timers=[],_.fx.tick=function(){var a,b=0,c=_.timers;for(Xa=_.now();b<c.length;b++)(a=c[b])()||c[b]!==a||c.splice(b--,1);c.length||_.fx.stop(),Xa=void 0},_.fx.timer=function(a){_.timers.push(a),a()?_.fx.start():_.timers.pop()},_.fx.interval=13,_.fx.start=function(){Ya||(Ya=setInterval(_.fx.tick,_.fx.interval))},_.fx.stop=function(){clearInterval(Ya),Ya=null},_.fx.speeds={slow:600,fast:200,_default:400},_.fn.delay=function(a,b){return a=_.fx?_.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=Z.createElement("input"),b=Z.createElement("select"),c=b.appendChild(Z.createElement("option"));a.type="checkbox",Y.checkOn=""!==a.value,Y.optSelected=c.selected,b.disabled=!0,Y.optDisabled=!c.disabled,a=Z.createElement("input"),a.value="t",a.type="radio",Y.radioValue="t"===a.value}();var cb,db,eb=_.expr.attrHandle;_.fn.extend({attr:function(a,b){return pa(this,_.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){_.removeAttr(this,a)})}}),_.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===ya?_.prop(a,b,c):(1===f&&_.isXMLDoc(a)||(b=b.toLowerCase(),d=_.attrHooks[b]||(_.expr.match.bool.test(b)?db:cb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=_.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void _.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(ma);if(f&&1===a.nodeType)for(;c=f[e++];)d=_.propFix[c]||c,_.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!Y.radioValue&&"radio"===b&&_.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),db={set:function(a,b,c){return!1===b?_.removeAttr(a,c):a.setAttribute(c,c),c}},_.each(_.expr.match.bool.source.match(/\w+/g),function(a,b){var c=eb[b]||_.find.attr;eb[b]=function(a,b,d){var e,f;return d||(f=eb[b],eb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,eb[b]=f),e}});var fb=/^(?:input|select|textarea|button)$/i;_.fn.extend({prop:function(a,b){return pa(this,_.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[_.propFix[a]||a]})}}),_.extend({propFix:{for:"htmlFor",class:"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!_.isXMLDoc(a),f&&(b=_.propFix[b]||b,e=_.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||fb.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),Y.optSelected||(_.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),_.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){_.propFix[this.toLowerCase()]=this});var gb=/[\t\r\n\f]/g;_.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(_.isFunction(a))return this.each(function(b){_(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(ma)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(gb," "):" ")){for(f=0;e=b[f++];)d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=_.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(_.isFunction(a))return this.each(function(b){_(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(ma)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(gb," "):"")){for(f=0;e=b[f++];)for(;d.indexOf(" "+e+" ")>=0;)d=d.replace(" "+e+" "," ");g=a?_.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(_.isFunction(a)?function(c){_(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c)for(var b,d=0,e=_(this),f=a.match(ma)||[];b=f[d++];)e.hasClass(b)?e.removeClass(b):e.addClass(b);else(c===ya||"boolean"===c)&&(this.className&&qa.set(this,"__className__",this.className),this.className=this.className||!1===a?"":qa.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(gb," ").indexOf(b)>=0)return!0;return!1}});var hb=/\r/g;_.fn.extend({val:function(a){var b,c,d,e=this[0];return arguments.length?(d=_.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,_(this).val()):a,null==e?e="":"number"==typeof e?e+="":_.isArray(e)&&(e=_.map(e,function(a){return null==a?"":a+""})),(b=_.valHooks[this.type]||_.valHooks[this.nodeName.toLowerCase()])&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))})):e?(b=_.valHooks[e.type]||_.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(hb,""):null==c?"":c)):void 0}}),_.extend({valHooks:{option:{get:function(a){var b=_.find.attr(a,"value");return null!=b?b:_.trim(_.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(Y.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&_.nodeName(c.parentNode,"optgroup"))){if(b=_(c).val(),f)return b;g.push(b)}return g},set:function(a,b){for(var c,d,e=a.options,f=_.makeArray(b),g=e.length;g--;)d=e[g],(d.selected=_.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),_.each(["radio","checkbox"],function(){_.valHooks[this]={set:function(a,b){return _.isArray(b)?a.checked=_.inArray(_(a).val(),b)>=0:void 0}},Y.checkOn||(_.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),_.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){_.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),_.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var ib=_.now(),jb=/\?/;_.parseJSON=function(a){return JSON.parse(a+"")},_.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(a){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&_.error("Invalid XML: "+a),b};var kb,lb,mb=/#.*$/,nb=/([?&])_=[^&]*/,ob=/^(.*?):[ \t]*([^\r\n]*)$/gm,pb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,qb=/^(?:GET|HEAD)$/,rb=/^\/\//,sb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,tb={},ub={},vb="*/".concat("*");try{lb=location.href}catch(a){lb=Z.createElement("a"),lb.href="",lb=lb.href}kb=sb.exec(lb.toLowerCase())||[],_.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:lb,type:"GET",isLocal:pb.test(kb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":vb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":_.parseJSON,"text xml":_.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?L(L(a,_.ajaxSettings),b):L(_.ajaxSettings,a)},ajaxPrefilter:J(tb),ajaxTransport:J(ub),ajax:function(a,b){function c(a,b,c,g){var i,k,r,s,u,w=b;2!==t&&(t=2,h&&clearTimeout(h),d=void 0,f=g||"",v.readyState=a>0?4:0,i=a>=200&&300>a||304===a,c&&(s=M(l,v,c)),s=N(l,s,v,i),i?(l.ifModified&&(u=v.getResponseHeader("Last-Modified"),u&&(_.lastModified[e]=u),(u=v.getResponseHeader("etag"))&&(_.etag[e]=u)),204===a||"HEAD"===l.type?w="nocontent":304===a?w="notmodified":(w=s.state,k=s.data,r=s.error,i=!r)):(r=w,(a||!w)&&(w="error",0>a&&(a=0))),v.status=a,v.statusText=(b||w)+"",i?o.resolveWith(m,[k,w,v]):o.rejectWith(m,[v,w,r]),v.statusCode(q),q=void 0,j&&n.trigger(i?"ajaxSuccess":"ajaxError",[v,l,i?k:r]),p.fireWith(m,[v,w]),j&&(n.trigger("ajaxComplete",[v,l]),--_.active||_.event.trigger("ajaxStop")))}"object"==typeof a&&(b=a,a=void 0),b=b||{};var d,e,f,g,h,i,j,k,l=_.ajaxSetup({},b),m=l.context||l,n=l.context&&(m.nodeType||m.jquery)?_(m):_.event,o=_.Deferred(),p=_.Callbacks("once memory"),q=l.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!g)for(g={};b=ob.exec(f);)g[b[1].toLowerCase()]=b[2];b=g[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(l.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return d&&d.abort(b),c(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,l.url=((a||l.url||lb)+"").replace(mb,"").replace(rb,kb[1]+"//"),l.type=b.method||b.type||l.method||l.type,l.dataTypes=_.trim(l.dataType||"*").toLowerCase().match(ma)||[""],null==l.crossDomain&&(i=sb.exec(l.url.toLowerCase()),l.crossDomain=!(!i||i[1]===kb[1]&&i[2]===kb[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(kb[3]||("http:"===kb[1]?"80":"443")))),l.data&&l.processData&&"string"!=typeof l.data&&(l.data=_.param(l.data,l.traditional)),K(tb,l,b,v),2===t)return v;j=l.global,j&&0==_.active++&&_.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!qb.test(l.type),e=l.url,l.hasContent||(l.data&&(e=l.url+=(jb.test(e)?"&":"?")+l.data,delete l.data),!1===l.cache&&(l.url=nb.test(e)?e.replace(nb,"$1_="+ib++):e+(jb.test(e)?"&":"?")+"_="+ib++)),l.ifModified&&(_.lastModified[e]&&v.setRequestHeader("If-Modified-Since",_.lastModified[e]),_.etag[e]&&v.setRequestHeader("If-None-Match",_.etag[e])),(l.data&&l.hasContent&&!1!==l.contentType||b.contentType)&&v.setRequestHeader("Content-Type",l.contentType),v.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+("*"!==l.dataTypes[0]?", "+vb+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)v.setRequestHeader(k,l.headers[k]);if(l.beforeSend&&(!1===l.beforeSend.call(m,v,l)||2===t))return v.abort();u="abort";for(k in{success:1,error:1,complete:1})v[k](l[k]);if(d=K(ub,l,b,v)){v.readyState=1,j&&n.trigger("ajaxSend",[v,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){v.abort("timeout")},l.timeout));try{t=1,d.send(r,c)}catch(a){if(!(2>t))throw a;c(-1,a)}}else c(-1,"No Transport");return v},getJSON:function(a,b,c){return _.get(a,b,c,"json")},getScript:function(a,b){return _.get(a,void 0,b,"script")}}),_.each(["get","post"],function(a,b){_[b]=function(a,c,d,e){return _.isFunction(c)&&(e=e||d,d=c,c=void 0),_.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),_.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){_.fn[b]=function(a){return this.on(b,a)}}),_._evalUrl=function(a){return _.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},_.fn.extend({wrapAll:function(a){var b;return _.isFunction(a)?this.each(function(b){_(this).wrapAll(a.call(this,b))}):(this[0]&&(b=_(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){for(var a=this;a.firstElementChild;)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(_.isFunction(a)?function(b){_(this).wrapInner(a.call(this,b))}:function(){var b=_(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=_.isFunction(a);return this.each(function(c){_(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){_.nodeName(this,"body")||_(this).replaceWith(this.childNodes)}).end()}}),_.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},_.expr.filters.visible=function(a){return!_.expr.filters.hidden(a)};var wb=/%20/g,xb=/\[\]$/,yb=/\r?\n/g,zb=/^(?:submit|button|image|reset|file)$/i,Ab=/^(?:input|select|textarea|keygen)/i;_.param=function(a,b){var c,d=[],e=function(a,b){b=_.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=_.ajaxSettings&&_.ajaxSettings.traditional),_.isArray(a)||a.jquery&&!_.isPlainObject(a))_.each(a,function(){e(this.name,this.value)});else for(c in a)O(c,a[c],b,e);return d.join("&").replace(wb,"+")},_.fn.extend({serialize:function(){return _.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=_.prop(this,"elements");return a?_.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!_(this).is(":disabled")&&Ab.test(this.nodeName)&&!zb.test(a)&&(this.checked||!xa.test(a))}).map(function(a,b){var c=_(this).val();return null==c?null:_.isArray(c)?_.map(c,function(a){return{name:b.name,value:a.replace(yb,"\r\n")}}):{name:b.name,value:c.replace(yb,"\r\n")}}).get()}}),_.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Bb=0,Cb={},Db={0:200,1223:204},Eb=_.ajaxSettings.xhr();a.ActiveXObject&&_(a).on("unload",function(){for(var a in Cb)Cb[a]()}),Y.cors=!!Eb&&"withCredentials"in Eb,Y.ajax=Eb=!!Eb,_.ajaxTransport(function(a){var b;return Y.cors||Eb&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Bb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Cb[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Db[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Cb[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(a){if(b)throw a}},abort:function(){b&&b()}}:void 0}),_.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return _.globalEval(a),a}}}),_.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),_.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=_("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),Z.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Fb=[],Gb=/(=)\?(?=&|$)|\?\?/;_.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Fb.pop()||_.expando+"_"+ib++;return this[a]=!0,a}}),_.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=!1!==b.jsonp&&(Gb.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Gb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=_.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Gb,"$1"+e):!1!==b.jsonp&&(b.url+=(jb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||_.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Fb.push(e)),g&&_.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),_.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||Z
  ;var d=ga.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=_.buildFragment([a],b,e),e&&e.length&&_(e).remove(),_.merge([],d.childNodes))};var Hb=_.fn.load;_.fn.load=function(a,b,c){if("string"!=typeof a&&Hb)return Hb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=_.trim(a.slice(h)),a=a.slice(0,h)),_.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&_.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?_("<div>").append(_.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},_.expr.filters.animated=function(a){return _.grep(_.timers,function(b){return a===b.elem}).length};var Ib=a.document.documentElement;_.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=_.css(a,"position"),l=_(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=_.css(a,"top"),i=_.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),_.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},_.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){_.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;return f?(b=f.documentElement,_.contains(b,d)?(typeof d.getBoundingClientRect!==ya&&(e=d.getBoundingClientRect()),c=P(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e):void 0},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===_.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),_.nodeName(a[0],"html")||(d=a.offset()),d.top+=_.css(a[0],"borderTopWidth",!0),d.left+=_.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-_.css(c,"marginTop",!0),left:b.left-d.left-_.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||Ib;a&&!_.nodeName(a,"html")&&"static"===_.css(a,"position");)a=a.offsetParent;return a||Ib})}}),_.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;_.fn[b]=function(e){return pa(this,function(b,e,f){var g=P(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),_.each(["top","left"],function(a,b){_.cssHooks[b]=w(Y.pixelPosition,function(a,c){return c?(c=v(a,b),Pa.test(c)?_(a).position()[b]+"px":c):void 0})}),_.each({Height:"height",Width:"width"},function(a,b){_.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){_.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(!0===d||!0===e?"margin":"border");return pa(this,function(b,c,d){var e;return _.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?_.css(b,c,g):_.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),_.fn.size=function(){return this.length},_.fn.andSelf=_.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return _});var Jb=a.jQuery,Kb=a.$;return _.noConflict=function(b){return a.$===_&&(a.$=Kb),b&&a.jQuery===_&&(a.jQuery=Jb),_},typeof b===ya&&(a.jQuery=a.$=_),_});var Detector={canvas:!!window.CanvasRenderingContext2D,webgl:function(){try{var a=document.createElement("canvas");return!(!window.WebGLRenderingContext||!a.getContext("webgl")&&!a.getContext("experimental-webgl"))}catch(a){return!1}}(),workers:!!window.Worker,fileapi:window.File&&window.FileReader&&window.FileList&&window.Blob,getWebGLErrorMessage:function(){var a=document.createElement("div");return a.id="webgl-error-message",a.style.fontFamily="monospace",a.style.fontSize="13px",a.style.fontWeight="normal",a.style.textAlign="center",a.style.background="#fff",a.style.color="#000",a.style.padding="1.5em",a.style.width="400px",a.style.margin="5em auto 0",this.webgl||(a.innerHTML=window.WebGLRenderingContext?['Your graphics card does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">WebGL</a>.<br />','Find out how to get it <a href="http://get.webgl.org/" style="color:#000">here</a>.'].join("\n"):['Your browser does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">WebGL</a>.<br/>','Find out how to get it <a href="http://get.webgl.org/" style="color:#000">here</a>.'].join("\n")),a},addGetWebGLMessage:function(a){var b,c,d;a=a||{},b=void 0!==a.parent?a.parent:document.body,c=void 0!==a.id?a.id:"oldie",d=Detector.getWebGLErrorMessage(),d.id=c,b.appendChild(d)}};"object"==typeof module&&(module.exports=Detector);var dat=dat||{};dat.gui=dat.gui||{},dat.utils=dat.utils||{},dat.controllers=dat.controllers||{},dat.dom=dat.dom||{},dat.color=dat.color||{},dat.utils.css=function(){return{load:function(a,b){var b=b||document,c=b.createElement("link");c.type="text/css",c.rel="stylesheet",c.href=a,b.getElementsByTagName("head")[0].appendChild(c)},inject:function(a,b){var b=b||document,c=document.createElement("style");c.type="text/css",c.innerHTML=a,b.getElementsByTagName("head")[0].appendChild(c)}}}(),dat.utils.common=function(){var a=Array.prototype.forEach,b=Array.prototype.slice;return{BREAK:{},extend:function(a){return this.each(b.call(arguments,1),function(b){for(var c in b)this.isUndefined(b[c])||(a[c]=b[c])},this),a},defaults:function(a){return this.each(b.call(arguments,1),function(b){for(var c in b)this.isUndefined(a[c])&&(a[c]=b[c])},this),a},compose:function(){var a=b.call(arguments);return function(){for(var c=b.call(arguments),d=a.length-1;d>=0;d--)c=[a[d].apply(this,c)];return c[0]}},each:function(b,c,d){if(a&&b.forEach===a)b.forEach(c,d);else if(b.length===b.length+0)for(var e=0,f=b.length;e<f&&!(e in b&&c.call(d,b[e],e)===this.BREAK);e++);else for(e in b)if(c.call(d,b[e],e)===this.BREAK)break},defer:function(a){setTimeout(a,0)},toArray:function(a){return a.toArray?a.toArray():b.call(a)},isUndefined:function(a){return void 0===a},isNull:function(a){return null===a},isNaN:function(a){return a!==a},isArray:Array.isArray||function(a){return a.constructor===Array},isObject:function(a){return a===Object(a)},isNumber:function(a){return a===a+0},isString:function(a){return a===a+""},isBoolean:function(a){return!1===a||!0===a},isFunction:function(a){return"[object Function]"===Object.prototype.toString.call(a)}}}(),dat.controllers.Controller=function(a){var b=function(a,b){this.initialValue=a[b],this.domElement=document.createElement("div"),this.object=a,this.property=b,this.__onFinishChange=this.__onChange=void 0};return a.extend(b.prototype,{onChange:function(a){return this.__onChange=a,this},onFinishChange:function(a){return this.__onFinishChange=a,this},setValue:function(a){return this.object[this.property]=a,this.__onChange&&this.__onChange.call(this,a),this.updateDisplay(),this},getValue:function(){return this.object[this.property]},updateDisplay:function(){return this},isModified:function(){return this.initialValue!==this.getValue()}}),b}(dat.utils.common),dat.dom.dom=function(a){function b(b){return"0"===b||a.isUndefined(b)?0:(b=b.match(d),a.isNull(b)?0:parseFloat(b[1]))}var c={};a.each({HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},function(b,d){a.each(b,function(a){c[a]=d})});var d=/(\d+(\.\d+)?)px/,e={makeSelectable:function(a,b){void 0!==a&&void 0!==a.style&&(a.onselectstart=b?function(){return!1}:function(){},a.style.MozUserSelect=b?"auto":"none",a.style.KhtmlUserSelect=b?"auto":"none",a.unselectable=b?"on":"off")},makeFullscreen:function(b,c,d){a.isUndefined(c)&&(c=!0),a.isUndefined(d)&&(d=!0),b.style.position="absolute",c&&(b.style.left=0,b.style.right=0),d&&(b.style.top=0,b.style.bottom=0)},fakeEvent:function(b,d,e,f){var e=e||{},g=c[d];if(!g)throw Error("Event type "+d+" not supported.");var h=document.createEvent(g);switch(g){case"MouseEvents":h.initMouseEvent(d,e.bubbles||!1,e.cancelable||!0,window,e.clickCount||1,0,0,e.x||e.clientX||0,e.y||e.clientY||0,!1,!1,!1,!1,0,null);break;case"KeyboardEvents":g=h.initKeyboardEvent||h.initKeyEvent,a.defaults(e,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),g(d,e.bubbles||!1,e.cancelable,window,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.keyCode,e.charCode);break;default:h.initEvent(d,e.bubbles||!1,e.cancelable||!0)}a.defaults(h,f),b.dispatchEvent(h)},bind:function(a,b,c,d){return a.addEventListener?a.addEventListener(b,c,d||!1):a.attachEvent&&a.attachEvent("on"+b,c),e},unbind:function(a,b,c,d){return a.removeEventListener?a.removeEventListener(b,c,d||!1):a.detachEvent&&a.detachEvent("on"+b,c),e},addClass:function(a,b){if(void 0===a.className)a.className=b;else if(a.className!==b){var c=a.className.split(/ +/);-1==c.indexOf(b)&&(c.push(b),a.className=c.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}return e},removeClass:function(a,b){if(b){if(void 0!==a.className)if(a.className===b)a.removeAttribute("class");else{var c=a.className.split(/ +/),d=c.indexOf(b);-1!=d&&(c.splice(d,1),a.className=c.join(" "))}}else a.className=void 0;return e},hasClass:function(a,b){return RegExp("(?:^|\\s+)"+b+"(?:\\s+|$)").test(a.className)||!1},getWidth:function(a){return a=getComputedStyle(a),b(a["border-left-width"])+b(a["border-right-width"])+b(a["padding-left"])+b(a["padding-right"])+b(a.width)},getHeight:function(a){return a=getComputedStyle(a),b(a["border-top-width"])+b(a["border-bottom-width"])+b(a["padding-top"])+b(a["padding-bottom"])+b(a.height)},getOffset:function(a){var b={left:0,top:0};if(a.offsetParent)do{b.left+=a.offsetLeft,b.top+=a.offsetTop}while(a=a.offsetParent);return b},isActive:function(a){return a===document.activeElement&&(a.type||a.href)}};return e}(dat.utils.common),dat.controllers.OptionController=function(a,b,c){var d=function(a,e,f){d.superclass.call(this,a,e);var g=this;if(this.__select=document.createElement("select"),c.isArray(f)){var h={};c.each(f,function(a){h[a]=a}),f=h}c.each(f,function(a,b){var c=document.createElement("option");c.innerHTML=b,c.setAttribute("value",a),g.__select.appendChild(c)}),this.updateDisplay(),b.bind(this.__select,"change",function(){g.setValue(this.options[this.selectedIndex].value)}),this.domElement.appendChild(this.__select)};return d.superclass=a,c.extend(d.prototype,a.prototype,{setValue:function(a){return a=d.superclass.prototype.setValue.call(this,a),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),a},updateDisplay:function(){return this.__select.value=this.getValue(),d.superclass.prototype.updateDisplay.call(this)}}),d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common),dat.controllers.NumberController=function(a,b){var c=function(a,d,e){c.superclass.call(this,a,d),e=e||{},this.__min=e.min,this.__max=e.max,this.__step=e.step,a=this.__impliedStep=b.isUndefined(this.__step)?0==this.initialValue?1:Math.pow(10,Math.floor(Math.log(this.initialValue)/Math.LN10))/10:this.__step,a=a.toString(),this.__precision=a.indexOf(".")>-1?a.length-a.indexOf(".")-1:0};return c.superclass=a,b.extend(c.prototype,a.prototype,{setValue:function(a){return void 0!==this.__min&&a<this.__min?a=this.__min:void 0!==this.__max&&a>this.__max&&(a=this.__max),void 0!==this.__step&&a%this.__step!=0&&(a=Math.round(a/this.__step)*this.__step),c.superclass.prototype.setValue.call(this,a)},min:function(a){return this.__min=a,this},max:function(a){return this.__max=a,this},step:function(a){return this.__step=a,this}}),c}(dat.controllers.Controller,dat.utils.common),dat.controllers.NumberControllerBox=function(a,b,c){var d=function(a,e,f){function g(){var a=parseFloat(k.__input.value);c.isNaN(a)||k.setValue(a)}function h(a){var b=j-a.clientY;k.setValue(k.getValue()+b*k.__impliedStep),j=a.clientY}function i(){b.unbind(window,"mousemove",h),b.unbind(window,"mouseup",i)}this.__truncationSuspended=!1,d.superclass.call(this,a,e,f);var j,k=this;this.__input=document.createElement("input"),this.__input.setAttribute("type","text"),b.bind(this.__input,"change",g),b.bind(this.__input,"blur",function(){g(),k.__onFinishChange&&k.__onFinishChange.call(k,k.getValue())}),b.bind(this.__input,"mousedown",function(a){b.bind(window,"mousemove",h),b.bind(window,"mouseup",i),j=a.clientY}),b.bind(this.__input,"keydown",function(a){13===a.keyCode&&(k.__truncationSuspended=!0,this.blur(),k.__truncationSuspended=!1)}),this.updateDisplay(),this.domElement.appendChild(this.__input)};return d.superclass=a,c.extend(d.prototype,a.prototype,{updateDisplay:function(){var a,b=this.__input;if(this.__truncationSuspended)a=this.getValue();else{a=this.getValue();var c=Math.pow(10,this.__precision);a=Math.round(a*c)/c}return b.value=a,d.superclass.prototype.updateDisplay.call(this)}}),d}(dat.controllers.NumberController,dat.dom.dom,dat.utils.common),dat.controllers.NumberControllerSlider=function(a,b,c,d,e){var f=function(a,c,d,e,g){function h(a){a.preventDefault();var c=b.getOffset(j.__background),d=b.getWidth(j.__background);return j.setValue(j.__min+(j.__max-j.__min)*((a.clientX-c.left)/(c.left+d-c.left))),!1}function i(){b.unbind(window,"mousemove",h),b.unbind(window,"mouseup",i),j.__onFinishChange&&j.__onFinishChange.call(j,j.getValue())}f.superclass.call(this,a,c,{min:d,max:e,step:g});var j=this;this.__background=document.createElement("div"),this.__foreground=document.createElement("div"),b.bind(this.__background,"mousedown",function(a){b.bind(window,"mousemove",h),b.bind(window,"mouseup",i),h(a)}),b.addClass(this.__background,"slider"),b.addClass(this.__foreground,"slider-fg"),this.updateDisplay(),this.__background.appendChild(this.__foreground),this.domElement.appendChild(this.__background)};return f.superclass=a,f.useDefaultStyles=function(){c.inject(e)},d.extend(f.prototype,a.prototype,{updateDisplay:function(){return this.__foreground.style.width=(this.getValue()-this.__min)/(this.__max-this.__min)*100+"%",f.superclass.prototype.updateDisplay.call(this)}}),f}(dat.controllers.NumberController,dat.dom.dom,dat.utils.css,dat.utils.common,".slider {\n  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n  height: 1em;\n  border-radius: 1em;\n  background-color: #eee;\n  padding: 0 0.5em;\n  overflow: hidden;\n}\n\n.slider-fg {\n  padding: 1px 0 2px 0;\n  background-color: #aaa;\n  height: 1em;\n  margin-left: -0.5em;\n  padding-right: 0.5em;\n  border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n  display: inline-block;\n  border-radius: 1em;\n  background-color: #fff;\n  border:  1px solid #aaa;\n  content: '';\n  float: right;\n  margin-right: -1em;\n  margin-top: -1px;\n  height: 0.9em;\n  width: 0.9em;\n}"),dat.controllers.FunctionController=function(a,b,c){var d=function(a,c,e){d.superclass.call(this,a,c);var f=this;this.__button=document.createElement("div"),this.__button.innerHTML=void 0===e?"Fire":e,b.bind(this.__button,"click",function(a){return a.preventDefault(),f.fire(),!1}),b.addClass(this.__button,"button"),this.domElement.appendChild(this.__button)};return d.superclass=a,c.extend(d.prototype,a.prototype,{fire:function(){this.__onChange&&this.__onChange.call(this),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.getValue().call(this.object)}}),d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common),dat.controllers.BooleanController=function(a,b,c){var d=function(a,c){d.superclass.call(this,a,c);var e=this;this.__prev=this.getValue(),this.__checkbox=document.createElement("input"),this.__checkbox.setAttribute("type","checkbox"),b.bind(this.__checkbox,"change",function(){e.setValue(!e.__prev)},!1),this.domElement.appendChild(this.__checkbox),this.updateDisplay()};return d.superclass=a,c.extend(d.prototype,a.prototype,{setValue:function(a){return a=d.superclass.prototype.setValue.call(this,a),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),a},updateDisplay:function(){return!0===this.getValue()?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0):this.__checkbox.checked=!1,d.superclass.prototype.updateDisplay.call(this)}}),d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common),dat.color.toString=function(a){return function(b){if(1==b.a||a.isUndefined(b.a)){for(b=b.hex.toString(16);b.length<6;)b="0"+b;return"#"+b}return"rgba("+Math.round(b.r)+","+Math.round(b.g)+","+Math.round(b.b)+","+b.a+")"}}(dat.utils.common),dat.color.interpret=function(a,b){var c,d,e=[{litmus:b.isString,conversions:{THREE_CHAR_HEX:{read:function(a){return null!==(a=a.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i))&&{space:"HEX",hex:parseInt("0x"+a[1].toString()+a[1].toString()+a[2].toString()+a[2].toString()+a[3].toString()+a[3].toString())}},write:a},SIX_CHAR_HEX:{read:function(a){return null!==(a=a.match(/^#([A-F0-9]{6})$/i))&&{space:"HEX",hex:parseInt("0x"+a[1].toString())}},write:a},CSS_RGB:{read:function(a){return null!==(a=a.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/))&&{space:"RGB",r:parseFloat(a[1]),g:parseFloat(a[2]),b:parseFloat(a[3])}},write:a},CSS_RGBA:{read:function(a){return null!==(a=a.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/))&&{space:"RGB",r:parseFloat(a[1]),g:parseFloat(a[2]),b:parseFloat(a[3]),a:parseFloat(a[4])}},write:a}}},{litmus:b.isNumber,conversions:{HEX:{read:function(a){return{space:"HEX",hex:a,conversionName:"HEX"}},write:function(a){return a.hex}}}},{litmus:b.isArray,conversions:{RGB_ARRAY:{read:function(a){return 3==a.length&&{space:"RGB",r:a[0],g:a[1],b:a[2]}},write:function(a){return[a.r,a.g,a.b]}},RGBA_ARRAY:{read:function(a){return 4==a.length&&{space:"RGB",r:a[0],g:a[1],b:a[2],a:a[3]}},write:function(a){return[a.r,a.g,a.b,a.a]}}}},{litmus:b.isObject,conversions:{RGBA_OBJ:{read:function(a){return!!(b.isNumber(a.r)&&b.isNumber(a.g)&&b.isNumber(a.b)&&b.isNumber(a.a))&&{space:"RGB",r:a.r,g:a.g,b:a.b,a:a.a}},write:function(a){return{r:a.r,g:a.g,b:a.b,a:a.a}}},RGB_OBJ:{read:function(a){return!!(b.isNumber(a.r)&&b.isNumber(a.g)&&b.isNumber(a.b))&&{space:"RGB",r:a.r,g:a.g,b:a.b}},write:function(a){return{r:a.r,g:a.g,b:a.b}}},HSVA_OBJ:{read:function(a){return!!(b.isNumber(a.h)&&b.isNumber(a.s)&&b.isNumber(a.v)&&b.isNumber(a.a))&&{space:"HSV",h:a.h,s:a.s,v:a.v,a:a.a}},write:function(a){return{h:a.h,s:a.s,v:a.v,a:a.a}}},HSV_OBJ:{read:function(a){return!!(b.isNumber(a.h)&&b.isNumber(a.s)&&b.isNumber(a.v))&&{space:"HSV",h:a.h,s:a.s,v:a.v}},write:function(a){return{h:a.h,s:a.s,v:a.v}}}}}];return function(){d=!1;var a=arguments.length>1?b.toArray(arguments):arguments[0];return b.each(e,function(e){if(e.litmus(a))return b.each(e.conversions,function(e,f){if(c=e.read(a),!1===d&&!1!==c)return d=c,c.conversionName=f,c.conversion=e,b.BREAK}),b.BREAK}),d}}(dat.color.toString,dat.utils.common),dat.GUI=dat.gui.GUI=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){function p(a,b,c,f){if(void 0===b[c])throw Error("Object "+b+' has no property "'+c+'"');f.color?b=new k(b,c):(b=[b,c].concat(f.factoryArgs),b=d.apply(a,b)),f.before instanceof e&&(f.before=f.before.__li),s(a,b),n.addClass(b.domElement,"c"),c=document.createElement("span"),n.addClass(c,"property-name"),c.innerHTML=b.property;var g=document.createElement("div");return g.appendChild(c),g.appendChild(b.domElement),f=q(a,g,f.before),n.addClass(f,H.CLASS_CONTROLLER_ROW),n.addClass(f,typeof b.getValue()),r(a,f,b),a.__controllers.push(b),b}function q(a,b,c){var d=document.createElement("li");return b&&d.appendChild(b),c?a.__ul.insertBefore(d,params.before):a.__ul.appendChild(d),a.onResize(),d}function r(a,b,c){if(c.__li=b,c.__gui=a,o.extend(c,{options:function(b){return arguments.length>1?(c.remove(),p(a,c.object,c.property,{before:c.__li.nextElementSibling,factoryArgs:[o.toArray(arguments)]})):o.isArray(b)||o.isObject(b)?(c.remove(),p(a,c.object,c.property,{before:c.__li.nextElementSibling,factoryArgs:[b]})):void 0},name:function(a){return c.__li.firstElementChild.firstElementChild.innerHTML=a,c},listen:function(){return c.__gui.listen(c),c},remove:function(){return c.__gui.remove(c),c}}),c instanceof i){var d=new h(c.object,c.property,{min:c.__min,max:c.__max,step:c.__step});o.each(["updateDisplay","onChange","onFinishChange"],function(a){var b=c[a],e=d[a];c[a]=d[a]=function(){var a=Array.prototype.slice.call(arguments);return b.apply(c,a),e.apply(d,a)}}),n.addClass(b,"has-slider"),c.domElement.insertBefore(d.domElement,c.domElement.firstElementChild)}else if(c instanceof h){var e=function(b){return o.isNumber(c.__min)&&o.isNumber(c.__max)?(c.remove(),p(a,c.object,c.property,{before:c.__li.nextElementSibling,factoryArgs:[c.__min,c.__max,c.__step]})):b};c.min=o.compose(e,c.min),c.max=o.compose(e,c.max)}else c instanceof f?(n.bind(b,"click",function(){n.fakeEvent(c.__checkbox,"click")}),n.bind(c.__checkbox,"click",function(a){a.stopPropagation()})):c instanceof g?(n.bind(b,"click",function(){n.fakeEvent(c.__button,"click")}),n.bind(b,"mouseover",function(){n.addClass(c.__button,"hover")}),n.bind(b,"mouseout",function(){n.removeClass(c.__button,"hover")})):c instanceof k&&(n.addClass(b,"color"),c.updateDisplay=o.compose(function(a){return b.style.borderLeftColor=c.__color.toString(),a},c.updateDisplay),c.updateDisplay());c.setValue=o.compose(function(b){return a.getRoot().__preset_select&&c.isModified()&&y(a.getRoot(),!0),b},c.setValue)}function s(a,b){var c=a.getRoot(),d=c.__rememberedObjects.indexOf(b.object);if(-1!=d){var e=c.__rememberedObjectIndecesToControllers[d];if(void 0===e&&(e={},c.__rememberedObjectIndecesToControllers[d]=e),e[b.property]=b,c.load&&c.load.remembered){if(c=c.load.remembered,c[a.preset])c=c[a.preset];else{if(!c[B])return;c=c[B]}c[d]&&void 0!==c[d][b.property]&&(d=c[d][b.property],b.initialValue=d,b.setValue(d))}}}function t(a){var b=a.__save_row=document.createElement("li");n.addClass(a.domElement,"has-save"),a.__ul.insertBefore(b,a.__ul.firstChild),n.addClass(b,"save-row");var c=document.createElement("span");c.innerHTML="&nbsp;",n.addClass(c,"button gears");var d=document.createElement("span");d.innerHTML="Save",n.addClass(d,"button"),n.addClass(d,"save");var e=document.createElement("span");e.innerHTML="New",n.addClass(e,"button"),n.addClass(e,"save-as");var f=document.createElement("span");f.innerHTML="Revert",n.addClass(f,"button"),n.addClass(f,"revert");var g=a.__preset_select=document.createElement("select");if(a.load&&a.load.remembered?o.each(a.load.remembered,function(b,c){x(a,c,c==a.preset)}):x(a,B,!1),n.bind(g,"change",function(){for(var b=0;b<a.__preset_select.length;b++)a.__preset_select[b].innerHTML=a.__preset_select[b].value;a.preset=this.value}),b.appendChild(g),b.appendChild(c),b.appendChild(d),b.appendChild(e),b.appendChild(f),A){var b=document.getElementById("dg-save-locally"),h=document.getElementById("dg-local-explain");b.style.display="block",b=document.getElementById("dg-local-storage"),"true"===localStorage.getItem(document.location.href+".isLocal")&&b.setAttribute("checked","checked");var i=function(){h.style.display=a.useLocalStorage?"block":"none"};i(),n.bind(b,"change",function(){a.useLocalStorage=!a.useLocalStorage,i()})}var j=document.getElementById("dg-new-constructor");n.bind(j,"keydown",function(a){a.metaKey&&(67===a.which||67==a.keyCode)&&C.hide()}),n.bind(c,"click",function(){j.innerHTML=JSON.stringify(a.getSaveObject(),void 0,2),C.show(),j.focus(),j.select()}),n.bind(d,"click",function(){a.save()}),n.bind(e,"click",function(){var b=prompt("Enter a new preset name.");b&&a.saveAs(b)}),n.bind(f,"click",function(){a.revert()})}function u(a){function b(b){return b.preventDefault(),e=b.clientX,n.addClass(a.__closeButton,H.CLASS_DRAG),n.bind(window,"mousemove",c),n.bind(window,"mouseup",d),!1}function c(b){return b.preventDefault(),a.width+=e-b.clientX,a.onResize(),e=b.clientX,!1}function d(){n.removeClass(a.__closeButton,H.CLASS_DRAG),n.unbind(window,"mousemove",c),n.unbind(window,"mouseup",d)}a.__resize_handle=document.createElement("div"),o.extend(a.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"});var e;n.bind(a.__resize_handle,"mousedown",b),n.bind(a.__closeButton,"mousedown",b),a.domElement.insertBefore(a.__resize_handle,a.domElement.firstElementChild)}function v(a,b){a.domElement.style.width=b+"px",a.__save_row&&a.autoPlace&&(a.__save_row.style.width=b+"px"),a.__closeButton&&(a.__closeButton.style.width=b+"px")}function w(a,b){var c={};return o.each(a.__rememberedObjects,function(d,e){var f={};o.each(a.__rememberedObjectIndecesToControllers[e],function(a,c){f[c]=b?a.initialValue:a.getValue()}),c[e]=f}),c}function x(a,b,c){var d=document.createElement("option");d.innerHTML=b,d.value=b,a.__preset_select.appendChild(d),c&&(a.__preset_select.selectedIndex=a.__preset_select.length-1)}function y(a,b){var c=a.__preset_select[a.__preset_select.selectedIndex];c.innerHTML=b?c.value+"*":c.value}function z(a){0!=a.length&&l(function(){z(a)}),o.each(a,function(a){a.updateDisplay()})}a.inject(c);var A,B="Default";try{A="localStorage"in window&&null!==window.localStorage}catch(a){A=!1}var C,D,E=!0,F=!1,G=[],H=function(a){function b(){localStorage.setItem(document.location.href+".gui",JSON.stringify(d.getSaveObject()))}function c(){var a=d.getRoot();a.width+=1,o.defer(function(){a.width-=1})}var d=this;this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),n.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],a=a||{},a=o.defaults(a,{autoPlace:!0,width:H.DEFAULT_WIDTH}),a=o.defaults(a,{resizable:a.autoPlace,hideable:a.autoPlace}),o.isUndefined(a.load)?a.load={preset:B}:a.preset&&(a.load.preset=a.preset),o.isUndefined(a.parent)&&a.hideable&&G.push(this),a.resizable=o.isUndefined(a.parent)&&a.resizable,a.autoPlace&&o.isUndefined(a.scrollable)&&(a.scrollable=!0);var e=A&&"true"===localStorage.getItem(document.location.href+".isLocal");if(Object.defineProperties(this,{parent:{get:function(){return a.parent}},scrollable:{get:function(){return a.scrollable}},autoPlace:{get:function(){return a.autoPlace}},preset:{get:function(){return d.parent?d.getRoot().preset:a.load.preset},set:function(b){for(d.parent?d.getRoot().preset=b:a.load.preset=b,b=0;b<this.__preset_select.length;b++)this.__preset_select[b].value==this.preset&&(this.__preset_select.selectedIndex=b);d.revert()}},width:{get:function(){return a.width},set:function(b){a.width=b,v(d,b)}},name:{get:function(){return a.name},set:function(b){a.name=b,g&&(g.innerHTML=a.name)}},closed:{get:function(){return a.closed},set:function(b){a.closed=b,a.closed?n.addClass(d.__ul,H.CLASS_CLOSED):n.removeClass(d.__ul,H.CLASS_CLOSED),this.onResize(),d.__closeButton&&(d.__closeButton.innerHTML=b?H.TEXT_OPEN:H.TEXT_CLOSED)}},load:{get:function(){return a.load}},useLocalStorage:{get:function(){return e},set:function(a){A&&((e=a)?n.bind(window,"unload",b):n.unbind(window,"unload",b),localStorage.setItem(document.location.href+".isLocal",a))}}}),o.isUndefined(a.parent)){if(a.closed=!1,n.addClass(this.domElement,H.CLASS_MAIN),n.makeSelectable(this.domElement,!1),A&&e){d.useLocalStorage=!0;var f=localStorage.getItem(document.location.href+".gui");f&&(a.load=JSON.parse(f))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=H.TEXT_CLOSED,n.addClass(this.__closeButton,H.CLASS_CLOSE_BUTTON),this.domElement.appendChild(this.__closeButton),n.bind(this.__closeButton,"click",function(){d.closed=!d.closed})}else{void 0===a.closed&&(a.closed=!0);var g=document.createTextNode(a.name);n.addClass(g,"controller-name"),f=q(d,g),n.addClass(this.__ul,H.CLASS_CLOSED),n.addClass(f,"title"),n.bind(f,"click",function(a){return a.preventDefault(),d.closed=!d.closed,!1}),a.closed||(this.closed=!1)}a.autoPlace&&(o.isUndefined(a.parent)&&(E&&(D=document.createElement("div"),n.addClass(D,"dg"),n.addClass(D,H.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(D),E=!1),D.appendChild(this.domElement),n.addClass(this.domElement,H.CLASS_AUTO_PLACE)),this.parent||v(d,a.width)),n.bind(window,"resize",function(){d.onResize()}),n.bind(this.__ul,"webkitTransitionEnd",function(){d.onResize()}),n.bind(this.__ul,"transitionend",function(){d.onResize()}),n.bind(this.__ul,"oTransitionEnd",function(){d.onResize()}),this.onResize(),a.resizable&&u(this),d.getRoot(),a.parent||c()};return H.toggleHide=function(){F=!F,o.each(G,function(a){a.domElement.style.zIndex=F?-999:999,a.domElement.style.opacity=F?0:1})},H.CLASS_AUTO_PLACE="a",H.CLASS_AUTO_PLACE_CONTAINER="ac",H.CLASS_MAIN="main",H.CLASS_CONTROLLER_ROW="cr",H.CLASS_TOO_TALL="taller-than-window",H.CLASS_CLOSED="closed",H.CLASS_CLOSE_BUTTON="close-button",H.CLASS_DRAG="drag",H.DEFAULT_WIDTH=245,H.TEXT_CLOSED="Close Controls",H.TEXT_OPEN="Open Controls",n.bind(window,"keydown",function(a){"text"!==document.activeElement.type&&(72===a.which||72==a.keyCode)&&H.toggleHide()},!1),o.extend(H.prototype,{add:function(a,b){return p(this,a,b,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(a,b){return p(this,a,b,{color:!0})},remove:function(a){this.__ul.removeChild(a.__li),this.__controllers.slice(this.__controllers.indexOf(a),1);var b=this;o.defer(function(){b.onResize()})},destroy:function(){this.autoPlace&&D.removeChild(this.domElement)},addFolder:function(a){if(void 0!==this.__folders[a])throw Error('You already have a folder in this GUI by the name "'+a+'"');var b={name:a,parent:this};return b.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[a]&&(b.closed=this.load.folders[a].closed,b.load=this.load.folders[a]),b=new H(b),this.__folders[a]=b,a=q(this,b.domElement),n.addClass(a,"folder"),b},open:function(){this.closed=!1},close:function(){this.closed=!0},onResize:function(){var a=this.getRoot();if(a.scrollable){var b=n.getOffset(a.__ul).top,c=0;o.each(a.__ul.childNodes,function(b){a.autoPlace&&b===a.__save_row||(c+=n.getHeight(b))}),window.innerHeight-b-20<c?(n.addClass(a.domElement,H.CLASS_TOO_TALL),a.__ul.style.height=window.innerHeight-b-20+"px"):(n.removeClass(a.domElement,H.CLASS_TOO_TALL),a.__ul.style.height="auto")}a.__resize_handle&&o.defer(function(){a.__resize_handle.style.height=a.__ul.offsetHeight+"px"}),a.__closeButton&&(a.__closeButton.style.width=a.width+"px")},remember:function(){if(o.isUndefined(C)&&(C=new m,C.domElement.innerHTML=b),this.parent)throw Error("You can only call remember on a top level GUI.");var a=this;o.each(Array.prototype.slice.call(arguments),function(b){0==a.__rememberedObjects.length&&t(a),-1==a.__rememberedObjects.indexOf(b)&&a.__rememberedObjects.push(b)}),this.autoPlace&&v(this,this.width)},getRoot:function(){for(var a=this;a.parent;)a=a.parent;return a},getSaveObject:function(){var a=this.load;return a.closed=this.closed,this.__rememberedObjects.length>0&&(a.preset=this.preset,a.remembered||(a.remembered={}),a.remembered[this.preset]=w(this)),a.folders={},o.each(this.__folders,function(b,c){a.folders[c]=b.getSaveObject()}),a},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=w(this),y(this,!1)},saveAs:function(a){this.load.remembered||(this.load.remembered={},this.load.remembered[B]=w(this,!0)),this.load.remembered[a]=w(this),this.preset=a,x(this,a,!0)},revert:function(a){o.each(this.__controllers,function(b){this.getRoot().load.remembered?s(a||this.getRoot(),b):b.setValue(b.initialValue)},this),o.each(this.__folders,function(a){a.revert(a)}),a||y(this.getRoot(),!1)},listen:function(a){var b=0==this.__listening.length;this.__listening.push(a),b&&z(this.__listening)}}),H
  }(dat.utils.css,'<div id="dg-save" class="dg dialogue">\n\n  Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n  <textarea id="dg-new-constructor"></textarea>\n\n  <div id="dg-save-locally">\n\n    <input id="dg-local-storage" type="checkbox"/> Automatically save\n    values to <code>localStorage</code> on exit.\n\n    <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n      override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n      easier to work incrementally, but <code>localStorage</code> is fragile,\n      and your friends may not see the same values you do.\n      \n    </div>\n    \n  </div>\n\n</div>',".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear;border:0;position:absolute;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-x:hidden}.dg.a.has-save ul{margin-top:27px}.dg.a.has-save ul.closed{margin-top:0}.dg.a .save-row{position:fixed;top:0;z-index:1002}.dg li{-webkit-transition:height 0.1s ease-out;-o-transition:height 0.1s ease-out;-moz-transition:height 0.1s ease-out;transition:height 0.1s ease-out}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;overflow:hidden;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li > *{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:9px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n",dat.controllers.factory=function(a,b,c,d,e,f,g){return function(h,i,j,k){var l=h[i];return g.isArray(j)||g.isObject(j)?new a(h,i,j):g.isNumber(l)?g.isNumber(j)&&g.isNumber(k)?new c(h,i,j,k):new b(h,i,{min:j,max:k}):g.isString(l)?new d(h,i):g.isFunction(l)?new e(h,i,""):g.isBoolean(l)?new f(h,i):void 0}}(dat.controllers.OptionController,dat.controllers.NumberControllerBox,dat.controllers.NumberControllerSlider,dat.controllers.StringController=function(a,b,c){var d=function(a,c){function e(){f.setValue(f.__input.value)}d.superclass.call(this,a,c);var f=this;this.__input=document.createElement("input"),this.__input.setAttribute("type","text"),b.bind(this.__input,"keyup",e),b.bind(this.__input,"change",e),b.bind(this.__input,"blur",function(){f.__onFinishChange&&f.__onFinishChange.call(f,f.getValue())}),b.bind(this.__input,"keydown",function(a){13===a.keyCode&&this.blur()}),this.updateDisplay(),this.domElement.appendChild(this.__input)};return d.superclass=a,c.extend(d.prototype,a.prototype,{updateDisplay:function(){return b.isActive(this.__input)||(this.__input.value=this.getValue()),d.superclass.prototype.updateDisplay.call(this)}}),d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common),dat.controllers.FunctionController,dat.controllers.BooleanController,dat.utils.common),dat.controllers.Controller,dat.controllers.BooleanController,dat.controllers.FunctionController,dat.controllers.NumberControllerBox,dat.controllers.NumberControllerSlider,dat.controllers.OptionController,dat.controllers.ColorController=function(a,b,c,d,e){function f(a,b,c,d){a.style.background="",e.each(i,function(e){a.style.cssText+="background: "+e+"linear-gradient("+b+", "+c+" 0%, "+d+" 100%); "})}function g(a){a.style.background="",a.style.cssText+="background: -moz-linear-gradient(top,  #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",a.style.cssText+="background: -webkit-linear-gradient(top,  #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",a.style.cssText+="background: -o-linear-gradient(top,  #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",a.style.cssText+="background: -ms-linear-gradient(top,  #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",a.style.cssText+="background: linear-gradient(top,  #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}var h=function(a,i){function j(a){n(a),b.bind(window,"mousemove",n),b.bind(window,"mouseup",k)}function k(){b.unbind(window,"mousemove",n),b.unbind(window,"mouseup",k)}function l(){var a=d(this.value);!1!==a?(p.__color.__state=a,p.setValue(p.__color.toOriginal())):this.value=p.__color.toString()}function m(){b.unbind(window,"mousemove",o),b.unbind(window,"mouseup",m)}function n(a){a.preventDefault();var c=b.getWidth(p.__saturation_field),d=b.getOffset(p.__saturation_field),e=(a.clientX-d.left+document.body.scrollLeft)/c,a=1-(a.clientY-d.top+document.body.scrollTop)/c;return a>1?a=1:a<0&&(a=0),e>1?e=1:e<0&&(e=0),p.__color.v=a,p.__color.s=e,p.setValue(p.__color.toOriginal()),!1}function o(a){a.preventDefault();var c=b.getHeight(p.__hue_field),d=b.getOffset(p.__hue_field),a=1-(a.clientY-d.top+document.body.scrollTop)/c;return a>1?a=1:a<0&&(a=0),p.__color.h=360*a,p.setValue(p.__color.toOriginal()),!1}h.superclass.call(this,a,i),this.__color=new c(this.getValue()),this.__temp=new c(0);var p=this;this.domElement=document.createElement("div"),b.makeSelectable(this.domElement,!1),this.__selector=document.createElement("div"),this.__selector.className="selector",this.__saturation_field=document.createElement("div"),this.__saturation_field.className="saturation-field",this.__field_knob=document.createElement("div"),this.__field_knob.className="field-knob",this.__field_knob_border="2px solid ",this.__hue_knob=document.createElement("div"),this.__hue_knob.className="hue-knob",this.__hue_field=document.createElement("div"),this.__hue_field.className="hue-field",this.__input=document.createElement("input"),this.__input.type="text",this.__input_textShadow="0 1px 1px ",b.bind(this.__input,"keydown",function(a){13===a.keyCode&&l.call(this)}),b.bind(this.__input,"blur",l),b.bind(this.__selector,"mousedown",function(){b.addClass(this,"drag").bind(window,"mouseup",function(){b.removeClass(p.__selector,"drag")})});var q=document.createElement("div");e.extend(this.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),e.extend(this.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:this.__field_knob_border+(this.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),e.extend(this.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),e.extend(this.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),e.extend(q.style,{width:"100%",height:"100%",background:"none"}),f(q,"top","rgba(0,0,0,0)","#000"),e.extend(this.__hue_field.style,{width:"15px",height:"100px",display:"inline-block",border:"1px solid #555",cursor:"ns-resize"}),g(this.__hue_field),e.extend(this.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:this.__input_textShadow+"rgba(0,0,0,0.7)"}),b.bind(this.__saturation_field,"mousedown",j),b.bind(this.__field_knob,"mousedown",j),b.bind(this.__hue_field,"mousedown",function(a){o(a),b.bind(window,"mousemove",o),b.bind(window,"mouseup",m)}),this.__saturation_field.appendChild(q),this.__selector.appendChild(this.__field_knob),this.__selector.appendChild(this.__saturation_field),this.__selector.appendChild(this.__hue_field),this.__hue_field.appendChild(this.__hue_knob),this.domElement.appendChild(this.__input),this.domElement.appendChild(this.__selector),this.updateDisplay()};h.superclass=a,e.extend(h.prototype,a.prototype,{updateDisplay:function(){var a=d(this.getValue());if(!1!==a){var b=!1;e.each(c.COMPONENTS,function(c){if(!e.isUndefined(a[c])&&!e.isUndefined(this.__color.__state[c])&&a[c]!==this.__color.__state[c])return b=!0,{}},this),b&&e.extend(this.__color.__state,a)}e.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var g=this.__color.v<.5||this.__color.s>.5?255:0,h=255-g;e.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toString(),border:this.__field_knob_border+"rgb("+g+","+g+","+g+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,f(this.__saturation_field,"left","#fff",this.__temp.toString()),e.extend(this.__input.style,{backgroundColor:this.__input.value=this.__color.toString(),color:"rgb("+g+","+g+","+g+")",textShadow:this.__input_textShadow+"rgba("+h+","+h+","+h+",.7)"})}});var i=["-moz-","-o-","-webkit-","-ms-",""];return h}(dat.controllers.Controller,dat.dom.dom,dat.color.Color=function(a,b,c,d){function e(a,b,c){Object.defineProperty(a,b,{get:function(){return"RGB"===this.__state.space?this.__state[b]:(g(this,b,c),this.__state[b])},set:function(a){"RGB"!==this.__state.space&&(g(this,b,c),this.__state.space="RGB"),this.__state[b]=a}})}function f(a,b){Object.defineProperty(a,b,{get:function(){return"HSV"===this.__state.space?this.__state[b]:(h(this),this.__state[b])},set:function(a){"HSV"!==this.__state.space&&(h(this),this.__state.space="HSV"),this.__state[b]=a}})}function g(a,c,e){if("HEX"===a.__state.space)a.__state[c]=b.component_from_hex(a.__state.hex,e);else{if("HSV"!==a.__state.space)throw"Corrupted color state";d.extend(a.__state,b.hsv_to_rgb(a.__state.h,a.__state.s,a.__state.v))}}function h(a){var c=b.rgb_to_hsv(a.r,a.g,a.b);d.extend(a.__state,{s:c.s,v:c.v}),d.isNaN(c.h)?d.isUndefined(a.__state.h)&&(a.__state.h=0):a.__state.h=c.h}var i=function(){if(this.__state=a.apply(this,arguments),!1===this.__state)throw"Failed to interpret color arguments";this.__state.a=this.__state.a||1};return i.COMPONENTS="r,g,b,h,s,v,hex,a".split(","),d.extend(i.prototype,{toString:function(){return c(this)},toOriginal:function(){return this.__state.conversion.write(this)}}),e(i.prototype,"r",2),e(i.prototype,"g",1),e(i.prototype,"b",0),f(i.prototype,"h"),f(i.prototype,"s"),f(i.prototype,"v"),Object.defineProperty(i.prototype,"a",{get:function(){return this.__state.a},set:function(a){this.__state.a=a}}),Object.defineProperty(i.prototype,"hex",{get:function(){return"HEX"!==!this.__state.space&&(this.__state.hex=b.rgb_to_hex(this.r,this.g,this.b)),this.__state.hex},set:function(a){this.__state.space="HEX",this.__state.hex=a}}),i}(dat.color.interpret,dat.color.math=function(){var a;return{hsv_to_rgb:function(a,b,c){var d=a/60-Math.floor(a/60),e=c*(1-b),f=c*(1-d*b),b=c*(1-(1-d)*b),a=[[c,b,e],[f,c,e],[e,c,b],[e,f,c],[b,e,c],[c,e,f]][Math.floor(a/60)%6];return{r:255*a[0],g:255*a[1],b:255*a[2]}},rgb_to_hsv:function(a,b,c){var d=Math.min(a,b,c),e=Math.max(a,b,c),d=e-d;return 0==e?{h:NaN,s:0,v:0}:(a=a==e?(b-c)/d:b==e?2+(c-a)/d:4+(a-b)/d,a/=6,a<0&&(a+=1),{h:360*a,s:d/e,v:e/255})},rgb_to_hex:function(a,b,c){return a=this.hex_with_component(0,2,a),a=this.hex_with_component(a,1,b),a=this.hex_with_component(a,0,c)},component_from_hex:function(a,b){return a>>8*b&255},hex_with_component:function(b,c,d){return d<<(a=8*c)|b&~(255<<a)}}}(),dat.color.toString,dat.utils.common),dat.color.interpret,dat.utils.common),dat.utils.requestAnimationFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),dat.dom.CenteredDiv=function(a,b){var c=function(){this.backgroundElement=document.createElement("div"),b.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear"}),a.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),b.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var c=this;a.bind(this.backgroundElement,"click",function(){c.hide()})};return c.prototype.show=function(){var a=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),b.defer(function(){a.backgroundElement.style.opacity=1,a.domElement.style.opacity=1,a.domElement.style.webkitTransform="scale(1)"})},c.prototype.hide=function(){var b=this,c=function(){b.domElement.style.display="none",b.backgroundElement.style.display="none",a.unbind(b.domElement,"webkitTransitionEnd",c),a.unbind(b.domElement,"transitionend",c),a.unbind(b.domElement,"oTransitionEnd",c)};a.bind(this.domElement,"webkitTransitionEnd",c),a.bind(this.domElement,"transitionend",c),a.bind(this.domElement,"oTransitionEnd",c),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"},c.prototype.layout=function(){this.domElement.style.left=window.innerWidth/2-a.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-a.getHeight(this.domElement)/2+"px"},c}(dat.dom.dom,dat.utils.common),dat.dom.dom,dat.utils.common);var Stats=function(){var a=Date.now(),b=a,c=0,d=1/0,e=0,f=0,g=1/0,h=0,i=0,j=0,k=document.createElement("div");k.id="stats",k.addEventListener("mousedown",function(a){a.preventDefault(),s(++j%2)},!1),k.style.cssText="width:80px;opacity:0.9;cursor:pointer";var l=document.createElement("div");l.id="fps",l.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002",k.appendChild(l);var m=document.createElement("div");m.id="fpsText",m.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px",m.innerHTML="FPS",l.appendChild(m);var n=document.createElement("div");for(n.id="fpsGraph",n.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff",l.appendChild(n);74>n.children.length;){var o=document.createElement("span");o.style.cssText="width:1px;height:30px;float:left;background-color:#113",n.appendChild(o)}var p=document.createElement("div");p.id="ms",p.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none",k.appendChild(p);var q=document.createElement("div");q.id="msText",q.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px",q.innerHTML="MS",p.appendChild(q);var r=document.createElement("div");for(r.id="msGraph",r.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0",p.appendChild(r);74>r.children.length;)o=document.createElement("span"),o.style.cssText="width:1px;height:30px;float:left;background-color:#131",r.appendChild(o);var s=function(a){switch(j=a){case 0:l.style.display="block",p.style.display="none";break;case 1:l.style.display="none",p.style.display="block"}};return{REVISION:11,domElement:k,setMode:s,begin:function(){a=Date.now()},end:function(){var j=Date.now();c=j-a,d=Math.min(d,c),e=Math.max(e,c),q.textContent=c+" MS ("+d+"-"+e+")";var k=Math.min(30,30-c/200*30);return r.appendChild(r.firstChild).style.height=k+"px",i++,j>b+1e3&&(f=Math.round(1e3*i/(j-b)),g=Math.min(g,f),h=Math.max(h,f),m.textContent=f+" FPS ("+g+"-"+h+")",k=Math.min(30,30-f/100*30),n.appendChild(n.firstChild).style.height=k+"px",b=j,i=0),j},update:function(){a=this.end()}}},THREE={REVISION:"71"};"object"==typeof module&&(module.exports=THREE),void 0===Math.sign&&(Math.sign=function(a){return a<0?-1:a>0?1:+a}),THREE.log=function(){console.log.apply(console,arguments)},THREE.warn=function(){console.warn.apply(console,arguments)},THREE.error=function(){console.error.apply(console,arguments)},THREE.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2},THREE.CullFaceNone=0,THREE.CullFaceBack=1,THREE.CullFaceFront=2,THREE.CullFaceFrontBack=3,THREE.FrontFaceDirectionCW=0,THREE.FrontFaceDirectionCCW=1,THREE.BasicShadowMap=0,THREE.PCFShadowMap=1,THREE.PCFSoftShadowMap=2,THREE.FrontSide=0,THREE.BackSide=1,THREE.DoubleSide=2,THREE.NoShading=0,THREE.FlatShading=1,THREE.SmoothShading=2,THREE.NoColors=0,THREE.FaceColors=1,THREE.VertexColors=2,THREE.NoBlending=0,THREE.NormalBlending=1,THREE.AdditiveBlending=2,THREE.SubtractiveBlending=3,THREE.MultiplyBlending=4,THREE.CustomBlending=5,THREE.AddEquation=100,THREE.SubtractEquation=101,THREE.ReverseSubtractEquation=102,THREE.MinEquation=103,THREE.MaxEquation=104,THREE.ZeroFactor=200,THREE.OneFactor=201,THREE.SrcColorFactor=202,THREE.OneMinusSrcColorFactor=203,THREE.SrcAlphaFactor=204,THREE.OneMinusSrcAlphaFactor=205,THREE.DstAlphaFactor=206,THREE.OneMinusDstAlphaFactor=207,THREE.DstColorFactor=208,THREE.OneMinusDstColorFactor=209,THREE.SrcAlphaSaturateFactor=210,THREE.MultiplyOperation=0,THREE.MixOperation=1,THREE.AddOperation=2,THREE.UVMapping=300,THREE.CubeReflectionMapping=301,THREE.CubeRefractionMapping=302,THREE.EquirectangularReflectionMapping=303,THREE.EquirectangularRefractionMapping=304,THREE.SphericalReflectionMapping=305,THREE.RepeatWrapping=1e3,THREE.ClampToEdgeWrapping=1001,THREE.MirroredRepeatWrapping=1002,THREE.NearestFilter=1003,THREE.NearestMipMapNearestFilter=1004,THREE.NearestMipMapLinearFilter=1005,THREE.LinearFilter=1006,THREE.LinearMipMapNearestFilter=1007,THREE.LinearMipMapLinearFilter=1008,THREE.UnsignedByteType=1009,THREE.ByteType=1010,THREE.ShortType=1011,THREE.UnsignedShortType=1012,THREE.IntType=1013,THREE.UnsignedIntType=1014,THREE.FloatType=1015,THREE.HalfFloatType=1025,THREE.UnsignedShort4444Type=1016,THREE.UnsignedShort5551Type=1017,THREE.UnsignedShort565Type=1018,THREE.AlphaFormat=1019,THREE.RGBFormat=1020,THREE.RGBAFormat=1021,THREE.LuminanceFormat=1022,THREE.LuminanceAlphaFormat=1023,THREE.RGBEFormat=THREE.RGBAFormat,THREE.RGB_S3TC_DXT1_Format=2001,THREE.RGBA_S3TC_DXT1_Format=2002,THREE.RGBA_S3TC_DXT3_Format=2003,THREE.RGBA_S3TC_DXT5_Format=2004,THREE.RGB_PVRTC_4BPPV1_Format=2100,THREE.RGB_PVRTC_2BPPV1_Format=2101,THREE.RGBA_PVRTC_4BPPV1_Format=2102,THREE.RGBA_PVRTC_2BPPV1_Format=2103,THREE.Projector=function(){THREE.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(a,b){THREE.warn("THREE.Projector: .projectVector() is now vector.project()."),a.project(b)},this.unprojectVector=function(a,b){THREE.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),a.unproject(b)},this.pickingRay=function(a,b){THREE.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}},THREE.CanvasRenderer=function(){THREE.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElement("canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}},THREE.Color=function(a){return 3===arguments.length?this.setRGB(arguments[0],arguments[1],arguments[2]):this.set(a)},THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,set:function(a){return a instanceof THREE.Color?this.copy(a):"number"==typeof a?this.setHex(a):"string"==typeof a&&this.setStyle(a),this},setHex:function(a){return a=Math.floor(a),this.r=(a>>16&255)/255,this.g=(a>>8&255)/255,this.b=(255&a)/255,this},setRGB:function(a,b,c){return this.r=a,this.g=b,this.b=c,this},setHSL:function(a,b,c){if(0===b)this.r=this.g=this.b=c;else{var d=function(a,b,c){return c<0&&(c+=1),c>1&&(c-=1),c<1/6?a+6*(b-a)*c:c<.5?b:c<2/3?a+6*(b-a)*(2/3-c):a},e=c<=.5?c*(1+b):c+b-c*b,f=2*c-e;this.r=d(f,e,a+1/3),this.g=d(f,e,a),this.b=d(f,e,a-1/3)}return this},setStyle:function(a){if(/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.test(a)){var b=/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.exec(a);return this.r=Math.min(255,parseInt(b[1],10))/255,this.g=Math.min(255,parseInt(b[2],10))/255,this.b=Math.min(255,parseInt(b[3],10))/255,this}if(/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.test(a)){var b=/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.exec(a);return this.r=Math.min(100,parseInt(b[1],10))/100,this.g=Math.min(100,parseInt(b[2],10))/100,this.b=Math.min(100,parseInt(b[3],10))/100,this}if(/^\#([0-9a-f]{6})$/i.test(a)){var b=/^\#([0-9a-f]{6})$/i.exec(a);return this.setHex(parseInt(b[1],16)),this}if(/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.test(a)){var b=/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(a);return this.setHex(parseInt(b[1]+b[1]+b[2]+b[2]+b[3]+b[3],16)),this}if(/^(\w+)$/i.test(a))return this.setHex(THREE.ColorKeywords[a]),this},copy:function(a){return this.r=a.r,this.g=a.g,this.b=a.b,this},copyGammaToLinear:function(a,b){return 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),this},copyLinearToGamma:function(a,b){void 0===b&&(b=2);var c=b>0?1/b:1;return this.r=Math.pow(a.r,c),this.g=Math.pow(a.g,c),this.b=Math.pow(a.b,c),this},convertGammaToLinear:function(){var a=this.r,b=this.g,c=this.b;return this.r=a*a,this.g=b*b,this.b=c*c,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 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){var b,c,d=a||{h:0,s:0,l:0},e=this.r,f=this.g,g=this.b,h=Math.max(e,f,g),i=Math.min(e,f,g),j=(i+h)/2;if(i===h)b=0,c=0;else{var k=h-i;switch(c=j<=.5?k/(h+i):k/(2-h-i),h){case e:b=(f-g)/k+(f<g?6:0);break;case f:b=(g-e)/k+2;break;case g:b=(e-f)/k+4}b/=6}return d.h=b,d.s=c,d.l=j,d},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(a,b,c){var d=this.getHSL();return d.h+=a,d.s+=b,d.l+=c,this.setHSL(d.h,d.s,d.l),this},add:function(a){return this.r+=a.r,this.g+=a.g,this.b+=a.b,this},addColors:function(a,b){return this.r=a.r+b.r,this.g=a.g+b.g,this.b=a.b+b.b,this},addScalar:function(a){return this.r+=a,this.g+=a,this.b+=a,this},multiply:function(a){return this.r*=a.r,this.g*=a.g,this.b*=a.b,this},multiplyScalar:function(a){return this.r*=a,this.g*=a,this.b*=a,this},lerp:function(a,b){return this.r+=(a.r-this.r)*b,this.g+=(a.g-this.g)*b,this.b+=(a.b-this.b)*b,this},equals:function(a){return a.r===this.r&&a.g===this.g&&a.b===this.b},fromArray:function(a){return this.r=a[0],this.g=a[1],this.b=a[2],this},toArray:function(a,b){return void 0===a&&(a=[]),void 0===b&&(b=0),a[b]=this.r,a[b+1]=this.g,a[b+2]=this.b,a},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}},THREE.ColorKeywords={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},THREE.Quaternion=function(a,b,c,d){this._x=a||0,this._y=b||0,this._z=c||0,this._w=void 0!==d?d:1},THREE.Quaternion.prototype={constructor:THREE.Quaternion,_x:0,_y:0,_z:0,_w:0,get x(){return this._x},set x(a){this._x=a,this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a,this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a,this.onChangeCallback()},get w(){return this._w},set w(a){this._w=a,this.onChangeCallback()},set:function(a,b,c,d){return this._x=a,this._y=b,this._z=c,this._w=d,this.onChangeCallback(),this},copy:function(a){return this._x=a.x,this._y=a.y,this._z=a.z,this._w=a.w,this.onChangeCallback(),this},setFromEuler:function(a,b){if(a instanceof THREE.Euler==!1)throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var c=Math.cos(a._x/2),d=Math.cos(a._y/2),e=Math.cos(a._z/2),f=Math.sin(a._x/2),g=Math.sin(a._y/2),h=Math.sin(a._z/2);return"XYZ"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e-f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e-f*g*h):"YXZ"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e-f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e+f*g*h):"ZXY"===a.order?(this._x=f*d*e-c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e-f*g*h):"ZYX"===a.order?(this._x=f*d*e-c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e+f*g*h):"YZX"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e-f*g*h):"XZY"===a.order&&(this._x=f*d*e-c*g*h,this._y=c*g*e-f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e+f*g*h),!1!==b&&this.onChangeCallback(),this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);return this._x=a.x*d,this._y=a.y*d,this._z=a.z*d,this._w=Math.cos(c),this.onChangeCallback(),this},setFromRotationMatrix:function(a){var b,c=a.elements,d=c[0],e=c[4],f=c[8],g=c[1],h=c[5],i=c[9],j=c[2],k=c[6],l=c[10],m=d+h+l;return m>0?(b=.5/Math.sqrt(m+1),this._w=.25/b,this._x=(k-i)*b,this._y=(f-j)*b,this._z=(g-e)*b):d>h&&d>l?(b=2*Math.sqrt(1+d-h-l),this._w=(k-i)/b,this._x=.25*b,this._y=(e+g)/b,this._z=(f+j)/b):h>l?(b=2*Math.sqrt(1+h-d-l),this._w=(f-j)/b,this._x=(e+g)/b,this._y=.25*b,this._z=(i+k)/b):(b=2*Math.sqrt(1+l-d-h),this._w=(g-e)/b,this._x=(f+j)/b,this._y=(i+k)/b,this._z=.25*b),this.onChangeCallback(),this},setFromUnitVectors:function(){var a,b;return function(c,d){return void 0===a&&(a=new THREE.Vector3),b=c.dot(d)+1,b<1e-6?(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,this.normalize(),this}}(),inverse:function(){return this.conjugate().normalize(),this},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),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)},normalize:function(){var a=this.length();return 0===a?(this._x=0,this._y=0,this._z=0,this._w=1):(a=1/a,this._x=this._x*a,this._y=this._y*a,this._z=this._z*a,this._w=this._w*a),this.onChangeCallback(),this},multiply:function(a,b){return void 0!==b?(THREE.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z,f=a._w,g=b._x,h=b._y,i=b._z,j=b._w;return this._x=c*j+f*g+d*i-e*h,this._y=d*j+f*h+e*g-c*i,this._z=e*j+f*i+c*h-d*g,this._w=f*j-c*g-d*h-e*i,this.onChangeCallback(),this},multiplyVector3:function(a){return THREE.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),a.applyQuaternion(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;if(g<0?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a),g>=1)return this._w=f,this._x=c,this._y=d,this._z=e,this;var h=Math.acos(g),i=Math.sqrt(1-g*g);if(Math.abs(i)<.001)return this._w=.5*(f+this._w),this._x=.5*(c+this._x),this._y=.5*(d+this._y),this._z=.5*(e+this._z),this;var j=Math.sin((1-b)*h)/i,k=Math.sin(b*h)/i;return this._w=f*j+this._w*k,this._x=c*j+this._x*k,this._y=d*j+this._y*k,this._z=e*j+this._z*k,this.onChangeCallback(),this},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a,b){return 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(),this},toArray:function(a,b){return 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,a},onChange:function(a){return this.onChangeCallback=a,this},onChangeCallback:function(){},clone:function(){return new THREE.Quaternion(this._x,this._y,this._z,this._w)}},THREE.Quaternion.slerp=function(a,b,c,d){return c.copy(a).slerp(b,d)},THREE.Vector2=function(a,b){this.x=a||0,this.y=b||0},THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){return this.x=a,this.y=b,this},setX:function(a){return this.x=a,this},setY:function(a){return this.y=a,this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw new Error("index is out of range: "+a)}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+a)}},copy:function(a){return this.x=a.x,this.y=a.y,this},add:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b)):(this.x+=a.x,this.y+=a.y,this)},addScalar:function(a){return this.x+=a,this.y+=a,this},addVectors:function(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this},sub:function(a,b){return void 0!==b?(THREE.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,this)},subScalar:function(a){return this.x-=a,this.y-=a,this},subVectors:function(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this},multiply:function(a){return this.x*=a.x,this.y*=a.y,this},multiplyScalar:function(a){return this.x*=a,this.y*=a,this},divide:function(a){return this.x/=a.x,this.y/=a.y,this},divideScalar:function(a){if(0!==a){var b=1/a;this.x*=b,this.y*=b}else this.x=0,this.y=0;return this},min:function(a){return this.x>a.x&&(this.x=a.x),this.y>a.y&&(this.y=a.y),this},max:function(a){return this.x<a.x&&(this.x=a.x),this.y<a.y&&(this.y=a.y),this},clamp:function(a,b){return this.x<a.x?this.x=a.x:this.x>b.x&&(this.x=b.x),this.y<a.y?this.y=a.y:this.y>b.y&&(this.y=b.y),this},clampScalar:function(){var a,b;return function(c,d){return void 0===a&&(a=new THREE.Vector2,b=new THREE.Vector2),a.set(c,c),b.set(d,d),this.clamp(a,b)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(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*this.x+this.y*this.y)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;return b*b+c*c},setLength:function(a){var b=this.length();return 0!==b&&a!==b&&this.multiplyScalar(a/b),this},lerp:function(a,b){return this.x+=(a.x-this.x)*b,this.y+=(a.y-this.y)*b,this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a),this},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a,b){return void 0===b&&(b=0),this.x=a[b],this.y=a[b+1],this},toArray:function(a,b){return void 0===a&&(a=[]),void 0===b&&(b=0),a[b]=this.x,a[b+1]=this.y,a},fromAttribute:function(a,b,c){return void 0===c&&(c=0),b=b*a.itemSize+c,this.x=a.array[b],this.y=a.array[b+1],this},clone:function(){return new THREE.Vector2(this.x,this.y)}},THREE.Vector3=function(a,b,c){this.x=a||0,this.y=b||0,this.z=c||0},THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){return this.x=a,this.y=b,this.z=c,this},setX:function(a){return this.x=a,this},setY:function(a){return this.y=a,this},setZ:function(a){return this.z=a,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 new Error("index is out of range: "+a)}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+a)}},copy:function(a){return this.x=a.x,this.y=a.y,this.z=a.z,this},add:function(a,b){return void 0!==b?(THREE.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,this)},addScalar:function(a){return this.x+=a,this.y+=a,this.z+=a,this},addVectors:function(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this.z=a.z+b.z,this},sub:function(a,b){return void 0!==b?(THREE.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,this)},subScalar:function(a){return this.x-=a,this.y-=a,this.z-=a,this},subVectors:function(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this.z=a.z-b.z,this},multiply:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(a,b)):(this.x*=a.x,this.y*=a.y,this.z*=a.z,this)},multiplyScalar:function(a){return this.x*=a,this.y*=a,this.z*=a,this},multiplyVectors:function(a,b){return this.x=a.x*b.x,this.y=a.y*b.y,this.z=a.z*b.z,this},applyEuler:function(){var a;return function(b){return b instanceof THREE.Euler==!1&&THREE.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order."),void 0===a&&(a=new THREE.Quaternion),this.applyQuaternion(a.setFromEuler(b)),this}}(),applyAxisAngle:function(){var a;return function(b,c){return void 0===a&&(a=new THREE.Quaternion),this.applyQuaternion(a.setFromAxisAngle(b,c)),this}}(),applyMatrix3:function(a){var b=this.x,c=this.y,d=this.z,e=a.elements;return this.x=e[0]*b+e[3]*c+e[6]*d,this.y=e[1]*b+e[4]*c+e[7]*d,this.z=e[2]*b+e[5]*c+e[8]*d,this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z,e=a.elements;return this.x=e[0]*b+e[4]*c+e[8]*d+e[12],this.y=e[1]*b+e[5]*c+e[9]*d+e[13],this.z=e[2]*b+e[6]*c+e[10]*d+e[14],this},applyProjection:function(a){var b=this.x,c=this.y,d=this.z,e=a.elements,f=1/(e[3]*b+e[7]*c+e[11]*d+e[15]);return this.x=(e[0]*b+e[4]*c+e[8]*d+e[12])*f,this.y=(e[1]*b+e[5]*c+e[9]*d+e[13])*f,this.z=(e[2]*b+e[6]*c+e[10]*d+e[14])*f,this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z,h=a.w,i=h*b+f*d-g*c,j=h*c+g*b-e*d,k=h*d+e*c-f*b,l=-e*b-f*c-g*d;return this.x=i*h+l*-e+j*-g-k*-f,this.y=j*h+l*-f+k*-e-i*-g,this.z=k*h+l*-g+i*-f-j*-e,this},project:function(){var a;return function(b){return void 0===a&&(a=new THREE.Matrix4),a.multiplyMatrices(b.projectionMatrix,a.getInverse(b.matrixWorld)),this.applyProjection(a)}}(),unproject:function(){var a;return function(b){return void 0===a&&(a=new THREE.Matrix4),a.multiplyMatrices(b.matrixWorld,a.getInverse(b.projectionMatrix)),this.applyProjection(a)}}(),transformDirection:function(a){var b=this.x,c=this.y,d=this.z,e=a.elements;return this.x=e[0]*b+e[4]*c+e[8]*d,this.y=e[1]*b+e[5]*c+e[9]*d,this.z=e[2]*b+e[6]*c+e[10]*d,this.normalize(),this},divide:function(a){return this.x/=a.x,this.y/=a.y,this.z/=a.z,this},divideScalar:function(a){if(0!==a){var b=1/a;this.x*=b,this.y*=b,this.z*=b}else this.x=0,this.y=0,this.z=0;return this},min:function(a){return this.x>a.x&&(this.x=a.x),this.y>a.y&&(this.y=a.y),this.z>a.z&&(this.z=a.z),this},max:function(a){return this.x<a.x&&(this.x=a.x),this.y<a.y&&(this.y=a.y),this.z<a.z&&(this.z=a.z),this},clamp:function(a,b){return this.x<a.x?this.x=a.x:this.x>b.x&&(this.x=b.x),this.y<a.y?this.y=a.y:this.y>b.y&&(this.y=b.y),this.z<a.z?this.z=a.z:this.z>b.z&&(this.z=b.z),this},clampScalar:function(){var a,b;return function(c,d){return void 0===a&&(a=new THREE.Vector3,b=new THREE.Vector3),a.set(c,c,c),b.set(d,d,d),this.clamp(a,b)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(a){return this.x*a.x+this.y*a.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)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){var b=this.length();return 0!==b&&a!==b&&this.multiplyScalar(a/b),this},lerp:function(a,b){return this.x+=(a.x-this.x)*b,this.y+=(a.y-this.y)*b,this.z+=(a.z-this.z)*b,this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a),this},cross:function(a,b){if(void 0!==b)return THREE.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(a,b);var c=this.x,d=this.y,e=this.z;return this.x=d*a.z-e*a.y,this.y=e*a.x-c*a.z,this.z=c*a.y-d*a.x,this},crossVectors:function(a,b){var c=a.x,d=a.y,e=a.z,f=b.x,g=b.y,h=b.z;return this.x=d*h-e*g,this.y=e*f-c*h,this.z=c*g-d*f,this},projectOnVector:function(){var a,b;return function(c){return void 0===a&&(a=new THREE.Vector3),a.copy(c).normalize(),b=this.dot(a),this.copy(a).multiplyScalar(b)}}(),projectOnPlane:function(){var a;return function(b){return void 0===a&&(a=new THREE.Vector3),a.copy(this).projectOnVector(b),this.sub(a)}}(),reflect:function(){var a;return function(b){return void 0===a&&(a=new THREE.Vector3),this.sub(a.copy(b).multiplyScalar(2*this.dot(b)))}}(),angleTo:function(a){var b=this.dot(a)/(this.length()*a.length());return Math.acos(THREE.Math.clamp(b,-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,d=this.z-a.z;return b*b+c*c+d*d},setEulerFromRotationMatrix:function(a,b){THREE.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(a,b){THREE.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(a){return THREE.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(a)},getScaleFromMatrix:function(a){return THREE.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(a)},getColumnFromMatrix:function(a,b){return THREE.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(a,b)},setFromMatrixPosition:function(a){return this.x=a.elements[12],this.y=a.elements[13],this.z=a.elements[14],this},setFromMatrixScale:function(a){var b=this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length(),d=this.set(a.elements[8],a.elements[9],a.elements[10]).length();return this.x=b,this.y=c,this.z=d,this},setFromMatrixColumn:function(a,b){var c=4*a,d=b.elements;return this.x=d[c],this.y=d[c+1],this.z=d[c+2],this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a,b){return void 0===b&&(b=0),this.x=a[b],this.y=a[b+1],this.z=a[b+2],this},toArray:function(a,b){return void 0===a&&(a=[]),void 0===b&&(b=0),a[b]=this.x,a[b+1]=this.y,a[b+2]=this.z,a},fromAttribute:function(a,b,c){return void 0===c&&(c=0),b=b*a.itemSize+c,this.x=a.array[b],this.y=a.array[b+1],this.z=a.array[b+2],this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}},THREE.Vector4=function(a,b,c,d){this.x=a||0,this.y=b||0,this.z=c||0,this.w=void 0!==d?d:1},THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){return this.x=a,this.y=b,this.z=c,this.w=d,this},setX:function(a){return this.x=a,this},setY:function(a){return this.y=a,this},setZ:function(a){return this.z=a,this},setW:function(a){return this.w=a,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 new Error("index is out of range: "+a)}},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 new Error("index is out of range: "+a)}},copy:function(a){return this.x=a.x,this.y=a.y,this.z=a.z,this.w=void 0!==a.w?a.w:1,this},add:function(a,b){return void 0!==b?(THREE.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,this)},addScalar:function(a){return this.x+=a,this.y+=a,this.z+=a,this.w+=a,this},addVectors:function(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this.z=a.z+b.z,this.w=a.w+b.w,this},sub:function(a,b){return void 0!==b?(THREE.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,this)},subScalar:function(a){return this.x-=a,this.y-=a,this.z-=a,this.w-=a,this},subVectors:function(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this.z=a.z-b.z,this.w=a.w-b.w,this},multiplyScalar:function(a){return this.x*=a,this.y*=a,this.z*=a,this.w*=a,this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,f=a.elements;return this.x=f[0]*b+f[4]*c+f[8]*d+f[12]*e,this.y=f[1]*b+f[5]*c+f[9]*d+f[13]*e,this.z=f[2]*b+f[6]*c+f[10]*d+f[14]*e,this.w=f[3]*b+f[7]*c+f[11]*d+f[15]*e,this},divideScalar:function(a){if(0!==a){var b=1/a;this.x*=b,this.y*=b,this.z*=b,this.w*=b}else this.x=0,this.y=0,this.z=0,this.w=1;return this},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);return b<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b),this},setAxisAngleFromRotationMatrix:function(a){var b,c,d,e,f=.01,g=.1,h=a.elements,i=h[0],j=h[4],k=h[8],l=h[1],m=h[5],n=h[9],o=h[2],p=h[6],q=h[10];if(Math.abs(j-l)<f&&Math.abs(k-o)<f&&Math.abs(n-p)<f){if(Math.abs(j+l)<g&&Math.abs(k+o)<g&&Math.abs(n+p)<g&&Math.abs(i+m+q-3)<g)return this.set(1,0,0,0),this;b=Math.PI;var r=(i+1)/2,s=(m+1)/2,t=(q+1)/2,u=(j+l)/4,v=(k+o)/4,w=(n+p)/4;return r>s&&r>t?r<f?(c=0,d=.707106781,e=.707106781):(c=Math.sqrt(r),d=u/c,e=v/c):s>t?s<f?(c=.707106781,d=0,e=.707106781):(d=Math.sqrt(s),c=u/d,e=w/d):t<f?(c=.707106781,d=.707106781,e=0):(e=Math.sqrt(t),c=v/e,d=w/e),this.set(c,d,e,b),this}var x=Math.sqrt((p-n)*(p-n)+(k-o)*(k-o)+(l-j)*(l-j));return Math.abs(x)<.001&&(x=1),this.x=(p-n)/x,this.y=(k-o)/x,this.z=(l-j)/x,this.w=Math.acos((i+m+q-1)/2),this},min:function(a){return this.x>a.x&&(this.x=a.x),this.y>a.y&&(this.y=a.y),this.z>a.z&&(this.z=a.z),this.w>a.w&&(this.w=a.w),this},max:function(a){return this.x<a.x&&(this.x=a.x),this.y<a.y&&(this.y=a.y),this.z<a.z&&(this.z=a.z),this.w<a.w&&(this.w=a.w),this},clamp:function(a,b){return this.x<a.x?this.x=a.x:this.x>b.x&&(this.x=b.x),this.y<a.y?this.y=a.y:this.y>b.y&&(this.y=b.y),this.z<a.z?this.z=a.z:this.z>b.z&&(this.z=b.z),this.w<a.w?this.w=a.w:this.w>b.w&&(this.w=b.w),this},clampScalar:function(){var a,b;return function(c,d){return void 0===a&&(a=new THREE.Vector4,b=new THREE.Vector4),a.set(c,c,c,c),b.set(d,d,d,d),this.clamp(a,b)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(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)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){var b=this.length();return 0!==b&&a!==b&&this.multiplyScalar(a/b),this},lerp:function(a,b){return 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,this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a),this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a,b){return 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},toArray:function(a,b){return 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,a},fromAttribute:function(a,b,c){return void 0===c&&(c=0),b=b*a.itemSize+c,this.x=a.array[b],this.y=a.array[b+1],this.z=a.array[b+2],this.w=a.array[b+3],this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}},THREE.Euler=function(a,b,c,d){this._x=a||0,this._y=b||0,this._z=c||0,this._order=d||THREE.Euler.DefaultOrder},THREE.Euler.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],THREE.Euler.DefaultOrder="XYZ",THREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,get x(){return this._x},set x(a){this._x=a,this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a,this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a,this.onChangeCallback()},get order(){return this._order},set order(a){this._order=a,this.onChangeCallback()},set:function(a,b,c,d){return this._x=a,this._y=b,this._z=c,this._order=d||this._order,this.onChangeCallback(),this},copy:function(a){return this._x=a._x,this._y=a._y,this._z=a._z,this._order=a._order,this.onChangeCallback(),this},setFromRotationMatrix:function(a,b,c){var d=THREE.Math.clamp,e=a.elements,f=e[0],g=e[4],h=e[8],i=e[1],j=e[5],k=e[9],l=e[2],m=e[6],n=e[10];return b=b||this._order,"XYZ"===b?(this._y=Math.asin(d(h,-1,1)),Math.abs(h)<.99999?(this._x=Math.atan2(-k,n),this._z=Math.atan2(-g,f)):(this._x=Math.atan2(m,j),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(k,-1,1)),Math.abs(k)<.99999?(this._y=Math.atan2(h,n),this._z=Math.atan2(i,j)):(this._y=Math.atan2(-l,f),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(m,-1,1)),Math.abs(m)<.99999?(this._y=Math.atan2(-l,n),this._z=Math.atan2(-g,j)):(this._y=0,this._z=Math.atan2(i,f))):"ZYX"===b?(this._y=Math.asin(-d(l,-1,1)),Math.abs(l)<.99999?(this._x=Math.atan2(m,n),this._z=Math.atan2(i,f)):(this._x=0,this._z=Math.atan2(-g,j))):"YZX"===b?(this._z=Math.asin(d(i,-1,1)),Math.abs(i)<.99999?(this._x=Math.atan2(-k,j),this._y=Math.atan2(-l,f)):(this._x=0,this._y=Math.atan2(h,n))):"XZY"===b?(this._z=Math.asin(-d(g,-1,1)),Math.abs(g)<.99999?(this._x=Math.atan2(m,j),this._y=Math.atan2(h,f)):(this._x=Math.atan2(-k,n),this._y=0)):THREE.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b),this._order=b,!1!==c&&this.onChangeCallback(),this},setFromQuaternion:function(){var a;return function(b,c,d){return void 0===a&&(a=new THREE.Matrix4),a.makeRotationFromQuaternion(b),this.setFromRotationMatrix(a,c,d),this}}(),setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,b||this._order)},reorder:function(){var a=new THREE.Quaternion;return function(b){a.setFromEuler(this),this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){return this._x=a[0],this._y=a[1],this._z=a[2],void 0!==a[3]&&(this._order=a[3]),this.onChangeCallback(),this},toArray:function(a,b){return 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,a},toVector3:function(a){return a?a.set(this._x,this._y,this._z):new THREE.Vector3(this._x,this._y,this._z)},onChange:function(a){return this.onChangeCallback=a,this},onChangeCallback:function(){},clone:function(){return new THREE.Euler(this._x,this._y,this._z,this._order)}},THREE.Line3=function(a,b){this.start=void 0!==a?a:new THREE.Vector3,this.end=void 0!==b?b:new THREE.Vector3},THREE.Line3.prototype={constructor:THREE.Line3,set:function(a,b){return this.start.copy(a),this.end.copy(b),this},copy:function(a){return this.start.copy(a.start),this.end.copy(a.end),this},center:function(a){return(a||new THREE.Vector3).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(a){return(a||new THREE.Vector3).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(a,b){var c=b||new THREE.Vector3;return this.delta(c).multiplyScalar(a).add(this.start)},closestPointToPointParameter:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d){a.subVectors(c,this.start),b.subVectors(this.end,this.start);var e=b.dot(b),f=b.dot(a),g=f/e;return d&&(g=THREE.Math.clamp(g,0,1)),g}}(),closestPointToPoint:function(a,b,c){var d=this.closestPointToPointParameter(a,b),e=c||new THREE.Vector3;return this.delta(e).multiplyScalar(d).add(this.start)},applyMatrix4:function(a){return this.start.applyMatrix4(a),this.end.applyMatrix4(a),this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)},clone:function(){return(new THREE.Line3).copy(this)}},THREE.Box2=function(a,b){this.min=void 0!==a?a:new THREE.Vector2(1/0,1/0),this.max=void 0!==b?b:new THREE.Vector2(-1/0,-1/0)},THREE.Box2.prototype={constructor:THREE.Box2,set:function(a,b){return this.min.copy(a),this.max.copy(b),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 THREE.Vector2;return function(b,c){var d=a.copy(c).multiplyScalar(.5);return this.min.copy(b).sub(d),this.max.copy(b).add(d),this}}(),copy:function(a){return this.min.copy(a.min),this.max.copy(a.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},empty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},center:function(a){return(a||new THREE.Vector2).addVectors(this.min,this.max).multiplyScalar(.5)},size:function(a){return(a||new THREE.Vector2).subVectors(this.max,this.min)},expandByPoint:function(a){return this.min.min(a),this.max.max(a),this},expandByVector:function(a){return this.min.sub(a),this.max.add(a),this},expandByScalar:function(a){return this.min.addScalar(-a),this.max.addScalar(a),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)},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},getParameter:function(a,b){return(b||new THREE.Vector2).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox: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)},clampPoint:function(a,b){return(b||new THREE.Vector2).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector2;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),intersect:function(a){return this.min.max(a.min),this.max.min(a.max),this},union:function(a){return this.min.min(a.min),this.max.max(a.max),this},translate:function(a){return this.min.add(a),this.max.add(a),this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)},clone:function(){return(new THREE.Box2).copy(this)}},THREE.Box3=function(a,b){this.min=void 0!==a?a:new THREE.Vector3(1/0,1/0,1/0),this.max=void 0!==b?b:new THREE.Vector3(-1/0,-1/0,-1/0)},THREE.Box3.prototype={constructor:THREE.Box3,set:function(a,b){return this.min.copy(a),this.max.copy(b),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 THREE.Vector3;return function(b,c){var d=a.copy(c).multiplyScalar(.5);return this.min.copy(b).sub(d),this.max.copy(b).add(d),this}}(),setFromObject:function(){var a=new THREE.Vector3;return function(b){var c=this;return b.updateMatrixWorld(!0),this.makeEmpty(),b.traverse(function(b){var d=b.geometry;if(void 0!==d)if(d instanceof THREE.Geometry)for(var e=d.vertices,f=0,g=e.length;f<g;f++)a.copy(e[f]),a.applyMatrix4(b.matrixWorld),c.expandByPoint(a);else if(d instanceof THREE.BufferGeometry&&void 0!==d.attributes.position)for(var h=d.attributes.position.array,f=0,g=h.length;f<g;f+=3)a.set(h[f],h[f+1],h[f+2]),a.applyMatrix4(b.matrixWorld),c.expandByPoint(a)}),this}}(),copy:function(a){return this.min.copy(a.min),this.max.copy(a.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},empty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},center:function(a){return(a||new THREE.Vector3).addVectors(this.min,this.max).multiplyScalar(.5)},size:function(a){return(a||new THREE.Vector3).subVectors(this.max,this.min)},expandByPoint:function(a){return this.min.min(a),this.max.max(a),this},expandByVector:function(a){return this.min.sub(a),this.max.add(a),this},expandByScalar:function(a){return this.min.addScalar(-a),this.max.addScalar(a),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)},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){return(b||new THREE.Vector3).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox: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)},clampPoint:function(a,b){return(b||new THREE.Vector3).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),getBoundingSphere:function(){var a=new THREE.Vector3;return function(b){var c=b||new THREE.Sphere;return c.center=this.center(),c.radius=.5*this.size(a).length(),c}}(),intersect:function(a){return this.min.max(a.min),this.max.min(a.max),this},union:function(a){return this.min.min(a.min),this.max.max(a.max),this},applyMatrix4:function(){var a=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];return function(b){return a[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(b),a[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(b),a[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(b),a[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(b),a[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(b),a[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(b),a[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(b),a[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(b),this.makeEmpty(),this.setFromPoints(a),this}}(),translate:function(a){return this.min.add(a),this.max.add(a),this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)},clone:function(){return(new THREE.Box3).copy(this)}},THREE.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]),arguments.length>0&&THREE.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")},THREE.Matrix3.prototype={constructor:THREE.Matrix3,set:function(a,b,c,d,e,f,g,h,i){var j=this.elements;return j[0]=a,j[3]=b,j[6]=c,j[1]=d,j[4]=e,j[7]=f,j[2]=g,j[5]=h,j[8]=i,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},copy:function(a){var b=a.elements;return this.set(b[0],b[3],b[6],b[1],b[4],b[7],b[2],b[5],b[8]),this},multiplyVector3:function(a){return THREE.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),a.applyMatrix3(this)},multiplyVector3Array:function(a){return THREE.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(a)},applyToVector3Array:function(){var a=new THREE.Vector3;return function(b,c,d){void 0===c&&(c=0),void 0===d&&(d=b.length);for(var e=0,f=c;e<d;e+=3,f+=3)a.x=b[f],a.y=b[f+1],a.z=b[f+2],a.applyMatrix3(this),b[f]=a.x,b[f+1]=a.y,b[f+2]=a.z;return b}}(),multiplyScalar:function(a){var b=this.elements;return 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]*=a,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],i=a[7],j=a[8];return b*f*j-b*g*i-c*e*j+c*g*h+d*e*i-d*f*h},getInverse:function(a,b){var c=a.elements,d=this.elements;d[0]=c[10]*c[5]-c[6]*c[9],d[1]=-c[10]*c[1]+c[2]*c[9],d[2]=c[6]*c[1]-c[2]*c[5],d[3]=-c[10]*c[4]+c[6]*c[8],d[4]=c[10]*c[0]-c[2]*c[8],
  d[5]=-c[6]*c[0]+c[2]*c[4],d[6]=c[9]*c[4]-c[5]*c[8],d[7]=-c[9]*c[0]+c[1]*c[8],d[8]=c[5]*c[0]-c[1]*c[4];var e=c[0]*d[0]+c[1]*d[3]+c[2]*d[6];if(0===e){var f="Matrix3.getInverse(): can't invert matrix, determinant is 0";if(b)throw new Error(f);return THREE.warn(f),this.identity(),this}return this.multiplyScalar(1/e),this},transpose:function(){var a,b=this.elements;return a=b[1],b[1]=b[3],b[3]=a,a=b[2],b[2]=b[6],b[6]=a,a=b[5],b[5]=b[7],b[7]=a,this},flattenToArrayOffset:function(a,b){var c=this.elements;return 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},getNormalMatrix:function(a){return this.getInverse(a).transpose(),this},transposeIntoArray:function(a){var b=this.elements;return 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],this},fromArray:function(a){return this.elements.set(a),this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8]]},clone:function(){return(new THREE.Matrix3).fromArray(this.elements)}},THREE.Matrix4=function(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),arguments.length>0&&THREE.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")},THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){var q=this.elements;return q[0]=a,q[4]=b,q[8]=c,q[12]=d,q[1]=e,q[5]=f,q[9]=g,q[13]=h,q[2]=i,q[6]=j,q[10]=k,q[14]=l,q[3]=m,q[7]=n,q[11]=o,q[15]=p,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},copy:function(a){return this.elements.set(a.elements),this},extractPosition:function(a){return THREE.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(a)},copyPosition:function(a){var b=this.elements,c=a.elements;return b[12]=c[12],b[13]=c[13],b[14]=c[14],this},extractBasis:function(a,b,c){var d=this.elements;return a.set(d[0],d[1],d[2]),b.set(d[4],d[5],d[6]),c.set(d[8],d[9],d[10]),this},makeBasis:function(a,b,c){return 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),this},extractRotation:function(){var a=new THREE.Vector3;return function(b){var c=this.elements,d=b.elements,e=1/a.set(d[0],d[1],d[2]).length(),f=1/a.set(d[4],d[5],d[6]).length(),g=1/a.set(d[8],d[9],d[10]).length();return c[0]=d[0]*e,c[1]=d[1]*e,c[2]=d[2]*e,c[4]=d[4]*f,c[5]=d[5]*f,c[6]=d[6]*f,c[8]=d[8]*g,c[9]=d[9]*g,c[10]=d[10]*g,this}}(),makeRotationFromEuler:function(a){a instanceof THREE.Euler==!1&&THREE.error("THREE.Matrix: .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),g=Math.sin(c),h=Math.cos(d),i=Math.sin(d),j=Math.cos(e),k=Math.sin(e);if("XYZ"===a.order){var l=f*j,m=f*k,n=g*j,o=g*k;b[0]=h*j,b[4]=-h*k,b[8]=i,b[1]=m+n*i,b[5]=l-o*i,b[9]=-g*h,b[2]=o-l*i,b[6]=n+m*i,b[10]=f*h}else if("YXZ"===a.order){var p=h*j,q=h*k,r=i*j,s=i*k;b[0]=p+s*g,b[4]=r*g-q,b[8]=f*i,b[1]=f*k,b[5]=f*j,b[9]=-g,b[2]=q*g-r,b[6]=s+p*g,b[10]=f*h}else if("ZXY"===a.order){var p=h*j,q=h*k,r=i*j,s=i*k;b[0]=p-s*g,b[4]=-f*k,b[8]=r+q*g,b[1]=q+r*g,b[5]=f*j,b[9]=s-p*g,b[2]=-f*i,b[6]=g,b[10]=f*h}else if("ZYX"===a.order){var l=f*j,m=f*k,n=g*j,o=g*k;b[0]=h*j,b[4]=n*i-m,b[8]=l*i+o,b[1]=h*k,b[5]=o*i+l,b[9]=m*i-n,b[2]=-i,b[6]=g*h,b[10]=f*h}else if("YZX"===a.order){var t=f*h,u=f*i,v=g*h,w=g*i;b[0]=h*j,b[4]=w-t*k,b[8]=v*k+u,b[1]=k,b[5]=f*j,b[9]=-g*j,b[2]=-i*j,b[6]=u*k+v,b[10]=t-w*k}else if("XZY"===a.order){var t=f*h,u=f*i,v=g*h,w=g*i;b[0]=h*j,b[4]=-k,b[8]=i*j,b[1]=t*k+w,b[5]=f*j,b[9]=u*k-v,b[2]=v*k-u,b[6]=g*j,b[10]=w*k+t}return b[3]=0,b[7]=0,b[11]=0,b[12]=0,b[13]=0,b[14]=0,b[15]=1,this},setRotationFromQuaternion:function(a){return THREE.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(a)},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,h=d+d,i=e+e,j=c*g,k=c*h,l=c*i,m=d*h,n=d*i,o=e*i,p=f*g,q=f*h,r=f*i;return b[0]=1-(m+o),b[4]=k-r,b[8]=l+q,b[1]=k+r,b[5]=1-(j+o),b[9]=n-p,b[2]=l-q,b[6]=n+p,b[10]=1-(j+m),b[3]=0,b[7]=0,b[11]=0,b[12]=0,b[13]=0,b[14]=0,b[15]=1,this},lookAt:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f){var g=this.elements;return c.subVectors(d,e).normalize(),0===c.length()&&(c.z=1),a.crossVectors(f,c).normalize(),0===a.length()&&(c.x+=1e-4,a.crossVectors(f,c).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,this}}(),multiply:function(a,b){return void 0!==b?(THREE.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],i=c[12],j=c[1],k=c[5],l=c[9],m=c[13],n=c[2],o=c[6],p=c[10],q=c[14],r=c[3],s=c[7],t=c[11],u=c[15],v=d[0],w=d[4],x=d[8],y=d[12],z=d[1],A=d[5],B=d[9],C=d[13],D=d[2],E=d[6],F=d[10],G=d[14],H=d[3],I=d[7],J=d[11],K=d[15];return e[0]=f*v+g*z+h*D+i*H,e[4]=f*w+g*A+h*E+i*I,e[8]=f*x+g*B+h*F+i*J,e[12]=f*y+g*C+h*G+i*K,e[1]=j*v+k*z+l*D+m*H,e[5]=j*w+k*A+l*E+m*I,e[9]=j*x+k*B+l*F+m*J,e[13]=j*y+k*C+l*G+m*K,e[2]=n*v+o*z+p*D+q*H,e[6]=n*w+o*A+p*E+q*I,e[10]=n*x+o*B+p*F+q*J,e[14]=n*y+o*C+p*G+q*K,e[3]=r*v+s*z+t*D+u*H,e[7]=r*w+s*A+t*E+u*I,e[11]=r*x+s*B+t*F+u*J,e[15]=r*y+s*C+t*G+u*K,this},multiplyToArray:function(a,b,c){var d=this.elements;return this.multiplyMatrices(a,b),c[0]=d[0],c[1]=d[1],c[2]=d[2],c[3]=d[3],c[4]=d[4],c[5]=d[5],c[6]=d[6],c[7]=d[7],c[8]=d[8],c[9]=d[9],c[10]=d[10],c[11]=d[11],c[12]=d[12],c[13]=d[13],c[14]=d[14],c[15]=d[15],this},multiplyScalar:function(a){var b=this.elements;return 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,this},multiplyVector3:function(a){return THREE.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),a.applyProjection(this)},multiplyVector4:function(a){return THREE.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),a.applyMatrix4(this)},multiplyVector3Array:function(a){return THREE.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(a)},applyToVector3Array:function(){var a=new THREE.Vector3;return function(b,c,d){void 0===c&&(c=0),void 0===d&&(d=b.length);for(var e=0,f=c;e<d;e+=3,f+=3)a.x=b[f],a.y=b[f+1],a.z=b[f+2],a.applyMatrix4(this),b[f]=a.x,b[f+1]=a.y,b[f+2]=a.z;return b}}(),rotateAxis:function(a){THREE.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),a.transformDirection(this)},crossVector:function(a){return THREE.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),a.applyMatrix4(this)},determinant: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],i=a[13],j=a[2],k=a[6],l=a[10],m=a[14];return a[3]*(+e*h*k-d*i*k-e*g*l+c*i*l+d*g*m-c*h*m)+a[7]*(+b*h*m-b*i*l+e*f*l-d*f*m+d*i*j-e*h*j)+a[11]*(+b*i*k-b*g*m-e*f*k+c*f*m+e*g*j-c*i*j)+a[15]*(-d*g*j-b*h*k+b*g*l+d*f*k-c*f*l+c*h*j)},transpose:function(){var a,b=this.elements;return a=b[1],b[1]=b[4],b[4]=a,a=b[2],b[2]=b[8],b[8]=a,a=b[6],b[6]=b[9],b[9]=a,a=b[3],b[3]=b[12],b[12]=a,a=b[7],b[7]=b[13],b[13]=a,a=b[11],b[11]=b[14],b[14]=a,this},flattenToArrayOffset:function(a,b){var c=this.elements;return 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],a},getPosition:function(){var a=new THREE.Vector3;return function(){THREE.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var b=this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=this.elements;return b[12]=a.x,b[13]=a.y,b[14]=a.z,this},getInverse:function(a,b){var c=this.elements,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[12],i=d[1],j=d[5],k=d[9],l=d[13],m=d[2],n=d[6],o=d[10],p=d[14],q=d[3],r=d[7],s=d[11],t=d[15];c[0]=k*p*r-l*o*r+l*n*s-j*p*s-k*n*t+j*o*t,c[4]=h*o*r-g*p*r-h*n*s+f*p*s+g*n*t-f*o*t,c[8]=g*l*r-h*k*r+h*j*s-f*l*s-g*j*t+f*k*t,c[12]=h*k*n-g*l*n-h*j*o+f*l*o+g*j*p-f*k*p,c[1]=l*o*q-k*p*q-l*m*s+i*p*s+k*m*t-i*o*t,c[5]=g*p*q-h*o*q+h*m*s-e*p*s-g*m*t+e*o*t,c[9]=h*k*q-g*l*q-h*i*s+e*l*s+g*i*t-e*k*t,c[13]=g*l*m-h*k*m+h*i*o-e*l*o-g*i*p+e*k*p,c[2]=j*p*q-l*n*q+l*m*r-i*p*r-j*m*t+i*n*t,c[6]=h*n*q-f*p*q-h*m*r+e*p*r+f*m*t-e*n*t,c[10]=f*l*q-h*j*q+h*i*r-e*l*r-f*i*t+e*j*t,c[14]=h*j*m-f*l*m-h*i*n+e*l*n+f*i*p-e*j*p,c[3]=k*n*q-j*o*q-k*m*r+i*o*r+j*m*s-i*n*s,c[7]=f*o*q-g*n*q+g*m*r-e*o*r-f*m*s+e*n*s,c[11]=g*j*q-f*k*q-g*i*r+e*k*r+f*i*s-e*j*s,c[15]=f*k*m-g*j*m+g*i*n-e*k*n-f*i*o+e*j*o;var u=e*c[0]+i*c[4]+m*c[8]+q*c[12];if(0==u){var v="THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";if(b)throw new Error(v);return THREE.warn(v),this.identity(),this}return this.multiplyScalar(1/u),this},translate:function(a){THREE.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(a){THREE.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(a){THREE.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(a){THREE.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(a,b){THREE.error("THREE.Matrix4: .rotateByAxis() has been removed.")},scale:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z;return b[0]*=c,b[4]*=d,b[8]*=e,b[1]*=c,b[5]*=d,b[9]*=e,b[2]*=c,b[6]*=d,b[10]*=e,b[3]*=c,b[7]*=d,b[11]*=e,this},getMaxScaleOnAxis:function(){var a=this.elements,b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2],c=a[4]*a[4]+a[5]*a[5]+a[6]*a[6],d=a[8]*a[8]+a[9]*a[9]+a[10]*a[10];return Math.sqrt(Math.max(b,Math.max(c,d)))},makeTranslation:function(a,b,c){return this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1),this},makeRotationX:function(a){var b=Math.cos(a),c=Math.sin(a);return this.set(1,0,0,0,0,b,-c,0,0,c,b,0,0,0,0,1),this},makeRotationY:function(a){var b=Math.cos(a),c=Math.sin(a);return this.set(b,0,c,0,0,1,0,0,-c,0,b,0,0,0,0,1),this},makeRotationZ:function(a){var b=Math.cos(a),c=Math.sin(a);return this.set(b,-c,0,0,c,b,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,g=a.y,h=a.z,i=e*f,j=e*g;return this.set(i*f+c,i*g-d*h,i*h+d*g,0,i*g+d*h,j*g+c,j*h-d*f,0,i*h-d*g,j*h+d*f,e*h*h+c,0,0,0,0,1),this},makeScale:function(a,b,c){return this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1),this},compose:function(a,b,c){return this.makeRotationFromQuaternion(b),this.scale(c),this.setPosition(a),this},decompose:function(){var a=new THREE.Vector3,b=new THREE.Matrix4;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(),i=a.set(f[8],f[9],f[10]).length();this.determinant()<0&&(g=-g),c.x=f[12],c.y=f[13],c.z=f[14],b.elements.set(this.elements);var j=1/g,k=1/h,l=1/i;return b.elements[0]*=j,b.elements[1]*=j,b.elements[2]*=j,b.elements[4]*=k,b.elements[5]*=k,b.elements[6]*=k,b.elements[8]*=l,b.elements[9]*=l,b.elements[10]*=l,d.setFromRotationMatrix(b),e.x=g,e.y=h,e.z=i,this}}(),makeFrustum:function(a,b,c,d,e,f){var g=this.elements,h=2*e/(b-a),i=2*e/(d-c),j=(b+a)/(b-a),k=(d+c)/(d-c),l=-(f+e)/(f-e),m=-2*f*e/(f-e);return g[0]=h,g[4]=0,g[8]=j,g[12]=0,g[1]=0,g[5]=i,g[9]=k,g[13]=0,g[2]=0,g[6]=0,g[10]=l,g[14]=m,g[3]=0,g[7]=0,g[11]=-1,g[15]=0,this},makePerspective:function(a,b,c,d){var e=c*Math.tan(THREE.Math.degToRad(.5*a)),f=-e,g=f*b,h=e*b;return this.makeFrustum(g,h,f,e,c,d)},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=b-a,i=c-d,j=f-e,k=(b+a)/h,l=(c+d)/i,m=(f+e)/j;return g[0]=2/h,g[4]=0,g[8]=0,g[12]=-k,g[1]=0,g[5]=2/i,g[9]=0,g[13]=-l,g[2]=0,g[6]=0,g[10]=-2/j,g[14]=-m,g[3]=0,g[7]=0,g[11]=0,g[15]=1,this},fromArray:function(a){return this.elements.set(a),this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]]},clone:function(){return(new THREE.Matrix4).fromArray(this.elements)}},THREE.Ray=function(a,b){this.origin=void 0!==a?a:new THREE.Vector3,this.direction=void 0!==b?b:new THREE.Vector3},THREE.Ray.prototype={constructor:THREE.Ray,set:function(a,b){return this.origin.copy(a),this.direction.copy(b),this},copy:function(a){return this.origin.copy(a.origin),this.direction.copy(a.direction),this},at:function(a,b){return(b||new THREE.Vector3).copy(this.direction).multiplyScalar(a).add(this.origin)},recast:function(){var a=new THREE.Vector3;return function(b){return this.origin.copy(this.at(b,a)),this}}(),closestPointToPoint:function(a,b){var c=b||new THREE.Vector3;c.subVectors(a,this.origin);var d=c.dot(this.direction);return d<0?c.copy(this.origin):c.copy(this.direction).multiplyScalar(d).add(this.origin)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);return c<0?this.origin.distanceTo(b):(a.copy(this.direction).multiplyScalar(c).add(this.origin),a.distanceTo(b))}}(),distanceSqToSegment:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;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,i,j,k,l=.5*d.distanceTo(e),m=-this.direction.dot(b),n=c.dot(this.direction),o=-c.dot(b),p=c.lengthSq(),q=Math.abs(1-m*m);if(q>0)if(h=m*o-n,i=m*n-o,k=l*q,h>=0)if(i>=-k)if(i<=k){var r=1/q;h*=r,i*=r,j=h*(h+m*i+2*n)+i*(m*h+i+2*o)+p}else i=l,h=Math.max(0,-(m*i+n)),j=-h*h+i*(i+2*o)+p;else i=-l,h=Math.max(0,-(m*i+n)),j=-h*h+i*(i+2*o)+p;else i<=-k?(h=Math.max(0,-(-m*l+n)),i=h>0?-l:Math.min(Math.max(-l,-o),l),j=-h*h+i*(i+2*o)+p):i<=k?(h=0,i=Math.min(Math.max(-l,-o),l),j=i*(i+2*o)+p):(h=Math.max(0,-(m*l+n)),i=h>0?l:Math.min(Math.max(-l,-o),l),j=-h*h+i*(i+2*o)+p);else i=m>0?-l:l,h=Math.max(0,-(m*i+n)),j=-h*h+i*(i+2*o)+p;return f&&f.copy(this.direction).multiplyScalar(h).add(this.origin),g&&g.copy(b).multiplyScalar(i).add(a),j}}(),isIntersectionSphere:function(a){return this.distanceToPoint(a.center)<=a.radius},intersectSphere:function(){var a=new THREE.Vector3;return function(b,c){a.subVectors(b.center,this.origin);var d=a.dot(this.direction),e=a.dot(a)-d*d,f=b.radius*b.radius;if(e>f)return null;var g=Math.sqrt(f-e),h=d-g,i=d+g;return h<0&&i<0?null:h<0?this.at(i,c):this.at(h,c)}}(),isIntersectionPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||a.normal.dot(this.direction)*b<0},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0==b)return 0==a.distanceToPoint(this.origin)?0:null;var c=-(this.origin.dot(a.normal)+a.constant)/b;return c>=0?c:null},intersectPlane:function(a,b){var c=this.distanceToPlane(a);return null===c?null:this.at(c,b)},isIntersectionBox:function(){var a=new THREE.Vector3;return function(b){return null!==this.intersectBox(b,a)}}(),intersectBox:function(a,b){var c,d,e,f,g,h,i=1/this.direction.x,j=1/this.direction.y,k=1/this.direction.z,l=this.origin;return i>=0?(c=(a.min.x-l.x)*i,d=(a.max.x-l.x)*i):(c=(a.max.x-l.x)*i,d=(a.min.x-l.x)*i),j>=0?(e=(a.min.y-l.y)*j,f=(a.max.y-l.y)*j):(e=(a.max.y-l.y)*j,f=(a.min.y-l.y)*j),c>f||e>d?null:((e>c||c!==c)&&(c=e),(f<d||d!==d)&&(d=f),k>=0?(g=(a.min.z-l.z)*k,h=(a.max.z-l.z)*k):(g=(a.max.z-l.z)*k,h=(a.min.z-l.z)*k),c>h||g>d?null:((g>c||c!==c)&&(c=g),(h<d||d!==d)&&(d=h),d<0?null:this.at(c>=0?c:d,b)))},intersectTriangle:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Vector3;return function(e,f,g,h,i){b.subVectors(f,e),c.subVectors(g,e),d.crossVectors(b,c);var j,k=this.direction.dot(d);if(k>0){if(h)return null;j=1}else{if(!(k<0))return null;j=-1,k=-k}a.subVectors(this.origin,e);var l=j*this.direction.dot(c.crossVectors(a,c));if(l<0)return null;var m=j*this.direction.dot(b.cross(a));if(m<0)return null;if(l+m>k)return null;var n=-j*a.dot(d);return n<0?null:this.at(n/k,i)}}(),applyMatrix4:function(a){return this.direction.add(this.origin).applyMatrix4(a),this.origin.applyMatrix4(a),this.direction.sub(this.origin),this.direction.normalize(),this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)},clone:function(){return(new THREE.Ray).copy(this)}},THREE.Sphere=function(a,b){this.center=void 0!==a?a:new THREE.Vector3,this.radius=void 0!==b?b:0},THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){return this.center.copy(a),this.radius=b,this},setFromPoints:function(){var a=new THREE.Box3;return function(b,c){var d=this.center;void 0!==c?d.copy(c):a.setFromPoints(b).center(d);for(var e=0,f=0,g=b.length;f<g;f++)e=Math.max(e,d.distanceToSquared(b[f]));return this.radius=Math.sqrt(e),this}}(),copy:function(a){return this.center.copy(a.center),this.radius=a.radius,this},empty:function(){return this.radius<=0},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},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;return d.copy(a),c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center)),d},getBoundingBox:function(a){var b=a||new THREE.Box3;return b.set(this.center,this.center),b.expandByScalar(this.radius),b},applyMatrix4:function(a){return this.center.applyMatrix4(a),this.radius=this.radius*a.getMaxScaleOnAxis(),this},translate:function(a){return this.center.add(a),this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}},THREE.Frustum=function(a,b,c,d,e,f){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==f?f:new THREE.Plane]},THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;return g[0].copy(a),g[1].copy(b),g[2].copy(c),g[3].copy(d),g[4].copy(e),g[5].copy(f),this},copy:function(a){for(var b=this.planes,c=0;c<6;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements,d=c[0],e=c[1],f=c[2],g=c[3],h=c[4],i=c[5],j=c[6],k=c[7],l=c[8],m=c[9],n=c[10],o=c[11],p=c[12],q=c[13],r=c[14],s=c[15];return b[0].setComponents(g-d,k-h,o-l,s-p).normalize(),b[1].setComponents(g+d,k+h,o+l,s+p).normalize(),b[2].setComponents(g+e,k+i,o+m,s+q).normalize(),b[3].setComponents(g-e,k-i,o-m,s-q).normalize(),b[4].setComponents(g-f,k-j,o-n,s-r).normalize(),b[5].setComponents(g+f,k+j,o+n,s+r).normalize(),this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;return null===c.boundingSphere&&c.computeBoundingSphere(),a.copy(c.boundingSphere),a.applyMatrix4(b.matrixWorld),this.intersectsSphere(a)}}(),intersectsSphere:function(a){for(var b=this.planes,c=a.center,d=-a.radius,e=0;e<6;e++){if(b[e].distanceToPoint(c)<d)return!1}return!0},intersectsBox:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){for(var d=this.planes,e=0;e<6;e++){var f=d[e];a.x=f.normal.x>0?c.min.x:c.max.x,b.x=f.normal.x>0?c.max.x:c.min.x,a.y=f.normal.y>0?c.min.y:c.max.y,b.y=f.normal.y>0?c.max.y:c.min.y,a.z=f.normal.z>0?c.min.z:c.max.z,b.z=f.normal.z>0?c.max.z:c.min.z;var g=f.distanceToPoint(a),h=f.distanceToPoint(b);if(g<0&&h<0)return!1}return!0}}(),containsPoint:function(a){for(var b=this.planes,c=0;c<6;c++)if(b[c].distanceToPoint(a)<0)return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}},THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0),this.constant=void 0!==b?b:0},THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){return this.normal.copy(a),this.constant=b,this},setComponents:function(a,b,c,d){return this.normal.set(a,b,c),this.constant=d,this},setFromNormalAndCoplanarPoint:function(a,b){return this.normal.copy(a),this.constant=-b.dot(this.normal),this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){var f=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();return this.setFromNormalAndCoplanarPoint(f,c),this}}(),copy:function(a){return this.normal.copy(a.normal),this.constant=a.constant,this},normalize:function(){var a=1/this.normal.length();return this.normal.multiplyScalar(a),this.constant*=a,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(a){return this.normal.dot(a)+this.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a,b){return this.orthoPoint(a,b).sub(a).negate()},orthoPoint:function(a,b){var c=this.distanceToPoint(a);return(b||new THREE.Vector3).copy(this.normal).multiplyScalar(c)},isIntersectionLine:function(a){var b=this.distanceToPoint(a.start),c=this.distanceToPoint(a.end);return b<0&&c>0||c<0&&b>0},intersectLine:function(){var a=new THREE.Vector3;return function(b,c){var d=c||new THREE.Vector3,e=b.delta(a),f=this.normal.dot(e);if(0!=f){var g=-(b.start.dot(this.normal)+this.constant)/f;if(!(g<0||g>1))return d.copy(e).multiplyScalar(g).add(b.start)}else if(0==this.distanceToPoint(b.start))return d.copy(b.start)}}(),coplanarPoint:function(a){return(a||new THREE.Vector3).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Matrix3;return function(d,e){var f=e||c.getNormalMatrix(d),g=a.copy(this.normal).applyMatrix3(f),h=this.coplanarPoint(b);return h.applyMatrix4(d),this.setFromNormalAndCoplanarPoint(g,h),this}}(),translate:function(a){return this.constant=this.constant-a.dot(this.normal),this},equals:function(a){return a.normal.equals(this.normal)&&a.constant==this.constant},clone:function(){return(new THREE.Plane).copy(this)}},THREE.Math={generateUUID:function(){var a,b="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),c=new Array(36),d=0;return function(){for(var e=0;e<36;e++)8==e||13==e||18==e||23==e?c[e]="-":14==e?c[e]="4":(d<=2&&(d=33554432+16777216*Math.random()|0),a=15&d,d>>=4,c[e]=b[19==e?3&a|8:a]);return c.join("")}}(),clamp:function(a,b,c){return a<b?b:a>c?c:a},clampBottom:function(a,b){return a<b?b:a},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},smoothstep:function(a,b,c){return a<=b?0:a>=c?1:(a=(a-b)/(c-b))*a*(3-2*a)},smootherstep:function(a,b,c){return a<=b?0:a>=c?1:(a=(a-b)/(c-b))*a*a*(a*(6*a-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return Math.floor(this.randFloat(a,b))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},degToRad:function(){var a=Math.PI/180;return function(b){return b*a}}(),radToDeg:function(){var a=180/Math.PI;return function(b){return b*a}}(),isPowerOfTwo:function(a){return 0==(a&a-1)&&0!==a},nextPowerOfTwo:function(a){return a--,a|=a>>1,a|=a>>2,a|=a>>4,a|=a>>8,a|=a>>16,++a}},THREE.Spline=function(a){function b(a,b,c,d,e,f,g){var h=.5*(c-a),i=.5*(d-b);return(2*(b-c)+h+i)*g+(-3*(b-c)-2*h-i)*f+h*e+b}this.points=a;var c,d,e,f,g,h,i,j,k,l=[],m={x:0,y:0,z:0};this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}},this.getPoint=function(a){return c=(this.points.length-1)*a,d=Math.floor(c),e=c-d,l[0]=0===d?d:d-1,l[1]=d,l[2]=d>this.points.length-2?this.points.length-1:d+1,l[3]=d>this.points.length-3?this.points.length-1:d+2,h=this.points[l[0]],i=this.points[l[1]],j=this.points[l[2]],k=this.points[l[3]],f=e*e,g=e*f,m.x=b(h.x,i.x,j.x,k.x,e,f,g),m.y=b(h.y,i.y,j.y,k.y,e,f,g),m.z=b(h.z,i.z,j.z,k.z,e,f,g),m},this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a<c;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d},this.getLength=function(a){var b,c,d,e,f=0,g=0,h=0,i=new THREE.Vector3,j=new THREE.Vector3,k=[],l=0;for(k[0]=0,a||(a=100),d=this.points.length*a,i.copy(this.points[0]),b=1;b<d;b++)c=b/d,e=this.getPoint(c),j.copy(e),l+=j.distanceTo(i),i.copy(e),f=(this.points.length-1)*c,(g=Math.floor(f))!=h&&(k[g]=l,h=g);return k[k.length]=l,{chunks:k,total:l}},this.reparametrizeByArcLength=function(a){var b,c,d,e,f,g,h,i,j=[],k=new THREE.Vector3,l=this.getLength();for(j.push(k.copy(this.points[0]).clone()),b=1;b<this.points.length;b++){for(g=l.chunks[b]-l.chunks[b-1],h=Math.ceil(a*g/l.total),e=(b-1)/(this.points.length-1),f=b/(this.points.length-1),c=1;c<h-1;c++)d=e+c*(1/h)*(f-e),i=this.getPoint(d),j.push(k.copy(i).clone());j.push(k.copy(this.points[b]).clone())}this.points=j}},THREE.Triangle=function(a,b,c){this.a=void 0!==a?a:new THREE.Vector3,this.b=void 0!==b?b:new THREE.Vector3,this.c=void 0!==c?c:new THREE.Vector3},THREE.Triangle.normal=function(){var a=new THREE.Vector3;return function(b,c,d,e){var f=e||new THREE.Vector3;f.subVectors(d,c),a.subVectors(b,c),f.cross(a);var g=f.lengthSq();return g>0?f.multiplyScalar(1/Math.sqrt(g)):f.set(0,0,0)}}(),THREE.Triangle.barycoordFromPoint=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f,g,h){a.subVectors(g,e),b.subVectors(f,e),c.subVectors(d,e);var i=a.dot(a),j=a.dot(b),k=a.dot(c),l=b.dot(b),m=b.dot(c),n=i*l-j*j,o=h||new THREE.Vector3;if(0==n)return o.set(-2,-1,-1);var p=1/n,q=(l*k-j*m)*p,r=(i*m-j*k)*p;return o.set(1-q-r,r,q)}}(),THREE.Triangle.containsPoint=function(){var a=new THREE.Vector3;return function(b,c,d,e){var f=THREE.Triangle.barycoordFromPoint(b,c,d,e,a);return f.x>=0&&f.y>=0&&f.x+f.y<=1}}(),THREE.Triangle.prototype={constructor:THREE.Triangle,set:function(a,b,c){return this.a.copy(a),this.b.copy(b),this.c.copy(c),this},setFromPointsAndIndices:function(a,b,c,d){return this.a.copy(a[b]),this.b.copy(a[c]),this.c.copy(a[d]),this},copy:function(a){return this.a.copy(a.a),this.b.copy(a.b),this.c.copy(a.c),this},area:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){return a.subVectors(this.c,this.b),b.subVectors(this.a,this.b),.5*a.cross(b).length()}}(),midpoint:function(a){return(a||new THREE.Vector3).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(a){return THREE.Triangle.normal(this.a,this.b,this.c,a)},plane:function(a){return(a||new THREE.Plane).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(a,b){return THREE.Triangle.barycoordFromPoint(a,this.a,this.b,this.c,b)},containsPoint:function(a){return THREE.Triangle.containsPoint(a,this.a,this.b,this.c)},equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)},clone:function(){return(new THREE.Triangle).copy(this)}},THREE.Clock=function(a){this.autoStart=void 0===a||a,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1},THREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.startTime=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(),this.oldTime=this.startTime,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var a=0;if(this.autoStart&&!this.running&&this.start(),this.running){var b=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now();a=.001*(b-this.oldTime),this.oldTime=b,this.elapsedTime+=a}return a}},THREE.EventDispatcher=function(){},THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(a){a.addEventListener=THREE.EventDispatcher.prototype.addEventListener,a.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener,a.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener,a.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},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,b){if(void 0!==this._listeners){var c=this._listeners,d=c[a];if(void 0!==d){var e=d.indexOf(b);-1!==e&&d.splice(e,1)}}},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners,c=b[a.type];if(void 0!==c){a.target=this;for(var d=[],e=c.length,f=0;f<e;f++)d[f]=c[f];for(var f=0;f<e;f++)d[f].call(this,a)}}}},function(a){a.Raycaster=function(b,c,d,e){this.ray=new a.Ray(b,c),this.near=d||0,this.far=e||1/0,this.params={Sprite:{},Mesh:{},PointCloud:{threshold:1},LOD:{},Line:{}}};var b=function(a,b){return a.distance-b.distance},c=function(a,b,d,e){if(a.raycast(b,d),!0===e)for(var f=a.children,g=0,h=f.length;g<h;g++)c(f[g],b,d,!0)};a.Raycaster.prototype={constructor:a.Raycaster,precision:1e-4,linePrecision:1,set:function(a,b){this.ray.set(a,b)},setFromCamera:function(b,c){c instanceof a.PerspectiveCamera?(this.ray.origin.copy(c.position),this.ray.direction.set(b.x,b.y,.5).unproject(c).sub(c.position).normalize()):c instanceof a.OrthographicCamera?(this.ray.origin.set(b.x,b.y,-1).unproject(c),this.ray.direction.set(0,0,-1).transformDirection(c.matrixWorld)):a.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(a,d){var e=[];return c(a,this,e,d),e.sort(b),e},intersectObjects:function(d,e){var f=[];if(d instanceof Array==!1)return a.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),f;for(var g=0,h=d.length;g<h;g++)c(d[g],this,f,e);return f.sort(b),f}}}(THREE),THREE.Object3D=function(){Object.defineProperty(this,"id",{value:THREE.Object3DIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="Object3D",this.parent=void 0,this.children=[],this.up=THREE.Object3D.DefaultUp.clone();var a=new THREE.Vector3,b=new THREE.Euler,c=new THREE.Quaternion,d=new THREE.Vector3(1,1,1),e=function(){c.setFromEuler(b,!1)},f=function(){b.setFromQuaternion(c,void 0,!1)};b.onChange(e),c.onChange(f),Object.defineProperties(this,{position:{enumerable:!0,value:a},rotation:{enumerable:!0,value:b},quaternion:{enumerable:!0,value:c},scale:{enumerable:!0,value:d}}),this.rotationAutoUpdate=!0,this.matrix=new THREE.Matrix4,this.matrixWorld=new THREE.Matrix4,this.matrixAutoUpdate=!0,this.matrixWorldNeedsUpdate=!1,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}},THREE.Object3D.DefaultUp=new THREE.Vector3(0,1,0),THREE.Object3D.prototype={constructor:THREE.Object3D,get eulerOrder(){return THREE.warn("THREE.Object3D: .eulerOrder has been moved to .rotation.order."),this.rotation.order},set eulerOrder(a){THREE.warn("THREE.Object3D: .eulerOrder has been moved to .rotation.order."),this.rotation.order=a},get useQuaternion(){THREE.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set useQuaternion(a){THREE.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},applyMatrix:function(a){this.matrix.multiplyMatrices(a,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},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 THREE.Quaternion;return function(b,c){return a.setFromAxisAngle(b,c),this.quaternion.multiply(a),this}}(),rotateX:function(){var a=new THREE.Vector3(1,0,0);return function(b){return this.rotateOnAxis(a,b)}}(),rotateY:function(){var a=new THREE.Vector3(0,1,0);return function(b){return this.rotateOnAxis(a,b)}}(),
  rotateZ:function(){var a=new THREE.Vector3(0,0,1);return function(b){return this.rotateOnAxis(a,b)}}(),translateOnAxis:function(){var a=new THREE.Vector3;return function(b,c){return a.copy(b).applyQuaternion(this.quaternion),this.position.add(a.multiplyScalar(c)),this}}(),translate:function(a,b){return THREE.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(b,a)},translateX:function(){var a=new THREE.Vector3(1,0,0);return function(b){return this.translateOnAxis(a,b)}}(),translateY:function(){var a=new THREE.Vector3(0,1,0);return function(b){return this.translateOnAxis(a,b)}}(),translateZ:function(){var a=new THREE.Vector3(0,0,1);return function(b){return this.translateOnAxis(a,b)}}(),localToWorld:function(a){return a.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var a=new THREE.Matrix4;return function(b){return b.applyMatrix4(a.getInverse(this.matrixWorld))}}(),lookAt:function(){var a=new THREE.Matrix4;return function(b){a.lookAt(b,this.position,this.up),this.quaternion.setFromRotationMatrix(a)}}(),add:function(a){if(arguments.length>1){for(var b=0;b<arguments.length;b++)this.add(arguments[b]);return this}return a===this?(THREE.error("THREE.Object3D.add: object can't be added as a child of itself.",a),this):(a instanceof THREE.Object3D?(void 0!==a.parent&&a.parent.remove(a),a.parent=this,a.dispatchEvent({type:"added"}),this.children.push(a)):THREE.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",a),this)},remove:function(a){if(arguments.length>1)for(var b=0;b<arguments.length;b++)this.remove(arguments[b]);var c=this.children.indexOf(a);-1!==c&&(a.parent=void 0,a.dispatchEvent({type:"removed"}),this.children.splice(c,1))},getChildByName:function(a){return THREE.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(a)},getObjectById:function(a){return this.getObjectByProperty("id",a)},getObjectByName:function(a){return this.getObjectByProperty("name",a)},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],f=e.getObjectByProperty(a,b);if(void 0!==f)return f}},getWorldPosition:function(a){var b=a||new THREE.Vector3;return this.updateMatrixWorld(!0),b.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){var d=c||new THREE.Quaternion;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(a,d,b),d}}(),getWorldRotation:function(){var a=new THREE.Quaternion;return function(b){var c=b||new THREE.Euler;return this.getWorldQuaternion(a),c.setFromQuaternion(a,this.rotation.order,!1)}}(),getWorldScale:function(){var a=new THREE.Vector3,b=new THREE.Quaternion;return function(c){var d=c||new THREE.Vector3;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(a,b,d),d}}(),getWorldDirection:function(){var a=new THREE.Quaternion;return function(b){var c=b||new THREE.Vector3;return this.getWorldQuaternion(a),c.set(0,0,1).applyQuaternion(a)}}(),raycast:function(){},traverse:function(a){a(this);for(var b=0,c=this.children.length;b<c;b++)this.children[b].traverse(a)},traverseVisible:function(a){if(!1!==this.visible){a(this);for(var b=0,c=this.children.length;b<c;b++)this.children[b].traverseVisible(a)}},traverseAncestors:function(a){this.parent&&(a(this.parent),this.parent.traverseAncestors(a))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){!0===this.matrixAutoUpdate&&this.updateMatrix(),!0!==this.matrixWorldNeedsUpdate&&!0!==a||(void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0);for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},toJSON:function(){var a={metadata:{version:4.3,type:"Object",generator:"ObjectExporter"}},b={},c=function(c){if(void 0===a.geometries&&(a.geometries=[]),void 0===b[c.uuid]){var d=c.toJSON();delete d.metadata,b[c.uuid]=d,a.geometries.push(d)}return c.uuid},d={},e=function(b){if(void 0===a.materials&&(a.materials=[]),void 0===d[b.uuid]){var c=b.toJSON();delete c.metadata,d[b.uuid]=c,a.materials.push(c)}return b.uuid},f=function(a){var b={};if(b.uuid=a.uuid,b.type=a.type,""!==a.name&&(b.name=a.name),"{}"!==JSON.stringify(a.userData)&&(b.userData=a.userData),!0!==a.visible&&(b.visible=a.visible),a instanceof THREE.PerspectiveCamera?(b.fov=a.fov,b.aspect=a.aspect,b.near=a.near,b.far=a.far):a instanceof THREE.OrthographicCamera?(b.left=a.left,b.right=a.right,b.top=a.top,b.bottom=a.bottom,b.near=a.near,b.far=a.far):a instanceof THREE.AmbientLight?b.color=a.color.getHex():a instanceof THREE.DirectionalLight?(b.color=a.color.getHex(),b.intensity=a.intensity):a instanceof THREE.PointLight?(b.color=a.color.getHex(),b.intensity=a.intensity,b.distance=a.distance,b.decay=a.decay):a instanceof THREE.SpotLight?(b.color=a.color.getHex(),b.intensity=a.intensity,b.distance=a.distance,b.angle=a.angle,b.exponent=a.exponent,b.decay=a.decay):a instanceof THREE.HemisphereLight?(b.color=a.color.getHex(),b.groundColor=a.groundColor.getHex()):a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.PointCloud?(b.geometry=c(a.geometry),b.material=e(a.material),a instanceof THREE.Line&&(b.mode=a.mode)):a instanceof THREE.Sprite&&(b.material=e(a.material)),b.matrix=a.matrix.toArray(),a.children.length>0){b.children=[];for(var d=0;d<a.children.length;d++)b.children.push(f(a.children[d]))}return b};return a.object=f(this),a},clone:function(a,b){if(void 0===a&&(a=new THREE.Object3D),void 0===b&&(b=!0),a.name=this.name,a.up.copy(this.up),a.position.copy(this.position),a.quaternion.copy(this.quaternion),a.scale.copy(this.scale),a.rotationAutoUpdate=this.rotationAutoUpdate,a.matrix.copy(this.matrix),a.matrixWorld.copy(this.matrixWorld),a.matrixAutoUpdate=this.matrixAutoUpdate,a.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate,a.visible=this.visible,a.castShadow=this.castShadow,a.receiveShadow=this.receiveShadow,a.frustumCulled=this.frustumCulled,a.userData=JSON.parse(JSON.stringify(this.userData)),!0===b)for(var c=0;c<this.children.length;c++){var d=this.children[c];a.add(d.clone())}return a}},THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype),THREE.Object3DIdCount=0,THREE.Face3=function(a,b,c,d,e,f){this.a=a,this.b=b,this.c=c,this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3,this.vertexNormals=d instanceof Array?d:[],this.color=e instanceof THREE.Color?e:new THREE.Color,this.vertexColors=e instanceof Array?e:[],this.vertexTangents=[],this.materialIndex=void 0!==f?f:0},THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal),a.color.copy(this.color),a.materialIndex=this.materialIndex;for(var b=0,c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();for(var b=0,c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();for(var b=0,c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();return a}},THREE.Face4=function(a,b,c,d,e,f,g){return THREE.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new THREE.Face3(a,b,c,e,f,g)},THREE.BufferAttribute=function(a,b){this.array=a,this.itemSize=b,this.needsUpdate=!1},THREE.BufferAttribute.prototype={constructor:THREE.BufferAttribute,get length(){return this.array.length},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},set:function(a,b){return void 0===b&&(b=0),this.array.set(a,b),this},setX:function(a,b){return this.array[a*this.itemSize]=b,this},setY:function(a,b){return this.array[a*this.itemSize+1]=b,this},setZ:function(a,b){return this.array[a*this.itemSize+2]=b,this},setXY:function(a,b,c){return a*=this.itemSize,this.array[a]=b,this.array[a+1]=c,this},setXYZ:function(a,b,c,d){return a*=this.itemSize,this.array[a]=b,this.array[a+1]=c,this.array[a+2]=d,this},setXYZW:function(a,b,c,d,e){return a*=this.itemSize,this.array[a]=b,this.array[a+1]=c,this.array[a+2]=d,this.array[a+3]=e,this},clone:function(){return new THREE.BufferAttribute(new this.array.constructor(this.array),this.itemSize)}},THREE.Int8Attribute=function(a,b){return THREE.warn("THREE.Int8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Uint8Attribute=function(a,b){return THREE.warn("THREE.Uint8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Uint8ClampedAttribute=function(a,b){return THREE.warn("THREE.Uint8ClampedAttribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Int16Attribute=function(a,b){return THREE.warn("THREE.Int16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Uint16Attribute=function(a,b){return THREE.warn("THREE.Uint16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Int32Attribute=function(a,b){return THREE.warn("THREE.Int32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Uint32Attribute=function(a,b){return THREE.warn("THREE.Uint32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Float32Attribute=function(a,b){return THREE.warn("THREE.Float32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Float64Attribute=function(a,b){return THREE.warn("THREE.Float64Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.DynamicBufferAttribute=function(a,b){THREE.BufferAttribute.call(this,a,b),this.updateRange={offset:0,count:-1}},THREE.DynamicBufferAttribute.prototype=Object.create(THREE.BufferAttribute.prototype),THREE.DynamicBufferAttribute.prototype.constructor=THREE.DynamicBufferAttribute,THREE.DynamicBufferAttribute.prototype.clone=function(){return new THREE.DynamicBufferAttribute(new this.array.constructor(this.array),this.itemSize)},THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="BufferGeometry",this.attributes={},this.attributesKeys=[],this.drawcalls=[],this.offsets=this.drawcalls,this.boundingBox=null,this.boundingSphere=null},THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b){if(b instanceof THREE.BufferAttribute==!1)return THREE.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),void(this.attributes[a]={array:arguments[1],itemSize:arguments[2]});this.attributes[a]=b,this.attributesKeys=Object.keys(this.attributes)},getAttribute:function(a){return this.attributes[a]},addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0})},applyMatrix:function(a){var b=this.attributes.position;void 0!==b&&(a.applyToVector3Array(b.array),b.needsUpdate=!0);var c=this.attributes.normal;if(void 0!==c){(new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(c.array),c.needsUpdate=!0}null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere()},center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();return this.applyMatrix((new THREE.Matrix4).setPosition(a)),a},fromGeometry:function(a,b){b=b||{vertexColors:THREE.NoColors};var c=a.vertices,d=a.faces,e=a.faceVertexUvs,f=b.vertexColors,g=e[0].length>0,h=3==d[0].vertexNormals.length,i=new Float32Array(3*d.length*3);this.addAttribute("position",new THREE.BufferAttribute(i,3));var j=new Float32Array(3*d.length*3);if(this.addAttribute("normal",new THREE.BufferAttribute(j,3)),f!==THREE.NoColors){var k=new Float32Array(3*d.length*3);this.addAttribute("color",new THREE.BufferAttribute(k,3))}if(!0===g){var l=new Float32Array(3*d.length*2);this.addAttribute("uv",new THREE.BufferAttribute(l,2))}for(var m=0,n=0,o=0;m<d.length;m++,n+=6,o+=9){var p=d[m],q=c[p.a],r=c[p.b],s=c[p.c];if(i[o]=q.x,i[o+1]=q.y,i[o+2]=q.z,i[o+3]=r.x,i[o+4]=r.y,i[o+5]=r.z,i[o+6]=s.x,i[o+7]=s.y,i[o+8]=s.z,!0===h){var t=p.vertexNormals[0],u=p.vertexNormals[1],v=p.vertexNormals[2];j[o]=t.x,j[o+1]=t.y,j[o+2]=t.z,j[o+3]=u.x,j[o+4]=u.y,j[o+5]=u.z,j[o+6]=v.x,j[o+7]=v.y,j[o+8]=v.z}else{var w=p.normal;j[o]=w.x,j[o+1]=w.y,j[o+2]=w.z,j[o+3]=w.x,j[o+4]=w.y,j[o+5]=w.z,j[o+6]=w.x,j[o+7]=w.y,j[o+8]=w.z}if(f===THREE.FaceColors){var x=p.color;k[o]=x.r,k[o+1]=x.g,k[o+2]=x.b,k[o+3]=x.r,k[o+4]=x.g,k[o+5]=x.b,k[o+6]=x.r,k[o+7]=x.g,k[o+8]=x.b}else if(f===THREE.VertexColors){var y=p.vertexColors[0],z=p.vertexColors[1],A=p.vertexColors[2];k[o]=y.r,k[o+1]=y.g,k[o+2]=y.b,k[o+3]=z.r,k[o+4]=z.g,k[o+5]=z.b,k[o+6]=A.r,k[o+7]=A.g,k[o+8]=A.b}if(!0===g){var B=e[0][m][0],C=e[0][m][1],D=e[0][m][2];l[n]=B.x,l[n+1]=B.y,l[n+2]=C.x,l[n+3]=C.y,l[n+4]=D.x,l[n+5]=D.y}}return this.computeBoundingSphere(),this},computeBoundingBox:function(){var a=new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var b=this.attributes.position.array;if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.set(b[d],b[d+1],b[d+2]),c.expandByPoint(a)}void 0!==b&&0!==b.length||(this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0)),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&THREE.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.')}}(),computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),a.expandByPoint(b);a.center(d);for(var g=0,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g),isNaN(this.boundingSphere.radius)&&THREE.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.')}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var f,g,h,c=a.normal.array,i=new THREE.Vector3,j=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,m=new THREE.Vector3;if(a.index)for(var n=a.index.array,o=this.offsets.length>0?this.offsets:[{start:0,count:n.length,index:0}],p=0,q=o.length;p<q;++p)for(var r=o[p].start,s=o[p].count,t=o[p].index,d=r,e=r+s;d<e;d+=3)f=3*(t+n[d]),g=3*(t+n[d+1]),h=3*(t+n[d+2]),i.fromArray(b,f),j.fromArray(b,g),k.fromArray(b,h),l.subVectors(k,j),m.subVectors(i,j),l.cross(m),c[f]+=l.x,c[f+1]+=l.y,c[f+2]+=l.z,c[g]+=l.x,c[g+1]+=l.y,c[g+2]+=l.z,c[h]+=l.x,c[h+1]+=l.y,c[h+2]+=l.z;else for(var d=0,e=b.length;d<e;d+=9)i.fromArray(b,d),j.fromArray(b,d+3),k.fromArray(b,d+6),l.subVectors(k,j),m.subVectors(i,j),l.cross(m),c[d]=l.x,c[d+1]=l.y,c[d+2]=l.z,c[d+3]=l.x,c[d+4]=l.y,c[d+5]=l.z,c[d+6]=l.x,c[d+7]=l.y,c[d+8]=l.z;this.normalizeNormals(),a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){D.fromArray(d,3*a),E.fromArray(d,3*b),F.fromArray(d,3*c),G.fromArray(f,2*a),H.fromArray(f,2*b),I.fromArray(f,2*c),l=E.x-D.x,m=F.x-D.x,n=E.y-D.y,o=F.y-D.y,p=E.z-D.z,q=F.z-D.z,r=H.x-G.x,s=I.x-G.x,t=H.y-G.y,u=I.y-G.y,v=1/(r*u-s*t),J.set((u*l-t*m)*v,(u*n-t*o)*v,(u*p-t*q)*v),K.set((r*m-s*l)*v,(r*o-s*n)*v,(r*q-s*p)*v),i[a].add(J),i[b].add(J),i[c].add(J),j[a].add(K),j[b].add(K),j[c].add(K)}function b(a){U.fromArray(e,3*a),V.copy(U),Q=i[a],S.copy(Q),S.sub(U.multiplyScalar(U.dot(Q))).normalize(),T.crossVectors(V,Q),R=T.dot(j[a]),P=R<0?-1:1,h[4*a]=S.x,h[4*a+1]=S.y,h[4*a+2]=S.z,h[4*a+3]=P}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)return void THREE.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*g),4));for(var h=this.attributes.tangent.array,i=[],j=[],k=0;k<g;k++)i[k]=new THREE.Vector3,j[k]=new THREE.Vector3;var l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D=new THREE.Vector3,E=new THREE.Vector3,F=new THREE.Vector3,G=new THREE.Vector2,H=new THREE.Vector2,I=new THREE.Vector2,J=new THREE.Vector3,K=new THREE.Vector3;0===this.drawcalls.length&&this.addDrawCall(0,c.length,0);var L=this.drawcalls;for(y=0,z=L.length;y<z;++y){var M=L[y].start,N=L[y].count,O=L[y].index;for(w=M,x=M+N;w<x;w+=3)A=O+c[w],B=O+c[w+1],C=O+c[w+2],a(A,B,C)}var P,Q,R,S=new THREE.Vector3,T=new THREE.Vector3,U=new THREE.Vector3,V=new THREE.Vector3;for(y=0,z=L.length;y<z;++y){var M=L[y].start,N=L[y].count,O=L[y].index;for(w=M,x=M+N;w<x;w+=3)A=O+c[w],B=O+c[w+1],C=O+c[w+2],b(A),b(B),b(C)}},computeOffsets:function(a){void 0===a&&(a=65535);for(var b=this.attributes.index.array,c=this.attributes.position.array,d=b.length/3,e=new Uint16Array(b.length),f=0,g=0,h=[{start:0,count:0,index:0}],i=h[0],j=0,k=0,l=new Int32Array(6),m=new Int32Array(c.length),n=new Int32Array(c.length),o=0;o<c.length;o++)m[o]=-1,n[o]=-1;for(var p=0;p<d;p++){k=0;for(var q=0;q<3;q++){var r=b[3*p+q];-1==m[r]?(l[2*q]=r,l[2*q+1]=-1,k++):m[r]<i.index?(l[2*q]=r,l[2*q+1]=-1,j++):(l[2*q]=r,l[2*q+1]=m[r])}if(g+k>i.index+a){var s={start:f,count:0,index:g};h.push(s),i=s;for(var t=0;t<6;t+=2){var u=l[t+1];u>-1&&u<i.index&&(l[t+1]=-1)}}for(var t=0;t<6;t+=2){var r=l[t],u=l[t+1];-1===u&&(u=g++),m[r]=u,n[u]=r,e[f++]=u-i.index,i.count++}}return this.reorderBuffers(e,n,g),this.offsets=h,this.drawcalls=h,h},merge:function(a,b){if(a instanceof THREE.BufferGeometry==!1)return void THREE.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",a);void 0===b&&(b=0);var c=this.attributes;for(var d in c)if(void 0!==a.attributes[d])for(var e=c[d],f=e.array,g=a.attributes[d],h=g.array,i=g.itemSize,j=0,k=i*b;j<h.length;j++,k++)f[k]=h[j];return this},normalizeNormals:function(){for(var a,b,c,d,e=this.attributes.normal.array,f=0,g=e.length;f<g;f+=3)a=e[f],b=e[f+1],c=e[f+2],d=1/Math.sqrt(a*a+b*b+c*c),e[f]*=d,e[f+1]*=d,e[f+2]*=d},reorderBuffers:function(a,b,c){var d={};for(var e in this.attributes)if("index"!=e){var f=this.attributes[e].array;d[e]=new f.constructor(this.attributes[e].itemSize*c)}for(var g=0;g<c;g++){var h=b[g];for(var e in this.attributes)if("index"!=e)for(var i=this.attributes[e].array,j=this.attributes[e].itemSize,k=d[e],l=0;l<j;l++)k[g*j+l]=i[h*j+l]}this.attributes.index.array=a;for(var e in this.attributes)"index"!=e&&(this.attributes[e].array=d[e],this.attributes[e].numItems=this.attributes[e].itemSize*c)},toJSON:function(){var a={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type,data:{attributes:{}}},b=this.attributes,c=this.offsets,d=this.boundingSphere;for(var e in b){var f=b[e],g=Array.prototype.slice.call(f.array);a.data.attributes[e]={itemSize:f.itemSize,type:f.array.constructor.name,array:g}}return c.length>0&&(a.data.offsets=JSON.parse(JSON.stringify(c))),null!==d&&(a.data.boundingSphere={center:d.center.toArray(),radius:d.radius}),a},clone:function(){var a=new THREE.BufferGeometry;for(var b in this.attributes){var c=this.attributes[b];a.addAttribute(b,c.clone())}for(var d=0,e=this.offsets.length;d<e;d++){var f=this.offsets[d];a.offsets.push({start:f.start,index:f.index,count:f.count})}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype),THREE.Geometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphColors=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.hasTangents=!1,this.dynamic=!0,this.verticesNeedUpdate=!1,this.elementsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.tangentsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1},THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){for(var b=(new THREE.Matrix3).getNormalMatrix(a),c=0,d=this.vertices.length;c<d;c++){this.vertices[c].applyMatrix4(a)}for(var c=0,d=this.faces.length;c<d;c++){var e=this.faces[c];e.normal.applyMatrix3(b).normalize();for(var f=0,g=e.vertexNormals.length;f<g;f++)e.vertexNormals[f].applyMatrix3(b).normalize()}null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0},fromBufferGeometry:function(a){for(var b=this,c=a.attributes,d=c.position.array,e=void 0!==c.index?c.index.array:void 0,f=void 0!==c.normal?c.normal.array:void 0,g=void 0!==c.color?c.color.array:void 0,h=void 0!==c.uv?c.uv.array:void 0,i=[],j=[],k=0,l=0;k<d.length;k+=3,l+=2)b.vertices.push(new THREE.Vector3(d[k],d[k+1],d[k+2])),void 0!==f&&i.push(new THREE.Vector3(f[k],f[k+1],f[k+2])),void 0!==g&&b.colors.push(new THREE.Color(g[k],g[k+1],g[k+2])),void 0!==h&&j.push(new THREE.Vector2(h[l],h[l+1]));var m=function(a,c,d){var e=void 0!==f?[i[a].clone(),i[c].clone(),i[d].clone()]:[],k=void 0!==g?[b.colors[a].clone(),b.colors[c].clone(),b.colors[d].clone()]:[];b.faces.push(new THREE.Face3(a,c,d,e,k)),void 0!==h&&b.faceVertexUvs[0].push([j[a].clone(),j[c].clone(),j[d].clone()])};if(void 0!==e){var n=a.drawcalls;if(n.length>0)for(var k=0;k<n.length;k++)for(var o=n[k],p=o.start,q=o.count,r=o.index,l=p,s=p+q;l<s;l+=3)m(r+e[l],r+e[l+1],r+e[l+2]);else for(var k=0;k<e.length;k+=3)m(e[k],e[k+1],e[k+2])}else for(var k=0;k<d.length/3;k+=3)m(k,k+1,k+2);return this.computeFaceNormals(),null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone()),null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();return this.applyMatrix((new THREE.Matrix4).setPosition(a)),a},computeFaceNormals:function(){for(var a=new THREE.Vector3,b=new THREE.Vector3,c=0,d=this.faces.length;c<d;c++){var e=this.faces[c],f=this.vertices[e.a],g=this.vertices[e.b],h=this.vertices[e.c];a.subVectors(h,g),b.subVectors(f,g),a.cross(b),a.normalize(),e.normal.copy(a)}},computeVertexNormals:function(a){var b,c,d,e,f,g;for(g=new Array(this.vertices.length),b=0,c=this.vertices.length;b<c;b++)g[b]=new THREE.Vector3;if(a){var h,i,j,k=new THREE.Vector3,l=new THREE.Vector3;for(d=0,e=this.faces.length;d<e;d++)f=this.faces[d],h=this.vertices[f.a],i=this.vertices[f.b],j=this.vertices[f.c],k.subVectors(j,i),l.subVectors(h,i),k.cross(l),g[f.a].add(k),g[f.b].add(k),g[f.c].add(k)}else for(d=0,e=this.faces.length;d<e;d++)f=this.faces[d],g[f.a].add(f.normal),g[f.b].add(f.normal),g[f.c].add(f.normal);for(b=0,c=this.vertices.length;b<c;b++)g[b].normalize();for(d=0,e=this.faces.length;d<e;d++)f=this.faces[d],f.vertexNormals[0]=g[f.a].clone(),f.vertexNormals[1]=g[f.b].clone(),f.vertexNormals[2]=g[f.c].clone()},computeMorphNormals:function(){var a,b,c,d,e;for(c=0,d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var f=new THREE.Geometry;for(f.faces=this.faces,a=0,b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={},this.morphNormals[a].faceNormals=[],this.morphNormals[a].vertexNormals=[];var g,h,i=this.morphNormals[a].faceNormals,j=this.morphNormals[a].vertexNormals;for(c=0,d=this.faces.length;c<d;c++)g=new THREE.Vector3,h={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},i.push(g),j.push(h)}var k=this.morphNormals[a];f.vertices=this.morphTargets[a].vertices,f.computeFaceNormals(),f.computeVertexNormals();var g,h;for(c=0,d=this.faces.length;c<d;c++)e=this.faces[c],g=k.faceNormals[c],h=k.vertexNormals[c],g.copy(e.normal),h.a.copy(e.vertexNormals[0]),h.b.copy(e.vertexNormals[1]),h.c.copy(e.vertexNormals[2])}for(c=0,d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){function a(a,b,c,d,e,f,g){j=a.vertices[b],k=a.vertices[c],l=a.vertices[d],m=i[e],n=i[f],o=i[g],p=k.x-j.x,q=l.x-j.x,r=k.y-j.y,s=l.y-j.y,t=k.z-j.z,u=l.z-j.z,v=n.x-m.x,w=o.x-m.x,x=n.y-m.y,y=o.y-m.y,z=1/(v*y-w*x),F.set((y*p-x*q)*z,(y*r-x*s)*z,(y*t-x*u)*z),G.set((v*q-w*p)*z,(v*s-w*r)*z,(v*u-w*t)*z),D[b].add(F),D[c].add(F),D[d].add(F),E[b].add(G),E[c].add(G),E[d].add(G)}var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D=[],E=[],F=new THREE.Vector3,G=new THREE.Vector3,H=new THREE.Vector3,I=new THREE.Vector3,J=new THREE.Vector3;for(d=0,e=this.vertices.length;d<e;d++)D[d]=new THREE.Vector3,E[d]=new THREE.Vector3;for(b=0,c=this.faces.length;b<c;b++)h=this.faces[b],i=this.faceVertexUvs[0][b],a(this,h.a,h.b,h.c,0,1,2);var K=["a","b","c","d"];for(b=0,c=this.faces.length;b<c;b++)for(h=this.faces[b],f=0;f<Math.min(h.vertexNormals.length,3);f++)J.copy(h.vertexNormals[f]),g=h[K[f]],A=D[g],H.copy(A),H.sub(J.multiplyScalar(J.dot(A))).normalize(),I.crossVectors(h.vertexNormals[f],A),B=I.dot(E[g]),C=B<0?-1:1,h.vertexTangents[f]=new THREE.Vector4(H.x,H.y,H.z,C);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)c>0&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere),this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b,c){if(a instanceof THREE.Geometry==!1)return void THREE.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);var d,e=this.vertices.length,f=this.vertices,g=a.vertices,h=this.faces,i=a.faces,j=this.faceVertexUvs[0],k=a.faceVertexUvs[0];void 0===c&&(c=0),void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var l=0,m=g.length;l<m;l++){var n=g[l],o=n.clone();void 0!==b&&o.applyMatrix4(b),f.push(o)}for(l=0,m=i.length;l<m;l++){var p,q,r,s=i[l],t=s.vertexNormals,u=s.vertexColors;p=new THREE.Face3(s.a+e,s.b+e,s.c+e),p.normal.copy(s.normal),void 0!==d&&p.normal.applyMatrix3(d).normalize();for(var v=0,w=t.length;v<w;v++)q=t[v].clone(),void 0!==d&&q.applyMatrix3(d).normalize(),p.vertexNormals.push(q);p.color.copy(s.color);for(var v=0,w=u.length;v<w;v++)r=u[v],p.vertexColors.push(r.clone());p.materialIndex=s.materialIndex+c,h.push(p)}for(l=0,m=k.length;l<m;l++){var x=k[l],y=[];if(void 0!==x){for(var v=0,w=x.length;v<w;v++)y.push(x[v].clone());j.push(y)}}},mergeMesh:function(a){if(a instanceof THREE.Mesh==!1)return void THREE.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",a);a.matrixAutoUpdate&&a.updateMatrix(),this.merge(a.geometry,a.matrix)},mergeVertices:function(){var a,b,c,d,e,f,g,h,i={},j=[],k=[],l=4,m=Math.pow(10,l);for(c=0,d=this.vertices.length;c<d;c++)a=this.vertices[c],b=Math.round(a.x*m)+"_"+Math.round(a.y*m)+"_"+Math.round(a.z*m),void 0===i[b]?(i[b]=c,j.push(this.vertices[c]),k[c]=j.length-1):k[c]=k[i[b]];var n=[];for(c=0,d=this.faces.length;c<d;c++){e=this.faces[c],e.a=k[e.a],e.b=k[e.b],e.c=k[e.c],f=[e.a,e.b,e.c];for(var o=0;o<3;o++)if(f[o]==f[(o+1)%3]){o,n.push(c);break}}for(c=n.length-1;c>=0;c--){var p=n[c];for(this.faces.splice(p,1),g=0,h=this.faceVertexUvs.length;g<h;g++)this.faceVertexUvs[g].splice(p,1)}var q=this.vertices.length-j.length;return this.vertices=j,q},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();return void 0!==m[b]?m[b]:(m[b]=l.length/3,l.push(a.x,a.y,a.z),m[b])}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();return void 0!==o[b]?o[b]:(o[b]=n.length,n.push(a.getHex()),o[b])}function d(a){var b=a.x.toString()+a.y.toString();return void 0!==q[b]?q[b]:(q[b]=p.length/2,p.push(a.x,a.y),q[b])}var e={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type};if(""!==this.name&&(e.name=this.name),void 0!==this.parameters){var f=this.parameters;for(var g in f)void 0!==f[g]&&(e[g]=f[g]);return e}for(var h=[],i=0;i<this.vertices.length;i++){var j=this.vertices[i];h.push(j.x,j.y,j.z)}for(var k=[],l=[],m={},n=[],o={},p=[],q={},i=0;i<this.faces.length;i++){var r=this.faces[i],s=void 0!==this.faceVertexUvs[0][i],t=r.normal.length()>0,u=r.vertexNormals.length>0,v=1!==r.color.r||1!==r.color.g||1!==r.color.b,w=r.vertexColors.length>0,x=0;if(x=a(x,0,0),x=a(x,1,!1),x=a(x,2,!1),x=a(x,3,s),x=a(x,4,t),x=a(x,5,u),x=a(x,6,v),x=a(x,7,w),k.push(x),k.push(r.a,r.b,r.c),s){var y=this.faceVertexUvs[0][i];k.push(d(y[0]),d(y[1]),d(y[2]))}if(t&&k.push(b(r.normal)),u){var z=r.vertexNormals;k.push(b(z[0]),b(z[1]),b(z[2]))}if(v&&k.push(c(r.color)),w){var A=r.vertexColors;k.push(c(A[0]),c(A[1]),c(A[2]))}}return e.data={},e.data.vertices=h,e.data.normals=l,n.length>0&&(e.data.colors=n),p.length>0&&(e.data.uvs=[p]),e.data.faces=k,e},clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());for(var e=this.faces,c=0,d=e.length;c<d;c++)a.faces.push(e[c].clone());for(var c=0,d=this.faceVertexUvs.length;c<d;c++){var f=this.faceVertexUvs[c];void 0===a.faceVertexUvs[c]&&(a.faceVertexUvs[c]=[]);for(var g=0,h=f.length;g<h;g++){for(var i=f[g],j=[],k=0,l=i.length;k<l;k++){var m=i[k];j.push(m.clone())}a.faceVertexUvs[c].push(j)}}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype),THREE.GeometryIdCount=0,THREE.Camera=function(){THREE.Object3D.call(this),this.type="Camera",this.matrixWorldInverse=new THREE.Matrix4,this.projectionMatrix=new THREE.Matrix4},THREE.Camera.prototype=Object.create(THREE.Object3D.prototype),THREE.Camera.prototype.constructor=THREE.Camera,THREE.Camera.prototype.getWorldDirection=function(){var a=new THREE.Quaternion;return function(b){var c=b||new THREE.Vector3;return this.getWorldQuaternion(a),c.set(0,0,-1).applyQuaternion(a)}}(),THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up),this.quaternion.setFromRotationMatrix(a)}}(),THREE.Camera.prototype.clone=function(a){return void 0===a&&(a=new THREE.Camera),THREE.Object3D.prototype.clone.call(this,a),a.matrixWorldInverse.copy(this.matrixWorldInverse),a.projectionMatrix.copy(this.projectionMatrix),a},THREE.CubeCamera=function(a,b,c){THREE.Object3D.call(this),this.type="CubeCamera";var d=90,e=1,f=new THREE.PerspectiveCamera(d,e,a,b);f.up.set(0,-1,0),f.lookAt(new THREE.Vector3(1,0,0)),this.add(f);var g=new THREE.PerspectiveCamera(d,e,a,b);g.up.set(0,-1,0),
  g.lookAt(new THREE.Vector3(-1,0,0)),this.add(g);var h=new THREE.PerspectiveCamera(d,e,a,b);h.up.set(0,0,1),h.lookAt(new THREE.Vector3(0,1,0)),this.add(h);var i=new THREE.PerspectiveCamera(d,e,a,b);i.up.set(0,0,-1),i.lookAt(new THREE.Vector3(0,-1,0)),this.add(i);var j=new THREE.PerspectiveCamera(d,e,a,b);j.up.set(0,-1,0),j.lookAt(new THREE.Vector3(0,0,1)),this.add(j);var k=new THREE.PerspectiveCamera(d,e,a,b);k.up.set(0,-1,0),k.lookAt(new THREE.Vector3(0,0,-1)),this.add(k),this.renderTarget=new THREE.WebGLRenderTargetCube(c,c,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter}),this.updateCubeMap=function(a,b){var c=this.renderTarget,d=c.generateMipmaps;c.generateMipmaps=!1,c.activeCubeFace=0,a.render(b,f,c),c.activeCubeFace=1,a.render(b,g,c),c.activeCubeFace=2,a.render(b,h,c),c.activeCubeFace=3,a.render(b,i,c),c.activeCubeFace=4,a.render(b,j,c),c.generateMipmaps=d,c.activeCubeFace=5,a.render(b,k,c)}},THREE.CubeCamera.prototype=Object.create(THREE.Object3D.prototype),THREE.CubeCamera.prototype.constructor=THREE.CubeCamera,THREE.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this),this.type="OrthographicCamera",this.zoom=1,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()},THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype),THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera,THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){var a=(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;this.projectionMatrix.makeOrthographic(c-a,c+a,d+b,d-b,this.near,this.far)},THREE.OrthographicCamera.prototype.clone=function(){var a=new THREE.OrthographicCamera;return THREE.Camera.prototype.clone.call(this,a),a.zoom=this.zoom,a.left=this.left,a.right=this.right,a.top=this.top,a.bottom=this.bottom,a.near=this.near,a.far=this.far,a.projectionMatrix.copy(this.projectionMatrix),a},THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this),this.type="PerspectiveCamera",this.zoom=1,this.fov=void 0!==a?a:50,this.aspect=void 0!==b?b:1,this.near=void 0!==c?c:.1,this.far=void 0!==d?d:2e3,this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype),THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera,THREE.PerspectiveCamera.prototype.setLens=function(a,b){void 0===b&&(b=24),this.fov=2*THREE.Math.radToDeg(Math.atan(b/(2*a))),this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,f){this.fullWidth=a,this.fullHeight=b,this.x=c,this.y=d,this.width=e,this.height=f,this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){var a=THREE.Math.radToDeg(2*Math.atan(Math.tan(.5*THREE.Math.degToRad(this.fov))/this.zoom));if(this.fullWidth){var b=this.fullWidth/this.fullHeight,c=Math.tan(THREE.Math.degToRad(.5*a))*this.near,d=-c,e=b*d,f=b*c,g=Math.abs(f-e),h=Math.abs(c-d);this.projectionMatrix.makeFrustum(e+this.x*g/this.fullWidth,e+(this.x+this.width)*g/this.fullWidth,c-(this.y+this.height)*h/this.fullHeight,c-this.y*h/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(a,this.aspect,this.near,this.far)},THREE.PerspectiveCamera.prototype.clone=function(){var a=new THREE.PerspectiveCamera;return THREE.Camera.prototype.clone.call(this,a),a.zoom=this.zoom,a.fov=this.fov,a.aspect=this.aspect,a.near=this.near,a.far=this.far,a.projectionMatrix.copy(this.projectionMatrix),a},THREE.Light=function(a){THREE.Object3D.call(this),this.type="Light",this.color=new THREE.Color(a)},THREE.Light.prototype=Object.create(THREE.Object3D.prototype),THREE.Light.prototype.constructor=THREE.Light,THREE.Light.prototype.clone=function(a){return void 0===a&&(a=new THREE.Light),THREE.Object3D.prototype.clone.call(this,a),a.color.copy(this.color),a},THREE.AmbientLight=function(a){THREE.Light.call(this,a),this.type="AmbientLight"},THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype),THREE.AmbientLight.prototype.constructor=THREE.AmbientLight,THREE.AmbientLight.prototype.clone=function(){var a=new THREE.AmbientLight;return THREE.Light.prototype.clone.call(this,a),a},THREE.AreaLight=function(a,b){THREE.Light.call(this,a),this.type="AreaLight",this.normal=new THREE.Vector3(0,-1,0),this.right=new THREE.Vector3(1,0,0),this.intensity=void 0!==b?b:1,this.width=1,this.height=1,this.constantAttenuation=1.5,this.linearAttenuation=.5,this.quadraticAttenuation=.1},THREE.AreaLight.prototype=Object.create(THREE.Light.prototype),THREE.AreaLight.prototype.constructor=THREE.AreaLight,THREE.DirectionalLight=function(a,b){THREE.Light.call(this,a),this.type="DirectionalLight",this.position.set(0,1,0),this.target=new THREE.Object3D,this.intensity=void 0!==b?b:1,this.castShadow=!1,this.onlyShadow=!1,this.shadowCameraNear=50,this.shadowCameraFar=5e3,this.shadowCameraLeft=-500,this.shadowCameraRight=500,this.shadowCameraTop=500,this.shadowCameraBottom=-500,this.shadowCameraVisible=!1,this.shadowBias=0,this.shadowDarkness=.5,this.shadowMapWidth=512,this.shadowMapHeight=512,this.shadowCascade=!1,this.shadowCascadeOffset=new THREE.Vector3(0,0,-1e3),this.shadowCascadeCount=2,this.shadowCascadeBias=[0,0,0],this.shadowCascadeWidth=[512,512,512],this.shadowCascadeHeight=[512,512,512],this.shadowCascadeNearZ=[-1,.99,.998],this.shadowCascadeFarZ=[.99,.998,1],this.shadowCascadeArray=[],this.shadowMap=null,this.shadowMapSize=null,this.shadowCamera=null,this.shadowMatrix=null};THREE.DirectionalLight.prototype=Object.create(THREE.Light.prototype),THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight,THREE.DirectionalLight.prototype.clone=function(){var a=new THREE.DirectionalLight;return THREE.Light.prototype.clone.call(this,a),a.target=this.target.clone(),a.intensity=this.intensity,a.castShadow=this.castShadow,a.onlyShadow=this.onlyShadow,a.shadowCameraNear=this.shadowCameraNear,a.shadowCameraFar=this.shadowCameraFar,a.shadowCameraLeft=this.shadowCameraLeft,a.shadowCameraRight=this.shadowCameraRight,a.shadowCameraTop=this.shadowCameraTop,a.shadowCameraBottom=this.shadowCameraBottom,a.shadowCameraVisible=this.shadowCameraVisible,a.shadowBias=this.shadowBias,a.shadowDarkness=this.shadowDarkness,a.shadowMapWidth=this.shadowMapWidth,a.shadowMapHeight=this.shadowMapHeight,a.shadowCascade=this.shadowCascade,a.shadowCascadeOffset.copy(this.shadowCascadeOffset),a.shadowCascadeCount=this.shadowCascadeCount,a.shadowCascadeBias=this.shadowCascadeBias.slice(0),a.shadowCascadeWidth=this.shadowCascadeWidth.slice(0),a.shadowCascadeHeight=this.shadowCascadeHeight.slice(0),a.shadowCascadeNearZ=this.shadowCascadeNearZ.slice(0),a.shadowCascadeFarZ=this.shadowCascadeFarZ.slice(0),a},THREE.HemisphereLight=function(a,b,c){THREE.Light.call(this,a),this.type="HemisphereLight",this.position.set(0,100,0),this.groundColor=new THREE.Color(b),this.intensity=void 0!==c?c:1},THREE.HemisphereLight.prototype=Object.create(THREE.Light.prototype),THREE.HemisphereLight.prototype.constructor=THREE.HemisphereLight,THREE.HemisphereLight.prototype.clone=function(){var a=new THREE.HemisphereLight;return THREE.Light.prototype.clone.call(this,a),a.groundColor.copy(this.groundColor),a.intensity=this.intensity,a},THREE.PointLight=function(a,b,c,d){THREE.Light.call(this,a),this.type="PointLight",this.intensity=void 0!==b?b:1,this.distance=void 0!==c?c:0,this.decay=void 0!==d?d:1},THREE.PointLight.prototype=Object.create(THREE.Light.prototype),THREE.PointLight.prototype.constructor=THREE.PointLight,THREE.PointLight.prototype.clone=function(){var a=new THREE.PointLight;return THREE.Light.prototype.clone.call(this,a),a.intensity=this.intensity,a.distance=this.distance,a.decay=this.decay,a},THREE.SpotLight=function(a,b,c,d,e,f){THREE.Light.call(this,a),this.type="SpotLight",this.position.set(0,1,0),this.target=new THREE.Object3D,this.intensity=void 0!==b?b:1,this.distance=void 0!==c?c:0,this.angle=void 0!==d?d:Math.PI/3,this.exponent=void 0!==e?e:10,this.decay=void 0!==f?f:1,this.castShadow=!1,this.onlyShadow=!1,this.shadowCameraNear=50,this.shadowCameraFar=5e3,this.shadowCameraFov=50,this.shadowCameraVisible=!1,this.shadowBias=0,this.shadowDarkness=.5,this.shadowMapWidth=512,this.shadowMapHeight=512,this.shadowMap=null,this.shadowMapSize=null,this.shadowCamera=null,this.shadowMatrix=null},THREE.SpotLight.prototype=Object.create(THREE.Light.prototype),THREE.SpotLight.prototype.constructor=THREE.SpotLight,THREE.SpotLight.prototype.clone=function(){var a=new THREE.SpotLight;return THREE.Light.prototype.clone.call(this,a),a.target=this.target.clone(),a.intensity=this.intensity,a.distance=this.distance,a.angle=this.angle,a.exponent=this.exponent,a.decay=this.decay,a.castShadow=this.castShadow,a.onlyShadow=this.onlyShadow,a.shadowCameraNear=this.shadowCameraNear,a.shadowCameraFar=this.shadowCameraFar,a.shadowCameraFov=this.shadowCameraFov,a.shadowCameraVisible=this.shadowCameraVisible,a.shadowBias=this.shadowBias,a.shadowDarkness=this.shadowDarkness,a.shadowMapWidth=this.shadowMapWidth,a.shadowMapHeight=this.shadowMapHeight,a},THREE.Cache={files:{},add:function(a,b){this.files[a]=b},get:function(a){return this.files[a]},remove:function(a){delete this.files[a]},clear:function(){this.files={}}},THREE.Loader=function(a){this.showStatus=a,this.statusDomElement=a?THREE.Loader.prototype.addStatusElement():null,this.imageLoader=new THREE.ImageLoader,this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}},THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:void 0,addStatusElement:function(){var a=document.createElement("div");return a.style.position="absolute",a.style.right="0px",a.style.top="0px",a.style.fontSize="0.8em",a.style.textAlign="left",a.style.background="rgba(0,0,0,0.25)",a.style.color="#fff",a.style.width="120px",a.style.padding="0.5em 0.5em 0.5em 0.5em",a.style.zIndex=1e3,a.innerHTML="Loading ...",a},updateProgress:function(a){var b="Loaded ";a.total?b+=(100*a.loaded/a.total).toFixed(0)+"%":b+=(a.loaded/1024).toFixed(2)+" KB",this.statusDomElement.innerHTML=b},extractUrlBase:function(a){var b=a.split("/");return 1===b.length?"./":(b.pop(),b.join("/")+"/")},initMaterials:function(a,b){for(var c=[],d=0;d<a.length;++d)c[d]=this.createMaterial(a[d],b);return c},needsTangents:function(a){for(var b=0,c=a.length;b<c;b++){if(a[b]instanceof THREE.ShaderMaterial)return!0}return!1},createMaterial:function(a,b){function c(a){var b=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(b))}function d(a,d,e,g,h,i,j){var k,l=b+e,m=THREE.Loader.Handlers.get(l);if(null!==m?k=m.load(l):(k=new THREE.Texture,m=f.imageLoader,m.crossOrigin=f.crossOrigin,m.load(l,function(a){if(!1===THREE.Math.isPowerOfTwo(a.width)||!1===THREE.Math.isPowerOfTwo(a.height)){var b=c(a.width),d=c(a.height),e=document.createElement("canvas");e.width=b,e.height=d;e.getContext("2d").drawImage(a,0,0,b,d),k.image=e}else k.image=a;k.needsUpdate=!0})),k.sourceFile=e,g&&(k.repeat.set(g[0],g[1]),1!==g[0]&&(k.wrapS=THREE.RepeatWrapping),1!==g[1]&&(k.wrapT=THREE.RepeatWrapping)),h&&k.offset.set(h[0],h[1]),i){var n={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};void 0!==n[i[0]]&&(k.wrapS=n[i[0]]),void 0!==n[i[1]]&&(k.wrapT=n[i[1]])}j&&(k.anisotropy=j),a[d]=k}function e(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var f=this,g="MeshLambertMaterial",h={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(a.shading){var i=a.shading.toLowerCase();"phong"===i?g="MeshPhongMaterial":"basic"===i&&(g="MeshBasicMaterial")}void 0!==a.blending&&void 0!==THREE[a.blending]&&(h.blending=THREE[a.blending]),void 0!==a.transparent&&(h.transparent=a.transparent),void 0!==a.opacity&&a.opacity<1&&(h.transparent=!0),void 0!==a.depthTest&&(h.depthTest=a.depthTest),void 0!==a.depthWrite&&(h.depthWrite=a.depthWrite),void 0!==a.visible&&(h.visible=a.visible),void 0!==a.flipSided&&(h.side=THREE.BackSide),void 0!==a.doubleSided&&(h.side=THREE.DoubleSide),void 0!==a.wireframe&&(h.wireframe=a.wireframe),void 0!==a.vertexColors&&("face"===a.vertexColors?h.vertexColors=THREE.FaceColors:a.vertexColors&&(h.vertexColors=THREE.VertexColors)),a.colorDiffuse?h.color=e(a.colorDiffuse):a.DbgColor&&(h.color=a.DbgColor),a.colorSpecular&&(h.specular=e(a.colorSpecular)),a.colorEmissive&&(h.emissive=e(a.colorEmissive)),void 0!==a.transparency&&(console.warn("THREE.Loader: transparency has been renamed to opacity"),a.opacity=a.transparency),void 0!==a.opacity&&(h.opacity=a.opacity),a.specularCoef&&(h.shininess=a.specularCoef),a.mapDiffuse&&b&&d(h,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap,a.mapDiffuseAnisotropy),a.mapLight&&b&&d(h,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap,a.mapLightAnisotropy),a.mapBump&&b&&d(h,"bumpMap",a.mapBump,a.mapBumpRepeat,a.mapBumpOffset,a.mapBumpWrap,a.mapBumpAnisotropy),a.mapNormal&&b&&d(h,"normalMap",a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap,a.mapNormalAnisotropy),a.mapSpecular&&b&&d(h,"specularMap",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap,a.mapSpecularAnisotropy),a.mapAlpha&&b&&d(h,"alphaMap",a.mapAlpha,a.mapAlphaRepeat,a.mapAlphaOffset,a.mapAlphaWrap,a.mapAlphaAnisotropy),a.mapBumpScale&&(h.bumpScale=a.mapBumpScale),a.mapNormalFactor&&(h.normalScale=new THREE.Vector2(a.mapNormalFactor,a.mapNormalFactor));var j=new THREE[g](h);return void 0!==a.DbgName&&(j.name=a.DbgName),j}},THREE.Loader.Handlers={handlers:[],add:function(a,b){this.handlers.push(a,b)},get:function(a){for(var b=0,c=this.handlers.length;b<c;b+=2){var d=this.handlers[b],e=this.handlers[b+1];if(d.test(a))return e}return null}},THREE.XHRLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager},THREE.XHRLoader.prototype={constructor:THREE.XHRLoader,load:function(a,b,c,d){var e=this,f=THREE.Cache.get(a);if(void 0!==f)return void(b&&b(f));var g=new XMLHttpRequest;g.open("GET",a,!0),g.addEventListener("load",function(c){THREE.Cache.add(a,this.response),b&&b(this.response),e.manager.itemEnd(a)},!1),void 0!==c&&g.addEventListener("progress",function(a){c(a)},!1),void 0!==d&&g.addEventListener("error",function(a){d(a)},!1),void 0!==this.crossOrigin&&(g.crossOrigin=this.crossOrigin),void 0!==this.responseType&&(g.responseType=this.responseType),g.send(null),e.manager.itemStart(a)},setResponseType:function(a){this.responseType=a},setCrossOrigin:function(a){this.crossOrigin=a}},THREE.ImageLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager},THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d){var e=this,f=THREE.Cache.get(a);if(void 0!==f)return void b(f);var g=document.createElement("img");return g.addEventListener("load",function(c){THREE.Cache.add(a,this),b&&b(this),e.manager.itemEnd(a)},!1),void 0!==c&&g.addEventListener("progress",function(a){c(a)},!1),void 0!==d&&g.addEventListener("error",function(a){d(a)},!1),void 0!==this.crossOrigin&&(g.crossOrigin=this.crossOrigin),g.src=a,e.manager.itemStart(a),g},setCrossOrigin:function(a){this.crossOrigin=a}},THREE.JSONLoader=function(a){THREE.Loader.call(this,a),this.withCredentials=!1},THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype),THREE.JSONLoader.prototype.constructor=THREE.JSONLoader,THREE.JSONLoader.prototype.load=function(a,b,c){c=c&&"string"==typeof c?c:this.extractUrlBase(a),this.onLoadStart(),this.loadAjaxJSON(this,a,b,c)},THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,g=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(200===f.status||0===f.status){if(f.responseText){var h=JSON.parse(f.responseText),i=h.metadata;if(void 0!==i){if("object"===i.type)return void THREE.error("THREE.JSONLoader: "+b+" should be loaded with THREE.ObjectLoader instead.");if("scene"===i.type)return void THREE.error("THREE.JSONLoader: "+b+" seems to be a Scene. Use THREE.SceneLoader instead.")}var j=a.parse(h,d);c(j.geometry,j.materials)}else THREE.error("THREE.JSONLoader: "+b+" seems to be unreachable or the file is empty.");a.onLoadComplete()}else THREE.error("THREE.JSONLoader: Couldn't load "+b+" ("+f.status+")");else f.readyState===f.LOADING?e&&(0===g&&(g=f.getResponseHeader("Content-Length")),e({total:g,loaded:f.responseText.length})):f.readyState===f.HEADERS_RECEIVED&&void 0!==e&&(g=f.getResponseHeader("Content-Length"))},f.open("GET",b,!0),f.withCredentials=this.withCredentials,f.send(null)},THREE.JSONLoader.prototype.parse=function(a,b){function c(b){function c(a,b){return a&1<<b}var d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F=a.faces,G=a.vertices,H=a.normals,I=a.colors,J=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&J++;for(d=0;d<J;d++)f.faceVertexUvs[d]=[]}for(h=0,i=G.length;h<i;)v=new THREE.Vector3,v.x=G[h++]*b,v.y=G[h++]*b,v.z=G[h++]*b,f.vertices.push(v);for(h=0,i=F.length;h<i;)if(n=F[h++],o=c(n,0),p=c(n,1),q=c(n,3),r=c(n,4),s=c(n,5),t=c(n,6),u=c(n,7),o){if(x=new THREE.Face3,x.a=F[h],x.b=F[h+1],x.c=F[h+3],y=new THREE.Face3,y.a=F[h+1],y.b=F[h+2],y.c=F[h+3],h+=4,p&&(m=F[h++],x.materialIndex=m,y.materialIndex=m),g=f.faces.length,q)for(d=0;d<J;d++)for(B=a.uvs[d],f.faceVertexUvs[d][g]=[],f.faceVertexUvs[d][g+1]=[],e=0;e<4;e++)l=F[h++],D=B[2*l],E=B[2*l+1],C=new THREE.Vector2(D,E),2!==e&&f.faceVertexUvs[d][g].push(C),0!==e&&f.faceVertexUvs[d][g+1].push(C);if(r&&(k=3*F[h++],x.normal.set(H[k++],H[k++],H[k]),y.normal.copy(x.normal)),s)for(d=0;d<4;d++)k=3*F[h++],A=new THREE.Vector3(H[k++],H[k++],H[k]),2!==d&&x.vertexNormals.push(A),0!==d&&y.vertexNormals.push(A);if(t&&(j=F[h++],z=I[j],x.color.setHex(z),y.color.setHex(z)),u)for(d=0;d<4;d++)j=F[h++],z=I[j],2!==d&&x.vertexColors.push(new THREE.Color(z)),0!==d&&y.vertexColors.push(new THREE.Color(z));f.faces.push(x),f.faces.push(y)}else{if(w=new THREE.Face3,w.a=F[h++],w.b=F[h++],w.c=F[h++],p&&(m=F[h++],w.materialIndex=m),g=f.faces.length,q)for(d=0;d<J;d++)for(B=a.uvs[d],f.faceVertexUvs[d][g]=[],e=0;e<3;e++)l=F[h++],D=B[2*l],E=B[2*l+1],C=new THREE.Vector2(D,E),f.faceVertexUvs[d][g].push(C);if(r&&(k=3*F[h++],w.normal.set(H[k++],H[k++],H[k])),s)for(d=0;d<3;d++)k=3*F[h++],A=new THREE.Vector3(H[k++],H[k++],H[k]),w.vertexNormals.push(A);if(t&&(j=F[h++],w.color.setHex(I[j])),u)for(d=0;d<3;d++)j=F[h++],w.vertexColors.push(new THREE.Color(I[j]));f.faces.push(w)}}function d(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var c=0,d=a.skinWeights.length;c<d;c+=b){var e=a.skinWeights[c],g=b>1?a.skinWeights[c+1]:0,h=b>2?a.skinWeights[c+2]:0,i=b>3?a.skinWeights[c+3]:0;f.skinWeights.push(new THREE.Vector4(e,g,h,i))}if(a.skinIndices)for(var c=0,d=a.skinIndices.length;c<d;c+=b){var j=a.skinIndices[c],k=b>1?a.skinIndices[c+1]:0,l=b>2?a.skinIndices[c+2]:0,m=b>3?a.skinIndices[c+3]:0;f.skinIndices.push(new THREE.Vector4(j,k,l,m))}f.bones=a.bones,f.bones&&f.bones.length>0&&(f.skinWeights.length!==f.skinIndices.length||f.skinIndices.length!==f.vertices.length)&&THREE.warn("THREE.JSONLoader: When skinning, number of vertices ("+f.vertices.length+"), skinIndices ("+f.skinIndices.length+"), and skinWeights ("+f.skinWeights.length+") should match."),f.animation=a.animation,f.animations=a.animations}function e(b){if(void 0!==a.morphTargets){var c,d,e,g,h,i;for(c=0,d=a.morphTargets.length;c<d;c++)for(f.morphTargets[c]={},f.morphTargets[c].name=a.morphTargets[c].name,f.morphTargets[c].vertices=[],h=f.morphTargets[c].vertices,i=a.morphTargets[c].vertices,e=0,g=i.length;e<g;e+=3){var j=new THREE.Vector3;j.x=i[e]*b,j.y=i[e+1]*b,j.z=i[e+2]*b,h.push(j)}}if(void 0!==a.morphColors){var c,d,k,l,m,n,o;for(c=0,d=a.morphColors.length;c<d;c++)for(f.morphColors[c]={},f.morphColors[c].name=a.morphColors[c].name,f.morphColors[c].colors=[],m=f.morphColors[c].colors,n=a.morphColors[c].colors,k=0,l=n.length;k<l;k+=3)o=new THREE.Color(16755200),o.setRGB(n[k],n[k+1],n[k+2]),m.push(o)}}var f=new THREE.Geometry,g=void 0!==a.scale?1/a.scale:1;if(c(g),d(),e(g),f.computeFaceNormals(),f.computeBoundingSphere(),void 0===a.materials||0===a.materials.length)return{geometry:f};var h=this.initMaterials(a.materials,b);return this.needsTangents(h)&&f.computeTangents(),{geometry:f,materials:h}},THREE.LoadingManager=function(a,b,c){var d=this,e=0,f=0;this.onLoad=a,this.onProgress=b,this.onError=c,this.itemStart=function(a){f++},this.itemEnd=function(a){e++,void 0!==d.onProgress&&d.onProgress(a,e,f),e===f&&void 0!==d.onLoad&&d.onLoad()}},THREE.DefaultLoadingManager=new THREE.LoadingManager,THREE.BufferGeometryLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager},THREE.BufferGeometryLoader.prototype={constructor:THREE.BufferGeometryLoader,load:function(a,b,c,d){var e=this,f=new THREE.XHRLoader(e.manager);f.setCrossOrigin(this.crossOrigin),f.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b=new THREE.BufferGeometry,c=a.data.attributes;for(var d in c){var e=c[d],f=new self[e.type](e.array);b.addAttribute(d,new THREE.BufferAttribute(f,e.itemSize))}var g=a.data.offsets;void 0!==g&&(b.offsets=JSON.parse(JSON.stringify(g)));var h=a.data.boundingSphere;if(void 0!==h){var i=new THREE.Vector3;void 0!==h.center&&i.fromArray(h.center),b.boundingSphere=new THREE.Sphere(i,h.radius)}return b}},THREE.MaterialLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager},THREE.MaterialLoader.prototype={constructor:THREE.MaterialLoader,load:function(a,b,c,d){var e=this,f=new THREE.XHRLoader(e.manager);f.setCrossOrigin(this.crossOrigin),f.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b=new THREE[a.type];if(void 0!==a.color&&b.color.setHex(a.color),void 0!==a.emissive&&b.emissive.setHex(a.emissive),void 0!==a.specular&&b.specular.setHex(a.specular),void 0!==a.shininess&&(b.shininess=a.shininess),void 0!==a.uniforms&&(b.uniforms=a.uniforms),void 0!==a.vertexShader&&(b.vertexShader=a.vertexShader),void 0!==a.fragmentShader&&(b.fragmentShader=a.fragmentShader),void 0!==a.vertexColors&&(b.vertexColors=a.vertexColors),void 0!==a.shading&&(b.shading=a.shading),void 0!==a.blending&&(b.blending=a.blending),void 0!==a.side&&(b.side=a.side),void 0!==a.opacity&&(b.opacity=a.opacity),void 0!==a.transparent&&(b.transparent=a.transparent),void 0!==a.wireframe&&(b.wireframe=a.wireframe),void 0!==a.size&&(b.size=a.size),void 0!==a.sizeAttenuation&&(b.sizeAttenuation=a.sizeAttenuation),void 0!==a.materials)for(var c=0,d=a.materials.length;c<d;c++)b.materials.push(this.parse(a.materials[c]));return b}},THREE.ObjectLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager,this.texturePath=""},THREE.ObjectLoader.prototype={constructor:THREE.ObjectLoader,load:function(a,b,c,d){""===this.texturePath&&(this.texturePath=a.substring(0,a.lastIndexOf("/")+1));var e=this,f=new THREE.XHRLoader(e.manager);f.setCrossOrigin(this.crossOrigin),f.load(a,function(a){e.parse(JSON.parse(a),b)},c,d)},setTexturePath:function(a){this.texturePath=a},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a,b){var c=this.parseGeometries(a.geometries),d=this.parseImages(a.images,function(){void 0!==b&&b(g)}),e=this.parseTextures(a.textures,d),f=this.parseMaterials(a.materials,e),g=this.parseObject(a.object,c,f);return void 0!==a.images&&0!==a.images.length||void 0!==b&&b(g),g},parseGeometries:function(a){var b={};if(void 0!==a)for(var c=new THREE.JSONLoader,d=new THREE.BufferGeometryLoader,e=0,f=a.length;e<f;e++){var g,h=a[e];switch(h.type){case"PlaneGeometry":case"PlaneBufferGeometry":g=new THREE[h.type](h.width,h.height,h.widthSegments,h.heightSegments);break;case"BoxGeometry":case"CubeGeometry":g=new THREE.BoxGeometry(h.width,h.height,h.depth,h.widthSegments,h.heightSegments,h.depthSegments);break;case"CircleGeometry":g=new THREE.CircleGeometry(h.radius,h.segments);break;case"CylinderGeometry":g=new THREE.CylinderGeometry(h.radiusTop,h.radiusBottom,h.height,h.radialSegments,h.heightSegments,h.openEnded);break;case"SphereGeometry":g=new THREE.SphereGeometry(h.radius,h.widthSegments,h.heightSegments,h.phiStart,h.phiLength,h.thetaStart,h.thetaLength);break;case"IcosahedronGeometry":g=new THREE.IcosahedronGeometry(h.radius,h.detail);break;case"TorusGeometry":g=new THREE.TorusGeometry(h.radius,h.tube,h.radialSegments,h.tubularSegments,h.arc);break;case"TorusKnotGeometry":g=new THREE.TorusKnotGeometry(h.radius,h.tube,h.radialSegments,h.tubularSegments,h.p,h.q,h.heightScale);break;case"BufferGeometry":g=d.parse(h);break;case"Geometry":g=c.parse(h.data).geometry}g.uuid=h.uuid,void 0!==h.name&&(g.name=h.name),b[h.uuid]=g}return b},parseMaterials:function(a,b){var c={};if(void 0!==a)for(var d=function(a){return void 0===b[a]&&THREE.warn("THREE.ObjectLoader: Undefined texture",a),b[a]},e=new THREE.MaterialLoader,f=0,g=a.length;f<g;f++){var h=a[f],i=e.parse(h);i.uuid=h.uuid,void 0!==h.name&&(i.name=h.name),void 0!==h.map&&(i.map=d(h.map)),void 0!==h.bumpMap&&(i.bumpMap=d(h.bumpMap),h.bumpScale&&(i.bumpScale=new THREE.Vector2(h.bumpScale,h.bumpScale))),void 0!==h.alphaMap&&(i.alphaMap=d(h.alphaMap)),void 0!==h.envMap&&(i.envMap=d(h.envMap)),void 0!==h.normalMap&&(i.normalMap=d(h.normalMap),h.normalScale&&(i.normalScale=new THREE.Vector2(h.normalScale,h.normalScale))),void 0!==h.lightMap&&(i.lightMap=d(h.lightMap)),void 0!==h.specularMap&&(i.specularMap=d(h.specularMap)),c[h.uuid]=i}return c},parseImages:function(a,b){var c=this,d={};if(void 0!==a&&a.length>0){var e=new THREE.LoadingManager(b),f=new THREE.ImageLoader(e);f.setCrossOrigin(this.crossOrigin);for(var g=function(a){return c.manager.itemStart(a),f.load(a,function(){c.manager.itemEnd(a)})},h=0,i=a.length;h<i;h++){var j=a[h],k=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(j.url)?j.url:c.texturePath+j.url;d[j.uuid]=g(k)}}return d},parseTextures:function(a,b){var c={};if(void 0!==a)for(var d=0,e=a.length;d<e;d++){var f=a[d];void 0===f.image&&THREE.warn('THREE.ObjectLoader: No "image" speficied for',f.uuid),void 0===b[f.image]&&THREE.warn("THREE.ObjectLoader: Undefined image",f.image);var g=new THREE.Texture(b[f.image]);g.needsUpdate=!0,g.uuid=f.uuid,void 0!==f.name&&(g.name=f.name),void 0!==f.repeat&&(g.repeat=new THREE.Vector2(f.repeat[0],f.repeat[1])),void 0!==f.minFilter&&(g.minFilter=THREE[f.minFilter]),void 0!==f.magFilter&&(g.magFilter=THREE[f.magFilter]),void 0!==f.anisotropy&&(g.anisotropy=f.anisotropy),f.wrap instanceof Array&&(g.wrapS=THREE[f.wrap[0]],g.wrapT=THREE[f.wrap[1]]),c[f.uuid]=g}return c},parseObject:function(){var a=new THREE.Matrix4;return function(b,c,d){var e,f=function(a){return void 0===c[a]&&THREE.warn("THREE.ObjectLoader: Undefined geometry",a),c[a]},g=function(a){return void 0===d[a]&&THREE.warn("THREE.ObjectLoader: Undefined material",a),d[a]};switch(b.type){case"Scene":e=new THREE.Scene;break;case"PerspectiveCamera":e=new THREE.PerspectiveCamera(b.fov,b.aspect,b.near,b.far);break;case"OrthographicCamera":e=new THREE.OrthographicCamera(b.left,b.right,b.top,b.bottom,b.near,b.far);break;case"AmbientLight":e=new THREE.AmbientLight(b.color);break;case"DirectionalLight":e=new THREE.DirectionalLight(b.color,b.intensity);break;case"PointLight":e=new THREE.PointLight(b.color,b.intensity,b.distance,b.decay);break;case"SpotLight":e=new THREE.SpotLight(b.color,b.intensity,b.distance,b.angle,b.exponent,b.decay);break;case"HemisphereLight":e=new THREE.HemisphereLight(b.color,b.groundColor,b.intensity);break;case"Mesh":e=new THREE.Mesh(f(b.geometry),g(b.material));break;case"Line":e=new THREE.Line(f(b.geometry),g(b.material),b.mode);break;case"PointCloud":e=new THREE.PointCloud(f(b.geometry),g(b.material));break;case"Sprite":e=new THREE.Sprite(g(b.material));break;case"Group":e=new THREE.Group;break;default:e=new THREE.Object3D}if(e.uuid=b.uuid,void 0!==b.name&&(e.name=b.name),void 0!==b.matrix?(a.fromArray(b.matrix),a.decompose(e.position,e.quaternion,e.scale)):(void 0!==b.position&&e.position.fromArray(b.position),void 0!==b.rotation&&e.rotation.fromArray(b.rotation),void 0!==b.scale&&e.scale.fromArray(b.scale)),void 0!==b.visible&&(e.visible=b.visible),void 0!==b.userData&&(e.userData=b.userData),void 0!==b.children)for(var h in b.children)e.add(this.parseObject(b.children[h],c,d));return e}}()},THREE.TextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager},THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b,c,d){var e=this,f=new THREE.ImageLoader(e.manager);f.setCrossOrigin(this.crossOrigin),f.load(a,function(a){var c=new THREE.Texture(a);c.needsUpdate=!0,void 0!==b&&b(c)},c,d)},setCrossOrigin:function(a){this.crossOrigin=a}},THREE.DataTextureLoader=THREE.BinaryTextureLoader=function(){this._parser=null},THREE.BinaryTextureLoader.prototype={constructor:THREE.BinaryTextureLoader,load:function(a,b,c,d){var e=this,f=new THREE.DataTexture,g=new THREE.XHRLoader;return g.setResponseType("arraybuffer"),g.load(a,function(a){var c=e._parser(a);c&&(void 0!==c.image?f.image=c.image:void 0!==c.data&&(f.image.width=c.width,f.image.height=c.height,f.image.data=c.data),f.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping,f.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping,f.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter,f.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter,f.anisotropy=void 0!==c.anisotropy?c.anisotropy:1,void 0!==c.format&&(f.format=c.format),void 0!==c.type&&(f.type=c.type),void 0!==c.mipmaps&&(f.mipmaps=c.mipmaps),1===c.mipmapCount&&(f.minFilter=THREE.LinearFilter),f.needsUpdate=!0,b&&b(f,c))},c,d),f}},THREE.CompressedTextureLoader=function(){this._parser=null},THREE.CompressedTextureLoader.prototype={constructor:THREE.CompressedTextureLoader,load:function(a,b,c){var d=this,e=[],f=new THREE.CompressedTexture;f.image=e;var g=new THREE.XHRLoader;if(g.setResponseType("arraybuffer"),a instanceof Array)for(var h=0,i=function(c){g.load(a[c],function(a){var g=d._parser(a,!0);e[c]={width:g.width,height:g.height,format:g.format,mipmaps:g.mipmaps},6===(h+=1)&&(1==g.mipmapCount&&(f.minFilter=THREE.LinearFilter),f.format=g.format,f.needsUpdate=!0,b&&b(f))})},j=0,k=a.length;j<k;++j)i(j);else g.load(a,function(a){var c=d._parser(a,!0);if(c.isCubemap)for(var g=c.mipmaps.length/c.mipmapCount,h=0;h<g;h++){e[h]={mipmaps:[]};for(var i=0;i<c.mipmapCount;i++)e[h].mipmaps.push(c.mipmaps[h*c.mipmapCount+i]),e[h].format=c.format,e[h].width=c.width,e[h].height=c.height}else f.image.width=c.width,f.image.height=c.height,f.mipmaps=c.mipmaps;1===c.mipmapCount&&(f.minFilter=THREE.LinearFilter),f.format=c.format,f.needsUpdate=!0,b&&b(f)});return f}},THREE.Material=function(){Object.defineProperty(this,"id",{value:THREE.MaterialIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="Material",this.side=THREE.FrontSide,this.opacity=1,this.transparent=!1,this.blending=THREE.NormalBlending,this.blendSrc=THREE.SrcAlphaFactor,this.blendDst=THREE.OneMinusSrcAlphaFactor,this.blendEquation=THREE.AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthTest=!0,this.depthWrite=!0,this.colorWrite=!0,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.alphaTest=0,this.overdraw=0,this.visible=!0,this._needsUpdate=!0},THREE.Material.prototype={constructor:THREE.Material,get needsUpdate(){return this._needsUpdate},set needsUpdate(a){!0===a&&this.update(),this._needsUpdate=a},setValues:function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0!==c){if(b in this){var d=this[b];d instanceof THREE.Color?d.set(c):d instanceof THREE.Vector3&&c instanceof THREE.Vector3?d.copy(c):this[b]="overdraw"==b?Number(c):c}}else THREE.warn("THREE.Material: '"+b+"' parameter is undefined.")}},toJSON:function(){var a={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type};return""!==this.name&&(a.name=this.name),
  this instanceof THREE.MeshBasicMaterial?(a.color=this.color.getHex(),this.vertexColors!==THREE.NoColors&&(a.vertexColors=this.vertexColors),this.blending!==THREE.NormalBlending&&(a.blending=this.blending),this.side!==THREE.FrontSide&&(a.side=this.side)):this instanceof THREE.MeshLambertMaterial?(a.color=this.color.getHex(),a.emissive=this.emissive.getHex(),this.vertexColors!==THREE.NoColors&&(a.vertexColors=this.vertexColors),this.shading!==THREE.SmoothShading&&(a.shading=this.shading),this.blending!==THREE.NormalBlending&&(a.blending=this.blending),this.side!==THREE.FrontSide&&(a.side=this.side)):this instanceof THREE.MeshPhongMaterial?(a.color=this.color.getHex(),a.emissive=this.emissive.getHex(),a.specular=this.specular.getHex(),a.shininess=this.shininess,this.vertexColors!==THREE.NoColors&&(a.vertexColors=this.vertexColors),this.shading!==THREE.SmoothShading&&(a.shading=this.shading),this.blending!==THREE.NormalBlending&&(a.blending=this.blending),this.side!==THREE.FrontSide&&(a.side=this.side)):this instanceof THREE.MeshNormalMaterial?(this.blending!==THREE.NormalBlending&&(a.blending=this.blending),this.side!==THREE.FrontSide&&(a.side=this.side)):this instanceof THREE.MeshDepthMaterial?(this.blending!==THREE.NormalBlending&&(a.blending=this.blending),this.side!==THREE.FrontSide&&(a.side=this.side)):this instanceof THREE.PointCloudMaterial?(a.size=this.size,a.sizeAttenuation=this.sizeAttenuation,a.color=this.color.getHex(),this.vertexColors!==THREE.NoColors&&(a.vertexColors=this.vertexColors),this.blending!==THREE.NormalBlending&&(a.blending=this.blending)):this instanceof THREE.ShaderMaterial?(a.uniforms=this.uniforms,a.vertexShader=this.vertexShader,a.fragmentShader=this.fragmentShader):this instanceof THREE.SpriteMaterial&&(a.color=this.color.getHex()),this.opacity<1&&(a.opacity=this.opacity),!1!==this.transparent&&(a.transparent=this.transparent),!1!==this.wireframe&&(a.wireframe=this.wireframe),a},clone:function(a){return void 0===a&&(a=new THREE.Material),a.name=this.name,a.side=this.side,a.opacity=this.opacity,a.transparent=this.transparent,a.blending=this.blending,a.blendSrc=this.blendSrc,a.blendDst=this.blendDst,a.blendEquation=this.blendEquation,a.blendSrcAlpha=this.blendSrcAlpha,a.blendDstAlpha=this.blendDstAlpha,a.blendEquationAlpha=this.blendEquationAlpha,a.depthTest=this.depthTest,a.depthWrite=this.depthWrite,a.polygonOffset=this.polygonOffset,a.polygonOffsetFactor=this.polygonOffsetFactor,a.polygonOffsetUnits=this.polygonOffsetUnits,a.alphaTest=this.alphaTest,a.overdraw=this.overdraw,a.visible=this.visible,a},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.Material.prototype),THREE.MaterialIdCount=0,THREE.LineBasicMaterial=function(a){THREE.Material.call(this),this.type="LineBasicMaterial",this.color=new THREE.Color(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.vertexColors=THREE.NoColors,this.fog=!0,this.setValues(a)},THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype),THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial,THREE.LineBasicMaterial.prototype.clone=function(){var a=new THREE.LineBasicMaterial;return THREE.Material.prototype.clone.call(this,a),a.color.copy(this.color),a.linewidth=this.linewidth,a.linecap=this.linecap,a.linejoin=this.linejoin,a.vertexColors=this.vertexColors,a.fog=this.fog,a},THREE.LineDashedMaterial=function(a){THREE.Material.call(this),this.type="LineDashedMaterial",this.color=new THREE.Color(16777215),this.linewidth=1,this.scale=1,this.dashSize=3,this.gapSize=1,this.vertexColors=!1,this.fog=!0,this.setValues(a)},THREE.LineDashedMaterial.prototype=Object.create(THREE.Material.prototype),THREE.LineDashedMaterial.prototype.constructor=THREE.LineDashedMaterial,THREE.LineDashedMaterial.prototype.clone=function(){var a=new THREE.LineDashedMaterial;return THREE.Material.prototype.clone.call(this,a),a.color.copy(this.color),a.linewidth=this.linewidth,a.scale=this.scale,a.dashSize=this.dashSize,a.gapSize=this.gapSize,a.vertexColors=this.vertexColors,a.fog=this.fog,a},THREE.MeshBasicMaterial=function(a){THREE.Material.call(this),this.type="MeshBasicMaterial",this.color=new THREE.Color(16777215),this.map=null,this.lightMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=THREE.NoColors,this.skinning=!1,this.morphTargets=!1,this.setValues(a)},THREE.MeshBasicMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial,THREE.MeshBasicMaterial.prototype.clone=function(){var a=new THREE.MeshBasicMaterial;return THREE.Material.prototype.clone.call(this,a),a.color.copy(this.color),a.map=this.map,a.lightMap=this.lightMap,a.specularMap=this.specularMap,a.alphaMap=this.alphaMap,a.envMap=this.envMap,a.combine=this.combine,a.reflectivity=this.reflectivity,a.refractionRatio=this.refractionRatio,a.fog=this.fog,a.shading=this.shading,a.wireframe=this.wireframe,a.wireframeLinewidth=this.wireframeLinewidth,a.wireframeLinecap=this.wireframeLinecap,a.wireframeLinejoin=this.wireframeLinejoin,a.vertexColors=this.vertexColors,a.skinning=this.skinning,a.morphTargets=this.morphTargets,a},THREE.MeshLambertMaterial=function(a){THREE.Material.call(this),this.type="MeshLambertMaterial",this.color=new THREE.Color(16777215),this.emissive=new THREE.Color(0),this.wrapAround=!1,this.wrapRGB=new THREE.Vector3(1,1,1),this.map=null,this.lightMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=THREE.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(a)},THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshLambertMaterial.prototype.constructor=THREE.MeshLambertMaterial,THREE.MeshLambertMaterial.prototype.clone=function(){var a=new THREE.MeshLambertMaterial;return THREE.Material.prototype.clone.call(this,a),a.color.copy(this.color),a.emissive.copy(this.emissive),a.wrapAround=this.wrapAround,a.wrapRGB.copy(this.wrapRGB),a.map=this.map,a.lightMap=this.lightMap,a.specularMap=this.specularMap,a.alphaMap=this.alphaMap,a.envMap=this.envMap,a.combine=this.combine,a.reflectivity=this.reflectivity,a.refractionRatio=this.refractionRatio,a.fog=this.fog,a.shading=this.shading,a.wireframe=this.wireframe,a.wireframeLinewidth=this.wireframeLinewidth,a.wireframeLinecap=this.wireframeLinecap,a.wireframeLinejoin=this.wireframeLinejoin,a.vertexColors=this.vertexColors,a.skinning=this.skinning,a.morphTargets=this.morphTargets,a.morphNormals=this.morphNormals,a},THREE.MeshPhongMaterial=function(a){THREE.Material.call(this),this.type="MeshPhongMaterial",this.color=new THREE.Color(16777215),this.emissive=new THREE.Color(0),this.specular=new THREE.Color(1118481),this.shininess=30,this.metal=!1,this.wrapAround=!1,this.wrapRGB=new THREE.Vector3(1,1,1),this.map=null,this.lightMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new THREE.Vector2(1,1),this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=THREE.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(a)},THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshPhongMaterial.prototype.constructor=THREE.MeshPhongMaterial,THREE.MeshPhongMaterial.prototype.clone=function(){var a=new THREE.MeshPhongMaterial;return THREE.Material.prototype.clone.call(this,a),a.color.copy(this.color),a.emissive.copy(this.emissive),a.specular.copy(this.specular),a.shininess=this.shininess,a.metal=this.metal,a.wrapAround=this.wrapAround,a.wrapRGB.copy(this.wrapRGB),a.map=this.map,a.lightMap=this.lightMap,a.bumpMap=this.bumpMap,a.bumpScale=this.bumpScale,a.normalMap=this.normalMap,a.normalScale.copy(this.normalScale),a.specularMap=this.specularMap,a.alphaMap=this.alphaMap,a.envMap=this.envMap,a.combine=this.combine,a.reflectivity=this.reflectivity,a.refractionRatio=this.refractionRatio,a.fog=this.fog,a.shading=this.shading,a.wireframe=this.wireframe,a.wireframeLinewidth=this.wireframeLinewidth,a.wireframeLinecap=this.wireframeLinecap,a.wireframeLinejoin=this.wireframeLinejoin,a.vertexColors=this.vertexColors,a.skinning=this.skinning,a.morphTargets=this.morphTargets,a.morphNormals=this.morphNormals,a},THREE.MeshDepthMaterial=function(a){THREE.Material.call(this),this.type="MeshDepthMaterial",this.morphTargets=!1,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(a)},THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshDepthMaterial.prototype.constructor=THREE.MeshDepthMaterial,THREE.MeshDepthMaterial.prototype.clone=function(){var a=new THREE.MeshDepthMaterial;return THREE.Material.prototype.clone.call(this,a),a.wireframe=this.wireframe,a.wireframeLinewidth=this.wireframeLinewidth,a},THREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a),this.type="MeshNormalMaterial",this.wireframe=!1,this.wireframeLinewidth=1,this.morphTargets=!1,this.setValues(a)},THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshNormalMaterial.prototype.constructor=THREE.MeshNormalMaterial,THREE.MeshNormalMaterial.prototype.clone=function(){var a=new THREE.MeshNormalMaterial;return THREE.Material.prototype.clone.call(this,a),a.wireframe=this.wireframe,a.wireframeLinewidth=this.wireframeLinewidth,a},THREE.MeshFaceMaterial=function(a){this.uuid=THREE.Math.generateUUID(),this.type="MeshFaceMaterial",this.materials=a instanceof Array?a:[]},THREE.MeshFaceMaterial.prototype={constructor:THREE.MeshFaceMaterial,toJSON:function(){for(var a={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},b=0,c=this.materials.length;b<c;b++)a.materials.push(this.materials[b].toJSON());return a},clone:function(){for(var a=new THREE.MeshFaceMaterial,b=0;b<this.materials.length;b++)a.materials.push(this.materials[b].clone());return a}},THREE.PointCloudMaterial=function(a){THREE.Material.call(this),this.type="PointCloudMaterial",this.color=new THREE.Color(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.vertexColors=THREE.NoColors,this.fog=!0,this.setValues(a)},THREE.PointCloudMaterial.prototype=Object.create(THREE.Material.prototype),THREE.PointCloudMaterial.prototype.constructor=THREE.PointCloudMaterial,THREE.PointCloudMaterial.prototype.clone=function(){var a=new THREE.PointCloudMaterial;return THREE.Material.prototype.clone.call(this,a),a.color.copy(this.color),a.map=this.map,a.size=this.size,a.sizeAttenuation=this.sizeAttenuation,a.vertexColors=this.vertexColors,a.fog=this.fog,a},THREE.ParticleBasicMaterial=function(a){return THREE.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointCloudMaterial."),new THREE.PointCloudMaterial(a)},THREE.ParticleSystemMaterial=function(a){return THREE.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointCloudMaterial."),new THREE.PointCloudMaterial(a)},THREE.ShaderMaterial=function(a){THREE.Material.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.attributes=null,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.shading=THREE.SmoothShading,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.vertexColors=THREE.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.setValues(a)},THREE.ShaderMaterial.prototype=Object.create(THREE.Material.prototype),THREE.ShaderMaterial.prototype.constructor=THREE.ShaderMaterial,THREE.ShaderMaterial.prototype.clone=function(){var a=new THREE.ShaderMaterial;return THREE.Material.prototype.clone.call(this,a),a.fragmentShader=this.fragmentShader,a.vertexShader=this.vertexShader,a.uniforms=THREE.UniformsUtils.clone(this.uniforms),a.attributes=this.attributes,a.defines=this.defines,a.shading=this.shading,a.wireframe=this.wireframe,a.wireframeLinewidth=this.wireframeLinewidth,a.fog=this.fog,a.lights=this.lights,a.vertexColors=this.vertexColors,a.skinning=this.skinning,a.morphTargets=this.morphTargets,a.morphNormals=this.morphNormals,a},THREE.RawShaderMaterial=function(a){THREE.ShaderMaterial.call(this,a),this.type="RawShaderMaterial"},THREE.RawShaderMaterial.prototype=Object.create(THREE.ShaderMaterial.prototype),THREE.RawShaderMaterial.prototype.constructor=THREE.RawShaderMaterial,THREE.RawShaderMaterial.prototype.clone=function(){var a=new THREE.RawShaderMaterial;return THREE.ShaderMaterial.prototype.clone.call(this,a),a},THREE.SpriteMaterial=function(a){THREE.Material.call(this),this.type="SpriteMaterial",this.color=new THREE.Color(16777215),this.map=null,this.rotation=0,this.fog=!1,this.setValues(a)},THREE.SpriteMaterial.prototype=Object.create(THREE.Material.prototype),THREE.SpriteMaterial.prototype.constructor=THREE.SpriteMaterial,THREE.SpriteMaterial.prototype.clone=function(){var a=new THREE.SpriteMaterial;return THREE.Material.prototype.clone.call(this,a),a.color.copy(this.color),a.map=this.map,a.rotation=this.rotation,a.fog=this.fog,a},THREE.Texture=function(a,b,c,d,e,f,g,h,i){Object.defineProperty(this,"id",{value:THREE.TextureIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.sourceFile="",this.image=void 0!==a?a:THREE.Texture.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==b?b:THREE.Texture.DEFAULT_MAPPING,this.wrapS=void 0!==c?c:THREE.ClampToEdgeWrapping,this.wrapT=void 0!==d?d:THREE.ClampToEdgeWrapping,this.magFilter=void 0!==e?e:THREE.LinearFilter,this.minFilter=void 0!==f?f:THREE.LinearMipMapLinearFilter,this.anisotropy=void 0!==i?i:1,this.format=void 0!==g?g:THREE.RGBAFormat,this.type=void 0!==h?h:THREE.UnsignedByteType,this.offset=new THREE.Vector2(0,0),this.repeat=new THREE.Vector2(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this._needsUpdate=!1,this.onUpdate=null},THREE.Texture.DEFAULT_IMAGE=void 0,THREE.Texture.DEFAULT_MAPPING=THREE.UVMapping,THREE.Texture.prototype={constructor:THREE.Texture,get needsUpdate(){return this._needsUpdate},set needsUpdate(a){!0===a&&this.update(),this._needsUpdate=a},clone:function(a){return void 0===a&&(a=new THREE.Texture),a.image=this.image,a.mipmaps=this.mipmaps.slice(0),a.mapping=this.mapping,a.wrapS=this.wrapS,a.wrapT=this.wrapT,a.magFilter=this.magFilter,a.minFilter=this.minFilter,a.anisotropy=this.anisotropy,a.format=this.format,a.type=this.type,a.offset.copy(this.offset),a.repeat.copy(this.repeat),a.generateMipmaps=this.generateMipmaps,a.premultiplyAlpha=this.premultiplyAlpha,a.flipY=this.flipY,a.unpackAlignment=this.unpackAlignment,a},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.Texture.prototype),THREE.TextureIdCount=0,THREE.CubeTexture=function(a,b,c,d,e,f,g,h,i){b=void 0!==b?b:THREE.CubeReflectionMapping,THREE.Texture.call(this,a,b,c,d,e,f,g,h,i),this.images=a},THREE.CubeTexture.prototype=Object.create(THREE.Texture.prototype),THREE.CubeTexture.prototype.constructor=THREE.CubeTexture,THREE.CubeTexture.clone=function(a){return void 0===a&&(a=new THREE.CubeTexture),THREE.Texture.prototype.clone.call(this,a),a.images=this.images,a},THREE.CompressedTexture=function(a,b,c,d,e,f,g,h,i,j,k){THREE.Texture.call(this,null,f,g,h,i,j,d,e,k),this.image={width:b,height:c},this.mipmaps=a,this.flipY=!1,this.generateMipmaps=!1},THREE.CompressedTexture.prototype=Object.create(THREE.Texture.prototype),THREE.CompressedTexture.prototype.constructor=THREE.CompressedTexture,THREE.CompressedTexture.prototype.clone=function(){var a=new THREE.CompressedTexture;return THREE.Texture.prototype.clone.call(this,a),a},THREE.DataTexture=function(a,b,c,d,e,f,g,h,i,j,k){THREE.Texture.call(this,null,f,g,h,i,j,d,e,k),this.image={data:a,width:b,height:c}},THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype),THREE.DataTexture.prototype.constructor=THREE.DataTexture,THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture;return THREE.Texture.prototype.clone.call(this,a),a},THREE.VideoTexture=function(a,b,c,d,e,f,g,h,i){THREE.Texture.call(this,a,b,c,d,e,f,g,h,i),this.generateMipmaps=!1;var j=this,k=function(){requestAnimationFrame(k),a.readyState===a.HAVE_ENOUGH_DATA&&(j.needsUpdate=!0)};k()},THREE.VideoTexture.prototype=Object.create(THREE.Texture.prototype),THREE.VideoTexture.prototype.constructor=THREE.VideoTexture,THREE.Group=function(){THREE.Object3D.call(this),this.type="Group"},THREE.Group.prototype=Object.create(THREE.Object3D.prototype),THREE.Group.prototype.constructor=THREE.Group,THREE.PointCloud=function(a,b){THREE.Object3D.call(this),this.type="PointCloud",this.geometry=void 0!==a?a:new THREE.Geometry,this.material=void 0!==b?b:new THREE.PointCloudMaterial({color:16777215*Math.random()})},THREE.PointCloud.prototype=Object.create(THREE.Object3D.prototype),THREE.PointCloud.prototype.constructor=THREE.PointCloud,THREE.PointCloud.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray;return function(c,d){var e=this,f=e.geometry,g=c.params.PointCloud.threshold;if(a.getInverse(this.matrixWorld),b.copy(c.ray).applyMatrix4(a),null===f.boundingBox||!1!==b.isIntersectionBox(f.boundingBox)){var h=g/((this.scale.x+this.scale.y+this.scale.z)/3),i=new THREE.Vector3,j=function(a,f){var g=b.distanceToPoint(a);if(g<h){var i=b.closestPointToPoint(a);i.applyMatrix4(e.matrixWorld);var j=c.ray.origin.distanceTo(i);d.push({distance:j,distanceToRay:g,point:i.clone(),index:f,face:null,object:e})}};if(f instanceof THREE.BufferGeometry){var k=f.attributes,l=k.position.array;if(void 0!==k.index){var m=k.index.array,n=f.offsets;if(0===n.length){n=[{start:0,count:m.length,index:0}]}for(var o=0,p=n.length;o<p;++o)for(var q=n[o].start,r=n[o].count,s=n[o].index,t=q,u=q+r;t<u;t++){var v=s+m[t];i.fromArray(l,3*v),j(i,v)}}else for(var w=l.length/3,t=0;t<w;t++)i.set(l[3*t],l[3*t+1],l[3*t+2]),j(i,t)}else for(var x=this.geometry.vertices,t=0;t<x.length;t++)j(x[t],t)}}}(),THREE.PointCloud.prototype.clone=function(a){return void 0===a&&(a=new THREE.PointCloud(this.geometry,this.material)),THREE.Object3D.prototype.clone.call(this,a),a},THREE.ParticleSystem=function(a,b){return THREE.warn("THREE.ParticleSystem has been renamed to THREE.PointCloud."),new THREE.PointCloud(a,b)},THREE.Line=function(a,b,c){THREE.Object3D.call(this),this.type="Line",this.geometry=void 0!==a?a:new THREE.Geometry,this.material=void 0!==b?b:new THREE.LineBasicMaterial({color:16777215*Math.random()}),this.mode=void 0!==c?c:THREE.LineStrip},THREE.LineStrip=0,THREE.LinePieces=1,THREE.Line.prototype=Object.create(THREE.Object3D.prototype),THREE.Line.prototype.constructor=THREE.Line,THREE.Line.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere;return function(d,e){var f=d.linePrecision,g=f*f,h=this.geometry;if(null===h.boundingSphere&&h.computeBoundingSphere(),c.copy(h.boundingSphere),c.applyMatrix4(this.matrixWorld),!1!==d.ray.isIntersectionSphere(c)){a.getInverse(this.matrixWorld),b.copy(d.ray).applyMatrix4(a);var i=new THREE.Vector3,j=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,m=this.mode===THREE.LineStrip?1:2;if(h instanceof THREE.BufferGeometry){var n=h.attributes;if(void 0!==n.index){var o=n.index.array,p=n.position.array,q=h.offsets;0===q.length&&(q=[{start:0,count:o.length,index:0}]);for(var r=0;r<q.length;r++)for(var s=q[r].start,t=q[r].count,u=q[r].index,v=s;v<s+t-1;v+=m){var w=u+o[v],x=u+o[v+1];i.fromArray(p,3*w),j.fromArray(p,3*x);var y=b.distanceSqToSegment(i,j,l,k);if(!(y>g)){var z=b.origin.distanceTo(l);z<d.near||z>d.far||e.push({distance:z,point:k.clone().applyMatrix4(this.matrixWorld),index:v,offsetIndex:r,face:null,faceIndex:null,object:this})}}}else for(var p=n.position.array,v=0;v<p.length/3-1;v+=m){i.fromArray(p,3*v),j.fromArray(p,3*v+3);var y=b.distanceSqToSegment(i,j,l,k);if(!(y>g)){var z=b.origin.distanceTo(l);z<d.near||z>d.far||e.push({distance:z,point:k.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}}else if(h instanceof THREE.Geometry)for(var A=h.vertices,B=A.length,v=0;v<B-1;v+=m){var y=b.distanceSqToSegment(A[v],A[v+1],l,k);if(!(y>g)){var z=b.origin.distanceTo(l);z<d.near||z>d.far||e.push({distance:z,point:k.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}}}}(),THREE.Line.prototype.clone=function(a){return void 0===a&&(a=new THREE.Line(this.geometry,this.material,this.mode)),THREE.Object3D.prototype.clone.call(this,a),a},THREE.Mesh=function(a,b){THREE.Object3D.call(this),this.type="Mesh",this.geometry=void 0!==a?a:new THREE.Geometry,this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()}),this.updateMorphTargets()},THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype),THREE.Mesh.prototype.constructor=THREE.Mesh,THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&this.geometry.morphTargets.length>0){this.morphTargetBase=-1,this.morphTargetForcedOrder=[],this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var a=0,b=this.geometry.morphTargets.length;a<b;a++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[a].name]=a}},THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){return void 0!==this.morphTargetDictionary[a]?this.morphTargetDictionary[a]:(THREE.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0."),0)},THREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3;return function(g,h){var i=this.geometry;if(null===i.boundingSphere&&i.computeBoundingSphere(),c.copy(i.boundingSphere),c.applyMatrix4(this.matrixWorld),!1!==g.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(g.ray).applyMatrix4(a),null===i.boundingBox||!1!==b.isIntersectionBox(i.boundingBox)))if(i instanceof THREE.BufferGeometry){var j=this.material;if(void 0===j)return;var k,l,m,n=i.attributes,o=g.precision;if(void 0!==n.index){var p=n.index.array,q=n.position.array,r=i.offsets;0===r.length&&(r=[{start:0,count:p.length,index:0}]);for(var s=0,t=r.length;s<t;++s)for(var u=r[s].start,v=r[s].count,w=r[s].index,x=u,y=u+v;x<y;x+=3){if(k=w+p[x],l=w+p[x+1],m=w+p[x+2],d.fromArray(q,3*k),e.fromArray(q,3*l),f.fromArray(q,3*m),j.side===THREE.BackSide)var z=b.intersectTriangle(f,e,d,!0);else var z=b.intersectTriangle(d,e,f,j.side!==THREE.DoubleSide);if(null!==z){z.applyMatrix4(this.matrixWorld);var A=g.ray.origin.distanceTo(z);A<o||A<g.near||A>g.far||h.push({distance:A,point:z,face:new THREE.Face3(k,l,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(var q=n.position.array,x=0,B=0,y=q.length;x<y;x+=3,B+=9){if(k=x,l=x+1,m=x+2,d.fromArray(q,B),e.fromArray(q,B+3),f.fromArray(q,B+6),j.side===THREE.BackSide)var z=b.intersectTriangle(f,e,d,!0);else var z=b.intersectTriangle(d,e,f,j.side!==THREE.DoubleSide);if(null!==z){z.applyMatrix4(this.matrixWorld);var A=g.ray.origin.distanceTo(z);A<o||A<g.near||A>g.far||h.push({distance:A,point:z,face:new THREE.Face3(k,l,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else if(i instanceof THREE.Geometry)for(var k,l,m,C=this.material instanceof THREE.MeshFaceMaterial,D=!0===C?this.material.materials:null,o=g.precision,E=i.vertices,F=0,G=i.faces.length;F<G;F++){var H=i.faces[F],j=!0===C?D[H.materialIndex]:this.material;if(void 0!==j){if(k=E[H.a],l=E[H.b],m=E[H.c],!0===j.morphTargets){var I=i.morphTargets,J=this.morphTargetInfluences;d.set(0,0,0),e.set(0,0,0),f.set(0,0,0);for(var K=0,L=I.length;K<L;K++){var M=J[K];if(0!==M){var N=I[K].vertices;d.x+=(N[H.a].x-k.x)*M,d.y+=(N[H.a].y-k.y)*M,d.z+=(N[H.a].z-k.z)*M,e.x+=(N[H.b].x-l.x)*M,e.y+=(N[H.b].y-l.y)*M,e.z+=(N[H.b].z-l.z)*M,f.x+=(N[H.c].x-m.x)*M,f.y+=(N[H.c].y-m.y)*M,f.z+=(N[H.c].z-m.z)*M}}d.add(k),e.add(l),f.add(m),k=d,l=e,m=f}if(j.side===THREE.BackSide)var z=b.intersectTriangle(m,l,k,!0);else var z=b.intersectTriangle(k,l,m,j.side!==THREE.DoubleSide);if(null!==z){z.applyMatrix4(this.matrixWorld);var A=g.ray.origin.distanceTo(z);A<o||A<g.near||A>g.far||h.push({distance:A,point:z,face:H,faceIndex:F,object:this})}}}}}(),THREE.Mesh.prototype.clone=function(a,b){return void 0===a&&(a=new THREE.Mesh(this.geometry,this.material)),THREE.Object3D.prototype.clone.call(this,a,b),a},THREE.Bone=function(a){THREE.Object3D.call(this),this.type="Bone",this.skin=a},THREE.Bone.prototype=Object.create(THREE.Object3D.prototype),THREE.Bone.prototype.constructor=THREE.Bone,THREE.Skeleton=function(a,b,c){if(this.useVertexTexture=void 0===c||c,this.identityMatrix=new THREE.Matrix4,a=a||[],this.bones=a.slice(0),this.useVertexTexture){var d;d=this.bones.length>256?64:this.bones.length>64?32:this.bones.length>16?16:8,this.boneTextureWidth=d,this.boneTextureHeight=d,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType),this.boneTexture.minFilter=THREE.NearestFilter,this.boneTexture.magFilter=THREE.NearestFilter,this.boneTexture.generateMipmaps=!1,this.boneTexture.flipY=!1}else 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{THREE.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[];for(var e=0,f=this.bones.length;e<f;e++)this.boneInverses.push(new THREE.Matrix4)}},THREE.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var a=0,b=this.bones.length;a<b;a++){var c=new THREE.Matrix4;this.bones[a]&&c.getInverse(this.bones[a].matrixWorld),this.boneInverses.push(c)}},THREE.Skeleton.prototype.pose=function(){for(var a,b=0,c=this.bones.length;b<c;b++)(a=this.bones[b])&&a.matrixWorld.getInverse(this.boneInverses[b]);for(var b=0,c=this.bones.length;b<c;b++)(a=this.bones[b])&&(a.parent?(a.matrix.getInverse(a.parent.matrixWorld),a.matrix.multiply(a.matrixWorld)):a.matrix.copy(a.matrixWorld),a.matrix.decompose(a.position,a.quaternion,a.scale))},THREE.Skeleton.prototype.update=function(){var a=new THREE.Matrix4;return function(){for(var b=0,c=this.bones.length;b<c;b++){var d=this.bones[b]?this.bones[b].matrixWorld:this.identityMatrix;a.multiplyMatrices(d,this.boneInverses[b]),a.flattenToArrayOffset(this.boneMatrices,16*b)}this.useVertexTexture&&(this.boneTexture.needsUpdate=!0)}}(),THREE.SkinnedMesh=function(a,b,c){THREE.Mesh.call(this,a,b),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new THREE.Matrix4,this.bindMatrixInverse=new THREE.Matrix4;var d=[];if(this.geometry&&void 0!==this.geometry.bones){for(var e,f,g,h,i,j=0,k=this.geometry.bones.length;j<k;++j)f=this.geometry.bones[j],g=f.pos,h=f.rotq,i=f.scl,e=new THREE.Bone(this),d.push(e),e.name=f.name,e.position.set(g[0],g[1],g[2]),e.quaternion.set(h[0],h[1],h[2],h[3]),void 0!==i?e.scale.set(i[0],i[1],i[2]):e.scale.set(1,1,1);for(var j=0,k=this.geometry.bones.length;j<k;++j)f=this.geometry.bones[j],-1!==f.parent?d[f.parent].add(d[j]):this.add(d[j])}this.normalizeSkinWeights(),this.updateMatrixWorld(!0),this.bind(new THREE.Skeleton(d,void 0,c))},THREE.SkinnedMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh,THREE.SkinnedMesh.prototype.bind=function(a,b){this.skeleton=a,void 0===b&&(this.updateMatrixWorld(!0),b=this.matrixWorld),this.bindMatrix.copy(b),this.bindMatrixInverse.getInverse(b)},THREE.SkinnedMesh.prototype.pose=function(){this.skeleton.pose()},THREE.SkinnedMesh.prototype.normalizeSkinWeights=function(){if(this.geometry instanceof THREE.Geometry)for(var a=0;a<this.geometry.skinIndices.length;a++){var b=this.geometry.skinWeights[a],c=1/b.lengthManhattan();c!==1/0?b.multiplyScalar(c):b.set(1)}},THREE.SkinnedMesh.prototype.updateMatrixWorld=function(a){THREE.Mesh.prototype.updateMatrixWorld.call(this,!0),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):THREE.warn("THREE.SkinnedMesh unreckognized bindMode: "+this.bindMode)},THREE.SkinnedMesh.prototype.clone=function(a){return void 0===a&&(a=new THREE.SkinnedMesh(this.geometry,this.material,this.useVertexTexture)),THREE.Mesh.prototype.clone.call(this,a),a},THREE.MorphAnimMesh=function(a,b){THREE.Mesh.call(this,a,b),this.type="MorphAnimMesh",this.duration=1e3,this.mirroredLoop=!1,this.time=0,this.lastKeyframe=0,this.currentKeyframe=0,this.direction=1,this.directionBackwards=!1,this.setFrameRange(0,this.geometry.morphTargets.length-1)},THREE.MorphAnimMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.MorphAnimMesh.prototype.constructor=THREE.MorphAnimMesh,THREE.MorphAnimMesh.prototype.setFrameRange=function(a,b){this.startKeyframe=a,this.endKeyframe=b,this.length=this.endKeyframe-this.startKeyframe+1},THREE.MorphAnimMesh.prototype.setDirectionForward=function(){this.direction=1,this.directionBackwards=!1},THREE.MorphAnimMesh.prototype.setDirectionBackward=function(){this.direction=-1,this.directionBackwards=!0},THREE.MorphAnimMesh.prototype.parseAnimations=function(){var a=this.geometry;a.animations||(a.animations={});for(var b,c=a.animations,d=/([a-z]+)_?(\d+)/,e=0,f=a.morphTargets.length;e<f;e++){var g=a.morphTargets[e],h=g.name.match(d);if(h&&h.length>1){var i=h[1];c[i]||(c[i]={start:1/0,end:-1/0});var j=c[i];e<j.start&&(j.start=e),e>j.end&&(j.end=e),b||(b=i)}}a.firstAnimation=b},THREE.MorphAnimMesh.prototype.setAnimationLabel=function(a,b,c){this.geometry.animations||(this.geometry.animations={}),this.geometry.animations[a]={start:b,end:c}},THREE.MorphAnimMesh.prototype.playAnimation=function(a,b){var c=this.geometry.animations[a];c?(this.setFrameRange(c.start,c.end),this.duration=(c.end-c.start)/b*1e3,this.time=0):THREE.warn("THREE.MorphAnimMesh: animation["+a+"] undefined in .playAnimation()")},THREE.MorphAnimMesh.prototype.updateAnimation=function(a){var b=this.duration/this.length;this.time+=this.direction*a,this.mirroredLoop?(this.time>this.duration||this.time<0)&&(this.direction*=-1,this.time>this.duration&&(this.time=this.duration,this.directionBackwards=!0),this.time<0&&(this.time=0,this.directionBackwards=!1)):(this.time=this.time%this.duration,this.time<0&&(this.time+=this.duration));var c=this.startKeyframe+THREE.Math.clamp(Math.floor(this.time/b),0,this.length-1);c!==this.currentKeyframe&&(this.morphTargetInfluences[this.lastKeyframe]=0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[c]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=c);var d=this.time%b/b;this.directionBackwards&&(d=1-d),this.morphTargetInfluences[this.currentKeyframe]=d,this.morphTargetInfluences[this.lastKeyframe]=1-d},THREE.MorphAnimMesh.prototype.interpolateTargets=function(a,b,c){for(var d=this.morphTargetInfluences,e=0,f=d.length;e<f;e++)d[e]=0;a>-1&&(d[a]=1-c),b>-1&&(d[b]=c)},
  THREE.MorphAnimMesh.prototype.clone=function(a){return void 0===a&&(a=new THREE.MorphAnimMesh(this.geometry,this.material)),a.duration=this.duration,a.mirroredLoop=this.mirroredLoop,a.time=this.time,a.lastKeyframe=this.lastKeyframe,a.currentKeyframe=this.currentKeyframe,a.direction=this.direction,a.directionBackwards=this.directionBackwards,THREE.Mesh.prototype.clone.call(this,a),a},THREE.LOD=function(){THREE.Object3D.call(this),this.objects=[]},THREE.LOD.prototype=Object.create(THREE.Object3D.prototype),THREE.LOD.prototype.constructor=THREE.LOD,THREE.LOD.prototype.addLevel=function(a,b){void 0===b&&(b=0),b=Math.abs(b);for(var c=0;c<this.objects.length&&!(b<this.objects[c].distance);c++);this.objects.splice(c,0,{distance:b,object:a}),this.add(a)},THREE.LOD.prototype.getObjectForDistance=function(a){for(var b=1,c=this.objects.length;b<c&&!(a<this.objects[b].distance);b++);return this.objects[b-1].object},THREE.LOD.prototype.raycast=function(){var a=new THREE.Vector3;return function(b,c){a.setFromMatrixPosition(this.matrixWorld);var d=b.ray.origin.distanceTo(a);this.getObjectForDistance(d).raycast(b,c)}}(),THREE.LOD.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){if(this.objects.length>1){a.setFromMatrixPosition(c.matrixWorld),b.setFromMatrixPosition(this.matrixWorld);var d=a.distanceTo(b);this.objects[0].object.visible=!0;for(var e=1,f=this.objects.length;e<f&&d>=this.objects[e].distance;e++)this.objects[e-1].object.visible=!1,this.objects[e].object.visible=!0;for(;e<f;e++)this.objects[e].object.visible=!1}}}(),THREE.LOD.prototype.clone=function(a){void 0===a&&(a=new THREE.LOD),THREE.Object3D.prototype.clone.call(this,a);for(var b=0,c=this.objects.length;b<c;b++){var d=this.objects[b].object.clone();d.visible=0===b,a.addLevel(d,this.objects[b].distance)}return a},THREE.Sprite=function(){var a=new Uint16Array([0,1,2,0,2,3]),b=new Float32Array([-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0]),c=new Float32Array([0,0,1,0,1,1,0,1]),d=new THREE.BufferGeometry;return d.addAttribute("index",new THREE.BufferAttribute(a,1)),d.addAttribute("position",new THREE.BufferAttribute(b,3)),d.addAttribute("uv",new THREE.BufferAttribute(c,2)),function(a){THREE.Object3D.call(this),this.type="Sprite",this.geometry=d,this.material=void 0!==a?a:new THREE.SpriteMaterial}}(),THREE.Sprite.prototype=Object.create(THREE.Object3D.prototype),THREE.Sprite.prototype.constructor=THREE.Sprite,THREE.Sprite.prototype.raycast=function(){var a=new THREE.Vector3;return function(b,c){a.setFromMatrixPosition(this.matrixWorld);var d=b.ray.distanceToPoint(a);d>this.scale.x||c.push({distance:d,point:this.position,face:null,object:this})}}(),THREE.Sprite.prototype.clone=function(a){return void 0===a&&(a=new THREE.Sprite(this.material)),THREE.Object3D.prototype.clone.call(this,a),a},THREE.Particle=THREE.Sprite,THREE.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this),this.lensFlares=[],this.positionScreen=new THREE.Vector3,this.customUpdateCallback=void 0,void 0!==a&&this.add(a,b,c,d,e)},THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype),THREE.LensFlare.prototype.constructor=THREE.LensFlare,THREE.LensFlare.prototype.add=function(a,b,c,d,e,f){void 0===b&&(b=-1),void 0===c&&(c=0),void 0===f&&(f=1),void 0===e&&(e=new THREE.Color(16777215)),void 0===d&&(d=THREE.NormalBlending),c=Math.min(c,Math.max(0,c)),this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:f,color:e,blending:d})},THREE.LensFlare.prototype.updateLensFlares=function(){var a,b,c=this.lensFlares.length,d=2*-this.positionScreen.x,e=2*-this.positionScreen.y;for(a=0;a<c;a++)b=this.lensFlares[a],b.x=this.positionScreen.x+d*b.distance,b.y=this.positionScreen.y+e*b.distance,b.wantedRotation=b.x*Math.PI*.25,b.rotation+=.25*(b.wantedRotation-b.rotation)},THREE.Scene=function(){THREE.Object3D.call(this),this.type="Scene",this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0},THREE.Scene.prototype=Object.create(THREE.Object3D.prototype),THREE.Scene.prototype.constructor=THREE.Scene,THREE.Scene.prototype.clone=function(a){return void 0===a&&(a=new THREE.Scene),THREE.Object3D.prototype.clone.call(this,a),null!==this.fog&&(a.fog=this.fog.clone()),null!==this.overrideMaterial&&(a.overrideMaterial=this.overrideMaterial.clone()),a.autoUpdate=this.autoUpdate,a.matrixAutoUpdate=this.matrixAutoUpdate,a},THREE.Fog=function(a,b,c){this.name="",this.color=new THREE.Color(a),this.near=void 0!==b?b:1,this.far=void 0!==c?c:1e3},THREE.Fog.prototype.clone=function(){return new THREE.Fog(this.color.getHex(),this.near,this.far)},THREE.FogExp2=function(a,b){this.name="",this.color=new THREE.Color(a),this.density=void 0!==b?b:25e-5},THREE.FogExp2.prototype.clone=function(){return new THREE.FogExp2(this.color.getHex(),this.density)},THREE.ShaderChunk={},THREE.ShaderChunk.common="#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n\nfloat square( in float a ) { return a*a; }\nvec2  square( in vec2 a )  { return vec2( a.x*a.x, a.y*a.y ); }\nvec3  square( in vec3 a )  { return vec3( a.x*a.x, a.y*a.y, a.z*a.z ); }\nvec4  square( in vec4 a )  { return vec4( a.x*a.x, a.y*a.y, a.z*a.z, a.w*a.w ); }\nfloat saturate( in float a ) { return clamp( a, 0.0, 1.0 ); }\nvec2  saturate( in vec2 a )  { return clamp( a, 0.0, 1.0 ); }\nvec3  saturate( in vec3 a )  { return clamp( a, 0.0, 1.0 ); }\nvec4  saturate( in vec4 a )  { return clamp( a, 0.0, 1.0 ); }\nfloat average( in float a ) { return a; }\nfloat average( in vec2 a )  { return ( a.x + a.y) * 0.5; }\nfloat average( in vec3 a )  { return ( a.x + a.y + a.z) / 3.0; }\nfloat average( in vec4 a )  { return ( a.x + a.y + a.z + a.w) * 0.25; }\nfloat whiteCompliment( in float a ) { return saturate( 1.0 - a ); }\nvec2  whiteCompliment( in vec2 a )  { return saturate( vec2(1.0) - a ); }\nvec3  whiteCompliment( in vec3 a )  { return saturate( vec3(1.0) - a ); }\nvec4  whiteCompliment( in vec4 a )  { return saturate( vec4(1.0) - a ); }\nvec3 transformDirection( in vec3 normal, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( normal, 0.0 ) ).xyz );\n}\n// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\nvec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {\n\treturn normalize( ( vec4( normal, 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 point - distance * planeNormal;\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 pointOnLine + lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) );\n}\nfloat calcLightAttenuation( float lightDistance, float cutoffDistance, float decayExponent ) {\n\tif ( decayExponent > 0.0 ) {\n\t  return pow( saturate( 1.0 - lightDistance / cutoffDistance ), decayExponent );\n\t}\n\treturn 1.0;\n}\n\nvec3 inputToLinear( in vec3 a ) {\n#ifdef GAMMA_INPUT\n\treturn pow( a, vec3( float( GAMMA_FACTOR ) ) );\n#else\n\treturn a;\n#endif\n}\nvec3 linearToOutput( in vec3 a ) {\n#ifdef GAMMA_OUTPUT\n\treturn pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );\n#else\n\treturn a;\n#endif\n}\n",THREE.ShaderChunk.alphatest_fragment="#ifdef ALPHATEST\n\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n\n#endif\n",THREE.ShaderChunk.lights_lambert_vertex="vLightFront = vec3( 0.0 );\n\n#ifdef DOUBLE_SIDED\n\n\tvLightBack = vec3( 0.0 );\n\n#endif\n\ntransformedNormal = normalize( transformedNormal );\n\n#if MAX_DIR_LIGHTS > 0\n\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n\tvec3 dirVector = transformDirection( directionalLightDirection[ i ], viewMatrix );\n\n\tfloat dotProduct = dot( transformedNormal, dirVector );\n\tvec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tvec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tvec3 directionalLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t#endif\n\n\t#endif\n\n\t#ifdef WRAP_AROUND\n\n\t\tvec3 directionalLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\tdirectionalLightWeighting = mix( directionalLightWeighting, directionalLightWeightingHalf, wrapRGB );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tdirectionalLightWeightingBack = mix( directionalLightWeightingBack, directionalLightWeightingHalfBack, wrapRGB );\n\n\t\t#endif\n\n\t#endif\n\n\tvLightFront += directionalLightColor[ i ] * directionalLightWeighting;\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tvLightBack += directionalLightColor[ i ] * directionalLightWeightingBack;\n\n\t#endif\n\n}\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n\t\tfloat attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n\t\tlVector = normalize( lVector );\n\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\n\t\tvec3 pointLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvec3 pointLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tvec3 pointLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tvec3 pointLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\t\tpointLightWeighting = mix( pointLightWeighting, pointLightWeightingHalf, wrapRGB );\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tpointLightWeightingBack = mix( pointLightWeightingBack, pointLightWeightingHalfBack, wrapRGB );\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t\tvLightFront += pointLightColor[ i ] * pointLightWeighting * attenuation;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += pointLightColor[ i ] * pointLightWeightingBack * attenuation;\n\n\t\t#endif\n\n\t}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - worldPosition.xyz ) );\n\n\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\n\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n\t\t\tfloat attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n\t\t\tlVector = normalize( lVector );\n\n\t\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\t\t\tvec3 spotLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tvec3 spotLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\t\tvec3 spotLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tvec3 spotLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\t\t\tspotLightWeighting = mix( spotLightWeighting, spotLightWeightingHalf, wrapRGB );\n\n\t\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\t\tspotLightWeightingBack = mix( spotLightWeightingBack, spotLightWeightingHalfBack, wrapRGB );\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\tvLightFront += spotLightColor[ i ] * spotLightWeighting * attenuation * spotEffect;\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tvLightBack += spotLightColor[ i ] * spotLightWeightingBack * attenuation * spotEffect;\n\n\t\t\t#endif\n\n\t\t}\n\n\t}\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n\t\tvec3 lVector = transformDirection( hemisphereLightDirection[ i ], viewMatrix );\n\n\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\n\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\t\tfloat hemiDiffuseWeightBack = -0.5 * dotProduct + 0.5;\n\n\t\tvLightFront += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeightBack );\n\n\t\t#endif\n\n\t}\n\n#endif\n\nvLightFront += ambientLightColor;\n\n#ifdef DOUBLE_SIDED\n\n\tvLightBack += ambientLightColor;\n\n#endif\n",THREE.ShaderChunk.map_particle_pars_fragment="#ifdef USE_MAP\n\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n\n#endif\n",THREE.ShaderChunk.default_vertex="#ifdef USE_SKINNING\n\n\tvec4 mvPosition = modelViewMatrix * skinned;\n\n#elif defined( USE_MORPHTARGETS )\n\n\tvec4 mvPosition = modelViewMatrix * vec4( morphed, 1.0 );\n\n#else\n\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\n#endif\n\ngl_Position = projectionMatrix * mvPosition;\n",THREE.ShaderChunk.map_pars_fragment="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvarying vec2 vUv;\n\n#endif\n\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif";THREE.ShaderChunk.skinnormal_vertex="#ifdef USE_SKINNING\n\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\n\t#ifdef USE_MORPHNORMALS\n\n\tvec4 skinnedNormal = skinMatrix * vec4( morphedNormal, 0.0 );\n\n\t#else\n\n\tvec4 skinnedNormal = skinMatrix * vec4( normal, 0.0 );\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.logdepthbuf_pars_vertex="#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n\tuniform float logDepthBufFC;\n\n#endif",THREE.ShaderChunk.lightmap_pars_vertex="#ifdef USE_LIGHTMAP\n\n\tvarying vec2 vUv2;\n\n#endif",THREE.ShaderChunk.lights_phong_fragment="#ifndef FLAT_SHADED\n\n\tvec3 normal = normalize( vNormal );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\n\t#endif\n\n#else\n\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n\n#endif\n\nvec3 viewPosition = normalize( vViewPosition );\n\n#ifdef USE_NORMALMAP\n\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\n#elif defined( USE_BUMPMAP )\n\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n\n#endif\n\nvec3 totalDiffuseLight = vec3( 0.0 );\nvec3 totalSpecularLight = vec3( 0.0 );\n\n#if MAX_POINT_LIGHTS > 0\n\n\tfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n\t\tfloat attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n\t\tlVector = normalize( lVector );\n\n\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, lVector );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tfloat pointDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\tfloat pointDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\tvec3 pointDiffuseWeight = mix( vec3( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\n\n\t\t#else\n\n\t\t\tfloat pointDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t#endif\n\n\t\ttotalDiffuseLight += pointLightColor[ i ] * pointDiffuseWeight * attenuation;\n\n\t\t\t\t// specular\n\n\t\tvec3 pointHalfVector = normalize( lVector + viewPosition );\n\t\tfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\n\t\tfloat pointSpecularWeight = specularStrength * max( pow( pointDotNormalHalf, shininess ), 0.0 );\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, pointHalfVector ), 0.0 ), 5.0 );\n\t\ttotalSpecularLight += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * attenuation * specularNormalization;\n\n\t}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tfor ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n\t\tfloat attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n\t\tlVector = normalize( lVector );\n\n\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\n\n\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\n\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n\t\t\t// diffuse\n\n\t\t\tfloat dotProduct = dot( normal, lVector );\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tfloat spotDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\t\tfloat spotDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\t\tvec3 spotDiffuseWeight = mix( vec3( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\n\n\t\t\t#else\n\n\t\t\t\tfloat spotDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t\t#endif\n\n\t\t\ttotalDiffuseLight += spotLightColor[ i ] * spotDiffuseWeight * attenuation * spotEffect;\n\n\t\t\t// specular\n\n\t\t\tvec3 spotHalfVector = normalize( lVector + viewPosition );\n\t\t\tfloat spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\n\t\t\tfloat spotSpecularWeight = specularStrength * max( pow( spotDotNormalHalf, shininess ), 0.0 );\n\n\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, spotHalfVector ), 0.0 ), 5.0 );\n\t\t\ttotalSpecularLight += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * attenuation * specularNormalization * spotEffect;\n\n\t\t}\n\n\t}\n\n#endif\n\n#if MAX_DIR_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n\t\tvec3 dirVector = transformDirection( directionalLightDirection[ i ], viewMatrix );\n\n\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, dirVector );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tfloat dirDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\tfloat dirDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\tvec3 dirDiffuseWeight = mix( vec3( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), wrapRGB );\n\n\t\t#else\n\n\t\t\tfloat dirDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t#endif\n\n\t\ttotalDiffuseLight += directionalLightColor[ i ] * dirDiffuseWeight;\n\n\t\t// specular\n\n\t\tvec3 dirHalfVector = normalize( dirVector + viewPosition );\n\t\tfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\n\t\tfloat dirSpecularWeight = specularStrength * max( pow( dirDotNormalHalf, shininess ), 0.0 );\n\n\t\t/*\n\t\t// fresnel term from skin shader\n\t\tconst float F0 = 0.128;\n\n\t\tfloat base = 1.0 - dot( viewPosition, dirHalfVector );\n\t\tfloat exponential = pow( base, 5.0 );\n\n\t\tfloat fresnel = exponential + F0 * ( 1.0 - exponential );\n\t\t*/\n\n\t\t/*\n\t\t// fresnel term from fresnel shader\n\t\tconst float mFresnelBias = 0.08;\n\t\tconst float mFresnelScale = 0.3;\n\t\tconst float mFresnelPower = 5.0;\n\n\t\tfloat fresnel = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( -viewPosition ), normal ), mFresnelPower );\n\t\t*/\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\t// \t\tdirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization * fresnel;\n\n\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( dirVector, dirHalfVector ), 0.0 ), 5.0 );\n\t\ttotalSpecularLight += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\n\n\n\t}\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n\t\tvec3 lVector = transformDirection( hemisphereLightDirection[ i ], viewMatrix );\n\n\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, lVector );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\n\t\tvec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n\t\ttotalDiffuseLight += hemiColor;\n\n\t\t// specular (sky light)\n\n\t\tvec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\n\t\tfloat hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\n\t\tfloat hemiSpecularWeightSky = specularStrength * max( pow( max( hemiDotNormalHalfSky, 0.0 ), shininess ), 0.0 );\n\n\t\t// specular (ground light)\n\n\t\tvec3 lVectorGround = -lVector;\n\n\t\tvec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\n\t\tfloat hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\n\t\tfloat hemiSpecularWeightGround = specularStrength * max( pow( max( hemiDotNormalHalfGround, 0.0 ), shininess ), 0.0 );\n\n\t\tfloat dotProductGround = dot( normal, lVectorGround );\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\tvec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, hemiHalfVectorSky ), 0.0 ), 5.0 );\n\t\tvec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 0.0 ), 5.0 );\n\t\ttotalSpecularLight += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\n\n\t}\n\n#endif\n\n#ifdef METAL\n\n\toutgoingLight += diffuseColor.rgb * ( totalDiffuseLight + ambientLightColor ) * specular + totalSpecularLight + emissive;\n\n#else\n\n\toutgoingLight += diffuseColor.rgb * ( totalDiffuseLight + ambientLightColor ) + totalSpecularLight + emissive;\n\n#endif\n",THREE.ShaderChunk.fog_pars_fragment="#ifdef USE_FOG\n\n\tuniform vec3 fogColor;\n\n\t#ifdef FOG_EXP2\n\n\t\tuniform float fogDensity;\n\n\t#else\n\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n\n#endif",THREE.ShaderChunk.morphnormal_vertex="#ifdef USE_MORPHNORMALS\n\n\tvec3 morphedNormal = vec3( 0.0 );\n\n\tmorphedNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tmorphedNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tmorphedNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tmorphedNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n\n\tmorphedNormal += normal;\n\n#endif",THREE.ShaderChunk.envmap_pars_fragment="#ifdef USE_ENVMAP\n\n\tuniform float reflectivity;\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\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n\t\tuniform float refractionRatio;\n\n\t#else\n\n\t\tvarying vec3 vReflect;\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.logdepthbuf_fragment="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n\n#endif",THREE.ShaderChunk.normalmap_pars_fragment="#ifdef USE_NORMALMAP\n\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\n\t// Per-Pixel Tangent Space Normal Mapping\n\t// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\n\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\n\t}\n\n#endif\n",THREE.ShaderChunk.lights_phong_pars_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n",THREE.ShaderChunk.lightmap_pars_fragment="#ifdef USE_LIGHTMAP\n\n\tvarying vec2 vUv2;\n\tuniform sampler2D lightMap;\n\n#endif",THREE.ShaderChunk.shadowmap_vertex="#ifdef USE_SHADOWMAP\n\n\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n\t\tvShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\n\n\t}\n\n#endif",THREE.ShaderChunk.lights_phong_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvWorldPosition = worldPosition.xyz;\n\n#endif",THREE.ShaderChunk.map_fragment="#ifdef USE_MAP\n\n\tvec4 texelColor = texture2D( map, vUv );\n\n\ttexelColor.xyz = inputToLinear( texelColor.xyz );\n\n\tdiffuseColor *= texelColor;\n\n#endif",THREE.ShaderChunk.lightmap_vertex="#ifdef USE_LIGHTMAP\n\n\tvUv2 = uv2;\n\n#endif",THREE.ShaderChunk.map_particle_fragment="#ifdef USE_MAP\n\n\tdiffuseColor *= texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\n#endif\n",THREE.ShaderChunk.color_pars_fragment="#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif\n",THREE.ShaderChunk.color_vertex="#ifdef USE_COLOR\n\n\tvColor.xyz = inputToLinear( color.xyz );\n\n#endif",THREE.ShaderChunk.skinning_vertex="#ifdef USE_SKINNING\n\n\t#ifdef USE_MORPHTARGETS\n\n\tvec4 skinVertex = bindMatrix * vec4( morphed, 1.0 );\n\n\t#else\n\n\tvec4 skinVertex = bindMatrix * vec4( position, 1.0 );\n\n\t#endif\n\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned  = bindMatrixInverse * skinned;\n\n#endif\n",THREE.ShaderChunk.envmap_pars_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n\tvarying vec3 vReflect;\n\n\tuniform float refractionRatio;\n\n#endif\n",THREE.ShaderChunk.linear_to_gamma_fragment="\n\toutgoingLight = linearToOutput( outgoingLight );\n",THREE.ShaderChunk.color_pars_vertex="#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif",THREE.ShaderChunk.lights_lambert_pars_vertex="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#ifdef WRAP_AROUND\n\n\tuniform vec3 wrapRGB;\n\n#endif\n",THREE.ShaderChunk.map_pars_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n\n#endif\n",THREE.ShaderChunk.envmap_fragment="#ifdef USE_ENVMAP\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\n\t\t// Transforming Normal Vectors with the Inverse Transformation\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\n\t\t#else\n\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#else\n\n\t\tvec3 reflectVec = vReflect;\n\n\t#endif\n\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\n\tenvColor.xyz = inputToLinear( envColor.xyz );\n\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.specularmap_pars_fragment="#ifdef USE_SPECULARMAP\n\n\tuniform sampler2D specularMap;\n\n#endif",THREE.ShaderChunk.logdepthbuf_vertex="#ifdef USE_LOGDEPTHBUF\n\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\n#else\n\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\n\t#endif\n\n#endif",THREE.ShaderChunk.morphtarget_pars_vertex="#ifdef USE_MORPHTARGETS\n\n\t#ifndef USE_MORPHNORMALS\n\n\tuniform float morphTargetInfluences[ 8 ];\n\n\t#else\n\n\tuniform float morphTargetInfluences[ 4 ];\n\n\t#endif\n\n#endif",THREE.ShaderChunk.specularmap_fragment="float specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n\n#else\n\n\tspecularStrength = 1.0;\n\n#endif",THREE.ShaderChunk.fog_fragment="#ifdef USE_FOG\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\n\t#else\n\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\n\t#endif\n\n\t#ifdef FOG_EXP2\n\n\t\tfloat fogFactor = exp2( - square( fogDensity ) * square( depth ) * LOG2 );\n\t\tfogFactor = whiteCompliment( fogFactor );\n\n\t#else\n\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\n\t#endif\n\t\n\toutgoingLight = mix( outgoingLight, fogColor, fogFactor );\n\n#endif",
  THREE.ShaderChunk.bumpmap_pars_fragment="#ifdef USE_BUMPMAP\n\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\n\t// Derivative maps - bump mapping unparametrized surfaces by Morten Mikkelsen\n\t// http://mmikkelsen3d.blogspot.sk/2011/07/derivative-maps.html\n\n\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n\tvec2 dHdxy_fwd() {\n\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\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\n\t\treturn vec2( dBx, dBy );\n\n\t}\n\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\t\t// normalized\n\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\n\t}\n\n#endif\n",THREE.ShaderChunk.defaultnormal_vertex="#ifdef USE_SKINNING\n\n\tvec3 objectNormal = skinnedNormal.xyz;\n\n#elif defined( USE_MORPHNORMALS )\n\n\tvec3 objectNormal = morphedNormal;\n\n#else\n\n\tvec3 objectNormal = normal;\n\n#endif\n\n#ifdef FLIP_SIDED\n\n\tobjectNormal = -objectNormal;\n\n#endif\n\nvec3 transformedNormal = normalMatrix * objectNormal;\n",THREE.ShaderChunk.lights_phong_pars_fragment="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n\n#ifdef WRAP_AROUND\n\n\tuniform vec3 wrapRGB;\n\n#endif\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n",THREE.ShaderChunk.skinbase_vertex="#ifdef USE_SKINNING\n\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\n#endif",THREE.ShaderChunk.map_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n\n#endif",THREE.ShaderChunk.lightmap_fragment="#ifdef USE_LIGHTMAP\n\n\toutgoingLight *= diffuseColor.xyz * texture2D( lightMap, vUv2 ).xyz;\n\n#endif",THREE.ShaderChunk.shadowmap_pars_vertex="#ifdef USE_SHADOWMAP\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\tuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n\n#endif",THREE.ShaderChunk.color_fragment="#ifdef USE_COLOR\n\n\tdiffuseColor.rgb *= vColor;\n\n#endif",THREE.ShaderChunk.morphtarget_vertex="#ifdef USE_MORPHTARGETS\n\n\tvec3 morphed = vec3( 0.0 );\n\tmorphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\tmorphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\tmorphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\tmorphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\n\t#ifndef USE_MORPHNORMALS\n\n\tmorphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\tmorphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\tmorphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\tmorphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\n\t#endif\n\n\tmorphed += position;\n\n#endif",THREE.ShaderChunk.envmap_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n\tvec3 worldNormal = transformDirection( objectNormal, modelMatrix );\n\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\n\t#else\n\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.shadowmap_fragment="#ifdef USE_SHADOWMAP\n\n\t#ifdef SHADOWMAP_DEBUG\n\n\t\tvec3 frustumColors[3];\n\t\tfrustumColors[0] = vec3( 1.0, 0.5, 0.0 );\n\t\tfrustumColors[1] = vec3( 0.0, 1.0, 0.8 );\n\t\tfrustumColors[2] = vec3( 0.0, 0.5, 1.0 );\n\n\t#endif\n\n\t#ifdef SHADOWMAP_CASCADE\n\n\t\tint inFrustumCount = 0;\n\n\t#endif\n\n\tfloat fDepth;\n\tvec3 shadowColor = vec3( 1.0 );\n\n\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n\t\tvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\n\n\t\t\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\n\t\t\t\t// if ( all( something, something ) ) using this instead\n\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\n\t\t\t\t// don't shadow pixels outside of light frustum\n\t\t\t\t// use just first frustum (for cascades)\n\t\t\t\t// don't shadow pixels behind far plane of light frustum\n\n\t\t#ifdef SHADOWMAP_CASCADE\n\n\t\t\tinFrustumCount += int( inFrustum );\n\t\t\tbvec3 frustumTestVec = bvec3( inFrustum, inFrustumCount == 1, shadowCoord.z <= 1.0 );\n\n\t\t#else\n\n\t\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n\t\t#endif\n\n\t\tbool frustumTest = all( frustumTestVec );\n\n\t\tif ( frustumTest ) {\n\n\t\t\tshadowCoord.z += shadowBias[ i ];\n\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\n\t\t\t\t\t\t// Percentage-close filtering\n\t\t\t\t\t\t// (9 pixel kernel)\n\t\t\t\t\t\t// http://fabiensanglard.net/shadowmappingPCF/\n\n\t\t\t\tfloat shadow = 0.0;\n\n\t\t/*\n\t\t\t\t\t\t// nested loops breaks shader compiler / validator on some ATI cards when using OpenGL\n\t\t\t\t\t\t// must enroll loop manually\n\n\t\t\t\tfor ( float y = -1.25; y <= 1.25; y += 1.25 )\n\t\t\t\t\tfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\n\n\t\t\t\t\t\tvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\n\n\t\t\t\t\t\t\t\t// doesn't seem to produce any noticeable visual difference compared to simple texture2D lookup\n\t\t\t\t\t\t\t\t//vec4 rgbaDepth = texture2DProj( shadowMap[ i ], vec4( vShadowCoord[ i ].w * ( vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy ), 0.05, vShadowCoord[ i ].w ) );\n\n\t\t\t\t\t\tfloat fDepth = unpackDepth( rgbaDepth );\n\n\t\t\t\t\t\tif ( fDepth < shadowCoord.z )\n\t\t\t\t\t\t\tshadow += 1.0;\n\n\t\t\t\t}\n\n\t\t\t\tshadow /= 9.0;\n\n\t\t*/\n\n\t\t\t\tconst float shadowDelta = 1.0 / 9.0;\n\n\t\t\t\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n\t\t\t\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n\t\t\t\tfloat dx0 = -1.25 * xPixelOffset;\n\t\t\t\tfloat dy0 = -1.25 * yPixelOffset;\n\t\t\t\tfloat dx1 = 1.25 * xPixelOffset;\n\t\t\t\tfloat dy1 = 1.25 * yPixelOffset;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n\t\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\t\t\t\t\t\t// Percentage-close filtering\n\t\t\t\t\t\t// (9 pixel kernel)\n\t\t\t\t\t\t// http://fabiensanglard.net/shadowmappingPCF/\n\n\t\t\t\tfloat shadow = 0.0;\n\n\t\t\t\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n\t\t\t\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n\t\t\t\tfloat dx0 = -1.0 * xPixelOffset;\n\t\t\t\tfloat dy0 = -1.0 * yPixelOffset;\n\t\t\t\tfloat dx1 = 1.0 * xPixelOffset;\n\t\t\t\tfloat dy1 = 1.0 * yPixelOffset;\n\n\t\t\t\tmat3 shadowKernel;\n\t\t\t\tmat3 depthKernel;\n\n\t\t\t\tdepthKernel[0][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n\t\t\t\tdepthKernel[0][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n\t\t\t\tdepthKernel[0][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n\t\t\t\tdepthKernel[1][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n\t\t\t\tdepthKernel[1][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n\t\t\t\tdepthKernel[1][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n\t\t\t\tdepthKernel[2][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n\t\t\t\tdepthKernel[2][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n\t\t\t\tdepthKernel[2][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\n\t\t\t\tvec3 shadowZ = vec3( shadowCoord.z );\n\t\t\t\tshadowKernel[0] = vec3(lessThan(depthKernel[0], shadowZ ));\n\t\t\t\tshadowKernel[0] *= vec3(0.25);\n\n\t\t\t\tshadowKernel[1] = vec3(lessThan(depthKernel[1], shadowZ ));\n\t\t\t\tshadowKernel[1] *= vec3(0.25);\n\n\t\t\t\tshadowKernel[2] = vec3(lessThan(depthKernel[2], shadowZ ));\n\t\t\t\tshadowKernel[2] *= vec3(0.25);\n\n\t\t\t\tvec2 fractionalCoord = 1.0 - fract( shadowCoord.xy * shadowMapSize[i].xy );\n\n\t\t\t\tshadowKernel[0] = mix( shadowKernel[1], shadowKernel[0], fractionalCoord.x );\n\t\t\t\tshadowKernel[1] = mix( shadowKernel[2], shadowKernel[1], fractionalCoord.x );\n\n\t\t\t\tvec4 shadowValues;\n\t\t\t\tshadowValues.x = mix( shadowKernel[0][1], shadowKernel[0][0], fractionalCoord.y );\n\t\t\t\tshadowValues.y = mix( shadowKernel[0][2], shadowKernel[0][1], fractionalCoord.y );\n\t\t\t\tshadowValues.z = mix( shadowKernel[1][1], shadowKernel[1][0], fractionalCoord.y );\n\t\t\t\tshadowValues.w = mix( shadowKernel[1][2], shadowKernel[1][1], fractionalCoord.y );\n\n\t\t\t\tshadow = dot( shadowValues, vec4( 1.0 ) );\n\n\t\t\t\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n\t\t\t#else\n\n\t\t\t\tvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\n\t\t\t\tfloat fDepth = unpackDepth( rgbaDepth );\n\n\t\t\t\tif ( fDepth < shadowCoord.z )\n\n\t\t// spot with multiple shadows is darker\n\n\t\t\t\t\tshadowColor = shadowColor * vec3( 1.0 - shadowDarkness[ i ] );\n\n\t\t// spot with multiple shadows has the same color as single shadow spot\n\n\t\t// \t\t\t\t\tshadowColor = min( shadowColor, vec3( shadowDarkness[ i ] ) );\n\n\t\t\t#endif\n\n\t\t}\n\n\n\t\t#ifdef SHADOWMAP_DEBUG\n\n\t\t\t#ifdef SHADOWMAP_CASCADE\n\n\t\t\t\tif ( inFrustum && inFrustumCount == 1 ) outgoingLight *= frustumColors[ i ];\n\n\t\t\t#else\n\n\t\t\t\tif ( inFrustum ) outgoingLight *= frustumColors[ i ];\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t}\n\n\t// NOTE: I am unsure if this is correct in linear space.  -bhouston, Dec 29, 2014\n\tshadowColor = inputToLinear( shadowColor );\n\n\toutgoingLight = outgoingLight * shadowColor;\n\n#endif\n",THREE.ShaderChunk.worldpos_vertex="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\n\t#ifdef USE_SKINNING\n\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\n\t#elif defined( USE_MORPHTARGETS )\n\n\t\tvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n\n\t#else\n\n\t\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n\n\tuniform sampler2D shadowMap[ MAX_SHADOWS ];\n\tuniform vec2 shadowMapSize[ MAX_SHADOWS ];\n\n\tuniform float shadowDarkness[ MAX_SHADOWS ];\n\tuniform float shadowBias[ MAX_SHADOWS ];\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\tfloat depth = dot( rgba_depth, bit_shift );\n\t\treturn depth;\n\n\t}\n\n#endif",THREE.ShaderChunk.skinning_pars_vertex="#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\t#ifdef BONE_TEXTURE\n\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\n\t\t\ty = dy * ( y + 0.5 );\n\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\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\t\treturn bone;\n\n\t\t}\n\n\t#else\n\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\n\t\t}\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.logdepthbuf_pars_fragment="#ifdef USE_LOGDEPTHBUF\n\n\tuniform float logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\t#extension GL_EXT_frag_depth : enable\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n#endif",THREE.ShaderChunk.alphamap_fragment="#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n",THREE.ShaderChunk.alphamap_pars_fragment="#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",THREE.UniformsUtils={merge:function(a){for(var b={},c=0;c<a.length;c++){var d=this.clone(a[c]);for(var e in d)b[e]=d[e]}return b},clone:function(a){var b={};for(var c in a){b[c]={};for(var d in a[c]){var e=a[c][d];e instanceof THREE.Color||e instanceof THREE.Vector2||e instanceof THREE.Vector3||e instanceof THREE.Vector4||e instanceof THREE.Matrix4||e instanceof THREE.Texture?b[c][d]=e.clone():e instanceof Array?b[c][d]=e.slice():b[c][d]=e}}return b}},THREE.UniformsLib={common:{diffuse:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},lightMap:{type:"t",value:null},specularMap:{type:"t",value:null},alphaMap:{type:"t",value:null},envMap:{type:"t",value:null},flipEnvMap:{type:"f",value:-1},reflectivity:{type:"f",value:1},refractionRatio:{type:"f",value:.98},morphTargetInfluences:{type:"f",value:0}},bump:{bumpMap:{type:"t",value:null},bumpScale:{type:"f",value:1}},normalmap:{normalMap:{type:"t",value:null},normalScale:{type:"v2",value:new THREE.Vector2(1,1)}},fog:{fogDensity:{type:"f",value:25e-5},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},fogColor:{type:"c",value:new THREE.Color(16777215)}},lights:{ambientLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]},directionalLightColor:{type:"fv",value:[]},hemisphereLightDirection:{type:"fv",value:[]},hemisphereLightSkyColor:{type:"fv",value:[]},hemisphereLightGroundColor:{type:"fv",value:[]},pointLightColor:{type:"fv",value:[]},pointLightPosition:{type:"fv",value:[]},pointLightDistance:{type:"fv1",value:[]},pointLightDecay:{type:"fv1",value:[]},spotLightColor:{type:"fv",value:[]},spotLightPosition:{type:"fv",value:[]},spotLightDirection:{type:"fv",value:[]},spotLightDistance:{type:"fv1",value:[]},spotLightAngleCos:{type:"fv1",value:[]},spotLightExponent:{type:"fv1",value:[]},spotLightDecay:{type:"fv1",value:[]}},particle:{psColor:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},size:{type:"f",value:1},scale:{type:"f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},fogDensity:{type:"f",value:25e-5},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},fogColor:{type:"c",value:new THREE.Color(16777215)}},shadowmap:{shadowMap:{type:"tv",value:[]},shadowMapSize:{type:"v2v",value:[]},shadowBias:{type:"fv1",value:[]},shadowDarkness:{type:"fv1",value:[]},shadowMatrix:{type:"m4v",value:[]}}},THREE.ShaderLib={basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,THREE.UniformsLib.shadowmap]),vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.skinbase_vertex,"\t#ifdef USE_ENVMAP",THREE.ShaderChunk.morphnormal_vertex,THREE.ShaderChunk.skinnormal_vertex,THREE.ShaderChunk.defaultnormal_vertex,"\t#endif",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,THREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;","uniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.alphamap_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.specularmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {","\tvec3 outgoingLight = vec3( 0.0 );","\tvec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.alphamap_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.specularmap_fragment,"\toutgoingLight = diffuseColor.rgb;",THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );","}"].join("\n")},lambert:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,THREE.UniformsLib.lights,THREE.UniformsLib.shadowmap,{emissive:{type:"c",value:new THREE.Color(0)},wrapRGB:{type:"v3",value:new THREE.Vector3(1,1,1)}}]),vertexShader:["#define LAMBERT","varying vec3 vLightFront;","#ifdef DOUBLE_SIDED","\tvarying vec3 vLightBack;","#endif",THREE.ShaderChunk.common,THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_lambert_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.morphnormal_vertex,THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.skinnormal_vertex,THREE.ShaderChunk.defaultnormal_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,THREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.lights_lambert_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;","uniform vec3 emissive;","uniform float opacity;","varying vec3 vLightFront;","#ifdef DOUBLE_SIDED","\tvarying vec3 vLightBack;","#endif",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.alphamap_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.specularmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {","\tvec3 outgoingLight = vec3( 0.0 );","\tvec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.alphamap_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.specularmap_fragment,"\t#ifdef DOUBLE_SIDED","\t\tif ( gl_FrontFacing )","\t\t\toutgoingLight += diffuseColor.rgb * vLightFront + emissive;","\t\telse","\t\t\toutgoingLight += diffuseColor.rgb * vLightBack + emissive;","\t#else","\t\toutgoingLight += diffuseColor.rgb * vLightFront + emissive;","\t#endif",THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );","}"].join("\n")},phong:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.bump,THREE.UniformsLib.normalmap,THREE.UniformsLib.fog,THREE.UniformsLib.lights,THREE.UniformsLib.shadowmap,{emissive:{type:"c",value:new THREE.Color(0)},specular:{type:"c",value:new THREE.Color(1118481)},shininess:{type:"f",value:30},wrapRGB:{type:"v3",value:new THREE.Vector3(1,1,1)}}]),vertexShader:["#define PHONG","varying vec3 vViewPosition;","#ifndef FLAT_SHADED","\tvarying vec3 vNormal;","#endif",THREE.ShaderChunk.common,THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_phong_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.morphnormal_vertex,THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.skinnormal_vertex,THREE.ShaderChunk.defaultnormal_vertex,"#ifndef FLAT_SHADED","\tvNormal = normalize( transformedNormal );","#endif",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"\tvViewPosition = -mvPosition.xyz;",THREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.lights_phong_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["#define PHONG","uniform vec3 diffuse;","uniform vec3 emissive;","uniform vec3 specular;","uniform float shininess;","uniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.alphamap_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.lights_phong_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.bumpmap_pars_fragment,THREE.ShaderChunk.normalmap_pars_fragment,THREE.ShaderChunk.specularmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {","\tvec3 outgoingLight = vec3( 0.0 );","\tvec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.alphamap_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.specularmap_fragment,THREE.ShaderChunk.lights_phong_fragment,THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );","}"].join("\n")},particle_basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.particle,THREE.UniformsLib.shadowmap]),vertexShader:["uniform float size;","uniform float scale;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","\t#ifdef USE_SIZEATTENUATION","\t\tgl_PointSize = size * ( scale / length( mvPosition.xyz ) );","\t#else","\t\tgl_PointSize = size;","\t#endif","\tgl_Position = projectionMatrix * mvPosition;",THREE.ShaderChunk.logdepthbuf_vertex,THREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 psColor;","uniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {","\tvec3 outgoingLight = vec3( 0.0 );","\tvec4 diffuseColor = vec4( psColor, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.alphatest_fragment,"\toutgoingLight = diffuseColor.rgb;",THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );","}"].join("\n")},dashed:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,{scale:{type:"f",value:1},dashSize:{type:"f",value:1},totalSize:{type:"f",value:2}}]),vertexShader:["uniform float scale;","attribute float lineDistance;","varying float vLineDistance;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"\tvLineDistance = scale * lineDistance;","\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * mvPosition;",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;","uniform float opacity;","uniform float dashSize;","uniform float totalSize;","varying float vLineDistance;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {","\tif ( mod( vLineDistance, totalSize ) > dashSize ) {","\t\tdiscard;","\t}","\tvec3 outgoingLight = vec3( 0.0 );","\tvec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.color_fragment,"\toutgoingLight = diffuseColor.rgb;",THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );","}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2e3},opacity:{type:"f",value:1}},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float mNear;","uniform float mFar;","uniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT","\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;","\t#else","\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;","\t#endif","\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );","\tgl_FragColor = vec4( vec3( color ), opacity );","}"].join("\n")},normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {","\tvNormal = normalize( normalMatrix * normal );",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;","varying vec3 vNormal;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {","\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {","\tvWorldPosition = transformDirection( position, modelMatrix );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;","uniform float tFlip;","varying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {","\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},equirect:{uniforms:{tEquirect:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {","\tvWorldPosition = transformDirection( position, modelMatrix );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","uniform float tFlip;","varying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {","vec3 direction = normalize( vWorldPosition );","vec2 sampleUV;","sampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );","sampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;","gl_FragColor = texture2D( tEquirect, sampleUV );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},
  vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {","\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );","\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );","\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );","\tres -= res.xxyz * bit_mask;","\treturn res;","}","void main() {",THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT","\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );","\t#else","\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );","\t#endif","}"].join("\n")}},THREE.WebGLRenderer=function(a){function b(a){a.__webglVertexBuffer=Ea.createBuffer(),a.__webglColorBuffer=Ea.createBuffer(),Fa.info.memory.geometries++}function c(a){a.__webglVertexBuffer=Ea.createBuffer(),a.__webglColorBuffer=Ea.createBuffer(),a.__webglLineDistanceBuffer=Ea.createBuffer(),Fa.info.memory.geometries++}function d(a){a.__webglVertexBuffer=Ea.createBuffer(),a.__webglNormalBuffer=Ea.createBuffer(),a.__webglTangentBuffer=Ea.createBuffer(),a.__webglColorBuffer=Ea.createBuffer(),a.__webglUVBuffer=Ea.createBuffer(),a.__webglUV2Buffer=Ea.createBuffer(),a.__webglSkinIndicesBuffer=Ea.createBuffer(),a.__webglSkinWeightsBuffer=Ea.createBuffer(),a.__webglFaceBuffer=Ea.createBuffer(),a.__webglLineBuffer=Ea.createBuffer();var b=a.numMorphTargets;if(b){a.__webglMorphTargetsBuffers=[];for(var c=0,d=b;c<d;c++)a.__webglMorphTargetsBuffers.push(Ea.createBuffer())}var e=a.numMorphNormals;if(e){a.__webglMorphNormalsBuffers=[];for(var c=0,d=e;c<d;c++)a.__webglMorphNormalsBuffers.push(Ea.createBuffer())}Fa.info.memory.geometries++}function e(a){var b=a.geometry,c=a.material,d=b.vertices.length;if(c.attributes){void 0===b.__webglCustomAttributesList&&(b.__webglCustomAttributesList=[]);for(var e in c.attributes){var f=c.attributes[e];if(!f.__webglInitialized||f.createUniqueBuffers){f.__webglInitialized=!0;var g=1;"v2"===f.type?g=2:"v3"===f.type?g=3:"v4"===f.type?g=4:"c"===f.type&&(g=3),f.size=g,f.array=new Float32Array(d*g),f.buffer=Ea.createBuffer(),f.buffer.belongsToAttribute=e,f.needsUpdate=!0}b.__webglCustomAttributesList.push(f)}}}function f(a,b){var c=a.vertices.length;a.__vertexArray=new Float32Array(3*c),a.__colorArray=new Float32Array(3*c),a.__webglParticleCount=c,e(b)}function g(a,b){var c=a.vertices.length;a.__vertexArray=new Float32Array(3*c),a.__colorArray=new Float32Array(3*c),a.__lineDistanceArray=new Float32Array(1*c),a.__webglLineCount=c,e(b)}function h(a,b){var c=b.geometry,d=a.faces3,e=3*d.length,f=1*d.length,g=3*d.length,h=i(b,a);a.__vertexArray=new Float32Array(3*e),a.__normalArray=new Float32Array(3*e),a.__colorArray=new Float32Array(3*e),a.__uvArray=new Float32Array(2*e),c.faceVertexUvs.length>1&&(a.__uv2Array=new Float32Array(2*e)),c.hasTangents&&(a.__tangentArray=new Float32Array(4*e)),b.geometry.skinWeights.length&&b.geometry.skinIndices.length&&(a.__skinIndexArray=new Float32Array(4*e),a.__skinWeightArray=new Float32Array(4*e));var j=null!==_a.get("OES_element_index_uint")&&f>21845?Uint32Array:Uint16Array;a.__typeArray=j,a.__faceArray=new j(3*f),a.__lineArray=new j(2*g);var k=a.numMorphTargets;if(k){a.__morphTargetsArrays=[];for(var l=0,m=k;l<m;l++)a.__morphTargetsArrays.push(new Float32Array(3*e))}var n=a.numMorphNormals;if(n){a.__morphNormalsArrays=[];for(var l=0,m=n;l<m;l++)a.__morphNormalsArrays.push(new Float32Array(3*e))}if(a.__webglFaceCount=3*f,a.__webglLineCount=2*g,h.attributes){void 0===a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var o in h.attributes){var p=h.attributes[o],q={};for(var r in p)q[r]=p[r];if(!q.__webglInitialized||q.createUniqueBuffers){q.__webglInitialized=!0;var s=1;"v2"===q.type?s=2:"v3"===q.type?s=3:"v4"===q.type?s=4:"c"===q.type&&(s=3),q.size=s,q.array=new Float32Array(e*s),q.buffer=Ea.createBuffer(),q.buffer.belongsToAttribute=o,p.needsUpdate=!0,q.__original=p}a.__webglCustomAttributesList.push(q)}}a.__inittedArrays=!0}function i(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function j(a){return a instanceof THREE.MeshPhongMaterial==!1&&a.shading===THREE.FlatShading}function k(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o=a.vertices,p=o.length,q=a.colors,r=q.length,s=a.__vertexArray,t=a.__colorArray,u=a.verticesNeedUpdate,v=a.colorsNeedUpdate,w=a.__webglCustomAttributesList;if(u){for(d=0;d<p;d++)f=o[d],g=3*d,s[g]=f.x,s[g+1]=f.y,s[g+2]=f.z;Ea.bindBuffer(Ea.ARRAY_BUFFER,a.__webglVertexBuffer),Ea.bufferData(Ea.ARRAY_BUFFER,s,b)}if(v){for(e=0;e<r;e++)h=q[e],g=3*e,t[g]=h.r,t[g+1]=h.g,t[g+2]=h.b;Ea.bindBuffer(Ea.ARRAY_BUFFER,a.__webglColorBuffer),Ea.bufferData(Ea.ARRAY_BUFFER,t,b)}if(w)for(i=0,j=w.length;i<j;i++){if(n=w[i],n.needsUpdate&&(void 0===n.boundTo||"vertices"===n.boundTo))if(l=n.value.length,g=0,1===n.size)for(k=0;k<l;k++)n.array[k]=n.value[k];else if(2===n.size)for(k=0;k<l;k++)m=n.value[k],n.array[g]=m.x,n.array[g+1]=m.y,g+=2;else if(3===n.size)if("c"===n.type)for(k=0;k<l;k++)m=n.value[k],n.array[g]=m.r,n.array[g+1]=m.g,n.array[g+2]=m.b,g+=3;else for(k=0;k<l;k++)m=n.value[k],n.array[g]=m.x,n.array[g+1]=m.y,n.array[g+2]=m.z,g+=3;else if(4===n.size)for(k=0;k<l;k++)m=n.value[k],n.array[g]=m.x,n.array[g+1]=m.y,n.array[g+2]=m.z,n.array[g+3]=m.w,g+=4;Ea.bindBuffer(Ea.ARRAY_BUFFER,n.buffer),Ea.bufferData(Ea.ARRAY_BUFFER,n.array,b),n.needsUpdate=!1}}function l(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=a.vertices,p=a.colors,q=a.lineDistances,r=o.length,s=p.length,t=q.length,u=a.__vertexArray,v=a.__colorArray,w=a.__lineDistanceArray,x=a.verticesNeedUpdate,y=a.colorsNeedUpdate,z=a.lineDistancesNeedUpdate,A=a.__webglCustomAttributesList;if(x){for(c=0;c<r;c++)f=o[c],g=3*c,u[g]=f.x,u[g+1]=f.y,u[g+2]=f.z;Ea.bindBuffer(Ea.ARRAY_BUFFER,a.__webglVertexBuffer),Ea.bufferData(Ea.ARRAY_BUFFER,u,b)}if(y){for(d=0;d<s;d++)h=p[d],g=3*d,v[g]=h.r,v[g+1]=h.g,v[g+2]=h.b;Ea.bindBuffer(Ea.ARRAY_BUFFER,a.__webglColorBuffer),Ea.bufferData(Ea.ARRAY_BUFFER,v,b)}if(z){for(e=0;e<t;e++)w[e]=q[e];Ea.bindBuffer(Ea.ARRAY_BUFFER,a.__webglLineDistanceBuffer),Ea.bufferData(Ea.ARRAY_BUFFER,w,b)}if(A)for(i=0,j=A.length;i<j;i++)if(n=A[i],n.needsUpdate&&(void 0===n.boundTo||"vertices"===n.boundTo)){if(g=0,l=n.value.length,1===n.size)for(k=0;k<l;k++)n.array[k]=n.value[k];else if(2===n.size)for(k=0;k<l;k++)m=n.value[k],n.array[g]=m.x,n.array[g+1]=m.y,g+=2;else if(3===n.size)if("c"===n.type)for(k=0;k<l;k++)m=n.value[k],n.array[g]=m.r,n.array[g+1]=m.g,n.array[g+2]=m.b,g+=3;else for(k=0;k<l;k++)m=n.value[k],n.array[g]=m.x,n.array[g+1]=m.y,n.array[g+2]=m.z,g+=3;else if(4===n.size)for(k=0;k<l;k++)m=n.value[k],n.array[g]=m.x,n.array[g+1]=m.y,n.array[g+2]=m.z,n.array[g+3]=m.w,g+=4;Ea.bindBuffer(Ea.ARRAY_BUFFER,n.buffer),Ea.bufferData(Ea.ARRAY_BUFFER,n.array,b),n.needsUpdate=!1}}function m(a,b,c,d,e){if(a.__inittedArrays){var f,g,h,i,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W=j(e),X=0,Y=0,Z=0,$=0,_=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=a.__vertexArray,ia=a.__uvArray,ja=a.__uv2Array,ka=a.__normalArray,la=a.__tangentArray,ma=a.__colorArray,na=a.__skinIndexArray,oa=a.__skinWeightArray,pa=a.__morphTargetsArrays,qa=a.__morphNormalsArrays,ra=a.__webglCustomAttributesList,sa=a.__faceArray,ta=a.__lineArray,ua=b.geometry,va=ua.verticesNeedUpdate,wa=ua.elementsNeedUpdate,xa=ua.uvsNeedUpdate,ya=ua.normalsNeedUpdate,za=ua.tangentsNeedUpdate,Aa=ua.colorsNeedUpdate,Ba=ua.morphTargetsNeedUpdate,Ca=ua.vertices,Da=a.faces3,Fa=ua.faces,Ga=ua.faceVertexUvs[0],Ha=ua.faceVertexUvs[1],Ia=ua.skinIndices,Ja=ua.skinWeights,Ka=ua.morphTargets,La=ua.morphNormals;if(va){for(f=0,g=Da.length;f<g;f++)i=Fa[Da[f]],r=Ca[i.a],s=Ca[i.b],t=Ca[i.c],ha[Y]=r.x,ha[Y+1]=r.y,ha[Y+2]=r.z,ha[Y+3]=s.x,ha[Y+4]=s.y,ha[Y+5]=s.z,ha[Y+6]=t.x,ha[Y+7]=t.y,ha[Y+8]=t.z,Y+=9;Ea.bindBuffer(Ea.ARRAY_BUFFER,a.__webglVertexBuffer),Ea.bufferData(Ea.ARRAY_BUFFER,ha,c)}if(Ba)for(O=0,P=Ka.length;O<P;O++){for(fa=0,f=0,g=Da.length;f<g;f++)S=Da[f],i=Fa[S],r=Ka[O].vertices[i.a],s=Ka[O].vertices[i.b],t=Ka[O].vertices[i.c],Q=pa[O],Q[fa]=r.x,Q[fa+1]=r.y,Q[fa+2]=r.z,Q[fa+3]=s.x,Q[fa+4]=s.y,Q[fa+5]=s.z,Q[fa+6]=t.x,Q[fa+7]=t.y,Q[fa+8]=t.z,e.morphNormals&&(W?(x=La[O].faceNormals[S],y=x,z=x):(T=La[O].vertexNormals[S],x=T.a,y=T.b,z=T.c),R=qa[O],R[fa]=x.x,R[fa+1]=x.y,R[fa+2]=x.z,R[fa+3]=y.x,R[fa+4]=y.y,R[fa+5]=y.z,R[fa+6]=z.x,R[fa+7]=z.y,R[fa+8]=z.z),fa+=9;Ea.bindBuffer(Ea.ARRAY_BUFFER,a.__webglMorphTargetsBuffers[O]),Ea.bufferData(Ea.ARRAY_BUFFER,pa[O],c),e.morphNormals&&(Ea.bindBuffer(Ea.ARRAY_BUFFER,a.__webglMorphNormalsBuffers[O]),Ea.bufferData(Ea.ARRAY_BUFFER,qa[O],c))}if(Ja.length){for(f=0,g=Da.length;f<g;f++)i=Fa[Da[f]],D=Ja[i.a],E=Ja[i.b],F=Ja[i.c],oa[ea]=D.x,oa[ea+1]=D.y,oa[ea+2]=D.z,oa[ea+3]=D.w,oa[ea+4]=E.x,oa[ea+5]=E.y,oa[ea+6]=E.z,oa[ea+7]=E.w,oa[ea+8]=F.x,oa[ea+9]=F.y,oa[ea+10]=F.z,oa[ea+11]=F.w,G=Ia[i.a],H=Ia[i.b],I=Ia[i.c],na[ea]=G.x,na[ea+1]=G.y,na[ea+2]=G.z,na[ea+3]=G.w,na[ea+4]=H.x,na[ea+5]=H.y,na[ea+6]=H.z,na[ea+7]=H.w,na[ea+8]=I.x,na[ea+9]=I.y,na[ea+10]=I.z,na[ea+11]=I.w,ea+=12;ea>0&&(Ea.bindBuffer(Ea.ARRAY_BUFFER,a.__webglSkinIndicesBuffer),Ea.bufferData(Ea.ARRAY_BUFFER,na,c),Ea.bindBuffer(Ea.ARRAY_BUFFER,a.__webglSkinWeightsBuffer),Ea.bufferData(Ea.ARRAY_BUFFER,oa,c))}if(Aa){for(f=0,g=Da.length;f<g;f++)i=Fa[Da[f]],m=i.vertexColors,n=i.color,3===m.length&&e.vertexColors===THREE.VertexColors?(A=m[0],B=m[1],C=m[2]):(A=n,B=n,C=n),ma[da]=A.r,ma[da+1]=A.g,ma[da+2]=A.b,ma[da+3]=B.r,ma[da+4]=B.g,ma[da+5]=B.b,ma[da+6]=C.r,ma[da+7]=C.g,ma[da+8]=C.b,da+=9;da>0&&(Ea.bindBuffer(Ea.ARRAY_BUFFER,a.__webglColorBuffer),Ea.bufferData(Ea.ARRAY_BUFFER,ma,c))}if(za&&ua.hasTangents){for(f=0,g=Da.length;f<g;f++)i=Fa[Da[f]],o=i.vertexTangents,u=o[0],v=o[1],w=o[2],la[ba]=u.x,la[ba+1]=u.y,la[ba+2]=u.z,la[ba+3]=u.w,la[ba+4]=v.x,la[ba+5]=v.y,la[ba+6]=v.z,la[ba+7]=v.w,la[ba+8]=w.x,la[ba+9]=w.y,la[ba+10]=w.z,la[ba+11]=w.w,ba+=12;Ea.bindBuffer(Ea.ARRAY_BUFFER,a.__webglTangentBuffer),Ea.bufferData(Ea.ARRAY_BUFFER,la,c)}if(ya){for(f=0,g=Da.length;f<g;f++)if(i=Fa[Da[f]],k=i.vertexNormals,l=i.normal,3===k.length&&!1===W)for(J=0;J<3;J++)L=k[J],ka[aa]=L.x,ka[aa+1]=L.y,ka[aa+2]=L.z,aa+=3;else for(J=0;J<3;J++)ka[aa]=l.x,ka[aa+1]=l.y,ka[aa+2]=l.z,aa+=3;Ea.bindBuffer(Ea.ARRAY_BUFFER,a.__webglNormalBuffer),Ea.bufferData(Ea.ARRAY_BUFFER,ka,c)}if(xa&&Ga){for(f=0,g=Da.length;f<g;f++)if(h=Da[f],void 0!==(p=Ga[h]))for(J=0;J<3;J++)M=p[J],ia[Z]=M.x,ia[Z+1]=M.y,Z+=2;Z>0&&(Ea.bindBuffer(Ea.ARRAY_BUFFER,a.__webglUVBuffer),Ea.bufferData(Ea.ARRAY_BUFFER,ia,c))}if(xa&&Ha){for(f=0,g=Da.length;f<g;f++)if(h=Da[f],void 0!==(q=Ha[h]))for(J=0;J<3;J++)N=q[J],ja[$]=N.x,ja[$+1]=N.y,$+=2;$>0&&(Ea.bindBuffer(Ea.ARRAY_BUFFER,a.__webglUV2Buffer),Ea.bufferData(Ea.ARRAY_BUFFER,ja,c))}if(wa){for(f=0,g=Da.length;f<g;f++)sa[_]=X,sa[_+1]=X+1,sa[_+2]=X+2,_+=3,ta[ca]=X,ta[ca+1]=X+1,ta[ca+2]=X,ta[ca+3]=X+2,ta[ca+4]=X+1,ta[ca+5]=X+2,ca+=6,X+=3;Ea.bindBuffer(Ea.ELEMENT_ARRAY_BUFFER,a.__webglFaceBuffer),Ea.bufferData(Ea.ELEMENT_ARRAY_BUFFER,sa,c),Ea.bindBuffer(Ea.ELEMENT_ARRAY_BUFFER,a.__webglLineBuffer),Ea.bufferData(Ea.ELEMENT_ARRAY_BUFFER,ta,c)}if(ra)for(J=0,K=ra.length;J<K;J++)if(V=ra[J],V.__original.needsUpdate){if(ga=0,1===V.size){if(void 0===V.boundTo||"vertices"===V.boundTo)for(f=0,g=Da.length;f<g;f++)i=Fa[Da[f]],V.array[ga]=V.value[i.a],V.array[ga+1]=V.value[i.b],V.array[ga+2]=V.value[i.c],ga+=3;else if("faces"===V.boundTo)for(f=0,g=Da.length;f<g;f++)U=V.value[Da[f]],V.array[ga]=U,V.array[ga+1]=U,V.array[ga+2]=U,ga+=3}else if(2===V.size){if(void 0===V.boundTo||"vertices"===V.boundTo)for(f=0,g=Da.length;f<g;f++)i=Fa[Da[f]],r=V.value[i.a],s=V.value[i.b],t=V.value[i.c],V.array[ga]=r.x,V.array[ga+1]=r.y,V.array[ga+2]=s.x,V.array[ga+3]=s.y,V.array[ga+4]=t.x,V.array[ga+5]=t.y,ga+=6;else if("faces"===V.boundTo)for(f=0,g=Da.length;f<g;f++)U=V.value[Da[f]],r=U,s=U,t=U,V.array[ga]=r.x,V.array[ga+1]=r.y,V.array[ga+2]=s.x,V.array[ga+3]=s.y,V.array[ga+4]=t.x,V.array[ga+5]=t.y,ga+=6}else if(3===V.size){var Ma;if(Ma="c"===V.type?["r","g","b"]:["x","y","z"],void 0===V.boundTo||"vertices"===V.boundTo)for(f=0,g=Da.length;f<g;f++)i=Fa[Da[f]],r=V.value[i.a],s=V.value[i.b],t=V.value[i.c],V.array[ga]=r[Ma[0]],V.array[ga+1]=r[Ma[1]],V.array[ga+2]=r[Ma[2]],V.array[ga+3]=s[Ma[0]],V.array[ga+4]=s[Ma[1]],V.array[ga+5]=s[Ma[2]],V.array[ga+6]=t[Ma[0]],V.array[ga+7]=t[Ma[1]],V.array[ga+8]=t[Ma[2]],ga+=9;else if("faces"===V.boundTo)for(f=0,g=Da.length;f<g;f++)U=V.value[Da[f]],r=U,s=U,t=U,V.array[ga]=r[Ma[0]],V.array[ga+1]=r[Ma[1]],V.array[ga+2]=r[Ma[2]],V.array[ga+3]=s[Ma[0]],V.array[ga+4]=s[Ma[1]],V.array[ga+5]=s[Ma[2]],V.array[ga+6]=t[Ma[0]],V.array[ga+7]=t[Ma[1]],V.array[ga+8]=t[Ma[2]],ga+=9;else if("faceVertices"===V.boundTo)for(f=0,g=Da.length;f<g;f++)U=V.value[Da[f]],r=U[0],s=U[1],t=U[2],V.array[ga]=r[Ma[0]],V.array[ga+1]=r[Ma[1]],V.array[ga+2]=r[Ma[2]],V.array[ga+3]=s[Ma[0]],V.array[ga+4]=s[Ma[1]],V.array[ga+5]=s[Ma[2]],V.array[ga+6]=t[Ma[0]],V.array[ga+7]=t[Ma[1]],V.array[ga+8]=t[Ma[2]],ga+=9}else if(4===V.size)if(void 0===V.boundTo||"vertices"===V.boundTo)for(f=0,g=Da.length;f<g;f++)i=Fa[Da[f]],r=V.value[i.a],s=V.value[i.b],t=V.value[i.c],V.array[ga]=r.x,V.array[ga+1]=r.y,V.array[ga+2]=r.z,V.array[ga+3]=r.w,V.array[ga+4]=s.x,V.array[ga+5]=s.y,V.array[ga+6]=s.z,V.array[ga+7]=s.w,V.array[ga+8]=t.x,V.array[ga+9]=t.y,V.array[ga+10]=t.z,V.array[ga+11]=t.w,ga+=12;else if("faces"===V.boundTo)for(f=0,g=Da.length;f<g;f++)U=V.value[Da[f]],r=U,s=U,t=U,V.array[ga]=r.x,V.array[ga+1]=r.y,V.array[ga+2]=r.z,V.array[ga+3]=r.w,V.array[ga+4]=s.x,V.array[ga+5]=s.y,V.array[ga+6]=s.z,V.array[ga+7]=s.w,V.array[ga+8]=t.x,V.array[ga+9]=t.y,V.array[ga+10]=t.z,V.array[ga+11]=t.w,ga+=12;else if("faceVertices"===V.boundTo)for(f=0,g=Da.length;f<g;f++)U=V.value[Da[f]],r=U[0],s=U[1],t=U[2],V.array[ga]=r.x,V.array[ga+1]=r.y,V.array[ga+2]=r.z,V.array[ga+3]=r.w,V.array[ga+4]=s.x,V.array[ga+5]=s.y,V.array[ga+6]=s.z,V.array[ga+7]=s.w,V.array[ga+8]=t.x,V.array[ga+9]=t.y,V.array[ga+10]=t.z,V.array[ga+11]=t.w,ga+=12;Ea.bindBuffer(Ea.ARRAY_BUFFER,V.buffer),Ea.bufferData(Ea.ARRAY_BUFFER,V.array,c)}d&&(delete a.__inittedArrays,delete a.__colorArray,delete a.__normalArray,delete a.__tangentArray,delete a.__uvArray,delete a.__uv2Array,delete a.__faceArray,delete a.__vertexArray,delete a.__lineArray,delete a.__skinIndexArray,delete a.__skinWeightArray)}}function n(a,b,c,d){for(var e=c.attributes,f=b.attributes,g=b.attributesKeys,h=0,i=g.length;h<i;h++){var j=g[h],k=f[j];if(k>=0){var l=e[j];if(void 0!==l){var m=l.itemSize;Ea.bindBuffer(Ea.ARRAY_BUFFER,l.buffer),$a.enableAttribute(k),Ea.vertexAttribPointer(k,m,Ea.FLOAT,!1,0,d*m*4)}else void 0!==a.defaultAttributeValues&&(2===a.defaultAttributeValues[j].length?Ea.vertexAttrib2fv(k,a.defaultAttributeValues[j]):3===a.defaultAttributeValues[j].length&&Ea.vertexAttrib3fv(k,a.defaultAttributeValues[j]))}}$a.disableUnusedAttributes()}function o(a,b,c){var d=a.program.attributes;if(-1!==c.morphTargetBase&&d.position>=0?(Ea.bindBuffer(Ea.ARRAY_BUFFER,b.__webglMorphTargetsBuffers[c.morphTargetBase]),$a.enableAttribute(d.position),Ea.vertexAttribPointer(d.position,3,Ea.FLOAT,!1,0,0)):d.position>=0&&(Ea.bindBuffer(Ea.ARRAY_BUFFER,b.__webglVertexBuffer),$a.enableAttribute(d.position),Ea.vertexAttribPointer(d.position,3,Ea.FLOAT,!1,0,0)),c.morphTargetForcedOrder.length)for(var e,f=0,g=c.morphTargetForcedOrder,h=c.morphTargetInfluences;f<a.numSupportedMorphTargets&&f<g.length;)e=d["morphTarget"+f],e>=0&&(Ea.bindBuffer(Ea.ARRAY_BUFFER,b.__webglMorphTargetsBuffers[g[f]]),$a.enableAttribute(e),Ea.vertexAttribPointer(e,3,Ea.FLOAT,!1,0,0)),e=d["morphNormal"+f],e>=0&&a.morphNormals&&(Ea.bindBuffer(Ea.ARRAY_BUFFER,b.__webglMorphNormalsBuffers[g[f]]),$a.enableAttribute(e),Ea.vertexAttribPointer(e,3,Ea.FLOAT,!1,0,0)),c.__webglMorphTargetInfluences[f]=h[g[f]],f++;else{var i=[],h=c.morphTargetInfluences,j=c.geometry.morphTargets;h.length>j.length&&(console.warn("THREE.WebGLRenderer: Influences array is bigger than morphTargets array."),h.length=j.length);for(var k=0,l=h.length;k<l;k++){var m=h[k];i.push([m,k])}i.length>a.numSupportedMorphTargets?(i.sort(r),i.length=a.numSupportedMorphTargets):i.length>a.numSupportedMorphNormals?i.sort(r):0===i.length&&i.push([0,0]);for(var e,f=0,n=a.numSupportedMorphTargets;f<n;f++)if(i[f]){var o=i[f][1];e=d["morphTarget"+f],e>=0&&(Ea.bindBuffer(Ea.ARRAY_BUFFER,b.__webglMorphTargetsBuffers[o]),$a.enableAttribute(e),Ea.vertexAttribPointer(e,3,Ea.FLOAT,!1,0,0)),e=d["morphNormal"+f],e>=0&&a.morphNormals&&(Ea.bindBuffer(Ea.ARRAY_BUFFER,b.__webglMorphNormalsBuffers[o]),$a.enableAttribute(e),Ea.vertexAttribPointer(e,3,Ea.FLOAT,!1,0,0)),c.__webglMorphTargetInfluences[f]=h[o]}else c.__webglMorphTargetInfluences[f]=0}null!==a.program.uniforms.morphTargetInfluences&&Ea.uniform1fv(a.program.uniforms.morphTargetInfluences,c.__webglMorphTargetInfluences)}function p(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder: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 q(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function r(a,b){return b[0]-a[0]}function s(a){if(!1!==a.visible){if(a instanceof THREE.Scene||a instanceof THREE.Group);else if(x(a),a instanceof THREE.Light)xa.push(a);else if(a instanceof THREE.Sprite)Ca.push(a);else if(a instanceof THREE.LensFlare)Da.push(a);else{var b=ya[a.id];if(b&&(!1===a.frustumCulled||!0===Ta.intersectsObject(a)))for(var c=0,d=b.length;c<d;c++){var e=b[c];w(e),e.render=!0,!0===Fa.sortObjects&&(Va.setFromMatrixPosition(a.matrixWorld),Va.applyProjection(Ua),e.z=Va.z)}}for(var c=0,d=a.children.length;c<d;c++)s(a.children[c])}}function t(a,b,c,d,e){for(var f,g=0,h=a.length;g<h;g++){var i=a[g],j=i.object,k=i.buffer;if(X(j,b),e)f=e;else{if(!(f=i.material))continue;I(f)}Fa.setMaterialFaces(f),k instanceof THREE.BufferGeometry?Fa.renderBufferDirect(b,c,d,f,k,j):Fa.renderBuffer(b,c,d,f,k,j)}}function u(a,b,c,d,e,f){for(var g,h=0,i=a.length;h<i;h++){var j=a[h],k=j.object;if(k.visible){if(f)g=f;else{if(!(g=j[b]))continue;I(g)}Fa.renderImmediateObject(c,d,e,g,k)}}}function v(a){var b=a.object,c=b.material;c.transparent?(a.transparent=c,a.opaque=null):(a.opaque=c,a.transparent=null)}function w(a){var b=a.object,c=a.buffer,d=b.geometry,e=b.material;if(e instanceof THREE.MeshFaceMaterial){var f=d instanceof THREE.BufferGeometry?0:c.materialIndex;e=e.materials[f],a.material=e,e.transparent?Ba.push(a):Aa.push(a)}else e&&(a.material=e,e.transparent?Ba.push(a):Aa.push(a))}function x(a){void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,a.addEventListener("removed",tb));var d=a.geometry;if(void 0===d||void 0===d.__webglInit&&(d.__webglInit=!0,d.addEventListener("dispose",ub),d instanceof THREE.BufferGeometry?Fa.info.memory.geometries++:a instanceof THREE.Mesh?z(a,d):a instanceof THREE.Line?void 0===d.__webglVertexBuffer&&(c(d),g(d,a),d.verticesNeedUpdate=!0,d.colorsNeedUpdate=!0,d.lineDistancesNeedUpdate=!0):a instanceof THREE.PointCloud&&void 0===d.__webglVertexBuffer&&(b(d),f(d,a),d.verticesNeedUpdate=!0,d.colorsNeedUpdate=!0)),void 0===a.__webglActive)if(a.__webglActive=!0,a instanceof THREE.Mesh){if(d instanceof THREE.BufferGeometry)A(ya,d,a);else if(d instanceof THREE.Geometry)for(var e=Db[d.id],h=0,i=e.length;h<i;h++)A(ya,e[h],a)}else a instanceof THREE.Line||a instanceof THREE.PointCloud?A(ya,d,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&B(za,a)}function y(a,b){for(var c,d,e=_a.get("OES_element_index_uint")?4294967296:65535,f={},g=a.morphTargets.length,h=a.morphNormals.length,i={},j=[],k=0,l=a.faces.length;k<l;k++){var m=a.faces[k],n=b?m.materialIndex:0;n in f||(f[n]={hash:n,counter:0}),c=f[n].hash+"_"+f[n].counter,c in i||(d={id:Eb++,faces3:[],materialIndex:n,vertices:0,numMorphTargets:g,numMorphNormals:h},i[c]=d,j.push(d)),i[c].vertices+3>e&&(f[n].counter+=1,(c=f[n].hash+"_"+f[n].counter)in i||(d={id:Eb++,faces3:[],materialIndex:n,vertices:0,numMorphTargets:g,numMorphNormals:h},i[c]=d,j.push(d))),i[c].faces3.push(k),i[c].vertices+=3}return j}function z(a,b){var c=a.material,e=!1;void 0!==Db[b.id]&&!0!==b.groupsNeedUpdate||(delete ya[a.id],Db[b.id]=y(b,c instanceof THREE.MeshFaceMaterial),b.groupsNeedUpdate=!1);for(var f=Db[b.id],g=0,i=f.length;g<i;g++){var j=f[g];void 0===j.__webglVertexBuffer?(d(j),h(j,a),b.verticesNeedUpdate=!0,b.morphTargetsNeedUpdate=!0,b.elementsNeedUpdate=!0,b.uvsNeedUpdate=!0,b.normalsNeedUpdate=!0,b.tangentsNeedUpdate=!0,b.colorsNeedUpdate=!0,e=!0):e=!1,(e||void 0===a.__webglActive)&&A(ya,j,a)}a.__webglActive=!0}function A(a,b,c){var d=c.id;a[d]=a[d]||[],a[d].push({id:d,buffer:b,object:c,material:null,z:0})}function B(a,b){a.push({id:null,object:b,opaque:null,transparent:null,z:0})}function C(a){var b=a.geometry;if(b instanceof THREE.BufferGeometry)for(var c=b.attributes,d=b.attributesKeys,e=0,f=d.length;e<f;e++){var g=d[e],h=c[g],j="index"===g?Ea.ELEMENT_ARRAY_BUFFER:Ea.ARRAY_BUFFER;void 0===h.buffer?(h.buffer=Ea.createBuffer(),Ea.bindBuffer(j,h.buffer),Ea.bufferData(j,h.array,h instanceof THREE.DynamicBufferAttribute?Ea.DYNAMIC_DRAW:Ea.STATIC_DRAW),h.needsUpdate=!1):!0===h.needsUpdate&&(Ea.bindBuffer(j,h.buffer),void 0===h.updateRange||-1===h.updateRange.count?Ea.bufferSubData(j,0,h.array):0===h.updateRange.count?console.error("THREE.WebGLRenderer.updateObject: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):(Ea.bufferSubData(j,h.updateRange.offset*h.array.BYTES_PER_ELEMENT,h.array.subarray(h.updateRange.offset,h.updateRange.offset+h.updateRange.count)),h.updateRange.count=0),h.needsUpdate=!1)}else if(a instanceof THREE.Mesh){!0===b.groupsNeedUpdate&&z(a,b);for(var n=Db[b.id],e=0,o=n.length;e<o;e++){var p=n[e],q=i(a,p),r=q.attributes&&D(q);(b.verticesNeedUpdate||b.morphTargetsNeedUpdate||b.elementsNeedUpdate||b.uvsNeedUpdate||b.normalsNeedUpdate||b.colorsNeedUpdate||b.tangentsNeedUpdate||r)&&m(p,a,Ea.DYNAMIC_DRAW,!b.dynamic,q)}b.verticesNeedUpdate=!1,b.morphTargetsNeedUpdate=!1,b.elementsNeedUpdate=!1,b.uvsNeedUpdate=!1,b.normalsNeedUpdate=!1,b.colorsNeedUpdate=!1,b.tangentsNeedUpdate=!1,q.attributes&&E(q)}else if(a instanceof THREE.Line){var q=i(a,b),r=q.attributes&&D(q);(b.verticesNeedUpdate||b.colorsNeedUpdate||b.lineDistancesNeedUpdate||r)&&l(b,Ea.DYNAMIC_DRAW),b.verticesNeedUpdate=!1,b.colorsNeedUpdate=!1,b.lineDistancesNeedUpdate=!1,q.attributes&&E(q)}else if(a instanceof THREE.PointCloud){var q=i(a,b),r=q.attributes&&D(q);(b.verticesNeedUpdate||b.colorsNeedUpdate||r)&&k(b,Ea.DYNAMIC_DRAW,a),b.verticesNeedUpdate=!1,b.colorsNeedUpdate=!1,q.attributes&&E(q)}}function D(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function E(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function F(a){a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line?delete ya[a.id]:(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&G(za,a),delete a.__webglInit,delete a._modelViewMatrix,delete a._normalMatrix,delete a.__webglActive}function G(a,b){for(var c=a.length-1;c>=0;c--)a[c].object===b&&a.splice(c,1)}function H(a,b,c,d){a.addEventListener("dispose",xb);var e=Fb[a.type];if(e){var f=THREE.ShaderLib[e];a.__webglShader={uniforms:THREE.UniformsUtils.clone(f.uniforms),vertexShader:f.vertexShader,fragmentShader:f.fragmentShader}}else a.__webglShader={uniforms:a.uniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader};var g=ia(b),h=ja(b),i=ha(d),j={precision:na,supportsVertexTextures:hb,map:!!a.map,envMap:!!a.envMap,envMapMode:a.envMap&&a.envMap.mapping,lightMap:!!a.lightMap,bumpMap:!!a.bumpMap,normalMap:!!a.normalMap,specularMap:!!a.specularMap,alphaMap:!!a.alphaMap,combine:a.combine,vertexColors:a.vertexColors,fog:c,useFog:a.fog,fogExp:c instanceof THREE.FogExp2,flatShading:a.shading===THREE.FlatShading,sizeAttenuation:a.sizeAttenuation,logarithmicDepthBuffer:ua,skinning:a.skinning,maxBones:i,useVertexTexture:ib&&d&&d.skeleton&&d.skeleton.useVertexTexture,morphTargets:a.morphTargets,morphNormals:a.morphNormals,maxMorphTargets:Fa.maxMorphTargets,maxMorphNormals:Fa.maxMorphNormals,maxDirLights:g.directional,maxPointLights:g.point,maxSpotLights:g.spot,maxHemiLights:g.hemi,maxShadows:h,shadowMapEnabled:Fa.shadowMapEnabled&&d.receiveShadow&&h>0,shadowMapType:Fa.shadowMapType,shadowMapDebug:Fa.shadowMapDebug,shadowMapCascade:Fa.shadowMapCascade,alphaTest:a.alphaTest,metal:a.metal,wrapAround:a.wrapAround,doubleSided:a.side===THREE.DoubleSide,flipSided:a.side===THREE.BackSide},k=[];if(e?k.push(e):(k.push(a.fragmentShader),k.push(a.vertexShader)),void 0!==a.defines)for(var l in a.defines)k.push(l),k.push(a.defines[l]);for(var l in j)k.push(l),k.push(j[l]);for(var m,n=k.join(),o=0,p=Ga.length;o<p;o++){var q=Ga[o];if(q.code===n){m=q,m.usedTimes++;break}}void 0===m&&(m=new THREE.WebGLProgram(Fa,n,a,j),Ga.push(m),Fa.info.memory.programs=Ga.length),a.program=m;var r=m.attributes;if(a.morphTargets){a.numSupportedMorphTargets=0;for(var s,t="morphTarget",u=0;u<Fa.maxMorphTargets;u++)s=t+u,r[s]>=0&&a.numSupportedMorphTargets++}if(a.morphNormals){a.numSupportedMorphNormals=0;var s,t="morphNormal";for(u=0;u<Fa.maxMorphNormals;u++)s=t+u,r[s]>=0&&a.numSupportedMorphNormals++}a.uniformsList=[];for(var v in a.__webglShader.uniforms){var w=a.program.uniforms[v];w&&a.uniformsList.push([a.__webglShader.uniforms[v],w])}}function I(a){!0===a.transparent?$a.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):$a.setBlending(THREE.NoBlending),$a.setDepthTest(a.depthTest),$a.setDepthWrite(a.depthWrite),$a.setColorWrite(a.colorWrite),$a.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}function J(a,b,c,d,e){Ma=0,d.needsUpdate&&(d.program&&Cb(d),H(d,b,c,e),d.needsUpdate=!1),d.morphTargets&&(e.__webglMorphTargetInfluences||(e.__webglMorphTargetInfluences=new Float32Array(Fa.maxMorphTargets)));var f=!1,g=!1,h=!1,i=d.program,j=i.uniforms,k=d.__webglShader.uniforms;if(i.id!==Ha&&(Ea.useProgram(i.program),Ha=i.id,f=!0,g=!0,h=!0),d.id!==Ja&&(-1===Ja&&(h=!0),Ja=d.id,g=!0),(f||a!==La)&&(Ea.uniformMatrix4fv(j.projectionMatrix,!1,a.projectionMatrix.elements),ua&&Ea.uniform1f(j.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==La&&(La=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==j.cameraPosition&&(Va.setFromMatrixPosition(a.matrixWorld),Ea.uniform3f(j.cameraPosition,Va.x,Va.y,Va.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==j.viewMatrix&&Ea.uniformMatrix4fv(j.viewMatrix,!1,a.matrixWorldInverse.elements)),d.skinning)if(e.bindMatrix&&null!==j.bindMatrix&&Ea.uniformMatrix4fv(j.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==j.bindMatrixInverse&&Ea.uniformMatrix4fv(j.bindMatrixInverse,!1,e.bindMatrixInverse.elements),ib&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==j.boneTexture){var l=V();Ea.uniform1i(j.boneTexture,l),Fa.setTexture(e.skeleton.boneTexture,l)}null!==j.boneTextureWidth&&Ea.uniform1i(j.boneTextureWidth,e.skeleton.boneTextureWidth),null!==j.boneTextureHeight&&Ea.uniform1i(j.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&null!==j.boneGlobalMatrices&&Ea.uniformMatrix4fv(j.boneGlobalMatrices,!1,e.skeleton.boneMatrices);return g&&(c&&d.fog&&O(k,c),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights)&&(Xa&&(h=!0,Z(b),Xa=!1),h?(R(k,Ya),S(k,!0)):S(k,!1)),(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial)&&K(k,d),d instanceof THREE.LineBasicMaterial?L(k,d):d instanceof THREE.LineDashedMaterial?(L(k,d),M(k,d)):d instanceof THREE.PointCloudMaterial?N(k,d):d instanceof THREE.MeshPhongMaterial?P(k,d):d instanceof THREE.MeshLambertMaterial?Q(k,d):d instanceof THREE.MeshDepthMaterial?(k.mNear.value=a.near,k.mFar.value=a.far,k.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(k.opacity.value=d.opacity),e.receiveShadow&&!d._shadowPass&&T(k,b),W(d.uniformsList)),U(j,e),null!==j.modelMatrix&&Ea.uniformMatrix4fv(j.modelMatrix,!1,e.matrixWorld.elements),i}function K(a,b){a.opacity.value=b.opacity,a.diffuse.value=b.color,a.map.value=b.map,a.lightMap.value=b.lightMap,a.specularMap.value=b.specularMap,a.alphaMap.value=b.alphaMap,b.bumpMap&&(a.bumpMap.value=b.bumpMap,a.bumpScale.value=b.bumpScale),b.normalMap&&(a.normalMap.value=b.normalMap,a.normalScale.value.copy(b.normalScale));var c;if(b.map?c=b.map:b.specularMap?c=b.specularMap:b.normalMap?c=b.normalMap:b.bumpMap?c=b.bumpMap:b.alphaMap&&(c=b.alphaMap),void 0!==c){var d=c.offset,e=c.repeat;a.offsetRepeat.value.set(d.x,d.y,e.x,e.y)}a.envMap.value=b.envMap,a.flipEnvMap.value=b.envMap instanceof THREE.WebGLRenderTargetCube?1:-1,a.reflectivity.value=b.reflectivity,a.refractionRatio.value=b.refractionRatio}function L(a,b){a.diffuse.value=b.color,a.opacity.value=b.opacity}function M(a,b){a.dashSize.value=b.dashSize,a.totalSize.value=b.dashSize+b.gapSize,a.scale.value=b.scale}function N(a,b){if(a.psColor.value=b.color,a.opacity.value=b.opacity,a.size.value=b.size,a.scale.value=ka.height/2,a.map.value=b.map,null!==b.map){var c=b.map.offset,d=b.map.repeat;a.offsetRepeat.value.set(c.x,c.y,d.x,d.y)}}function O(a,b){a.fogColor.value=b.color,b instanceof THREE.Fog?(a.fogNear.value=b.near,a.fogFar.value=b.far):b instanceof THREE.FogExp2&&(a.fogDensity.value=b.density)}function P(a,b){a.shininess.value=b.shininess,a.emissive.value=b.emissive,a.specular.value=b.specular,b.wrapAround&&a.wrapRGB.value.copy(b.wrapRGB)}function Q(a,b){a.emissive.value=b.emissive,b.wrapAround&&a.wrapRGB.value.copy(b.wrapRGB)}function R(a,b){a.ambientLightColor.value=b.ambient,a.directionalLightColor.value=b.directional.colors,a.directionalLightDirection.value=b.directional.positions,a.pointLightColor.value=b.point.colors,a.pointLightPosition.value=b.point.positions,a.pointLightDistance.value=b.point.distances,a.pointLightDecay.value=b.point.decays,a.spotLightColor.value=b.spot.colors,a.spotLightPosition.value=b.spot.positions,a.spotLightDistance.value=b.spot.distances,a.spotLightDirection.value=b.spot.directions,a.spotLightAngleCos.value=b.spot.anglesCos,a.spotLightExponent.value=b.spot.exponents,a.spotLightDecay.value=b.spot.decays,a.hemisphereLightSkyColor.value=b.hemi.skyColors,a.hemisphereLightGroundColor.value=b.hemi.groundColors,a.hemisphereLightDirection.value=b.hemi.positions}function S(a,b){a.ambientLightColor.needsUpdate=b,a.directionalLightColor.needsUpdate=b,a.directionalLightDirection.needsUpdate=b,a.pointLightColor.needsUpdate=b,a.pointLightPosition.needsUpdate=b,a.pointLightDistance.needsUpdate=b,a.pointLightDecay.needsUpdate=b,a.spotLightColor.needsUpdate=b,a.spotLightPosition.needsUpdate=b,a.spotLightDistance.needsUpdate=b,a.spotLightDirection.needsUpdate=b,a.spotLightAngleCos.needsUpdate=b,a.spotLightExponent.needsUpdate=b,a.spotLightDecay.needsUpdate=b,a.hemisphereLightSkyColor.needsUpdate=b,a.hemisphereLightGroundColor.needsUpdate=b,a.hemisphereLightDirection.needsUpdate=b}function T(a,b){if(a.shadowMatrix)for(var c=0,d=0,e=b.length;d<e;d++){var f=b[d];f.castShadow&&((f instanceof THREE.SpotLight||f instanceof THREE.DirectionalLight&&!f.shadowCascade)&&(a.shadowMap.value[c]=f.shadowMap,a.shadowMapSize.value[c]=f.shadowMapSize,a.shadowMatrix.value[c]=f.shadowMatrix,a.shadowDarkness.value[c]=f.shadowDarkness,
  a.shadowBias.value[c]=f.shadowBias,c++))}}function U(a,b){Ea.uniformMatrix4fv(a.modelViewMatrix,!1,b._modelViewMatrix.elements),a.normalMatrix&&Ea.uniformMatrix3fv(a.normalMatrix,!1,b._normalMatrix.elements)}function V(){var a=Ma;return a>=db&&THREE.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+db),Ma+=1,a}function W(a){for(var b,c,d,e=0,f=a.length;e<f;e++){var g=a[e][0];if(!1!==g.needsUpdate){var h=g.type,i=g.value,j=a[e][1];switch(h){case"1i":Ea.uniform1i(j,i);break;case"1f":Ea.uniform1f(j,i);break;case"2f":Ea.uniform2f(j,i[0],i[1]);break;case"3f":Ea.uniform3f(j,i[0],i[1],i[2]);break;case"4f":Ea.uniform4f(j,i[0],i[1],i[2],i[3]);break;case"1iv":Ea.uniform1iv(j,i);break;case"3iv":Ea.uniform3iv(j,i);break;case"1fv":Ea.uniform1fv(j,i);break;case"2fv":Ea.uniform2fv(j,i);break;case"3fv":Ea.uniform3fv(j,i);break;case"4fv":Ea.uniform4fv(j,i);break;case"Matrix3fv":Ea.uniformMatrix3fv(j,!1,i);break;case"Matrix4fv":Ea.uniformMatrix4fv(j,!1,i);break;case"i":Ea.uniform1i(j,i);break;case"f":Ea.uniform1f(j,i);break;case"v2":Ea.uniform2f(j,i.x,i.y);break;case"v3":Ea.uniform3f(j,i.x,i.y,i.z);break;case"v4":Ea.uniform4f(j,i.x,i.y,i.z,i.w);break;case"c":Ea.uniform3f(j,i.r,i.g,i.b);break;case"iv1":Ea.uniform1iv(j,i);break;case"iv":Ea.uniform3iv(j,i);break;case"fv1":Ea.uniform1fv(j,i);break;case"fv":Ea.uniform3fv(j,i);break;case"v2v":void 0===g._array&&(g._array=new Float32Array(2*i.length));for(var k=0,l=i.length;k<l;k++)d=2*k,g._array[d]=i[k].x,g._array[d+1]=i[k].y;Ea.uniform2fv(j,g._array);break;case"v3v":void 0===g._array&&(g._array=new Float32Array(3*i.length));for(var k=0,l=i.length;k<l;k++)d=3*k,g._array[d]=i[k].x,g._array[d+1]=i[k].y,g._array[d+2]=i[k].z;Ea.uniform3fv(j,g._array);break;case"v4v":void 0===g._array&&(g._array=new Float32Array(4*i.length));for(var k=0,l=i.length;k<l;k++)d=4*k,g._array[d]=i[k].x,g._array[d+1]=i[k].y,g._array[d+2]=i[k].z,g._array[d+3]=i[k].w;Ea.uniform4fv(j,g._array);break;case"m3":Ea.uniformMatrix3fv(j,!1,i.elements);break;case"m3v":void 0===g._array&&(g._array=new Float32Array(9*i.length));for(var k=0,l=i.length;k<l;k++)i[k].flattenToArrayOffset(g._array,9*k);Ea.uniformMatrix3fv(j,!1,g._array);break;case"m4":Ea.uniformMatrix4fv(j,!1,i.elements);break;case"m4v":void 0===g._array&&(g._array=new Float32Array(16*i.length));for(var k=0,l=i.length;k<l;k++)i[k].flattenToArrayOffset(g._array,16*k);Ea.uniformMatrix4fv(j,!1,g._array);break;case"t":if(b=i,c=V(),Ea.uniform1i(j,c),!b)continue;b instanceof THREE.CubeTexture||b.image instanceof Array&&6===b.image.length?aa(b,c):b instanceof THREE.WebGLRenderTargetCube?ba(b,c):Fa.setTexture(b,c);break;case"tv":void 0===g._array&&(g._array=[]);for(var k=0,l=g.value.length;k<l;k++)g._array[k]=V();Ea.uniform1iv(j,g._array);for(var k=0,l=g.value.length;k<l;k++)b=g.value[k],c=g._array[k],b&&Fa.setTexture(b,c);break;default:THREE.warn("THREE.WebGLRenderer: Unknown uniform type: "+h)}}}}function X(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld),a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}function Y(a,b,c,d){a[b]=c.r*d,a[b+1]=c.g*d,a[b+2]=c.b*d}function Z(a){var b,c,d,e,f,g,h,i,j=0,k=0,l=0,m=Ya,n=m.directional.colors,o=m.directional.positions,p=m.point.colors,q=m.point.positions,r=m.point.distances,s=m.point.decays,t=m.spot.colors,u=m.spot.positions,v=m.spot.distances,w=m.spot.directions,x=m.spot.anglesCos,y=m.spot.exponents,z=m.spot.decays,A=m.hemi.skyColors,B=m.hemi.groundColors,C=m.hemi.positions,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;for(b=0,c=a.length;b<c;b++)if(d=a[b],!d.onlyShadow)if(e=d.color,h=d.intensity,i=d.distance,d instanceof THREE.AmbientLight){if(!d.visible)continue;j+=e.r,k+=e.g,l+=e.b}else if(d instanceof THREE.DirectionalLight){if(H+=1,!d.visible)continue;Wa.setFromMatrixPosition(d.matrixWorld),Va.setFromMatrixPosition(d.target.matrixWorld),Wa.sub(Va),Wa.normalize(),L=3*D,o[L]=Wa.x,o[L+1]=Wa.y,o[L+2]=Wa.z,Y(n,L,e,h),D+=1}else if(d instanceof THREE.PointLight){if(I+=1,!d.visible)continue;M=3*E,Y(p,M,e,h),Va.setFromMatrixPosition(d.matrixWorld),q[M]=Va.x,q[M+1]=Va.y,q[M+2]=Va.z,r[E]=i,s[E]=0===d.distance?0:d.decay,E+=1}else if(d instanceof THREE.SpotLight){if(J+=1,!d.visible)continue;N=3*F,Y(t,N,e,h),Wa.setFromMatrixPosition(d.matrixWorld),u[N]=Wa.x,u[N+1]=Wa.y,u[N+2]=Wa.z,v[F]=i,Va.setFromMatrixPosition(d.target.matrixWorld),Wa.sub(Va),Wa.normalize(),w[N]=Wa.x,w[N+1]=Wa.y,w[N+2]=Wa.z,x[F]=Math.cos(d.angle),y[F]=d.exponent,z[F]=0===d.distance?0:d.decay,F+=1}else if(d instanceof THREE.HemisphereLight){if(K+=1,!d.visible)continue;Wa.setFromMatrixPosition(d.matrixWorld),Wa.normalize(),O=3*G,C[O]=Wa.x,C[O+1]=Wa.y,C[O+2]=Wa.z,f=d.color,g=d.groundColor,Y(A,O,f,h),Y(B,O,g,h),G+=1}for(b=3*D,c=Math.max(n.length,3*H);b<c;b++)n[b]=0;for(b=3*E,c=Math.max(p.length,3*I);b<c;b++)p[b]=0;for(b=3*F,c=Math.max(t.length,3*J);b<c;b++)t[b]=0;for(b=3*G,c=Math.max(A.length,3*K);b<c;b++)A[b]=0;for(b=3*G,c=Math.max(B.length,3*K);b<c;b++)B[b]=0;m.directional.length=D,m.point.length=E,m.spot.length=F,m.hemi.length=G,m.ambient[0]=j,m.ambient[1]=k,m.ambient[2]=l}function $(a,b,c){var d;c?(Ea.texParameteri(a,Ea.TEXTURE_WRAP_S,ga(b.wrapS)),Ea.texParameteri(a,Ea.TEXTURE_WRAP_T,ga(b.wrapT)),Ea.texParameteri(a,Ea.TEXTURE_MAG_FILTER,ga(b.magFilter)),Ea.texParameteri(a,Ea.TEXTURE_MIN_FILTER,ga(b.minFilter))):(Ea.texParameteri(a,Ea.TEXTURE_WRAP_S,Ea.CLAMP_TO_EDGE),Ea.texParameteri(a,Ea.TEXTURE_WRAP_T,Ea.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),Ea.texParameteri(a,Ea.TEXTURE_MAG_FILTER,fa(b.magFilter)),Ea.texParameteri(a,Ea.TEXTURE_MIN_FILTER,fa(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )")),(d=_a.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(b.anisotropy>1||b.__currentAnisotropy)&&(Ea.texParameterf(a,d.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,Fa.getMaxAnisotropy())),b.__currentAnisotropy=b.anisotropy)}function _(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c),d.height=Math.floor(a.height*c);return d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height),THREE.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a),d}return a}function aa(a,b){if(6===a.image.length)if(a.needsUpdate){a.image.__webglTextureCube||(a.addEventListener("dispose",vb),a.image.__webglTextureCube=Ea.createTexture(),Fa.info.memory.textures++),Ea.activeTexture(Ea.TEXTURE0+b),Ea.bindTexture(Ea.TEXTURE_CUBE_MAP,a.image.__webglTextureCube),Ea.pixelStorei(Ea.UNPACK_FLIP_Y_WEBGL,a.flipY);for(var c=a instanceof THREE.CompressedTexture,d=a.image[0]instanceof THREE.DataTexture,e=[],f=0;f<6;f++)!Fa.autoScaleCubemaps||c||d?e[f]=d?a.image[f].image:a.image[f]:e[f]=_(a.image[f],gb);var g=e[0],h=THREE.Math.isPowerOfTwo(g.width)&&THREE.Math.isPowerOfTwo(g.height),i=ga(a.format),j=ga(a.type);$(Ea.TEXTURE_CUBE_MAP,a,h);for(var f=0;f<6;f++)if(c)for(var k,l=e[f].mipmaps,m=0,n=l.length;m<n;m++)k=l[m],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?nb().indexOf(i)>-1?Ea.compressedTexImage2D(Ea.TEXTURE_CUBE_MAP_POSITIVE_X+f,m,i,k.width,k.height,0,k.data):THREE.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):Ea.texImage2D(Ea.TEXTURE_CUBE_MAP_POSITIVE_X+f,m,i,k.width,k.height,0,i,j,k.data);else d?Ea.texImage2D(Ea.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,i,e[f].width,e[f].height,0,i,j,e[f].data):Ea.texImage2D(Ea.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,i,i,j,e[f]);a.generateMipmaps&&h&&Ea.generateMipmap(Ea.TEXTURE_CUBE_MAP),a.needsUpdate=!1,a.onUpdate&&a.onUpdate()}else Ea.activeTexture(Ea.TEXTURE0+b),Ea.bindTexture(Ea.TEXTURE_CUBE_MAP,a.image.__webglTextureCube)}function ba(a,b){Ea.activeTexture(Ea.TEXTURE0+b),Ea.bindTexture(Ea.TEXTURE_CUBE_MAP,a.__webglTexture)}function ca(a,b,c){Ea.bindFramebuffer(Ea.FRAMEBUFFER,a),Ea.framebufferTexture2D(Ea.FRAMEBUFFER,Ea.COLOR_ATTACHMENT0,c,b.__webglTexture,0)}function da(a,b){Ea.bindRenderbuffer(Ea.RENDERBUFFER,a),b.depthBuffer&&!b.stencilBuffer?(Ea.renderbufferStorage(Ea.RENDERBUFFER,Ea.DEPTH_COMPONENT16,b.width,b.height),Ea.framebufferRenderbuffer(Ea.FRAMEBUFFER,Ea.DEPTH_ATTACHMENT,Ea.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(Ea.renderbufferStorage(Ea.RENDERBUFFER,Ea.DEPTH_STENCIL,b.width,b.height),Ea.framebufferRenderbuffer(Ea.FRAMEBUFFER,Ea.DEPTH_STENCIL_ATTACHMENT,Ea.RENDERBUFFER,a)):Ea.renderbufferStorage(Ea.RENDERBUFFER,Ea.RGBA4,b.width,b.height)}function ea(a){a instanceof THREE.WebGLRenderTargetCube?(Ea.bindTexture(Ea.TEXTURE_CUBE_MAP,a.__webglTexture),Ea.generateMipmap(Ea.TEXTURE_CUBE_MAP),Ea.bindTexture(Ea.TEXTURE_CUBE_MAP,null)):(Ea.bindTexture(Ea.TEXTURE_2D,a.__webglTexture),Ea.generateMipmap(Ea.TEXTURE_2D),Ea.bindTexture(Ea.TEXTURE_2D,null))}function fa(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?Ea.NEAREST:Ea.LINEAR}function ga(a){var b;if(a===THREE.RepeatWrapping)return Ea.REPEAT;if(a===THREE.ClampToEdgeWrapping)return Ea.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return Ea.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return Ea.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return Ea.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return Ea.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return Ea.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return Ea.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return Ea.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return Ea.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return Ea.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return Ea.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return Ea.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return Ea.BYTE;if(a===THREE.ShortType)return Ea.SHORT;if(a===THREE.UnsignedShortType)return Ea.UNSIGNED_SHORT;if(a===THREE.IntType)return Ea.INT;if(a===THREE.UnsignedIntType)return Ea.UNSIGNED_INT;if(a===THREE.FloatType)return Ea.FLOAT;if(null!==(b=_a.get("OES_texture_half_float"))&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return Ea.ALPHA;if(a===THREE.RGBFormat)return Ea.RGB;if(a===THREE.RGBAFormat)return Ea.RGBA;if(a===THREE.LuminanceFormat)return Ea.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return Ea.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return Ea.FUNC_ADD;if(a===THREE.SubtractEquation)return Ea.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return Ea.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return Ea.ZERO;if(a===THREE.OneFactor)return Ea.ONE;if(a===THREE.SrcColorFactor)return Ea.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return Ea.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return Ea.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return Ea.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return Ea.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return Ea.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return Ea.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return Ea.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return Ea.SRC_ALPHA_SATURATE;if(null!==(b=_a.get("WEBGL_compressed_texture_s3tc"))){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(null!==(b=_a.get("WEBGL_compressed_texture_pvrtc"))){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(null!==(b=_a.get("EXT_blend_minmax"))){if(a===THREE.MinEquation)return b.MIN_EXT;if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}function ha(a){if(ib&&a&&a.skeleton&&a.skeleton.useVertexTexture)return 1024;var b=Ea.getParameter(Ea.MAX_VERTEX_UNIFORM_VECTORS),c=Math.floor((b-20)/4),d=c;return void 0!==a&&a instanceof THREE.SkinnedMesh&&(d=Math.min(a.skeleton.bones.length,d))<a.skeleton.bones.length&&THREE.warn("WebGLRenderer: too many bones - "+a.skeleton.bones.length+", this GPU supports just "+d+" (try OpenGL instead of ANGLE)"),d}function ia(a){for(var b=0,c=0,d=0,e=0,f=0,g=a.length;f<g;f++){var h=a[f];h.onlyShadow||!1===h.visible||(h instanceof THREE.DirectionalLight&&b++,h instanceof THREE.PointLight&&c++,h instanceof THREE.SpotLight&&d++,h instanceof THREE.HemisphereLight&&e++)}return{directional:b,point:c,spot:d,hemi:e}}function ja(a){for(var b=0,c=0,d=a.length;c<d;c++){var e=a[c];e.castShadow&&(e instanceof THREE.SpotLight&&b++,e instanceof THREE.DirectionalLight&&!e.shadowCascade&&b++)}return b}console.log("THREE.WebGLRenderer",THREE.REVISION),a=a||{};var ka=void 0!==a.canvas?a.canvas:document.createElement("canvas"),la=void 0!==a.context?a.context:null,ma=1,na=void 0!==a.precision?a.precision:"highp",oa=void 0!==a.alpha&&a.alpha,pa=void 0===a.depth||a.depth,qa=void 0===a.stencil||a.stencil,ra=void 0!==a.antialias&&a.antialias,sa=void 0===a.premultipliedAlpha||a.premultipliedAlpha,ta=void 0!==a.preserveDrawingBuffer&&a.preserveDrawingBuffer,ua=void 0!==a.logarithmicDepthBuffer&&a.logarithmicDepthBuffer,va=new THREE.Color(0),wa=0,xa=[],ya={},za=[],Aa=[],Ba=[],Ca=[],Da=[];this.domElement=ka,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.shadowMapEnabled=!1,this.shadowMapType=THREE.PCFShadowMap,this.shadowMapCullFace=THREE.CullFaceFront,this.shadowMapDebug=!1,this.shadowMapCascade=!1,this.maxMorphTargets=8,this.maxMorphNormals=4,this.autoScaleCubemaps=!0,this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var Ea,Fa=this,Ga=[],Ha=null,Ia=null,Ja=-1,Ka="",La=null,Ma=0,Na=0,Oa=0,Pa=ka.width,Qa=ka.height,Ra=0,Sa=0,Ta=new THREE.Frustum,Ua=new THREE.Matrix4,Va=new THREE.Vector3,Wa=new THREE.Vector3,Xa=!0,Ya={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}};try{var Za={alpha:oa,depth:pa,stencil:qa,antialias:ra,premultipliedAlpha:sa,preserveDrawingBuffer:ta};if(null===(Ea=la||ka.getContext("webgl",Za)||ka.getContext("experimental-webgl",Za)))throw null!==ka.getContext("webgl")?"Error creating WebGL context with your selected attributes.":"Error creating WebGL context.";ka.addEventListener("webglcontextlost",function(a){a.preventDefault(),cb(),bb(),ya={}},!1)}catch(a){THREE.error("THREE.WebGLRenderer: "+a)}var $a=new THREE.WebGLState(Ea,ga);void 0===Ea.getShaderPrecisionFormat&&(Ea.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var _a=new THREE.WebGLExtensions(Ea);_a.get("OES_texture_float"),_a.get("OES_texture_float_linear"),_a.get("OES_texture_half_float"),_a.get("OES_texture_half_float_linear"),_a.get("OES_standard_derivatives"),ua&&_a.get("EXT_frag_depth");var ab=function(a,b,c,d){!0===sa&&(a*=d,b*=d,c*=d),Ea.clearColor(a,b,c,d)},bb=function(){Ea.clearColor(0,0,0,1),Ea.clearDepth(1),Ea.clearStencil(0),Ea.enable(Ea.DEPTH_TEST),Ea.depthFunc(Ea.LEQUAL),Ea.frontFace(Ea.CCW),Ea.cullFace(Ea.BACK),Ea.enable(Ea.CULL_FACE),Ea.enable(Ea.BLEND),Ea.blendEquation(Ea.FUNC_ADD),Ea.blendFunc(Ea.SRC_ALPHA,Ea.ONE_MINUS_SRC_ALPHA),Ea.viewport(Na,Oa,Pa,Qa),ab(va.r,va.g,va.b,wa)},cb=function(){Ha=null,La=null,Ka="",Ja=-1,Xa=!0,$a.reset()};bb(),this.context=Ea,this.state=$a;var db=Ea.getParameter(Ea.MAX_TEXTURE_IMAGE_UNITS),eb=Ea.getParameter(Ea.MAX_VERTEX_TEXTURE_IMAGE_UNITS),fb=Ea.getParameter(Ea.MAX_TEXTURE_SIZE),gb=Ea.getParameter(Ea.MAX_CUBE_MAP_TEXTURE_SIZE),hb=eb>0,ib=hb&&_a.get("OES_texture_float"),jb=Ea.getShaderPrecisionFormat(Ea.VERTEX_SHADER,Ea.HIGH_FLOAT),kb=Ea.getShaderPrecisionFormat(Ea.VERTEX_SHADER,Ea.MEDIUM_FLOAT),lb=Ea.getShaderPrecisionFormat(Ea.FRAGMENT_SHADER,Ea.HIGH_FLOAT),mb=Ea.getShaderPrecisionFormat(Ea.FRAGMENT_SHADER,Ea.MEDIUM_FLOAT),nb=function(){var a;return function(){if(void 0!==a)return a;if(a=[],_a.get("WEBGL_compressed_texture_pvrtc")||_a.get("WEBGL_compressed_texture_s3tc"))for(var b=Ea.getParameter(Ea.COMPRESSED_TEXTURE_FORMATS),c=0;c<b.length;c++)a.push(b[c]);return a}}(),ob=jb.precision>0&&lb.precision>0,pb=kb.precision>0&&mb.precision>0;"highp"!==na||ob||(pb?(na="mediump",THREE.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(na="lowp",THREE.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp."))),"mediump"!==na||pb||(na="lowp",THREE.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var qb=new THREE.ShadowMapPlugin(this,xa,ya,za),rb=new THREE.SpritePlugin(this,Ca),sb=new THREE.LensFlarePlugin(this,Da);this.getContext=function(){return Ea},this.forceContextLoss=function(){_a.get("WEBGL_lose_context").loseContext()},this.supportsVertexTextures=function(){return hb},this.supportsFloatTextures=function(){return _a.get("OES_texture_float")},this.supportsHalfFloatTextures=function(){return _a.get("OES_texture_half_float")},this.supportsStandardDerivatives=function(){return _a.get("OES_standard_derivatives")},this.supportsCompressedTextureS3TC=function(){return _a.get("WEBGL_compressed_texture_s3tc")},this.supportsCompressedTexturePVRTC=function(){return _a.get("WEBGL_compressed_texture_pvrtc")},this.supportsBlendMinMax=function(){return _a.get("EXT_blend_minmax")},this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=_a.get("EXT_texture_filter_anisotropic");return a=null!==b?Ea.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}(),this.getPrecision=function(){return na},this.getPixelRatio=function(){return ma},this.setPixelRatio=function(a){ma=a},this.setSize=function(a,b,c){ka.width=a*ma,ka.height=b*ma,!1!==c&&(ka.style.width=a+"px",ka.style.height=b+"px"),this.setViewport(0,0,a,b)},this.setViewport=function(a,b,c,d){Na=a*ma,Oa=b*ma,Pa=c*ma,Qa=d*ma,Ea.viewport(Na,Oa,Pa,Qa)},this.setScissor=function(a,b,c,d){Ea.scissor(a*ma,b*ma,c*ma,d*ma)},this.enableScissorTest=function(a){a?Ea.enable(Ea.SCISSOR_TEST):Ea.disable(Ea.SCISSOR_TEST)},this.getClearColor=function(){return va},this.setClearColor=function(a,b){va.set(a),wa=void 0!==b?b:1,ab(va.r,va.g,va.b,wa)},this.getClearAlpha=function(){return wa},this.setClearAlpha=function(a){wa=a,ab(va.r,va.g,va.b,wa)},this.clear=function(a,b,c){var d=0;(void 0===a||a)&&(d|=Ea.COLOR_BUFFER_BIT),(void 0===b||b)&&(d|=Ea.DEPTH_BUFFER_BIT),(void 0===c||c)&&(d|=Ea.STENCIL_BUFFER_BIT),Ea.clear(d)},this.clearColor=function(){Ea.clear(Ea.COLOR_BUFFER_BIT)},this.clearDepth=function(){Ea.clear(Ea.DEPTH_BUFFER_BIT)},this.clearStencil=function(){Ea.clear(Ea.STENCIL_BUFFER_BIT)},this.clearTarget=function(a,b,c,d){this.setRenderTarget(a),this.clear(b,c,d)},this.resetGLState=cb;var tb=function(a){a.target.traverse(function(a){a.removeEventListener("remove",tb),F(a)})},ub=function(a){var b=a.target;b.removeEventListener("dispose",ub),zb(b)},vb=function(a){var b=a.target;b.removeEventListener("dispose",vb),Ab(b),Fa.info.memory.textures--},wb=function(a){var b=a.target;b.removeEventListener("dispose",wb),Bb(b),Fa.info.memory.textures--},xb=function(a){var b=a.target;b.removeEventListener("dispose",xb),Cb(b)},yb=function(a){for(var b=["__webglVertexBuffer","__webglNormalBuffer","__webglTangentBuffer","__webglColorBuffer","__webglUVBuffer","__webglUV2Buffer","__webglSkinIndicesBuffer","__webglSkinWeightsBuffer","__webglFaceBuffer","__webglLineBuffer","__webglLineDistanceBuffer"],c=0,d=b.length;c<d;c++){var e=b[c];void 0!==a[e]&&(Ea.deleteBuffer(a[e]),delete a[e])}if(void 0!==a.__webglCustomAttributesList){for(var e in a.__webglCustomAttributesList)Ea.deleteBuffer(a.__webglCustomAttributesList[e].buffer);delete a.__webglCustomAttributesList}Fa.info.memory.geometries--},zb=function(a){if(delete a.__webglInit,a instanceof THREE.BufferGeometry){for(var b in a.attributes){var c=a.attributes[b];void 0!==c.buffer&&(Ea.deleteBuffer(c.buffer),delete c.buffer)}Fa.info.memory.geometries--}else{var d=Db[a.id];if(void 0!==d){for(var e=0,f=d.length;e<f;e++){var g=d[e];if(void 0!==g.numMorphTargets){for(var h=0,i=g.numMorphTargets;h<i;h++)Ea.deleteBuffer(g.__webglMorphTargetsBuffers[h]);delete g.__webglMorphTargetsBuffers}if(void 0!==g.numMorphNormals){for(var h=0,i=g.numMorphNormals;h<i;h++)Ea.deleteBuffer(g.__webglMorphNormalsBuffers[h]);delete g.__webglMorphNormalsBuffers}yb(g)}delete Db[a.id]}else yb(a)}Ka=""},Ab=function(a){if(a.image&&a.image.__webglTextureCube)Ea.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube;else{if(void 0===a.__webglInit)return;Ea.deleteTexture(a.__webglTexture),delete a.__webglTexture,delete a.__webglInit}},Bb=function(a){if(a&&void 0!==a.__webglTexture){if(Ea.deleteTexture(a.__webglTexture),delete a.__webglTexture,a instanceof THREE.WebGLRenderTargetCube)for(var b=0;b<6;b++)Ea.deleteFramebuffer(a.__webglFramebuffer[b]),Ea.deleteRenderbuffer(a.__webglRenderbuffer[b]);else Ea.deleteFramebuffer(a.__webglFramebuffer),Ea.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer,delete a.__webglRenderbuffer}},Cb=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e,f=!1;for(c=0,d=Ga.length;c<d;c++)if(e=Ga[c],e.program===b){e.usedTimes--,0===e.usedTimes&&(f=!0);break}if(!0===f){var g=[];for(c=0,d=Ga.length;c<d;c++)e=Ga[c],e.program!==b&&g.push(e);Ga=g,Ea.deleteProgram(b),Fa.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){if($a.initAttributes(),a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=Ea.createBuffer()),a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=Ea.createBuffer()),a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=Ea.createBuffer()),a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=Ea.createBuffer()),a.hasPositions&&(Ea.bindBuffer(Ea.ARRAY_BUFFER,a.__webglVertexBuffer),Ea.bufferData(Ea.ARRAY_BUFFER,a.positionArray,Ea.DYNAMIC_DRAW),$a.enableAttribute(b.attributes.position),Ea.vertexAttribPointer(b.attributes.position,3,Ea.FLOAT,!1,0,0)),a.hasNormals){if(Ea.bindBuffer(Ea.ARRAY_BUFFER,a.__webglNormalBuffer),c instanceof THREE.MeshPhongMaterial==!1&&c.shading===THREE.FlatShading){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r=3*a.count;for(q=0;q<r;q+=9)p=a.normalArray,g=p[q],j=p[q+1],m=p[q+2],h=p[q+3],k=p[q+4],n=p[q+5],i=p[q+6],l=p[q+7],o=p[q+8],d=(g+h+i)/3,e=(j+k+l)/3,f=(m+n+o)/3,p[q]=d,p[q+1]=e,p[q+2]=f,p[q+3]=d,p[q+4]=e,p[q+5]=f,p[q+6]=d,p[q+7]=e,p[q+8]=f}Ea.bufferData(Ea.ARRAY_BUFFER,a.normalArray,Ea.DYNAMIC_DRAW),$a.enableAttribute(b.attributes.normal),Ea.vertexAttribPointer(b.attributes.normal,3,Ea.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(Ea.bindBuffer(Ea.ARRAY_BUFFER,a.__webglUvBuffer),Ea.bufferData(Ea.ARRAY_BUFFER,a.uvArray,Ea.DYNAMIC_DRAW),$a.enableAttribute(b.attributes.uv),Ea.vertexAttribPointer(b.attributes.uv,2,Ea.FLOAT,!1,0,0)),a.hasColors&&c.vertexColors!==THREE.NoColors&&(Ea.bindBuffer(Ea.ARRAY_BUFFER,a.__webglColorBuffer),Ea.bufferData(Ea.ARRAY_BUFFER,a.colorArray,Ea.DYNAMIC_DRAW),$a.enableAttribute(b.attributes.color),Ea.vertexAttribPointer(b.attributes.color,3,Ea.FLOAT,!1,0,0)),$a.disableUnusedAttributes(),Ea.drawArrays(Ea.TRIANGLES,0,a.count),a.count=0},this.renderBufferDirect=function(a,b,c,d,e,f){if(!1!==d.visible){C(f);var g=J(a,b,c,d,f),h=!1,i=d.wireframe?1:0,j="direct_"+e.id+"_"+g.id+"_"+i;if(j!==Ka&&(Ka=j,h=!0),h&&$a.initAttributes(),f instanceof THREE.Mesh){var k=!0===d.wireframe?Ea.LINES:Ea.TRIANGLES,l=e.attributes.index;if(l){var m,o;l.array instanceof Uint32Array&&_a.get("OES_element_index_uint")?(m=Ea.UNSIGNED_INT,o=4):(m=Ea.UNSIGNED_SHORT,o=2);var p=e.offsets;if(0===p.length)h&&(n(d,g,e,0),Ea.bindBuffer(Ea.ELEMENT_ARRAY_BUFFER,l.buffer)),Ea.drawElements(k,l.array.length,m,0),Fa.info.render.calls++,Fa.info.render.vertices+=l.array.length,Fa.info.render.faces+=l.array.length/3;else{h=!0;for(var q=0,r=p.length;q<r;q++){var s=p[q].index;h&&(n(d,g,e,s),Ea.bindBuffer(Ea.ELEMENT_ARRAY_BUFFER,l.buffer)),Ea.drawElements(k,p[q].count,m,p[q].start*o),Fa.info.render.calls++,Fa.info.render.vertices+=p[q].count,Fa.info.render.faces+=p[q].count/3}}}else{h&&n(d,g,e,0);var t=e.attributes.position;Ea.drawArrays(k,0,t.array.length/t.itemSize),Fa.info.render.calls++,Fa.info.render.vertices+=t.array.length/t.itemSize,Fa.info.render.faces+=t.array.length/(3*t.itemSize)}}else if(f instanceof THREE.PointCloud){var k=Ea.POINTS,l=e.attributes.index;if(l){var m,o;l.array instanceof Uint32Array&&_a.get("OES_element_index_uint")?(m=Ea.UNSIGNED_INT,o=4):(m=Ea.UNSIGNED_SHORT,o=2);var p=e.offsets;if(0===p.length)h&&(n(d,g,e,0),Ea.bindBuffer(Ea.ELEMENT_ARRAY_BUFFER,l.buffer)),Ea.drawElements(k,l.array.length,m,0),Fa.info.render.calls++,Fa.info.render.points+=l.array.length;else{p.length>1&&(h=!0);for(var q=0,r=p.length;q<r;q++){var s=p[q].index;h&&(n(d,g,e,s),Ea.bindBuffer(Ea.ELEMENT_ARRAY_BUFFER,l.buffer)),Ea.drawElements(k,p[q].count,m,p[q].start*o),Fa.info.render.calls++,Fa.info.render.points+=p[q].count}}}else{h&&n(d,g,e,0);var t=e.attributes.position,p=e.offsets;if(0===p.length)Ea.drawArrays(k,0,t.array.length/3),Fa.info.render.calls++,Fa.info.render.points+=t.array.length/3;else for(var q=0,r=p.length;q<r;q++)Ea.drawArrays(k,p[q].index,p[q].count),Fa.info.render.calls++,Fa.info.render.points+=p[q].count}}else if(f instanceof THREE.Line){var k=f.mode===THREE.LineStrip?Ea.LINE_STRIP:Ea.LINES;$a.setLineWidth(d.linewidth*ma);var l=e.attributes.index;if(l){var m,o;l.array instanceof Uint32Array?(m=Ea.UNSIGNED_INT,o=4):(m=Ea.UNSIGNED_SHORT,o=2);var p=e.offsets;if(0===p.length)h&&(n(d,g,e,0),Ea.bindBuffer(Ea.ELEMENT_ARRAY_BUFFER,l.buffer)),Ea.drawElements(k,l.array.length,m,0),Fa.info.render.calls++,Fa.info.render.vertices+=l.array.length;else{p.length>1&&(h=!0);for(var q=0,r=p.length;q<r;q++){var s=p[q].index;h&&(n(d,g,e,s),Ea.bindBuffer(Ea.ELEMENT_ARRAY_BUFFER,l.buffer)),Ea.drawElements(k,p[q].count,m,p[q].start*o),Fa.info.render.calls++,Fa.info.render.vertices+=p[q].count}}}else{h&&n(d,g,e,0);var t=e.attributes.position,p=e.offsets;if(0===p.length)Ea.drawArrays(k,0,t.array.length/3),Fa.info.render.calls++,Fa.info.render.vertices+=t.array.length/3;else for(var q=0,r=p.length;q<r;q++)Ea.drawArrays(k,p[q].index,p[q].count),Fa.info.render.calls++,Fa.info.render.vertices+=p[q].count}}}},this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){C(f);var g=J(a,b,c,d,f),h=g.attributes,i=!1,j=d.wireframe?1:0,k=e.id+"_"+g.id+"_"+j;if(k!==Ka&&(Ka=k,i=!0),i&&$a.initAttributes(),!d.morphTargets&&h.position>=0?i&&(Ea.bindBuffer(Ea.ARRAY_BUFFER,e.__webglVertexBuffer),$a.enableAttribute(h.position),Ea.vertexAttribPointer(h.position,3,Ea.FLOAT,!1,0,0)):f.morphTargetBase&&o(d,e,f),i){if(e.__webglCustomAttributesList)for(var l=0,m=e.__webglCustomAttributesList.length;l<m;l++){var n=e.__webglCustomAttributesList[l];h[n.buffer.belongsToAttribute]>=0&&(Ea.bindBuffer(Ea.ARRAY_BUFFER,n.buffer),$a.enableAttribute(h[n.buffer.belongsToAttribute]),Ea.vertexAttribPointer(h[n.buffer.belongsToAttribute],n.size,Ea.FLOAT,!1,0,0))}h.color>=0&&(f.geometry.colors.length>0||f.geometry.faces.length>0?(Ea.bindBuffer(Ea.ARRAY_BUFFER,e.__webglColorBuffer),$a.enableAttribute(h.color),Ea.vertexAttribPointer(h.color,3,Ea.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&Ea.vertexAttrib3fv(h.color,d.defaultAttributeValues.color)),h.normal>=0&&(Ea.bindBuffer(Ea.ARRAY_BUFFER,e.__webglNormalBuffer),$a.enableAttribute(h.normal),Ea.vertexAttribPointer(h.normal,3,Ea.FLOAT,!1,0,0)),h.tangent>=0&&(Ea.bindBuffer(Ea.ARRAY_BUFFER,e.__webglTangentBuffer),$a.enableAttribute(h.tangent),Ea.vertexAttribPointer(h.tangent,4,Ea.FLOAT,!1,0,0)),h.uv>=0&&(f.geometry.faceVertexUvs[0]?(Ea.bindBuffer(Ea.ARRAY_BUFFER,e.__webglUVBuffer),$a.enableAttribute(h.uv),Ea.vertexAttribPointer(h.uv,2,Ea.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&Ea.vertexAttrib2fv(h.uv,d.defaultAttributeValues.uv)),h.uv2>=0&&(f.geometry.faceVertexUvs[1]?(Ea.bindBuffer(Ea.ARRAY_BUFFER,e.__webglUV2Buffer),$a.enableAttribute(h.uv2),Ea.vertexAttribPointer(h.uv2,2,Ea.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&Ea.vertexAttrib2fv(h.uv2,d.defaultAttributeValues.uv2)),d.skinning&&h.skinIndex>=0&&h.skinWeight>=0&&(Ea.bindBuffer(Ea.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),$a.enableAttribute(h.skinIndex),Ea.vertexAttribPointer(h.skinIndex,4,Ea.FLOAT,!1,0,0),Ea.bindBuffer(Ea.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),$a.enableAttribute(h.skinWeight),Ea.vertexAttribPointer(h.skinWeight,4,Ea.FLOAT,!1,0,0)),h.lineDistance>=0&&(Ea.bindBuffer(Ea.ARRAY_BUFFER,e.__webglLineDistanceBuffer),$a.enableAttribute(h.lineDistance),Ea.vertexAttribPointer(h.lineDistance,1,Ea.FLOAT,!1,0,0))}if($a.disableUnusedAttributes(),f instanceof THREE.Mesh){var p=e.__typeArray===Uint32Array?Ea.UNSIGNED_INT:Ea.UNSIGNED_SHORT;d.wireframe?($a.setLineWidth(d.wireframeLinewidth*ma),i&&Ea.bindBuffer(Ea.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),Ea.drawElements(Ea.LINES,e.__webglLineCount,p,0)):(i&&Ea.bindBuffer(Ea.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),Ea.drawElements(Ea.TRIANGLES,e.__webglFaceCount,p,0)),Fa.info.render.calls++,Fa.info.render.vertices+=e.__webglFaceCount,Fa.info.render.faces+=e.__webglFaceCount/3}else if(f instanceof THREE.Line){var q=f.mode===THREE.LineStrip?Ea.LINE_STRIP:Ea.LINES;$a.setLineWidth(d.linewidth*ma),Ea.drawArrays(q,0,e.__webglLineCount),Fa.info.render.calls++}else f instanceof THREE.PointCloud&&(Ea.drawArrays(Ea.POINTS,0,e.__webglParticleCount),Fa.info.render.calls++,Fa.info.render.points+=e.__webglParticleCount)}},this.render=function(a,b,c,d){if(b instanceof THREE.Camera==!1)return void THREE.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");var e=a.fog;Ka="",Ja=-1,La=null,Xa=!0,!0===a.autoUpdate&&a.updateMatrixWorld(),void 0===b.parent&&b.updateMatrixWorld(),a.traverse(function(a){a instanceof THREE.SkinnedMesh&&a.skeleton.update()}),b.matrixWorldInverse.getInverse(b.matrixWorld),Ua.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse),Ta.setFromMatrix(Ua),xa.length=0,Aa.length=0,Ba.length=0,Ca.length=0,Da.length=0,s(a),!0===Fa.sortObjects&&(Aa.sort(p),Ba.sort(q)),qb.render(a,b),Fa.info.render.calls=0,Fa.info.render.vertices=0,Fa.info.render.faces=0,Fa.info.render.points=0,this.setRenderTarget(c),(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);for(var f=0,g=za.length;f<g;f++){var h=za[f],i=h.object;i.visible&&(X(i,b),v(h))}if(a.overrideMaterial){var j=a.overrideMaterial;I(j),t(Aa,b,xa,e,j),t(Ba,b,xa,e,j),u(za,"",b,xa,e,j)}else $a.setBlending(THREE.NoBlending),t(Aa,b,xa,e,null),u(za,"opaque",b,xa,e,null),t(Ba,b,xa,e,null),u(za,"transparent",b,xa,e,null);rb.render(a,b),sb.render(a,b,Ra,Sa),c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&ea(c),$a.setDepthTest(!0),$a.setDepthWrite(!0),$a.setColorWrite(!0)},this.renderImmediateObject=function(a,b,c,d,e){var f=J(a,b,c,d,e);Ka="",Fa.setMaterialFaces(d),e.immediateRenderCallback?e.immediateRenderCallback(f,Ea,Ta):e.render(function(a){Fa.renderBufferImmediate(a,f,d)})};var Db={},Eb=0,Fb={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};this.setFaceCulling=function(a,b){
  a===THREE.CullFaceNone?Ea.disable(Ea.CULL_FACE):(b===THREE.FrontFaceDirectionCW?Ea.frontFace(Ea.CW):Ea.frontFace(Ea.CCW),a===THREE.CullFaceBack?Ea.cullFace(Ea.BACK):a===THREE.CullFaceFront?Ea.cullFace(Ea.FRONT):Ea.cullFace(Ea.FRONT_AND_BACK),Ea.enable(Ea.CULL_FACE))},this.setMaterialFaces=function(a){$a.setDoubleSided(a.side===THREE.DoubleSide),$a.setFlipSided(a.side===THREE.BackSide)},this.uploadTexture=function(a){void 0===a.__webglInit&&(a.__webglInit=!0,a.addEventListener("dispose",vb),a.__webglTexture=Ea.createTexture(),Fa.info.memory.textures++),Ea.bindTexture(Ea.TEXTURE_2D,a.__webglTexture),Ea.pixelStorei(Ea.UNPACK_FLIP_Y_WEBGL,a.flipY),Ea.pixelStorei(Ea.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha),Ea.pixelStorei(Ea.UNPACK_ALIGNMENT,a.unpackAlignment),a.image=_(a.image,fb);var b=a.image,c=THREE.Math.isPowerOfTwo(b.width)&&THREE.Math.isPowerOfTwo(b.height),d=ga(a.format),e=ga(a.type);$(Ea.TEXTURE_2D,a,c);var f,g=a.mipmaps;if(a instanceof THREE.DataTexture)if(g.length>0&&c){for(var h=0,i=g.length;h<i;h++)f=g[h],Ea.texImage2D(Ea.TEXTURE_2D,h,d,f.width,f.height,0,d,e,f.data);a.generateMipmaps=!1}else Ea.texImage2D(Ea.TEXTURE_2D,0,d,b.width,b.height,0,d,e,b.data);else if(a instanceof THREE.CompressedTexture)for(var h=0,i=g.length;h<i;h++)f=g[h],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?nb().indexOf(d)>-1?Ea.compressedTexImage2D(Ea.TEXTURE_2D,h,d,f.width,f.height,0,f.data):THREE.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Ea.texImage2D(Ea.TEXTURE_2D,h,d,f.width,f.height,0,d,e,f.data);else if(g.length>0&&c){for(var h=0,i=g.length;h<i;h++)f=g[h],Ea.texImage2D(Ea.TEXTURE_2D,h,d,d,e,f);a.generateMipmaps=!1}else Ea.texImage2D(Ea.TEXTURE_2D,0,d,d,e,a.image);a.generateMipmaps&&c&&Ea.generateMipmap(Ea.TEXTURE_2D),a.needsUpdate=!1,a.onUpdate&&a.onUpdate()},this.setTexture=function(a,b){Ea.activeTexture(Ea.TEXTURE0+b),a.needsUpdate?Fa.uploadTexture(a):Ea.bindTexture(Ea.TEXTURE_2D,a.__webglTexture)},this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0),void 0===a.stencilBuffer&&(a.stencilBuffer=!0),a.addEventListener("dispose",wb),a.__webglTexture=Ea.createTexture(),Fa.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=ga(a.format),e=ga(a.type);if(b){a.__webglFramebuffer=[],a.__webglRenderbuffer=[],Ea.bindTexture(Ea.TEXTURE_CUBE_MAP,a.__webglTexture),$(Ea.TEXTURE_CUBE_MAP,a,c);for(var f=0;f<6;f++)a.__webglFramebuffer[f]=Ea.createFramebuffer(),a.__webglRenderbuffer[f]=Ea.createRenderbuffer(),Ea.texImage2D(Ea.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null),ca(a.__webglFramebuffer[f],a,Ea.TEXTURE_CUBE_MAP_POSITIVE_X+f),da(a.__webglRenderbuffer[f],a);c&&Ea.generateMipmap(Ea.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=Ea.createFramebuffer(),a.shareDepthFrom?a.__webglRenderbuffer=a.shareDepthFrom.__webglRenderbuffer:a.__webglRenderbuffer=Ea.createRenderbuffer(),Ea.bindTexture(Ea.TEXTURE_2D,a.__webglTexture),$(Ea.TEXTURE_2D,a,c),Ea.texImage2D(Ea.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),ca(a.__webglFramebuffer,a,Ea.TEXTURE_2D),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?Ea.framebufferRenderbuffer(Ea.FRAMEBUFFER,Ea.DEPTH_ATTACHMENT,Ea.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&Ea.framebufferRenderbuffer(Ea.FRAMEBUFFER,Ea.DEPTH_STENCIL_ATTACHMENT,Ea.RENDERBUFFER,a.__webglRenderbuffer):da(a.__webglRenderbuffer,a),c&&Ea.generateMipmap(Ea.TEXTURE_2D);b?Ea.bindTexture(Ea.TEXTURE_CUBE_MAP,null):Ea.bindTexture(Ea.TEXTURE_2D,null),Ea.bindRenderbuffer(Ea.RENDERBUFFER,null),Ea.bindFramebuffer(Ea.FRAMEBUFFER,null)}var g,h,i,j,k;a?(g=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,h=a.width,i=a.height,j=0,k=0):(g=null,h=Pa,i=Qa,j=Na,k=Oa),g!==Ia&&(Ea.bindFramebuffer(Ea.FRAMEBUFFER,g),Ea.viewport(j,k,h,i),Ia=g),Ra=h,Sa=i},this.readRenderTargetPixels=function(a,b,c,d,e,f){if(!(a instanceof THREE.WebGLRenderTarget))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");if(a.__webglFramebuffer){if(a.format!==THREE.RGBAFormat)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");var g=!1;a.__webglFramebuffer!==Ia&&(Ea.bindFramebuffer(Ea.FRAMEBUFFER,a.__webglFramebuffer),g=!0),Ea.checkFramebufferStatus(Ea.FRAMEBUFFER)===Ea.FRAMEBUFFER_COMPLETE?Ea.readPixels(b,c,d,e,Ea.RGBA,Ea.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."),g&&Ea.bindFramebuffer(Ea.FRAMEBUFFER,Ia)}},this.initMaterial=function(){THREE.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},this.addPrePlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},this.addPostPlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},this.updateShadowMap=function(){THREE.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}},THREE.WebGLRenderTarget=function(a,b,c){this.width=a,this.height=b,c=c||{},this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping,this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping,this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter,this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter,this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1,this.offset=new THREE.Vector2(0,0),this.repeat=new THREE.Vector2(1,1),this.format=void 0!==c.format?c.format:THREE.RGBAFormat,this.type=void 0!==c.type?c.type:THREE.UnsignedByteType,this.depthBuffer=void 0===c.depthBuffer||c.depthBuffer,this.stencilBuffer=void 0===c.stencilBuffer||c.stencilBuffer,this.generateMipmaps=!0,this.shareDepthFrom=void 0!==c.shareDepthFrom?c.shareDepthFrom:null},THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){this.width=a,this.height=b},clone:function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);return a.wrapS=this.wrapS,a.wrapT=this.wrapT,a.magFilter=this.magFilter,a.minFilter=this.minFilter,a.anisotropy=this.anisotropy,a.offset.copy(this.offset),a.repeat.copy(this.repeat),a.format=this.format,a.type=this.type,a.depthBuffer=this.depthBuffer,a.stencilBuffer=this.stencilBuffer,a.generateMipmaps=this.generateMipmaps,a.shareDepthFrom=this.shareDepthFrom,a},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype),THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c),this.activeCubeFace=0},THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype),THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube,THREE.WebGLExtensions=function(a){var b={};this.get=function(c){if(void 0!==b[c])return b[c];var d;switch(c){case"EXT_texture_filter_anisotropic":d=a.getExtension("EXT_texture_filter_anisotropic")||a.getExtension("MOZ_EXT_texture_filter_anisotropic")||a.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)}return null===d&&THREE.warn("THREE.WebGLRenderer: "+c+" extension not supported."),b[c]=d,d}},THREE.WebGLProgram=function(){var a=0,b=function(a){var b,c,d=[];for(var e in a)!1!==(b=a[e])&&(c="#define "+e+" "+b,d.push(c));return d.join("\n")},c=function(a,b,c){for(var d={},e=0,f=c.length;e<f;e++){var g=c[e];d[g]=a.getUniformLocation(b,g)}return d},d=function(a,b,c){for(var d={},e=0,f=c.length;e<f;e++){var g=c[e];d[g]=a.getAttribLocation(b,g)}return d};return function(e,f,g,h){var i=e,j=i.context,k=g.defines,l=g.__webglShader.uniforms,m=g.attributes,n=g.__webglShader.vertexShader,o=g.__webglShader.fragmentShader,p=g.index0AttributeName;void 0===p&&!0===h.morphTargets&&(p="position");var q="SHADOWMAP_TYPE_BASIC";h.shadowMapType===THREE.PCFShadowMap?q="SHADOWMAP_TYPE_PCF":h.shadowMapType===THREE.PCFSoftShadowMap&&(q="SHADOWMAP_TYPE_PCF_SOFT");var r="ENVMAP_TYPE_CUBE",s="ENVMAP_MODE_REFLECTION",t="ENVMAP_BLENDING_MULTIPLY";if(h.envMap){switch(g.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:r="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:r="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:r="ENVMAP_TYPE_SPHERE"}switch(g.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:s="ENVMAP_MODE_REFRACTION"}switch(g.combine){case THREE.MultiplyOperation:t="ENVMAP_BLENDING_MULTIPLY";break;case THREE.MixOperation:t="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:t="ENVMAP_BLENDING_ADD"}}var u,v,w=e.gammaFactor>0?e.gammaFactor:1,x=b(k),y=j.createProgram();g instanceof THREE.RawShaderMaterial?(u="",v=""):(u=["precision "+h.precision+" float;","precision "+h.precision+" int;",x,h.supportsVertexTextures?"#define VERTEX_TEXTURES":"",i.gammaInput?"#define GAMMA_INPUT":"",i.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+w,"#define MAX_DIR_LIGHTS "+h.maxDirLights,"#define MAX_POINT_LIGHTS "+h.maxPointLights,"#define MAX_SPOT_LIGHTS "+h.maxSpotLights,"#define MAX_HEMI_LIGHTS "+h.maxHemiLights,"#define MAX_SHADOWS "+h.maxShadows,"#define MAX_BONES "+h.maxBones,h.map?"#define USE_MAP":"",h.envMap?"#define USE_ENVMAP":"",h.envMap?"#define "+s:"",h.lightMap?"#define USE_LIGHTMAP":"",h.bumpMap?"#define USE_BUMPMAP":"",h.normalMap?"#define USE_NORMALMAP":"",h.specularMap?"#define USE_SPECULARMAP":"",h.alphaMap?"#define USE_ALPHAMAP":"",h.vertexColors?"#define USE_COLOR":"",h.flatShading?"#define FLAT_SHADED":"",h.skinning?"#define USE_SKINNING":"",h.useVertexTexture?"#define BONE_TEXTURE":"",h.morphTargets?"#define USE_MORPHTARGETS":"",h.morphNormals?"#define USE_MORPHNORMALS":"",h.wrapAround?"#define WRAP_AROUND":"",h.doubleSided?"#define DOUBLE_SIDED":"",h.flipSided?"#define FLIP_SIDED":"",h.shadowMapEnabled?"#define USE_SHADOWMAP":"",h.shadowMapEnabled?"#define "+q:"",h.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",h.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",h.sizeAttenuation?"#define USE_SIZEATTENUATION":"",h.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","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;","attribute vec2 uv2;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif",""].join("\n"),v=["precision "+h.precision+" float;","precision "+h.precision+" int;",h.bumpMap||h.normalMap||h.flatShading?"#extension GL_OES_standard_derivatives : enable":"",x,"#define MAX_DIR_LIGHTS "+h.maxDirLights,"#define MAX_POINT_LIGHTS "+h.maxPointLights,"#define MAX_SPOT_LIGHTS "+h.maxSpotLights,"#define MAX_HEMI_LIGHTS "+h.maxHemiLights,"#define MAX_SHADOWS "+h.maxShadows,h.alphaTest?"#define ALPHATEST "+h.alphaTest:"",i.gammaInput?"#define GAMMA_INPUT":"",i.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+w,h.useFog&&h.fog?"#define USE_FOG":"",h.useFog&&h.fogExp?"#define FOG_EXP2":"",h.map?"#define USE_MAP":"",h.envMap?"#define USE_ENVMAP":"",h.envMap?"#define "+r:"",h.envMap?"#define "+s:"",h.envMap?"#define "+t:"",h.lightMap?"#define USE_LIGHTMAP":"",h.bumpMap?"#define USE_BUMPMAP":"",h.normalMap?"#define USE_NORMALMAP":"",h.specularMap?"#define USE_SPECULARMAP":"",h.alphaMap?"#define USE_ALPHAMAP":"",h.vertexColors?"#define USE_COLOR":"",h.flatShading?"#define FLAT_SHADED":"",h.metal?"#define METAL":"",h.wrapAround?"#define WRAP_AROUND":"",h.doubleSided?"#define DOUBLE_SIDED":"",h.flipSided?"#define FLIP_SIDED":"",h.shadowMapEnabled?"#define USE_SHADOWMAP":"",h.shadowMapEnabled?"#define "+q:"",h.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",h.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",h.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",""].join("\n"));var z=new THREE.WebGLShader(j,j.VERTEX_SHADER,u+n),A=new THREE.WebGLShader(j,j.FRAGMENT_SHADER,v+o);j.attachShader(y,z),j.attachShader(y,A),void 0!==p&&j.bindAttribLocation(y,0,p),j.linkProgram(y);var B=j.getProgramInfoLog(y);!1===j.getProgramParameter(y,j.LINK_STATUS)&&THREE.error("THREE.WebGLProgram: shader error: "+j.getError(),"gl.VALIDATE_STATUS",j.getProgramParameter(y,j.VALIDATE_STATUS),"gl.getPRogramInfoLog",B),""!==B&&THREE.warn("THREE.WebGLProgram: gl.getProgramInfoLog()"+B),j.deleteShader(z),j.deleteShader(A);var C=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","modelMatrix","cameraPosition","morphTargetInfluences","bindMatrix","bindMatrixInverse"];h.useVertexTexture?(C.push("boneTexture"),C.push("boneTextureWidth"),C.push("boneTextureHeight")):C.push("boneGlobalMatrices"),h.logarithmicDepthBuffer&&C.push("logDepthBufFC");for(var D in l)C.push(D);this.uniforms=c(j,y,C),C=["position","normal","uv","uv2","tangent","color","skinIndex","skinWeight","lineDistance"];for(var E=0;E<h.maxMorphTargets;E++)C.push("morphTarget"+E);for(var E=0;E<h.maxMorphNormals;E++)C.push("morphNormal"+E);for(var F in m)C.push(F);return this.attributes=d(j,y,C),this.attributesKeys=Object.keys(this.attributes),this.id=a++,this.code=f,this.usedTimes=1,this.program=y,this.vertexShader=z,this.fragmentShader=A,this}}(),THREE.WebGLShader=function(){var a=function(a){for(var b=a.split("\n"),c=0;c<b.length;c++)b[c]=c+1+": "+b[c];return b.join("\n")};return function(b,c,d){var e=b.createShader(c);return b.shaderSource(e,d),b.compileShader(e),!1===b.getShaderParameter(e,b.COMPILE_STATUS)&&THREE.error("THREE.WebGLShader: Shader couldn't compile."),""!==b.getShaderInfoLog(e)&&THREE.warn("THREE.WebGLShader: gl.getShaderInfoLog()",b.getShaderInfoLog(e),a(d)),e}}(),THREE.WebGLState=function(a,b){var c=new Uint8Array(16),d=new Uint8Array(16),e=null,f=null,g=null,h=null,i=null,j=null,k=null,l=null,m=null,n=null,o=null,p=null,q=null,r=null,s=null,t=null;this.initAttributes=function(){for(var a=0,b=c.length;a<b;a++)c[a]=0},this.enableAttribute=function(b){c[b]=1,0===d[b]&&(a.enableVertexAttribArray(b),d[b]=1)},this.disableUnusedAttributes=function(){for(var b=0,e=d.length;b<e;b++)d[b]!==c[b]&&(a.disableVertexAttribArray(b),d[b]=0)},this.setBlending=function(c,d,l,m,n,o,p){c!==e&&(c===THREE.NoBlending?a.disable(a.BLEND):c===THREE.AdditiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):c===THREE.SubtractiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):c===THREE.MultiplyBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):c===THREE.CustomBlending?a.enable(a.BLEND):(a.enable(a.BLEND),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)),e=c),c===THREE.CustomBlending?(n=n||d,o=o||l,p=p||m,d===f&&n===i||(a.blendEquationSeparate(b(d),b(n)),f=d,i=n),l===g&&m===h&&o===j&&p===k||(a.blendFuncSeparate(b(l),b(m),b(o),b(p)),g=l,h=m,j=o,k=p)):(f=null,g=null,h=null,i=null,j=null,k=null)},this.setDepthTest=function(b){l!==b&&(b?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST),l=b)},this.setDepthWrite=function(b){m!==b&&(a.depthMask(b),m=b)},this.setColorWrite=function(b){n!==b&&(a.colorMask(b,b,b,b),n=b)},this.setDoubleSided=function(b){o!==b&&(b?a.disable(a.CULL_FACE):a.enable(a.CULL_FACE),o=b)},this.setFlipSided=function(b){p!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),p=b)},this.setLineWidth=function(b){b!==q&&(a.lineWidth(b),q=b)},this.setPolygonOffset=function(b,c,d){r!==b&&(b?a.enable(a.POLYGON_OFFSET_FILL):a.disable(a.POLYGON_OFFSET_FILL),r=b),!b||s===c&&t===d||(a.polygonOffset(c,d),s=c,t=d)},this.reset=function(){for(var a=0;a<d.length;a++)d[a]=0;e=null,l=null,m=null,n=null,o=null,p=null}},THREE.LensFlarePlugin=function(a,b){function c(b){var c=l.createProgram(),d=l.createShader(l.FRAGMENT_SHADER),e=l.createShader(l.VERTEX_SHADER),f="precision "+a.getPrecision()+" float;\n";return l.shaderSource(d,f+b.fragmentShader),l.shaderSource(e,f+b.vertexShader),l.compileShader(d),l.compileShader(e),l.attachShader(c,d),l.attachShader(c,e),l.linkProgram(c),c}var d,e,f,g,h,i,j,k,l=a.context,m=function(){var a=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),b=new Uint16Array([0,1,2,0,2,3]);d=l.createBuffer(),e=l.createBuffer(),l.bindBuffer(l.ARRAY_BUFFER,d),l.bufferData(l.ARRAY_BUFFER,a,l.STATIC_DRAW),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e),l.bufferData(l.ELEMENT_ARRAY_BUFFER,b,l.STATIC_DRAW),j=l.createTexture(),k=l.createTexture(),l.bindTexture(l.TEXTURE_2D,j),l.texImage2D(l.TEXTURE_2D,0,l.RGB,16,16,0,l.RGB,l.UNSIGNED_BYTE,null),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST),l.bindTexture(l.TEXTURE_2D,k),l.texImage2D(l.TEXTURE_2D,0,l.RGBA,16,16,0,l.RGBA,l.UNSIGNED_BYTE,null),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST),i=l.getParameter(l.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;var m;m=i?{vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","uniform sampler2D occlusionMap;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float vVisibility;","void main() {","vUV = uv;","vec2 pos = position;","if( renderType == 2 ) {","vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );","vVisibility =        visibility.r / 9.0;","vVisibility *= 1.0 - visibility.g / 9.0;","vVisibility *=       visibility.b / 9.0;","vVisibility *= 1.0 - visibility.a / 9.0;","pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","}","gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );","}"].join("\n"),fragmentShader:["uniform lowp int renderType;","uniform sampler2D map;","uniform float opacity;","uniform vec3 color;","varying vec2 vUV;","varying float vVisibility;","void main() {","if( renderType == 0 ) {","gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );","} else if( renderType == 1 ) {","gl_FragColor = texture2D( map, vUV );","} else {","vec4 texture = texture2D( map, vUV );","texture.a *= opacity * vVisibility;","gl_FragColor = texture;","gl_FragColor.rgb *= color;","}","}"].join("\n")}:{vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uv;","vec2 pos = position;","if( renderType == 2 ) {","pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","}","gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );","}"].join("\n"),fragmentShader:["precision mediump float;","uniform lowp int renderType;","uniform sampler2D map;","uniform sampler2D occlusionMap;","uniform float opacity;","uniform vec3 color;","varying vec2 vUV;","void main() {","if( renderType == 0 ) {","gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );","} else if( renderType == 1 ) {","gl_FragColor = texture2D( map, vUV );","} else {","float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;","visibility = ( 1.0 - visibility / 4.0 );","vec4 texture = texture2D( map, vUV );","texture.a *= opacity * visibility;","gl_FragColor = texture;","gl_FragColor.rgb *= color;","}","}"].join("\n")},f=c(m),g={vertex:l.getAttribLocation(f,"position"),uv:l.getAttribLocation(f,"uv")},h={renderType:l.getUniformLocation(f,"renderType"),map:l.getUniformLocation(f,"map"),occlusionMap:l.getUniformLocation(f,"occlusionMap"),opacity:l.getUniformLocation(f,"opacity"),color:l.getUniformLocation(f,"color"),scale:l.getUniformLocation(f,"scale"),rotation:l.getUniformLocation(f,"rotation"),screenPosition:l.getUniformLocation(f,"screenPosition")}};this.render=function(c,n,o,p){if(0!==b.length){var q=new THREE.Vector3,r=p/o,s=.5*o,t=.5*p,u=16/p,v=new THREE.Vector2(u*r,u),w=new THREE.Vector3(1,1,0),x=new THREE.Vector2(1,1);void 0===f&&m(),l.useProgram(f),l.enableVertexAttribArray(g.vertex),l.enableVertexAttribArray(g.uv),l.uniform1i(h.occlusionMap,0),l.uniform1i(h.map,1),l.bindBuffer(l.ARRAY_BUFFER,d),l.vertexAttribPointer(g.vertex,2,l.FLOAT,!1,16,0),l.vertexAttribPointer(g.uv,2,l.FLOAT,!1,16,8),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e),l.disable(l.CULL_FACE),l.depthMask(!1);for(var y=0,z=b.length;y<z;y++){u=16/p,v.set(u*r,u);var A=b[y];if(q.set(A.matrixWorld.elements[12],A.matrixWorld.elements[13],A.matrixWorld.elements[14]),q.applyMatrix4(n.matrixWorldInverse),q.applyProjection(n.projectionMatrix),w.copy(q),x.x=w.x*s+s,x.y=w.y*t+t,i||x.x>0&&x.x<o&&x.y>0&&x.y<p){l.activeTexture(l.TEXTURE1),l.bindTexture(l.TEXTURE_2D,j),l.copyTexImage2D(l.TEXTURE_2D,0,l.RGB,x.x-8,x.y-8,16,16,0),l.uniform1i(h.renderType,0),l.uniform2f(h.scale,v.x,v.y),l.uniform3f(h.screenPosition,w.x,w.y,w.z),l.disable(l.BLEND),l.enable(l.DEPTH_TEST),l.drawElements(l.TRIANGLES,6,l.UNSIGNED_SHORT,0),l.activeTexture(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,k),l.copyTexImage2D(l.TEXTURE_2D,0,l.RGBA,x.x-8,x.y-8,16,16,0),l.uniform1i(h.renderType,1),l.disable(l.DEPTH_TEST),l.activeTexture(l.TEXTURE1),l.bindTexture(l.TEXTURE_2D,j),l.drawElements(l.TRIANGLES,6,l.UNSIGNED_SHORT,0),A.positionScreen.copy(w),A.customUpdateCallback?A.customUpdateCallback(A):A.updateLensFlares(),l.uniform1i(h.renderType,2),l.enable(l.BLEND);for(var B=0,C=A.lensFlares.length;B<C;B++){var D=A.lensFlares[B];D.opacity>.001&&D.scale>.001&&(w.x=D.x,w.y=D.y,w.z=D.z,u=D.size*D.scale/p,v.x=u*r,v.y=u,l.uniform3f(h.screenPosition,w.x,w.y,w.z),l.uniform2f(h.scale,v.x,v.y),l.uniform1f(h.rotation,D.rotation),l.uniform1f(h.opacity,D.opacity),l.uniform3f(h.color,D.color.r,D.color.g,D.color.b),a.state.setBlending(D.blending,D.blendEquation,D.blendSrc,D.blendDst),a.setTexture(D.texture,1),l.drawElements(l.TRIANGLES,6,l.UNSIGNED_SHORT,0))}}}l.enable(l.CULL_FACE),l.enable(l.DEPTH_TEST),l.depthMask(!0),a.resetGLState()}}},THREE.ShadowMapPlugin=function(a,b,c,d){function e(a,b,d){if(b.visible){var f=c[b.id];if(f&&b.castShadow&&(!1===b.frustumCulled||!0===o.intersectsObject(b)))for(var g=0,h=f.length;g<h;g++){var i=f[g];b._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,b.matrixWorld),t.push(i)}for(var g=0,h=b.children.length;g<h;g++)e(a,b.children[g],d)}}function f(a,b){var c=new THREE.DirectionalLight;c.isVirtual=!0,c.onlyShadow=!0,c.castShadow=!0,c.shadowCameraNear=a.shadowCameraNear,c.shadowCameraFar=a.shadowCameraFar,c.shadowCameraLeft=a.shadowCameraLeft,c.shadowCameraRight=a.shadowCameraRight,c.shadowCameraBottom=a.shadowCameraBottom,c.shadowCameraTop=a.shadowCameraTop,c.shadowCameraVisible=a.shadowCameraVisible,c.shadowDarkness=a.shadowDarkness,c.shadowBias=a.shadowCascadeBias[b],c.shadowMapWidth=a.shadowCascadeWidth[b],c.shadowMapHeight=a.shadowCascadeHeight[b],c.pointsWorld=[],c.pointsFrustum=[];for(var d=c.pointsWorld,e=c.pointsFrustum,f=0;f<8;f++)d[f]=new THREE.Vector3,e[f]=new THREE.Vector3;var g=a.shadowCascadeNearZ[b],h=a.shadowCascadeFarZ[b];return e[0].set(-1,-1,g),e[1].set(1,-1,g),e[2].set(-1,1,g),e[3].set(1,1,g),e[4].set(-1,-1,h),e[5].set(1,-1,h),e[6].set(-1,1,h),e[7].set(1,1,h),c}function g(a,b){var c=a.shadowCascadeArray[b];c.position.copy(a.position),c.target.position.copy(a.target.position),c.lookAt(c.target),c.shadowCameraVisible=a.shadowCameraVisible,c.shadowDarkness=a.shadowDarkness,c.shadowBias=a.shadowCascadeBias[b];var d=a.shadowCascadeNearZ[b],e=a.shadowCascadeFarZ[b],f=c.pointsFrustum;f[0].z=d,f[1].z=d,f[2].z=d,f[3].z=d,f[4].z=e,f[5].z=e,f[6].z=e,f[7].z=e}function h(a,b){var c=b.shadowCamera,d=b.pointsFrustum,e=b.pointsWorld;q.set(1/0,1/0,1/0),r.set(-1/0,-1/0,-1/0);for(var f=0;f<8;f++){var g=e[f];g.copy(d[f]),g.unproject(a),g.applyMatrix4(c.matrixWorldInverse),g.x<q.x&&(q.x=g.x),g.x>r.x&&(r.x=g.x),g.y<q.y&&(q.y=g.y),g.y>r.y&&(r.y=g.y),g.z<q.z&&(q.z=g.z),g.z>r.z&&(r.z=g.z)}c.left=q.x,c.right=r.x,c.top=r.y,c.bottom=q.y,c.updateProjectionMatrix()}function i(a){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[0]:a.material}var j,k,l,m,n=a.context,o=new THREE.Frustum,p=new THREE.Matrix4,q=new THREE.Vector3,r=new THREE.Vector3,s=new THREE.Vector3,t=[],u=THREE.ShaderLib.depthRGBA,v=THREE.UniformsUtils.clone(u.uniforms);j=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader}),k=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,morphTargets:!0}),l=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,skinning:!0}),m=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,morphTargets:!0,skinning:!0}),j._shadowPass=!0,k._shadowPass=!0,l._shadowPass=!0,m._shadowPass=!0,this.render=function(c,q){if(!1!==a.shadowMapEnabled){var r,u,v,w,x,y,z,A,B,C,D,E,F,G=[],H=0,I=null;for(n.clearColor(1,1,1,1),n.disable(n.BLEND),n.enable(n.CULL_FACE),n.frontFace(n.CCW),a.shadowMapCullFace===THREE.CullFaceFront?n.cullFace(n.FRONT):n.cullFace(n.BACK),a.state.setDepthTest(!0),r=0,u=b.length;r<u;r++)if(F=b[r],F.castShadow)if(F instanceof THREE.DirectionalLight&&F.shadowCascade)for(x=0;x<F.shadowCascadeCount;x++){var J;if(F.shadowCascadeArray[x])J=F.shadowCascadeArray[x];else{J=f(F,x),J.originalCamera=q;var K=new THREE.Gyroscope;K.position.copy(F.shadowCascadeOffset),K.add(J),K.add(J.target),q.add(K),F.shadowCascadeArray[x]=J}g(F,x),G[H]=J,H++}else G[H]=F,H++;for(r=0,u=G.length;r<u;r++){if(F=G[r],!F.shadowMap){var L=THREE.LinearFilter;a.shadowMapType===THREE.PCFSoftShadowMap&&(L=THREE.NearestFilter);var M={minFilter:L,magFilter:L,format:THREE.RGBAFormat};F.shadowMap=new THREE.WebGLRenderTarget(F.shadowMapWidth,F.shadowMapHeight,M),F.shadowMapSize=new THREE.Vector2(F.shadowMapWidth,F.shadowMapHeight),F.shadowMatrix=new THREE.Matrix4}if(!F.shadowCamera){if(F instanceof THREE.SpotLight)F.shadowCamera=new THREE.PerspectiveCamera(F.shadowCameraFov,F.shadowMapWidth/F.shadowMapHeight,F.shadowCameraNear,F.shadowCameraFar);else{if(!(F instanceof THREE.DirectionalLight)){THREE.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",F);continue}F.shadowCamera=new THREE.OrthographicCamera(F.shadowCameraLeft,F.shadowCameraRight,F.shadowCameraTop,F.shadowCameraBottom,F.shadowCameraNear,F.shadowCameraFar)}c.add(F.shadowCamera),!0===c.autoUpdate&&c.updateMatrixWorld()}F.shadowCameraVisible&&!F.cameraHelper&&(F.cameraHelper=new THREE.CameraHelper(F.shadowCamera),c.add(F.cameraHelper)),F.isVirtual&&J.originalCamera==q&&h(q,F),y=F.shadowMap,z=F.shadowMatrix,A=F.shadowCamera,A.position.setFromMatrixPosition(F.matrixWorld),s.setFromMatrixPosition(F.target.matrixWorld),A.lookAt(s),A.updateMatrixWorld(),A.matrixWorldInverse.getInverse(A.matrixWorld),F.cameraHelper&&(F.cameraHelper.visible=F.shadowCameraVisible),F.shadowCameraVisible&&F.cameraHelper.update(),z.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),z.multiply(A.projectionMatrix),z.multiply(A.matrixWorldInverse),p.multiplyMatrices(A.projectionMatrix,A.matrixWorldInverse),o.setFromMatrix(p),a.setRenderTarget(y),a.clear(),t.length=0,e(c,c,A);var N,O,P;for(v=0,w=t.length;v<w;v++)D=t[v],E=D.object,B=D.buffer,N=i(E),O=void 0!==E.geometry.morphTargets&&E.geometry.morphTargets.length>0&&N.morphTargets,P=E instanceof THREE.SkinnedMesh&&N.skinning,C=E.customDepthMaterial?E.customDepthMaterial:P?O?m:l:O?k:j,a.setMaterialFaces(N),B instanceof THREE.BufferGeometry?a.renderBufferDirect(A,b,I,C,B,E):a.renderBuffer(A,b,I,C,B,E);for(v=0,w=d.length;v<w;v++)D=d[v],E=D.object,E.visible&&E.castShadow&&(E._modelViewMatrix.multiplyMatrices(A.matrixWorldInverse,E.matrixWorld),a.renderImmediateObject(A,b,I,j,E))}var Q=a.getClearColor(),R=a.getClearAlpha();n.clearColor(Q.r,Q.g,Q.b,R),n.enable(n.BLEND),a.shadowMapCullFace===THREE.CullFaceFront&&n.cullFace(n.BACK),a.resetGLState()}}},THREE.SpritePlugin=function(a,b){function c(){var b=k.createProgram(),c=k.createShader(k.VERTEX_SHADER),d=k.createShader(k.FRAGMENT_SHADER);return k.shaderSource(c,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uvOffset + uv * uvScale;","vec2 alignedPosition = position * scale;","vec2 rotatedPosition;","rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","vec4 finalPosition;","finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","finalPosition.xy += rotatedPosition;","finalPosition = projectionMatrix * finalPosition;","gl_Position = finalPosition;","}"].join("\n")),k.shaderSource(d,["precision "+a.getPrecision()+" float;","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","void main() {","vec4 texture = texture2D( map, vUV );","if ( texture.a < alphaTest ) discard;","gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","if ( fogType > 0 ) {","float depth = gl_FragCoord.z / gl_FragCoord.w;","float fogFactor = 0.0;","if ( fogType == 1 ) {","fogFactor = smoothstep( fogNear, fogFar, depth );","} else {","const float LOG2 = 1.442695;","float fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );","fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","}","gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}","}"].join("\n")),k.compileShader(c),k.compileShader(d),k.attachShader(b,c),k.attachShader(b,d),k.linkProgram(b),b}
  function d(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var e,f,g,h,i,j,k=a.context,l=new THREE.Vector3,m=new THREE.Quaternion,n=new THREE.Vector3,o=function(){var a=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),b=new Uint16Array([0,1,2,0,2,3]);e=k.createBuffer(),f=k.createBuffer(),k.bindBuffer(k.ARRAY_BUFFER,e),k.bufferData(k.ARRAY_BUFFER,a,k.STATIC_DRAW),k.bindBuffer(k.ELEMENT_ARRAY_BUFFER,f),k.bufferData(k.ELEMENT_ARRAY_BUFFER,b,k.STATIC_DRAW),g=c(),h={position:k.getAttribLocation(g,"position"),uv:k.getAttribLocation(g,"uv")},i={uvOffset:k.getUniformLocation(g,"uvOffset"),uvScale:k.getUniformLocation(g,"uvScale"),rotation:k.getUniformLocation(g,"rotation"),scale:k.getUniformLocation(g,"scale"),color:k.getUniformLocation(g,"color"),map:k.getUniformLocation(g,"map"),opacity:k.getUniformLocation(g,"opacity"),modelViewMatrix:k.getUniformLocation(g,"modelViewMatrix"),projectionMatrix:k.getUniformLocation(g,"projectionMatrix"),fogType:k.getUniformLocation(g,"fogType"),fogDensity:k.getUniformLocation(g,"fogDensity"),fogNear:k.getUniformLocation(g,"fogNear"),fogFar:k.getUniformLocation(g,"fogFar"),fogColor:k.getUniformLocation(g,"fogColor"),alphaTest:k.getUniformLocation(g,"alphaTest")};var d=document.createElement("canvas");d.width=8,d.height=8;var l=d.getContext("2d");l.fillStyle="white",l.fillRect(0,0,8,8),j=new THREE.Texture(d),j.needsUpdate=!0};this.render=function(c,p){if(0!==b.length){void 0===g&&o(),k.useProgram(g),k.enableVertexAttribArray(h.position),k.enableVertexAttribArray(h.uv),k.disable(k.CULL_FACE),k.enable(k.BLEND),k.bindBuffer(k.ARRAY_BUFFER,e),k.vertexAttribPointer(h.position,2,k.FLOAT,!1,16,0),k.vertexAttribPointer(h.uv,2,k.FLOAT,!1,16,8),k.bindBuffer(k.ELEMENT_ARRAY_BUFFER,f),k.uniformMatrix4fv(i.projectionMatrix,!1,p.projectionMatrix.elements),k.activeTexture(k.TEXTURE0),k.uniform1i(i.map,0);var q=0,r=0,s=c.fog;s?(k.uniform3f(i.fogColor,s.color.r,s.color.g,s.color.b),s instanceof THREE.Fog?(k.uniform1f(i.fogNear,s.near),k.uniform1f(i.fogFar,s.far),k.uniform1i(i.fogType,1),q=1,r=1):s instanceof THREE.FogExp2&&(k.uniform1f(i.fogDensity,s.density),k.uniform1i(i.fogType,2),q=2,r=2)):(k.uniform1i(i.fogType,0),q=0,r=0);for(var t=0,u=b.length;t<u;t++){var v=b[t];v._modelViewMatrix.multiplyMatrices(p.matrixWorldInverse,v.matrixWorld),v.z=-v._modelViewMatrix.elements[14]}b.sort(d);for(var w=[],t=0,u=b.length;t<u;t++){var v=b[t],x=v.material;k.uniform1f(i.alphaTest,x.alphaTest),k.uniformMatrix4fv(i.modelViewMatrix,!1,v._modelViewMatrix.elements),v.matrixWorld.decompose(l,m,n),w[0]=n.x,w[1]=n.y;var y=0;c.fog&&x.fog&&(y=r),q!==y&&(k.uniform1i(i.fogType,y),q=y),null!==x.map?(k.uniform2f(i.uvOffset,x.map.offset.x,x.map.offset.y),k.uniform2f(i.uvScale,x.map.repeat.x,x.map.repeat.y)):(k.uniform2f(i.uvOffset,0,0),k.uniform2f(i.uvScale,1,1)),k.uniform1f(i.opacity,x.opacity),k.uniform3f(i.color,x.color.r,x.color.g,x.color.b),k.uniform1f(i.rotation,x.rotation),k.uniform2fv(i.scale,w),a.state.setBlending(x.blending,x.blendEquation,x.blendSrc,x.blendDst),a.state.setDepthTest(x.depthTest),a.state.setDepthWrite(x.depthWrite),x.map&&x.map.image&&x.map.image.width?a.setTexture(x.map,0):a.setTexture(j,0),k.drawElements(k.TRIANGLES,6,k.UNSIGNED_SHORT,0)}k.enable(k.CULL_FACE),a.resetGLState()}}},THREE.GeometryUtils={merge:function(a,b,c){THREE.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var d;b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry),a.merge(b,d,c)},center:function(a){return THREE.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),a.center()}},THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.Texture(void 0,b);return e.load(a,function(a){f.image=a,f.needsUpdate=!0,c&&c(f)},void 0,function(a){d&&d(a)}),f.sourceFile=a,f},loadTextureCube:function(a,b,c,d){var e=[],f=new THREE.ImageLoader;f.crossOrigin=this.crossOrigin;var g=new THREE.CubeTexture(e,b);g.flipY=!1;for(var h=0,i=function(b){f.load(a[b],function(a){g.images[b]=a,6===(h+=1)&&(g.needsUpdate=!0,c&&c(g))},void 0,d)},j=0,k=a.length;j<k;++j)i(j);return g},loadCompressedTexture:function(){THREE.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){THREE.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(a,b){var c=function(a,b){return[a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]]},d=function(a,b){return[a[0]-b[0],a[1]-b[1],a[2]-b[2]]},e=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;var f=a.width,g=a.height,h=document.createElement("canvas");h.width=f,h.height=g;var i=h.getContext("2d");i.drawImage(a,0,0);for(var j=i.getImageData(0,0,f,g).data,k=i.createImageData(f,g),l=k.data,m=0;m<f;m++)for(var n=0;n<g;n++){var o=n-1<0?0:n-1,p=n+1>g-1?g-1:n+1,q=m-1<0?0:m-1,r=m+1>f-1?f-1:m+1,s=[],t=[0,0,j[4*(n*f+m)]/255*b];s.push([-1,0,j[4*(n*f+q)]/255*b]),s.push([-1,-1,j[4*(o*f+q)]/255*b]),s.push([0,-1,j[4*(o*f+m)]/255*b]),s.push([1,-1,j[4*(o*f+r)]/255*b]),s.push([1,0,j[4*(n*f+r)]/255*b]),s.push([1,1,j[4*(p*f+r)]/255*b]),s.push([0,1,j[4*(p*f+m)]/255*b]),s.push([-1,1,j[4*(p*f+q)]/255*b]);for(var u=[],v=s.length,w=0;w<v;w++){var x=s[w],y=s[(w+1)%v];x=d(x,t),y=d(y,t),u.push(e(c(x,y)))}for(var z=[0,0,0],w=0;w<u.length;w++)z[0]+=u[w][0],z[1]+=u[w][1],z[2]+=u[w][2];z[0]/=u.length,z[1]/=u.length,z[2]/=u.length;var A=4*(n*f+m);l[A]=(z[0]+1)/2*255|0,l[A+1]=(z[1]+1)/2*255|0,l[A+2]=255*z[2]|0,l[A+3]=255}return i.putImageData(k,0,0),h},generateDataTexture:function(a,b,c){for(var d=a*b,e=new Uint8Array(3*d),f=Math.floor(255*c.r),g=Math.floor(255*c.g),h=Math.floor(255*c.b),i=0;i<d;i++)e[3*i]=f,e[3*i+1]=g,e[3*i+2]=h;var j=new THREE.DataTexture(e,a,b,THREE.RGBFormat);return j.needsUpdate=!0,j}},THREE.SceneUtils={createMultiMaterialObject:function(a,b){for(var c=new THREE.Object3D,d=0,e=b.length;d<e;d++)c.add(new THREE.Mesh(a,b[d]));return c},detach:function(a,b,c){a.applyMatrix(b.matrixWorld),b.remove(a),c.add(a)},attach:function(a,b,c){var d=new THREE.Matrix4;d.getInverse(c.matrixWorld),a.applyMatrix(d),b.remove(a),c.add(a)}},THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){try{return this.faces[this.face][this.weight][this.style]}catch(a){throw"The font "+this.face+" with "+this.weight+" weight and "+this.style+" style is missing."}},loadFace:function(a){var b=a.familyName.toLowerCase(),c=this;return c.faces[b]=c.faces[b]||{},c.faces[b][a.cssFontWeight]=c.faces[b][a.cssFontWeight]||{},c.faces[b][a.cssFontWeight][a.cssFontStyle]=a,c.faces[b][a.cssFontWeight][a.cssFontStyle]=a,a},drawText:function(a){var b,c=this.getFace(),d=this.size/c.resolution,e=0,f=String(a).split(""),g=f.length,h=[];for(b=0;b<g;b++){var i=new THREE.Path,j=this.extractGlyphPoints(f[b],c,d,e,i);e+=j.offset,h.push(j.path)}return{paths:h,offset:e/2}},extractGlyphPoints:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x=[],y=b.glyphs[a]||b.glyphs["?"];if(y){if(y.o)for(i=y._cachedOutline||(y._cachedOutline=y.o.split(" ")),j=i.length,k=c,l=c,f=0;f<j;)switch(i[f++]){case"m":m=i[f++]*k+d,n=i[f++]*l,e.moveTo(m,n);break;case"l":m=i[f++]*k+d,n=i[f++]*l,e.lineTo(m,n);break;case"q":if(o=i[f++]*k+d,p=i[f++]*l,s=i[f++]*k+d,t=i[f++]*l,e.quadraticCurveTo(s,t,o,p),w=x[x.length-1])for(q=w.x,r=w.y,g=1,h=this.divisions;g<=h;g++){var z=g/h;THREE.Shape.Utils.b2(z,q,s,o),THREE.Shape.Utils.b2(z,r,t,p)}break;case"b":if(o=i[f++]*k+d,p=i[f++]*l,s=i[f++]*k+d,t=i[f++]*l,u=i[f++]*k+d,v=i[f++]*l,e.bezierCurveTo(s,t,u,v,o,p),w=x[x.length-1])for(q=w.x,r=w.y,g=1,h=this.divisions;g<=h;g++){var z=g/h;THREE.Shape.Utils.b3(z,q,s,u,o),THREE.Shape.Utils.b3(z,r,t,v,p)}}return{offset:y.ha*c,path:e}}}},THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.size?b.size:100,d=void 0!==b.curveSegments?b.curveSegments:4,e=void 0!==b.font?b.font:"helvetiker",f=void 0!==b.weight?b.weight:"normal",g=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=c,THREE.FontUtils.divisions=d,THREE.FontUtils.face=e,THREE.FontUtils.weight=f,THREE.FontUtils.style=g;for(var h=THREE.FontUtils.drawText(a),i=h.paths,j=[],k=0,l=i.length;k<l;k++)Array.prototype.push.apply(j,i[k].toShapes());return j},function(a){var b=1e-10,c=function(a,b){var c=a.length;if(c<3)return null;var f,g,h,i=[],j=[],k=[];if(d(a)>0)for(g=0;g<c;g++)j[g]=g;else for(g=0;g<c;g++)j[g]=c-1-g;var l=c,m=2*l;for(g=l-1;l>2;){if(m--<=0)return THREE.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()"),b?k:i;if(f=g,l<=f&&(f=0),g=f+1,l<=g&&(g=0),h=g+1,l<=h&&(h=0),e(a,f,g,h,l,j)){var n,o,p,q,r;for(n=j[f],o=j[g],p=j[h],i.push([a[n],a[o],a[p]]),k.push([j[f],j[g],j[h]]),q=g,r=g+1;r<l;q++,r++)j[q]=j[r];l--,m=2*l}}return b?k:i},d=function(a){for(var b=a.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},e=function(a,c,d,e,f,g){var h,i,j,k,l,m,n,o,p;if(i=a[g[c]].x,j=a[g[c]].y,k=a[g[d]].x,l=a[g[d]].y,m=a[g[e]].x,n=a[g[e]].y,b>(k-i)*(n-j)-(l-j)*(m-i))return!1;var q,r,s,t,u,v,w,x,y,z,A,B,C,D,E;for(q=m-k,r=n-l,s=i-m,t=j-n,u=k-i,v=l-j,h=0;h<f;h++)if(o=a[g[h]].x,p=a[g[h]].y,!(o===i&&p===j||o===k&&p===l||o===m&&p===n)&&(w=o-i,x=p-j,y=o-k,z=p-l,A=o-m,B=p-n,E=q*z-r*y,C=u*x-v*w,D=s*B-t*A,E>=-b&&D>=-b&&C>=-b))return!1;return!0};a.Triangulate=c,a.Triangulate.area=d}(THREE.FontUtils),self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace},THREE.typeface_js=self._typeface_js,THREE.Audio=function(a){THREE.Object3D.call(this),this.type="Audio",this.context=a.context,this.source=this.context.createBufferSource(),this.source.onended=this.onEnded.bind(this),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.panner=this.context.createPanner(),this.panner.connect(this.gain),this.autoplay=!1,this.startTime=0,this.isPlaying=!1},THREE.Audio.prototype=Object.create(THREE.Object3D.prototype),THREE.Audio.prototype.constructor=THREE.Audio,THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;return c.open("GET",a,!0),c.responseType="arraybuffer",c.onload=function(a){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a,b.autoplay&&b.play()})},c.send(),this},THREE.Audio.prototype.play=function(){if(!0===this.isPlaying)return void THREE.warn("THREE.Audio: Audio is already playing.");var a=this.context.createBufferSource();a.buffer=this.source.buffer,a.loop=this.source.loop,a.onended=this.source.onended,a.connect(this.panner),a.start(0,this.startTime),this.isPlaying=!0,this.source=a},THREE.Audio.prototype.pause=function(){this.source.stop(),this.startTime=this.context.currentTime},THREE.Audio.prototype.stop=function(){this.source.stop(),this.startTime=0},THREE.Audio.prototype.onEnded=function(){this.isPlaying=!1},THREE.Audio.prototype.setLoop=function(a){this.source.loop=a},THREE.Audio.prototype.setRefDistance=function(a){this.panner.refDistance=a},THREE.Audio.prototype.setRolloffFactor=function(a){this.panner.rolloffFactor=a},THREE.Audio.prototype.setVolume=function(a){this.gain.gain.value=a},THREE.Audio.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3;return function(b){THREE.Object3D.prototype.updateMatrixWorld.call(this,b),a.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(a.x,a.y,a.z)}}(),THREE.AudioListener=function(){THREE.Object3D.call(this),this.type="AudioListener",this.context=new(window.AudioContext||window.webkitAudioContext)},THREE.AudioListener.prototype=Object.create(THREE.Object3D.prototype),THREE.AudioListener.prototype.constructor=THREE.AudioListener,THREE.AudioListener.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3,b=new THREE.Quaternion,c=new THREE.Vector3,d=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3;return function(g){THREE.Object3D.prototype.updateMatrixWorld.call(this,g);var h=this.context.listener,i=this.up;this.matrixWorld.decompose(a,b,c),d.set(0,0,-1).applyQuaternion(b),e.subVectors(a,f),h.setPosition(a.x,a.y,a.z),h.setOrientation(d.x,d.y,d.z,i.x,i.y,i.z),h.setVelocity(e.x,e.y,e.z),f.copy(a)}}(),THREE.Curve=function(){},THREE.Curve.prototype.getPoint=function(a){return THREE.warn("THREE.Curve: Warning, getPoint() not implemented!"),null},THREE.Curve.prototype.getPointAt=function(a){var b=this.getUtoTmapping(a);return this.getPoint(b)},THREE.Curve.prototype.getPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPoint(b/a));return c},THREE.Curve.prototype.getSpacedPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPointAt(b/a));return c},THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]},THREE.Curve.prototype.getLengths=function(a){if(a||(a=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length==a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var b,c,d=[],e=this.getPoint(0),f=0;for(d.push(0),c=1;c<=a;c++)b=this.getPoint(c/a),f+=b.distanceTo(e),d.push(f),e=b;return this.cacheArcLengths=d,d},THREE.Curve.prototype.updateArcLengths=function(){this.needsUpdate=!0,this.getLengths()},THREE.Curve.prototype.getUtoTmapping=function(a,b){var c,d=this.getLengths(),e=0,f=d.length;c=b||a*d[f-1];for(var g,h=0,i=f-1;h<=i;)if(e=Math.floor(h+(i-h)/2),(g=d[e]-c)<0)h=e+1;else{if(!(g>0)){i=e;break}i=e-1}if(e=i,d[e]==c){var j=e/(f-1);return j}var k=d[e],l=d[e+1],m=l-k,n=(c-k)/m,j=(e+n)/(f-1);return j},THREE.Curve.prototype.getTangent=function(a){var b=1e-4,c=a-b,d=a+b;c<0&&(c=0),d>1&&(d=1);var e=this.getPoint(c);return this.getPoint(d).clone().sub(e).normalize()},THREE.Curve.prototype.getTangentAt=function(a){var b=this.getUtoTmapping(a);return this.getTangent(b)},THREE.Curve.Utils={tangentQuadraticBezier:function(a,b,c,d){return 2*(1-a)*(c-b)+2*a*(d-c)},tangentCubicBezier:function(a,b,c,d,e){return-3*b*(1-a)*(1-a)+3*c*(1-a)*(1-a)-6*a*c*(1-a)+6*a*d*(1-a)-3*a*a*d+3*a*a*e},tangentSpline:function(a,b,c,d,e){return 6*a*a-6*a+(3*a*a-4*a+1)+(-6*a*a+6*a)+(3*a*a-2*a)},interpolate:function(a,b,c,d,e){var f=.5*(c-a),g=.5*(d-b),h=e*e;return(2*b-2*c+f+g)*(e*h)+(-3*b+3*c-2*f-g)*h+f*e+b}},THREE.Curve.create=function(a,b){return a.prototype=Object.create(THREE.Curve.prototype),a.prototype.constructor=a,a.prototype.getPoint=b,a},THREE.CurvePath=function(){this.curves=[],this.bends=[],this.autoClose=!1},THREE.CurvePath.prototype=Object.create(THREE.Curve.prototype),THREE.CurvePath.prototype.constructor=THREE.CurvePath,THREE.CurvePath.prototype.add=function(a){this.curves.push(a)},THREE.CurvePath.prototype.checkConnection=function(){},THREE.CurvePath.prototype.closePath=function(){var a=this.curves[0].getPoint(0),b=this.curves[this.curves.length-1].getPoint(1);a.equals(b)||this.curves.push(new THREE.LineCurve(b,a))},THREE.CurvePath.prototype.getPoint=function(a){for(var b,c,d=a*this.getLength(),e=this.getCurveLengths(),f=0;f<e.length;){if(e[f]>=d){b=e[f]-d,c=this.curves[f];var g=1-b/c.getLength();return c.getPointAt(g)}f++}return null},THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]},THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var a,b=[],c=0,d=this.curves.length;for(a=0;a<d;a++)c+=this.curves[a].getLength(),b.push(c);return this.cacheLengths=b,b},THREE.CurvePath.prototype.getBoundingBox=function(){var a,b,c,d,e,f,g=this.getPoints();a=b=Number.NEGATIVE_INFINITY,d=e=Number.POSITIVE_INFINITY;var h,i,j,k,l=g[0]instanceof THREE.Vector3;for(k=l?new THREE.Vector3:new THREE.Vector2,i=0,j=g.length;i<j;i++)h=g[i],h.x>a?a=h.x:h.x<d&&(d=h.x),h.y>b?b=h.y:h.y<e&&(e=h.y),l&&(h.z>c?c=h.z:h.z<f&&(f=h.z)),k.add(h);var m={minX:d,minY:e,maxX:a,maxY:b};return l&&(m.maxZ=c,m.minZ=f),m},THREE.CurvePath.prototype.createPointsGeometry=function(a){var b=this.getPoints(a,!0);return this.createGeometry(b)},THREE.CurvePath.prototype.createSpacedPointsGeometry=function(a){var b=this.getSpacedPoints(a,!0);return this.createGeometry(b)},THREE.CurvePath.prototype.createGeometry=function(a){for(var b=new THREE.Geometry,c=0;c<a.length;c++)b.vertices.push(new THREE.Vector3(a[c].x,a[c].y,a[c].z||0));return b},THREE.CurvePath.prototype.addWrapPath=function(a){this.bends.push(a)},THREE.CurvePath.prototype.getTransformedPoints=function(a,b){var c,d,e=this.getPoints(a);for(b||(b=this.bends),c=0,d=b.length;c<d;c++)e=this.getWrapPoints(e,b[c]);return e},THREE.CurvePath.prototype.getTransformedSpacedPoints=function(a,b){var c,d,e=this.getSpacedPoints(a);for(b||(b=this.bends),c=0,d=b.length;c<d;c++)e=this.getWrapPoints(e,b[c]);return e},THREE.CurvePath.prototype.getWrapPoints=function(a,b){var c,d,e,f,g,h,i=this.getBoundingBox();for(c=0,d=a.length;c<d;c++){e=a[c],f=e.x,g=e.y,h=f/i.maxX,h=b.getUtoTmapping(h,f);var j=b.getPoint(h),k=b.getTangent(h);k.set(-k.y,k.x).multiplyScalar(g),e.x=j.x+k.x,e.y=j.y+k.y}return a},THREE.Gyroscope=function(){THREE.Object3D.call(this)},THREE.Gyroscope.prototype=Object.create(THREE.Object3D.prototype),THREE.Gyroscope.prototype.constructor=THREE.Gyroscope,THREE.Gyroscope.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3,b=new THREE.Quaternion,c=new THREE.Vector3,d=new THREE.Vector3,e=new THREE.Quaternion,f=new THREE.Vector3;return function(g){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||g)&&(this.parent?(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorld.decompose(d,e,f),this.matrix.decompose(a,b,c),this.matrixWorld.compose(d,b,f)):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,g=!0);for(var h=0,i=this.children.length;h<i;h++)this.children[h].updateMatrixWorld(g)}}(),THREE.Path=function(a){THREE.CurvePath.call(this),this.actions=[],a&&this.fromPoints(a)},THREE.Path.prototype=Object.create(THREE.CurvePath.prototype),THREE.Path.prototype.constructor=THREE.Path,THREE.PathActions={MOVE_TO:"moveTo",LINE_TO:"lineTo",QUADRATIC_CURVE_TO:"quadraticCurveTo",BEZIER_CURVE_TO:"bezierCurveTo",CSPLINE_THRU:"splineThru",ARC:"arc",ELLIPSE:"ellipse"},THREE.Path.prototype.fromPoints=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)},THREE.Path.prototype.moveTo=function(a,b){var c=Array.prototype.slice.call(arguments);this.actions.push({action:THREE.PathActions.MOVE_TO,args:c})},THREE.Path.prototype.lineTo=function(a,b){var c=Array.prototype.slice.call(arguments),d=this.actions[this.actions.length-1].args,e=d[d.length-2],f=d[d.length-1],g=new THREE.LineCurve(new THREE.Vector2(e,f),new THREE.Vector2(a,b));this.curves.push(g),this.actions.push({action:THREE.PathActions.LINE_TO,args:c})},THREE.Path.prototype.quadraticCurveTo=function(a,b,c,d){var e=Array.prototype.slice.call(arguments),f=this.actions[this.actions.length-1].args,g=f[f.length-2],h=f[f.length-1],i=new THREE.QuadraticBezierCurve(new THREE.Vector2(g,h),new THREE.Vector2(a,b),new THREE.Vector2(c,d));this.curves.push(i),this.actions.push({action:THREE.PathActions.QUADRATIC_CURVE_TO,args:e})},THREE.Path.prototype.bezierCurveTo=function(a,b,c,d,e,f){var g=Array.prototype.slice.call(arguments),h=this.actions[this.actions.length-1].args,i=h[h.length-2],j=h[h.length-1],k=new THREE.CubicBezierCurve(new THREE.Vector2(i,j),new THREE.Vector2(a,b),new THREE.Vector2(c,d),new THREE.Vector2(e,f));this.curves.push(k),this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:g})},THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,d=c[c.length-2],e=c[c.length-1],f=[new THREE.Vector2(d,e)];Array.prototype.push.apply(f,a);var g=new THREE.SplineCurve(f);this.curves.push(g),this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})},THREE.Path.prototype.arc=function(a,b,c,d,e,f){var g=this.actions[this.actions.length-1].args,h=g[g.length-2],i=g[g.length-1];this.absarc(a+h,b+i,c,d,e,f)},THREE.Path.prototype.absarc=function(a,b,c,d,e,f){this.absellipse(a,b,c,c,d,e,f)},THREE.Path.prototype.ellipse=function(a,b,c,d,e,f,g){var h=this.actions[this.actions.length-1].args,i=h[h.length-2],j=h[h.length-1];this.absellipse(a+i,b+j,c,d,e,f,g)},THREE.Path.prototype.absellipse=function(a,b,c,d,e,f,g){var h=Array.prototype.slice.call(arguments),i=new THREE.EllipseCurve(a,b,c,d,e,f,g);this.curves.push(i);var j=i.getPoint(1);h.push(j.x),h.push(j.y),this.actions.push({action:THREE.PathActions.ELLIPSE,args:h})},THREE.Path.prototype.getSpacedPoints=function(a,b){a||(a=40);for(var c=[],d=0;d<a;d++)c.push(this.getPoint(d/a));return c},THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(a,b);a=a||12;var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u=[];for(c=0,d=this.actions.length;c<d;c++)switch(e=this.actions[c],f=e.action,g=e.args,f){case THREE.PathActions.MOVE_TO:case THREE.PathActions.LINE_TO:u.push(new THREE.Vector2(g[0],g[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:for(h=g[2],i=g[3],l=g[0],m=g[1],u.length>0?(p=u[u.length-1],n=p.x,o=p.y):(p=this.actions[c-1].args,n=p[p.length-2],o=p[p.length-1]),q=1;q<=a;q++)r=q/a,s=THREE.Shape.Utils.b2(r,n,l,h),t=THREE.Shape.Utils.b2(r,o,m,i),u.push(new THREE.Vector2(s,t));break;case THREE.PathActions.BEZIER_CURVE_TO:for(h=g[4],i=g[5],l=g[0],m=g[1],j=g[2],k=g[3],u.length>0?(p=u[u.length-1],n=p.x,o=p.y):(p=this.actions[c-1].args,n=p[p.length-2],o=p[p.length-1]),q=1;q<=a;q++)r=q/a,s=THREE.Shape.Utils.b3(r,n,l,j,h),t=THREE.Shape.Utils.b3(r,o,m,k,i),u.push(new THREE.Vector2(s,t));break;case THREE.PathActions.CSPLINE_THRU:p=this.actions[c-1].args;var v=new THREE.Vector2(p[p.length-2],p[p.length-1]),w=[v],x=a*g[0].length;w=w.concat(g[0]);var y=new THREE.SplineCurve(w);for(q=1;q<=x;q++)u.push(y.getPointAt(q/x));break;case THREE.PathActions.ARC:var z,A=g[0],B=g[1],C=g[2],D=g[3],E=g[4],F=!!g[5],G=E-D,H=2*a;for(q=1;q<=H;q++)r=q/H,F||(r=1-r),z=D+r*G,s=A+C*Math.cos(z),t=B+C*Math.sin(z),u.push(new THREE.Vector2(s,t));break;case THREE.PathActions.ELLIPSE:var z,A=g[0],B=g[1],I=g[2],J=g[3],D=g[4],E=g[5],F=!!g[6],G=E-D,H=2*a;for(q=1;q<=H;q++)r=q/H,F||(r=1-r),z=D+r*G,s=A+I*Math.cos(z),t=B+J*Math.sin(z),u.push(new THREE.Vector2(s,t))}var K=u[u.length-1],L=1e-10;return Math.abs(K.x-u[0].x)<L&&Math.abs(K.y-u[0].y)<L&&u.splice(u.length-1,1),b&&u.push(u[0]),u},THREE.Path.prototype.toShapes=function(a,b){function c(a){var b,c,d,e,f,g=[],h=new THREE.Path;for(b=0,c=a.length;b<c;b++)d=a[b],f=d.args,e=d.action,e==THREE.PathActions.MOVE_TO&&0!=h.actions.length&&(g.push(h),h=new THREE.Path),h[e].apply(h,f);return 0!=h.actions.length&&g.push(h),g}function d(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c],f=new THREE.Shape;f.actions=e.actions,f.curves=e.curves,b.push(f)}return b}function e(a,b){for(var c=1e-10,d=b.length,e=!1,f=d-1,g=0;g<d;f=g++){var h=b[f],i=b[g],j=i.x-h.x,k=i.y-h.y;if(Math.abs(k)>c){if(k<0&&(h=b[g],j=-j,i=b[f],k=-k),a.y<h.y||a.y>i.y)continue;if(a.y==h.y){if(a.x==h.x)return!0}else{var l=k*(a.x-h.x)-j*(a.y-h.y);if(0==l)return!0;if(l<0)continue;e=!e}}else{if(a.y!=h.y)continue;if(i.x<=a.x&&a.x<=h.x||h.x<=a.x&&a.x<=i.x)return!0}}return e}var f=c(this.actions);if(0==f.length)return[];if(!0===b)return d(f);var g,h,i,j=[];if(1==f.length)return h=f[0],i=new THREE.Shape,i.actions=h.actions,i.curves=h.curves,j.push(i),j;var k=!THREE.Shape.Utils.isClockWise(f[0].getPoints());k=a?!k:k;var l,m=[],n=[],o=[],p=0;n[p]=void 0,o[p]=[];var q,r;for(q=0,r=f.length;q<r;q++)h=f[q],l=h.getPoints(),g=THREE.Shape.Utils.isClockWise(l),g=a?!g:g,g?(!k&&n[p]&&p++,n[p]={s:new THREE.Shape,p:l},n[p].s.actions=h.actions,n[p].s.curves=h.curves,k&&p++,o[p]=[]):o[p].push({h:h,p:l[0]});if(!n[0])return d(f);if(n.length>1){for(var s=!1,t=[],u=0,v=n.length;u<v;u++)m[u]=[];for(var u=0,v=n.length;u<v;u++)for(var w=o[u],x=0;x<w.length;x++){for(var y=w[x],z=!0,A=0;A<n.length;A++)e(y.p,n[A].p)&&(u!=A&&t.push({froms:u,tos:A,hole:x}),z?(z=!1,m[A].push(y)):s=!0);z&&m[u].push(y)}t.length>0&&(s||(o=m))}var B,C,D;for(q=0,r=n.length;q<r;q++)for(i=n[q].s,j.push(i),B=o[q],C=0,D=B.length;C<D;C++)i.holes.push(B[C].h);return j},THREE.Shape=function(){THREE.Path.apply(this,arguments),this.holes=[]},THREE.Shape.prototype=Object.create(THREE.Path.prototype),THREE.Shape.prototype.constructor=THREE.Shape,THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)},THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)},THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d},THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d},THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}},THREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)},THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}},THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,i=e.x-d.x,j=e.y-d.y,k=a.x-d.x,l=a.y-d.y,m=h*i-g*j,n=h*k-g*l;if(Math.abs(m)>1e-10){var o;if(m>0){if(n<0||n>m)return[];if((o=j*k-i*l)<0||o>m)return[]}else{if(n>0||n<m)return[];if((o=j*k-i*l)>0||o<m)return[]}if(0==o)return!f||0!=n&&n!=m?[a]:[];if(o==m)return!f||0!=n&&n!=m?[b]:[];if(0==n)return[d];if(n==m)return[e];var p=o/m;return[{x:a.x+p*g,y:a.y+p*h}]}if(0!=n||j*k!=i*l)return[];var q=0==g&&0==h,r=0==i&&0==j;if(q&&r)return a.x!=d.x||a.y!=d.y?[]:[a];if(q)return c(d,e,a)?[a]:[];if(r)return c(a,b,d)?[d]:[];var s,t,u,v,w,x,y,z;return 0!=g?(a.x<b.x?(s=a,u=a.x,t=b,v=b.x):(s=b,u=b.x,t=a,v=a.x),d.x<e.x?(w=d,y=d.x,x=e,z=e.x):(w=e,y=e.x,x=d,z=d.x)):(a.y<b.y?(s=a,u=a.y,t=b,v=b.y):(s=b,u=b.y,t=a,v=a.y),d.y<e.y?(w=d,y=d.y,x=e,z=e.y):(w=e,y=e.y,x=d,z=d.y)),u<=y?v<y?[]:v==y?f?[]:[w]:v<=z?[w,t]:[w,x]:u>z?[]:u==z?f?[]:[s]:v<=z?[s,t]:[s,x]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y,g=c.x-a.x,h=c.y-a.y,i=d.x-a.x,j=d.y-a.y,k=e*h-f*g,l=e*j-f*i;if(Math.abs(k)>1e-10){var m=i*h-j*g;return k>0?l>=0&&m>=0:l>=0||m>=0}return l>0}function f(a,b){function c(a,b){var c=s.length-1,d=a-1;d<0&&(d=c);var f=a+1;f>c&&(f=0);var g=e(s[a],s[d],s[f],h[b]);if(!g)return!1;var i=h.length-1,j=b-1;j<0&&(j=i);var k=b+1;return k>i&&(k=0),!!(g=e(h[b],h[j],h[k],s[a]))}function f(a,b){var c,e,f;for(c=0;c<s.length;c++)if(e=c+1,e%=s.length,f=d(a,b,s[c],s[e],!0),f.length>0)return!0;return!1}function g(a,c){var e,f,g,h,i;for(e=0;e<t.length;e++)for(f=b[t[e]],g=0;g<f.length;g++)if(h=g+1,h%=f.length,i=d(a,c,f[g],f[h],!0),i.length>0)return!0;return!1}for(var h,i,j,k,l,m,n,o,p,q,r,s=a.concat(),t=[],u=[],v=0,w=b.length;v<w;v++)t.push(v);for(var x=0,y=2*t.length;t.length>0;){if(--y<0){console.log("Infinite Loop! Holes left:"+t.length+", Probably Hole outside Shape!");break}for(j=x;j<s.length;j++){k=s[j],i=-1;for(var v=0;v<t.length;v++)if(m=t[v],n=k.x+":"+k.y+":"+m,void 0===u[n]){h=b[m];for(var z=0;z<h.length;z++)if(l=h[z],c(j,z)&&!f(k,l)&&!g(k,l)){i=z,t.splice(v,1),o=s.slice(0,j+1),p=s.slice(j),q=h.slice(i),r=h.slice(0,i+1),s=o.concat(q).concat(r).concat(p),x=j;break}if(i>=0)break;u[n]=!0}if(i>=0)break}}return s}for(var g,h,i,j,k,l,m={},n=a.concat(),o=0,p=b.length;o<p;o++)Array.prototype.push.apply(n,b[o]);for(g=0,h=n.length;g<h;g++)k=n[g].x+":"+n[g].y,void 0!==m[k]&&THREE.warn("THREE.Shape: Duplicate point",k),m[k]=g;var q=f(a,b),r=THREE.FontUtils.Triangulate(q,!1);for(g=0,h=r.length;g<h;g++)for(j=r[g],i=0;i<3;i++)k=j[i].x+":"+j[i].y,void 0!==(l=m[k])&&(j[i]=l);return r.concat()},isClockWise:function(a){return THREE.FontUtils.Triangulate.area(a)<0},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}},THREE.LineCurve=function(a,b){this.v1=a,this.v2=b},THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype),THREE.LineCurve.prototype.constructor=THREE.LineCurve,THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);return b.multiplyScalar(a).add(this.v1),b},THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)},THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()},THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a,this.v1=b,this.v2=c},THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype),THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve,THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b=new THREE.Vector2;return b.x=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x),b.y=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y),b},THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b=new THREE.Vector2;return b.x=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x),b.y=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y),b.normalize()},THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a,this.v1=b,this.v2=c,this.v3=d},THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype),THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve,THREE.CubicBezierCurve.prototype.getPoint=function(a){var b,c;return b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x),c=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y),new THREE.Vector2(b,c)},THREE.CubicBezierCurve.prototype.getTangent=function(a){var b,c;b=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x),c=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);var d=new THREE.Vector2(b,c);return d.normalize(),d},THREE.SplineCurve=function(a){this.points=void 0==a?[]:a},THREE.SplineCurve.prototype=Object.create(THREE.Curve.prototype),THREE.SplineCurve.prototype.constructor=THREE.SplineCurve,THREE.SplineCurve.prototype.getPoint=function(a){var b=this.points,c=(b.length-1)*a,d=Math.floor(c),e=c-d,f=b[0==d?d:d-1],g=b[d],h=b[d>b.length-2?b.length-1:d+1],i=b[d>b.length-3?b.length-1:d+2],j=new THREE.Vector2;return j.x=THREE.Curve.Utils.interpolate(f.x,g.x,h.x,i.x,e),j.y=THREE.Curve.Utils.interpolate(f.y,g.y,h.y,i.y,e),j},THREE.EllipseCurve=function(a,b,c,d,e,f,g){this.aX=a,this.aY=b,this.xRadius=c,this.yRadius=d,this.aStartAngle=e,this.aEndAngle=f,this.aClockwise=g},THREE.EllipseCurve.prototype=Object.create(THREE.Curve.prototype),THREE.EllipseCurve.prototype.constructor=THREE.EllipseCurve,THREE.EllipseCurve.prototype.getPoint=function(a){var b=this.aEndAngle-this.aStartAngle;b<0&&(b+=2*Math.PI),b>2*Math.PI&&(b-=2*Math.PI);var c;c=!0===this.aClockwise?this.aEndAngle+(1-a)*(2*Math.PI-b):this.aStartAngle+a*b;var d=new THREE.Vector2;return d.x=this.aX+this.xRadius*Math.cos(c),d.y=this.aY+this.yRadius*Math.sin(c),d},THREE.ArcCurve=function(a,b,c,d,e,f){THREE.EllipseCurve.call(this,a,b,c,c,d,e,f)},THREE.ArcCurve.prototype=Object.create(THREE.EllipseCurve.prototype),THREE.ArcCurve.prototype.constructor=THREE.ArcCurve,THREE.LineCurve3=THREE.Curve.create(function(a,b){this.v1=a,this.v2=b},function(a){var b=new THREE.Vector3;return b.subVectors(this.v2,this.v1),b.multiplyScalar(a),b.add(this.v1),b}),THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a,
  this.v1=b,this.v2=c},function(a){var b=new THREE.Vector3;return b.x=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x),b.y=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y),b.z=THREE.Shape.Utils.b2(a,this.v0.z,this.v1.z,this.v2.z),b}),THREE.CubicBezierCurve3=THREE.Curve.create(function(a,b,c,d){this.v0=a,this.v1=b,this.v2=c,this.v3=d},function(a){var b=new THREE.Vector3;return b.x=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x),b.y=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y),b.z=THREE.Shape.Utils.b3(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z),b}),THREE.SplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points,c=(b.length-1)*a,d=Math.floor(c),e=c-d,f=b[0==d?d:d-1],g=b[d],h=b[d>b.length-2?b.length-1:d+1],i=b[d>b.length-3?b.length-1:d+2],j=new THREE.Vector3;return j.x=THREE.Curve.Utils.interpolate(f.x,g.x,h.x,i.x,e),j.y=THREE.Curve.Utils.interpolate(f.y,g.y,h.y,i.y,e),j.z=THREE.Curve.Utils.interpolate(f.z,g.z,h.z,i.z,e),j}),THREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points,c=(b.length-0)*a,d=Math.floor(c),e=c-d;d+=d>0?0:(Math.floor(Math.abs(d)/b.length)+1)*b.length;var f=b[(d-1)%b.length],g=b[d%b.length],h=b[(d+1)%b.length],i=b[(d+2)%b.length],j=new THREE.Vector3;return j.x=THREE.Curve.Utils.interpolate(f.x,g.x,h.x,i.x,e),j.y=THREE.Curve.Utils.interpolate(f.y,g.y,h.y,i.y,e),j.z=THREE.Curve.Utils.interpolate(f.z,g.z,h.z,i.z,e),j}),THREE.AnimationHandler={LINEAR:0,CATMULLROM:1,CATMULLROM_FORWARD:2,add:function(){THREE.warn("THREE.AnimationHandler.add() has been deprecated.")},get:function(){THREE.warn("THREE.AnimationHandler.get() has been deprecated.")},remove:function(){THREE.warn("THREE.AnimationHandler.remove() has been deprecated.")},animations:[],init:function(a){if(!0===a.initialized)return a;for(var b=0;b<a.hierarchy.length;b++){for(var c=0;c<a.hierarchy[b].keys.length;c++)if(a.hierarchy[b].keys[c].time<0&&(a.hierarchy[b].keys[c].time=0),void 0!==a.hierarchy[b].keys[c].rot&&!(a.hierarchy[b].keys[c].rot instanceof THREE.Quaternion)){var d=a.hierarchy[b].keys[c].rot;a.hierarchy[b].keys[c].rot=(new THREE.Quaternion).fromArray(d)}if(a.hierarchy[b].keys.length&&void 0!==a.hierarchy[b].keys[0].morphTargets){for(var e={},c=0;c<a.hierarchy[b].keys.length;c++)for(var f=0;f<a.hierarchy[b].keys[c].morphTargets.length;f++){var g=a.hierarchy[b].keys[c].morphTargets[f];e[g]=-1}a.hierarchy[b].usedMorphTargets=e;for(var c=0;c<a.hierarchy[b].keys.length;c++){var h={};for(var g in e){for(var f=0;f<a.hierarchy[b].keys[c].morphTargets.length;f++)if(a.hierarchy[b].keys[c].morphTargets[f]===g){h[g]=a.hierarchy[b].keys[c].morphTargetsInfluences[f];break}f===a.hierarchy[b].keys[c].morphTargets.length&&(h[g]=0)}a.hierarchy[b].keys[c].morphTargetsInfluences=h}}for(var c=1;c<a.hierarchy[b].keys.length;c++)a.hierarchy[b].keys[c].time===a.hierarchy[b].keys[c-1].time&&(a.hierarchy[b].keys.splice(c,1),c--);for(var c=0;c<a.hierarchy[b].keys.length;c++)a.hierarchy[b].keys[c].index=c}return a.initialized=!0,a},parse:function(a){var b=function(a,c){c.push(a);for(var d=0;d<a.children.length;d++)b(a.children[d],c)},c=[];if(a instanceof THREE.SkinnedMesh)for(var d=0;d<a.skeleton.bones.length;d++)c.push(a.skeleton.bones[d]);else b(a,c);return c},play:function(a){-1===this.animations.indexOf(a)&&this.animations.push(a)},stop:function(a){var b=this.animations.indexOf(a);-1!==b&&this.animations.splice(b,1)},update:function(a){for(var b=0;b<this.animations.length;b++)this.animations[b].resetBlendWeights();for(var b=0;b<this.animations.length;b++)this.animations[b].update(a)}},THREE.Animation=function(a,b){this.root=a,this.data=THREE.AnimationHandler.init(b),this.hierarchy=THREE.AnimationHandler.parse(a),this.currentTime=0,this.timeScale=1,this.isPlaying=!1,this.loop=!0,this.weight=0,this.interpolationType=THREE.AnimationHandler.LINEAR},THREE.Animation.prototype={constructor:THREE.Animation,keyTypes:["pos","rot","scl"],play:function(a,b){this.currentTime=void 0!==a?a:0,this.weight=void 0!==b?b:1,this.isPlaying=!0,this.reset(),THREE.AnimationHandler.play(this)},stop:function(){this.isPlaying=!1,THREE.AnimationHandler.stop(this)},reset:function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a];void 0===c.animationCache&&(c.animationCache={animations:{},blending:{positionWeight:0,quaternionWeight:0,scaleWeight:0}});var d=this.data.name,e=c.animationCache.animations,f=e[d];void 0===f&&(f={prevKey:{pos:0,rot:0,scl:0},nextKey:{pos:0,rot:0,scl:0},originalMatrix:c.matrix},e[d]=f);for(var g=0;g<3;g++){for(var h=this.keyTypes[g],i=this.data.hierarchy[a].keys[0],j=this.getNextKeyWith(h,a,1);j.time<this.currentTime&&j.index>i.index;)i=j,j=this.getNextKeyWith(h,a,j.index+1);f.prevKey[h]=i,f.nextKey[h]=j}}},resetBlendWeights:function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a],d=c.animationCache;if(void 0!==d){var e=d.blending;e.positionWeight=0,e.quaternionWeight=0,e.scaleWeight=0}}},update:function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c,d,e,g,h,i,j,k,l,m=[],n=[];return c=(a.length-1)*b,d=Math.floor(c),e=c-d,m[0]=0===d?d:d-1,m[1]=d,m[2]=d>a.length-2?d:d+1,m[3]=d>a.length-3?d:d+2,i=a[m[0]],j=a[m[1]],k=a[m[2]],l=a[m[3]],g=e*e,h=e*g,n[0]=f(i[0],j[0],k[0],l[0],e,g,h),n[1]=f(i[1],j[1],k[1],l[1],e,g,h),n[2]=f(i[2],j[2],k[2],l[2],e,g,h),n},f=function(a,b,c,d,e,f,g){var h=.5*(c-a),i=.5*(d-b);return(2*(b-c)+h+i)*g+(-3*(b-c)-2*h-i)*f+h*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){var g=this.data.length;(this.currentTime>g||this.currentTime<0)&&(this.loop?(this.currentTime%=g,this.currentTime<0&&(this.currentTime+=g),this.reset()):this.stop());for(var h=0,i=this.hierarchy.length;h<i;h++)for(var j=this.hierarchy[h],k=j.animationCache.animations[this.data.name],l=j.animationCache.blending,m=0;m<3;m++){var n=this.keyTypes[m],o=k.prevKey[n],p=k.nextKey[n];if(this.timeScale>0&&p.time<=this.currentTime||this.timeScale<0&&o.time>=this.currentTime){for(o=this.data.hierarchy[h].keys[0],p=this.getNextKeyWith(n,h,1);p.time<this.currentTime&&p.index>o.index;)o=p,p=this.getNextKeyWith(n,h,p.index+1);k.prevKey[n]=o,k.nextKey[n]=p}var q=(this.currentTime-o.time)/(p.time-o.time),r=o[n],s=p[n];if(q<0&&(q=0),q>1&&(q=1),"pos"===n){if(this.interpolationType===THREE.AnimationHandler.LINEAR){c.x=r[0]+(s[0]-r[0])*q,c.y=r[1]+(s[1]-r[1])*q,c.z=r[2]+(s[2]-r[2])*q;var t=this.weight/(this.weight+l.positionWeight);j.position.lerp(c,t),l.positionWeight+=this.weight}else if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD){a[0]=this.getPrevKeyWith("pos",h,o.index-1).pos,a[1]=r,a[2]=s,a[3]=this.getNextKeyWith("pos",h,p.index+1).pos,q=.33*q+.33;var u=e(a,q),t=this.weight/(this.weight+l.positionWeight);l.positionWeight+=this.weight;var v=j.position;if(v.x=v.x+(u[0]-v.x)*t,v.y=v.y+(u[1]-v.y)*t,v.z=v.z+(u[2]-v.z)*t,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD){var w=e(a,1.01*q);b.set(w[0],w[1],w[2]),b.sub(v),b.y=0,b.normalize();var x=Math.atan2(b.x,b.z);j.rotation.set(0,x,0)}}}else if("rot"===n)if(THREE.Quaternion.slerp(r,s,d,q),0===l.quaternionWeight)j.quaternion.copy(d),l.quaternionWeight=this.weight;else{var t=this.weight/(this.weight+l.quaternionWeight);THREE.Quaternion.slerp(j.quaternion,d,j.quaternion,t),l.quaternionWeight+=this.weight}else if("scl"===n){c.x=r[0]+(s[0]-r[0])*q,c.y=r[1]+(s[1]-r[1])*q,c.z=r[2]+(s[2]-r[2])*q;var t=this.weight/(this.weight+l.scaleWeight);j.scale.lerp(c,t),l.scaleWeight+=this.weight}}return!0}}}(),getNextKeyWith:function(a,b,c){var d=this.data.hierarchy[b].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c=c<d.length-1?c:d.length-1:c%=d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]},getPrevKeyWith:function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c>0?c:0:c>=0?c:c+d.length;c>=0;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]}},THREE.KeyFrameAnimation=function(a){this.root=a.node,this.data=THREE.AnimationHandler.init(a),this.hierarchy=THREE.AnimationHandler.parse(this.root),this.currentTime=0,this.timeScale=.001,this.isPlaying=!1,this.isPaused=!0,this.loop=!0;for(var b=0,c=this.hierarchy.length;b<c;b++){var d=this.data.hierarchy[b].keys,e=this.data.hierarchy[b].sids,f=this.hierarchy[b];if(d.length&&e){for(var g=0;g<e.length;g++){var h=e[g],i=this.getNextKeyWith(h,b,0);i&&i.apply(h)}f.matrixAutoUpdate=!1,this.data.hierarchy[b].node.updateMatrix(),f.matrixWorldNeedsUpdate=!0}}},THREE.KeyFrameAnimation.prototype={constructor:THREE.KeyFrameAnimation,play:function(a){if(this.currentTime=void 0!==a?a:0,!1===this.isPlaying){this.isPlaying=!0;var b,c,d,e=this.hierarchy.length;for(b=0;b<e;b++){c=this.hierarchy[b],d=this.data.hierarchy[b],void 0===d.animationCache&&(d.animationCache={},d.animationCache.prevKey=null,d.animationCache.nextKey=null,d.animationCache.originalMatrix=c.matrix);var f=this.data.hierarchy[b].keys;f.length&&(d.animationCache.prevKey=f[0],d.animationCache.nextKey=f[1],this.startTime=Math.min(f[0].time,this.startTime),this.endTime=Math.max(f[f.length-1].time,this.endTime))}this.update(0)}this.isPaused=!1,THREE.AnimationHandler.play(this)},stop:function(){this.isPlaying=!1,this.isPaused=!1,THREE.AnimationHandler.stop(this);for(var a=0;a<this.data.hierarchy.length;a++){var b=this.hierarchy[a],c=this.data.hierarchy[a];if(void 0!==c.animationCache){var d=c.animationCache.originalMatrix;d.copy(b.matrix),b.matrix=d,delete c.animationCache}}},update:function(a){if(!1!==this.isPlaying){this.currentTime+=a*this.timeScale;var b=this.data.length;!0===this.loop&&this.currentTime>b&&(this.currentTime%=b),this.currentTime=Math.min(this.currentTime,b);for(var c=0,d=this.hierarchy.length;c<d;c++){var e=this.hierarchy[c],f=this.data.hierarchy[c],g=f.keys,h=f.animationCache;if(g.length){var i=h.prevKey,j=h.nextKey;if(j.time<=this.currentTime){for(;j.time<this.currentTime&&j.index>i.index;)i=j,j=g[i.index+1];h.prevKey=i,h.nextKey=j}j.time>=this.currentTime?i.interpolate(j,this.currentTime):i.interpolate(j,j.time),this.data.hierarchy[c].node.updateMatrix(),e.matrixWorldNeedsUpdate=!0}}}},getNextKeyWith:function(a,b,c){var d=this.data.hierarchy[b].keys;for(c%=d.length;c<d.length;c++)if(d[c].hasTarget(a))return d[c];return d[0]},getPrevKeyWith:function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=c>=0?c:c+d.length;c>=0;c--)if(d[c].hasTarget(a))return d[c];return d[d.length-1]}},THREE.MorphAnimation=function(a){this.mesh=a,this.frames=a.morphTargetInfluences.length,this.currentTime=0,this.duration=1e3,this.loop=!0,this.lastFrame=0,this.currentFrame=0,this.isPlaying=!1},THREE.MorphAnimation.prototype={constructor:THREE.MorphAnimation,play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(a){if(!1!==this.isPlaying){this.currentTime+=a,!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration),this.currentTime=Math.min(this.currentTime,this.duration);var b=this.duration/this.frames,c=Math.floor(this.currentTime/b),d=this.mesh.morphTargetInfluences;c!=this.currentFrame&&(d[this.lastFrame]=0,d[this.currentFrame]=1,d[c]=0,this.lastFrame=this.currentFrame,this.currentFrame=c),d[c]=this.currentTime%b/b,d[this.lastFrame]=1-d[c]}}},THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,i){var j,k,l,m=h.widthSegments,n=h.heightSegments,o=e/2,p=f/2,q=h.vertices.length;"x"===a&&"y"===b||"y"===a&&"x"===b?j="z":"x"===a&&"z"===b||"z"===a&&"x"===b?(j="y",n=h.depthSegments):("z"===a&&"y"===b||"y"===a&&"z"===b)&&(j="x",m=h.depthSegments);var r=m+1,s=n+1,t=e/m,u=f/n,v=new THREE.Vector3;for(v[j]=g>0?1:-1,l=0;l<s;l++)for(k=0;k<r;k++){var w=new THREE.Vector3;w[a]=(k*t-o)*c,w[b]=(l*u-p)*d,w[j]=g,h.vertices.push(w)}for(l=0;l<n;l++)for(k=0;k<m;k++){var x=k+r*l,y=k+r*(l+1),z=k+1+r*(l+1),A=k+1+r*l,B=new THREE.Vector2(k/m,1-l/n),C=new THREE.Vector2(k/m,1-(l+1)/n),D=new THREE.Vector2((k+1)/m,1-(l+1)/n),E=new THREE.Vector2((k+1)/m,1-l/n),F=new THREE.Face3(x+q,y+q,A+q);F.normal.copy(v),F.vertexNormals.push(v.clone(),v.clone(),v.clone()),F.materialIndex=i,h.faces.push(F),h.faceVertexUvs[0].push([B,C,E]),F=new THREE.Face3(y+q,z+q,A+q),F.normal.copy(v),F.vertexNormals.push(v.clone(),v.clone(),v.clone()),F.materialIndex=i,h.faces.push(F),h.faceVertexUvs[0].push([C.clone(),D,E.clone()])}}THREE.Geometry.call(this),this.type="BoxGeometry",this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f},this.widthSegments=d||1,this.heightSegments=e||1,this.depthSegments=f||1;var h=this,i=a/2,j=b/2,k=c/2;g("z","y",-1,-1,c,b,i,0),g("z","y",1,-1,c,b,-i,1),g("x","z",1,1,a,c,j,2),g("x","z",1,-1,a,c,-j,3),g("x","y",1,-1,a,b,k,4),g("x","y",-1,-1,a,b,-k,5),this.mergeVertices()},THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry,THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this),this.type="CircleGeometry",this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d},a=a||50,b=void 0!==b?Math.max(3,b):8,c=void 0!==c?c:0,d=void 0!==d?d:2*Math.PI;var e,f=[],g=new THREE.Vector3,h=new THREE.Vector2(.5,.5);for(this.vertices.push(g),f.push(h),e=0;e<=b;e++){var i=new THREE.Vector3,j=c+e/b*d;i.x=a*Math.cos(j),i.y=a*Math.sin(j),this.vertices.push(i),f.push(new THREE.Vector2((i.x/a+1)/2,(i.y/a+1)/2))}var k=new THREE.Vector3(0,0,1);for(e=1;e<=b;e++)this.faces.push(new THREE.Face3(e,e+1,0,[k.clone(),k.clone(),k.clone()])),this.faceVertexUvs[0].push([f[e].clone(),f[e+1].clone(),h.clone()]);this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)},THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry,THREE.CubeGeometry=function(a,b,c,d,e,f){return THREE.warn("THREE.CubeGeometry has been renamed to THREE.BoxGeometry."),new THREE.BoxGeometry(a,b,c,d,e,f)},THREE.CylinderGeometry=function(a,b,c,d,e,f,g,h){THREE.Geometry.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h},a=void 0!==a?a:20,b=void 0!==b?b:20,c=void 0!==c?c:100,d=d||8,e=e||1,f=void 0!==f&&f,g=void 0!==g?g:0,h=void 0!==h?h:2*Math.PI;var i,j,k=c/2,l=[],m=[];for(j=0;j<=e;j++){var n=[],o=[],p=j/e,q=p*(b-a)+a;for(i=0;i<=d;i++){var r=i/d,s=new THREE.Vector3;s.x=q*Math.sin(r*h+g),s.y=-p*c+k,s.z=q*Math.cos(r*h+g),this.vertices.push(s),n.push(this.vertices.length-1),o.push(new THREE.Vector2(r,1-p))}l.push(n),m.push(o)}var t,u,v=(b-a)/c;for(i=0;i<d;i++)for(0!==a?(t=this.vertices[l[0][i]].clone(),u=this.vertices[l[0][i+1]].clone()):(t=this.vertices[l[1][i]].clone(),u=this.vertices[l[1][i+1]].clone()),t.setY(Math.sqrt(t.x*t.x+t.z*t.z)*v).normalize(),u.setY(Math.sqrt(u.x*u.x+u.z*u.z)*v).normalize(),j=0;j<e;j++){var w=l[j][i],x=l[j+1][i],y=l[j+1][i+1],z=l[j][i+1],A=t.clone(),B=t.clone(),C=u.clone(),D=u.clone(),E=m[j][i].clone(),F=m[j+1][i].clone(),G=m[j+1][i+1].clone(),H=m[j][i+1].clone();this.faces.push(new THREE.Face3(w,x,z,[A,B,D])),this.faceVertexUvs[0].push([E,F,H]),this.faces.push(new THREE.Face3(x,y,z,[B.clone(),C,D.clone()])),this.faceVertexUvs[0].push([F.clone(),G,H.clone()])}if(!1===f&&a>0)for(this.vertices.push(new THREE.Vector3(0,k,0)),i=0;i<d;i++){var w=l[0][i],x=l[0][i+1],y=this.vertices.length-1,A=new THREE.Vector3(0,1,0),B=new THREE.Vector3(0,1,0),C=new THREE.Vector3(0,1,0),E=m[0][i].clone(),F=m[0][i+1].clone(),G=new THREE.Vector2(F.x,0);this.faces.push(new THREE.Face3(w,x,y,[A,B,C])),this.faceVertexUvs[0].push([E,F,G])}if(!1===f&&b>0)for(this.vertices.push(new THREE.Vector3(0,-k,0)),i=0;i<d;i++){var w=l[e][i+1],x=l[e][i],y=this.vertices.length-1,A=new THREE.Vector3(0,-1,0),B=new THREE.Vector3(0,-1,0),C=new THREE.Vector3(0,-1,0),E=m[e][i+1].clone(),F=m[e][i].clone(),G=new THREE.Vector2(F.x,1);this.faces.push(new THREE.Face3(w,x,y,[A,B,C])),this.faceVertexUvs[0].push([E,F,G])}this.computeFaceNormals()},THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;THREE.ExtrudeGeometry=function(a,b){if(void 0===a)return void(a=[]);THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=a instanceof Array?a:[a],this.addShapeList(a,b),this.computeFaceNormals()},THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry,THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++){var e=a[d];this.addShape(e,b)}},THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){return b||THREE.error("THREE.ExtrudeGeometry: vec does not exist"),b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d,e,f=1e-10,g=1,h=a.x-b.x,i=a.y-b.y,j=c.x-a.x,k=c.y-a.y,l=h*h+i*i,m=h*k-i*j;if(Math.abs(m)>f){var n=Math.sqrt(l),o=Math.sqrt(j*j+k*k),p=b.x-i/n,q=b.y+h/n,r=c.x-k/o,s=c.y+j/o,t=((r-p)*k-(s-q)*j)/(h*k-i*j);d=p+h*t-a.x,e=q+i*t-a.y;var u=d*d+e*e;if(u<=2)return new THREE.Vector2(d,e);g=Math.sqrt(u/2)}else{var v=!1;h>f?j>f&&(v=!0):h<-f?j<-f&&(v=!0):Math.sign(i)==Math.sign(k)&&(v=!0),v?(d=-i,e=h,g=Math.sqrt(l)):(d=h,e=i,g=Math.sqrt(l/2))}return new THREE.Vector2(d/g,e/g)}function e(){if(t){var a=0,b=S*a;for(V=0;V<T;V++)R=K[V],i(R[2]+b,R[1]+b,R[0]+b);for(a=v+2*s,b=S*a,V=0;V<T;V++)R=K[V],i(R[0]+b,R[1]+b,R[2]+b)}else{for(V=0;V<T;V++)R=K[V],i(R[2],R[1],R[0]);for(V=0;V<T;V++)R=K[V],i(R[0]+S*v,R[1]+S*v,R[2]+S*v)}}function f(){var a=0;for(g(L,a),a+=L.length,C=0,D=I.length;C<D;C++)B=I[C],g(B,a),a+=B.length}function g(a,b){var c,d;for(V=a.length;--V>=0;){c=V,d=V-1,d<0&&(d=a.length-1);var e=0,f=v+2*s;for(e=0;e<f;e++){var g=S*e,h=S*(e+1);j(b+c+g,b+d+g,b+d+h,b+c+h,a,e,f,c,d)}}}function h(a,b,c){E.vertices.push(new THREE.Vector3(a,b,c))}function i(a,b,c){a+=F,b+=F,c+=F,E.faces.push(new THREE.Face3(a,b,c,null,null,y));var d=A.generateTopUV(E,a,b,c);E.faceVertexUvs[0].push(d)}function j(a,b,c,d,e,f,g,h,i){a+=F,b+=F,c+=F,d+=F,E.faces.push(new THREE.Face3(a,b,d,null,null,z)),E.faces.push(new THREE.Face3(b,c,d,null,null,z));var j=A.generateSideWallUV(E,a,b,c,d);E.faceVertexUvs[0].push([j[0],j[1],j[3]]),E.faceVertexUvs[0].push([j[1],j[2],j[3]])}var k,l,m,n,o,p=void 0!==b.amount?b.amount:100,q=void 0!==b.bevelThickness?b.bevelThickness:6,r=void 0!==b.bevelSize?b.bevelSize:q-2,s=void 0!==b.bevelSegments?b.bevelSegments:3,t=void 0===b.bevelEnabled||b.bevelEnabled,u=void 0!==b.curveSegments?b.curveSegments:12,v=void 0!==b.steps?b.steps:1,w=b.extrudePath,x=!1,y=b.material,z=b.extrudeMaterial,A=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator;w&&(k=w.getSpacedPoints(v),x=!0,t=!1,l=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(w,v,!1),m=new THREE.Vector3,n=new THREE.Vector3,o=new THREE.Vector3),t||(s=0,q=0,r=0);var B,C,D,E=this,F=this.vertices.length,G=a.extractPoints(u),H=G.shape,I=G.holes,J=!THREE.Shape.Utils.isClockWise(H);if(J){for(H=H.reverse(),C=0,D=I.length;C<D;C++)B=I[C],THREE.Shape.Utils.isClockWise(B)&&(I[C]=B.reverse());J=!1}var K=THREE.Shape.Utils.triangulateShape(H,I),L=H;for(C=0,D=I.length;C<D;C++)B=I[C],H=H.concat(B);for(var M,N,O,P,Q,R,S=H.length,T=K.length,U=[],V=0,W=L.length,X=W-1,Y=V+1;V<W;V++,X++,Y++)X===W&&(X=0),Y===W&&(Y=0),U[V]=d(L[V],L[X],L[Y]);var Z,$=[],_=U.concat();for(C=0,D=I.length;C<D;C++){for(B=I[C],Z=[],V=0,W=B.length,X=W-1,Y=V+1;V<W;V++,X++,Y++)X===W&&(X=0),Y===W&&(Y=0),Z[V]=d(B[V],B[X],B[Y]);$.push(Z),_=_.concat(Z)}for(M=0;M<s;M++){for(O=M/s,P=q*(1-O),N=r*Math.sin(O*Math.PI/2),V=0,W=L.length;V<W;V++)Q=c(L[V],U[V],N),h(Q.x,Q.y,-P);for(C=0,D=I.length;C<D;C++)for(B=I[C],Z=$[C],V=0,W=B.length;V<W;V++)Q=c(B[V],Z[V],N),h(Q.x,Q.y,-P)}for(N=r,V=0;V<S;V++)Q=t?c(H[V],_[V],N):H[V],x?(n.copy(l.normals[0]).multiplyScalar(Q.x),m.copy(l.binormals[0]).multiplyScalar(Q.y),o.copy(k[0]).add(n).add(m),h(o.x,o.y,o.z)):h(Q.x,Q.y,0);var aa;for(aa=1;aa<=v;aa++)for(V=0;V<S;V++)Q=t?c(H[V],_[V],N):H[V],x?(n.copy(l.normals[aa]).multiplyScalar(Q.x),m.copy(l.binormals[aa]).multiplyScalar(Q.y),o.copy(k[aa]).add(n).add(m),h(o.x,o.y,o.z)):h(Q.x,Q.y,p/v*aa);for(M=s-1;M>=0;M--){for(O=M/s,P=q*(1-O),N=r*Math.sin(O*Math.PI/2),V=0,W=L.length;V<W;V++)Q=c(L[V],U[V],N),h(Q.x,Q.y,p+P);for(C=0,D=I.length;C<D;C++)for(B=I[C],Z=$[C],V=0,W=B.length;V<W;V++)Q=c(B[V],Z[V],N),x?h(Q.x,Q.y+k[v-1].y,k[v-1].x+P):h(Q.x,Q.y,p+P)}e(),f()},THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d){var e=a.vertices,f=e[b],g=e[c],h=e[d];return[new THREE.Vector2(f.x,f.y),new THREE.Vector2(g.x,g.y),new THREE.Vector2(h.x,h.y)]},generateSideWallUV:function(a,b,c,d,e){var f=a.vertices,g=f[b],h=f[c],i=f[d],j=f[e];return Math.abs(g.y-h.y)<.01?[new THREE.Vector2(g.x,1-g.z),new THREE.Vector2(h.x,1-h.z),new THREE.Vector2(i.x,1-i.z),new THREE.Vector2(j.x,1-j.z)]:[new THREE.Vector2(g.y,1-g.z),new THREE.Vector2(h.y,1-h.z),new THREE.Vector2(i.y,1-i.z),new THREE.Vector2(j.y,1-j.z)]}},THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this),this.type="ShapeGeometry",a instanceof Array==!1&&(a=[a]),this.addShapeList(a,b),this.computeFaceNormals()},THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry,THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this},THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c,d,e,f=void 0!==b.curveSegments?b.curveSegments:12,g=b.material,h=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,i=this.vertices.length,j=a.extractPoints(f),k=j.shape,l=j.holes,m=!THREE.Shape.Utils.isClockWise(k);if(m){for(k=k.reverse(),c=0,d=l.length;c<d;c++)e=l[c],THREE.Shape.Utils.isClockWise(e)&&(l[c]=e.reverse());m=!1}var n=THREE.Shape.Utils.triangulateShape(k,l);for(c=0,d=l.length;c<d;c++)e=l[c],k=k.concat(e);var o,p,q=k.length,r=n.length;for(c=0;c<q;c++)o=k[c],this.vertices.push(new THREE.Vector3(o.x,o.y,0));for(c=0;c<r;c++){p=n[c];var s=p[0]+i,t=p[1]+i,u=p[2]+i;this.faces.push(new THREE.Face3(s,t,u,null,null,g)),this.faceVertexUvs[0].push(h.generateTopUV(this,s,t,u))}},THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this),this.type="LatheGeometry",this.parameters={points:a,segments:b,phiStart:c,phiLength:d},b=b||12,c=c||0,d=d||2*Math.PI;for(var e=1/(a.length-1),f=1/b,g=0,h=b;g<=h;g++)for(var i=c+g*f*d,j=Math.cos(i),k=Math.sin(i),l=0,m=a.length;l<m;l++){var n=a[l],o=new THREE.Vector3;o.x=j*n.x-k*n.y,o.y=k*n.x+j*n.y,o.z=n.z,this.vertices.push(o)}for(var p=a.length,g=0,h=b;g<h;g++)for(var l=0,m=a.length-1;l<m;l++){var q=l+p*g,r=q,s=q+p,j=q+1+p,t=q+1,u=g*f,v=l*e,w=u+f,x=v+e;this.faces.push(new THREE.Face3(r,s,t)),this.faceVertexUvs[0].push([new THREE.Vector2(u,v),new THREE.Vector2(w,v),new THREE.Vector2(u,x)]),this.faces.push(new THREE.Face3(s,j,t)),this.faceVertexUvs[0].push([new THREE.Vector2(w,v),new THREE.Vector2(w,x),new THREE.Vector2(u,x)])}this.mergeVertices(),this.computeFaceNormals(),this.computeVertexNormals()},THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry,THREE.PlaneGeometry=function(a,b,c,d){console.info("THREE.PlaneGeometry: Consider using THREE.PlaneBufferGeometry for lower memory footprint."),THREE.Geometry.call(this),this.type="PlaneGeometry",this.parameters={width:a,height:b,widthSegments:c,heightSegments:d},this.fromBufferGeometry(new THREE.PlaneBufferGeometry(a,b,c,d))},THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry,THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this),this.type="PlaneBufferGeometry",this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};for(var e=a/2,f=b/2,g=c||1,h=d||1,i=g+1,j=h+1,k=a/g,l=b/h,m=new Float32Array(i*j*3),n=new Float32Array(i*j*3),o=new Float32Array(i*j*2),p=0,q=0,r=0;r<j;r++)for(var s=r*l-f,t=0;t<i;t++){var u=t*k-e;m[p]=u,m[p+1]=-s,n[p+2]=1,o[q]=t/g,o[q+1]=1-r/h,p+=3,q+=2}p=0;for(var v=new(m.length/3>65535?Uint32Array:Uint16Array)(g*h*6),r=0;r<h;r++)for(var t=0;t<g;t++){var w=t+i*r,x=t+i*(r+1),y=t+1+i*(r+1),z=t+1+i*r;v[p]=w,v[p+1]=x,v[p+2]=z,v[p+3]=x,v[p+4]=y,v[p+5]=z,p+=6}this.addAttribute("index",new THREE.BufferAttribute(v,1)),this.addAttribute("position",new THREE.BufferAttribute(m,3)),this.addAttribute("normal",new THREE.BufferAttribute(n,3)),this.addAttribute("uv",new THREE.BufferAttribute(o,2))},THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry,THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this),this.type="RingGeometry",this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:f},a=a||0,b=b||50,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):8;var g,h,i=[],j=a,k=(b-a)/d;for(g=0;g<d+1;g++){for(h=0;h<c+1;h++){var l=new THREE.Vector3,m=e+h/c*f;l.x=j*Math.cos(m),l.y=j*Math.sin(m),this.vertices.push(l),i.push(new THREE.Vector2((l.x/b+1)/2,(l.y/b+1)/2))}j+=k}var n=new THREE.Vector3(0,0,1);for(g=0;g<d;g++){var o=g*(c+1);for(h=0;h<c;h++){var m=h+o,p=m,q=m+c+1,r=m+c+2;this.faces.push(new THREE.Face3(p,q,r,[n.clone(),n.clone(),n.clone()])),this.faceVertexUvs[0].push([i[p].clone(),i[q].clone(),i[r].clone()]),p=m,q=m+c+2,r=m+1,this.faces.push(new THREE.Face3(p,q,r,[n.clone(),n.clone(),n.clone()])),this.faceVertexUvs[0].push([i[p].clone(),i[q].clone(),i[r].clone()])}}this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,j)},THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.RingGeometry.prototype.constructor=THREE.RingGeometry,THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this),this.type="SphereGeometry",this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g},a=a||50,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,i,j=[],k=[];for(i=0;i<=c;i++){var l=[],m=[];for(h=0;h<=b;h++){var n=h/b,o=i/c,p=new THREE.Vector3;p.x=-a*Math.cos(d+n*e)*Math.sin(f+o*g),p.y=a*Math.cos(f+o*g),p.z=a*Math.sin(d+n*e)*Math.sin(f+o*g),this.vertices.push(p),l.push(this.vertices.length-1),m.push(new THREE.Vector2(n,1-o))}j.push(l),k.push(m)}for(i=0;i<c;i++)for(h=0;h<b;h++){var q=j[i][h+1],r=j[i][h],s=j[i+1][h],t=j[i+1][h+1],u=this.vertices[q].clone().normalize(),v=this.vertices[r].clone().normalize(),w=this.vertices[s].clone().normalize(),x=this.vertices[t].clone().normalize(),y=k[i][h+1].clone(),z=k[i][h].clone(),A=k[i+1][h].clone(),B=k[i+1][h+1].clone();Math.abs(this.vertices[q].y)===a?(y.x=(y.x+z.x)/2,this.faces.push(new THREE.Face3(q,s,t,[u,w,x])),this.faceVertexUvs[0].push([y,A,B])):Math.abs(this.vertices[s].y)===a?(A.x=(A.x+B.x)/2,this.faces.push(new THREE.Face3(q,r,s,[u,v,w])),this.faceVertexUvs[0].push([y,z,A])):(this.faces.push(new THREE.Face3(q,r,t,[u,v,x])),this.faceVertexUvs[0].push([y,z,B]),this.faces.push(new THREE.Face3(r,s,t,[v.clone(),w,x.clone()])),this.faceVertexUvs[0].push([z.clone(),A,B.clone()]))}this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)},THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry,THREE.TextGeometry=function(a,b){b=b||{};var c=THREE.FontUtils.generateShapes(a,b);b.amount=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),THREE.ExtrudeGeometry.call(this,c,b),this.type="TextGeometry"},THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype),THREE.TextGeometry.prototype.constructor=THREE.TextGeometry,THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this),this.type="TorusGeometry",this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e},a=a||100,b=b||40,c=c||8,d=d||6,e=e||2*Math.PI;for(var f=new THREE.Vector3,g=[],h=[],i=0;i<=c;i++)for(var j=0;j<=d;j++){var k=j/d*e,l=i/c*Math.PI*2;f.x=a*Math.cos(k),f.y=a*Math.sin(k);var m=new THREE.Vector3;m.x=(a+b*Math.cos(l))*Math.cos(k),m.y=(a+b*Math.cos(l))*Math.sin(k),m.z=b*Math.sin(l),this.vertices.push(m),g.push(new THREE.Vector2(j/d,i/c)),h.push(m.clone().sub(f).normalize())}for(var i=1;i<=c;i++)for(var j=1;j<=d;j++){var n=(d+1)*i+j-1,o=(d+1)*(i-1)+j-1,p=(d+1)*(i-1)+j,q=(d+1)*i+j,r=new THREE.Face3(n,o,q,[h[n].clone(),h[o].clone(),h[q].clone()]);this.faces.push(r),this.faceVertexUvs[0].push([g[n].clone(),g[o].clone(),g[q].clone()]),r=new THREE.Face3(o,p,q,[h[o].clone(),h[p].clone(),h[q].clone()]),this.faces.push(r),this.faceVertexUvs[0].push([g[o].clone(),g[p].clone(),g[q].clone()])}this.computeFaceNormals()},THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry,THREE.TorusKnotGeometry=function(a,b,c,d,e,f,g){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a),h=b/c*a,i=Math.cos(h),j=d*(2+i)*.5*f,k=d*(2+i)*g*.5,l=e*d*Math.sin(h)*.5;return new THREE.Vector3(j,k,l)}THREE.Geometry.call(this),this.type="TorusKnotGeometry",this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:f,heightScale:g},a=a||100,b=b||40,c=c||64,d=d||8,e=e||2,f=f||3,g=g||1;for(var i=new Array(c),j=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,m=0;m<c;++m){i[m]=new Array(d);var n=m/c*2*e*Math.PI,o=h(n,f,e,a,g),p=h(n+.01,f,e,a,g);j.subVectors(p,o),k.addVectors(p,o),l.crossVectors(j,k),k.crossVectors(l,j),l.normalize(),k.normalize();for(var q=0;q<d;++q){var r=q/d*2*Math.PI,s=-b*Math.cos(r),t=b*Math.sin(r),u=new THREE.Vector3;u.x=o.x+s*k.x+t*l.x,u.y=o.y+s*k.y+t*l.y,u.z=o.z+s*k.z+t*l.z,i[m][q]=this.vertices.push(u)-1}}for(var m=0;m<c;++m)for(var q=0;q<d;++q){var v=(m+1)%c,w=(q+1)%d,x=i[m][q],y=i[v][q],z=i[v][w],A=i[m][w],B=new THREE.Vector2(m/c,q/d),C=new THREE.Vector2((m+1)/c,q/d),D=new THREE.Vector2((m+1)/c,(q+1)/d),E=new THREE.Vector2(m/c,(q+1)/d);this.faces.push(new THREE.Face3(x,y,A)),this.faceVertexUvs[0].push([B,C,E]),this.faces.push(new THREE.Face3(y,z,A)),this.faceVertexUvs[0].push([C.clone(),D,E.clone()])}this.computeFaceNormals(),this.computeVertexNormals()},THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry,THREE.TubeGeometry=function(a,b,c,d,e,f){function g(a,b,c){return C.vertices.push(new THREE.Vector3(a,b,c))-1}THREE.Geometry.call(this),this.type="TubeGeometry",this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e},b=b||64,c=c||1,d=d||8,e=e||!1,f=f||THREE.TubeGeometry.NoTaper;var h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B=[],C=this,D=b+1,E=new THREE.Vector3,F=new THREE.TubeGeometry.FrenetFrames(a,b,e),G=F.tangents,H=F.normals,I=F.binormals;for(this.tangents=G,this.normals=H,this.binormals=I,p=0;p<D;p++)for(B[p]=[],j=p/(D-1),o=a.getPointAt(j),G[p],h=H[p],i=I[p],l=c*f(j),q=0;q<d;q++)k=q/d*2*Math.PI,m=-l*Math.cos(k),n=l*Math.sin(k),E.copy(o),E.x+=m*h.x+n*i.x,E.y+=m*h.y+n*i.y,E.z+=m*h.z+n*i.z,B[p][q]=g(E.x,E.y,E.z);for(p=0;p<b;p++)for(q=0;q<d;q++)r=e?(p+1)%b:p+1,s=(q+1)%d,t=B[p][q],u=B[r][q],v=B[r][s],w=B[p][s],x=new THREE.Vector2(p/b,q/d),y=new THREE.Vector2((p+1)/b,q/d),z=new THREE.Vector2((p+1)/b,(q+1)/d),A=new THREE.Vector2(p/b,(q+1)/d),this.faces.push(new THREE.Face3(t,u,w)),this.faceVertexUvs[0].push([x,y,A]),this.faces.push(new THREE.Face3(u,v,w)),
  this.faceVertexUvs[0].push([y.clone(),z,A.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry,THREE.TubeGeometry.NoTaper=function(a){return 1},THREE.TubeGeometry.SinusoidalTaper=function(a){return Math.sin(Math.PI*a)},THREE.TubeGeometry.FrenetFrames=function(a,b,c){function d(){n[0]=new THREE.Vector3,o[0]=new THREE.Vector3,f=Number.MAX_VALUE,g=Math.abs(m[0].x),h=Math.abs(m[0].y),i=Math.abs(m[0].z),g<=f&&(f=g,l.set(1,0,0)),h<=f&&(f=h,l.set(0,1,0)),i<=f&&l.set(0,0,1),p.crossVectors(m[0],l).normalize(),n[0].crossVectors(m[0],p),o[0].crossVectors(m[0],n[0])}var e,f,g,h,i,j,k,l=new THREE.Vector3,m=[],n=[],o=[],p=new THREE.Vector3,q=new THREE.Matrix4,r=b+1,s=1e-4;for(this.tangents=m,this.normals=n,this.binormals=o,j=0;j<r;j++)k=j/(r-1),m[j]=a.getTangentAt(k),m[j].normalize();for(d(),j=1;j<r;j++)n[j]=n[j-1].clone(),o[j]=o[j-1].clone(),p.crossVectors(m[j-1],m[j]),p.length()>s&&(p.normalize(),e=Math.acos(THREE.Math.clamp(m[j-1].dot(m[j]),-1,1)),n[j].applyMatrix4(q.makeRotationAxis(p,e))),o[j].crossVectors(m[j],n[j]);if(c)for(e=Math.acos(THREE.Math.clamp(n[0].dot(n[r-1]),-1,1)),e/=r-1,m[0].dot(p.crossVectors(n[0],n[r-1]))>0&&(e=-e),j=1;j<r;j++)n[j].applyMatrix4(q.makeRotationAxis(m[j],e*j)),o[j].crossVectors(m[j],n[j])},THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=k.vertices.push(b)-1;var c=h(a)/2/Math.PI+.5,d=i(a)/Math.PI+.5;return b.uv=new THREE.Vector2(c,1-d),b}function f(a,b,c){var d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()]);k.faces.push(d),t.copy(a).add(b).add(c).divideScalar(3);var e=h(t);k.faceVertexUvs[0].push([j(a.uv,a,e),j(b.uv,b,e),j(c.uv,c,e)])}function g(a,b){for(var c=Math.pow(2,b),d=e(k.vertices[a.a]),g=e(k.vertices[a.b]),h=e(k.vertices[a.c]),i=[],j=0;j<=c;j++){i[j]=[];for(var l=e(d.clone().lerp(h,j/c)),m=e(g.clone().lerp(h,j/c)),n=c-j,o=0;o<=n;o++)i[j][o]=0==o&&j==c?l:e(l.clone().lerp(m,o/n))}for(var j=0;j<c;j++)for(var o=0;o<2*(c-j)-1;o++){var p=Math.floor(o/2);o%2==0?f(i[j][p+1],i[j+1][p],i[j][p]):f(i[j][p+1],i[j+1][p+1],i[j+1][p])}}function h(a){return Math.atan2(a.z,-a.x)}function i(a){return Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))}function j(a,b,c){return c<0&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y)),0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+.5,a.y)),a.clone()}THREE.Geometry.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:a,indices:b,radius:c,detail:d},c=c||1,d=d||0;for(var k=this,l=0,m=a.length;l<m;l+=3)e(new THREE.Vector3(a[l],a[l+1],a[l+2]));for(var n=this.vertices,o=[],l=0,p=0,m=b.length;l<m;l+=3,p++){var q=n[b[l]],r=n[b[l+1]],s=n[b[l+2]];o[p]=new THREE.Face3(q.index,r.index,s.index,[q.clone(),r.clone(),s.clone()])}for(var t=new THREE.Vector3,l=0,m=o.length;l<m;l++)g(o[l],d);for(var l=0,m=this.faceVertexUvs[0].length;l<m;l++){var u=this.faceVertexUvs[0][l],v=u[0].x,w=u[1].x,x=u[2].x,y=Math.max(v,Math.max(w,x)),z=Math.min(v,Math.min(w,x));y>.9&&z<.1&&(v<.2&&(u[0].x+=1),w<.2&&(u[1].x+=1),x<.2&&(u[2].x+=1))}for(var l=0,m=this.vertices.length;l<m;l++)this.vertices[l].multiplyScalar(c);this.mergeVertices(),this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)},THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry,THREE.DodecahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};var c=(1+Math.sqrt(5))/2,d=1/c,e=[-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,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],f=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];THREE.PolyhedronGeometry.call(this,e,f,a,b)},THREE.DodecahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.DodecahedronGeometry.prototype.constructor=THREE.DodecahedronGeometry,THREE.IcosahedronGeometry=function(a,b){var c=(1+Math.sqrt(5))/2,d=[-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],e=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];THREE.PolyhedronGeometry.call(this,d,e,a,b),this.type="IcosahedronGeometry",this.parameters={radius:a,detail:b}},THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry,THREE.OctahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};var c=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],d=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];THREE.PolyhedronGeometry.call(this,c,d,a,b),this.type="OctahedronGeometry",this.parameters={radius:a,detail:b}},THREE.OctahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry,THREE.TetrahedronGeometry=function(a,b){var c=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],d=[2,1,0,0,3,2,1,3,0,2,3,1];THREE.PolyhedronGeometry.call(this,c,d,a,b),this.type="TetrahedronGeometry",this.parameters={radius:a,detail:b}},THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TetrahedronGeometry.prototype.constructor=THREE.TetrahedronGeometry,THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this),this.type="ParametricGeometry",this.parameters={func:a,slices:b,stacks:c};var d,e,f,g,h,i=this.vertices,j=this.faces,k=this.faceVertexUvs[0],l=b+1;for(d=0;d<=c;d++)for(h=d/c,e=0;e<=b;e++)g=e/b,f=a(g,h),i.push(f);var m,n,o,p,q,r,s,t;for(d=0;d<c;d++)for(e=0;e<b;e++)m=d*l+e,n=d*l+e+1,o=(d+1)*l+e+1,p=(d+1)*l+e,q=new THREE.Vector2(e/b,d/c),r=new THREE.Vector2((e+1)/b,d/c),s=new THREE.Vector2((e+1)/b,(d+1)/c),t=new THREE.Vector2(e/b,(d+1)/c),j.push(new THREE.Face3(m,n,p)),k.push([q,r,t]),j.push(new THREE.Face3(n,o,p)),k.push([r.clone(),s,t.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry,THREE.AxisHelper=function(a){a=a||1;var b=new Float32Array([0,0,0,a,0,0,0,0,0,0,a,0,0,0,0,0,0,a]),c=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]),d=new THREE.BufferGeometry;d.addAttribute("position",new THREE.BufferAttribute(b,3)),d.addAttribute("color",new THREE.BufferAttribute(c,3));var e=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});THREE.Line.call(this,d,e,THREE.LinePieces)},THREE.AxisHelper.prototype=Object.create(THREE.Line.prototype),THREE.AxisHelper.prototype.constructor=THREE.AxisHelper,THREE.ArrowHelper=function(){var a=new THREE.Geometry;a.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1,0));var b=new THREE.CylinderGeometry(0,.5,1,5,1);return b.applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0)),function(c,d,e,f,g,h){THREE.Object3D.call(this),void 0===f&&(f=16776960),void 0===e&&(e=1),void 0===g&&(g=.2*e),void 0===h&&(h=.2*g),this.position.copy(d),this.line=new THREE.Line(a,new THREE.LineBasicMaterial({color:f})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:f})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(c),this.setLength(e,g,h)}}(),THREE.ArrowHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.ArrowHelper.prototype.constructor=THREE.ArrowHelper,THREE.ArrowHelper.prototype.setDirection=function(){var a,b=new THREE.Vector3;return function(c){c.y>.99999?this.quaternion.set(0,0,0,1):c.y<-.99999?this.quaternion.set(1,0,0,0):(b.set(c.z,0,-c.x).normalize(),a=Math.acos(c.y),this.quaternion.setFromAxisAngle(b,a))}}(),THREE.ArrowHelper.prototype.setLength=function(a,b,c){void 0===b&&(b=.2*a),void 0===c&&(c=.2*b),this.line.scale.set(1,a-b,1),this.line.updateMatrix(),this.cone.scale.set(c,b,c),this.cone.position.y=a,this.cone.updateMatrix()},THREE.ArrowHelper.prototype.setColor=function(a){this.line.material.color.set(a),this.cone.material.color.set(a)},THREE.BoxHelper=function(a){var b=new THREE.BufferGeometry;b.addAttribute("position",new THREE.BufferAttribute(new Float32Array(72),3)),THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:16776960}),THREE.LinePieces),void 0!==a&&this.update(a)},THREE.BoxHelper.prototype=Object.create(THREE.Line.prototype),THREE.BoxHelper.prototype.constructor=THREE.BoxHelper,THREE.BoxHelper.prototype.update=function(a){var b=a.geometry;null===b.boundingBox&&b.computeBoundingBox();var c=b.boundingBox.min,d=b.boundingBox.max,e=this.geometry.attributes.position.array;e[0]=d.x,e[1]=d.y,e[2]=d.z,e[3]=c.x,e[4]=d.y,e[5]=d.z,e[6]=c.x,e[7]=d.y,e[8]=d.z,e[9]=c.x,e[10]=c.y,e[11]=d.z,e[12]=c.x,e[13]=c.y,e[14]=d.z,e[15]=d.x,e[16]=c.y,e[17]=d.z,e[18]=d.x,e[19]=c.y,e[20]=d.z,e[21]=d.x,e[22]=d.y,e[23]=d.z,e[24]=d.x,e[25]=d.y,e[26]=c.z,e[27]=c.x,e[28]=d.y,e[29]=c.z,e[30]=c.x,e[31]=d.y,e[32]=c.z,e[33]=c.x,e[34]=c.y,e[35]=c.z,e[36]=c.x,e[37]=c.y,e[38]=c.z,e[39]=d.x,e[40]=c.y,e[41]=c.z,e[42]=d.x,e[43]=c.y,e[44]=c.z,e[45]=d.x,e[46]=d.y,e[47]=c.z,e[48]=d.x,e[49]=d.y,e[50]=d.z,e[51]=d.x,e[52]=d.y,e[53]=c.z,e[54]=c.x,e[55]=d.y,e[56]=d.z,e[57]=c.x,e[58]=d.y,e[59]=c.z,e[60]=c.x,e[61]=c.y,e[62]=d.z,e[63]=c.x,e[64]=c.y,e[65]=c.z,e[66]=d.x,e[67]=c.y,e[68]=d.z,e[69]=d.x,e[70]=c.y,e[71]=c.z,this.geometry.attributes.position.needsUpdate=!0,this.geometry.computeBoundingSphere(),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1},THREE.BoundingBoxHelper=function(a,b){var c=void 0!==b?b:8947848;this.object=a,this.box=new THREE.Box3,THREE.Mesh.call(this,new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:c,wireframe:!0}))},THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype),THREE.BoundingBoxHelper.prototype.constructor=THREE.BoundingBoxHelper,THREE.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object),this.box.size(this.scale),this.box.center(this.position)},THREE.CameraHelper=function(a){function b(a,b,d){c(a,d),c(b,d)}function c(a,b){d.vertices.push(new THREE.Vector3),d.colors.push(new THREE.Color(b)),void 0===f[a]&&(f[a]=[]),f[a].push(d.vertices.length-1)}var d=new THREE.Geometry,e=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors}),f={},g=16755200,h=16711680,i=43775,j=3355443;b("n1","n2",g),b("n2","n4",g),b("n4","n3",g),b("n3","n1",g),b("f1","f2",g),b("f2","f4",g),b("f4","f3",g),b("f3","f1",g),b("n1","f1",g),b("n2","f2",g),b("n3","f3",g),b("n4","f4",g),b("p","n1",h),b("p","n2",h),b("p","n3",h),b("p","n4",h),b("u1","u2",i),b("u2","u3",i),b("u3","u1",i),b("c","t",16777215),b("p","c",j),b("cn1","cn2",j),b("cn3","cn4",j),b("cf1","cf2",j),b("cf3","cf4",j),THREE.Line.call(this,d,e,THREE.LinePieces),this.camera=a,this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=f,this.update()},THREE.CameraHelper.prototype=Object.create(THREE.Line.prototype),THREE.CameraHelper.prototype.constructor=THREE.CameraHelper,THREE.CameraHelper.prototype.update=function(){var a,b,c=new THREE.Vector3,d=new THREE.Camera,e=function(e,f,g,h){c.set(f,g,h).unproject(d);var i=b[e];if(void 0!==i)for(var j=0,k=i.length;j<k;j++)a.vertices[i[j]].copy(c)};return function(){a=this.geometry,b=this.pointMap;var c=1,f=1;d.projectionMatrix.copy(this.camera.projectionMatrix),e("c",0,0,-1),e("t",0,0,1),e("n1",-c,-f,-1),e("n2",c,-f,-1),e("n3",-c,f,-1),e("n4",c,f,-1),e("f1",-c,-f,1),e("f2",c,-f,1),e("f3",-c,f,1),e("f4",c,f,1),e("u1",.7*c,1.1*f,-1),e("u2",.7*-c,1.1*f,-1),e("u3",0,2*f,-1),e("cf1",-c,0,1),e("cf2",c,0,1),e("cf3",0,-f,1),e("cf4",0,f,1),e("cn1",-c,0,-1),e("cn2",c,0,-1),e("cn3",0,-f,-1),e("cn4",0,f,-1),a.verticesNeedUpdate=!0}}(),THREE.DirectionalLightHelper=function(a,b){THREE.Object3D.call(this),this.light=a,this.light.updateMatrixWorld(),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1,b=b||1;var c=new THREE.Geometry;c.vertices.push(new THREE.Vector3(-b,b,0),new THREE.Vector3(b,b,0),new THREE.Vector3(b,-b,0),new THREE.Vector3(-b,-b,0),new THREE.Vector3(-b,b,0));var d=new THREE.LineBasicMaterial({fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.lightPlane=new THREE.Line(c,d),this.add(this.lightPlane),c=new THREE.Geometry,c.vertices.push(new THREE.Vector3,new THREE.Vector3),d=new THREE.LineBasicMaterial({fog:!1}),d.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine=new THREE.Line(c,d),this.add(this.targetLine),this.update()},THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.DirectionalLightHelper.prototype.constructor=THREE.DirectionalLightHelper,THREE.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},THREE.DirectionalLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(){a.setFromMatrixPosition(this.light.matrixWorld),b.setFromMatrixPosition(this.light.target.matrixWorld),c.subVectors(b,a),this.lightPlane.lookAt(c),this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine.geometry.vertices[1].copy(c),this.targetLine.geometry.verticesNeedUpdate=!0,this.targetLine.material.color.copy(this.lightPlane.material.color)}}(),THREE.EdgesHelper=function(a,b,c){var d=void 0!==b?b:16777215;c=void 0!==c?c:1;var e,f=Math.cos(THREE.Math.degToRad(c)),g=[0,0],h={},i=function(a,b){return a-b},j=["a","b","c"],k=new THREE.BufferGeometry;a.geometry instanceof THREE.BufferGeometry?(e=new THREE.Geometry,e.fromBufferGeometry(a.geometry)):e=a.geometry.clone(),e.mergeVertices(),e.computeFaceNormals();for(var l=e.vertices,m=e.faces,n=0,o=0,p=m.length;o<p;o++)for(var q=m[o],r=0;r<3;r++){g[0]=q[j[r]],g[1]=q[j[(r+1)%3]],g.sort(i);var s=g.toString();void 0===h[s]?(h[s]={vert1:g[0],vert2:g[1],face1:o,face2:void 0},n++):h[s].face2=o}var t=new Float32Array(2*n*3),u=0;for(var s in h){var v=h[s];if(void 0===v.face2||m[v.face1].normal.dot(m[v.face2].normal)<=f){var w=l[v.vert1];t[u++]=w.x,t[u++]=w.y,t[u++]=w.z,w=l[v.vert2],t[u++]=w.x,t[u++]=w.y,t[u++]=w.z}}k.addAttribute("position",new THREE.BufferAttribute(t,3)),THREE.Line.call(this,k,new THREE.LineBasicMaterial({color:d}),THREE.LinePieces),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1},THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype),THREE.EdgesHelper.prototype.constructor=THREE.EdgesHelper,THREE.FaceNormalsHelper=function(a,b,c,d){this.object=a,this.size=void 0!==b?b:1;for(var e=void 0!==c?c:16776960,f=void 0!==d?d:1,g=new THREE.Geometry,h=this.object.geometry.faces,i=0,j=h.length;i<j;i++)g.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,g,new THREE.LineBasicMaterial({color:e,linewidth:f}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new THREE.Matrix3,this.update()},THREE.FaceNormalsHelper.prototype=Object.create(THREE.Line.prototype),THREE.FaceNormalsHelper.prototype.constructor=THREE.FaceNormalsHelper,THREE.FaceNormalsHelper.prototype.update=function(){var a=this.geometry.vertices,b=this.object,c=b.geometry.vertices,d=b.geometry.faces,e=b.matrixWorld;b.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(e);for(var f=0,g=0,h=d.length;f<h;f++,g+=2){var i=d[f];a[g].copy(c[i.a]).add(c[i.b]).add(c[i.c]).divideScalar(3).applyMatrix4(e),a[g+1].copy(i.normal).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a[g])}return this.geometry.verticesNeedUpdate=!0,this},THREE.GridHelper=function(a,b){var c=new THREE.Geometry,d=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});this.color1=new THREE.Color(4473924),this.color2=new THREE.Color(8947848);for(var e=-a;e<=a;e+=b){c.vertices.push(new THREE.Vector3(-a,0,e),new THREE.Vector3(a,0,e),new THREE.Vector3(e,0,-a),new THREE.Vector3(e,0,a));var f=0===e?this.color1:this.color2;c.colors.push(f,f,f,f)}THREE.Line.call(this,c,d,THREE.LinePieces)},THREE.GridHelper.prototype=Object.create(THREE.Line.prototype),THREE.GridHelper.prototype.constructor=THREE.GridHelper,THREE.GridHelper.prototype.setColors=function(a,b){this.color1.set(a),this.color2.set(b),this.geometry.colorsNeedUpdate=!0},THREE.HemisphereLightHelper=function(a,b){THREE.Object3D.call(this),this.light=a,this.light.updateMatrixWorld(),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1,this.colors=[new THREE.Color,new THREE.Color];var c=new THREE.SphereGeometry(b,4,2);c.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));for(var d=0,e=8;d<e;d++)c.faces[d].color=this.colors[d<4?0:1];var f=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0});this.lightSphere=new THREE.Mesh(c,f),this.add(this.lightSphere),this.update()},THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.HemisphereLightHelper.prototype.constructor=THREE.HemisphereLightHelper,THREE.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose(),this.lightSphere.material.dispose()},THREE.HemisphereLightHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),this.lightSphere.lookAt(a.setFromMatrixPosition(this.light.matrixWorld).negate()),this.lightSphere.geometry.colorsNeedUpdate=!0}}(),THREE.PointLightHelper=function(a,b){this.light=a,this.light.updateMatrixWorld();var c=new THREE.SphereGeometry(b,4,2),d=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity),THREE.Mesh.call(this,c,d),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1},THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype),THREE.PointLightHelper.prototype.constructor=THREE.PointLightHelper,THREE.PointLightHelper.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},THREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)},THREE.SkeletonHelper=function(a){this.bones=this.getBoneList(a);for(var b=new THREE.Geometry,c=0;c<this.bones.length;c++){this.bones[c].parent instanceof THREE.Bone&&(b.vertices.push(new THREE.Vector3),b.vertices.push(new THREE.Vector3),b.colors.push(new THREE.Color(0,0,1)),b.colors.push(new THREE.Color(0,1,0)))}var d=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors,depthTest:!1,depthWrite:!1,transparent:!0});THREE.Line.call(this,b,d,THREE.LinePieces),this.root=a,this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1,this.update()},THREE.SkeletonHelper.prototype=Object.create(THREE.Line.prototype),THREE.SkeletonHelper.prototype.constructor=THREE.SkeletonHelper,THREE.SkeletonHelper.prototype.getBoneList=function(a){var b=[];a instanceof THREE.Bone&&b.push(a);for(var c=0;c<a.children.length;c++)b.push.apply(b,this.getBoneList(a.children[c]));return b},THREE.SkeletonHelper.prototype.update=function(){for(var a=this.geometry,b=(new THREE.Matrix4).getInverse(this.root.matrixWorld),c=new THREE.Matrix4,d=0,e=0;e<this.bones.length;e++){var f=this.bones[e];f.parent instanceof THREE.Bone&&(c.multiplyMatrices(b,f.matrixWorld),a.vertices[d].setFromMatrixPosition(c),c.multiplyMatrices(b,f.parent.matrixWorld),a.vertices[d+1].setFromMatrixPosition(c),d+=2)}a.verticesNeedUpdate=!0,a.computeBoundingSphere()},THREE.SpotLightHelper=function(a){THREE.Object3D.call(this),this.light=a,this.light.updateMatrixWorld(),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1;var b=new THREE.CylinderGeometry(0,1,1,8,1,!0);b.applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0)),b.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));var c=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});this.cone=new THREE.Mesh(b,c),this.add(this.cone),this.update()},THREE.SpotLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.SpotLightHelper.prototype.constructor=THREE.SpotLightHelper,THREE.SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},THREE.SpotLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){var c=this.light.distance?this.light.distance:1e4,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)),this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}(),THREE.VertexNormalsHelper=function(a,b,c,d){this.object=a,this.size=void 0!==b?b:1;for(var e=void 0!==c?c:16711680,f=void 0!==d?d:1,g=new THREE.Geometry,h=a.geometry.faces,i=0,j=h.length;i<j;i++)for(var k=h[i],l=0,m=k.vertexNormals.length;l<m;l++)g.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,g,new THREE.LineBasicMaterial({color:e,linewidth:f}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new THREE.Matrix3,this.update()},THREE.VertexNormalsHelper.prototype=Object.create(THREE.Line.prototype),THREE.VertexNormalsHelper.prototype.constructor=THREE.VertexNormalsHelper,THREE.VertexNormalsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){var c=["a","b","c","d"];this.object.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,i=0,j=f.length;i<j;i++)for(var k=f[i],l=0,m=k.vertexNormals.length;l<m;l++){var n=k[c[l]],o=e[n],p=k.vertexNormals[l];d[h].copy(o).applyMatrix4(g),b.copy(p).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size),b.add(d[h]),h+=1,d[h].copy(b),h+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),THREE.VertexTangentsHelper=function(a,b,c,d){this.object=a,this.size=void 0!==b?b:1;for(var e=void 0!==c?c:255,f=void 0!==d?d:1,g=new THREE.Geometry,h=a.geometry.faces,i=0,j=h.length;i<j;i++)for(var k=h[i],l=0,m=k.vertexTangents.length;l<m;l++)g.vertices.push(new THREE.Vector3),g.vertices.push(new THREE.Vector3);THREE.Line.call(this,g,new THREE.LineBasicMaterial({color:e,linewidth:f}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.update()},THREE.VertexTangentsHelper.prototype=Object.create(THREE.Line.prototype),THREE.VertexTangentsHelper.prototype.constructor=THREE.VertexTangentsHelper,THREE.VertexTangentsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){var c=["a","b","c","d"];this.object.updateMatrixWorld(!0);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,i=0,j=f.length;i<j;i++)for(var k=f[i],l=0,m=k.vertexTangents.length;l<m;l++){var n=k[c[l]],o=e[n],p=k.vertexTangents[l];d[h].copy(o).applyMatrix4(g),b.copy(p).transformDirection(g).multiplyScalar(this.size),b.add(d[h]),h+=1,d[h].copy(b),h+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),THREE.WireframeHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry;if(a.geometry instanceof THREE.Geometry){for(var i=a.geometry.vertices,j=a.geometry.faces,k=0,l=new Uint32Array(6*j.length),m=0,n=j.length;m<n;m++)for(var o=j[m],p=0;p<3;p++){d[0]=o[g[p]],d[1]=o[g[(p+1)%3]],d.sort(f);var q=d.toString();void 0===e[q]&&(l[2*k]=d[0],l[2*k+1]=d[1],e[q]=!0,k++)}for(var r=new Float32Array(2*k*3),m=0,n=k;m<n;m++)for(var p=0;p<2;p++){var s=i[l[2*m+p]],t=6*m+3*p;r[t+0]=s.x,r[t+1]=s.y,r[t+2]=s.z}h.addAttribute("position",new THREE.BufferAttribute(r,3))}else if(a.geometry instanceof THREE.BufferGeometry)if(void 0!==a.geometry.attributes.index){var i=a.geometry.attributes.position.array,u=a.geometry.attributes.index.array,v=a.geometry.drawcalls,k=0;0===v.length&&(v=[{count:u.length,index:0,start:0}]);for(var l=new Uint32Array(2*u.length),w=0,x=v.length;w<x;++w)for(var y=v[w].start,z=v[w].count,t=v[w].index,m=y,A=y+z;m<A;m+=3)for(var p=0;p<3;p++){d[0]=t+u[m+p],d[1]=t+u[m+(p+1)%3],d.sort(f);var q=d.toString();void 0===e[q]&&(l[2*k]=d[0],l[2*k+1]=d[1],e[q]=!0,k++)}for(var r=new Float32Array(2*k*3),m=0,n=k;m<n;m++)for(var p=0;p<2;p++){var t=6*m+3*p,B=3*l[2*m+p];r[t+0]=i[B],r[t+1]=i[B+1],r[t+2]=i[B+2]}h.addAttribute("position",new THREE.BufferAttribute(r,3))}else{for(var i=a.geometry.attributes.position.array,k=i.length/3,C=k/3,r=new Float32Array(2*k*3),m=0,n=C;m<n;m++)for(var p=0;p<3;p++){var t=18*m+6*p,D=9*m+3*p;r[t+0]=i[D],r[t+1]=i[D+1],r[t+2]=i[D+2];var B=9*m+(p+1)%3*3;r[t+3]=i[B],r[t+4]=i[B+1],r[t+5]=i[B+2]}h.addAttribute("position",new THREE.BufferAttribute(r,3))}THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1},THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype),THREE.WireframeHelper.prototype.constructor=THREE.WireframeHelper,THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this),this.render=function(a){}},THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype),THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject,THREE.MorphBlendMesh=function(a,b){THREE.Mesh.call(this,a,b),this.animationsMap={},this.animationsList=[];var c=this.geometry.morphTargets.length,d="__default",e=c-1,f=c/1;this.createAnimation(d,0,e,f),this.setAnimationWeight(d,1)},THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh,THREE.MorphBlendMesh.prototype.createAnimation=function(a,b,c,d){var e={startFrame:b,endFrame:c,length:c-b+1,fps:d,duration:(c-b)/d,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[a]=e,this.animationsList.push(e)},THREE.MorphBlendMesh.prototype.autoCreateAnimations=function(a){for(var b,c=/([a-z]+)_?(\d+)/,d={},e=this.geometry,f=0,g=e.morphTargets.length;f<g;f++){var h=e.morphTargets[f],i=h.name.match(c);if(i&&i.length>1){var j=i[1];d[j]||(d[j]={start:1/0,end:-1/0});var k=d[j];f<k.start&&(k.start=f),f>k.end&&(k.end=f),b||(b=j)}}for(var j in d){var k=d[j];this.createAnimation(j,k.start,k.end,a)}this.firstAnimation=b},THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(a){var b=this.animationsMap[a];b&&(b.direction=1,b.directionBackwards=!1)},THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(a){var b=this.animationsMap[a];b&&(b.direction=-1,b.directionBackwards=!0)},THREE.MorphBlendMesh.prototype.setAnimationFPS=function(a,b){var c=this.animationsMap[a];c&&(c.fps=b,c.duration=(c.end-c.start)/c.fps)},THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/c.duration)},THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)},THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)},THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0,c=this.animationsMap[a];return c&&(b=c.time),b},THREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1,c=this.animationsMap[a];return c&&(b=c.duration),b},THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):THREE.warn("THREE.MorphBlendMesh: animation["+a+"] undefined in .playAnimation()")},THREE.MorphBlendMesh.prototype.stopAnimation=function(a){var b=this.animationsMap[a];b&&(b.active=!1)},THREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;b<c;b++){var d=this.animationsList[b];if(d.active){var e=d.duration/d.length;d.time+=d.direction*a,d.mirroredLoop?(d.time>d.duration||d.time<0)&&(d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),d.time<0&&(d.time=0,d.directionBackwards=!1)):(d.time=d.time%d.duration,d.time<0&&(d.time+=d.duration));var f=d.startFrame+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),g=d.weight;f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f);var h=d.time%e/e;d.directionBackwards&&(h=1-h),this.morphTargetInfluences[d.currentFrame]=h*g,this.morphTargetInfluences[d.lastFrame]=(1-h)*g}}},THREE.OrbitControls=function(a,b){function c(){return 2*Math.PI/60/60*o.autoRotateSpeed}function d(){return Math.pow(.95,o.zoomSpeed)}function e(a){if(!1!==o.enabled){if(a.preventDefault(),a.button===o.mouseButtons.ORBIT){if(!0===o.noRotate)return;I=H.ROTATE,q.set(a.clientX,a.clientY)}else if(a.button===o.mouseButtons.ZOOM){if(!0===o.noZoom)return;I=H.DOLLY,y.set(a.clientX,a.clientY)}else if(a.button===o.mouseButtons.PAN){if(!0===o.noPan)return;I=H.PAN,t.set(a.clientX,a.clientY)}I!==H.NONE&&(document.addEventListener("mousemove",f,!1),document.addEventListener("mouseup",g,!1),o.dispatchEvent(M))}}function f(a){if(!1!==o.enabled){a.preventDefault();var b=o.domElement===document?o.domElement.body:o.domElement;if(I===H.ROTATE){if(!0===o.noRotate)return;r.set(a.clientX,a.clientY),s.subVectors(r,q),o.rotateLeft(2*Math.PI*s.x/b.clientWidth*o.rotateSpeed),o.rotateUp(2*Math.PI*s.y/b.clientHeight*o.rotateSpeed),q.copy(r)}else if(I===H.DOLLY){if(!0===o.noZoom)return;z.set(a.clientX,a.clientY),A.subVectors(z,y),A.y>0?o.dollyIn():A.y<0&&o.dollyOut(),y.copy(z)}else if(I===H.PAN){if(!0===o.noPan)return;u.set(a.clientX,a.clientY),v.subVectors(u,t),o.pan(v.x,v.y),t.copy(u)}I!==H.NONE&&o.update()}}function g(){!1!==o.enabled&&(document.removeEventListener("mousemove",f,!1),document.removeEventListener("mouseup",g,!1),o.dispatchEvent(N),I=H.NONE)}function h(a){if(!1!==o.enabled&&!0!==o.noZoom&&I===H.NONE){a.preventDefault(),a.stopPropagation();var b=0;void 0!==a.wheelDelta?b=a.wheelDelta:void 0!==a.detail&&(b=-a.detail),b>0?o.dollyOut():b<0&&o.dollyIn(),o.update(),o.dispatchEvent(M),o.dispatchEvent(N)}}function i(a){if(!1!==o.enabled&&!0!==o.noKeys&&!0!==o.noPan)switch(a.keyCode){case o.keys.UP:o.pan(0,o.keyPanSpeed),o.update();break;case o.keys.BOTTOM:o.pan(0,-o.keyPanSpeed),o.update();break;case o.keys.LEFT:o.pan(o.keyPanSpeed,0),o.update();break;case o.keys.RIGHT:o.pan(-o.keyPanSpeed,0),o.update()}}function j(a){if(!1!==o.enabled){switch(a.touches.length){case 1:if(!0===o.noRotate)return;I=H.TOUCH_ROTATE,q.set(a.touches[0].pageX,a.touches[0].pageY);break;case 2:if(!0===o.noZoom)return;I=H.TOUCH_DOLLY;var b=a.touches[0].pageX-a.touches[1].pageX,c=a.touches[0].pageY-a.touches[1].pageY,d=Math.sqrt(b*b+c*c);y.set(0,d);break;case 3:if(!0===o.noPan)return;I=H.TOUCH_PAN,t.set(a.touches[0].pageX,a.touches[0].pageY);break;default:I=H.NONE}I!==H.NONE&&o.dispatchEvent(M)}}function k(a){if(!1!==o.enabled){a.preventDefault(),a.stopPropagation();var b=o.domElement===document?o.domElement.body:o.domElement;switch(a.touches.length){case 1:if(!0===o.noRotate)return;if(I!==H.TOUCH_ROTATE)return;r.set(a.touches[0].pageX,a.touches[0].pageY),s.subVectors(r,q),o.rotateLeft(2*Math.PI*s.x/b.clientWidth*o.rotateSpeed),o.rotateUp(2*Math.PI*s.y/b.clientHeight*o.rotateSpeed),q.copy(r),o.update();break;case 2:if(!0===o.noZoom)return;if(I!==H.TOUCH_DOLLY)return;var c=a.touches[0].pageX-a.touches[1].pageX,d=a.touches[0].pageY-a.touches[1].pageY,e=Math.sqrt(c*c+d*d);z.set(0,e),A.subVectors(z,y),A.y>0?o.dollyOut():A.y<0&&o.dollyIn(),y.copy(z),o.update();break;case 3:if(!0===o.noPan)return;if(I!==H.TOUCH_PAN)return;u.set(a.touches[0].pageX,a.touches[0].pageY),v.subVectors(u,t),o.pan(v.x,v.y),t.copy(u),o.update();break;default:I=H.NONE}}}function l(){!1!==o.enabled&&(o.dispatchEvent(N),I=H.NONE)}this.object=a,this.domElement=void 0!==b?b:document,this.enabled=!0,
  this.target=new THREE.Vector3,this.center=this.target,this.noZoom=!1,this.zoomSpeed=1,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.noRotate=!1,this.rotateSpeed=1,this.noPan=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.noKeys=!1,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:THREE.MOUSE.LEFT,ZOOM:THREE.MOUSE.MIDDLE,PAN:THREE.MOUSE.RIGHT};var m,n,o=this,p=1e-6,q=new THREE.Vector2,r=new THREE.Vector2,s=new THREE.Vector2,t=new THREE.Vector2,u=new THREE.Vector2,v=new THREE.Vector2,w=new THREE.Vector3,x=new THREE.Vector3,y=new THREE.Vector2,z=new THREE.Vector2,A=new THREE.Vector2,B=0,C=0,D=1,E=new THREE.Vector3,F=new THREE.Vector3,G=new THREE.Quaternion,H={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},I=H.NONE;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom;var J=(new THREE.Quaternion).setFromUnitVectors(a.up,new THREE.Vector3(0,1,0)),K=J.clone().inverse(),L={type:"change"},M={type:"start"},N={type:"end"};this.rotateLeft=function(a){void 0===a&&(a=c()),C-=a},this.rotateUp=function(a){void 0===a&&(a=c()),B-=a},this.panLeft=function(a){var b=this.object.matrix.elements;w.set(b[0],b[1],b[2]),w.multiplyScalar(-a),E.add(w)},this.panUp=function(a){var b=this.object.matrix.elements;w.set(b[4],b[5],b[6]),w.multiplyScalar(a),E.add(w)},this.pan=function(a,b){var c=o.domElement===document?o.domElement.body:o.domElement;if(o.object instanceof THREE.PerspectiveCamera){var d=o.object.position,e=d.clone().sub(o.target),f=e.length();f*=Math.tan(o.object.fov/2*Math.PI/180),o.panLeft(2*a*f/c.clientHeight),o.panUp(2*b*f/c.clientHeight)}else o.object instanceof THREE.OrthographicCamera?(o.panLeft(a*(o.object.right-o.object.left)/c.clientWidth),o.panUp(b*(o.object.top-o.object.bottom)/c.clientHeight)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.")},this.dollyIn=function(a){void 0===a&&(a=d()),o.object instanceof THREE.PerspectiveCamera?D/=a:o.object instanceof THREE.OrthographicCamera?(o.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom*a)),o.object.updateProjectionMatrix(),o.dispatchEvent(L)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.")},this.dollyOut=function(a){void 0===a&&(a=d()),o.object instanceof THREE.PerspectiveCamera?D*=a:o.object instanceof THREE.OrthographicCamera?(o.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/a)),o.object.updateProjectionMatrix(),o.dispatchEvent(L)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.")},this.update=function(){var a=this.object.position;x.copy(a).sub(this.target),x.applyQuaternion(J),m=Math.atan2(x.x,x.z),n=Math.atan2(Math.sqrt(x.x*x.x+x.z*x.z),x.y),this.autoRotate&&I===H.NONE&&this.rotateLeft(c()),m+=C,n+=B,m=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,m)),n=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,n)),n=Math.max(p,Math.min(Math.PI-p,n));var b=x.length()*D;b=Math.max(this.minDistance,Math.min(this.maxDistance,b)),this.target.add(E),x.x=b*Math.sin(n)*Math.sin(m),x.y=b*Math.cos(n),x.z=b*Math.sin(n)*Math.cos(m),x.applyQuaternion(K),a.copy(this.target).add(x),this.object.lookAt(this.target),C=0,B=0,D=1,E.set(0,0,0),(F.distanceToSquared(this.object.position)>p||8*(1-G.dot(this.object.quaternion))>p)&&(this.dispatchEvent(L),F.copy(this.object.position),G.copy(this.object.quaternion))},this.reset=function(){I=H.NONE,this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(L),this.update()},this.getPolarAngle=function(){return n},this.getAzimuthalAngle=function(){return m},this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1),this.domElement.addEventListener("mousedown",e,!1),this.domElement.addEventListener("mousewheel",h,!1),this.domElement.addEventListener("DOMMouseScroll",h,!1),this.domElement.addEventListener("touchstart",j,!1),this.domElement.addEventListener("touchend",l,!1),this.domElement.addEventListener("touchmove",k,!1),window.addEventListener("keydown",i,!1),this.update()},THREE.OrbitControls.prototype=Object.create(THREE.EventDispatcher.prototype),THREE.OrbitControls.prototype.constructor=THREE.OrbitControls,THREE.OBJLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager},THREE.OBJLoader.prototype={constructor:THREE.OBJLoader,load:function(a,b,c,d){var e=this,f=new THREE.XHRLoader(e.manager);f.setCrossOrigin(this.crossOrigin),f.load(a,function(a){b(e.parse(a))})},parse:function(a){function b(a,b,c){return new THREE.Vector3(parseFloat(a),parseFloat(b),parseFloat(c))}function c(a,b){return new THREE.Vector2(parseFloat(a),parseFloat(b))}function d(a,b,c,d){return new THREE.Face3(a,b,c,d)}function e(a){return a=parseInt(a),a>=0?a-1:a+o.length}function f(a){return a=parseInt(a),a>=0?a-1:a+p.length}function g(a){return a=parseInt(a),a>=0?a-1:a+q.length}function h(a,b,c,g){void 0===g?k.faces.push(d(o[e(a)]-1,o[e(b)]-1,o[e(c)]-1)):k.faces.push(d(o[e(a)]-1,o[e(b)]-1,o[e(c)]-1,[p[f(g[0])].clone(),p[f(g[1])].clone(),p[f(g[2])].clone()]))}function i(a,b,c){k.faceVertexUvs[0].push([q[g(a)].clone(),q[g(b)].clone(),q[g(c)].clone()])}function j(a,b,c){void 0===a[3]?(h(a[0],a[1],a[2],c),void 0!==b&&b.length>0&&i(b[0],b[1],b[2])):(void 0!==c&&c.length>0?(h(a[0],a[1],a[3],[c[0],c[1],c[3]]),h(a[1],a[2],a[3],[c[1],c[2],c[3]])):(h(a[0],a[1],a[3]),h(a[1],a[2],a[3])),void 0!==b&&b.length>0&&(i(b[0],b[1],b[3]),i(b[1],b[2],b[3])))}var k,l,m,n=new THREE.Object3D;!1===/^o /gm.test(a)&&(k=new THREE.Geometry,l=new THREE.MeshLambertMaterial,m=new THREE.Mesh(k,l),n.add(m));for(var o=[],p=[],q=[],r=/v( +[\d|\.|\+|\-|e]+)( +[\d|\.|\+|\-|e]+)( +[\d|\.|\+|\-|e]+)/,s=/vn( +[\d|\.|\+|\-|e]+)( +[\d|\.|\+|\-|e]+)( +[\d|\.|\+|\-|e]+)/,t=/vt( +[\d|\.|\+|\-|e]+)( +[\d|\.|\+|\-|e]+)/,u=/f( +-?\d+)( +-?\d+)( +-?\d+)( +-?\d+)?/,v=/f( +(-?\d+)\/(-?\d+))( +(-?\d+)\/(-?\d+))( +(-?\d+)\/(-?\d+))( +(-?\d+)\/(-?\d+))?/,w=/f( +(-?\d+)\/(-?\d+)\/(-?\d+))( +(-?\d+)\/(-?\d+)\/(-?\d+))( +(-?\d+)\/(-?\d+)\/(-?\d+))( +(-?\d+)\/(-?\d+)\/(-?\d+))?/,x=/f( +(-?\d+)\/\/(-?\d+))( +(-?\d+)\/\/(-?\d+))( +(-?\d+)\/\/(-?\d+))( +(-?\d+)\/\/(-?\d+))?/,y=a.split("\n"),z=0;z<y.length;z++){var A=y[z];A=A.trim();var B;0!==A.length&&"#"!==A.charAt(0)&&(null!==(B=r.exec(A))?o.push(k.vertices.push(b(B[1],B[2],B[3]))):null!==(B=s.exec(A))?p.push(b(B[1],B[2],B[3])):null!==(B=t.exec(A))?q.push(c(B[1],B[2])):null!==(B=u.exec(A))?j([B[1],B[2],B[3],B[4]]):null!==(B=v.exec(A))?j([B[2],B[5],B[8],B[11]],[B[3],B[6],B[9],B[12]]):null!==(B=w.exec(A))?j([B[2],B[6],B[10],B[14]],[B[3],B[7],B[11],B[15]],[B[4],B[8],B[12],B[16]]):null!==(B=x.exec(A))?j([B[2],B[5],B[8],B[11]],[],[B[3],B[6],B[9],B[12]]):/^o /.test(A)?(k=new THREE.Geometry,l=new THREE.MeshLambertMaterial,m=new THREE.Mesh(k,l),m.name=A.substring(2).trim(),n.add(m)):/^g /.test(A)||(/^usemtl /.test(A)?l.name=A.substring(7).trim():/^mtllib /.test(A)||/^s /.test(A)))}for(var C=n.children,z=0,D=C.length;z<D;z++){var k=C[z].geometry;k.computeFaceNormals(),k.computeBoundingSphere()}return n}};