Skip to content

Instantly share code, notes, and snippets.

@teocci
Created July 29, 2022 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teocci/c7eaa6834b923096e65b3ca8fd3ae497 to your computer and use it in GitHub Desktop.
Save teocci/c7eaa6834b923096e65b3ca8fd3ae497 to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; };
if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } }
{
let window = _____WB$wombat$assign$function_____("window");
let self = _____WB$wombat$assign$function_____("self");
let document = _____WB$wombat$assign$function_____("document");
let location = _____WB$wombat$assign$function_____("location");
let top = _____WB$wombat$assign$function_____("top");
let parent = _____WB$wombat$assign$function_____("parent");
let frames = _____WB$wombat$assign$function_____("frames");
let opener = _____WB$wombat$assign$function_____("opener");
window.verold = window.verold || {};
window.verold.apiBaseUrl = "https://web.archive.org/web/20140320040108/http://studio.verold.com";
window.verold.assetsBaseUrl = "https://web.archive.org/web/20140320040108/http://assets.verold.com";
window.verold.staticBaseUrl = "https://web.archive.org/web/20140320040108/http://assets.verold.com/production";
window.verold.glAssetsBaseUrl = "https://web.archive.org/web/20140320040108/http://assets.verold.com/production/assets";
window.verold.debug = true;
window.verold.bust = "8ec12a";
window.VAPI = {};
/**
* almond 0.2.5 Copyright (c) 2011-2012, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/almond for details
*/
/*!
* jQuery JavaScript Library v1.8.3
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: Tue Nov 13 2012 08:20:33 GMT-0500 (Eastern Standard Time)
*/
/*!
* Sizzle CSS Selector Engine
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license
* http://sizzlejs.com/
*/
/**
* @license
* Lo-Dash 1.3.1 (Custom Build) <http://lodash.com/>
* Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js`
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.4.4 <http://underscorejs.org/>
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
* Available under MIT license <http://lodash.com/license>
*/
// (c) 2010-2013 Jeremy Ashkenas, DocumentCloud Inc.
// Backbone may be freely distributed under the MIT license.
// For all details and documentation:
// http://backbonejs.org
/**
* Backbone-relational.js 0.8.5
* (c) 2011-2013 Paul Uithol and contributors (https://github.com/PaulUithol/Backbone-relational/graphs/contributors)
*
* Backbone-relational may be freely distributed under the MIT license; see the accompanying LICENSE.txt.
* For details and documentation: https://github.com/PaulUithol/Backbone-relational.
* Depends on Backbone (and thus on Underscore as well): https://github.com/documentcloud/backbone.
*/
/**
*
* Backbone.DeepModel v0.10.4
*
* Copyright (c) 2013 Charles Davison, Pow Media Ltd
*
* https://github.com/powmedia/backbone-deep-model
* Licensed under the MIT License
*/
/**
* @author alteredq / http://alteredqualia.com/
*
* Film grain & scanlines shader
*
* - ported from HLSL to WebGL / GLSL
* http://www.truevision3d.com/forums/showcase/staticnoise_colorblackwhite_scanline_shaders-t18698.0.html
*
* Screen Space Static Postprocessor
*
* Produces an analogue noise overlay similar to a film grain / TV static
*
* Original implementation and noise algorithm
* Pat 'Hawthorne' Shearon
*
* Optimized scanlines + noise version with intensity scaling
* Georg 'Leviathan' Steinrohder
*
* This version is provided under a Creative Commons Attribution 3.0 License
* http://creativecommons.org/licenses/by/3.0/
*/
/**
* @license RequireJS text 2.0.5 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/requirejs/text for details
*/
(function(e,t){"function"==typeof define&&define.amd?define(t):e.VAPI=t()})(this,function(){var e,t,i;(function(r){function n(e,t){return x.call(e,t)}function s(e,t){var i,r,n,s,o,a,l,d,c,h,u=t&&t.split("/"),p=y.map,f=p&&p["*"]||{};if(e&&"."===e.charAt(0))if(t){for(u=u.slice(0,u.length-1),e=u.concat(e.split("/")),d=0;e.length>d;d+=1)if(h=e[d],"."===h)e.splice(d,1),d-=1;else if(".."===h){if(1===d&&(".."===e[2]||".."===e[0]))break;d>0&&(e.splice(d-1,2),d-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((u||f)&&p){for(i=e.split("/"),d=i.length;d>0;d-=1){if(r=i.slice(0,d).join("/"),u)for(c=u.length;c>0;c-=1)if(n=p[u.slice(0,c).join("/")],n&&(n=n[r])){s=n,o=d;break}if(s)break;!a&&f&&f[r]&&(a=f[r],l=d)}!s&&a&&(s=a,o=l),s&&(i.splice(0,o,s),e=i.join("/"))}return e}function o(e,t){return function(){return p.apply(r,b.call(arguments,0).concat([e,t]))}}function a(e){return function(t){return s(t,e)}}function l(e){return function(t){v[e]=t}}function d(e){if(n(m,e)){var t=m[e];delete m[e],w[e]=!0,u.apply(r,t)}if(!n(v,e)&&!n(w,e))throw Error("No "+e);return v[e]}function c(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function h(e){return function(){return y&&y.config&&y.config[e]||{}}}var u,p,f,g,v={},m={},y={},w={},x=Object.prototype.hasOwnProperty,b=[].slice;f=function(e,t){var i,r=c(e),n=r[0];return e=r[1],n&&(n=s(n,t),i=d(n)),n?e=i&&i.normalize?i.normalize(e,a(t)):s(e,t):(e=s(e,t),r=c(e),n=r[0],e=r[1],n&&(i=d(n))),{f:n?n+"!"+e:e,n:e,pr:n,p:i}},g={require:function(e){return o(e)},exports:function(e){var t=v[e];return t!==void 0?t:v[e]={}},module:function(e){return{id:e,uri:"",exports:v[e],config:h(e)}}},u=function(e,t,i,s){var a,c,h,u,p,y,x=[];if(s=s||e,"function"==typeof i){for(t=!t.length&&i.length?["require","exports","module"]:t,p=0;t.length>p;p+=1)if(u=f(t[p],s),c=u.f,"require"===c)x[p]=g.require(e);else if("exports"===c)x[p]=g.exports(e),y=!0;else if("module"===c)a=x[p]=g.module(e);else if(n(v,c)||n(m,c)||n(w,c))x[p]=d(c);else{if(!u.p)throw Error(e+" missing "+c);u.p.load(u.n,o(s,!0),l(c),{}),x[p]=v[c]}h=i.apply(v[e],x),e&&(a&&a.exports!==r&&a.exports!==v[e]?v[e]=a.exports:h===r&&y||(v[e]=h))}else e&&(v[e]=i)},e=t=p=function(e,t,i,n,s){return"string"==typeof e?g[e]?g[e](t):d(f(e,t).f):(e.splice||(y=e,t.splice?(e=t,t=i,i=null):e=r),t=t||function(){},"function"==typeof i&&(i=n,n=s),n?u(r,e,t,i):setTimeout(function(){u(r,e,t,i)},4),p)},p.config=function(e){return y=e,y.deps&&p(y.deps,y.callback),p},i=function(e,t,i){t.splice||(i=t,t=[]),n(v,e)||n(m,e)||(m[e]=[e,t,i])},i.amd={jQuery:!0}})(),i("libs/require/almond",function(){}),function(e,t){function r(e){var t=gt[e]={};return Z.each(e.split(it),function(e,i){t[i]=!0}),t}function n(e,i,r){if(r===t&&1===e.nodeType){var n="data-"+i.replace(mt,"-$1").toLowerCase();if(r=e.getAttribute(n),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:vt.test(r)?Z.parseJSON(r):r}catch(s){}Z.data(e,i,r)}else r=t}return r}function s(e){var t;for(t in e)if(("data"!==t||!Z.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function o(){return!1}function a(){return!0}function l(e){return!e||!e.parentNode||11===e.parentNode.nodeType}function d(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function c(e,t,i){if(t=t||0,Z.isFunction(t))return Z.grep(e,function(e,r){var n=!!t.call(e,r,e);return n===i});if(t.nodeType)return Z.grep(e,function(e){return e===t===i});if("string"==typeof t){var r=Z.grep(e,function(e){return 1===e.nodeType});if(Lt.test(t))return Z.filter(t,r,!i);t=Z.filter(t,r)}return Z.grep(e,function(e){return Z.inArray(e,t)>=0===i})}function h(e){var t=Ft.split("|"),i=e.createDocumentFragment();if(i.createElement)for(;t.length;)i.createElement(t.pop());return i}function u(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function p(e,t){if(1===t.nodeType&&Z.hasData(e)){var i,r,n,s=Z._data(e),o=Z._data(t,s),a=s.events;if(a){delete o.handle,o.events={};for(i in a)for(r=0,n=a[i].length;n>r;r++)Z.event.add(t,i,a[i][r])}o.data&&(o.data=Z.extend({},o.data))}}function f(e,t){var i;1===t.nodeType&&(t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),i=t.nodeName.toLowerCase(),"object"===i?(t.parentNode&&(t.outerHTML=e.outerHTML),Z.support.html5Clone&&e.innerHTML&&!Z.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===i&&Kt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===i?t.selected=e.defaultSelected:"input"===i||"textarea"===i?t.defaultValue=e.defaultValue:"script"===i&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(Z.expando))}function g(e){return e.getElementsByTagName!==t?e.getElementsByTagName("*"):e.querySelectorAll!==t?e.querySelectorAll("*"):[]}function v(e){Kt.test(e.type)&&(e.defaultChecked=e.checked)}function m(e,t){if(t in e)return t;for(var i=t.charAt(0).toUpperCase()+t.slice(1),r=t,n=yi.length;n--;)if(t=yi[n]+i,t in e)return t;return r}function y(e,t){return e=t||e,"none"===Z.css(e,"display")||!Z.contains(e.ownerDocument,e)}function w(e,t){for(var i,r,n=[],s=0,o=e.length;o>s;s++)i=e[s],i.style&&(n[s]=Z._data(i,"olddisplay"),t?(n[s]||"none"!==i.style.display||(i.style.display=""),""===i.style.display&&y(i)&&(n[s]=Z._data(i,"olddisplay",_(i.nodeName)))):(r=ri(i,"display"),n[s]||"none"===r||Z._data(i,"olddisplay",r)));for(s=0;o>s;s++)i=e[s],i.style&&(t&&"none"!==i.style.display&&""!==i.style.display||(i.style.display=t?n[s]||"":"none"));return e}function x(e,t,i){var r=hi.exec(t);return r?Math.max(0,r[1]-(i||0))+(r[2]||"px"):t}function b(e,t,i,r){for(var n=i===(r?"border":"content")?4:"width"===t?1:0,s=0;4>n;n+=2)"margin"===i&&(s+=Z.css(e,i+mi[n],!0)),r?("content"===i&&(s-=parseFloat(ri(e,"padding"+mi[n]))||0),"margin"!==i&&(s-=parseFloat(ri(e,"border"+mi[n]+"Width"))||0)):(s+=parseFloat(ri(e,"padding"+mi[n]))||0,"padding"!==i&&(s+=parseFloat(ri(e,"border"+mi[n]+"Width"))||0));return s}function E(e,t,i){var r="width"===t?e.offsetWidth:e.offsetHeight,n=!0,s=Z.support.boxSizing&&"border-box"===Z.css(e,"boxSizing");if(0>=r||null==r){if(r=ri(e,t),(0>r||null==r)&&(r=e.style[t]),ui.test(r))return r;n=s&&(Z.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+b(e,t,i||(s?"border":"content"),n)+"px"}function _(e){if(fi[e])return fi[e];var t=Z("<"+e+">").appendTo(z.body),i=t.css("display");return t.remove(),("none"===i||""===i)&&(ni=z.body.appendChild(ni||Z.extend(z.createElement("iframe"),{frameBorder:0,width:0,height:0})),si&&ni.createElement||(si=(ni.contentWindow||ni.contentDocument).document,si.write("<!doctype html><html><body>"),si.close()),t=si.body.appendChild(si.createElement(e)),i=ri(t,"display"),z.body.removeChild(ni)),fi[e]=i,i}function T(e,t,i,r){var n;if(Z.isArray(t))Z.each(t,function(t,n){i||bi.test(e)?r(e,n):T(e+"["+("object"==typeof n?t:"")+"]",n,i,r)});else if(i||"object"!==Z.type(t))r(e,t);else for(n in t)T(e+"["+n+"]",t[n],i,r)}function C(e){return function(t,i){"string"!=typeof t&&(i=t,t="*");var r,n,s,o=t.toLowerCase().split(it),a=0,l=o.length;if(Z.isFunction(i))for(;l>a;a++)r=o[a],s=/^\+/.test(r),s&&(r=r.substr(1)||"*"),n=e[r]=e[r]||[],n[s?"unshift":"push"](i)}}function M(e,i,r,n,s,o){s=s||i.dataTypes[0],o=o||{},o[s]=!0;for(var a,l=e[s],d=0,c=l?l.length:0,h=e===Li;c>d&&(h||!a);d++)a=l[d](i,r,n),"string"==typeof a&&(!h||o[a]?a=t:(i.dataTypes.unshift(a),a=M(e,i,r,n,a,o)));return!h&&a||o["*"]||(a=M(e,i,r,n,"*",o)),a}function S(e,i){var r,n,s=Z.ajaxSettings.flatOptions||{};for(r in i)i[r]!==t&&((s[r]?e:n||(n={}))[r]=i[r]);n&&Z.extend(!0,e,n)}function A(e,i,r){var n,s,o,a,l=e.contents,d=e.dataTypes,c=e.responseFields;for(s in c)s in r&&(i[c[s]]=r[s]);for(;"*"===d[0];)d.shift(),n===t&&(n=e.mimeType||i.getResponseHeader("content-type"));if(n)for(s in l)if(l[s]&&l[s].test(n)){d.unshift(s);break}if(d[0]in r)o=d[0];else{for(s in r){if(!d[0]||e.converters[s+" "+d[0]]){o=s;break}a||(a=s)}o=o||a}return o?(o!==d[0]&&d.unshift(o),r[o]):t}function R(e,t){var i,r,n,s,o=e.dataTypes.slice(),a=o[0],l={},d=0;if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),o[1])for(i in e.converters)l[i.toLowerCase()]=e.converters[i];for(;n=o[++d];)if("*"!==n){if("*"!==a&&a!==n){if(i=l[a+" "+n]||l["* "+n],!i)for(r in l)if(s=r.split(" "),s[1]===n&&(i=l[a+" "+s[0]]||l["* "+s[0]])){i===!0?i=l[r]:l[r]!==!0&&(n=s[0],o.splice(d--,0,n));break}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(c){return{state:"parsererror",error:i?c:"No conversion from "+a+" to "+n}}}a=n}return{state:"success",data:t}}function U(){try{return new e.XMLHttpRequest}catch(t){}}function D(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function P(){return setTimeout(function(){$i=t},0),$i=Z.now()}function j(e,t){Z.each(t,function(t,i){for(var r=(er[t]||[]).concat(er["*"]),n=0,s=r.length;s>n;n++)if(r[n].call(e,t,i))return})}function B(e,t,i){var r,n=0,s=Zi.length,o=Z.Deferred().always(function(){delete a.elem}),a=function(){for(var t=$i||P(),i=Math.max(0,l.startTime+l.duration-t),r=i/l.duration||0,n=1-r,s=0,a=l.tweens.length;a>s;s++)l.tweens[s].run(n);return o.notifyWith(e,[l,n,i]),1>n&&a?i:(o.resolveWith(e,[l]),!1)},l=o.promise({elem:e,props:Z.extend({},t),opts:Z.extend(!0,{specialEasing:{}},i),originalProperties:t,originalOptions:i,startTime:$i||P(),duration:i.duration,tweens:[],createTween:function(t,i){var r=Z.Tween(e,l.opts,t,i,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){for(var i=0,r=t?l.tweens.length:0;r>i;i++)l.tweens[i].run(1);return t?o.resolveWith(e,[l,t]):o.rejectWith(e,[l,t]),this}}),d=l.props;for(H(d,l.opts.specialEasing);s>n;n++)if(r=Zi[n].call(l,e,d,l.opts))return r;return j(l,d),Z.isFunction(l.opts.start)&&l.opts.start.call(e,l),Z.fx.timer(Z.extend(a,{anim:l,queue:l.opts.queue,elem:e})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function H(e,t){var i,r,n,s,o;for(i in e)if(r=Z.camelCase(i),n=t[r],s=e[i],Z.isArray(s)&&(n=s[1],s=e[i]=s[0]),i!==r&&(e[r]=s,delete e[i]),o=Z.cssHooks[r],o&&"expand"in o){s=o.expand(s),delete e[r];for(i in s)i in e||(e[i]=s[i],t[i]=n)}else t[r]=n}function k(e,t,i){var r,n,s,o,a,l,d,c,h,u=this,p=e.style,f={},g=[],v=e.nodeType&&y(e);i.queue||(c=Z._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,h=c.empty.fire,c.empty.fire=function(){c.unqueued||h()}),c.unqueued++,u.always(function(){u.always(function(){c.unqueued--,Z.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(i.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===Z.css(e,"display")&&"none"===Z.css(e,"float")&&(Z.support.inlineBlockNeedsLayout&&"inline"!==_(e.nodeName)?p.zoom=1:p.display="inline-block")),i.overflow&&(p.overflow="hidden",Z.support.shrinkWrapBlocks||u.done(function(){p.overflow=i.overflow[0],p.overflowX=i.overflow[1],p.overflowY=i.overflow[2]}));for(r in t)if(s=t[r],Ki.exec(s)){if(delete t[r],l=l||"toggle"===s,s===(v?"hide":"show"))continue;g.push(r)}if(o=g.length){a=Z._data(e,"fxshow")||Z._data(e,"fxshow",{}),"hidden"in a&&(v=a.hidden),l&&(a.hidden=!v),v?Z(e).show():u.done(function(){Z(e).hide()}),u.done(function(){var t;Z.removeData(e,"fxshow",!0);for(t in f)Z.style(e,t,f[t])});for(r=0;o>r;r++)n=g[r],d=u.createTween(n,v?a[n]:0),f[n]=a[n]||Z.style(e,n),n in a||(a[n]=d.start,v&&(d.end=d.start,d.start="width"===n||"height"===n?1:0))}}function L(e,t,i,r,n){return new L.prototype.init(e,t,i,r,n)}function I(e,t){var i,r={height:e},n=0;for(t=t?1:0;4>n;n+=2-t)i=mi[n],r["margin"+i]=r["padding"+i]=e;return t&&(r.opacity=r.width=e),r}function N(e){return Z.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var F,O,z=e.document,V=e.location,W=e.navigator,G=e.jQuery,X=e.$,q=Array.prototype.push,$=Array.prototype.slice,Y=Array.prototype.indexOf,K=Object.prototype.toString,J=Object.prototype.hasOwnProperty,Q=String.prototype.trim,Z=function(e,t){return new Z.fn.init(e,t,F)},et=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,tt=/\S/,it=/\s+/,rt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,nt=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,st=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,ot=/^[\],:{}\s]*$/,at=/(?:^|:|,)(?:\s*\[)+/g,lt=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,dt=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,ct=/^-ms-/,ht=/-([\da-z])/gi,ut=function(e,t){return(t+"").toUpperCase()},pt=function(){z.addEventListener?(z.removeEventListener("DOMContentLoaded",pt,!1),Z.ready()):"complete"===z.readyState&&(z.detachEvent("onreadystatechange",pt),Z.ready())},ft={};Z.fn=Z.prototype={constructor:Z,init:function(e,i,r){var n,s,o;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if("string"==typeof e){if(n="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:nt.exec(e),!n||!n[1]&&i)return!i||i.jquery?(i||r).find(e):this.constructor(i).find(e);if(n[1])return i=i instanceof Z?i[0]:i,o=i&&i.nodeType?i.ownerDocument||i:z,e=Z.parseHTML(n[1],o,!0),st.test(n[1])&&Z.isPlainObject(i)&&this.attr.call(e,i,!0),Z.merge(this,e);if(s=z.getElementById(n[2]),s&&s.parentNode){if(s.id!==n[2])return r.find(e);this.length=1,this[0]=s}return this.context=z,this.selector=e,this}return Z.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),Z.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return $.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e,t,i){var r=Z.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,"find"===t?r.selector=this.selector+(this.selector?" ":"")+i:t&&(r.selector=this.selector+"."+t+"("+i+")"),r},each:function(e,t){return Z.each(this,e,t)},ready:function(e){return Z.ready.promise().done(e),this},eq:function(e){return e=+e,-1===e?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack($.apply(this,arguments),"slice",$.call(arguments).join(","))},map:function(e){return this.pushStack(Z.map(this,function(t,i){return e.call(t,i,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:q,sort:[].sort,splice:[].splice},Z.fn.init.prototype=Z.fn,Z.extend=Z.fn.extend=function(){var e,i,r,n,s,o,a=arguments[0]||{},l=1,d=arguments.length,c=!1;for("boolean"==typeof a&&(c=a,a=arguments[1]||{},l=2),"object"==typeof a||Z.isFunction(a)||(a={}),d===l&&(a=this,--l);d>l;l++)if(null!=(e=arguments[l]))for(i in e)r=a[i],n=e[i],a!==n&&(c&&n&&(Z.isPlainObject(n)||(s=Z.isArray(n)))?(s?(s=!1,o=r&&Z.isArray(r)?r:[]):o=r&&Z.isPlainObject(r)?r:{},a[i]=Z.extend(c,o,n)):n!==t&&(a[i]=n));return a},Z.extend({noConflict:function(t){return e.$===Z&&(e.$=X),t&&e.jQuery===Z&&(e.jQuery=G),Z},isReady:!1,readyWait:1,holdReady:function(e){e?Z.readyWait++:Z.ready(!0)},ready:function(e){if(e===!0?!--Z.readyWait:!Z.isReady){if(!z.body)return setTimeout(Z.ready,1);Z.isReady=!0,e!==!0&&--Z.readyWait>0||(O.resolveWith(z,[Z]),Z.fn.trigger&&Z(z).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===Z.type(e)},isArray:Array.isArray||function(e){return"array"===Z.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":ft[K.call(e)]||"object"},isPlainObject:function(e){if(!e||"object"!==Z.type(e)||e.nodeType||Z.isWindow(e))return!1;try{if(e.constructor&&!J.call(e,"constructor")&&!J.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(i){return!1}var r;for(r in e);return r===t||J.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,i){var r;return e&&"string"==typeof e?("boolean"==typeof t&&(i=t,t=0),t=t||z,(r=st.exec(e))?[t.createElement(r[1])]:(r=Z.buildFragment([e],t,i?null:[]),Z.merge([],(r.cacheable?Z.clone(r.fragment):r.fragment).childNodes))):null},parseJSON:function(i){return i&&"string"==typeof i?(i=Z.trim(i),e.JSON&&e.JSON.parse?e.JSON.parse(i):ot.test(i.replace(lt,"@").replace(dt,"]").replace(at,""))?Function("return "+i)():(Z.error("Invalid JSON: "+i),t)):null},parseXML:function(i){var r,n;if(!i||"string"!=typeof i)return null;try{e.DOMParser?(n=new DOMParser,r=n.parseFromString(i,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(i))}catch(s){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||Z.error("Invalid XML: "+i),r},noop:function(){},globalEval:function(t){t&&tt.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(ct,"ms-").replace(ht,ut)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,i,r){var n,s=0,o=e.length,a=o===t||Z.isFunction(e);if(r)if(a){for(n in e)if(i.apply(e[n],r)===!1)break}else for(;o>s&&i.apply(e[s++],r)!==!1;);else if(a){for(n in e)if(i.call(e[n],n,e[n])===!1)break}else for(;o>s&&i.call(e[s],s,e[s++])!==!1;);return e},trim:Q&&!Q.call(" ")?function(e){return null==e?"":Q.call(e)}:function(e){return null==e?"":(e+"").replace(rt,"")},makeArray:function(e,t){var i,r=t||[];return null!=e&&(i=Z.type(e),null==e.length||"string"===i||"function"===i||"regexp"===i||Z.isWindow(e)?q.call(r,e):Z.merge(r,e)),r},inArray:function(e,t,i){var r;if(t){if(Y)return Y.call(t,e,i);for(r=t.length,i=i?0>i?Math.max(0,r+i):i:0;r>i;i++)if(i in t&&t[i]===e)return i}return-1},merge:function(e,i){var r=i.length,n=e.length,s=0;if("number"==typeof r)for(;r>s;s++)e[n++]=i[s];else for(;i[s]!==t;)e[n++]=i[s++];return e.length=n,e},grep:function(e,t,i){var r,n=[],s=0,o=e.length;for(i=!!i;o>s;s++)r=!!t(e[s],s),i!==r&&n.push(e[s]);return n},map:function(e,i,r){var n,s,o=[],a=0,l=e.length,d=e instanceof Z||l!==t&&"number"==typeof l&&(l>0&&e[0]&&e[l-1]||0===l||Z.isArray(e));if(d)for(;l>a;a++)n=i(e[a],a,r),null!=n&&(o[o.length]=n);else for(s in e)n=i(e[s],s,r),null!=n&&(o[o.length]=n);return o.concat.apply([],o)},guid:1,proxy:function(e,i){var r,n,s;return"string"==typeof i&&(r=e[i],i=e,e=r),Z.isFunction(e)?(n=$.call(arguments,2),s=function(){return e.apply(i,n.concat($.call(arguments)))},s.guid=e.guid=e.guid||Z.guid++,s):t},access:function(e,i,r,n,s,o,a){var l,d=null==r,c=0,h=e.length;if(r&&"object"==typeof r){for(c in r)Z.access(e,i,c,r[c],1,o,n);s=1}else if(n!==t){if(l=a===t&&Z.isFunction(n),d&&(l?(l=i,i=function(e,t,i){return l.call(Z(e),i)}):(i.call(e,n),i=null)),i)for(;h>c;c++)i(e[c],r,l?n.call(e[c],c,i(e[c],r)):n,a);s=1}return s?e:d?i.call(e):h?i(e[0],r):o},now:function(){return(new Date).getTime()}}),Z.ready.promise=function(t){if(!O)if(O=Z.Deferred(),"complete"===z.readyState)setTimeout(Z.ready,1);else if(z.addEventListener)z.addEventListener("DOMContentLoaded",pt,!1),e.addEventListener("load",Z.ready,!1);else{z.attachEvent("onreadystatechange",pt),e.attachEvent("onload",Z.ready);var i=!1;try{i=null==e.frameElement&&z.documentElement}catch(r){}i&&i.doScroll&&function n(){if(!Z.isReady){try{i.doScroll("left")}catch(e){return setTimeout(n,50)}Z.ready()}}()}return O.promise(t)},Z.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){ft["[object "+t+"]"]=t.toLowerCase()}),F=Z(z);var gt={};Z.Callbacks=function(e){e="string"==typeof e?gt[e]||r(e):Z.extend({},e);var i,n,s,o,a,l,d=[],c=!e.once&&[],h=function(t){for(i=e.memory&&t,n=!0,l=o||0,o=0,a=d.length,s=!0;d&&a>l;l++)if(d[l].apply(t[0],t[1])===!1&&e.stopOnFalse){i=!1;break}s=!1,d&&(c?c.length&&h(c.shift()):i?d=[]:u.disable())},u={add:function(){if(d){var t=d.length;(function r(t){Z.each(t,function(t,i){var n=Z.type(i);"function"===n?e.unique&&u.has(i)||d.push(i):i&&i.length&&"string"!==n&&r(i)})})(arguments),s?a=d.length:i&&(o=t,h(i))}return this},remove:function(){return d&&Z.each(arguments,function(e,t){for(var i;(i=Z.inArray(t,d,i))>-1;)d.splice(i,1),s&&(a>=i&&a--,l>=i&&l--)}),this},has:function(e){return Z.inArray(e,d)>-1},empty:function(){return d=[],this},disable:function(){return d=c=i=t,this},disabled:function(){return!d},lock:function(){return c=t,i||u.disable(),this},locked:function(){return!c},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!d||n&&!c||(s?c.push(t):h(t)),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!n}};return u},Z.extend({Deferred:function(e){var t=[["resolve","done",Z.Callbacks("once memory"),"resolved"],["reject","fail",Z.Callbacks("once memory"),"rejected"],["notify","progress",Z.Callbacks("memory")]],i="pending",r={state:function(){return i},always:function(){return n.done(arguments).fail(arguments),this},then:function(){var e=arguments;return Z.Deferred(function(i){Z.each(t,function(t,r){var s=r[0],o=e[t];n[r[1]](Z.isFunction(o)?function(){var e=o.apply(this,arguments);e&&Z.isFunction(e.promise)?e.promise().done(i.resolve).fail(i.reject).progress(i.notify):i[s+"With"](this===n?i:this,[e])}:i[s])}),e=null}).promise()},promise:function(e){return null!=e?Z.extend(e,r):r}},n={};return r.pipe=r.then,Z.each(t,function(e,s){var o=s[2],a=s[3];r[s[1]]=o.add,a&&o.add(function(){i=a},t[1^e][2].disable,t[2][2].lock),n[s[0]]=o.fire,n[s[0]+"With"]=o.fireWith}),r.promise(n),e&&e.call(n,n),n},when:function(e){var t,i,r,n=0,s=$.call(arguments),o=s.length,a=1!==o||e&&Z.isFunction(e.promise)?o:0,l=1===a?e:Z.Deferred(),d=function(e,i,r){return function(n){i[e]=this,r[e]=arguments.length>1?$.call(arguments):n,r===t?l.notifyWith(i,r):--a||l.resolveWith(i,r)}};if(o>1)for(t=Array(o),i=Array(o),r=Array(o);o>n;n++)s[n]&&Z.isFunction(s[n].promise)?s[n].promise().done(d(n,r,s)).fail(l.reject).progress(d(n,i,t)):--a;return a||l.resolveWith(r,s),l.promise()}}),Z.support=function(){var i,r,n,s,o,a,l,d,c,h,u,p=z.createElement("div");if(p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",r=p.getElementsByTagName("*"),n=p.getElementsByTagName("a")[0],!r||!n||!r.length)return{};s=z.createElement("select"),o=s.appendChild(z.createElement("option")),a=p.getElementsByTagName("input")[0],n.style.cssText="top:1px;float:left;opacity:.5",i={leadingWhitespace:3===p.firstChild.nodeType,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(n.getAttribute("style")),hrefNormalized:"/a"===n.getAttribute("href"),opacity:/^0.5/.test(n.style.opacity),cssFloat:!!n.style.cssFloat,checkOn:"on"===a.value,optSelected:o.selected,getSetAttribute:"t"!==p.className,enctype:!!z.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==z.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===z.compatMode,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,i.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,i.optDisabled=!o.disabled;try{delete p.test}catch(f){i.deleteExpando=!1}if(!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",u=function(){i.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",u)),a=z.createElement("input"),a.value="t",a.setAttribute("type","radio"),i.radioValue="t"===a.value,a.setAttribute("checked","checked"),a.setAttribute("name","t"),p.appendChild(a),l=z.createDocumentFragment(),l.appendChild(p.lastChild),i.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,i.appendChecked=a.checked,l.removeChild(a),l.appendChild(p),p.attachEvent)for(c in{submit:!0,change:!0,focusin:!0})d="on"+c,h=d in p,h||(p.setAttribute(d,"return;"),h="function"==typeof p[d]),i[c+"Bubbles"]=h;return Z(function(){var r,n,s,o,a="padding:0;margin:0;border:0;display:block;overflow:hidden;",l=z.getElementsByTagName("body")[0];l&&(r=z.createElement("div"),r.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",l.insertBefore(r,l.firstChild),n=z.createElement("div"),r.appendChild(n),n.innerHTML="<table><tr><td></td><td>t</td></tr></table>",s=n.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",h=0===s[0].offsetHeight,s[0].style.display="",s[1].style.display="none",i.reliableHiddenOffsets=h&&0===s[0].offsetHeight,n.innerHTML="",n.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",i.boxSizing=4===n.offsetWidth,i.doesNotIncludeMarginInBodyOffset=1!==l.offsetTop,e.getComputedStyle&&(i.pixelPosition="1%"!==(e.getComputedStyle(n,null)||{}).top,i.boxSizingReliable="4px"===(e.getComputedStyle(n,null)||{width:"4px"}).width,o=z.createElement("div"),o.style.cssText=n.style.cssText=a,o.style.marginRight=o.style.width="0",n.style.width="1px",n.appendChild(o),i.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),n.style.zoom!==t&&(n.innerHTML="",n.style.cssText=a+"width:1px;padding:1px;display:inline;zoom:1",i.inlineBlockNeedsLayout=3===n.offsetWidth,n.style.display="block",n.style.overflow="visible",n.innerHTML="<div></div>",n.firstChild.style.width="5px",i.shrinkWrapBlocks=3!==n.offsetWidth,r.style.zoom=1),l.removeChild(r),r=n=s=o=null)}),l.removeChild(p),r=n=s=o=a=l=p=null,i}();var vt=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,mt=/([A-Z])/g;Z.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(Z.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?Z.cache[e[Z.expando]]:e[Z.expando],!!e&&!s(e)},data:function(e,i,r,n){if(Z.acceptData(e)){var s,o,a=Z.expando,l="string"==typeof i,d=e.nodeType,c=d?Z.cache:e,h=d?e[a]:e[a]&&a;if(h&&c[h]&&(n||c[h].data)||!l||r!==t)return h||(d?e[a]=h=Z.deletedIds.pop()||Z.guid++:h=a),c[h]||(c[h]={},d||(c[h].toJSON=Z.noop)),("object"==typeof i||"function"==typeof i)&&(n?c[h]=Z.extend(c[h],i):c[h].data=Z.extend(c[h].data,i)),s=c[h],n||(s.data||(s.data={}),s=s.data),r!==t&&(s[Z.camelCase(i)]=r),l?(o=s[i],null==o&&(o=s[Z.camelCase(i)])):o=s,o}},removeData:function(e,t,i){if(Z.acceptData(e)){var r,n,o,a=e.nodeType,l=a?Z.cache:e,d=a?e[Z.expando]:Z.expando;if(l[d]){if(t&&(r=i?l[d]:l[d].data)){Z.isArray(t)||(t in r?t=[t]:(t=Z.camelCase(t),t=t in r?[t]:t.split(" ")));for(n=0,o=t.length;o>n;n++)delete r[t[n]];if(!(i?s:Z.isEmptyObject)(r))return}(i||(delete l[d].data,s(l[d])))&&(a?Z.cleanData([e],!0):Z.support.deleteExpando||l!=l.window?delete l[d]:l[d]=null)}}},_data:function(e,t,i){return Z.data(e,t,i,!0)},acceptData:function(e){var t=e.nodeName&&Z.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),Z.fn.extend({data:function(e,i){var r,s,o,a,l,d=this[0],c=0,h=null;if(e===t){if(this.length&&(h=Z.data(d),1===d.nodeType&&!Z._data(d,"parsedAttrs"))){for(o=d.attributes,l=o.length;l>c;c++)a=o[c].name,a.indexOf("data-")||(a=Z.camelCase(a.substring(5)),n(d,a,h[a]));Z._data(d,"parsedAttrs",!0)}return h}return"object"==typeof e?this.each(function(){Z.data(this,e)}):(r=e.split(".",2),r[1]=r[1]?"."+r[1]:"",s=r[1]+"!",Z.access(this,function(i){return i===t?(h=this.triggerHandler("getData"+s,[r[0]]),h===t&&d&&(h=Z.data(d,e),h=n(d,e,h)),h===t&&r[1]?this.data(r[0]):h):(r[1]=i,this.each(function(){var t=Z(this);t.triggerHandler("setData"+s,r),Z.data(this,e,i),t.triggerHandler("changeData"+s,r)}),t)},null,i,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){Z.removeData(this,e)})}}),Z.extend({queue:function(e,i,r){var n;return e?(i=(i||"fx")+"queue",n=Z._data(e,i),r&&(!n||Z.isArray(r)?n=Z._data(e,i,Z.makeArray(r)):n.push(r)),n||[]):t},dequeue:function(e,t){t=t||"fx";var i=Z.queue(e,t),r=i.length,n=i.shift(),s=Z._queueHooks(e,t),o=function(){Z.dequeue(e,t)};"inprogress"===n&&(n=i.shift(),r--),n&&("fx"===t&&i.unshift("inprogress"),delete s.stop,n.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var i=t+"queueHooks";return Z._data(e,i)||Z._data(e,i,{empty:Z.Callbacks("once memory").add(function(){Z.removeData(e,t+"queue",!0),Z.removeData(e,i,!0)})})}}),Z.fn.extend({queue:function(e,i){var r=2;return"string"!=typeof e&&(i=e,e="fx",r--),r>arguments.length?Z.queue(this[0],e):i===t?this:this.each(function(){var t=Z.queue(this,e,i);Z._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&Z.dequeue(this,e)})},dequeue:function(e){return this.each(function(){Z.dequeue(this,e)})},delay:function(e,t){return e=Z.fx?Z.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,i){var r=setTimeout(t,e);i.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,i){var r,n=1,s=Z.Deferred(),o=this,a=this.length,l=function(){--n||s.resolveWith(o,[o])};for("string"!=typeof e&&(i=e,e=t),e=e||"fx";a--;)r=Z._data(o[a],e+"queueHooks"),r&&r.empty&&(n++,r.empty.add(l));return l(),s.promise(i)}});var yt,wt,xt,bt=/[\t\r\n]/g,Et=/\r/g,_t=/^(?:button|input)$/i,Tt=/^(?:button|input|object|select|textarea)$/i,Ct=/^a(?:rea|)$/i,Mt=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,St=Z.support.getSetAttribute;Z.fn.extend({attr:function(e,t){return Z.access(this,Z.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){Z.removeAttr(this,e)})},prop:function(e,t){return Z.access(this,Z.prop,e,t,arguments.length>1)},removeProp:function(e){return e=Z.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(i){}})},addClass:function(e){var t,i,r,n,s,o,a;if(Z.isFunction(e))return this.each(function(t){Z(this).addClass(e.call(this,t,this.className))});if(e&&"string"==typeof e)for(t=e.split(it),i=0,r=this.length;r>i;i++)if(n=this[i],1===n.nodeType)if(n.className||1!==t.length){for(s=" "+n.className+" ",o=0,a=t.length;a>o;o++)0>s.indexOf(" "+t[o]+" ")&&(s+=t[o]+" ");n.className=Z.trim(s)}else n.className=e;return this},removeClass:function(e){var i,r,n,s,o,a,l;if(Z.isFunction(e))return this.each(function(t){Z(this).removeClass(e.call(this,t,this.className))});if(e&&"string"==typeof e||e===t)for(i=(e||"").split(it),a=0,l=this.length;l>a;a++)if(n=this[a],1===n.nodeType&&n.className){for(r=(" "+n.className+" ").replace(bt," "),s=0,o=i.length;o>s;s++)for(;r.indexOf(" "+i[s]+" ")>=0;)r=r.replace(" "+i[s]+" "," ");n.className=e?Z.trim(r):""}return this},toggleClass:function(e,t){var i=typeof e,r="boolean"==typeof t;return Z.isFunction(e)?this.each(function(i){Z(this).toggleClass(e.call(this,i,this.className,t),t)}):this.each(function(){if("string"===i)for(var n,s=0,o=Z(this),a=t,l=e.split(it);n=l[s++];)a=r?a:!o.hasClass(n),o[a?"addClass":"removeClass"](n);else("undefined"===i||"boolean"===i)&&(this.className&&Z._data(this,"__className__",this.className),this.className=this.className||e===!1?"":Z._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",i=0,r=this.length;r>i;i++)if(1===this[i].nodeType&&(" "+this[i].className+" ").replace(bt," ").indexOf(t)>=0)return!0;return!1},val:function(e){var i,r,n,s=this[0];{if(arguments.length)return n=Z.isFunction(e),this.each(function(r){var s,o=Z(this);1===this.nodeType&&(s=n?e.call(this,r,o.val()):e,null==s?s="":"number"==typeof s?s+="":Z.isArray(s)&&(s=Z.map(s,function(e){return null==e?"":e+""})),i=Z.valHooks[this.type]||Z.valHooks[this.nodeName.toLowerCase()],i&&"set"in i&&i.set(this,s,"value")!==t||(this.value=s))});if(s)return i=Z.valHooks[s.type]||Z.valHooks[s.nodeName.toLowerCase()],i&&"get"in i&&(r=i.get(s,"value"))!==t?r:(r=s.value,"string"==typeof r?r.replace(Et,""):null==r?"":r)}}}),Z.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,i,r=e.options,n=e.selectedIndex,s="select-one"===e.type||0>n,o=s?null:[],a=s?n+1:r.length,l=0>n?a:s?n:0;a>l;l++)if(i=r[l],!(!i.selected&&l!==n||(Z.support.optDisabled?i.disabled:null!==i.getAttribute("disabled"))||i.parentNode.disabled&&Z.nodeName(i.parentNode,"optgroup"))){if(t=Z(i).val(),s)return t;o.push(t)}return o},set:function(e,t){var i=Z.makeArray(t);
return Z(e).find("option").each(function(){this.selected=Z.inArray(Z(this).val(),i)>=0}),i.length||(e.selectedIndex=-1),i}}},attrFn:{},attr:function(e,i,r,n){var s,o,a,l=e.nodeType;if(e&&3!==l&&8!==l&&2!==l)return n&&Z.isFunction(Z.fn[i])?Z(e)[i](r):e.getAttribute===t?Z.prop(e,i,r):(a=1!==l||!Z.isXMLDoc(e),a&&(i=i.toLowerCase(),o=Z.attrHooks[i]||(Mt.test(i)?wt:yt)),r!==t?null===r?(Z.removeAttr(e,i),t):o&&"set"in o&&a&&(s=o.set(e,r,i))!==t?s:(e.setAttribute(i,r+""),r):o&&"get"in o&&a&&null!==(s=o.get(e,i))?s:(s=e.getAttribute(i),null===s?t:s))},removeAttr:function(e,t){var i,r,n,s,o=0;if(t&&1===e.nodeType)for(r=t.split(it);r.length>o;o++)n=r[o],n&&(i=Z.propFix[n]||n,s=Mt.test(n),s||Z.attr(e,n,""),e.removeAttribute(St?n:i),s&&i in e&&(e[i]=!1))},attrHooks:{type:{set:function(e,t){if(_t.test(e.nodeName)&&e.parentNode)Z.error("type property can't be changed");else if(!Z.support.radioValue&&"radio"===t&&Z.nodeName(e,"input")){var i=e.value;return e.setAttribute("type",t),i&&(e.value=i),t}}},value:{get:function(e,t){return yt&&Z.nodeName(e,"button")?yt.get(e,t):t in e?e.value:null},set:function(e,i,r){return yt&&Z.nodeName(e,"button")?yt.set(e,i,r):(e.value=i,t)}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,i,r){var n,s,o,a=e.nodeType;if(e&&3!==a&&8!==a&&2!==a)return o=1!==a||!Z.isXMLDoc(e),o&&(i=Z.propFix[i]||i,s=Z.propHooks[i]),r!==t?s&&"set"in s&&(n=s.set(e,r,i))!==t?n:e[i]=r:s&&"get"in s&&null!==(n=s.get(e,i))?n:e[i]},propHooks:{tabIndex:{get:function(e){var i=e.getAttributeNode("tabindex");return i&&i.specified?parseInt(i.value,10):Tt.test(e.nodeName)||Ct.test(e.nodeName)&&e.href?0:t}}}}),wt={get:function(e,i){var r,n=Z.prop(e,i);return n===!0||"boolean"!=typeof n&&(r=e.getAttributeNode(i))&&r.nodeValue!==!1?i.toLowerCase():t},set:function(e,t,i){var r;return t===!1?Z.removeAttr(e,i):(r=Z.propFix[i]||i,r in e&&(e[r]=!0),e.setAttribute(i,i.toLowerCase())),i}},St||(xt={name:!0,id:!0,coords:!0},yt=Z.valHooks.button={get:function(e,i){var r;return r=e.getAttributeNode(i),r&&(xt[i]?""!==r.value:r.specified)?r.value:t},set:function(e,t,i){var r=e.getAttributeNode(i);return r||(r=z.createAttribute(i),e.setAttributeNode(r)),r.value=t+""}},Z.each(["width","height"],function(e,i){Z.attrHooks[i]=Z.extend(Z.attrHooks[i],{set:function(e,r){return""===r?(e.setAttribute(i,"auto"),r):t}})}),Z.attrHooks.contenteditable={get:yt.get,set:function(e,t,i){""===t&&(t="false"),yt.set(e,t,i)}}),Z.support.hrefNormalized||Z.each(["href","src","width","height"],function(e,i){Z.attrHooks[i]=Z.extend(Z.attrHooks[i],{get:function(e){var r=e.getAttribute(i,2);return null===r?t:r}})}),Z.support.style||(Z.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=t+""}}),Z.support.optSelected||(Z.propHooks.selected=Z.extend(Z.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),Z.support.enctype||(Z.propFix.enctype="encoding"),Z.support.checkOn||Z.each(["radio","checkbox"],function(){Z.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),Z.each(["radio","checkbox"],function(){Z.valHooks[this]=Z.extend(Z.valHooks[this],{set:function(e,i){return Z.isArray(i)?e.checked=Z.inArray(Z(e).val(),i)>=0:t}})});var At=/^(?:textarea|input|select)$/i,Rt=/^([^\.]*|)(?:\.(.+)|)$/,Ut=/(?:^|\s)hover(\.\S+|)\b/,Dt=/^key/,Pt=/^(?:mouse|contextmenu)|click/,jt=/^(?:focusinfocus|focusoutblur)$/,Bt=function(e){return Z.event.special.hover?e:e.replace(Ut,"mouseenter$1 mouseleave$1")};Z.event={add:function(e,i,r,n,s){var o,a,l,d,c,h,u,p,f,g,v;if(3!==e.nodeType&&8!==e.nodeType&&i&&r&&(o=Z._data(e))){for(r.handler&&(f=r,r=f.handler,s=f.selector),r.guid||(r.guid=Z.guid++),l=o.events,l||(o.events=l={}),a=o.handle,a||(o.handle=a=function(e){return Z===t||e&&Z.event.triggered===e.type?t:Z.event.dispatch.apply(a.elem,arguments)},a.elem=e),i=Z.trim(Bt(i)).split(" "),d=0;i.length>d;d++)c=Rt.exec(i[d])||[],h=c[1],u=(c[2]||"").split(".").sort(),v=Z.event.special[h]||{},h=(s?v.delegateType:v.bindType)||h,v=Z.event.special[h]||{},p=Z.extend({type:h,origType:c[1],data:n,handler:r,guid:r.guid,selector:s,needsContext:s&&Z.expr.match.needsContext.test(s),namespace:u.join(".")},f),g=l[h],g||(g=l[h]=[],g.delegateCount=0,v.setup&&v.setup.call(e,n,u,a)!==!1||(e.addEventListener?e.addEventListener(h,a,!1):e.attachEvent&&e.attachEvent("on"+h,a))),v.add&&(v.add.call(e,p),p.handler.guid||(p.handler.guid=r.guid)),s?g.splice(g.delegateCount++,0,p):g.push(p),Z.event.global[h]=!0;e=null}},global:{},remove:function(e,t,i,r,n){var s,o,a,l,d,c,h,u,p,f,g,v=Z.hasData(e)&&Z._data(e);if(v&&(u=v.events)){for(t=Z.trim(Bt(t||"")).split(" "),s=0;t.length>s;s++)if(o=Rt.exec(t[s])||[],a=l=o[1],d=o[2],a){for(p=Z.event.special[a]||{},a=(r?p.delegateType:p.bindType)||a,f=u[a]||[],c=f.length,d=d?RegExp("(^|\\.)"+d.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=0;f.length>h;h++)g=f[h],!n&&l!==g.origType||i&&i.guid!==g.guid||d&&!d.test(g.namespace)||r&&r!==g.selector&&("**"!==r||!g.selector)||(f.splice(h--,1),g.selector&&f.delegateCount--,p.remove&&p.remove.call(e,g));0===f.length&&c!==f.length&&(p.teardown&&p.teardown.call(e,d,v.handle)!==!1||Z.removeEvent(e,a,v.handle),delete u[a])}else for(a in u)Z.event.remove(e,a+t[s],i,r,!0);Z.isEmptyObject(u)&&(delete v.handle,Z.removeData(e,"events",!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(i,r,n,s){if(!n||3!==n.nodeType&&8!==n.nodeType){var o,a,l,d,c,h,u,p,f,g,v=i.type||i,m=[];if(!jt.test(v+Z.event.triggered)&&(v.indexOf("!")>=0&&(v=v.slice(0,-1),a=!0),v.indexOf(".")>=0&&(m=v.split("."),v=m.shift(),m.sort()),n&&!Z.event.customEvent[v]||Z.event.global[v]))if(i="object"==typeof i?i[Z.expando]?i:new Z.Event(v,i):new Z.Event(v),i.type=v,i.isTrigger=!0,i.exclusive=a,i.namespace=m.join("."),i.namespace_re=i.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=0>v.indexOf(":")?"on"+v:"",n){if(i.result=t,i.target||(i.target=n),r=null!=r?Z.makeArray(r):[],r.unshift(i),u=Z.event.special[v]||{},!u.trigger||u.trigger.apply(n,r)!==!1){if(f=[[n,u.bindType||v]],!s&&!u.noBubble&&!Z.isWindow(n)){for(g=u.delegateType||v,d=jt.test(g+v)?n:n.parentNode,c=n;d;d=d.parentNode)f.push([d,g]),c=d;c===(n.ownerDocument||z)&&f.push([c.defaultView||c.parentWindow||e,g])}for(l=0;f.length>l&&!i.isPropagationStopped();l++)d=f[l][0],i.type=f[l][1],p=(Z._data(d,"events")||{})[i.type]&&Z._data(d,"handle"),p&&p.apply(d,r),p=h&&d[h],p&&Z.acceptData(d)&&p.apply&&p.apply(d,r)===!1&&i.preventDefault();return i.type=v,s||i.isDefaultPrevented()||u._default&&u._default.apply(n.ownerDocument,r)!==!1||"click"===v&&Z.nodeName(n,"a")||!Z.acceptData(n)||h&&n[v]&&("focus"!==v&&"blur"!==v||0!==i.target.offsetWidth)&&!Z.isWindow(n)&&(c=n[h],c&&(n[h]=null),Z.event.triggered=v,n[v](),Z.event.triggered=t,c&&(n[h]=c)),i.result}}else{o=Z.cache;for(l in o)o[l].events&&o[l].events[v]&&Z.event.trigger(i,r,o[l].handle.elem,!0)}}},dispatch:function(i){i=Z.event.fix(i||e.event);var r,n,s,o,a,l,d,c,h,u=(Z._data(this,"events")||{})[i.type]||[],p=u.delegateCount,f=$.call(arguments),g=!i.exclusive&&!i.namespace,v=Z.event.special[i.type]||{},m=[];if(f[0]=i,i.delegateTarget=this,!v.preDispatch||v.preDispatch.call(this,i)!==!1){if(p&&(!i.button||"click"!==i.type))for(s=i.target;s!=this;s=s.parentNode||this)if(s.disabled!==!0||"click"!==i.type){for(a={},d=[],r=0;p>r;r++)c=u[r],h=c.selector,a[h]===t&&(a[h]=c.needsContext?Z(h,this).index(s)>=0:Z.find(h,this,null,[s]).length),a[h]&&d.push(c);d.length&&m.push({elem:s,matches:d})}for(u.length>p&&m.push({elem:this,matches:u.slice(p)}),r=0;m.length>r&&!i.isPropagationStopped();r++)for(l=m[r],i.currentTarget=l.elem,n=0;l.matches.length>n&&!i.isImmediatePropagationStopped();n++)c=l.matches[n],(g||!i.namespace&&!c.namespace||i.namespace_re&&i.namespace_re.test(c.namespace))&&(i.data=c.data,i.handleObj=c,o=((Z.event.special[c.origType]||{}).handle||c.handler).apply(l.elem,f),o!==t&&(i.result=o,o===!1&&(i.preventDefault(),i.stopPropagation())));return v.postDispatch&&v.postDispatch.call(this,i),i.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,i){var r,n,s,o=i.button,a=i.fromElement;return null==e.pageX&&null!=i.clientX&&(r=e.target.ownerDocument||z,n=r.documentElement,s=r.body,e.pageX=i.clientX+(n&&n.scrollLeft||s&&s.scrollLeft||0)-(n&&n.clientLeft||s&&s.clientLeft||0),e.pageY=i.clientY+(n&&n.scrollTop||s&&s.scrollTop||0)-(n&&n.clientTop||s&&s.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?i.toElement:a),e.which||o===t||(e.which=1&o?1:2&o?3:4&o?2:0),e}},fix:function(e){if(e[Z.expando])return e;var t,i,r=e,n=Z.event.fixHooks[e.type]||{},s=n.props?this.props.concat(n.props):this.props;for(e=Z.Event(r),t=s.length;t;)i=s[--t],e[i]=r[i];return e.target||(e.target=r.srcElement||z),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,n.filter?n.filter(e,r):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,i){Z.isWindow(this)&&(this.onbeforeunload=i)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,i,r){var n=Z.extend(new Z.Event,i,{type:e,isSimulated:!0,originalEvent:{}});r?Z.event.trigger(n,null,t):Z.event.dispatch.call(t,n),n.isDefaultPrevented()&&i.preventDefault()}},Z.event.handle=Z.event.dispatch,Z.removeEvent=z.removeEventListener?function(e,t,i){e.removeEventListener&&e.removeEventListener(t,i,!1)}:function(e,i,r){var n="on"+i;e.detachEvent&&(e[n]===t&&(e[n]=null),e.detachEvent(n,r))},Z.Event=function(e,i){return this instanceof Z.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?a:o):this.type=e,i&&Z.extend(this,i),this.timeStamp=e&&e.timeStamp||Z.now(),this[Z.expando]=!0,t):new Z.Event(e,i)},Z.Event.prototype={preventDefault:function(){this.isDefaultPrevented=a;var e=this.originalEvent;e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=a;var e=this.originalEvent;e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=a,this.stopPropagation()},isDefaultPrevented:o,isPropagationStopped:o,isImmediatePropagationStopped:o},Z.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){Z.event.special[e]={delegateType:t,bindType:t,handle:function(e){var i,r=this,n=e.relatedTarget,s=e.handleObj;return s.selector,(!n||n!==r&&!Z.contains(r,n))&&(e.type=s.origType,i=s.handler.apply(this,arguments),e.type=t),i}}}),Z.support.submitBubbles||(Z.event.special.submit={setup:function(){return Z.nodeName(this,"form")?!1:(Z.event.add(this,"click._submit keypress._submit",function(e){var i=e.target,r=Z.nodeName(i,"input")||Z.nodeName(i,"button")?i.form:t;r&&!Z._data(r,"_submit_attached")&&(Z.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),Z._data(r,"_submit_attached",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&Z.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return Z.nodeName(this,"form")?!1:(Z.event.remove(this,"._submit"),t)}}),Z.support.changeBubbles||(Z.event.special.change={setup:function(){return At.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(Z.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),Z.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),Z.event.simulate("change",this,e,!0)})),!1):(Z.event.add(this,"beforeactivate._change",function(e){var t=e.target;At.test(t.nodeName)&&!Z._data(t,"_change_attached")&&(Z.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||Z.event.simulate("change",this.parentNode,e,!0)}),Z._data(t,"_change_attached",!0))}),t)},handle:function(e){var i=e.target;return this!==i||e.isSimulated||e.isTrigger||"radio"!==i.type&&"checkbox"!==i.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return Z.event.remove(this,"._change"),!At.test(this.nodeName)}}),Z.support.focusinBubbles||Z.each({focus:"focusin",blur:"focusout"},function(e,t){var i=0,r=function(e){Z.event.simulate(t,e.target,Z.event.fix(e),!0)};Z.event.special[t]={setup:function(){0===i++&&z.addEventListener(e,r,!0)},teardown:function(){0===--i&&z.removeEventListener(e,r,!0)}}}),Z.fn.extend({on:function(e,i,r,n,s){var a,l;if("object"==typeof e){"string"!=typeof i&&(r=r||i,i=t);for(l in e)this.on(l,i,r,e[l],s);return this}if(null==r&&null==n?(n=i,r=i=t):null==n&&("string"==typeof i?(n=r,r=t):(n=r,r=i,i=t)),n===!1)n=o;else if(!n)return this;return 1===s&&(a=n,n=function(e){return Z().off(e),a.apply(this,arguments)},n.guid=a.guid||(a.guid=Z.guid++)),this.each(function(){Z.event.add(this,e,n,r,i)})},one:function(e,t,i,r){return this.on(e,t,i,r,1)},off:function(e,i,r){var n,s;if(e&&e.preventDefault&&e.handleObj)return n=e.handleObj,Z(e.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler),this;if("object"==typeof e){for(s in e)this.off(s,i,e[s]);return this}return(i===!1||"function"==typeof i)&&(r=i,i=t),r===!1&&(r=o),this.each(function(){Z.event.remove(this,e,r,i)})},bind:function(e,t,i){return this.on(e,null,t,i)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,i){return Z(this.context).on(e,this.selector,t,i),this},die:function(e,t){return Z(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,i,r){return this.on(t,e,i,r)},undelegate:function(e,t,i){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",i)},trigger:function(e,t){return this.each(function(){Z.event.trigger(e,t,this)})},triggerHandler:function(e,i){return this[0]?Z.event.trigger(e,i,this[0],!0):t},toggle:function(e){var t=arguments,i=e.guid||Z.guid++,r=0,n=function(i){var n=(Z._data(this,"lastToggle"+e.guid)||0)%r;return Z._data(this,"lastToggle"+e.guid,n+1),i.preventDefault(),t[n].apply(this,arguments)||!1};for(n.guid=i;t.length>r;)t[r++].guid=i;return this.click(n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),Z.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(e,t){Z.fn[t]=function(e,i){return null==i&&(i=e,e=null),arguments.length>0?this.on(t,null,e,i):this.trigger(t)},Dt.test(t)&&(Z.event.fixHooks[t]=Z.event.keyHooks),Pt.test(t)&&(Z.event.fixHooks[t]=Z.event.mouseHooks)}),function(e,t){function i(e,t,i,r){i=i||[],t=t||D;var n,s,o,a,l=t.nodeType;if(!e||"string"!=typeof e)return i;if(1!==l&&9!==l)return[];if(o=b(t),!o&&!r&&(n=it.exec(e)))if(a=n[1]){if(9===l){if(s=t.getElementById(a),!s||!s.parentNode)return i;if(s.id===a)return i.push(s),i}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(a))&&E(t,s)&&s.id===a)return i.push(s),i}else{if(n[2])return k.apply(i,L.call(t.getElementsByTagName(e),0)),i;if((a=n[3])&&ut&&t.getElementsByClassName)return k.apply(i,L.call(t.getElementsByClassName(a),0)),i}return g(e.replace(J,"$1"),t,i,r,o)}function r(e){return function(t){var i=t.nodeName.toLowerCase();return"input"===i&&t.type===e}}function n(e){return function(t){var i=t.nodeName.toLowerCase();return("input"===i||"button"===i)&&t.type===e}}function s(e){return N(function(t){return t=+t,N(function(i,r){for(var n,s=e([],i.length,t),o=s.length;o--;)i[n=s[o]]&&(i[n]=!(r[n]=i[n]))})})}function o(e,t,i){if(e===t)return i;for(var r=e.nextSibling;r;){if(r===t)return-1;r=r.nextSibling}return 1}function a(e,t){var r,n,s,o,a,l,d,c=z[R][e+" "];if(c)return t?0:c.slice(0);for(a=e,l=[],d=w.preFilter;a;){(!r||(n=Q.exec(a)))&&(n&&(a=a.slice(n[0].length)||a),l.push(s=[])),r=!1,(n=et.exec(a))&&(s.push(r=new U(n.shift())),a=a.slice(r.length),r.type=n[0].replace(J," "));for(o in w.filter)!(n=at[o].exec(a))||d[o]&&!(n=d[o](n))||(s.push(r=new U(n.shift())),a=a.slice(r.length),r.type=o,r.matches=n);if(!r)break}return t?a.length:a?i.error(e):z(e,l).slice(0)}function l(e,t,i){var r=t.dir,n=i&&"parentNode"===t.dir,s=B++;return t.first?function(t,i,s){for(;t=t[r];)if(n||1===t.nodeType)return e(t,i,s)}:function(t,i,o){if(o){for(;t=t[r];)if((n||1===t.nodeType)&&e(t,i,o))return t}else for(var a,l=j+" "+s+" ",d=l+m;t=t[r];)if(n||1===t.nodeType){if((a=t[R])===d)return t.sizset;if("string"==typeof a&&0===a.indexOf(l)){if(t.sizset)return t}else{if(t[R]=d,e(t,i,o))return t.sizset=!0,t;t.sizset=!1}}}}function d(e){return e.length>1?function(t,i,r){for(var n=e.length;n--;)if(!e[n](t,i,r))return!1;return!0}:e[0]}function c(e,t,i,r,n){for(var s,o=[],a=0,l=e.length,d=null!=t;l>a;a++)(s=e[a])&&(!i||i(s,r,n))&&(o.push(s),d&&t.push(a));return o}function h(e,t,i,r,n,s){return r&&!r[R]&&(r=h(r)),n&&!n[R]&&(n=h(n,s)),N(function(s,o,a,l){var d,h,u,p=[],g=[],v=o.length,m=s||f(t||"*",a.nodeType?[a]:a,[]),y=!e||!s&&t?m:c(m,p,e,a,l),w=i?n||(s?e:v||r)?[]:o:y;if(i&&i(y,w,a,l),r)for(d=c(w,g),r(d,[],a,l),h=d.length;h--;)(u=d[h])&&(w[g[h]]=!(y[g[h]]=u));if(s){if(n||e){if(n){for(d=[],h=w.length;h--;)(u=w[h])&&d.push(y[h]=u);n(null,w=[],d,l)}for(h=w.length;h--;)(u=w[h])&&(d=n?I.call(s,u):p[h])>-1&&(s[d]=!(o[d]=u))}}else w=c(w===o?w.splice(v,w.length):w),n?n(null,o,w,l):k.apply(o,w)})}function u(e){for(var t,i,r,n=e.length,s=w.relative[e[0].type],o=s||w.relative[" "],a=s?1:0,c=l(function(e){return e===t},o,!0),p=l(function(e){return I.call(t,e)>-1},o,!0),f=[function(e,i,r){return!s&&(r||i!==M)||((t=i).nodeType?c(e,i,r):p(e,i,r))}];n>a;a++)if(i=w.relative[e[a].type])f=[l(d(f),i)];else{if(i=w.filter[e[a].type].apply(null,e[a].matches),i[R]){for(r=++a;n>r&&!w.relative[e[r].type];r++);return h(a>1&&d(f),a>1&&e.slice(0,a-1).join("").replace(J,"$1"),i,r>a&&u(e.slice(a,r)),n>r&&u(e=e.slice(r)),n>r&&e.join(""))}f.push(i)}return d(f)}function p(e,t){var r=t.length>0,n=e.length>0,s=function(o,a,l,d,h){var u,p,f,g=[],v=0,y="0",x=o&&[],b=null!=h,E=M,_=o||n&&w.find.TAG("*",h&&a.parentNode||a),T=j+=null==E?1:Math.E;for(b&&(M=a!==D&&a,m=s.el);null!=(u=_[y]);y++){if(n&&u){for(p=0;f=e[p];p++)if(f(u,a,l)){d.push(u);break}b&&(j=T,m=++s.el)}r&&((u=!f&&u)&&v--,o&&x.push(u))}if(v+=y,r&&y!==v){for(p=0;f=t[p];p++)f(x,g,a,l);if(o){if(v>0)for(;y--;)x[y]||g[y]||(g[y]=H.call(d));g=c(g)}k.apply(d,g),b&&!o&&g.length>0&&v+t.length>1&&i.uniqueSort(d)}return b&&(j=T,M=E),x};return s.el=0,r?N(s):s}function f(e,t,r){for(var n=0,s=t.length;s>n;n++)i(e,t[n],r);return r}function g(e,t,i,r,n){var s,o,l,d,c,h=a(e);if(h.length,!r&&1===h.length){if(o=h[0]=h[0].slice(0),o.length>2&&"ID"===(l=o[0]).type&&9===t.nodeType&&!n&&w.relative[o[1].type]){if(t=w.find.ID(l.matches[0].replace(ot,""),t,n)[0],!t)return i;e=e.slice(o.shift().length)}for(s=at.POS.test(e)?-1:o.length-1;s>=0&&(l=o[s],!w.relative[d=l.type]);s--)if((c=w.find[d])&&(r=c(l.matches[0].replace(ot,""),rt.test(o[0].type)&&t.parentNode||t,n))){if(o.splice(s,1),e=r.length&&o.join(""),!e)return k.apply(i,L.call(r,0)),i;break}}return _(e,h)(r,t,n,i,rt.test(e)),i}function v(){}var m,y,w,x,b,E,_,T,C,M,S=!0,A="undefined",R=("sizcache"+Math.random()).replace(".",""),U=String,D=e.document,P=D.documentElement,j=0,B=0,H=[].pop,k=[].push,L=[].slice,I=[].indexOf||function(e){for(var t=0,i=this.length;i>t;t++)if(this[t]===e)return t;return-1},N=function(e,t){return e[R]=null==t||t,e},F=function(){var e={},t=[];return N(function(i,r){return t.push(i)>w.cacheLength&&delete e[t.shift()],e[i+" "]=r},e)},O=F(),z=F(),V=F(),W="[\\x20\\t\\r\\n\\f]",G="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",X=G.replace("w","w#"),q="([*^$|!~]?=)",$="\\["+W+"*("+G+")"+W+"*(?:"+q+W+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+X+")|)|)"+W+"*\\]",Y=":("+G+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+$+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+W+"*((?:-\\d)?\\d*)"+W+"*\\)|)(?=[^-]|$)",J=RegExp("^"+W+"+|((?:^|[^\\\\])(?:\\\\.)*)"+W+"+$","g"),Q=RegExp("^"+W+"*,"+W+"*"),et=RegExp("^"+W+"*([\\x20\\t\\r\\n\\f>+~])"+W+"*"),tt=RegExp(Y),it=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,rt=/[\x20\t\r\n\f]*[+~]/,nt=/h\d/i,st=/input|select|textarea|button/i,ot=/\\(?!\\)/g,at={ID:RegExp("^#("+G+")"),CLASS:RegExp("^\\.("+G+")"),NAME:RegExp("^\\[name=['\"]?("+G+")['\"]?\\]"),TAG:RegExp("^("+G.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+Y),POS:RegExp(K,"i"),CHILD:RegExp("^:(only|nth|first|last)-child(?:\\("+W+"*(even|odd|(([+-]|)(\\d*)n|)"+W+"*(?:([+-]|)"+W+"*(\\d+)|))"+W+"*\\)|)","i"),needsContext:RegExp("^"+W+"*[>+~]|"+K,"i")},lt=function(e){var t=D.createElement("div");try{return e(t)}catch(i){return!1}finally{t=null}},dt=lt(function(e){return e.appendChild(D.createComment("")),!e.getElementsByTagName("*").length}),ct=lt(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")}),ht=lt(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),ut=lt(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),pt=lt(function(e){e.id=R+0,e.innerHTML="<a name='"+R+"'></a><div name='"+R+"'></div>",P.insertBefore(e,P.firstChild);var t=D.getElementsByName&&D.getElementsByName(R).length===2+D.getElementsByName(R+0).length;return y=!D.getElementById(R),P.removeChild(e),t});try{L.call(P.childNodes,0)[0].nodeType}catch(ft){L=function(e){for(var t,i=[];t=this[e];e++)i.push(t);return i}}i.matches=function(e,t){return i(e,null,null,t)},i.matchesSelector=function(e,t){return i(t,null,null,[e]).length>0},x=i.getText=function(e){var t,i="",r=0,n=e.nodeType;if(n){if(1===n||9===n||11===n){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)i+=x(e)}else if(3===n||4===n)return e.nodeValue}else for(;t=e[r];r++)i+=x(t);return i},b=i.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},E=i.contains=P.contains?function(e,t){var i=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&1===r.nodeType&&i.contains&&i.contains(r))}:P.compareDocumentPosition?function(e,t){return t&&!!(16&e.compareDocumentPosition(t))}:function(e,t){for(;t=t.parentNode;)if(t===e)return!0;return!1},i.attr=function(e,t){var i,r=b(e);return r||(t=t.toLowerCase()),(i=w.attrHandle[t])?i(e):r||ht?e.getAttribute(t):(i=e.getAttributeNode(t),i?"boolean"==typeof e[t]?e[t]?t:null:i.specified?i.value:null:null)},w=i.selectors={cacheLength:50,createPseudo:N,match:at,attrHandle:ct?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:y?function(e,t,i){if(typeof t.getElementById!==A&&!i){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,i,r){if(typeof i.getElementById!==A&&!r){var n=i.getElementById(e);return n?n.id===e||typeof n.getAttributeNode!==A&&n.getAttributeNode("id").value===e?[n]:t:[]}},TAG:dt?function(e,i){return typeof i.getElementsByTagName!==A?i.getElementsByTagName(e):t}:function(e,t){var i=t.getElementsByTagName(e);if("*"===e){for(var r,n=[],s=0;r=i[s];s++)1===r.nodeType&&n.push(r);return n}return i},NAME:pt&&function(e,i){return typeof i.getElementsByName!==A?i.getElementsByName(name):t},CLASS:ut&&function(e,i,r){return typeof i.getElementsByClassName===A||r?t:i.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ot,""),e[3]=(e[4]||e[5]||"").replace(ot,""),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1]?(e[2]||i.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*("even"===e[2]||"odd"===e[2])),e[4]=+(e[6]+e[7]||"odd"===e[2])):e[2]&&i.error(e[0]),e},PSEUDO:function(e){var t,i;return at.CHILD.test(e[0])?null:(e[3]?e[2]=e[3]:(t=e[4])&&(tt.test(t)&&(i=a(t,!0))&&(i=t.indexOf(")",t.length-i)-t.length)&&(t=t.slice(0,i),e[0]=e[0].slice(0,i)),e[2]=t),e.slice(0,3))}},filter:{ID:y?function(e){return e=e.replace(ot,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace(ot,""),function(t){var i=typeof t.getAttributeNode!==A&&t.getAttributeNode("id");return i&&i.value===e}},TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(ot,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=O[R][e+" "];return t||(t=RegExp("(^|"+W+")"+e+"("+W+"|$)"))&&O(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,r){return function(n){var s=i.attr(n,e);return null==s?"!="===t:t?(s+="","="===t?s===r:"!="===t?s!==r:"^="===t?r&&0===s.indexOf(r):"*="===t?r&&s.indexOf(r)>-1:"$="===t?r&&s.substr(s.length-r.length)===r:"~="===t?(" "+s+" ").indexOf(r)>-1:"|="===t?s===r||s.substr(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,i,r){return"nth"===e?function(e){var t,n,s=e.parentNode;if(1===i&&0===r)return!0;if(s)for(n=0,t=s.firstChild;t&&(1!==t.nodeType||(n++,e!==t));t=t.nextSibling);return n-=r,n===i||0===n%i&&n/i>=0}:function(t){var i=t;switch(e){case"only":case"first":for(;i=i.previousSibling;)if(1===i.nodeType)return!1;if("first"===e)return!0;i=t;case"last":for(;i=i.nextSibling;)if(1===i.nodeType)return!1;return!0}}},PSEUDO:function(e,t){var r,n=w.pseudos[e]||w.setFilters[e.toLowerCase()]||i.error("unsupported pseudo: "+e);return n[R]?n(t):n.length>1?(r=[e,e,"",t],w.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,i){for(var r,s=n(e,t),o=s.length;o--;)r=I.call(e,s[o]),e[r]=!(i[r]=s[o])}):function(e){return n(e,0,r)}):n}},pseudos:{not:N(function(e){var t=[],i=[],r=_(e.replace(J,"$1"));return r[R]?N(function(e,t,i,n){for(var s,o=r(e,null,n,[]),a=e.length;a--;)(s=o[a])&&(e[a]=!(t[a]=s))}):function(e,n,s){return t[0]=e,r(t,null,s,i),!i.pop()}}),has:N(function(e){return function(t){return i(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||x(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!w.pseudos.empty(e)},empty:function(e){var t;for(e=e.firstChild;e;){if(e.nodeName>"@"||3===(t=e.nodeType)||4===t)return!1;e=e.nextSibling}return!0},header:function(e){return nt.test(e.nodeName)},text:function(e){var t,i;return"input"===e.nodeName.toLowerCase()&&"text"===(t=e.type)&&(null==(i=e.getAttribute("type"))||i.toLowerCase()===t)},radio:r("radio"),checkbox:r("checkbox"),file:r("file"),password:r("password"),image:r("image"),submit:n("submit"),reset:n("reset"),button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},input:function(e){return st.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:s(function(){return[0]}),last:s(function(e,t){return[t-1]}),eq:s(function(e,t,i){return[0>i?i+t:i]}),even:s(function(e,t){for(var i=0;t>i;i+=2)e.push(i);return e}),odd:s(function(e,t){for(var i=1;t>i;i+=2)e.push(i);return e}),lt:s(function(e,t,i){for(var r=0>i?i+t:i;--r>=0;)e.push(r);return e}),gt:s(function(e,t,i){for(var r=0>i?i+t:i;t>++r;)e.push(r);return e})}},T=P.compareDocumentPosition?function(e,t){return e===t?(C=!0,0):(e.compareDocumentPosition&&t.compareDocumentPosition?4&e.compareDocumentPosition(t):e.compareDocumentPosition)?-1:1}:function(e,t){if(e===t)return C=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var i,r,n=[],s=[],a=e.parentNode,l=t.parentNode,d=a;if(a===l)return o(e,t);if(!a)return-1;if(!l)return 1;for(;d;)n.unshift(d),d=d.parentNode;for(d=l;d;)s.unshift(d),d=d.parentNode;i=n.length,r=s.length;for(var c=0;i>c&&r>c;c++)if(n[c]!==s[c])return o(n[c],s[c]);return c===i?o(e,s[c],-1):o(n[c],t,1)},[0,0].sort(T),S=!C,i.uniqueSort=function(e){var t,i=[],r=1,n=0;if(C=S,e.sort(T),C){for(;t=e[r];r++)t===e[r-1]&&(n=i.push(r));for(;n--;)e.splice(i[n],1)}return e},i.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},_=i.compile=function(e,t){var i,r=[],n=[],s=V[R][e+" "];if(!s){for(t||(t=a(e)),i=t.length;i--;)s=u(t[i]),s[R]?r.push(s):n.push(s);s=V(e,p(n,r))}return s},D.querySelectorAll&&function(){var e,t=g,r=/'|\\/g,n=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,s=[":focus"],o=[":active"],l=P.matchesSelector||P.mozMatchesSelector||P.webkitMatchesSelector||P.oMatchesSelector||P.msMatchesSelector;lt(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||s.push("\\["+W+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||s.push(":checked")}),lt(function(e){e.innerHTML="<p test=''></p>",e.querySelectorAll("[test^='']").length&&s.push("[*^$]="+W+"*(?:\"\"|'')"),e.innerHTML="<input type='hidden'/>",e.querySelectorAll(":enabled").length||s.push(":enabled",":disabled")}),s=RegExp(s.join("|")),g=function(e,i,n,o,l){if(!o&&!l&&!s.test(e)){var d,c,h=!0,u=R,p=i,f=9===i.nodeType&&e;if(1===i.nodeType&&"object"!==i.nodeName.toLowerCase()){for(d=a(e),(h=i.getAttribute("id"))?u=h.replace(r,"\\$&"):i.setAttribute("id",u),u="[id='"+u+"'] ",c=d.length;c--;)d[c]=u+d[c].join("");p=rt.test(e)&&i.parentNode||i,f=d.join(",")}if(f)try{return k.apply(n,L.call(p.querySelectorAll(f),0)),n}catch(g){}finally{h||i.removeAttribute("id")}}return t(e,i,n,o,l)},l&&(lt(function(t){e=l.call(t,"div");try{l.call(t,"[test!='']:sizzle"),o.push("!=",Y)}catch(i){}}),o=RegExp(o.join("|")),i.matchesSelector=function(t,r){if(r=r.replace(n,"='$1']"),!b(t)&&!o.test(r)&&!s.test(r))try{var a=l.call(t,r);if(a||e||t.document&&11!==t.document.nodeType)return a}catch(d){}return i(r,null,null,[t]).length>0})}(),w.pseudos.nth=w.pseudos.eq,w.filters=v.prototype=w.pseudos,w.setFilters=new v,i.attr=Z.attr,Z.find=i,Z.expr=i.selectors,Z.expr[":"]=Z.expr.pseudos,Z.unique=i.uniqueSort,Z.text=i.getText,Z.isXMLDoc=i.isXML,Z.contains=i.contains}(e);var Ht=/Until$/,kt=/^(?:parents|prev(?:Until|All))/,Lt=/^.[^:#\[\.,]*$/,It=Z.expr.match.needsContext,Nt={children:!0,contents:!0,next:!0,prev:!0};Z.fn.extend({find:function(e){var t,i,r,n,s,o,a=this;if("string"!=typeof e)return Z(e).filter(function(){for(t=0,i=a.length;i>t;t++)if(Z.contains(a[t],this))return!0});for(o=this.pushStack("","find",e),t=0,i=this.length;i>t;t++)if(r=o.length,Z.find(e,this[t],o),t>0)for(n=r;o.length>n;n++)for(s=0;r>s;s++)if(o[s]===o[n]){o.splice(n--,1);break}return o},has:function(e){var t,i=Z(e,this),r=i.length;return this.filter(function(){for(t=0;r>t;t++)if(Z.contains(this,i[t]))return!0})},not:function(e){return this.pushStack(c(this,e,!1),"not",e)},filter:function(e){return this.pushStack(c(this,e,!0),"filter",e)},is:function(e){return!!e&&("string"==typeof e?It.test(e)?Z(e,this.context).index(this[0])>=0:Z.filter(e,this).length>0:this.filter(e).length>0)
},closest:function(e,t){for(var i,r=0,n=this.length,s=[],o=It.test(e)||"string"!=typeof e?Z(e,t||this.context):0;n>r;r++)for(i=this[r];i&&i.ownerDocument&&i!==t&&11!==i.nodeType;){if(o?o.index(i)>-1:Z.find.matchesSelector(i,e)){s.push(i);break}i=i.parentNode}return s=s.length>1?Z.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?"string"==typeof e?Z.inArray(this[0],Z(e)):Z.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var i="string"==typeof e?Z(e,t):Z.makeArray(e&&e.nodeType?[e]:e),r=Z.merge(this.get(),i);return this.pushStack(l(i[0])||l(r[0])?r:Z.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),Z.fn.andSelf=Z.fn.addBack,Z.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Z.dir(e,"parentNode")},parentsUntil:function(e,t,i){return Z.dir(e,"parentNode",i)},next:function(e){return d(e,"nextSibling")},prev:function(e){return d(e,"previousSibling")},nextAll:function(e){return Z.dir(e,"nextSibling")},prevAll:function(e){return Z.dir(e,"previousSibling")},nextUntil:function(e,t,i){return Z.dir(e,"nextSibling",i)},prevUntil:function(e,t,i){return Z.dir(e,"previousSibling",i)},siblings:function(e){return Z.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return Z.sibling(e.firstChild)},contents:function(e){return Z.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:Z.merge([],e.childNodes)}},function(e,t){Z.fn[e]=function(i,r){var n=Z.map(this,t,i);return Ht.test(e)||(r=i),r&&"string"==typeof r&&(n=Z.filter(r,n)),n=this.length>1&&!Nt[e]?Z.unique(n):n,this.length>1&&kt.test(e)&&(n=n.reverse()),this.pushStack(n,e,$.call(arguments).join(","))}}),Z.extend({filter:function(e,t,i){return i&&(e=":not("+e+")"),1===t.length?Z.find.matchesSelector(t[0],e)?[t[0]]:[]:Z.find.matches(e,t)},dir:function(e,i,r){for(var n=[],s=e[i];s&&9!==s.nodeType&&(r===t||1!==s.nodeType||!Z(s).is(r));)1===s.nodeType&&n.push(s),s=s[i];return n},sibling:function(e,t){for(var i=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&i.push(e);return i}});var Ft="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Ot=/ jQuery\d+="(?:null|\d+)"/g,zt=/^\s+/,Vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Wt=/<([\w:]+)/,Gt=/<tbody/i,Xt=/<|&#?\w+;/,qt=/<(?:script|style|link)/i,$t=/<(?:script|object|embed|option|style)/i,Yt=RegExp("<(?:"+Ft+")[\\s/>]","i"),Kt=/^(?:checkbox|radio)$/,Jt=/checked\s*(?:[^=]|=\s*.checked.)/i,Qt=/\/(java|ecma)script/i,Zt=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,ei={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},ti=h(z),ii=ti.appendChild(z.createElement("div"));ei.optgroup=ei.option,ei.tbody=ei.tfoot=ei.colgroup=ei.caption=ei.thead,ei.th=ei.td,Z.support.htmlSerialize||(ei._default=[1,"X<div>","</div>"]),Z.fn.extend({text:function(e){return Z.access(this,function(e){return e===t?Z.text(this):this.empty().append((this[0]&&this[0].ownerDocument||z).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(Z.isFunction(e))return this.each(function(t){Z(this).wrapAll(e.call(this,t))});if(this[0]){var t=Z(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return Z.isFunction(e)?this.each(function(t){Z(this).wrapInner(e.call(this,t))}):this.each(function(){var t=Z(this),i=t.contents();i.length?i.wrapAll(e):t.append(e)})},wrap:function(e){var t=Z.isFunction(e);return this.each(function(i){Z(this).wrapAll(t?e.call(this,i):e)})},unwrap:function(){return this.parent().each(function(){Z.nodeName(this,"body")||Z(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!l(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=Z.clean(arguments);return this.pushStack(Z.merge(e,this),"before",this.selector)}},after:function(){if(!l(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=Z.clean(arguments);return this.pushStack(Z.merge(this,e),"after",this.selector)}},remove:function(e,t){for(var i,r=0;null!=(i=this[r]);r++)(!e||Z.filter(e,[i]).length)&&(t||1!==i.nodeType||(Z.cleanData(i.getElementsByTagName("*")),Z.cleanData([i])),i.parentNode&&i.parentNode.removeChild(i));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)for(1===e.nodeType&&Z.cleanData(e.getElementsByTagName("*"));e.firstChild;)e.removeChild(e.firstChild);return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return Z.clone(this,e,t)})},html:function(e){return Z.access(this,function(e){var i=this[0]||{},r=0,n=this.length;if(e===t)return 1===i.nodeType?i.innerHTML.replace(Ot,""):t;if(!("string"!=typeof e||qt.test(e)||!Z.support.htmlSerialize&&Yt.test(e)||!Z.support.leadingWhitespace&&zt.test(e)||ei[(Wt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(Vt,"<$1></$2>");try{for(;n>r;r++)i=this[r]||{},1===i.nodeType&&(Z.cleanData(i.getElementsByTagName("*")),i.innerHTML=e);i=0}catch(s){}}i&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return l(this[0])?this.length?this.pushStack(Z(Z.isFunction(e)?e():e),"replaceWith",e):this:Z.isFunction(e)?this.each(function(t){var i=Z(this),r=i.html();i.replaceWith(e.call(this,t,r))}):("string"!=typeof e&&(e=Z(e).detach()),this.each(function(){var t=this.nextSibling,i=this.parentNode;Z(this).remove(),t?Z(t).before(e):Z(i).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,i,r){e=[].concat.apply([],e);var n,s,o,a,l=0,d=e[0],c=[],h=this.length;if(!Z.support.checkClone&&h>1&&"string"==typeof d&&Jt.test(d))return this.each(function(){Z(this).domManip(e,i,r)});if(Z.isFunction(d))return this.each(function(n){var s=Z(this);e[0]=d.call(this,n,i?s.html():t),s.domManip(e,i,r)});if(this[0]){if(n=Z.buildFragment(e,this,c),o=n.fragment,s=o.firstChild,1===o.childNodes.length&&(o=s),s)for(i=i&&Z.nodeName(s,"tr"),a=n.cacheable||h-1;h>l;l++)r.call(i&&Z.nodeName(this[l],"table")?u(this[l],"tbody"):this[l],l===a?o:Z.clone(o,!0,!0));o=s=null,c.length&&Z.each(c,function(e,t){t.src?Z.ajax?Z.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):Z.error("no ajax"):Z.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Zt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),Z.buildFragment=function(e,i,r){var n,s,o,a=e[0];return i=i||z,i=!i.nodeType&&i[0]||i,i=i.ownerDocument||i,!(1===e.length&&"string"==typeof a&&512>a.length&&i===z&&"<"===a.charAt(0))||$t.test(a)||!Z.support.checkClone&&Jt.test(a)||!Z.support.html5Clone&&Yt.test(a)||(s=!0,n=Z.fragments[a],o=n!==t),n||(n=i.createDocumentFragment(),Z.clean(e,i,n,r),s&&(Z.fragments[a]=o&&n)),{fragment:n,cacheable:s}},Z.fragments={},Z.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){Z.fn[e]=function(i){var r,n=0,s=[],o=Z(i),a=o.length,l=1===this.length&&this[0].parentNode;if((null==l||l&&11===l.nodeType&&1===l.childNodes.length)&&1===a)return o[t](this[0]),this;for(;a>n;n++)r=(n>0?this.clone(!0):this).get(),Z(o[n])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),Z.extend({clone:function(e,t,i){var r,n,s,o;if(Z.support.html5Clone||Z.isXMLDoc(e)||!Yt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(ii.innerHTML=e.outerHTML,ii.removeChild(o=ii.firstChild)),!(Z.support.noCloneEvent&&Z.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||Z.isXMLDoc(e)))for(f(e,o),r=g(e),n=g(o),s=0;r[s];++s)n[s]&&f(r[s],n[s]);if(t&&(p(e,o),i))for(r=g(e),n=g(o),s=0;r[s];++s)p(r[s],n[s]);return r=n=null,o},clean:function(e,i,r,n){var s,o,a,l,d,c,u,p,f,g,m,y=i===z&&ti,w=[];for(i&&i.createDocumentFragment!==t||(i=z),s=0;null!=(a=e[s]);s++)if("number"==typeof a&&(a+=""),a){if("string"==typeof a)if(Xt.test(a)){for(y=y||h(i),u=i.createElement("div"),y.appendChild(u),a=a.replace(Vt,"<$1></$2>"),l=(Wt.exec(a)||["",""])[1].toLowerCase(),d=ei[l]||ei._default,c=d[0],u.innerHTML=d[1]+a+d[2];c--;)u=u.lastChild;if(!Z.support.tbody)for(p=Gt.test(a),f="table"!==l||p?"<table>"!==d[1]||p?[]:u.childNodes:u.firstChild&&u.firstChild.childNodes,o=f.length-1;o>=0;--o)Z.nodeName(f[o],"tbody")&&!f[o].childNodes.length&&f[o].parentNode.removeChild(f[o]);!Z.support.leadingWhitespace&&zt.test(a)&&u.insertBefore(i.createTextNode(zt.exec(a)[0]),u.firstChild),a=u.childNodes,u.parentNode.removeChild(u)}else a=i.createTextNode(a);a.nodeType?w.push(a):Z.merge(w,a)}if(u&&(a=u=y=null),!Z.support.appendChecked)for(s=0;null!=(a=w[s]);s++)Z.nodeName(a,"input")?v(a):a.getElementsByTagName!==t&&Z.grep(a.getElementsByTagName("input"),v);if(r)for(g=function(e){return!e.type||Qt.test(e.type)?n?n.push(e.parentNode?e.parentNode.removeChild(e):e):r.appendChild(e):t},s=0;null!=(a=w[s]);s++)Z.nodeName(a,"script")&&g(a)||(r.appendChild(a),a.getElementsByTagName!==t&&(m=Z.grep(Z.merge([],a.getElementsByTagName("script")),g),w.splice.apply(w,[s+1,0].concat(m)),s+=m.length));return w},cleanData:function(e,t){for(var i,r,n,s,o=0,a=Z.expando,l=Z.cache,d=Z.support.deleteExpando,c=Z.event.special;null!=(n=e[o]);o++)if((t||Z.acceptData(n))&&(r=n[a],i=r&&l[r])){if(i.events)for(s in i.events)c[s]?Z.event.remove(n,s):Z.removeEvent(n,s,i.handle);l[r]&&(delete l[r],d?delete n[a]:n.removeAttribute?n.removeAttribute(a):n[a]=null,Z.deletedIds.push(r))}}}),function(){var e,t;Z.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=Z.uaMatch(W.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),Z.browser=t,Z.sub=function(){function e(t,i){return new e.fn.init(t,i)}Z.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(i,r){return r&&r instanceof Z&&!(r instanceof e)&&(r=e(r)),Z.fn.init.call(this,i,r,t)},e.fn.init.prototype=e.fn;var t=e(z);return e}}();var ri,ni,si,oi=/alpha\([^)]*\)/i,ai=/opacity=([^)]*)/,li=/^(top|right|bottom|left)$/,di=/^(none|table(?!-c[ea]).+)/,ci=/^margin/,hi=RegExp("^("+et+")(.*)$","i"),ui=RegExp("^("+et+")(?!px)[a-z%]+$","i"),pi=RegExp("^([-+])=("+et+")","i"),fi={BODY:"block"},gi={position:"absolute",visibility:"hidden",display:"block"},vi={letterSpacing:0,fontWeight:400},mi=["Top","Right","Bottom","Left"],yi=["Webkit","O","Moz","ms"],wi=Z.fn.toggle;Z.fn.extend({css:function(e,i){return Z.access(this,function(e,i,r){return r!==t?Z.style(e,i,r):Z.css(e,i)},e,i,arguments.length>1)},show:function(){return w(this,!0)},hide:function(){return w(this)},toggle:function(e,t){var i="boolean"==typeof e;return Z.isFunction(e)&&Z.isFunction(t)?wi.apply(this,arguments):this.each(function(){(i?e:y(this))?Z(this).show():Z(this).hide()})}}),Z.extend({cssHooks:{opacity:{get:function(e,t){if(t){var i=ri(e,"opacity");return""===i?"1":i}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":Z.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,i,r,n){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var s,o,a,l=Z.camelCase(i),d=e.style;if(i=Z.cssProps[l]||(Z.cssProps[l]=m(d,l)),a=Z.cssHooks[i]||Z.cssHooks[l],r===t)return a&&"get"in a&&(s=a.get(e,!1,n))!==t?s:d[i];if(o=typeof r,"string"===o&&(s=pi.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(Z.css(e,i)),o="number"),!(null==r||"number"===o&&isNaN(r)||("number"!==o||Z.cssNumber[l]||(r+="px"),a&&"set"in a&&(r=a.set(e,r,n))===t)))try{d[i]=r}catch(c){}}},css:function(e,i,r,n){var s,o,a,l=Z.camelCase(i);return i=Z.cssProps[l]||(Z.cssProps[l]=m(e.style,l)),a=Z.cssHooks[i]||Z.cssHooks[l],a&&"get"in a&&(s=a.get(e,!0,n)),s===t&&(s=ri(e,i)),"normal"===s&&i in vi&&(s=vi[i]),r||n!==t?(o=parseFloat(s),r||Z.isNumeric(o)?o||0:s):s},swap:function(e,t,i){var r,n,s={};for(n in t)s[n]=e.style[n],e.style[n]=t[n];r=i.call(e);for(n in t)e.style[n]=s[n];return r}}),e.getComputedStyle?ri=function(t,i){var r,n,s,o,a=e.getComputedStyle(t,null),l=t.style;return a&&(r=a.getPropertyValue(i)||a[i],""!==r||Z.contains(t.ownerDocument,t)||(r=Z.style(t,i)),ui.test(r)&&ci.test(i)&&(n=l.width,s=l.minWidth,o=l.maxWidth,l.minWidth=l.maxWidth=l.width=r,r=a.width,l.width=n,l.minWidth=s,l.maxWidth=o)),r}:z.documentElement.currentStyle&&(ri=function(e,t){var i,r,n=e.currentStyle&&e.currentStyle[t],s=e.style;return null==n&&s&&s[t]&&(n=s[t]),ui.test(n)&&!li.test(t)&&(i=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left="fontSize"===t?"1em":n,n=s.pixelLeft+"px",s.left=i,r&&(e.runtimeStyle.left=r)),""===n?"auto":n}),Z.each(["height","width"],function(e,i){Z.cssHooks[i]={get:function(e,r,n){return r?0===e.offsetWidth&&di.test(ri(e,"display"))?Z.swap(e,gi,function(){return E(e,i,n)}):E(e,i,n):t},set:function(e,t,r){return x(e,t,r?b(e,i,r,Z.support.boxSizing&&"border-box"===Z.css(e,"boxSizing")):0)}}}),Z.support.opacity||(Z.cssHooks.opacity={get:function(e,t){return ai.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var i=e.style,r=e.currentStyle,n=Z.isNumeric(t)?"alpha(opacity="+100*t+")":"",s=r&&r.filter||i.filter||"";i.zoom=1,t>=1&&""===Z.trim(s.replace(oi,""))&&i.removeAttribute&&(i.removeAttribute("filter"),r&&!r.filter)||(i.filter=oi.test(s)?s.replace(oi,n):s+" "+n)}}),Z(function(){Z.support.reliableMarginRight||(Z.cssHooks.marginRight={get:function(e,i){return Z.swap(e,{display:"inline-block"},function(){return i?ri(e,"marginRight"):t})}}),!Z.support.pixelPosition&&Z.fn.position&&Z.each(["top","left"],function(e,t){Z.cssHooks[t]={get:function(e,i){if(i){var r=ri(e,t);return ui.test(r)?Z(e).position()[t]+"px":r}}}})}),Z.expr&&Z.expr.filters&&(Z.expr.filters.hidden=function(e){return 0===e.offsetWidth&&0===e.offsetHeight||!Z.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||ri(e,"display"))},Z.expr.filters.visible=function(e){return!Z.expr.filters.hidden(e)}),Z.each({margin:"",padding:"",border:"Width"},function(e,t){Z.cssHooks[e+t]={expand:function(i){var r,n="string"==typeof i?i.split(" "):[i],s={};for(r=0;4>r;r++)s[e+mi[r]+t]=n[r]||n[r-2]||n[0];return s}},ci.test(e)||(Z.cssHooks[e+t].set=x)});var xi=/%20/g,bi=/\[\]$/,Ei=/\r?\n/g,_i=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Ti=/^(?:select|textarea)/i;Z.fn.extend({serialize:function(){return Z.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?Z.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||Ti.test(this.nodeName)||_i.test(this.type))}).map(function(e,t){var i=Z(this).val();return null==i?null:Z.isArray(i)?Z.map(i,function(e){return{name:t.name,value:e.replace(Ei,"\r\n")}}):{name:t.name,value:i.replace(Ei,"\r\n")}}).get()}}),Z.param=function(e,i){var r,n=[],s=function(e,t){t=Z.isFunction(t)?t():null==t?"":t,n[n.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(i===t&&(i=Z.ajaxSettings&&Z.ajaxSettings.traditional),Z.isArray(e)||e.jquery&&!Z.isPlainObject(e))Z.each(e,function(){s(this.name,this.value)});else for(r in e)T(r,e[r],i,s);return n.join("&").replace(xi,"+")};var Ci,Mi,Si=/#.*$/,Ai=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Ri=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Ui=/^(?:GET|HEAD)$/,Di=/^\/\//,Pi=/\?/,ji=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,Bi=/([?&])_=[^&]*/,Hi=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,ki=Z.fn.load,Li={},Ii={},Ni=["*/"]+["*"];try{Mi=V.href}catch(Fi){Mi=z.createElement("a"),Mi.href="",Mi=Mi.href}Ci=Hi.exec(Mi.toLowerCase())||[],Z.fn.load=function(e,i,r){if("string"!=typeof e&&ki)return ki.apply(this,arguments);if(!this.length)return this;var n,s,o,a=this,l=e.indexOf(" ");return l>=0&&(n=e.slice(l,e.length),e=e.slice(0,l)),Z.isFunction(i)?(r=i,i=t):i&&"object"==typeof i&&(s="POST"),Z.ajax({url:e,type:s,dataType:"html",data:i,complete:function(e,t){r&&a.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,a.html(n?Z("<div>").append(e.replace(ji,"")).find(n):e)}),this},Z.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){Z.fn[t]=function(e){return this.on(t,e)}}),Z.each(["get","post"],function(e,i){Z[i]=function(e,r,n,s){return Z.isFunction(r)&&(s=s||n,n=r,r=t),Z.ajax({type:i,url:e,data:r,success:n,dataType:s})}}),Z.extend({getScript:function(e,i){return Z.get(e,t,i,"script")},getJSON:function(e,t,i){return Z.get(e,t,i,"json")},ajaxSetup:function(e,t){return t?S(e,Z.ajaxSettings):(t=e,e=Z.ajaxSettings),S(e,t),e},ajaxSettings:{url:Mi,isLocal:Ri.test(Ci[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Ni},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":Z.parseJSON,"text xml":Z.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:C(Li),ajaxTransport:C(Ii),ajax:function(e,i){function r(e,i,r,o){var d,h,y,w,b,_=i;2!==x&&(x=2,l&&clearTimeout(l),a=t,s=o||"",E.readyState=e>0?4:0,r&&(w=A(u,E,r)),e>=200&&300>e||304===e?(u.ifModified&&(b=E.getResponseHeader("Last-Modified"),b&&(Z.lastModified[n]=b),b=E.getResponseHeader("Etag"),b&&(Z.etag[n]=b)),304===e?(_="notmodified",d=!0):(d=R(u,w),_=d.state,h=d.data,y=d.error,d=!y)):(y=_,(!_||e)&&(_="error",0>e&&(e=0))),E.status=e,E.statusText=(i||_)+"",d?g.resolveWith(p,[h,_,E]):g.rejectWith(p,[E,_,y]),E.statusCode(m),m=t,c&&f.trigger("ajax"+(d?"Success":"Error"),[E,u,d?h:y]),v.fireWith(p,[E,_]),c&&(f.trigger("ajaxComplete",[E,u]),--Z.active||Z.event.trigger("ajaxStop")))}"object"==typeof e&&(i=e,e=t),i=i||{};var n,s,o,a,l,d,c,h,u=Z.ajaxSetup({},i),p=u.context||u,f=p!==u&&(p.nodeType||p instanceof Z)?Z(p):Z.event,g=Z.Deferred(),v=Z.Callbacks("once memory"),m=u.statusCode||{},y={},w={},x=0,b="canceled",E={readyState:0,setRequestHeader:function(e,t){if(!x){var i=e.toLowerCase();e=w[i]=w[i]||e,y[e]=t}return this},getAllResponseHeaders:function(){return 2===x?s:null},getResponseHeader:function(e){var i;if(2===x){if(!o)for(o={};i=Ai.exec(s);)o[i[1].toLowerCase()]=i[2];i=o[e.toLowerCase()]}return i===t?null:i},overrideMimeType:function(e){return x||(u.mimeType=e),this},abort:function(e){return e=e||b,a&&a.abort(e),r(0,e),this}};if(g.promise(E),E.success=E.done,E.error=E.fail,E.complete=v.add,E.statusCode=function(e){if(e){var t;if(2>x)for(t in e)m[t]=[m[t],e[t]];else t=e[E.status],E.always(t)}return this},u.url=((e||u.url)+"").replace(Si,"").replace(Di,Ci[1]+"//"),u.dataTypes=Z.trim(u.dataType||"*").toLowerCase().split(it),null==u.crossDomain&&(d=Hi.exec(u.url.toLowerCase()),u.crossDomain=!(!d||d[1]===Ci[1]&&d[2]===Ci[2]&&(d[3]||("http:"===d[1]?80:443))==(Ci[3]||("http:"===Ci[1]?80:443)))),u.data&&u.processData&&"string"!=typeof u.data&&(u.data=Z.param(u.data,u.traditional)),M(Li,u,i,E),2===x)return E;if(c=u.global,u.type=u.type.toUpperCase(),u.hasContent=!Ui.test(u.type),c&&0===Z.active++&&Z.event.trigger("ajaxStart"),!u.hasContent&&(u.data&&(u.url+=(Pi.test(u.url)?"&":"?")+u.data,delete u.data),n=u.url,u.cache===!1)){var _=Z.now(),T=u.url.replace(Bi,"$1_="+_);u.url=T+(T===u.url?(Pi.test(u.url)?"&":"?")+"_="+_:"")}(u.data&&u.hasContent&&u.contentType!==!1||i.contentType)&&E.setRequestHeader("Content-Type",u.contentType),u.ifModified&&(n=n||u.url,Z.lastModified[n]&&E.setRequestHeader("If-Modified-Since",Z.lastModified[n]),Z.etag[n]&&E.setRequestHeader("If-None-Match",Z.etag[n])),E.setRequestHeader("Accept",u.dataTypes[0]&&u.accepts[u.dataTypes[0]]?u.accepts[u.dataTypes[0]]+("*"!==u.dataTypes[0]?", "+Ni+"; q=0.01":""):u.accepts["*"]);for(h in u.headers)E.setRequestHeader(h,u.headers[h]);if(u.beforeSend&&(u.beforeSend.call(p,E,u)===!1||2===x))return E.abort();b="abort";for(h in{success:1,error:1,complete:1})E[h](u[h]);if(a=M(Ii,u,i,E)){E.readyState=1,c&&f.trigger("ajaxSend",[E,u]),u.async&&u.timeout>0&&(l=setTimeout(function(){E.abort("timeout")},u.timeout));try{x=1,a.send(y,r)}catch(C){if(!(2>x))throw C;r(-1,C)}}else r(-1,"No Transport");return E},active:0,lastModified:{},etag:{}});var Oi=[],zi=/\?/,Vi=/(=)\?(?=&|$)|\?\?/,Wi=Z.now();Z.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Oi.pop()||Z.expando+"_"+Wi++;return this[e]=!0,e}}),Z.ajaxPrefilter("json jsonp",function(i,r,n){var s,o,a,l=i.data,d=i.url,c=i.jsonp!==!1,h=c&&Vi.test(d),u=c&&!h&&"string"==typeof l&&!(i.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vi.test(l);return"jsonp"===i.dataTypes[0]||h||u?(s=i.jsonpCallback=Z.isFunction(i.jsonpCallback)?i.jsonpCallback():i.jsonpCallback,o=e[s],h?i.url=d.replace(Vi,"$1"+s):u?i.data=l.replace(Vi,"$1"+s):c&&(i.url+=(zi.test(d)?"&":"?")+i.jsonp+"="+s),i.converters["script json"]=function(){return a||Z.error(s+" was not called"),a[0]},i.dataTypes[0]="json",e[s]=function(){a=arguments},n.always(function(){e[s]=o,i[s]&&(i.jsonpCallback=r.jsonpCallback,Oi.push(s)),a&&Z.isFunction(o)&&o(a[0]),a=o=t}),"script"):t}),Z.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return Z.globalEval(e),e}}}),Z.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),Z.ajaxTransport("script",function(e){if(e.crossDomain){var i,r=z.head||z.getElementsByTagName("head")[0]||z.documentElement;return{send:function(n,s){i=z.createElement("script"),i.async="async",e.scriptCharset&&(i.charset=e.scriptCharset),i.src=e.url,i.onload=i.onreadystatechange=function(e,n){(n||!i.readyState||/loaded|complete/.test(i.readyState))&&(i.onload=i.onreadystatechange=null,r&&i.parentNode&&r.removeChild(i),i=t,n||s(200,"success"))},r.insertBefore(i,r.firstChild)},abort:function(){i&&i.onload(0,1)}}}});var Gi,Xi=e.ActiveXObject?function(){for(var e in Gi)Gi[e](0,1)}:!1,qi=0;Z.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&U()||D()}:U,function(e){Z.extend(Z.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(Z.ajaxSettings.xhr()),Z.support.ajax&&Z.ajaxTransport(function(i){if(!i.crossDomain||Z.support.cors){var r;return{send:function(n,s){var o,a,l=i.xhr();if(i.username?l.open(i.type,i.url,i.async,i.username,i.password):l.open(i.type,i.url,i.async),i.xhrFields)for(a in i.xhrFields)l[a]=i.xhrFields[a];i.mimeType&&l.overrideMimeType&&l.overrideMimeType(i.mimeType),i.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");try{for(a in n)l.setRequestHeader(a,n[a])}catch(d){}l.send(i.hasContent&&i.data||null),r=function(e,n){var a,d,c,h,u;try{if(r&&(n||4===l.readyState))if(r=t,o&&(l.onreadystatechange=Z.noop,Xi&&delete Gi[o]),n)4!==l.readyState&&l.abort();else{a=l.status,c=l.getAllResponseHeaders(),h={},u=l.responseXML,u&&u.documentElement&&(h.xml=u);try{h.text=l.responseText}catch(p){}try{d=l.statusText}catch(p){d=""}a||!i.isLocal||i.crossDomain?1223===a&&(a=204):a=h.text?200:404}}catch(f){n||s(-1,f)}h&&s(a,d,h,c)},i.async?4===l.readyState?setTimeout(r,0):(o=++qi,Xi&&(Gi||(Gi={},Z(e).unload(Xi)),Gi[o]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var $i,Yi,Ki=/^(?:toggle|show|hide)$/,Ji=RegExp("^(?:([-+])=|)("+et+")([a-z%]*)$","i"),Qi=/queueHooks$/,Zi=[k],er={"*":[function(e,t){var i,r,n=this.createTween(e,t),s=Ji.exec(t),o=n.cur(),a=+o||0,l=1,d=20;if(s){if(i=+s[2],r=s[3]||(Z.cssNumber[e]?"":"px"),"px"!==r&&a){a=Z.css(n.elem,e,!0)||i||1;do l=l||".5",a/=l,Z.style(n.elem,e,a+r);while(l!==(l=n.cur()/o)&&1!==l&&--d)}n.unit=r,n.start=a,n.end=s[1]?a+(s[1]+1)*i:i}return n}]};Z.Animation=Z.extend(B,{tweener:function(e,t){Z.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var i,r=0,n=e.length;n>r;r++)i=e[r],er[i]=er[i]||[],er[i].unshift(t)},prefilter:function(e,t){t?Zi.unshift(e):Zi.push(e)}}),Z.Tween=L,L.prototype={constructor:L,init:function(e,t,i,r,n,s){this.elem=e,this.prop=i,this.easing=n||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(Z.cssNumber[i]?"":"px")},cur:function(){var e=L.propHooks[this.prop];return e&&e.get?e.get(this):L.propHooks._default.get(this)},run:function(e){var t,i=L.propHooks[this.prop];return this.pos=t=this.options.duration?Z.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):L.propHooks._default.set(this),this}},L.prototype.init.prototype=L.prototype,L.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=Z.css(e.elem,e.prop,!1,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){Z.fx.step[e.prop]?Z.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[Z.cssProps[e.prop]]||Z.cssHooks[e.prop])?Z.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},L.propHooks.scrollTop=L.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},Z.each(["toggle","show","hide"],function(e,t){var i=Z.fn[t];Z.fn[t]=function(r,n,s){return null==r||"boolean"==typeof r||!e&&Z.isFunction(r)&&Z.isFunction(n)?i.apply(this,arguments):this.animate(I(t,!0),r,n,s)}}),Z.fn.extend({fadeTo:function(e,t,i,r){return this.filter(y).css("opacity",0).show().end().animate({opacity:t},e,i,r)},animate:function(e,t,i,r){var n=Z.isEmptyObject(e),s=Z.speed(t,i,r),o=function(){var t=B(this,Z.extend({},e),s);n&&t.stop(!0)};return n||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,i,r){var n=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=i,i=e,e=t),i&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",s=Z.timers,o=Z._data(this);if(i)o[i]&&o[i].stop&&n(o[i]);else for(i in o)o[i]&&o[i].stop&&Qi.test(i)&&n(o[i]);for(i=s.length;i--;)s[i].elem!==this||null!=e&&s[i].queue!==e||(s[i].anim.stop(r),t=!1,s.splice(i,1));(t||!r)&&Z.dequeue(this,e)})}}),Z.each({slideDown:I("show"),slideUp:I("hide"),slideToggle:I("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){Z.fn[e]=function(e,i,r){return this.animate(t,e,i,r)}}),Z.speed=function(e,t,i){var r=e&&"object"==typeof e?Z.extend({},e):{complete:i||!i&&t||Z.isFunction(e)&&e,duration:e,easing:i&&t||t&&!Z.isFunction(t)&&t};return r.duration=Z.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in Z.fx.speeds?Z.fx.speeds[r.duration]:Z.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){Z.isFunction(r.old)&&r.old.call(this),r.queue&&Z.dequeue(this,r.queue)},r},Z.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},Z.timers=[],Z.fx=L.prototype.init,Z.fx.tick=function(){var e,i=Z.timers,r=0;for($i=Z.now();i.length>r;r++)e=i[r],e()||i[r]!==e||i.splice(r--,1);i.length||Z.fx.stop(),$i=t},Z.fx.timer=function(e){e()&&Z.timers.push(e)&&!Yi&&(Yi=setInterval(Z.fx.tick,Z.fx.interval))},Z.fx.interval=13,Z.fx.stop=function(){clearInterval(Yi),Yi=null},Z.fx.speeds={slow:600,fast:200,_default:400},Z.fx.step={},Z.expr&&Z.expr.filters&&(Z.expr.filters.animated=function(e){return Z.grep(Z.timers,function(t){return e===t.elem}).length});var tr=/^(?:body|html)$/i;Z.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){Z.offset.setOffset(this,e,t)});var i,r,n,s,o,a,l,d={top:0,left:0},c=this[0],h=c&&c.ownerDocument;if(h)return(r=h.body)===c?Z.offset.bodyOffset(c):(i=h.documentElement,Z.contains(i,c)?(c.getBoundingClientRect!==t&&(d=c.getBoundingClientRect()),n=N(h),s=i.clientTop||r.clientTop||0,o=i.clientLeft||r.clientLeft||0,a=n.pageYOffset||i.scrollTop,l=n.pageXOffset||i.scrollLeft,{top:d.top+a-s,left:d.left+l-o}):d)},Z.offset={bodyOffset:function(e){var t=e.offsetTop,i=e.offsetLeft;return Z.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(Z.css(e,"marginTop"))||0,i+=parseFloat(Z.css(e,"marginLeft"))||0),{top:t,left:i}},setOffset:function(e,t,i){var r=Z.css(e,"position");"static"===r&&(e.style.position="relative");var n,s,o=Z(e),a=o.offset(),l=Z.css(e,"top"),d=Z.css(e,"left"),c=("absolute"===r||"fixed"===r)&&Z.inArray("auto",[l,d])>-1,h={},u={};c?(u=o.position(),n=u.top,s=u.left):(n=parseFloat(l)||0,s=parseFloat(d)||0),Z.isFunction(t)&&(t=t.call(e,i,a)),null!=t.top&&(h.top=t.top-a.top+n),null!=t.left&&(h.left=t.left-a.left+s),"using"in t?t.using.call(e,h):o.css(h)}},Z.fn.extend({position:function(){if(this[0]){var e=this[0],t=this.offsetParent(),i=this.offset(),r=tr.test(t[0].nodeName)?{top:0,left:0}:t.offset();return i.top-=parseFloat(Z.css(e,"marginTop"))||0,i.left-=parseFloat(Z.css(e,"marginLeft"))||0,r.top+=parseFloat(Z.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(Z.css(t[0],"borderLeftWidth"))||0,{top:i.top-r.top,left:i.left-r.left}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||z.body;e&&!tr.test(e.nodeName)&&"static"===Z.css(e,"position");)e=e.offsetParent;return e||z.body})}}),Z.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,i){var r=/Y/.test(i);Z.fn[e]=function(n){return Z.access(this,function(e,n,s){var o=N(e);return s===t?o?i in o?o[i]:o.document.documentElement[n]:e[n]:(o?o.scrollTo(r?Z(o).scrollLeft():s,r?s:Z(o).scrollTop()):e[n]=s,t)},e,n,arguments.length,null)}}),Z.each({Height:"height",Width:"width"},function(e,i){Z.each({padding:"inner"+e,content:i,"":"outer"+e},function(r,n){Z.fn[n]=function(n,s){var o=arguments.length&&(r||"boolean"!=typeof n),a=r||(n===!0||s===!0?"margin":"border");return Z.access(this,function(i,r,n){var s;return Z.isWindow(i)?i.document.documentElement["client"+e]:9===i.nodeType?(s=i.documentElement,Math.max(i.body["scroll"+e],s["scroll"+e],i.body["offset"+e],s["offset"+e],s["client"+e])):n===t?Z.css(i,r,n,a):Z.style(i,r,n,a)},i,o?n:t,o,null)}})}),e.jQuery=e.$=Z,"function"==typeof i&&i.amd&&i.amd.jQuery&&i("jquery",[],function(){return Z})}(window),function(e){function t(e,t,i){for(var r=(i||0)-1,n=e.length;n>++r;)if(e[r]===t)return r;return-1}function r(e,t){var i=e.index,r=t.index;if(e=e.criteria,t=t.criteria,e!==t){if(e>t||e===Kt)return 1;if(t>e||t===Kt)return-1}return r>i?-1:1}function n(e){return"\\"+gi[e]}function s(){}function o(e){return e instanceof o?e:new a(e)}function a(e){this.__wrapped__=e}function l(e,t,i,r){function n(){var r=arguments,c=o?this:t;if(s||(e=t[a]),i.length&&(r=r.length?(r=Fi.call(r),l?r.concat(i):i.concat(r)):i),this instanceof n){c=d(e.prototype);var h=e.apply(c,r);return S(h)?h:c}return e.apply(c,r)}var s=M(e),o=!i,a=t;if(o){var l=r;i=t}else if(!s){if(!r)throw new TypeError;t=e}return n}function d(e){return S(e)?Pi(e):{}}function c(e){return qi[e]}function h(){var e=(e=o.indexOf)===ct?t:e;return e}function u(e){return $i[e]}function p(e){return Ui.call(e)==si}function f(e){if(!e)return e;for(var t=1,i=arguments.length;i>t;t++){var r=arguments[t];
if(r)for(var n in r)e[n]=r[n]}return e}function g(e){return S(e)?Wi(e)?Fi.call(e):f({},e):e}function v(e){if(!e)return e;for(var t=1,i=arguments.length;i>t;t++){var r=arguments[t];if(r)for(var n in r)null==e[n]&&(e[n]=r[n])}return e}function m(e){var t=[];return Yi(e,function(e,i){M(e)&&t.push(i)}),t.sort()}function y(e,t){return e?Si.call(e,t):!1}function w(e){for(var t=-1,i=Xi(e),r=i.length,n={};r>++t;){var s=i[t];n[e[s]]=s}return n}function x(e){return e===!0||e===!1||Ui.call(e)==ai}function b(e){return e?"object"==typeof e&&Ui.call(e)==li:!1}function E(e){return e?1===e.nodeType:!1}function _(e){if(!e)return!0;if(Wi(e)||P(e))return!e.length;for(var t in e)if(Si.call(e,t))return!1;return!0}function T(e,t,i,r){if(e===t)return 0!==e||1/e==1/t;var n=typeof e,s=typeof t;if(e===e&&(!e||"function"!=n&&"object"!=n)&&(!t||"function"!=s&&"object"!=s))return!1;if(null==e||null==t)return e===t;var a=Ui.call(e),l=Ui.call(t);if(a!=l)return!1;switch(a){case ai:case li:return+e==+t;case ci:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case ui:case pi:return e==t+""}var d=a==oi;if(!d){if(e instanceof o||t instanceof o)return T(e.__wrapped__||e,t.__wrapped__||t,i,r);if(a!=hi)return!1;var c=e.constructor,h=t.constructor;if(c!=h&&!(M(c)&&c instanceof c&&M(h)&&h instanceof h))return!1}i||(i=[]),r||(r=[]);for(var u=i.length;u--;)if(i[u]==e)return r[u]==t;var p=!0,f=0;if(i.push(e),r.push(t),d){if(f=t.length,p=f==e.length)for(;f--&&(p=T(e[f],t[f],i,r)););return p}return Yi(t,function(t,n,s){return Si.call(s,n)?(f++,!(p=Si.call(e,n)&&T(e[n],t,i,r))&&Qt):Kt}),p&&Yi(e,function(e,t,i){return Si.call(i,t)?!(p=--f>-1)&&Qt:Kt}),p}function C(e){return Bi(e)&&!Hi(parseFloat(e))}function M(e){return"function"==typeof e}function S(e){return!(!e||!fi[typeof e])}function A(e){return U(e)&&e!=+e}function R(e){return null===e}function U(e){return"number"==typeof e||Ui.call(e)==ci}function D(e){return!(!e||!fi[typeof e])&&Ui.call(e)==ui}function P(e){return"string"==typeof e||Ui.call(e)==pi}function j(e){return e===Kt}function B(e){var t=h(),i=Ci.apply(wi,Fi.call(arguments,1)),r={};return Yi(e,function(e,n){0>t(i,n)&&(r[n]=e)}),r}function H(e){for(var t=-1,i=Xi(e),r=i.length,n=Array(r);r>++t;){var s=i[t];n[t]=[s,e[s]]}return n}function k(e){for(var t=-1,i=Ci.apply(wi,Fi.call(arguments,1)),r=i.length,n={};r>++t;){var s=i[t];s in e&&(n[s]=e[s])}return n}function L(e){for(var t=-1,i=Xi(e),r=i.length,n=Array(r);r>++t;)n[t]=e[i[t]];return n}function I(e,t){var i=h(),r=e?e.length:0,n=!1;return r&&"number"==typeof r?n=i(e,t)>-1:Ki(e,function(e){return(n=e===t)&&Qt}),n}function N(e,t,i){var r={};return t=St(t,i),W(e,function(e,i,n){i=t(e,i,n)+"",Si.call(r,i)?r[i]++:r[i]=1}),r}function F(e,t,i){var r=!0;t=St(t,i);var n=-1,s=e?e.length:0;if("number"==typeof s)for(;s>++n&&(r=!!t(e[n],n,e)););else Ki(e,function(e,i,n){return!(r=!!t(e,i,n))&&Qt});return r}function O(e,t,i){var r=[];t=St(t,i);var n=-1,s=e?e.length:0;if("number"==typeof s)for(;s>++n;){var o=e[n];t(o,n,e)&&r.push(o)}else Ki(e,function(e,i,n){t(e,i,n)&&r.push(e)});return r}function z(e,t,i){t=St(t,i);var r=-1,n=e?e.length:0;if("number"!=typeof n){var s;return Ki(e,function(e,i,r){return t(e,i,r)?(s=e,Qt):Kt}),s}for(;n>++r;){var o=e[r];if(t(o,r,e))return o}}function V(e,t){return st(e,t,!0)}function W(e,t,i){var r=-1,n=e?e.length:0;if(t=t&&i===Kt?t:St(t,i),"number"==typeof n)for(;n>++r&&t(e[r],r,e)!==Qt;);else Ki(e,t)}function G(e,t,i){var r={};return t=St(t,i),W(e,function(e,i,n){i=t(e,i,n)+"",(Si.call(r,i)?r[i]:r[i]=[]).push(e)}),r}function X(e,t){var i=Fi.call(arguments,2),r=-1,n="function"==typeof t,s=e?e.length:0,o=Array("number"==typeof s?s:0);return W(e,function(e){o[++r]=(n?t:e[t]).apply(e,i)}),o}function q(e,t,i){var r=-1,n=e?e.length:0;if(t=St(t,i),"number"==typeof n)for(var s=Array(n);n>++r;)s[r]=t(e[r],r,e);else s=[],Ki(e,function(e,i,n){s[++r]=t(e,i,n)});return s}function $(e,t,i){var r=-1/0,n=r,s=-1,o=e?e.length:0;if(t||"number"!=typeof o)t=St(t,i),W(e,function(e,i,s){var o=t(e,i,s);o>r&&(r=o,n=e)});else for(;o>++s;){var a=e[s];a>n&&(n=a)}return n}function Y(e,t,i){var r=1/0,n=r,s=-1,o=e?e.length:0;if(t||"number"!=typeof o)t=St(t,i),W(e,function(e,i,s){var o=t(e,i,s);r>o&&(r=o,n=e)});else for(;o>++s;){var a=e[s];n>a&&(n=a)}return n}function K(e,t){var i=-1,r=e?e.length:0;if("number"==typeof r)for(var n=Array(r);r>++i;)n[i]=e[i][t];return n||q(e,t)}function J(e,t,i,r){if(!e)return i;var n=3>arguments.length;t=St(t,r,4);var s=-1,o=e.length;if("number"==typeof o)for(n&&(i=e[++s]);o>++s;)i=t(i,e[s],s,e);else Ki(e,function(e,r,s){i=n?(n=!1,e):t(i,e,r,s)});return i}function Q(e,t,i,r){var n=e,s=e?e.length:0,o=3>arguments.length;if("number"!=typeof s){var a=Xi(e);s=a.length}return t=St(t,r,4),W(e,function(e,r,l){r=a?a[--s]:--s,i=o?(o=!1,n[r]):t(i,n[r],r,l)}),i}function Z(e,t,i){return t=St(t,i),O(e,function(e,i,r){return!t(e,i,r)})}function et(e){var t=-1,i=e?e.length:0,r=Array("number"==typeof i?i:0);return W(e,function(e){var i=Mi(Ni()*(++t+1));r[t]=r[i],r[i]=e}),r}function tt(e){var t=e?e.length:0;return"number"==typeof t?t:Xi(e).length}function it(e,t,i){var r;t=St(t,i);var n=-1,s=e?e.length:0;if("number"==typeof s)for(;s>++n&&!(r=t(e[n],n,e)););else Ki(e,function(e,i,n){return(r=t(e,i,n))&&Qt});return!!r}function rt(e,t,i){var n=-1,s=e?e.length:0,o=Array("number"==typeof s?s:0);for(t=St(t,i),W(e,function(e,i,r){o[++n]={criteria:t(e,i,r),index:n,value:e}}),s=o.length,o.sort(r);s--;)o[s]=o[s].value;return o}function nt(e){return Wi(e)?Fi.call(e):e&&"number"==typeof e.length?q(e):L(e)}function st(e,t,i){return i&&_(t)?null:(i?z:O)(e,t)}function ot(e){for(var t=-1,i=e?e.length:0,r=[];i>++t;){var n=e[t];n&&r.push(n)}return r}function at(e){for(var t=-1,i=h(),r=e.length,n=Ci.apply(wi,Fi.call(arguments,1)),s=[];r>++t;){var o=e[t];0>i(n,o)&&s.push(o)}return s}function lt(e,t,i){if(e){var r=0,n=e.length;if("number"!=typeof t&&null!=t){var s=-1;for(t=St(t,i);n>++s&&t(e[s],s,e);)r++}else if(r=t,null==r||i)return e[0];return Fi.call(e,0,Ii(Li(0,r),n))}}function dt(e,t){for(var i=-1,r=e?e.length:0,n=[];r>++i;){var s=e[i];Wi(s)?Ai.apply(n,t?s:dt(s)):n.push(s)}return n}function ct(e,i,r){if("number"==typeof r){var n=e?e.length:0;r=0>r?Li(0,n+r):r||0}else if(r){var s=mt(e,i);return e[s]===i?s:-1}return e?t(e,i,r):-1}function ht(e,t,i){if(!e)return[];var r=0,n=e.length;if("number"!=typeof t&&null!=t){var s=n;for(t=St(t,i);s--&&t(e[s],s,e);)r++}else r=null==t||i?1:t||r;return Fi.call(e,0,Ii(Li(0,n-r),n))}function ut(e){var t=arguments,i=t.length,r=-1,n=h(),s=e?e.length:0,o=[];e:for(;s>++r;){var a=e[r];if(0>n(o,a)){for(var l=i;--l;)if(0>n(t[l],a))continue e;o.push(a)}}return o}function pt(e,t,i){if(e){var r=0,n=e.length;if("number"!=typeof t&&null!=t){var s=n;for(t=St(t,i);s--&&t(e[s],s,e);)r++}else if(r=t,null==r||i)return e[n-1];return Fi.call(e,Li(0,n-r))}}function ft(e,t,i){var r=e?e.length:0;for("number"==typeof i&&(r=(0>i?Li(0,r+i):Ii(i,r-1))+1);r--;)if(e[r]===t)return r;return-1}function gt(e,t,i){e=+e||0,i=+i||1,null==t&&(t=e,e=0);for(var r=-1,n=Li(0,_i((t-e)/i)),s=Array(n);n>++r;)s[r]=e,e+=i;return s}function vt(e,t,i){if("number"!=typeof t&&null!=t){var r=0,n=-1,s=e?e.length:0;for(t=St(t,i);s>++n&&t(e[n],n,e);)r++}else r=null==t||i?1:Li(0,t);return Fi.call(e,r)}function mt(e,t,i,r){var n=0,s=e?e.length:n;for(i=i?St(i,r,1):Lt,t=i(t);s>n;){var o=n+s>>>1;t>i(e[o])?n=o+1:s=o}return n}function yt(e){return Wi(e)||(arguments[0]=e?Fi.call(e):wi),wt(Ci.apply(wi,arguments))}function wt(e,t,i,r){var n=-1,s=h(),o=e?e.length:0,a=[],l=a;for("boolean"!=typeof t&&null!=t&&(r=i,i=t,t=!1),null!=i&&(l=[],i=St(i,r));o>++n;){var d=e[n],c=i?i(d,n,e):d;(t?!n||l[l.length-1]!==c:0>s(l,c))&&(i&&l.push(c),a.push(d))}return a}function xt(e){return at(e,Fi.call(arguments,1))}function bt(e){for(var t=-1,i=e?$(K(arguments,"length")):0,r=Array(0>i?0:i);i>++t;)r[t]=K(arguments,t);return r}function Et(e,t){for(var i=-1,r=e?e.length:0,n={};r>++i;){var s=e[i];t?n[s]=t[i]:n[s[0]]=s[1]}return n}function _t(e,t){return 1>e?t():function(){return 1>--e?t.apply(this,arguments):Kt}}function Tt(e,t){return Vi.fastBind||Di&&arguments.length>2?Di.call.apply(Di,arguments):l(e,t,Fi.call(arguments,2))}function Ct(e){for(var t=arguments.length>1?Ci.apply(wi,Fi.call(arguments,1)):m(e),i=-1,r=t.length;r>++i;){var n=t[i];e[n]=Tt(e[n],e)}return e}function Mt(){var e=arguments;return function(){for(var t=arguments,i=e.length;i--;)t=[e[i].apply(this,t)];return t[0]}}function St(e,t,i){if(null==e)return Lt;var r=typeof e;if("function"!=r){if("object"!=r)return function(t){return t[e]};var n=Xi(e);return function(t){for(var i=n.length,r=!1;i--&&(r=t[n[i]]===e[n[i]]););return r}}return t===Kt?e:1===i?function(i){return e.call(t,i)}:2===i?function(i,r){return e.call(t,i,r)}:4===i?function(i,r,n,s){return e.call(t,i,r,n,s)}:function(i,r,n){return e.call(t,i,r,n)}}function At(e,t,i){function r(){a=null,i||(s=e.apply(o,n))}var n,s,o,a=null;return function(){var l=i&&!a;return n=arguments,o=this,Ti(a),a=Ri(r,t),l&&(s=e.apply(o,n)),s}}function Rt(e){var t=Fi.call(arguments,1);return Ri(function(){e.apply(Kt,t)},1)}function Ut(e,t){var i=Fi.call(arguments,2);return Ri(function(){e.apply(Kt,i)},t)}function Dt(e,t){var i={};return function(){var r=Zt+(t?t.apply(this,arguments):arguments[0]);return Si.call(i,r)?i[r]:i[r]=e.apply(this,arguments)}}function Pt(e){var t,i;return function(){return t?i:(t=!0,i=e.apply(this,arguments),e=null,i)}}function jt(e){return l(e,Fi.call(arguments,1))}function Bt(e,t){function i(){o=new Date,a=null,n=e.apply(s,r)}var r,n,s,o=0,a=null;return function(){var l=new Date,d=t-(l-o);return r=arguments,s=this,0>=d?(Ti(a),a=null,o=l,n=e.apply(s,r)):a||(a=Ri(i,d)),n}}function Ht(e,t){return function(){var i=[e];return Ai.apply(i,arguments),t.apply(this,i)}}function kt(e){return null==e?"":(e+"").replace(ri,c)}function Lt(e){return e}function It(e){W(m(e),function(t){var i=o[t]=e[t];o.prototype[t]=function(){var e=[this.__wrapped__];Ai.apply(e,arguments);var t=i.apply(o,e);return this.__chain__&&(t=new a(t),t.__chain__=!0),t}})}function Nt(){return e._=bi,this}function Ft(e,t){null==e&&null==t&&(t=1),e=+e||0,null==t?(t=e,e=0):t=+t||0;var i=Ni();return e%1||t%1?e+Ii(i*(t-e+parseFloat("1e-"+((i+"").length-1))),t):e+Mi(i*(t-e+1))}function Ot(e,t){var i=e?e[t]:null;return M(i)?e[t]():i}function zt(e,t,i){var r=o.templateSettings;e||(e=""),i=v({},i,r);var s=0,a="__p += '",l=i.variable,d=RegExp((i.escape||ii).source+"|"+(i.interpolate||ii).source+"|"+(i.evaluate||ii).source+"|$","g");e.replace(d,function(t,i,r,o,l){return a+=e.slice(s,l).replace(ni,n),i&&(a+="' +\n_.escape("+i+") +\n'"),o&&(a+="';\n"+o+";\n__p += '"),r&&(a+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),s=l+t.length,t}),a+="';\n",l||(l="obj",a="with ("+l+" || {}) {\n"+a+"\n}\n"),a="function("+l+") {\n"+"var __t, __p = '', __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n"+a+"return __p\n}";try{var c=Function("_","return "+a)(o)}catch(h){throw h.source=a,h}return t?c(t):(c.source=a,c)}function Vt(e,t,i){for(var r=-1,n=Array(e>-1?e:0);e>++r;)n[r]=t.call(i,r);return n}function Wt(e){return null==e?"":(e+"").replace(ei,u)}function Gt(e){var t=++Jt+"";return e?e+t:t}function Xt(e){return e=new a(e),e.__chain__=!0,e}function qt(e,t){return t(e),e}function $t(){return this.__chain__=!0,this}function Yt(){return this.__wrapped__}var Kt,Jt=0,Qt={},Zt=+new Date+"",ei=/&(?:amp|lt|gt|quot|#39);/g,ti=/<%=([\s\S]+?)%>/g,ii=/($^)/,ri=/[&<>"']/g,ni=/['\n\r\t\u2028\u2029\\]/g,si="[object Arguments]",oi="[object Array]",ai="[object Boolean]",li="[object Date]",di="[object Function]",ci="[object Number]",hi="[object Object]",ui="[object RegExp]",pi="[object String]",fi={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},gi={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},vi=fi[typeof exports]&&exports,mi=fi[typeof module]&&module&&module.exports==vi&&module,yi=fi[typeof global]&&global;!yi||yi.global!==yi&&yi.window!==yi||(e=yi);var wi=[],xi=Object.prototype;String.prototype;var bi=e._,Ei=RegExp("^"+(xi.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),_i=Math.ceil,Ti=e.clearTimeout,Ci=wi.concat,Mi=Math.floor,Si=xi.hasOwnProperty,Ai=wi.push,Ri=(xi.propertyIsEnumerable,e.setTimeout),Ui=xi.toString,Di=Ei.test(Di=Ui.bind)&&Di,Pi=Ei.test(Pi=Object.create)&&Pi,ji=Ei.test(ji=Array.isArray)&&ji,Bi=e.isFinite,Hi=e.isNaN,ki=Ei.test(ki=Object.keys)&&ki,Li=Math.max,Ii=Math.min,Ni=Math.random,Fi=wi.slice,Oi=Ei.test(e.attachEvent),zi=Di&&!/\n|true/.test(Di+Oi);a.prototype=o.prototype;var Vi={};if(function(){var e={0:1,length:1};Vi.fastBind=Di&&!zi,Vi.spliceObjects=(wi.splice.call(e,0,1),!e[0])}(1),o.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:ti,variable:""},!Pi)var d=function(e){if(S(e)){s.prototype=e;var t=new s;s.prototype=null}return t||{}};p(arguments)||(p=function(e){return e?Si.call(e,"callee"):!1});var Wi=ji||function(e){return e?"object"==typeof e&&Ui.call(e)==oi:!1},Gi=function(e){var t,i=e,r=[];if(!i)return r;if(!fi[typeof e])return r;for(t in i)Si.call(i,t)&&r.push(t);return r},Xi=ki?function(e){return S(e)?ki(e):[]}:Gi,qi={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},$i=w(qi),Yi=function(e,t){var i,r=e,n=r;if(!r)return n;if(!fi[typeof r])return n;for(i in r)if(t(r[i],i,e)===Qt)return n;return n},Ki=function(e,t){var i,r=e,n=r;if(!r)return n;if(!fi[typeof r])return n;for(i in r)if(Si.call(r,i)&&t(r[i],i,e)===Qt)return n;return n};M(/x/)&&(M=function(e){return"function"==typeof e&&Ui.call(e)==di}),o.after=_t,o.bind=Tt,o.bindAll=Ct,o.compact=ot,o.compose=Mt,o.countBy=N,o.debounce=At,o.defaults=v,o.defer=Rt,o.delay=Ut,o.difference=at,o.filter=O,o.flatten=dt,o.forEach=W,o.functions=m,o.groupBy=G,o.initial=ht,o.intersection=ut,o.invert=w,o.invoke=X,o.keys=Xi,o.map=q,o.max=$,o.memoize=Dt,o.min=Y,o.omit=B,o.once=Pt,o.pairs=H,o.partial=jt,o.pick=k,o.pluck=K,o.range=gt,o.reject=Z,o.rest=vt,o.shuffle=et,o.sortBy=rt,o.tap=qt,o.throttle=Bt,o.times=Vt,o.toArray=nt,o.union=yt,o.uniq=wt,o.values=L,o.where=st,o.without=xt,o.wrap=Ht,o.zip=bt,o.collect=q,o.drop=vt,o.each=W,o.extend=f,o.methods=m,o.object=Et,o.select=O,o.tail=vt,o.unique=wt,o.chain=Xt,o.clone=g,o.contains=I,o.escape=kt,o.every=F,o.find=z,o.has=y,o.identity=Lt,o.indexOf=ct,o.isArguments=p,o.isArray=Wi,o.isBoolean=x,o.isDate=b,o.isElement=E,o.isEmpty=_,o.isEqual=T,o.isFinite=C,o.isFunction=M,o.isNaN=A,o.isNull=R,o.isNumber=U,o.isObject=S,o.isRegExp=D,o.isString=P,o.isUndefined=j,o.lastIndexOf=ft,o.mixin=It,o.noConflict=Nt,o.random=Ft,o.reduce=J,o.reduceRight=Q,o.result=Ot,o.size=tt,o.some=it,o.sortedIndex=mt,o.template=zt,o.unescape=Wt,o.uniqueId=Gt,o.all=F,o.any=it,o.detect=z,o.findWhere=V,o.foldl=J,o.foldr=Q,o.include=I,o.inject=J,o.first=lt,o.last=pt,o.take=lt,o.head=lt,o.VERSION="1.3.1",It(o),o.prototype.chain=$t,o.prototype.value=Yt,W(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=wi[e];o.prototype[e]=function(){var e=this.__wrapped__;return t.apply(e,arguments),Vi.spliceObjects||0!==e.length||delete e[0],this}}),W(["concat","join","slice"],function(e){var t=wi[e];o.prototype[e]=function(){var e=this.__wrapped__,i=t.apply(e,arguments);return this.__chain__&&(i=new a(i),i.__chain__=!0),i}}),"function"==typeof i&&"object"==typeof i.amd&&i.amd?(e._=o,i("underscore",[],function(){return o})):vi&&!vi.nodeType?mi?(mi.exports=o)._=o:vi._=o:e._=o}(this),i("backbone",["jquery","underscore"],function(){return function(){var e,i=this,r=i.Backbone,n=[],s=n.push,o=n.slice,a=n.splice;e="undefined"!=typeof exports?exports:i.Backbone={},e.VERSION="1.0.0";var l=i._;l||void 0===t||(l=t("underscore")),e.$=i.jQuery||i.Zepto||i.ender||i.$,e.noConflict=function(){return i.Backbone=r,this},e.emulateHTTP=!1,e.emulateJSON=!1;var d=e.Events={on:function(e,t,i){if(!h(this,"on",e,[t,i])||!t)return this;this._events||(this._events={});var r=this._events[e]||(this._events[e]=[]);return r.push({callback:t,context:i,ctx:i||this}),this},once:function(e,t,i){if(!h(this,"once",e,[t,i])||!t)return this;var r=this,n=l.once(function(){r.off(e,n),t.apply(this,arguments)});return n._callback=t,this.on(e,n,i)},off:function(e,t,i){var r,n,s,o,a,d,c,u;if(!this._events||!h(this,"off",e,[t,i]))return this;if(!e&&!t&&!i)return this._events={},this;for(o=e?[e]:l.keys(this._events),a=0,d=o.length;d>a;a++)if(e=o[a],s=this._events[e]){if(this._events[e]=r=[],t||i)for(c=0,u=s.length;u>c;c++)n=s[c],(t&&t!==n.callback&&t!==n.callback._callback||i&&i!==n.context)&&r.push(n);r.length||delete this._events[e]}return this},trigger:function(e){if(!this._events)return this;var t=o.call(arguments,1);if(!h(this,"trigger",e,t))return this;var i=this._events[e],r=this._events.all;return i&&u(i,t),r&&u(r,arguments),this},stopListening:function(e,t,i){var r=this._listeners;if(!r)return this;var n=!t&&!i;"object"==typeof t&&(i=this),e&&((r={})[e._listenerId]=e);for(var s in r)r[s].off(t,i,this),n&&delete this._listeners[s];return this}},c=/\s+/,h=function(e,t,i,r){if(!i)return!0;if("object"==typeof i){for(var n in i)e[t].apply(e,[n,i[n]].concat(r));return!1}if(c.test(i)){for(var s=i.split(c),o=0,a=s.length;a>o;o++)e[t].apply(e,[s[o]].concat(r));return!1}return!0},u=function(e,t){var i,r=-1,n=e.length,s=t[0],o=t[1],a=t[2];switch(t.length){case 0:for(;n>++r;)(i=e[r]).callback.call(i.ctx);return;case 1:for(;n>++r;)(i=e[r]).callback.call(i.ctx,s);return;case 2:for(;n>++r;)(i=e[r]).callback.call(i.ctx,s,o);return;case 3:for(;n>++r;)(i=e[r]).callback.call(i.ctx,s,o,a);return;default:for(;n>++r;)(i=e[r]).callback.apply(i.ctx,t)}},p={listenTo:"on",listenToOnce:"once"};l.each(p,function(e,t){d[t]=function(t,i,r){var n=this._listeners||(this._listeners={}),s=t._listenerId||(t._listenerId=l.uniqueId("l"));return n[s]=t,"object"==typeof i&&(r=this),t[e](i,r,this),this}}),d.bind=d.on,d.unbind=d.off,l.extend(e,d);var f=e.Model=function(e,t){var i,r=e||{};t||(t={}),this.cid=l.uniqueId("c"),this.attributes={},l.extend(this,l.pick(t,g)),t.parse&&(r=this.parse(r,t)||{}),(i=l.result(this,"defaults"))&&(r=l.defaults({},r,i)),this.set(r,t),this.changed={},this.initialize.apply(this,arguments)},g=["url","urlRoot","collection"];l.extend(f.prototype,d,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(){return l.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(e){return this.attributes[e]},escape:function(e){return l.escape(this.get(e))},has:function(e){return null!=this.get(e)},set:function(e,t,i){var r,n,s,o,a,d,c,h;if(null==e)return this;if("object"==typeof e?(n=e,i=t):(n={})[e]=t,i||(i={}),!this._validate(n,i))return!1;s=i.unset,a=i.silent,o=[],d=this._changing,this._changing=!0,d||(this._previousAttributes=l.clone(this.attributes),this.changed={}),h=this.attributes,c=this._previousAttributes,this.idAttribute in n&&(this.id=n[this.idAttribute]);for(r in n)t=n[r],l.isEqual(h[r],t)||o.push(r),l.isEqual(c[r],t)?delete this.changed[r]:this.changed[r]=t,s?delete h[r]:h[r]=t;if(!a){o.length&&(this._pending=!0);for(var u=0,p=o.length;p>u;u++)this.trigger("change:"+o[u],this,h[o[u]],i)}if(d)return this;if(!a)for(;this._pending;)this._pending=!1,this.trigger("change",this,i);return this._pending=!1,this._changing=!1,this},unset:function(e,t){return this.set(e,void 0,l.extend({},t,{unset:!0}))},clear:function(e){var t={};for(var i in this.attributes)t[i]=void 0;return this.set(t,l.extend({},e,{unset:!0}))},hasChanged:function(e){return null==e?!l.isEmpty(this.changed):l.has(this.changed,e)},changedAttributes:function(e){if(!e)return this.hasChanged()?l.clone(this.changed):!1;var t,i=!1,r=this._changing?this._previousAttributes:this.attributes;for(var n in e)l.isEqual(r[n],t=e[n])||((i||(i={}))[n]=t);return i},previous:function(e){return null!=e&&this._previousAttributes?this._previousAttributes[e]:null},previousAttributes:function(){return l.clone(this._previousAttributes)},fetch:function(e){e=e?l.clone(e):{},void 0===e.parse&&(e.parse=!0);var t=this,i=e.success;return e.success=function(r){return t.set(t.parse(r,e),e)?(i&&i(t,r,e),t.trigger("sync",t,r,e),void 0):!1},I(this,e),this.sync("read",this,e)},save:function(e,t,i){var r,n,s,o=this.attributes;if(null==e||"object"==typeof e?(r=e,i=t):(r={})[e]=t,!(!r||i&&i.wait||this.set(r,i)))return!1;if(i=l.extend({validate:!0},i),!this._validate(r,i))return!1;r&&i.wait&&(this.attributes=l.extend({},o,r)),void 0===i.parse&&(i.parse=!0);var a=this,d=i.success;return i.success=function(e){a.attributes=o;var t=a.parse(e,i);return i.wait&&(t=l.extend(r||{},t)),l.isObject(t)&&!a.set(t,i)?!1:(d&&d(a,e,i),a.trigger("sync",a,e,i),void 0)},I(this,i),n=this.isNew()?"create":i.patch?"patch":"update","patch"===n&&(i.attrs=r),s=this.sync(n,this,i),r&&i.wait&&(this.attributes=o),s},destroy:function(e){e=e?l.clone(e):{};var t=this,i=e.success,r=function(){t.trigger("destroy",t,t.collection,e)};if(e.success=function(n){(e.wait||t.isNew())&&r(),i&&i(t,n,e),t.isNew()||t.trigger("sync",t,n,e)},this.isNew())return e.success(),!1;I(this,e);var n=this.sync("delete",this,e);return e.wait||r(),n},url:function(){var e=l.result(this,"urlRoot")||l.result(this.collection,"url")||L();return this.isNew()?e:e+("/"===e.charAt(e.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(e){return e},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},isValid:function(e){return this._validate({},l.extend(e||{},{validate:!0}))},_validate:function(e,t){if(!t.validate||!this.validate)return!0;e=l.extend({},this.attributes,e);var i=this.validationError=this.validate(e,t)||null;return i?(this.trigger("invalid",this,i,l.extend(t||{},{validationError:i})),!1):!0}});var v=["keys","values","pairs","invert","pick","omit"];l.each(v,function(e){f.prototype[e]=function(){var t=o.call(arguments);return t.unshift(this.attributes),l[e].apply(l,t)}});var m=e.Collection=function(e,t){t||(t={}),t.url&&(this.url=t.url),t.model&&(this.model=t.model),void 0!==t.comparator&&(this.comparator=t.comparator),this._reset(),this.initialize.apply(this,arguments),e&&this.reset(e,l.extend({silent:!0},t))},y={add:!0,remove:!0,merge:!0},w={add:!0,merge:!1,remove:!1};l.extend(m.prototype,d,{model:f,initialize:function(){},toJSON:function(e){return this.map(function(t){return t.toJSON(e)})},sync:function(){return e.sync.apply(this,arguments)},add:function(e,t){return this.set(e,l.defaults(t||{},w))},remove:function(e,t){e=l.isArray(e)?e.slice():[e],t||(t={});var i,r,n,s;for(i=0,r=e.length;r>i;i++)s=this.get(e[i]),s&&(delete this._byId[s.id],delete this._byId[s.cid],n=this.indexOf(s),this.models.splice(n,1),this.length--,t.silent||(t.index=n,s.trigger("remove",s,this,t)),this._removeReference(s));return this},set:function(e,t){t=l.defaults(t||{},y),t.parse&&(e=this.parse(e,t)),l.isArray(e)||(e=e?[e]:[]);var i,r,n,o,d,c=t.at,h=this.comparator&&null==c&&t.sort!==!1,u=l.isString(this.comparator)?this.comparator:null,p=[],f=[],g={};for(i=0,r=e.length;r>i;i++)(n=this._prepareModel(e[i],t))&&((o=this.get(n))?(t.remove&&(g[o.cid]=!0),t.merge&&(o.set(n.attributes,t),h&&!d&&o.hasChanged(u)&&(d=!0))):t.add&&(p.push(n),n.on("all",this._onModelEvent,this),this._byId[n.cid]=n,null!=n.id&&(this._byId[n.id]=n)));if(t.remove){for(i=0,r=this.length;r>i;++i)g[(n=this.models[i]).cid]||f.push(n);f.length&&this.remove(f,t)}if(p.length&&(h&&(d=!0),this.length+=p.length,null!=c?a.apply(this.models,[c,0].concat(p)):s.apply(this.models,p)),d&&this.sort({silent:!0}),t.silent)return this;for(i=0,r=p.length;r>i;i++)(n=p[i]).trigger("add",n,this,t);return d&&this.trigger("sort",this,t),this},reset:function(e,t){t||(t={});for(var i=0,r=this.models.length;r>i;i++)this._removeReference(this.models[i]);return t.previousModels=this.models,this._reset(),this.add(e,l.extend({silent:!0},t)),t.silent||this.trigger("reset",this,t),this},push:function(e,t){return e=this._prepareModel(e,t),this.add(e,l.extend({at:this.length},t)),e},pop:function(e){var t=this.at(this.length-1);return this.remove(t,e),t},unshift:function(e,t){return e=this._prepareModel(e,t),this.add(e,l.extend({at:0},t)),e},shift:function(e){var t=this.at(0);return this.remove(t,e),t},slice:function(e,t){return this.models.slice(e,t)},get:function(e){return null==e?void 0:this._byId[null!=e.id?e.id:e.cid||e]},at:function(e){return this.models[e]},where:function(e,t){return l.isEmpty(e)?t?void 0:[]:this[t?"find":"filter"](function(t){for(var i in e)if(e[i]!==t.get(i))return!1;return!0})},findWhere:function(e){return this.where(e,!0)},sort:function(e){if(!this.comparator)throw Error("Cannot sort a set without a comparator");return e||(e={}),l.isString(this.comparator)||1===this.comparator.length?this.models=this.sortBy(this.comparator,this):this.models.sort(l.bind(this.comparator,this)),e.silent||this.trigger("sort",this,e),this},sortedIndex:function(e,t,i){t||(t=this.comparator);var r=l.isFunction(t)?t:function(e){return e.get(t)};return l.sortedIndex(this.models,e,r,i)},pluck:function(e){return l.invoke(this.models,"get",e)},fetch:function(e){e=e?l.clone(e):{},void 0===e.parse&&(e.parse=!0);var t=e.success,i=this;return e.success=function(r){var n=e.reset?"reset":"set";i[n](r,e),t&&t(i,r,e),i.trigger("sync",i,r,e)},I(this,e),this.sync("read",this,e)},create:function(e,t){if(t=t?l.clone(t):{},!(e=this._prepareModel(e,t)))return!1;t.wait||this.add(e,t);var i=this,r=t.success;return t.success=function(n){t.wait&&i.add(e,t),r&&r(e,n,t)},e.save(null,t),e},parse:function(e){return e},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(e,t){if(e instanceof f)return e.collection||(e.collection=this),e;t||(t={}),t.collection=this;var i=new this.model(e,t);return i._validate(e,t)?i:(this.trigger("invalid",this,e,t),!1)},_removeReference:function(e){this===e.collection&&delete e.collection,e.off("all",this._onModelEvent,this)},_onModelEvent:function(e,t,i,r){("add"!==e&&"remove"!==e||i===this)&&("destroy"===e&&this.remove(t,r),t&&e==="change:"+t.idAttribute&&(delete this._byId[t.previous(t.idAttribute)],null!=t.id&&(this._byId[t.id]=t)),this.trigger.apply(this,arguments))}});var x=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","indexOf","shuffle","lastIndexOf","isEmpty","chain"];l.each(x,function(e){m.prototype[e]=function(){var t=o.call(arguments);return t.unshift(this.models),l[e].apply(l,t)}});var b=["groupBy","countBy","sortBy"];l.each(b,function(e){m.prototype[e]=function(t,i){var r=l.isFunction(t)?t:function(e){return e.get(t)};return l[e](this.models,r,i)}});var E=e.View=function(e){this.cid=l.uniqueId("view"),this._configure(e||{}),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},_=/^(\S+)\s*(.*)$/,T=["model","collection","el","id","attributes","className","tagName","events"];l.extend(E.prototype,d,{tagName:"div",$:function(e){return this.$el.find(e)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this.stopListening(),this},setElement:function(t,i){return this.$el&&this.undelegateEvents(),this.$el=t instanceof e.$?t:e.$(t),this.el=this.$el[0],i!==!1&&this.delegateEvents(),this},delegateEvents:function(e){if(!e&&!(e=l.result(this,"events")))return this;this.undelegateEvents();for(var t in e){var i=e[t];if(l.isFunction(i)||(i=this[e[t]]),i){var r=t.match(_),n=r[1],s=r[2];i=l.bind(i,this),n+=".delegateEvents"+this.cid,""===s?this.$el.on(n,i):this.$el.on(n,s,i)}}return this},undelegateEvents:function(){return this.$el.off(".delegateEvents"+this.cid),this},_configure:function(e){this.options&&(e=l.extend({},l.result(this,"options"),e)),l.extend(this,l.pick(e,T)),this.options=e},_ensureElement:function(){if(this.el)this.setElement(l.result(this,"el"),!1);else{var t=l.extend({},l.result(this,"attributes"));this.id&&(t.id=l.result(this,"id")),this.className&&(t["class"]=l.result(this,"className"));var i=e.$("<"+l.result(this,"tagName")+">").attr(t);this.setElement(i,!1)}}}),e.sync=function(t,i,r){var n=C[t];l.defaults(r||(r={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var s={type:n,dataType:"json"};if(r.url||(s.url=l.result(i,"url")||L()),null!=r.data||!i||"create"!==t&&"update"!==t&&"patch"!==t||(s.contentType="application/json",s.data=JSON.stringify(r.attrs||i.toJSON(r))),r.emulateJSON&&(s.contentType="application/x-www-form-urlencoded",s.data=s.data?{model:s.data}:{}),r.emulateHTTP&&("PUT"===n||"DELETE"===n||"PATCH"===n)){s.type="POST",r.emulateJSON&&(s.data._method=n);var o=r.beforeSend;r.beforeSend=function(e){return e.setRequestHeader("X-HTTP-Method-Override",n),o?o.apply(this,arguments):void 0}}"GET"===s.type||r.emulateJSON||(s.processData=!1),"PATCH"!==s.type||!window.ActiveXObject||window.external&&window.external.msActiveXFilteringEnabled||(s.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var a=r.xhr=e.ajax(l.extend(s,r));return i.trigger("request",i,a,r),a};var C={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var M=e.Router=function(e){e||(e={}),e.routes&&(this.routes=e.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},S=/\((.*?)\)/g,A=/(\(\?)?:\w+/g,R=/\*\w+/g,U=/[\-{}\[\]+?.,\\\^$|#\s]/g;l.extend(M.prototype,d,{initialize:function(){},route:function(t,i,r){l.isRegExp(t)||(t=this._routeToRegExp(t)),l.isFunction(i)&&(r=i,i=""),r||(r=this[i]);var n=this;return e.history.route(t,function(s){var o=n._extractParameters(t,s);r&&r.apply(n,o),n.trigger.apply(n,["route:"+i].concat(o)),n.trigger("route",i,o),e.history.trigger("route",n,i,o)}),this},navigate:function(t,i){return e.history.navigate(t,i),this},_bindRoutes:function(){if(this.routes){this.routes=l.result(this,"routes");for(var e,t=l.keys(this.routes);null!=(e=t.pop());)this.route(e,this.routes[e])}},_routeToRegExp:function(e){return e=e.replace(U,"\\$&").replace(S,"(?:$1)?").replace(A,function(e,t){return t?e:"([^/]+)"}).replace(R,"(.*?)"),RegExp("^"+e+"$")},_extractParameters:function(e,t){var i=e.exec(t).slice(1);return l.map(i,function(e){return e?decodeURIComponent(e):null})}});var D=e.History=function(){this.handlers=[],l.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},P=/^[#\/]|\s+$/g,j=/^\/+|\/+$/g,B=/msie [\w.]+/,H=/\/$/;D.started=!1,l.extend(D.prototype,d,{interval:50,getHash:function(e){var t=(e||this).location.href.match(/#(.*)$/);return t?t[1]:""},getFragment:function(e,t){if(null==e)if(this._hasPushState||!this._wantsHashChange||t){e=this.location.pathname;var i=this.root.replace(H,"");e.indexOf(i)||(e=e.substr(i.length))}else e=this.getHash();return e.replace(P,"")},start:function(t){if(D.started)throw Error("Backbone.history has already been started");D.started=!0,this.options=l.extend({},{root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var i=this.getFragment(),r=document.documentMode,n=B.exec(navigator.userAgent.toLowerCase())&&(!r||7>=r);this.root=("/"+this.root+"/").replace(j,"/"),n&&this._wantsHashChange&&(this.iframe=e.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(i)),this._hasPushState?e.$(window).on("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!n?e.$(window).on("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=i;var s=this.location,o=s.pathname.replace(/[^\/]$/,"$&/")===this.root;return this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!o?(this.fragment=this.getFragment(null,!0),this.location.replace(this.root+this.location.search+"#"+this.fragment),!0):(this._wantsPushState&&this._hasPushState&&o&&s.hash&&(this.fragment=this.getHash().replace(P,""),this.history.replaceState({},document.title,this.root+this.fragment+s.search)),this.options.silent?void 0:this.loadUrl())
},stop:function(){e.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl),clearInterval(this._checkUrlInterval),D.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(){var e=this.getFragment();return e===this.fragment&&this.iframe&&(e=this.getFragment(this.getHash(this.iframe))),e===this.fragment?!1:(this.iframe&&this.navigate(e),this.loadUrl()||this.loadUrl(this.getHash()),void 0)},loadUrl:function(e){var t=this.fragment=this.getFragment(e),i=l.any(this.handlers,function(e){return e.route.test(t)?(e.callback(t),!0):void 0});return i},navigate:function(e,t){if(!D.started)return!1;if(t&&t!==!0||(t={trigger:t}),e=this.getFragment(e||""),this.fragment!==e){this.fragment=e;var i=this.root+e;if(this._hasPushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,i);else{if(!this._wantsHashChange)return this.location.assign(i);this._updateHash(this.location,e,t.replace),this.iframe&&e!==this.getFragment(this.getHash(this.iframe))&&(t.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,e,t.replace))}t.trigger&&this.loadUrl(e)}},_updateHash:function(e,t,i){if(i){var r=e.href.replace(/(javascript:|#).*$/,"");e.replace(r+"#"+t)}else e.hash="#"+t}}),e.history=new D;var k=function(e,t){var i,r=this;i=e&&l.has(e,"constructor")?e.constructor:function(){return r.apply(this,arguments)},l.extend(i,r,t);var n=function(){this.constructor=i};return n.prototype=r.prototype,i.prototype=new n,e&&l.extend(i.prototype,e),i.__super__=r.prototype,i};f.extend=m.extend=M.extend=E.extend=D.extend=k;var L=function(){throw Error('A "url" property or function must be specified')},I=function(e,t){var i=t.error;t.error=function(r){i&&i(e,r,t),e.trigger("error",e,r,t)}}}.call(this),Backbone}),i("libs/backbone/backbone-relational",["jquery","underscore","backbone"],function(){(function(e){var i,r,n;"undefined"==typeof window?(i=t("underscore"),r=t("backbone"),n=module.exports=r):(i=window._,r=window.Backbone,n=window),r.Relational={showWarnings:!0},r.Semaphore={_permitsAvailable:null,_permitsUsed:0,acquire:function(){if(this._permitsAvailable&&this._permitsUsed>=this._permitsAvailable)throw Error("Max permits acquired");this._permitsUsed++},release:function(){if(0===this._permitsUsed)throw Error("All permits released");this._permitsUsed--},isLocked:function(){return this._permitsUsed>0},setAvailablePermits:function(e){if(this._permitsUsed>e)throw Error("Available permits cannot be less than used permits");this._permitsAvailable=e}},r.BlockingQueue=function(){this._queue=[]},i.extend(r.BlockingQueue.prototype,r.Semaphore,{_queue:null,add:function(e){this.isBlocked()?this._queue.push(e):e()},process:function(){for(;this._queue&&this._queue.length;)this._queue.shift()()},block:function(){this.acquire()},unblock:function(){this.release(),this.isBlocked()||this.process()},isBlocked:function(){return this.isLocked()}}),r.Relational.eventQueue=new r.BlockingQueue,r.Store=function(){this._collections=[],this._reverseRelations=[],this._orphanRelations=[],this._subModels=[],this._modelScopes=[n]},i.extend(r.Store.prototype,r.Events,{initializeRelation:function(e,t,n){var s=i.isString(t.type)?r[t.type]||this.getObjectByName(t.type):t.type;s&&s.prototype instanceof r.Relation?new s(e,t,n):r.Relational.showWarnings&&"undefined"!=typeof console&&console.warn("Relation=%o; missing or invalid relation type!",t)},addModelScope:function(e){this._modelScopes.push(e)},removeModelScope:function(e){this._modelScopes=i.without(this._modelScopes,e)},addSubModels:function(e,t){this._subModels.push({superModelType:t,subModels:e})},setupSuperModel:function(t){i.find(this._subModels,function(r){return i.find(r.subModels||[],function(i,n){var s=this.getObjectByName(i);return t===s?(r.superModelType._subModels[n]=t,t._superModel=r.superModelType,t._subModelTypeValue=n,t._subModelTypeAttribute=r.superModelType.prototype.subModelTypeAttribute,!0):e},this)},this)},addReverseRelation:function(e){var t=i.any(this._reverseRelations,function(t){return i.all(e||[],function(e,i){return e===t[i]})});!t&&e.model&&e.type&&(this._reverseRelations.push(e),this._addRelation(e.model,e),this.retroFitRelation(e))},addOrphanRelation:function(e){var t=i.any(this._orphanRelations,function(t){return i.all(e||[],function(e,i){return e===t[i]})});!t&&e.model&&e.type&&this._orphanRelations.push(e)},processOrphanRelations:function(){i.each(this._orphanRelations.slice(0),function(e){var t=r.Relational.store.getObjectByName(e.relatedModel);t&&(this.initializeRelation(null,e),this._orphanRelations=i.without(this._orphanRelations,e))},this)},_addRelation:function(e,t){e.prototype.relations||(e.prototype.relations=[]),e.prototype.relations.push(t),i.each(e._subModels||[],function(e){this._addRelation(e,t)},this)},retroFitRelation:function(e){var t=this.getCollection(e.model,!1);t&&t.each(function(t){t instanceof e.model&&new e.type(t,e)},this)},getCollection:function(e,t){e instanceof r.RelationalModel&&(e=e.constructor);for(var n=e;n._superModel;)n=n._superModel;var s=i.findWhere(this._collections,{model:n});return s||t===!1||(s=this._createCollection(n)),s},getObjectByName:function(t){var r=t.split("."),n=null;return i.find(this._modelScopes,function(t){return n=i.reduce(r||[],function(t,i){return t?t[i]:e},t),n&&n!==t?!0:e},this),n},_createCollection:function(e){var t;return e instanceof r.RelationalModel&&(e=e.constructor),e.prototype instanceof r.RelationalModel&&(t=new r.Collection,t.model=e,this._collections.push(t)),t},resolveIdForItem:function(e,t){var n=i.isString(t)||i.isNumber(t)?t:null;return null===n&&(t instanceof r.RelationalModel?n=t.id:i.isObject(t)&&(n=t[e.prototype.idAttribute])),n||0===n||(n=null),n},find:function(e,t){var i=this.resolveIdForItem(e,t),r=this.getCollection(e);if(r){var n=r.get(i);if(n instanceof e)return n}return null},register:function(e){var t=this.getCollection(e);if(t){var i=e.collection;t.add(e),this.listenTo(e,"destroy",this.unregister,this),e.collection=i}},checkId:function(e,t){var i=this.getCollection(e),n=i&&i.get(t);if(n&&e!==n)throw r.Relational.showWarnings&&"undefined"!=typeof console&&console.warn("Duplicate id! Old RelationalModel=%o, new RelationalModel=%o",n,e),Error("Cannot instantiate more than one Backbone.RelationalModel with the same id per type!")},update:function(e){var t=this.getCollection(e);t._onModelEvent("change:"+e.idAttribute,e,t),e.trigger("relational:change:id",e,t)},unregister:function(e){this.stopListening(e,"destroy",this.unregister);var t=this.getCollection(e);t&&t.remove(e)},reset:function(){this.stopListening(),this._collections=[],this._subModels=[],this._modelScopes=[n]}}),r.Relational.store=new r.Store,r.Relation=function(e,t,n){if(this.instance=e,t=i.isObject(t)?t:{},this.reverseRelation=i.defaults(t.reverseRelation||{},this.options.reverseRelation),this.options=i.defaults(t,this.options,r.Relation.prototype.options),this.reverseRelation.type=i.isString(this.reverseRelation.type)?r[this.reverseRelation.type]||r.Relational.store.getObjectByName(this.reverseRelation.type):this.reverseRelation.type,this.key=this.options.key,this.keySource=this.options.keySource||this.key,this.keyDestination=this.options.keyDestination||this.keySource||this.key,this.model=this.options.model||this.instance.constructor,this.relatedModel=this.options.relatedModel,i.isString(this.relatedModel)&&(this.relatedModel=r.Relational.store.getObjectByName(this.relatedModel)),this.checkPreconditions()&&(!this.options.isAutoRelation&&this.reverseRelation.type&&this.reverseRelation.key&&r.Relational.store.addReverseRelation(i.defaults({isAutoRelation:!0,model:this.relatedModel,relatedModel:this.model,reverseRelation:this.options},this.reverseRelation)),e)){var s=this.keySource;s!==this.key&&"object"==typeof this.instance.get(this.key)&&(s=this.key),this.setKeyContents(this.instance.get(s)),this.relatedCollection=r.Relational.store.getCollection(this.relatedModel),this.keySource!==this.key&&this.instance.unset(this.keySource,{silent:!0}),this.instance._relations[this.key]=this,this.initialize(n),this.options.autoFetch&&this.instance.fetchRelated(this.key,i.isObject(this.options.autoFetch)?this.options.autoFetch:{}),this.listenTo(this.instance,"destroy",this.destroy).listenTo(this.relatedCollection,"relational:add relational:change:id",this.tryAddRelated).listenTo(this.relatedCollection,"relational:remove",this.removeRelated)}},r.Relation.extend=r.Model.extend,i.extend(r.Relation.prototype,r.Events,r.Semaphore,{options:{createModels:!0,includeInJSON:!0,isAutoRelation:!1,autoFetch:!1,parse:!1},instance:null,key:null,keyContents:null,relatedModel:null,relatedCollection:null,reverseRelation:null,related:null,checkPreconditions:function(){var e=this.instance,t=this.key,n=this.model,s=this.relatedModel,o=r.Relational.showWarnings&&"undefined"!=typeof console;if(!n||!t||!s)return o&&console.warn("Relation=%o: missing model, key or relatedModel (%o, %o, %o).",this,n,t,s),!1;if(!(n.prototype instanceof r.RelationalModel))return o&&console.warn("Relation=%o: model does not inherit from Backbone.RelationalModel (%o).",this,e),!1;if(!(s.prototype instanceof r.RelationalModel))return o&&console.warn("Relation=%o: relatedModel does not inherit from Backbone.RelationalModel (%o).",this,s),!1;if(this instanceof r.HasMany&&this.reverseRelation.type===r.HasMany)return o&&console.warn("Relation=%o: relation is a HasMany, and the reverseRelation is HasMany as well.",this),!1;if(e&&i.keys(e._relations).length){var a=i.find(e._relations,function(e){return e.key===t},this);if(a)return o&&console.warn("Cannot create relation=%o on %o for model=%o: already taken by relation=%o.",this,t,e,a),!1}return!0},setRelated:function(e){this.related=e,this.instance.acquire(),this.instance.attributes[this.key]=e,this.instance.release()},_isReverseRelation:function(e){return e.instance instanceof this.relatedModel&&this.reverseRelation.key===e.key&&this.key===e.reverseRelation.key},getReverseRelations:function(e){var t=[],r=i.isUndefined(e)?this.related&&(this.related.models||[this.related]):[e];return i.each(r||[],function(e){i.each(e.getRelations()||[],function(e){this._isReverseRelation(e)&&t.push(e)},this)},this),t},destroy:function(){this.stopListening(),this instanceof r.HasOne?this.setRelated(null):this instanceof r.HasMany&&this.setRelated(this._prepareCollection()),i.each(this.getReverseRelations(),function(e){e.removeRelated(this.instance)},this)}}),r.HasOne=r.Relation.extend({options:{reverseRelation:{type:"HasMany"}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange);var t=this.findRelated(e);this.setRelated(t),i.each(this.getReverseRelations(),function(t){t.addRelated(this.instance,e)},this)},findRelated:function(e){var t=null;if(e=i.defaults({parse:this.options.parse},e),this.keyContents instanceof this.relatedModel)t=this.keyContents;else if(this.keyContents||0===this.keyContents){var r=i.defaults({create:this.options.createModels},e);t=this.relatedModel.findOrCreate(this.keyContents,r)}return this.related&&(this.keyId=null),t},setKeyContents:function(e){this.keyContents=e,this.keyId=r.Relational.store.resolveIdForItem(this.relatedModel,this.keyContents)},onChange:function(e,t,n){if(!this.isLocked()){this.acquire(),n=n?i.clone(n):{};var s=i.isUndefined(n.__related),o=s?this.related:n.__related;if(s){this.setKeyContents(t);var a=this.findRelated(n);this.setRelated(a)}if(o&&this.related!==o&&i.each(this.getReverseRelations(o),function(e){e.removeRelated(this.instance,null,n)},this),i.each(this.getReverseRelations(),function(e){e.addRelated(this.instance,n)},this),!n.silent&&this.related!==o){var l=this;this.changed=!0,r.Relational.eventQueue.add(function(){l.instance.trigger("change:"+l.key,l.instance,l.related,n,!0),l.changed=!1})}this.release()}},tryAddRelated:function(e,t,i){!this.keyId&&0!==this.keyId||e.id!==this.keyId||(this.addRelated(e,i),this.keyId=null)},addRelated:function(e,t){var r=this;e.queue(function(){if(e!==r.related){var n=r.related||null;r.setRelated(e),r.onChange(r.instance,e,i.defaults({__related:n},t))}})},removeRelated:function(e,t,r){if(this.related&&e===this.related){var n=this.related||null;this.setRelated(null),this.onChange(this.instance,e,i.defaults({__related:n},r))}}}),r.HasMany=r.Relation.extend({collectionType:null,options:{reverseRelation:{type:"HasOne"},collectionType:r.Collection,collectionKey:!0,collectionOptions:{}},initialize:function(e){if(this.listenTo(this.instance,"relational:change:"+this.key,this.onChange),this.collectionType=this.options.collectionType,i.isString(this.collectionType)&&(this.collectionType=r.Relational.store.getObjectByName(this.collectionType)),this.collectionType!==r.Collection&&!(this.collectionType.prototype instanceof r.Collection))throw Error("`collectionType` must inherit from Backbone.Collection");var t=this.findRelated(e);this.setRelated(t)},_prepareCollection:function(e){if(this.related&&this.stopListening(this.related),!(e&&e instanceof r.Collection)){var t=i.isFunction(this.options.collectionOptions)?this.options.collectionOptions(this.instance):this.options.collectionOptions;e=new this.collectionType(null,t)}if(e.model=this.relatedModel,this.options.collectionKey){var n=this.options.collectionKey===!0?this.options.reverseRelation.key:this.options.collectionKey;e[n]&&e[n]!==this.instance?r.Relational.showWarnings&&"undefined"!=typeof console&&console.warn("Relation=%o; collectionKey=%s already exists on collection=%o",this,n,this.options.collectionKey):n&&(e[n]=this.instance)}return this.listenTo(e,"relational:add",this.handleAddition).listenTo(e,"relational:remove",this.handleRemoval).listenTo(e,"relational:reset",this.handleReset),e},findRelated:function(e){var t=null;if(e=i.defaults({parse:this.options.parse},e),this.keyContents instanceof r.Collection)this._prepareCollection(this.keyContents),t=this.keyContents;else{var n=[];i.each(this.keyContents,function(t){if(t instanceof this.relatedModel)var r=t;else r=this.relatedModel.findOrCreate(t,i.extend({merge:!0},e,{create:this.options.createModels}));r&&n.push(r)},this),t=this.related instanceof r.Collection?this.related:this._prepareCollection(),t.set(n,i.defaults({merge:!1,parse:!1},e))}return this.keyIds=i.difference(this.keyIds,i.pluck(t.models,"id")),t},setKeyContents:function(e){this.keyContents=e instanceof r.Collection?e:null,this.keyIds=[],this.keyContents||!e&&0!==e||(this.keyContents=i.isArray(e)?e:[e],i.each(this.keyContents,function(e){var t=r.Relational.store.resolveIdForItem(this.relatedModel,e);(t||0===t)&&this.keyIds.push(t)},this))},onChange:function(e,t,n){n=n?i.clone(n):{},this.setKeyContents(t),this.changed=!1;var s=this.findRelated(n);if(this.setRelated(s),!n.silent){var o=this;r.Relational.eventQueue.add(function(){o.changed&&(o.instance.trigger("change:"+o.key,o.instance,o.related,n,!0),o.changed=!1)})}},handleAddition:function(e,t,n){n=n?i.clone(n):{},this.changed=!0,i.each(this.getReverseRelations(e),function(e){e.addRelated(this.instance,n)},this);var s=this;!n.silent&&r.Relational.eventQueue.add(function(){s.instance.trigger("add:"+s.key,e,s.related,n)})},handleRemoval:function(e,t,n){n=n?i.clone(n):{},this.changed=!0,i.each(this.getReverseRelations(e),function(e){e.removeRelated(this.instance,null,n)},this);var s=this;!n.silent&&r.Relational.eventQueue.add(function(){s.instance.trigger("remove:"+s.key,e,s.related,n)})},handleReset:function(e,t){var n=this;t=t?i.clone(t):{},!t.silent&&r.Relational.eventQueue.add(function(){n.instance.trigger("reset:"+n.key,n.related,t)})},tryAddRelated:function(e,t,r){var n=i.contains(this.keyIds,e.id);n&&(this.addRelated(e,r),this.keyIds=i.without(this.keyIds,e.id))},addRelated:function(e,t){var r=this;e.queue(function(){r.related&&!r.related.get(e)&&r.related.add(e,i.defaults({parse:!1},t))})},removeRelated:function(e,t,i){this.related.get(e)&&this.related.remove(e,i)}}),r.RelationalModel=r.Model.extend({relations:null,_relations:null,_isInitialized:!1,_deferProcessing:!1,_queue:null,subModelTypeAttribute:"type",subModelTypes:null,constructor:function(e,t){if(t&&t.collection){var n=this,s=this.collection=t.collection;delete t.collection,this._deferProcessing=!0;var o=function(e){e===n&&(n._deferProcessing=!1,n.processQueue(),s.off("relational:add",o))};s.on("relational:add",o),i.defer(function(){o(n)})}r.Relational.store.processOrphanRelations(),this._queue=new r.BlockingQueue,this._queue.block(),r.Relational.eventQueue.block();try{r.Model.apply(this,arguments)}finally{r.Relational.eventQueue.unblock()}},trigger:function(e){if(e.length>5&&0===e.indexOf("change")){var t=this,i=arguments;r.Relational.eventQueue.add(function(){if(t._isInitialized){var n=!0;if("change"===e)n=t.hasChanged();else{var s=e.slice(7),o=t.getRelation(s);o&&(n=i[4]===!0,n?t.changed[s]=i[2]:o.changed||delete t.changed[s])}n&&r.Model.prototype.trigger.apply(t,i)}})}else r.Model.prototype.trigger.apply(this,arguments);return this},initializeRelations:function(e){this.acquire(),this._relations={},i.each(this.relations||[],function(t){r.Relational.store.initializeRelation(this,t,e)},this),this._isInitialized=!0,this.release(),this.processQueue()},updateRelations:function(e){this._isInitialized&&!this.isLocked()&&i.each(this._relations,function(t){var i=this.attributes[t.keySource]||this.attributes[t.key];t.related!==i&&this.trigger("relational:change:"+t.key,this,i,e||{})},this)},queue:function(e){this._queue.add(e)},processQueue:function(){this._isInitialized&&!this._deferProcessing&&this._queue.isBlocked()&&this._queue.unblock()},getRelation:function(e){return this._relations[e]},getRelations:function(){return i.values(this._relations)},fetchRelated:function(e,t,n){t=i.extend({update:!0,remove:!1},t);var s,o=[],a=this.getRelation(e),l=a&&(a.keyIds||(a.keyId||0===a.keyId?[a.keyId]:[]));if(n){var d=a.related instanceof r.Collection?a.related.models:[a.related];i.each(d,function(e){(e.id||0===e.id)&&l.push(e.id)})}if(l&&l.length){var c=[],d=i.map(l,function(e){var i=r.Relational.store.find(a.relatedModel,e);if(!i){var n={};n[a.relatedModel.prototype.idAttribute]=e,i=a.relatedModel.findOrCreate(n,t),c.push(i)}return i},this);if(a.related instanceof r.Collection&&i.isFunction(a.related.url)&&(s=a.related.url(d)),s&&s!==a.related.url()){var h=i.defaults({error:function(){var e=arguments;i.each(c,function(i){i.trigger("destroy",i,i.collection,t),t.error&&t.error.apply(i,e)})},url:s},t);o=[a.related.fetch(h)]}else o=i.map(d,function(e){var r=i.defaults({error:function(){i.contains(c,e)&&(e.trigger("destroy",e,e.collection,t),t.error&&t.error.apply(e,arguments))}},t);return e.fetch(r)},this)}return o},get:function(t){var n=r.Model.prototype.get.call(this,t);if(!this.dotNotation||-1===t.indexOf("."))return n;var s=t.split("."),o=i.reduce(s,function(e,t){if(!(e instanceof r.Model))throw Error("Attribute must be an instanceof Backbone.Model. Is: "+e+", currentSplit: "+t);return r.Model.prototype.get.call(e,t)},this);if(n!==e&&o!==e)throw Error("Ambiguous result for '"+t+"'. direct result: "+n+", dotNotation: "+o);return n||o},set:function(e,t,n){r.Relational.eventQueue.block();var s;i.isObject(e)||null==e?(s=e,n=t):(s={},s[e]=t);try{var o=this.id,a=s&&this.idAttribute in s&&s[this.idAttribute];r.Relational.store.checkId(this,a);var l=r.Model.prototype.set.apply(this,arguments);this._isInitialized||this.isLocked()?a&&a!==o&&r.Relational.store.update(this):(this.constructor.initializeModelHierarchy(),r.Relational.store.register(this),this.initializeRelations(n)),s&&this.updateRelations(n)}finally{r.Relational.eventQueue.unblock()}return l},unset:function(e,t){r.Relational.eventQueue.block();var i=r.Model.prototype.unset.apply(this,arguments);return this.updateRelations(t),r.Relational.eventQueue.unblock(),i},clear:function(e){r.Relational.eventQueue.block();var t=r.Model.prototype.clear.apply(this,arguments);return this.updateRelations(e),r.Relational.eventQueue.unblock(),t},clone:function(){var e=i.clone(this.attributes);return i.isUndefined(e[this.idAttribute])||(e[this.idAttribute]=null),i.each(this.getRelations(),function(t){delete e[t.key]}),new this.constructor(e)},toJSON:function(e){if(this.isLocked())return this.id;this.acquire();var t=r.Model.prototype.toJSON.call(this,e);return!this.constructor._superModel||this.constructor._subModelTypeAttribute in t||(t[this.constructor._subModelTypeAttribute]=this.constructor._subModelTypeValue),i.each(this._relations,function(n){var s=t[n.key],o=n.options.includeInJSON,a=null;o===!0?s&&i.isFunction(s.toJSON)&&(a=s.toJSON(e)):i.isString(o)?(s instanceof r.Collection?a=s.pluck(o):s instanceof r.Model&&(a=s.get(o)),o===n.relatedModel.prototype.idAttribute&&(n instanceof r.HasMany?a=a.concat(n.keyIds):n instanceof r.HasOne&&(a=a||n.keyId))):i.isArray(o)?s instanceof r.Collection?(a=[],s.each(function(e){var t={};i.each(o,function(i){t[i]=e.get(i)}),a.push(t)})):s instanceof r.Model&&(a={},i.each(o,function(e){a[e]=s.get(e)})):delete t[n.key],o&&(t[n.keyDestination]=a),n.keyDestination!==n.key&&delete t[n.key]}),this.release(),t}},{setup:function(){return this.prototype.relations=(this.prototype.relations||[]).slice(0),this._subModels={},this._superModel=null,this.prototype.hasOwnProperty("subModelTypes")?r.Relational.store.addSubModels(this.prototype.subModelTypes,this):this.prototype.subModelTypes=null,i.each(this.prototype.relations||[],function(e){if(e.model||(e.model=this),e.reverseRelation&&e.model===this){var t=!0;if(i.isString(e.relatedModel)){var n=r.Relational.store.getObjectByName(e.relatedModel);t=n&&n.prototype instanceof r.RelationalModel}t?r.Relational.store.initializeRelation(null,e):i.isString(e.relatedModel)&&r.Relational.store.addOrphanRelation(e)}},this),this},build:function(e,t){var i=this;if(this.initializeModelHierarchy(),this._subModels&&this.prototype.subModelTypeAttribute in e){var r=e[this.prototype.subModelTypeAttribute],n=this._subModels[r];n&&(i=n)}return new i(e,t)},initializeModelHierarchy:function(){if(i.isUndefined(this._superModel)||i.isNull(this._superModel))if(r.Relational.store.setupSuperModel(this),this._superModel&&this._superModel.prototype.relations){var e=i.select(this._superModel.prototype.relations||[],function(e){return!i.any(this.prototype.relations||[],function(t){return e.relatedModel===t.relatedModel&&e.key===t.key},this)},this);this.prototype.relations=e.concat(this.prototype.relations)}else this._superModel=!1;this.prototype.subModelTypes&&i.keys(this.prototype.subModelTypes).length!==i.keys(this._subModels).length&&i.each(this.prototype.subModelTypes||[],function(e){var t=r.Relational.store.getObjectByName(e);t&&t.initializeModelHierarchy()})},findOrCreate:function(e,t){t||(t={});var n=i.isObject(e)&&t.parse&&this.prototype.parse?this.prototype.parse(e):e,s=r.Relational.store.find(this,n);return i.isObject(e)&&(s&&t.merge!==!1?(delete t.collection,s.set(n,t)):s||t.create===!1||(s=this.build(e,t))),s}}),i.extend(r.RelationalModel.prototype,r.Semaphore),r.Collection.prototype.__prepareModel=r.Collection.prototype._prepareModel,r.Collection.prototype._prepareModel=function(t,i){var n;return t instanceof r.Model?(t.collection||(t.collection=this),n=t):(i||(i={}),i.collection=this,n=this.model.findOrCreate!==e?this.model.findOrCreate(t,i):new this.model(t,i),n&&n.isNew()&&!n._validate(t,i)&&(this.trigger("invalid",this,t,i),n=!1)),n};var s=r.Collection.prototype.__set=r.Collection.prototype.set;r.Collection.prototype.set=function(e,t){if(!(this.model.prototype instanceof r.RelationalModel))return s.apply(this,arguments);t&&t.parse&&(e=this.parse(e,t)),i.isArray(e)||(e=e?[e]:[]);var n=[],o=[];return i.each(e,function(e){e instanceof r.Model||(e=r.Collection.prototype._prepareModel.call(this,e,t)),e&&(o.push(e),this.get(e)||this.get(e.cid)?null!=e.id&&(this._byId[e.id]=e):n.push(e))},this),s.call(this,o,i.defaults({parse:!1},t)),i.each(n,function(e){(this.get(e)||this.get(e.cid))&&this.trigger("relational:add",e,this,t)},this),this};var o=r.Collection.prototype.__remove=r.Collection.prototype.remove;r.Collection.prototype.remove=function(e,t){if(!(this.model.prototype instanceof r.RelationalModel))return o.apply(this,arguments);e=i.isArray(e)?e.slice():[e],t||(t={});var n=[];return i.each(e,function(e){e=this.get(e)||this.get(e.cid),e&&n.push(e)},this),n.length&&(o.call(this,n,t),i.each(n,function(e){this.trigger("relational:remove",e,this,t)},this)),this};var a=r.Collection.prototype.__reset=r.Collection.prototype.reset;r.Collection.prototype.reset=function(e,t){return t=i.extend({merge:!0},t),a.call(this,e,t),this.model.prototype instanceof r.RelationalModel&&this.trigger("relational:reset",this,t),this};var l=r.Collection.prototype.__sort=r.Collection.prototype.sort;r.Collection.prototype.sort=function(e){return l.call(this,e),this.model.prototype instanceof r.RelationalModel&&this.trigger("relational:reset",this,e),this};var d=r.Collection.prototype.__trigger=r.Collection.prototype.trigger;r.Collection.prototype.trigger=function(e){if(!(this.model.prototype instanceof r.RelationalModel))return d.apply(this,arguments);if("add"===e||"remove"===e||"reset"===e){var t=this,n=arguments;i.isObject(n[3])&&(n=i.toArray(n),n[3]=i.clone(n[3])),r.Relational.eventQueue.add(function(){d.apply(t,n)})}else d.apply(this,arguments);return this},r.RelationalModel.extend=function(){var e=r.Model.extend.apply(this,arguments);return e.setup(this),e}})()}),i("models/media",["underscore","backbone","libs/backbone/backbone-relational"],function(e,t){var i=t.RelationalModel.extend({idAttribute:"id",url:function(){return this.get("id")?"/projects/"+this.get("project").id+"/media/"+this.get("id")+".json":"/projects/"+this.get("project").id+"/media.json"},validate:function(e){return e.url&&!e.url.match(/(?:http:\/\/)?(?:www\.)?(youtube.com|youtu.be|vimeo.com)\//)?"Only youtube and vimeo links are supported.":void 0},getNext:function(){var t,i=this;return e(this.get("project").get("media").models).each(function(e,r){e.get("id")==i.get("id")&&i.get("project").get("media").models[r+1]!==void 0&&(t=i.get("project").get("media").models[r+1])}),t},getPrevious:function(){var t,i=this;return e(this.get("project").get("media").models).each(function(e,r){e.get("id")==i.get("id")&&i.get("project").get("media").models[r-1]!==void 0&&(t=i.get("project").get("media").models[r-1])}),t}});return i}),i("collections/media",["underscore","backbone","models/media"],function(e,t,i){var r=t.Collection.extend({model:i});return r}),i("models/project",["jquery","underscore","backbone","collections/media","models/media","libs/backbone/backbone-relational"],function(e,t,i,r,n){var s=i.RelationalModel.extend({url:function(){var e;return e=this.id?window.verold.apiBaseUrl+"/projects/"+this.id+".json":window.verold.apiBaseUrl+"/projects.json"},idAttribute:"id",relations:[{type:i.HasMany,key:"media",collectionType:r,relatedModel:n,reverseRelation:{key:"project",includeInJSON:!0}}],getRoute:function(){return"projects/"+this.get("id")},addTag:function(t,i,r){e.ajax({type:"post",url:window.verold.apiBaseUrl+"/projects/"+this.id+"/tags.json",contentType:"application/json",data:JSON.stringify({tags:t}),success:i,error:r})},deleteTag:function(t,i,r){e.ajax({type:"delete",url:window.verold.apiBaseUrl+"/projects/"+this.id+"/tags.json",contentType:"application/json",data:JSON.stringify({tag:t}),success:i,error:r})},addUrl:function(t,i,r){e.ajax({type:"post",url:window.verold.apiBaseUrl+"/projects/"+this.id+"/url.json",contentType:"application/json",data:JSON.stringify({url:t}),success:i,error:r})},deleteUrl:function(t,i,r){e.ajax({type:"delete",url:window.verold.apiBaseUrl+"/projects/"+this.id+"/url.json",contentType:"application/json",data:JSON.stringify({url:t}),success:i,error:r})},follow:function(t,i){e.ajax({type:"post",url:window.verold.apiBaseUrl+"/projects/"+this.id+"/follow.json",data:{},success:t,error:i})},unfollow:function(t,i){e.ajax({type:"delete",url:window.verold.apiBaseUrl+"/projects/"+this.id+"/follow.json",data:{},success:t,error:i})}});return s}),i("collections/subentity",["underscore","backbone"],function(e,t){var i=t.Collection.extend({initialize:function(e,t){this.model=t.model,this.entity=t.entity},url:function(){return window.verold.apiBaseUrl+"/entities/"+this.entity.id+"/entities.json"}});return i}),i("libs/backbone/deep-model",["underscore","backbone"],function(e,t){function i(t){var r={},n=o.keyPathSeparator;for(var s in t){var a=t[s];if(a&&a.constructor===Object&&!e.isEmpty(a)){var l=i(a);for(var d in l){var c=l[d];r[s+n+d]=c}}else r[s]=a}return r}function r(t,i,r){for(var n=o.keyPathSeparator,s=i.split(n),a=t,l=0,d=s.length;d>l;l++){if(r&&!e.has(a,s[l]))return!1;if(a=a[s[l]],null==a&&d-1>l&&(a={}),a===void 0)return r?!0:a}return r?!0:a}function n(t,i,r,n){n=n||{};for(var s=o.keyPathSeparator,a=i.split(s),l=t,d=0,c=a.length;c>d&&void 0!==l;d++){var h=a[d];d===c-1?n.unset?delete l[h]:l[h]=r:(void 0!==l[h]&&e.isObject(l[h])||(l[h]={}),l=l[h])}}function s(e,t){n(e,t,null,{unset:!0})}(function(){var i,r,n,s,o,a,l=[].slice;n=function(i){var r,s;return!e.isObject(i)||e.isFunction(i)?i:i instanceof t.Collection||i instanceof t.Model?i:e.isDate(i)?new Date(i.getTime()):e.isRegExp(i)?RegExp(i.source,(""+i).replace(/.*\//,"")):(s=e.isArray(i||e.isArguments(i)),r=function(e,t,i){return s?e.push(n(t)):e[i]=n(t),e},e.reduce(i,r,s?[]:{}))},a=function(t){return null==t?!1:!(t.prototype!=={}.prototype&&t.prototype!==Object.prototype||!e.isObject(t)||e.isArray(t)||e.isFunction(t)||e.isDate(t)||e.isRegExp(t)||e.isArguments(t))},r=function(t){return e.filter(e.keys(t),function(e){return a(t[e])})},i=function(t){return e.filter(e.keys(t),function(i){return e.isArray(t[i])})},o=function(t,n,s){var a,l,d,c,h,u,p,f,g,v;if(null==s&&(s=20),0>=s)return console.warn("_.deepExtend(): Maximum depth of recursion hit."),e.extend(t,n);for(u=e.intersection(r(t),r(n)),l=function(e){return n[e]=o(t[e],n[e],s-1)},p=0,g=u.length;g>p;p++)h=u[p],l(h);for(c=e.intersection(i(t),i(n)),a=function(i){return n[i]=e.union(t[i],n[i])},f=0,v=c.length;v>f;f++)d=c[f],a(d);return e.extend(t,n)},s=function(){var t,i,r,s;if(r=arguments.length>=2?l.call(arguments,0,s=arguments.length-1):(s=0,[]),i=arguments[s++],e.isNumber(i)||(r.push(i),i=20),1>=r.length)return r[0];if(0>=i)return e.extend.apply(this,r);for(t=r.shift();r.length>0;)t=o(t,n(r.shift()),i);return t},e.mixin({deepClone:n,isBasicObject:a,basicObjects:r,arrays:i,deepExtend:s})}).call(this);var o=t.Model.extend({constructor:function(t,i){var r,n=t||{};this.cid=e.uniqueId("c"),this.attributes={},i&&i.collection&&(this.collection=i.collection),i&&i.parse&&(n=this.parse(n,i)||{}),(r=e.result(this,"defaults"))&&(n=e.deepExtend({},r,n)),this.set(n,i),this.changed={},this.initialize.apply(this,arguments)},toJSON:function(){return e.deepClone(this.attributes)},get:function(e){return r(this.attributes,e)},set:function(t,a,l){var d,c,h,u,p,f,g,v;if(null==t)return this;if("object"==typeof t?(c=t,l=a||{}):(c={})[t]=a,l||(l={}),!this._validate(c,l))return!1;h=l.unset,p=l.silent,u=[],f=this._changing,this._changing=!0,f||(this._previousAttributes=e.deepClone(this.attributes),this.changed={}),v=this.attributes,g=this._previousAttributes,this.idAttribute in c&&(this.id=c[this.idAttribute]),c=i(c);for(d in c)a=c[d],e.isEqual(r(v,d),a)||u.push(d),e.isEqual(r(g,d),a)?s(this.changed,d):n(this.changed,d,a),h?s(v,d):n(v,d,a);if(!p){u.length&&(this._pending=!0);for(var m=o.keyPathSeparator,y=0,w=u.length;w>y;y++){var t=u[y];this.trigger("change:"+t,this,r(v,t),l);for(var x=t.split(m),b=x.length-1;b>0;b--){var E=e.first(x,b).join(m),_=E+m+"*";this.trigger("change:"+_,this,r(v,E),l)}}}if(f)return this;if(!p)for(;this._pending;)this._pending=!1,this.trigger("change",this,l);return this._pending=!1,this._changing=!1,this},clear:function(t){var r={},n=i(this.attributes);for(var s in n)r[s]=void 0;return this.set(r,e.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!e.isEmpty(this.changed):void 0!==r(this.changed,t)
},changedAttributes:function(t){if(!t)return this.hasChanged()?i(this.changed):!1;var r=this._changing?this._previousAttributes:this.attributes;t=i(t),r=i(r);var n,s=!1;for(var o in t)e.isEqual(r[o],n=t[o])||((s||(s={}))[o]=n);return s},previous:function(e){return null!=e&&this._previousAttributes?r(this._previousAttributes,e):null},previousAttributes:function(){return e.deepClone(this._previousAttributes)}});return o.keyPathSeparator=".",t.DeepModel=o,"undefined"!=typeof module&&(module.exports=o),t}),i("models/entity",["jquery","underscore","backbone","collections/subentity","libs/backbone/deep-model"],function(e,t,i,r){var n={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"},s=function(){throw Error('A "url" property or function must be specified')},o=i.DeepModel.extend({idAttribute:"id",initialize:function(){this.subEntities=new r([],{model:o,entity:this}),this.isPersistent=!0,this.creationCallbacks={success:{},failure:{}}},url:function(){return this.has("id")?window.verold.apiBaseUrl+"/entities/"+this.get("id")+".json":window.verold.apiBaseUrl+"/projects/"+this.get("projectId")+"/entities.json"},getPath:function(e){var i="path",r=this.get("type");if("texture2D"==r)i=this.get("payload")[e],i=i?i.path:this.get("payload").path,i&&!this.get("payload").isLocal&&(i=window.verold.assetsBaseUrl+"/entities/"+this.get("projectId")+"/"+this.get("folder")+"/"+i);else if("textureCube"==r){if(i=this.get("payload")[e],i=i?i.path:this.get("payload").path,!this.get("payload").isLocal)if(t.isArray(i))for(var n in i)i.push(window.verold.assetsBaseUrl+"/entities/"+this.get("projectId")+"/"+this.get("folder")+"/"+i[n]);else i=window.verold.assetsBaseUrl+"/entities/"+this.get("projectId")+"/"+this.get("folder")+"/"+i}else"mesh"==r||"skinned_mesh"==r?(i=this.get("payload").geometry,this.get("payload").isLocal||(i=window.verold.assetsBaseUrl+"/entities/"+this.get("projectId")+"/"+this.get("folder")+"/"+this.get("payload").geometry)):(i=this.get("payload").path,this.get("payload").isLocal||(i=window.verold.assetsBaseUrl+"/entities/"+this.get("projectId")+"/"+this.get("folder")+"/"+this.get("payload").path));return i},clonePayload:function(){function e(i){if(t.isArray(i)){n=[];for(var r in i)n.push(e(i[r]));return n}if(t.isObject(i)){var n={};for(var r in i)n[r]=e(i[r]);return n}return i}var i={},r=this.get("payload");for(var n in r)i[n]=e(r[n]);return i},loadSubEntities:function(e){if("material"===this.get("type")||"texture2D"===this.get("type")||"textureCube"===this.get("type"))return"function"==typeof e&&e(null),void 0;var t=this,i=this.get("subEntitiesState");i&&"pending"!==i?"loading"===i?(this.subEntityCallbacks||(this.subEntityCallbacks=[]),this.subEntityCallbacks.push(e)):"loaded"===i&&"function"==typeof e&&e(this.subEntities):(this.set({subEntitiesState:"loading"}),this.subEntities.fetch({reset:!0,success:function(){if(t.set({subEntitiesState:"loaded"}),"function"==typeof e){e(t.subEntities);for(var i in t.subEntityCallbacks)t.subEntityCallbacks[i](t.subEntities),delete t.subEntityCallbacks[i];t.subEntityCallbacks=void 0}},error:function(){console.error("Failed to load subentites")}}))},getInstance:function(t,i){var r="/entities/"+this.get("id")+"/instances.json";e.post(r,t,function(e){i(new o(e))},"json")},getClone:function(t,i){var r="/entities/"+this.get("id")+"/clone.json";e.post(r,t,function(e){i(new o(e))},"json")},sync:function(e,r,o){var a=n[e],l=/^[a-f0-9]{24}$/i;t.defaults(o||(o={}),{emulateHTTP:i.emulateHTTP,emulateJSON:i.emulateJSON});var d={type:a,dataType:"json"};if(o.url||(d.url=t.result(r,"url")||s()),null==o.data&&r&&("create"===e||"update"===e||"patch"===e)){d.contentType="application/json";var c=JSON.parse(JSON.stringify(o.attrs||r.toJSON(o)));for(var h in c.children)h.match(l)||delete c.children[h];d.data=JSON.stringify(c)}if(o.emulateJSON&&(d.contentType="application/x-www-form-urlencoded",d.data=d.data?{model:d.data}:{}),o.emulateHTTP&&("PUT"===a||"DELETE"===a||"PATCH"===a)){d.type="POST",o.emulateJSON&&(d.data._method=a);var u=o.beforeSend;o.beforeSend=function(e){return e.setRequestHeader("X-HTTP-Method-Override",a),u?u.apply(this,arguments):void 0}}"GET"===d.type||o.emulateJSON||(d.processData=!1),"PATCH"!==d.type||!window.ActiveXObject||window.external&&window.external.msActiveXFilteringEnabled||(d.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var p=o.xhr=i.ajax(t.extend(d,o));return r.trigger("request",r,p,o),p}});return o}),i("collections/entity",["underscore","backbone","models/entity"],function(e,t,i){var r=t.Collection.extend({model:i,initialize:function(e,t){this.project=t.project},url:function(){return window.verold.apiBaseUrl+"/projects/"+this.project.id+"/assets.json"}});return r});var r=r||{REVISION:"59dev"};return self.console=self.console||{info:function(){},log:function(){},debug:function(){},warn:function(){},error:function(){}},self.Int32Array=self.Int32Array||Array,self.Float32Array=self.Float32Array||Array,String.prototype.trim=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},r.extend=function(e,t){if(Object.keys)for(var i=Object.keys(t),r=0,n=i.length;n>r;r++){var s=i[r];Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(t,s))}else{var o={}.hasOwnProperty;for(var s in t)o.call(t,s)&&(e[s]=t[s])}return e},function(){for(var e=0,t=["ms","moz","webkit","o"],i=0;t.length>i&&!self.requestAnimationFrame;++i)self.requestAnimationFrame=self[t[i]+"RequestAnimationFrame"],self.cancelAnimationFrame=self[t[i]+"CancelAnimationFrame"]||self[t[i]+"CancelRequestAnimationFrame"];void 0===self.requestAnimationFrame&&void 0!==self.setTimeout&&(self.requestAnimationFrame=function(t){var i=Date.now(),r=Math.max(0,16-(i-e)),n=self.setTimeout(function(){t(i+r)},r);return e=i+r,n}),void 0===self.cancelAnimationFrame&&void 0!==self.clearTimeout&&(self.cancelAnimationFrame=function(e){self.clearTimeout(e)})}(),r.CullFaceNone=0,r.CullFaceBack=1,r.CullFaceFront=2,r.CullFaceFrontBack=3,r.FrontFaceDirectionCW=0,r.FrontFaceDirectionCCW=1,r.BasicShadowMap=0,r.PCFShadowMap=1,r.PCFSoftShadowMap=2,r.FrontSide=0,r.BackSide=1,r.DoubleSide=2,r.NoShading=0,r.FlatShading=1,r.SmoothShading=2,r.NoColors=0,r.FaceColors=1,r.VertexColors=2,r.NoBlending=0,r.NormalBlending=1,r.AdditiveBlending=2,r.SubtractiveBlending=3,r.MultiplyBlending=4,r.CustomBlending=5,r.AddEquation=100,r.SubtractEquation=101,r.ReverseSubtractEquation=102,r.ZeroFactor=200,r.OneFactor=201,r.SrcColorFactor=202,r.OneMinusSrcColorFactor=203,r.SrcAlphaFactor=204,r.OneMinusSrcAlphaFactor=205,r.DstAlphaFactor=206,r.OneMinusDstAlphaFactor=207,r.DstColorFactor=208,r.OneMinusDstColorFactor=209,r.SrcAlphaSaturateFactor=210,r.MultiplyOperation=0,r.MixOperation=1,r.AddOperation=2,r.UVMapping=function(){},r.CubeReflectionMapping=function(){},r.CubeRefractionMapping=function(){},r.SphericalReflectionMapping=function(){},r.SphericalRefractionMapping=function(){},r.RepeatWrapping=1e3,r.ClampToEdgeWrapping=1001,r.MirroredRepeatWrapping=1002,r.NearestFilter=1003,r.NearestMipMapNearestFilter=1004,r.NearestMipMapLinearFilter=1005,r.LinearFilter=1006,r.LinearMipMapNearestFilter=1007,r.LinearMipMapLinearFilter=1008,r.UnsignedByteType=1009,r.ByteType=1010,r.ShortType=1011,r.UnsignedShortType=1012,r.IntType=1013,r.UnsignedIntType=1014,r.FloatType=1015,r.UnsignedShort4444Type=1016,r.UnsignedShort5551Type=1017,r.UnsignedShort565Type=1018,r.AlphaFormat=1019,r.RGBFormat=1020,r.RGBAFormat=1021,r.LuminanceFormat=1022,r.LuminanceAlphaFormat=1023,r.RGB_S3TC_DXT1_Format=2001,r.RGBA_S3TC_DXT1_Format=2002,r.RGBA_S3TC_DXT3_Format=2003,r.RGBA_S3TC_DXT5_Format=2004,r.RGB_PVRTC_4BPPV1_Format=2100,r.RGB_PVRTC_2BPPV1_Format=2101,r.RGBA_PVRTC_4BPPV1_Format=2102,r.RGBA_PVRTC_2BPPV1_Format=2103,r.RGB_ATC_Format=2200,r.RGBA_ATC_EXPLICIT_ALPHA_Format=2201,r.RGBA_ATC_INTERP_ALPHA_Format=2202,r.Color=function(e){return void 0!==e&&this.set(e),this},r.Color.prototype={constructor:r.Color,r:1,g:1,b:1,set:function(e){return e instanceof r.Color?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setHex:function(e){return e=Math.floor(e),this.r=(255&e>>16)/255,this.g=(255&e>>8)/255,this.b=(255&e)/255,this},setRGB:function(e,t,i){return this.r=e,this.g=t,this.b=i,this},setHSL:function(e,t,i){if(0===t)this.r=this.g=this.b=i;else{var r=function(e,t,i){return 0>i&&(i+=1),i>1&&(i-=1),1/6>i?e+6*(t-e)*i:.5>i?t:2/3>i?e+6*(t-e)*(2/3-i):e},n=.5>=i?i*(1+t):i+t-i*t,s=2*i-n;this.r=r(s,n,e+1/3),this.g=r(s,n,e),this.b=r(s,n,e-1/3)}return this},setStyle:function(e){if(/^rgb\((\d+),(\d+),(\d+)\)$/i.test(e)){var t=/^rgb\((\d+),(\d+),(\d+)\)$/i.exec(e);return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,this}if(/^rgb\((\d+)\%,(\d+)\%,(\d+)\%\)$/i.test(e)){var t=/^rgb\((\d+)\%,(\d+)\%,(\d+)\%\)$/i.exec(e);return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,this}if(/^\#([0-9a-f]{6})$/i.test(e)){var t=/^\#([0-9a-f]{6})$/i.exec(e);return this.setHex(parseInt(t[1],16)),this}if(/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.test(e)){var t=/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(e);return this.setHex(parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3],16)),this}return/^(\w+)$/i.test(e)?(this.setHex(r.ColorKeywords[e]),this):void 0},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e){return this.r=e.r*e.r,this.g=e.g*e.g,this.b=e.b*e.b,this},copyLinearToGamma:function(e){return this.r=Math.sqrt(e.r),this.g=Math.sqrt(e.g),this.b=Math.sqrt(e.b),this},convertGammaToLinear:function(){var e=this.r,t=this.g,i=this.b;return this.r=e*e,this.g=t*t,this.b=i*i,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(){var e={h:0,s:0,l:0};return function(){var t,i,r=this.r,n=this.g,s=this.b,o=Math.max(r,n,s),a=Math.min(r,n,s),l=(a+o)/2;if(a===o)t=0,i=0;else{var d=o-a;switch(i=.5>=l?d/(o+a):d/(2-o-a),o){case r:t=(n-s)/d+(s>n?6:0);break;case n:t=(s-r)/d+2;break;case s:t=(r-n)/d+4}t/=6}return e.h=t,e.s=i,e.l=l,e}}(),getStyle:function(){return"rgb("+(0|255*this.r)+","+(0|255*this.g)+","+(0|255*this.b)+")"},offsetHSL:function(e,t,i){var r=this.getHSL();return r.h+=e,r.s+=t,r.l+=i,this.setHSL(r.h,r.s,r.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},clone:function(){return(new r.Color).setRGB(this.r,this.g,this.b)}},r.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},r.Quaternion=function(e,t,i,r){this.x=e||0,this.y=t||0,this.z=i||0,this.w=void 0!==r?r:1},r.Quaternion.prototype={constructor:r.Quaternion,set:function(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},setFromEuler:function(e,t){var i=Math.cos(e.x/2),r=Math.cos(e.y/2),n=Math.cos(e.z/2),s=Math.sin(e.x/2),o=Math.sin(e.y/2),a=Math.sin(e.z/2);return void 0===t||"XYZ"===t?(this.x=s*r*n+i*o*a,this.y=i*o*n-s*r*a,this.z=i*r*a+s*o*n,this.w=i*r*n-s*o*a):"YXZ"===t?(this.x=s*r*n+i*o*a,this.y=i*o*n-s*r*a,this.z=i*r*a-s*o*n,this.w=i*r*n+s*o*a):"ZXY"===t?(this.x=s*r*n-i*o*a,this.y=i*o*n+s*r*a,this.z=i*r*a+s*o*n,this.w=i*r*n-s*o*a):"ZYX"===t?(this.x=s*r*n-i*o*a,this.y=i*o*n+s*r*a,this.z=i*r*a-s*o*n,this.w=i*r*n+s*o*a):"YZX"===t?(this.x=s*r*n+i*o*a,this.y=i*o*n+s*r*a,this.z=i*r*a-s*o*n,this.w=i*r*n-s*o*a):"XZY"===t&&(this.x=s*r*n-i*o*a,this.y=i*o*n-s*r*a,this.z=i*r*a+s*o*n,this.w=i*r*n+s*o*a),this},setFromAxisAngle:function(e,t){var i=t/2,r=Math.sin(i);return this.x=e.x*r,this.y=e.y*r,this.z=e.z*r,this.w=Math.cos(i),this},setFromRotationMatrix:function(e){var t,i=e.elements,r=i[0],n=i[4],s=i[8],o=i[1],a=i[5],l=i[9],d=i[2],c=i[6],h=i[10],u=r+a+h;return u>0?(t=.5/Math.sqrt(u+1),this.w=.25/t,this.x=(c-l)*t,this.y=(s-d)*t,this.z=(o-n)*t):r>a&&r>h?(t=2*Math.sqrt(1+r-a-h),this.w=(c-l)/t,this.x=.25*t,this.y=(n+o)/t,this.z=(s+d)/t):a>h?(t=2*Math.sqrt(1+a-r-h),this.w=(s-d)/t,this.x=(n+o)/t,this.y=.25*t,this.z=(l+c)/t):(t=2*Math.sqrt(1+h-r-a),this.w=(o-n)/t,this.x=(s+d)/t,this.y=(l+c)/t,this.z=.25*t),this},inverse:function(){return this.conjugate().normalize(),this},conjugate:function(){return this.x*=-1,this.y*=-1,this.z*=-1,this},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 e=this.length();return 0===e?(this.x=0,this.y=0,this.z=0,this.w=1):(e=1/e,this.x=this.x*e,this.y=this.y*e,this.z=this.z*e,this.w=this.w*e),this},multiply:function(e,t){return void 0!==t?(console.warn("DEPRECATED: Quaternion's .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},multiplyQuaternions:function(e,t){var i=e.x,r=e.y,n=e.z,s=e.w,o=t.x,a=t.y,l=t.z,d=t.w;return this.x=i*d+s*o+r*l-n*a,this.y=r*d+s*a+n*o-i*l,this.z=n*d+s*l+i*a-r*o,this.w=s*d-i*o-r*a-n*l,this},multiplyVector3:function(e){return console.warn("DEPRECATED: Quaternion's .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},slerp:function(e,t){var i=this.x,r=this.y,n=this.z,s=this.w,o=s*e.w+i*e.x+r*e.y+n*e.z;if(0>o?(this.w=-e.w,this.x=-e.x,this.y=-e.y,this.z=-e.z,o=-o):this.copy(e),o>=1)return this.w=s,this.x=i,this.y=r,this.z=n,this;var a=Math.acos(o),l=Math.sqrt(1-o*o);if(.001>Math.abs(l))return this.w=.5*(s+this.w),this.x=.5*(i+this.x),this.y=.5*(r+this.y),this.z=.5*(n+this.z),this;var d=Math.sin((1-t)*a)/l,c=Math.sin(t*a)/l;return this.w=s*d+this.w*c,this.x=i*d+this.x*c,this.y=r*d+this.y*c,this.z=n*d+this.z*c,this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e){return this.x=e[0],this.y=e[1],this.z=e[2],this.w=e[3],this},toArray:function(){return[this.x,this.y,this.z,this.w]},clone:function(){return new r.Quaternion(this.x,this.y,this.z,this.w)}},r.Quaternion.slerp=function(e,t,i,r){return i.copy(e).slerp(t,r)},r.Vector2=function(e,t){this.x=e||0,this.y=t||0},r.Vector2.prototype={constructor:r.Vector2,set:function(e,t){return this.x=e,this.y=t,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+e)}},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(console.warn("DEPRECATED: Vector2's .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScalar:function(e){return this.x+=e,this.y+=e,this},sub:function(e,t){return void 0!==t?(console.warn("DEPRECATED: Vector2's .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divideScalar:function(e){return 0!==e?(this.x/=e,this.y/=e):this.set(0,0),this},min:function(e){return this.x>e.x&&(this.x=e.x),this.y>e.y&&(this.y=e.y),this},max:function(e){return this.x<e.x&&(this.x=e.x),this.y<e.y&&(this.y=e.y),this},clamp:function(e,t){return this.x<e.x?this.x=e.x:this.x>t.x&&(this.x=t.x),this.y<e.y?this.y=e.y:this.y>t.y&&(this.y=t.y),this},negate:function(){return this.multiplyScalar(-1)},dot:function(e){return this.x*e.x+this.y*e.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())},angleTo:function(e){return Math.acos(this.dot(e)/this.length()/e.length())},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,i=this.y-e.y;return t*t+i*i},setLength:function(e){var t=this.length();return 0!==t&&e!==t&&this.multiplyScalar(e/t),this},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e){return this.x=e[0],this.y=e[1],this},toArray:function(){return[this.x,this.y]},clone:function(){return new r.Vector2(this.x,this.y)}},r.Vector3=function(e,t,i){this.x=e||0,this.y=t||0,this.z=i||0},r.Vector3.prototype={constructor:r.Vector3,set:function(e,t,i){return this.x=e,this.y=t,this.z=i,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+e)}},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("DEPRECATED: Vector3's .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},sub:function(e,t){return void 0!==t?(console.warn("DEPRECATED: Vector3's .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("DEPRECATED: Vector3's .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyMatrix3:function(e){var t=this.x,i=this.y,r=this.z,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6]*r,this.y=n[1]*t+n[4]*i+n[7]*r,this.z=n[2]*t+n[5]*i+n[8]*r,this},applyMatrix4:function(e){var t=this.x,i=this.y,r=this.z,n=e.elements;return this.x=n[0]*t+n[4]*i+n[8]*r+n[12],this.y=n[1]*t+n[5]*i+n[9]*r+n[13],this.z=n[2]*t+n[6]*i+n[10]*r+n[14],this},applyProjection:function(e){var t=this.x,i=this.y,r=this.z,n=e.elements,s=1/(n[3]*t+n[7]*i+n[11]*r+n[15]);return this.x=(n[0]*t+n[4]*i+n[8]*r+n[12])*s,this.y=(n[1]*t+n[5]*i+n[9]*r+n[13])*s,this.z=(n[2]*t+n[6]*i+n[10]*r+n[14])*s,this},applyQuaternion:function(e){var t=this.x,i=this.y,r=this.z,n=e.x,s=e.y,o=e.z,a=e.w,l=a*t+s*r-o*i,d=a*i+o*t-n*r,c=a*r+n*i-s*t,h=-n*t-s*i-o*r;return this.x=l*a+h*-n+d*-o-c*-s,this.y=d*a+h*-s+c*-n-l*-o,this.z=c*a+h*-o+l*-s-d*-n,this},transformDirection:function(e){var t=this.x,i=this.y,r=this.z,n=e.elements;return this.x=n[0]*t+n[4]*i+n[8]*r,this.y=n[1]*t+n[5]*i+n[9]*r,this.z=n[2]*t+n[6]*i+n[10]*r,this.normalize(),this},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return 0!==e?(this.x/=e,this.y/=e,this.z/=e):(this.x=0,this.y=0,this.z=0),this},min:function(e){return this.x>e.x&&(this.x=e.x),this.y>e.y&&(this.y=e.y),this.z>e.z&&(this.z=e.z),this},max:function(e){return this.x<e.x&&(this.x=e.x),this.y<e.y&&(this.y=e.y),this.z<e.z&&(this.z=e.z),this},clamp:function(e,t){return this.x<e.x?this.x=e.x:this.x>t.x&&(this.x=t.x),this.y<e.y?this.y=e.y:this.y>t.y&&(this.y=t.y),this.z<e.z?this.z=e.z:this.z>t.z&&(this.z=t.z),this},negate:function(){return this.multiplyScalar(-1)},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.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(e){var t=this.length();return 0!==t&&e!==t&&this.multiplyScalar(e/t),this},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},cross:function(e,t){if(void 0!==t)return console.warn("DEPRECATED: Vector3's .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t);var i=this.x,r=this.y,n=this.z;return this.x=r*e.z-n*e.y,this.y=n*e.x-i*e.z,this.z=i*e.y-r*e.x,this},crossVectors:function(e,t){return this.x=e.y*t.z-e.z*t.y,this.y=e.z*t.x-e.x*t.z,this.z=e.x*t.y-e.y*t.x,this},angleTo:function(e){var t=this.dot(e)/(this.length()*e.length());return Math.acos(r.Math.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r},setEulerFromRotationMatrix:function(e,t){function i(e){return Math.min(Math.max(e,-1),1)}var r=e.elements,n=r[0],s=r[4],o=r[8],a=r[1],l=r[5],d=r[9],c=r[2],h=r[6],u=r[10];return void 0===t||"XYZ"===t?(this.y=Math.asin(i(o)),.99999>Math.abs(o)?(this.x=Math.atan2(-d,u),this.z=Math.atan2(-s,n)):(this.x=Math.atan2(h,l),this.z=0)):"YXZ"===t?(this.x=Math.asin(-i(d)),.99999>Math.abs(d)?(this.y=Math.atan2(o,u),this.z=Math.atan2(a,l)):(this.y=Math.atan2(-c,n),this.z=0)):"ZXY"===t?(this.x=Math.asin(i(h)),.99999>Math.abs(h)?(this.y=Math.atan2(-c,u),this.z=Math.atan2(-s,l)):(this.y=0,this.z=Math.atan2(a,n))):"ZYX"===t?(this.y=Math.asin(-i(c)),.99999>Math.abs(c)?(this.x=Math.atan2(h,u),this.z=Math.atan2(a,n)):(this.x=0,this.z=Math.atan2(-s,l))):"YZX"===t?(this.z=Math.asin(i(a)),.99999>Math.abs(a)?(this.x=Math.atan2(-d,l),this.y=Math.atan2(-c,n)):(this.x=0,this.y=Math.atan2(o,u))):"XZY"===t&&(this.z=Math.asin(-i(s)),.99999>Math.abs(s)?(this.x=Math.atan2(h,l),this.y=Math.atan2(o,n)):(this.x=Math.atan2(-d,u),this.y=0)),this},setEulerFromQuaternion:function(e,t){function i(e){return Math.min(Math.max(e,-1),1)}var r=e.x*e.x,n=e.y*e.y,s=e.z*e.z,o=e.w*e.w;return void 0===t||"XYZ"===t?(this.x=Math.atan2(2*(e.x*e.w-e.y*e.z),o-r-n+s),this.y=Math.asin(i(2*(e.x*e.z+e.y*e.w))),this.z=Math.atan2(2*(e.z*e.w-e.x*e.y),o+r-n-s)):"YXZ"===t?(this.x=Math.asin(i(2*(e.x*e.w-e.y*e.z))),this.y=Math.atan2(2*(e.x*e.z+e.y*e.w),o-r-n+s),this.z=Math.atan2(2*(e.x*e.y+e.z*e.w),o-r+n-s)):"ZXY"===t?(this.x=Math.asin(i(2*(e.x*e.w+e.y*e.z))),this.y=Math.atan2(2*(e.y*e.w-e.z*e.x),o-r-n+s),this.z=Math.atan2(2*(e.z*e.w-e.x*e.y),o-r+n-s)):"ZYX"===t?(this.x=Math.atan2(2*(e.x*e.w+e.z*e.y),o-r-n+s),this.y=Math.asin(i(2*(e.y*e.w-e.x*e.z))),this.z=Math.atan2(2*(e.x*e.y+e.z*e.w),o+r-n-s)):"YZX"===t?(this.x=Math.atan2(2*(e.x*e.w-e.z*e.y),o-r+n-s),this.y=Math.atan2(2*(e.y*e.w-e.x*e.z),o+r-n-s),this.z=Math.asin(i(2*(e.x*e.y+e.z*e.w)))):"XZY"===t&&(this.x=Math.atan2(2*(e.x*e.w+e.y*e.z),o-r+n-s),this.y=Math.atan2(2*(e.x*e.z+e.y*e.w),o+r-n-s),this.z=Math.asin(i(2*(e.z*e.w-e.x*e.y)))),this},getPositionFromMatrix:function(e){return this.x=e.elements[12],this.y=e.elements[13],this.z=e.elements[14],this},getScaleFromMatrix:function(e){var t=this.set(e.elements[0],e.elements[1],e.elements[2]).length(),i=this.set(e.elements[4],e.elements[5],e.elements[6]).length(),r=this.set(e.elements[8],e.elements[9],e.elements[10]).length();return this.x=t,this.y=i,this.z=r,this},getColumnFromMatrix:function(e,t){var i=4*e,r=t.elements;return this.x=r[i],this.y=r[i+1],this.z=r[i+2],this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e){return this.x=e[0],this.y=e[1],this.z=e[2],this},toArray:function(){return[this.x,this.y,this.z]},clone:function(){return new r.Vector3(this.x,this.y,this.z)}},r.extend(r.Vector3.prototype,{applyEuler:function(){var e=new r.Quaternion;return function(t,i){var r=e.setFromEuler(t,i);return this.applyQuaternion(r),this}}(),applyAxisAngle:function(){var e=new r.Quaternion;return function(t,i){var r=e.setFromAxisAngle(t,i);return this.applyQuaternion(r),this}}(),projectOnVector:function(){var e=new r.Vector3;return function(t){e.copy(t).normalize();var i=this.dot(e);return this.copy(e).multiplyScalar(i)}}(),projectOnPlane:function(){var e=new r.Vector3;return function(t){return e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e=new r.Vector3;return function(t){return e.copy(this).projectOnVector(t).multiplyScalar(2),this.subVectors(e,this)}}()}),r.Vector4=function(e,t,i,r){this.x=e||0,this.y=t||0,this.z=i||0,this.w=void 0!==r?r:1},r.Vector4.prototype={constructor:r.Vector4,set:function(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+e)}},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(console.warn("DEPRECATED: Vector4's .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},sub:function(e,t){return void 0!==t?(console.warn("DEPRECATED: Vector4's .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,i=this.y,r=this.z,n=this.w,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r+s[12]*n,this.y=s[1]*t+s[5]*i+s[9]*r+s[13]*n,this.z=s[2]*t+s[6]*i+s[10]*r+s[14]*n,this.w=s[3]*t+s[7]*i+s[11]*r+s[15]*n,this},divideScalar:function(e){return 0!==e?(this.x/=e,this.y/=e,this.z/=e,this.w/=e):(this.x=0,this.y=0,this.z=0,this.w=1),this},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return 1e-4>t?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,i,r,n,s=.01,o=.1,a=e.elements,l=a[0],d=a[4],c=a[8],h=a[1],u=a[5],p=a[9],f=a[2],g=a[6],v=a[10];if(s>Math.abs(d-h)&&s>Math.abs(c-f)&&s>Math.abs(p-g)){if(o>Math.abs(d+h)&&o>Math.abs(c+f)&&o>Math.abs(p+g)&&o>Math.abs(l+u+v-3))return this.set(1,0,0,0),this;t=Math.PI;var m=(l+1)/2,y=(u+1)/2,w=(v+1)/2,x=(d+h)/4,b=(c+f)/4,E=(p+g)/4;return m>y&&m>w?s>m?(i=0,r=.707106781,n=.707106781):(i=Math.sqrt(m),r=x/i,n=b/i):y>w?s>y?(i=.707106781,r=0,n=.707106781):(r=Math.sqrt(y),i=x/r,n=E/r):s>w?(i=.707106781,r=.707106781,n=0):(n=Math.sqrt(w),i=b/n,r=E/n),this.set(i,r,n,t),this}var _=Math.sqrt((g-p)*(g-p)+(c-f)*(c-f)+(h-d)*(h-d));return.001>Math.abs(_)&&(_=1),this.x=(g-p)/_,this.y=(c-f)/_,this.z=(h-d)/_,this.w=Math.acos((l+u+v-1)/2),this},min:function(e){return this.x>e.x&&(this.x=e.x),this.y>e.y&&(this.y=e.y),this.z>e.z&&(this.z=e.z),this.w>e.w&&(this.w=e.w),this},max:function(e){return this.x<e.x&&(this.x=e.x),this.y<e.y&&(this.y=e.y),this.z<e.z&&(this.z=e.z),this.w<e.w&&(this.w=e.w),this},clamp:function(e,t){return this.x<e.x?this.x=e.x:this.x>t.x&&(this.x=t.x),this.y<e.y?this.y=e.y:this.y>t.y&&(this.y=t.y),this.z<e.z?this.z=e.z:this.z>t.z&&(this.z=t.z),this.w<e.w?this.w=e.w:this.w>t.w&&(this.w=t.w),this},negate:function(){return this.multiplyScalar(-1)},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.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(e){var t=this.length();return 0!==t&&e!==t&&this.multiplyScalar(e/t),this},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e){return this.x=e[0],this.y=e[1],this.z=e[2],this.w=e[3],this},toArray:function(){return[this.x,this.y,this.z,this.w]
},clone:function(){return new r.Vector4(this.x,this.y,this.z,this.w)}},r.Line3=function(e,t){this.start=void 0!==e?e:new r.Vector3,this.end=void 0!==t?t:new r.Vector3},r.Line3.prototype={constructor:r.Line3,set:function(e,t){return this.start.copy(e),this.end.copy(t),this},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},center:function(e){var t=e||new r.Vector3;return t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){var t=e||new r.Vector3;return t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){var i=t||new r.Vector3;return this.delta(i).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(){var e=new r.Vector3,t=new r.Vector3;return function(i,n){e.subVectors(i,this.start),t.subVectors(this.end,this.start);var s=t.dot(t),o=t.dot(e),a=o/s;return n&&(a=r.Math.clamp(a,0,1)),a}}(),closestPointToPoint:function(e,t,i){var n=this.closestPointToPointParameter(e,t),s=i||new r.Vector3;return this.delta(s).multiplyScalar(n).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)},clone:function(){return(new r.Line3).copy(this)}},r.Box2=function(e,t){this.min=void 0!==e?e:new r.Vector2(1/0,1/0),this.max=void 0!==t?t:new r.Vector2(-1/0,-1/0)},r.Box2.prototype={constructor:r.Box2,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){if(e.length>0){var t=e[0];this.min.copy(t),this.max.copy(t);for(var i=1,r=e.length;r>i;i++)t=e[i],t.x<this.min.x?this.min.x=t.x:t.x>this.max.x&&(this.max.x=t.x),t.y<this.min.y?this.min.y=t.y:t.y>this.max.y&&(this.max.y=t.y)}else this.makeEmpty();return this},setFromCenterAndSize:function(){var e=new r.Vector2;return function(t,i){var r=e.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}}(),copy:function(e){return this.min.copy(e.min),this.max.copy(e.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(e){var t=e||new r.Vector2;return t.addVectors(this.min,this.max).multiplyScalar(.5)},size:function(e){var t=e||new r.Vector2;return t.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y?!1:!0},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y?!0:!1},getParameter:function(e){return new r.Vector2((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox:function(e){return e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y?!1:!0},clampPoint:function(e,t){var i=t||new r.Vector2;return i.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new r.Vector2;return function(t){var i=e.copy(t).clamp(this.min,this.max);return i.sub(t).length()}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)},clone:function(){return(new r.Box2).copy(this)}},r.Box3=function(e,t){this.min=void 0!==e?e:new r.Vector3(1/0,1/0,1/0),this.max=void 0!==t?t:new r.Vector3(-1/0,-1/0,-1/0)},r.Box3.prototype={constructor:r.Box3,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){if(e.length>0){var t=e[0];this.min.copy(t),this.max.copy(t);for(var i=1,r=e.length;r>i;i++)t=e[i],t.x<this.min.x?this.min.x=t.x:t.x>this.max.x&&(this.max.x=t.x),t.y<this.min.y?this.min.y=t.y:t.y>this.max.y&&(this.max.y=t.y),t.z<this.min.z?this.min.z=t.z:t.z>this.max.z&&(this.max.z=t.z)}else this.makeEmpty();return this},setFromCenterAndSize:function(){var e=new r.Vector3;return function(t,i){var r=e.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}}(),setFromObject:function(){var e=new r.Vector3;return function(t){var i=this;return t.updateMatrixWorld(!0),this.makeEmpty(),t.traverse(function(t){if(void 0!==t.geometry&&void 0!==t.geometry.vertices)for(var r=t.geometry.vertices,n=0,s=r.length;s>n;n++)e.copy(r[n]),e.applyMatrix4(t.matrixWorld),i.expandByPoint(e)}),this}}(),copy:function(e){return this.min.copy(e.min),this.max.copy(e.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(e){var t=e||new r.Vector3;return t.addVectors(this.min,this.max).multiplyScalar(.5)},size:function(e){var t=e||new r.Vector3;return t.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z?!1:!0},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z?!0:!1},getParameter:function(e){return new r.Vector3((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(e){return e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z?!1:!0},clampPoint:function(e,t){var i=t||new r.Vector3;return i.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new r.Vector3;return function(t){var i=e.copy(t).clamp(this.min,this.max);return i.sub(t).length()}}(),getBoundingSphere:function(){var e=new r.Vector3;return function(t){var i=t||new r.Sphere;return i.center=this.center(),i.radius=.5*this.size(e).length(),i}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(){var e=[new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3];return function(t){return e[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),e[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),e[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),e[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),e[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),e[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),e[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),e[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.makeEmpty(),this.setFromPoints(e),this}}(),translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)},clone:function(){return(new r.Box3).copy(this)}},r.Matrix3=function(e,t,i,r,n,s,o,a,l){this.elements=new Float32Array(9),this.set(void 0!==e?e:1,t||0,i||0,r||0,void 0!==n?n:1,s||0,o||0,a||0,void 0!==l?l:1)},r.Matrix3.prototype={constructor:r.Matrix3,set:function(e,t,i,r,n,s,o,a,l){var d=this.elements;return d[0]=e,d[3]=t,d[6]=i,d[1]=r,d[4]=n,d[7]=s,d[2]=o,d[5]=a,d[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},copy:function(e){var t=e.elements;return this.set(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]),this},multiplyVector3:function(e){return console.warn("DEPRECATED: Matrix3's .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){var e=new r.Vector3;return function(t){for(var i=0,r=t.length;r>i;i+=3)e.x=t[i],e.y=t[i+1],e.z=t[i+2],e.applyMatrix3(this),t[i]=e.x,t[i+1]=e.y,t[i+2]=e.z;return t}}(),multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],i=e[1],r=e[2],n=e[3],s=e[4],o=e[5],a=e[6],l=e[7],d=e[8];return t*s*d-t*o*l-i*n*d+i*o*a+r*n*l-r*s*a},getInverse:function(e,t){var i=e.elements,r=this.elements;r[0]=i[10]*i[5]-i[6]*i[9],r[1]=-i[10]*i[1]+i[2]*i[9],r[2]=i[6]*i[1]-i[2]*i[5],r[3]=-i[10]*i[4]+i[6]*i[8],r[4]=i[10]*i[0]-i[2]*i[8],r[5]=-i[6]*i[0]+i[2]*i[4],r[6]=i[9]*i[4]-i[5]*i[8],r[7]=-i[9]*i[0]+i[1]*i[8],r[8]=i[5]*i[0]-i[1]*i[4];var n=i[0]*r[0]+i[1]*r[3]+i[2]*r[6];if(0===n){var s="Matrix3.getInverse(): can't invert matrix, determinant is 0";if(t)throw Error(s);return console.warn(s),this.identity(),this}return this.multiplyScalar(1/n),this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},getNormalMatrix:function(e){return this.getInverse(e).transpose(),this},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},clone:function(){var e=this.elements;return new r.Matrix3(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])}},r.Matrix4=function(e,t,i,r,n,s,o,a,l,d,c,h,u,p,f,g){var v=this.elements=new Float32Array(16);v[0]=void 0!==e?e:1,v[4]=t||0,v[8]=i||0,v[12]=r||0,v[1]=n||0,v[5]=void 0!==s?s:1,v[9]=o||0,v[13]=a||0,v[2]=l||0,v[6]=d||0,v[10]=void 0!==c?c:1,v[14]=h||0,v[3]=u||0,v[7]=p||0,v[11]=f||0,v[15]=void 0!==g?g:1},r.Matrix4.prototype={constructor:r.Matrix4,set:function(e,t,i,r,n,s,o,a,l,d,c,h,u,p,f,g){var v=this.elements;return v[0]=e,v[4]=t,v[8]=i,v[12]=r,v[1]=n,v[5]=s,v[9]=o,v[13]=a,v[2]=l,v[6]=d,v[10]=c,v[14]=h,v[3]=u,v[7]=p,v[11]=f,v[15]=g,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(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15]),this},extractPosition:function(e){return console.warn("DEPRECATED: Matrix4's .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},copyPosition:function(e){var t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this},extractRotation:function(){var e=new r.Vector3;return function(t){var i=this.elements,r=t.elements,n=1/e.set(r[0],r[1],r[2]).length(),s=1/e.set(r[4],r[5],r[6]).length(),o=1/e.set(r[8],r[9],r[10]).length();return i[0]=r[0]*n,i[1]=r[1]*n,i[2]=r[2]*n,i[4]=r[4]*s,i[5]=r[5]*s,i[6]=r[6]*s,i[8]=r[8]*o,i[9]=r[9]*o,i[10]=r[10]*o,this}}(),setRotationFromEuler:function(e,t){return console.warn("DEPRECATED: Matrix4's .setRotationFromEuler() has been deprecated in favor of makeRotationFromEuler. Please update your code."),this.makeRotationFromEuler(e,t)},makeRotationFromEuler:function(e,t){var i=this.elements,r=e.x,n=e.y,s=e.z,o=Math.cos(r),a=Math.sin(r),l=Math.cos(n),d=Math.sin(n),c=Math.cos(s),h=Math.sin(s);if(void 0===t||"XYZ"===t){var u=o*c,p=o*h,f=a*c,g=a*h;i[0]=l*c,i[4]=-l*h,i[8]=d,i[1]=p+f*d,i[5]=u-g*d,i[9]=-a*l,i[2]=g-u*d,i[6]=f+p*d,i[10]=o*l}else if("YXZ"===t){var v=l*c,m=l*h,y=d*c,w=d*h;i[0]=v+w*a,i[4]=y*a-m,i[8]=o*d,i[1]=o*h,i[5]=o*c,i[9]=-a,i[2]=m*a-y,i[6]=w+v*a,i[10]=o*l}else if("ZXY"===t){var v=l*c,m=l*h,y=d*c,w=d*h;i[0]=v-w*a,i[4]=-o*h,i[8]=y+m*a,i[1]=m+y*a,i[5]=o*c,i[9]=w-v*a,i[2]=-o*d,i[6]=a,i[10]=o*l}else if("ZYX"===t){var u=o*c,p=o*h,f=a*c,g=a*h;i[0]=l*c,i[4]=f*d-p,i[8]=u*d+g,i[1]=l*h,i[5]=g*d+u,i[9]=p*d-f,i[2]=-d,i[6]=a*l,i[10]=o*l}else if("YZX"===t){var x=o*l,b=o*d,E=a*l,_=a*d;i[0]=l*c,i[4]=_-x*h,i[8]=E*h+b,i[1]=h,i[5]=o*c,i[9]=-a*c,i[2]=-d*c,i[6]=b*h+E,i[10]=x-_*h}else if("XZY"===t){var x=o*l,b=o*d,E=a*l,_=a*d;i[0]=l*c,i[4]=-h,i[8]=d*c,i[1]=x*h+_,i[5]=o*c,i[9]=b*h-E,i[2]=E*h-b,i[6]=a*c,i[10]=_*h+x}return i[3]=0,i[7]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this},setRotationFromQuaternion:function(e){return console.warn("DEPRECATED: Matrix4's .setRotationFromQuaternion() has been deprecated in favor of makeRotationFromQuaternion. Please update your code."),this.makeRotationFromQuaternion(e)},makeRotationFromQuaternion:function(e){var t=this.elements,i=e.x,r=e.y,n=e.z,s=e.w,o=i+i,a=r+r,l=n+n,d=i*o,c=i*a,h=i*l,u=r*a,p=r*l,f=n*l,g=s*o,v=s*a,m=s*l;return t[0]=1-(u+f),t[4]=c-m,t[8]=h+v,t[1]=c+m,t[5]=1-(d+f),t[9]=p-g,t[2]=h-v,t[6]=p+g,t[10]=1-(d+u),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},lookAt:function(){var e=new r.Vector3,t=new r.Vector3,i=new r.Vector3;return function(r,n,s){var o=this.elements;return i.subVectors(r,n).normalize(),0===i.length()&&(i.z=1),e.crossVectors(s,i).normalize(),0===e.length()&&(i.x+=1e-4,e.crossVectors(s,i).normalize()),t.crossVectors(i,e),o[0]=e.x,o[4]=t.x,o[8]=i.x,o[1]=e.y,o[5]=t.y,o[9]=i.y,o[2]=e.z,o[6]=t.z,o[10]=i.z,this}}(),multiply:function(e,t){return void 0!==t?(console.warn("DEPRECATED: Matrix4's .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},multiplyMatrices:function(e,t){var i=e.elements,r=t.elements,n=this.elements,s=i[0],o=i[4],a=i[8],l=i[12],d=i[1],c=i[5],h=i[9],u=i[13],p=i[2],f=i[6],g=i[10],v=i[14],m=i[3],y=i[7],w=i[11],x=i[15],b=r[0],E=r[4],_=r[8],T=r[12],C=r[1],M=r[5],S=r[9],A=r[13],R=r[2],U=r[6],D=r[10],P=r[14],j=r[3],B=r[7],H=r[11],k=r[15];return n[0]=s*b+o*C+a*R+l*j,n[4]=s*E+o*M+a*U+l*B,n[8]=s*_+o*S+a*D+l*H,n[12]=s*T+o*A+a*P+l*k,n[1]=d*b+c*C+h*R+u*j,n[5]=d*E+c*M+h*U+u*B,n[9]=d*_+c*S+h*D+u*H,n[13]=d*T+c*A+h*P+u*k,n[2]=p*b+f*C+g*R+v*j,n[6]=p*E+f*M+g*U+v*B,n[10]=p*_+f*S+g*D+v*H,n[14]=p*T+f*A+g*P+v*k,n[3]=m*b+y*C+w*R+x*j,n[7]=m*E+y*M+w*U+x*B,n[11]=m*_+y*S+w*D+x*H,n[15]=m*T+y*A+w*P+x*k,this},multiplyToArray:function(e,t,i){var r=this.elements;return this.multiplyMatrices(e,t),i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[8]=r[8],i[9]=r[9],i[10]=r[10],i[11]=r[11],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15],this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},multiplyVector3:function(e){return console.warn("DEPRECATED: Matrix4's .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),e.applyProjection(this)},multiplyVector4:function(e){return console.warn("DEPRECATED: Matrix4's .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){var e=new r.Vector3;return function(t){for(var i=0,r=t.length;r>i;i+=3)e.x=t[i],e.y=t[i+1],e.z=t[i+2],e.applyProjection(this),t[i]=e.x,t[i+1]=e.y,t[i+2]=e.z;return t}}(),rotateAxis:function(e){console.warn("DEPRECATED: Matrix4's .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("DEPRECATED: Matrix4's .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},determinant:function(){var e=this.elements,t=e[0],i=e[4],r=e[8],n=e[12],s=e[1],o=e[5],a=e[9],l=e[13],d=e[2],c=e[6],h=e[10],u=e[14],p=e[3],f=e[7],g=e[11],v=e[15];return p*(+n*a*c-r*l*c-n*o*h+i*l*h+r*o*u-i*a*u)+f*(+t*a*u-t*l*h+n*s*h-r*s*u+r*l*d-n*a*d)+g*(+t*l*c-t*o*u-n*s*c+i*s*u+n*o*d-i*l*d)+v*(-r*o*d-t*a*c+t*o*h+r*s*c-i*s*h+i*a*d)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},flattenToArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},flattenToArrayOffset:function(e,t){var i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e},getPosition:function(){var e=new r.Vector3;return function(){console.warn("DEPRECATED: Matrix4's .getPosition() has been removed. Use Vector3.getPositionFromMatrix( matrix ) instead.");var t=this.elements;return e.set(t[12],t[13],t[14])}}(),setPosition:function(e){var t=this.elements;return t[12]=e.x,t[13]=e.y,t[14]=e.z,this},getInverse:function(e,t){var i=this.elements,r=e.elements,n=r[0],s=r[4],o=r[8],a=r[12],l=r[1],d=r[5],c=r[9],h=r[13],u=r[2],p=r[6],f=r[10],g=r[14],v=r[3],m=r[7],y=r[11],w=r[15];i[0]=c*g*m-h*f*m+h*p*y-d*g*y-c*p*w+d*f*w,i[4]=a*f*m-o*g*m-a*p*y+s*g*y+o*p*w-s*f*w,i[8]=o*h*m-a*c*m+a*d*y-s*h*y-o*d*w+s*c*w,i[12]=a*c*p-o*h*p-a*d*f+s*h*f+o*d*g-s*c*g,i[1]=h*f*v-c*g*v-h*u*y+l*g*y+c*u*w-l*f*w,i[5]=o*g*v-a*f*v+a*u*y-n*g*y-o*u*w+n*f*w,i[9]=a*c*v-o*h*v-a*l*y+n*h*y+o*l*w-n*c*w,i[13]=o*h*u-a*c*u+a*l*f-n*h*f-o*l*g+n*c*g,i[2]=d*g*v-h*p*v+h*u*m-l*g*m-d*u*w+l*p*w,i[6]=a*p*v-s*g*v-a*u*m+n*g*m+s*u*w-n*p*w,i[10]=s*h*v-a*d*v+a*l*m-n*h*m-s*l*w+n*d*w,i[14]=a*d*u-s*h*u-a*l*p+n*h*p+s*l*g-n*d*g,i[3]=c*p*v-d*f*v-c*u*m+l*f*m+d*u*y-l*p*y,i[7]=s*f*v-o*p*v+o*u*m-n*f*m-s*u*y+n*p*y,i[11]=o*d*v-s*c*v-o*l*m+n*c*m+s*l*y-n*d*y,i[15]=s*c*u-o*d*u+o*l*p-n*c*p-s*l*f+n*d*f;var x=n*i[0]+l*i[4]+u*i[8]+v*i[12];if(0==x){var b="Matrix4.getInverse(): can't invert matrix, determinant is 0";if(t)throw Error(b);return console.warn(b),this.identity(),this}return this.multiplyScalar(1/x),this},translate:function(){console.warn("DEPRECATED: Matrix4's .translate() has been removed.")},rotateX:function(){console.warn("DEPRECATED: Matrix4's .rotateX() has been removed.")},rotateY:function(){console.warn("DEPRECATED: Matrix4's .rotateY() has been removed.")},rotateZ:function(){console.warn("DEPRECATED: Matrix4's .rotateZ() has been removed.")},rotateByAxis:function(){console.warn("DEPRECATED: Matrix4's .rotateByAxis() has been removed.")},scale:function(e){var t=this.elements,i=e.x,r=e.y,n=e.z;return t[0]*=i,t[4]*=r,t[8]*=n,t[1]*=i,t[5]*=r,t[9]*=n,t[2]*=i,t[6]*=r,t[10]*=n,t[3]*=i,t[7]*=r,t[11]*=n,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,Math.max(i,r)))},makeTranslation:function(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var i=Math.cos(t),r=Math.sin(t),n=1-i,s=e.x,o=e.y,a=e.z,l=n*s,d=n*o;return this.set(l*s+i,l*o-r*a,l*a+r*o,0,l*o+r*a,d*o+i,d*a-r*s,0,l*a-r*o,d*a+r*s,n*a*a+i,0,0,0,0,1),this},makeScale:function(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this},compose:function(e,t,i){return console.warn("DEPRECATED: Matrix4's .compose() has been deprecated in favor of makeFromPositionQuaternionScale. Please update your code."),this.makeFromPositionQuaternionScale(e,t,i)},makeFromPositionQuaternionScale:function(e,t,i){return this.makeRotationFromQuaternion(t),this.scale(i),this.setPosition(e),this},makeFromPositionEulerScale:function(e,t,i,r){return this.makeRotationFromEuler(t,i),this.scale(r),this.setPosition(e),this},makeFrustum:function(e,t,i,r,n,s){var o=this.elements,a=2*n/(t-e),l=2*n/(r-i),d=(t+e)/(t-e),c=(r+i)/(r-i),h=-(s+n)/(s-n),u=-2*s*n/(s-n);return o[0]=a,o[4]=0,o[8]=d,o[12]=0,o[1]=0,o[5]=l,o[9]=c,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=u,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makePerspective:function(e,t,i,n){var s=i*Math.tan(r.Math.degToRad(.5*e)),o=-s,a=o*t,l=s*t;return this.makeFrustum(a,l,o,s,i,n)},makeOrthographic:function(e,t,i,r,n,s){var o=this.elements,a=t-e,l=i-r,d=s-n,c=(t+e)/a,h=(i+r)/l,u=(s+n)/d;return o[0]=2/a,o[4]=0,o[8]=0,o[12]=-c,o[1]=0,o[5]=2/l,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=-2/d,o[14]=-u,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},clone:function(){var e=this.elements;return new r.Matrix4(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])}},r.extend(r.Matrix4.prototype,{decompose:function(){var e=new r.Vector3,t=new r.Vector3,i=new r.Vector3,n=new r.Matrix4;return function(s,o,a){var l=this.elements;return e.set(l[0],l[1],l[2]),t.set(l[4],l[5],l[6]),i.set(l[8],l[9],l[10]),s=s instanceof r.Vector3?s:new r.Vector3,o=o instanceof r.Quaternion?o:new r.Quaternion,a=a instanceof r.Vector3?a:new r.Vector3,a.x=e.length(),a.y=t.length(),a.z=i.length(),s.x=l[12],s.y=l[13],s.z=l[14],n.copy(this),n.elements[0]/=a.x,n.elements[1]/=a.x,n.elements[2]/=a.x,n.elements[4]/=a.y,n.elements[5]/=a.y,n.elements[6]/=a.y,n.elements[8]/=a.z,n.elements[9]/=a.z,n.elements[10]/=a.z,o.setFromRotationMatrix(n),[s,o,a]}}()}),r.Ray=function(e,t){this.origin=void 0!==e?e:new r.Vector3,this.direction=void 0!==t?t:new r.Vector3},r.Ray.prototype={constructor:r.Ray,set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){var i=t||new r.Vector3;return i.copy(this.direction).multiplyScalar(e).add(this.origin)},recast:function(){var e=new r.Vector3;return function(t){return this.origin.copy(this.at(t,e)),this}}(),closestPointToPoint:function(e,t){var i=t||new r.Vector3;i.subVectors(e,this.origin);var n=i.dot(this.direction);return i.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(){var e=new r.Vector3;return function(t){var i=e.subVectors(t,this.origin).dot(this.direction);return e.copy(this.direction).multiplyScalar(i).add(this.origin),e.distanceTo(t)}}(),isIntersectionSphere:function(e){return this.distanceToPoint(e.center)<=e.radius},isIntersectionPlane:function(e){var t=e.normal.dot(this.direction);return 0!=t?!0:0==e.distanceToPoint(this.origin)?!0:!1},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0==t)return 0==e.distanceToPoint(this.origin)?0:void 0;var i=-(this.origin.dot(e.normal)+e.constant)/t;return i},intersectPlane:function(e,t){var i=this.distanceToPlane(e);return void 0===i?void 0:this.at(i,t)},applyMatrix4:function(e){return this.direction.add(this.origin).applyMatrix4(e),this.origin.applyMatrix4(e),this.direction.sub(this.origin),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)},clone:function(){return(new r.Ray).copy(this)}},r.Sphere=function(e,t){this.center=void 0!==e?e:new r.Vector3,this.radius=void 0!==t?t:0},r.Sphere.prototype={constructor:r.Sphere,set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(e){for(var t,i=0,r=0,n=e.length;n>r;r++)t=e[r].lengthSq(),i=Math.max(i,t);return this.center.set(0,0,0),this.radius=Math.sqrt(i),this},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return 0>=this.radius},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return t*t>=e.center.distanceToSquared(this.center)},clampPoint:function(e,t){var i=this.center.distanceToSquared(e),n=t||new r.Vector3;return n.copy(e),i>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n},getBoundingBox:function(e){var t=e||new r.Box3;return t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius},clone:function(){return(new r.Sphere).copy(this)}},r.Frustum=function(e,t,i,n,s,o){this.planes=[void 0!==e?e:new r.Plane,void 0!==t?t:new r.Plane,void 0!==i?i:new r.Plane,void 0!==n?n:new r.Plane,void 0!==s?s:new r.Plane,void 0!==o?o:new r.Plane]},r.Frustum.prototype={constructor:r.Frustum,set:function(e,t,i,r,n,s){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(i),o[3].copy(r),o[4].copy(n),o[5].copy(s),this},copy:function(e){for(var t=this.planes,i=0;6>i;i++)t[i].copy(e.planes[i]);return this},setFromMatrix:function(e){var t=this.planes,i=e.elements,r=i[0],n=i[1],s=i[2],o=i[3],a=i[4],l=i[5],d=i[6],c=i[7],h=i[8],u=i[9],p=i[10],f=i[11],g=i[12],v=i[13],m=i[14],y=i[15];return t[0].setComponents(o-r,c-a,f-h,y-g).normalize(),t[1].setComponents(o+r,c+a,f+h,y+g).normalize(),t[2].setComponents(o+n,c+l,f+u,y+v).normalize(),t[3].setComponents(o-n,c-l,f-u,y-v).normalize(),t[4].setComponents(o-s,c-d,f-p,y-m).normalize(),t[5].setComponents(o+s,c+d,f+p,y+m).normalize(),this},intersectsObject:function(){var e=new r.Vector3;return function(t){var i=t.matrixWorld,r=this.planes,n=-t.geometry.boundingSphere.radius*i.getMaxScaleOnAxis();e.getPositionFromMatrix(i);for(var s=0;6>s;s++){var o=r[s].distanceToPoint(e);if(n>o)return!1}return!0}}(),intersectsSphere:function(e){for(var t=this.planes,i=e.center,r=-e.radius,n=0;6>n;n++){var s=t[n].distanceToPoint(i);if(r>s)return!1}return!0},containsPoint:function(e){for(var t=this.planes,i=0;6>i;i++)if(0>t[i].distanceToPoint(e))return!1;return!0},clone:function(){return(new r.Frustum).copy(this)}},r.Plane=function(e,t){this.normal=void 0!==e?e:new r.Vector3(1,0,0),this.constant=void 0!==t?t:0},r.Plane.prototype={constructor:r.Plane,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var e=new r.Vector3,t=new r.Vector3;return function(i,r,n){var s=e.subVectors(n,r).cross(t.subVectors(i,r)).normalize();return this.setFromNormalAndCoplanarPoint(s,i),this}}(),copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return this.orthoPoint(e,t).sub(e).negate()},orthoPoint:function(e,t){var i=this.distanceToPoint(e),n=t||new r.Vector3;return n.copy(this.normal).multiplyScalar(i)},isIntersectionLine:function(e){var t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return 0>t&&i>0||0>i&&t>0},intersectLine:function(){var e=new r.Vector3;return function(t,i){var n=i||new r.Vector3,s=t.delta(e),o=this.normal.dot(s);if(0==o)return 0==this.distanceToPoint(t.start)?n.copy(t.start):void 0;var a=-(t.start.dot(this.normal)+this.constant)/o;return 0>a||a>1?void 0:n.copy(s).multiplyScalar(a).add(t.start)}}(),coplanarPoint:function(e){var t=e||new r.Vector3;return t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var e=new r.Vector3,t=new r.Vector3;return function(i,n){n=n||(new r.Matrix3).getNormalMatrix(i);var s=e.copy(this.normal).applyMatrix3(n),o=this.coplanarPoint(t);return o.applyMatrix4(i),this.setFromNormalAndCoplanarPoint(s,o),this}}(),translate:function(e){return this.constant=this.constant-e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant==this.constant},clone:function(){return(new r.Plane).copy(this)}},r.Math={generateUUID:function(){var e,t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),i=Array(36),r=0;return function(){for(var n=0;36>n;n++)8==n||13==n||18==n||23==n?i[n]="-":14==n?i[n]="4":(2>=r&&(r=0|33554432+16777216*Math.random()),e=15&r,r>>=4,i[n]=t[19==n?8|3&e:e]);return i.join("")}}(),clamp:function(e,t,i){return t>e?t:e>i?i:e},clampBottom:function(e,t){return t>e?t:e},mapLinear:function(e,t,i,r,n){return r+(e-t)*(n-r)/(i-t)},smoothstep:function(e,t,i){return t>=e?0:e>=i?1:(e=(e-t)/(i-t),e*e*(3-2*e))},smootherstep:function(e,t,i){return t>=e?0:e>=i?1:(e=(e-t)/(i-t),e*e*e*(e*(6*e-15)+10))},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},sign:function(e){return 0>e?-1:e>0?1:0},degToRad:function(){var e=Math.PI/180;return function(t){return t*e}}(),radToDeg:function(){var e=180/Math.PI;return function(t){return t*e}}()},r.Spline=function(e){function t(e,t,i,r,n,s,o){var a=.5*(i-e),l=.5*(r-t);return(2*(t-i)+a+l)*o+(-3*(t-i)-2*a-l)*s+a*n+t}this.points=e;var i,n,s,o,a,l,d,c,h,u=[],p={x:0,y:0,z:0};this.initFromArray=function(e){this.points=[];for(var t=0;e.length>t;t++)this.points[t]={x:e[t][0],y:e[t][1],z:e[t][2]}},this.getPoint=function(e){return i=(this.points.length-1)*e,n=Math.floor(i),s=i-n,u[0]=0===n?n:n-1,u[1]=n,u[2]=n>this.points.length-2?this.points.length-1:n+1,u[3]=n>this.points.length-3?this.points.length-1:n+2,l=this.points[u[0]],d=this.points[u[1]],c=this.points[u[2]],h=this.points[u[3]],o=s*s,a=s*o,p.x=t(l.x,d.x,c.x,h.x,s,o,a),p.y=t(l.y,d.y,c.y,h.y,s,o,a),p.z=t(l.z,d.z,c.z,h.z,s,o,a),p},this.getControlPointsArray=function(){var e,t,i=this.points.length,r=[];for(e=0;i>e;e++)t=this.points[e],r[e]=[t.x,t.y,t.z];return r},this.getLength=function(e){var t,i,n,s,o=0,a=0,l=0,d=new r.Vector3,c=new r.Vector3,h=[],u=0;for(h[0]=0,e||(e=100),n=this.points.length*e,d.copy(this.points[0]),t=1;n>t;t++)i=t/n,s=this.getPoint(i),c.copy(s),u+=c.distanceTo(d),d.copy(s),o=(this.points.length-1)*i,a=Math.floor(o),a!=l&&(h[a]=u,l=a);return h[h.length]=u,{chunks:h,total:u}},this.reparametrizeByArcLength=function(e){var t,i,n,s,o,a,l,d,c=[],h=new r.Vector3,u=this.getLength();for(c.push(h.copy(this.points[0]).clone()),t=1;this.points.length>t;t++){for(a=u.chunks[t]-u.chunks[t-1],l=Math.ceil(e*a/u.total),s=(t-1)/(this.points.length-1),o=t/(this.points.length-1),i=1;l-1>i;i++)n=s+i*(1/l)*(o-s),d=this.getPoint(n),c.push(h.copy(d).clone());c.push(h.copy(this.points[t]).clone())}this.points=c}},r.Triangle=function(e,t,i){this.a=void 0!==e?e:new r.Vector3,this.b=void 0!==t?t:new r.Vector3,this.c=void 0!==i?i:new r.Vector3},r.Triangle.normal=function(){var e=new r.Vector3;return function(t,i,n,s){var o=s||new r.Vector3;o.subVectors(n,i),e.subVectors(t,i),o.cross(e);var a=o.lengthSq();return a>0?o.multiplyScalar(1/Math.sqrt(a)):o.set(0,0,0)}}(),r.Triangle.barycoordFromPoint=function(){var e=new r.Vector3,t=new r.Vector3,i=new r.Vector3;return function(n,s,o,a,l){e.subVectors(a,s),t.subVectors(o,s),i.subVectors(n,s);var d=e.dot(e),c=e.dot(t),h=e.dot(i),u=t.dot(t),p=t.dot(i),f=d*u-c*c,g=l||new r.Vector3;if(0==f)return g.set(-2,-1,-1);var v=1/f,m=(u*h-c*p)*v,y=(d*p-c*h)*v;return g.set(1-m-y,y,m)}}(),r.Triangle.containsPoint=function(){var e=new r.Vector3;return function(t,i,n,s){var o=r.Triangle.barycoordFromPoint(t,i,n,s,e);return o.x>=0&&o.y>=0&&1>=o.x+o.y}}(),r.Triangle.prototype={constructor:r.Triangle,set:function(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this},setFromPointsAndIndices:function(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},area:function(){var e=new r.Vector3,t=new r.Vector3;return function(){return e.subVectors(this.c,this.b),t.subVectors(this.a,this.b),.5*e.cross(t).length()
}}(),midpoint:function(e){var t=e||new r.Vector3;return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(e){return r.Triangle.normal(this.a,this.b,this.c,e)},plane:function(e){var t=e||new r.Plane;return t.setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(e,t){return r.Triangle.barycoordFromPoint(e,this.a,this.b,this.c,t)},containsPoint:function(e){return r.Triangle.containsPoint(e,this.a,this.b,this.c)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)},clone:function(){return(new r.Triangle).copy(this)}},r.Vertex=function(e){return console.warn("THREE.Vertex has been DEPRECATED. Use THREE.Vector3 instead."),e},r.UV=function(e,t){return console.warn("THREE.UV has been DEPRECATED. Use THREE.Vector2 instead."),new r.Vector2(e,t)},r.Clock=function(e){this.autoStart=void 0!==e?e:!0,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1},r.Clock.prototype={constructor:r.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 e=0;if(this.autoStart&&!this.running&&this.start(),this.running){var t=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now();e=.001*(t-this.oldTime),this.oldTime=t,this.elapsedTime+=e}return e}},r.EventDispatcher=function(){},r.EventDispatcher.prototype={constructor:r.EventDispatcher,addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(t)?!0:!1},removeEventListener:function(e,t){if(void 0!==this._listeners){var i=this._listeners,r=i[e].indexOf(t);-1!==r&&i[e].splice(r,1)}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners,i=t[e.type];if(void 0!==i){e.target=this;for(var r=0,n=i.length;n>r;r++)i[r].call(this,e)}}}},function(e){e.Raycaster=function(t,i,r,n){this.ray=new e.Ray(t,i),this.ray.direction.lengthSq()>0&&this.ray.direction.normalize(),this.near=r||0,this.far=n||1/0};var t=new e.Sphere,i=new e.Ray,r=new e.Plane,n=new e.Vector3,s=new e.Vector3,o=new e.Matrix4,a=function(e,t){return e.distance-t.distance},l=function(a,d,c){if(a instanceof e.Particle){s.getPositionFromMatrix(a.matrixWorld);var h=d.ray.distanceToPoint(s);if(h>a.scale.x)return c;c.push({distance:h,point:a.position,face:null,object:a})}else if(a instanceof e.LOD){s.getPositionFromMatrix(a.matrixWorld);var h=d.ray.origin.distanceTo(s);l(a.getObjectForDistance(h),d,c)}else if(a instanceof e.Mesh){if(s.getPositionFromMatrix(a.matrixWorld),t.set(s,a.geometry.boundingSphere.radius*a.matrixWorld.getMaxScaleOnAxis()),d.ray.isIntersectionSphere(t)===!1)return c;var u=a.geometry,p=u.vertices;if(u instanceof e.BufferGeometry){var f=a.material;if(void 0===f)return c;if(!u.dynamic)return c;var g,v,m,y=a.material instanceof e.MeshFaceMaterial,w=y===!0?a.material.materials:null,x=a.material.side,b=d.precision;o.getInverse(a.matrixWorld),i.copy(d.ray).applyMatrix4(o);var E,_=!1;u.attributes.index?(_=!0,E=u.attributes.index.numItems/3):E=u.attributes.position.numItems/9;var T=new e.Vector3,C=new e.Vector3,M=new e.Vector3;new e.Vector3,new e.Vector3;for(var S=0;u.offsets.length>S;++S)for(var A=u.offsets[S].start,R=u.offsets[S].count,U=u.offsets[S].index,D=A,P=A+R;P>D;D+=3){_?(g=U+u.attributes.index.array[D],v=U+u.attributes.index.array[D+1],m=U+u.attributes.index.array[D+2]):(g=U,v=U+1,m=U+2),T.set(u.attributes.position.array[3*g],u.attributes.position.array[3*g+1],u.attributes.position.array[3*g+2]),C.set(u.attributes.position.array[3*v],u.attributes.position.array[3*v+1],u.attributes.position.array[3*v+2]),M.set(u.attributes.position.array[3*m],u.attributes.position.array[3*m+1],u.attributes.position.array[3*m+2]),r.setFromCoplanarPoints(T,C,M);var j=i.distanceToPlane(r);if(!(b>Math.abs(j)||0>j)){if(x=f.side,x!==e.DoubleSide){var B=i.direction.dot(r.normal);if(!(x===e.FrontSide?0>B:B>0))continue}d.near>j||j>d.far||(n=i.at(j,n),e.Triangle.containsPoint(n,T,C,M)&&c.push({distance:j,point:d.ray.at(j),face:null,faceIndex:null,object:a}))}}}else if(u instanceof e.Geometry){var g,v,m,H,y=a.material instanceof e.MeshFaceMaterial,w=y===!0?a.material.materials:null,x=a.material.side,b=d.precision;o.getInverse(a.matrixWorld),i.copy(d.ray).applyMatrix4(o);for(var k=0,E=u.faces.length;E>k;k++){var L=u.faces[k],f=y===!0?w[L.materialIndex]:a.material;if(void 0!==f){r.setFromNormalAndCoplanarPoint(L.normal,p[L.a]);var j=i.distanceToPlane(r);if(!(b>Math.abs(j)||0>j)){if(x=f.side,x!==e.DoubleSide){var B=i.direction.dot(r.normal);if(!(x===e.FrontSide?0>B:B>0))continue}if(!(d.near>j||j>d.far)){if(n=i.at(j,n),L instanceof e.Face3){if(g=p[L.a],v=p[L.b],m=p[L.c],!e.Triangle.containsPoint(n,g,v,m))continue}else{if(!(L instanceof e.Face4))throw Error("face type not supported");if(g=p[L.a],v=p[L.b],m=p[L.c],H=p[L.d],!e.Triangle.containsPoint(n,g,v,H)&&!e.Triangle.containsPoint(n,v,m,H))continue}c.push({distance:j,point:d.ray.at(j),face:L,faceIndex:k,object:a})}}}}}}},d=function(e,t,i){for(var r=e.getDescendants(),n=0,s=r.length;s>n;n++)l(r[n],t,i)};e.Raycaster.prototype.precision=1e-4,e.Raycaster.prototype.set=function(e,t){this.ray.set(e,t),this.ray.direction.length()>0&&this.ray.direction.normalize()},e.Raycaster.prototype.intersectObject=function(e,t){var i=[];return t===!0&&d(e,this,i),l(e,this,i),i.sort(a),i},e.Raycaster.prototype.intersectObjects=function(e,t){for(var i=[],r=0,n=e.length;n>r;r++)l(e[r],this,i),t===!0&&d(e[r],this,i);return i.sort(a),i}}(r),r.Object3D=function(){this.id=r.Math.generateUUID(),this.name="",this.parent=void 0,this.children=[],this.up=new r.Vector3(0,1,0),this.position=new r.Vector3,this.rotation=new r.Vector3,this.eulerOrder=r.Object3D.defaultEulerOrder,this.scale=new r.Vector3(1,1,1),this.renderDepth=null,this.rotationAutoUpdate=!0,this.matrix=new r.Matrix4,this.matrixWorld=new r.Matrix4,this.matrixAutoUpdate=!0,this.matrixWorldNeedsUpdate=!0,this.quaternion=new r.Quaternion,this.useQuaternion=!1,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.userData={}},r.Object3D.prototype={constructor:r.Object3D,addEventListener:r.EventDispatcher.prototype.addEventListener,hasEventListener:r.EventDispatcher.prototype.hasEventListener,removeEventListener:r.EventDispatcher.prototype.removeEventListener,dispatchEvent:r.EventDispatcher.prototype.dispatchEvent,applyMatrix:function(){var e=new r.Matrix4;return function(t){this.matrix.multiplyMatrices(t,this.matrix),this.position.getPositionFromMatrix(this.matrix),this.scale.getScaleFromMatrix(this.matrix),e.extractRotation(this.matrix),this.useQuaternion===!0?this.quaternion.setFromRotationMatrix(e):this.rotation.setEulerFromRotationMatrix(e,this.eulerOrder)}}(),rotateOnAxis:function(){var e=new r.Quaternion,t=new r.Quaternion;return function(i,r){return e.setFromAxisAngle(i,r),this.useQuaternion===!0?this.quaternion.multiply(e):(t.setFromEuler(this.rotation,this.eulerOrder),t.multiply(e),this.rotation.setEulerFromQuaternion(t,this.eulerOrder)),this}}(),translateOnAxis:function(){var e=new r.Vector3;return function(t,i){return e.copy(t),this.useQuaternion===!0?e.applyQuaternion(this.quaternion):e.applyEuler(this.rotation,this.eulerOrder),this.position.add(e.multiplyScalar(i)),this}}(),translate:function(e,t){return console.warn("DEPRECATED: Object3D's .translate() has been removed. Use .translateOnAxis( axis, distance ) instead. Note args have been changed."),this.translateOnAxis(t,e)},translateX:function(){var e=new r.Vector3(1,0,0);return function(t){return this.translateOnAxis(e,t)}}(),translateY:function(){var e=new r.Vector3(0,1,0);return function(t){return this.translateOnAxis(e,t)}}(),translateZ:function(){var e=new r.Vector3(0,0,1);return function(t){return this.translateOnAxis(e,t)}}(),localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var e=new r.Matrix4;return function(t){return t.applyMatrix4(e.getInverse(this.matrixWorld))}}(),lookAt:function(){var e=new r.Matrix4;return function(t){e.lookAt(t,this.position,this.up),this.useQuaternion===!0?this.quaternion.setFromRotationMatrix(e):this.rotation.setEulerFromRotationMatrix(e,this.eulerOrder)}}(),add:function(e){if(e===this)return console.warn("THREE.Object3D.add: An object can't be added as a child of itself."),void 0;if(e instanceof r.Object3D){void 0!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e);for(var t=this;void 0!==t.parent;)t=t.parent;void 0!==t&&t instanceof r.Scene&&t.__addObject(e)}},remove:function(e){var t=this.children.indexOf(e);if(-1!==t){e.parent=void 0,this.children.splice(t,1);for(var i=this;void 0!==i.parent;)i=i.parent;void 0!==i&&i instanceof r.Scene&&i.__removeObject(e)}},traverse:function(e){e(this);for(var t=0,i=this.children.length;i>t;t++)this.children[t].traverse(e)},getObjectById:function(e,t){for(var i=0,r=this.children.length;r>i;i++){var n=this.children[i];if(n.id===e)return n;if(t===!0&&(n=n.getObjectById(e,t),void 0!==n))return n}return void 0},getObjectByName:function(e,t){for(var i=0,r=this.children.length;r>i;i++){var n=this.children[i];if(n.name===e)return n;if(t===!0&&(n=n.getObjectByName(e,t),void 0!==n))return n}return void 0},getChildByName:function(e,t){return console.warn("DEPRECATED: Object3D's .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e,t)},getDescendants:function(e){void 0===e&&(e=[]),Array.prototype.push.apply(e,this.children);for(var t=0,i=this.children.length;i>t;t++)this.children[t].getDescendants(e);return e},updateMatrix:function(){this.useQuaternion===!1?this.matrix.makeFromPositionEulerScale(this.position,this.rotation,this.eulerOrder,this.scale):this.matrix.makeFromPositionQuaternionScale(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate===!0&&this.updateMatrix(),(this.matrixWorldNeedsUpdate===!0||e===!0)&&(void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=0,i=this.children.length;i>t;t++)this.children[t].updateMatrixWorld(e)},clone:function(e,t){if(void 0===e&&(e=new r.Object3D),void 0===t&&(t=!0),e.name=this.name,e.up.copy(this.up),e.position.copy(this.position),e.rotation instanceof r.Vector3&&e.rotation.copy(this.rotation),e.eulerOrder=this.eulerOrder,e.scale.copy(this.scale),e.renderDepth=this.renderDepth,e.rotationAutoUpdate=this.rotationAutoUpdate,e.matrix.copy(this.matrix),e.matrixWorld.copy(this.matrixWorld),e.matrixAutoUpdate=this.matrixAutoUpdate,e.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate,e.quaternion.copy(this.quaternion),e.useQuaternion=this.useQuaternion,e.visible=this.visible,e.castShadow=this.castShadow,e.receiveShadow=this.receiveShadow,e.frustumCulled=this.frustumCulled,e.userData=JSON.parse(JSON.stringify(this.userData)),t===!0)for(var i=0;this.children.length>i;i++){var n=this.children[i];e.add(n.clone())}return e}},r.Object3D.defaultEulerOrder="XYZ",r.Projector=function(){function e(){if(c===E){var e=new r.RenderableObject;return b.push(e),E++,c++,e}return b[c++]}function t(){if(u===T){var e=new r.RenderableVertex;return _.push(e),T++,u++,e}return _[u++]}function i(){if(f===M){var e=new r.RenderableFace3;return C.push(e),M++,f++,e}return C[f++]}function n(){if(g===A){var e=new r.RenderableFace4;return S.push(e),A++,g++,e}return S[g++]}function s(){if(m===U){var e=new r.RenderableLine;return R.push(e),U++,m++,e}return R[m++]}function o(){if(w===P){var e=new r.RenderableParticle;return D.push(e),P++,w++,e}return D[w++]}function a(e,t){return t.z-e.z}function l(e,t){var i=0,r=1,n=e.z+e.w,s=t.z+t.w,o=-e.z+e.w,a=-t.z+t.w;return n>=0&&s>=0&&o>=0&&a>=0?!0:0>n&&0>s||0>o&&0>a?!1:(0>n?i=Math.max(i,n/(n-s)):0>s&&(r=Math.min(r,n/(n-s))),0>o?i=Math.max(i,o/(o-a)):0>a&&(r=Math.min(r,o/(o-a))),i>r?!1:(e.lerp(t,i),t.lerp(e,1-r),!0))}var d,c,h,u,p,f,g,v,m,y,w,x,b=[],E=0,_=[],T=0,C=[],M=0,S=[],A=0,R=[],U=0,D=[],P=0,j={objects:[],sprites:[],lights:[],elements:[]},B=new r.Vector3,H=new r.Vector4,k=new r.Box3(new r.Vector3(-1,-1,-1),new r.Vector3(1,1,1)),L=new r.Box3,I=Array(3),N=Array(4),F=new r.Matrix4,O=new r.Matrix4,z=new r.Matrix4,V=new r.Matrix3,W=new r.Matrix3,G=new r.Vector3,X=new r.Frustum,q=new r.Vector4,$=new r.Vector4;this.projectVector=function(e,t){return t.matrixWorldInverse.getInverse(t.matrixWorld),O.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),e.applyProjection(O)},this.unprojectVector=function(e,t){return t.projectionMatrixInverse.getInverse(t.projectionMatrix),O.multiplyMatrices(t.matrixWorld,t.projectionMatrixInverse),e.applyProjection(O)},this.pickingRay=function(e,t){e.z=-1;var i=new r.Vector3(e.x,e.y,1);return this.unprojectVector(e,t),this.unprojectVector(i,t),i.sub(e).normalize(),new r.Raycaster(e,i)};var Y=function(t){return d=e(),d.object=t,null!==t.renderDepth?d.z=t.renderDepth:(B.getPositionFromMatrix(t.matrixWorld),B.applyProjection(O),d.z=B.z),d},K=function(e){if(e.visible!==!1){e instanceof r.Light?j.lights.push(e):e instanceof r.Mesh||e instanceof r.Line?(e.frustumCulled===!1||X.intersectsObject(e)===!0)&&j.objects.push(Y(e)):(e instanceof r.Sprite||e instanceof r.Particle)&&j.sprites.push(Y(e));for(var t=0,i=e.children.length;i>t;t++)K(e.children[t])}},J=function(e,t){c=0,j.objects.length=0,j.sprites.length=0,j.lights.length=0,K(e),t===!0&&j.objects.sort(a)};this.projectScene=function(e,d,c,b){var E,T,C,M,S,A,R,U,D,P,B,Y,K,Q,Z,et,tt,it,rt,nt,st,ot,at,lt,dt,ct,ht=!1;for(f=0,g=0,m=0,w=0,j.elements.length=0,e.autoUpdate===!0&&e.updateMatrixWorld(),void 0===d.parent&&d.updateMatrixWorld(),F.copy(d.matrixWorldInverse.getInverse(d.matrixWorld)),O.multiplyMatrices(d.projectionMatrix,F),W.getNormalMatrix(F),X.setFromMatrix(O),J(e,c),E=0,T=j.objects.length;T>E;E++)if(K=j.objects[E].object,x=K.matrixWorld,u=0,K instanceof r.Mesh){for(Q=K.geometry,Z=Q.vertices,et=Q.faces,rt=Q.faceVertexUvs,V.getNormalMatrix(x),dt=K.material instanceof r.MeshFaceMaterial,ct=dt===!0?K.material:null,C=0,M=Z.length;M>C;C++)h=t(),h.positionWorld.copy(Z[C]).applyMatrix4(x),h.positionScreen.copy(h.positionWorld).applyMatrix4(O),h.positionScreen.x/=h.positionScreen.w,h.positionScreen.y/=h.positionScreen.w,h.positionScreen.z/=h.positionScreen.w,h.visible=!(-1>h.positionScreen.x||h.positionScreen.x>1||-1>h.positionScreen.y||h.positionScreen.y>1||-1>h.positionScreen.z||h.positionScreen.z>1);for(S=0,A=et.length;A>S;S++){tt=et[S];var ut=dt===!0?ct.materials[tt.materialIndex]:K.material;if(void 0!==ut){var pt=ut.side;if(tt instanceof r.Face3){if(st=_[tt.a],ot=_[tt.b],at=_[tt.c],I[0]=st.positionScreen,I[1]=ot.positionScreen,I[2]=at.positionScreen,st.visible!==!0&&ot.visible!==!0&&at.visible!==!0&&!k.isIntersectionBox(L.setFromPoints(I)))continue;if(ht=0>(at.positionScreen.x-st.positionScreen.x)*(ot.positionScreen.y-st.positionScreen.y)-(at.positionScreen.y-st.positionScreen.y)*(ot.positionScreen.x-st.positionScreen.x),pt!==r.DoubleSide&&ht!==(pt===r.FrontSide))continue;p=i(),p.v1.copy(st),p.v2.copy(ot),p.v3.copy(at)}else if(tt instanceof r.Face4){if(st=_[tt.a],ot=_[tt.b],at=_[tt.c],lt=_[tt.d],N[0]=st.positionScreen,N[1]=ot.positionScreen,N[2]=at.positionScreen,N[3]=lt.positionScreen,st.visible!==!0&&ot.visible!==!0&&at.visible!==!0&&lt.visible!==!0&&!k.isIntersectionBox(L.setFromPoints(N)))continue;if(ht=0>(lt.positionScreen.x-st.positionScreen.x)*(ot.positionScreen.y-st.positionScreen.y)-(lt.positionScreen.y-st.positionScreen.y)*(ot.positionScreen.x-st.positionScreen.x)||0>(ot.positionScreen.x-at.positionScreen.x)*(lt.positionScreen.y-at.positionScreen.y)-(ot.positionScreen.y-at.positionScreen.y)*(lt.positionScreen.x-at.positionScreen.x),pt!==r.DoubleSide&&ht!==(pt===r.FrontSide))continue;p=n(),p.v1.copy(st),p.v2.copy(ot),p.v3.copy(at),p.v4.copy(lt)}for(p.normalModel.copy(tt.normal),ht!==!1||pt!==r.BackSide&&pt!==r.DoubleSide||p.normalModel.negate(),p.normalModel.applyMatrix3(V).normalize(),p.normalModelView.copy(p.normalModel).applyMatrix3(W),p.centroidModel.copy(tt.centroid).applyMatrix4(x),it=tt.vertexNormals,R=0,U=it.length;U>R;R++){var ft=p.vertexNormalsModel[R];ft.copy(it[R]),ht!==!1||pt!==r.BackSide&&pt!==r.DoubleSide||ft.negate(),ft.applyMatrix3(V).normalize();var gt=p.vertexNormalsModelView[R];gt.copy(ft).applyMatrix3(W)}for(p.vertexNormalsLength=it.length,D=0,P=rt.length;P>D;D++)if(nt=rt[D][S],void 0!==nt)for(B=0,Y=nt.length;Y>B;B++)p.uvs[D][B]=nt[B];p.color=tt.color,p.material=ut,G.copy(p.centroidModel).applyProjection(O),p.z=G.z,j.elements.push(p)}}}else if(K instanceof r.Line){z.multiplyMatrices(O,x),Z=K.geometry.vertices,st=t(),st.positionScreen.copy(Z[0]).applyMatrix4(z);var vt=K.type===r.LinePieces?2:1;for(C=1,M=Z.length;M>C;C++)st=t(),st.positionScreen.copy(Z[C]).applyMatrix4(z),(C+1)%vt>0||(ot=_[u-2],q.copy(st.positionScreen),$.copy(ot.positionScreen),l(q,$)===!0&&(q.multiplyScalar(1/q.w),$.multiplyScalar(1/$.w),v=s(),v.v1.positionScreen.copy(q),v.v2.positionScreen.copy($),v.z=Math.max(q.z,$.z),v.material=K.material,K.material.vertexColors===r.VertexColors&&(v.vertexColors[0].copy(K.geometry.colors[C]),v.vertexColors[1].copy(K.geometry.colors[C-1])),j.elements.push(v)))}for(E=0,T=j.sprites.length;T>E;E++)K=j.sprites[E].object,x=K.matrixWorld,K instanceof r.Particle&&(H.set(x.elements[12],x.elements[13],x.elements[14],1),H.applyMatrix4(O),H.z/=H.w,H.z>0&&1>H.z&&(y=o(),y.object=K,y.x=H.x/H.w,y.y=H.y/H.w,y.z=H.z,y.rotation=K.rotation.z,y.scale.x=K.scale.x*Math.abs(y.x-(H.x+d.projectionMatrix.elements[0])/(H.w+d.projectionMatrix.elements[12])),y.scale.y=K.scale.y*Math.abs(y.y-(H.y+d.projectionMatrix.elements[5])/(H.w+d.projectionMatrix.elements[13])),y.material=K.material,j.elements.push(y)));return b===!0&&j.elements.sort(a),j}},r.Face3=function(e,t,i,n,s,o){this.a=e,this.b=t,this.c=i,this.normal=n instanceof r.Vector3?n:new r.Vector3,this.vertexNormals=n instanceof Array?n:[],this.color=s instanceof r.Color?s:new r.Color,this.vertexColors=s instanceof Array?s:[],this.vertexTangents=[],this.materialIndex=void 0!==o?o:0,this.centroid=new r.Vector3},r.Face3.prototype={constructor:r.Face3,clone:function(){var e=new r.Face3(this.a,this.b,this.c);e.normal.copy(this.normal),e.color.copy(this.color),e.centroid.copy(this.centroid),e.materialIndex=this.materialIndex;var t,i;for(t=0,i=this.vertexNormals.length;i>t;t++)e.vertexNormals[t]=this.vertexNormals[t].clone();for(t=0,i=this.vertexColors.length;i>t;t++)e.vertexColors[t]=this.vertexColors[t].clone();for(t=0,i=this.vertexTangents.length;i>t;t++)e.vertexTangents[t]=this.vertexTangents[t].clone();return e}},r.Face4=function(e,t,i,n,s,o,a){this.a=e,this.b=t,this.c=i,this.d=n,this.normal=s instanceof r.Vector3?s:new r.Vector3,this.vertexNormals=s instanceof Array?s:[],this.color=o instanceof r.Color?o:new r.Color,this.vertexColors=o instanceof Array?o:[],this.vertexTangents=[],this.materialIndex=void 0!==a?a:0,this.centroid=new r.Vector3},r.Face4.prototype={constructor:r.Face4,clone:function(){var e=new r.Face4(this.a,this.b,this.c,this.d);e.normal.copy(this.normal),e.color.copy(this.color),e.centroid.copy(this.centroid),e.materialIndex=this.materialIndex;var t,i;for(t=0,i=this.vertexNormals.length;i>t;t++)e.vertexNormals[t]=this.vertexNormals[t].clone();for(t=0,i=this.vertexColors.length;i>t;t++)e.vertexColors[t]=this.vertexColors[t].clone();for(t=0,i=this.vertexTangents.length;i>t;t++)e.vertexTangents[t]=this.vertexTangents[t].clone();return e}},r.Geometry=function(){this.id=r.Math.generateUUID(),this.name="",this.vertices=[],this.colors=[],this.normals=[],this.faces=[],this.faceUvs=[[]],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.buffersNeedUpdate=!1},r.Geometry.prototype={constructor:r.Geometry,addEventListener:r.EventDispatcher.prototype.addEventListener,hasEventListener:r.EventDispatcher.prototype.hasEventListener,removeEventListener:r.EventDispatcher.prototype.removeEventListener,dispatchEvent:r.EventDispatcher.prototype.dispatchEvent,applyMatrix:function(e){for(var t=(new r.Matrix3).getNormalMatrix(e),i=0,n=this.vertices.length;n>i;i++){var s=this.vertices[i];s.applyMatrix4(e)}for(var i=0,n=this.faces.length;n>i;i++){var o=this.faces[i];o.normal.applyMatrix3(t).normalize();for(var a=0,l=o.vertexNormals.length;l>a;a++)o.vertexNormals[a].applyMatrix3(t).normalize();o.centroid.applyMatrix4(e)}this.boundingBox instanceof r.Box3&&this.computeBoundingBox(),this.boundingSphere instanceof r.Sphere&&this.computeBoundingSphere()},computeCentroids:function(){var e,t,i;for(e=0,t=this.faces.length;t>e;e++)i=this.faces[e],i.centroid.set(0,0,0),i instanceof r.Face3?(i.centroid.add(this.vertices[i.a]),i.centroid.add(this.vertices[i.b]),i.centroid.add(this.vertices[i.c]),i.centroid.divideScalar(3)):i instanceof r.Face4&&(i.centroid.add(this.vertices[i.a]),i.centroid.add(this.vertices[i.b]),i.centroid.add(this.vertices[i.c]),i.centroid.add(this.vertices[i.d]),i.centroid.divideScalar(4))},computeFaceNormals:function(){for(var e=new r.Vector3,t=new r.Vector3,i=0,n=this.faces.length;n>i;i++){var s=this.faces[i],o=this.vertices[s.a],a=this.vertices[s.b],l=this.vertices[s.c];e.subVectors(l,a),t.subVectors(o,a),e.cross(t),e.normalize(),s.normal.copy(e)}},computeVertexNormals:function(e){var t,i,n,s,o,a;if(void 0===this.__tmpVertices){for(this.__tmpVertices=Array(this.vertices.length),a=this.__tmpVertices,t=0,i=this.vertices.length;i>t;t++)a[t]=new r.Vector3;for(n=0,s=this.faces.length;s>n;n++)o=this.faces[n],o instanceof r.Face3?o.vertexNormals=[new r.Vector3,new r.Vector3,new r.Vector3]:o instanceof r.Face4&&(o.vertexNormals=[new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3])}else for(a=this.__tmpVertices,t=0,i=this.vertices.length;i>t;t++)a[t].set(0,0,0);if(e){var l,d,c,h,u=new r.Vector3,p=new r.Vector3,f=new r.Vector3,g=new r.Vector3,v=new r.Vector3;for(n=0,s=this.faces.length;s>n;n++)o=this.faces[n],o instanceof r.Face3?(l=this.vertices[o.a],d=this.vertices[o.b],c=this.vertices[o.c],u.subVectors(c,d),p.subVectors(l,d),u.cross(p),a[o.a].add(u),a[o.b].add(u),a[o.c].add(u)):o instanceof r.Face4&&(l=this.vertices[o.a],d=this.vertices[o.b],c=this.vertices[o.c],h=this.vertices[o.d],f.subVectors(h,d),p.subVectors(l,d),f.cross(p),a[o.a].add(f),a[o.b].add(f),a[o.d].add(f),g.subVectors(h,c),v.subVectors(d,c),g.cross(v),a[o.b].add(g),a[o.c].add(g),a[o.d].add(g))}else for(n=0,s=this.faces.length;s>n;n++)o=this.faces[n],o instanceof r.Face3?(a[o.a].add(o.normal),a[o.b].add(o.normal),a[o.c].add(o.normal)):o instanceof r.Face4&&(a[o.a].add(o.normal),a[o.b].add(o.normal),a[o.c].add(o.normal),a[o.d].add(o.normal));for(t=0,i=this.vertices.length;i>t;t++)a[t].normalize();for(n=0,s=this.faces.length;s>n;n++)o=this.faces[n],o instanceof r.Face3?(o.vertexNormals[0].copy(a[o.a]),o.vertexNormals[1].copy(a[o.b]),o.vertexNormals[2].copy(a[o.c])):o instanceof r.Face4&&(o.vertexNormals[0].copy(a[o.a]),o.vertexNormals[1].copy(a[o.b]),o.vertexNormals[2].copy(a[o.c]),o.vertexNormals[3].copy(a[o.d]))},computeVertexNormalsAsync:function(e,t,i,n){function s(e,t,i){e[3*t]+=i.x,e[3*t+1]+=i.y,e[3*t+2]+=i.z}function o(e,t,r,n,s){function o(t){var o=0;do{var a=E.faces[t];e(a,t),t++,o++}while(s>o&&E.faces.length>t);E.faces.length>t?(d+=c*s,i&&i(d)):(i(r),n())}function a(e){setTimeout(function(){o(e)},0)}for(var l=0,d=t,c=(r-t)/E.faces.length;E.faces.length>l;)a(l),l+=s}function a(e){e instanceof r.Face3?(s(v,e.a,e.normal),s(v,e.b,e.normal),s(v,e.c,e.normal)):e instanceof r.Face4&&(s(v,e.a,e.normal),s(v,e.b,e.normal),s(v,e.c,e.normal),s(v,e.d,e.normal))}function l(){for(h=0,u=E.vertices.length;u>h;h++)m.x=v[3*h],m.y=v[3*h+1],m.z=v[3*h+2],m.normalize(),v[3*h]=m.x,v[3*h+1]=m.y,v[3*h+2]=m.z}function d(e){e instanceof r.Face3?(e.vertexNormals[0].set(v[3*e.a],v[3*e.a+1],v[3*e.a+2]),e.vertexNormals[1].set(v[3*e.b],v[3*e.b+1],v[3*e.b+2]),e.vertexNormals[2].set(v[3*e.c],v[3*e.c+1],v[3*e.c+2])):e instanceof r.Face4&&(e.vertexNormals[0].set(v[3*e.a],v[3*e.a+1],v[3*e.a+2]),e.vertexNormals[1].set(v[3*e.b],v[3*e.b+1],v[3*e.b+2]),e.vertexNormals[2].set(v[3*e.c],v[3*e.c+1],v[3*e.c+2]),e.vertexNormals[3].set(v[3*e.d],v[3*e.d+1],v[3*e.d+2]))}function c(e){e instanceof r.Face3?(_.set(E.vertices[3*e.c]-E.vertices[3*e.b],E.vertices[3*e.c+1]-E.vertices[3*e.b+1],E.vertices[3*e.c+2]-E.vertices[3*e.b+2]),T.set(E.vertices[3*e.a]-E.vertices[3*e.b],E.vertices[3*e.a+1]-E.vertices[3*e.b+1],E.vertices[3*e.a+2]-E.vertices[3*e.b+2]),_.cross(T),s(v,e.a,_),s(v,e.b,_),s(v,e.c,_)):e instanceof r.Face4&&(y=E.vertices[e.a],w=E.vertices[e.b],x=E.vertices[e.c],b=E.vertices[e.d],C.set(E.vertices[3*e.d]-E.vertices[3*e.b],E.vertices[3*e.d+1]-E.vertices[3*e.b+1],E.vertices[3*e.d+2]-E.vertices[3*e.b+2]),T.set(E.vertices[3*e.a]-E.vertices[3*e.b],E.vertices[3*e.a+1]-E.vertices[3*e.b+1],E.vertices[3*e.a+2]-E.vertices[3*e.b+2]),C.cross(T),s(v,e.a,C),s(v,e.b,C),s(v,e.d,C),M.set(E.vertices[3*e.d]-E.vertices[3*e.c],E.vertices[3*e.d+1]-E.vertices[3*e.c+1],E.vertices[3*e.d+2]-E.vertices[3*e.c+2]),S.set(E.vertices[3*e.b]-E.vertices[3*e.c],E.vertices[3*e.b+1]-E.vertices[3*e.c+1],E.vertices[3*e.b+2]-E.vertices[3*e.c+2]),M.cross(S),s(v,e.b,M),s(v,e.c,M),s(v,e.d,M))}var h,u,p,f,g,v,m;m=new r.Vector3;var y,w,x,b,E=this,_=new r.Vector3,T=new r.Vector3,C=new r.Vector3,M=new r.Vector3,S=new r.Vector3;if(void 0===n&&(n=1e5),void 0===this.__tmpVertices){var A=4*3*this.vertices.length,R=new ArrayBuffer(A),U=new Float32Array(R);for(this.__tmpVertices=U,v=this.__tmpVertices,p=0,f=this.faces.length;f>p;p++)g=this.faces[p],g instanceof r.Face3?g.vertexNormals=[new r.Vector3,new r.Vector3,new r.Vector3]:g instanceof r.Face4&&(g.vertexNormals=[new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3])}else for(v=this.__tmpVertices,h=0,u=this.vertices.length;u>h;h++)v[3*h]=0,v[3*h+1]=0,v[3*h+2]=0;setTimeout(function(){e?o(c,0,.5,function(){l(),o(d,.5,1,function(){t&&t()},n)},n):o(a,0,.5,function(){l(),o(d,.5,1,function(){t&&t()},n)},n)},0)},computeMorphNormals:function(){var e,t,i,n,s;for(i=0,n=this.faces.length;n>i;i++)for(s=this.faces[i],s.__originalFaceNormal?s.__originalFaceNormal.copy(s.normal):s.__originalFaceNormal=s.normal.clone(),s.__originalVertexNormals||(s.__originalVertexNormals=[]),e=0,t=s.vertexNormals.length;t>e;e++)s.__originalVertexNormals[e]?s.__originalVertexNormals[e].copy(s.vertexNormals[e]):s.__originalVertexNormals[e]=s.vertexNormals[e].clone();var o=new r.Geometry;for(o.faces=this.faces,e=0,t=this.morphTargets.length;t>e;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var a,l,d=this.morphNormals[e].faceNormals,c=this.morphNormals[e].vertexNormals;for(i=0,n=this.faces.length;n>i;i++)s=this.faces[i],a=new r.Vector3,l=s instanceof r.Face3?{a:new r.Vector3,b:new r.Vector3,c:new r.Vector3}:{a:new r.Vector3,b:new r.Vector3,c:new r.Vector3,d:new r.Vector3},d.push(a),c.push(l)}var h=this.morphNormals[e];o.vertices=this.morphTargets[e].vertices,o.computeFaceNormals(),o.computeVertexNormals();var a,l;for(i=0,n=this.faces.length;n>i;i++)s=this.faces[i],a=h.faceNormals[i],l=h.vertexNormals[i],a.copy(s.normal),s instanceof r.Face3?(l.a.copy(s.vertexNormals[0]),l.b.copy(s.vertexNormals[1]),l.c.copy(s.vertexNormals[2])):(l.a.copy(s.vertexNormals[0]),l.b.copy(s.vertexNormals[1]),l.c.copy(s.vertexNormals[2]),l.d.copy(s.vertexNormals[3]))}for(i=0,n=this.faces.length;n>i;i++)s=this.faces[i],s.normal=s.__originalFaceNormal,s.vertexNormals=s.__originalVertexNormals},computeTangents:function(){function e(e,t,i,r,n,s,o){c=e.vertices[t],h=e.vertices[i],u=e.vertices[r],p=d[n],f=d[s],g=d[o],v=h.x-c.x,m=u.x-c.x,y=h.y-c.y,w=u.y-c.y,x=h.z-c.z,b=u.z-c.z,E=f.x-p.x,_=g.x-p.x,T=f.y-p.y,C=g.y-p.y,M=1/(E*C-_*T),P.set((C*v-T*m)*M,(C*y-T*w)*M,(C*x-T*b)*M),j.set((E*m-_*v)*M,(E*w-_*y)*M,(E*b-_*x)*M),U[t].add(P),U[i].add(P),U[r].add(P),D[t].add(j),D[i].add(j),D[r].add(j)}var t,i,n,s,o,a,l,d,c,h,u,p,f,g,v,m,y,w,x,b,E,_,T,C,M,S,A,R,U=[],D=[],P=new r.Vector3,j=new r.Vector3,B=new r.Vector3,H=new r.Vector3,k=new r.Vector3;for(n=0,s=this.vertices.length;s>n;n++)U[n]=new r.Vector3,D[n]=new r.Vector3;for(t=0,i=this.faces.length;i>t;t++)l=this.faces[t],d=this.faceVertexUvs[0][t],l instanceof r.Face3?e(this,l.a,l.b,l.c,0,1,2):l instanceof r.Face4&&(e(this,l.a,l.b,l.d,0,1,3),e(this,l.b,l.c,l.d,1,2,3));var L=["a","b","c","d"];for(t=0,i=this.faces.length;i>t;t++)for(l=this.faces[t],o=0;l.vertexNormals.length>o;o++)k.copy(l.vertexNormals[o]),a=l[L[o]],S=U[a],B.copy(S),B.sub(k.multiplyScalar(k.dot(S))).normalize(),H.crossVectors(l.vertexNormals[o],S),A=H.dot(D[a]),R=0>A?-1:1,l.vertexTangents[o]=new r.Vector4(B.x,B.y,B.z,R);this.hasTangents=!0},computeTangentsAsync:function(e,t,i){function n(e,t){return G.set(e[3*t],e[3*t+1],e[3*t+2]),G}function s(e,t,i){e[3*t]+=i.x,e[3*t+1]+=i.y,e[3*t+2]+=i.z}function o(e,t,i,r,n,o,a){function l(e,t){e[t]||0==e[t]?1/0===e[t]?e[t]=1:e[t]===-1/0&&(e[t]=-1):e[t]=0}g=e.vertices[t],v=e.vertices[i],m=e.vertices[r],y=f[n],w=f[o],x=f[a],b=v.x-g.x,E=m.x-g.x,_=v.y-g.y,T=m.y-g.y,C=v.z-g.z,M=m.z-g.z,S=w.x-y.x,A=x.x-y.x,R=w.y-y.y,U=x.y-y.y,D=1/(S*U-A*R),H.set((U*b-R*E)*D,(U*_-R*T)*D,(U*C-R*M)*D),k.set((S*E-A*b)*D,(S*T-A*_)*D,(S*M-A*C)*D),l(H,"x"),l(H,"y"),l(H,"z"),l(k,"x"),l(k,"y"),l(k,"z"),s(V,t,H),s(V,i,H),s(V,r,H),s(W,t,k),s(W,i,k),s(W,r,k)}function a(e,i,r,n,s){function o(i){var o=0;do{var a=q.faces[i];e(a,i),i++,o++}while(s>o&&q.faces.length>i);q.faces.length>i?(d+=c*s,t&&t(d)):(t(r),n())}function a(e){setTimeout(function(){o(e)},0)}for(var l=0,d=i,c=(r-i)/q.faces.length;q.faces.length>l;)a(l),l+=s}function l(e,t){f=q.faceVertexUvs[0][t],e instanceof r.Face3?o(q,e.a,e.b,e.c,0,1,2):e instanceof r.Face4&&(o(q,e.a,e.b,e.d,0,1,3),o(q,e.b,e.c,e.d,1,2,3))}function d(e){for(h=0;e.vertexNormals.length>h;h++)N.copy(e.vertexNormals[h]),u=e[X[h]],P=n(V,u),L.copy(P),L.sub(N.multiplyScalar(N.dot(P))).normalize(),I.crossVectors(e.vertexNormals[h],P),j=I.dot(n(W,u)),B=0>j?-1:1,e.vertexTangents[h].set(L.x,L.y,L.z,B)}var c,h,u,p,f,g,v,m,y,w,x,b,E,_,T,C,M,S,A,R,U,D,P,j,B,H=new r.Vector3,k=new r.Vector3,L=new r.Vector3,I=new r.Vector3,N=new r.Vector3;for(c=0;this.faces.length>c;c++)for(p=this.faces[c],h=0;p.vertexNormals.length>h;h++)p.vertexTangents[h]=new r.Vector4;void 0===i&&(i=1e5);var F=4*3*this.vertices.length,O=new ArrayBuffer(F),z=new ArrayBuffer(F),V=new Float32Array(O),W=new Float32Array(z),G=new r.Vector3,X=["a","b","c","d"],q=this;a(l,0,.3,function(){a(d,.3,1,function(){q.hasTangents=!0,e&&(G=void 0,V=void 0,W=void 0,O=void 0,z=void 0,e())},i)},i)},computeTangentsAsync_Partial:function(e,t,i){function n(e,t,i,r,n,s,o){function a(e,t){e[t]||0==e[t]?1/0===e[t]?e[t]=1:e[t]===-1/0&&(e[t]=-1):e[t]=0}p=e.vertices[t],f=e.vertices[i],g=e.vertices[r],v=u[n],m=u[s],y=u[o],w=f.x-p.x,x=g.x-p.x,b=f.y-p.y,E=g.y-p.y,_=f.z-p.z,T=g.z-p.z,C=m.x-v.x,M=y.x-v.x,S=m.y-v.y,A=y.y-v.y,R=1/(C*A-M*S),U.set((A*w-S*x)*R,(A*b-S*E)*R,(A*_-S*T)*R),D.set((C*x-M*w)*R,(C*E-M*b)*R,(C*T-M*_)*R),a(U,"x"),a(U,"y"),a(D,"x"),a(D,"y"),P[t].x+=U.x,P[t].y+=U.y,P[i].x+=U.x,P[i].y+=U.y,P[r].x+=U.x,P[r].y+=U.y,P[t].z+=D.x,P[t].w+=D.y,P[i].z+=D.x,P[i].w+=D.y,P[r].z+=D.x,P[r].w+=D.y}function s(e,i,r,n,s){function o(i){var o=0;do{var a=B.faces[i];e(a,i),i++,o++}while(s>o&&B.faces.length>i);B.faces.length>i?(d+=c*s,t&&t(d)):(t(r),n())}function a(e){setTimeout(function(){o(e)},0)}for(var l=0,d=i,c=(r-i)/B.faces.length;B.faces.length>l;)a(l),l+=s
}function o(e,t){u=B.faceVertexUvs[0][t],e instanceof r.Face3?n(B,e.a,e.b,e.c,0,1,2):e instanceof r.Face4&&(n(B,e.a,e.b,e.d,0,1,3),n(B,e.b,e.c,e.d,1,2,3))}function a(e){for(c=0;e.vertexNormals.length>c;c++)h=e[j[c]],e.vertexTangents[c]=P[h]}var l,d,c,h,u,p,f,g,v,m,y,w,x,b,E,_,T,C,M,S,A,R,U=new r.Vector3,D=new r.Vector3;new r.Vector3,new r.Vector3,new r.Vector3;var P=[];for(l=0,d=this.vertices.length;d>l;l++)P[l]=new r.Vector4;void 0===i&&(i=1e5);var j=["a","b","c","d"],B=this;s(o,0,.3,function(){s(a,.3,1,function(){B.hasTangents=!0,e&&e()},i)},i)},computeLineDistances:function(){for(var e=0,t=this.vertices,i=0,r=t.length;r>i;i++)i>0&&(e+=t[i].distanceTo(t[i-1])),this.lineDistances[i]=e},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new r.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new r.Sphere),this.boundingSphere.setFromPoints(this.vertices)},mergeVertices:function(){var e,t,i,n,s,o,a,l,d,c={},h=[],u=[],p=4,f=Math.pow(10,p);for(this.__tmpVertices=void 0,i=0,n=this.vertices.length;n>i;i++)e=this.vertices[i],t=Math.round(e.x*f)+"_"+Math.round(e.y*f)+"_"+Math.round(e.z*f),void 0===c[t]?(c[t]=i,h.push(this.vertices[i]),u[i]=h.length-1):u[i]=u[c[t]];var g=[];for(i=0,n=this.faces.length;n>i;i++)if(s=this.faces[i],s instanceof r.Face3){s.a=u[s.a],s.b=u[s.b],s.c=u[s.c],o=[s.a,s.b,s.c];for(var v=-1,m=0;3>m;m++)if(o[m]==o[(m+1)%3]){v=m,g.push(i);break}}else if(s instanceof r.Face4){s.a=u[s.a],s.b=u[s.b],s.c=u[s.c],s.d=u[s.d],o=[s.a,s.b,s.c,s.d];for(var v=-1,m=0;4>m;m++)o[m]==o[(m+1)%4]&&(v>=0&&g.push(i),v=m);if(v>=0){o.splice(v,1);var y=new r.Face3(o[0],o[1],o[2],s.normal,s.color,s.materialIndex);for(a=0,l=this.faceVertexUvs.length;l>a;a++)d=this.faceVertexUvs[a][i],d&&d.splice(v,1);s.vertexNormals&&s.vertexNormals.length>0&&(y.vertexNormals=s.vertexNormals,y.vertexNormals.splice(v,1)),s.vertexColors&&s.vertexColors.length>0&&(y.vertexColors=s.vertexColors,y.vertexColors.splice(v,1)),this.faces[i]=y}}for(i=g.length-1;i>=0;i--)for(this.faces.splice(i,1),a=0,l=this.faceVertexUvs.length;l>a;a++)this.faceVertexUvs[a].splice(i,1);var w=this.vertices.length-h.length;return this.vertices=h,w},clone:function(){for(var e=new r.Geometry,t=this.vertices,i=0,n=t.length;n>i;i++)e.vertices.push(t[i].clone());for(var s=this.faces,i=0,n=s.length;n>i;i++)e.faces.push(s[i].clone());for(var o=this.faceVertexUvs[0],i=0,n=o.length;n>i;i++){for(var a=o[i],l=[],d=0,c=a.length;c>d;d++)l.push(new r.Vector2(a[d].x,a[d].y));e.faceVertexUvs[0].push(l)}return e},dispose:function(){this.dispatchEvent({type:"dispose"})}},r.BufferGeometry=function(){this.id=r.Math.generateUUID(),this.attributes={},this.dynamic=!1,this.offsets=[],this.boundingBox=null,this.boundingSphere=null,this.hasTangents=!1,this.morphTargets=[]},r.BufferGeometry.prototype={constructor:r.BufferGeometry,addEventListener:r.EventDispatcher.prototype.addEventListener,hasEventListener:r.EventDispatcher.prototype.hasEventListener,removeEventListener:r.EventDispatcher.prototype.removeEventListener,dispatchEvent:r.EventDispatcher.prototype.dispatchEvent,applyMatrix:function(e){var t,i;if(this.attributes.position&&(t=this.attributes.position.array),this.attributes.normal&&(i=this.attributes.normal.array),void 0!==t&&(e.multiplyVector3Array(t),this.verticesNeedUpdate=!0),void 0!==i){var n=(new r.Matrix3).getNormalMatrix(e);n.multiplyVector3Array(i),this.normalizeNormals(),this.normalsNeedUpdate=!0}},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new r.Box3);var e=this.attributes.position.array;if(e){var t,i,n,s=this.boundingBox;e.length>=3&&(s.min.x=s.max.x=e[0],s.min.y=s.max.y=e[1],s.min.z=s.max.z=e[2]);for(var o=3,a=e.length;a>o;o+=3)t=e[o],i=e[o+1],n=e[o+2],s.min.x>t?s.min.x=t:t>s.max.x&&(s.max.x=t),s.min.y>i?s.min.y=i:i>s.max.y&&(s.max.y=i),s.min.z>n?s.min.z=n:n>s.max.z&&(s.max.z=n)}(void 0===e||0===e.length)&&(this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0))},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new r.Sphere);var e=this.attributes.position.array;if(e){for(var t,i,n,s,o=0,a=0,l=e.length;l>a;a+=3)i=e[a],n=e[a+1],s=e[a+2],t=i*i+n*n+s*s,t>o&&(o=t);this.boundingSphere.radius=Math.sqrt(o)}},computeVertexNormals:function(){if(this.attributes.position){var e,t,i,n,s=this.attributes.position.array.length;if(void 0===this.attributes.normal)this.attributes.normal={itemSize:3,array:new Float32Array(s)};else for(e=0,t=this.attributes.normal.array.length;t>e;e++)this.attributes.normal.array[e]=0;var o,a,l,d,c,h,u=this.attributes.position.array,p=this.attributes.normal.array,f=new r.Vector3,g=new r.Vector3,v=new r.Vector3,m=new r.Vector3,y=new r.Vector3;if(this.attributes.index){var w=this.attributes.index.array,x=this.offsets;for(i=0,n=x.length;n>i;++i){var b=x[i].start,E=x[i].count,_=x[i].index;for(e=b,t=b+E;t>e;e+=3)o=_+w[e],a=_+w[e+1],l=_+w[e+2],d=u[3*o],c=u[3*o+1],h=u[3*o+2],f.set(d,c,h),d=u[3*a],c=u[3*a+1],h=u[3*a+2],g.set(d,c,h),d=u[3*l],c=u[3*l+1],h=u[3*l+2],v.set(d,c,h),m.subVectors(v,g),y.subVectors(f,g),m.cross(y),p[3*o]+=m.x,p[3*o+1]+=m.y,p[3*o+2]+=m.z,p[3*a]+=m.x,p[3*a+1]+=m.y,p[3*a+2]+=m.z,p[3*l]+=m.x,p[3*l+1]+=m.y,p[3*l+2]+=m.z}}else for(e=0,t=u.length;t>e;e+=9)d=u[e],c=u[e+1],h=u[e+2],f.set(d,c,h),d=u[e+3],c=u[e+4],h=u[e+5],g.set(d,c,h),d=u[e+6],c=u[e+7],h=u[e+8],v.set(d,c,h),m.subVectors(v,g),y.subVectors(f,g),m.cross(y),p[e]=m.x,p[e+1]=m.y,p[e+2]=m.z,p[e+3]=m.x,p[e+4]=m.y,p[e+5]=m.z,p[e+6]=m.x,p[e+7]=m.y,p[e+8]=m.z;this.normalizeNormals(),this.normalsNeedUpdate=!0}},normalizeNormals:function(){for(var e,t,i,r,n=this.attributes.normal.array,s=0,o=n.length;o>s;s+=3)e=n[s],t=n[s+1],i=n[s+2],r=1/Math.sqrt(e*e+t*t+i*i),n[s]*=r,n[s+1]*=r,n[s+2]*=r},computeTangents:function(){function e(e,t,i){p=n[3*e],f=n[3*e+1],g=n[3*e+2],v=n[3*t],m=n[3*t+1],y=n[3*t+2],w=n[3*i],x=n[3*i+1],b=n[3*i+2],E=o[2*e],_=o[2*e+1],T=o[2*t],C=o[2*t+1],M=o[2*i],S=o[2*i+1],A=v-p,R=w-p,U=m-f,D=x-f,P=y-g,j=b-g,B=T-E,H=M-E,k=C-_,L=S-_,I=1/(B*L-H*k),X.set((L*A-k*R)*I,(L*U-k*D)*I,(L*P-k*j)*I),q.set((B*R-H*A)*I,(B*D-H*U)*I,(B*j-H*P)*I),c[e].add(X),c[t].add(X),c[i].add(X),h[e].add(q),h[t].add(q),h[i].add(q)}function t(e){rt.x=s[3*e],rt.y=s[3*e+1],rt.z=s[3*e+2],nt.copy(rt),Z=c[e],tt.copy(Z),tt.sub(rt.multiplyScalar(rt.dot(Z))).normalize(),it.crossVectors(nt,Z),et=it.dot(h[e]),Q=0>et?-1:1,d[4*e]=tt.x,d[4*e+1]=tt.y,d[4*e+2]=tt.z,d[4*e+3]=Q}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)return console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()"),void 0;var i=this.attributes.index.array,n=this.attributes.position.array,s=this.attributes.normal.array,o=this.attributes.uv.array,a=n.length/3;if(void 0===this.attributes.tangent){var l=4*a;this.attributes.tangent={itemSize:4,array:new Float32Array(l)}}for(var d=this.attributes.tangent.array,c=[],h=[],u=0;a>u;u++)c[u]=new r.Vector3,h[u]=new r.Vector3;var p,f,g,v,m,y,w,x,b,E,_,T,C,M,S,A,R,U,D,P,j,B,H,k,L,I,N,F,O,z,V,W,G,X=new r.Vector3,q=new r.Vector3,$=this.offsets;for(O=0,z=$.length;z>O;++O){var Y=$[O].start,K=$[O].count,J=$[O].index;for(N=Y,F=Y+K;F>N;N+=3)V=J+i[N],W=J+i[N+1],G=J+i[N+2],e(V,W,G)}var Q,Z,et,tt=new r.Vector3,it=new r.Vector3,rt=new r.Vector3,nt=new r.Vector3;for(O=0,z=$.length;z>O;++O){var Y=$[O].start,K=$[O].count,J=$[O].index;for(N=Y,F=Y+K;F>N;N+=3)V=J+i[N],W=J+i[N+1],G=J+i[N+2],t(V),t(W),t(G)}this.hasTangents=!0,this.tangentsNeedUpdate=!0},dispose:function(){this.dispatchEvent({type:"dispose"})}},r.Camera=function(){r.Object3D.call(this),this.matrixWorldInverse=new r.Matrix4,this.projectionMatrix=new r.Matrix4,this.projectionMatrixInverse=new r.Matrix4},r.Camera.prototype=Object.create(r.Object3D.prototype),r.Camera.prototype.lookAt=function(){var e=new r.Matrix4;return function(t){e.lookAt(this.position,t,this.up),this.useQuaternion===!0?this.quaternion.setFromRotationMatrix(e):this.rotation.setEulerFromRotationMatrix(e,this.eulerOrder)}}(),r.OrthographicCamera=function(e,t,i,n,s,o){r.Camera.call(this),this.left=e,this.right=t,this.top=i,this.bottom=n,this.near=void 0!==s?s:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()},r.OrthographicCamera.prototype=Object.create(r.Camera.prototype),r.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far)},r.PerspectiveCamera=function(e,t,i,n){r.Camera.call(this),this.fov=void 0!==e?e:50,this.aspect=void 0!==t?t:1,this.near=void 0!==i?i:.1,this.far=void 0!==n?n:2e3,this.updateProjectionMatrix()},r.PerspectiveCamera.prototype=Object.create(r.Camera.prototype),r.PerspectiveCamera.prototype.setLens=function(e,t){void 0===t&&(t=24),this.fov=2*r.Math.radToDeg(Math.atan(t/(2*e))),this.updateProjectionMatrix()},r.PerspectiveCamera.prototype.setViewOffset=function(e,t,i,r,n,s){this.fullWidth=e,this.fullHeight=t,this.x=i,this.y=r,this.width=n,this.height=s,this.updateProjectionMatrix()},r.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var e=this.fullWidth/this.fullHeight,t=Math.tan(r.Math.degToRad(.5*this.fov))*this.near,i=-t,n=e*i,s=e*t,o=Math.abs(s-n),a=Math.abs(t-i);this.projectionMatrix.makeFrustum(n+this.x*o/this.fullWidth,n+(this.x+this.width)*o/this.fullWidth,t-(this.y+this.height)*a/this.fullHeight,t-this.y*a/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(this.fov,this.aspect,this.near,this.far)},r.Light=function(e){r.Object3D.call(this),this.color=new r.Color(e)},r.Light.prototype=Object.create(r.Object3D.prototype),r.Light.prototype.clone=function(e){return void 0===e&&(e=new r.Light),r.Object3D.prototype.clone.call(this,e),e.color.copy(this.color),e},r.AmbientLight=function(e){r.Light.call(this,e)},r.AmbientLight.prototype=Object.create(r.Light.prototype),r.AmbientLight.prototype.clone=function(){var e=new r.AmbientLight;return r.Light.prototype.clone.call(this,e),e},r.AreaLight=function(e,t){r.Light.call(this,e),this.normal=new r.Vector3(0,-1,0),this.right=new r.Vector3(1,0,0),this.intensity=void 0!==t?t:1,this.width=1,this.height=1,this.constantAttenuation=1.5,this.linearAttenuation=.5,this.quadraticAttenuation=.1},r.AreaLight.prototype=Object.create(r.Light.prototype),r.DirectionalLight=function(e,t){r.Light.call(this,e),this.position.set(0,1,0),this.target=new r.Object3D,this.intensity=void 0!==t?t: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 r.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},r.DirectionalLight.prototype=Object.create(r.Light.prototype),r.DirectionalLight.prototype.clone=function(){var e=new r.DirectionalLight;return r.Light.prototype.clone.call(this,e),e.target=this.target.clone(),e.intensity=this.intensity,e.castShadow=this.castShadow,e.onlyShadow=this.onlyShadow,e},r.HemisphereLight=function(e,t,i){r.Light.call(this,e),this.position.set(0,100,0),this.groundColor=new r.Color(t),this.intensity=void 0!==i?i:1},r.HemisphereLight.prototype=Object.create(r.Light.prototype),r.HemisphereLight.prototype.clone=function(){var e=new r.PointLight;return r.Light.prototype.clone.call(this,e),e.groundColor.copy(this.groundColor),e.intensity=this.intensity,e},r.PointLight=function(e,t,i){r.Light.call(this,e),this.intensity=void 0!==t?t:1,this.distance=void 0!==i?i:0},r.PointLight.prototype=Object.create(r.Light.prototype),r.PointLight.prototype.clone=function(){var e=new r.PointLight;return r.Light.prototype.clone.call(this,e),e.intensity=this.intensity,e.distance=this.distance,e},r.SpotLight=function(e,t,i,n,s){r.Light.call(this,e),this.position.set(0,1,0),this.target=new r.Object3D,this.intensity=void 0!==t?t:1,this.distance=void 0!==i?i:0,this.angle=void 0!==n?n:Math.PI/3,this.exponent=void 0!==s?s:10,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},r.SpotLight.prototype=Object.create(r.Light.prototype),r.SpotLight.prototype.clone=function(){var e=new r.SpotLight;return r.Light.prototype.clone.call(this,e),e.target=this.target.clone(),e.intensity=this.intensity,e.distance=this.distance,e.angle=this.angle,e.exponent=this.exponent,e.castShadow=this.castShadow,e.onlyShadow=this.onlyShadow,e},r.Loader=function(e){this.showStatus=e,this.statusDomElement=e?r.Loader.prototype.addStatusElement():null,this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}},r.Loader.prototype={constructor:r.Loader,crossOrigin:"anonymous",addStatusElement:function(){var e=document.createElement("div");return e.style.position="absolute",e.style.right="0px",e.style.top="0px",e.style.fontSize="0.8em",e.style.textAlign="left",e.style.background="rgba(0,0,0,0.25)",e.style.color="#fff",e.style.width="120px",e.style.padding="0.5em 0.5em 0.5em 0.5em",e.style.zIndex=1e3,e.innerHTML="Loading ...",e},updateProgress:function(e){var t="Loaded ";t+=e.total?(100*e.loaded/e.total).toFixed(0)+"%":(e.loaded/1e3).toFixed(2)+" KB",this.statusDomElement.innerHTML=t},extractUrlBase:function(e){var t=e.split("/");return t.pop(),(1>t.length?".":t.join("/"))+"/"},initMaterials:function(e,t){for(var i=[],n=0;e.length>n;++n)i[n]=r.Loader.prototype.createMaterial(e[n],t);return i},needsTangents:function(e){for(var t=0,i=e.length;i>t;t++){var n=e[t];if(n instanceof r.ShaderMaterial)return!0}return!1},createMaterial:function(e,t){function i(e){var t=Math.log(e)/Math.LN2;return Math.floor(t)==t}function n(e){var t=Math.log(e)/Math.LN2;return Math.pow(2,Math.round(t))}function s(e,t){var r=new Image;r.onload=function(){if(i(this.width)&&i(this.height))e.image=this;else{var t=n(this.width),r=n(this.height);e.image.width=t,e.image.height=r,e.image.getContext("2d").drawImage(this,0,0,t,r)}e.needsUpdate=!0},r.crossOrigin=l.crossOrigin,r.src=t}function o(e,i,n,o,a,l,d){var c=/\.dds$/i.test(n),h=t+"/"+n;if(c){var u=r.ImageUtils.loadCompressedTexture(h);e[i]=u}else{var u=document.createElement("canvas");e[i]=new r.Texture(u)}if(e[i].sourceFile=n,o&&(e[i].repeat.set(o[0],o[1]),1!==o[0]&&(e[i].wrapS=r.RepeatWrapping),1!==o[1]&&(e[i].wrapT=r.RepeatWrapping)),a&&e[i].offset.set(a[0],a[1]),l){var p={repeat:r.RepeatWrapping,mirror:r.MirroredRepeatWrapping};void 0!==p[l[0]]&&(e[i].wrapS=p[l[0]]),void 0!==p[l[1]]&&(e[i].wrapT=p[l[1]])}d&&(e[i].anisotropy=d),c||s(e[i],h)}function a(e){return(255*e[0]<<16)+(255*e[1]<<8)+255*e[2]}var l=this,d="MeshLambertMaterial",c={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(e.shading){var h=e.shading.toLowerCase();"phong"===h?d="MeshPhongMaterial":"basic"===h&&(d="MeshBasicMaterial")}if(void 0!==e.blending&&void 0!==r[e.blending]&&(c.blending=r[e.blending]),(void 0!==e.transparent||1>e.opacity)&&(c.transparent=e.transparent),void 0!==e.depthTest&&(c.depthTest=e.depthTest),void 0!==e.depthWrite&&(c.depthWrite=e.depthWrite),void 0!==e.visible&&(c.visible=e.visible),void 0!==e.flipSided&&(c.side=r.BackSide),void 0!==e.doubleSided&&(c.side=r.DoubleSide),void 0!==e.wireframe&&(c.wireframe=e.wireframe),void 0!==e.vertexColors&&("face"===e.vertexColors?c.vertexColors=r.FaceColors:e.vertexColors&&(c.vertexColors=r.VertexColors)),e.colorDiffuse?c.color=a(e.colorDiffuse):e.DbgColor&&(c.color=e.DbgColor),e.colorSpecular&&(c.specular=a(e.colorSpecular)),e.colorAmbient&&(c.ambient=a(e.colorAmbient)),e.transparency&&(c.opacity=e.transparency),e.specularCoef&&(c.shininess=e.specularCoef),e.mapDiffuse&&t&&o(c,"map",e.mapDiffuse,e.mapDiffuseRepeat,e.mapDiffuseOffset,e.mapDiffuseWrap,e.mapDiffuseAnisotropy),e.mapLight&&t&&o(c,"lightMap",e.mapLight,e.mapLightRepeat,e.mapLightOffset,e.mapLightWrap,e.mapLightAnisotropy),e.mapBump&&t&&o(c,"bumpMap",e.mapBump,e.mapBumpRepeat,e.mapBumpOffset,e.mapBumpWrap,e.mapBumpAnisotropy),e.mapNormal&&t&&o(c,"normalMap",e.mapNormal,e.mapNormalRepeat,e.mapNormalOffset,e.mapNormalWrap,e.mapNormalAnisotropy),e.mapSpecular&&t&&o(c,"specularMap",e.mapSpecular,e.mapSpecularRepeat,e.mapSpecularOffset,e.mapSpecularWrap,e.mapSpecularAnisotropy),e.mapBumpScale&&(c.bumpScale=e.mapBumpScale),e.mapNormal){var u=r.ShaderLib.normalmap,p=r.UniformsUtils.clone(u.uniforms);p.tNormal.value=c.normalMap,e.mapNormalFactor&&p.uNormalScale.value.set(e.mapNormalFactor,e.mapNormalFactor),c.map&&(p.tDiffuse.value=c.map,p.enableDiffuse.value=!0),c.specularMap&&(p.tSpecular.value=c.specularMap,p.enableSpecular.value=!0),c.lightMap&&(p.tAO.value=c.lightMap,p.enableAO.value=!0),p.uDiffuseColor.value.setHex(c.color),p.uSpecularColor.value.setHex(c.specular),p.uAmbientColor.value.setHex(c.ambient),p.uShininess.value=c.shininess,void 0!==c.opacity&&(p.uOpacity.value=c.opacity);var f={fragmentShader:u.fragmentShader,vertexShader:u.vertexShader,uniforms:p,lights:!0,fog:!0},g=new r.ShaderMaterial(f);c.transparent&&(g.transparent=!0)}else var g=new r[d](c);return void 0!==e.DbgName&&(g.name=e.DbgName),g}},r.XHRLoader=function(e){this.manager=void 0!==e?e:r.DefaultLoadingManager},r.XHRLoader.prototype={constructor:r.XHRLoader,load:function(e,t,i,r){var n=this,s=new XMLHttpRequest;void 0!==t&&s.addEventListener("load",function(i){n.manager.itemEnd(e),t(i.target.responseText)},!1),void 0!==i&&s.addEventListener("progress",function(e){i(e)},!1),void 0!==r&&s.addEventListener("error",function(e){r(e)},!1),void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),s.open("GET",e,!0),s.send(null),n.manager.itemStart(e)},setCrossOrigin:function(e){this.crossOrigin=e}},r.ImageLoader=function(e){this.manager=void 0!==e?e:r.DefaultLoadingManager},r.ImageLoader.prototype={constructor:r.ImageLoader,load:function(e,t,i,r){var n=this,s=document.createElement("img");void 0!==t&&s.addEventListener("load",function(){n.manager.itemEnd(e),t(this)},!1),void 0!==i&&s.addEventListener("progress",function(e){i(e)},!1),void 0!==r&&s.addEventListener("error",function(e){r(e)},!1),void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),s.src=e,n.manager.itemStart(e)},setCrossOrigin:function(e){this.crossOrigin=e}},r.JSONLoader=function(e){r.Loader.call(this,e),this.withCredentials=!1},r.JSONLoader.prototype=Object.create(r.Loader.prototype),r.JSONLoader.prototype.load=function(e,t,i){i=i&&"string"==typeof i?i:this.extractUrlBase(e),this.onLoadStart(),this.loadAjaxJSON(this,e,t,i)},r.JSONLoader.prototype.loadAjaxJSON=function(e,t,i,r,n){var s=new XMLHttpRequest,o=0;s.onreadystatechange=function(){if(s.readyState===s.DONE)if(200===s.status||0===s.status){if(s.responseText){var a=JSON.parse(s.responseText),l=e.parse(a,r);i(l.geometry,l.materials)}else console.warn("THREE.JSONLoader: ["+t+"] seems to be unreachable or file there is empty");e.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load ["+t+"] ["+s.status+"]");else s.readyState===s.LOADING?n&&(0===o&&(o=s.getResponseHeader("Content-Length")),n({total:o,loaded:s.responseText.length})):s.readyState===s.HEADERS_RECEIVED&&void 0!==n&&(o=s.getResponseHeader("Content-Length"))},s.open("GET",t,!0),s.withCredentials=this.withCredentials,s.send(null)},r.JSONLoader.prototype.parse=function(e,t){function i(t){function i(e,t){return e&1<<t}var n,s,a,l,d,c,h,u,p,f,g,v,m,y,w,x,b,E,_,T,C,M,S,A,R,U,D,P=e.faces,j=e.vertices,B=e.normals,H=e.colors,k=0;for(n=0;e.uvs.length>n;n++)e.uvs[n].length&&k++;for(n=0;k>n;n++)o.faceUvs[n]=[],o.faceVertexUvs[n]=[];for(l=0,d=j.length;d>l;)T=new r.Vector3,T.x=j[l++]*t,T.y=j[l++]*t,T.z=j[l++]*t,o.vertices.push(T);for(l=0,d=P.length;d>l;){if(g=P[l++],v=i(g,0),m=i(g,1),y=i(g,2),w=i(g,3),x=i(g,4),b=i(g,5),E=i(g,6),_=i(g,7),v?(C=new r.Face4,C.a=P[l++],C.b=P[l++],C.c=P[l++],C.d=P[l++],c=4):(C=new r.Face3,C.a=P[l++],C.b=P[l++],C.c=P[l++],c=3),m&&(f=P[l++],C.materialIndex=f),a=o.faces.length,y)for(n=0;k>n;n++)A=e.uvs[n],p=P[l++],U=A[2*p],D=A[2*p+1],o.faceUvs[n][a]=new r.Vector2(U,D);if(w)for(n=0;k>n;n++){for(A=e.uvs[n],R=[],s=0;c>s;s++)p=P[l++],U=A[2*p],D=A[2*p+1],R[s]=new r.Vector2(U,D);o.faceVertexUvs[n][a]=R}if(x&&(u=3*P[l++],S=new r.Vector3,S.x=B[u++],S.y=B[u++],S.z=B[u],C.normal=S),b)for(n=0;c>n;n++)u=3*P[l++],S=new r.Vector3,S.x=B[u++],S.y=B[u++],S.z=B[u],C.vertexNormals.push(S);if(E&&(h=P[l++],M=new r.Color(H[h]),C.color=M),_)for(n=0;c>n;n++)h=P[l++],M=new r.Color(H[h]),C.vertexColors.push(M);o.faces.push(C)}}function n(){var t,i,n,s,a,l,d,c,h,u;if(e.skinWeights)for(t=0,i=e.skinWeights.length;i>t;t+=2)n=e.skinWeights[t],s=e.skinWeights[t+1],a=0,l=0,o.skinWeights.push(new r.Vector4(n,s,a,l));if(e.skinIndices)for(t=0,i=e.skinIndices.length;i>t;t+=2)d=e.skinIndices[t],c=e.skinIndices[t+1],h=0,u=0,o.skinIndices.push(new r.Vector4(d,c,h,u));o.bones=e.bones,o.animation=e.animation}function s(t){if(void 0!==e.morphTargets){var i,n,s,a,l,d;for(i=0,n=e.morphTargets.length;n>i;i++)for(o.morphTargets[i]={},o.morphTargets[i].name=e.morphTargets[i].name,o.morphTargets[i].vertices=[],l=o.morphTargets[i].vertices,d=e.morphTargets[i].vertices,s=0,a=d.length;a>s;s+=3){var c=new r.Vector3;c.x=d[s]*t,c.y=d[s+1]*t,c.z=d[s+2]*t,l.push(c)}}if(void 0!==e.morphColors){var i,n,h,u,p,f,g;for(i=0,n=e.morphColors.length;n>i;i++)for(o.morphColors[i]={},o.morphColors[i].name=e.morphColors[i].name,o.morphColors[i].colors=[],p=o.morphColors[i].colors,f=e.morphColors[i].colors,h=0,u=f.length;u>h;h+=3)g=new r.Color(16755200),g.setRGB(f[h],f[h+1],f[h+2]),p.push(g)}}var o=new r.Geometry,a=void 0!==e.scale?1/e.scale:1;if(i(a),n(),s(a),o.computeCentroids(),o.computeFaceNormals(),void 0===e.materials)return{geometry:o};var l=this.initMaterials(e.materials,t);return this.needsTangents(l)&&o.computeTangents(),{geometry:o,materials:l}},r.LoadingManager=function(e,t,i){var r=this,n=0,s=0;this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(){s++},this.itemEnd=function(e){n++,void 0!==r.onProgress&&r.onProgress(e,n,s),n===s&&void 0!==r.onLoad&&r.onLoad()}},r.DefaultLoadingManager=new r.LoadingManager,r.GeometryLoader=function(e){this.manager=void 0!==e?e:r.DefaultLoadingManager},r.GeometryLoader.prototype={constructor:r.GeometryLoader,load:function(e,t){var i=this,n=new r.XHRLoader;n.setCrossOrigin(this.crossOrigin),n.load(e,function(e){t(i.parse(JSON.parse(e)))})},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(){}},r.MaterialLoader=function(e){this.manager=void 0!==e?e:r.DefaultLoadingManager},r.MaterialLoader.prototype={constructor:r.MaterialLoader,load:function(e,t){var i=this,n=new r.XHRLoader;n.setCrossOrigin(this.crossOrigin),n.load(e,function(e){t(i.parse(JSON.parse(e)))})},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e){var t;switch(e.type){case"MeshBasicMaterial":t=new r.MeshBasicMaterial({color:e.color,opacity:e.opacity,transparent:e.transparent,wireframe:e.wireframe});break;case"MeshLambertMaterial":t=new r.MeshLambertMaterial({color:e.color,ambient:e.ambient,emissive:e.emissive,opacity:e.opacity,transparent:e.transparent,wireframe:e.wireframe});break;case"MeshPhongMaterial":t=new r.MeshPhongMaterial({color:e.color,ambient:e.ambient,emissive:e.emissive,specular:e.specular,shininess:e.shininess,opacity:e.opacity,transparent:e.transparent,wireframe:e.wireframe});break;case"MeshNormalMaterial":t=new r.MeshNormalMaterial({opacity:e.opacity,transparent:e.transparent,wireframe:e.wireframe});break;case"MeshDepthMaterial":t=new r.MeshDepthMaterial({opacity:e.opacity,transparent:e.transparent,wireframe:e.wireframe})}return t}},r.ObjectLoader=function(e){this.manager=void 0!==e?e:r.DefaultLoadingManager},r.ObjectLoader.prototype={constructor:r.ObjectLoader,load:function(e,t){var i=this,n=new r.XHRLoader(i.manager);n.setCrossOrigin(this.crossOrigin),n.load(e,function(e){t(i.parse(JSON.parse(e)))})},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e){var t=this.parseGeometries(e.geometries),i=this.parseMaterials(e.materials),r=this.parseObject(e.object,t,i);return r},parseGeometries:function(e){var t={};if(void 0!==e)for(var i=new r.JSONLoader,n=0,s=e.length;s>n;n++){var o,a=e[n];switch(a.type){case"PlaneGeometry":o=new r.PlaneGeometry(a.width,a.height,a.widthSegments,a.heightSegments);break;case"CubeGeometry":o=new r.CubeGeometry(a.width,a.height,a.depth,a.widthSegments,a.heightSegments,a.depthSegments);break;case"CylinderGeometry":o=new r.CylinderGeometry(a.radiusTop,a.radiusBottom,a.height,a.radiusSegments,a.heightSegments,a.openEnded);break;case"SphereGeometry":o=new r.SphereGeometry(a.radius,a.widthSegments,a.heightSegments,a.phiStart,a.phiLength,a.thetaStart,a.thetaLength);break;case"IcosahedronGeometry":o=new r.IcosahedronGeometry(a.radius,a.detail);break;case"TorusGeometry":o=new r.TorusGeometry(a.radius,a.tube,a.radialSegments,a.tubularSegments,a.arc);break;case"TorusKnotGeometry":o=new r.TorusKnotGeometry(a.radius,a.tube,a.radialSegments,a.tubularSegments,a.p,a.q,a.heightScale);break;case"Geometry":o=i.parse(a.data).geometry}void 0!==a.id&&(o.id=a.id),void 0!==a.name&&(o.name=a.name),t[a.id]=o}return t},parseMaterials:function(e){var t={};if(void 0!==e)for(var i=new r.MaterialLoader,n=0,s=e.length;s>n;n++){var o=e[n],a=i.parse(o);void 0!==o.id&&(a.id=o.id),void 0!==o.name&&(a.name=o.name),t[o.id]=a}return t},parseObject:function(e,t,i){var n;switch(e.type){case"Scene":n=new r.Scene;break;case"PerspectiveCamera":n=new r.PerspectiveCamera(e.fov,e.aspect,e.near,e.far),n.position.fromArray(e.position),n.rotation.fromArray(e.rotation);break;case"OrthographicCamera":n=new r.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far),n.position.fromArray(e.position),n.rotation.fromArray(e.rotation);break;case"AmbientLight":n=new r.AmbientLight(e.color);break;case"DirectionalLight":n=new r.DirectionalLight(e.color,e.intensity),n.position.fromArray(e.position);break;case"PointLight":n=new r.PointLight(e.color,e.intensity,e.distance),n.position.fromArray(e.position);break;case"SpotLight":n=new r.SpotLight(e.color,e.intensity,e.distance,e.angle,e.exponent),n.position.fromArray(e.position);break;case"HemisphereLight":n=new r.HemisphereLight(e.color,e.groundColor,e.intensity),n.position.fromArray(e.position);break;case"Mesh":n=new r.Mesh(t[e.geometry],i[e.material]),n.position.fromArray(e.position),n.rotation.fromArray(e.rotation),n.scale.fromArray(e.scale);break;default:n=new r.Object3D,n.position.fromArray(e.position),n.rotation.fromArray(e.rotation),n.scale.fromArray(e.scale)}if(void 0!==e.id&&(n.id=e.id),void 0!==e.name&&(n.name=e.name),void 0!==e.visible&&(n.visible=e.visible),void 0!==e.userData&&(n.userData=e.userData),void 0!==e.children)for(var s in e.children)n.add(this.parseObject(e.children[s],t,i));return n}},r.SceneLoader=function(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){},this.callbackSync=function(){},this.callbackProgress=function(){},this.geometryHandlers={},this.hierarchyHandlers={},this.addGeometryHandler("ascii",r.JSONLoader)},r.SceneLoader.prototype={constructor:r.SceneLoader,load:function(e,t){var i=this,n=new r.XHRLoader(i.manager);n.setCrossOrigin(this.crossOrigin),n.load(e,function(r){i.parse(JSON.parse(r),t,e)})},setCrossOrigin:function(e){this.crossOrigin=e},addGeometryHandler:function(e,t){this.geometryHandlers[e]={loaderClass:t}},addHierarchyHandler:function(e,t){this.hierarchyHandlers[e]={loaderClass:t}},parse:function(e,t,i){function n(e,t){return"relativeToHTML"==t?e:U+"/"+e}function s(){o(A.scene,P.objects)}function o(e,t){var i,s,a,l,d,h;for(var u in t){var p=A.objects[u],f=t[u];if(void 0===p){if(f.type&&f.type in R.hierarchyHandlers){if(void 0===f.loading){var y={type:1,url:1,material:1,position:1,rotation:1,scale:1,visible:1,children:1,userData:1,skin:1,morph:1,mirroredLoop:1,duration:1},w={};for(var x in f)x in y||(w[x]=f[x]);v=A.materials[f.material],f.loading=!0;var T=R.hierarchyHandlers[f.type].loaderObject;T.options?T.load(n(f.url,P.urlBaseType),c(u,e,v,f)):T.load(n(f.url,P.urlBaseType),c(u,e,v,f),w)}}else if(void 0!==f.geometry){if(g=A.geometries[f.geometry]){var C=!1;if(v=A.materials[f.material],C=v instanceof r.ShaderMaterial,a=f.position,l=f.rotation,d=f.scale,i=f.matrix,h=f.quaternion,f.material||(v=new r.MeshFaceMaterial(A.face_materials[f.geometry])),v instanceof r.MeshFaceMaterial&&0===v.materials.length&&(v=new r.MeshFaceMaterial(A.face_materials[f.geometry])),v instanceof r.MeshFaceMaterial)for(var M=0;v.materials.length>M;M++)C=C||v.materials[M]instanceof r.ShaderMaterial;C&&g.computeTangents(),f.skin?p=new r.SkinnedMesh(g,v):f.morph?(p=new r.MorphAnimMesh(g,v),void 0!==f.duration&&(p.duration=f.duration),void 0!==f.time&&(p.time=f.time),void 0!==f.mirroredLoop&&(p.mirroredLoop=f.mirroredLoop),v.morphNormals&&g.computeMorphNormals()):p=new r.Mesh(g,v),p.name=u,i?(p.matrixAutoUpdate=!1,p.matrix.set(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],i[9],i[10],i[11],i[12],i[13],i[14],i[15])):(p.position.fromArray(a),h?(p.quaternion.fromArray(h),p.useQuaternion=!0):p.rotation.fromArray(l),p.scale.fromArray(d)),p.visible=f.visible,p.castShadow=f.castShadow,p.receiveShadow=f.receiveShadow,e.add(p),A.objects[u]=p}}else"DirectionalLight"===f.type||"PointLight"===f.type||"AmbientLight"===f.type?(E=void 0!==f.color?f.color:16777215,_=void 0!==f.intensity?f.intensity:1,"DirectionalLight"===f.type?(a=f.direction,b=new r.DirectionalLight(E,_),b.position.fromArray(a),f.target&&(D.push({object:b,targetName:f.target}),b.target=null)):"PointLight"===f.type?(a=f.position,s=f.distance,b=new r.PointLight(E,_,s),b.position.fromArray(a)):"AmbientLight"===f.type&&(b=new r.AmbientLight(E)),e.add(b),b.name=u,A.lights[u]=b,A.objects[u]=b):"PerspectiveCamera"===f.type||"OrthographicCamera"===f.type?(a=f.position,l=f.rotation,h=f.quaternion,"PerspectiveCamera"===f.type?m=new r.PerspectiveCamera(f.fov,f.aspect,f.near,f.far):"OrthographicCamera"===f.type&&(m=new r.OrthographicCamera(f.left,f.right,f.top,f.bottom,f.near,f.far)),m.name=u,m.position.fromArray(a),void 0!==h?(m.quaternion.fromArray(h),m.useQuaternion=!0):void 0!==l&&m.rotation.fromArray(l),e.add(m),A.cameras[u]=m,A.objects[u]=m):(a=f.position,l=f.rotation,d=f.scale,h=f.quaternion,p=new r.Object3D,p.name=u,p.position.fromArray(a),h?(p.quaternion.fromArray(h),p.useQuaternion=!0):p.rotation.fromArray(l),p.scale.fromArray(d),p.visible=void 0!==f.visible?f.visible:!1,e.add(p),A.objects[u]=p,A.empties[u]=p);if(p){if(void 0!==f.userData)for(var S in f.userData){var U=f.userData[S];p.userData[S]=U}if(void 0!==f.groups)for(var M=0;f.groups.length>M;M++){var j=f.groups[M];void 0===A.groups[j]&&(A.groups[j]=[]),A.groups[j].push(u)}}}void 0!==p&&void 0!==f.children&&o(p,f.children)}}function a(e,t,i){A.geometries[i]=e,A.face_materials[i]=t,s()}function l(e,t,i,r,n){var o=n.position,a=n.rotation,l=n.quaternion,d=n.scale;e.position.fromArray(o),l?(e.quaternion.fromArray(l),e.useQuaternion=!0):e.rotation.fromArray(a),e.scale.fromArray(d),r&&e.traverse(function(e){e.material=r});var c=void 0!==n.visible?n.visible:!0;e.traverse(function(e){e.visible=c}),i.add(e),e.name=t,A.objects[t]=e,s()}function d(e){return function(t,i){t.name=e,a(t,i,e),T-=1,R.onLoadComplete(),u()}}function c(e,t,i,r){return function(n){var s;s=n.content?n.content:n.dae?n.scene:n,l(s,e,t,i,r),T-=1,R.onLoadComplete(),u()}}function h(e){return function(t,i){t.name=e,A.geometries[e]=t,A.face_materials[e]=i
}}function u(){var e={totalModels:M,totalTextures:S,loadedModels:M-T,loadedTextures:S-C};R.callbackProgress(e,A),R.onLoadProgress(),0===T&&0===C&&(p(),t(A))}function p(){for(var e=0;D.length>e;e++){var t=D[e],i=A.objects[t.targetName];i?t.object.target=i:(t.object.target=new r.Object3D,A.scene.add(t.object.target)),t.object.target.userData.targetInverse=t.object}}function f(e,t){if(t(e),void 0!==e.children)for(var i in e.children)f(e.children[i],t)}var g,v,m,y,w,x,b,E,_,T,C,M,S,A,R=this,U=r.Loader.prototype.extractUrlBase(i),D=[],P=e;for(var j in this.geometryHandlers){var B=this.geometryHandlers[j].loaderClass;this.geometryHandlers[j].loaderObject=new B}for(var j in this.hierarchyHandlers){var B=this.hierarchyHandlers[j].loaderClass;this.hierarchyHandlers[j].loaderObject=new B}if(T=0,C=0,A={scene:new r.Scene,geometries:{},face_materials:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},empties:{},groups:{}},P.transform){var H=P.transform.position,k=P.transform.rotation,L=P.transform.scale;H&&A.scene.position.fromArray(H),k&&A.scene.rotation.fromArray(k),L&&A.scene.scale.fromArray(L),(H||k||L)&&(A.scene.updateMatrix(),A.scene.updateMatrixWorld())}var I,N,F=function(e){C-=e,u(),R.onLoadComplete()},O=function(e){return function(){F(e)}};for(I in P.fogs)N=P.fogs[I],"linear"===N.type?y=new r.Fog(0,N.near,N.far):"exp2"===N.type&&(y=new r.FogExp2(0,N.density)),x=N.color,y.color.setRGB(x[0],x[1],x[2]),A.fogs[I]=y;var z,V;for(z in P.geometries)V=P.geometries[z],V.type in this.geometryHandlers&&(T+=1,R.onLoadStart());for(var W in P.objects)f(P.objects[W],function(e){e.type&&e.type in R.hierarchyHandlers&&(T+=1,R.onLoadStart())});M=T;for(z in P.geometries)if(V=P.geometries[z],"cube"===V.type)g=new r.CubeGeometry(V.width,V.height,V.depth,V.widthSegments,V.heightSegments,V.depthSegments),g.name=z,A.geometries[z]=g;else if("plane"===V.type)g=new r.PlaneGeometry(V.width,V.height,V.widthSegments,V.heightSegments),g.name=z,A.geometries[z]=g;else if("sphere"===V.type)g=new r.SphereGeometry(V.radius,V.widthSegments,V.heightSegments),g.name=z,A.geometries[z]=g;else if("cylinder"===V.type)g=new r.CylinderGeometry(V.topRad,V.botRad,V.height,V.radSegs,V.heightSegs),g.name=z,A.geometries[z]=g;else if("torus"===V.type)g=new r.TorusGeometry(V.radius,V.tube,V.segmentsR,V.segmentsT),g.name=z,A.geometries[z]=g;else if("icosahedron"===V.type)g=new r.IcosahedronGeometry(V.radius,V.subdivisions),g.name=z,A.geometries[z]=g;else if(V.type in this.geometryHandlers){var G={};for(var X in V)"type"!==X&&"url"!==X&&(G[X]=V[X]);var q=this.geometryHandlers[V.type].loaderObject;q.load(n(V.url,P.urlBaseType),d(z),G)}else if("embedded"===V.type){var $=P.embeds[V.id],Y="";if($.metadata=P.metadata,$){var K=this.geometryHandlers.ascii.loaderObject,J=K.parse($,Y);h(z)(J.geometry,J.materials)}}var Q,Z;for(Q in P.textures)if(Z=P.textures[Q],Z.url instanceof Array){C+=Z.url.length;for(var et=0;Z.url.length>et;et++)R.onLoadStart()}else C+=1,R.onLoadStart();S=C;for(Q in P.textures){if(Z=P.textures[Q],void 0!==Z.mapping&&void 0!==r[Z.mapping]&&(Z.mapping=new r[Z.mapping]),Z.url instanceof Array){for(var tt=Z.url.length,it=[],rt=0;tt>rt;rt++)it[rt]=n(Z.url[rt],P.urlBaseType);var nt=/\.dds$/i.test(it[0]);w=nt?r.ImageUtils.loadCompressedTextureCube(it,Z.mapping,O(tt)):r.ImageUtils.loadTextureCube(it,Z.mapping,O(tt))}else{var nt=/\.dds$/i.test(Z.url),st=n(Z.url,P.urlBaseType),ot=O(1);if(w=nt?r.ImageUtils.loadCompressedTexture(st,Z.mapping,ot):r.ImageUtils.loadTexture(st,Z.mapping,ot),void 0!==r[Z.minFilter]&&(w.minFilter=r[Z.minFilter]),void 0!==r[Z.magFilter]&&(w.magFilter=r[Z.magFilter]),Z.anisotropy&&(w.anisotropy=Z.anisotropy),Z.repeat&&(w.repeat.set(Z.repeat[0],Z.repeat[1]),1!==Z.repeat[0]&&(w.wrapS=r.RepeatWrapping),1!==Z.repeat[1]&&(w.wrapT=r.RepeatWrapping)),Z.offset&&w.offset.set(Z.offset[0],Z.offset[1]),Z.wrap){var at={repeat:r.RepeatWrapping,mirror:r.MirroredRepeatWrapping};void 0!==at[Z.wrap[0]]&&(w.wrapS=at[Z.wrap[0]]),void 0!==at[Z.wrap[1]]&&(w.wrapT=at[Z.wrap[1]])}}A.textures[Q]=w}var lt,dt,ct;for(lt in P.materials){dt=P.materials[lt];for(ct in dt.parameters)if("envMap"===ct||"map"===ct||"lightMap"===ct||"bumpMap"===ct)dt.parameters[ct]=A.textures[dt.parameters[ct]];else if("shading"===ct)dt.parameters[ct]="flat"===dt.parameters[ct]?r.FlatShading:r.SmoothShading;else if("side"===ct)dt.parameters[ct]="double"==dt.parameters[ct]?r.DoubleSide:"back"==dt.parameters[ct]?r.BackSide:r.FrontSide;else if("blending"===ct)dt.parameters[ct]=dt.parameters[ct]in r?r[dt.parameters[ct]]:r.NormalBlending;else if("combine"===ct)dt.parameters[ct]=dt.parameters[ct]in r?r[dt.parameters[ct]]:r.MultiplyOperation;else if("vertexColors"===ct)"face"==dt.parameters[ct]?dt.parameters[ct]=r.FaceColors:dt.parameters[ct]&&(dt.parameters[ct]=r.VertexColors);else if("wrapRGB"===ct){var ht=dt.parameters[ct];dt.parameters[ct]=new r.Vector3(ht[0],ht[1],ht[2])}if(void 0!==dt.parameters.opacity&&1>dt.parameters.opacity&&(dt.parameters.transparent=!0),dt.parameters.normalMap){var ut=r.ShaderLib.normalmap,pt=r.UniformsUtils.clone(ut.uniforms),ft=dt.parameters.color,gt=dt.parameters.specular,vt=dt.parameters.ambient,mt=dt.parameters.shininess;pt.tNormal.value=A.textures[dt.parameters.normalMap],dt.parameters.normalScale&&pt.uNormalScale.value.set(dt.parameters.normalScale[0],dt.parameters.normalScale[1]),dt.parameters.map&&(pt.tDiffuse.value=dt.parameters.map,pt.enableDiffuse.value=!0),dt.parameters.envMap&&(pt.tCube.value=dt.parameters.envMap,pt.enableReflection.value=!0,pt.uReflectivity.value=dt.parameters.reflectivity),dt.parameters.lightMap&&(pt.tAO.value=dt.parameters.lightMap,pt.enableAO.value=!0),dt.parameters.specularMap&&(pt.tSpecular.value=A.textures[dt.parameters.specularMap],pt.enableSpecular.value=!0),dt.parameters.displacementMap&&(pt.tDisplacement.value=A.textures[dt.parameters.displacementMap],pt.enableDisplacement.value=!0,pt.uDisplacementBias.value=dt.parameters.displacementBias,pt.uDisplacementScale.value=dt.parameters.displacementScale),pt.uDiffuseColor.value.setHex(ft),pt.uSpecularColor.value.setHex(gt),pt.uAmbientColor.value.setHex(vt),pt.uShininess.value=mt,dt.parameters.opacity&&(pt.uOpacity.value=dt.parameters.opacity);var yt={fragmentShader:ut.fragmentShader,vertexShader:ut.vertexShader,uniforms:pt,lights:!0,fog:!0};v=new r.ShaderMaterial(yt)}else v=new r[dt.type](dt.parameters);v.name=lt,A.materials[lt]=v}for(lt in P.materials)if(dt=P.materials[lt],dt.parameters.materials){for(var wt=[],rt=0;dt.parameters.materials.length>rt;rt++){var xt=dt.parameters.materials[rt];wt.push(A.materials[xt])}A.materials[lt].materials=wt}s(),A.cameras&&P.defaults.camera&&(A.currentCamera=A.cameras[P.defaults.camera]),A.fogs&&P.defaults.fog&&(A.scene.fog=A.fogs[P.defaults.fog]),R.callbackSync(A),u()}},r.TextureLoader=function(e){this.manager=void 0!==e?e:r.DefaultLoadingManager},r.TextureLoader.prototype={constructor:r.TextureLoader,load:function(e,t){var i=this,n=new r.ImageLoader(i.manager);n.setCrossOrigin(this.crossOrigin),n.load(e,function(e){var i=new r.Texture(e);i.needsUpdate=!0,void 0!==t&&t(i)})},setCrossOrigin:function(e){this.crossOrigin=e}},r.Material=function(){this.id=r.Math.generateUUID(),this.name="",this.side=r.FrontSide,this.opacity=1,this.transparent=!1,this.blending=r.NormalBlending,this.blendSrc=r.SrcAlphaFactor,this.blendDst=r.OneMinusSrcAlphaFactor,this.blendEquation=r.AddEquation,this.depthTest=!0,this.depthWrite=!0,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.alphaTest=0,this.overdraw=0,this.visible=!0,this.needsUpdate=!0},r.Material.prototype={constructor:r.Material,addEventListener:r.EventDispatcher.prototype.addEventListener,hasEventListener:r.EventDispatcher.prototype.hasEventListener,removeEventListener:r.EventDispatcher.prototype.removeEventListener,dispatchEvent:r.EventDispatcher.prototype.dispatchEvent,setValues:function(e){if(void 0!==e)for(var t in e){var i=e[t];if(void 0!==i){if(t in this){var n=this[t];n instanceof r.Color?n.set(i):n instanceof r.Vector3&&i instanceof r.Vector3?n.copy(i):this[t]="overdraw"==t?Number(i):i}}else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},clone:function(e){return void 0===e&&(e=new r.Material),e.name=this.name,e.side=this.side,e.opacity=this.opacity,e.transparent=this.transparent,e.blending=this.blending,e.blendSrc=this.blendSrc,e.blendDst=this.blendDst,e.blendEquation=this.blendEquation,e.depthTest=this.depthTest,e.depthWrite=this.depthWrite,e.polygonOffset=this.polygonOffset,e.polygonOffsetFactor=this.polygonOffsetFactor,e.polygonOffsetUnits=this.polygonOffsetUnits,e.alphaTest=this.alphaTest,e.overdraw=this.overdraw,e.visible=this.visible,e},dispose:function(){this.dispatchEvent({type:"dispose"})}},r.LineBasicMaterial=function(e){r.Material.call(this),this.color=new r.Color(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.vertexColors=!1,this.fog=!0,this.setValues(e)},r.LineBasicMaterial.prototype=Object.create(r.Material.prototype),r.LineBasicMaterial.prototype.clone=function(){var e=new r.LineBasicMaterial;return r.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.linewidth=this.linewidth,e.linecap=this.linecap,e.linejoin=this.linejoin,e.vertexColors=this.vertexColors,e.fog=this.fog,e},r.LineDashedMaterial=function(e){r.Material.call(this),this.color=new r.Color(16777215),this.linewidth=1,this.scale=1,this.dashSize=3,this.gapSize=1,this.vertexColors=!1,this.fog=!0,this.setValues(e)},r.LineDashedMaterial.prototype=Object.create(r.Material.prototype),r.LineDashedMaterial.prototype.clone=function(){var e=new r.LineDashedMaterial;return r.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.linewidth=this.linewidth,e.scale=this.scale,e.dashSize=this.dashSize,e.gapSize=this.gapSize,e.vertexColors=this.vertexColors,e.fog=this.fog,e},r.MeshBasicMaterial=function(e){r.Material.call(this),this.color=new r.Color(16777215),this.map=null,this.lightMap=null,this.specularMap=null,this.envMap=null,this.combine=r.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=r.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=r.NoColors,this.skinning=!1,this.morphTargets=!1,this.setValues(e)},r.MeshBasicMaterial.prototype=Object.create(r.Material.prototype),r.MeshBasicMaterial.prototype.clone=function(){var e=new r.MeshBasicMaterial;return r.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.map=this.map,e.lightMap=this.lightMap,e.specularMap=this.specularMap,e.envMap=this.envMap,e.combine=this.combine,e.reflectivity=this.reflectivity,e.refractionRatio=this.refractionRatio,e.fog=this.fog,e.shading=this.shading,e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e.wireframeLinecap=this.wireframeLinecap,e.wireframeLinejoin=this.wireframeLinejoin,e.vertexColors=this.vertexColors,e.skinning=this.skinning,e.morphTargets=this.morphTargets,e},r.MeshLambertMaterial=function(e){r.Material.call(this),this.color=new r.Color(16777215),this.ambient=new r.Color(16777215),this.emissive=new r.Color(0),this.wrapAround=!1,this.wrapRGB=new r.Vector3(1,1,1),this.map=null,this.lightMap=null,this.specularMap=null,this.envMap=null,this.combine=r.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=r.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=r.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)},r.MeshLambertMaterial.prototype=Object.create(r.Material.prototype),r.MeshLambertMaterial.prototype.clone=function(){var e=new r.MeshLambertMaterial;return r.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.ambient.copy(this.ambient),e.emissive.copy(this.emissive),e.wrapAround=this.wrapAround,e.wrapRGB.copy(this.wrapRGB),e.map=this.map,e.lightMap=this.lightMap,e.specularMap=this.specularMap,e.envMap=this.envMap,e.combine=this.combine,e.reflectivity=this.reflectivity,e.refractionRatio=this.refractionRatio,e.fog=this.fog,e.shading=this.shading,e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e.wireframeLinecap=this.wireframeLinecap,e.wireframeLinejoin=this.wireframeLinejoin,e.vertexColors=this.vertexColors,e.skinning=this.skinning,e.morphTargets=this.morphTargets,e.morphNormals=this.morphNormals,e},r.MeshPhongMaterial=function(e){r.Material.call(this),this.color=new r.Color(16777215),this.ambient=new r.Color(16777215),this.emissive=new r.Color(0),this.specular=new r.Color(1118481),this.shininess=30,this.metal=!1,this.perPixel=!0,this.wrapAround=!1,this.wrapRGB=new r.Vector3(1,1,1),this.map=null,this.lightMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new r.Vector2(1,1),this.specularMap=null,this.envMap=null,this.combine=r.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=r.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=r.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)},r.MeshPhongMaterial.prototype=Object.create(r.Material.prototype),r.MeshPhongMaterial.prototype.clone=function(){var e=new r.MeshPhongMaterial;return r.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.ambient.copy(this.ambient),e.emissive.copy(this.emissive),e.specular.copy(this.specular),e.shininess=this.shininess,e.metal=this.metal,e.perPixel=this.perPixel,e.wrapAround=this.wrapAround,e.wrapRGB.copy(this.wrapRGB),e.map=this.map,e.lightMap=this.lightMap,e.bumpMap=this.bumpMap,e.bumpScale=this.bumpScale,e.normalMap=this.normalMap,e.normalScale.copy(this.normalScale),e.specularMap=this.specularMap,e.envMap=this.envMap,e.combine=this.combine,e.reflectivity=this.reflectivity,e.refractionRatio=this.refractionRatio,e.fog=this.fog,e.shading=this.shading,e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e.wireframeLinecap=this.wireframeLinecap,e.wireframeLinejoin=this.wireframeLinejoin,e.vertexColors=this.vertexColors,e.skinning=this.skinning,e.morphTargets=this.morphTargets,e.morphNormals=this.morphNormals,e},r.MeshDepthMaterial=function(e){r.Material.call(this),this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)},r.MeshDepthMaterial.prototype=Object.create(r.Material.prototype),r.MeshDepthMaterial.prototype.clone=function(){var e=new r.MeshDepthMaterial;return r.Material.prototype.clone.call(this,e),e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e},r.MeshNormalMaterial=function(e){r.Material.call(this,e),this.shading=r.FlatShading,this.wireframe=!1,this.wireframeLinewidth=1,this.morphTargets=!1,this.setValues(e)},r.MeshNormalMaterial.prototype=Object.create(r.Material.prototype),r.MeshNormalMaterial.prototype.clone=function(){var e=new r.MeshNormalMaterial;return r.Material.prototype.clone.call(this,e),e.shading=this.shading,e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e},r.MeshFaceMaterial=function(e){this.materials=e instanceof Array?e:[]},r.MeshFaceMaterial.prototype.clone=function(){return new r.MeshFaceMaterial(this.materials.slice(0))},r.ParticleBasicMaterial=function(e){r.Material.call(this),this.color=new r.Color(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.vertexColors=!1,this.fog=!0,this.setValues(e)},r.ParticleBasicMaterial.prototype=Object.create(r.Material.prototype),r.ParticleBasicMaterial.prototype.clone=function(){var e=new r.ParticleBasicMaterial;return r.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.map=this.map,e.size=this.size,e.sizeAttenuation=this.sizeAttenuation,e.vertexColors=this.vertexColors,e.fog=this.fog,e},r.ParticleCanvasMaterial=function(e){r.Material.call(this),this.color=new r.Color(16777215),this.program=function(){},this.setValues(e)},r.ParticleCanvasMaterial.prototype=Object.create(r.Material.prototype),r.ParticleCanvasMaterial.prototype.clone=function(){var e=new r.ParticleCanvasMaterial;return r.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.program=this.program,e},r.ShaderMaterial=function(e){r.Material.call(this),this.fragmentShader="void main() {}",this.vertexShader="void main() {}",this.uniforms={},this.defines={},this.attributes=null,this.shading=r.SmoothShading,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.vertexColors=r.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)},r.ShaderMaterial.prototype=Object.create(r.Material.prototype),r.ShaderMaterial.prototype.clone=function(){var e=new r.ShaderMaterial;return r.Material.prototype.clone.call(this,e),e.fragmentShader=this.fragmentShader,e.vertexShader=this.vertexShader,e.uniforms=r.UniformsUtils.clone(this.uniforms),e.attributes=this.attributes,e.defines=this.defines,e.shading=this.shading,e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e.fog=this.fog,e.lights=this.lights,e.vertexColors=this.vertexColors,e.skinning=this.skinning,e.morphTargets=this.morphTargets,e.morphNormals=this.morphNormals,e},r.SpriteMaterial=function(e){r.Material.call(this),this.color=new r.Color(16777215),this.map=new r.Texture,this.useScreenCoordinates=!0,this.depthTest=!this.useScreenCoordinates,this.sizeAttenuation=!this.useScreenCoordinates,this.scaleByViewport=!this.sizeAttenuation,this.alignment=r.SpriteAlignment.center.clone(),this.fog=!1,this.uvOffset=new r.Vector2(0,0),this.uvScale=new r.Vector2(1,1),this.setValues(e),e=e||{},void 0===e.depthTest&&(this.depthTest=!this.useScreenCoordinates),void 0===e.sizeAttenuation&&(this.sizeAttenuation=!this.useScreenCoordinates),void 0===e.scaleByViewport&&(this.scaleByViewport=!this.sizeAttenuation)},r.SpriteMaterial.prototype=Object.create(r.Material.prototype),r.SpriteMaterial.prototype.clone=function(){var e=new r.SpriteMaterial;return r.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.map=this.map,e.useScreenCoordinates=this.useScreenCoordinates,e.sizeAttenuation=this.sizeAttenuation,e.scaleByViewport=this.scaleByViewport,e.alignment.copy(this.alignment),e.uvOffset.copy(this.uvOffset),e.uvScale.copy(this.uvScale),e.fog=this.fog,e},r.SpriteAlignment={},r.SpriteAlignment.topLeft=new r.Vector2(1,-1),r.SpriteAlignment.topCenter=new r.Vector2(0,-1),r.SpriteAlignment.topRight=new r.Vector2(-1,-1),r.SpriteAlignment.centerLeft=new r.Vector2(1,0),r.SpriteAlignment.center=new r.Vector2(0,0),r.SpriteAlignment.centerRight=new r.Vector2(-1,0),r.SpriteAlignment.bottomLeft=new r.Vector2(1,1),r.SpriteAlignment.bottomCenter=new r.Vector2(0,1),r.SpriteAlignment.bottomRight=new r.Vector2(-1,1),r.Texture=function(e,t,i,n,s,o,a,l,d){this.id=r.Math.generateUUID(),this.name="",this.image=e,this.mipmaps=[],this.mapping=void 0!==t?t:new r.UVMapping,this.wrapS=void 0!==i?i:r.ClampToEdgeWrapping,this.wrapT=void 0!==n?n:r.ClampToEdgeWrapping,this.magFilter=void 0!==s?s:r.LinearFilter,this.minFilter=void 0!==o?o:r.LinearMipMapLinearFilter,this.anisotropy=void 0!==d?d:1,this.format=void 0!==a?a:r.RGBAFormat,this.type=void 0!==l?l:r.UnsignedByteType,this.offset=new r.Vector2(0,0),this.repeat=new r.Vector2(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.needsUpdate=!1,this.onUpdate=null},r.Texture.prototype={constructor:r.Texture,addEventListener:r.EventDispatcher.prototype.addEventListener,hasEventListener:r.EventDispatcher.prototype.hasEventListener,removeEventListener:r.EventDispatcher.prototype.removeEventListener,dispatchEvent:r.EventDispatcher.prototype.dispatchEvent,clone:function(e){return void 0===e&&(e=new r.Texture),e.image=this.image,e.mipmaps=this.mipmaps.slice(0),e.mapping=this.mapping,e.wrapS=this.wrapS,e.wrapT=this.wrapT,e.magFilter=this.magFilter,e.minFilter=this.minFilter,e.anisotropy=this.anisotropy,e.format=this.format,e.type=this.type,e.offset.copy(this.offset),e.repeat.copy(this.repeat),e.generateMipmaps=this.generateMipmaps,e.premultiplyAlpha=this.premultiplyAlpha,e.flipY=this.flipY,e.unpackAlignment=this.unpackAlignment,e},dispose:function(){this.dispatchEvent({type:"dispose"})}},r.CompressedTexture=function(e,t,i,n,s,o,a,l,d,c,h){r.Texture.call(this,null,o,a,l,d,c,n,s,h),this.image={width:t,height:i},this.mipmaps=e,this.generateMipmaps=!1},r.CompressedTexture.prototype=Object.create(r.Texture.prototype),r.CompressedTexture.prototype.clone=function(){var e=new r.CompressedTexture;return r.Texture.prototype.clone.call(this,e),e},r.DataTexture=function(e,t,i,n,s,o,a,l,d,c,h){r.Texture.call(this,null,o,a,l,d,c,n,s,h),this.image={data:e,width:t,height:i}},r.DataTexture.prototype=Object.create(r.Texture.prototype),r.DataTexture.prototype.clone=function(){var e=new r.DataTexture;return r.Texture.prototype.clone.call(this,e),e},r.Particle=function(e){r.Object3D.call(this),this.material=e},r.Particle.prototype=Object.create(r.Object3D.prototype),r.Particle.prototype.clone=function(e){return void 0===e&&(e=new r.Particle(this.material)),r.Object3D.prototype.clone.call(this,e),e},r.ParticleSystem=function(e,t){r.Object3D.call(this),this.geometry=e,this.material=void 0!==t?t:new r.ParticleBasicMaterial({color:16777215*Math.random()}),this.sortParticles=!1,this.geometry&&null===this.geometry.boundingSphere&&this.geometry.computeBoundingSphere(),this.frustumCulled=!1},r.ParticleSystem.prototype=Object.create(r.Object3D.prototype),r.ParticleSystem.prototype.clone=function(e){return void 0===e&&(e=new r.ParticleSystem(this.geometry,this.material)),e.sortParticles=this.sortParticles,r.Object3D.prototype.clone.call(this,e),e},r.Line=function(e,t,i){r.Object3D.call(this),this.geometry=e,this.material=void 0!==t?t:new r.LineBasicMaterial({color:16777215*Math.random()}),this.type=void 0!==i?i:r.LineStrip,this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere())},r.LineStrip=0,r.LinePieces=1,r.Line.prototype=Object.create(r.Object3D.prototype),r.Line.prototype.clone=function(e){return void 0===e&&(e=new r.Line(this.geometry,this.material,this.type)),r.Object3D.prototype.clone.call(this,e),e},r.Mesh=function(e,t){r.Object3D.call(this),this.geometry=null,this.material=null,this.setGeometry(e),this.setMaterial(t)},r.Mesh.prototype=Object.create(r.Object3D.prototype),r.Mesh.prototype.setGeometry=function(e){void 0!==e&&(this.geometry=e,null===this.geometry.boundingSphere&&this.geometry.computeBoundingSphere(),this.updateMorphTargets())},r.Mesh.prototype.setMaterial=function(e){this.material=void 0!==e?e:new r.MeshBasicMaterial({color:16777215*Math.random(),wireframe:!0})},r.Mesh.prototype.updateMorphTargets=function(){if(this.geometry.morphTargets.length>0){this.morphTargetBase=-1,this.morphTargetForcedOrder=[],this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var e=0,t=this.geometry.morphTargets.length;t>e;e++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[e].name]=e}},r.Mesh.prototype.getMorphTargetIndexByName=function(e){return void 0!==this.morphTargetDictionary[e]?this.morphTargetDictionary[e]:(console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+e+" does not exist. Returning 0."),0)},r.Mesh.prototype.clone=function(e){return void 0===e&&(e=new r.Mesh(this.geometry,this.material)),r.Object3D.prototype.clone.call(this,e),e},r.Bone=function(e){r.Object3D.call(this),this.skin=e,this.skinMatrix=new r.Matrix4},r.Bone.prototype=Object.create(r.Object3D.prototype),r.Bone.prototype.update=function(e,t){this.matrixAutoUpdate&&(t|=this.updateMatrix()),(t||this.matrixWorldNeedsUpdate)&&(e?this.skinMatrix.multiplyMatrices(e,this.matrix):this.skinMatrix.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);var i,r=this.children.length;for(i=0;r>i;i++)this.children[i].update(this.skinMatrix,t)},r.SkinnedMesh=function(e,t,i){r.Mesh.call(this,e,t),this.useVertexTexture=void 0!==i?i:!0,this.identityMatrix=new r.Matrix4,this.bones=[],this.boneMatrices=[];var n,s,o,a,l,d;if(this.geometry&&void 0!==this.geometry.bones){for(n=0;this.geometry.bones.length>n;n++)o=this.geometry.bones[n],a=o.pos,l=o.rotq,d=o.scl,s=this.addBone(),s.name=o.name,s.position.set(a[0],a[1],a[2]),s.quaternion.set(l[0],l[1],l[2],l[3]),s.useQuaternion=!0,void 0!==d?s.scale.set(d[0],d[1],d[2]):s.scale.set(1,1,1);for(n=0;this.bones.length>n;n++)o=this.geometry.bones[n],s=this.bones[n],-1===o.parent?this.add(s):this.bones[o.parent].add(s);var c=this.bones.length;if(this.useVertexTexture){var h;h=c>256?64:c>64?32:c>16?16:8,this.boneTextureWidth=h,this.boneTextureHeight=h,this.boneMatrices=new Float32Array(4*this.boneTextureWidth*this.boneTextureHeight),this.boneTexture=new r.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,r.RGBAFormat,r.FloatType),this.boneTexture.minFilter=r.NearestFilter,this.boneTexture.magFilter=r.NearestFilter,this.boneTexture.generateMipmaps=!1,this.boneTexture.flipY=!1}else this.boneMatrices=new Float32Array(16*c);this.pose()}},r.SkinnedMesh.prototype=Object.create(r.Mesh.prototype),r.SkinnedMesh.prototype.addBone=function(e){return void 0===e&&(e=new r.Bone(this)),this.bones.push(e),e},r.SkinnedMesh.prototype.updateMatrixWorld=function(){var e=new r.Matrix4;return function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent?this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(var i=0,n=this.children.length;n>i;i++){var s=this.children[i];s instanceof r.Bone?s.update(this.identityMatrix,!1):s.updateMatrixWorld(!0)}if(void 0==this.boneInverses){this.boneInverses=[];for(var o=0,a=this.bones.length;a>o;o++){var l=new r.Matrix4;l.getInverse(this.bones[o].skinMatrix),this.boneInverses.push(l)}}for(var o=0,a=this.bones.length;a>o;o++)e.multiplyMatrices(this.bones[o].skinMatrix,this.boneInverses[o]),e.flattenToArrayOffset(this.boneMatrices,16*o);this.useVertexTexture&&(this.boneTexture.needsUpdate=!0)}}(),r.SkinnedMesh.prototype.pose=function(){this.updateMatrixWorld(!0),this.normalizeSkinWeights()},r.SkinnedMesh.prototype.normalizeSkinWeights=function(){if(this.geometry instanceof r.Geometry)for(var e=0;this.geometry.skinIndices.length>e;e++){var t=this.geometry.skinWeights[e],i=1/t.lengthManhattan();1/0!==i?t.multiplyScalar(i):t.set(1)}},r.SkinnedMesh.prototype.clone=function(e){return void 0===e&&(e=new r.SkinnedMesh(this.geometry,this.material,this.useVertexTexture)),r.Mesh.prototype.clone.call(this,e),e},r.MorphAnimMesh=function(e,t){r.Mesh.call(this,e,t),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)},r.MorphAnimMesh.prototype=Object.create(r.Mesh.prototype),r.MorphAnimMesh.prototype.setFrameRange=function(e,t){this.startKeyframe=e,this.endKeyframe=t,this.length=this.endKeyframe-this.startKeyframe+1},r.MorphAnimMesh.prototype.setDirectionForward=function(){this.direction=1,this.directionBackwards=!1},r.MorphAnimMesh.prototype.setDirectionBackward=function(){this.direction=-1,this.directionBackwards=!0},r.MorphAnimMesh.prototype.parseAnimations=function(){var e=this.geometry;e.animations||(e.animations={});for(var t,i=e.animations,r=/([a-z]+)(\d+)/,n=0,s=e.morphTargets.length;s>n;n++){var o=e.morphTargets[n],a=o.name.match(r);if(a&&a.length>1){var l=a[1];a[2],i[l]||(i[l]={start:1/0,end:-1/0});var d=i[l];d.start>n&&(d.start=n),n>d.end&&(d.end=n),t||(t=l)}}e.firstAnimation=t},r.MorphAnimMesh.prototype.setAnimationLabel=function(e,t,i){this.geometry.animations||(this.geometry.animations={}),this.geometry.animations[e]={start:t,end:i}},r.MorphAnimMesh.prototype.playAnimation=function(e,t){var i=this.geometry.animations[e];i?(this.setFrameRange(i.start,i.end),this.duration=1e3*((i.end-i.start)/t),this.time=0):console.warn("animation["+e+"] undefined")},r.MorphAnimMesh.prototype.updateAnimation=function(e){var t=this.duration/this.length;this.time+=this.direction*e,this.mirroredLoop?(this.time>this.duration||0>this.time)&&(this.direction*=-1,this.time>this.duration&&(this.time=this.duration,this.directionBackwards=!0),0>this.time&&(this.time=0,this.directionBackwards=!1)):(this.time=this.time%this.duration,0>this.time&&(this.time+=this.duration));var i=this.startKeyframe+r.Math.clamp(Math.floor(this.time/t),0,this.length-1);i!==this.currentKeyframe&&(this.morphTargetInfluences[this.lastKeyframe]=0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[i]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=i);var n=this.time%t/t;this.directionBackwards&&(n=1-n),this.morphTargetInfluences[this.currentKeyframe]=n,this.morphTargetInfluences[this.lastKeyframe]=1-n},r.MorphAnimMesh.prototype.clone=function(e){return void 0===e&&(e=new r.MorphAnimMesh(this.geometry,this.material)),e.duration=this.duration,e.mirroredLoop=this.mirroredLoop,e.time=this.time,e.lastKeyframe=this.lastKeyframe,e.currentKeyframe=this.currentKeyframe,e.direction=this.direction,e.directionBackwards=this.directionBackwards,r.Mesh.prototype.clone.call(this,e),e},r.Ribbon=function(e,t){r.Object3D.call(this),this.geometry=e,this.material=t},r.Ribbon.prototype=Object.create(r.Object3D.prototype),r.Ribbon.prototype.clone=function(e){return void 0===e&&(e=new r.Ribbon(this.geometry,this.material)),r.Object3D.prototype.clone.call(this,e),e},r.LOD=function(){r.Object3D.call(this),this.objects=[]},r.LOD.prototype=Object.create(r.Object3D.prototype),r.LOD.prototype.addLevel=function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var i=0;this.objects.length>i&&!(this.objects[i].distance>t);i++);this.objects.splice(i,0,{distance:t,object:e}),this.add(e)},r.LOD.prototype.getObjectForDistance=function(e){for(var t=1,i=this.objects.length;i>t&&!(this.objects[t].distance>e);t++);return this.objects[t-1].object},r.LOD.prototype.update=function(){var e=new r.Vector3,t=new r.Vector3;return function(i){if(this.objects.length>1){e.getPositionFromMatrix(i.matrixWorld),t.getPositionFromMatrix(this.matrixWorld);var r=e.distanceTo(t);this.objects[0].object.visible=!0;for(var n=1,s=this.objects.length;s>n&&r>=this.objects[n].distance;n++)this.objects[n-1].object.visible=!1,this.objects[n].object.visible=!0;for(;s>n;n++)this.objects[n].object.visible=!1}}}(),r.LOD.prototype.clone=function(){},r.Sprite=function(e){r.Object3D.call(this),this.material=void 0!==e?e:new r.SpriteMaterial,this.rotation3d=this.rotation,this.rotation=0},r.Sprite.prototype=Object.create(r.Object3D.prototype),r.Sprite.prototype.updateMatrix=function(){this.rotation3d.set(0,0,this.rotation),this.quaternion.setFromEuler(this.rotation3d,this.eulerOrder),this.matrix.makeFromPositionQuaternionScale(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},r.Sprite.prototype.clone=function(e){return void 0===e&&(e=new r.Sprite(this.material)),r.Object3D.prototype.clone.call(this,e),e},r.Scene=function(){r.Object3D.call(this),this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,this.matrixAutoUpdate=!1,this.__objects=[],this.__lights=[],this.__objectsAdded=[],this.__objectsRemoved=[]},r.Scene.prototype=Object.create(r.Object3D.prototype),r.Scene.prototype.__addObject=function(e){if(e instanceof r.Light)-1===this.__lights.indexOf(e)&&this.__lights.push(e),e.target&&void 0===e.target.parent&&this.add(e.target);else if(!(e instanceof r.Camera||e instanceof r.Bone)&&-1===this.__objects.indexOf(e)){this.__objects.push(e),this.__objectsAdded.push(e);var t=this.__objectsRemoved.indexOf(e);-1!==t&&this.__objectsRemoved.splice(t,1)}for(var i=0;e.children.length>i;i++)this.__addObject(e.children[i])},r.Scene.prototype.__removeObject=function(e){if(e instanceof r.Light){var t=this.__lights.indexOf(e);-1!==t&&this.__lights.splice(t,1)}else if(!(e instanceof r.Camera)){var t=this.__objects.indexOf(e);
if(-1!==t){this.__objects.splice(t,1),this.__objectsRemoved.push(e);var i=this.__objectsAdded.indexOf(e);-1!==i&&this.__objectsAdded.splice(i,1)}}for(var n=0;e.children.length>n;n++)this.__removeObject(e.children[n])},r.Scene.prototype.clone=function(e){return void 0===e&&(e=new r.Scene),r.Object3D.prototype.clone.call(this,e),null!==this.fog&&(e.fog=this.fog.clone()),null!==this.overrideMaterial&&(e.overrideMaterial=this.overrideMaterial.clone()),e.autoUpdate=this.autoUpdate,e.matrixAutoUpdate=this.matrixAutoUpdate,e},r.Fog=function(e,t,i){this.name="",this.color=new r.Color(e),this.near=void 0!==t?t:1,this.far=void 0!==i?i:1e3},r.Fog.prototype.clone=function(){return new r.Fog(this.color.getHex(),this.near,this.far)},r.FogExp2=function(e,t){this.name="",this.color=new r.Color(e),this.density=void 0!==t?t:25e-5},r.FogExp2.prototype.clone=function(){return new r.FogExp2(this.color.getHex(),this.density)},r.CanvasRenderer=function(e){function t(){Ot.setRGB(0,0,0),zt.setRGB(0,0,0),Vt.setRGB(0,0,0);for(var e=0,t=S.length;t>e;e++){var i=S[e],n=i.color;i instanceof r.AmbientLight?Ot.add(n):i instanceof r.DirectionalLight?zt.add(n):i instanceof r.PointLight&&Vt.add(n)}}function i(e,t,i){for(var n=0,s=S.length;s>n;n++){var o=S[n];if(Ht.copy(o.color),o instanceof r.DirectionalLight){var a=Wt.getPositionFromMatrix(o.matrixWorld).normalize(),l=t.dot(a);if(0>=l)continue;l*=o.intensity,i.add(Ht.multiplyScalar(l))}else if(o instanceof r.PointLight){var a=Wt.getPositionFromMatrix(o.matrixWorld),l=t.dot(Wt.subVectors(a,e).normalize());if(0>=l)continue;if(l*=0==o.distance?1:1-Math.min(e.distanceTo(a)/o.distance,1),0==l)continue;l*=o.intensity,i.add(Ht.multiplyScalar(l))}}}function n(e,t,i){v(i.opacity),m(i.blending);var n,s,o,a,l,d,c;if(i instanceof r.ParticleBasicMaterial)if(null===i.map){if(o=t.object.scale.x,a=t.object.scale.y,o*=t.scale.x*U,a*=t.scale.y*D,Ft.min.set(e.x-o,e.y-a),Ft.max.set(e.x+o,e.y+a),It.isIntersectionBox(Ft)===!1)return Ft.makeEmpty(),void 0;E(i.color.getStyle()),ft.save(),ft.translate(e.x,e.y),ft.rotate(-t.rotation),ft.scale(o,a),ft.fillRect(-1,-1,2,2),ft.restore()}else{if(l=i.map.image,d=l.width>>1,c=l.height>>1,o=t.scale.x*U,a=t.scale.y*D,n=o*d,s=a*c,Ft.min.set(e.x-n,e.y-s),Ft.max.set(e.x+n,e.y+s),It.isIntersectionBox(Ft)===!1)return Ft.makeEmpty(),void 0;ft.save(),ft.translate(e.x,e.y),ft.rotate(-t.rotation),ft.scale(o,-a),ft.translate(-d,-c),ft.drawImage(l,0,0),ft.restore()}else if(i instanceof r.ParticleCanvasMaterial){if(n=t.scale.x*U,s=t.scale.y*D,Ft.min.set(e.x-n,e.y-s),Ft.max.set(e.x+n,e.y+s),It.isIntersectionBox(Ft)===!1)return Ft.makeEmpty(),void 0;b(i.color.getStyle()),E(i.color.getStyle()),ft.save(),ft.translate(e.x,e.y),ft.rotate(-t.rotation),ft.scale(n,s),i.program(ft),ft.restore()}}function s(e,t,i,n){if(v(n.opacity),m(n.blending),ft.beginPath(),ft.moveTo(e.positionScreen.x,e.positionScreen.y),ft.lineTo(t.positionScreen.x,t.positionScreen.y),n instanceof r.LineBasicMaterial){if(y(n.linewidth),w(n.linecap),x(n.linejoin),n.vertexColors!==r.VertexColors)b(n.color.getStyle());else{var s=i.vertexColors[0].getStyle(),o=i.vertexColors[1].getStyle();if(s===o)b(s);else{try{var a=ft.createLinearGradient(e.positionScreen.x,e.positionScreen.y,t.positionScreen.x,t.positionScreen.y);a.addColorStop(0,s),a.addColorStop(1,o)}catch(l){a=s}b(a)}}ft.stroke(),Ft.expandByScalar(2*n.linewidth)}else n instanceof r.LineDashedMaterial&&(y(n.linewidth),w(n.linecap),x(n.linejoin),b(n.color.getStyle()),_(n.dashSize,n.gapSize),ft.stroke(),Ft.expandByScalar(2*n.linewidth),_(null,null))}function o(e,t,n,s,o,a,d,g){if(ht.info.render.vertices+=3,ht.info.render.faces++,v(g.opacity),m(g.blending),L=e.positionScreen.x,I=e.positionScreen.y,N=t.positionScreen.x,F=t.positionScreen.y,O=n.positionScreen.x,z=n.positionScreen.y,l(L,I,N,F,O,z),(g instanceof r.MeshLambertMaterial||g instanceof r.MeshPhongMaterial)&&null===g.map)jt.copy(g.color),Bt.copy(g.emissive),g.vertexColors===r.FaceColors&&jt.multiply(d.color),g.wireframe===!1&&g.shading==r.SmoothShading&&3==d.vertexNormalsLength?(Rt.copy(Ot),Ut.copy(Ot),Dt.copy(Ot),i(d.v1.positionWorld,d.vertexNormalsModel[0],Rt),i(d.v2.positionWorld,d.vertexNormalsModel[1],Ut),i(d.v3.positionWorld,d.vertexNormalsModel[2],Dt),Rt.multiply(jt).add(Bt),Ut.multiply(jt).add(Bt),Dt.multiply(jt).add(Bt),Pt.addColors(Ut,Dt).multiplyScalar(.5),J=f(Rt,Ut,Dt,Pt),p(L,I,N,F,O,z,0,0,1,0,0,1,J)):(At.copy(Ot),i(d.centroidModel,d.normalModel,At),At.multiply(jt).add(Bt),g.wireframe===!0?c(At,g.wireframeLinewidth,g.wireframeLinecap,g.wireframeLinejoin):h(At));else if(g instanceof r.MeshBasicMaterial||g instanceof r.MeshLambertMaterial||g instanceof r.MeshPhongMaterial)null!==g.map?g.map.mapping instanceof r.UVMapping&&(Q=d.uvs[0],u(L,I,N,F,O,z,Q[s].x,Q[s].y,Q[o].x,Q[o].y,Q[a].x,Q[a].y,g.map)):null!==g.envMap?g.envMap.mapping instanceof r.SphericalReflectionMapping&&(Wt.copy(d.vertexNormalsModelView[s]),Z=.5*Wt.x+.5,et=.5*Wt.y+.5,Wt.copy(d.vertexNormalsModelView[o]),tt=.5*Wt.x+.5,it=.5*Wt.y+.5,Wt.copy(d.vertexNormalsModelView[a]),rt=.5*Wt.x+.5,nt=.5*Wt.y+.5,u(L,I,N,F,O,z,Z,et,tt,it,rt,nt,g.envMap)):(At.copy(g.color),g.vertexColors===r.FaceColors&&At.multiply(d.color),g.wireframe===!0?c(At,g.wireframeLinewidth,g.wireframeLinecap,g.wireframeLinejoin):h(At));else if(g instanceof r.MeshDepthMaterial)Y=P.near,K=P.far,Rt.r=Rt.g=Rt.b=1-T(e.positionScreen.z*e.positionScreen.w,Y,K),Ut.r=Ut.g=Ut.b=1-T(t.positionScreen.z*t.positionScreen.w,Y,K),Dt.r=Dt.g=Dt.b=1-T(n.positionScreen.z*n.positionScreen.w,Y,K),Pt.addColors(Ut,Dt).multiplyScalar(.5),J=f(Rt,Ut,Dt,Pt),p(L,I,N,F,O,z,0,0,1,0,0,1,J);else if(g instanceof r.MeshNormalMaterial){var y;g.shading==r.FlatShading?(y=d.normalModelView,At.setRGB(y.x,y.y,y.z).multiplyScalar(.5).addScalar(.5),g.wireframe===!0?c(At,g.wireframeLinewidth,g.wireframeLinecap,g.wireframeLinejoin):h(At)):g.shading==r.SmoothShading&&(y=d.vertexNormalsModelView[s],Rt.setRGB(y.x,y.y,y.z).multiplyScalar(.5).addScalar(.5),y=d.vertexNormalsModelView[o],Ut.setRGB(y.x,y.y,y.z).multiplyScalar(.5).addScalar(.5),y=d.vertexNormalsModelView[a],Dt.setRGB(y.x,y.y,y.z).multiplyScalar(.5).addScalar(.5),Pt.addColors(Ut,Dt).multiplyScalar(.5),J=f(Rt,Ut,Dt,Pt),p(L,I,N,F,O,z,0,0,1,0,0,1,J))}}function a(e,t,n,s,a,u,g,y){if(ht.info.render.vertices+=4,ht.info.render.faces++,v(y.opacity),m(y.blending),void 0!==y.map&&null!==y.map||void 0!==y.envMap&&null!==y.envMap)return o(e,t,s,0,1,3,g,y),o(a,n,u,1,2,3,g,y),void 0;if(L=e.positionScreen.x,I=e.positionScreen.y,N=t.positionScreen.x,F=t.positionScreen.y,O=n.positionScreen.x,z=n.positionScreen.y,V=s.positionScreen.x,W=s.positionScreen.y,G=a.positionScreen.x,X=a.positionScreen.y,q=u.positionScreen.x,$=u.positionScreen.y,y instanceof r.MeshLambertMaterial||y instanceof r.MeshPhongMaterial)jt.copy(y.color),Bt.copy(y.emissive),y.vertexColors===r.FaceColors&&jt.multiply(g.color),y.wireframe===!1&&y.shading==r.SmoothShading&&4==g.vertexNormalsLength?(Rt.copy(Ot),Ut.copy(Ot),Dt.copy(Ot),Pt.copy(Ot),i(g.v1.positionWorld,g.vertexNormalsModel[0],Rt),i(g.v2.positionWorld,g.vertexNormalsModel[1],Ut),i(g.v4.positionWorld,g.vertexNormalsModel[3],Dt),i(g.v3.positionWorld,g.vertexNormalsModel[2],Pt),Rt.multiply(jt).add(Bt),Ut.multiply(jt).add(Bt),Dt.multiply(jt).add(Bt),Pt.multiply(jt).add(Bt),J=f(Rt,Ut,Dt,Pt),l(L,I,N,F,V,W),p(L,I,N,F,V,W,0,0,1,0,0,1,J),l(G,X,O,z,q,$),p(G,X,O,z,q,$,1,0,1,1,0,1,J)):(At.copy(Ot),i(g.centroidModel,g.normalModel,At),At.multiply(jt).add(Bt),d(L,I,N,F,O,z,V,W),y.wireframe===!0?c(At,y.wireframeLinewidth,y.wireframeLinecap,y.wireframeLinejoin):h(At));else if(y instanceof r.MeshBasicMaterial)At.copy(y.color),y.vertexColors===r.FaceColors&&At.multiply(g.color),d(L,I,N,F,O,z,V,W),y.wireframe===!0?c(At,y.wireframeLinewidth,y.wireframeLinecap,y.wireframeLinejoin):h(At);else if(y instanceof r.MeshNormalMaterial){var w;y.shading==r.FlatShading?(w=g.normalModelView,At.setRGB(w.x,w.y,w.z).multiplyScalar(.5).addScalar(.5),d(L,I,N,F,O,z,V,W),y.wireframe===!0?c(At,y.wireframeLinewidth,y.wireframeLinecap,y.wireframeLinejoin):h(At)):y.shading==r.SmoothShading&&(w=g.vertexNormalsModelView[0],Rt.setRGB(w.x,w.y,w.z).multiplyScalar(.5).addScalar(.5),w=g.vertexNormalsModelView[1],Ut.setRGB(w.x,w.y,w.z).multiplyScalar(.5).addScalar(.5),w=g.vertexNormalsModelView[3],Dt.setRGB(w.x,w.y,w.z).multiplyScalar(.5).addScalar(.5),w=g.vertexNormalsModelView[2],Pt.setRGB(w.x,w.y,w.z).multiplyScalar(.5).addScalar(.5),J=f(Rt,Ut,Dt,Pt),l(L,I,N,F,V,W),p(L,I,N,F,V,W,0,0,1,0,0,1,J),l(G,X,O,z,q,$),p(G,X,O,z,q,$,1,0,1,1,0,1,J))}else y instanceof r.MeshDepthMaterial&&(Y=P.near,K=P.far,Rt.r=Rt.g=Rt.b=1-T(e.positionScreen.z*e.positionScreen.w,Y,K),Ut.r=Ut.g=Ut.b=1-T(t.positionScreen.z*t.positionScreen.w,Y,K),Dt.r=Dt.g=Dt.b=1-T(s.positionScreen.z*s.positionScreen.w,Y,K),Pt.r=Pt.g=Pt.b=1-T(n.positionScreen.z*n.positionScreen.w,Y,K),J=f(Rt,Ut,Dt,Pt),l(L,I,N,F,V,W),p(L,I,N,F,V,W,0,0,1,0,0,1,J),l(G,X,O,z,q,$),p(G,X,O,z,q,$,1,0,1,1,0,1,J))}function l(e,t,i,r,n,s){ft.beginPath(),ft.moveTo(e,t),ft.lineTo(i,r),ft.lineTo(n,s),ft.closePath()}function d(e,t,i,r,n,s,o,a){ft.beginPath(),ft.moveTo(e,t),ft.lineTo(i,r),ft.lineTo(n,s),ft.lineTo(o,a),ft.closePath()}function c(e,t,i,r){y(t),w(i),x(r),b(e.getStyle()),ft.stroke(),Ft.expandByScalar(2*t)}function h(e){E(e.getStyle()),ft.fill()}function u(e,t,i,n,s,o,a,l,d,c,u,p,f){if(!(f instanceof r.DataTexture||void 0===f.image||0==f.image.width)){if(f.needsUpdate===!0){var g=f.wrapS==r.RepeatWrapping,v=f.wrapT==r.RepeatWrapping;kt[f.id]=ft.createPattern(f.image,g===!0&&v===!0?"repeat":g===!0&&v===!1?"repeat-x":g===!1&&v===!0?"repeat-y":"no-repeat"),f.needsUpdate=!1}void 0===kt[f.id]?E("rgba(0,0,0,1)"):E(kt[f.id]);var m,y,w,x,b,_,T,C,M=f.offset.x/f.repeat.x,S=f.offset.y/f.repeat.y,A=f.image.width*f.repeat.x,R=f.image.height*f.repeat.y;if(a=(a+M)*A,l=(1-l+S)*R,d=(d+M)*A,c=(1-c+S)*R,u=(u+M)*A,p=(1-p+S)*R,i-=e,n-=t,s-=e,o-=t,d-=a,c-=l,u-=a,p-=l,T=d*p-u*c,0===T){if(void 0===Lt[f.id]){var U=document.createElement("canvas");U.width=f.image.width,U.height=f.image.height;var D=U.getContext("2d");D.drawImage(f.image,0,0),Lt[f.id]=D.getImageData(0,0,f.image.width,f.image.height).data}var P=Lt[f.id],j=4*(Math.floor(a)+Math.floor(l)*f.image.width);return At.setRGB(P[j]/255,P[j+1]/255,P[j+2]/255),h(At),void 0}C=1/T,m=(p*i-c*s)*C,y=(p*n-c*o)*C,w=(d*s-u*i)*C,x=(d*o-u*n)*C,b=e-m*a-w*l,_=t-y*a-x*l,ft.save(),ft.transform(m,y,w,x,b,_),ft.fill(),ft.restore()}}function p(e,t,i,r,n,s,o,a,l,d,c,h,u){var p,f,g,v,m,y,w,x,b=u.width-1,E=u.height-1;o*=b,a*=E,l*=b,d*=E,c*=b,h*=E,i-=e,r-=t,n-=e,s-=t,l-=o,d-=a,c-=o,h-=a,w=l*h-c*d,x=1/w,p=(h*i-d*n)*x,f=(h*r-d*s)*x,g=(l*n-c*i)*x,v=(l*s-c*r)*x,m=e-p*o-g*a,y=t-f*o-v*a,ft.save(),ft.transform(p,f,g,v,m,y),ft.clip(),ft.drawImage(u,0,0),ft.restore()}function f(e,t,i,r){return lt[0]=0|255*e.r,lt[1]=0|255*e.g,lt[2]=0|255*e.b,lt[4]=0|255*t.r,lt[5]=0|255*t.g,lt[6]=0|255*t.b,lt[8]=0|255*i.r,lt[9]=0|255*i.g,lt[10]=0|255*i.b,lt[12]=0|255*r.r,lt[13]=0|255*r.g,lt[14]=0|255*r.b,ot.putImageData(at,0,0),ct.drawImage(st,0,0),dt}function g(e,t,i){var r,n=t.x-e.x,s=t.y-e.y,o=n*n+s*s;0!==o&&(r=i/Math.sqrt(o),n*=r,s*=r,t.x+=n,t.y+=s,e.x-=n,e.y-=s)}function v(e){mt!==e&&(ft.globalAlpha=e,mt=e)}function m(e){yt!==e&&(e===r.NormalBlending?ft.globalCompositeOperation="source-over":e===r.AdditiveBlending?ft.globalCompositeOperation="lighter":e===r.SubtractiveBlending&&(ft.globalCompositeOperation="darker"),yt=e)}function y(e){bt!==e&&(ft.lineWidth=e,bt=e)}function w(e){Et!==e&&(ft.lineCap=e,Et=e)}function x(e){_t!==e&&(ft.lineJoin=e,_t=e)}function b(e){wt!==e&&(ft.strokeStyle=e,wt=e)}function E(e){xt!==e&&(ft.fillStyle=e,xt=e)}function _(e,t){(Tt!==e||Ct!==t)&&(ft.setLineDash([e,t]),Tt=e,Ct=t)}console.log("THREE.CanvasRenderer",r.REVISION);var T=r.Math.smoothstep;e=e||{};var C,M,S,A,R,U,D,P,j,B,H,k,L,I,N,F,O,z,V,W,G,X,q,$,Y,K,J,Q,Z,et,tt,it,rt,nt,st,ot,at,lt,dt,ct,ht=this,ut=new r.Projector,pt=void 0!==e.canvas?e.canvas:document.createElement("canvas"),ft=pt.getContext("2d"),gt=new r.Color(0),vt=0,mt=1,yt=0,wt=null,xt=null,bt=null,Et=null,_t=null,Tt=null,Ct=0,Mt=new r.RenderableVertex,St=new r.RenderableVertex,At=new r.Color,Rt=new r.Color,Ut=new r.Color,Dt=new r.Color,Pt=new r.Color,jt=new r.Color,Bt=new r.Color,Ht=new r.Color,kt={},Lt={},It=new r.Box2,Nt=new r.Box2,Ft=new r.Box2,Ot=new r.Color,zt=new r.Color,Vt=new r.Color,Wt=new r.Vector3,Gt=16;st=document.createElement("canvas"),st.width=st.height=2,ot=st.getContext("2d"),ot.fillStyle="rgba(0,0,0,1)",ot.fillRect(0,0,2,2),at=ot.getImageData(0,0,2,2),lt=at.data,dt=document.createElement("canvas"),dt.width=dt.height=Gt,ct=dt.getContext("2d"),ct.translate(-Gt/2,-Gt/2),ct.scale(Gt,Gt),Gt--,void 0===ft.setLineDash&&(ft.setLineDash=void 0!==ft.mozDash?function(e){ft.mozDash=null!==e[0]?e:null}:function(){}),this.domElement=pt,this.devicePixelRatio=void 0!==e.devicePixelRatio?e.devicePixelRatio:void 0!==window.devicePixelRatio?window.devicePixelRatio:1,this.autoClear=!0,this.sortObjects=!0,this.sortElements=!0,this.info={render:{vertices:0,faces:0}},this.supportsVertexTextures=function(){},this.setFaceCulling=function(){},this.setSize=function(e,t,i){A=e*this.devicePixelRatio,R=t*this.devicePixelRatio,U=Math.floor(A/2),D=Math.floor(R/2),pt.width=A,pt.height=R,1!==this.devicePixelRatio&&i!==!1&&(pt.style.width=e+"px",pt.style.height=t+"px"),It.set(new r.Vector2(-U,-D),new r.Vector2(U,D)),Nt.set(new r.Vector2(-U,-D),new r.Vector2(U,D)),mt=1,yt=0,wt=null,xt=null,bt=null,Et=null,_t=null},this.setClearColor=function(e,t){gt.set(e),vt=void 0!==t?t:1,Nt.set(new r.Vector2(-U,-D),new r.Vector2(U,D))},this.setClearColorHex=function(e,t){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead."),this.setClearColor(e,t)},this.getMaxAnisotropy=function(){return 0},this.clear=function(){ft.setTransform(1,0,0,-1,U,D),Nt.empty()===!1&&(Nt.intersect(It),Nt.expandByScalar(2),1>vt&&ft.clearRect(0|Nt.min.x,0|Nt.min.y,0|Nt.max.x-Nt.min.x,0|Nt.max.y-Nt.min.y),vt>0&&(m(r.NormalBlending),v(1),E("rgba("+Math.floor(255*gt.r)+","+Math.floor(255*gt.g)+","+Math.floor(255*gt.b)+","+vt+")"),ft.fillRect(0|Nt.min.x,0|Nt.min.y,0|Nt.max.x-Nt.min.x,0|Nt.max.y-Nt.min.y)),Nt.makeEmpty())},this.render=function(e,i){if(i instanceof r.Camera==!1)return console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera."),void 0;this.autoClear===!0&&this.clear(),ft.setTransform(1,0,0,-1,U,D),ht.info.render.vertices=0,ht.info.render.faces=0,C=ut.projectScene(e,i,this.sortObjects,this.sortElements),M=C.elements,S=C.lights,P=i,t();for(var l=0,d=M.length;d>l;l++){var c=M[l],h=c.material;if(void 0!==h&&h.visible!==!1){if(Ft.makeEmpty(),c instanceof r.RenderableParticle)j=c,j.x*=U,j.y*=D,n(j,c,h);else if(c instanceof r.RenderableLine)j=c.v1,B=c.v2,j.positionScreen.x*=U,j.positionScreen.y*=D,B.positionScreen.x*=U,B.positionScreen.y*=D,Ft.setFromPoints([j.positionScreen,B.positionScreen]),It.isIntersectionBox(Ft)===!0&&s(j,B,c,h);else if(c instanceof r.RenderableFace3){if(j=c.v1,B=c.v2,H=c.v3,-1>j.positionScreen.z||j.positionScreen.z>1)continue;if(-1>B.positionScreen.z||B.positionScreen.z>1)continue;if(-1>H.positionScreen.z||H.positionScreen.z>1)continue;j.positionScreen.x*=U,j.positionScreen.y*=D,B.positionScreen.x*=U,B.positionScreen.y*=D,H.positionScreen.x*=U,H.positionScreen.y*=D,h.overdraw>0&&(g(j.positionScreen,B.positionScreen,h.overdraw),g(B.positionScreen,H.positionScreen,h.overdraw),g(H.positionScreen,j.positionScreen,h.overdraw)),Ft.setFromPoints([j.positionScreen,B.positionScreen,H.positionScreen]),It.isIntersectionBox(Ft)===!0&&o(j,B,H,0,1,2,c,h)}else if(c instanceof r.RenderableFace4){if(j=c.v1,B=c.v2,H=c.v3,k=c.v4,-1>j.positionScreen.z||j.positionScreen.z>1)continue;if(-1>B.positionScreen.z||B.positionScreen.z>1)continue;if(-1>H.positionScreen.z||H.positionScreen.z>1)continue;if(-1>k.positionScreen.z||k.positionScreen.z>1)continue;j.positionScreen.x*=U,j.positionScreen.y*=D,B.positionScreen.x*=U,B.positionScreen.y*=D,H.positionScreen.x*=U,H.positionScreen.y*=D,k.positionScreen.x*=U,k.positionScreen.y*=D,Mt.positionScreen.copy(B.positionScreen),St.positionScreen.copy(k.positionScreen),h.overdraw>0&&(g(j.positionScreen,B.positionScreen,h.overdraw),g(B.positionScreen,k.positionScreen,h.overdraw),g(k.positionScreen,j.positionScreen,h.overdraw),g(H.positionScreen,Mt.positionScreen,h.overdraw),g(H.positionScreen,St.positionScreen,h.overdraw)),Ft.setFromPoints([j.positionScreen,B.positionScreen,H.positionScreen,k.positionScreen]),It.isIntersectionBox(Ft)===!0&&a(j,B,H,k,Mt,St,c,h)}Nt.union(Ft)}}ft.setTransform(1,0,0,1,0,0)}},r.ShaderChunk={fog_pars_fragment:["#ifdef USE_FOG","uniform vec3 fogColor;","#ifdef FOG_EXP2","uniform float fogDensity;","#else","uniform float fogNear;","uniform float fogFar;","#endif","#endif"].join("\n"),fog_fragment:["#ifdef USE_FOG","float depth = gl_FragCoord.z / gl_FragCoord.w;","#ifdef FOG_EXP2","const float LOG2 = 1.442695;","float fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );","fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","#else","float fogFactor = smoothstep( fogNear, fogFar, depth );","#endif","gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","#endif"].join("\n"),envmap_pars_fragment:["#ifdef USE_ENVMAP","uniform float reflectivity;","uniform samplerCube envMap;","uniform float flipEnvMap;","uniform int combine;","#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )","uniform bool useRefract;","uniform float refractionRatio;","#else","varying vec3 vReflect;","#endif","#endif"].join("\n"),envmap_fragment:["#ifdef USE_ENVMAP","vec3 reflectVec;","#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )","vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );","if ( useRefract ) {","reflectVec = refract( cameraToVertex, normal, refractionRatio );","} else { ","reflectVec = reflect( cameraToVertex, normal );","}","#else","reflectVec = vReflect;","#endif","#ifdef DOUBLE_SIDED","float flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );","vec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );","#else","vec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );","#endif","#ifdef GAMMA_INPUT","cubeColor.xyz *= cubeColor.xyz;","#endif","if ( combine == 1 ) {","gl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );","} else if ( combine == 2 ) {","gl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;","} else {","gl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );","}","#endif"].join("\n"),envmap_pars_vertex:["#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )","varying vec3 vReflect;","uniform float refractionRatio;","uniform bool useRefract;","#endif"].join("\n"),worldpos_vertex:["#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )","#ifdef USE_SKINNING","vec4 worldPosition = modelMatrix * skinned;","#endif","#if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )","vec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );","#endif","#if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )","vec4 worldPosition = modelMatrix * vec4( position, 1.0 );","#endif","#endif"].join("\n"),envmap_vertex:["#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )","vec3 worldNormal = mat3( modelMatrix[ 0 ].xyz, modelMatrix[ 1 ].xyz, modelMatrix[ 2 ].xyz ) * objectNormal;","worldNormal = normalize( worldNormal );","vec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );","if ( useRefract ) {","vReflect = refract( cameraToVertex, worldNormal, refractionRatio );","} else {","vReflect = reflect( cameraToVertex, worldNormal );","}","#endif"].join("\n"),map_particle_pars_fragment:["#ifdef USE_MAP","uniform sampler2D map;","#endif"].join("\n"),map_particle_fragment:["#ifdef USE_MAP","gl_FragColor = gl_FragColor * texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) );","#endif"].join("\n"),map_pars_vertex:["#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP )","varying vec2 vUv;","uniform vec4 offsetRepeat;","#endif"].join("\n"),map_pars_fragment:["#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP )","varying vec2 vUv;","#endif","#ifdef USE_MAP","uniform sampler2D map;","#endif"].join("\n"),map_vertex:["#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP )","vUv = uv * offsetRepeat.zw + offsetRepeat.xy;","#endif"].join("\n"),map_fragment:["#ifdef USE_MAP","vec4 texelColor = texture2D( map, vUv );","#ifdef GAMMA_INPUT","texelColor.xyz *= texelColor.xyz;","#endif","gl_FragColor = gl_FragColor * texelColor;","#endif"].join("\n"),lightmap_pars_fragment:["#ifdef USE_LIGHTMAP","varying vec2 vUv2;","uniform sampler2D lightMap;","#endif"].join("\n"),lightmap_pars_vertex:["#ifdef USE_LIGHTMAP","varying vec2 vUv2;","#endif"].join("\n"),lightmap_fragment:["#ifdef USE_LIGHTMAP","gl_FragColor = gl_FragColor * texture2D( lightMap, vUv2 );","#endif"].join("\n"),lightmap_vertex:["#ifdef USE_LIGHTMAP","vUv2 = uv2;","#endif"].join("\n"),bumpmap_pars_fragment:["#ifdef USE_BUMPMAP","uniform sampler2D bumpMap;","uniform float bumpScale;","vec2 dHdxy_fwd() {","vec2 dSTdx = dFdx( vUv );","vec2 dSTdy = dFdy( vUv );","float Hll = bumpScale * texture2D( bumpMap, vUv ).x;","float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;","float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;","return vec2( dBx, dBy );","}","vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {","vec3 vSigmaX = dFdx( surf_pos );","vec3 vSigmaY = dFdy( surf_pos );","vec3 vN = surf_norm;","vec3 R1 = cross( vSigmaY, vN );","vec3 R2 = cross( vN, vSigmaX );","float fDet = dot( vSigmaX, R1 );","vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );","return normalize( abs( fDet ) * surf_norm - vGrad );","}","#endif"].join("\n"),normalmap_pars_fragment:["#ifdef USE_NORMALMAP","uniform sampler2D normalMap;","uniform vec2 normalScale;","vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {","vec3 q0 = dFdx( eye_pos.xyz );","vec3 q1 = dFdy( eye_pos.xyz );","vec2 st0 = dFdx( vUv.st );","vec2 st1 = dFdy( vUv.st );","vec3 S = normalize( q0 * st1.t - q1 * st0.t );","vec3 T = normalize( -q0 * st1.s + q1 * st0.s );","vec3 N = normalize( surf_norm );","vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;","mapN.xy = normalScale * mapN.xy;","mat3 tsn = mat3( S, T, N );","return normalize( tsn * mapN );","}","#endif"].join("\n"),specularmap_pars_fragment:["#ifdef USE_SPECULARMAP","uniform sampler2D specularMap;","#endif"].join("\n"),specularmap_fragment:["float specularStrength;","#ifdef USE_SPECULARMAP","vec4 texelSpecular = texture2D( specularMap, vUv );","specularStrength = texelSpecular.r;","#else","specularStrength = 1.0;","#endif"].join("\n"),lights_lambert_pars_vertex:["uniform vec3 ambient;","uniform vec3 diffuse;","uniform vec3 emissive;","uniform vec3 ambientLightColor;","#if MAX_DIR_LIGHTS > 0","uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];","uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];","#endif","#if MAX_HEMI_LIGHTS > 0","uniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];","uniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];","uniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];","#endif","#if MAX_POINT_LIGHTS > 0","uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];","uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];","uniform float pointLightDistance[ MAX_POINT_LIGHTS ];","#endif","#if MAX_SPOT_LIGHTS > 0","uniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];","uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];","uniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];","uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];","uniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];","uniform float spotLightExponent[ MAX_SPOT_LIGHTS ];","#endif","#ifdef WRAP_AROUND","uniform vec3 wrapRGB;","#endif"].join("\n"),lights_lambert_vertex:["vLightFront = vec3( 0.0 );","#ifdef DOUBLE_SIDED","vLightBack = vec3( 0.0 );","#endif","transformedNormal = normalize( transformedNormal );","#if MAX_DIR_LIGHTS > 0","for( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {","vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );","vec3 dirVector = normalize( lDirection.xyz );","float dotProduct = dot( transformedNormal, dirVector );","vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );","#ifdef DOUBLE_SIDED","vec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );","#ifdef WRAP_AROUND","vec3 directionalLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );","#endif","#endif","#ifdef WRAP_AROUND","vec3 directionalLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );","directionalLightWeighting = mix( directionalLightWeighting, directionalLightWeightingHalf, wrapRGB );","#ifdef DOUBLE_SIDED","directionalLightWeightingBack = mix( directionalLightWeightingBack, directionalLightWeightingHalfBack, wrapRGB );","#endif","#endif","vLightFront += directionalLightColor[ i ] * directionalLightWeighting;","#ifdef DOUBLE_SIDED","vLightBack += directionalLightColor[ i ] * directionalLightWeightingBack;","#endif","}","#endif","#if MAX_POINT_LIGHTS > 0","for( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {","vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );","vec3 lVector = lPosition.xyz - mvPosition.xyz;","float lDistance = 1.0;","if ( pointLightDistance[ i ] > 0.0 )","lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );","lVector = normalize( lVector );","float dotProduct = dot( transformedNormal, lVector );","vec3 pointLightWeighting = vec3( max( dotProduct, 0.0 ) );","#ifdef DOUBLE_SIDED","vec3 pointLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );","#ifdef WRAP_AROUND","vec3 pointLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );","#endif","#endif","#ifdef WRAP_AROUND","vec3 pointLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );","pointLightWeighting = mix( pointLightWeighting, pointLightWeightingHalf, wrapRGB );","#ifdef DOUBLE_SIDED","pointLightWeightingBack = mix( pointLightWeightingBack, pointLightWeightingHalfBack, wrapRGB );","#endif","#endif","vLightFront += pointLightColor[ i ] * pointLightWeighting * lDistance;","#ifdef DOUBLE_SIDED","vLightBack += pointLightColor[ i ] * pointLightWeightingBack * lDistance;","#endif","}","#endif","#if MAX_SPOT_LIGHTS > 0","for( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {","vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );","vec3 lVector = lPosition.xyz - mvPosition.xyz;","float spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - worldPosition.xyz ) );","if ( spotEffect > spotLightAngleCos[ i ] ) {","spotEffect = max( pow( spotEffect, spotLightExponent[ i ] ), 0.0 );","float lDistance = 1.0;","if ( spotLightDistance[ i ] > 0.0 )","lDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );","lVector = normalize( lVector );","float dotProduct = dot( transformedNormal, lVector );","vec3 spotLightWeighting = vec3( max( dotProduct, 0.0 ) );","#ifdef DOUBLE_SIDED","vec3 spotLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );","#ifdef WRAP_AROUND","vec3 spotLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );","#endif","#endif","#ifdef WRAP_AROUND","vec3 spotLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );","spotLightWeighting = mix( spotLightWeighting, spotLightWeightingHalf, wrapRGB );","#ifdef DOUBLE_SIDED","spotLightWeightingBack = mix( spotLightWeightingBack, spotLightWeightingHalfBack, wrapRGB );","#endif","#endif","vLightFront += spotLightColor[ i ] * spotLightWeighting * lDistance * spotEffect;","#ifdef DOUBLE_SIDED","vLightBack += spotLightColor[ i ] * spotLightWeightingBack * lDistance * spotEffect;","#endif","}","}","#endif","#if MAX_HEMI_LIGHTS > 0","for( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {","vec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );","vec3 lVector = normalize( lDirection.xyz );","float dotProduct = dot( transformedNormal, lVector );","float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;","float hemiDiffuseWeightBack = -0.5 * dotProduct + 0.5;","vLightFront += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );","#ifdef DOUBLE_SIDED","vLightBack += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeightBack );","#endif","}","#endif","vLightFront = vLightFront * diffuse + ambient * ambientLightColor + emissive;","#ifdef DOUBLE_SIDED","vLightBack = vLightBack * diffuse + ambient * ambientLightColor + emissive;","#endif"].join("\n"),lights_phong_pars_vertex:["#ifndef PHONG_PER_PIXEL","#if MAX_POINT_LIGHTS > 0","uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];","uniform float pointLightDistance[ MAX_POINT_LIGHTS ];","varying vec4 vPointLight[ MAX_POINT_LIGHTS ];","#endif","#if MAX_SPOT_LIGHTS > 0","uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];","uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];","varying vec4 vSpotLight[ MAX_SPOT_LIGHTS ];","#endif","#endif","#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP )","varying vec3 vWorldPosition;","#endif"].join("\n"),lights_phong_vertex:["#ifndef PHONG_PER_PIXEL","#if MAX_POINT_LIGHTS > 0","for( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {","vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );","vec3 lVector = lPosition.xyz - mvPosition.xyz;","float lDistance = 1.0;","if ( pointLightDistance[ i ] > 0.0 )","lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );","vPointLight[ i ] = vec4( lVector, lDistance );","}","#endif","#if MAX_SPOT_LIGHTS > 0","for( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {","vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );","vec3 lVector = lPosition.xyz - mvPosition.xyz;","float lDistance = 1.0;","if ( spotLightDistance[ i ] > 0.0 )","lDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );","vSpotLight[ i ] = vec4( lVector, lDistance );","}","#endif","#endif","#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP )","vWorldPosition = worldPosition.xyz;","#endif"].join("\n"),lights_phong_pars_fragment:["uniform vec3 ambientLightColor;","#if MAX_DIR_LIGHTS > 0","uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];","uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];","#endif","#if MAX_HEMI_LIGHTS > 0","uniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];","uniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];","uniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];","#endif","#if MAX_POINT_LIGHTS > 0","uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];","#ifdef PHONG_PER_PIXEL","uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];","uniform float pointLightDistance[ MAX_POINT_LIGHTS ];","#else","varying vec4 vPointLight[ MAX_POINT_LIGHTS ];","#endif","#endif","#if MAX_SPOT_LIGHTS > 0","uniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];","uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];","uniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];","uniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];","uniform float spotLightExponent[ MAX_SPOT_LIGHTS ];","#ifdef PHONG_PER_PIXEL","uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];","#else","varying vec4 vSpotLight[ MAX_SPOT_LIGHTS ];","#endif","#endif","#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP )","varying vec3 vWorldPosition;","#endif","#ifdef WRAP_AROUND","uniform vec3 wrapRGB;","#endif","varying vec3 vViewPosition;","varying vec3 vNormal;"].join("\n"),lights_phong_fragment:["vec3 normal = normalize( vNormal );","vec3 viewPosition = normalize( vViewPosition );","#ifdef DOUBLE_SIDED","normal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );","#endif","#ifdef USE_NORMALMAP","normal = perturbNormal2Arb( -vViewPosition, normal );","#elif defined( USE_BUMPMAP )","normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );","#endif","#if MAX_POINT_LIGHTS > 0","vec3 pointDiffuse = vec3( 0.0 );","vec3 pointSpecular = vec3( 0.0 );","for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {","#ifdef PHONG_PER_PIXEL","vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );","vec3 lVector = lPosition.xyz + vViewPosition.xyz;","float lDistance = 1.0;","if ( pointLightDistance[ i ] > 0.0 )","lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );","lVector = normalize( lVector );","#else","vec3 lVector = normalize( vPointLight[ i ].xyz );","float lDistance = vPointLight[ i ].w;","#endif","float dotProduct = dot( normal, lVector );","#ifdef WRAP_AROUND","float pointDiffuseWeightFull = max( dotProduct, 0.0 );","float pointDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );","vec3 pointDiffuseWeight = mix( vec3 ( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );","#else","float pointDiffuseWeight = max( dotProduct, 0.0 );","#endif","pointDiffuse += diffuse * pointLightColor[ i ] * pointDiffuseWeight * lDistance;","vec3 pointHalfVector = normalize( lVector + viewPosition );","float pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );","float pointSpecularWeight = specularStrength * max( pow( pointDotNormalHalf, shininess ), 0.0 );","#ifdef PHYSICALLY_BASED_SHADING","float specularNormalization = ( shininess + 2.0001 ) / 8.0;","vec3 schlick = specular + vec3( 1.0 - specular ) * pow( 1.0 - dot( lVector, pointHalfVector ), 5.0 );","pointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * lDistance * specularNormalization;","#else","pointSpecular += specular * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * lDistance;","#endif","}","#endif","#if MAX_SPOT_LIGHTS > 0","vec3 spotDiffuse = vec3( 0.0 );","vec3 spotSpecular = vec3( 0.0 );","for ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {","#ifdef PHONG_PER_PIXEL","vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );","vec3 lVector = lPosition.xyz + vViewPosition.xyz;","float lDistance = 1.0;","if ( spotLightDistance[ i ] > 0.0 )","lDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );","lVector = normalize( lVector );","#else","vec3 lVector = normalize( vSpotLight[ i ].xyz );","float lDistance = vSpotLight[ i ].w;","#endif","float spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );","if ( spotEffect > spotLightAngleCos[ i ] ) {","spotEffect = max( pow( spotEffect, spotLightExponent[ i ] ), 0.0 );","float dotProduct = dot( normal, lVector );","#ifdef WRAP_AROUND","float spotDiffuseWeightFull = max( dotProduct, 0.0 );","float spotDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );","vec3 spotDiffuseWeight = mix( vec3 ( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );","#else","float spotDiffuseWeight = max( dotProduct, 0.0 );","#endif","spotDiffuse += diffuse * spotLightColor[ i ] * spotDiffuseWeight * lDistance * spotEffect;","vec3 spotHalfVector = normalize( lVector + viewPosition );","float spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );","float spotSpecularWeight = specularStrength * max( pow( spotDotNormalHalf, shininess ), 0.0 );","#ifdef PHYSICALLY_BASED_SHADING","float specularNormalization = ( shininess + 2.0001 ) / 8.0;","vec3 schlick = specular + vec3( 1.0 - specular ) * pow( 1.0 - dot( lVector, spotHalfVector ), 5.0 );","spotSpecular += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * lDistance * specularNormalization * spotEffect;","#else","spotSpecular += specular * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * lDistance * spotEffect;","#endif","}","}","#endif","#if MAX_DIR_LIGHTS > 0","vec3 dirDiffuse = vec3( 0.0 );","vec3 dirSpecular = vec3( 0.0 );","for( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {","vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );","vec3 dirVector = normalize( lDirection.xyz );","float dotProduct = dot( normal, dirVector );","#ifdef WRAP_AROUND","float dirDiffuseWeightFull = max( dotProduct, 0.0 );","float dirDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );","vec3 dirDiffuseWeight = mix( vec3( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), wrapRGB );","#else","float dirDiffuseWeight = max( dotProduct, 0.0 );","#endif","dirDiffuse += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;","vec3 dirHalfVector = normalize( dirVector + viewPosition );","float dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );","float dirSpecularWeight = specularStrength * max( pow( dirDotNormalHalf, shininess ), 0.0 );","#ifdef PHYSICALLY_BASED_SHADING","float specularNormalization = ( shininess + 2.0001 ) / 8.0;","vec3 schlick = specular + vec3( 1.0 - specular ) * pow( 1.0 - dot( dirVector, dirHalfVector ), 5.0 );","dirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;","#else","dirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight;","#endif","}","#endif","#if MAX_HEMI_LIGHTS > 0","vec3 hemiDiffuse = vec3( 0.0 );","vec3 hemiSpecular = vec3( 0.0 );","for( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {","vec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );","vec3 lVector = normalize( lDirection.xyz );","float dotProduct = dot( normal, lVector );","float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;","vec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );","hemiDiffuse += diffuse * hemiColor;","vec3 hemiHalfVectorSky = normalize( lVector + viewPosition );","float hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;","float hemiSpecularWeightSky = specularStrength * max( pow( hemiDotNormalHalfSky, shininess ), 0.0 );","vec3 lVectorGround = -lVector;","vec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );","float hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;","float hemiSpecularWeightGround = specularStrength * max( pow( hemiDotNormalHalfGround, shininess ), 0.0 );","#ifdef PHYSICALLY_BASED_SHADING","float dotProductGround = dot( normal, lVectorGround );","float specularNormalization = ( shininess + 2.0001 ) / 8.0;","vec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( 1.0 - dot( lVector, hemiHalfVectorSky ), 5.0 );","vec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 5.0 );","hemiSpecular += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );","#else","hemiSpecular += specular * hemiColor * ( hemiSpecularWeightSky + hemiSpecularWeightGround ) * hemiDiffuseWeight;","#endif","}","#endif","vec3 totalDiffuse = vec3( 0.0 );","vec3 totalSpecular = vec3( 0.0 );","#if MAX_DIR_LIGHTS > 0","totalDiffuse += dirDiffuse;","totalSpecular += dirSpecular;","#endif","#if MAX_HEMI_LIGHTS > 0","totalDiffuse += hemiDiffuse;","totalSpecular += hemiSpecular;","#endif","#if MAX_POINT_LIGHTS > 0","totalDiffuse += pointDiffuse;","totalSpecular += pointSpecular;","#endif","#if MAX_SPOT_LIGHTS > 0","totalDiffuse += spotDiffuse;","totalSpecular += spotSpecular;","#endif","#ifdef METAL","gl_FragColor.xyz = gl_FragColor.xyz * ( emissive + totalDiffuse + ambientLightColor * ambient + totalSpecular );","#else","gl_FragColor.xyz = gl_FragColor.xyz * ( emissive + totalDiffuse + ambientLightColor * ambient ) + totalSpecular;","#endif"].join("\n"),color_pars_fragment:["#ifdef USE_COLOR","varying vec3 vColor;","#endif"].join("\n"),color_fragment:["#ifdef USE_COLOR","gl_FragColor = gl_FragColor * vec4( vColor, opacity );","#endif"].join("\n"),color_pars_vertex:["#ifdef USE_COLOR","varying vec3 vColor;","#endif"].join("\n"),color_vertex:["#ifdef USE_COLOR","#ifdef GAMMA_INPUT","vColor = color * color;","#else","vColor = color;","#endif","#endif"].join("\n"),skinning_pars_vertex:["#ifdef USE_SKINNING","#ifdef BONE_TEXTURE","uniform sampler2D boneTexture;","mat4 getBoneMatrix( const in float i ) {","float j = i * 4.0;","float x = mod( j, N_BONE_PIXEL_X );","float y = floor( j / N_BONE_PIXEL_X );","const float dx = 1.0 / N_BONE_PIXEL_X;","const float dy = 1.0 / N_BONE_PIXEL_Y;","y = dy * ( y + 0.5 );","vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );","vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );","vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );","vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );","mat4 bone = mat4( v1, v2, v3, v4 );","return bone;","}","#else","uniform mat4 boneGlobalMatrices[ MAX_BONES ];","mat4 getBoneMatrix( const in float i ) {","mat4 bone = boneGlobalMatrices[ int(i) ];","return bone;","}","#endif","#endif"].join("\n"),skinbase_vertex:["#ifdef USE_SKINNING","mat4 boneMatX = getBoneMatrix( skinIndex.x );","mat4 boneMatY = getBoneMatrix( skinIndex.y );","#endif"].join("\n"),skinning_vertex:["#ifdef USE_SKINNING","#ifdef USE_MORPHTARGETS","vec4 skinVertex = vec4( morphed, 1.0 );","#else","vec4 skinVertex = vec4( position, 1.0 );","#endif","vec4 skinned = boneMatX * skinVertex * skinWeight.x;","skinned += boneMatY * skinVertex * skinWeight.y;","#endif"].join("\n"),morphtarget_pars_vertex:["#ifdef USE_MORPHTARGETS","#ifndef USE_MORPHNORMALS","uniform float morphTargetInfluences[ 8 ];","#else","uniform float morphTargetInfluences[ 4 ];","#endif","#endif"].join("\n"),morphtarget_vertex:["#ifdef USE_MORPHTARGETS","vec3 morphed = vec3( 0.0 );","morphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];","morphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];","morphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];","morphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];","#ifndef USE_MORPHNORMALS","morphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];","morphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];","morphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];","morphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];","#endif","morphed += position;","#endif"].join("\n"),default_vertex:["vec4 mvPosition;","#ifdef USE_SKINNING","mvPosition = modelViewMatrix * skinned;","#endif","#if !defined( USE_SKINNING ) && defined( USE_MORPHTARGETS )","mvPosition = modelViewMatrix * vec4( morphed, 1.0 );","#endif","#if !defined( USE_SKINNING ) && ! defined( USE_MORPHTARGETS )","mvPosition = modelViewMatrix * vec4( position, 1.0 );","#endif","gl_Position = projectionMatrix * mvPosition;"].join("\n"),morphnormal_vertex:["#ifdef USE_MORPHNORMALS","vec3 morphedNormal = vec3( 0.0 );","morphedNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];","morphedNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];","morphedNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];","morphedNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];","morphedNormal += normal;","#endif"].join("\n"),skinnormal_vertex:["#ifdef USE_SKINNING","mat4 skinMatrix = skinWeight.x * boneMatX;","skinMatrix += skinWeight.y * boneMatY;","#ifdef USE_MORPHNORMALS","vec4 skinnedNormal = skinMatrix * vec4( morphedNormal, 0.0 );","#else","vec4 skinnedNormal = skinMatrix * vec4( normal, 0.0 );","#endif","#endif"].join("\n"),defaultnormal_vertex:["vec3 objectNormal;","#ifdef USE_SKINNING","objectNormal = skinnedNormal.xyz;","#endif","#if !defined( USE_SKINNING ) && defined( USE_MORPHNORMALS )","objectNormal = morphedNormal;","#endif","#if !defined( USE_SKINNING ) && ! defined( USE_MORPHNORMALS )","objectNormal = normal;","#endif","#ifdef FLIP_SIDED","objectNormal = -objectNormal;","#endif","vec3 transformedNormal = normalMatrix * objectNormal;"].join("\n"),shadowmap_pars_fragment:["#ifdef USE_SHADOWMAP","uniform sampler2D shadowMap[ MAX_SHADOWS ];","uniform vec2 shadowMapSize[ MAX_SHADOWS ];","uniform float shadowDarkness[ MAX_SHADOWS ];","uniform float shadowBias[ MAX_SHADOWS ];","varying vec4 vShadowCoord[ MAX_SHADOWS ];","float unpackDepth( const in vec4 rgba_depth ) {","const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );","float depth = dot( rgba_depth, bit_shift );","return depth;","}","#endif"].join("\n"),shadowmap_fragment:["#ifdef USE_SHADOWMAP","#ifdef SHADOWMAP_DEBUG","vec3 frustumColors[3];","frustumColors[0] = vec3( 1.0, 0.5, 0.0 );","frustumColors[1] = vec3( 0.0, 1.0, 0.8 );","frustumColors[2] = vec3( 0.0, 0.5, 1.0 );","#endif","#ifdef SHADOWMAP_CASCADE","int inFrustumCount = 0;","#endif","float fDepth;","vec3 shadowColor = vec3( 1.0 );","for( int i = 0; i < MAX_SHADOWS; i ++ ) {","vec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;","bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );","bool inFrustum = all( inFrustumVec );","#ifdef SHADOWMAP_CASCADE","inFrustumCount += int( inFrustum );","bvec3 frustumTestVec = bvec3( inFrustum, inFrustumCount == 1, shadowCoord.z <= 1.0 );","#else","bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );","#endif","bool frustumTest = all( frustumTestVec );","if ( frustumTest ) {","shadowCoord.z += shadowBias[ i ];","#if defined( SHADOWMAP_TYPE_PCF )","float shadow = 0.0;","const float shadowDelta = 1.0 / 9.0;","float xPixelOffset = 1.0 / shadowMapSize[ i ].x;","float yPixelOffset = 1.0 / shadowMapSize[ i ].y;","float dx0 = -1.25 * xPixelOffset;","float dy0 = -1.25 * yPixelOffset;","float dx1 = 1.25 * xPixelOffset;","float dy1 = 1.25 * yPixelOffset;","fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );","if ( fDepth < shadowCoord.z ) shadow += shadowDelta;","fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );","if ( fDepth < shadowCoord.z ) shadow += shadowDelta;","fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );","if ( fDepth < shadowCoord.z ) shadow += shadowDelta;","fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );","if ( fDepth < shadowCoord.z ) shadow += shadowDelta;","fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );","if ( fDepth < shadowCoord.z ) shadow += shadowDelta;","fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );","if ( fDepth < shadowCoord.z ) shadow += shadowDelta;","fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );","if ( fDepth < shadowCoord.z ) shadow += shadowDelta;","fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );","if ( fDepth < shadowCoord.z ) shadow += shadowDelta;","fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );","if ( fDepth < shadowCoord.z ) shadow += shadowDelta;","shadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );","#elif defined( SHADOWMAP_TYPE_PCF_SOFT )","float shadow = 0.0;","float xPixelOffset = 1.0 / shadowMapSize[ i ].x;","float yPixelOffset = 1.0 / shadowMapSize[ i ].y;","float dx0 = -1.0 * xPixelOffset;","float dy0 = -1.0 * yPixelOffset;","float dx1 = 1.0 * xPixelOffset;","float dy1 = 1.0 * yPixelOffset;","mat3 shadowKernel;","mat3 depthKernel;","depthKernel[0][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );","depthKernel[0][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );","depthKernel[0][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );","depthKernel[1][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );","depthKernel[1][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );","depthKernel[1][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );","depthKernel[2][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );","depthKernel[2][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );","depthKernel[2][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );","vec3 shadowZ = vec3( shadowCoord.z );","shadowKernel[0] = vec3(lessThan(depthKernel[0], shadowZ ));","shadowKernel[0] *= vec3(0.25);","shadowKernel[1] = vec3(lessThan(depthKernel[1], shadowZ ));","shadowKernel[1] *= vec3(0.25);","shadowKernel[2] = vec3(lessThan(depthKernel[2], shadowZ ));","shadowKernel[2] *= vec3(0.25);","vec2 fractionalCoord = 1.0 - fract( shadowCoord.xy * shadowMapSize[i].xy );","shadowKernel[0] = mix( shadowKernel[1], shadowKernel[0], fractionalCoord.x );","shadowKernel[1] = mix( shadowKernel[2], shadowKernel[1], fractionalCoord.x );","vec4 shadowValues;","shadowValues.x = mix( shadowKernel[0][1], shadowKernel[0][0], fractionalCoord.y );","shadowValues.y = mix( shadowKernel[0][2], shadowKernel[0][1], fractionalCoord.y );","shadowValues.z = mix( shadowKernel[1][1], shadowKernel[1][0], fractionalCoord.y );","shadowValues.w = mix( shadowKernel[1][2], shadowKernel[1][1], fractionalCoord.y );","shadow = dot( shadowValues, vec4( 1.0 ) );","shadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );","#else","vec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );","float fDepth = unpackDepth( rgbaDepth );","if ( fDepth < shadowCoord.z )","shadowColor = shadowColor * vec3( 1.0 - shadowDarkness[ i ] );","#endif","}","#ifdef SHADOWMAP_DEBUG","#ifdef SHADOWMAP_CASCADE","if ( inFrustum && inFrustumCount == 1 ) gl_FragColor.xyz *= frustumColors[ i ];","#else","if ( inFrustum ) gl_FragColor.xyz *= frustumColors[ i ];","#endif","#endif","}","#ifdef GAMMA_OUTPUT","shadowColor *= shadowColor;","#endif","gl_FragColor.xyz = gl_FragColor.xyz * shadowColor;","#endif"].join("\n"),shadowmap_pars_vertex:["#ifdef USE_SHADOWMAP","varying vec4 vShadowCoord[ MAX_SHADOWS ];","uniform mat4 shadowMatrix[ MAX_SHADOWS ];","#endif"].join("\n"),shadowmap_vertex:["#ifdef USE_SHADOWMAP","for( int i = 0; i < MAX_SHADOWS; i ++ ) {","vShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;","}","#endif"].join("\n"),alphatest_fragment:["#ifdef ALPHATEST","if ( gl_FragColor.a < ALPHATEST ) discard;","#endif"].join("\n"),linear_to_gamma_fragment:["#ifdef GAMMA_OUTPUT","gl_FragColor.xyz = sqrt( gl_FragColor.xyz );","#endif"].join("\n")},r.UniformsUtils={merge:function(e){var t,i,r,n={};
for(t=0;e.length>t;t++){r=this.clone(e[t]);for(i in r)n[i]=r[i]}return n},clone:function(e){var t,i,n,s={};for(t in e){s[t]={};for(i in e[t])n=e[t][i],s[t][i]=n instanceof r.Color||n instanceof r.Vector2||n instanceof r.Vector3||n instanceof r.Vector4||n instanceof r.Matrix4||n instanceof r.Texture?n.clone():n instanceof Array?n.slice():n}return s}},r.UniformsLib={common:{diffuse:{type:"c",value:new r.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new r.Vector4(0,0,1,1)},lightMap:{type:"t",value:null},specularMap:{type:"t",value:null},envMap:{type:"t",value:null},flipEnvMap:{type:"f",value:-1},useRefract:{type:"i",value:0},reflectivity:{type:"f",value:1},refractionRatio:{type:"f",value:.98},combine:{type:"i",value:0},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 r.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 r.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:[]},spotLightColor:{type:"fv",value:[]},spotLightPosition:{type:"fv",value:[]},spotLightDirection:{type:"fv",value:[]},spotLightDistance:{type:"fv1",value:[]},spotLightAngleCos:{type:"fv1",value:[]},spotLightExponent:{type:"fv1",value:[]}},particle:{psColor:{type:"c",value:new r.Color(15658734)},opacity:{type:"f",value:1},size:{type:"f",value:1},scale:{type:"f",value:1},map:{type:"t",value:null},fogDensity:{type:"f",value:25e-5},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},fogColor:{type:"c",value:new r.Color(16777215)}},shadowmap:{shadowMap:{type:"tv",value:[]},shadowMapSize:{type:"v2v",value:[]},shadowBias:{type:"fv1",value:[]},shadowDarkness:{type:"fv1",value:[]},shadowMatrix:{type:"m4v",value:[]}}},r.ShaderLib={basic:{uniforms:r.UniformsUtils.merge([r.UniformsLib.common,r.UniformsLib.fog,r.UniformsLib.shadowmap]),vertexShader:[r.ShaderChunk.map_pars_vertex,r.ShaderChunk.lightmap_pars_vertex,r.ShaderChunk.envmap_pars_vertex,r.ShaderChunk.color_pars_vertex,r.ShaderChunk.morphtarget_pars_vertex,r.ShaderChunk.skinning_pars_vertex,r.ShaderChunk.shadowmap_pars_vertex,"void main() {",r.ShaderChunk.map_vertex,r.ShaderChunk.lightmap_vertex,r.ShaderChunk.color_vertex,r.ShaderChunk.skinbase_vertex,"#ifdef USE_ENVMAP",r.ShaderChunk.morphnormal_vertex,r.ShaderChunk.skinnormal_vertex,r.ShaderChunk.defaultnormal_vertex,"#endif",r.ShaderChunk.morphtarget_vertex,r.ShaderChunk.skinning_vertex,r.ShaderChunk.default_vertex,r.ShaderChunk.worldpos_vertex,r.ShaderChunk.envmap_vertex,r.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;","uniform float opacity;",r.ShaderChunk.color_pars_fragment,r.ShaderChunk.map_pars_fragment,r.ShaderChunk.lightmap_pars_fragment,r.ShaderChunk.envmap_pars_fragment,r.ShaderChunk.fog_pars_fragment,r.ShaderChunk.shadowmap_pars_fragment,r.ShaderChunk.specularmap_pars_fragment,"void main() {","gl_FragColor = vec4( diffuse, opacity );",r.ShaderChunk.map_fragment,r.ShaderChunk.alphatest_fragment,r.ShaderChunk.specularmap_fragment,r.ShaderChunk.lightmap_fragment,r.ShaderChunk.color_fragment,r.ShaderChunk.envmap_fragment,r.ShaderChunk.shadowmap_fragment,r.ShaderChunk.linear_to_gamma_fragment,r.ShaderChunk.fog_fragment,"}"].join("\n")},lambert:{uniforms:r.UniformsUtils.merge([r.UniformsLib.common,r.UniformsLib.fog,r.UniformsLib.lights,r.UniformsLib.shadowmap,{ambient:{type:"c",value:new r.Color(16777215)},emissive:{type:"c",value:new r.Color(0)},wrapRGB:{type:"v3",value:new r.Vector3(1,1,1)}}]),vertexShader:["#define LAMBERT","varying vec3 vLightFront;","#ifdef DOUBLE_SIDED","varying vec3 vLightBack;","#endif",r.ShaderChunk.map_pars_vertex,r.ShaderChunk.lightmap_pars_vertex,r.ShaderChunk.envmap_pars_vertex,r.ShaderChunk.lights_lambert_pars_vertex,r.ShaderChunk.color_pars_vertex,r.ShaderChunk.morphtarget_pars_vertex,r.ShaderChunk.skinning_pars_vertex,r.ShaderChunk.shadowmap_pars_vertex,"void main() {",r.ShaderChunk.map_vertex,r.ShaderChunk.lightmap_vertex,r.ShaderChunk.color_vertex,r.ShaderChunk.morphnormal_vertex,r.ShaderChunk.skinbase_vertex,r.ShaderChunk.skinnormal_vertex,r.ShaderChunk.defaultnormal_vertex,r.ShaderChunk.morphtarget_vertex,r.ShaderChunk.skinning_vertex,r.ShaderChunk.default_vertex,r.ShaderChunk.worldpos_vertex,r.ShaderChunk.envmap_vertex,r.ShaderChunk.lights_lambert_vertex,r.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;","varying vec3 vLightFront;","#ifdef DOUBLE_SIDED","varying vec3 vLightBack;","#endif",r.ShaderChunk.color_pars_fragment,r.ShaderChunk.map_pars_fragment,r.ShaderChunk.lightmap_pars_fragment,r.ShaderChunk.envmap_pars_fragment,r.ShaderChunk.fog_pars_fragment,r.ShaderChunk.shadowmap_pars_fragment,r.ShaderChunk.specularmap_pars_fragment,"void main() {","gl_FragColor = vec4( vec3 ( 1.0 ), opacity );",r.ShaderChunk.map_fragment,r.ShaderChunk.alphatest_fragment,r.ShaderChunk.specularmap_fragment,"#ifdef DOUBLE_SIDED","if ( gl_FrontFacing )","gl_FragColor.xyz *= vLightFront;","else","gl_FragColor.xyz *= vLightBack;","#else","gl_FragColor.xyz *= vLightFront;","#endif",r.ShaderChunk.lightmap_fragment,r.ShaderChunk.color_fragment,r.ShaderChunk.envmap_fragment,r.ShaderChunk.shadowmap_fragment,r.ShaderChunk.linear_to_gamma_fragment,r.ShaderChunk.fog_fragment,"}"].join("\n")},phong:{uniforms:r.UniformsUtils.merge([r.UniformsLib.common,r.UniformsLib.bump,r.UniformsLib.normalmap,r.UniformsLib.fog,r.UniformsLib.lights,r.UniformsLib.shadowmap,{ambient:{type:"c",value:new r.Color(16777215)},emissive:{type:"c",value:new r.Color(0)},specular:{type:"c",value:new r.Color(1118481)},shininess:{type:"f",value:30},wrapRGB:{type:"v3",value:new r.Vector3(1,1,1)}}]),vertexShader:["#define PHONG","varying vec3 vViewPosition;","varying vec3 vNormal;",r.ShaderChunk.map_pars_vertex,r.ShaderChunk.lightmap_pars_vertex,r.ShaderChunk.envmap_pars_vertex,r.ShaderChunk.lights_phong_pars_vertex,r.ShaderChunk.color_pars_vertex,r.ShaderChunk.morphtarget_pars_vertex,r.ShaderChunk.skinning_pars_vertex,r.ShaderChunk.shadowmap_pars_vertex,"void main() {",r.ShaderChunk.map_vertex,r.ShaderChunk.lightmap_vertex,r.ShaderChunk.color_vertex,r.ShaderChunk.morphnormal_vertex,r.ShaderChunk.skinbase_vertex,r.ShaderChunk.skinnormal_vertex,r.ShaderChunk.defaultnormal_vertex,"vNormal = normalize( transformedNormal );",r.ShaderChunk.morphtarget_vertex,r.ShaderChunk.skinning_vertex,r.ShaderChunk.default_vertex,"vViewPosition = -mvPosition.xyz;",r.ShaderChunk.worldpos_vertex,r.ShaderChunk.envmap_vertex,r.ShaderChunk.lights_phong_vertex,r.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;","uniform float opacity;","uniform vec3 ambient;","uniform vec3 emissive;","uniform vec3 specular;","uniform float shininess;",r.ShaderChunk.color_pars_fragment,r.ShaderChunk.map_pars_fragment,r.ShaderChunk.lightmap_pars_fragment,r.ShaderChunk.envmap_pars_fragment,r.ShaderChunk.fog_pars_fragment,r.ShaderChunk.lights_phong_pars_fragment,r.ShaderChunk.shadowmap_pars_fragment,r.ShaderChunk.bumpmap_pars_fragment,r.ShaderChunk.normalmap_pars_fragment,r.ShaderChunk.specularmap_pars_fragment,"void main() {","gl_FragColor = vec4( vec3 ( 1.0 ), opacity );",r.ShaderChunk.map_fragment,r.ShaderChunk.alphatest_fragment,r.ShaderChunk.specularmap_fragment,r.ShaderChunk.lights_phong_fragment,r.ShaderChunk.lightmap_fragment,r.ShaderChunk.color_fragment,r.ShaderChunk.envmap_fragment,r.ShaderChunk.shadowmap_fragment,r.ShaderChunk.linear_to_gamma_fragment,r.ShaderChunk.fog_fragment,"}"].join("\n")},particle_basic:{uniforms:r.UniformsUtils.merge([r.UniformsLib.particle,r.UniformsLib.shadowmap]),vertexShader:["uniform float size;","uniform float scale;",r.ShaderChunk.color_pars_vertex,r.ShaderChunk.shadowmap_pars_vertex,"void main() {",r.ShaderChunk.color_vertex,"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","#ifdef USE_SIZEATTENUATION","gl_PointSize = size * ( scale / length( mvPosition.xyz ) );","#else","gl_PointSize = size;","#endif","gl_Position = projectionMatrix * mvPosition;",r.ShaderChunk.worldpos_vertex,r.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 psColor;","uniform float opacity;",r.ShaderChunk.color_pars_fragment,r.ShaderChunk.map_particle_pars_fragment,r.ShaderChunk.fog_pars_fragment,r.ShaderChunk.shadowmap_pars_fragment,"void main() {","gl_FragColor = vec4( psColor, opacity );",r.ShaderChunk.map_particle_fragment,r.ShaderChunk.alphatest_fragment,r.ShaderChunk.color_fragment,r.ShaderChunk.shadowmap_fragment,r.ShaderChunk.fog_fragment,"}"].join("\n")},dashed:{uniforms:r.UniformsUtils.merge([r.UniformsLib.common,r.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;",r.ShaderChunk.color_pars_vertex,"void main() {",r.ShaderChunk.color_vertex,"vLineDistance = scale * lineDistance;","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform vec3 diffuse;","uniform float opacity;","uniform float dashSize;","uniform float totalSize;","varying float vLineDistance;",r.ShaderChunk.color_pars_fragment,r.ShaderChunk.fog_pars_fragment,"void main() {","if ( mod( vLineDistance, totalSize ) > dashSize ) {","discard;","}","gl_FragColor = vec4( diffuse, opacity );",r.ShaderChunk.color_fragment,r.ShaderChunk.fog_fragment,"}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2e3},opacity:{type:"f",value:1}},vertexShader:["void main() {","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float mNear;","uniform float mFar;","uniform float opacity;","void main() {","float depth = gl_FragCoord.z / gl_FragCoord.w;","float color = 1.0 - smoothstep( mNear, mFar, depth );","gl_FragColor = vec4( vec3( color ), opacity );","}"].join("\n")},normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",r.ShaderChunk.morphtarget_pars_vertex,"void main() {","vNormal = normalize( normalMatrix * normal );",r.ShaderChunk.morphtarget_vertex,r.ShaderChunk.default_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;","varying vec3 vNormal;","void main() {","gl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );","}"].join("\n")},normalmap:{uniforms:r.UniformsUtils.merge([r.UniformsLib.fog,r.UniformsLib.lights,r.UniformsLib.shadowmap,{enableAO:{type:"i",value:0},enableDiffuse:{type:"i",value:0},enableSpecular:{type:"i",value:0},enableReflection:{type:"i",value:0},enableDisplacement:{type:"i",value:0},tDisplacement:{type:"t",value:null},tDiffuse:{type:"t",value:null},tCube:{type:"t",value:null},tNormal:{type:"t",value:null},tSpecular:{type:"t",value:null},tAO:{type:"t",value:null},uNormalScale:{type:"v2",value:new r.Vector2(1,1)},uDisplacementBias:{type:"f",value:0},uDisplacementScale:{type:"f",value:1},uDiffuseColor:{type:"c",value:new r.Color(16777215)},uSpecularColor:{type:"c",value:new r.Color(1118481)},uAmbientColor:{type:"c",value:new r.Color(16777215)},uShininess:{type:"f",value:30},uOpacity:{type:"f",value:1},useRefract:{type:"i",value:0},uRefractionRatio:{type:"f",value:.98},uReflectivity:{type:"f",value:.5},uOffset:{type:"v2",value:new r.Vector2(0,0)},uRepeat:{type:"v2",value:new r.Vector2(1,1)},wrapRGB:{type:"v3",value:new r.Vector3(1,1,1)}}]),fragmentShader:["uniform vec3 uAmbientColor;","uniform vec3 uDiffuseColor;","uniform vec3 uSpecularColor;","uniform float uShininess;","uniform float uOpacity;","uniform bool enableDiffuse;","uniform bool enableSpecular;","uniform bool enableAO;","uniform bool enableReflection;","uniform sampler2D tDiffuse;","uniform sampler2D tNormal;","uniform sampler2D tSpecular;","uniform sampler2D tAO;","uniform samplerCube tCube;","uniform vec2 uNormalScale;","uniform bool useRefract;","uniform float uRefractionRatio;","uniform float uReflectivity;","varying vec3 vTangent;","varying vec3 vBinormal;","varying vec3 vNormal;","varying vec2 vUv;","uniform vec3 ambientLightColor;","#if MAX_DIR_LIGHTS > 0","uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];","uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];","#endif","#if MAX_HEMI_LIGHTS > 0","uniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];","uniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];","uniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];","#endif","#if MAX_POINT_LIGHTS > 0","uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];","uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];","uniform float pointLightDistance[ MAX_POINT_LIGHTS ];","#endif","#if MAX_SPOT_LIGHTS > 0","uniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];","uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];","uniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];","uniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];","uniform float spotLightExponent[ MAX_SPOT_LIGHTS ];","uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];","#endif","#ifdef WRAP_AROUND","uniform vec3 wrapRGB;","#endif","varying vec3 vWorldPosition;","varying vec3 vViewPosition;",r.ShaderChunk.shadowmap_pars_fragment,r.ShaderChunk.fog_pars_fragment,"void main() {","gl_FragColor = vec4( vec3( 1.0 ), uOpacity );","vec3 specularTex = vec3( 1.0 );","vec3 normalTex = texture2D( tNormal, vUv ).xyz * 2.0 - 1.0;","normalTex.xy *= uNormalScale;","normalTex = normalize( normalTex );","if( enableDiffuse ) {","#ifdef GAMMA_INPUT","vec4 texelColor = texture2D( tDiffuse, vUv );","texelColor.xyz *= texelColor.xyz;","gl_FragColor = gl_FragColor * texelColor;","#else","gl_FragColor = gl_FragColor * texture2D( tDiffuse, vUv );","#endif","}","if( enableAO ) {","#ifdef GAMMA_INPUT","vec4 aoColor = texture2D( tAO, vUv );","aoColor.xyz *= aoColor.xyz;","gl_FragColor.xyz = gl_FragColor.xyz * aoColor.xyz;","#else","gl_FragColor.xyz = gl_FragColor.xyz * texture2D( tAO, vUv ).xyz;","#endif","}","if( enableSpecular )","specularTex = texture2D( tSpecular, vUv ).xyz;","mat3 tsb = mat3( normalize( vTangent ), normalize( vBinormal ), normalize( vNormal ) );","vec3 finalNormal = tsb * normalTex;","#ifdef FLIP_SIDED","finalNormal = -finalNormal;","#endif","vec3 normal = normalize( finalNormal );","vec3 viewPosition = normalize( vViewPosition );","#if MAX_POINT_LIGHTS > 0","vec3 pointDiffuse = vec3( 0.0 );","vec3 pointSpecular = vec3( 0.0 );","for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {","vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );","vec3 pointVector = lPosition.xyz + vViewPosition.xyz;","float pointDistance = 1.0;","if ( pointLightDistance[ i ] > 0.0 )","pointDistance = 1.0 - min( ( length( pointVector ) / pointLightDistance[ i ] ), 1.0 );","pointVector = normalize( pointVector );","#ifdef WRAP_AROUND","float pointDiffuseWeightFull = max( dot( normal, pointVector ), 0.0 );","float pointDiffuseWeightHalf = max( 0.5 * dot( normal, pointVector ) + 0.5, 0.0 );","vec3 pointDiffuseWeight = mix( vec3 ( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );","#else","float pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );","#endif","pointDiffuse += pointDistance * pointLightColor[ i ] * uDiffuseColor * pointDiffuseWeight;","vec3 pointHalfVector = normalize( pointVector + viewPosition );","float pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );","float pointSpecularWeight = specularTex.r * max( pow( pointDotNormalHalf, uShininess ), 0.0 );","#ifdef PHYSICALLY_BASED_SHADING","float specularNormalization = ( uShininess + 2.0001 ) / 8.0;","vec3 schlick = uSpecularColor + vec3( 1.0 - uSpecularColor ) * pow( 1.0 - dot( pointVector, pointHalfVector ), 5.0 );","pointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance * specularNormalization;","#else","pointSpecular += pointDistance * pointLightColor[ i ] * uSpecularColor * pointSpecularWeight * pointDiffuseWeight;","#endif","}","#endif","#if MAX_SPOT_LIGHTS > 0","vec3 spotDiffuse = vec3( 0.0 );","vec3 spotSpecular = vec3( 0.0 );","for ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {","vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );","vec3 spotVector = lPosition.xyz + vViewPosition.xyz;","float spotDistance = 1.0;","if ( spotLightDistance[ i ] > 0.0 )","spotDistance = 1.0 - min( ( length( spotVector ) / spotLightDistance[ i ] ), 1.0 );","spotVector = normalize( spotVector );","float spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );","if ( spotEffect > spotLightAngleCos[ i ] ) {","spotEffect = max( pow( spotEffect, spotLightExponent[ i ] ), 0.0 );","#ifdef WRAP_AROUND","float spotDiffuseWeightFull = max( dot( normal, spotVector ), 0.0 );","float spotDiffuseWeightHalf = max( 0.5 * dot( normal, spotVector ) + 0.5, 0.0 );","vec3 spotDiffuseWeight = mix( vec3 ( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );","#else","float spotDiffuseWeight = max( dot( normal, spotVector ), 0.0 );","#endif","spotDiffuse += spotDistance * spotLightColor[ i ] * uDiffuseColor * spotDiffuseWeight * spotEffect;","vec3 spotHalfVector = normalize( spotVector + viewPosition );","float spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );","float spotSpecularWeight = specularTex.r * max( pow( spotDotNormalHalf, uShininess ), 0.0 );","#ifdef PHYSICALLY_BASED_SHADING","float specularNormalization = ( uShininess + 2.0001 ) / 8.0;","vec3 schlick = uSpecularColor + vec3( 1.0 - uSpecularColor ) * pow( 1.0 - dot( spotVector, spotHalfVector ), 5.0 );","spotSpecular += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * spotDistance * specularNormalization * spotEffect;","#else","spotSpecular += spotDistance * spotLightColor[ i ] * uSpecularColor * spotSpecularWeight * spotDiffuseWeight * spotEffect;","#endif","}","}","#endif","#if MAX_DIR_LIGHTS > 0","vec3 dirDiffuse = vec3( 0.0 );","vec3 dirSpecular = vec3( 0.0 );","for( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {","vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );","vec3 dirVector = normalize( lDirection.xyz );","#ifdef WRAP_AROUND","float directionalLightWeightingFull = max( dot( normal, dirVector ), 0.0 );","float directionalLightWeightingHalf = max( 0.5 * dot( normal, dirVector ) + 0.5, 0.0 );","vec3 dirDiffuseWeight = mix( vec3( directionalLightWeightingFull ), vec3( directionalLightWeightingHalf ), wrapRGB );","#else","float dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );","#endif","dirDiffuse += directionalLightColor[ i ] * uDiffuseColor * dirDiffuseWeight;","vec3 dirHalfVector = normalize( dirVector + viewPosition );","float dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );","float dirSpecularWeight = specularTex.r * max( pow( dirDotNormalHalf, uShininess ), 0.0 );","#ifdef PHYSICALLY_BASED_SHADING","float specularNormalization = ( uShininess + 2.0001 ) / 8.0;","vec3 schlick = uSpecularColor + vec3( 1.0 - uSpecularColor ) * pow( 1.0 - dot( dirVector, dirHalfVector ), 5.0 );","dirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;","#else","dirSpecular += directionalLightColor[ i ] * uSpecularColor * dirSpecularWeight * dirDiffuseWeight;","#endif","}","#endif","#if MAX_HEMI_LIGHTS > 0","vec3 hemiDiffuse = vec3( 0.0 );","vec3 hemiSpecular = vec3( 0.0 );","for( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {","vec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );","vec3 lVector = normalize( lDirection.xyz );","float dotProduct = dot( normal, lVector );","float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;","vec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );","hemiDiffuse += uDiffuseColor * hemiColor;","vec3 hemiHalfVectorSky = normalize( lVector + viewPosition );","float hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;","float hemiSpecularWeightSky = specularTex.r * max( pow( hemiDotNormalHalfSky, uShininess ), 0.0 );","vec3 lVectorGround = -lVector;","vec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );","float hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;","float hemiSpecularWeightGround = specularTex.r * max( pow( hemiDotNormalHalfGround, uShininess ), 0.0 );","#ifdef PHYSICALLY_BASED_SHADING","float dotProductGround = dot( normal, lVectorGround );","float specularNormalization = ( uShininess + 2.0001 ) / 8.0;","vec3 schlickSky = uSpecularColor + vec3( 1.0 - uSpecularColor ) * pow( 1.0 - dot( lVector, hemiHalfVectorSky ), 5.0 );","vec3 schlickGround = uSpecularColor + vec3( 1.0 - uSpecularColor ) * pow( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 5.0 );","hemiSpecular += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );","#else","hemiSpecular += uSpecularColor * hemiColor * ( hemiSpecularWeightSky + hemiSpecularWeightGround ) * hemiDiffuseWeight;","#endif","}","#endif","vec3 totalDiffuse = vec3( 0.0 );","vec3 totalSpecular = vec3( 0.0 );","#if MAX_DIR_LIGHTS > 0","totalDiffuse += dirDiffuse;","totalSpecular += dirSpecular;","#endif","#if MAX_HEMI_LIGHTS > 0","totalDiffuse += hemiDiffuse;","totalSpecular += hemiSpecular;","#endif","#if MAX_POINT_LIGHTS > 0","totalDiffuse += pointDiffuse;","totalSpecular += pointSpecular;","#endif","#if MAX_SPOT_LIGHTS > 0","totalDiffuse += spotDiffuse;","totalSpecular += spotSpecular;","#endif","#ifdef METAL","gl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * uAmbientColor + totalSpecular );","#else","gl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * uAmbientColor ) + totalSpecular;","#endif","if ( enableReflection ) {","vec3 vReflect;","vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );","if ( useRefract ) {","vReflect = refract( cameraToVertex, normal, uRefractionRatio );","} else {","vReflect = reflect( cameraToVertex, normal );","}","vec4 cubeColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );","#ifdef GAMMA_INPUT","cubeColor.xyz *= cubeColor.xyz;","#endif","gl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularTex.r * uReflectivity );","}",r.ShaderChunk.shadowmap_fragment,r.ShaderChunk.linear_to_gamma_fragment,r.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["attribute vec4 tangent;","uniform vec2 uOffset;","uniform vec2 uRepeat;","uniform bool enableDisplacement;","#ifdef VERTEX_TEXTURES","uniform sampler2D tDisplacement;","uniform float uDisplacementScale;","uniform float uDisplacementBias;","#endif","varying vec3 vTangent;","varying vec3 vBinormal;","varying vec3 vNormal;","varying vec2 vUv;","varying vec3 vWorldPosition;","varying vec3 vViewPosition;",r.ShaderChunk.skinning_pars_vertex,r.ShaderChunk.shadowmap_pars_vertex,"void main() {",r.ShaderChunk.skinbase_vertex,r.ShaderChunk.skinnormal_vertex,"#ifdef USE_SKINNING","vNormal = normalize( normalMatrix * skinnedNormal.xyz );","vec4 skinnedTangent = skinMatrix * vec4( tangent.xyz, 0.0 );","vTangent = normalize( normalMatrix * skinnedTangent.xyz );","#else","vNormal = normalize( normalMatrix * normal );","vTangent = normalize( normalMatrix * tangent.xyz );","#endif","vBinormal = normalize( cross( vNormal, vTangent ) * tangent.w );","vUv = uv * uRepeat + uOffset;","vec3 displacedPosition;","#ifdef VERTEX_TEXTURES","if ( enableDisplacement ) {","vec3 dv = texture2D( tDisplacement, uv ).xyz;","float df = uDisplacementScale * dv.x + uDisplacementBias;","displacedPosition = position + normalize( normal ) * df;","} else {","#ifdef USE_SKINNING","vec4 skinVertex = vec4( position, 1.0 );","vec4 skinned = boneMatX * skinVertex * skinWeight.x;","skinned += boneMatY * skinVertex * skinWeight.y;","displacedPosition = skinned.xyz;","#else","displacedPosition = position;","#endif","}","#else","#ifdef USE_SKINNING","vec4 skinVertex = vec4( position, 1.0 );","vec4 skinned = boneMatX * skinVertex * skinWeight.x;","skinned += boneMatY * skinVertex * skinWeight.y;","displacedPosition = skinned.xyz;","#else","displacedPosition = position;","#endif","#endif","vec4 mvPosition = modelViewMatrix * vec4( displacedPosition, 1.0 );","vec4 worldPosition = modelMatrix * vec4( displacedPosition, 1.0 );","gl_Position = projectionMatrix * mvPosition;","vWorldPosition = worldPosition.xyz;","vViewPosition = -mvPosition.xyz;","#ifdef USE_SHADOWMAP","for( int i = 0; i < MAX_SHADOWS; i ++ ) {","vShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;","}","#endif","}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;","void main() {","vec4 worldPosition = modelMatrix * vec4( position, 1.0 );","vWorldPosition = worldPosition.xyz;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform samplerCube tCube;","uniform float tFlip;","varying vec3 vWorldPosition;","void main() {","gl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );","}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[r.ShaderChunk.morphtarget_pars_vertex,r.ShaderChunk.skinning_pars_vertex,"void main() {",r.ShaderChunk.skinbase_vertex,r.ShaderChunk.morphtarget_vertex,r.ShaderChunk.skinning_vertex,r.ShaderChunk.default_vertex,"}"].join("\n"),fragmentShader:["vec4 pack_depth( const in float depth ) {","const vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );","const vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );","vec4 res = fract( depth * bit_shift );","res -= res.xxyz * bit_mask;","return res;","}","void main() {","gl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );","}"].join("\n")}},r.WebGLRenderer=function(e){function t(e){e.__webglVertexBuffer=Nt.createBuffer(),e.__webglColorBuffer=Nt.createBuffer(),qt.info.memory.geometries++}function i(e){e.__webglVertexBuffer=Nt.createBuffer(),e.__webglColorBuffer=Nt.createBuffer(),e.__webglLineDistanceBuffer=Nt.createBuffer(),qt.info.memory.geometries++}function n(e){e.__webglVertexBuffer=Nt.createBuffer(),e.__webglColorBuffer=Nt.createBuffer(),e.__webglNormalBuffer=Nt.createBuffer(),qt.info.memory.geometries++}function s(e){e.__webglVertexBuffer=Nt.createBuffer(),e.__webglNormalBuffer=Nt.createBuffer(),e.__webglTangentBuffer=Nt.createBuffer(),e.__webglColorBuffer=Nt.createBuffer(),e.__webglUVBuffer=Nt.createBuffer(),e.__webglUV2Buffer=Nt.createBuffer(),e.__webglSkinIndicesBuffer=Nt.createBuffer(),e.__webglSkinWeightsBuffer=Nt.createBuffer(),e.__webglFaceBuffer=Nt.createBuffer(),e.__webglLineBuffer=Nt.createBuffer();var t,i;if(e.numMorphTargets)for(e.__webglMorphTargetsBuffers=[],t=0,i=e.numMorphTargets;i>t;t++)e.__webglMorphTargetsBuffers.push(Nt.createBuffer());if(e.numMorphNormals)for(e.__webglMorphNormalsBuffers=[],t=0,i=e.numMorphNormals;i>t;t++)e.__webglMorphNormalsBuffers.push(Nt.createBuffer());qt.info.memory.geometries++}function o(e){if(e.__webglCustomAttributesList)for(var t in e.__webglCustomAttributesList)Nt.deleteBuffer(e.__webglCustomAttributesList[t].buffer)}function a(e,t){var i=e.vertices.length,r=t.material;if(r.attributes){void 0===e.__webglCustomAttributesList&&(e.__webglCustomAttributesList=[]);for(var n in r.attributes){var s=r.attributes[n];if(!s.__webglInitialized||s.createUniqueBuffers){s.__webglInitialized=!0;var o=1;"v2"===s.type?o=2:"v3"===s.type?o=3:"v4"===s.type?o=4:"c"===s.type&&(o=3),s.size=o,s.array=new Float32Array(i*o),s.buffer=Nt.createBuffer(),s.buffer.belongsToAttribute=n,s.needsUpdate=!0}e.__webglCustomAttributesList.push(s)}}}function l(e,t){var i=e.vertices.length;e.__vertexArray=new Float32Array(3*i),e.__colorArray=new Float32Array(3*i),e.__sortArray=[],e.__webglParticleCount=i,a(e,t)}function d(e,t){var i=e.vertices.length;e.__vertexArray=new Float32Array(3*i),e.__colorArray=new Float32Array(3*i),e.__lineDistanceArray=new Float32Array(1*i),e.__webglLineCount=i,a(e,t)}function c(e,t){var i=e.vertices.length;e.__vertexArray=new Float32Array(3*i),e.__colorArray=new Float32Array(3*i),e.__normalArray=new Float32Array(3*i),e.__webglVertexCount=i,a(e,t)}function h(e,t){var i=t.geometry,r=e.faces3,n=e.faces4,s=3*r.length+4*n.length,o=1*r.length+2*n.length,a=3*r.length+4*n.length,l=u(t,e),d=v(l),c=f(l),h=g(l);e.__vertexArray=new Float32Array(3*s),c&&(e.__normalArray=new Float32Array(3*s)),i.hasTangents&&(e.__tangentArray=new Float32Array(4*s)),h&&(e.__colorArray=new Float32Array(3*s)),d&&((i.faceUvs.length>0||i.faceVertexUvs.length>0)&&(e.__uvArray=new Float32Array(2*s)),(i.faceUvs.length>1||i.faceVertexUvs.length>1)&&(e.__uv2Array=new Float32Array(2*s))),t.geometry.skinWeights.length&&t.geometry.skinIndices.length&&(e.__skinIndexArray=new Float32Array(4*s),e.__skinWeightArray=new Float32Array(4*s)),e.__faceArray=new Uint16Array(3*o),e.__lineArray=new Uint16Array(2*a);var p,m;if(e.numMorphTargets)for(e.__morphTargetsArrays=[],p=0,m=e.numMorphTargets;m>p;p++)e.__morphTargetsArrays.push(new Float32Array(3*s));if(e.numMorphNormals)for(e.__morphNormalsArrays=[],p=0,m=e.numMorphNormals;m>p;p++)e.__morphNormalsArrays.push(new Float32Array(3*s));if(e.__webglFaceCount=3*o,e.__webglLineCount=2*a,l.attributes){void 0===e.__webglCustomAttributesList&&(e.__webglCustomAttributesList=[]);for(var y in l.attributes){var w=l.attributes[y],x={};for(var b in w)x[b]=w[b];if(!x.__webglInitialized||x.createUniqueBuffers){x.__webglInitialized=!0;var E=1;"v2"===x.type?E=2:"v3"===x.type?E=3:"v4"===x.type?E=4:"c"===x.type&&(E=3),x.size=E,x.array=new Float32Array(s*E),x.buffer=Nt.createBuffer(),x.buffer.belongsToAttribute=y,w.needsUpdate=!0,x.__original=w}e.__webglCustomAttributesList.push(x)}}e.__inittedArrays=!0}function u(e,t){return e.material instanceof r.MeshFaceMaterial?e.material.materials[t.materialIndex]:e.material}function p(e){return e&&void 0!==e.shading&&e.shading===r.SmoothShading}function f(e){return e instanceof r.MeshBasicMaterial&&!e.envMap||e instanceof r.MeshDepthMaterial?!1:p(e)?r.SmoothShading:r.FlatShading}function g(e){return e.vertexColors?e.vertexColors:!1}function v(e){return e.map||e.lightMap||e.bumpMap||e.normalMap||e.specularMap||e instanceof r.ShaderMaterial?!0:!1}function m(e){var t,i,r;for(t in e.attributes)r="index"===t?Nt.ELEMENT_ARRAY_BUFFER:Nt.ARRAY_BUFFER,i=e.attributes[t],void 0===i.numItems&&(i.numItems=i.array.length),i.buffer=Nt.createBuffer(),Nt.bindBuffer(r,i.buffer),Nt.bufferData(r,i.array,Nt.STATIC_DRAW)}function y(e,t,i){var r,n,s,o,a,l,d,c,h,u,p,f,g=e.vertices,v=g.length,m=e.colors,y=m.length,w=e.__vertexArray,x=e.__colorArray,b=e.__sortArray,E=e.verticesNeedUpdate,_=(e.elementsNeedUpdate,e.colorsNeedUpdate),T=e.__webglCustomAttributesList;if(i.sortParticles){for(Ti.copy(_i),Ti.multiply(i.matrixWorld),r=0;v>r;r++)s=g[r],Ci.copy(s),Ci.applyProjection(Ti),b[r]=[Ci.z,r];for(b.sort(S),r=0;v>r;r++)s=g[b[r][1]],o=3*r,w[o]=s.x,w[o+1]=s.y,w[o+2]=s.z;for(n=0;y>n;n++)o=3*n,l=m[b[n][1]],x[o]=l.r,x[o+1]=l.g,x[o+2]=l.b;if(T)for(d=0,c=T.length;c>d;d++)if(f=T[d],void 0===f.boundTo||"vertices"===f.boundTo)if(o=0,u=f.value.length,1===f.size)for(h=0;u>h;h++)a=b[h][1],f.array[h]=f.value[a];else if(2===f.size)for(h=0;u>h;h++)a=b[h][1],p=f.value[a],f.array[o]=p.x,f.array[o+1]=p.y,o+=2;else if(3===f.size)if("c"===f.type)for(h=0;u>h;h++)a=b[h][1],p=f.value[a],f.array[o]=p.r,f.array[o+1]=p.g,f.array[o+2]=p.b,o+=3;else for(h=0;u>h;h++)a=b[h][1],p=f.value[a],f.array[o]=p.x,f.array[o+1]=p.y,f.array[o+2]=p.z,o+=3;
else if(4===f.size)for(h=0;u>h;h++)a=b[h][1],p=f.value[a],f.array[o]=p.x,f.array[o+1]=p.y,f.array[o+2]=p.z,f.array[o+3]=p.w,o+=4}else{if(E)for(r=0;v>r;r++)s=g[r],o=3*r,w[o]=s.x,w[o+1]=s.y,w[o+2]=s.z;if(_)for(n=0;y>n;n++)l=m[n],o=3*n,x[o]=l.r,x[o+1]=l.g,x[o+2]=l.b;if(T)for(d=0,c=T.length;c>d;d++)if(f=T[d],f.needsUpdate&&(void 0===f.boundTo||"vertices"===f.boundTo))if(u=f.value.length,o=0,1===f.size)for(h=0;u>h;h++)f.array[h]=f.value[h];else if(2===f.size)for(h=0;u>h;h++)p=f.value[h],f.array[o]=p.x,f.array[o+1]=p.y,o+=2;else if(3===f.size)if("c"===f.type)for(h=0;u>h;h++)p=f.value[h],f.array[o]=p.r,f.array[o+1]=p.g,f.array[o+2]=p.b,o+=3;else for(h=0;u>h;h++)p=f.value[h],f.array[o]=p.x,f.array[o+1]=p.y,f.array[o+2]=p.z,o+=3;else if(4===f.size)for(h=0;u>h;h++)p=f.value[h],f.array[o]=p.x,f.array[o+1]=p.y,f.array[o+2]=p.z,f.array[o+3]=p.w,o+=4}if((E||i.sortParticles)&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,e.__webglVertexBuffer),Nt.bufferData(Nt.ARRAY_BUFFER,w,t)),(_||i.sortParticles)&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,e.__webglColorBuffer),Nt.bufferData(Nt.ARRAY_BUFFER,x,t)),T)for(d=0,c=T.length;c>d;d++)f=T[d],(f.needsUpdate||i.sortParticles)&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,f.buffer),Nt.bufferData(Nt.ARRAY_BUFFER,f.array,t))}function w(e,t){var i,r,n,s,o,a,l,d,c,h,u,p,f=e.vertices,g=e.colors,v=e.lineDistances,m=f.length,y=g.length,w=v.length,x=e.__vertexArray,b=e.__colorArray,E=e.__lineDistanceArray,_=e.verticesNeedUpdate,T=e.colorsNeedUpdate,C=e.lineDistancesNeedUpdate,M=e.__webglCustomAttributesList;if(_){for(i=0;m>i;i++)s=f[i],o=3*i,x[o]=s.x,x[o+1]=s.y,x[o+2]=s.z;Nt.bindBuffer(Nt.ARRAY_BUFFER,e.__webglVertexBuffer),Nt.bufferData(Nt.ARRAY_BUFFER,x,t)}if(T){for(r=0;y>r;r++)a=g[r],o=3*r,b[o]=a.r,b[o+1]=a.g,b[o+2]=a.b;Nt.bindBuffer(Nt.ARRAY_BUFFER,e.__webglColorBuffer),Nt.bufferData(Nt.ARRAY_BUFFER,b,t)}if(C){for(n=0;w>n;n++)E[n]=v[n];Nt.bindBuffer(Nt.ARRAY_BUFFER,e.__webglLineDistanceBuffer),Nt.bufferData(Nt.ARRAY_BUFFER,E,t)}if(M)for(l=0,d=M.length;d>l;l++)if(p=M[l],p.needsUpdate&&(void 0===p.boundTo||"vertices"===p.boundTo)){if(o=0,h=p.value.length,1===p.size)for(c=0;h>c;c++)p.array[c]=p.value[c];else if(2===p.size)for(c=0;h>c;c++)u=p.value[c],p.array[o]=u.x,p.array[o+1]=u.y,o+=2;else if(3===p.size)if("c"===p.type)for(c=0;h>c;c++)u=p.value[c],p.array[o]=u.r,p.array[o+1]=u.g,p.array[o+2]=u.b,o+=3;else for(c=0;h>c;c++)u=p.value[c],p.array[o]=u.x,p.array[o+1]=u.y,p.array[o+2]=u.z,o+=3;else if(4===p.size)for(c=0;h>c;c++)u=p.value[c],p.array[o]=u.x,p.array[o+1]=u.y,p.array[o+2]=u.z,p.array[o+3]=u.w,o+=4;Nt.bindBuffer(Nt.ARRAY_BUFFER,p.buffer),Nt.bufferData(Nt.ARRAY_BUFFER,p.array,t)}}function x(e,t){var i,r,n,s,o,a,l,d,c,h,u,p,f,g=e.vertices,v=e.colors,m=e.normals,y=g.length,w=v.length,x=m.length,b=e.__vertexArray,E=e.__colorArray,_=e.__normalArray,T=e.verticesNeedUpdate,C=e.colorsNeedUpdate,M=e.normalsNeedUpdate,S=e.__webglCustomAttributesList;if(T){for(i=0;y>i;i++)s=g[i],o=3*i,b[o]=s.x,b[o+1]=s.y,b[o+2]=s.z;Nt.bindBuffer(Nt.ARRAY_BUFFER,e.__webglVertexBuffer),Nt.bufferData(Nt.ARRAY_BUFFER,b,t)}if(C){for(r=0;w>r;r++)a=v[r],o=3*r,E[o]=a.r,E[o+1]=a.g,E[o+2]=a.b;Nt.bindBuffer(Nt.ARRAY_BUFFER,e.__webglColorBuffer),Nt.bufferData(Nt.ARRAY_BUFFER,E,t)}if(M){for(n=0;x>n;n++)l=m[n],o=3*n,_[o]=l.x,_[o+1]=l.y,_[o+2]=l.z;Nt.bindBuffer(Nt.ARRAY_BUFFER,e.__webglNormalBuffer),Nt.bufferData(Nt.ARRAY_BUFFER,_,t)}if(S)for(d=0,c=S.length;c>d;d++)if(p=S[d],p.needsUpdate&&(void 0===p.boundTo||"vertices"===p.boundTo)){if(o=0,u=p.value.length,1===p.size)for(h=0;u>h;h++)p.array[h]=p.value[h];else if(2===p.size)for(h=0;u>h;h++)f=p.value[h],p.array[o]=f.x,p.array[o+1]=f.y,o+=2;else if(3===p.size)if("c"===p.type)for(h=0;u>h;h++)f=p.value[h],p.array[o]=f.r,p.array[o+1]=f.g,p.array[o+2]=f.b,o+=3;else for(h=0;u>h;h++)f=p.value[h],p.array[o]=f.x,p.array[o+1]=f.y,p.array[o+2]=f.z,o+=3;else if(4===p.size)for(h=0;u>h;h++)f=p.value[h],p.array[o]=f.x,p.array[o+1]=f.y,p.array[o+2]=f.z,p.array[o+3]=f.w,o+=4;Nt.bindBuffer(Nt.ARRAY_BUFFER,p.buffer),Nt.bufferData(Nt.ARRAY_BUFFER,p.array,t)}}function b(e,t,i,n,s){if(e.__inittedArrays){var o,a,l,d,c,h,u,p,m,y,w,x,b,E,_,T,C,M,S,A,R,U,D,P,j,B,H,k,L,I,N,F,O,z,V,W,G,X,q,$,Y,K,J,Q,Z,et,tt,it,rt=f(s),nt=g(s),st=v(s),ot=rt===r.SmoothShading,at=0,lt=0,dt=0,ct=0,ht=0,ut=0,pt=0,ft=0,gt=0,vt=0,mt=0,yt=0,wt=0,xt=e.__vertexArray,bt=e.__uvArray,Et=e.__uv2Array,_t=e.__normalArray,Tt=e.__tangentArray,Ct=e.__colorArray,Mt=e.__skinIndexArray,St=e.__skinWeightArray,At=e.__morphTargetsArrays,Rt=e.__morphNormalsArrays,Ut=e.__webglCustomAttributesList,Dt=e.__faceArray,Pt=e.__lineArray,jt=t.geometry,Bt=jt.verticesNeedUpdate,Ht=jt.elementsNeedUpdate,kt=jt.uvsNeedUpdate,Lt=jt.normalsNeedUpdate,It=jt.tangentsNeedUpdate,Ft=jt.colorsNeedUpdate,Ot=jt.morphTargetsNeedUpdate,zt=jt.vertices,Vt=e.faces3,Wt=e.faces4,Gt=jt.faces,Xt=jt.faceVertexUvs[0],qt=jt.faceVertexUvs[1],$t=(jt.colors,jt.skinIndices),Yt=jt.skinWeights,Kt=jt.morphTargets,Jt=jt.morphNormals;if(Bt){for(o=0,a=Vt.length;a>o;o++)d=Gt[Vt[o]],x=zt[d.a],b=zt[d.b],E=zt[d.c],xt[lt]=x.x,xt[lt+1]=x.y,xt[lt+2]=x.z,xt[lt+3]=b.x,xt[lt+4]=b.y,xt[lt+5]=b.z,xt[lt+6]=E.x,xt[lt+7]=E.y,xt[lt+8]=E.z,lt+=9;for(o=0,a=Wt.length;a>o;o++)d=Gt[Wt[o]],x=zt[d.a],b=zt[d.b],E=zt[d.c],_=zt[d.d],xt[lt]=x.x,xt[lt+1]=x.y,xt[lt+2]=x.z,xt[lt+3]=b.x,xt[lt+4]=b.y,xt[lt+5]=b.z,xt[lt+6]=E.x,xt[lt+7]=E.y,xt[lt+8]=E.z,xt[lt+9]=_.x,xt[lt+10]=_.y,xt[lt+11]=_.z,lt+=12;Nt.bindBuffer(Nt.ARRAY_BUFFER,e.__webglVertexBuffer),Nt.bufferData(Nt.ARRAY_BUFFER,xt,i)}if(Ot)for(Y=0,K=Kt.length;K>Y;Y++){for(mt=0,o=0,a=Vt.length;a>o;o++)Z=Vt[o],d=Gt[Z],x=Kt[Y].vertices[d.a],b=Kt[Y].vertices[d.b],E=Kt[Y].vertices[d.c],J=At[Y],J[mt]=x.x,J[mt+1]=x.y,J[mt+2]=x.z,J[mt+3]=b.x,J[mt+4]=b.y,J[mt+5]=b.z,J[mt+6]=E.x,J[mt+7]=E.y,J[mt+8]=E.z,s.morphNormals&&(ot?(et=Jt[Y].vertexNormals[Z],A=et.a,R=et.b,U=et.c):(A=Jt[Y].faceNormals[Z],R=A,U=A),Q=Rt[Y],Q[mt]=A.x,Q[mt+1]=A.y,Q[mt+2]=A.z,Q[mt+3]=R.x,Q[mt+4]=R.y,Q[mt+5]=R.z,Q[mt+6]=U.x,Q[mt+7]=U.y,Q[mt+8]=U.z),mt+=9;for(o=0,a=Wt.length;a>o;o++)Z=Wt[o],d=Gt[Z],x=Kt[Y].vertices[d.a],b=Kt[Y].vertices[d.b],E=Kt[Y].vertices[d.c],_=Kt[Y].vertices[d.d],J=At[Y],J[mt]=x.x,J[mt+1]=x.y,J[mt+2]=x.z,J[mt+3]=b.x,J[mt+4]=b.y,J[mt+5]=b.z,J[mt+6]=E.x,J[mt+7]=E.y,J[mt+8]=E.z,J[mt+9]=_.x,J[mt+10]=_.y,J[mt+11]=_.z,s.morphNormals&&(ot?(et=Jt[Y].vertexNormals[Z],A=et.a,R=et.b,U=et.c,D=et.d):(A=Jt[Y].faceNormals[Z],R=A,U=A,D=A),Q=Rt[Y],Q[mt]=A.x,Q[mt+1]=A.y,Q[mt+2]=A.z,Q[mt+3]=R.x,Q[mt+4]=R.y,Q[mt+5]=R.z,Q[mt+6]=U.x,Q[mt+7]=U.y,Q[mt+8]=U.z,Q[mt+9]=D.x,Q[mt+10]=D.y,Q[mt+11]=D.z),mt+=12;Nt.bindBuffer(Nt.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[Y]),Nt.bufferData(Nt.ARRAY_BUFFER,At[Y],i),s.morphNormals&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[Y]),Nt.bufferData(Nt.ARRAY_BUFFER,Rt[Y],i))}if(Yt.length){for(o=0,a=Vt.length;a>o;o++)d=Gt[Vt[o]],k=Yt[d.a],L=Yt[d.b],I=Yt[d.c],St[vt]=k.x,St[vt+1]=k.y,St[vt+2]=k.z,St[vt+3]=k.w,St[vt+4]=L.x,St[vt+5]=L.y,St[vt+6]=L.z,St[vt+7]=L.w,St[vt+8]=I.x,St[vt+9]=I.y,St[vt+10]=I.z,St[vt+11]=I.w,F=$t[d.a],O=$t[d.b],z=$t[d.c],Mt[vt]=F.x,Mt[vt+1]=F.y,Mt[vt+2]=F.z,Mt[vt+3]=F.w,Mt[vt+4]=O.x,Mt[vt+5]=O.y,Mt[vt+6]=O.z,Mt[vt+7]=O.w,Mt[vt+8]=z.x,Mt[vt+9]=z.y,Mt[vt+10]=z.z,Mt[vt+11]=z.w,vt+=12;for(o=0,a=Wt.length;a>o;o++)d=Gt[Wt[o]],k=Yt[d.a],L=Yt[d.b],I=Yt[d.c],N=Yt[d.d],St[vt]=k.x,St[vt+1]=k.y,St[vt+2]=k.z,St[vt+3]=k.w,St[vt+4]=L.x,St[vt+5]=L.y,St[vt+6]=L.z,St[vt+7]=L.w,St[vt+8]=I.x,St[vt+9]=I.y,St[vt+10]=I.z,St[vt+11]=I.w,St[vt+12]=N.x,St[vt+13]=N.y,St[vt+14]=N.z,St[vt+15]=N.w,F=$t[d.a],O=$t[d.b],z=$t[d.c],V=$t[d.d],Mt[vt]=F.x,Mt[vt+1]=F.y,Mt[vt+2]=F.z,Mt[vt+3]=F.w,Mt[vt+4]=O.x,Mt[vt+5]=O.y,Mt[vt+6]=O.z,Mt[vt+7]=O.w,Mt[vt+8]=z.x,Mt[vt+9]=z.y,Mt[vt+10]=z.z,Mt[vt+11]=z.w,Mt[vt+12]=V.x,Mt[vt+13]=V.y,Mt[vt+14]=V.z,Mt[vt+15]=V.w,vt+=16;vt>0&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),Nt.bufferData(Nt.ARRAY_BUFFER,Mt,i),Nt.bindBuffer(Nt.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),Nt.bufferData(Nt.ARRAY_BUFFER,St,i))}if(Ft&&nt){for(o=0,a=Vt.length;a>o;o++)d=Gt[Vt[o]],u=d.vertexColors,p=d.color,3===u.length&&nt===r.VertexColors?(P=u[0],j=u[1],B=u[2]):(P=p,j=p,B=p),Ct[gt]=P.r,Ct[gt+1]=P.g,Ct[gt+2]=P.b,Ct[gt+3]=j.r,Ct[gt+4]=j.g,Ct[gt+5]=j.b,Ct[gt+6]=B.r,Ct[gt+7]=B.g,Ct[gt+8]=B.b,gt+=9;for(o=0,a=Wt.length;a>o;o++)d=Gt[Wt[o]],u=d.vertexColors,p=d.color,4===u.length&&nt===r.VertexColors?(P=u[0],j=u[1],B=u[2],H=u[3]):(P=p,j=p,B=p,H=p),Ct[gt]=P.r,Ct[gt+1]=P.g,Ct[gt+2]=P.b,Ct[gt+3]=j.r,Ct[gt+4]=j.g,Ct[gt+5]=j.b,Ct[gt+6]=B.r,Ct[gt+7]=B.g,Ct[gt+8]=B.b,Ct[gt+9]=H.r,Ct[gt+10]=H.g,Ct[gt+11]=H.b,gt+=12;gt>0&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,e.__webglColorBuffer),Nt.bufferData(Nt.ARRAY_BUFFER,Ct,i))}if(It&&jt.hasTangents){for(o=0,a=Vt.length;a>o;o++)d=Gt[Vt[o]],m=d.vertexTangents,T=m[0],C=m[1],M=m[2],Tt[pt]=T.x,Tt[pt+1]=T.y,Tt[pt+2]=T.z,Tt[pt+3]=T.w,Tt[pt+4]=C.x,Tt[pt+5]=C.y,Tt[pt+6]=C.z,Tt[pt+7]=C.w,Tt[pt+8]=M.x,Tt[pt+9]=M.y,Tt[pt+10]=M.z,Tt[pt+11]=M.w,pt+=12;for(o=0,a=Wt.length;a>o;o++)d=Gt[Wt[o]],m=d.vertexTangents,T=m[0],C=m[1],M=m[2],S=m[3],Tt[pt]=T.x,Tt[pt+1]=T.y,Tt[pt+2]=T.z,Tt[pt+3]=T.w,Tt[pt+4]=C.x,Tt[pt+5]=C.y,Tt[pt+6]=C.z,Tt[pt+7]=C.w,Tt[pt+8]=M.x,Tt[pt+9]=M.y,Tt[pt+10]=M.z,Tt[pt+11]=M.w,Tt[pt+12]=S.x,Tt[pt+13]=S.y,Tt[pt+14]=S.z,Tt[pt+15]=S.w,pt+=16;Nt.bindBuffer(Nt.ARRAY_BUFFER,e.__webglTangentBuffer),Nt.bufferData(Nt.ARRAY_BUFFER,Tt,i)}if(Lt&&rt){for(o=0,a=Vt.length;a>o;o++)if(d=Gt[Vt[o]],c=d.vertexNormals,h=d.normal,3===c.length&&ot)for(W=0;3>W;W++)X=c[W],_t[ut]=X.x,_t[ut+1]=X.y,_t[ut+2]=X.z,ut+=3;else for(W=0;3>W;W++)_t[ut]=h.x,_t[ut+1]=h.y,_t[ut+2]=h.z,ut+=3;for(o=0,a=Wt.length;a>o;o++)if(d=Gt[Wt[o]],c=d.vertexNormals,h=d.normal,4===c.length&&ot)for(W=0;4>W;W++)X=c[W],_t[ut]=X.x,_t[ut+1]=X.y,_t[ut+2]=X.z,ut+=3;else for(W=0;4>W;W++)_t[ut]=h.x,_t[ut+1]=h.y,_t[ut+2]=h.z,ut+=3;Nt.bindBuffer(Nt.ARRAY_BUFFER,e.__webglNormalBuffer),Nt.bufferData(Nt.ARRAY_BUFFER,_t,i)}if(kt&&Xt&&st){for(o=0,a=Vt.length;a>o;o++)if(l=Vt[o],y=Xt[l],void 0!==y)for(W=0;3>W;W++)q=y[W],bt[dt]=q.x,bt[dt+1]=q.y,dt+=2;for(o=0,a=Wt.length;a>o;o++)if(l=Wt[o],y=Xt[l],void 0!==y)for(W=0;4>W;W++)q=y[W],bt[dt]=q.x,bt[dt+1]=q.y,dt+=2;dt>0&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,e.__webglUVBuffer),Nt.bufferData(Nt.ARRAY_BUFFER,bt,i))}if(kt&&qt&&st){for(o=0,a=Vt.length;a>o;o++)if(l=Vt[o],w=qt[l],void 0!==w)for(W=0;3>W;W++)$=w[W],Et[ct]=$.x,Et[ct+1]=$.y,ct+=2;for(o=0,a=Wt.length;a>o;o++)if(l=Wt[o],w=qt[l],void 0!==w)for(W=0;4>W;W++)$=w[W],Et[ct]=$.x,Et[ct+1]=$.y,ct+=2;ct>0&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,e.__webglUV2Buffer),Nt.bufferData(Nt.ARRAY_BUFFER,Et,i))}if(Ht){for(o=0,a=Vt.length;a>o;o++)Dt[ht]=at,Dt[ht+1]=at+1,Dt[ht+2]=at+2,ht+=3,Pt[ft]=at,Pt[ft+1]=at+1,Pt[ft+2]=at,Pt[ft+3]=at+2,Pt[ft+4]=at+1,Pt[ft+5]=at+2,ft+=6,at+=3;for(o=0,a=Wt.length;a>o;o++)Dt[ht]=at,Dt[ht+1]=at+1,Dt[ht+2]=at+3,Dt[ht+3]=at+1,Dt[ht+4]=at+2,Dt[ht+5]=at+3,ht+=6,Pt[ft]=at,Pt[ft+1]=at+1,Pt[ft+2]=at,Pt[ft+3]=at+3,Pt[ft+4]=at+1,Pt[ft+5]=at+2,Pt[ft+6]=at+2,Pt[ft+7]=at+3,ft+=8,at+=4;Nt.bindBuffer(Nt.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),Nt.bufferData(Nt.ELEMENT_ARRAY_BUFFER,Dt,i),Nt.bindBuffer(Nt.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),Nt.bufferData(Nt.ELEMENT_ARRAY_BUFFER,Pt,i)}if(Ut)for(W=0,G=Ut.length;G>W;W++)if(it=Ut[W],it.__original.needsUpdate){if(yt=0,wt=0,1===it.size){if(void 0===it.boundTo||"vertices"===it.boundTo){for(o=0,a=Vt.length;a>o;o++)d=Gt[Vt[o]],it.array[yt]=it.value[d.a],it.array[yt+1]=it.value[d.b],it.array[yt+2]=it.value[d.c],yt+=3;for(o=0,a=Wt.length;a>o;o++)d=Gt[Wt[o]],it.array[yt]=it.value[d.a],it.array[yt+1]=it.value[d.b],it.array[yt+2]=it.value[d.c],it.array[yt+3]=it.value[d.d],yt+=4}else if("faces"===it.boundTo){for(o=0,a=Vt.length;a>o;o++)tt=it.value[Vt[o]],it.array[yt]=tt,it.array[yt+1]=tt,it.array[yt+2]=tt,yt+=3;for(o=0,a=Wt.length;a>o;o++)tt=it.value[Wt[o]],it.array[yt]=tt,it.array[yt+1]=tt,it.array[yt+2]=tt,it.array[yt+3]=tt,yt+=4}}else if(2===it.size){if(void 0===it.boundTo||"vertices"===it.boundTo){for(o=0,a=Vt.length;a>o;o++)d=Gt[Vt[o]],x=it.value[d.a],b=it.value[d.b],E=it.value[d.c],it.array[yt]=x.x,it.array[yt+1]=x.y,it.array[yt+2]=b.x,it.array[yt+3]=b.y,it.array[yt+4]=E.x,it.array[yt+5]=E.y,yt+=6;for(o=0,a=Wt.length;a>o;o++)d=Gt[Wt[o]],x=it.value[d.a],b=it.value[d.b],E=it.value[d.c],_=it.value[d.d],it.array[yt]=x.x,it.array[yt+1]=x.y,it.array[yt+2]=b.x,it.array[yt+3]=b.y,it.array[yt+4]=E.x,it.array[yt+5]=E.y,it.array[yt+6]=_.x,it.array[yt+7]=_.y,yt+=8}else if("faces"===it.boundTo){for(o=0,a=Vt.length;a>o;o++)tt=it.value[Vt[o]],x=tt,b=tt,E=tt,it.array[yt]=x.x,it.array[yt+1]=x.y,it.array[yt+2]=b.x,it.array[yt+3]=b.y,it.array[yt+4]=E.x,it.array[yt+5]=E.y,yt+=6;for(o=0,a=Wt.length;a>o;o++)tt=it.value[Wt[o]],x=tt,b=tt,E=tt,_=tt,it.array[yt]=x.x,it.array[yt+1]=x.y,it.array[yt+2]=b.x,it.array[yt+3]=b.y,it.array[yt+4]=E.x,it.array[yt+5]=E.y,it.array[yt+6]=_.x,it.array[yt+7]=_.y,yt+=8}}else if(3===it.size){var Qt;if(Qt="c"===it.type?["r","g","b"]:["x","y","z"],void 0===it.boundTo||"vertices"===it.boundTo){for(o=0,a=Vt.length;a>o;o++)d=Gt[Vt[o]],x=it.value[d.a],b=it.value[d.b],E=it.value[d.c],it.array[yt]=x[Qt[0]],it.array[yt+1]=x[Qt[1]],it.array[yt+2]=x[Qt[2]],it.array[yt+3]=b[Qt[0]],it.array[yt+4]=b[Qt[1]],it.array[yt+5]=b[Qt[2]],it.array[yt+6]=E[Qt[0]],it.array[yt+7]=E[Qt[1]],it.array[yt+8]=E[Qt[2]],yt+=9;for(o=0,a=Wt.length;a>o;o++)d=Gt[Wt[o]],x=it.value[d.a],b=it.value[d.b],E=it.value[d.c],_=it.value[d.d],it.array[yt]=x[Qt[0]],it.array[yt+1]=x[Qt[1]],it.array[yt+2]=x[Qt[2]],it.array[yt+3]=b[Qt[0]],it.array[yt+4]=b[Qt[1]],it.array[yt+5]=b[Qt[2]],it.array[yt+6]=E[Qt[0]],it.array[yt+7]=E[Qt[1]],it.array[yt+8]=E[Qt[2]],it.array[yt+9]=_[Qt[0]],it.array[yt+10]=_[Qt[1]],it.array[yt+11]=_[Qt[2]],yt+=12}else if("faces"===it.boundTo){for(o=0,a=Vt.length;a>o;o++)tt=it.value[Vt[o]],x=tt,b=tt,E=tt,it.array[yt]=x[Qt[0]],it.array[yt+1]=x[Qt[1]],it.array[yt+2]=x[Qt[2]],it.array[yt+3]=b[Qt[0]],it.array[yt+4]=b[Qt[1]],it.array[yt+5]=b[Qt[2]],it.array[yt+6]=E[Qt[0]],it.array[yt+7]=E[Qt[1]],it.array[yt+8]=E[Qt[2]],yt+=9;for(o=0,a=Wt.length;a>o;o++)tt=it.value[Wt[o]],x=tt,b=tt,E=tt,_=tt,it.array[yt]=x[Qt[0]],it.array[yt+1]=x[Qt[1]],it.array[yt+2]=x[Qt[2]],it.array[yt+3]=b[Qt[0]],it.array[yt+4]=b[Qt[1]],it.array[yt+5]=b[Qt[2]],it.array[yt+6]=E[Qt[0]],it.array[yt+7]=E[Qt[1]],it.array[yt+8]=E[Qt[2]],it.array[yt+9]=_[Qt[0]],it.array[yt+10]=_[Qt[1]],it.array[yt+11]=_[Qt[2]],yt+=12}else if("faceVertices"===it.boundTo){for(o=0,a=Vt.length;a>o;o++)tt=it.value[Vt[o]],x=tt[0],b=tt[1],E=tt[2],it.array[yt]=x[Qt[0]],it.array[yt+1]=x[Qt[1]],it.array[yt+2]=x[Qt[2]],it.array[yt+3]=b[Qt[0]],it.array[yt+4]=b[Qt[1]],it.array[yt+5]=b[Qt[2]],it.array[yt+6]=E[Qt[0]],it.array[yt+7]=E[Qt[1]],it.array[yt+8]=E[Qt[2]],yt+=9;for(o=0,a=Wt.length;a>o;o++)tt=it.value[Wt[o]],x=tt[0],b=tt[1],E=tt[2],_=tt[3],it.array[yt]=x[Qt[0]],it.array[yt+1]=x[Qt[1]],it.array[yt+2]=x[Qt[2]],it.array[yt+3]=b[Qt[0]],it.array[yt+4]=b[Qt[1]],it.array[yt+5]=b[Qt[2]],it.array[yt+6]=E[Qt[0]],it.array[yt+7]=E[Qt[1]],it.array[yt+8]=E[Qt[2]],it.array[yt+9]=_[Qt[0]],it.array[yt+10]=_[Qt[1]],it.array[yt+11]=_[Qt[2]],yt+=12}}else if(4===it.size)if(void 0===it.boundTo||"vertices"===it.boundTo){for(o=0,a=Vt.length;a>o;o++)d=Gt[Vt[o]],x=it.value[d.a],b=it.value[d.b],E=it.value[d.c],it.array[yt]=x.x,it.array[yt+1]=x.y,it.array[yt+2]=x.z,it.array[yt+3]=x.w,it.array[yt+4]=b.x,it.array[yt+5]=b.y,it.array[yt+6]=b.z,it.array[yt+7]=b.w,it.array[yt+8]=E.x,it.array[yt+9]=E.y,it.array[yt+10]=E.z,it.array[yt+11]=E.w,yt+=12;for(o=0,a=Wt.length;a>o;o++)d=Gt[Wt[o]],x=it.value[d.a],b=it.value[d.b],E=it.value[d.c],_=it.value[d.d],it.array[yt]=x.x,it.array[yt+1]=x.y,it.array[yt+2]=x.z,it.array[yt+3]=x.w,it.array[yt+4]=b.x,it.array[yt+5]=b.y,it.array[yt+6]=b.z,it.array[yt+7]=b.w,it.array[yt+8]=E.x,it.array[yt+9]=E.y,it.array[yt+10]=E.z,it.array[yt+11]=E.w,it.array[yt+12]=_.x,it.array[yt+13]=_.y,it.array[yt+14]=_.z,it.array[yt+15]=_.w,yt+=16}else if("faces"===it.boundTo){for(o=0,a=Vt.length;a>o;o++)tt=it.value[Vt[o]],x=tt,b=tt,E=tt,it.array[yt]=x.x,it.array[yt+1]=x.y,it.array[yt+2]=x.z,it.array[yt+3]=x.w,it.array[yt+4]=b.x,it.array[yt+5]=b.y,it.array[yt+6]=b.z,it.array[yt+7]=b.w,it.array[yt+8]=E.x,it.array[yt+9]=E.y,it.array[yt+10]=E.z,it.array[yt+11]=E.w,yt+=12;for(o=0,a=Wt.length;a>o;o++)tt=it.value[Wt[o]],x=tt,b=tt,E=tt,_=tt,it.array[yt]=x.x,it.array[yt+1]=x.y,it.array[yt+2]=x.z,it.array[yt+3]=x.w,it.array[yt+4]=b.x,it.array[yt+5]=b.y,it.array[yt+6]=b.z,it.array[yt+7]=b.w,it.array[yt+8]=E.x,it.array[yt+9]=E.y,it.array[yt+10]=E.z,it.array[yt+11]=E.w,it.array[yt+12]=_.x,it.array[yt+13]=_.y,it.array[yt+14]=_.z,it.array[yt+15]=_.w,yt+=16}else if("faceVertices"===it.boundTo){for(o=0,a=Vt.length;a>o;o++)tt=it.value[Vt[o]],x=tt[0],b=tt[1],E=tt[2],it.array[yt]=x.x,it.array[yt+1]=x.y,it.array[yt+2]=x.z,it.array[yt+3]=x.w,it.array[yt+4]=b.x,it.array[yt+5]=b.y,it.array[yt+6]=b.z,it.array[yt+7]=b.w,it.array[yt+8]=E.x,it.array[yt+9]=E.y,it.array[yt+10]=E.z,it.array[yt+11]=E.w,yt+=12;for(o=0,a=Wt.length;a>o;o++)tt=it.value[Wt[o]],x=tt[0],b=tt[1],E=tt[2],_=tt[3],it.array[yt]=x.x,it.array[yt+1]=x.y,it.array[yt+2]=x.z,it.array[yt+3]=x.w,it.array[yt+4]=b.x,it.array[yt+5]=b.y,it.array[yt+6]=b.z,it.array[yt+7]=b.w,it.array[yt+8]=E.x,it.array[yt+9]=E.y,it.array[yt+10]=E.z,it.array[yt+11]=E.w,it.array[yt+12]=_.x,it.array[yt+13]=_.y,it.array[yt+14]=_.z,it.array[yt+15]=_.w,yt+=16}Nt.bindBuffer(Nt.ARRAY_BUFFER,it.buffer),Nt.bufferData(Nt.ARRAY_BUFFER,it.array,i)}n&&(delete e.__inittedArrays,delete e.__colorArray,delete e.__normalArray,delete e.__tangentArray,delete e.__uvArray,delete e.__uv2Array,delete e.__faceArray,delete e.__vertexArray,delete e.__lineArray,delete e.__skinIndexArray,delete e.__skinWeightArray)}}function E(e,t,i){var r,n,s=e.attributes;for(r in s)n=s[r],n.needsUpdate&&("index"===r?(Nt.bindBuffer(Nt.ELEMENT_ARRAY_BUFFER,n.buffer),Nt.bufferData(Nt.ELEMENT_ARRAY_BUFFER,n.array,t)):(Nt.bindBuffer(Nt.ARRAY_BUFFER,n.buffer),Nt.bufferData(Nt.ARRAY_BUFFER,n.array,t)),n.needsUpdate=!1),i&&!n.dynamic&&(n.array=null)}function _(e){bi[e]||(Nt.enableVertexAttribArray(e),bi[e]=!0)}function T(){for(var e in bi)bi[e]&&(Nt.disableVertexAttribArray(e),bi[e]=!1)}function C(e,t,i){var r=e.program.attributes;if(-1!==i.morphTargetBase&&r.position>=0?(Nt.bindBuffer(Nt.ARRAY_BUFFER,t.__webglMorphTargetsBuffers[i.morphTargetBase]),_(r.position),Nt.vertexAttribPointer(r.position,3,Nt.FLOAT,!1,0,0)):r.position>=0&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,t.__webglVertexBuffer),_(r.position),Nt.vertexAttribPointer(r.position,3,Nt.FLOAT,!1,0,0)),i.morphTargetForcedOrder.length)for(var n=0,s=i.morphTargetForcedOrder,o=i.morphTargetInfluences;e.numSupportedMorphTargets>n&&s.length>n;)r["morphTarget"+n]>=0&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,t.__webglMorphTargetsBuffers[s[n]]),_(r["morphTarget"+n]),Nt.vertexAttribPointer(r["morphTarget"+n],3,Nt.FLOAT,!1,0,0)),r["morphNormal"+n]>=0&&e.morphNormals&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,t.__webglMorphNormalsBuffers[s[n]]),_(r["morphNormal"+n]),Nt.vertexAttribPointer(r["morphNormal"+n],3,Nt.FLOAT,!1,0,0)),i.__webglMorphTargetInfluences[n]=o[s[n]],n++;else{var a,l,d=[],o=i.morphTargetInfluences,c=o.length;for(l=0;c>l;l++)a=o[l],a>0&&d.push([a,l]);d.length>e.numSupportedMorphTargets?(d.sort(S),d.length=e.numSupportedMorphTargets):d.length>e.numSupportedMorphNormals?d.sort(S):0===d.length&&d.push([0,0]);for(var h,n=0;e.numSupportedMorphTargets>n;)d[n]?(h=d[n][1],r["morphTarget"+n]>=0&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,t.__webglMorphTargetsBuffers[h]),_(r["morphTarget"+n]),Nt.vertexAttribPointer(r["morphTarget"+n],3,Nt.FLOAT,!1,0,0)),r["morphNormal"+n]>=0&&e.morphNormals&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,t.__webglMorphNormalsBuffers[h]),_(r["morphNormal"+n]),Nt.vertexAttribPointer(r["morphNormal"+n],3,Nt.FLOAT,!1,0,0)),i.__webglMorphTargetInfluences[n]=o[h]):i.__webglMorphTargetInfluences[n]=0,n++}null!==e.program.uniforms.morphTargetInfluences&&Nt.uniform1fv(e.program.uniforms.morphTargetInfluences,i.__webglMorphTargetInfluences)}function M(e,t){return e.z!==t.z?t.z-e.z:e.id-t.id}function S(e,t){return t[0]-e[0]}function A(e,t,i){if(e.length)for(var r=0,n=e.length;n>r;r++)Kt=null,ei=null,si=-1,di=-1,ci=-1,ri=-1,ni=-1,Zt=-1,Qt=-1,Si=!0,e[r].render(t,i,wi,xi),Kt=null,ei=null,si=-1,di=-1,ci=-1,ri=-1,ni=-1,Zt=-1,Qt=-1,Si=!0}function R(e,t,i,n,s,o,a,l,d){var c,h,u,p,f,g,v;t?(f=e.length-1,g=-1,v=-1):(f=0,g=e.length,v=1);for(var m=f;m!==g;m+=v)if(c=e[m],c.render){h=c.object,u=c.buffer;var y,w,x,b=!1;if(l)p=h instanceof r.SkinnedMesh?l.skinned:l["static"];else{if(p=c[i],"opaque"==i&&h.opacity&&1>c.object.opacity)continue;if("transparent"==i&&h.opacity&&1>c.object.opacity&&(p||(p=c.opaque),p.uniforms.opacity&&(b=!0,y=p.transparent,w=p.depthWrite,x=p.uniforms.opacity.value,p.uniforms.opacity.value=h.opacity,p.transparent=!0,p.depthWrite=!1)),!p)continue;for(var E in d)p.uniforms[E]&&(p.uniforms[E].value=d[E].value);a&&qt.setBlending(p.blending,p.blendEquation,p.blendSrc,p.blendDst),qt.setDepthTest(p.depthTest),qt.setDepthWrite(p.depthWrite),lt(p.polygonOffset,p.polygonOffsetFactor,p.polygonOffsetUnits)}qt.setMaterialFaces(p),u instanceof r.BufferGeometry?qt.renderBufferDirect(n,s,o,p,u,h):qt.renderBuffer(n,s,o,p,u,h);for(var E in d)p.uniforms[E]&&(p.uniforms[E].value=d[E].defaultValue);b&&(p.uniforms.opacity.value=x,p.transparent=y,p.depthWrite=w)}}function U(e,t,i,r,n,s,o){for(var a,l,d,c=0,h=e.length;h>c;c++)if(a=e[c],l=a.object,l.visible){if(o)d=o;else{if(d=a[t],!d)continue;s&&qt.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),qt.setDepthTest(d.depthTest),qt.setDepthWrite(d.depthWrite),lt(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits)}qt.renderImmediateObject(i,r,n,d,l)}}function D(e){var t=e.object,i=t.material;i.transparent?(e.transparent=i,e.opaque=null):(e.opaque=i,e.transparent=null),e.picking||(e.picking=t.pickingMaterial),e.depth||(e.depth=t.customDepthMaterial)}function P(e){var t,i,n,s=e.object,o=e.buffer;n=s.material,n instanceof r.MeshFaceMaterial?(i=o.materialIndex,t=n.materials[i],t.transparent?(e.transparent=t,e.opaque=null):(e.opaque=t,e.transparent=null)):(t=n,t&&(t.transparent?(e.transparent=t,e.opaque=null):(e.opaque=t,e.transparent=null))),e.picking||(e.picking=s.pickingMaterial),e.depth||(e.depth=s.customDepthMaterial)}function j(e,t){var i,n,s,o,a,l,d={},c=e.morphTargets.length,h=e.morphNormals.length,u=t instanceof r.MeshFaceMaterial;for(e.geometryGroups={},i=0,n=e.faces.length;n>i;i++)s=e.faces[i],o=u?s.materialIndex:0,void 0===d[o]&&(d[o]={hash:o,counter:0}),l=d[o].hash+"_"+d[o].counter,void 0===e.geometryGroups[l]&&(e.geometryGroups[l]={faces3:[],faces4:[],materialIndex:o,vertices:0,numMorphTargets:c,numMorphNormals:h}),a=s instanceof r.Face3?3:4,e.geometryGroups[l].vertices+a>65535&&(d[o].counter+=1,l=d[o].hash+"_"+d[o].counter,void 0===e.geometryGroups[l]&&(e.geometryGroups[l]={faces3:[],faces4:[],materialIndex:o,vertices:0,numMorphTargets:c,numMorphNormals:h})),s instanceof r.Face3?e.geometryGroups[l].faces3.push(i):e.geometryGroups[l].faces4.push(i),e.geometryGroups[l].vertices+=a;e.geometryGroupsList=[];for(var p in e.geometryGroups)e.geometryGroups[p].id=ti++,e.geometryGroupsList.push(e.geometryGroups[p])}function B(e,o){var a,u,p,f;if(void 0===e.__webglInit)if(e.__webglInit=!0,e._modelViewMatrix=new r.Matrix4,e._normalMatrix=new r.Matrix3,void 0!==e.geometry&&void 0===e.geometry.__webglInit&&(e.geometry.__webglInit=!0,e.geometry.addEventListener("dispose",zi)),u=e.geometry,void 0===u);else if(u instanceof r.BufferGeometry)m(u);else if(e instanceof r.Mesh){p=e.material,void 0===u.geometryGroups&&j(u,p);for(a in u.geometryGroups)f=u.geometryGroups[a],f.__webglVertexBuffer||(s(f),h(f,e),u.verticesNeedUpdate=!0,u.morphTargetsNeedUpdate=!0,u.elementsNeedUpdate=!0,u.uvsNeedUpdate=!0,u.normalsNeedUpdate=!0,u.tangentsNeedUpdate=!0,u.colorsNeedUpdate=!0)}else e instanceof r.Ribbon?u.__webglVertexBuffer||(n(u),c(u,e),u.verticesNeedUpdate=!0,u.colorsNeedUpdate=!0,u.normalsNeedUpdate=!0):e instanceof r.Line?u.__webglVertexBuffer||(i(u),d(u,e),u.verticesNeedUpdate=!0,u.colorsNeedUpdate=!0,u.lineDistancesNeedUpdate=!0):e instanceof r.ParticleSystem&&(u.__webglVertexBuffer||(t(u),l(u,e),u.verticesNeedUpdate=!0,u.colorsNeedUpdate=!0));if(void 0===e.__webglActive){if(e instanceof r.Mesh){if(u=e.geometry,u instanceof r.BufferGeometry)H(o.__webglObjects,u,e);else if(u instanceof r.Geometry)for(a in u.geometryGroups)f=u.geometryGroups[a],H(o.__webglObjects,f,e)}else e instanceof r.Ribbon||e instanceof r.Line||e instanceof r.ParticleSystem?(u=e.geometry,H(o.__webglObjects,u,e)):e instanceof r.ImmediateRenderObject||e.immediateRenderCallback?k(o.__webglObjectsImmediate,e):e instanceof r.Sprite?o.__webglSprites.push(e):e instanceof r.LensFlare&&o.__webglFlares.push(e);e.__webglActive=!0}}function H(e,t,i){e.push({id:null,buffer:t,object:i,opaque:null,transparent:null,z:0})}function k(e,t){e.push({id:null,object:t,opaque:null,transparent:null,z:0})}function L(e){var t,i,n,s=e.geometry;if(s instanceof r.BufferGeometry)E(s,Nt.DYNAMIC_DRAW,!s.dynamic);else if(e instanceof r.Mesh){for(var o=0,a=s.geometryGroupsList.length;a>o;o++)t=s.geometryGroupsList[o],n=u(e,t),s.buffersNeedUpdate&&h(t,e),i=n.attributes&&I(n),(s.verticesNeedUpdate||s.morphTargetsNeedUpdate||s.elementsNeedUpdate||s.uvsNeedUpdate||s.normalsNeedUpdate||s.colorsNeedUpdate||s.tangentsNeedUpdate||i)&&b(t,e,Nt.DYNAMIC_DRAW,!s.dynamic,n);s.verticesNeedUpdate=!1,s.morphTargetsNeedUpdate=!1,s.elementsNeedUpdate=!1,s.uvsNeedUpdate=!1,s.normalsNeedUpdate=!1,s.colorsNeedUpdate=!1,s.tangentsNeedUpdate=!1,s.buffersNeedUpdate=!1,n.attributes&&N(n)}else e instanceof r.Ribbon?(n=u(e,s),i=n.attributes&&I(n),(s.verticesNeedUpdate||s.colorsNeedUpdate||s.normalsNeedUpdate||i)&&x(s,Nt.DYNAMIC_DRAW),s.verticesNeedUpdate=!1,s.colorsNeedUpdate=!1,s.normalsNeedUpdate=!1,n.attributes&&N(n)):e instanceof r.Line?(n=u(e,s),i=n.attributes&&I(n),(s.verticesNeedUpdate||s.colorsNeedUpdate||s.lineDistancesNeedUpdate||i)&&w(s,Nt.DYNAMIC_DRAW),s.verticesNeedUpdate=!1,s.colorsNeedUpdate=!1,s.lineDistancesNeedUpdate=!1,n.attributes&&N(n)):e instanceof r.ParticleSystem&&(n=u(e,s),i=n.attributes&&I(n),(s.verticesNeedUpdate||s.colorsNeedUpdate||e.sortParticles||i)&&y(s,Nt.DYNAMIC_DRAW,e),s.verticesNeedUpdate=!1,s.colorsNeedUpdate=!1,n.attributes&&N(n))}function I(e){for(var t in e.attributes)if(e.attributes[t].needsUpdate)return!0;return!1}function N(e){for(var t in e.attributes)e.attributes[t].needsUpdate=!1}function F(e,t){e instanceof r.Mesh||e instanceof r.ParticleSystem||e instanceof r.Ribbon||e instanceof r.Line?O(t.__webglObjects,e):e instanceof r.Sprite?z(t.__webglSprites,e):e instanceof r.LensFlare?z(t.__webglFlares,e):(e instanceof r.ImmediateRenderObject||e.immediateRenderCallback)&&O(t.__webglObjectsImmediate,e),delete e.__webglActive}function O(e,t){for(var i=e.length-1;i>=0;i--)e[i].object===t&&e.splice(i,1)}function z(e,t){for(var i=e.length-1;i>=0;i--)e[i]===t&&e.splice(i,1)}function V(e,t){e.uniforms=r.UniformsUtils.clone(t.uniforms),e.vertexShader=t.vertexShader,e.fragmentShader=t.fragmentShader}function W(e,t,i,n,s){ii=0,n.needsUpdate&&(n.program&&Yi(n),qt.initMaterial(n,t,i,s),n.needsUpdate=!1),n.morphTargets&&(s.__webglMorphTargetInfluences||(s.__webglMorphTargetInfluences=new Float32Array(qt.maxMorphTargets)));var o=!1,a=n.program,l=a.uniforms,d=n.uniforms;if(a!==Kt&&(Nt.useProgram(a),Kt=a,o=!0),n.id!==Qt&&(Qt=n.id,o=!0),(o||e!==ei)&&(Nt.uniformMatrix4fv(l.projectionMatrix,!1,e.projectionMatrix.elements),e!==ei&&(ei=e)),n.skinning)if(Hi&&s.useVertexTexture){if(null!==l.boneTexture){var c=tt();Nt.uniform1i(l.boneTexture,c),qt.setTexture(s.boneTexture,c)}}else null!==l.boneGlobalMatrices&&Nt.uniformMatrix4fv(l.boneGlobalMatrices,!1,s.boneMatrices);return o&&(i&&n.fog&&Y(d,i),(n instanceof r.MeshPhongMaterial||n instanceof r.MeshLambertMaterial||n.lights)&&(Si&&(ot(a,t),Si=!1),Q(d,Ai)),(n instanceof r.MeshBasicMaterial||n instanceof r.MeshLambertMaterial||n instanceof r.MeshPhongMaterial)&&G(d,n),n instanceof r.LineBasicMaterial?X(d,n):n instanceof r.LineDashedMaterial?(X(d,n),q(d,n)):n instanceof r.ParticleBasicMaterial?$(d,n):n instanceof r.MeshPhongMaterial?K(d,n):n instanceof r.MeshLambertMaterial?J(d,n):n instanceof r.MeshDepthMaterial?(d.mNear.value=e.near,d.mFar.value=e.far,d.opacity.value=n.opacity):n instanceof r.MeshNormalMaterial&&(d.opacity.value=n.opacity),s.receiveShadow&&!n._shadowPass&&Z(d,t),it(a,n.uniformsList),(n instanceof r.ShaderMaterial||n instanceof r.MeshPhongMaterial||n.envMap)&&null!==l.cameraPosition&&(Ci.getPositionFromMatrix(e.matrixWorld),Nt.uniform3f(l.cameraPosition,Ci.x,Ci.y,Ci.z)),(n instanceof r.MeshPhongMaterial||n instanceof r.MeshLambertMaterial||n instanceof r.ShaderMaterial||n.skinning)&&null!==l.viewMatrix&&Nt.uniformMatrix4fv(l.viewMatrix,!1,e.matrixWorldInverse.elements)),et(l,s),null!==l.modelMatrix&&Nt.uniformMatrix4fv(l.modelMatrix,!1,s.matrixWorld.elements),a}function G(e,t){e.opacity.value=t.opacity,qt.gammaInput?e.diffuse.value.copyGammaToLinear(t.color):e.diffuse.value=t.color,e.map.value=t.map,e.lightMap.value=t.lightMap,e.specularMap.value=t.specularMap,t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale));var i;if(t.map?i=t.map:t.specularMap?i=t.specularMap:t.normalMap?i=t.normalMap:t.bumpMap&&(i=t.bumpMap),void 0!==i){var n=i.offset,s=i.repeat;e.offsetRepeat.value.set(n.x,n.y,s.x,s.y)}e.envMap.value=t.envMap,e.flipEnvMap.value=t.envMap instanceof r.WebGLRenderTargetCube?1:-1,e.reflectivity.value=qt.gammaInput?t.reflectivity:t.reflectivity,e.refractionRatio.value=t.refractionRatio,e.combine.value=t.combine,e.useRefract.value=t.envMap&&t.envMap.mapping instanceof r.CubeRefractionMapping}function X(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity}function q(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function $(e,t){e.psColor.value=t.color,e.opacity.value=t.opacity,e.size.value=t.size,e.scale.value=Ut.height/2,e.map.value=t.map}function Y(e,t){e.fogColor.value=t.color,t instanceof r.Fog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t instanceof r.FogExp2&&(e.fogDensity.value=t.density)}function K(e,t){e.shininess.value=t.shininess,qt.gammaInput?(e.ambient.value.copyGammaToLinear(t.ambient),e.emissive.value.copyGammaToLinear(t.emissive),e.specular.value.copyGammaToLinear(t.specular)):(e.ambient.value=t.ambient,e.emissive.value=t.emissive,e.specular.value=t.specular),t.wrapAround&&e.wrapRGB.value.copy(t.wrapRGB)}function J(e,t){qt.gammaInput?(e.ambient.value.copyGammaToLinear(t.ambient),e.emissive.value.copyGammaToLinear(t.emissive)):(e.ambient.value=t.ambient,e.emissive.value=t.emissive),t.wrapAround&&e.wrapRGB.value.copy(t.wrapRGB)}function Q(e,t){e.ambientLightColor.value=t.ambient,e.directionalLightColor.value=t.directional.colors,e.directionalLightDirection.value=t.directional.positions,e.pointLightColor.value=t.point.colors,e.pointLightPosition.value=t.point.positions,e.pointLightDistance.value=t.point.distances,e.spotLightColor.value=t.spot.colors,e.spotLightPosition.value=t.spot.positions,e.spotLightDistance.value=t.spot.distances,e.spotLightDirection.value=t.spot.directions,e.spotLightAngleCos.value=t.spot.anglesCos,e.spotLightExponent.value=t.spot.exponents,e.hemisphereLightSkyColor.value=t.hemi.skyColors,e.hemisphereLightGroundColor.value=t.hemi.groundColors,e.hemisphereLightDirection.value=t.hemi.positions}function Z(e,t){if(e.shadowMatrix)for(var i=0,n=0,s=t.length;s>n;n++){var o=t[n];o.castShadow&&(o instanceof r.SpotLight||o instanceof r.DirectionalLight&&!o.shadowCascade)&&(e.shadowMap.value[i]=o.shadowMap,e.shadowMapSize.value[i]=o.shadowMapSize,e.shadowMatrix.value[i]=o.shadowMatrix,e.shadowDarkness.value[i]=o.shadowDarkness,e.shadowBias.value[i]=o.shadowBias,i++)}}function et(e,t){Nt.uniformMatrix4fv(e.modelViewMatrix,!1,t._modelViewMatrix.elements),e.normalMatrix&&Nt.uniformMatrix3fv(e.normalMatrix,!1,t._normalMatrix.elements)}function tt(){var e=ii;return e>=Ri&&console.warn("WebGLRenderer: trying to use "+e+" texture units while this GPU supports only "+Ri),ii+=1,e}function it(e,t){var i,n,s,o,a,l,d,c,h,u,p;for(h=0,u=t.length;u>h;h++)if(o=e.uniforms[t[h][1]])if(i=t[h][0],s=i.type,n=i.value,"i"===s)Nt.uniform1i(o,n);
else if("f"===s)Nt.uniform1f(o,n);else if("v2"===s)Nt.uniform2f(o,n.x,n.y);else if("v3"===s)Nt.uniform3f(o,n.x,n.y,n.z);else if("v4"===s)Nt.uniform4f(o,n.x,n.y,n.z,n.w);else if("c"===s)Nt.uniform3f(o,n.r,n.g,n.b);else if("iv1"===s)Nt.uniform1iv(o,n);else if("iv"===s)Nt.uniform3iv(o,n);else if("fv1"===s)Nt.uniform1fv(o,n);else if("fv"===s)Nt.uniform3fv(o,n);else if("v2v"===s){for(void 0===i._array&&(i._array=new Float32Array(2*n.length)),d=0,c=n.length;c>d;d++)p=2*d,i._array[p]=n[d].x,i._array[p+1]=n[d].y;Nt.uniform2fv(o,i._array)}else if("v3v"===s){for(void 0===i._array&&(i._array=new Float32Array(3*n.length)),d=0,c=n.length;c>d;d++)p=3*d,i._array[p]=n[d].x,i._array[p+1]=n[d].y,i._array[p+2]=n[d].z;Nt.uniform3fv(o,i._array)}else if("v4v"===s){for(void 0===i._array&&(i._array=new Float32Array(4*n.length)),d=0,c=n.length;c>d;d++)p=4*d,i._array[p]=n[d].x,i._array[p+1]=n[d].y,i._array[p+2]=n[d].z,i._array[p+3]=n[d].w;Nt.uniform4fv(o,i._array)}else if("m4"===s)void 0===i._array&&(i._array=new Float32Array(16)),n.flattenToArray(i._array),Nt.uniformMatrix4fv(o,!1,i._array);else if("m4v"===s){for(void 0===i._array&&(i._array=new Float32Array(16*n.length)),d=0,c=n.length;c>d;d++)n[d].flattenToArrayOffset(i._array,16*d);Nt.uniformMatrix4fv(o,!1,i._array)}else if("t"===s){if(a=n,l=tt(),Nt.uniform1i(o,l),!a)continue;a.image instanceof Array&&6===a.image.length?yt(a,l):a instanceof r.WebGLRenderTargetCube?wt(a,l):qt.setTexture(a,l)}else if("tv"===s){for(void 0===i._array&&(i._array=[]),d=0,c=i.value.length;c>d;d++)i._array[d]=tt();for(Nt.uniform1iv(o,i._array),d=0,c=i.value.length;c>d;d++)a=i.value[d],l=i._array[d],a&&qt.setTexture(a,l)}}function rt(e,t){e._modelViewMatrix.multiplyMatrices(t.matrixWorldInverse,e.matrixWorld),e._normalMatrix.getNormalMatrix(e._modelViewMatrix)}function nt(e,t,i,r){e[t]=i.r*i.r*r,e[t+1]=i.g*i.g*r,e[t+2]=i.b*i.b*r}function st(e,t,i,r){e[t]=i.r*r,e[t+1]=i.g*r,e[t+2]=i.b*r}function ot(e,t){var i,n,s,o,a,l,d,c,h,u=0,p=0,f=0,g=Ai,v=g.directional.colors,m=g.directional.positions,y=g.point.colors,w=g.point.positions,x=g.point.distances,b=g.spot.colors,E=g.spot.positions,_=g.spot.distances,T=g.spot.directions,C=g.spot.anglesCos,M=g.spot.exponents,S=g.hemi.skyColors,A=g.hemi.groundColors,R=g.hemi.positions,U=0,D=0,P=0,j=0,B=0,H=0,k=0,L=0,I=0,N=0,F=0,O=0;for(i=0,n=t.length;n>i;i++)if(s=t[i],!s.onlyShadow)if(o=s.color,d=s.intensity,h=s.distance,s instanceof r.AmbientLight){if(!s.visible)continue;qt.gammaInput?(u+=o.r*o.r,p+=o.g*o.g,f+=o.b*o.b):(u+=o.r,p+=o.g,f+=o.b)}else if(s instanceof r.DirectionalLight){if(B+=1,!s.visible)continue;if(Mi.getPositionFromMatrix(s.matrixWorld),Ci.getPositionFromMatrix(s.target.matrixWorld),Mi.sub(Ci),Mi.normalize(),0===Mi.x&&0===Mi.y&&0===Mi.z)continue;I=3*U,m[I]=Mi.x,m[I+1]=Mi.y,m[I+2]=Mi.z,qt.gammaInput?nt(v,I,o,d*d):st(v,I,o,d),U+=1}else if(s instanceof r.PointLight){if(H+=1,!s.visible)continue;N=3*D,qt.gammaInput?nt(y,N,o,d*d):st(y,N,o,d),Ci.getPositionFromMatrix(s.matrixWorld),w[N]=Ci.x,w[N+1]=Ci.y,w[N+2]=Ci.z,x[D]=h,D+=1}else if(s instanceof r.SpotLight){if(k+=1,!s.visible)continue;F=3*P,qt.gammaInput?nt(b,F,o,d*d):st(b,F,o,d),Ci.getPositionFromMatrix(s.matrixWorld),E[F]=Ci.x,E[F+1]=Ci.y,E[F+2]=Ci.z,_[P]=h,Mi.copy(Ci),Ci.getPositionFromMatrix(s.target.matrixWorld),Mi.sub(Ci),Mi.normalize(),T[F]=Mi.x,T[F+1]=Mi.y,T[F+2]=Mi.z,C[P]=Math.cos(s.angle),M[P]=s.exponent,P+=1}else if(s instanceof r.HemisphereLight){if(L+=1,!s.visible)continue;if(Mi.getPositionFromMatrix(s.matrixWorld),Mi.normalize(),0===Mi.x&&0===Mi.y&&0===Mi.z)continue;O=3*j,R[O]=Mi.x,R[O+1]=Mi.y,R[O+2]=Mi.z,a=s.color,l=s.groundColor,qt.gammaInput?(c=d*d,nt(S,O,a,c),nt(A,O,l,c)):(st(S,O,a,d),st(A,O,l,d)),j+=1}for(i=3*U,n=Math.max(v.length,3*B);n>i;i++)v[i]=0;for(i=3*D,n=Math.max(y.length,3*H);n>i;i++)y[i]=0;for(i=3*P,n=Math.max(b.length,3*k);n>i;i++)b[i]=0;for(i=3*j,n=Math.max(S.length,3*L);n>i;i++)S[i]=0;for(i=3*j,n=Math.max(A.length,3*L);n>i;i++)A[i]=0;g.directional.length=U,g.point.length=D,g.spot.length=P,g.hemi.length=j,g.ambient[0]=u,g.ambient[1]=p,g.ambient[2]=f}function at(e){e!==fi&&(Nt.lineWidth(e),fi=e)}function lt(e,t,i){hi!==e&&(e?Nt.enable(Nt.POLYGON_OFFSET_FILL):Nt.disable(Nt.POLYGON_OFFSET_FILL),hi=e),!e||ui===t&&pi===i||(Nt.polygonOffset(t,i),ui=t,pi=i)}function dt(e){var t,i,r=[];for(var n in e)t=e[n],t!==!1&&(i="#define "+n+" "+t,r.push(i));return r.join("\n")}function ct(e,t,i,n,s,o,a){var l,d,c,h,u,p=[];e?p.push(e):(p.push(t),p.push(i));for(c in o)p.push(c),p.push(o[c]);for(l in a)p.push(l),p.push(a[l]);for(u=p.join(),l=0,d=$t.length;d>l;l++){var f=$t[l];if(f.code===u)return f.usedTimes++,f.program}var g="SHADOWMAP_TYPE_BASIC";a.shadowMapType===r.PCFShadowMap?g="SHADOWMAP_TYPE_PCF":a.shadowMapType===r.PCFSoftShadowMap&&(g="SHADOWMAP_TYPE_PCF_SOFT");var v=dt(o);h=Nt.createProgram();var m=["precision "+Dt+" float;",v,Bi?"#define VERTEX_TEXTURES":"",qt.gammaInput?"#define GAMMA_INPUT":"",qt.gammaOutput?"#define GAMMA_OUTPUT":"",qt.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"","#define MAX_DIR_LIGHTS "+a.maxDirLights,"#define MAX_POINT_LIGHTS "+a.maxPointLights,"#define MAX_SPOT_LIGHTS "+a.maxSpotLights,"#define MAX_HEMI_LIGHTS "+a.maxHemiLights,"#define MAX_SHADOWS "+a.maxShadows,"#define MAX_BONES "+a.maxBones,a.map?"#define USE_MAP":"",a.envMap?"#define USE_ENVMAP":"",a.lightMap?"#define USE_LIGHTMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.vertexColors?"#define USE_COLOR":"",a.skinning?"#define USE_SKINNING":"",a.useVertexTexture?"#define BONE_TEXTURE":"",a.boneTextureWidth?"#define N_BONE_PIXEL_X "+a.boneTextureWidth.toFixed(1):"",a.boneTextureHeight?"#define N_BONE_PIXEL_Y "+a.boneTextureHeight.toFixed(1):"",a.morphTargets?"#define USE_MORPHTARGETS":"",a.morphNormals?"#define USE_MORPHNORMALS":"",a.perPixel?"#define PHONG_PER_PIXEL":"",a.wrapAround?"#define WRAP_AROUND":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+g:"",a.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",a.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",a.sizeAttenuation?"#define USE_SIZEATTENUATION":"","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","attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","attribute vec3 morphTarget0;","attribute vec3 morphTarget1;","attribute vec3 morphTarget2;","attribute vec3 morphTarget3;","#ifdef USE_MORPHNORMALS","attribute vec3 morphNormal0;","attribute vec3 morphNormal1;","attribute vec3 morphNormal2;","attribute vec3 morphNormal3;","#else","attribute vec3 morphTarget4;","attribute vec3 morphTarget5;","attribute vec3 morphTarget6;","attribute vec3 morphTarget7;","#endif","#endif","#ifdef USE_SKINNING","attribute vec4 skinIndex;","attribute vec4 skinWeight;","#endif",""].join("\n"),y=["precision "+Dt+" float;",a.bumpMap||a.normalMap?"#extension GL_OES_standard_derivatives : enable":"",v,"#define MAX_DIR_LIGHTS "+a.maxDirLights,"#define MAX_POINT_LIGHTS "+a.maxPointLights,"#define MAX_SPOT_LIGHTS "+a.maxSpotLights,"#define MAX_HEMI_LIGHTS "+a.maxHemiLights,"#define MAX_SHADOWS "+a.maxShadows,a.alphaTest?"#define ALPHATEST "+a.alphaTest:"",qt.gammaInput?"#define GAMMA_INPUT":"",qt.gammaOutput?"#define GAMMA_OUTPUT":"",qt.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"",a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.envMap?"#define USE_ENVMAP":"",a.lightMap?"#define USE_LIGHTMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.vertexColors?"#define USE_COLOR":"",a.metal?"#define METAL":"",a.perPixel?"#define PHONG_PER_PIXEL":"",a.wrapAround?"#define WRAP_AROUND":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+g:"",a.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",a.shadowMapCascade?"#define SHADOWMAP_CASCADE":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",""].join("\n"),w=ft("vertex",m+i),x=ft("fragment",y+t);Nt.attachShader(h,w),Nt.attachShader(h,x),Nt.bindAttribLocation(h,0,"position"),Nt.linkProgram(h),Nt.getProgramParameter(h,Nt.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+Nt.getProgramParameter(h,Nt.VALIDATE_STATUS)+", gl error ["+Nt.getError()+"]"),Nt.deleteShader(x),Nt.deleteShader(w),h.uniforms={},h.attributes={};var b,E,_,T;b=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","modelMatrix","cameraPosition","morphTargetInfluences"],a.useVertexTexture?b.push("boneTexture"):b.push("boneGlobalMatrices");for(E in n)b.push(E);for(ht(h,b),b=["position","normal","uv","uv2","tangent","color","skinIndex","skinWeight","lineDistance"],T=0;a.maxMorphTargets>T;T++)b.push("morphTarget"+T);for(T=0;a.maxMorphNormals>T;T++)b.push("morphNormal"+T);for(_ in s)b.push(_);return ut(h,b),h.id=Yt++,$t.push({program:h,code:u,usedTimes:1}),qt.info.memory.programs=$t.length,h}function ht(e,t){var i,r,n;for(i=0,r=t.length;r>i;i++)n=t[i],e.uniforms[n]=Nt.getUniformLocation(e,n)}function ut(e,t){var i,r,n;for(i=0,r=t.length;r>i;i++)n=t[i],e.attributes[n]=Nt.getAttribLocation(e,n)}function pt(e){for(var t=e.split("\n"),i=0,r=t.length;r>i;i++)t[i]=i+1+": "+t[i];return t.join("\n")}function ft(e,t){var i;return"fragment"===e?i=Nt.createShader(Nt.FRAGMENT_SHADER):"vertex"===e&&(i=Nt.createShader(Nt.VERTEX_SHADER)),Nt.shaderSource(i,t),Nt.compileShader(i),Nt.getShaderParameter(i,Nt.COMPILE_STATUS)?i:(console.error(Nt.getShaderInfoLog(i)),console.error(pt(t)),null)}function gt(e){return 0===(e&e-1)}function vt(e,t,i){i?(Nt.texParameteri(e,Nt.TEXTURE_WRAP_S,Tt(t.wrapS)),Nt.texParameteri(e,Nt.TEXTURE_WRAP_T,Tt(t.wrapT)),Nt.texParameteri(e,Nt.TEXTURE_MAG_FILTER,Tt(t.magFilter)),Nt.texParameteri(e,Nt.TEXTURE_MIN_FILTER,Tt(t.minFilter))):(Nt.texParameteri(e,Nt.TEXTURE_WRAP_S,Nt.CLAMP_TO_EDGE),Nt.texParameteri(e,Nt.TEXTURE_WRAP_T,Nt.CLAMP_TO_EDGE),Nt.texParameteri(e,Nt.TEXTURE_MAG_FILTER,_t(t.magFilter)),Nt.texParameteri(e,Nt.TEXTURE_MIN_FILTER,_t(t.minFilter))),Vt&&t.type!==r.FloatType&&(t.anisotropy>1||t.__oldAnisotropy)&&(Nt.texParameterf(e,Vt.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,ji)),t.__oldAnisotropy=t.anisotropy)}function mt(e,t){if(t>=e.width&&t>=e.height)return e;var i=Math.max(e.width,e.height),r=Math.floor(e.width*t/i),n=Math.floor(e.height*t/i),s=document.createElement("canvas");s.width=r,s.height=n;var o=s.getContext("2d");return o.drawImage(e,0,0,e.width,e.height,0,0,r,n),s}function yt(e,t){if(6===e.image.length)if(e.needsUpdate){e.image.__webglTextureCube||(e.addEventListener("dispose",Vi),e.image.__webglTextureCube=Nt.createTexture(),qt.info.memory.textures++),Nt.activeTexture(Nt.TEXTURE0+t),Nt.bindTexture(Nt.TEXTURE_CUBE_MAP,e.image.__webglTextureCube),Nt.pixelStorei(Nt.UNPACK_FLIP_Y_WEBGL,e.flipY);for(var i=e instanceof r.CompressedTexture,n=[],s=0;6>s;s++)n[s]=qt.autoScaleCubemaps&&!i?mt(e.image[s],Pi):e.image[s];var o=n[0],a=gt(o.width)&&gt(o.height),l=Tt(e.format),d=Tt(e.type);vt(Nt.TEXTURE_CUBE_MAP,e,a);for(var s=0;6>s;s++)if(i)for(var c,h=n[s].mipmaps,u=0,p=h.length;p>u;u++)c=h[u],Nt.compressedTexImage2D(Nt.TEXTURE_CUBE_MAP_POSITIVE_X+s,u,l,c.width,c.height,0,c.data);else Nt.texImage2D(Nt.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,l,l,d,n[s]);e.generateMipmaps&&a&&Nt.generateMipmap(Nt.TEXTURE_CUBE_MAP),e.needsUpdate=!1,e.onUpdate&&e.onUpdate()}else Nt.activeTexture(Nt.TEXTURE0+t),Nt.bindTexture(Nt.TEXTURE_CUBE_MAP,e.image.__webglTextureCube)}function wt(e,t){Nt.activeTexture(Nt.TEXTURE0+t),Nt.bindTexture(Nt.TEXTURE_CUBE_MAP,e.__webglTexture)}function xt(e,t,i){Nt.bindFramebuffer(Nt.FRAMEBUFFER,e),Nt.framebufferTexture2D(Nt.FRAMEBUFFER,Nt.COLOR_ATTACHMENT0,i,t.__webglTexture,0)}function bt(e,t){Nt.bindRenderbuffer(Nt.RENDERBUFFER,e),t.depthBuffer&&!t.stencilBuffer?(Nt.renderbufferStorage(Nt.RENDERBUFFER,Nt.DEPTH_COMPONENT16,t.width,t.height),Nt.framebufferRenderbuffer(Nt.FRAMEBUFFER,Nt.DEPTH_ATTACHMENT,Nt.RENDERBUFFER,e)):t.depthBuffer&&t.stencilBuffer?(Nt.renderbufferStorage(Nt.RENDERBUFFER,Nt.DEPTH_STENCIL,t.width,t.height),Nt.framebufferRenderbuffer(Nt.FRAMEBUFFER,Nt.DEPTH_STENCIL_ATTACHMENT,Nt.RENDERBUFFER,e)):Nt.renderbufferStorage(Nt.RENDERBUFFER,Nt.RGBA4,t.width,t.height)}function Et(e){e instanceof r.WebGLRenderTargetCube?(Nt.bindTexture(Nt.TEXTURE_CUBE_MAP,e.__webglTexture),Nt.generateMipmap(Nt.TEXTURE_CUBE_MAP),Nt.bindTexture(Nt.TEXTURE_CUBE_MAP,null)):(Nt.bindTexture(Nt.TEXTURE_2D,e.__webglTexture),Nt.generateMipmap(Nt.TEXTURE_2D),Nt.bindTexture(Nt.TEXTURE_2D,null))}function _t(e){return e===r.NearestFilter||e===r.NearestMipMapNearestFilter||e===r.NearestMipMapLinearFilter?Nt.NEAREST:Nt.LINEAR}function Tt(e){if(e===r.RepeatWrapping)return Nt.REPEAT;if(e===r.ClampToEdgeWrapping)return Nt.CLAMP_TO_EDGE;if(e===r.MirroredRepeatWrapping)return Nt.MIRRORED_REPEAT;if(e===r.NearestFilter)return Nt.NEAREST;if(e===r.NearestMipMapNearestFilter)return Nt.NEAREST_MIPMAP_NEAREST;if(e===r.NearestMipMapLinearFilter)return Nt.NEAREST_MIPMAP_LINEAR;if(e===r.LinearFilter)return Nt.LINEAR;if(e===r.LinearMipMapNearestFilter)return Nt.LINEAR_MIPMAP_NEAREST;if(e===r.LinearMipMapLinearFilter)return Nt.LINEAR_MIPMAP_LINEAR;if(e===r.UnsignedByteType)return Nt.UNSIGNED_BYTE;if(e===r.UnsignedShort4444Type)return Nt.UNSIGNED_SHORT_4_4_4_4;if(e===r.UnsignedShort5551Type)return Nt.UNSIGNED_SHORT_5_5_5_1;if(e===r.UnsignedShort565Type)return Nt.UNSIGNED_SHORT_5_6_5;if(e===r.ByteType)return Nt.BYTE;if(e===r.ShortType)return Nt.SHORT;if(e===r.UnsignedShortType)return Nt.UNSIGNED_SHORT;if(e===r.IntType)return Nt.INT;if(e===r.UnsignedIntType)return Nt.UNSIGNED_INT;if(e===r.FloatType)return Nt.FLOAT;if(e===r.AlphaFormat)return Nt.ALPHA;if(e===r.RGBFormat)return Nt.RGB;if(e===r.RGBAFormat)return Nt.RGBA;if(e===r.LuminanceFormat)return Nt.LUMINANCE;if(e===r.LuminanceAlphaFormat)return Nt.LUMINANCE_ALPHA;if(e===r.AddEquation)return Nt.FUNC_ADD;if(e===r.SubtractEquation)return Nt.FUNC_SUBTRACT;if(e===r.ReverseSubtractEquation)return Nt.FUNC_REVERSE_SUBTRACT;if(e===r.ZeroFactor)return Nt.ZERO;if(e===r.OneFactor)return Nt.ONE;if(e===r.SrcColorFactor)return Nt.SRC_COLOR;if(e===r.OneMinusSrcColorFactor)return Nt.ONE_MINUS_SRC_COLOR;if(e===r.SrcAlphaFactor)return Nt.SRC_ALPHA;if(e===r.OneMinusSrcAlphaFactor)return Nt.ONE_MINUS_SRC_ALPHA;if(e===r.DstAlphaFactor)return Nt.DST_ALPHA;if(e===r.OneMinusDstAlphaFactor)return Nt.ONE_MINUS_DST_ALPHA;if(e===r.DstColorFactor)return Nt.DST_COLOR;if(e===r.OneMinusDstColorFactor)return Nt.ONE_MINUS_DST_COLOR;if(e===r.SrcAlphaSaturateFactor)return Nt.SRC_ALPHA_SATURATE;if(void 0!==Wt){if(e===r.RGB_S3TC_DXT1_Format)return Wt.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===r.RGBA_S3TC_DXT1_Format)return Wt.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===r.RGBA_S3TC_DXT3_Format)return Wt.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===r.RGBA_S3TC_DXT5_Format)return Wt.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(void 0!==Gt){if(e===r.RGB_ATC_Format)return Gt.COMPRESSED_RGB_ATC_WEBGL;if(e===r.RGBA_ATC_EXPLICIT_ALPHA_Format)return Gt.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL;if(e===r.RGBA_ATC_INTERP_ALPHA_Format)return Gt.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL}if(void 0!==Xt){if(e===r.RGB_PVRTC_4BPPV1_Format)return Xt.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===r.RGB_PVRTC_2BPPV1_Format)return Xt.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===r.RGBA_PVRTC_4BPPV1_Format)return Xt.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===r.RGBA_PVRTC_2BPPV1_Format)return Xt.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}return 0}function Ct(e){if(Hi&&e&&e.useVertexTexture)return 1024;var t=Nt.getParameter(Nt.MAX_VERTEX_UNIFORM_VECTORS),i=Math.floor((t-20)/4),n=i;return void 0!==e&&e instanceof r.SkinnedMesh&&(n=Math.min(e.bones.length,n),e.bones.length>n&&console.warn("WebGLRenderer: too many bones - "+e.bones.length+", this GPU supports just "+n+" (try OpenGL instead of ANGLE)")),n}function Mt(e){for(var t=0,i=0,n=0,s=0,o=0,a=e.length;a>o;o++){var l=e[o];l.onlyShadow||(l instanceof r.DirectionalLight&&t++,l instanceof r.PointLight&&i++,l instanceof r.SpotLight&&n++,l instanceof r.HemisphereLight&&s++)}return{directional:t,point:i,spot:n,hemi:s}}function St(e){for(var t=0,i=0,n=e.length;n>i;i++){var s=e[i];s.castShadow&&(s instanceof r.SpotLight&&t++,s instanceof r.DirectionalLight&&!s.shadowCascade&&t++)}return t}function At(){try{if(!(Nt=Ut.getContext("experimental-webgl",{alpha:Pt,premultipliedAlpha:jt,antialias:Bt,stencil:Ht,preserveDrawingBuffer:kt})))throw"Error creating WebGL context."}catch(e){console.error(e)}Ft=Nt.getExtension("OES_texture_float"),Ot=Nt.getExtension("OES_texture_float_linear"),zt=Nt.getExtension("OES_standard_derivatives"),Vt=Nt.getExtension("EXT_texture_filter_anisotropic")||Nt.getExtension("MOZ_EXT_texture_filter_anisotropic")||Nt.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),Wt=Nt.getExtension("WEBGL_compressed_texture_s3tc")||Nt.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||Nt.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"),Gt=Nt.getExtension("WEBGL_compressed_texture_atc")||Nt.getExtension("MOZ_WEBGL_compressed_texture_atc")||Nt.getExtension("WEBKIT_WEBGL_compressed_texture_atc"),Xt=Nt.getExtension("WEBGL_compressed_texture_pvrtc")||Nt.getExtension("MOZ_WEBGL_compressed_texture_pvrtc")||Nt.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),Ft||console.log("THREE.WebGLRenderer: Float textures not supported."),zt||console.log("THREE.WebGLRenderer: Standard derivatives not supported."),Vt||console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported."),Wt||console.log("THREE.WebGLRenderer: S3TC compressed textures not supported."),Gt||console.log("THREE.WebGLRenderer: ATC compressed textures not supported."),Xt||console.log("THREE.WebGLRenderer: PVRTC compressed textures not supported."),void 0===Nt.getShaderPrecisionFormat&&(Nt.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}function Rt(){Nt.clearColor(0,0,0,1),Nt.clearDepth(1),Nt.clearStencil(0),Nt.enable(Nt.DEPTH_TEST),Nt.depthFunc(Nt.LEQUAL),Nt.frontFace(Nt.CCW),Nt.cullFace(Nt.BACK),Nt.enable(Nt.CULL_FACE),Nt.enable(Nt.BLEND),Nt.blendEquation(Nt.FUNC_ADD),Nt.blendFunc(Nt.SRC_ALPHA,Nt.ONE_MINUS_SRC_ALPHA),Nt.clearColor(Lt.r,Lt.g,Lt.b,It)}console.log("THREE.WebGLRenderer",r.REVISION),e=e||{};var Ut=void 0!==e.canvas?e.canvas:document.createElement("canvas"),Dt=void 0!==e.precision?e.precision:"highp",Pt=void 0!==e.alpha?e.alpha:!0,jt=void 0!==e.premultipliedAlpha?e.premultipliedAlpha:!0,Bt=void 0!==e.antialias?e.antialias:!1,Ht=void 0!==e.stencil?e.stencil:!0,kt=void 0!==e.preserveDrawingBuffer?e.preserveDrawingBuffer:!1,Lt=new r.Color(0),It=0;void 0!==e.clearColor&&(console.warn("DEPRECATED: clearColor in WebGLRenderer constructor parameters is being removed. Use .setClearColor() instead."),Lt.setHex(e.clearColor)),void 0!==e.clearAlpha&&(console.warn("DEPRECATED: clearAlpha in WebGLRenderer constructor parameters is being removed. Use .setClearColor() instead."),It=e.clearAlpha),this.domElement=Ut,this.context=null,this.devicePixelRatio=void 0!==e.devicePixelRatio?e.devicePixelRatio:void 0!==window.devicePixelRatio?window.devicePixelRatio:1,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.autoUpdateObjects=!0,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyBasedShading=!1,this.shadowMapEnabled=!1,this.shadowMapAutoUpdate=!0,this.shadowMapType=r.PCFShadowMap,this.shadowMapCullFace=r.CullFaceFront,this.shadowMapDebug=!1,this.shadowMapCascade=!1,this.maxMorphTargets=8,this.maxMorphNormals=4,this.autoScaleCubemaps=!0,this.renderPluginsPre=[],this.renderPluginsPost=[],this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var Nt,Ft,Ot,zt,Vt,Wt,Gt,Xt,qt=this,$t=[],Yt=0,Kt=null,Jt=null,Qt=-1,Zt=null,ei=null,ti=0,ii=0,ri=-1,ni=-1,si=-1,oi=-1,ai=-1,li=-1,di=-1,ci=-1,hi=null,ui=null,pi=null,fi=null,gi=0,vi=0,mi=0,yi=0,wi=0,xi=0,bi={},Ei=new r.Frustum,_i=new r.Matrix4,Ti=new r.Matrix4,Ci=new r.Vector3,Mi=new r.Vector3,Si=!0,Ai={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}};At(),Rt(),this.context=Nt;var Ri=Nt.getParameter(Nt.MAX_TEXTURE_IMAGE_UNITS),Ui=Nt.getParameter(Nt.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Di=Nt.getParameter(Nt.MAX_TEXTURE_SIZE),Pi=Nt.getParameter(Nt.MAX_CUBE_MAP_TEXTURE_SIZE),ji=Vt?Nt.getParameter(Vt.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,Bi=Ui>0,Hi=Bi&&Ft;Wt||Gt||Xt?Nt.getParameter(Nt.COMPRESSED_TEXTURE_FORMATS):[];var ki=Nt.getShaderPrecisionFormat(Nt.VERTEX_SHADER,Nt.HIGH_FLOAT),Li=Nt.getShaderPrecisionFormat(Nt.VERTEX_SHADER,Nt.MEDIUM_FLOAT);Nt.getShaderPrecisionFormat(Nt.VERTEX_SHADER,Nt.LOW_FLOAT);var Ii=Nt.getShaderPrecisionFormat(Nt.FRAGMENT_SHADER,Nt.HIGH_FLOAT),Ni=Nt.getShaderPrecisionFormat(Nt.FRAGMENT_SHADER,Nt.MEDIUM_FLOAT);Nt.getShaderPrecisionFormat(Nt.FRAGMENT_SHADER,Nt.LOW_FLOAT),Nt.getShaderPrecisionFormat(Nt.VERTEX_SHADER,Nt.HIGH_INT),Nt.getShaderPrecisionFormat(Nt.VERTEX_SHADER,Nt.MEDIUM_INT),Nt.getShaderPrecisionFormat(Nt.VERTEX_SHADER,Nt.LOW_INT),Nt.getShaderPrecisionFormat(Nt.FRAGMENT_SHADER,Nt.HIGH_INT),Nt.getShaderPrecisionFormat(Nt.FRAGMENT_SHADER,Nt.MEDIUM_INT),Nt.getShaderPrecisionFormat(Nt.FRAGMENT_SHADER,Nt.LOW_INT);var Fi=ki.precision>0&&Ii.precision>0,Oi=Li.precision>0&&Ni.precision>0;"highp"!==Dt||Fi||(Oi?(Dt="mediump",console.warn("WebGLRenderer: highp not supported, using mediump")):(Dt="lowp",console.warn("WebGLRenderer: highp and mediump not supported, using lowp"))),"mediump"!==Dt||Oi||(Dt="lowp",console.warn("WebGLRenderer: mediump not supported, using lowp")),this.getContext=function(){return Nt},this.supportsVertexTextures=function(){return Bi},this.supportsFloatTextures=function(){return Ft},this.supportsStandardDerivatives=function(){return zt},this.supportsCompressedTextureS3TC=function(){return Wt},this.supportsCompressedTextureATC=function(){return Gt},this.supportsCompressedTexturePVRTC=function(){return Xt},this.getMaxAnisotropy=function(){return ji},this.getMaxTextureSize=function(){return Di},this.getMaxCubemapSize=function(){return Pi},this.getMaxTextures=function(){return Ri},this.getMaxVertexTextures=function(){return Ui},this.setPrecision=function(e){Dt=void 0!==e?e:"highp"},this.getPrecision=function(){return Dt},this.setSize=function(e,t,i){Ut.width=e*this.devicePixelRatio,Ut.height=t*this.devicePixelRatio,1!==this.devicePixelRatio&&i!==!1&&(Ut.style.width=e+"px",Ut.style.height=t+"px"),this.setViewport(0,0,Ut.width,Ut.height)},this.setViewport=function(e,t,i,r){gi=void 0!==e?e:0,vi=void 0!==t?t:0,mi=void 0!==i?i:Ut.width,yi=void 0!==r?r:Ut.height,Nt.viewport(gi,vi,mi,yi)},this.setScissor=function(e,t,i,r){Nt.scissor(e,t,i,r)},this.enableScissorTest=function(e){e?Nt.enable(Nt.SCISSOR_TEST):Nt.disable(Nt.SCISSOR_TEST)},this.setClearColor=function(e,t){Lt.set(e),It=void 0!==t?t:1,Nt.clearColor(Lt.r,Lt.g,Lt.b,It)},this.setClearColorHex=function(e,t){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead."),this.setClearColor(e,t)},this.getClearColor=function(){return Lt},this.getClearAlpha=function(){return It},this.clear=function(e,t,i){var r=0;(void 0===e||e)&&(r|=Nt.COLOR_BUFFER_BIT),(void 0===t||t)&&(r|=Nt.DEPTH_BUFFER_BIT),(void 0===i||i)&&(r|=Nt.STENCIL_BUFFER_BIT),Nt.clear(r)},this.clearTarget=function(e,t,i,r){this.setRenderTarget(e),this.clear(t,i,r)},this.addPostPlugin=function(e){e.init(this),this.renderPluginsPost.push(e)},this.addPrePlugin=function(e){e.init(this),this.renderPluginsPre.push(e)},this.updateShadowMap=function(e,t){Kt=null,si=-1,di=-1,ci=-1,Zt=-1,Qt=-1,Si=!0,ri=-1,ni=-1,this.shadowMapPlugin.update(e,t)};var zi=function(e){var t=e.target;t.removeEventListener("dispose",zi),Xi(t),qt.info.memory.geometries--},Vi=function(e){var t=e.target;t.removeEventListener("dispose",Vi),qi(t),qt.info.memory.textures--},Wi=function(e){var t=e.target;t.removeEventListener("dispose",Wi),$i(t),qt.info.memory.textures--},Gi=function(e){var t=e.target;t.removeEventListener("dispose",Gi),Yi(t)},Xi=function(e){function t(e){void 0!==e.__webglVertexBuffer&&Nt.deleteBuffer(e.__webglVertexBuffer),void 0!==e.__webglNormalBuffer&&Nt.deleteBuffer(e.__webglNormalBuffer),void 0!==e.__webglTangentBuffer&&Nt.deleteBuffer(e.__webglTangentBuffer),void 0!==e.__webglColorBuffer&&Nt.deleteBuffer(e.__webglColorBuffer),void 0!==e.__webglUVBuffer&&Nt.deleteBuffer(e.__webglUVBuffer),void 0!==e.__webglUV2Buffer&&Nt.deleteBuffer(e.__webglUV2Buffer),void 0!==e.__webglSkinIndicesBuffer&&Nt.deleteBuffer(e.__webglSkinIndicesBuffer),void 0!==e.__webglSkinWeightsBuffer&&Nt.deleteBuffer(e.__webglSkinWeightsBuffer),void 0!==e.__webglFaceBuffer&&Nt.deleteBuffer(e.__webglFaceBuffer),void 0!==e.__webglLineBuffer&&Nt.deleteBuffer(e.__webglLineBuffer),void 0!==e.__webglLineDistanceBuffer&&Nt.deleteBuffer(e.__webglLineDistanceBuffer)}if(e.__webglInit=void 0,t(e),void 0!==e.geometryGroups)for(var i in e.geometryGroups){var r=e.geometryGroups[i];if(t(r),void 0!==r.numMorphTargets)for(var n=0,s=r.numMorphTargets;s>n;n++)Nt.deleteBuffer(r.__webglMorphTargetsBuffers[n]);if(void 0!==r.numMorphNormals)for(var n=0,s=r.numMorphNormals;s>n;n++)Nt.deleteBuffer(r.__webglMorphNormalsBuffers[n]);o(r)}o(e)},qi=function(e){if(e.image&&e.image.__webglTextureCube)Nt.deleteTexture(e.image.__webglTextureCube);else{if(!e.__webglInit)return;e.__webglInit=!1,Nt.deleteTexture(e.__webglTexture)}},$i=function(e){if(e&&e.__webglTexture)if(Nt.deleteTexture(e.__webglTexture),e instanceof r.WebGLRenderTargetCube)for(var t=0;6>t;t++)Nt.deleteFramebuffer(e.__webglFramebuffer[t]),Nt.deleteRenderbuffer(e.__webglRenderbuffer[t]);else Nt.deleteFramebuffer(e.__webglFramebuffer),Nt.deleteRenderbuffer(e.__webglRenderbuffer)},Yi=function(e){var t=e.program;if(void 0!==t){e.program=void 0;var i,r,n,s=!1;for(i=0,r=$t.length;r>i;i++)if(n=$t[i],n.program===t){n.usedTimes--,0===n.usedTimes&&(s=!0);break}if(s===!0){var o=[];for(i=0,r=$t.length;r>i;i++)n=$t[i],n.program!==t&&o.push(n);$t=o,Nt.deleteProgram(t),qt.info.memory.programs--}}};this.renderBufferImmediate=function(e,t,i){if(e.hasPositions&&!e.__webglVertexBuffer&&(e.__webglVertexBuffer=Nt.createBuffer()),e.hasNormals&&!e.__webglNormalBuffer&&(e.__webglNormalBuffer=Nt.createBuffer()),e.hasUvs&&!e.__webglUvBuffer&&(e.__webglUvBuffer=Nt.createBuffer()),e.hasColors&&!e.__webglColorBuffer&&(e.__webglColorBuffer=Nt.createBuffer()),e.hasPositions&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,e.__webglVertexBuffer),Nt.bufferData(Nt.ARRAY_BUFFER,e.positionArray,Nt.DYNAMIC_DRAW),Nt.enableVertexAttribArray(t.attributes.position),Nt.vertexAttribPointer(t.attributes.position,3,Nt.FLOAT,!1,0,0)),e.hasNormals){if(Nt.bindBuffer(Nt.ARRAY_BUFFER,e.__webglNormalBuffer),i.shading===r.FlatShading){var n,s,o,a,l,d,c,h,u,p,f,g,v,m,y=3*e.count;for(m=0;y>m;m+=9)v=e.normalArray,a=v[m],c=v[m+1],p=v[m+2],l=v[m+3],h=v[m+4],f=v[m+5],d=v[m+6],u=v[m+7],g=v[m+8],n=(a+l+d)/3,s=(c+h+u)/3,o=(p+f+g)/3,v[m]=n,v[m+1]=s,v[m+2]=o,v[m+3]=n,v[m+4]=s,v[m+5]=o,v[m+6]=n,v[m+7]=s,v[m+8]=o}Nt.bufferData(Nt.ARRAY_BUFFER,e.normalArray,Nt.DYNAMIC_DRAW),Nt.enableVertexAttribArray(t.attributes.normal),Nt.vertexAttribPointer(t.attributes.normal,3,Nt.FLOAT,!1,0,0)}e.hasUvs&&i.map&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,e.__webglUvBuffer),Nt.bufferData(Nt.ARRAY_BUFFER,e.uvArray,Nt.DYNAMIC_DRAW),Nt.enableVertexAttribArray(t.attributes.uv),Nt.vertexAttribPointer(t.attributes.uv,2,Nt.FLOAT,!1,0,0)),e.hasColors&&i.vertexColors!==r.NoColors&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,e.__webglColorBuffer),Nt.bufferData(Nt.ARRAY_BUFFER,e.colorArray,Nt.DYNAMIC_DRAW),Nt.enableVertexAttribArray(t.attributes.color),Nt.vertexAttribPointer(t.attributes.color,3,Nt.FLOAT,!1,0,0)),Nt.drawArrays(Nt.TRIANGLES,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,i,n,s,o){if(n.visible!==!1){var a,l,d,c,h=W(e,t,i,n,o),u=h.attributes,p=s.attributes,f=!1,g=n.wireframe?1:0,v=16777215*s.id+2*h.id+g;if(v!==Zt&&(Zt=v,f=!0),f&&T(),o instanceof r.Mesh){var m=p.index;if(m){var y=s.offsets;y.length>1&&(f=!0);for(var w=0,x=y.length;x>w;w++){var b=y[w].index;if(f){for(l in p)"index"!==l&&(d=u[l],a=p[l],c=a.itemSize,d>=0&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,a.buffer),_(d),Nt.vertexAttribPointer(d,c,Nt.FLOAT,!1,0,4*b*c)));Nt.bindBuffer(Nt.ELEMENT_ARRAY_BUFFER,m.buffer)}Nt.drawElements(Nt.TRIANGLES,y[w].count,Nt.UNSIGNED_SHORT,2*y[w].start),qt.info.render.calls++,qt.info.render.vertices+=y[w].count,qt.info.render.faces+=y[w].count/3}}else{if(f)for(l in p)"index"!==l&&(d=u[l],a=p[l],c=a.itemSize,d>=0&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,a.buffer),_(d),Nt.vertexAttribPointer(d,c,Nt.FLOAT,!1,0,0)));var E=s.attributes.position;Nt.drawArrays(Nt.TRIANGLES,0,E.numItems/3),qt.info.render.calls++,qt.info.render.vertices+=E.numItems/3,qt.info.render.faces+=E.numItems/3/3}}else if(o instanceof r.ParticleSystem){if(f){for(l in p)d=u[l],a=p[l],c=a.itemSize,d>=0&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,a.buffer),_(d),Nt.vertexAttribPointer(d,c,Nt.FLOAT,!1,0,0));var E=p.position;Nt.drawArrays(Nt.POINTS,0,E.numItems/3),qt.info.render.calls++,qt.info.render.points+=E.numItems/3}}else if(o instanceof r.Line&&f){for(l in p)d=u[l],a=p[l],c=a.itemSize,d>=0&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,a.buffer),_(d),Nt.vertexAttribPointer(d,c,Nt.FLOAT,!1,0,0));var C=o.type===r.LineStrip?Nt.LINE_STRIP:Nt.LINES;at(n.linewidth);var E=p.position;Nt.drawArrays(C,0,E.numItems/3),qt.info.render.calls++,qt.info.render.points+=E.numItems}}},this.renderBuffer=function(e,t,i,n,s,o){if(n.visible!==!1){var a,l,d,c=W(e,t,i,n,o),h=c.attributes,u=!1,p=n.wireframe?1:0,f=16777215*s.id+2*c.id+p;if(f!==Zt&&(Zt=f,u=!0),u&&T(),!n.morphTargets&&h.position>=0?u&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,s.__webglVertexBuffer),_(h.position),Nt.vertexAttribPointer(h.position,3,Nt.FLOAT,!1,0,0)):o.morphTargetBase&&C(n,s,o),u){if(s.__webglCustomAttributesList)for(l=0,d=s.__webglCustomAttributesList.length;d>l;l++)a=s.__webglCustomAttributesList[l],h[a.buffer.belongsToAttribute]>=0&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,a.buffer),_(h[a.buffer.belongsToAttribute]),Nt.vertexAttribPointer(h[a.buffer.belongsToAttribute],a.size,Nt.FLOAT,!1,0,0));h.color>=0&&(o.geometry.faces.length&&o.geometry.faces[0].vertexColors.length>0||o.geometry.__webglColorBuffer?(Nt.bindBuffer(Nt.ARRAY_BUFFER,s.__webglColorBuffer),_(h.color),Nt.vertexAttribPointer(h.color,3,Nt.FLOAT,!1,0,0)):Nt.vertexAttrib3f(h.color,1,1,1)),h.normal>=0&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,s.__webglNormalBuffer),_(h.normal),Nt.vertexAttribPointer(h.normal,3,Nt.FLOAT,!1,0,0)),h.tangent>=0&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,s.__webglTangentBuffer),_(h.tangent),Nt.vertexAttribPointer(h.tangent,4,Nt.FLOAT,!1,0,0)),h.uv>=0&&(o.geometry.faceVertexUvs[0]?(Nt.bindBuffer(Nt.ARRAY_BUFFER,s.__webglUVBuffer),_(h.uv),Nt.vertexAttribPointer(h.uv,2,Nt.FLOAT,!1,0,0)):Nt.vertexAttrib2f(h.uv,0,0)),h.uv2>=0&&(o.geometry.faceVertexUvs[1]?(Nt.bindBuffer(Nt.ARRAY_BUFFER,s.__webglUV2Buffer),_(h.uv2),Nt.vertexAttribPointer(h.uv2,2,Nt.FLOAT,!1,0,0)):Nt.vertexAttrib2f(h.uv2,0,0)),n.skinning&&h.skinIndex>=0&&h.skinWeight>=0&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,s.__webglSkinIndicesBuffer),_(h.skinIndex),Nt.vertexAttribPointer(h.skinIndex,4,Nt.FLOAT,!1,0,0),Nt.bindBuffer(Nt.ARRAY_BUFFER,s.__webglSkinWeightsBuffer),_(h.skinWeight),Nt.vertexAttribPointer(h.skinWeight,4,Nt.FLOAT,!1,0,0)),h.lineDistance>=0&&(Nt.bindBuffer(Nt.ARRAY_BUFFER,s.__webglLineDistanceBuffer),_(h.lineDistance),Nt.vertexAttribPointer(h.lineDistance,1,Nt.FLOAT,!1,0,0))}if(o instanceof r.Mesh)n.wireframe?(at(n.wireframeLinewidth),u&&Nt.bindBuffer(Nt.ELEMENT_ARRAY_BUFFER,s.__webglLineBuffer),Nt.drawElements(Nt.LINES,s.__webglLineCount,Nt.UNSIGNED_SHORT,0)):(u&&Nt.bindBuffer(Nt.ELEMENT_ARRAY_BUFFER,s.__webglFaceBuffer),Nt.drawElements(Nt.TRIANGLES,s.__webglFaceCount,Nt.UNSIGNED_SHORT,0)),qt.info.render.calls++,qt.info.render.vertices+=s.__webglFaceCount,qt.info.render.faces+=s.__webglFaceCount/3;
else if(o instanceof r.Line){var g=o.type===r.LineStrip?Nt.LINE_STRIP:Nt.LINES;at(n.linewidth),Nt.drawArrays(g,0,s.__webglLineCount),qt.info.render.calls++}else o instanceof r.ParticleSystem?(Nt.drawArrays(Nt.POINTS,0,s.__webglParticleCount),qt.info.render.calls++,qt.info.render.points+=s.__webglParticleCount):o instanceof r.Ribbon&&(Nt.drawArrays(Nt.TRIANGLE_STRIP,0,s.__webglVertexCount),qt.info.render.calls++)}},this.render=function(e,t,i,n){if(t instanceof r.Camera==!1)return console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera."),void 0;var s,o,a,l,d,c=e.__lights,h=e.fog;for(Qt=-1,Si=!0,e.autoUpdate===!0&&e.updateMatrixWorld(),void 0===t.parent&&t.updateMatrixWorld(),t.matrixWorldInverse.getInverse(t.matrixWorld),_i.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Ei.setFromMatrix(_i),this.autoUpdateObjects&&this.initWebGLObjects(e),A(this.renderPluginsPre,e,t),qt.info.render.calls=0,qt.info.render.vertices=0,qt.info.render.faces=0,qt.info.render.points=0,this.setRenderTarget(i),(this.autoClear||n)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil),d=e.__webglObjects,s=0,o=d.length;o>s;s++)a=d[s],l=a.object,a.id=s,a.render=!1,l.visible&&((l instanceof r.Mesh||l instanceof r.ParticleSystem)&&l.frustumCulled&&!Ei.intersectsObject(l)||(rt(l,t),P(a),a.render=!0,this.sortObjects===!0&&(null!==l.renderDepth?a.z=l.renderDepth:(Ci.getPositionFromMatrix(l.matrixWorld),Ci.applyProjection(_i),a.z=Ci.z))));for(this.sortObjects&&d.sort(M),d=e.__webglObjectsImmediate,s=0,o=d.length;o>s;s++)a=d[s],l=a.object,l.visible&&(rt(l,t),D(a));if(e.overrideMaterial){var u=e.overrideMaterial;this.setBlending(u["static"].blending,u["static"].blendEquation,u["static"].blendSrc,u["static"].blendDst),this.setDepthTest(u["static"].depthTest),this.setDepthWrite(u["static"].depthWrite),lt(u["static"].polygonOffset,u["static"].polygonOffsetFactor,u["static"].polygonOffsetUnits),R(e.__webglObjects,!1,"",t,c,h,!0,u),U(e.__webglObjectsImmediate,"",t,c,h,!1,u)}else if(e.enablePicking)this.setBlending(r.NormalBlending),R(e.__webglObjects,!1,"picking",t,[],void 0,!0),U(e.__webglObjectsImmediate,"picking",t,[],void 0,!1);else if(e.enableDepth)this.setBlending(r.NormalBlending),R(e.__webglObjects,!1,"depth",t,[],void 0,!0),U(e.__webglObjectsImmediate,"depth",t,[],void 0,!1);else{var u=null;this.setBlending(r.NoBlending),R(e.__webglObjects,!0,"opaque",t,c,h,!1,u,e.overrideUniforms),U(e.__webglObjectsImmediate,"opaque",t,c,h,!1,u),R(e.__webglObjects,!1,"transparent",t,c,h,!0,u,e.overrideUniforms),U(e.__webglObjectsImmediate,"transparent",t,c,h,!0,u)}A(this.renderPluginsPost,e,t),i&&i.generateMipmaps&&i.minFilter!==r.NearestFilter&&i.minFilter!==r.LinearFilter&&Et(i),this.setDepthTest(!0),this.setDepthWrite(!0)},this.renderImmediateObject=function(e,t,i,r,n){var s=W(e,t,i,r,n);Zt=-1,qt.setMaterialFaces(r),n.immediateRenderCallback?n.immediateRenderCallback(s,Nt,Ei):n.render(function(e){qt.renderBufferImmediate(e,s,r)})},this.initWebGLObjects=function(e){for(e.__webglObjects||(e.__webglObjects=[],e.__webglObjectsImmediate=[],e.__webglSprites=[],e.__webglFlares=[]);e.__objectsAdded.length;)B(e.__objectsAdded[0],e),e.__objectsAdded.splice(0,1);for(;e.__objectsRemoved.length;)F(e.__objectsRemoved[0],e),e.__objectsRemoved.splice(0,1);for(var t=0,i=e.__webglObjects.length;i>t;t++){var r=e.__webglObjects[t].object;void 0===r.__webglInit&&(void 0!==r.__webglActive&&F(r,e),B(r,e)),L(r)}},this.initMaterial=function(e,t,i,n){e.addEventListener("dispose",Gi);var s,o,a,l,d,c,h;e instanceof r.MeshDepthMaterial?h="depth":e instanceof r.MeshNormalMaterial?h="normal":e instanceof r.MeshBasicMaterial?h="basic":e instanceof r.MeshLambertMaterial?h="lambert":e instanceof r.MeshPhongMaterial?h="phong":e instanceof r.LineBasicMaterial?h="basic":e instanceof r.LineDashedMaterial?h="dashed":e instanceof r.ParticleBasicMaterial&&(h="particle_basic"),h&&V(e,r.ShaderLib[h]),l=Mt(t),c=St(t),d=Ct(n),a={map:!!e.map,envMap:!!e.envMap,lightMap:!!e.lightMap,bumpMap:!!e.bumpMap,normalMap:!!e.normalMap,specularMap:!!e.specularMap,vertexColors:e.vertexColors,fog:i,useFog:e.fog,fogExp:i instanceof r.FogExp2,sizeAttenuation:e.sizeAttenuation,skinning:e.skinning,maxBones:d,useVertexTexture:Hi&&n&&n.useVertexTexture,boneTextureWidth:n&&n.boneTextureWidth,boneTextureHeight:n&&n.boneTextureHeight,morphTargets:e.morphTargets,morphNormals:e.morphNormals,maxMorphTargets:this.maxMorphTargets,maxMorphNormals:this.maxMorphNormals,maxDirLights:l.directional,maxPointLights:l.point,maxSpotLights:l.spot,maxHemiLights:l.hemi,maxShadows:c,shadowMapEnabled:this.shadowMapEnabled&&n.receiveShadow,shadowMapType:this.shadowMapType,shadowMapDebug:this.shadowMapDebug,shadowMapCascade:this.shadowMapCascade,alphaTest:e.alphaTest,metal:e.metal,perPixel:e.perPixel,wrapAround:e.wrapAround,doubleSided:e.side===r.DoubleSide,flipSided:e.side===r.BackSide},e.program=ct(h,e.fragmentShader,e.vertexShader,e.uniforms,e.attributes,e.defines,a);var u=e.program.attributes;if(e.morphTargets){e.numSupportedMorphTargets=0;var p,f="morphTarget";for(o=0;this.maxMorphTargets>o;o++)p=f+o,u[p]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;var p,f="morphNormal";for(o=0;this.maxMorphNormals>o;o++)p=f+o,u[p]>=0&&e.numSupportedMorphNormals++}e.uniformsList=[];for(s in e.uniforms)e.uniformsList.push([e.uniforms[s],s])},this.setFaceCulling=function(e,t){e===r.CullFaceNone?Nt.disable(Nt.CULL_FACE):(t===r.FrontFaceDirectionCW?Nt.frontFace(Nt.CW):Nt.frontFace(Nt.CCW),e===r.CullFaceBack?Nt.cullFace(Nt.BACK):e===r.CullFaceFront?Nt.cullFace(Nt.FRONT):Nt.cullFace(Nt.FRONT_AND_BACK),Nt.enable(Nt.CULL_FACE))},this.setMaterialFaces=function(e){var t=e.side===r.DoubleSide,i=e.side===r.BackSide;ri!==t&&(t?Nt.disable(Nt.CULL_FACE):Nt.enable(Nt.CULL_FACE),ri=t),ni!==i&&(i?Nt.frontFace(Nt.CW):Nt.frontFace(Nt.CCW),ni=i)},this.setDepthTest=function(e){di!==e&&(e?Nt.enable(Nt.DEPTH_TEST):Nt.disable(Nt.DEPTH_TEST),di=e)},this.setDepthWrite=function(e){ci!==e&&(Nt.depthMask(e),ci=e)},this.setBlending=function(e,t,i,n){e!==si&&(e===r.NoBlending?Nt.disable(Nt.BLEND):e===r.AdditiveBlending?(Nt.enable(Nt.BLEND),Nt.blendEquation(Nt.FUNC_ADD),Nt.blendFunc(Nt.SRC_ALPHA,Nt.ONE)):e===r.SubtractiveBlending?(Nt.enable(Nt.BLEND),Nt.blendEquation(Nt.FUNC_ADD),Nt.blendFunc(Nt.ZERO,Nt.ONE_MINUS_SRC_COLOR)):e===r.MultiplyBlending?(Nt.enable(Nt.BLEND),Nt.blendEquation(Nt.FUNC_ADD),Nt.blendFunc(Nt.ZERO,Nt.SRC_COLOR)):e===r.CustomBlending?Nt.enable(Nt.BLEND):(Nt.enable(Nt.BLEND),Nt.blendEquationSeparate(Nt.FUNC_ADD,Nt.FUNC_ADD),Nt.blendFuncSeparate(Nt.SRC_ALPHA,Nt.ONE_MINUS_SRC_ALPHA,Nt.ONE,Nt.ONE_MINUS_SRC_ALPHA)),si=e),e===r.CustomBlending?(t!==oi&&(Nt.blendEquation(Tt(t)),oi=t),(i!==ai||n!==li)&&(Nt.blendFunc(Tt(i),Tt(n)),ai=i,li=n)):(oi=null,ai=null,li=null)},this.setTexture=function(e,t){if(e.needsUpdate){e.__webglInit||(e.__webglInit=!0,e.addEventListener("dispose",Vi),e.__webglTexture=Nt.createTexture(),qt.info.memory.textures++),Nt.activeTexture(Nt.TEXTURE0+t),Nt.bindTexture(Nt.TEXTURE_2D,e.__webglTexture),Nt.pixelStorei(Nt.UNPACK_FLIP_Y_WEBGL,e.flipY),Nt.pixelStorei(Nt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),Nt.pixelStorei(Nt.UNPACK_ALIGNMENT,e.unpackAlignment);var i=e.image,n=gt(i.width)&&gt(i.height),s=Tt(e.format),o=Tt(e.type);vt(Nt.TEXTURE_2D,e,n);var a,l=e.mipmaps;if(e instanceof r.DataTexture)if(l.length>0&&n){for(var d=0,c=l.length;c>d;d++)a=l[d],Nt.texImage2D(Nt.TEXTURE_2D,d,s,a.width,a.height,0,s,o,a.data);e.generateMipmaps=!1}else Nt.texImage2D(Nt.TEXTURE_2D,0,s,i.width,i.height,0,s,o,i.data);else if(e instanceof r.CompressedTexture)for(var d=0,c=l.length;c>d;d++)a=l[d],Nt.compressedTexImage2D(Nt.TEXTURE_2D,d,s,a.width,a.height,0,a.data);else if(l.length>0&&n){for(var d=0,c=l.length;c>d;d++)a=l[d],Nt.texImage2D(Nt.TEXTURE_2D,d,s,s,o,a);e.generateMipmaps=!1}else Nt.texImage2D(Nt.TEXTURE_2D,0,s,s,o,e.image);e.generateMipmaps&&n&&Nt.generateMipmap(Nt.TEXTURE_2D),e.needsUpdate=!1,e.onUpdate&&e.onUpdate()}else Nt.activeTexture(Nt.TEXTURE0+t),Nt.bindTexture(Nt.TEXTURE_2D,e.__webglTexture)},this.setRenderTarget=function(e){var t=e instanceof r.WebGLRenderTargetCube;if(e&&!e.__webglFramebuffer){void 0===e.depthBuffer&&(e.depthBuffer=!0),void 0===e.stencilBuffer&&(e.stencilBuffer=!0),e.addEventListener("dispose",Wi),e.__webglTexture=Nt.createTexture(),qt.info.memory.textures++;var i=gt(e.width)&&gt(e.height),n=Tt(e.format),s=Tt(e.type);if(t){e.__webglFramebuffer=[],e.__webglRenderbuffer=[],Nt.bindTexture(Nt.TEXTURE_CUBE_MAP,e.__webglTexture),vt(Nt.TEXTURE_CUBE_MAP,e,i);for(var o=0;6>o;o++)e.__webglFramebuffer[o]=Nt.createFramebuffer(),e.__webglRenderbuffer[o]=Nt.createRenderbuffer(),Nt.texImage2D(Nt.TEXTURE_CUBE_MAP_POSITIVE_X+o,0,n,e.width,e.height,0,n,s,null),xt(e.__webglFramebuffer[o],e,Nt.TEXTURE_CUBE_MAP_POSITIVE_X+o),bt(e.__webglRenderbuffer[o],e);i&&Nt.generateMipmap(Nt.TEXTURE_CUBE_MAP)}else e.__webglFramebuffer=Nt.createFramebuffer(),e.__webglRenderbuffer=e.shareDepthFrom?e.shareDepthFrom.__webglRenderbuffer:Nt.createRenderbuffer(),Nt.bindTexture(Nt.TEXTURE_2D,e.__webglTexture),vt(Nt.TEXTURE_2D,e,i),Nt.texImage2D(Nt.TEXTURE_2D,0,n,e.width,e.height,0,n,s,null),xt(e.__webglFramebuffer,e,Nt.TEXTURE_2D),e.shareDepthFrom?e.depthBuffer&&!e.stencilBuffer?Nt.framebufferRenderbuffer(Nt.FRAMEBUFFER,Nt.DEPTH_ATTACHMENT,Nt.RENDERBUFFER,e.__webglRenderbuffer):e.depthBuffer&&e.stencilBuffer&&Nt.framebufferRenderbuffer(Nt.FRAMEBUFFER,Nt.DEPTH_STENCIL_ATTACHMENT,Nt.RENDERBUFFER,e.__webglRenderbuffer):bt(e.__webglRenderbuffer,e),i&&Nt.generateMipmap(Nt.TEXTURE_2D);t?Nt.bindTexture(Nt.TEXTURE_CUBE_MAP,null):Nt.bindTexture(Nt.TEXTURE_2D,null),Nt.bindRenderbuffer(Nt.RENDERBUFFER,null),Nt.bindFramebuffer(Nt.FRAMEBUFFER,null)}var a,l,d,c,h;e?(a=t?e.__webglFramebuffer[e.activeCubeFace]:e.__webglFramebuffer,l=e.width,d=e.height,c=0,h=0):(a=null,l=mi,d=yi,c=gi,h=vi),a!==Jt&&(Nt.bindFramebuffer(Nt.FRAMEBUFFER,a),Nt.viewport(c,h,l,d),Jt=a),wi=l,xi=d},this.shadowMapPlugin=new r.ShadowMapPlugin,this.addPrePlugin(this.shadowMapPlugin),this.addPostPlugin(new r.SpritePlugin),this.addPostPlugin(new r.LensFlarePlugin)},r.WebGLRenderTarget=function(e,t,i){this.width=e,this.height=t,i=i||{},this.wrapS=void 0!==i.wrapS?i.wrapS:r.ClampToEdgeWrapping,this.wrapT=void 0!==i.wrapT?i.wrapT:r.ClampToEdgeWrapping,this.magFilter=void 0!==i.magFilter?i.magFilter:r.LinearFilter,this.minFilter=void 0!==i.minFilter?i.minFilter:r.LinearMipMapLinearFilter,this.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,this.offset=new r.Vector2(0,0),this.repeat=new r.Vector2(1,1),this.format=void 0!==i.format?i.format:r.RGBAFormat,this.type=void 0!==i.type?i.type:r.UnsignedByteType,this.depthBuffer=void 0!==i.depthBuffer?i.depthBuffer:!0,this.stencilBuffer=void 0!==i.stencilBuffer?i.stencilBuffer:!0,this.generateMipmaps=!0,this.shareDepthFrom=null},r.WebGLRenderTarget.prototype={constructor:r.WebGLRenderTarget,addEventListener:r.EventDispatcher.prototype.addEventListener,hasEventListener:r.EventDispatcher.prototype.hasEventListener,removeEventListener:r.EventDispatcher.prototype.removeEventListener,dispatchEvent:r.EventDispatcher.prototype.dispatchEvent,clone:function(){var e=new r.WebGLRenderTarget(this.width,this.height);return e.wrapS=this.wrapS,e.wrapT=this.wrapT,e.magFilter=this.magFilter,e.minFilter=this.minFilter,e.anisotropy=this.anisotropy,e.offset.copy(this.offset),e.repeat.copy(this.repeat),e.format=this.format,e.type=this.type,e.depthBuffer=this.depthBuffer,e.stencilBuffer=this.stencilBuffer,e.generateMipmaps=this.generateMipmaps,e.shareDepthFrom=this.shareDepthFrom,e},dispose:function(){this.dispatchEvent({type:"dispose"})}},r.WebGLRenderTargetCube=function(e,t,i){r.WebGLRenderTarget.call(this,e,t,i),this.activeCubeFace=0},r.WebGLRenderTargetCube.prototype=Object.create(r.WebGLRenderTarget.prototype),r.RenderableVertex=function(){this.positionWorld=new r.Vector3,this.positionScreen=new r.Vector4,this.visible=!0},r.RenderableVertex.prototype.copy=function(e){this.positionWorld.copy(e.positionWorld),this.positionScreen.copy(e.positionScreen)},r.RenderableFace3=function(){this.v1=new r.RenderableVertex,this.v2=new r.RenderableVertex,this.v3=new r.RenderableVertex,this.centroidModel=new r.Vector3,this.normalModel=new r.Vector3,this.normalModelView=new r.Vector3,this.vertexNormalsLength=0,this.vertexNormalsModel=[new r.Vector3,new r.Vector3,new r.Vector3],this.vertexNormalsModelView=[new r.Vector3,new r.Vector3,new r.Vector3],this.color=null,this.material=null,this.uvs=[[]],this.z=null},r.RenderableFace4=function(){this.v1=new r.RenderableVertex,this.v2=new r.RenderableVertex,this.v3=new r.RenderableVertex,this.v4=new r.RenderableVertex,this.centroidModel=new r.Vector3,this.normalModel=new r.Vector3,this.normalModelView=new r.Vector3,this.vertexNormalsLength=0,this.vertexNormalsModel=[new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3],this.vertexNormalsModelView=[new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3],this.color=null,this.material=null,this.uvs=[[]],this.z=null},r.RenderableObject=function(){this.object=null,this.z=null},r.RenderableParticle=function(){this.object=null,this.x=null,this.y=null,this.z=null,this.rotation=null,this.scale=new r.Vector2,this.material=null},r.RenderableLine=function(){this.z=null,this.v1=new r.RenderableVertex,this.v2=new r.RenderableVertex,this.vertexColors=[new r.Color,new r.Color],this.material=null},r.GeometryUtils={merge:function(e,t,i){var n,s,o=e.vertices.length,a=(e.faceVertexUvs[0].length,t instanceof r.Mesh?t.geometry:t),l=e.vertices,d=a.vertices,c=e.faces,h=a.faces,u=e.faceVertexUvs[0],p=a.faceVertexUvs[0];void 0===i&&(i=0),t instanceof r.Mesh&&(t.matrixAutoUpdate&&t.updateMatrix(),n=t.matrix,s=(new r.Matrix3).getNormalMatrix(n));for(var f=0,g=d.length;g>f;f++){var v=d[f],m=v.clone();n&&m.applyMatrix4(n),l.push(m)}for(f=0,g=h.length;g>f;f++){var y,w,x,b=h[f],E=b.vertexNormals,_=b.vertexColors;b instanceof r.Face3?y=new r.Face3(b.a+o,b.b+o,b.c+o):b instanceof r.Face4&&(y=new r.Face4(b.a+o,b.b+o,b.c+o,b.d+o)),y.normal.copy(b.normal),s&&y.normal.applyMatrix3(s).normalize();for(var T=0,C=E.length;C>T;T++)w=E[T].clone(),s&&w.applyMatrix3(s).normalize(),y.vertexNormals.push(w);y.color.copy(b.color);for(var T=0,C=_.length;C>T;T++)x=_[T],y.vertexColors.push(x.clone());y.materialIndex=b.materialIndex+i,y.centroid.copy(b.centroid),n&&y.centroid.applyMatrix4(n),c.push(y)}for(f=0,g=p.length;g>f;f++){for(var M=p[f],S=[],T=0,C=M.length;C>T;T++)S.push(new r.Vector2(M[T].x,M[T].y));u.push(S)}},removeMaterials:function(e,t){for(var i={},r=0,n=t.length;n>r;r++)i[t[r]]=!0;for(var s,o=[],r=0,n=e.faces.length;n>r;r++)s=e.faces[r],s.materialIndex in i||o.push(s);e.faces=o},randomPointInTriangle:function(e,t,i){var n,s,o,a=new r.Vector3,l=r.GeometryUtils.__v1;return n=r.GeometryUtils.random(),s=r.GeometryUtils.random(),n+s>1&&(n=1-n,s=1-s),o=1-n-s,a.copy(e),a.multiplyScalar(n),l.copy(t),l.multiplyScalar(s),a.add(l),l.copy(i),l.multiplyScalar(o),a.add(l),a},randomPointInFace:function(e,t,i){var n,s,o,a;if(e instanceof r.Face3)return n=t.vertices[e.a],s=t.vertices[e.b],o=t.vertices[e.c],r.GeometryUtils.randomPointInTriangle(n,s,o);if(e instanceof r.Face4){n=t.vertices[e.a],s=t.vertices[e.b],o=t.vertices[e.c],a=t.vertices[e.d];var l,d;i?e._area1&&e._area2?(l=e._area1,d=e._area2):(l=r.GeometryUtils.triangleArea(n,s,a),d=r.GeometryUtils.triangleArea(s,o,a),e._area1=l,e._area2=d):(l=r.GeometryUtils.triangleArea(n,s,a),d=r.GeometryUtils.triangleArea(s,o,a));var c=r.GeometryUtils.random()*(l+d);return l>c?r.GeometryUtils.randomPointInTriangle(n,s,a):r.GeometryUtils.randomPointInTriangle(s,o,a)}},randomPointsInGeometry:function(e,t){function i(e){function t(i,r){if(i>r)return i;var n=i+Math.floor((r-i)/2);return f[n]>e?t(i,n-1):e>f[n]?t(n+1,r):n}var i=t(0,f.length-1);return i}var n,s,o,a,l,d,c=e.faces,h=e.vertices,u=c.length,p=0,f=[];for(s=0;u>s;s++)n=c[s],n instanceof r.Face3?(o=h[n.a],a=h[n.b],l=h[n.c],n._area=r.GeometryUtils.triangleArea(o,a,l)):n instanceof r.Face4&&(o=h[n.a],a=h[n.b],l=h[n.c],d=h[n.d],n._area1=r.GeometryUtils.triangleArea(o,a,d),n._area2=r.GeometryUtils.triangleArea(a,l,d),n._area=n._area1+n._area2),p+=n._area,f[s]=p;var g,v,m=[],y={};for(s=0;t>s;s++)g=r.GeometryUtils.random()*p,v=i(g),m[s]=r.GeometryUtils.randomPointInFace(c[v],e,!0),y[v]?y[v]+=1:y[v]=1;return m},triangleArea:function(e,t,i){var n=r.GeometryUtils.__v1,s=r.GeometryUtils.__v2;return n.subVectors(t,e),s.subVectors(i,e),n.cross(s),.5*n.length()},center:function(e){e.computeBoundingBox();var t=e.boundingBox,i=new r.Vector3;return i.addVectors(t.min,t.max),i.multiplyScalar(-.5),e.applyMatrix((new r.Matrix4).makeTranslation(i.x,i.y,i.z)),e.computeBoundingBox(),i},normalizeUVs:function(e){for(var t=e.faceVertexUvs[0],i=0,r=t.length;r>i;i++)for(var n=t[i],s=0,o=n.length;o>s;s++)1!==n[s].x&&(n[s].x=n[s].x-Math.floor(n[s].x)),1!==n[s].y&&(n[s].y=n[s].y-Math.floor(n[s].y))},triangulateQuads:function(e){var t,i,n,s,o=[],a=[],l=[];for(t=0,i=e.faceUvs.length;i>t;t++)a[t]=[];for(t=0,i=e.faceVertexUvs.length;i>t;t++)l[t]=[];for(t=0,i=e.faces.length;i>t;t++){var d=e.faces[t];if(d instanceof r.Face4){var c=d.a,h=d.b,u=d.c,p=d.d,f=new r.Face3,g=new r.Face3;for(f.color.copy(d.color),g.color.copy(d.color),f.materialIndex=d.materialIndex,g.materialIndex=d.materialIndex,f.a=c,f.b=h,f.c=p,g.a=h,g.b=u,g.c=p,4===d.vertexColors.length&&(f.vertexColors[0]=d.vertexColors[0].clone(),f.vertexColors[1]=d.vertexColors[1].clone(),f.vertexColors[2]=d.vertexColors[3].clone(),g.vertexColors[0]=d.vertexColors[1].clone(),g.vertexColors[1]=d.vertexColors[2].clone(),g.vertexColors[2]=d.vertexColors[3].clone()),o.push(f,g),n=0,s=e.faceVertexUvs.length;s>n;n++)if(e.faceVertexUvs[n].length){var v=e.faceVertexUvs[n][t],m=v[0],y=v[1],w=v[2],x=v[3],b=[m.clone(),y.clone(),x.clone()],E=[y.clone(),w.clone(),x.clone()];l[n].push(b,E)}for(n=0,s=e.faceUvs.length;s>n;n++)if(e.faceUvs[n].length){var _=e.faceUvs[n][t];a[n].push(_,_)}}else{for(o.push(d),n=0,s=e.faceUvs.length;s>n;n++)a[n].push(e.faceUvs[n][t]);for(n=0,s=e.faceVertexUvs.length;s>n;n++)l[n].push(e.faceVertexUvs[n][t])}}e.faces=o,e.faceUvs=a,e.faceVertexUvs=l,e.computeCentroids(),e.computeFaceNormals(),e.computeVertexNormals(),e.hasTangents&&e.computeTangents()},setMaterialIndex:function(e,t,i,r){for(var n=e.faces,s=i||0,o=r||n.length-1,a=s;o>=a;a++)n[a].materialIndex=t}},r.GeometryUtils.random=r.Math.random16,r.GeometryUtils.__v1=new r.Vector3,r.GeometryUtils.__v2=new r.Vector3,r.ImageUtils={crossOrigin:"anonymous",loadTexture:function(e,t,i){var n=new Image,s=new r.Texture(n,t),o=new r.ImageLoader;return o.crossOrigin=this.crossOrigin,o.load(e,function(e){s.image=e,s.needsUpdate=!0,i&&i(s)}),s.sourceFile=e,s},loadCompressedTexture:function(e,t,i,n){var s=new r.CompressedTexture;s.mapping=t;var o=new XMLHttpRequest;return o.onload=function(){var e=o.response,t=r.ImageUtils.parseDDS(e,!0);s.format=t.format,s.mipmaps=t.mipmaps,s.image.width=t.width,s.image.height=t.height,s.generateMipmaps=!1,s.needsUpdate=!0,i&&i(s)},o.onerror=n,o.open("GET",e,!0),o.responseType="arraybuffer",o.send(null),s},loadTextureCube:function(e,t,i,n){var s=[];s.loadCount=0;var o=new r.Texture;o.image=s,void 0!==t&&(o.mapping=t),o.flipY=!1;for(var a=0,l=e.length;l>a;++a){var d=new Image;s[a]=d,d.onload=function(){s.loadCount+=1,6===s.loadCount&&(o.needsUpdate=!0,i&&i(o))},d.onerror=n,d.crossOrigin=this.crossOrigin,d.src=e[a]}return o},loadCompressedTextureCube:function(e,t,i,n){var s=[];s.loadCount=0;var o=new r.CompressedTexture;o.image=s,void 0!==t&&(o.mapping=t),o.flipY=!1,o.generateMipmaps=!1;var a=function(e,t){return function(){var n=e.response,a=r.ImageUtils.parseDDS(n,!0);t.format=a.format,t.mipmaps=a.mipmaps,t.width=a.width,t.height=a.height,s.loadCount+=1,6===s.loadCount&&(o.format=a.format,o.needsUpdate=!0,i&&i(o))}};if(e instanceof Array)for(var l=0,d=e.length;d>l;++l){var c={};s[l]=c;var h=new XMLHttpRequest;h.onload=a(h,c),h.onerror=n;var u=e[l];h.open("GET",u,!0),h.responseType="arraybuffer",h.send(null)}else{var u=e,h=new XMLHttpRequest;h.onload=function(){var e=h.response,t=r.ImageUtils.parseDDS(e,!0);if(t.isCubemap){for(var n=t.mipmaps.length/t.mipmapCount,a=0;n>a;a++){s[a]={mipmaps:[]};for(var l=0;t.mipmapCount>l;l++)s[a].mipmaps.push(t.mipmaps[a*t.mipmapCount+l]),s[a].format=t.format,s[a].width=t.width,s[a].height=t.height}o.format=t.format,o.needsUpdate=!0,i&&i(o)}},h.onerror=n,h.open("GET",u,!0),h.responseType="arraybuffer",h.send(null)}return o},parseDDS:function(e,t){function i(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}function n(e){return String.fromCharCode(255&e,255&e>>8,255&e>>16,255&e>>24)}var s={mipmaps:[],width:0,height:0,format:null,mipmapCount:1},o=542327876,a=131072,l=512,d=4,c=i("DXT1"),h=i("DXT3"),u=i("DXT5"),p=31,f=0,g=1,v=2,m=3,y=4,w=7,x=20,b=21,E=28,_=new Int32Array(e,0,p);if(_[f]!==o)return console.error("ImageUtils.parseDDS(): Invalid magic number in DDS header"),s;if(!_[x]&d)return console.error("ImageUtils.parseDDS(): Unsupported format, must contain a FourCC code"),s;var T,C=_[b];switch(C){case c:T=8,s.format=r.RGB_S3TC_DXT1_Format;break;case h:T=16,s.format=r.RGBA_S3TC_DXT3_Format;break;case u:T=16,s.format=r.RGBA_S3TC_DXT5_Format;break;default:return console.error("ImageUtils.parseDDS(): Unsupported FourCC code: ",n(C)),s}s.mipmapCount=1,_[v]&a&&t!==!1&&(s.mipmapCount=Math.max(1,_[w])),s.isCubemap=_[E]&l?!0:!1,s.width=_[y],s.height=_[m];for(var M=_[g]+4,S=s.width,A=s.height,R=s.isCubemap?6:1,U=0;R>U;U++){for(var D=0;s.mipmapCount>D;D++){var P=Math.max(4,S)/4*Math.max(4,A)/4*T,j=new Uint8Array(e,M,P),B={data:j,width:S,height:A};s.mipmaps.push(B),M+=P,S=Math.max(.5*S,1),A=Math.max(.5*A,1)}S=s.width,A=s.height}return s},getNormalMap:function(e,t){var i=function(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]},r=function(e,t){return[e[0]-t[0],e[1]-t[1],e[2]-t[2]]},n=function(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);return[e[0]/t,e[1]/t,e[2]/t]};t=1|t;var s=e.width,o=e.height,a=document.createElement("canvas");a.width=s,a.height=o;var l=a.getContext("2d");l.drawImage(e,0,0);for(var d=l.getImageData(0,0,s,o).data,c=l.createImageData(s,o),h=c.data,u=0;s>u;u++)for(var p=0;o>p;p++){var f=0>p-1?0:p-1,g=p+1>o-1?o-1:p+1,v=0>u-1?0:u-1,m=u+1>s-1?s-1:u+1,y=[],w=[0,0,d[4*(p*s+u)]/255*t];y.push([-1,0,d[4*(p*s+v)]/255*t]),y.push([-1,-1,d[4*(f*s+v)]/255*t]),y.push([0,-1,d[4*(f*s+u)]/255*t]),y.push([1,-1,d[4*(f*s+m)]/255*t]),y.push([1,0,d[4*(p*s+m)]/255*t]),y.push([1,1,d[4*(g*s+m)]/255*t]),y.push([0,1,d[4*(g*s+u)]/255*t]),y.push([-1,1,d[4*(g*s+v)]/255*t]);for(var x=[],b=y.length,E=0;b>E;E++){var _=y[E],T=y[(E+1)%b];_=r(_,w),T=r(T,w),x.push(n(i(_,T)))}for(var C=[0,0,0],E=0;x.length>E;E++)C[0]+=x[E][0],C[1]+=x[E][1],C[2]+=x[E][2];C[0]/=x.length,C[1]/=x.length,C[2]/=x.length;var M=4*(p*s+u);h[M]=0|255*((C[0]+1)/2),h[M+1]=0|255*((C[1]+1)/2),h[M+2]=0|255*C[2],h[M+3]=255}return l.putImageData(c,0,0),a},generateDataTexture:function(e,t,i){for(var n=e*t,s=new Uint8Array(3*n),o=Math.floor(255*i.r),a=Math.floor(255*i.g),l=Math.floor(255*i.b),d=0;n>d;d++)s[3*d]=o,s[3*d+1]=a,s[3*d+2]=l;var c=new r.DataTexture(s,e,t,r.RGBFormat);return c.needsUpdate=!0,c}},r.SceneUtils={createMultiMaterialObject:function(e,t){for(var i=new r.Object3D,n=0,s=t.length;s>n;n++)i.add(new r.Mesh(e,t[n]));return i},detach:function(e,t,i){e.applyMatrix(t.matrixWorld),t.remove(e),i.add(e)},attach:function(e,t,i){var n=new r.Matrix4;n.getInverse(i.matrixWorld),e.applyMatrix(n),t.remove(e),i.add(e)}},r.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},loadFace:function(e){var t=e.familyName.toLowerCase(),i=this;return i.faces[t]=i.faces[t]||{},i.faces[t][e.cssFontWeight]=i.faces[t][e.cssFontWeight]||{},i.faces[t][e.cssFontWeight][e.cssFontStyle]=e,i.faces[t][e.cssFontWeight][e.cssFontStyle]=e,e},drawText:function(e){var t,i=this.getFace(),n=this.size/i.resolution,s=0,o=(e+"").split(""),a=o.length,l=[];for(t=0;a>t;t++){var d=new r.Path,c=this.extractGlyphPoints(o[t],i,n,s,d);s+=c.offset,l.push(c.path)}var h=s/2;return{paths:l,offset:h}},extractGlyphPoints:function(e,t,i,n,s){var o,a,l,d,c,h,u,p,f,g,v,m,y,w,x,b,E,_,T,C=[],M=t.glyphs[e]||t.glyphs["?"];if(M){if(M.o)for(d=M._cachedOutline||(M._cachedOutline=M.o.split(" ")),h=d.length,u=i,p=i,o=0;h>o;)switch(c=d[o++]){case"m":f=d[o++]*u+n,g=d[o++]*p,s.moveTo(f,g);break;case"l":f=d[o++]*u+n,g=d[o++]*p,s.lineTo(f,g);break;case"q":if(v=d[o++]*u+n,m=d[o++]*p,x=d[o++]*u+n,b=d[o++]*p,s.quadraticCurveTo(x,b,v,m),T=C[C.length-1])for(y=T.x,w=T.y,a=1,l=this.divisions;l>=a;a++){var S=a/l;r.Shape.Utils.b2(S,y,x,v),r.Shape.Utils.b2(S,w,b,m)}break;case"b":if(v=d[o++]*u+n,m=d[o++]*p,x=d[o++]*u+n,b=d[o++]*-p,E=d[o++]*u+n,_=d[o++]*-p,s.bezierCurveTo(v,m,x,b,E,_),T=C[C.length-1])for(y=T.x,w=T.y,a=1,l=this.divisions;l>=a;a++){var S=a/l;r.Shape.Utils.b3(S,y,x,E,v),r.Shape.Utils.b3(S,w,b,_,m)}}return{offset:M.ha*i,path:s}}}},r.FontUtils.generateShapes=function(e,t){t=t||{};var i=void 0!==t.size?t.size:100,n=void 0!==t.curveSegments?t.curveSegments:4,s=void 0!==t.font?t.font:"helvetiker",o=void 0!==t.weight?t.weight:"normal",a=void 0!==t.style?t.style:"normal";r.FontUtils.size=i,r.FontUtils.divisions=n,r.FontUtils.face=s,r.FontUtils.weight=o,r.FontUtils.style=a;for(var l=r.FontUtils.drawText(e),d=l.paths,c=[],h=0,u=d.length;u>h;h++)Array.prototype.push.apply(c,d[h].toShapes());return c},function(e){var t=1e-10,i=function(e,t){var i=e.length;if(3>i)return null;var s,o,a,l=[],d=[],c=[];if(r(e)>0)for(o=0;i>o;o++)d[o]=o;else for(o=0;i>o;o++)d[o]=i-1-o;var h=i,u=2*h;for(o=h-1;h>2;){if(0>=u--)return console.log("Warning, unable to triangulate polygon!"),t?c:l;if(s=o,s>=h&&(s=0),o=s+1,o>=h&&(o=0),a=o+1,a>=h&&(a=0),n(e,s,o,a,h,d)){var p,f,g,v,m;for(p=d[s],f=d[o],g=d[a],l.push([e[p],e[f],e[g]]),c.push([d[s],d[o],d[a]]),v=o,m=o+1;h>m;v++,m++)d[v]=d[m];h--,u=2*h}}return t?c:l},r=function(e){for(var t=e.length,i=0,r=t-1,n=0;t>n;r=n++)i+=e[r].x*e[n].y-e[n].x*e[r].y;return.5*i},n=function(e,i,r,n,s,o){var a,l,d,c,h,u,p,f,g;if(l=e[o[i]].x,d=e[o[i]].y,c=e[o[r]].x,h=e[o[r]].y,u=e[o[n]].x,p=e[o[n]].y,t>(c-l)*(p-d)-(h-d)*(u-l))return!1;var v,m,y,w,x,b,E,_,T,C,M,S,A,R,U;for(v=u-c,m=p-h,y=l-u,w=d-p,x=c-l,b=h-d,a=0;s>a;a++)if(a!==i&&a!==r&&a!==n&&(f=e[o[a]].x,g=e[o[a]].y,E=f-l,_=g-d,T=f-c,C=g-h,M=f-u,S=g-p,U=v*C-m*T,A=x*_-b*E,R=y*S-w*M,U>=0&&R>=0&&A>=0))return!1;return!0};return e.Triangulate=i,e.Triangulate.area=r,e}(r.FontUtils),self._typeface_js={faces:r.FontUtils.faces,loadFace:r.FontUtils.loadFace},r.typeface_js=self._typeface_js,r.Curve=function(){},r.Curve.prototype.getPoint=function(){return console.log("Warning, getPoint() not implemented!"),null},r.Curve.prototype.getPointAt=function(e){var t=this.getUtoTmapping(e);return this.getPoint(t)},r.Curve.prototype.getPoints=function(e){e||(e=5);var t,i=[];for(t=0;e>=t;t++)i.push(this.getPoint(t/e));return i},r.Curve.prototype.getSpacedPoints=function(e){e||(e=5);var t,i=[];for(t=0;e>=t;t++)i.push(this.getPointAt(t/e));return i},r.Curve.prototype.getLength=function(){var e=this.getLengths();return e[e.length-1]},r.Curve.prototype.getLengths=function(e){if(e||(e=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length==e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,i,r=[],n=this.getPoint(0),s=0;for(r.push(0),i=1;e>=i;i++)t=this.getPoint(i/e),s+=t.distanceTo(n),r.push(s),n=t;return this.cacheArcLengths=r,r},r.Curve.prototype.updateArcLengths=function(){this.needsUpdate=!0,this.getLengths()},r.Curve.prototype.getUtoTmapping=function(e,t){var i,r=this.getLengths(),n=0,s=r.length;i=t?t:e*r[s-1];for(var o,a=0,l=s-1;l>=a;)if(n=Math.floor(a+(l-a)/2),o=r[n]-i,0>o)a=n+1;else{if(!(o>0)){l=n;break}l=n-1}if(n=l,r[n]==i){var d=n/(s-1);return d}var c=r[n],h=r[n+1],u=h-c,p=(i-c)/u,d=(n+p)/(s-1);return d},r.Curve.prototype.getTangent=function(e){var t=1e-4,i=e-t,r=e+t;0>i&&(i=0),r>1&&(r=1);var n=this.getPoint(i),s=this.getPoint(r),o=s.clone().sub(n);return o.normalize()},r.Curve.prototype.getTangentAt=function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},r.Curve.Utils={tangentQuadraticBezier:function(e,t,i,r){return 2*(1-e)*(i-t)+2*e*(r-i)},tangentCubicBezier:function(e,t,i,r,n){return-3*t*(1-e)*(1-e)+3*i*(1-e)*(1-e)-6*e*i*(1-e)+6*e*r*(1-e)-3*e*e*r+3*e*e*n},tangentSpline:function(e){var t=6*e*e-6*e,i=3*e*e-4*e+1,r=-6*e*e+6*e,n=3*e*e-2*e;return t+i+r+n},interpolate:function(e,t,i,r,n){var s=.5*(i-e),o=.5*(r-t),a=n*n,l=n*a;return(2*t-2*i+s+o)*l+(-3*t+3*i-2*s-o)*a+s*n+t}},r.Curve.create=function(e,t){return e.prototype=Object.create(r.Curve.prototype),e.prototype.getPoint=t,e},r.CurvePath=function(){this.curves=[],this.bends=[],this.autoClose=!1},r.CurvePath.prototype=Object.create(r.Curve.prototype),r.CurvePath.prototype.add=function(e){this.curves.push(e)},r.CurvePath.prototype.checkConnection=function(){},r.CurvePath.prototype.closePath=function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new r.LineCurve(t,e))},r.CurvePath.prototype.getPoint=function(e){for(var t,i,r=e*this.getLength(),n=this.getCurveLengths(),s=0;n.length>s;){if(n[s]>=r){t=n[s]-r,i=this.curves[s];var o=1-t/i.getLength();return i.getPointAt(o)}s++}return null},r.CurvePath.prototype.getLength=function(){var e=this.getCurveLengths();return e[e.length-1]},r.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var e,t=[],i=0,r=this.curves.length;for(e=0;r>e;e++)i+=this.curves[e].getLength(),t.push(i);return this.cacheLengths=t,t},r.CurvePath.prototype.getBoundingBox=function(){var e,t,i,n,s,o,a=this.getPoints();e=t=Number.NEGATIVE_INFINITY,n=s=Number.POSITIVE_INFINITY;var l,d,c,h,u=a[0]instanceof r.Vector3;for(h=u?new r.Vector3:new r.Vector2,d=0,c=a.length;c>d;d++)l=a[d],l.x>e?e=l.x:n>l.x&&(n=l.x),l.y>t?t=l.y:s>l.y&&(s=l.y),u&&(l.z>i?i=l.z:o>l.z&&(o=l.z)),h.add(l);var p={minX:n,minY:s,maxX:e,maxY:t,centroid:h.divideScalar(c)};return u&&(p.maxZ=i,p.minZ=o),p},r.CurvePath.prototype.createPointsGeometry=function(e){var t=this.getPoints(e,!0);return this.createGeometry(t)},r.CurvePath.prototype.createSpacedPointsGeometry=function(e){var t=this.getSpacedPoints(e,!0);return this.createGeometry(t)},r.CurvePath.prototype.createGeometry=function(e){for(var t=new r.Geometry,i=0;e.length>i;i++)t.vertices.push(new r.Vector3(e[i].x,e[i].y,e[i].z||0));return t},r.CurvePath.prototype.addWrapPath=function(e){this.bends.push(e)},r.CurvePath.prototype.getTransformedPoints=function(e,t){var i,r,n=this.getPoints(e);for(t||(t=this.bends),i=0,r=t.length;r>i;i++)n=this.getWrapPoints(n,t[i]);return n},r.CurvePath.prototype.getTransformedSpacedPoints=function(e,t){var i,r,n=this.getSpacedPoints(e);for(t||(t=this.bends),i=0,r=t.length;r>i;i++)n=this.getWrapPoints(n,t[i]);return n},r.CurvePath.prototype.getWrapPoints=function(e,t){var i,r,n,s,o,a,l=this.getBoundingBox();for(i=0,r=e.length;r>i;i++){n=e[i],s=n.x,o=n.y,a=s/l.maxX,a=t.getUtoTmapping(a,s);var d=t.getPoint(a),c=t.getNormalVector(a).multiplyScalar(o);n.x=d.x+c.x,n.y=d.y+c.y}return e},r.Gyroscope=function(){r.Object3D.call(this)},r.Gyroscope.prototype=Object.create(r.Object3D.prototype),r.Gyroscope.prototype.updateMatrixWorld=function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.parent?(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorld.decompose(this.translationWorld,this.rotationWorld,this.scaleWorld),this.matrix.decompose(this.translationObject,this.rotationObject,this.scaleObject),this.matrixWorld.makeFromPositionQuaternionScale(this.translationWorld,this.rotationObject,this.scaleWorld)):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=0,i=this.children.length;i>t;t++)this.children[t].updateMatrixWorld(e)},r.Gyroscope.prototype.translationWorld=new r.Vector3,r.Gyroscope.prototype.translationObject=new r.Vector3,r.Gyroscope.prototype.rotationWorld=new r.Quaternion,r.Gyroscope.prototype.rotationObject=new r.Quaternion,r.Gyroscope.prototype.scaleWorld=new r.Vector3,r.Gyroscope.prototype.scaleObject=new r.Vector3,r.Path=function(e){r.CurvePath.call(this),this.actions=[],e&&this.fromPoints(e)
},r.Path.prototype=Object.create(r.CurvePath.prototype),r.PathActions={MOVE_TO:"moveTo",LINE_TO:"lineTo",QUADRATIC_CURVE_TO:"quadraticCurveTo",BEZIER_CURVE_TO:"bezierCurveTo",CSPLINE_THRU:"splineThru",ARC:"arc",ELLIPSE:"ellipse"},r.Path.prototype.fromPoints=function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,i=e.length;i>t;t++)this.lineTo(e[t].x,e[t].y)},r.Path.prototype.moveTo=function(){var e=Array.prototype.slice.call(arguments);this.actions.push({action:r.PathActions.MOVE_TO,args:e})},r.Path.prototype.lineTo=function(e,t){var i=Array.prototype.slice.call(arguments),n=this.actions[this.actions.length-1].args,s=n[n.length-2],o=n[n.length-1],a=new r.LineCurve(new r.Vector2(s,o),new r.Vector2(e,t));this.curves.push(a),this.actions.push({action:r.PathActions.LINE_TO,args:i})},r.Path.prototype.quadraticCurveTo=function(e,t,i,n){var s=Array.prototype.slice.call(arguments),o=this.actions[this.actions.length-1].args,a=o[o.length-2],l=o[o.length-1],d=new r.QuadraticBezierCurve(new r.Vector2(a,l),new r.Vector2(e,t),new r.Vector2(i,n));this.curves.push(d),this.actions.push({action:r.PathActions.QUADRATIC_CURVE_TO,args:s})},r.Path.prototype.bezierCurveTo=function(e,t,i,n,s,o){var a=Array.prototype.slice.call(arguments),l=this.actions[this.actions.length-1].args,d=l[l.length-2],c=l[l.length-1],h=new r.CubicBezierCurve(new r.Vector2(d,c),new r.Vector2(e,t),new r.Vector2(i,n),new r.Vector2(s,o));this.curves.push(h),this.actions.push({action:r.PathActions.BEZIER_CURVE_TO,args:a})},r.Path.prototype.splineThru=function(e){var t=Array.prototype.slice.call(arguments),i=this.actions[this.actions.length-1].args,n=i[i.length-2],s=i[i.length-1],o=[new r.Vector2(n,s)];Array.prototype.push.apply(o,e);var a=new r.SplineCurve(o);this.curves.push(a),this.actions.push({action:r.PathActions.CSPLINE_THRU,args:t})},r.Path.prototype.arc=function(e,t,i,r,n,s){var o=this.actions[this.actions.length-1].args,a=o[o.length-2],l=o[o.length-1];this.absarc(e+a,t+l,i,r,n,s)},r.Path.prototype.absarc=function(e,t,i,r,n,s){this.absellipse(e,t,i,i,r,n,s)},r.Path.prototype.ellipse=function(e,t,i,r,n,s,o){var a=this.actions[this.actions.length-1].args,l=a[a.length-2],d=a[a.length-1];this.absellipse(e+l,t+d,i,r,n,s,o)},r.Path.prototype.absellipse=function(e,t,i,n,s,o,a){var l=Array.prototype.slice.call(arguments),d=new r.EllipseCurve(e,t,i,n,s,o,a);this.curves.push(d);var c=d.getPoint(a?1:0);l.push(c.x),l.push(c.y),this.actions.push({action:r.PathActions.ELLIPSE,args:l})},r.Path.prototype.getSpacedPoints=function(e){e||(e=40);for(var t=[],i=0;e>i;i++)t.push(this.getPoint(i/e));return t},r.Path.prototype.getPoints=function(e,t){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(e,t);e=e||12;var i,n,s,o,a,l,d,c,h,u,p,f,g,v,m,y,w,x,b=[];for(i=0,n=this.actions.length;n>i;i++)switch(s=this.actions[i],o=s.action,a=s.args,o){case r.PathActions.MOVE_TO:b.push(new r.Vector2(a[0],a[1]));break;case r.PathActions.LINE_TO:b.push(new r.Vector2(a[0],a[1]));break;case r.PathActions.QUADRATIC_CURVE_TO:for(l=a[2],d=a[3],u=a[0],p=a[1],b.length>0?(v=b[b.length-1],f=v.x,g=v.y):(v=this.actions[i-1].args,f=v[v.length-2],g=v[v.length-1]),m=1;e>=m;m++)y=m/e,w=r.Shape.Utils.b2(y,f,u,l),x=r.Shape.Utils.b2(y,g,p,d),b.push(new r.Vector2(w,x));break;case r.PathActions.BEZIER_CURVE_TO:for(l=a[4],d=a[5],u=a[0],p=a[1],c=a[2],h=a[3],b.length>0?(v=b[b.length-1],f=v.x,g=v.y):(v=this.actions[i-1].args,f=v[v.length-2],g=v[v.length-1]),m=1;e>=m;m++)y=m/e,w=r.Shape.Utils.b3(y,f,u,c,l),x=r.Shape.Utils.b3(y,g,p,h,d),b.push(new r.Vector2(w,x));break;case r.PathActions.CSPLINE_THRU:v=this.actions[i-1].args;var E=new r.Vector2(v[v.length-2],v[v.length-1]),_=[E],T=e*a[0].length;_=_.concat(a[0]);var C=new r.SplineCurve(_);for(m=1;T>=m;m++)b.push(C.getPointAt(m/T));break;case r.PathActions.ARC:var M,S=a[0],A=a[1],R=a[2],U=a[3],D=a[4],P=!!a[5],j=D-U,B=2*e;for(m=1;B>=m;m++)y=m/B,P||(y=1-y),M=U+y*j,w=S+R*Math.cos(M),x=A+R*Math.sin(M),b.push(new r.Vector2(w,x));break;case r.PathActions.ELLIPSE:var M,S=a[0],A=a[1],H=a[2],k=a[3],U=a[4],D=a[5],P=!!a[6],j=D-U,B=2*e;for(m=1;B>=m;m++)y=m/B,P||(y=1-y),M=U+y*j,w=S+H*Math.cos(M),x=A+k*Math.sin(M),b.push(new r.Vector2(w,x))}var L=b[b.length-1],I=1e-10;return I>Math.abs(L.x-b[0].x)&&I>Math.abs(L.y-b[0].y)&&b.splice(b.length-1,1),t&&b.push(b[0]),b},r.Path.prototype.toShapes=function(){var e,t,i,n,s,o=[],a=new r.Path;for(e=0,t=this.actions.length;t>e;e++)i=this.actions[e],s=i.args,n=i.action,n==r.PathActions.MOVE_TO&&0!=a.actions.length&&(o.push(a),a=new r.Path),a[n].apply(a,s);if(0!=a.actions.length&&o.push(a),0==o.length)return[];var l,d,c=[],h=!r.Shape.Utils.isClockWise(o[0].getPoints());if(1==o.length)return l=o[0],d=new r.Shape,d.actions=l.actions,d.curves=l.curves,c.push(d),c;if(h)for(d=new r.Shape,e=0,t=o.length;t>e;e++)l=o[e],r.Shape.Utils.isClockWise(l.getPoints())?(d.actions=l.actions,d.curves=l.curves,c.push(d),d=new r.Shape):d.holes.push(l);else{for(e=0,t=o.length;t>e;e++)l=o[e],r.Shape.Utils.isClockWise(l.getPoints())?(d&&c.push(d),d=new r.Shape,d.actions=l.actions,d.curves=l.curves):d.holes.push(l);c.push(d)}return c},r.Shape=function(){r.Path.apply(this,arguments),this.holes=[]},r.Shape.prototype=Object.create(r.Path.prototype),r.Shape.prototype.extrude=function(e){var t=new r.ExtrudeGeometry(this,e);return t},r.Shape.prototype.makeGeometry=function(e){var t=new r.ShapeGeometry(this,e);return t},r.Shape.prototype.getPointsHoles=function(e){var t,i=this.holes.length,r=[];for(t=0;i>t;t++)r[t]=this.holes[t].getTransformedPoints(e,this.bends);return r},r.Shape.prototype.getSpacedPointsHoles=function(e){var t,i=this.holes.length,r=[];for(t=0;i>t;t++)r[t]=this.holes[t].getTransformedSpacedPoints(e,this.bends);return r},r.Shape.prototype.extractAllPoints=function(e){return{shape:this.getTransformedPoints(e),holes:this.getPointsHoles(e)}},r.Shape.prototype.extractPoints=function(e){return this.useSpacedPoints?this.extractAllSpacedPoints(e):this.extractAllPoints(e)},r.Shape.prototype.extractAllSpacedPoints=function(e){return{shape:this.getTransformedSpacedPoints(e),holes:this.getSpacedPointsHoles(e)}},r.Shape.Utils={removeHoles:function(e,t){var i,n,s,o,a,l,d,c,h,u,p,f,g,v,m,y,w=e.concat(),x=w.concat(),b=[];for(a=0;t.length>a;a++){for(d=t[a],Array.prototype.push.apply(x,d),c=Number.POSITIVE_INFINITY,l=0;d.length>l;l++){p=d[l];var E=[];for(u=0;w.length>u;u++)f=w[u],h=p.distanceToSquared(f),E.push(h),c>h&&(c=h,s=l,o=u)}i=o-1>=0?o-1:w.length-1,n=s-1>=0?s-1:d.length-1;var _=[d[s],w[o],w[i]],T=r.FontUtils.Triangulate.area(_),C=[d[s],d[n],w[o]],M=r.FontUtils.Triangulate.area(C),S=1,A=-1,R=o,U=s;o+=S,s+=A,0>o&&(o+=w.length),o%=w.length,0>s&&(s+=d.length),s%=d.length,i=o-1>=0?o-1:w.length-1,n=s-1>=0?s-1:d.length-1,_=[d[s],w[o],w[i]];var D=r.FontUtils.Triangulate.area(_);C=[d[s],d[n],w[o]];var P=r.FontUtils.Triangulate.area(C);T+M>D+P&&(o=R,s=U,0>o&&(o+=w.length),o%=w.length,0>s&&(s+=d.length),s%=d.length,i=o-1>=0?o-1:w.length-1,n=s-1>=0?s-1:d.length-1),g=w.slice(0,o),v=w.slice(o),m=d.slice(s),y=d.slice(0,s);var j=[d[s],w[o],w[i]],B=[d[s],d[n],w[o]];b.push(j),b.push(B),w=g.concat(m).concat(y).concat(v)}return{shape:w,isolatedPts:b,allpoints:x}},triangulateShape:function(e,t){var i,n,s,o,a,l,d=r.Shape.Utils.removeHoles(e,t),c=d.shape,h=d.allpoints,u=d.isolatedPts,p=r.FontUtils.Triangulate(c,!1),f={};for(i=0,n=h.length;n>i;i++)a=h[i].x+":"+h[i].y,void 0!==f[a]&&console.log("Duplicate point",a),f[a]=i;for(i=0,n=p.length;n>i;i++)for(o=p[i],s=0;3>s;s++)a=o[s].x+":"+o[s].y,l=f[a],void 0!==l&&(o[s]=l);for(i=0,n=u.length;n>i;i++)for(o=u[i],s=0;3>s;s++)a=o[s].x+":"+o[s].y,l=f[a],void 0!==l&&(o[s]=l);return p.concat(u)},isClockWise:function(e){return 0>r.FontUtils.Triangulate.area(e)},b2p0:function(e,t){var i=1-e;return i*i*t},b2p1:function(e,t){return 2*(1-e)*e*t},b2p2:function(e,t){return e*e*t},b2:function(e,t,i,r){return this.b2p0(e,t)+this.b2p1(e,i)+this.b2p2(e,r)},b3p0:function(e,t){var i=1-e;return i*i*i*t},b3p1:function(e,t){var i=1-e;return 3*i*i*e*t},b3p2:function(e,t){var i=1-e;return 3*i*e*e*t},b3p3:function(e,t){return e*e*e*t},b3:function(e,t,i,r,n){return this.b3p0(e,t)+this.b3p1(e,i)+this.b3p2(e,r)+this.b3p3(e,n)}},r.LineCurve=function(e,t){this.v1=e,this.v2=t},r.LineCurve.prototype=Object.create(r.Curve.prototype),r.LineCurve.prototype.getPoint=function(e){var t=this.v2.clone().sub(this.v1);return t.multiplyScalar(e).add(this.v1),t},r.LineCurve.prototype.getPointAt=function(e){return this.getPoint(e)},r.LineCurve.prototype.getTangent=function(){var e=this.v2.clone().sub(this.v1);return e.normalize()},r.QuadraticBezierCurve=function(e,t,i){this.v0=e,this.v1=t,this.v2=i},r.QuadraticBezierCurve.prototype=Object.create(r.Curve.prototype),r.QuadraticBezierCurve.prototype.getPoint=function(e){var t,i;return t=r.Shape.Utils.b2(e,this.v0.x,this.v1.x,this.v2.x),i=r.Shape.Utils.b2(e,this.v0.y,this.v1.y,this.v2.y),new r.Vector2(t,i)},r.QuadraticBezierCurve.prototype.getTangent=function(e){var t,i;t=r.Curve.Utils.tangentQuadraticBezier(e,this.v0.x,this.v1.x,this.v2.x),i=r.Curve.Utils.tangentQuadraticBezier(e,this.v0.y,this.v1.y,this.v2.y);var n=new r.Vector2(t,i);return n.normalize(),n},r.CubicBezierCurve=function(e,t,i,r){this.v0=e,this.v1=t,this.v2=i,this.v3=r},r.CubicBezierCurve.prototype=Object.create(r.Curve.prototype),r.CubicBezierCurve.prototype.getPoint=function(e){var t,i;return t=r.Shape.Utils.b3(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),i=r.Shape.Utils.b3(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y),new r.Vector2(t,i)},r.CubicBezierCurve.prototype.getTangent=function(e){var t,i;t=r.Curve.Utils.tangentCubicBezier(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),i=r.Curve.Utils.tangentCubicBezier(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y);var n=new r.Vector2(t,i);return n.normalize(),n},r.SplineCurve=function(e){this.points=void 0==e?[]:e},r.SplineCurve.prototype=Object.create(r.Curve.prototype),r.SplineCurve.prototype.getPoint=function(e){var t,i,n,s=new r.Vector2,o=[],a=this.points;return t=(a.length-1)*e,i=Math.floor(t),n=t-i,o[0]=0==i?i:i-1,o[1]=i,o[2]=i>a.length-2?a.length-1:i+1,o[3]=i>a.length-3?a.length-1:i+2,s.x=r.Curve.Utils.interpolate(a[o[0]].x,a[o[1]].x,a[o[2]].x,a[o[3]].x,n),s.y=r.Curve.Utils.interpolate(a[o[0]].y,a[o[1]].y,a[o[2]].y,a[o[3]].y,n),s},r.EllipseCurve=function(e,t,i,r,n,s,o){this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=n,this.aEndAngle=s,this.aClockwise=o},r.EllipseCurve.prototype=Object.create(r.Curve.prototype),r.EllipseCurve.prototype.getPoint=function(e){var t=this.aEndAngle-this.aStartAngle;this.aClockwise||(e=1-e);var i=this.aStartAngle+e*t,n=this.aX+this.xRadius*Math.cos(i),s=this.aY+this.yRadius*Math.sin(i);return new r.Vector2(n,s)},r.ArcCurve=function(e,t,i,n,s,o){r.EllipseCurve.call(this,e,t,i,i,n,s,o)},r.ArcCurve.prototype=Object.create(r.EllipseCurve.prototype),r.LineCurve3=r.Curve.create(function(e,t){this.v1=e,this.v2=t},function(e){var t=new r.Vector3;return t.subVectors(this.v2,this.v1),t.multiplyScalar(e),t.add(this.v1),t}),r.QuadraticBezierCurve3=r.Curve.create(function(e,t,i){this.v0=e,this.v1=t,this.v2=i},function(e){var t,i,n;return t=r.Shape.Utils.b2(e,this.v0.x,this.v1.x,this.v2.x),i=r.Shape.Utils.b2(e,this.v0.y,this.v1.y,this.v2.y),n=r.Shape.Utils.b2(e,this.v0.z,this.v1.z,this.v2.z),new r.Vector3(t,i,n)}),r.CubicBezierCurve3=r.Curve.create(function(e,t,i,r){this.v0=e,this.v1=t,this.v2=i,this.v3=r},function(e){var t,i,n;return t=r.Shape.Utils.b3(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),i=r.Shape.Utils.b3(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y),n=r.Shape.Utils.b3(e,this.v0.z,this.v1.z,this.v2.z,this.v3.z),new r.Vector3(t,i,n)}),r.SplineCurve3=r.Curve.create(function(e){this.points=void 0==e?[]:e},function(e){var t,i,n,s=new r.Vector3,o=[],a=this.points;t=(a.length-1)*e,i=Math.floor(t),n=t-i,o[0]=0==i?i:i-1,o[1]=i,o[2]=i>a.length-2?a.length-1:i+1,o[3]=i>a.length-3?a.length-1:i+2;var l=a[o[0]],d=a[o[1]],c=a[o[2]],h=a[o[3]];return s.x=r.Curve.Utils.interpolate(l.x,d.x,c.x,h.x,n),s.y=r.Curve.Utils.interpolate(l.y,d.y,c.y,h.y,n),s.z=r.Curve.Utils.interpolate(l.z,d.z,c.z,h.z,n),s}),r.ClosedSplineCurve3=r.Curve.create(function(e){this.points=void 0==e?[]:e},function(e){var t,i,n,s=new r.Vector3,o=[],a=this.points;return t=(a.length-0)*e,i=Math.floor(t),n=t-i,i+=i>0?0:(Math.floor(Math.abs(i)/a.length)+1)*a.length,o[0]=(i-1)%a.length,o[1]=i%a.length,o[2]=(i+1)%a.length,o[3]=(i+2)%a.length,s.x=r.Curve.Utils.interpolate(a[o[0]].x,a[o[1]].x,a[o[2]].x,a[o[3]].x,n),s.y=r.Curve.Utils.interpolate(a[o[0]].y,a[o[1]].y,a[o[2]].y,a[o[3]].y,n),s.z=r.Curve.Utils.interpolate(a[o[0]].z,a[o[1]].z,a[o[2]].z,a[o[3]].z,n),s}),r.AnimationHandler=function(){var e=[],t={},i={};i.update=function(t){for(var i=0;e.length>i;i++)e[i].update(t)},i.addToUpdate=function(t){-1===e.indexOf(t)&&e.push(t)},i.removeFromUpdate=function(t){var i=e.indexOf(t);-1!==i&&e.splice(i,1)},i.add=function(e){void 0!==t[e.name]&&console.log("THREE.AnimationHandler.add: Warning! "+e.name+" already exists in library. Overwriting."),t[e.name]=e,s(e)},i.get=function(e){return"string"==typeof e?t[e]?t[e]:(console.log("THREE.AnimationHandler.get: Couldn't find animation "+e),null):void 0},i.parse=function(e){var t=[];if(e instanceof r.SkinnedMesh)for(var i=0;e.bones.length>i;i++)t.push(e.bones[i]);else n(e,t);return t};var n=function(e,t){t.push(e);for(var i=0;e.children.length>i;i++)n(e.children[i],t)},s=function(e){if(e.initialized!==!0){for(var t=0;e.hierarchy.length>t;t++){for(var i=0;e.hierarchy[t].keys.length>i;i++)if(0>e.hierarchy[t].keys[i].time&&(e.hierarchy[t].keys[i].time=0),void 0!==e.hierarchy[t].keys[i].rot&&!(e.hierarchy[t].keys[i].rot instanceof r.Quaternion)){var n=e.hierarchy[t].keys[i].rot;e.hierarchy[t].keys[i].rot=new r.Quaternion(n[0],n[1],n[2],n[3])}if(e.hierarchy[t].keys.length&&void 0!==e.hierarchy[t].keys[0].morphTargets){for(var s={},i=0;e.hierarchy[t].keys.length>i;i++)for(var o=0;e.hierarchy[t].keys[i].morphTargets.length>o;o++){var a=e.hierarchy[t].keys[i].morphTargets[o];s[a]=-1}e.hierarchy[t].usedMorphTargets=s;for(var i=0;e.hierarchy[t].keys.length>i;i++){var l={};for(var a in s){for(var o=0;e.hierarchy[t].keys[i].morphTargets.length>o;o++)if(e.hierarchy[t].keys[i].morphTargets[o]===a){l[a]=e.hierarchy[t].keys[i].morphTargetsInfluences[o];break}o===e.hierarchy[t].keys[i].morphTargets.length&&(l[a]=0)}e.hierarchy[t].keys[i].morphTargetsInfluences=l}}for(var i=1;e.hierarchy[t].keys.length>i;i++)e.hierarchy[t].keys[i].time===e.hierarchy[t].keys[i-1].time&&(e.hierarchy[t].keys.splice(i,1),i--);for(var i=0;e.hierarchy[t].keys.length>i;i++)e.hierarchy[t].keys[i].index=i}var d=parseInt(e.length*e.fps,10);e.JIT={},e.JIT.hierarchy=[];for(var t=0;e.hierarchy.length>t;t++)e.JIT.hierarchy.push(Array(d));e.initialized=!0}};return i.LINEAR=0,i.CATMULLROM=1,i.CATMULLROM_FORWARD=2,i}(),r.Animation=function(e,t,i){this.root=e,this.data=r.AnimationHandler.get(t),this.hierarchy=r.AnimationHandler.parse(e),this.currentTime=0,this.timeScale=1,this.isPlaying=!1,this.isPaused=!0,this.loop=!0,this.interpolationType=void 0!==i?i:r.AnimationHandler.LINEAR,this.points=[],this.target=new r.Vector3},r.Animation.prototype.play=function(e,t){if(this.isPlaying===!1){this.isPlaying=!0,this.loop=void 0!==e?e:!0,this.currentTime=void 0!==t?t:0;var i,n,s=this.hierarchy.length;for(i=0;s>i;i++){n=this.hierarchy[i],this.interpolationType!==r.AnimationHandler.CATMULLROM_FORWARD&&(n.useQuaternion=!0),n.matrixAutoUpdate=!0,void 0===n.animationCache&&(n.animationCache={},n.animationCache.prevKey={pos:0,rot:0,scl:0},n.animationCache.nextKey={pos:0,rot:0,scl:0},n.animationCache.originalMatrix=n instanceof r.Bone?n.skinMatrix:n.matrix);var o=n.animationCache.prevKey,a=n.animationCache.nextKey;o.pos=this.data.hierarchy[i].keys[0],o.rot=this.data.hierarchy[i].keys[0],o.scl=this.data.hierarchy[i].keys[0],a.pos=this.getNextKeyWith("pos",i,1),a.rot=this.getNextKeyWith("rot",i,1),a.scl=this.getNextKeyWith("scl",i,1)}this.update(0)}this.isPaused=!1,r.AnimationHandler.addToUpdate(this)},r.Animation.prototype.pause=function(){this.isPaused===!0?r.AnimationHandler.addToUpdate(this):r.AnimationHandler.removeFromUpdate(this),this.isPaused=!this.isPaused},r.Animation.prototype.stop=function(){this.isPlaying=!1,this.isPaused=!1,r.AnimationHandler.removeFromUpdate(this)},r.Animation.prototype.update=function(e){if(this.isPlaying!==!1){var t,i,n,s,o,a,l,d,c,h,u=["pos","rot","scl"];this.data.JIT.hierarchy;var p,f,g,v,m;this.currentTime+=e*this.timeScale,f=this.currentTime,p=this.currentTime=this.currentTime%this.data.length,h=parseInt(Math.min(p*this.data.fps,this.data.length*this.data.fps),10);for(var y=0,w=this.hierarchy.length;w>y;y++){d=this.hierarchy[y],c=d.animationCache;for(var x=0;3>x;x++){if(t=u[x],a=c.prevKey[t],l=c.nextKey[t],f>=l.time){if(f>p){if(!this.loop)return this.stop(),void 0;if(a=this.data.hierarchy[y].keys[0],l=this.getNextKeyWith(t,y,1),a!=l)for(;p>l.time;)a=l,l=this.getNextKeyWith(t,y,l.index+1)}else do a=l,l=this.getNextKeyWith(t,y,l.index+1);while(p>l.time&&a!=l);c.prevKey[t]=a,c.nextKey[t]=l}d.matrixAutoUpdate=!0,d.matrixWorldNeedsUpdate=!0,i=(p-a.time)/(l.time-a.time),s=a[t],o=l[t],(0>i||i>1)&&(console.log("THREE.Animation.update: Warning! Scale out of bounds:"+i+" on bone "+y),i=0>i?0:1),"pos"===t?(n=d.position,this.interpolationType===r.AnimationHandler.LINEAR?(n.x=s[0]+(o[0]-s[0])*i,n.y=s[1]+(o[1]-s[1])*i,n.z=s[2]+(o[2]-s[2])*i):(this.interpolationType===r.AnimationHandler.CATMULLROM||this.interpolationType===r.AnimationHandler.CATMULLROM_FORWARD)&&(this.points[0]=this.getPrevKeyWith("pos",y,a.index-1).pos,this.points[1]=s,this.points[2]=o,this.points[3]=this.getNextKeyWith("pos",y,l.index+1).pos,i=.33*i+.33,g=this.interpolateCatmullRom(this.points,i),n.x=g[0],n.y=g[1],n.z=g[2],this.interpolationType===r.AnimationHandler.CATMULLROM_FORWARD&&(v=this.interpolateCatmullRom(this.points,1.01*i),this.target.set(v[0],v[1],v[2]),this.target.sub(n),this.target.y=0,this.target.normalize(),m=Math.atan2(this.target.x,this.target.z),d.rotation.set(0,m,0)))):"rot"===t?r.Quaternion.slerp(s,o,d.quaternion,i):"scl"===t&&(n=d.scale,n.x=s[0]+(o[0]-s[0])*i,n.y=s[1]+(o[1]-s[1])*i,n.z=s[2]+(o[2]-s[2])*i)}}}},r.Animation.prototype.interpolateCatmullRom=function(e,t){var i,r,n,s,o,a,l,d,c,h=[],u=[];return i=(e.length-1)*t,r=Math.floor(i),n=i-r,h[0]=0===r?r:r-1,h[1]=r,h[2]=r>e.length-2?r:r+1,h[3]=r>e.length-3?r:r+2,a=e[h[0]],l=e[h[1]],d=e[h[2]],c=e[h[3]],s=n*n,o=n*s,u[0]=this.interpolate(a[0],l[0],d[0],c[0],n,s,o),u[1]=this.interpolate(a[1],l[1],d[1],c[1],n,s,o),u[2]=this.interpolate(a[2],l[2],d[2],c[2],n,s,o),u},r.Animation.prototype.interpolate=function(e,t,i,r,n,s,o){var a=.5*(i-e),l=.5*(r-t);return(2*(t-i)+a+l)*o+(-3*(t-i)-2*a-l)*s+a*n+t},r.Animation.prototype.getNextKeyWith=function(e,t,i){var n=this.data.hierarchy[t].keys;for(this.interpolationType===r.AnimationHandler.CATMULLROM||this.interpolationType===r.AnimationHandler.CATMULLROM_FORWARD?i=n.length-1>i?i:n.length-1:i%=n.length;n.length>i;i++)if(void 0!==n[i][e])return n[i];return this.data.hierarchy[t].keys[0]},r.Animation.prototype.getPrevKeyWith=function(e,t,i){var n=this.data.hierarchy[t].keys;for(i=this.interpolationType===r.AnimationHandler.CATMULLROM||this.interpolationType===r.AnimationHandler.CATMULLROM_FORWARD?i>0?i:0:i>=0?i:i+n.length;i>=0;i--)if(void 0!==n[i][e])return n[i];return this.data.hierarchy[t].keys[n.length-1]},r.KeyFrameAnimation=function(e,t,i){this.root=e,this.data=r.AnimationHandler.get(t),this.hierarchy=r.AnimationHandler.parse(e),this.currentTime=0,this.timeScale=.001,this.isPlaying=!1,this.isPaused=!0,this.loop=!0,this.JITCompile=void 0!==i?i:!0;for(var n=0,s=this.hierarchy.length;s>n;n++){var o=this.data.hierarchy[n].keys,a=this.data.hierarchy[n].sids,l=this.hierarchy[n];if(o.length&&a){for(var d=0;a.length>d;d++){var c=a[d],h=this.getNextKeyWith(c,n,0);h&&h.apply(c)}l.matrixAutoUpdate=!1,this.data.hierarchy[n].node.updateMatrix(),l.matrixWorldNeedsUpdate=!0}}},r.KeyFrameAnimation.prototype.play=function(e,t){if(!this.isPlaying){this.isPlaying=!0,this.loop=void 0!==e?e:!0,this.currentTime=void 0!==t?t:0,this.startTimeMs=t,this.startTime=1e7,this.endTime=-this.startTime;var i,n,s,o=this.hierarchy.length;for(i=0;o>i;i++){n=this.hierarchy[i],s=this.data.hierarchy[i],n.useQuaternion=!0,void 0===s.animationCache&&(s.animationCache={},s.animationCache.prevKey=null,s.animationCache.nextKey=null,s.animationCache.originalMatrix=n instanceof r.Bone?n.skinMatrix:n.matrix);var a=this.data.hierarchy[i].keys;a.length&&(s.animationCache.prevKey=a[0],s.animationCache.nextKey=a[1],this.startTime=Math.min(a[0].time,this.startTime),this.endTime=Math.max(a[a.length-1].time,this.endTime))}this.update(0)}this.isPaused=!1,r.AnimationHandler.addToUpdate(this)},r.KeyFrameAnimation.prototype.pause=function(){this.isPaused?r.AnimationHandler.addToUpdate(this):r.AnimationHandler.removeFromUpdate(this),this.isPaused=!this.isPaused},r.KeyFrameAnimation.prototype.stop=function(){this.isPlaying=!1,this.isPaused=!1,r.AnimationHandler.removeFromUpdate(this);for(var e=0;this.data.hierarchy.length>e;e++){var t=this.hierarchy[e],i=this.data.hierarchy[e];if(void 0!==i.animationCache){var n=i.animationCache.originalMatrix;t instanceof r.Bone?(n.copy(t.skinMatrix),t.skinMatrix=n):(n.copy(t.matrix),t.matrix=n),delete i.animationCache}}},r.KeyFrameAnimation.prototype.update=function(e){if(this.isPlaying){var t,i,n,s,o,a,l,d,c=this.data.JIT.hierarchy;if(this.currentTime+=e*this.timeScale,l=this.currentTime,a=this.currentTime=this.currentTime%this.data.length,this.startTimeMs>a&&(a=this.currentTime=this.startTimeMs+a),o=parseInt(Math.min(a*this.data.fps,this.data.length*this.data.fps),10),d=l>a,d&&!this.loop){for(var h=0,u=this.hierarchy.length;u>h;h++){var p=this.data.hierarchy[h].keys,f=this.data.hierarchy[h].sids,g=p.length-1,v=this.hierarchy[h];if(p.length){for(var m=0;f.length>m;m++){var y=f[m],w=this.getPrevKeyWith(y,h,g);w&&w.apply(y)}this.data.hierarchy[h].node.updateMatrix(),v.matrixWorldNeedsUpdate=!0}}return this.stop(),void 0}if(!(this.startTime>a)){for(var h=0,u=this.hierarchy.length;u>h;h++){n=this.hierarchy[h],s=this.data.hierarchy[h];var p=s.keys,x=s.animationCache;if(this.JITCompile&&void 0!==c[h][o])n instanceof r.Bone?(n.skinMatrix=c[h][o],n.matrixWorldNeedsUpdate=!1):(n.matrix=c[h][o],n.matrixWorldNeedsUpdate=!0);else if(p.length){if(this.JITCompile&&x&&(n instanceof r.Bone?n.skinMatrix=x.originalMatrix:n.matrix=x.originalMatrix),t=x.prevKey,i=x.nextKey,t&&i){if(l>=i.time){if(d&&this.loop)for(t=p[0],i=p[1];a>i.time;)t=i,i=p[t.index+1];else if(!d)for(var b=p.length-1;a>i.time&&i.index!==b;)t=i,i=p[t.index+1];x.prevKey=t,x.nextKey=i}i.time>=a?t.interpolate(i,a):t.interpolate(i,i.time)}this.data.hierarchy[h].node.updateMatrix(),n.matrixWorldNeedsUpdate=!0}}if(this.JITCompile&&void 0===c[0][o]){this.hierarchy[0].updateMatrixWorld(!0);for(var h=0;this.hierarchy.length>h;h++)c[h][o]=this.hierarchy[h]instanceof r.Bone?this.hierarchy[h].skinMatrix.clone():this.hierarchy[h].matrix.clone()}}}},r.KeyFrameAnimation.prototype.getNextKeyWith=function(e,t,i){var r=this.data.hierarchy[t].keys;for(i%=r.length;r.length>i;i++)if(r[i].hasTarget(e))return r[i];return r[0]},r.KeyFrameAnimation.prototype.getPrevKeyWith=function(e,t,i){var r=this.data.hierarchy[t].keys;for(i=i>=0?i:i+r.length;i>=0;i--)if(r[i].hasTarget(e))return r[i];return r[r.length-1]},r.CubeCamera=function(e,t,i){r.Object3D.call(this);var n=90,s=1,o=new r.PerspectiveCamera(n,s,e,t);o.up.set(0,-1,0),o.lookAt(new r.Vector3(1,0,0)),this.add(o);var a=new r.PerspectiveCamera(n,s,e,t);a.up.set(0,-1,0),a.lookAt(new r.Vector3(-1,0,0)),this.add(a);var l=new r.PerspectiveCamera(n,s,e,t);l.up.set(0,0,1),l.lookAt(new r.Vector3(0,1,0)),this.add(l);var d=new r.PerspectiveCamera(n,s,e,t);d.up.set(0,0,-1),d.lookAt(new r.Vector3(0,-1,0)),this.add(d);var c=new r.PerspectiveCamera(n,s,e,t);c.up.set(0,-1,0),c.lookAt(new r.Vector3(0,0,1)),this.add(c);var h=new r.PerspectiveCamera(n,s,e,t);h.up.set(0,-1,0),h.lookAt(new r.Vector3(0,0,-1)),this.add(h),this.renderTarget=new r.WebGLRenderTargetCube(i,i,{format:r.RGBFormat,magFilter:r.LinearFilter,minFilter:r.LinearFilter}),this.updateCubeMap=function(e,t){var i=this.renderTarget,r=i.generateMipmaps;i.generateMipmaps=!1,i.activeCubeFace=0,e.render(t,o,i),i.activeCubeFace=1,e.render(t,a,i),i.activeCubeFace=2,e.render(t,l,i),i.activeCubeFace=3,e.render(t,d,i),i.activeCubeFace=4,e.render(t,c,i),i.generateMipmaps=r,i.activeCubeFace=5,e.render(t,h,i)}},r.CubeCamera.prototype=Object.create(r.Object3D.prototype),r.CombinedCamera=function(e,t,i,n,s,o,a){r.Camera.call(this),this.fov=i,this.left=-e/2,this.right=e/2,this.top=t/2,this.bottom=-t/2,this.cameraO=new r.OrthographicCamera(e/-2,e/2,t/2,t/-2,o,a),this.cameraP=new r.PerspectiveCamera(i,e/t,n,s),this.zoom=1,this.toPerspective()},r.CombinedCamera.prototype=Object.create(r.Camera.prototype),r.CombinedCamera.prototype.toPerspective=function(){this.near=this.cameraP.near,this.far=this.cameraP.far,this.cameraP.fov=this.fov/this.zoom,this.cameraP.updateProjectionMatrix(),this.projectionMatrix=this.cameraP.projectionMatrix,this.inPerspectiveMode=!0,this.inOrthographicMode=!1},r.CombinedCamera.prototype.toOrthographic=function(){var e=this.fov,t=this.cameraP.aspect,i=this.cameraP.near,r=this.cameraP.far,n=(i+r)/2,s=Math.tan(e/2)*n,o=2*s,a=o*t,l=a/2;s/=this.zoom,l/=this.zoom,this.cameraO.left=-l,this.cameraO.right=l,this.cameraO.top=s,this.cameraO.bottom=-s,this.cameraO.updateProjectionMatrix(),this.near=this.cameraO.near,this.far=this.cameraO.far,this.projectionMatrix=this.cameraO.projectionMatrix,this.inPerspectiveMode=!1,this.inOrthographicMode=!0},r.CombinedCamera.prototype.setSize=function(e,t){this.cameraP.aspect=e/t,this.left=-e/2,this.right=e/2,this.top=t/2,this.bottom=-t/2},r.CombinedCamera.prototype.setFov=function(e){this.fov=e,this.inPerspectiveMode?this.toPerspective():this.toOrthographic()},r.CombinedCamera.prototype.updateProjectionMatrix=function(){this.inPerspectiveMode?this.toPerspective():(this.toPerspective(),this.toOrthographic())},r.CombinedCamera.prototype.setLens=function(e,t){void 0===t&&(t=24);var i=2*r.Math.radToDeg(Math.atan(t/(2*e)));return this.setFov(i),i},r.CombinedCamera.prototype.setZoom=function(e){this.zoom=e,this.inPerspectiveMode?this.toPerspective():this.toOrthographic()},r.CombinedCamera.prototype.toFrontView=function(){this.rotation.x=0,this.rotation.y=0,this.rotation.z=0,this.rotationAutoUpdate=!1},r.CombinedCamera.prototype.toBackView=function(){this.rotation.x=0,this.rotation.y=Math.PI,this.rotation.z=0,this.rotationAutoUpdate=!1},r.CombinedCamera.prototype.toLeftView=function(){this.rotation.x=0,this.rotation.y=-Math.PI/2,this.rotation.z=0,this.rotationAutoUpdate=!1},r.CombinedCamera.prototype.toRightView=function(){this.rotation.x=0,this.rotation.y=Math.PI/2,this.rotation.z=0,this.rotationAutoUpdate=!1},r.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2,this.rotation.y=0,this.rotation.z=0,this.rotationAutoUpdate=!1},r.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2,this.rotation.y=0,this.rotation.z=0,this.rotationAutoUpdate=!1},r.CircleGeometry=function(e,t,i,n,s){r.Geometry.call(this),e=e||50,i=void 0!==i?i:0,n=void 0!==n?n:2*Math.PI,t=void 0!==t?Math.max(3,t):8,s=void 0!==s?s:0,s>=e&&(console.warn("CircleGeometry: Can't set the innerRadius to be greater than the radius."),s=0);var o,a,l=[];if(!s){a=new r.Vector3;var d=new r.Vector2(.5,.5);this.vertices.push(a),l.push(d)}for(o=0;t>=o;o++){var c;s&&(c=new r.Vector3,c.x=s*Math.cos(i+o/t*n),c.y=s*Math.sin(i+o/t*n),this.vertices.push(c),l.push(new r.Vector2((c.x/e+1)/2,(c.y/e+1)/2))),c=new r.Vector3,c.x=e*Math.cos(i+o/t*n),c.y=e*Math.sin(i+o/t*n),this.vertices.push(c),l.push(new r.Vector2((c.x/e+1)/2,(c.y/e+1)/2))}var h=new r.Vector3(0,0,-1);for(o=1;t>=o;o++)if(s){var u=2*(o-1)+1,p=2*(o-1),f=2*o+1,g=2*o;this.faces.push(new r.Face3(u,p,f,[h,h,h])),this.faces.push(new r.Face3(p,g,f,[h,h,h])),this.faceVertexUvs[0].push([l[u],l[p],l[f]]),this.faceVertexUvs[0].push([l[p],l[g],l[f]])}else{var u=o,p=o+1,f=0;this.faces.push(new r.Face3(u,p,f,[h,h,h])),this.faceVertexUvs[0].push([l[o],l[o+1],d])}this.computeCentroids(),this.computeFaceNormals(),this.boundingSphere=new r.Sphere(new r.Vector3,e)},r.CircleGeometry.prototype=Object.create(r.Geometry.prototype),r.CubeGeometry=function(e,t,i,n,s,o){function a(e,t,i,n,s,o,a,d){var c,h,u,p=l.widthSegments,f=l.heightSegments,g=s/2,v=o/2,m=l.vertices.length;"x"===e&&"y"===t||"y"===e&&"x"===t?c="z":"x"===e&&"z"===t||"z"===e&&"x"===t?(c="y",f=l.depthSegments):("z"===e&&"y"===t||"y"===e&&"z"===t)&&(c="x",p=l.depthSegments);var y=p+1,w=f+1,x=s/p,b=o/f,E=new r.Vector3;for(E[c]=a>0?1:-1,u=0;w>u;u++)for(h=0;y>h;h++){var _=new r.Vector3;_[e]=(h*x-g)*i,_[t]=(u*b-v)*n,_[c]=a,l.vertices.push(_)}for(u=0;f>u;u++)for(h=0;p>h;h++){var T=h+y*u,C=h+y*(u+1),M=h+1+y*(u+1),S=h+1+y*u,A=new r.Face4(T+m,C+m,M+m,S+m);A.normal.copy(E),A.vertexNormals.push(E.clone(),E.clone(),E.clone(),E.clone()),A.materialIndex=d,l.faces.push(A),l.faceVertexUvs[0].push([new r.Vector2(h/p,1-u/f),new r.Vector2(h/p,1-(u+1)/f),new r.Vector2((h+1)/p,1-(u+1)/f),new r.Vector2((h+1)/p,1-u/f)])}}r.Geometry.call(this);var l=this;this.width=e,this.height=t,this.depth=i,this.widthSegments=n||1,this.heightSegments=s||1,this.depthSegments=o||1;var d=this.width/2,c=this.height/2,h=this.depth/2;a("z","y",-1,-1,this.depth,this.height,d,0),a("z","y",1,-1,this.depth,this.height,-d,1),a("x","z",1,1,this.width,this.depth,c,2),a("x","z",1,-1,this.width,this.depth,-c,3),a("x","y",1,-1,this.width,this.height,h,4),a("x","y",-1,-1,this.width,this.height,-h,5),this.computeCentroids(),this.mergeVertices()},r.CubeGeometry.prototype=Object.create(r.Geometry.prototype),r.CylinderGeometry=function(e,t,i,n,s,o){r.Geometry.call(this),this.radiusTop=e=void 0!==e?e:20,this.radiusBottom=t=void 0!==t?t:20,this.height=i=void 0!==i?i:100,this.radialSegments=n=n||8,this.heightSegments=s=s||1,this.openEnded=o=void 0!==o?o:!1;var a,l,d=i/2,c=[],h=[];for(l=0;s>=l;l++){var u=[],p=[],f=l/s,g=f*(t-e)+e;for(a=0;n>=a;a++){var v=a/n,m=new r.Vector3;m.x=g*Math.sin(2*v*Math.PI),m.y=-f*i+d,m.z=g*Math.cos(2*v*Math.PI),this.vertices.push(m),u.push(this.vertices.length-1),p.push(new r.Vector2(v,1-f))}c.push(u),h.push(p)}var y,w,x=(t-e)/i;for(a=0;n>a;a++)for(0!==e?(y=this.vertices[c[0][a]].clone(),w=this.vertices[c[0][a+1]].clone()):(y=this.vertices[c[1][a]].clone(),w=this.vertices[c[1][a+1]].clone()),y.setY(Math.sqrt(y.x*y.x+y.z*y.z)*x).normalize(),w.setY(Math.sqrt(w.x*w.x+w.z*w.z)*x).normalize(),l=0;s>l;l++){var b=c[l][a],E=c[l+1][a],_=c[l+1][a+1],T=c[l][a+1],C=y.clone(),M=y.clone(),S=w.clone(),A=w.clone(),R=h[l][a].clone(),U=h[l+1][a].clone(),D=h[l+1][a+1].clone(),P=h[l][a+1].clone();this.faces.push(new r.Face4(b,E,_,T,[C,M,S,A])),this.faceVertexUvs[0].push([R,U,D,P])}if(o===!1&&e>0)for(this.vertices.push(new r.Vector3(0,d,0)),a=0;n>a;a++){var b=c[0][a],E=c[0][a+1],_=this.vertices.length-1,C=new r.Vector3(0,1,0),M=new r.Vector3(0,1,0),S=new r.Vector3(0,1,0),R=h[0][a].clone(),U=h[0][a+1].clone(),D=new r.Vector2(U.u,0);this.faces.push(new r.Face3(b,E,_,[C,M,S])),this.faceVertexUvs[0].push([R,U,D])}if(o===!1&&t>0)for(this.vertices.push(new r.Vector3(0,-d,0)),a=0;n>a;a++){var b=c[l][a+1],E=c[l][a],_=this.vertices.length-1,C=new r.Vector3(0,-1,0),M=new r.Vector3(0,-1,0),S=new r.Vector3(0,-1,0),R=h[l][a+1].clone(),U=h[l][a].clone(),D=new r.Vector2(U.u,1);this.faces.push(new r.Face3(b,E,_,[C,M,S])),this.faceVertexUvs[0].push([R,U,D])}this.computeCentroids(),this.computeFaceNormals()},r.CylinderGeometry.prototype=Object.create(r.Geometry.prototype),r.ExtrudeGeometry=function(e,t){return e===void 0?(e=[],void 0):(r.Geometry.call(this),e=e instanceof Array?e:[e],this.shapebb=e[e.length-1].getBoundingBox(),this.addShapeList(e,t),this.computeCentroids(),this.computeFaceNormals(),void 0)},r.ExtrudeGeometry.prototype=Object.create(r.Geometry.prototype),r.ExtrudeGeometry.prototype.addShapeList=function(e,t){for(var i=e.length,r=0;i>r;r++){var n=e[r];this.addShape(n,t)}},r.ExtrudeGeometry.prototype.addShape=function(e,t){function i(e,t,i){return t||console.log("die"),t.clone().multiplyScalar(i).add(e)
}function n(e,t,i){return o(e,t,i)}function s(e,t,i){var n=Math.atan2(t.y-e.y,t.x-e.x),s=Math.atan2(i.y-e.y,i.x-e.x);n>s&&(s+=2*Math.PI);var o=(n+s)/2,a=-Math.cos(o),l=-Math.sin(o),d=new r.Vector2(a,l);return d}function o(e,t,i){var n,o,a,l,d,c,h=r.ExtrudeGeometry.__v1,u=r.ExtrudeGeometry.__v2,p=r.ExtrudeGeometry.__v3,f=r.ExtrudeGeometry.__v4,g=r.ExtrudeGeometry.__v5,v=r.ExtrudeGeometry.__v6;return h.set(e.x-t.x,e.y-t.y),u.set(e.x-i.x,e.y-i.y),n=h.normalize(),o=u.normalize(),p.set(-n.y,n.x),f.set(o.y,-o.x),g.copy(e).add(p),v.copy(e).add(f),g.equals(v)?f.clone():(g.copy(t).add(p),v.copy(i).add(f),a=n.dot(f),l=v.sub(g).dot(f),0===a&&(console.log("Either infinite or no solutions!"),0===l?console.log("Its finite solutions."):console.log("Too bad, no solutions.")),d=l/a,0>d?s(e,t,i):(c=n.multiplyScalar(d).add(g),c.sub(e).clone()))}function a(){if(y){var e=0,t=q*e;for(K=0;$>K;K++)X=N[K],h(X[2]+t,X[1]+t,X[0]+t,!0);for(e=x+2*m,t=q*e,K=0;$>K;K++)X=N[K],h(X[0]+t,X[1]+t,X[2]+t,!1)}else{for(K=0;$>K;K++)X=N[K],h(X[2],X[1],X[0],!0);for(K=0;$>K;K++)X=N[K],h(X[0]+q*x,X[1]+q*x,X[2]+q*x,!1)}}function l(){var e=0;for(d(F,e),e+=F.length,D=0,P=L.length;P>D;D++)U=L[D],d(U,e),e+=U.length}function d(e,t){var i,r;for(K=e.length;--K>=0;){i=K,r=K-1,0>r&&(r=e.length-1);var n=0,s=x+2*m;for(n=0;s>n;n++){var o=q*n,a=q*(n+1),l=t+i+o,d=t+r+o,c=t+r+a,h=t+i+a;u(l,d,c,h,e,n,s,i,r)}}}function c(e,t,i){j.vertices.push(new r.Vector3(e,t,i))}function h(i,n,s,o){i+=B,n+=B,s+=B,j.faces.push(new r.Face3(i,n,s,null,null,_));var a=o?C.generateBottomUV(j,e,t,i,n,s):C.generateTopUV(j,e,t,i,n,s);j.faceVertexUvs[0].push(a)}function u(i,n,s,o,a,l,d,c,h){i+=B,n+=B,s+=B,o+=B,j.faces.push(new r.Face4(i,n,s,o,null,null,T));var u=C.generateSideWallUV(j,e,a,t,i,n,s,o,l,d,c,h);j.faceVertexUvs[0].push(u)}var p,f=void 0!==t.amount?t.amount:100,g=void 0!==t.bevelThickness?t.bevelThickness:6,v=void 0!==t.bevelSize?t.bevelSize:g-2,m=void 0!==t.bevelSegments?t.bevelSegments:3,y=void 0!==t.bevelEnabled?t.bevelEnabled:!0,w=void 0!==t.curveSegments?t.curveSegments:12,x=void 0!==t.steps?t.steps:1,b=t.extrudePath,E=!1,_=t.material,T=t.extrudeMaterial,C=void 0!==t.UVGenerator?t.UVGenerator:r.ExtrudeGeometry.WorldUVGenerator;this.shapebb;var M,S,A,R;b&&(p=b.getSpacedPoints(x),E=!0,y=!1,M=void 0!==t.frames?t.frames:new r.TubeGeometry.FrenetFrames(b,x,!1),S=new r.Vector3,A=new r.Vector3,R=new r.Vector3),y||(m=0,g=0,v=0);var U,D,P,j=this,B=this.vertices.length,H=e.extractPoints(w),k=H.shape,L=H.holes,I=!r.Shape.Utils.isClockWise(k);if(I){for(k=k.reverse(),D=0,P=L.length;P>D;D++)U=L[D],r.Shape.Utils.isClockWise(U)&&(L[D]=U.reverse());I=!1}var N=r.Shape.Utils.triangulateShape(k,L),F=k;for(D=0,P=L.length;P>D;D++)U=L[D],k=k.concat(U);var O,z,V,W,G,X,q=k.length,$=N.length;F.length,180/Math.PI;for(var Y=[],K=0,J=F.length,Q=J-1,Z=K+1;J>K;K++,Q++,Z++)Q===J&&(Q=0),Z===J&&(Z=0),F[K],F[Q],F[Z],Y[K]=n(F[K],F[Q],F[Z]);var et,tt=[],it=Y.concat();for(D=0,P=L.length;P>D;D++){for(U=L[D],et=[],K=0,J=U.length,Q=J-1,Z=K+1;J>K;K++,Q++,Z++)Q===J&&(Q=0),Z===J&&(Z=0),et[K]=n(U[K],U[Q],U[Z]);tt.push(et),it=it.concat(et)}for(O=0;m>O;O++){for(V=O/m,W=g*(1-V),z=v*Math.sin(V*Math.PI/2),K=0,J=F.length;J>K;K++)G=i(F[K],Y[K],z),c(G.x,G.y,-W);for(D=0,P=L.length;P>D;D++)for(U=L[D],et=tt[D],K=0,J=U.length;J>K;K++)G=i(U[K],et[K],z),c(G.x,G.y,-W)}for(z=v,K=0;q>K;K++)G=y?i(k[K],it[K],z):k[K],E?(A.copy(M.normals[0]).multiplyScalar(G.x),S.copy(M.binormals[0]).multiplyScalar(G.y),R.copy(p[0]).add(A).add(S),c(R.x,R.y,R.z)):c(G.x,G.y,0);var rt;for(rt=1;x>=rt;rt++)for(K=0;q>K;K++)G=y?i(k[K],it[K],z):k[K],E?(A.copy(M.normals[rt]).multiplyScalar(G.x),S.copy(M.binormals[rt]).multiplyScalar(G.y),R.copy(p[rt]).add(A).add(S),c(R.x,R.y,R.z)):c(G.x,G.y,f/x*rt);for(O=m-1;O>=0;O--){for(V=O/m,W=g*(1-V),z=v*Math.sin(V*Math.PI/2),K=0,J=F.length;J>K;K++)G=i(F[K],Y[K],z),c(G.x,G.y,f+W);for(D=0,P=L.length;P>D;D++)for(U=L[D],et=tt[D],K=0,J=U.length;J>K;K++)G=i(U[K],et[K],z),E?c(G.x,G.y+p[x-1].y,p[x-1].x+W):c(G.x,G.y,f+W)}a(),l()},r.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(e,t,i,n,s,o){var a=e.vertices[n].x,l=e.vertices[n].y,d=e.vertices[s].x,c=e.vertices[s].y,h=e.vertices[o].x,u=e.vertices[o].y;return[new r.Vector2(a,l),new r.Vector2(d,c),new r.Vector2(h,u)]},generateBottomUV:function(e,t,i,r,n,s){return this.generateTopUV(e,t,i,r,n,s)},generateSideWallUV:function(e,t,i,n,s,o,a,l){var d=e.vertices[s].x,c=e.vertices[s].y,h=e.vertices[s].z,u=e.vertices[o].x,p=e.vertices[o].y,f=e.vertices[o].z,g=e.vertices[a].x,v=e.vertices[a].y,m=e.vertices[a].z,y=e.vertices[l].x,w=e.vertices[l].y,x=e.vertices[l].z;return.01>Math.abs(c-p)?[new r.Vector2(d,1-h),new r.Vector2(u,1-f),new r.Vector2(g,1-m),new r.Vector2(y,1-x)]:[new r.Vector2(c,1-h),new r.Vector2(p,1-f),new r.Vector2(v,1-m),new r.Vector2(w,1-x)]}},r.ExtrudeGeometry.__v1=new r.Vector2,r.ExtrudeGeometry.__v2=new r.Vector2,r.ExtrudeGeometry.__v3=new r.Vector2,r.ExtrudeGeometry.__v4=new r.Vector2,r.ExtrudeGeometry.__v5=new r.Vector2,r.ExtrudeGeometry.__v6=new r.Vector2,r.ShapeGeometry=function(e,t){r.Geometry.call(this),e instanceof Array==!1&&(e=[e]),this.shapebb=e[e.length-1].getBoundingBox(),this.addShapeList(e,t),this.computeCentroids(),this.computeFaceNormals()},r.ShapeGeometry.prototype=Object.create(r.Geometry.prototype),r.ShapeGeometry.prototype.addShapeList=function(e,t){for(var i=0,r=e.length;r>i;i++)this.addShape(e[i],t);return this},r.ShapeGeometry.prototype.addShape=function(e,t){void 0===t&&(t={});var i=void 0!==t.curveSegments?t.curveSegments:12,n=t.material,s=void 0===t.UVGenerator?r.ExtrudeGeometry.WorldUVGenerator:t.UVGenerator;this.shapebb;var o,a,l,d=this.vertices.length,c=e.extractPoints(i),h=c.shape,u=c.holes,p=!r.Shape.Utils.isClockWise(h);if(p){for(h=h.reverse(),o=0,a=u.length;a>o;o++)l=u[o],r.Shape.Utils.isClockWise(l)&&(u[o]=l.reverse());p=!1}var f=r.Shape.Utils.triangulateShape(h,u),g=h;for(o=0,a=u.length;a>o;o++)l=u[o],h=h.concat(l);var v,m,y=h.length,w=f.length;for(g.length,o=0;y>o;o++)v=h[o],this.vertices.push(new r.Vector3(v.x,v.y,0));for(o=0;w>o;o++){m=f[o];var x=m[0]+d,b=m[1]+d,E=m[2]+d;this.faces.push(new r.Face3(x,b,E,null,null,n)),this.faceVertexUvs[0].push(s.generateBottomUV(this,e,t,x,b,E))}},r.LatheGeometry=function(e,t,i,n){r.Geometry.call(this),t=t||12,i=i||0,n=n||2*Math.PI;for(var s=1/(e.length-1),o=1/t,a=0,l=t;l>=a;a++)for(var d=i+a*o*n,c=Math.cos(d),h=Math.sin(d),u=0,p=e.length;p>u;u++){var f=e[u],g=new r.Vector3;g.x=c*f.x-h*f.y,g.y=h*f.x+c*f.y,g.z=f.z,this.vertices.push(g)}for(var v=e.length,a=0,l=t;l>a;a++)for(var u=0,p=e.length-1;p>u;u++){var m=u+v*a,y=m,w=m+v,c=m+1+v,x=m+1;this.faces.push(new r.Face4(y,w,c,x));var b=a*o,E=u*s,_=b+o,T=E+s;this.faceVertexUvs[0].push([new r.Vector2(b,E),new r.Vector2(_,E),new r.Vector2(_,T),new r.Vector2(b,T)])}this.mergeVertices(),this.computeCentroids(),this.computeFaceNormals(),this.computeVertexNormals()},r.LatheGeometry.prototype=Object.create(r.Geometry.prototype),r.PlaneGeometry=function(e,t,i,n,s){r.Geometry.call(this),this.width=e,this.height=t,this.widthSegments=i||1,this.heightSegments=n||1;var o,a,l=e/2,d=t/2,c=this.widthSegments,h=this.heightSegments,u=c+1,p=h+1,f=this.width/c,g=this.height/h,v=new r.Vector3(0,0,1);for(s=s||1,a=0;p>a;a++)for(o=0;u>o;o++){var m=o*f-l,y=a*g-d;this.vertices.push(new r.Vector3(m,-y,0))}for(a=0;h>a;a++)for(o=0;c>o;o++){var w=o+u*a,x=o+u*(a+1),b=o+1+u*(a+1),E=o+1+u*a,_=new r.Face4(w,x,b,E);_.normal.copy(v),_.vertexNormals.push(v.clone(),v.clone(),v.clone(),v.clone()),this.faces.push(_),this.faceVertexUvs[0].push([new r.Vector2(o/c*s,1-a*s/h),new r.Vector2(o/c*s,1-(a+1)*s/h),new r.Vector2((o+1)*s/c,1-(a+1)*s/h),new r.Vector2((o+1)*s/c,1-a*s/h)])}this.computeCentroids()},r.PlaneGeometry.prototype=Object.create(r.Geometry.prototype),r.RingGeometry=function(e,t,i,n,s,o){r.Geometry.call(this),e=e||0,t=t||50,s=void 0!==s?s:0,o=void 0!==o?o:2*Math.PI,i=void 0!==i?Math.max(3,i):8,n=void 0!==n?Math.max(3,n):8;var a,l,d=[],c=e,h=(t-e)/n;for(a=0;n>=a;a++){for(l=0;i>=l;l++){var u=new r.Vector3,p=s+l/i*o;u.x=c*Math.cos(p),u.y=c*Math.sin(p),this.vertices.push(u),d.push(new r.Vector2((u.x/c+1)/2,-(u.y/c+1)/2+1))}c+=h}var f=new r.Vector3(0,0,1);for(a=0;n>a;a++){var g=a*i;for(l=0;i>=l;l++){var p=l+g,v=p+a,m=p+i+a,y=p+i+1+a;this.faces.push(new r.Face3(v,m,y,[f,f,f])),this.faceVertexUvs[0].push([d[v],d[m],d[y]]),v=p+a,m=p+i+1+a,y=p+1+a,this.faces.push(new r.Face3(v,m,y,[f,f,f])),this.faceVertexUvs[0].push([d[v],d[m],d[y]])}}this.computeCentroids(),this.computeFaceNormals(),this.boundingSphere=new r.Sphere(new r.Vector3,c)},r.RingGeometry.prototype=Object.create(r.Geometry.prototype),r.SphereGeometry=function(e,t,i,n,s,o,a){r.Geometry.call(this),this.radius=e=e||50,this.widthSegments=t=Math.max(3,Math.floor(t)||8),this.heightSegments=i=Math.max(2,Math.floor(i)||6),this.phiStart=n=void 0!==n?n:0,this.phiLength=s=void 0!==s?s:2*Math.PI,this.thetaStart=o=void 0!==o?o:0,this.thetaLength=a=void 0!==a?a:Math.PI;var l,d,c=[],h=[];for(d=0;i>=d;d++){var u=[],p=[];for(l=0;t>=l;l++){var f=l/t,g=d/i,v=new r.Vector3;v.x=-e*Math.cos(n+f*s)*Math.sin(o+g*a),v.y=e*Math.cos(o+g*a),v.z=e*Math.sin(n+f*s)*Math.sin(o+g*a),this.vertices.push(v),u.push(this.vertices.length-1),p.push(new r.Vector2(f,1-g))}c.push(u),h.push(p)}for(d=0;this.heightSegments>d;d++)for(l=0;this.widthSegments>l;l++){var m=c[d][l+1],y=c[d][l],w=c[d+1][l],x=c[d+1][l+1],b=this.vertices[m].clone().normalize(),E=this.vertices[y].clone().normalize(),_=this.vertices[w].clone().normalize(),T=this.vertices[x].clone().normalize(),C=h[d][l+1].clone(),M=h[d][l].clone(),S=h[d+1][l].clone(),A=h[d+1][l+1].clone();Math.abs(this.vertices[m].y)===this.radius?(this.faces.push(new r.Face3(m,w,x,[b,_,T])),this.faceVertexUvs[0].push([C,S,A])):Math.abs(this.vertices[w].y)===this.radius?(this.faces.push(new r.Face3(m,y,w,[b,E,_])),this.faceVertexUvs[0].push([C,M,S])):(this.faces.push(new r.Face4(m,y,w,x,[b,E,_,T])),this.faceVertexUvs[0].push([C,M,S,A]))}this.computeCentroids(),this.computeFaceNormals(),this.boundingSphere=new r.Sphere(new r.Vector3,e)},r.SphereGeometry.prototype=Object.create(r.Geometry.prototype),r.TextGeometry=function(e,t){t=t||{};var i=r.FontUtils.generateShapes(e,t);t.amount=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),r.ExtrudeGeometry.call(this,i,t)},r.TextGeometry.prototype=Object.create(r.ExtrudeGeometry.prototype),r.TorusGeometry=function(e,t,i,n,s){r.Geometry.call(this),this.radius=e||100,this.tube=t||40,this.radialSegments=i||8,this.tubularSegments=n||6,this.arc=s||2*Math.PI;for(var o=new r.Vector3,a=[],l=[],d=0;this.radialSegments>=d;d++)for(var c=0;this.tubularSegments>=c;c++){var h=c/this.tubularSegments*this.arc,u=2*d/this.radialSegments*Math.PI;o.x=this.radius*Math.cos(h),o.y=this.radius*Math.sin(h);var p=new r.Vector3;p.x=(this.radius+this.tube*Math.cos(u))*Math.cos(h),p.y=(this.radius+this.tube*Math.cos(u))*Math.sin(h),p.z=this.tube*Math.sin(u),this.vertices.push(p),a.push(new r.Vector2(c/this.tubularSegments,d/this.radialSegments)),l.push(p.clone().sub(o).normalize())}for(var d=1;this.radialSegments>=d;d++)for(var c=1;this.tubularSegments>=c;c++){var f=(this.tubularSegments+1)*d+c-1,g=(this.tubularSegments+1)*(d-1)+c-1,v=(this.tubularSegments+1)*(d-1)+c,m=(this.tubularSegments+1)*d+c,y=new r.Face4(f,g,v,m,[l[f],l[g],l[v],l[m]]);y.normal.add(l[f]),y.normal.add(l[g]),y.normal.add(l[v]),y.normal.add(l[m]),y.normal.normalize(),this.faces.push(y),this.faceVertexUvs[0].push([a[f].clone(),a[g].clone(),a[v].clone(),a[m].clone()])}this.computeCentroids()},r.TorusGeometry.prototype=Object.create(r.Geometry.prototype),r.TorusKnotGeometry=function(e,t,i,n,s,o,a){function l(e,t,i,n,s){var o=Math.cos(e),a=Math.sin(e),l=t/i*e,d=Math.cos(l),c=.5*n*(2+d)*o,h=.5*n*(2+d)*a,u=.5*s*n*Math.sin(l);return new r.Vector3(c,h,u)}r.Geometry.call(this);var d=this;this.radius=e||100,this.tube=t||40,this.radialSegments=i||64,this.tubularSegments=n||8,this.p=s||2,this.q=o||3,this.heightScale=a||1,this.grid=Array(this.radialSegments);for(var c=new r.Vector3,h=new r.Vector3,u=new r.Vector3,p=0;this.radialSegments>p;++p){this.grid[p]=Array(this.tubularSegments);var f=2*(p/this.radialSegments)*this.p*Math.PI,g=l(f,this.q,this.p,this.radius,this.heightScale),v=l(f+.01,this.q,this.p,this.radius,this.heightScale);c.subVectors(v,g),h.addVectors(v,g),u.crossVectors(c,h),h.crossVectors(u,c),u.normalize(),h.normalize();for(var m=0;this.tubularSegments>m;++m){var y=2*(m/this.tubularSegments)*Math.PI,w=-this.tube*Math.cos(y),x=this.tube*Math.sin(y),b=new r.Vector3;b.x=g.x+w*h.x+x*u.x,b.y=g.y+w*h.y+x*u.y,b.z=g.z+w*h.z+x*u.z,this.grid[p][m]=d.vertices.push(b)-1}}for(var p=0;this.radialSegments>p;++p)for(var m=0;this.tubularSegments>m;++m){var E=(p+1)%this.radialSegments,_=(m+1)%this.tubularSegments,T=this.grid[p][m],C=this.grid[E][m],M=this.grid[E][_],S=this.grid[p][_],A=new r.Vector2(p/this.radialSegments,m/this.tubularSegments),R=new r.Vector2((p+1)/this.radialSegments,m/this.tubularSegments),U=new r.Vector2((p+1)/this.radialSegments,(m+1)/this.tubularSegments),D=new r.Vector2(p/this.radialSegments,(m+1)/this.tubularSegments);this.faces.push(new r.Face4(T,C,M,S)),this.faceVertexUvs[0].push([A,R,U,D])}this.computeCentroids(),this.computeFaceNormals(),this.computeVertexNormals()},r.TorusKnotGeometry.prototype=Object.create(r.Geometry.prototype),r.TubeGeometry=function(e,t,i,n,s){function o(e,t,i){return S.vertices.push(new r.Vector3(e,t,i))-1}r.Geometry.call(this),this.path=e,this.segments=t||64,this.radius=i||1,this.radialSegments=n||8,this.closed=s||!1,this.grid=[];var a,l,d,c,h,u,p,f,g,v,m,y,w,x,b,E,_,T,C,M,S=this,A=this.segments+1,R=new r.Vector3,U=new r.TubeGeometry.FrenetFrames(this.path,this.segments,this.closed),D=U.tangents,P=U.normals,j=U.binormals;for(this.tangents=D,this.normals=P,this.binormals=j,g=0;A>g;g++)for(this.grid[g]=[],c=g/(A-1),f=e.getPointAt(c),a=D[g],l=P[g],d=j[g],v=0;this.radialSegments>v;v++)h=2*(v/this.radialSegments)*Math.PI,u=-this.radius*Math.cos(h),p=this.radius*Math.sin(h),R.copy(f),R.x+=u*l.x+p*d.x,R.y+=u*l.y+p*d.y,R.z+=u*l.z+p*d.z,this.grid[g][v]=o(R.x,R.y,R.z);for(g=0;this.segments>g;g++)for(v=0;this.radialSegments>v;v++)m=this.closed?(g+1)%this.segments:g+1,y=(v+1)%this.radialSegments,w=this.grid[g][v],x=this.grid[m][v],b=this.grid[m][y],E=this.grid[g][y],_=new r.Vector2(g/this.segments,v/this.radialSegments),T=new r.Vector2((g+1)/this.segments,v/this.radialSegments),C=new r.Vector2((g+1)/this.segments,(v+1)/this.radialSegments),M=new r.Vector2(g/this.segments,(v+1)/this.radialSegments),this.faces.push(new r.Face4(w,x,b,E)),this.faceVertexUvs[0].push([_,T,C,M]);this.computeCentroids(),this.computeFaceNormals(),this.computeVertexNormals()},r.TubeGeometry.prototype=Object.create(r.Geometry.prototype),r.TubeGeometry.FrenetFrames=function(e,t,i){function n(){f[0]=new r.Vector3,g[0]=new r.Vector3,o=Number.MAX_VALUE,a=Math.abs(p[0].x),l=Math.abs(p[0].y),d=Math.abs(p[0].z),o>=a&&(o=a,u.set(1,0,0)),o>=l&&(o=l,u.set(0,1,0)),o>=d&&u.set(0,0,1),v.crossVectors(p[0],u).normalize(),f[0].crossVectors(p[0],v),g[0].crossVectors(p[0],f[0])}var s,o,a,l,d,c,h,u=(new r.Vector3,new r.Vector3),p=(new r.Vector3,[]),f=[],g=[],v=new r.Vector3,m=new r.Matrix4,y=t+1,w=1e-4;for(this.tangents=p,this.normals=f,this.binormals=g,c=0;y>c;c++)h=c/(y-1),p[c]=e.getTangentAt(h),p[c].normalize();for(n(),c=1;y>c;c++)f[c]=f[c-1].clone(),g[c]=g[c-1].clone(),v.crossVectors(p[c-1],p[c]),v.length()>w&&(v.normalize(),s=Math.acos(r.Math.clamp(p[c-1].dot(p[c]),-1,1)),f[c].applyMatrix4(m.makeRotationAxis(v,s))),g[c].crossVectors(p[c],f[c]);if(i)for(s=Math.acos(r.Math.clamp(f[0].dot(f[y-1]),-1,1)),s/=y-1,p[0].dot(v.crossVectors(f[0],f[y-1]))>0&&(s=-s),c=1;y>c;c++)f[c].applyMatrix4(m.makeRotationAxis(p[c],s*c)),g[c].crossVectors(p[c],f[c])},r.PolyhedronGeometry=function(e,t,i,n){function s(e){var t=e.normalize().clone();t.index=h.vertices.push(t)-1;var i=l(e)/2/Math.PI+.5,n=d(e)/Math.PI+.5;return t.uv=new r.Vector2(i,1-n),t}function o(e,t,i){var n=new r.Face3(e.index,t.index,i.index,[e.clone(),t.clone(),i.clone()]);n.centroid.add(e).add(t).add(i).divideScalar(3),h.faces.push(n);var s=l(n.centroid);h.faceVertexUvs[0].push([c(e.uv,e,s),c(t.uv,t,s),c(i.uv,i,s)])}function a(e,t){var i=Math.pow(2,t);Math.pow(4,t);for(var r=s(h.vertices[e.a]),n=s(h.vertices[e.b]),a=s(h.vertices[e.c]),l=[],d=0;i>=d;d++){l[d]=[];for(var c=s(r.clone().lerp(a,d/i)),u=s(n.clone().lerp(a,d/i)),p=i-d,f=0;p>=f;f++)l[d][f]=0==f&&d==i?c:s(c.clone().lerp(u,f/p))}for(var d=0;i>d;d++)for(var f=0;2*(i-d)-1>f;f++){var g=Math.floor(f/2);0==f%2?o(l[d][g+1],l[d+1][g],l[d][g]):o(l[d][g+1],l[d+1][g+1],l[d+1][g])}}function l(e){return Math.atan2(e.z,-e.x)}function d(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}function c(e,t,i){return 0>i&&1===e.x&&(e=new r.Vector2(e.x-1,e.y)),0===t.x&&0===t.z&&(e=new r.Vector2(i/2/Math.PI+.5,e.y)),e.clone()}r.Geometry.call(this),i=i||1,n=n||0;for(var h=this,u=0,p=e.length;p>u;u++)s(new r.Vector3(e[u][0],e[u][1],e[u][2]));for(var f=this.vertices,g=[],u=0,p=t.length;p>u;u++){var v=f[t[u][0]],m=f[t[u][1]],y=f[t[u][2]];g[u]=new r.Face3(v.index,m.index,y.index,[v.clone(),m.clone(),y.clone()])}for(var u=0,p=g.length;p>u;u++)a(g[u],n);for(var u=0,p=this.faceVertexUvs[0].length;p>u;u++){var w=this.faceVertexUvs[0][u],x=w[0].x,b=w[1].x,E=w[2].x,_=Math.max(x,Math.max(b,E)),T=Math.min(x,Math.min(b,E));_>.9&&.1>T&&(.2>x&&(w[0].x+=1),.2>b&&(w[1].x+=1),.2>E&&(w[2].x+=1))}for(var u=0,p=this.vertices.length;p>u;u++)this.vertices[u].multiplyScalar(i);this.mergeVertices(),this.computeCentroids(),this.computeFaceNormals(),this.boundingSphere=new r.Sphere(new r.Vector3,i)},r.PolyhedronGeometry.prototype=Object.create(r.Geometry.prototype),r.IcosahedronGeometry=function(e,t){this.radius=e,this.detail=t;var i=(1+Math.sqrt(5))/2,n=[[-1,i,0],[1,i,0],[-1,-i,0],[1,-i,0],[0,-1,i],[0,1,i],[0,-1,-i],[0,1,-i],[i,0,-1],[i,0,1],[-i,0,-1],[-i,0,1]],s=[[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]];r.PolyhedronGeometry.call(this,n,s,e,t)},r.IcosahedronGeometry.prototype=Object.create(r.Geometry.prototype),r.OctahedronGeometry=function(e,t){var i=[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]],n=[[0,2,4],[0,4,3],[0,3,5],[0,5,2],[1,2,5],[1,5,3],[1,3,4],[1,4,2]];r.PolyhedronGeometry.call(this,i,n,e,t)},r.OctahedronGeometry.prototype=Object.create(r.Geometry.prototype),r.TetrahedronGeometry=function(e,t){var i=[[1,1,1],[-1,-1,1],[-1,1,-1],[1,-1,-1]],n=[[2,1,0],[0,3,2],[1,3,0],[2,3,1]];r.PolyhedronGeometry.call(this,i,n,e,t)},r.TetrahedronGeometry.prototype=Object.create(r.Geometry.prototype),r.ParametricGeometry=function(e,t,i,n){r.Geometry.call(this);var s=this.vertices,o=this.faces,a=this.faceVertexUvs[0];n=void 0===n?!1:n;var l,d,c,h,u,p=t+1;for(l=0;i>=l;l++)for(u=l/i,d=0;t>=d;d++)h=d/t,c=e(h,u),s.push(c);var f,g,v,m,y,w,x,b;for(l=0;i>l;l++)for(d=0;t>d;d++)f=l*p+d,g=l*p+d+1,v=(l+1)*p+d,m=(l+1)*p+d+1,y=new r.Vector2(d/t,l/i),w=new r.Vector2((d+1)/t,l/i),x=new r.Vector2(d/t,(l+1)/i),b=new r.Vector2((d+1)/t,(l+1)/i),n?(o.push(new r.Face3(f,g,v)),o.push(new r.Face3(g,m,v)),a.push([y,w,x]),a.push([w,b,x])):(o.push(new r.Face4(f,g,m,v)),a.push([y,w,b,x]));this.computeCentroids(),this.computeFaceNormals(),this.computeVertexNormals()},r.ParametricGeometry.prototype=Object.create(r.Geometry.prototype),r.ConvexGeometry=function(e){function t(t){var r=e[t].clone(),n=r.length();r.x+=n*o(),r.y+=n*o(),r.z+=n*o();for(var a=[],d=0;l.length>d;){var c=l[d];if(i(c,r)){for(var h=0;3>h;h++){for(var u=[c[h],c[(h+1)%3]],p=!0,f=0;a.length>f;f++)if(s(a[f],u)){a[f]=a[a.length-1],a.pop(),p=!1;break}p&&a.push(u)}l[d]=l[l.length-1],l.pop()}else d++}for(var f=0;a.length>f;f++)l.push([a[f][0],a[f][1],t])}function i(t,i){var r=e[t[0]],s=e[t[1]],o=e[t[2]],a=n(r,s,o),l=a.dot(r);return a.dot(i)>=l}function n(e,t,i){var n=new r.Vector3,s=new r.Vector3;return n.subVectors(i,t),s.subVectors(e,t),n.cross(s),n.normalize(),n}function s(e,t){return e[0]===t[1]&&e[1]===t[0]}function o(){return 1e-6*2*(Math.random()-.5)}function a(e){var t=e.length();return new r.Vector2(e.x/t,e.y/t)}r.Geometry.call(this);for(var l=[[0,1,2],[0,2,1]],d=3;e.length>d;d++)t(d);for(var c=0,h=Array(e.length),d=0;l.length>d;d++)for(var u=l[d],p=0;3>p;p++)void 0===h[u[p]]&&(h[u[p]]=c++,this.vertices.push(e[u[p]])),u[p]=h[u[p]];for(var d=0;l.length>d;d++)this.faces.push(new r.Face3(l[d][0],l[d][1],l[d][2]));for(var d=0;this.faces.length>d;d++){var u=this.faces[d];this.faceVertexUvs[0].push([a(this.vertices[u.a]),a(this.vertices[u.b]),a(this.vertices[u.c])])}this.computeCentroids(),this.computeFaceNormals(),this.computeVertexNormals()},r.ConvexGeometry.prototype=Object.create(r.Geometry.prototype),r.AxisHelper=function(e){e=e||1;var t=new r.Geometry;t.vertices.push(new r.Vector3,new r.Vector3(e,0,0),new r.Vector3,new r.Vector3(0,e,0),new r.Vector3,new r.Vector3(0,0,e)),t.colors.push(new r.Color(16711680),new r.Color(16755200),new r.Color(65280),new r.Color(11206400),new r.Color(255),new r.Color(43775));var i=new r.LineBasicMaterial({vertexColors:r.VertexColors});r.Line.call(this,t,i,r.LinePieces)},r.AxisHelper.prototype=Object.create(r.Line.prototype),r.ArrowHelper=function(e,t,i,n){r.Object3D.call(this),void 0===n&&(n=16776960),void 0===i&&(i=1),this.position=t,this.useQuaternion=!0;var s=new r.Geometry;s.vertices.push(new r.Vector3(0,0,0)),s.vertices.push(new r.Vector3(0,1,0)),this.line=new r.Line(s,new r.LineBasicMaterial({color:n})),this.line.matrixAutoUpdate=!1,this.add(this.line);var o=new r.CylinderGeometry(0,.05,.25,5,1);o.applyMatrix((new r.Matrix4).makeTranslation(0,.875,0)),this.cone=new r.Mesh(o,new r.MeshBasicMaterial({color:n})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i)},r.ArrowHelper.prototype=Object.create(r.Object3D.prototype),r.ArrowHelper.prototype.setDirection=function(){var e,t=new r.Vector3;return function(i){i.y>.99999?this.quaternion.set(0,0,0,1):-.99999>i.y?this.quaternion.set(1,0,0,0):(t.set(i.z,0,-i.x).normalize(),e=Math.acos(i.y),this.quaternion.setFromAxisAngle(t,e))}}(),r.ArrowHelper.prototype.setLength=function(e){this.scale.set(e,e,e)},r.ArrowHelper.prototype.setColor=function(e){this.line.material.color.setHex(e),this.cone.material.color.setHex(e)},r.BoxHelper=function(e){var t=[new r.Vector3(1,1,1),new r.Vector3(-1,1,1),new r.Vector3(-1,-1,1),new r.Vector3(1,-1,1),new r.Vector3(1,1,-1),new r.Vector3(-1,1,-1),new r.Vector3(-1,-1,-1),new r.Vector3(1,-1,-1)];this.vertices=t;var i=new r.Geometry;i.vertices.push(t[0],t[1],t[1],t[2],t[2],t[3],t[3],t[0],t[4],t[5],t[5],t[6],t[6],t[7],t[7],t[4],t[0],t[4],t[1],t[5],t[2],t[6],t[3],t[7]),r.Line.call(this,i,new r.LineBasicMaterial({color:16776960}),r.LinePieces),void 0!==e&&this.update(e)},r.BoxHelper.prototype=Object.create(r.Line.prototype),r.BoxHelper.prototype.update=function(e){var t=e.geometry;null===t.boundingBox&&t.computeBoundingBox();var i=t.boundingBox.min,r=t.boundingBox.max,n=this.vertices;n[0].set(r.x,r.y,r.z),n[1].set(i.x,r.y,r.z),n[2].set(i.x,i.y,r.z),n[3].set(r.x,i.y,r.z),n[4].set(r.x,r.y,i.z),n[5].set(i.x,r.y,i.z),n[6].set(i.x,i.y,i.z),n[7].set(r.x,i.y,i.z),this.geometry.computeBoundingSphere(),this.geometry.verticesNeedUpdate=!0,this.matrixAutoUpdate=!1,this.matrixWorld=e.matrixWorld},r.BoundingBoxHelper=function(e,t){var i=t||8947848;this.object=e,this.box=new r.Box3,r.Mesh.call(this,new r.CubeGeometry(1,1,1),new r.MeshBasicMaterial({color:i,wireframe:!0}))},r.BoundingBoxHelper.prototype=Object.create(r.Mesh.prototype),r.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object),this.box.size(this.scale),this.box.center(this.position)},r.CameraHelper=function(e){function t(e,t,r){i(e,r),i(t,r)}function i(e,t){n.vertices.push(new r.Vector3),n.colors.push(new r.Color(t)),void 0===o[e]&&(o[e]=[]),o[e].push(n.vertices.length-1)}r.Line.call(this);var n=new r.Geometry,s=new r.LineBasicMaterial({color:16777215,vertexColors:r.FaceColors}),o={},a=16755200,l=16711680,d=43775,c=16777215,h=3355443;t("n1","n2",a),t("n2","n4",a),t("n4","n3",a),t("n3","n1",a),t("f1","f2",a),t("f2","f4",a),t("f4","f3",a),t("f3","f1",a),t("n1","f1",a),t("n2","f2",a),t("n3","f3",a),t("n4","f4",a),t("p","n1",l),t("p","n2",l),t("p","n3",l),t("p","n4",l),t("u1","u2",d),t("u2","u3",d),t("u3","u1",d),t("c","t",c),t("p","c",h),t("cn1","cn2",h),t("cn3","cn4",h),t("cf1","cf2",h),t("cf3","cf4",h),r.Line.call(this,n,s,r.LinePieces),this.camera=e,this.matrixWorld=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()},r.CameraHelper.prototype=Object.create(r.Line.prototype),r.CameraHelper.prototype.update=function(){var e=new r.Vector3,t=new r.Camera,i=new r.Projector;return function(){function r(r,s,o,a){e.set(s,o,a),i.unprojectVector(e,t);var l=n.pointMap[r];if(void 0!==l)for(var d=0,c=l.length;c>d;d++)n.geometry.vertices[l[d]].copy(e)}var n=this,s=1,o=1;t.projectionMatrix.copy(this.camera.projectionMatrix),r("c",0,0,-1),r("t",0,0,1),r("n1",-s,-o,-1),r("n2",s,-o,-1),r("n3",-s,o,-1),r("n4",s,o,-1),r("f1",-s,-o,1),r("f2",s,-o,1),r("f3",-s,o,1),r("f4",s,o,1),r("u1",.7*s,1.1*o,-1),r("u2",.7*-s,1.1*o,-1),r("u3",0,2*o,-1),r("cf1",-s,0,1),r("cf2",s,0,1),r("cf3",0,-o,1),r("cf4",0,o,1),r("cn1",-s,0,-1),r("cn2",s,0,-1),r("cn3",0,-o,-1),r("cn4",0,o,-1),this.geometry.verticesNeedUpdate=!0}}(),r.DirectionalLightHelper=function(e,t){r.Object3D.call(this),this.matrixAutoUpdate=!1,this.light=e;var i=new r.SphereGeometry(t,4,2),n=new r.MeshBasicMaterial({fog:!1,wireframe:!0});n.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.lightSphere=new r.Mesh(i,n),this.lightSphere.matrixWorld=this.light.matrixWorld,this.lightSphere.matrixAutoUpdate=!1,this.add(this.lightSphere),i=new r.Geometry,i.vertices.push(this.light.position),i.vertices.push(this.light.target.position),i.computeLineDistances(),n=new r.LineDashedMaterial({dashSize:4,gapSize:4,opacity:.75,transparent:!0,fog:!1}),n.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine=new r.Line(i,n),this.add(this.targetLine)},r.DirectionalLightHelper.prototype=Object.create(r.Object3D.prototype),r.DirectionalLightHelper.prototype.update=function(){this.lightSphere.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine.geometry.computeLineDistances(),this.targetLine.geometry.verticesNeedUpdate=!0,this.targetLine.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)},r.FaceNormalsHelper=function(e,t,i,n){this.object=e,this.size=t||1;for(var s=i||16776960,o=n||1,a=new r.Geometry,l=this.object.geometry.faces,d=0,c=l.length;c>d;d++)a.vertices.push(new r.Vector3),a.vertices.push(new r.Vector3);r.Line.call(this,a,new r.LineBasicMaterial({color:s,linewidth:o}),r.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new r.Matrix3,this.update()},r.FaceNormalsHelper.prototype=Object.create(r.Line.prototype),r.FaceNormalsHelper.prototype.update=function(){var e=new r.Vector3;return function(){this.object.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var t=this.geometry.vertices,i=this.object.geometry.faces,r=this.object.matrixWorld,n=0,s=i.length;s>n;n++){var o=i[n];e.copy(o.normal).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);var a=2*n;t[a].copy(o.centroid).applyMatrix4(r),t[a+1].addVectors(t[a],e)}return this.geometry.verticesNeedUpdate=!0,this}}(),r.GridHelper=function(e,t){for(var i=new r.Geometry,n=new r.LineBasicMaterial({vertexColors:r.VertexColors}),s=new r.Color(4473924),o=new r.Color(8947848),a=-e;e>=a;a+=t){i.vertices.push(new r.Vector3(-e,0,a),new r.Vector3(e,0,a),new r.Vector3(a,0,-e),new r.Vector3(a,0,e));var l=0===a?s:o;i.colors.push(l,l,l,l)}r.Line.call(this,i,n,r.LinePieces)},r.GridHelper.prototype=Object.create(r.Line.prototype),r.HemisphereLightHelper=function(e,t){r.Object3D.call(this),this.light=e;var i=new r.SphereGeometry(t,4,2);i.applyMatrix((new r.Matrix4).makeRotationX(-Math.PI/2));for(var n=0,s=8;s>n;n++)i.faces[n].materialIndex=4>n?0:1;var o=new r.MeshBasicMaterial({fog:!1,wireframe:!0});o.color.copy(e.color).multiplyScalar(e.intensity);var a=new r.MeshBasicMaterial({fog:!1,wireframe:!0});a.color.copy(e.groundColor).multiplyScalar(e.intensity),this.lightSphere=new r.Mesh(i,new r.MeshFaceMaterial([o,a])),this.lightSphere.position=e.position,this.lightSphere.lookAt(new r.Vector3),this.add(this.lightSphere)},r.HemisphereLightHelper.prototype=Object.create(r.Object3D.prototype),r.HemisphereLightHelper.prototype.update=function(){this.lightSphere.lookAt(new r.Vector3),this.lightSphere.material.materials[0].color.copy(this.light.color).multiplyScalar(this.light.intensity),this.lightSphere.material.materials[1].color.copy(this.light.groundColor).multiplyScalar(this.light.intensity)},r.PointLightHelper=function(e,t){r.Object3D.call(this),this.matrixAutoUpdate=!1,this.light=e;var i=new r.SphereGeometry(t,4,2),n=new r.MeshBasicMaterial({fog:!1,wireframe:!0});n.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.lightSphere=new r.Mesh(i,n),this.lightSphere.matrixWorld=this.light.matrixWorld,this.lightSphere.matrixAutoUpdate=!1,this.add(this.lightSphere)},r.PointLightHelper.prototype=Object.create(r.Object3D.prototype),r.PointLightHelper.prototype.update=function(){this.lightSphere.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)},r.SpotLightHelper=function(e){this.light=e;var t=new r.CylinderGeometry(0,1,1,8,1,!0);t.applyMatrix((new r.Matrix4).makeTranslation(0,-.5,0)),t.applyMatrix((new r.Matrix4).makeRotationX(-Math.PI/2));var i=new r.MeshBasicMaterial({wireframe:!0,opacity:.3,transparent:!0});r.Mesh.call(this,t,i),this.update()},r.SpotLightHelper.prototype=Object.create(r.Mesh.prototype),r.SpotLightHelper.prototype.update=function(){var e=new r.Vector3;return function(){var t=this.light.distance?this.light.distance:1e4,i=t*Math.tan(this.light.angle);this.scale.set(i,i,t),this.light.updateMatrixWorld(!0),this.position.getPositionFromMatrix(this.light.matrixWorld),this.light.target.updateMatrixWorld(!0),e.getPositionFromMatrix(this.light.target.matrixWorld),this.lookAt(e),this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}(),r.VertexNormalsHelper=function(e,t,i,n){this.object=e,this.size=t||1;var s=i||16711680,o=n||1,a=new r.Geometry;e.geometry.vertices;for(var l=e.geometry.faces,d=0,c=l.length;c>d;d++)for(var h=l[d],u=0,p=h.vertexNormals.length;p>u;u++)a.vertices.push(new r.Vector3),a.vertices.push(new r.Vector3);r.Line.call(this,a,new r.LineBasicMaterial({color:s,linewidth:o}),r.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new r.Matrix3,this.update()},r.VertexNormalsHelper.prototype=Object.create(r.Line.prototype),r.VertexNormalsHelper.prototype.update=function(){var e=new r.Vector3;return function(){var t=["a","b","c","d"];this.object.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var i=this.geometry.vertices,r=this.object.geometry.vertices,n=this.object.geometry.faces,s=this.object.matrixWorld,o=0,a=0,l=n.length;l>a;a++)for(var d=n[a],c=0,h=d.vertexNormals.length;h>c;c++){var u=d[t[c]],p=r[u],f=d.vertexNormals[c];i[o].copy(p).applyMatrix4(s),e.copy(f).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size),e.add(i[o]),o+=1,i[o].copy(e),o+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),r.VertexTangentsHelper=function(e,t,i,n){this.object=e,this.size=t||1;var s=i||255,o=n||1,a=new r.Geometry;e.geometry.vertices;for(var l=e.geometry.faces,d=0,c=l.length;c>d;d++)for(var h=l[d],u=0,p=h.vertexTangents.length;p>u;u++)a.vertices.push(new r.Vector3),a.vertices.push(new r.Vector3);r.Line.call(this,a,new r.LineBasicMaterial({color:s,linewidth:o}),r.LinePieces),this.matrixAutoUpdate=!1,this.update()},r.VertexTangentsHelper.prototype=Object.create(r.Line.prototype),r.VertexTangentsHelper.prototype.update=function(){var e=new r.Vector3;return function(){var t=["a","b","c","d"];
this.object.updateMatrixWorld(!0);for(var i=this.geometry.vertices,r=this.object.geometry.vertices,n=this.object.geometry.faces,s=this.object.matrixWorld,o=0,a=0,l=n.length;l>a;a++)for(var d=n[a],c=0,h=d.vertexTangents.length;h>c;c++){var u=d[t[c]],p=r[u],f=d.vertexTangents[c];i[o].copy(p).applyMatrix4(s),e.copy(f).transformDirection(s).multiplyScalar(this.size),e.add(i[o]),o+=1,i[o].copy(e),o+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),r.WireframeHelper=function(e){for(var t=[0,0],i={},n=function(e,t){return e-t},s=["a","b","c","d"],o=new r.Geometry,a=e.geometry.vertices,l=e.geometry.faces,d=0,c=l.length;c>d;d++)for(var h=l[d],u=h instanceof r.Face4?4:3,p=0;u>p;p++){t[0]=h[s[p]],t[1]=h[s[(p+1)%u]],t.sort(n);var f=""+t;void 0===i[f]&&(o.vertices.push(a[t[0]]),o.vertices.push(a[t[1]]),i[f]=!0)}r.Line.call(this,o,new r.LineBasicMaterial({color:16777215}),r.LinePieces),this.matrixAutoUpdate=!1,this.matrixWorld=e.matrixWorld},r.WireframeHelper.prototype=Object.create(r.Line.prototype),r.ImmediateRenderObject=function(){r.Object3D.call(this),this.render=function(){}},r.ImmediateRenderObject.prototype=Object.create(r.Object3D.prototype),r.LensFlare=function(e,t,i,n,s){r.Object3D.call(this),this.lensFlares=[],this.positionScreen=new r.Vector3,this.customUpdateCallback=void 0,void 0!==e&&this.add(e,t,i,n,s)},r.LensFlare.prototype=Object.create(r.Object3D.prototype),r.LensFlare.prototype.add=function(e,t,i,n,s,o){void 0===t&&(t=-1),void 0===i&&(i=0),void 0===o&&(o=1),void 0===s&&(s=new r.Color(16777215)),void 0===n&&(n=r.NormalBlending),i=Math.min(i,Math.max(0,i)),this.lensFlares.push({texture:e,size:t,distance:i,x:0,y:0,z:0,scale:1,rotation:1,opacity:o,color:s,blending:n})},r.LensFlare.prototype.updateLensFlares=function(){var e,t,i=this.lensFlares.length,r=2*-this.positionScreen.x,n=2*-this.positionScreen.y;for(e=0;i>e;e++)t=this.lensFlares[e],t.x=this.positionScreen.x+r*t.distance,t.y=this.positionScreen.y+n*t.distance,t.wantedRotation=.25*t.x*Math.PI,t.rotation+=.25*(t.wantedRotation-t.rotation)},r.MorphBlendMesh=function(e,t){r.Mesh.call(this,e,t),this.animationsMap={},this.animationsList=[];var i=this.geometry.morphTargets.length,n="__default",s=0,o=i-1,a=i/1;this.createAnimation(n,s,o,a),this.setAnimationWeight(n,1)},r.MorphBlendMesh.prototype=Object.create(r.Mesh.prototype),r.MorphBlendMesh.prototype.createAnimation=function(e,t,i,r){var n={startFrame:t,endFrame:i,length:i-t+1,fps:r,duration:(i-t)/r,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[e]=n,this.animationsList.push(n)},r.MorphBlendMesh.prototype.autoCreateAnimations=function(e){for(var t,i=/([a-z]+)(\d+)/,r={},n=this.geometry,s=0,o=n.morphTargets.length;o>s;s++){var a=n.morphTargets[s],l=a.name.match(i);if(l&&l.length>1){var d=l[1];l[2],r[d]||(r[d]={start:1/0,end:-1/0});var c=r[d];c.start>s&&(c.start=s),s>c.end&&(c.end=s),t||(t=d)}}for(var d in r){var c=r[d];this.createAnimation(d,c.start,c.end,e)}this.firstAnimation=t},r.MorphBlendMesh.prototype.setAnimationDirectionForward=function(e){var t=this.animationsMap[e];t&&(t.direction=1,t.directionBackwards=!1)},r.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(e){var t=this.animationsMap[e];t&&(t.direction=-1,t.directionBackwards=!0)},r.MorphBlendMesh.prototype.setAnimationFPS=function(e,t){var i=this.animationsMap[e];i&&(i.fps=t,i.duration=(i.end-i.start)/i.fps)},r.MorphBlendMesh.prototype.setAnimationDuration=function(e,t){var i=this.animationsMap[e];i&&(i.duration=t,i.fps=(i.end-i.start)/i.duration)},r.MorphBlendMesh.prototype.setAnimationWeight=function(e,t){var i=this.animationsMap[e];i&&(i.weight=t)},r.MorphBlendMesh.prototype.setAnimationTime=function(e,t){var i=this.animationsMap[e];i&&(i.time=t)},r.MorphBlendMesh.prototype.getAnimationTime=function(e){var t=0,i=this.animationsMap[e];return i&&(t=i.time),t},r.MorphBlendMesh.prototype.getAnimationDuration=function(e){var t=-1,i=this.animationsMap[e];return i&&(t=i.duration),t},r.MorphBlendMesh.prototype.playAnimation=function(e){var t=this.animationsMap[e];t?(t.time=0,t.active=!0):console.warn("animation["+e+"] undefined")},r.MorphBlendMesh.prototype.stopAnimation=function(e){var t=this.animationsMap[e];t&&(t.active=!1)},r.MorphBlendMesh.prototype.update=function(e){for(var t=0,i=this.animationsList.length;i>t;t++){var n=this.animationsList[t];if(n.active){var s=n.duration/n.length;n.time+=n.direction*e,n.mirroredLoop?(n.time>n.duration||0>n.time)&&(n.direction*=-1,n.time>n.duration&&(n.time=n.duration,n.directionBackwards=!0),0>n.time&&(n.time=0,n.directionBackwards=!1)):(n.time=n.time%n.duration,0>n.time&&(n.time+=n.duration));var o=n.startFrame+r.Math.clamp(Math.floor(n.time/s),0,n.length-1),a=n.weight;o!==n.currentFrame&&(this.morphTargetInfluences[n.lastFrame]=0,this.morphTargetInfluences[n.currentFrame]=1*a,this.morphTargetInfluences[o]=0,n.lastFrame=n.currentFrame,n.currentFrame=o);var l=n.time%s/s;n.directionBackwards&&(l=1-l),this.morphTargetInfluences[n.currentFrame]=l*a,this.morphTargetInfluences[n.lastFrame]=(1-l)*a}}},r.LensFlarePlugin=function(){function e(e,i){var r=t.createProgram(),n=t.createShader(t.FRAGMENT_SHADER),s=t.createShader(t.VERTEX_SHADER),o="precision "+i+" float;\n";return t.shaderSource(n,o+e.fragmentShader),t.shaderSource(s,o+e.vertexShader),t.compileShader(n),t.compileShader(s),t.attachShader(r,n),t.attachShader(r,s),t.linkProgram(r),r}var t,i,n,s={};this.init=function(o){t=o.context,i=o,n=o.getPrecision(),s.vertices=new Float32Array(16),s.faces=new Uint16Array(6);var a=0;s.vertices[a++]=-1,s.vertices[a++]=-1,s.vertices[a++]=0,s.vertices[a++]=0,s.vertices[a++]=1,s.vertices[a++]=-1,s.vertices[a++]=1,s.vertices[a++]=0,s.vertices[a++]=1,s.vertices[a++]=1,s.vertices[a++]=1,s.vertices[a++]=1,s.vertices[a++]=-1,s.vertices[a++]=1,s.vertices[a++]=0,s.vertices[a++]=1,a=0,s.faces[a++]=0,s.faces[a++]=1,s.faces[a++]=2,s.faces[a++]=0,s.faces[a++]=2,s.faces[a++]=3,s.vertexBuffer=t.createBuffer(),s.elementBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,s.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,s.vertices,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,s.elementBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,s.faces,t.STATIC_DRAW),s.tempTexture=t.createTexture(),s.occlusionTexture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,s.tempTexture),t.texImage2D(t.TEXTURE_2D,0,t.RGB,16,16,0,t.RGB,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.bindTexture(t.TEXTURE_2D,s.occlusionTexture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,16,16,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),0>=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(s.hasVertexTexture=!1,s.program=e(r.ShaderFlares.lensFlare,n)):(s.hasVertexTexture=!0,s.program=e(r.ShaderFlares.lensFlareVertexTexture,n)),s.attributes={},s.uniforms={},s.attributes.vertex=t.getAttribLocation(s.program,"position"),s.attributes.uv=t.getAttribLocation(s.program,"uv"),s.uniforms.renderType=t.getUniformLocation(s.program,"renderType"),s.uniforms.map=t.getUniformLocation(s.program,"map"),s.uniforms.occlusionMap=t.getUniformLocation(s.program,"occlusionMap"),s.uniforms.opacity=t.getUniformLocation(s.program,"opacity"),s.uniforms.color=t.getUniformLocation(s.program,"color"),s.uniforms.scale=t.getUniformLocation(s.program,"scale"),s.uniforms.rotation=t.getUniformLocation(s.program,"rotation"),s.uniforms.screenPosition=t.getUniformLocation(s.program,"screenPosition")},this.render=function(e,n,o,a){var l=e.__webglFlares,d=l.length;if(d){var c=new r.Vector3,h=a/o,u=.5*o,p=.5*a,f=16/a,g=new r.Vector2(f*h,f),v=new r.Vector3(1,1,0),m=new r.Vector2(1,1),y=s.uniforms,w=s.attributes;t.useProgram(s.program),t.enableVertexAttribArray(s.attributes.vertex),t.enableVertexAttribArray(s.attributes.uv),t.uniform1i(y.occlusionMap,0),t.uniform1i(y.map,1),t.bindBuffer(t.ARRAY_BUFFER,s.vertexBuffer),t.vertexAttribPointer(w.vertex,2,t.FLOAT,!1,16,0),t.vertexAttribPointer(w.uv,2,t.FLOAT,!1,16,8),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,s.elementBuffer),t.disable(t.CULL_FACE),t.depthMask(!1);var x,b,E,_,T;for(x=0;d>x;x++)if(f=16/a,g.set(f*h,f),_=l[x],c.set(_.matrixWorld.elements[12],_.matrixWorld.elements[13],_.matrixWorld.elements[14]),c.applyMatrix4(n.matrixWorldInverse),c.applyProjection(n.projectionMatrix),v.copy(c),m.x=v.x*u+u,m.y=v.y*p+p,s.hasVertexTexture||m.x>0&&o>m.x&&m.y>0&&a>m.y)for(t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,s.tempTexture),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGB,m.x-8,m.y-8,16,16,0),t.uniform1i(y.renderType,0),t.uniform2f(y.scale,g.x,g.y),t.uniform3f(y.screenPosition,v.x,v.y,v.z),t.disable(t.BLEND),t.enable(t.DEPTH_TEST),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,s.occlusionTexture),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGBA,m.x-8,m.y-8,16,16,0),t.uniform1i(y.renderType,1),t.disable(t.DEPTH_TEST),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,s.tempTexture),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0),_.positionScreen.copy(v),_.customUpdateCallback?_.customUpdateCallback(_):_.updateLensFlares(),t.uniform1i(y.renderType,2),t.enable(t.BLEND),b=0,E=_.lensFlares.length;E>b;b++)T=_.lensFlares[b],T.opacity>.001&&T.scale>.001&&(v.x=T.x,v.y=T.y,v.z=T.z,f=T.size*T.scale/a,g.x=f*h,g.y=f,t.uniform3f(y.screenPosition,v.x,v.y,v.z),t.uniform2f(y.scale,g.x,g.y),t.uniform1f(y.rotation,T.rotation),t.uniform1f(y.opacity,T.opacity),t.uniform3f(y.color,T.color.r,T.color.g,T.color.b),i.setBlending(T.blending,T.blendEquation,T.blendSrc,T.blendDst),i.setTexture(T.texture,1),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0));t.enable(t.CULL_FACE),t.enable(t.DEPTH_TEST),t.depthMask(!0)}}},r.ShadowMapPlugin=function(){function e(e,t){var i=new r.DirectionalLight;i.isVirtual=!0,i.onlyShadow=!0,i.castShadow=!0,i.shadowCameraNear=e.shadowCameraNear,i.shadowCameraFar=e.shadowCameraFar,i.shadowCameraLeft=e.shadowCameraLeft,i.shadowCameraRight=e.shadowCameraRight,i.shadowCameraBottom=e.shadowCameraBottom,i.shadowCameraTop=e.shadowCameraTop,i.shadowCameraVisible=e.shadowCameraVisible,i.shadowDarkness=e.shadowDarkness,i.shadowBias=e.shadowCascadeBias[t],i.shadowMapWidth=e.shadowCascadeWidth[t],i.shadowMapHeight=e.shadowCascadeHeight[t],i.pointsWorld=[],i.pointsFrustum=[];for(var n=i.pointsWorld,s=i.pointsFrustum,o=0;8>o;o++)n[o]=new r.Vector3,s[o]=new r.Vector3;var a=e.shadowCascadeNearZ[t],l=e.shadowCascadeFarZ[t];return s[0].set(-1,-1,a),s[1].set(1,-1,a),s[2].set(-1,1,a),s[3].set(1,1,a),s[4].set(-1,-1,l),s[5].set(1,-1,l),s[6].set(-1,1,l),s[7].set(1,1,l),i}function t(e,t){var i=e.shadowCascadeArray[t];i.position.copy(e.position),i.target.position.copy(e.target.position),i.lookAt(i.target),i.shadowCameraVisible=e.shadowCameraVisible,i.shadowDarkness=e.shadowDarkness,i.shadowBias=e.shadowCascadeBias[t];var r=e.shadowCascadeNearZ[t],n=e.shadowCascadeFarZ[t],s=i.pointsFrustum;s[0].z=r,s[1].z=r,s[2].z=r,s[3].z=r,s[4].z=n,s[5].z=n,s[6].z=n,s[7].z=n}function i(e,t){var i=t.shadowCamera,n=t.pointsFrustum,s=t.pointsWorld;p.set(1/0,1/0,1/0),f.set(-1/0,-1/0,-1/0);for(var o=0;8>o;o++){var a=s[o];a.copy(n[o]),r.ShadowMapPlugin.__projector.unprojectVector(a,e),a.applyMatrix4(i.matrixWorldInverse),a.x<p.x&&(p.x=a.x),a.x>f.x&&(f.x=a.x),a.y<p.y&&(p.y=a.y),a.y>f.y&&(f.y=a.y),a.z<p.z&&(p.z=a.z),a.z>f.z&&(f.z=a.z)}i.left=p.x,i.right=f.x,i.top=f.y,i.bottom=p.y,i.updateProjectionMatrix()}function n(e){return e.material instanceof r.MeshFaceMaterial?e.material.materials[0]:e.material}var s,o,a,l,d,c,h=new r.Frustum,u=new r.Matrix4,p=new r.Vector3,f=new r.Vector3,g=new r.Vector3;this.init=function(e){s=e.context,o=e;var t=r.ShaderLib.depthRGBA,i=r.UniformsUtils.clone(t.uniforms);a=new r.ShaderMaterial({fragmentShader:t.fragmentShader,vertexShader:t.vertexShader,uniforms:i}),l=new r.ShaderMaterial({fragmentShader:t.fragmentShader,vertexShader:t.vertexShader,uniforms:i,morphTargets:!0}),d=new r.ShaderMaterial({fragmentShader:t.fragmentShader,vertexShader:t.vertexShader,uniforms:i,skinning:!0}),c=new r.ShaderMaterial({fragmentShader:t.fragmentShader,vertexShader:t.vertexShader,uniforms:i,morphTargets:!0,skinning:!0}),a._shadowPass=!0,l._shadowPass=!0,d._shadowPass=!0,c._shadowPass=!0},this.render=function(e,t){o.shadowMapEnabled&&o.shadowMapAutoUpdate&&this.update(e,t)},this.update=function(p,f){var v,m,y,w,x,b,E,_,T,C,M,S,A,R,U=[],D=0,P=null;for(s.clearColor(1,1,1,1),s.disable(s.BLEND),s.enable(s.CULL_FACE),s.frontFace(s.CCW),o.shadowMapCullFace===r.CullFaceFront?s.cullFace(s.FRONT):s.cullFace(s.BACK),o.setDepthTest(!0),v=0,m=p.__lights.length;m>v;v++)if(A=p.__lights[v],A.castShadow)if(A instanceof r.DirectionalLight&&A.shadowCascade)for(x=0;A.shadowCascadeCount>x;x++){var j;if(A.shadowCascadeArray[x])j=A.shadowCascadeArray[x];else{j=e(A,x),j.originalCamera=f;var B=new r.Gyroscope;B.position=A.shadowCascadeOffset,B.add(j),B.add(j.target),f.add(B),A.shadowCascadeArray[x]=j,console.log("Created virtualLight",j)}t(A,x),U[D]=j,D++}else U[D]=A,D++;for(v=0,m=U.length;m>v;v++){if(A=U[v],!A.shadowMap){var H=r.LinearFilter;o.shadowMapType===r.PCFSoftShadowMap&&(H=r.NearestFilter);var k={minFilter:H,magFilter:H,format:r.RGBAFormat};A.shadowMap=new r.WebGLRenderTarget(A.shadowMapWidth,A.shadowMapHeight,k),A.shadowMapSize=new r.Vector2(A.shadowMapWidth,A.shadowMapHeight),A.shadowMatrix=new r.Matrix4}if(!A.shadowCamera){if(A instanceof r.SpotLight)A.shadowCamera=new r.PerspectiveCamera(A.shadowCameraFov,A.shadowMapWidth/A.shadowMapHeight,A.shadowCameraNear,A.shadowCameraFar);else{if(!(A instanceof r.DirectionalLight)){console.error("Unsupported light type for shadow");continue}A.shadowCamera=new r.OrthographicCamera(A.shadowCameraLeft,A.shadowCameraRight,A.shadowCameraTop,A.shadowCameraBottom,A.shadowCameraNear,A.shadowCameraFar)}p.add(A.shadowCamera),p.autoUpdate===!0&&p.updateMatrixWorld()}for(A.shadowCameraVisible&&!A.cameraHelper&&(A.cameraHelper=new r.CameraHelper(A.shadowCamera),A.shadowCamera.add(A.cameraHelper)),A.isVirtual&&j.originalCamera==f&&i(f,A),b=A.shadowMap,E=A.shadowMatrix,_=A.shadowCamera,_.position.getPositionFromMatrix(A.matrixWorld),g.getPositionFromMatrix(A.target.matrixWorld),_.lookAt(g),_.updateMatrixWorld(),_.matrixWorldInverse.getInverse(_.matrixWorld),A.cameraHelper&&(A.cameraHelper.visible=A.shadowCameraVisible),A.shadowCameraVisible&&A.cameraHelper.update(),E.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),E.multiply(_.projectionMatrix),E.multiply(_.matrixWorldInverse),u.multiplyMatrices(_.projectionMatrix,_.matrixWorldInverse),h.setFromMatrix(u),o.setRenderTarget(b),o.clear(),R=p.__webglObjects,y=0,w=R.length;w>y;y++)M=R[y],S=M.object,M.render=!1,S.visible&&S.castShadow&&((S instanceof r.Mesh||S instanceof r.ParticleSystem)&&S.frustumCulled&&!h.intersectsObject(S)||(S._modelViewMatrix.multiplyMatrices(_.matrixWorldInverse,S.matrixWorld),M.render=!0));var L,I,N;for(y=0,w=R.length;w>y;y++)M=R[y],M.render&&(S=M.object,T=M.buffer,L=n(S),I=S.geometry.morphTargets.length>0&&L.morphTargets,N=S instanceof r.SkinnedMesh&&L.skinning,C=S.customDepthMaterial?S.customDepthMaterial:N?I?c:d:I?l:a,T instanceof r.BufferGeometry?o.renderBufferDirect(_,p.__lights,P,C,T,S):o.renderBuffer(_,p.__lights,P,C,T,S));for(R=p.__webglObjectsImmediate,y=0,w=R.length;w>y;y++)M=R[y],S=M.object,S.visible&&S.castShadow&&(S._modelViewMatrix.multiplyMatrices(_.matrixWorldInverse,S.matrixWorld),o.renderImmediateObject(_,p.__lights,P,a,S))}var F=o.getClearColor(),O=o.getClearAlpha();s.clearColor(F.r,F.g,F.b,O),s.enable(s.BLEND),o.shadowMapCullFace===r.CullFaceFront&&s.cullFace(s.BACK)}},r.ShadowMapPlugin.__projector=new r.Projector,r.SpritePlugin=function(){function e(e,t){var r=i.createProgram(),n=i.createShader(i.FRAGMENT_SHADER),s=i.createShader(i.VERTEX_SHADER),o="precision "+t+" float;\n";return i.shaderSource(n,o+e.fragmentShader),i.shaderSource(s,o+e.vertexShader),i.compileShader(n),i.compileShader(s),i.attachShader(r,n),i.attachShader(r,s),i.linkProgram(r),r}function t(e,t){return e.z!==t.z?t.z-e.z:t.id-e.id}var i,n,s,o={};this.init=function(t){i=t.context,n=t,s=t.getPrecision(),o.vertices=new Float32Array(16),o.faces=new Uint16Array(6);var a=0;o.vertices[a++]=-1,o.vertices[a++]=-1,o.vertices[a++]=0,o.vertices[a++]=0,o.vertices[a++]=1,o.vertices[a++]=-1,o.vertices[a++]=1,o.vertices[a++]=0,o.vertices[a++]=1,o.vertices[a++]=1,o.vertices[a++]=1,o.vertices[a++]=1,o.vertices[a++]=-1,o.vertices[a++]=1,o.vertices[a++]=0,o.vertices[a++]=1,a=0,o.faces[a++]=0,o.faces[a++]=1,o.faces[a++]=2,o.faces[a++]=0,o.faces[a++]=2,o.faces[a++]=3,o.vertexBuffer=i.createBuffer(),o.elementBuffer=i.createBuffer(),i.bindBuffer(i.ARRAY_BUFFER,o.vertexBuffer),i.bufferData(i.ARRAY_BUFFER,o.vertices,i.STATIC_DRAW),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,o.elementBuffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,o.faces,i.STATIC_DRAW),o.program=e(r.ShaderSprite.sprite,s),o.attributes={},o.uniforms={},o.attributes.position=i.getAttribLocation(o.program,"position"),o.attributes.uv=i.getAttribLocation(o.program,"uv"),o.uniforms.uvOffset=i.getUniformLocation(o.program,"uvOffset"),o.uniforms.uvScale=i.getUniformLocation(o.program,"uvScale"),o.uniforms.rotation=i.getUniformLocation(o.program,"rotation"),o.uniforms.scale=i.getUniformLocation(o.program,"scale"),o.uniforms.alignment=i.getUniformLocation(o.program,"alignment"),o.uniforms.color=i.getUniformLocation(o.program,"color"),o.uniforms.map=i.getUniformLocation(o.program,"map"),o.uniforms.opacity=i.getUniformLocation(o.program,"opacity"),o.uniforms.useScreenCoordinates=i.getUniformLocation(o.program,"useScreenCoordinates"),o.uniforms.sizeAttenuation=i.getUniformLocation(o.program,"sizeAttenuation"),o.uniforms.screenPosition=i.getUniformLocation(o.program,"screenPosition"),o.uniforms.modelViewMatrix=i.getUniformLocation(o.program,"modelViewMatrix"),o.uniforms.projectionMatrix=i.getUniformLocation(o.program,"projectionMatrix"),o.uniforms.fogType=i.getUniformLocation(o.program,"fogType"),o.uniforms.fogDensity=i.getUniformLocation(o.program,"fogDensity"),o.uniforms.fogNear=i.getUniformLocation(o.program,"fogNear"),o.uniforms.fogFar=i.getUniformLocation(o.program,"fogFar"),o.uniforms.fogColor=i.getUniformLocation(o.program,"fogColor"),o.uniforms.alphaTest=i.getUniformLocation(o.program,"alphaTest")},this.render=function(e,s,a,l){var d=e.__webglSprites,c=d.length;if(c){var h=o.attributes,u=o.uniforms,p=l/a,f=.5*a,g=.5*l;i.useProgram(o.program),i.enableVertexAttribArray(h.position),i.enableVertexAttribArray(h.uv),i.disable(i.CULL_FACE),i.enable(i.BLEND),i.bindBuffer(i.ARRAY_BUFFER,o.vertexBuffer),i.vertexAttribPointer(h.position,2,i.FLOAT,!1,16,0),i.vertexAttribPointer(h.uv,2,i.FLOAT,!1,16,8),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,o.elementBuffer),i.uniformMatrix4fv(u.projectionMatrix,!1,s.projectionMatrix.elements),i.activeTexture(i.TEXTURE0),i.uniform1i(u.map,0);var v=0,m=0,y=e.fog;y?(i.uniform3f(u.fogColor,y.color.r,y.color.g,y.color.b),y instanceof r.Fog?(i.uniform1f(u.fogNear,y.near),i.uniform1f(u.fogFar,y.far),i.uniform1i(u.fogType,1),v=1,m=1):y instanceof r.FogExp2&&(i.uniform1f(u.fogDensity,y.density),i.uniform1i(u.fogType,2),v=2,m=2)):(i.uniform1i(u.fogType,0),v=0,m=0);var w,x,b,E,_,T=[];for(w=0;c>w;w++)x=d[w],b=x.material,x.visible&&0!==b.opacity&&(b.useScreenCoordinates?x.z=-x.position.z:(x._modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,x.matrixWorld),x.z=-x._modelViewMatrix.elements[14]));for(d.sort(t),w=0;c>w;w++)x=d[w],b=x.material,x.visible&&0!==b.opacity&&b.map&&b.map.image&&b.map.image.width&&(i.uniform1f(u.alphaTest,b.alphaTest),b.useScreenCoordinates===!0?(i.uniform1i(u.useScreenCoordinates,1),i.uniform3f(u.screenPosition,(x.position.x*n.devicePixelRatio-f)/f,(g-x.position.y*n.devicePixelRatio)/g,Math.max(0,Math.min(1,x.position.z))),T[0]=n.devicePixelRatio,T[1]=n.devicePixelRatio):(i.uniform1i(u.useScreenCoordinates,0),i.uniform1i(u.sizeAttenuation,b.sizeAttenuation?1:0),i.uniformMatrix4fv(u.modelViewMatrix,!1,x._modelViewMatrix.elements),T[0]=1,T[1]=1),_=e.fog&&b.fog?m:0,v!==_&&(i.uniform1i(u.fogType,_),v=_),E=1/(b.scaleByViewport?l:1),T[0]*=E*p*x.scale.x,T[1]*=E*x.scale.y,i.uniform2f(u.uvScale,b.uvScale.x,b.uvScale.y),i.uniform2f(u.uvOffset,b.uvOffset.x,b.uvOffset.y),i.uniform2f(u.alignment,b.alignment.x,b.alignment.y),i.uniform1f(u.opacity,b.opacity),i.uniform3f(u.color,b.color.r,b.color.g,b.color.b),i.uniform1f(u.rotation,x.rotation),i.uniform2fv(u.scale,T),n.setBlending(b.blending,b.blendEquation,b.blendSrc,b.blendDst),n.setDepthTest(b.depthTest),n.setDepthWrite(b.depthWrite),n.setTexture(b.map,0),i.drawElements(i.TRIANGLES,6,i.UNSIGNED_SHORT,0));i.enable(i.CULL_FACE)}}},r.DepthPassPlugin=function(){function e(e){return e.material instanceof r.MeshFaceMaterial?e.material.materials[0]:e.material}this.enabled=!1,this.renderTarget=null;var t,i,n,s,o,a,l=new r.Frustum,d=new r.Matrix4;this.init=function(e){t=e.context,i=e;var l=r.ShaderLib.depthRGBA,d=r.UniformsUtils.clone(l.uniforms);n=new r.ShaderMaterial({fragmentShader:l.fragmentShader,vertexShader:l.vertexShader,uniforms:d}),s=new r.ShaderMaterial({fragmentShader:l.fragmentShader,vertexShader:l.vertexShader,uniforms:d,morphTargets:!0}),o=new r.ShaderMaterial({fragmentShader:l.fragmentShader,vertexShader:l.vertexShader,uniforms:d,skinning:!0}),a=new r.ShaderMaterial({fragmentShader:l.fragmentShader,vertexShader:l.vertexShader,uniforms:d,morphTargets:!0,skinning:!0}),n._shadowPass=!0,s._shadowPass=!0,o._shadowPass=!0,a._shadowPass=!0},this.render=function(e,t){this.enabled&&this.update(e,t)},this.update=function(c,h){var u,p,f,g,v,m,y,w=null;for(t.clearColor(1,1,1,1),t.disable(t.BLEND),i.setDepthTest(!0),c.autoUpdate===!0&&c.updateMatrixWorld(),h.matrixWorldInverse.getInverse(h.matrixWorld),d.multiplyMatrices(h.projectionMatrix,h.matrixWorldInverse),l.setFromMatrix(d),i.setRenderTarget(this.renderTarget),i.clear(),y=c.__webglObjects,u=0,p=y.length;p>u;u++)v=y[u],m=v.object,v.render=!1,m.visible&&((m instanceof r.Mesh||m instanceof r.ParticleSystem)&&m.frustumCulled&&!l.intersectsObject(m)||(m._modelViewMatrix.multiplyMatrices(h.matrixWorldInverse,m.matrixWorld),v.render=!0));var x,b,E;for(u=0,p=y.length;p>u;u++)if(v=y[u],v.render){if(m=v.object,f=v.buffer,m instanceof r.ParticleSystem&&!m.customDepthMaterial)continue;x=e(m),x&&i.setMaterialFaces(m.material),b=m.geometry.morphTargets.length>0&&x.morphTargets,E=m instanceof r.SkinnedMesh&&x.skinning,g=m.customDepthMaterial?m.customDepthMaterial:E?b?a:o:b?s:n,f instanceof r.BufferGeometry?i.renderBufferDirect(h,c.__lights,w,g,f,m):i.renderBuffer(h,c.__lights,w,g,f,m)}for(y=c.__webglObjectsImmediate,u=0,p=y.length;p>u;u++)v=y[u],m=v.object,m.visible&&(m._modelViewMatrix.multiplyMatrices(h.matrixWorldInverse,m.matrixWorld),i.renderImmediateObject(h,c.__lights,w,n,m));var _=i.getClearColor(),T=i.getClearAlpha();t.clearColor(_.r,_.g,_.b,T),t.enable(t.BLEND)}},r.ShaderFlares={lensFlareVertexTexture:{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 ) ) +","texture2D( occlusionMap, vec2( 0.5, 0.1 ) ) +","texture2D( occlusionMap, vec2( 0.9, 0.1 ) ) +","texture2D( occlusionMap, vec2( 0.9, 0.5 ) ) +","texture2D( occlusionMap, vec2( 0.9, 0.9 ) ) +","texture2D( occlusionMap, vec2( 0.5, 0.9 ) ) +","texture2D( occlusionMap, vec2( 0.1, 0.9 ) ) +","texture2D( occlusionMap, vec2( 0.1, 0.5 ) ) +","texture2D( occlusionMap, vec2( 0.5, 0.5 ) );","vVisibility = ( visibility.r / 9.0 ) *","( 1.0 - visibility.g / 9.0 ) *","( visibility.b / 9.0 ) *","( 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")},lensFlare:{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 +","texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a +","texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a +","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")}},r.ShaderSprite={sprite:{vertexShader:["uniform int useScreenCoordinates;","uniform int sizeAttenuation;","uniform vec3 screenPosition;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 scale;","uniform vec2 alignment;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uvOffset + uv * uvScale;","vec2 alignedPosition = position + alignment;","vec2 rotatedPosition;","rotatedPosition.x = ( cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y ) * scale.x;","rotatedPosition.y = ( sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y ) * scale.y;","vec4 finalPosition;","if( useScreenCoordinates != 0 ) {","finalPosition = vec4( screenPosition.xy + rotatedPosition, screenPosition.z, 1.0 );","} else {","finalPosition = projectionMatrix * modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","finalPosition.xy += rotatedPosition * ( sizeAttenuation == 1 ? 1.0 : finalPosition.z );","}","gl_Position = finalPosition;","}"].join("\n"),fragmentShader:["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")}},window.THREE=r,i("three",function(e){return function(){var t;return t||e.THREE}}(this)),i("libs/three/detector",[],function(){return Detector={canvas:!!window.CanvasRenderingContext2D,webgl:function(){try{return!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(e){return!1}}(),workers:!!window.Worker,fileapi:window.File&&window.FileReader&&window.FileList&&window.Blob,getWebGLErrorMessage:function(){var e=document.createElement("div");return e.style.fontFamily="monospace",e.style.fontSize="13px",e.style.textAlign="center",e.style.background="#eee",e.style.color="#000",e.style.padding="1em",e.style.width="475px",e.style.margin="5em auto 0",this.webgl||(e.innerHTML=window.WebGLRenderingContext?['Your graphics card does not seem to support <a href="https://web.archive.org/web/20140320040108/http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation">WebGL</a>.<br />','Find out how to get it <a href="https://web.archive.org/web/20140320040108/http://get.webgl.org/">here</a>.'].join("\n"):['Your browser does not seem to support <a href="https://web.archive.org/web/20140320040108/http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation">WebGL</a>.<br/>','Find out how to get it <a href="https://web.archive.org/web/20140320040108/http://get.webgl.org/">here</a>.'].join("\n")),e},addGetWebGLMessage:function(e){var t,i,r;e=e||{},t=void 0!==e.parent?e.parent:document.body,i=void 0!==e.id?e.id:"oldie",r=Detector.getWebGLErrorMessage(),r.id=i,t.appendChild(r)}}}),i("libs/three/stats",[],function(){var e=function(){var e,t,i,r,n,s,o,a,l=0,d=0,c=Date.now(),h=c,u=c,p=0,f=1e3,g=0,v=[[16,16,48],[0,255,255]],m=0,y=1e3,w=0,x=[[16,48,16],[0,255,0]];for(e=document.createElement("div"),e.style.cursor="pointer",e.style.width="80px",e.style.opacity="0.9",e.style.zIndex="10001",e.addEventListener("mousedown",function(e){e.preventDefault(),l=(l+1)%2,0==l?(i.style.display="block",s.style.display="none"):(i.style.display="none",s.style.display="block")},!1),i=document.createElement("div"),i.style.textAlign="left",i.style.lineHeight="1.2em",i.style.backgroundColor="rgb("+Math.floor(v[0][0]/2)+","+Math.floor(v[0][1]/2)+","+Math.floor(v[0][2]/2)+")",i.style.padding="0 0 3px 3px",e.appendChild(i),r=document.createElement("div"),r.style.fontFamily="Helvetica, Arial, sans-serif",r.style.fontSize="9px",r.style.color="rgb("+v[1][0]+","+v[1][1]+","+v[1][2]+")",r.style.fontWeight="bold",r.innerHTML="FPS",i.appendChild(r),n=document.createElement("div"),n.style.position="relative",n.style.width="74px",n.style.height="30px",n.style.backgroundColor="rgb("+v[1][0]+","+v[1][1]+","+v[1][2]+")",i.appendChild(n);74>n.children.length;)t=document.createElement("span"),t.style.width="1px",t.style.height="30px",t.style.cssFloat="left",t.style.backgroundColor="rgb("+v[0][0]+","+v[0][1]+","+v[0][2]+")",n.appendChild(t);for(s=document.createElement("div"),s.style.textAlign="left",s.style.lineHeight="1.2em",s.style.backgroundColor="rgb("+Math.floor(x[0][0]/2)+","+Math.floor(x[0][1]/2)+","+Math.floor(x[0][2]/2)+")",s.style.padding="0 0 3px 3px",s.style.display="none",e.appendChild(s),o=document.createElement("div"),o.style.fontFamily="Helvetica, Arial, sans-serif",o.style.fontSize="9px",o.style.color="rgb("+x[1][0]+","+x[1][1]+","+x[1][2]+")",o.style.fontWeight="bold",o.innerHTML="MS",s.appendChild(o),a=document.createElement("div"),a.style.position="relative",a.style.width="74px",a.style.height="30px",a.style.backgroundColor="rgb("+x[1][0]+","+x[1][1]+","+x[1][2]+")",s.appendChild(a);74>a.children.length;)t=document.createElement("span"),t.style.width="1px",t.style.height=30*Math.random()+"px",t.style.cssFloat="left",t.style.backgroundColor="rgb("+x[0][0]+","+x[0][1]+","+x[0][2]+")",a.appendChild(t);return{domElement:e,update:function(){c=Date.now(),m=c-h,y=Math.min(y,m),w=Math.max(w,m),o.textContent=m+" MS ("+y+"-"+w+")";var e=Math.min(30,30-30*(m/200));a.appendChild(a.firstChild).style.height=e+"px",h=c,d++,c>u+1e3&&(p=Math.round(1e3*d/(c-u)),f=Math.min(f,p),g=Math.max(g,p),r.textContent=p+" FPS ("+f+"-"+g+")",e=Math.min(30,30-30*(p/100)),n.appendChild(n.firstChild).style.height=e+"px",u=c,d=0)
}}};return e}),i("scene/Materials/EditorMaterials",["jquery","underscore","three"],function(e,t,i){var r={wireframe:{wireframe:!0,transparent:!0,blending:i.MultiplyBlending,uniforms:{color:{type:"c",value:new i.Color(11184810)}},vertexShader:[i.ShaderChunk.skinning_pars_vertex,"void main() {",i.ShaderChunk.skinbase_vertex,i.ShaderChunk.skinning_vertex,i.ShaderChunk.default_vertex,"gl_Position.z = ( (gl_Position.z / gl_Position.w) - 0.00005 ) * gl_Position.w;","}"].join("\n"),fragmentShader:["uniform vec3 color;","void main() {","gl_FragColor = vec4( color, 1.0 );","}"].join("\n")},basicUI:{depthTest:!0,depthWrite:!0,transparent:!0,side:i.DoubleSide,uniforms:{color:{type:"c",value:new i.Color(16711680)},opacity:{type:"f",value:.5}},vertexShader:["varying vec3 vNormal;","void main() {",i.ShaderChunk.defaultnormal_vertex,i.ShaderChunk.default_vertex,"vNormal = normalize(transformedNormal);","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform float opacity;","varying vec3 vNormal;","void main() {","float power = clamp( 0.1 + 0.9 * (1.0 - vNormal.z * vNormal.z ), 0.0, 1.0);","vec3 outColor = mix( color, color * 0.5, power * 2.0 - 1.0);","gl_FragColor = vec4( outColor, opacity );","}"].join("\n")},skybox:{side:i.BackSide,useFog:!0,fog:!0,vertexColors:i.VertexColors,uniforms:i.UniformsUtils.merge([i.UniformsLib.fog,{color:{type:"c",value:new i.Color(16711680)}},{skyboxFogPower:{type:"f",value:0}},{skyboxFogScale:{type:"f",value:0}},{environmentTexture:{type:"t",value:null}}]),vertexShader:["varying vec3 vCameraVector;","void main() {","vec4 worldPosition = modelMatrix * vec4( position, 1.0 );","vCameraVector = worldPosition.xyz - cameraPosition;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:[i.ShaderChunk.fog_pars_fragment,"uniform vec3 color;","uniform float skyboxFogPower;","uniform float skyboxFogScale;","uniform samplerCube environmentTexture;","varying vec3 vCameraVector;","void main() {","vec4 environmentColor = textureCube( environmentTexture, vec3( -vCameraVector.x, vCameraVector.yz ) );","gl_FragColor = vec4( environmentColor.xyz, 1.0 );","#ifdef USE_FOG","vec3 cameraVectorN = normalize( vCameraVector );","float fogFactor = clamp( pow( (1.0 - cameraVectorN.y), ( skyboxFogPower) * 12.0 ) + (skyboxFogScale * 2.0 - 1.0), 0.0, 1.0);","gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","#endif","}"].join("\n")},picking:{depthTest:!0,depthWrite:!0,transparent:!1,side:i.DoubleSide,uniforms:{color:{type:"c",value:16711680}},vertexShader:[i.ShaderChunk.skinning_pars_vertex,"void main() {",i.ShaderChunk.skinbase_vertex,i.ShaderChunk.skinnormal_vertex,i.ShaderChunk.defaultnormal_vertex,i.ShaderChunk.skinning_vertex,i.ShaderChunk.default_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 color;","void main() {","gl_FragColor = vec4( color, 1.0 );","}"].join("\n")},pickingUI:{side:i.DoubleSide,uniforms:{color:{type:"c",value:16711680}},vertexShader:["void main() {",i.ShaderChunk.defaultnormal_vertex,i.ShaderChunk.default_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 color;","void main() {","gl_FragColor = vec4( color, 1.0 );","}"].join("\n")},skinWeights:{side:i.DoubleSide,uniforms:{},vertexShader:[i.ShaderChunk.skinning_pars_vertex,"varying vec3 vColor;","void main() {",i.ShaderChunk.skinbase_vertex,i.ShaderChunk.skinning_vertex,i.ShaderChunk.default_vertex,"#ifdef USE_SKINNING","vColor = vec3( skinWeight.x, skinWeight.y, 0);","#else","vColor = vec3( 0.0, 0.0, 0);","#endif","}"].join("\n"),fragmentShader:["varying vec3 vColor;","void main() {","gl_FragColor = vec4( vColor, 1.0 );","}"].join("\n")},skinIndices:{side:i.DoubleSide,uniforms:{},vertexShader:[i.ShaderChunk.skinning_pars_vertex,"varying vec3 vColor;","void main() {",i.ShaderChunk.skinbase_vertex,i.ShaderChunk.skinning_vertex,i.ShaderChunk.default_vertex,"#ifdef USE_SKINNING","vColor = vec3( pow(skinIndex.x * 0.0025, 0.125), pow(skinIndex.y * 0.0025, 0.125), 0);","#else","vColor = vec3( 0.0, 0.0, 0);","#endif","}"].join("\n"),fragmentShader:["varying vec3 vColor;","void main() {","gl_FragColor = vec4( vColor, 1.0 );","}"].join("\n")}};return r}),i("libs/three/shaders/BasicShader",["three"],function(e){e.BasicShader={uniforms:{},vertexShader:["void main() {","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["void main() {","gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );","}"].join("\n")}}),i("libs/three/shaders/BleachBypassShader",["three"],function(e){e.BleachBypassShader={uniforms:{tDiffuse:{type:"t",value:null},opacity:{type:"f",value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 base = texture2D( tDiffuse, vUv );","vec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );","float lum = dot( lumCoeff, base.rgb );","vec3 blend = vec3( lum );","float L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );","vec3 result1 = 2.0 * base.rgb * blend;","vec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );","vec3 newColor = mix( result1, result2, L );","float A2 = opacity * base.a;","vec3 mixRGB = A2 * newColor.rgb;","mixRGB += ( ( 1.0 - A2 ) * base.rgb );","gl_FragColor = vec4( mixRGB, base.a );","}"].join("\n")}}),i("libs/three/shaders/BokehShader",["three"],function(e){e.BokehShader={uniforms:{tColor:{type:"t",value:null},tDepth:{type:"t",value:null},focus:{type:"f",value:1},aspect:{type:"f",value:1},aperture:{type:"f",value:.025},maxblur:{type:"f",value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float maxblur;","uniform float aperture;","uniform float focus;","uniform float aspect;","void main() {","vec2 aspectcorrect = vec2( 1.0, aspect );","vec4 depth1 = texture2D( tDepth, vUv );","float factor = depth1.x - focus;","vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );","vec2 dofblur9 = dofblur * 0.9;","vec2 dofblur7 = dofblur * 0.7;","vec2 dofblur4 = dofblur * 0.4;","vec4 col = vec4( 0.0 );","col += texture2D( tColor, vUv.xy );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );","gl_FragColor = col / 41.0;","gl_FragColor.a = 1.0;","}"].join("\n")}}),i("libs/three/shaders/BrightnessContrastShader",["three"],function(e){e.BrightnessContrastShader={uniforms:{tDiffuse:{type:"t",value:null},brightness:{type:"f",value:0},contrast:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float brightness;","uniform float contrast;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb += brightness;","if (contrast > 0.0) {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;","} else {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;","}","}"].join("\n")}}),i("libs/three/shaders/ColorCorrectionShader",["three"],function(e){e.ColorCorrectionShader={uniforms:{tDiffuse:{type:"t",value:null},powRGB:{type:"v3",value:new e.Vector3(2,2,2)},mulRGB:{type:"v3",value:new e.Vector3(1,1,1)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 powRGB;","uniform vec3 mulRGB;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb = mulRGB * pow( gl_FragColor.rgb, powRGB );","}"].join("\n")}}),i("libs/three/shaders/ColorifyShader",["three"],function(e){e.ColorifyShader={uniforms:{tDiffuse:{type:"t",value:null},color:{type:"c",value:new e.Color(16777215)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","gl_FragColor = vec4( v * color, texel.w );","}"].join("\n")}}),i("libs/three/shaders/ConvolutionShader",["three"],function(e){e.ConvolutionShader={defines:{KERNEL_SIZE_FLOAT:"25.0",KERNEL_SIZE_INT:"25"},uniforms:{tDiffuse:{type:"t",value:null},uImageIncrement:{type:"v2",value:new e.Vector2(.001953125,0)},cKernel:{type:"fv1",value:[]}},vertexShader:["uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float cKernel[ KERNEL_SIZE_INT ];","uniform sampler2D tDiffuse;","uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vec2 imageCoord = vUv;","vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );","for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {","sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];","imageCoord += uImageIncrement;","}","gl_FragColor = sum;","}"].join("\n"),buildKernel:function(e){function t(e,t){return Math.exp(-(e*e)/(2*t*t))}var i,r,n,s,o=25,a=2*Math.ceil(3*e)+1;for(a>o&&(a=o),s=.5*(a-1),r=Array(a),n=0,i=0;a>i;++i)r[i]=t(i-s,e),n+=r[i];for(i=0;a>i;++i)r[i]/=n;return r}}}),i("libs/three/shaders/CopyShader",["three"],function(e){e.CopyShader={uniforms:{tDiffuse:{type:"t",value:null},opacity:{type:"f",value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = opacity * texel;","}"].join("\n")}}),i("libs/three/shaders/DOFMipMapShader",["three"],function(e){e.DOFMipMapShader={uniforms:{tColor:{type:"t",value:null},tDepth:{type:"t",value:null},focus:{type:"f",value:1},maxblur:{type:"f",value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float focus;","uniform float maxblur;","uniform sampler2D tColor;","uniform sampler2D tDepth;","varying vec2 vUv;","void main() {","vec4 depth = texture2D( tDepth, vUv );","float factor = depth.x - focus;","vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );","gl_FragColor = col;","gl_FragColor.a = 1.0;","}"].join("\n")}}),i("libs/three/shaders/DotScreenShader",["three"],function(e){e.DotScreenShader={uniforms:{tDiffuse:{type:"t",value:null},tSize:{type:"v2",value:new e.Vector2(256,256)},center:{type:"v2",value:new e.Vector2(.5,.5)},angle:{type:"f",value:1.57},scale:{type:"f",value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec2 center;","uniform float angle;","uniform float scale;","uniform vec2 tSize;","uniform sampler2D tDiffuse;","varying vec2 vUv;","float pattern() {","float s = sin( angle ), c = cos( angle );","vec2 tex = vUv * tSize - center;","vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;","return ( sin( point.x ) * sin( point.y ) ) * 4.0;","}","void main() {","vec4 color = texture2D( tDiffuse, vUv );","float average = ( color.r + color.g + color.b ) / 3.0;","gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );","}"].join("\n")}}),i("libs/three/shaders/FilmShader",["three"],function(e){e.FilmShader={uniforms:{tDiffuse:{type:"t",value:null},time:{type:"f",value:0},nIntensity:{type:"f",value:.5},sIntensity:{type:"f",value:.05},sCount:{type:"f",value:4096},grayscale:{type:"i",value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float time;","uniform bool grayscale;","uniform float nIntensity;","uniform float sIntensity;","uniform float sCount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 cTextureScreen = texture2D( tDiffuse, vUv );","float x = vUv.x * vUv.y * time * 1000.0;","x = mod( x, 13.0 ) * mod( x, 123.0 );","float dx = mod( x, 0.01 );","vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx * 100.0, 0.0, 1.0 );","vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );","cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;","cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );","if( grayscale ) {","cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );","}","gl_FragColor = vec4( cResult, cTextureScreen.a );","}"].join("\n")}}),i("libs/three/shaders/FocusShader",["three"],function(e){e.FocusShader={uniforms:{tDiffuse:{type:"t",value:null},screenWidth:{type:"f",value:1024},screenHeight:{type:"f",value:1024},sampleDistance:{type:"f",value:.94},waveFactor:{type:"f",value:.00125}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float screenWidth;","uniform float screenHeight;","uniform float sampleDistance;","uniform float waveFactor;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color, org, tmp, add;","float sample_dist, f;","vec2 vin;","vec2 uv = vUv;","add = color = org = texture2D( tDiffuse, uv );","vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );","sample_dist = dot( vin, vin ) * 2.0;","f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;","vec2 sampleSize = vec2( 1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );","add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );","color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );","gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );","}"].join("\n")}}),i("libs/three/shaders/FXAAShader",["three"],function(e){e.FXAAShader={uniforms:{tDiffuse:{type:"t",value:null},resolution:{type:"v2",value:new e.Vector2(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","#define FXAA_REDUCE_MIN (1.0/128.0)","#define FXAA_REDUCE_MUL (1.0/8.0)","#define FXAA_SPAN_MAX 8.0","void main() {","vec3 rgbNW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ).xyz;","vec3 rgbNE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ).xyz;","vec3 rgbSW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ).xyz;","vec3 rgbSE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ).xyz;","vec4 rgbaM = texture2D( tDiffuse, gl_FragCoord.xy * resolution );","vec3 rgbM = rgbaM.xyz;","float opacity = rgbaM.w;","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float lumaNW = dot( rgbNW, luma );","float lumaNE = dot( rgbNE, luma );","float lumaSW = dot( rgbSW, luma );","float lumaSE = dot( rgbSE, luma );","float lumaM = dot( rgbM, luma );","float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );","float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );","vec2 dir;","dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));","dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));","float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );","float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );","dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),","max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),","dir * rcpDirMin)) * resolution;","vec3 rgbA = 0.5 * (","texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ).xyz +","texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ).xyz );","vec3 rgbB = rgbA * 0.5 + 0.25 * (","texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * -0.5 ).xyz +","texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * 0.5 ).xyz );","float lumaB = dot( rgbB, luma );","if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) ) {","gl_FragColor = vec4( rgbA, opacity );","} else {","gl_FragColor = vec4( rgbB, opacity );","}","}"].join("\n")}}),i("libs/three/shaders/HorizontalBlurShader",["three"],function(e){e.HorizontalBlurShader={uniforms:{tDiffuse:{type:"t",value:null},h:{type:"f",value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")}}),i("libs/three/shaders/HorizontalTiltShiftShader",["three"],function(e){e.HorizontalTiltShiftShader={uniforms:{tDiffuse:{type:"t",value:null},h:{type:"f",value:1/512},r:{type:"f",value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float hh = h * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")}}),i("libs/three/shaders/HueSaturationShader",["three"],function(e){e.HueSaturationShader={uniforms:{tDiffuse:{type:"t",value:null},hue:{type:"f",value:0},saturation:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float hue;","uniform float saturation;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","float angle = hue * 3.14159265;","float s = sin(angle), c = cos(angle);","vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;","float len = length(gl_FragColor.rgb);","gl_FragColor.rgb = vec3(","dot(gl_FragColor.rgb, weights.xyz),","dot(gl_FragColor.rgb, weights.zxy),","dot(gl_FragColor.rgb, weights.yzx)",");","float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;","if (saturation > 0.0) {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));","} else {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);","}","}"].join("\n")}}),i("libs/three/shaders/LuminosityShader",["three"],function(e){e.LuminosityShader={uniforms:{tDiffuse:{type:"t",value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","gl_FragColor = vec4( v, v, v, texel.w );","}"].join("\n")}}),i("libs/three/shaders/NormalMapShader",["three"],function(e){e.NormalMapShader={uniforms:{heightMap:{type:"t",value:null},resolution:{type:"v2",value:new e.Vector2(512,512)},scale:{type:"v2",value:new e.Vector2(1,1)},height:{type:"f",value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float height;","uniform vec2 resolution;","uniform sampler2D heightMap;","varying vec2 vUv;","void main() {","float val = texture2D( heightMap, vUv ).x;","float valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;","float valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;","gl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height ) ) + 0.5 ), 1.0 );","}"].join("\n")}}),i("libs/three/shaders/SepiaShader",["three"],function(e){e.SepiaShader={uniforms:{tDiffuse:{type:"t",value:null},amount:{type:"f",value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float amount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color = texture2D( tDiffuse, vUv );","vec3 c = color.rgb;","color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );","color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );","color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );","gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );","}"].join("\n")}}),i("libs/three/shaders/SSAOShader",["three"],function(e){e.SSAOShader={uniforms:{tDiffuse:{type:"t",value:null},tDepth:{type:"t",value:null},size:{type:"v2",value:new e.Vector2(512,512)},cameraNear:{type:"f",value:1},cameraFar:{type:"f",value:100},fogNear:{type:"f",value:5},fogFar:{type:"f",value:100},fogEnabled:{type:"i",value:0},onlyAO:{type:"i",value:0},aoClamp:{type:"f",value:.3},lumInfluence:{type:"f",value:.9}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float cameraNear;","uniform float cameraFar;","uniform float fogNear;","uniform float fogFar;","uniform bool fogEnabled;","uniform bool onlyAO;","uniform vec2 size;","uniform float aoClamp;","uniform float lumInfluence;","uniform sampler2D tDiffuse;","uniform sampler2D tDepth;","varying vec2 vUv;","#define DL 2.399963229728653","#define EULER 2.718281828459045","float width = size.x;","float height = size.y;","float cameraFarPlusNear = cameraFar + cameraNear;","float cameraFarMinusNear = cameraFar - cameraNear;","float cameraCoef = 2.0 * cameraNear;","const int samples = 8;","const float radius = 5.0;","const bool useNoise = false;","const float noiseAmount = 0.0003;","const float diffArea = 0.4;","const float gDisplace = 0.4;","const vec3 onlyAOColor = vec3( 1.0, 0.7, 0.5 );","float unpackDepth( const in vec4 rgba_depth ) {","const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );","float depth = dot( rgba_depth, bit_shift );","return depth;","}","vec2 rand( const vec2 coord ) {","vec2 noise;","if ( useNoise ) {","float nx = dot ( coord, vec2( 12.9898, 78.233 ) );","float ny = dot ( coord, vec2( 12.9898, 78.233 ) * 2.0 );","noise = clamp( fract ( 43758.5453 * sin( vec2( nx, ny ) ) ), 0.0, 1.0 );","} else {","float ff = fract( 1.0 - coord.s * ( width / 2.0 ) );","float gg = fract( coord.t * ( height / 2.0 ) );","noise = vec2( 0.25, 0.75 ) * vec2( ff ) + vec2( 0.75, 0.25 ) * gg;","}","return ( noise * 2.0 - 1.0 ) * noiseAmount;","}","float doFog() {","float zdepth = unpackDepth( texture2D( tDepth, vUv ) );","float depth = -cameraFar * cameraNear / ( zdepth * cameraFarMinusNear - cameraFar );","return smoothstep( fogNear, fogFar, depth );","}","float readDepth( const in vec2 coord ) {","return cameraCoef / ( cameraFarPlusNear - unpackDepth( texture2D( tDepth, coord ) ) * cameraFarMinusNear );","}","float compareDepths( const in float depth1, const in float depth2, inout int far ) {","float garea = 2.0;","float diff = ( depth1 - depth2 ) * 100.0;","if ( diff < gDisplace ) {","garea = diffArea;","} else {","far = 1;","}","float dd = diff - gDisplace;","float gauss = pow( EULER, -2.0 * dd * dd / ( garea * garea ) );","return gauss;","}","float calcAO( float depth, float dw, float dh ) {","float dd = radius - depth * radius;","vec2 vv = vec2( dw, dh );","vec2 coord1 = vUv + dd * vv;","vec2 coord2 = vUv - dd * vv;","float temp1 = 0.0;","float temp2 = 0.0;","int far = 0;","temp1 = compareDepths( depth, readDepth( coord1 ), far );","if ( far > 0 ) {","temp2 = compareDepths( readDepth( coord2 ), depth, far );","temp1 += ( 1.0 - temp1 ) * temp2;","}","return temp1;","}","void main() {","vec2 noise = rand( vUv );","float depth = readDepth( vUv );","float tt = clamp( depth, aoClamp, 1.0 );","float w = ( 1.0 / width ) / tt + ( noise.x * ( 1.0 - noise.x ) );","float h = ( 1.0 / height ) / tt + ( noise.y * ( 1.0 - noise.y ) );","float pw;","float ph;","float ao;","float dz = 1.0 / float( samples );","float z = 1.0 - dz / 2.0;","float l = 0.0;","for ( int i = 0; i <= samples; i ++ ) {","float r = sqrt( 1.0 - z );","pw = cos( l ) * r;","ph = sin( l ) * r;","ao += calcAO( depth, pw * w, ph * h );","z = z - dz;","l = l + DL;","}","ao /= float( samples );","ao = 1.0 - ao;","if ( fogEnabled ) {","ao = mix( ao, 1.0, doFog() );","}","vec3 color = texture2D( tDiffuse, vUv ).rgb;","vec3 lumcoeff = vec3( 0.299, 0.587, 0.114 );","float lum = dot( color.rgb, lumcoeff );","vec3 luminance = vec3( lum );","vec3 final = vec3( color * mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","if ( onlyAO ) {","final = onlyAOColor * vec3( mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","}","gl_FragColor = vec4( final, 1.0 );","}"].join("\n")}}),i("libs/three/shaders/TriangleBlurShader",["three"],function(e){e.TriangleBlurShader={uniforms:{texture:{type:"t",value:null},delta:{type:"v2",value:new e.Vector2(1,1)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define ITERATIONS 10.0","uniform sampler2D texture;","uniform vec2 delta;","varying vec2 vUv;","float random( vec3 scale, float seed ) {","return fract( sin( dot( gl_FragCoord.xyz + seed, scale ) ) * 43758.5453 + seed );","}","void main() {","vec4 color = vec4( 0.0 );","float total = 0.0;","float offset = random( vec3( 12.9898, 78.233, 151.7182 ), 0.0 );","for ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {","float percent = ( t + offset - 0.5 ) / ITERATIONS;","float weight = 1.0 - abs( percent );","color += texture2D( texture, vUv + delta * percent ) * weight;","total += weight;","}","gl_FragColor = color / total;","}"].join("\n")}
}),i("libs/three/shaders/UnpackDepthRGBAShader",["three"],function(e){e.UnpackDepthRGBAShader={uniforms:{tDiffuse:{type:"t",value:null},opacity:{type:"f",value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","float unpackDepth( const in vec4 rgba_depth ) {","const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );","float depth = dot( rgba_depth, bit_shift );","return depth;","}","void main() {","float depth = 1.0 - unpackDepth( texture2D( tDiffuse, vUv ) );","gl_FragColor = opacity * vec4( vec3( depth ), 1.0 );","}"].join("\n")}}),i("libs/three/shaders/VerticalBlurShader",["three"],function(e){e.VerticalBlurShader={uniforms:{tDiffuse:{type:"t",value:null},v:{type:"f",value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")}}),i("libs/three/shaders/VerticalTiltShiftShader",["three"],function(e){e.VerticalTiltShiftShader={uniforms:{tDiffuse:{type:"t",value:null},v:{type:"f",value:1/512},r:{type:"f",value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float vv = v * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")}}),i("libs/three/shaders/VignetteShader",["three"],function(e){e.VignetteShader={uniforms:{tDiffuse:{type:"t",value:null},offset:{type:"f",value:1},darkness:{type:"f",value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float offset;","uniform float darkness;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );","gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );","}"].join("\n")}}),i("libs/three/postprocessing/EffectComposer",["three"],function(e){e.EffectComposer=function(t,i){if(this.renderer=t,void 0===i){var r=window.innerWidth||1,n=window.innerHeight||1,s={minFilter:e.LinearFilter,magFilter:e.LinearFilter,format:e.RGBFormat,stencilBuffer:!1};i=new e.WebGLRenderTarget(r,n,s)}this.renderTarget1=i,this.renderTarget2=i.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.passes=[],void 0===e.CopyShader&&console.error("THREE.EffectComposer relies on THREE.CopyShader"),this.copyPass=new e.ShaderPass(e.CopyShader)},e.EffectComposer.prototype={swapBuffers:function(){var e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e},addPass:function(e){this.passes.push(e)},render:function(t){this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2;var i,r,n=!1,s=this.passes.length;for(r=0;s>r;r++)if(i=this.passes[r],i.enabled){if(i.render(this.renderer,this.writeBuffer,this.readBuffer,t,n),i.needsSwap){if(n){var o=this.renderer.context;o.stencilFunc(o.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,t),o.stencilFunc(o.EQUAL,1,4294967295)}this.swapBuffers()}i instanceof e.MaskPass?n=!0:i instanceof e.ClearMaskPass&&(n=!1)}},reset:function(e){void 0===e&&(e=this.renderTarget1.clone(),e.width=window.innerWidth,e.height=window.innerHeight),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2},setSize:function(e,t){var i=this.renderTarget1.clone();i.width=e,i.height=t,this.reset(i)}},e.EffectComposer.camera=new e.OrthographicCamera(-1,1,1,-1,0,1),e.EffectComposer.quad=new e.Mesh(new e.PlaneGeometry(2,2),null),e.EffectComposer.scene=new e.Scene,e.EffectComposer.scene.add(e.EffectComposer.quad)}),i("libs/three/postprocessing/RenderPass",["three"],function(e){e.RenderPass=function(t,i,r,n,s){this.scene=t,this.camera=i,this.overrideMaterial=r,this.clearColor=n,this.clearAlpha=void 0!==s?s:1,this.oldClearColor=new e.Color,this.oldClearAlpha=1,this.enabled=!0,this.clear=!0,this.needsSwap=!1},e.RenderPass.prototype={render:function(e,t,i){this.scene.overrideMaterial=this.overrideMaterial,this.scene.overrideUniforms=this.overrideUniforms,this.clearColor&&(this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,i,this.clear),this.clearColor&&e.setClearColor(this.oldClearColor,this.oldClearAlpha),this.scene.overrideMaterial=null}}}),i("libs/three/postprocessing/BloomPass",["three"],function(e){e.BloomPass=function(t,i,r,n){t=void 0!==t?t:1,i=void 0!==i?i:25,r=void 0!==r?r:4,n=void 0!==n?n:256;var s={minFilter:e.LinearFilter,magFilter:e.LinearFilter,format:e.RGBFormat};this.renderTargetX=new e.WebGLRenderTarget(n,n,s),this.renderTargetY=new e.WebGLRenderTarget(n,n,s),void 0===e.CopyShader&&console.error("THREE.BloomPass relies on THREE.CopyShader");var o=e.CopyShader;this.copyUniforms=e.UniformsUtils.clone(o.uniforms),this.copyUniforms.opacity.value=t,this.materialCopy=new e.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:o.vertexShader,fragmentShader:o.fragmentShader,blending:e.AdditiveBlending,transparent:!0}),void 0===e.ConvolutionShader&&console.error("THREE.BloomPass relies on THREE.ConvolutionShader");var a=e.ConvolutionShader;this.convolutionUniforms=e.UniformsUtils.clone(a.uniforms),this.convolutionUniforms.uImageIncrement.value=e.BloomPass.blurx,this.convolutionUniforms.cKernel.value=e.ConvolutionShader.buildKernel(r),this.materialConvolution=new e.ShaderMaterial({uniforms:this.convolutionUniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader,defines:{KERNEL_SIZE_FLOAT:i.toFixed(1),KERNEL_SIZE_INT:i.toFixed(0)}}),this.enabled=!0,this.needsSwap=!1,this.clear=!1},e.BloomPass.prototype={render:function(t,i,r,n,s){s&&t.context.disable(t.context.STENCIL_TEST),e.EffectComposer.quad.material=this.materialConvolution,this.convolutionUniforms.tDiffuse.value=r,this.convolutionUniforms.uImageIncrement.value=e.BloomPass.blurX,t.render(e.EffectComposer.scene,e.EffectComposer.camera,this.renderTargetX,!0),this.convolutionUniforms.tDiffuse.value=this.renderTargetX,this.convolutionUniforms.uImageIncrement.value=e.BloomPass.blurY,t.render(e.EffectComposer.scene,e.EffectComposer.camera,this.renderTargetY,!0),e.EffectComposer.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetY,s&&t.context.enable(t.context.STENCIL_TEST),t.render(e.EffectComposer.scene,e.EffectComposer.camera,r,this.clear)}},e.BloomPass.blurX=new e.Vector2(.001953125,0),e.BloomPass.blurY=new e.Vector2(0,.001953125)}),i("libs/three/postprocessing/FilmPass",["three"],function(e){e.FilmPass=function(t,i,r,n){void 0===e.FilmShader&&console.error("THREE.FilmPass relies on THREE.FilmShader");var s=e.FilmShader;this.uniforms=e.UniformsUtils.clone(s.uniforms),this.material=new e.ShaderMaterial({uniforms:this.uniforms,vertexShader:s.vertexShader,fragmentShader:s.fragmentShader}),void 0!==n&&(this.uniforms.grayscale.value=n),void 0!==t&&(this.uniforms.nIntensity.value=t),void 0!==i&&(this.uniforms.sIntensity.value=i),void 0!==r&&(this.uniforms.sCount.value=r),this.enabled=!0,this.renderToScreen=!1,this.needsSwap=!0},e.FilmPass.prototype={render:function(t,i,r,n){this.uniforms.tDiffuse.value=r,this.uniforms.time.value+=n,e.EffectComposer.quad.material=this.material,this.renderToScreen?t.render(e.EffectComposer.scene,e.EffectComposer.camera):t.render(e.EffectComposer.scene,e.EffectComposer.camera,i,!1)}}}),i("libs/three/postprocessing/DotScreenPass",["three"],function(e){e.DotScreenPass=function(t,i,r){void 0===e.DotScreenShader&&console.error("THREE.DotScreenPass relies on THREE.DotScreenShader");var n=e.DotScreenShader;this.uniforms=e.UniformsUtils.clone(n.uniforms),void 0!==t&&this.uniforms.center.value.copy(t),void 0!==i&&(this.uniforms.angle.value=i),void 0!==r&&(this.uniforms.scale.value=r),this.material=new e.ShaderMaterial({uniforms:this.uniforms,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}),this.enabled=!0,this.renderToScreen=!1,this.needsSwap=!0},e.DotScreenPass.prototype={render:function(t,i,r){this.uniforms.tDiffuse.value=r,this.uniforms.tSize.value.set(r.width,r.height),e.EffectComposer.quad.material=this.material,this.renderToScreen?t.render(e.EffectComposer.scene,e.EffectComposer.camera):t.render(e.EffectComposer.scene,e.EffectComposer.camera,i,!1)}}}),i("libs/three/postprocessing/TexturePass",["three"],function(e){e.TexturePass=function(t,i){void 0===e.CopyShader&&console.error("THREE.TexturePass relies on THREE.CopyShader");var r=e.CopyShader;this.uniforms=e.UniformsUtils.clone(r.uniforms),this.uniforms.opacity.value=void 0!==i?i:1,this.uniforms.tDiffuse.value=t,this.material=new e.ShaderMaterial({uniforms:this.uniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader}),this.enabled=!0,this.needsSwap=!1},e.TexturePass.prototype={render:function(t,i,r){e.EffectComposer.quad.material=this.material,t.render(e.EffectComposer.scene,e.EffectComposer.camera,r)}}}),i("libs/three/postprocessing/ShaderPass",["three"],function(e){e.ShaderPass=function(t,i){this.textureID=void 0!==i?i:"tDiffuse",this.uniforms=e.UniformsUtils.clone(t.uniforms),this.material=new e.ShaderMaterial({uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader}),this.renderToScreen=!1,this.enabled=!0,this.needsSwap=!0,this.clear=!1},e.ShaderPass.prototype={render:function(t,i,r){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r),e.EffectComposer.quad.material=this.material,this.renderToScreen?t.render(e.EffectComposer.scene,e.EffectComposer.camera):t.render(e.EffectComposer.scene,e.EffectComposer.camera,i,this.clear)}}}),i("libs/three/postprocessing/MaskPass",["three"],function(e){e.MaskPass=function(e,t){this.scene=e,this.camera=t,this.enabled=!0,this.clear=!0,this.needsSwap=!1,this.inverse=!1},e.MaskPass.prototype={render:function(e,t,i){var r=e.context;r.colorMask(!1,!1,!1,!1),r.depthMask(!1);var n,s;this.inverse?(n=0,s=1):(n=1,s=0),r.enable(r.STENCIL_TEST),r.stencilOp(r.REPLACE,r.REPLACE,r.REPLACE),r.stencilFunc(r.ALWAYS,n,4294967295),r.clearStencil(s),e.render(this.scene,this.camera,i,this.clear),e.render(this.scene,this.camera,t,this.clear),r.colorMask(!0,!0,!0,!0),r.depthMask(!0),r.stencilFunc(r.EQUAL,1,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP)}},e.ClearMaskPass=function(){this.enabled=!0},e.ClearMaskPass.prototype={render:function(e){var t=e.context;t.disable(t.STENCIL_TEST)}}}),i("libs/three/effects/AnaglyphEffect",["three"],function(e){e.AnaglyphEffect=function(t,i,r){var n,s,o,a,l=new e.Matrix4,d=new e.Matrix4,c=2,h=new e.PerspectiveCamera;h.matrixAutoUpdate=!1;var u=new e.PerspectiveCamera;u.matrixAutoUpdate=!1;var p=new e.OrthographicCamera(-1,1,1,-1,0,1),f=new e.Scene,g={minFilter:e.LinearFilter,magFilter:e.NearestFilter,format:e.RGBAFormat};void 0===i&&(i=512),void 0===r&&(r=512);var v=new e.WebGLRenderTarget(i,r,g),m=new e.WebGLRenderTarget(i,r,g),y=new e.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:v},mapRight:{type:"t",value:m}},vertexShader:["varying vec2 vUv;","void main() {"," vUv = vec2( uv.x, uv.y );"," gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D mapLeft;","uniform sampler2D mapRight;","varying vec2 vUv;","void main() {"," vec4 colorL, colorR;"," vec2 uv = vUv;"," colorL = texture2D( mapLeft, uv );"," colorR = texture2D( mapRight, uv );"," gl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;","}"].join("\n")}),w=new e.Mesh(new e.PlaneGeometry(2,2),y);f.add(w),this.setSize=function(i,r){v&&v.dispose(),m&&m.dispose(),v=new e.WebGLRenderTarget(i,r,g),m=new e.WebGLRenderTarget(i,r,g),y.uniforms.mapLeft.value=v,y.uniforms.mapRight.value=m,t.setSize(i,r)},this.render=function(i,r){i.updateMatrixWorld(),void 0===r.parent&&r.updateMatrixWorld();var g=n!==r.aspect||s!==r.near||o!==r.far||a!==r.fov;if(g){n=r.aspect,s=r.near,o=r.far,a=r.fov;var y,w,x=r.projectionMatrix.clone(),b=.5*(c/30),E=b*s/c,_=s*Math.tan(e.Math.degToRad(.5*a));l.elements[12]=b,d.elements[12]=-b,y=-_*n+E,w=_*n+E,x.elements[0]=2*s/(w-y),x.elements[8]=(w+y)/(w-y),h.projectionMatrix.copy(x),y=-_*n-E,w=_*n-E,x.elements[0]=2*s/(w-y),x.elements[8]=(w+y)/(w-y),u.projectionMatrix.copy(x)}h.matrixWorld.copy(r.matrixWorld).multiply(d),h.position.copy(r.position),h.near=r.near,h.far=r.far,t.render(i,h,v,!0),u.matrixWorld.copy(r.matrixWorld).multiply(l),u.position.copy(r.position),u.near=r.near,u.far=r.far,t.render(i,u,m,!0),t.render(f,p)},this.dispose=function(){v&&v.dispose(),m&&m.dispose()}}}),i("libs/three/effects/OculusRiftEffect",["three"],function(e){e.OculusRiftEffect=function(t,i){var r=i&&i.worldFactor?i.worldFactor:1,n=i&&i.HMD?i.HMD:{hResolution:1280,vResolution:800,hScreenSize:.14976,vScreenSize:.0936,interpupillaryDistance:.064,lensSeparationDistance:.064,eyeToScreenDistance:.041,distortionK:[1,.22,.24,0],chromaAbParameter:[.996,-.004,1.014,0]},s=new e.PerspectiveCamera;s.matrixAutoUpdate=!1,s.target=new e.Vector3;var o=new e.OrthographicCamera(-1,1,1,-1,1,1e3);o.position.z=1,this.preLeftRender=function(){},this.preRightRender=function(){},t.autoClear=!1;var a=new e.Color("black"),l={minFilter:e.LinearFilter,magFilter:e.NearestFilter,format:e.RGBAFormat},d=new e.WebGLRenderTarget(640,800,l),c=new e.ShaderMaterial({uniforms:{texid:{type:"t",value:d},scale:{type:"v2",value:new e.Vector2(1,1)},scaleIn:{type:"v2",value:new e.Vector2(1,1)},lensCenter:{type:"v2",value:new e.Vector2(0,0)},hmdWarpParam:{type:"v4",value:new e.Vector4(1,0,0,0)},chromAbParam:{type:"v4",value:new e.Vector4(1,0,0,0)}},vertexShader:["varying vec2 vUv;","void main() {"," vUv = uv;"," gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec2 scale;","uniform vec2 scaleIn;","uniform vec2 lensCenter;","uniform vec4 hmdWarpParam;","uniform vec4 chromAbParam;","uniform sampler2D texid;","varying vec2 vUv;","void main()","{"," vec2 uv = (vUv*2.0)-1.0;"," vec2 theta = (uv-lensCenter)*scaleIn;"," float rSq = theta.x*theta.x + theta.y*theta.y;"," vec2 rvector = theta*(hmdWarpParam.x + hmdWarpParam.y*rSq + hmdWarpParam.z*rSq*rSq + hmdWarpParam.w*rSq*rSq*rSq);"," vec2 rBlue = rvector * (chromAbParam.z + chromAbParam.w * rSq);"," vec2 tcBlue = (lensCenter + scale * rBlue);"," tcBlue = (tcBlue+1.0)/2.0;"," if (any(bvec2(clamp(tcBlue, vec2(0.0,0.0), vec2(1.0,1.0))-tcBlue))) {"," gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);"," return;}"," vec2 tcGreen = lensCenter + scale * rvector;"," tcGreen = (tcGreen+1.0)/2.0;"," vec2 rRed = rvector * (chromAbParam.x + chromAbParam.y * rSq);"," vec2 tcRed = lensCenter + scale * rRed;"," tcRed = (tcRed+1.0)/2.0;"," gl_FragColor = vec4(texture2D(texid, tcRed).r, texture2D(texid, tcGreen).g, texture2D(texid, tcBlue).b, 1);","}"].join("\n")}),h=new e.Mesh(new e.PlaneGeometry(2,2),c),u=new e.Scene;u.add(o),u.add(h);var p={},f={},g=1;this.setHMD=function(t){n=t;var i=n.hResolution/(2*n.vResolution),s=-1-4*(n.hScreenSize/4-n.lensSeparationDistance/2)/n.hScreenSize;g=n.distortionK[0]+n.distortionK[1]*Math.pow(s,2)+n.distortionK[2]*Math.pow(s,4)+n.distortionK[3]*Math.pow(s,6);var o=e.Math.radToDeg(2*Math.atan2(n.vScreenSize*g,2*n.eyeToScreenDistance)),a=(new e.Matrix4).makePerspective(o,i,.3,1e4),h=4*(n.hScreenSize/4-n.interpupillaryDistance/2)/n.hScreenSize;p.proj=(new e.Matrix4).makeTranslation(h,0,0).multiply(a),f.proj=(new e.Matrix4).makeTranslation(-h,0,0).multiply(a),p.tranform=(new e.Matrix4).makeTranslation(-r*n.interpupillaryDistance/2,0,0),f.tranform=(new e.Matrix4).makeTranslation(r*n.interpupillaryDistance/2,0,0),p.viewport=[0,0,n.hResolution/2,n.vResolution],f.viewport=[n.hResolution/2,0,n.hResolution/2,n.vResolution];var u=4*(n.hScreenSize/4-n.lensSeparationDistance/2)/n.hScreenSize;p.lensCenter=new e.Vector2(u,0),f.lensCenter=new e.Vector2(-u,0),c.uniforms.hmdWarpParam.value=new e.Vector4(n.distortionK[0],n.distortionK[1],n.distortionK[2],n.distortionK[3]),c.uniforms.chromAbParam.value=new e.Vector4(n.chromaAbParameter[0],n.chromaAbParameter[1],n.chromaAbParameter[2],n.chromaAbParameter[3]),c.uniforms.scaleIn.value=new e.Vector2(1,1/i),c.uniforms.scale.value=new e.Vector2(1/g,1*i/g),d&&d.dispose(),d=new e.WebGLRenderTarget(n.hResolution*g/2,n.vResolution*g,l),c.uniforms.texid.value=d},this.getHMD=function(){return n},this.setHMD(n),this.setSize=function(e,i){p.viewport=[e/2-n.hResolution/2,i/2-n.vResolution/2,n.hResolution/2,n.vResolution],f.viewport=[e/2,i/2-n.vResolution/2,n.hResolution/2,n.vResolution],t.setSize(e,i)},this.render=function(e,i){var r=t.getClearColor().clone();t.setClearColor(a),t.clear(),t.setClearColor(r),i.matrixAutoUpdate&&i.updateMatrix(),this.preLeftRender(),s.projectionMatrix.copy(p.proj),s.matrix.copy(i.matrix).multiply(p.tranform),s.matrixWorldNeedsUpdate=!0,t.setViewport(p.viewport[0],p.viewport[1],p.viewport[2],p.viewport[3]),c.uniforms.lensCenter.value=p.lensCenter,t.render(e,s,d,!0),t.render(u,o),this.preRightRender(),s.projectionMatrix.copy(f.proj),s.matrix.copy(i.matrix).multiply(f.tranform),s.matrixWorldNeedsUpdate=!0,t.setViewport(f.viewport[0],f.viewport[1],f.viewport[2],f.viewport[3]),c.uniforms.lensCenter.value=f.lensCenter,t.render(e,s,d,!0),t.render(u,o)},this.dispose=function(){c&&c.dispose(),d&&d.dispose()}}}),i("libs/verold/verold.controller",[],function(){var e=function(){};return e}),i("libs/verold/verold.events",["jquery","underscore","backbone","libs/verold/verold.controller"],function(e,t,i,r){window.verold=window.verold||{};var n=t.extend({},i.Events);n.trigger,window.verold.veroldEvents=n,t.each([i.Collection.prototype,i.Model.prototype,i.View.prototype,i.Router.prototype,r],function(e){e=t.extend(e,{veroldEvents:n})})}),i("scene/VeroldEngine/Renderer",["jquery","underscore","three","libs/three/detector","libs/three/stats","scene/Materials/EditorMaterials","libs/three/shaders/BasicShader","libs/three/shaders/BleachBypassShader","libs/three/shaders/BokehShader","libs/three/shaders/BrightnessContrastShader","libs/three/shaders/ColorCorrectionShader","libs/three/shaders/ColorifyShader","libs/three/shaders/ConvolutionShader","libs/three/shaders/CopyShader","libs/three/shaders/DOFMipMapShader","libs/three/shaders/DotScreenShader","libs/three/shaders/FilmShader","libs/three/shaders/FocusShader","libs/three/shaders/FXAAShader","libs/three/shaders/HorizontalBlurShader","libs/three/shaders/HorizontalTiltShiftShader","libs/three/shaders/HueSaturationShader","libs/three/shaders/LuminosityShader","libs/three/shaders/NormalMapShader","libs/three/shaders/SepiaShader","libs/three/shaders/SSAOShader","libs/three/shaders/TriangleBlurShader","libs/three/shaders/UnpackDepthRGBAShader","libs/three/shaders/VerticalBlurShader","libs/three/shaders/VerticalTiltShiftShader","libs/three/shaders/VignetteShader","libs/three/postprocessing/EffectComposer","libs/three/postprocessing/RenderPass","libs/three/postprocessing/BloomPass","libs/three/postprocessing/FilmPass","libs/three/postprocessing/DotScreenPass","libs/three/postprocessing/TexturePass","libs/three/postprocessing/ShaderPass","libs/three/postprocessing/MaskPass","libs/three/effects/AnaglyphEffect","libs/three/effects/OculusRiftEffect","libs/verold/verold.events"],function(e,t,i,r,n,s){var o=function(e){this.el=e.el,this.renderer=void 0,this.materialRenderer=void 0,this.renderSceneComposer=void 0,this.sceneRenderPass=void 0,this.rtParameters=void 0,this.vignettePass=void 0,this.shaderVignette=void 0,this.FXAAPass=void 0,this.shaderFXAA=void 0,this.screenPass=void 0,this.shaderScreen=void 0,this.renderTarget=void 0,this.veroldEngine=void 0,this.clearBeforeRender=void 0,this.flags={postProcessing:!1},this.settings={resolutionLevels:[.5,1,1.5,2],qualityIndex:2},this.qualityLevels=[{name:"Low",resolution:3,shadowResolution:3,shadowType:i.BasicShadowMap,shaderPrecision:"mediump",maxLights:3,shadowsEnabled:!1,fxaaEnabled:!1},{name:"Med",resolution:2,shadowResolution:2,shadowType:i.BasicShadowMap,shaderPrecision:"mediump",maxLights:3,shadowsEnabled:!0,fxaaEnabled:!1},{name:"High",resolution:1,shadowResolution:1,shadowType:i.PCFSoftShadowMap,shaderPrecision:"highp",maxLights:4,shadowsEnabled:!0,fxaaEnabled:!1}],this.renderFeatureOverrides={},this.uvTextureJSON={name:"uvTexture",id:"uvTexture",type:"texture2D",payload:{tex:{path:window.verold.glAssetsBaseUrl+"/textures/Materials/uvgrid.jpg",width:1024,height:1024},tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/Materials/uvgrid.dds",width:1024,height:1024,size:699192},isLocal:!0,filtering:"Trilinear",anisotropy:8,preferredFormat:"Compressed"}},this.uvMaterialJSON={name:"uvMaterial",id:"uvMaterial",type:"material",payload:{materialType:"Standard",diffuseTexture:"uvTexture",reflectionBias:-1,side:i.DoubleSide,lightsEnabled:!1}},this.flatShadedMaterialJSON={name:"flatShaded",id:"flatShaded",type:"material",payload:{materialType:"Simple",diffuseColor:15656413,specularColor:0,reflectionBias:-1,lightsEnabled:!1,side:i.DoubleSide}},this.currentRenderMode="Lit",this.renderModes={Lit:{overrideMaterial:null,overlayEnable:!1},Unlit:{overrideMaterial:null,overrideUniforms:{lightsEnabled:{value:0,defaultValue:1}},overlayEnable:!1},Normals:{overrideMaterial:null,overrideUniforms:{renderModeNormals:{value:1,defaultValue:0}},overlayEnable:!1},Wireframe:{overrideMaterial:null,overlayEnable:!0,overlayMaterial:{skinned:new i.ShaderMaterial(s.wireframe),"static":new i.ShaderMaterial(s.wireframe)}},"Flat-shaded Wireframe":{overrideMaterial:"flatShaded",overlayEnable:!0,overlayMaterial:{skinned:new i.ShaderMaterial(s.wireframe),"static":new i.ShaderMaterial(s.wireframe)},disableSkybox:!1},"UV Overlay":{overrideMaterial:"uvMaterial",overlayEnable:!1,disableSkybox:!1},"Skin Weights":{overrideMaterial:{skinned:new i.ShaderMaterial(s.skinWeights),"static":new i.ShaderMaterial(s.skinWeights)},overlayEnable:!1},"Skin Indices":{overrideMaterial:{skinned:new i.ShaderMaterial(s.skinIndices),"static":new i.ShaderMaterial(s.skinIndices)},overlayEnable:!1},"Picking Debug":{picking:!0,disableEditorScene:!0},"Depth Debug":{depth:!0,disableEditorScene:!0},"Anaglyph 3D":{disableEditorScene:!0,effect:null},"Oculus Rift 3D":{disableEditorScene:!0,effect:null}}};return o.prototype={constructor:o,initialize:function(t){this.xResMultiplier=void 0!==t.xResMultiplier?t.xResMultiplier:1,this.yResMultiplier=void 0!==t.yResMultiplier?t.yResMultiplier:1,this.clearBeforeRender=void 0!==t.clearBeforeRender?t.clearBeforeRender:!0,this.clearColor=t.clearColor?t.clearColor:0,this.clearOpacity=t.clearOpacity?t.clearOpacity:0,this.renderer=r.webgl?new i.WebGLRenderer({antialias:void 0!==t.antialias?t.antialias:!0,preserveDrawingBuffer:void 0!==t.preserveDrawingBuffer?t.preserveDrawingBuffer:!1,precision:"mediump"}):new i.CanvasRenderer,this.flags.postProcessing=t.enablePostProcess,this.veroldEngine=t.veroldEngine,this.forceLowEndRendering=void 0!==t.forceLowEndRendering?t.forceLowEndRendering:!1,this.renderer.setSize(this.getXRes(),this.getYRes()),this.renderer.setClearColor(this.clearColor,this.clearOpacity),this.renderer.autoClear=!1,this.renderer.gammaInput=!0,this.renderer.gammaOutput=!0,this.shadowMapEnabled=void 0!==t.shadowMapEnabled?t.shadowMapEnabled:!0,this.shadowMapType=void 0!==t.shadowMapType?t.shadowMapType:i.PCFSoftShadowMap,this.renderer.shadowMapEnabled=this.shadowMapEnabled,this.renderer.shadowMapCullFace=i.CullFaceBack,this.renderer.shadowMapType=this.shadowMapType,e(this.el).append(this.renderer.domElement);var n=this.renderer.getContext();console.log("WebGL VENDOR is "+n.getParameter(n.VENDOR)),console.log("WebGL SHADING_LANGUAGE_VERSION is "+n.getParameter(n.SHADING_LANGUAGE_VERSION)),console.log("WebGL RENDERER is "+n.getParameter(n.RENDERER)),this.caps={},this.caps.MAX_COMBINED_TEXTURE_IMAGE_UNITS=n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this.caps.MAX_CUBE_MAP_TEXTURE_SIZE=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),this.caps.MAX_FRAGMENT_UNIFORM_VECTORS=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),this.caps.MAX_RENDERBUFFER_SIZE=n.getParameter(n.MAX_RENDERBUFFER_SIZE),this.caps.MAX_TEXTURE_IMAGE_UNITS=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),this.caps.MAX_TEXTURE_SIZE=n.getParameter(n.MAX_TEXTURE_SIZE),this.caps.MAX_VARYING_VECTORS=n.getParameter(n.MAX_VARYING_VECTORS),this.caps.MAX_VERTEX_ATTRIBS=n.getParameter(n.MAX_VERTEX_ATTRIBS),this.caps.MAX_VERTEX_TEXTURE_IMAGE_UNITS=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this.caps.MAX_VERTEX_UNIFORM_VECTORS=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),this.caps.MAX_VIEWPORT_DIMS=n.getParameter(n.MAX_VIEWPORT_DIMS),this.caps.ALIASED_POINT_SIZE_RANGE=n.getParameter(n.ALIASED_POINT_SIZE_RANGE),this.caps.ALIASED_LINE_WIDTH_RANGE=n.getParameter(n.ALIASED_LINE_WIDTH_RANGE),this.caps.SAMPLES=n.getParameter(n.SAMPLES),this.caps.SAMPLE_BUFFERS=n.getParameter(n.SAMPLE_BUFFERS),this.caps.RED_BITS=n.getParameter(n.RED_BITS),this.caps.GREEN_BITS=n.getParameter(n.GREEN_BITS),this.caps.BLUE_BITS=n.getParameter(n.BLUE_BITS),this.caps.ALPHA_BITS=n.getParameter(n.ALPHA_BITS),this.caps.DEPTH_BITS=n.getParameter(n.DEPTH_BITS),this.caps.STENCIL_BITS=n.getParameter(n.STENCIL_BITS),this.caps.SUBPIXEL_BITS=n.getParameter(n.SUBPIXEL_BITS),this.caps.EXTENSIONS=n.getSupportedExtensions(),this.caps.COMPRESSED_TEXTURE_FORMATS=n.getParameter(n.COMPRESSED_TEXTURE_FORMATS),this.caps.VEROLD_PERFORMANCE_INDICATOR=100;for(var s in this.caps)console.log("Renderer Caps: "+s+" : "+this.caps[s]);this.flags.postProcessing&&this.initPostProcessing(),this.initStats(void 0!==t.enableStats?t.enableStats:!1),this.maxSupportedQualityLevel=this.qualityLevels.length-1,this.forceLowEndRendering&&(console.log("Low-end rendering has been enabled."),this.caps.VEROLD_PERFORMANCE_INDICATOR=10,this.renderFeatureOverrides.shadowsEnabled=!1,this.renderFeatureOverrides.fxaaEnabled=!1,this.maxSupportedQualityLevel=2,this.xResMultiplier=void 0!==t.xResMultiplier?t.xResMultiplier:.5,this.yResMultiplier=void 0!==t.yResMultiplier?t.yResMultiplier:.5),this.setRenderQuality(this.settings.qualityIndex),window.verold.veroldEvents.on("engine::renderer::requestRenderTargetImage",this.onRequestRenderTargetImage,this)},uninitialize:function(){this.veroldEngine=void 0,this.renderTarget&&this.renderTarget.dispose(),e(this.el).remove(this.renderer.domElement.className),this.renderer.domElement=null,this.renderer.context=null;for(var i in this.renderModes){if(t.isObject(this.renderModes[i].overlayMaterial))for(var r in this.renderModes[i].overlayMaterial)this.renderModes[i].overlayMaterial[r]&&this.renderModes[i].overlayMaterial[r].dispose();if(t.isObject(this.renderModes[i].overrideMaterial))for(var r in this.renderModes[i].overrideMaterial)this.renderModes[i].overrideMaterial[r]&&this.renderModes[i].overrideMaterial[r].dispose();this.renderModes[i].effect&&this.renderModes[i].effect.dispose&&this.renderModes[i].effect.dispose()}this.renderTarget=void 0,this.flags.postProcessing&&this.uninitPostProcessing(),this.renderer=void 0,this.stats=void 0,this.el=void 0,this.flags=void 0,window.verold.veroldEvents.off("engine::renderer::requestRenderTargetImage",this.onRequestRenderTargetImage,this)},onRequestRenderTargetImage:function(e){e.engine==this.veroldEngine.engineName&&(this.renderTargetRequested=!0,this.calledBy=e.calledBy,console.log("called by - "+this.calledBy))},getWidth:function(){return e(this.el).width()},getHeight:function(){return e(this.el).height()},getCurrentCanvas:function(){return this.renderer.domElement},initStats:function(t){this.stats=new n,this.stats.domElement.style.position="absolute",this.stats.domElement.style.bottom="0px",e(this.el).append(this.stats.domElement),this.stats.domElement.hidden=!t},initPostProcessing:function(){this.getWidth(),this.getHeight(),this.renderer.autoClear=!1,i.EffectComposer.initWidth=window.innerWidth||1,i.EffectComposer.initHeight=window.innerHeight||1,i.EffectComposer.camera=new i.OrthographicCamera(i.EffectComposer.initWidth/-2,i.EffectComposer.initWidth/2,i.EffectComposer.initHeight/2,i.EffectComposer.initHeight/-2,-1e4,1e4),i.EffectComposer.geometry=new i.PlaneGeometry(1,1),i.EffectComposer.quad=new i.Mesh(i.EffectComposer.geometry,null),i.EffectComposer.quad.position.z=-100,i.EffectComposer.quad.scale.set(i.EffectComposer.initWidth,i.EffectComposer.initHeight,1),i.EffectComposer.scene=new i.Scene,i.EffectComposer.scene.add(i.EffectComposer.quad),i.EffectComposer.scene.add(i.EffectComposer.camera),this.rtParameters={minFilter:i.LinearFilter,magFilter:i.LinearFilter,format:i.RGBAFormat,stencilBuffer:!1},this.overlayRenderPass=new i.RenderPass(null,null),this.overlayRenderPass.clear=!1,this.overlayRenderPass.renderToScreen=!1,this.overlayRenderPass.enabled=!1,this.sceneRenderPass=new i.RenderPass(null,null),this.sceneRenderPass.clear=!0,this.sceneRenderPass.renderToScreen=!1,this.shaderFXAA=i.FXAAShader,this.FXAAPass=new i.ShaderPass(this.shaderFXAA),this.FXAAPass.uniforms.resolution.value=new i.Vector2(1/this.getXRes(),1/this.getYRes()),this.FXAAPass.needsSwap=!0,this.FXAAPass.renderToScreen=!1,this.FXAAPass.enabled=!1,this.uiPass=new i.RenderPass(null,null),this.uiPass.enabled=!1,this.uiPass.clear=!1,this.uiPass.renderToScreen=!1,this.shaderVignette=i.VignetteShader,this.vignettePass=new i.ShaderPass(this.shaderVignette),this.vignettePass.uniforms.offset.value=.95,this.vignettePass.uniforms.darkness.value=1.6,this.vignettePass.needsSwap=!0,this.vignettePass.renderToScreen=!0,this.vignettePass.enabled=!1,this.shaderScreen=i.CopyShader,this.screenPass=new i.ShaderPass(this.shaderScreen),this.screenPass.enabled=!0,this.screenPass.clear=!0,this.screenPass.needsSwap=!0,this.screenPass.renderToScreen=!0,this.renderTarget=new i.WebGLRenderTarget(this.getXRes(),this.getYRes(),this.rtParameters),this.renderSceneComposer=new i.EffectComposer(this.renderer,this.renderTarget),this.renderSceneComposer.addPass(this.sceneRenderPass),this.renderSceneComposer.addPass(this.overlayRenderPass),this.renderSceneComposer.addPass(this.uiPass),this.renderSceneComposer.addPass(this.FXAAPass),this.renderSceneComposer.addPass(this.screenPass)
},uninitPostProcessing:function(){console.log("Unloading postprocessing shaders"),i.EffectComposer.quad&&(i.EffectComposer.quad.geometry.dispose(),i.EffectComposer.quad=void 0),i.EffectComposer.camera=void 0,i.EffectComposer.geometry=void 0,i.EffectComposer.scene=void 0,this.renderSceneComposer.renderTarget1.dispose(),this.renderSceneComposer.renderTarget2.dispose(),this.renderSceneComposer.copyPass.material.dispose(),this.renderSceneComposer=void 0,this.sceneRenderPass=void 0,this.rtParameters=void 0,this.FXAAPass.material.dispose(),this.FXAAPass=void 0,this.shaderFXAA=void 0,this.vignettePass.material.dispose(),this.vignettePass=void 0,this.shaderVignette=void 0,this.screenPass.material.dispose(),this.screenPass=void 0},initRenderModes:function(){var e=this,t=this.veroldEngine.assetRegistry;t.assets[this.uvTextureJSON.id]||t.createAsset(this.uvTextureJSON,{success:function(){}}),t.assets[this.uvMaterialJSON.id]||t.createAsset(this.uvMaterialJSON,{success:function(){}}),t.assets[this.flatShadedMaterialJSON.id]||t.createAsset(this.flatShadedMaterialJSON,{success:function(t){t.load();var r=e.renderModes["Flat-shaded Wireframe"].overlayMaterial;r["static"].uniforms=i.UniformsUtils.clone(r["static"].uniforms),r.skinned.uniforms=i.UniformsUtils.clone(r.skinned.uniforms)}}),this.renderModes["Anaglyph 3D"].effect=new i.AnaglyphEffect(this.renderer),this.renderModes["Anaglyph 3D"].effect.setSize(this.getXRes(),this.getYRes()),this.renderModes["Anaglyph 3D"].effect.focalLength=1,this.renderModes["Oculus Rift 3D"].effect=new i.OculusRiftEffect(this.renderer),this.renderModes["Oculus Rift 3D"].effect.setSize(this.getXRes(),this.getYRes())},render:function(e,i){if(i&&e){if(this.flags.postProcessing){this.clearBeforeRender&&this.renderer.clear(),this.sceneRenderPass.camera=i,this.sceneRenderPass.scene=e;var r=this.renderModes[this.currentRenderMode];if(this.overlayRenderPass.enabled=r.overlayEnable,r.overlayEnable&&(this.overlayRenderPass.camera=i,this.overlayRenderPass.scene=e,this.overlayRenderPass.overrideMaterial=t.isString(r.overlayMaterial)?this.veroldEngine.assetRegistry.getAsset(r.overlayMaterial,{autoLoad:!0}).threeData:r.overlayMaterial,this.overlayRenderPass.overrideMaterial.skinned.skinning=!0),r.picking){this.sceneRenderPass.scene.enablePicking=!0;var n=this.renderer.shadowMapEnabled;this.renderer.shadowMapEnabled=!1}this.sceneRenderPass.overrideMaterial=t.isString(r.overrideMaterial)?this.veroldEngine.assetRegistry.getAsset(r.overrideMaterial,{autoLoad:!0}).threeData:r.overrideMaterial,this.sceneRenderPass.overrideUniforms=r.overrideUniforms,this.sceneRenderPass.overrideMaterial&&(this.sceneRenderPass.overrideMaterial.skinned.skinning=!0),this.uiPass.scene?(this.uiPass.enabled=!0,this.uiPass.camera=i,r.picking&&(this.uiPass.scene.enablePicking=!0)):this.uiPass.enabled=!1,this.renderSceneComposer.render(.01),r.picking&&(this.sceneRenderPass.scene.enablePicking=!1,this.uiPass.scene&&(this.uiPass.scene.enablePicking=!1),this.renderer.shadowMapEnabled=n)}else{this.renderer.setRenderTarget(null),this.clearBeforeRender&&this.renderer.clear();var r=this.renderModes[this.currentRenderMode];if(r.picking){e.enablePicking=!0;var n=this.renderer.shadowMapEnabled;this.renderer.shadowMapEnabled=!1}if(r.depth){e.enableDepth=!0;var n=this.renderer.shadowMapEnabled;this.renderer.shadowMapEnabled=!1}e.overrideMaterial=t.isString(r.overrideMaterial)?this.veroldEngine.assetRegistry.getAsset(r.overrideMaterial,{autoLoad:!0}).threeData:r.overrideMaterial,e.overrideUniforms=r.overrideUniforms,e.overrideMaterial&&(e.overrideMaterial.skinned.skinning=!0),r.effect?r.effect.render(e,i):this.renderer.render(e,i),r.overlayEnable&&(e.overrideMaterial=t.isString(r.overlayMaterial)?this.veroldEngine.assetRegistry.getAsset(r.overlayMaterial,{autoLoad:!0}).threeData:r.overlayMaterial,e.overrideMaterial.skinned.skinning=!0,this.renderer.render(e,i)),this.editorScene&&(this.renderer.clear(!1,!0,!1),r.picking&&(this.editorScene.enablePicking=!0),this.renderer.render(this.editorScene,i)),r.picking&&(e.enablePicking=!1,this.editorScene&&(this.editorScene.enablePicking=!1),this.renderer.shadowMapEnabled=n),r.depth&&(e.enableDepth=!1,this.renderer.shadowMapEnabled=n)}this.stats.update(),this.renderTargetRequested&&(window.verold.veroldEvents.trigger("engine::renderer::sendRenderTargetImage",this.calledBy),this.renderTargetRequested=!1,this.calledBy=void 0)}},setRenderQuality:function(e){window.verold.veroldEvents.trigger("sceneUI::postInfoMessage","Adjusting Quality..."),this.settings.qualityIndex=e%(this.maxSupportedQualityLevel+1);var t=this.qualityLevels[this.settings.qualityIndex];this.renderer.setPrecision(t.precision),this.renderer.shadowMapType=t.shadowType,this.shadowMapEnabled&&(this.renderer.shadowMapEnabled=void 0!==this.renderFeatureOverrides.shadowsEnabled?this.renderFeatureOverrides.shadowsEnabled:t.shadowsEnabled),this.FXAAPass&&(this.FXAAPass.enabled=void 0!==this.renderFeatureOverrides.fxaaEnabled?this.renderFeatureOverrides.fxaaEnabled:t.fxaaEnabled),this.veroldEngine.assetRegistry.Materials.rebuildAll(),this.resize();var i="Quality Level: "+t.name;window.verold.veroldEvents.trigger("sceneUI::postInfoMessage",i),window.verold.veroldEvents.trigger("scene::controls::setQualityLevel",this.settings.qualityIndex)},togglePostProcess:function(){var e="Post Processing "+(this.vignettePass.enabled?"ON":"OFF");window.verold.veroldEvents.trigger("sceneUI::postInfoMessage",e)},setRenderMode:function(e){this.renderModes[e]||(e="Lit"),this.currentRenderMode=e,this.renderModes[e].effect?this.renderModes[e].effect.setSize(this.getXRes(),this.getYRes()):this.renderer.setSize(this.getXRes(),this.getYRes());var t=e+" Render Mode";window.verold.veroldEvents.trigger("sceneUI::postInfoMessage",t)},getXRes:function(){return this.getWidth()*this.xResMultiplier},getYRes:function(){return this.getHeight()*this.yResMultiplier},resize:function(){var e=this.getWidth(),t=this.getHeight();if(e=Math.max(e,1),t=Math.max(t,1),this.renderer&&(this.renderer.setSize(e*this.xResMultiplier,t*this.yResMultiplier),this.renderSceneComposer)){var r=this.renderTarget,n=Math.max(this.getXRes(),1),s=Math.max(this.getYRes(),1);this.renderTarget=new i.WebGLRenderTarget(n,s,this.rtParameters),this.renderSceneComposer.reset(this.renderTarget),this.FXAAPass.uniforms.resolution.value.x=1/n,this.FXAAPass.uniforms.resolution.value.y=1/s,r.dispose()}},supportsCompressedTextures:function(e){switch(e||(e="S3TC"),e){case"S3TC":return this.renderer.supportsCompressedTextureS3TC();case"ATC":return this.renderer.supportsCompressedTextureATC();case"PVRTC":return this.renderer.supportsCompressedTexturePVRTC();default:return!1}}},o}),i("scene/VeroldEngine/Objects/VeroldObject",["jquery","underscore","backbone","three","models/entity","scene/Materials/EditorMaterials"],function(e,t,i,r,n,s){var o=function(){this.veroldEngine=void 0,this.id=void 0,this.parentId=null,this.parentAssetId=null,this.type=void 0,this.state_base="pending",this.state_hierarchy="pending",this.threeData=null,this.entityModel=void 0,this.dependencies={},this.dataSize={base:0,base_in_memory:0,hierarchy:0,dependencies:0,dependencies_in_memory:0},this.loadingProgress={base:0,hierarchy:0,dependencies:0}};return o.prototype={constructor:o,initialize:function(e){if(!e.veroldEngine||!e.entityModel)return console.error("Can't create an asset/object without an engine reference or a backbone model."),!1;if(this.veroldEngine=e.veroldEngine,this.state_base="pending",this.state_hierarchy="pending",this.state_dependencies="pending",this.id=e.entityModel.get("id"),this.type=e.entityModel.get("type"),this.parentId=e.entityModel.get("parentId"),this.parentAssetId=void 0!==e.parentAssetId?e.parentAssetId:this.parentAssetId,this.entityModel=e.entityModel,this.isInstance()){var t=this.getSourceAsset();if(!t)return console.error("Source asset, "+this.entityModel.get("instanceOfAsset")+", doesn't exist for "+this.entityModel.get("type")+" object, "+this.id),!1;this.listenToOnce(t,"init_hierarchy",function(){var e=this.getSourceObject();e||(console.error("Source object, "+this.entityModel.get("instanceOf")+", doesn't exist for, "+this.entityModel.get("type")+" object, "+this.id),this.unload())})}this.entityModel.on("change:name",this.onEntityNameChanged,this),this.entityModel.on("change:payload.*",this.onEntityPayloadChanged,this),this.entityModel.on("change:children.*",this.onEntityChildrenChanged,this),this.entityModel.isPersistent!==!1&&(this.entityModel.isPersistent=!0),this.on("load_base",this.onLoadBase,this),this.on("load_hierarchy",this.onLoadHierarchy,this),this.on("load_dependencies",this.onLoadDependencies,this),this.on("load_progress",this.onLoadProgress,this),this.on("load_hierarchy_failure",this.onLoadHierarchyFailure,this),this.on("load_base_failure",this.onLoadBaseFailure,this),this.update_dataSize()},uninitialize:function(){this.off("load_base",this.onLoadBase,this),this.off("load_hierarchy",this.onLoadHierarchy,this),this.off("load_dependencies",this.onLoadDependencies,this),this.off("load_progress",this.onLoadProgress,this),this.off("load_hierarchy_failure",this.onLoadHierarchyFailure,this),this.off("load_base_failure",this.onLoadBaseFailure,this),this.entityModel.off("change:name",this.onEntityNameChanged,this),this.entityModel.off("change:payload.*",this.onEntityPayloadChanged,this),this.entityModel.off("change:children.*",this.onEntityChildrenChanged,this);var e=this.getSourceObject();e&&(e.entityModel.off("change:name",this.onSourceEntityNameChanged,this),e.entityModel.off("change:payload.*",this.onSourceEntityPayloadChanged,this),e.entityModel.off("change:children.*",this.onSourceEntityChildrenChanged,this),e.off("load_progress_source",this.onSourceLoadProgress,this)),this.unload(),this.entityModel=void 0,this.loadingProgress=void 0,this.id=void 0,this.type=void 0,this.state_base="pending",this.state_hierarchy="pending",this.state_dependencies="pending",this.parentId=void 0,this.parentAssetId=void 0,this.threeData=void 0,this.veroldEngine=void 0},traverse:function(e){var t=this.entityModel.get("children");for(var i in t)if(t[i]){var r=this.getObject(i);r&&(e(r),r.traverse(e))}},getThreeData:function(e){return this.threeData||this.load(e),this.threeData},getEntityModel:function(){return this.entityModel},getObject:function(e){var t=this.getParentAsset();return t.getObject(e)},getChildObject:function(e){return this.entityModel.get("children")[e]?this.getParentAsset().getObject(e):null},getParentAsset:function(){return this.veroldEngine.assetRegistry.getAsset(this.parentAssetId)},getParentObject:function(){var e=this.getParentAsset(),t=e.getObject(this.parentId);return t||e.id!==this.id?t:null},getSourceAsset:function(){var e=this.entityModel.get("instanceOfAsset");return e?this.veroldEngine.assetRegistry.getAsset(e):null},getSourceObject:function(){var e=this.entityModel.get("instanceOf");if(e){var t=this.getSourceAsset();if(t){if(e===t.id)return t;var i=t.getObject(e);return i||console.warn("VeroldObject.getSourceObject(): The source object being requested doesn't exist in its parent asset. Either the ID is invalid or the asset hasn't been loaded yet."),i}console.error(this.veroldEngine.engineName+" - VeroldObject.getSourceObject() - The instance object doesn't have a valid source asset defined.")}return null},isInstance:function(){var e=this.entityModel.get("instanceOf");return e?!0:!1},onLoadBase:function(){if(this.state_base="loaded",("loaded"===this.state_dependencies||"failed"===this.state_dependencies)&&(this.trigger("load_base_and_dependencies",this),"loaded"===this.state_hierarchy)){var e=this;e.trigger("load",e)}},onLoadHierarchy:function(){if(this.state_hierarchy="loaded",("loaded"===this.state_dependencies||"failed"===this.state_dependencies)&&(this.trigger("load_hierarchy_and_dependencies",this),"loaded"===this.state_base)){var e=this;e.trigger("load",e)}},onLoadDependencies:function(){if(this.state_dependencies="loaded","loaded"===this.state_base&&(this.trigger("load_base_and_dependencies",this),"loaded"===this.state_hierarchy)){this.trigger("load_hierarchy_and_dependencies",this);var e=this;e.trigger("load",e)}},onLoadProgress:function(){this.updateLoadingProgress(),this.updateDependencyLoadingProgress()},onLoadBaseFailure:function(){this.state_base="failed"},onLoadHierarchyFailure:function(){this.state_hierarchy="failed"},onLoadDependenciesFailure:function(){if(this.state_dependencies="failed","loaded"===this.state_base&&(this.trigger("load_base_and_dependencies",this),"loaded"===this.state_hierarchy)){this.trigger("load_hierarchy_and_dependencies",this);var e=this;e.trigger("load",e)}},load:function(e){e||(e={}),(e.success||e.success_base||e.success_hierarchy||e.failure)&&console.error("Passing in deprecated callback names to 'load' method!!!"),e.init_hierarchy&&this.listenToOnce(this,"init_hierarchy",function(){e.init_hierarchy(this)}),e.load&&this.listenToOnce(this,"load",function(){e.load(this)}),e.load_base&&this.listenToOnce(this,"load_base",function(){e.load_base(this)}),e.load_base_and_dependencies&&this.listenToOnce(this,"load_base_and_dependencies",function(){e.load_base_and_dependencies(this)}),e.load_hierarchy&&this.listenToOnce(this,"load_hierarchy",function(){e.load_hierarchy(this)}),e.load_hierarchy_and_dependencies&&this.listenToOnce(this,"load_hierarchy_and_dependencies",function(){e.load_hierarchy_and_dependencies(this)}),e.load_dependencies&&this.listenToOnce(this,"load_dependencies",function(){e.load_dependencies(this)}),e.load_progress&&this.on("load_progress",function t(){e.load_progress(this),this.getLoadingProgress()>=1&&this.off("load_progress",t,this)},this),e.load_base_failure&&this.listenToOnce(this,"load_base_failure",function(){e.load_base_failure(this)}),e.load_hierarchy_failure&&this.listenToOnce(this,"load_hierarchy_failure",function(){e.load_hierarchy_failure(this)}),e.load_dependencies_failure&&this.listenToOnce(this,"load_dependencies_failure",function(){e.load_dependencies_failure(this)}),this.load_base(),this.load_hierarchy()},update_dataSize_hierarchy:function(e){this.dataSize.hierarchy=0;var i=this;this.update_dataSize(function(){var r=i.getParentAsset(),n=i.entityModel.get("children"),s=t.size(n),o=0;t.each(n,function(i,n){if(i){var a=this,l=r.getObject(n);l?l.update_dataSize_hierarchy(function(){return o++,a.dataSize.hierarchy+=l.dataSize.hierarchy,o===s&&t.isFunction(e)?(e(),void 0):void 0}):o++}else o++},i),0===s&&(i.dataSize.hierarchy=i.dataSize.base,t.isFunction(e)&&e())})},getDataSize:function(){return this.dataSize.hierarchy+this.dataSize.dependencies},getDataSizeOfHierarchy:function(){return this.dataSize.hierarchy},getDataSizeOfTopLevel:function(){return this.dataSize.base},getDataSizeOfDependencies:function(){return this.dataSize.dependencies},getDataSizeInMemory:function(){return this.dataSize.hierarchy+this.dataSize.dependencies_in_memory},getDataSizeInMemoryOfDependencies:function(){return this.dataSize.dependencies_in_memory},getLoadingProgress:function(){var e=this.getDataSize();return e?(this.loadingProgress.hierarchy+this.loadingProgress.dependencies)/e:0},update_dataSize:function(e){this.dataSize.base=0,this.dataSize.base_in_memory=0,this.dataSize.dependencies=0,this.dataSize.dependencies_in_memory=0,t.each(this.dependencies,function(e){this.dataSize.dependencies+=e.object.dataSize.base,this.dataSize.dependencies_in_memory+=e.object.dataSize.base_in_memory},this),t.isFunction(e)&&e()},init_dependencies:function(e,i){(!this.dependenciesInitialized||i)&&(this.dependenciesInitialized=!0,t.isFunction(e)&&e())},init_hierarchy:function(){this.state_hierarchy="registered",this.trigger("init_hierarchy",this)},load_base:function(){if("loaded"===this.state_base)this.trigger("load_base",this);else if("pending"===this.state_base){this.state_base="loading";var e=this.entityModel.toJSON();if(this.isInstance()){var t=this.getSourceAsset();t&&this.listenToOnce(t,"init_hierarchy",function(){var t=this.getSourceObject();return t?(this._loadThreeData(e),void 0):(this.trigger("load_base_failure",this),void 0)})}else this._loadThreeData(e)}},_loadThreeData:function(e){function t(r){r.off("load_base",t,i),i.threeData=r.cloneThreeData(),i.threeData.veroldAssetID=i.id,i.threeData.name=i.entityModel.get("name"),i.applyPayloadSettings_loaded(e.payload),i.trigger("load_base",i)}var i=this;if(this.isInstance()){var n=i.getSourceAsset();this.listenToOnce(n,"init_hierarchy",function(){this._initSourceBindings();var e=i.getSourceObject();e.on("load_base",t,this),e.load_base()}),n.load()}else i.threeData=new r.Object3D,i.threeData.useQuaternion=!0,i.threeData.veroldAssetID=i.id,i.threeData.name=i.entityModel.get("name"),i.applyPayloadSettings_loaded(e.payload),i.trigger("load_base",i)},_initSourceBindings:function(){var e=this.getSourceObject();e?(e.entityModel.on("change:name",this.onSourceEntityNameChanged,this),e.entityModel.on("change:payload.*",this.onSourceEntityPayloadChanged,this),e.entityModel.on("change:children.*",this.onSourceEntityChildrenChanged,this),e.on("load_progress_source",this.onSourceLoadProgress,this)):console.error("Source object can't be found for instance "+this.type+", "+this.id)},onChildHierarchyLoaded:function(e){var t=this.entityModel.get("children"),i=this.getParentAsset();for(var r in t)if(t[r]){var n=i.getObject(r);if("loaded"!==e.state_base||n!==e&&n&&("loaded"!==n.state_base||"loaded"!==n.state_hierarchy))return}this.trigger("load_hierarchy",this)},onChildTopLevelLoaded:function(e){var t=this.entityModel.get("children"),i=this.getParentAsset();for(var r in t)if(t[r]){var n=i.getObject(r);if("loaded"!==e.state_hierarchy||n!==e&&n&&("loaded"!==n.state_base||"loaded"!==n.state_hierarchy))return}this.trigger("load_hierarchy",this)},onChildLoadProgress:function(){this.trigger("load_progress",this)},load_hierarchy:function(){"loaded"===this.state_hierarchy?(this.trigger("init_hierarchy",this),this.trigger("load_hierarchy",this)):("pending"===this.state_hierarchy||"registered"===this.state_hierarchy)&&(this.listenToOnce(this,"init_hierarchy",function(){this.state_hierarchy="loading";var e=this.entityModel.get("children");if(!e||t.isEmpty(e))return this.trigger("load_hierarchy",this),void 0;var i=this.getParentAsset();t.each(e,function(e,t){if(e){var r=i.getObject(t);if(r)r.on("sizeNeedsUpdate",this.onChildSizeNeedsUpdate,this),r.on("load_hierarchy",this.onChildHierarchyLoaded,this),r.on("load_base",this.onChildTopLevelLoaded,this),r.on("load_progress",this.onChildLoadProgress,this),this.listenToOnce(r,"load_base",function(e){function t(){"light"===e.type&&e.entityModel.get("payload").inScene===!1||i.threeData.add(e.threeData),"light"===e.type&&(console.log("A light was added to object "+i.id+" so we'll rebuild all shaders."),i.veroldEngine.assetRegistry.Materials.rebuildAll())}var i=this;"loaded"===this.state_base?t():(this.listenToOnce(this,"load_base",t),this.load())}),r.load();else{console.warn("The "+this.type+", "+this.id+", has a child, "+t+", that doesn't exist.");var n="children."+t,s={};s[n]=!1,this.set(s)}}},this)}),this.init_hierarchy())},unload:function(e){e||(e={}),"pending"!==this.state_base&&this.threeData&&this.threeData.parent&&this.threeData.parent.remove(this.threeData);var i;for(i in this.dependencies)this.dependencies.hasOwnProperty(i)&&this.unregisterDependency(i,!0,!0);var r=this.getParentAsset(),n=this.entityModel.get("children");t.each(n,function(t,i){if(t){var n=r.getObject(i);n&&(n.off("sizeNeedsUpdate",this.onChildSizeNeedsUpdate,this),n.off("load_hierarchy",this.onChildHierarchyLoaded,this),n.off("load_base",this.onChildTopLevelLoaded,this),n.off("load_progress",this.onChildLoadProgress,this),e.nonRecursive||n.unload(e))}},this),this.stopListening(),this.state_base="pending",this.threeData=null,this.dataSize={base:0,base_in_memory:0,hierarchy:0,dependencies:0,dependencies_in_memory:0},this.loadingProgress={base:0,hierarchy:0,dependencies:0}},update:function(){var e=this.entityModel.get("payload");if(e.billboarding&&e.billboarding.enabled){var t=this.veroldEngine.getActiveCamera();if(this.threeData.lookAt(t.position),e.billboarding.inheritParentRotation){var i=this.getOrientation();this.threeData.quaternion.multiply(i)}}},applyPayloadSettings_loaded:function(e){if("pending"!==this.state_base&&e){var t,i,n=this.entityModel.get("payload");if(e){if(e.alignToPosition&&n.alignToPosition?(t=this.getPosition(),this.alignToPosition({x:t.x,y:t.y,z:t.z},n.alignToPosition,{save:!1}),t=this.getPosition(),this.threeData.position.set(t.x,t.y,t.z)):e.position&&(t=this.getPosition(),this.threeData.position.set(t.x,t.y,t.z)),e.scale&&!n.scaleToSize){var s=this.getScale();this.threeData.scale.set(s.x,s.y,s.z)}if(e.center){var o=this.getCenter();o&&(this.threeData.center?this.threeData.center.set(o.x,o.y,o.z):this.threeData.center=new r.Vector3(o.x,o.y,o.z))}e.orientation&&(i=this.getOrientation(),this.threeData.quaternion.set(i.x,i.y,i.z,i.w)),void 0!==e.hidden&&(this.threeData.visible=e.hidden?!1:n.visible),void 0!==e.visible&&(n.hidden||(this.threeData.visible=n.visible)),void 0!==e.castShadow&&(this.threeData.castShadow=n.castShadow),void 0!==e.receiveShadow&&(this.threeData.receiveShadow=n.receiveShadow),void 0!==e.billboarding&&(n.billboarding.enabled?this.veroldEngine.on("update",this.update,this):(i=this.getOrientation(),this.threeData.quaternion.set(i.x,i.y,i.z,i.w),this.veroldEngine.off("update",this.update,this)))}}},applyPayloadSettings_unloaded:function(){},set:function(e,t){e.id&&this.id!==e.id?console.warn(this.veroldEngine.engineName+":VeroldObject - ID specified in JSON when calling 'set' doesn't match the ID of the object. Was this intended?"):e.id=this.id,this.entityModel.set(e,t),t&&(t.save?this.save(t):t.success&&t.success(this))},save:function(e){if(e||(e={}),this.entityModel.isPersistent&&window.socket){var t=this,i={};i.connectionId=window.socket?window.socket.socket.sessionid:null,i.parentAssetId=this.getParentAsset().id,this.entityModel.save(i,{silent:!0,success:function(){e.success&&e.success(t)},error:function(i,r){e.failure&&e.failure(t),console.log(t.veroldEngine.engineName+":VeroldObject - Object failed to save: ",i,r)}})}},unset:function(e,t){e.id&&this.id!==e.id&&console.warn(this.veroldEngine.engineName+":VeroldObject - ID specified in JSON when calling 'unset' doesn't match the ID of the object. Was this intended?"),t||(t={}),this.entityModel.unset(e);var i=this;if(t.save&&this.entityModel.isPersistent&&window.socket){var r={};r.connectionId=window.socket?window.socket.socket.sessionid:null,r.parentAssetId=this.getParentAsset().id,this.entityModel.save(r,{silent:!0,success:function(){t.success&&t.success(),console.log(i.veroldEngine.engineName+":VeroldObject - Object saved: ",i)},error:function(e,r){t.failure&&t.failure(),console.log(i.veroldEngine.engineName+":VeroldObject - Object failed to save: ",i,r)}})}},destroy:function(e){var t=this.getParentAsset();t.destroyObject(this.id,e)},clone:function(e){var i,r=this.getParentAsset(),n=this;if(e||(e={}),e.persistent){var s={};s.connectionId=window.socket?window.socket.socket.sessionid:null,s.parentAssetId=r.id,this.entityModel.getClone(s,function(t){i=t.id,e.success&&e.success(r.getObject(i))})}else{var o={};o.id=e.id?r.generateUniqueObjectID(e.id):r.generateUniqueObjectID(this.entityModel.id),o.name=e.name?r.generateUniqueObjectName(e.name):r.generateUniqueObjectName(this.entityModel.get("name")),o.type=this.entityModel.get("type"),o.instanceOf=this.entityModel.get("instanceOf"),o.instanceOfAsset=this.entityModel.get("instanceOfAsset"),o.payload=this.entityModel.clonePayload(),r.createObject(o,{persistent:!1,success:function(i){e.success_base&&e.success_base(i);var s=n.entityModel.get("children");if(s&&!t.isEmpty(s)){var o=t.size(s);t.each(s,function(t,n){if(t){var s=r.getObject(n);s.clone({persistent:!1,success_base:function(e){i.addChildObject(e)},success:function(){o--,0===o&&e.success&&e.success(i)}})}},this)}else e.success&&e.success(i)}})}},cloneThreeData:function(){if(this.threeData){var e=this.threeData.children;this.threeData.children=[];var t=this.threeData.clone();return this.threeData.children=e,t}},mirrorThreeData:function(e){function i(e,r){var n=e.children;e.children=[];var s=e.clone();return e.children=n,s.position=e.position,s.quaternion=e.quaternion,s.scale=e.scale,r&&t.each(n,function(e,t){var r=i(n[t],!0);s.add(r)},this),s}if(this.threeData){var r=i(this.threeData,e.recursive);return r}},addChild:function(e,t){var i=this.getObject(e);if(i){t||(t={});var r="children."+e,n=i.getParentObject();if(n){var s={};s[r]=!1,n.set(s,{save:t.save})}var o={};o[r]=!0,this.set(o,t)}else console.error(this.veroldEngine.engineName+" - VeroldObject.addChild - the object being added is not part of this asset. If it is an object from a different asset (e.g. scene, model, etc.), it must first be moved to this asset using moveObject()")},addChildObject:function(e,t){this.addChild(e.id,t)},removeChild:function(e,t){var i=this.getObject(e);if(i)if(t||(t={}),this.entityModel.get("children")[i.id]){var r="children."+i.id,n={};n[r]=!1,this.set(n,t)}else console.error(this.veroldEngine.engineName+" - VeroldObject.removeChild - the object is not a direct child of this object. If you're trying to delete the object, call destroyObject()");else console.error(this.veroldEngine.engineName+" - VeroldObject.removeChild - the object being removed is not part of this asset.")},removeChildObject:function(e,t){this.removeChild(e.id,t)},onEntityNameChanged:function(e,t){var i=e.changed;i.name&&(this.name=this.generateUniqueObjectName(t),this.threeData&&void 0!==this.threeData.name&&(this.threeData.name=t),this.name!==this.entityModel.get("name")&&this.set({name:this.name},{silent:!0}))},onEntityPayloadChanged:function(e){var t=e.changed;"loaded"===this.state_base&&(t.payload||(t.payload={}),this.applyPayloadSettings_loaded(t.payload)),this.applyPayloadSettings_unloaded(t.payload)},onEntityChildrenChanged:function(e){var i=e.changed,r=this,n=this.veroldEngine.assetRegistry.getAsset(this.parentAssetId);t.each(i.children,function(e,i){var s=n.getObject(i);e&&s?(s.parentId=this.id,"pending"!==this.state_base&&s.load({load_base:function(e){r.threeData.add(e.threeData),"light"===e.type&&(console.log("A light was added to object, "+r.id+", so we'll rebuild all shaders."),r.veroldEngine.assetRegistry.Materials.rebuildAll())}}),s.on("sizeNeedsUpdate",this.onChildSizeNeedsUpdate,this),s.on("load_progress",this.onChildLoadProgress,this),s.on("load_hierarchy",this.onChildHierarchyLoaded,this),s.on("load_base",this.onChildTopLevelLoaded,this),this.trigger("child_added",s)):(console.log(this.veroldEngine.engineName+" - Removing child, "+i),s&&s.parentId===this.id&&(s.off("sizeNeedsUpdate",this.onChildSizeNeedsUpdate,this),s.off("load_progress",this.onChildLoadProgress,this),s.off("load_hierarchy",this.onChildHierarchyLoaded,this),s.off("load_base",this.onChildTopLevelLoaded,this),t.each(s.dependencies,function(e,t){for(var i=0;e.count>i;i++)s.unregisterDependency(t)},this),s.parentId=null,"pending"!==this.state_base&&(r.threeData.remove(n.objects[i].threeData),"light"===s.type&&(console.log("A light was removed from object, "+r.id+", so we'll rebuild all shaders."),r.veroldEngine.assetRegistry.Materials.rebuildAll()))),this.trigger("child_removed",s))},this),n.trigger("sizeNeedsUpdate",this)},onSourceLoadProgress:function(){this.trigger("load_progress",this)},onSourceEntityPayloadChanged:function(){console.log("TODO: The source entity for "+this.id+" has changed.")},generateUniqueObjectName:function(e){var t=this.getParentAsset();return t.generateUniqueObjectName(e)},generateUniqueObjectID:function(e){var t=this.getParentAsset();return t.generateUniqueObjectID(e)},alignToPosition:function(e,i,n){var s=this.getOrientation(),o=this.getScale(),a=this.getCenter(),l=new r.Quaternion;l.set(s.x,s.y,s.z,s.w);var d=this.entityModel.get("payload");if(!d.boundingbox){var c=this.getSourceObject();if(c&&(d=c.entityModel.get("payload")),!d.boundingbox)return console.warn("No bounding box specified for "+this.type+" "+this.id+" so we can't align it."),void 0}var h={};h.min=new r.Vector3(d.boundingbox.min.x,d.boundingbox.min.y,d.boundingbox.min.z),h.max=new r.Vector3(d.boundingbox.max.x,d.boundingbox.max.y,d.boundingbox.max.z),h.min.applyQuaternion(l),h.max.applyQuaternion(l);var u=new r.Vector3(a.x,a.y,a.z);u.applyQuaternion(l),h.min.multiply(o),h.max.multiply(o),u.multiply(o),i&&t.each(i,function(t,r){var n=Math.min(h.min[r],h.max[r]),s=Math.max(h.min[r],h.max[r]),o=.5*i[r]+.5;e[r]-=(1-o)*n+o*s},this);var p={"payload.position":{x:e.x,y:e.y,z:e.z},"payload.alignToPosition":!1};this.set(p,n)},getScale:function(){var e=this.entityModel.get("payload");if(e&&e.scale)return new r.Vector3(e.scale.x,e.scale.y,e.scale.z);var t=this.getSourceObject();return t?t.getScale():new r.Vector3(1,1,1)},getName:function(){return this.entityModel.get("name")},getPosition:function(){var e=this.entityModel.get("payload");if(e&&e.position)return new r.Vector3(e.position.x,e.position.y,e.position.z);var t=this.getSourceObject();return t?t.getPosition():new r.Vector3},getOrientation:function(){var e=this.entityModel.get("payload");if(e&&e.orientation)return new r.Quaternion(e.orientation.x,e.orientation.y,e.orientation.z,e.orientation.w);var t=this.getSourceObject();return t?t.getOrientation():new r.Quaternion},getCenter:function(){var e=this.entityModel.get("payload");if(e&&e.center)return new r.Vector3(e.center.x,e.center.y,e.center.z);var t=this.getSourceObject();return t?t.getCenter():new r.Vector3(0,0,0)},getCenterInParentSpace:function(){var e=this.getCenter(),t=this.getOrientation(),i=this.getScale(),r=this.getPosition();return e.multiply(i),e.applyQuaternion(t),e.add(r),e},getProperty:function(e){var t=this.entityModel.get("payload");if(t&&void 0!==t[e])return t[e];var i=this.getSourceObject();return i?i.getProperty():void 0},constructBoundingBox:function(e,t,i){var n=this.entityModel.get("payload"),o=this;if(!n||!n.boundingbox){var a=this.getSourceObject();a&&(n=a.entityModel.get("payload"))}if(!t&&n.boundingbox){var l=new r.ShaderMaterial(s.wireframe);l.uniforms=r.UniformsUtils.clone(l.uniforms),e&&l.uniforms.color.value.setHex(e),l.wireframe=!0;var d=new r.CubeGeometry(n.boundingbox.max.x-n.boundingbox.min.x,n.boundingbox.max.y-n.boundingbox.min.y,n.boundingbox.max.z-n.boundingbox.min.z);d.computeTangents();var c=new r.Mesh(d,l);c.name=this.entityModel.get("name")+"_BBox",c.isBB=!0,c.useQuaternion=!0,c.castShadow=!1,c.receiveShadow=!1;var h=(new r.Vector3).addVectors(n.boundingbox.min,n.boundingbox.max).multiplyScalar(.5);if(c.position=c.position.add(h),this.set({"payload.center":{x:h.x,y:h.y,z:h.z}}),this.threeData)this.threeData.center=h,this.threeData.add(c),this.threeData.bBox=c,c.visible=!1;else{var u=this.getParentObject();this.listenToOnce(u,"load_base",function(e){e.threeData.add(c),c.position.add(o.getPosition()),c.quaternion.multiply(o.getOrientation()),c.scale.multiply(o.getScale()),o.listenToOnce(o,"load_base",function(e){c.quaternion.set(0,0,0,1),c.scale.set(1,1,1),c.position.set(h.x,h.y,h.z),e.threeData.center=h,e.threeData.add(c),c.visible=!1,e.threeData.bBox=c}),o.load_base()}),u.load_base()}}else if(t){var p=this.getSourceAsset();p.load({init_hierarchy:function(){var t=o._determineBoundingBoxFromChildren();t.min.x<t.max.x&&(o.set({"payload.boundingbox":{min:{x:t.min.x,y:t.min.y,z:t.min.z},max:{x:t.max.x,y:t.max.y,z:t.max.z}}},{silent:!0}),o.constructBoundingBox(e)),i&&i.success&&i.success()}})}},_determineBoundingBoxFromChildren:function(){var e=this.entityModel.get("children"),i={min:new r.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),max:new r.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE)};return t.each(e,function(t,r){var n=this.getChildObject(r);if(e[r]&&n){var s=n._determineBoundingBoxFromChildren(),o=n.getSourceObject(),a=o.entityModel.get("payload");if(a&&a.boundingbox&&(s.min.x=Math.min(s.min.x,a.boundingbox.min.x),s.min.y=Math.min(s.min.y,a.boundingbox.min.y),s.min.z=Math.min(s.min.z,a.boundingbox.min.z),s.max.x=Math.max(s.max.x,a.boundingbox.max.x),s.max.y=Math.max(s.max.y,a.boundingbox.max.y),s.max.z=Math.max(s.max.z,a.boundingbox.max.z)),s.min.x<s.max.x){var l=n.getPosition(),d=n.getOrientation(),c=n.getScale();
s.min.multiply(c),s.min.applyQuaternion(d),s.min.add(l),s.max.multiply(c),s.max.applyQuaternion(d),s.max.add(l)}i.min.x=Math.min(i.min.x,s.min.x),i.min.y=Math.min(i.min.y,s.min.y),i.min.z=Math.min(i.min.z,s.min.z),i.max.x=Math.max(i.max.x,s.max.x),i.max.y=Math.max(i.max.y,s.max.y),i.max.z=Math.max(i.max.z,s.max.z)}},this),i},registerDependency:function(e,i,r){var n=this.veroldEngine.assetRegistry.getAsset(e);if(n&&(this.dependencies[e]?this.dependencies[e].count++:(this.state_dependencies="pending",this.dependencies[e]={count:1,object:n},this.dependencies[e].load_progress=function(){this.trigger("load_progress",this)},this.dependencies[e].sizeNeedsUpdate=function(){this.trigger("sizeNeedsUpdate",this)},this.dependencies[e].load=function(){var t=!0;for(var i in this.dependencies)if(i!==e&&("failed"==this.dependencies[i].object.state_base&&(t=!1),"loaded"!==this.dependencies[i].object.state_base&&"failed"!==this.dependencies[i].object.state_base))return;t?this.trigger("load_dependencies",this):this.trigger("load_dependencies_failure",this)},this.dependencies[e].subDependencyAdded=function(e){this.registerDependency(e,!1,!0)},this.dependencies[e].subDependencyRemoved=function(e){this.unregisterDependency(e,!1,!0)},n.on("load",this.dependencies[e].load,this),n.on("load_base_failure",this.dependencies[e].load,this),i||n.on("load_progress",this.dependencies[e].load_progress,this),n.on("sizeNeedsUpdate",this.dependencies[e].sizeNeedsUpdate,this),n.on("dependencyAdded",this.dependencies[e].subDependencyAdded,this),n.on("dependencyRemoved",this.dependencies[e].subDependencyRemoved,this),"loaded"===n.state_base&&n.load()),this.trigger("dependencyAdded",n.id),t.each(n.dependencies,function(e,t){for(var i=0;e.count>i;i++)this.registerDependency(t,!1,!0)},this),!r)){var s=this.getParentObject();s&&s.id!==this.id&&s.registerDependency(e,!0)}},unregisterDependency:function(e,i,r){var n;if(this.veroldEngine&&(n=this.veroldEngine.assetRegistry.getAsset(e)),this.dependencies[e]&&(this.dependencies[e].count--,(0===this.dependencies[e].count||i)&&(n&&(n.off("load",this.dependencies[e].load,this),n.off("load_base_failure",this.dependencies[e].load,this),n.off("load_progress",this.dependencies[e].load_progress,this),n.off("sizeNeedsUpdate",this.dependencies[e].sizeNeedsUpdate,this),n.off("dependencyAdded",this.dependencies[e].subDependencyAdded,this),n.off("dependencyRemoved",this.dependencies[e].subDependencyRemoved,this)),this.dependencies[e].load=void 0,this.dependencies[e].load_progress=void 0,this.dependencies[e].updated=void 0,this.dependencies[e].subDependencyAdded=void 0,this.dependencies[e].subDependencyRemoved=void 0,delete this.dependencies[e]),n&&this.trigger("dependencyRemoved",n.id)),n&&t.each(n.dependencies,function(e,t){for(var i=0;e.count>i;i++)this.unregisterDependency(t,!1,!0)},this),!r){var s=this.getParentObject();s&&s.id!==this.id&&s.unregisterDependency(e,i)}},onChildSizeNeedsUpdate:function(){this.trigger("sizeNeedsUpdate",this)},updateLoadingProgress:function(){if(this.isInstance()){var e=this.getSourceObject();this.loadingProgress.base=e.loadingProgress.base,this.loadingProgress.hierarchy=e.loadingProgress.hierarchy}else{this.loadingProgress.hierarchy=this.loadingProgress.base;var i=this.entityModel.get("children");t.each(i,function(e,t){var i=this.getChildObject(t);e&&i&&(this.loadingProgress.hierarchy+=i.loadingProgress.hierarchy)},this)}},updateDependencyLoadingProgress:function(){this.loadingProgress.dependencies=0,t.each(this.dependencies,function(e){e.object&&e.object.loadingProgress&&(this.loadingProgress.dependencies+=e.object.loadingProgress.base)},this)}},t.extend(o.prototype,i.Events),t.isObject(window.VAPI)&&(window.VAPI.VeroldObject=o),o}),i("scene/VeroldEngine/Objects/CameraObject",["jquery","underscore","three","scene/VeroldEngine/Objects/VeroldObject"],function(e,t,i,r){var n={name:"Camera_With_No_Name",type:"PerspectiveCamera",orientation:{x:0,y:0,z:0,w:1},position:{x:5,y:5,z:5},fov:50,aspect:16/9,near:.01,far:60},s=function(){r.call(this)};return t.extend(s.prototype,r.prototype,{constructor:s,_loadThreeData:function(e,t){var i=n.type;e.payload&&e.payload.type&&(i=this.entityModel.get("payload").type),this._createThreeCamera(i),this.threeData.veroldAssetID=this.id,this.applyPayloadSettings_loaded(e.payload,t),this.trigger("load_base",this)},applyPayloadSettings_loaded:function(e){if(e){var t=this.entityModel.get("payload"),n=void 0;e.type&&(n=t.type);var s=this.threeData instanceof i.PerspectiveCamera?"PerspectiveCamera":"OrthographicCamera";n&&n!==s&&this._createThreeCamera(type),"PerspectiveCamera"==s?(this.threeData.fov=e.fov?t.fov:this.threeData.fov,this.threeData.aspect=e.aspect?t.aspect:this.threeData.aspect,this.threeData.near=e.near?t.near:this.threeData.near,this.threeData.far=e.far?t.far:this.threeData.far):"OrthographicCamera"==s&&(this.threeData.near=e.near?t.near:this.threeData.near,this.threeData.far=e.far?t.far:this.threeData.far,this.threeData.left=e.left?t.left:this.threeData.left,this.threeData.right=e.right?t.right:this.threeData.right,this.threeData.top=e.top?t.top:this.threeData.top,this.threeData.bottom=e.bottom?t.bottom:this.threeData.bottom),this.threeData.updateProjectionMatrix(),r.prototype.applyPayloadSettings_loaded.call(this,e)}this.trigger("updated",this)},_createThreeCamera:function(e){"PerspectiveCamera"==e?(this.threeData=new i.PerspectiveCamera,this.threeData.useQuaternion=!0):"OrthographicCamera"==e&&(this.threeData=new i.OrthographicCamera,this.threeData.useQuaternion=!0)}}),t.isObject(window.VAPI)&&(window.VAPI.CameraObject=s),s}),i("scene/VeroldEngine/Objects/LightObject",["jquery","underscore","three","scene/VeroldEngine/Objects/VeroldObject"],function(e,t,i,r){var n={type:"DirectionalLight",inScene:!0,color:12303291,intensity:1,position:{x:4,y:-4,z:4},target:null,orientation:{x:0,y:0,z:0,w:1},castShadow:!1,shadowCameraNear:1.4,shadowCameraFar:10,shadowCameraLeft:-8,shadowCameraRight:8,shadowCameraTop:8,shadowCameraBottom:-8,shadowBias:-.0022,shadowDarkness:.5,shadowMapWidth:1024,shadowMapHeight:1024,shadowCameraVisible:!1,shadowCascade:!1,shadowCascadeCount:2,shadowCascadeNearZ:[-1,.99,.997],shadowCascadeFarZ:[.99,.997,1],shadowCascadeWidth:[1024,1024,1024],shadowCascadeHeight:[1024,1024,1024],shadowCascadeBias:[-.0022,-.005,0],shadowCascadeOffset:new i.Vector3(0,0,-4)},s=function(){r.call(this)};return t.extend(s.prototype,r.prototype,{constructor:s,_loadThreeData:function(e,t){var i=n.type,r=n.color;e.payload&&(i=this.entityModel.get("payload").type,r=this.entityModel.get("payload").color),this._createThreeLight(i,r),this.threeData.veroldAssetID=this.id,this.applyPayloadSettings_loaded(e.payload,t),this.trigger("load_base",this)},applyPayloadSettings_loaded:function(e){if(e){var t=this.entityModel.get("payload"),n=void 0;if(e.type){n=t.type;var s=this.threeData instanceof i.DirectionalLight?"DirectionalLight":null;s=this.threeData instanceof i.PointLight?"PointLight":s,s=this.threeData instanceof i.AmbientLight?"AmbientLight":s,s=this.threeData instanceof i.SpotLight?"SpotLight":s,s=this.threeData instanceof i.HemisphereLight?"HemisphereLight":s,n!==s&&this._createThreeLight(o,t.color)}var o=this.entityModel.get("payload").type;if("DirectionalLight"==o){if(this.threeData.intensity=void 0!==e.intensity?t.intensity:this.threeData.intensity,this.threeData.castShadow=void 0!==e.castShadow?t.castShadow:this.threeData.castShadow,this.threeData.shadowCameraNear=void 0!==e.shadowCameraNear?t.shadowCameraNear:this.threeData.shadowCameraNear,this.threeData.shadowCameraFar=void 0!==e.shadowCameraFar?t.shadowCameraFar:this.threeData.shadowCameraFar,this.threeData.shadowCameraLeft=void 0!==e.shadowCameraLeft?t.shadowCameraLeft:this.threeData.shadowCameraLeft,this.threeData.shadowCameraRight=void 0!==e.shadowCameraRight?t.shadowCameraRight:this.threeData.shadowCameraRight,this.threeData.shadowCameraTop=void 0!==e.shadowCameraTop?t.shadowCameraTop:this.threeData.shadowCameraTop,this.threeData.shadowCameraBottom=void 0!==e.shadowCameraBottom?t.shadowCameraBottom:this.threeData.shadowCameraBottom,this.threeData.shadowBias=void 0!==e.shadowBias?t.shadowBias:this.threeData.shadowBias,this.threeData.shadowMapWidth=void 0!==e.shadowMapWidth?Math.min(t.shadowMapWidth,this.veroldEngine.Renderer.caps.MAX_TEXTURE_SIZE):this.threeData.shadowMapWidth,this.threeData.shadowMapHeight=void 0!==e.shadowMapHeight?Math.min(t.shadowMapHeight,this.veroldEngine.Renderer.caps.MAX_TEXTURE_SIZE):this.threeData.shadowMapHeight,this.threeData.shadowCascade=void 0!==e.shadowCascade?t.shadowCascade:this.threeData.shadowCascade,this.threeData.shadowCascadeCount=void 0!==e.shadowCascadeCount?t.shadowCascadeCount:this.threeData.shadowCascadeCount,this.threeData.shadowCascadeNearZ=void 0!==e.shadowCascadeNearZ?t.shadowCascadeNearZ:this.threeData.shadowCascadeNearZ,this.threeData.shadowCascadeFarZ=void 0!==e.shadowCascadeFarZ?t.shadowCascadeFarZ:this.threeData.shadowCascadeFarZ,this.threeData.shadowCascadeWidth=void 0!==e.shadowCascadeWidth?t.shadowCascadeWidth:this.threeData.shadowCascadeWidth,this.threeData.shadowCascadeHeight=void 0!==e.shadowCascadeHeight?t.shadowCascadeHeight:this.threeData.shadowCascadeHeight,this.threeData.shadowCascadeBias=void 0!==e.shadowCascadeBias?t.shadowCascadeBias:this.threeData.shadowCascadeBias,this.threeData.shadowCameraVisible=void 0!==e.shadowCameraVisible?t.shadowCameraVisible:this.threeData.shadowCameraVisible,void 0!==e.inScene)if(t.inScene){var a=this.veroldEngine.getActiveScene();a.threeData.add(this.threeData),this.veroldEngine.assetRegistry.Materials.rebuildAll()}else{var a=this.veroldEngine.getActiveScene();a.threeData.remove(this.threeData),this.veroldEngine.assetRegistry.Materials.rebuildAll()}}else"PointLight"==o||"AmbientLight"==o||"SpotLight"==o||"HemisphereLight"==o||console.error(this.veroldEngine.engineName+' - Invalid light type, "'+o+'"!');e.color&&this.threeData.color.setHex(t.color),r.prototype.applyPayloadSettings_loaded.call(this,e)}this.trigger("updated",this)},_createThreeLight:function(e,t){this.threeData&&console.warn("TODO: Update referencers of this light!");var r=new i.Color(t);"DirectionalLight"==e?(this.threeData=new i.DirectionalLight(r),this.threeData.useQuaternion=!0,this.threeData.shadowCascade=n.shadowCascade,this.threeData.shadowCascadeCount=n.shadowCascadeCount,this.threeData.shadowCascadeNearZ=n.shadowCascadeNearZ,this.threeData.shadowCascadeFarZ=n.shadowCascadeFarZ,this.threeData.shadowCascadeWidth=n.shadowCascadeWidth,this.threeData.shadowCascadeHeight=n.shadowCascadeHeight,this.threeData.shadowCascadeBias=n.shadowCascadeBias,this.threeData.shadowCascadeOffset=n.shadowCascadeOffset):"PointLight"==e?(this.threeData=new i.PointLight(r),this.threeData.useQuaternion=!0):"AmbientLight"==e?(this.threeData=new i.AmbientLight(r),this.threeData.useQuaternion=!0):"SpotLight"==e?(this.threeData=new i.SpotLight(r),this.threeData.useQuaternion=!0):"HemisphereLight"==e&&(this.threeData=new i.HemisphereLight(r),this.threeData.useQuaternion=!0)},unload:function(){this.threeData&&this.threeData.shadowMap&&(console.log(this.veroldEngine.engineName+" - Deallocating shadow map texture for light "+this.entityModel.get("name")),this.threeData.shadowMap.dispose()),r.prototype.unload.call(this)}}),t.isObject(window.VAPI)&&(window.VAPI.LightObject=s),s}),function(){var e={},t=this,i=t.async;"undefined"!=typeof module&&module.exports?module.exports=e:t.async=e,e.noConflict=function(){return t.async=i,e};var r=function(e,t){if(e.forEach)return e.forEach(t);for(var i=0;e.length>i;i+=1)t(e[i],i,e)},n=function(e,t){if(e.map)return e.map(t);var i=[];return r(e,function(e,r,n){i.push(t(e,r,n))}),i},s=function(e,t,i){return e.reduce?e.reduce(t,i):(r(e,function(e,r,n){i=t(i,e,r,n)}),i)},o=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(i);return t};e.nextTick="undefined"!=typeof process&&process.nextTick?process.nextTick:function(e){setTimeout(e,0)},e.forEach=function(e,t,i){if(i=i||function(){},!e.length)return i();var n=0;r(e,function(r){t(r,function(t){t?(i(t),i=function(){}):(n+=1,n===e.length&&i(null))})})},e.forEachSeries=function(e,t,i){if(i=i||function(){},!e.length)return i();var r=0,n=function(){t(e[r],function(t){t?(i(t),i=function(){}):(r+=1,r===e.length?i(null):n())})};n()},e.forEachLimit=function(e,t,i,r){if(r=r||function(){},!e.length||0>=t)return r();var n=0,s=0,o=0;(function a(){if(n===e.length)return r();for(;t>o&&e.length>s;)s+=1,o+=1,i(e[s-1],function(t){t?(r(t),r=function(){}):(n+=1,o-=1,n===e.length?r():a())})})()};var a=function(t){return function(){var i=Array.prototype.slice.call(arguments);return t.apply(null,[e.forEach].concat(i))}},l=function(t){return function(){var i=Array.prototype.slice.call(arguments);return t.apply(null,[e.forEachSeries].concat(i))}},d=function(e,t,i,r){var s=[];t=n(t,function(e,t){return{index:t,value:e}}),e(t,function(e,t){i(e.value,function(i,r){s[e.index]=r,t(i)})},function(e){r(e,s)})};e.map=a(d),e.mapSeries=l(d),e.reduce=function(t,i,r,n){e.forEachSeries(t,function(e,t){r(i,e,function(e,r){i=r,t(e)})},function(e){n(e,i)})},e.inject=e.reduce,e.foldl=e.reduce,e.reduceRight=function(t,i,r,s){var o=n(t,function(e){return e}).reverse();e.reduce(o,i,r,s)},e.foldr=e.reduceRight;var c=function(e,t,i,r){var s=[];t=n(t,function(e,t){return{index:t,value:e}}),e(t,function(e,t){i(e.value,function(i){i&&s.push(e),t()})},function(){r(n(s.sort(function(e,t){return e.index-t.index}),function(e){return e.value}))})};e.filter=a(c),e.filterSeries=l(c),e.select=e.filter,e.selectSeries=e.filterSeries;var h=function(e,t,i,r){var s=[];t=n(t,function(e,t){return{index:t,value:e}}),e(t,function(e,t){i(e.value,function(i){i||s.push(e),t()})},function(){r(n(s.sort(function(e,t){return e.index-t.index}),function(e){return e.value}))})};e.reject=a(h),e.rejectSeries=l(h);var u=function(e,t,i,r){e(t,function(e,t){i(e,function(i){i?(r(e),r=function(){}):t()})},function(){r()})};e.detect=a(u),e.detectSeries=l(u),e.some=function(t,i,r){e.forEach(t,function(e,t){i(e,function(e){e&&(r(!0),r=function(){}),t()})},function(){r(!1)})},e.any=e.some,e.every=function(t,i,r){e.forEach(t,function(e,t){i(e,function(e){e||(r(!1),r=function(){}),t()})},function(){r(!0)})},e.all=e.every,e.sortBy=function(t,i,r){e.map(t,function(e,t){i(e,function(i,r){i?t(i):t(null,{value:e,criteria:r})})},function(e,t){if(e)return r(e);var i=function(e,t){var i=e.criteria,r=t.criteria;return r>i?-1:i>r?1:0};r(null,n(t.sort(i),function(e){return e.value}))})},e.auto=function(e,t){t=t||function(){};var i=o(e);if(!i.length)return t(null);var n={},a=[],l=function(e){a.unshift(e)},d=function(e){for(var t=0;a.length>t;t+=1)if(a[t]===e)return a.splice(t,1),void 0},c=function(){r(a.slice(0),function(e){e()})};l(function(){o(n).length===i.length&&(t(null,n),t=function(){})}),r(i,function(i){var r=e[i]instanceof Function?[e[i]]:e[i],o=function(e){if(e)t(e),t=function(){};else{var r=Array.prototype.slice.call(arguments,1);1>=r.length&&(r=r[0]),n[i]=r,c()}},a=r.slice(0,Math.abs(r.length-1))||[],h=function(){return s(a,function(e,t){return e&&n.hasOwnProperty(t)},!0)&&!n.hasOwnProperty(i)};if(h())r[r.length-1](o,n);else{var u=function(){h()&&(d(u),r[r.length-1](o,n))};l(u)}})},e.waterfall=function(t,i){if(i=i||function(){},!t.length)return i();var r=function(t){return function(n){if(n)i(n),i=function(){};else{var s=Array.prototype.slice.call(arguments,1),o=t.next();o?s.push(r(o)):s.push(i),e.nextTick(function(){t.apply(null,s)})}}};r(e.iterator(t))()},e.parallel=function(t,i){if(i=i||function(){},t.constructor===Array)e.map(t,function(e,t){e&&e(function(e){var i=Array.prototype.slice.call(arguments,1);1>=i.length&&(i=i[0]),t.call(null,e,i)})},i);else{var r={};e.forEach(o(t),function(e,i){t[e](function(t){var n=Array.prototype.slice.call(arguments,1);1>=n.length&&(n=n[0]),r[e]=n,i(t)})},function(e){i(e,r)})}},e.series=function(t,i){if(i=i||function(){},t.constructor===Array)e.mapSeries(t,function(e,t){e&&e(function(e){var i=Array.prototype.slice.call(arguments,1);1>=i.length&&(i=i[0]),t.call(null,e,i)})},i);else{var r={};e.forEachSeries(o(t),function(e,i){t[e](function(t){var n=Array.prototype.slice.call(arguments,1);1>=n.length&&(n=n[0]),r[e]=n,i(t)})},function(e){i(e,r)})}},e.iterator=function(e){var t=function(i){var r=function(){return e.length&&e[i].apply(null,arguments),r.next()};return r.next=function(){return e.length-1>i?t(i+1):null},r};return t(0)},e.apply=function(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t.concat(Array.prototype.slice.call(arguments)))}};var p=function(e,t,i,r){var n=[];e(t,function(e,t){i(e,function(e,i){n=n.concat(i||[]),t(e)})},function(e){r(e,n)})};e.concat=a(p),e.concatSeries=l(p),e.whilst=function(t,i,r){t()?i(function(n){return n?r(n):(e.whilst(t,i,r),void 0)}):r()},e.until=function(t,i,r){t()?r():i(function(n){return n?r(n):(e.until(t,i,r),void 0)})},e.queue=function(t,i){var n=0,s={tasks:[],concurrency:i,saturated:null,empty:null,drain:null,push:function(t,n){t.constructor!==Array&&(t=[t]),r(t,function(t){s.tasks.push({data:t,callback:"function"==typeof n?n:null}),s.saturated&&s.tasks.length==i&&s.saturated(),e.nextTick(s.process)})},process:function(){if(s.concurrency>n&&s.tasks.length){var e=s.tasks.shift();s.empty&&0==s.tasks.length&&s.empty(),n+=1,t(e.data,function(){n-=1,e.callback&&e.callback.apply(e,arguments),s.drain&&0==s.tasks.length+n&&s.drain(),s.process()})}},length:function(){return s.tasks.length},running:function(){return n}};return s};var f=function(e){return function(t){var i=Array.prototype.slice.call(arguments,1);t.apply(null,i.concat([function(t){var i=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(t?console.error&&console.error(t):console[e]&&r(i,function(t){console[e](t)}))}]))}};e.log=f("log"),e.dir=f("dir"),e.memoize=function(e,t){var i={},r={};t=t||function(e){return e};var n=function(){var n=Array.prototype.slice.call(arguments),s=n.pop(),o=t.apply(null,n);o in i?s.apply(null,i[o]):o in r?r[o].push(s):(r[o]=[s],e.apply(null,n.concat([function(){i[o]=arguments;var e=r[o];delete r[o];for(var t=0,n=e.length;n>t;t++)e[t].apply(null,arguments)}])))};return n.unmemoized=e,n},e.unmemoize=function(e){return function(){return(e.unmemoized||e).apply(null,arguments)}}}(),i("libs/async/async",function(e){return function(){var t;return t||e.async}}(this)),i("scene/Loaders/VeroldGeometryLoader",["three","underscore","libs/async/async"],function(e,t,i){var r=5e4,n=0,s=8,o=function(e,t){var i;for(this.script=e,this.workers=[],this.queue=[],i=0;t>i;i++)this.makeWorker(i,null);this.idx=0};o.prototype.constructor=o,o.prototype.makeWorker=function(e,t){var i=this;this.workers[e]={worker:t,busy:!1},t&&(t.onmessage=function(r){switch(r.data.type){case"result":t.terminate(),i.workers[e].worker=void 0,i.workers[e].busy=!1,i.workers[e].fnDone(r.data.result),i.workers[e].fnDone=void 0,i.workers[e].fnProgress=void 0,i.dequeue(e);break;case"progress":"function"==typeof i.workers[e].fnProgress&&i.workers[e].fnProgress(r.data.progress)}},t.onerror=function(e){throw e})},o.prototype.loadGeometry=function(e,i,r){var n=this,s=!1;t.each(this.workers,function(t,o){s||t.busy||(n.makeWorker(o,new Worker(n.script)),s=!0,n.workers[o].busy=!0,n.workers[o].fnDone=i,n.workers[o].fnProgress=r,n.workers[o].worker.postMessage(e))}),s||n.queue.push({url:e,fnDone:i,fnProgress:r})},o.prototype.dequeue=function(e){var t,i;this.queue.length&&(this.makeWorker(e,new Worker(this.script)),t=this.queue.shift(),i=this.workers[e],i.busy=!0,i.fnDone=t.fnDone,i.fnProgress=t.fnProgress,i.worker.postMessage(t.url))};var a=new o(window.verold.apiBaseUrl+"/worker.js",s),l=function(){};return l.prototype.constructor=l,l.prototype.createVertices=function(t,i,r,s,o){for(var a,l=this,d=r;i.xChannel.length>d&&r+s>d;++d)a=new e.Vector3,a.x=i.xChannel[d],a.y=i.yChannel[d],a.z=i.zChannel[d],t.vertices.push(a);r+s>=i.xChannel.length?o():setTimeout(function(){l.createVertices(t,i,r+s,s,o)},n)},l.prototype.createFaces=function(t,i,r,s,o){var a,l,d=this;switch(i.format){default:console.warn("unrecognized format: "+i.format);break;case"triangles":for(a=r;i.indices.length/3>a&&r+s>a;++a)l=new e.Face3,l.a=i.indices[3*a],l.b=i.indices[3*a+1],l.c=i.indices[3*a+2],t.faces.push(l)}r+s>=i.indices.length/3?o():setTimeout(function(){d.createFaces(t,i,r+s,s,o)},n)},l.prototype.addComputedValues=function(t,i,r,s,o){var a,l=this;for(iFace=r;t.faces.length>iFace&&r+s>iFace;++iFace)if(a=t.faces[iFace],a instanceof e.Face3){if(a.vertexNormals.push(new e.Vector3(i.xNormChannel[a.a],i.yNormChannel[a.a],i.zNormChannel[a.a])),a.vertexNormals.push(new e.Vector3(i.xNormChannel[a.b],i.yNormChannel[a.b],i.zNormChannel[a.b])),a.vertexNormals.push(new e.Vector3(i.xNormChannel[a.c],i.yNormChannel[a.c],i.zNormChannel[a.c])),i.tangents&&(a.vertexTangents.push(new e.Vector4(i.tangents[a.a].x,i.tangents[a.a].y,i.tangents[a.a].z,i.tangents[a.a].w)),a.vertexTangents.push(new e.Vector4(i.tangents[a.b].x,i.tangents[a.b].y,i.tangents[a.b].z,i.tangents[a.b].w)),a.vertexTangents.push(new e.Vector4(i.tangents[a.c].x,i.tangents[a.c].y,i.tangents[a.c].z,i.tangents[a.c].w))),i.rChannel&&i.gChannel&&i.bChannel&&i.aChannel){var d=255;a.vertexColors.push((new e.Color).setRGB(i.rChannel[a.a]/d,i.gChannel[a.a]/d,i.bChannel[a.a]/d)),a.vertexColors.push((new e.Color).setRGB(i.rChannel[a.b]/d,i.gChannel[a.b]/d,i.bChannel[a.b]/d)),a.vertexColors.push((new e.Color).setRGB(i.rChannel[a.c]/d,i.gChannel[a.c]/d,i.bChannel[a.c]/d))}}else if(a instanceof e.Face4&&(a.vertexNormals.push(new e.Vector3(i.xNormChannel[a.a],i.yNormChannel[a.a],i.zNormChannel[a.a])),a.vertexNormals.push(new e.Vector3(i.xNormChannel[a.b],i.yNormChannel[a.b],i.zNormChannel[a.b])),a.vertexNormals.push(new e.Vector3(i.xNormChannel[a.c],i.yNormChannel[a.c],i.zNormChannel[a.c])),a.vertexNormals.push(new e.Vector3(i.xNormChannel[a.d],i.yNormChannel[a.d],i.zNormChannel[a.d])),i.tangents&&(a.vertexTangents.push(new e.Vector4(i.tangents[a.a].x,i.tangents[a.a].y,i.tangents[a.a].z,i.tangents[a.a].w)),a.vertexTangents.push(new e.Vector4(i.tangents[a.b].x,i.tangents[a.b].y,i.tangents[a.b].z,i.tangents[a.b].w)),a.vertexTangents.push(new e.Vector4(i.tangents[a.c].x,i.tangents[a.c].y,i.tangents[a.c].z,i.tangents[a.c].w)),a.vertexTangents.push(new e.Vector4(i.tangents[a.d].x,i.tangents[a.d].y,i.tangents[a.d].z,i.tangents[a.d].w))),i.rChannel&&i.gChannel&&i.bChannel&&i.aChannel)){var d=255;a.vertexColors.push((new e.Color).setRGB(i.rChannel[a.a]/d,i.gChannel[a.a]/d,i.bChannel[a.a]/d)),a.vertexColors.push((new e.Color).setRGB(i.rChannel[a.b]/d,i.gChannel[a.b]/d,i.bChannel[a.b]/d)),a.vertexColors.push((new e.Color).setRGB(i.rChannel[a.c]/d,i.gChannel[a.c]/d,i.bChannel[a.c]/d)),a.vertexColors.push((new e.Color).setRGB(i.rChannel[a.d]/d,i.gChannel[a.d]/d,i.bChannel[a.d]/d))}r+s>=t.faces.length?(i.tangents&&(t.hasTangents=!0),o()):setTimeout(function(){l.addComputedValues(t,i,r+s,s,o)},n)},l.prototype.addUVs=function(t,i,r,s,o){var a,l,d,c=this;if(i.uChannel&&i.vChannel)for(a=r;t.faces.length>a&&r+s>a;++a)l=t.faces[a],d=[],l instanceof e.Face3?(d.push(new e.Vector2(i.uChannel[l.a],1-i.vChannel[l.a])),d.push(new e.Vector2(i.uChannel[l.b],1-i.vChannel[l.b])),d.push(new e.Vector2(i.uChannel[l.c],1-i.vChannel[l.c])),t.faceVertexUvs[0][a]=d):l instanceof e.Face4&&(d.push(new e.Vector2(i.uChannel[l.a],1-i.vChannel[l.a])),d.push(new e.Vector2(i.uChannel[l.b],1-i.vChannel[l.b])),d.push(new e.Vector2(i.uChannel[l.c],1-i.vChannel[l.c])),d.push(new e.Vector2(i.uChannel[l.d],1-i.vChannel[l.d])),t.faceVertexUvs[0][a]=d);else for(console.log("No UV's found so we're creating them."),a=r;t.faces.length>a&&r+s>a;++a){var h;l=t.faces[a],d=[],l instanceof e.Face3?(h=new e.Vector3(i.xChannel[l.a],i.yChannel[l.a],i.zChannel[l.a]),h.normalize(),d.push(new e.Vector2(h.x,h.y)),h=new e.Vector3(i.xChannel[l.b],i.yChannel[l.b],i.zChannel[l.b]),h.normalize(),d.push(new e.Vector2(h.x,h.y)),h=new e.Vector3(i.xChannel[l.c],i.yChannel[l.c],i.zChannel[l.c]),h.normalize(),d.push(new e.Vector2(h.x,h.y)),t.faceVertexUvs[0][a]=d):l instanceof e.Face4&&(h=new e.Vector3(i.xChannel[l.a],i.yChannel[l.a],i.zChannel[l.a]),h.normalize(),d.push(new e.Vector2(h.x,h.y)),h=new e.Vector3(i.xChannel[l.b],i.yChannel[l.b],i.zChannel[l.b]),h.normalize(),d.push(new e.Vector2(h.x,h.y)),h=new e.Vector3(i.xChannel[l.c],i.yChannel[l.c],i.zChannel[l.c]),h.normalize(),d.push(new e.Vector2(h.x,h.y)),h=new e.Vector3(i.xChannel[l.d],i.yChannel[l.d],i.zChannel[l.d]),h.normalize(),d.push(new e.Vector2(h.x,h.y)),t.faceVertexUvs[0][a]=d)}r+s>=t.faces.length?o():setTimeout(function(){c.addUVs(t,i,r+s,s,o)},n)},l.prototype.addSkinningData=function(t,i,r,s,o){var a,l,d,c,h,u,p,f,g,v,m=this;if(i.skinWeights)for(a=r,l=i.skinWeights.length;l>a&&r+s>a;a+=2)d=i.skinWeights[a],c=i.skinWeights[a+1],h=0,u=0,t.skinWeights.push(new e.Vector4(d,c,h,u));if(i.skinIndices)for(a=r,l=i.skinIndices.length;l>a&&r+s>a;a+=2)p=i.skinIndices[a],f=i.skinIndices[a+1],g=0,v=0,t.skinIndices.push(new e.Vector4(p,f,g,v));i.skinIndices||(i.skinIndices=[]),r+s>=i.skinIndices.length?o():setTimeout(function(){m.addSkinningData(t,i,r+s,s,o)},n)},l.prototype.createGeometry=function(t,n){var s=new e.Geometry,o=this;return t.faces?(this.createVertices(s,t,0,r,function(){setTimeout(function(){i.forEachSeries(t.faces,function(e,t){o.createFaces(s,e,0,r,function(){t()})},function(){return s.faces[0]?(o.addSkinningData(s,t,0,r,function(){o.addComputedValues(s,t,0,r,function(){o.addUVs(s,t,0,r,function(){s.computeBoundingBox(),s.faces[0].vertexNormals[0]||s.computeVertexNormals(),s.faces[0].centroid[0]||s.computeCentroids(),s.faces[0].normal[0]||s.computeFaceNormals(),s.hasTangents||s.computeTangents(),n(s)})})}),void 0):(console.log('The geometry, "'+s+'", has no faces! Skipping it.'),n(null),void 0)})},0)}),void 0):(n(null),void 0)},l.prototype.loadGeometry=function(e,t,i){var r,n=this,s=new Date;a.loadGeometry(e,function(i){setTimeout(function(){n.createGeometry(i,function(i){r=new Date,i?console.log("Finished loading: "+e+" took: "+(r.getTime()-s.getTime())/1e3+" seconds"):console.warn("Error loading: "+e+" took: "+(r.getTime()-s.getTime())/1e3+" seconds"),t(i)})},0)},i)},e.JSONLoader.prototype.load=function(e,t,i,r,n){i=i&&"string"==typeof i?i:this.extractUrlBase(e),this.onLoadStart(),this.loadAjaxJSON(this,e,t,i,r,n)},e.JSONLoader.prototype.loadAjaxJSON=function(e,t,i,r,n,s){function o(){d.abort(),window.verold.veroldEvents.off("shutdown",o,l),i&&i()}function a(){return p?(u=!1,void 0):(u=!0,h=setTimeout(a,500),void 0)}var l=this,d=new XMLHttpRequest,c=0;d.withCredentials=this.withCredentials,window.verold.veroldEvents.on("shutdown",o,this);var h,u=!0,p=!1;a();var f=0;d.onreadystatechange=function(){if(d.readyState===d.DONE){if(p=!0,clearTimeout(h),n=null,200===d.status||0===d.status){if(d.responseText){var a=JSON.parse(d.responseText);n&&n({total:f,loaded:f}),e.createModel(a,i,r,s)}else console.warn("THREE.JSONLoader: ["+t+"] seems to be unreachable or file there is empty");e.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load ["+t+"] ["+d.status+"]");window.verold.veroldEvents.off("shutdown",o,l)}else d.readyState===d.LOADING?u&&(setTimeout(function(){n&&(0===c&&(c=parseInt(d.getResponseHeader("x-goog-meta-uncompressed-size")||d.getResponseHeader("Content-Length"),10)),f=c,n({total:c,loaded:parseInt(d.responseText.length,10)}))},0),u=!1):d.readyState===d.HEADERS_RECEIVED&&(c=parseInt(d.getResponseHeader("x-goog-meta-uncompressed-size")||d.getResponseHeader("Content-Length"),10))},d.open("GET",t,!0),d.send(null)},e.JSONLoader.prototype.createModel=function(t,i,r,n){function s(){function i(e,t,i,r){e in r||(r[e]={}),r[e][i]=t}function r(e){for(var t=Object.keys(n.objects),i=t.length,r=i-1;r>=0;r--){var o=t[r],a=n.objects[o];if(o==e)return a;if(a=s(e,n.objects[t[r]]))return a}return null}function s(e,t){if(t._name==e)return t;if(t.children)for(var i=Object.keys(t.children),r=i.length,n=r-1;n>=0;n--){var o=i[n],a=t.children[o],l=s(e,a);if(l)return l}}function o(e){for(var t=Object.keys(e),i=t.length,r=i-1;r>=0;r--){var n=t[r],s=e[n];s._name=n,a(s)}}function a(e){if(e.children)for(var t=Object.keys(e.children),i=t.length,r=i-1;r>=0;r--){var n=t[r],s=e.children[n];s._name=n,s._parent=e,a(s)}}var l=n;if(l.metadata){var d=l.metadata.formatVersion;if(d>=4&&l.animations){var c,h=l.animations.takes,u=l.animations.layers,p=l.animations.curves,f=t.skinning;if(d>=5)for(var g in l.poses){var v=l.poses[g];if("BindPose"==v.type&&v.children[l.poseName]){c=v.children;break}}else d>=4&&(c=l.poses[0]);var m=Object.keys(h).length,y=Object.keys(u).length,w=Object.keys(p).length;if(o(n.objects),m>0&&y>0&&w>0&&f)for(var x in h){var b=h[x],E=u[b.layers[0]],_=r(f.bones[0]);if(_){for(var T=f.bones.length,C=[],M=[],S=0;T>S;S++){var A=f.bones[S],R=s(A,_),U=-1;R._parent&&(U=f.bones.indexOf(R._parent._name)),c&&c[A]&&(R=c[A]);var D={parent:U,name:A,pos:R.position,rot:R.rotation,rotq:R.quaternion,scl:R.scale};C.push(D);for(var P={},j=0;E.curves.length>j;j++){var B=E.curves[j],H=p[B];if(H.object==A)for(var k=0;H.keys.length>k;k+=H.channels+1){for(var L=H.keys[k+0],I=[],N=0;H.channels>N;N++)I.push(H.keys[k+N+1]);i(L-b.start,I,H.property,P)}}for(var F=[],O=Object.keys(P).sort(function(e,t){return parseFloat(e)-parseFloat(t)}),j=0;O.length>j;j++){var z,V,W,L=O[j],g=P[L];g.position&&(z=[],z.push(g.position[0]||R.position[0]),z.push(g.position[1]||R.position[1]),z.push(g.position[2]||R.position[2])),g.rotation&&(V=[],V.push(g.rotation[0]||R.quaternion[0]),V.push(g.rotation[1]||R.quaternion[1]),V.push(g.rotation[2]||R.quaternion[2]),V.push(g.rotation[3]||R.quaternion[3])),g.scale&&(W=[],W.push(g.scale[0]||R.scale[0]),W.push(g.scale[1]||R.scale[1]),W.push(g.scale[2]||R.scale[2]));var G={time:L};z&&(G.pos=z),V&&(G.rot=V),W&&(G.scl=W),F.push(G)}M.push({parent:U,keys:F})}t.bones=C,t.skinIndices=f.indices,t.skinWeights=f.weights,t.animation={name:x,length:b.stop-b.start,fps:25,hierarchy:M},e.AnimationHandler.add(t.animation)}}}}}function o(i){function r(e,t){return e&1<<t}var n,s,o,a,l,c,h,u,p,f,g,v,m,y,w,x,b,E,_,T,C,M,S,A,R,U,D,P=t.faces,j=t.vertices,B=t.normals,H=t.colors,k=0;for(n=0;t.uvs.length>n;n++)t.uvs[n].length&&k++;for(n=0;k>n;n++)d.faceUvs[n]=[],d.faceVertexUvs[n]=[];for(a=0,l=j.length;l>a;)T=new e.Vector3,T.x=j[a++]*i,T.y=j[a++]*i,T.z=j[a++]*i,d.vertices.push(T);for(a=0,l=P.length;l>a;){if(g=P[a++],v=r(g,0),m=r(g,1),y=r(g,2),w=r(g,3),x=r(g,4),b=r(g,5),E=r(g,6),_=r(g,7),v?(C=new e.Face4,C.a=Math.min(P[a++],d.vertices.length-1),C.b=Math.min(P[a++],d.vertices.length-1),C.c=Math.min(P[a++],d.vertices.length-1),C.d=Math.min(P[a++],d.vertices.length-1),c=4):(C=new e.Face3,C.a=Math.min(P[a++],d.vertices.length-1),C.b=Math.min(P[a++],d.vertices.length-1),C.c=Math.min(P[a++],d.vertices.length-1),c=3),m&&(f=P[a++],C.materialIndex=f),o=d.faces.length,y)for(n=0;k>n;n++)A=t.uvs[n],p=P[a++],U=A[2*p],D=A[2*p+1],d.faceUvs[n][o]=new e.Vector2(U,D);if(w)for(n=0;k>n;n++){for(A=t.uvs[n],R=[],s=0;c>s;s++)p=P[a++],U=A[2*p],D=A[2*p+1],R[s]=new e.Vector2(U,D);d.faceVertexUvs[n][o]=R}if(x&&(u=3*P[a++],S=new e.Vector3,S.x=B[u++],S.y=B[u++],S.z=B[u],C.normal=S),b)for(n=0;c>n;n++)u=3*P[a++],S=new e.Vector3,S.x=B[u++],S.y=B[u++],S.z=B[u],C.vertexNormals.push(S);if(E&&(h=P[a++],M=new e.Color(H[h]),C.color=M),_)for(n=0;c>n;n++)h=P[a++],M=new e.Color(H[h]),C.vertexColors.push(M);d.faces.push(C)}}function a(){var i,r,n,s,o,a,l,c,h,u;if(t.skinWeights)for(i=0,r=t.skinWeights.length;r>i;i+=2)n=t.skinWeights[i],s=t.skinWeights[i+1],o=0,a=0,d.skinWeights.push(new e.Vector4(n,s,o,a));if(t.skinIndices)for(i=0,r=t.skinIndices.length;r>i;i+=2)l=t.skinIndices[i],c=t.skinIndices[i+1],h=0,u=0,d.skinIndices.push(new e.Vector4(l,c,h,u));d.bones=t.bones,d.animation=t.animation}function l(i){if(void 0!==t.morphTargets){var r,n,s,o,a,l;for(r=0,n=t.morphTargets.length;n>r;r++)for(d.morphTargets[r]={},d.morphTargets[r].name=t.morphTargets[r].name,d.morphTargets[r].vertices=[],a=d.morphTargets[r].vertices,l=t.morphTargets[r].vertices,s=0,o=l.length;o>s;s+=3){var c=new e.Vector3;
c.x=l[s]*i,c.y=l[s+1]*i,c.z=l[s+2]*i,a.push(c)}}if(void 0!==t.morphColors){var r,n,h,u,p,f,g;for(r=0,n=t.morphColors.length;n>r;r++)for(d.morphColors[r]={},d.morphColors[r].name=t.morphColors[r].name,d.morphColors[r].colors=[],p=d.morphColors[r].colors,f=t.morphColors[r].colors,h=0,u=f.length;u>h;h+=3)g=new e.Color(16755200),g.setRGB(f[h],f[h+1],f[h+2]),p.push(g)}}var d=new e.Geometry,c=void 0!==t.scale?1/t.scale:1;n&&n.animations&&s(),o(c),a(),l(c),d.computeCentroids(),d.computeFaceNormals(),i(d,materials)},l}),i("scene/VeroldEngine/Objects/MeshObject",["jquery","underscore","three","scene/VeroldEngine/Objects/VeroldObject","scene/Loaders/VeroldGeometryLoader","scene/Materials/EditorMaterials"],function(e,t,i,r,n,s){var o=function(){r.call(this),this._progressDownloadFraction=.5,this._progressNormalsFraction=.15,this._progressTangentsFraction=.35};return t.extend(o.prototype,r.prototype,{constructor:o,initialize:function(e){var t=r.prototype.initialize.call(this,e);return t===!1?!1:(window.verold.veroldEvents.on("engine::mesh::materialDeleted",this.onMaterialDeleted,this),void 0)},uninitialize:function(e){r.prototype.uninitialize.call(this,e),window.verold.veroldEvents.off("engine::mesh::materialDeleted",this.onMaterialDeleted,this)},unload:function(){this.threeData&&(this.threeData.material=null,this.threeData.pickingMaterial&&this.threeData.pickingMaterial.dispose(),console.log(this.veroldEngine.engineName+" - Deallocating geometry for mesh "+this.entityModel.get("name")),this.isInstance()||this.threeData.geometry&&this.threeData.geometry.dispose(),this.threeData.geometry=null),r.prototype.unload.call(this)},getMaterialId:function(){var e=this.entityModel.get("payload");if(!e||!e.material){var t=this.getSourceObject();t&&(e=t.entityModel.get("payload"))}return e&&e.material?e.material:null},getMaterial:function(){var e=this.getMaterialId();if(t.isArray(e)){var i=[];return t.each(e,function(e){i.push(this.veroldEngine.assetRegistry.Materials.getAsset(e))},this),i}return this.veroldEngine.assetRegistry.Materials.getAsset(e)},update_dataSize:function(e){var i,n=this;r.prototype.update_dataSize.call(this,function(){if(n.isInstance()){var r=n.getSourceAsset();n.listenToOnce(r,"init_hierarchy",function(){var r=n.getSourceObject();r?(i=r.entityModel.get("payload"),i.size_uncompressed&&(n.dataSize.base=i.size_uncompressed)):n.dataSize.base=0,t.isFunction(e)&&e()}),r.init_hierarchy()}else i=n.entityModel.get("payload"),i.size_uncompressed&&(n.dataSize.base=i.size_uncompressed),t.isFunction(e)&&e()})},init_dependencies:function(e,i){function n(){var i,r=s.getMaterialId();t.isArray(r)?t.each(r,function(e){i=this.veroldEngine.assetRegistry.Materials.getAsset(e),i&&(this.registerDependency(e),i.init_dependencies(null))},s):(i=s.veroldEngine.assetRegistry.Materials.getAsset(r),i&&(s.registerDependency(r),i.init_dependencies(null))),t.isFunction(e)&&e()}var s=this;r.prototype.init_dependencies.call(this,function(){if(s.isInstance()){var e=s.getSourceAsset();s.listenToOnce(e,"init_hierarchy",function(){n()}),e.init_hierarchy()}else n()},i)},_loadThreeData:function(e,t){function r(e){var t=new i.ShaderMaterial(s.picking);return t.uniforms=i.UniformsUtils.clone(t.uniforms),t.uniforms.color.value=new i.Color(e),window.verold.veroldEvents.trigger("engine::picker::registerMeshPart",{engineName:n.veroldEngine.engineName,idMap:{threeID:e,data:n.threeData,meshID:n.id,modelID:n.getParentModel(n).id}}),t}var n=this;if(t&&this.listenToOnce(this,"load_base",function(){t.call(this,this)}),n.isInstance()){var o=n.getSourceAsset();this.listenToOnce(o,"init_hierarchy",function(){n._initSourceBindings(),n.constructBoundingBox();var t=n.getSourceObject();t.load({load_base:function(t){t.type!==n.type&&n.set({type:t.type},{save:!0}),n.threeData=t.cloneThreeData();var i=n.getMaterialId();"skinned_mesh"===n.type?n.applyMaterialChange(i,"skinned"):n.applyMaterialChange(i,"static"),n.threeData.veroldAssetID=n.id;var s=t.entityModel.get("payload");s.selectable!==!1&&(n.threeData.pickingMaterial=r(n.veroldEngine.assetRegistry.Models.requestNewRegNumber()),n.threeData.selectable=!0),n.applyPayloadSettings_loaded(e.payload),n.trigger("load_base",n)}})}),o.init_hierarchy()}else this.on("load_base",function a(){this.off("load_base",a,this),e.payload.material||(e.payload.material=!0),this.applyPayloadSettings_loaded(e.payload)},this),this._createThreeMesh()},applyPayloadSettings_loaded:function(e){if(e){var t=this.entityModel.get("payload");e.material&&this.applyMaterialChange(t.material,"static"),void 0!==e.selectable&&(this.threeData.selectable=t.selectable!==!1?!0:!1),void 0!==e.opacity&&(this.threeData.opacity=t.opacity),r.prototype.applyPayloadSettings_loaded.call(this,e)}this.trigger("updated",this)},applyPayloadSettings_unloaded:function(e){if(e&&e.material){var i=this.entityModel.previous("payload");if(!i.material){var r=this.getSourceObject();r&&(i=r.entityModel.get("payload"))}var n;t.isArray(e.material)?t.each(e.material,function(e,t){n=this.veroldEngine.assetRegistry.Materials.getAsset(e),i.material[t]!==e&&n&&(this.unregisterDependency(i.material[t]),this.registerDependency(e),n.init_dependencies(null))},this):(n=this.veroldEngine.assetRegistry.Materials.getAsset(e.material),i.material!==e.material&&n&&(this.unregisterDependency(i.material),this.registerDependency(e.material),n.init_dependencies(null))),this.trigger("sizeNeedsUpdate",this)}},applyMaterialChange:function(e,r){var n;if(n=this.veroldEngine.assetRegistry.Materials.materialObjectTypes[r].skinning===!0?"depth_skinning":"depth_static",t.isObject(e)){var s=[];this.threeData.material||(this.threeData.material=new i.MeshFaceMaterial(s)),t.each(e,function(e,t){var i=this.veroldEngine.assetRegistry.Materials.getAsset(e,{autoLoad:!0});if(i){this.threeData.material.materials[t]=i.getThreeData()[r];var s=i.entityModel.get("payload");2==s.alphaBlendMode&&(this.threeData.customDepthMaterial=i.getThreeData()[n])}else this.threeData.material.materials[t]=this.veroldEngine.assetRegistry.Materials.getMissingMaterial().threeData[r]},this)}else{var o=this.veroldEngine.assetRegistry.Materials.getAsset(e,{autoLoad:!0});o?(this.threeData.material=o.getThreeData()[r],this.threeData.customDepthMaterial=o.getThreeData()[n]):(this.threeData.material=this.veroldEngine.assetRegistry.Materials.getMissingMaterial().threeData[r],this.threeData.customDepthMaterial=this.veroldEngine.assetRegistry.Materials.getMissingMaterial().threeData[n])}},_createThreeMesh:function(){this.threeData&&console.warn("TODO: THREE.Mesh is being recreated. Update referencers of this mesh!");var e=this.entityModel.get("payload"),r=null,s=e.geometry;if(s)if(t.isString(s)){var o,a=this;".js"===s.slice(-3)?(o=new i.JSONLoader,o.load(this.entityModel.getPath(),function(e){if(e&&e.faces[0])if(0===e.faceVertexUvs[0].length&&(console.log("Generating uv's because they don't exist for the mesh."),a._generateUVs(e)),e.faces[0].vertexNormals[0])a._geometryFinishedLoading(e);else{console.log("Generating normals because they don't exist for the mesh.");var t=e.faces.length/20;t=Math.max(t,500),t=Math.round(t),e.computeVertexNormalsAsync(!1,function(){a._geometryFinishedLoading(e)},function(e){a.loadingProgress.base=a.dataSize.base*a._progressDownloadFraction,a.loadingProgress.base+=a.dataSize.base*a._progressNormalsFraction*e,a.trigger("load_progress",a),a.trigger("load_progress_source",a)},t)}else console.warn(a.veroldEngine.engineName+" - The mesh, "+a.id+", failed to download for some reason."),a._geometryFinishedLoading(null),a.trigger("load_failure",a)},!1,function(e){a._updateGeometryDownloadingProgress(e),a.trigger("load_progress",a),a.trigger("load_progress_source",a)})):".vgo"===s.slice(-4)?(o=new n,o.loadGeometry(this.entityModel.getPath(),function(e){a._geometryFinishedLoading(e)},function(e){a._updateGeometryDownloadingProgress(e),a.trigger("load_progress",a),a.trigger("load_progress_source",a)})):console.error(this.veroldEngine.engineName+' - MeshObject: Unrecognized mesh file type, "'+s)}else if("Plane"===s.type){var l=s.uvMult?s.uvMult:30;r=new i.PlaneGeometry(s.scale.x,s.scale.y,s.segmentsX,s.segmentsY,l),r.applyMatrix((new i.Matrix4).makeRotationX(-Math.PI/2)),this._geometryFinishedLoading(r)}else"Cube"===s.type?(r=new i.CubeGeometry(s.scale.x,s.scale.y,s.scale.z,s.segmentsX,s.segmentsY,s.segmentsZ,e.flipSided),this._geometryFinishedLoading(r)):"Sphere"===s.type?(r=new i.SphereGeometry(s.radius,s.segments,s.rings),this._geometryFinishedLoading(r)):"Cylinder"===s.type?(r=new i.CylinderGeometry(s.radiusTop,s.radiusBottom,s.height,s.segmentsRadius,s.segmentsHeight,s.openEnded),this._geometryFinishedLoading(r)):"Torus"===s.type?(r=new i.TorusGeometry(s.radius,s.tube,s.segmentsR,s.segmentsT,s.arc),this._geometryFinishedLoading(r)):console.error(this.veroldEngine.engineName+' - MeshObject: Unrecognized geometry type, "'+s.type);else console.error(this.veroldEngine.engineName+" - MeshObject: No geometry specified for mesh.")},getParentModel:function(e){e||(e=this);var t=e.getObject(e.parentId);return t?"model"===t.type?t:this.getParentModel(t):(console.error(this.veroldEngine.engineName+" - MeshObject.getParentModel() object doesn't have a valid parentId"),void 0)},_geometryFinishedLoading:function(e){function t(){e.dynamic=!1,n=new i.Mesh(e),n.veroldAssetID=r.id,r.threeData=n,r.threeData.castShadow=!0,r.threeData.receiveShadow=!0,r.threeData.material=null,r.threeData.useQuaternion=!0;var t=r.entityModel.get("name");t&&(n.name=r.generateUniqueObjectName(t)),r.trigger("load_base",r)}var r=this,n=null;if(e)if(e.hasTangents)t();else{this._splitUVSeams(e),console.log("Generating tangents because they don't exist for the mesh.");var s=e.faces.length/20;s=Math.max(s,500),s=Math.round(s),e.computeTangentsAsync(function(){t()},function(e){r.loadingProgress.base=r.dataSize.base*r._progressDownloadFraction,r.loadingProgress.base+=r.dataSize.base*r._progressNormalsFraction,r.loadingProgress.base+=r.dataSize.base*r._progressTangentsFraction*e,r.trigger("load_progress",r),r.trigger("load_progress_source",r)},s)}else this.threeData=new i.Object3D,this.threeData.veroldAssetID=this.id,this.threeData.useQuaternion=!0},onMaterialDeleted:function(e){function i(){console.log("Material that is in-use by "+r.id+" has been deleted");var e=r.veroldEngine.assetRegistry.Materials.getMissingMaterial();r.applyMaterialChange(e.id,"static")}var r=this;this.threeData&&(this.threeData.material.materials?t.each(this.threeData.material.materials,function(t,r){var n=t.veroldAssetID;n===e&&i(this.threeData,r)},this):this.threeData.material.veroldAssetID===e&&i(this.threeData))},_generateUVs:function(e){for(var t,r,n=new i.Vector3,s=0;e.faces.length>s;++s)t=e.faces[s],r=[],t instanceof i.Face3?(n.set(e.vertices[t.a].x,e.vertices[t.a].y,e.vertices[t.a].z),n.normalize(),n.addScalar(1),n.multiplyScalar(.5),r.push(new i.Vector2(n.x,n.y)),n.set(e.vertices[t.b].x,e.vertices[t.b].y,e.vertices[t.b].z),n.normalize(),n.addScalar(1),n.multiplyScalar(.5),r.push(new i.Vector2(n.x,n.y)),n.set(e.vertices[t.c].x,e.vertices[t.c].y,e.vertices[t.c].z),n.normalize(),n.addScalar(1),n.multiplyScalar(.5),r.push(new i.Vector2(n.x,n.y)),e.faceVertexUvs[0][s]=r):t instanceof i.Face4&&(n.set(e.vertices[t.a].x,e.vertices[t.a].y,e.vertices[t.a].z),n.normalize(),n.addScalar(1),n.multiplyScalar(.5),r.push(new i.Vector2(n.x,n.y)),n.set(e.vertices[t.b].x,e.vertices[t.b].y,e.vertices[t.b].z),n.normalize(),n.addScalar(1),n.multiplyScalar(.5),r.push(new i.Vector2(n.x,n.y)),n.set(e.vertices[t.c].x,e.vertices[t.c].y,e.vertices[t.c].z),n.normalize(),n.addScalar(1),n.multiplyScalar(.5),r.push(new i.Vector2(n.x,n.y)),n.set(e.vertices[t.d].x,e.vertices[t.d].y,e.vertices[t.d].z),n.normalize(),n.addScalar(1),n.multiplyScalar(.5),r.push(new i.Vector2(n.x,n.y)),e.faceVertexUvs[0][s]=r)},_splitUVSeams:function(e){var t=[];t[e.vertices.length-1]=void 0;for(var r=["a","b","c","d"],n=0;e.faces.length>n;++n){var s=e.faces[n],o=3;s instanceof i.Face4&&(o=4);for(var a=0;o>a;++a){var l=s[r[a]];t[l]?t[l].push([n,a]):t[l]=[[n,a]]}}for(var d=e.faceVertexUvs[0],c=e.vertices.length,h=0;c>h;++h){var u=t[h];if(u)for(var p=1;u.length>p;++p){for(var f=u[p][0],g=u[p][1],v=e.faces[f],m=d[f][g],y=!1,w=0;p>w;++w){var x=u[w][0],b=u[w][1],E=e.faces[x],_=d[x][b];if(m.x===_.x&&m.y===_.y){v[r[g]]=E[r[b]],y=!0;break}}y||(e.vertices.push(e.vertices[h]),e.colors&&e.colors.push(e.colors[h]),e.normals&&e.normals.push(e.normals[h]),v[r[g]]=e.vertices.length-1)}}},_updateGeometryDownloadingProgress:function(e){if((void 0===e.step||"download"===e.step)&&(this.loadingProgress.base=e.loaded*this._progressDownloadFraction,0===this.dataSize.base)){this.dataSize.base=e.total,this.trigger("sizeNeedsUpdate",this);var t=this.entityModel.get("payload");!t.size_uncompressed&&this.veroldEngine.isWritable&&this.set({"payload.size_uncompressed":e.total},{save:!0})}}}),t.isObject(window.VAPI)&&(window.VAPI.MeshObject=o),i.Geometry.prototype.computeTangentsAsync=function(e,t,r){function n(){W=!0,console.log("Aborting tangent computation due to engine shutdown."),window.verold.veroldEvents.off("shutdown",n,Q)}function s(e,t){return K.set(e[3*t],e[3*t+1],e[3*t+2]),K}function o(e,t,i){e[3*t]+=i.x,e[3*t+1]+=i.y,e[3*t+2]+=i.z}function a(e,t,i,r,n,s,a){function l(e,t){e[t]||0==e[t]?1/0===e[t]?e[t]=1:e[t]===-1/0&&(e[t]=-1):e[t]=0}m=e.vertices[t],y=e.vertices[i],w=e.vertices[r],x=v[n],b=v[s],E=v[a],_=y.x-m.x,T=w.x-m.x,C=y.y-m.y,M=w.y-m.y,S=y.z-m.z,A=w.z-m.z,R=b.x-x.x,U=E.x-x.x,D=b.y-x.y,P=E.y-x.y,j=1/(R*P-U*D),N.set((P*_-D*T)*j,(P*C-D*M)*j,(P*S-D*A)*j),F.set((R*T-U*_)*j,(R*M-U*C)*j,(R*A-U*S)*j),l(N,"x"),l(N,"y"),l(N,"z"),l(F,"x"),l(F,"y"),l(F,"z"),o($,t,N),o($,i,N),o($,r,N),o(Y,t,F),o(Y,i,F),o(Y,r,F)}function l(e,i){var n=0;for(e;r>n&&Q.faces.length>e;e++,n++)g=Q.faces[e],i(g,e);g=null,Q.faces.length>e&&(I+=L*r,t&&t(I))}function d(e,i,n,s){function o(){return W?(clearTimeout(a),void 0):u>=Q.faces.length?(t(n),s(),void 0):(l(u,e),u+=r,a=setTimeout(o,0),void 0)}u=0;var a;I=i,L=(n-i)/Q.faces.length,o()}function c(e,t){v=Q.faceVertexUvs[0][t],e instanceof i.Face3?a(Q,e.a,e.b,e.c,0,1,2):e instanceof i.Face4&&(a(Q,e.a,e.b,e.d,0,1,3),a(Q,e.b,e.c,e.d,1,2,3))}function h(e){for(p=0;e.vertexNormals.length>p;p++)V.copy(e.vertexNormals[p]),f=e[J[p]],B=s($,f),O.copy(B),O.sub(V.multiplyScalar(V.dot(B))).normalize(),z.crossVectors(e.vertexNormals[p],B),H=z.dot(s(Y,f)),k=0>H?-1:1,e.vertexTangents[p].set(O.x,O.y,O.z,k)}var u,p,f,g,v,m,y,w,x,b,E,_,T,C,M,S,A,R,U,D,P,j,B,H,k,L,I,N=new i.Vector3,F=new i.Vector3,O=new i.Vector3,z=new i.Vector3,V=new i.Vector3,W=!1;for(window.verold.veroldEvents.on("shutdown",n,this),u=0;this.faces.length>u;u++)for(g=this.faces[u],p=0;g.vertexNormals.length>p;p++)g.vertexTangents[p]=new i.Vector4;void 0===r&&(r=1e5);var G=4*3*this.vertices.length,X=new ArrayBuffer(G),q=new ArrayBuffer(G),$=new Float32Array(X),Y=new Float32Array(q),K=new i.Vector3,J=["a","b","c","d"],Q=this;d(c,0,.3,function(){N=null,F=null,d(h,.3,1,function(){Q.hasTangents=!0,K=null,$=null,Y=null,X=null,q=null,O=null,z=null,V=null,window.verold.veroldEvents.off("shutdown",n,Q),e&&e()})})},i.Geometry.prototype.computeVertexNormalsAsync=function(e,t,r,n){function s(){T=!0,console.log("Aborting normal computation due to engine shutdown."),window.verold.veroldEvents.off("shutdown",s,R)}function o(e,t,i){e[3*t]+=i.x,e[3*t+1]+=i.y,e[3*t+2]+=i.z}function a(e,t){var i=0;for(e;n>i&&R.faces.length>e;e++,i++)w=R.faces[e],t(w,e);w=null,R.faces.length>e&&(_+=E*n,r&&r(_))}function l(e,t,i,s){function o(){return T?(clearTimeout(l),void 0):m>=R.faces.length?(r(i),s(),void 0):(a(m,e),m+=n,l=setTimeout(o,0),void 0)}m=0;var l;_=t,E=(i-t)/R.faces.length,o()}function d(e){e instanceof i.Face3?(o(x,e.a,e.normal),o(x,e.b,e.normal),o(x,e.c,e.normal)):e instanceof i.Face4&&(o(x,e.a,e.normal),o(x,e.b,e.normal),o(x,e.c,e.normal),o(x,e.d,e.normal))}function c(){for(g=0,v=R.vertices.length;v>g;g++)b.x=x[3*g],b.y=x[3*g+1],b.z=x[3*g+2],b.normalize(),x[3*g]=b.x,x[3*g+1]=b.y,x[3*g+2]=b.z}function h(e){e instanceof i.Face3?(e.vertexNormals[0].set(x[3*e.a],x[3*e.a+1],x[3*e.a+2]),e.vertexNormals[1].set(x[3*e.b],x[3*e.b+1],x[3*e.b+2]),e.vertexNormals[2].set(x[3*e.c],x[3*e.c+1],x[3*e.c+2])):e instanceof i.Face4&&(e.vertexNormals[0].set(x[3*e.a],x[3*e.a+1],x[3*e.a+2]),e.vertexNormals[1].set(x[3*e.b],x[3*e.b+1],x[3*e.b+2]),e.vertexNormals[2].set(x[3*e.c],x[3*e.c+1],x[3*e.c+2]),e.vertexNormals[3].set(x[3*e.d],x[3*e.d+1],x[3*e.d+2]))}function u(e){e instanceof i.Face3?(U.set(R.vertices[3*e.c]-R.vertices[3*e.b],R.vertices[3*e.c+1]-R.vertices[3*e.b+1],R.vertices[3*e.c+2]-R.vertices[3*e.b+2]),D.set(R.vertices[3*e.a]-R.vertices[3*e.b],R.vertices[3*e.a+1]-R.vertices[3*e.b+1],R.vertices[3*e.a+2]-R.vertices[3*e.b+2]),U.cross(D),o(x,e.a,U),o(x,e.b,U),o(x,e.c,U)):e instanceof i.Face4&&(C=R.vertices[e.a],M=R.vertices[e.b],S=R.vertices[e.c],A=R.vertices[e.d],P.set(R.vertices[3*e.d]-R.vertices[3*e.b],R.vertices[3*e.d+1]-R.vertices[3*e.b+1],R.vertices[3*e.d+2]-R.vertices[3*e.b+2]),D.set(R.vertices[3*e.a]-R.vertices[3*e.b],R.vertices[3*e.a+1]-R.vertices[3*e.b+1],R.vertices[3*e.a+2]-R.vertices[3*e.b+2]),P.cross(D),o(x,e.a,P),o(x,e.b,P),o(x,e.d,P),j.set(R.vertices[3*e.d]-R.vertices[3*e.c],R.vertices[3*e.d+1]-R.vertices[3*e.c+1],R.vertices[3*e.d+2]-R.vertices[3*e.c+2]),B.set(R.vertices[3*e.b]-R.vertices[3*e.c],R.vertices[3*e.b+1]-R.vertices[3*e.c+1],R.vertices[3*e.b+2]-R.vertices[3*e.c+2]),j.cross(B),o(x,e.b,j),o(x,e.c,j),o(x,e.d,j))}function p(){c(),l(h,.5,1,f)}function f(){D=null,B=null,P=null,j=null,window.verold.veroldEvents.off("shutdown",s,R),t&&t()}var g,v,m,y,w,x,b,E,_,T=!1;window.verold.veroldEvents.on("shutdown",s,this),b=new i.Vector3;var C,M,S,A,R=this,U=new i.Vector3,D=new i.Vector3,P=new i.Vector3,j=new i.Vector3,B=new i.Vector3;if(void 0===n&&(n=1e5),void 0===this.__tmpVertices){var H=4*3*this.vertices.length,k=new ArrayBuffer(H),L=new Float32Array(k);for(this.__tmpVertices=L,x=this.__tmpVertices,m=0,y=this.faces.length;y>m;m++)w=this.faces[m],w instanceof i.Face3?w.vertexNormals=[new i.Vector3,new i.Vector3,new i.Vector3]:w instanceof i.Face4&&(w.vertexNormals=[new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3])}else for(x=this.__tmpVertices,g=0,v=this.vertices.length;v>g;g++)x[3*g]=0,x[3*g+1]=0,x[3*g+2]=0;e?l(u,.1,.5,p):l(d,.1,.5,p)},o}),i("scene/VeroldEngine/Objects/SkinnedMeshObject",["jquery","underscore","three","scene/VeroldEngine/Objects/VeroldObject","scene/VeroldEngine/Objects/MeshObject"],function(e,t,i,r,n){var s=function(){n.call(this)};return t.extend(s.prototype,n.prototype,{constructor:s,initialize:function(e){var i=n.prototype.initialize.call(this,e);if(i===!1)return console.error("SkinnedMeshObject, "+this.id+", failed to initialize."),!1;if(this.isInstance()){var r=this.entityModel.get("payload");r||(r={});var s=r.animationInfo;t.isObject(s)||(s={}),s.state=void 0!==s.state?s.state:"stop",s.loop=void 0!==s.loop?s.loop:!0,s.startTime=void 0!==s.startTime?s.startTime:0,s.name=void 0!==s.name?s.name:null,this.set({"payload.animationInfo":s},{silent:!0})}},_loadThreeData:function(e){var t=this;n.prototype._loadThreeData.call(this,e,function(){t.threeData.pickingMaterial&&(t.threeData instanceof i.SkinnedMesh&&(t.threeData.pickingMaterial.skinning=!0),t.threeData.pickingMaterial.needsUpdate=!0)})},applyPayloadSettings_loaded:function(e){if(e){var t=this.entityModel.get("payload"),n=this.getSourceObject();if(e.material&&(this.threeData instanceof i.SkinnedMesh?this.applyMaterialChange.call(this,t.material,"skinned"):this.applyMaterialChange.call(this,t.material,"static")),void 0!==e.selectable&&(this.threeData.selectable=t.selectable!==!1?!0:!1),void 0!==e.opacity&&(this.threeData.opacity=t.opacity),e.animationInfo){if((!t.animationInfo.name||!this.currentAnimation)&&this.threeData.geometry.animation){t.animationInfo.name=this.threeData.geometry.animation.name;var s=n?n.id.length:this.id.length;t.animationInfo.name=t.animationInfo.name.slice(0,t.animationInfo.name.length-s),e.animationInfo.name=t.animationInfo.name}if(e.animationInfo.name){if(this.currentAnimation&&(this.currentAnimation.stop(),this.currentAnimation=void 0),n)var o=t.animationInfo.name+n.id;else var o=t.animationInfo.name+this.id;this.currentAnimation=new i.Animation(this.threeData,o,i.AnimationHandler.CATMULLROM)}if(e.animationInfo&&e.animationInfo.state&&this.currentAnimation)switch(t.animationInfo.state){case"play":this.currentAnimation.play(t.animationInfo.loop,t.animationInfo.startTime);break;case"pause":this.currentAnimation.pause();break;case"stop":this.currentAnimation.stop()}void 0!==e.animationInfo.loop&&(this.currentAnimation.loop=e.animationInfo.loop),void 0!==e.animationInfo.timeScale&&(this.currentAnimation.timeScale=e.animationInfo.timeScale)}r.prototype.applyPayloadSettings_loaded.call(this,e)}this.trigger("updated",this)},_createThreeMesh:function(){function e(i){var n={},s=i.entityModel.get("name"),o=i.getPosition(),a=i.getOrientation(),l=i.getScale();n[s]={},n[s].position=[],n[s].position.push(o.x),n[s].position.push(o.y),n[s].position.push(o.z),n[s].quaternion=[],n[s].quaternion.push(a.x),n[s].quaternion.push(a.y),n[s].quaternion.push(a.z),n[s].quaternion.push(a.w),n[s].scale=[],n[s].scale.push(l.x),n[s].scale.push(l.y),n[s].scale.push(l.z);var d=i.entityModel.get("children");if(!t.isEmpty(d)){n[s].children={};for(var c in d){var h=r.getObject(c);if(h){var u=e(h);n[s].children[t.keys(u)[0]]=u[t.keys(u)[0]]}}}return n}var r=this.getParentAsset();this.threeData&&console.warn("TODO: THREE.Mesh is being recreated. Update referencers of this mesh!");var n=this.entityModel.get("payload"),s=this.veroldEngine.assetRegistry.Animations.getAsset(n.animation);this.listenToOnce(s,"load",function(r){var s=this.getParentAsset(),o=s.entityModel.get("payload").formatVersion?s.entityModel.get("payload").formatVersion:4,a={metadata:{formatVersion:o}},l=this.veroldEngine.assetRegistry.Poses.getAsset(n.pose);this.listenToOnce(l,"load",function(n){a.animations={},t.each(r.threeData,function(e,t){a.animations[t]=e},this),a.animations.takes={},t.each(r.threeData.takes,function(e,t){var i=t+this.id;a.animations.takes[i]=e},this),a.poses=n.threeData,a.objects=e(this.getParentModel()),a.poseName=this.entityModel.get("name");var s=new i.JSONLoader,o=this;s.load(this.entityModel.getPath(),function(e){if(!e)return console.error(o.veroldEngine.engineName+" - SkinnedMeshObject: Unable to load geometry for skinned mesh, "+o.id+", from path, "+o.entityModel.getPath()),void 0;if(0===e.faceVertexUvs[0].length&&o._generateUVs(e),e.faces[0].vertexNormals[0])o._geometryFinishedLoading(e);else{var t=e.faces.length/20;t=Math.max(t,500),t=Math.round(t),e.computeVertexNormalsAsync(!1,function(){o._geometryFinishedLoading(e)},function(e){o.loadingProgress.base=o.dataSize.base*o._progressDownloadFraction,o.loadingProgress.base+=o.dataSize.base*o._progressNormalsFraction*e,o.trigger("load_progress",o),o.trigger("load_progress_source",o)},t)}},!1,function(e){o._updateGeometryDownloadingProgress(e),o.trigger("load_progress",o),o.trigger("load_progress_source",o)},a)},this),this.listenToOnce(l,"failure",function(){console.error("Failed to load the poses for skinned mesh, "+this.id)},this),l.load()},this),s.load()},_geometryFinishedLoading:function(e){function t(){if(e.dynamic=!1,e.animation&&e.bones)n=new i.SkinnedMesh(e,void 0,e.animation?!0:!1);else{console.warn("Failed to setup animations and bones for skinned mesh, "+this.id+". Converting to regular mesh."),r.set({type:"mesh"},{save:!0});var t=r.getSourceObject();t&&t.set({type:"mesh"},{save:!0}),n=new i.Mesh(e)}n.veroldAssetID=r.id,r.threeData=n,r.threeData.castShadow=!0,r.threeData.receiveShadow=!0,r.threeData.material=null,r.threeData.useQuaternion=!0,r.threeData.useVertexTexture=!0;var s=r.entityModel.get("name");s&&(n.name=r.generateUniqueObjectName(s))}var r=this,n=null;if(e)if(e.hasTangents)t();else{var s=e.faces.length/20;s=Math.max(s,500),s=Math.round(s),e.computeTangentsAsync(function(){t(),r.trigger("load_base",r)},function(e){r.loadingProgress.base=r.dataSize.base*r._progressDownloadFraction,r.loadingProgress.base+=r.dataSize.base*r._progressNormalsFraction,r.loadingProgress.base+=r.dataSize.base*r._progressTangentsFraction*e,r.trigger("load_progress",r),r.trigger("load_progress_source",r)},s)}else this.threeData=new i.Object3D,this.threeData.veroldAssetID=this.id,this.threeData.useQuaternion=!0},onMaterialDeleted:function(e){function t(){console.log("Material that is in-use by "+i.id+" has been deleted");var e=i.veroldEngine.assetRegistry.Materials.getMissingMaterial();i.applyMaterialChange(e.id,"skinned")}var i=this;if(this.threeData)if(this.threeData.material.materials)for(var r in this.threeData.material.materials){var n=this.threeData.material.materials[r].veroldAssetID;n==e&&t(this.threeData,r)}else this.threeData.material.veroldAssetID==e&&t(this.threeData)},unload:function(){this.currentAnimation&&(this.currentAnimation.stop(),this.currentAnimation=void 0),n.prototype.unload.call(this)}}),t.isObject(window.VAPI)&&(window.VAPI.SkinnedMeshObject=s),s}),i("scene/VeroldEngine/Objects/ModelObject",["jquery","underscore","three","scene/VeroldEngine/Objects/VeroldObject"],function(e,t,i,r){var n=function(){r.call(this)};return t.extend(n.prototype,r.prototype,{constructor:n,initialize:function(e){var i=r.prototype.initialize.call(this,e);if(i!==!1&&this.isInstance()){var n=this.getSourceAsset(),s=n.entityModel.get("payload");if(s.animation){var o=this.entityModel.get("payload").animationInfo;t.isObject(o)||(o={}),o.state=void 0!==o.state?o.state:"stop",o.loop=void 0!==o.loop?o.loop:!0,o.startTime=void 0!==o.startTime?o.startTime:0,o.name=void 0!==o.name?o.name:null,o.timeScale=void 0!==o.timeScale?o.timeScale:1,this.set({"payload.animationInfo":o},{silent:!0})}return!0}return!1},_loadThreeData:function(e,t){var i=this;this.constructBoundingBox(16711680,!0,{success:function(){var e=i.entityModel.toJSON();r.prototype._loadThreeData.call(i,e,t)}})},applyPayloadSettings_loaded:function(e){if(e){var i=this.entityModel.get("payload");if(e.scaleToSize){var n;i.scaleToSize?(n=this._determineScaleToSize(i.scaleToSize),this.threeData.scale.set(n,n,n),this.set({"payload.scale":{x:n,y:n,z:n}},{silent:!0})):(n=this.getScale(),this.threeData.scale.set(n.x,n.y,n.z))}var s=this,o=this.getSourceAsset(),a=o.entityModel.get("payload");if(e.animationInfo){if(!i.animationInfo.name){var l=this.veroldEngine.assetRegistry.getAsset(a.animation);l.load({load_base:function(){var e={"payload.animationInfo.name":t.keys(l.threeData.takes)[0]};s.set(e)}})}e.animationInfo&&this.load({load_hierarchy:function(){s.traverse(function(e){"skinned_mesh"===e.type&&e.set({"payload.animationInfo.name":i.animationInfo.name,"payload.animationInfo.state":i.animationInfo.state,"payload.animationInfo.timeScale":i.animationInfo.timeScale,"payload.animationInfo.loop":i.animationInfo.loop})})}})}r.prototype.applyPayloadSettings_loaded.call(this,e)}this.trigger("updated",this)},scaleToSize:function(e,t){var i=this._determineScaleToSize(e),r={"payload.scale":{x:i,y:i,z:i},"payload.scaleToSize":e};this.set(r,t)},getScaleToSize:function(){var e=this.entityModel.get("payload");return e?e.scaleToSize:0},_determineScaleToSize:function(e){var t=this.entityModel.toJSON(),r=t.payload.boundingbox;if(!r){var n=this.getSourceAsset();if(!n)return console.warn("No bounding box specified for "+this.type+" "+this.id+" so we can't scale it."),1;var s=n.entityModel.get("payload");if(!s.boundingbox)return console.warn("No bounding box specified for "+this.type+" "+this.id+" so we can't scale it."),1;r=s.boundingbox}var o={};o.min=new i.Vector3(r.min.x,r.min.y,r.min.z),o.max=new i.Vector3(r.max.x,r.max.y,r.max.z);var a=o.min.distanceTo(o.max),l=e/a;return l},setAnimation:function(e,t){this.set({"payload.animationInfo.name":e},{save:t})},setAnimationSpeed:function(e,t){this.set({"payload.animationInfo.timeScale":e},{save:t})},playAnimation:function(e,i,r,n){this.set({"payload.animationInfo.state":"pause"});var s={};s["payload.animationInfo.state"]="play",void 0!==e&&(s["payload.animationInfo.loop"]=e),void 0!==i&&(s["payload.animationInfo.startTime"]=i),this.set(s,{save:r});var o=0;this.traverse(function(e){"skinned_mesh"===e.type&&e.currentAnimation&&(o=e.currentAnimation.data.length*e.currentAnimation.timeScale)}),o&&this.veroldEngine.on("update",function a(e){o-=e,0>=o&&(this.veroldEngine.off("update",a,this),t.isFunction(n)&&n())},this)},pauseAnimation:function(e){this.set({"payload.animationInfo.state":"pause"},{save:e})},stopAnimation:function(e){this.set({"payload.animationInfo.state":"stop"},{save:e})},setVisibility:function(e,t){this.traverse(function(i){("mesh"===i.type||"skinned_mesh"===i.type)&&i.set({"payload.visible":e},{save:t})})}}),t.isObject(window.VAPI)&&(window.VAPI.ModelObject=n),n}),i("scene/VeroldEngine/AssetRegistry/BaseAsset",["jquery","underscore","three","models/entity","scene/VeroldEngine/Objects/VeroldObject","scene/VeroldEngine/Objects/CameraObject","scene/VeroldEngine/Objects/LightObject","scene/VeroldEngine/Objects/MeshObject","scene/VeroldEngine/Objects/SkinnedMeshObject","scene/VeroldEngine/Objects/ModelObject"],function(e,t,i,r,n,s,o,a,l,d){var c=function(){n.call(this),this.objects={},this.registry=void 0};return t.extend(c.prototype,n.prototype,{constructor:c,initialize:function(e){n.prototype.initialize.call(this,e),this.parentAssetId=this.id,this.projectId=e.projectId,this.on("sizeNeedsUpdate",this.onSizeNeedsUpdate,this),this.veroldEngine.on("update",this.onUpdate,this),this.entityModel.subEntities.on("reset",this.onEntityLoadChildObjects,this),this.entityModel.subEntities.on("add",this.onEntityAddChildObject,this),this.entityModel.subEntities.on("remove",this.onEntityRemoveChildObject,this),this._initEntityObjects(),this.registry=e.registry},uninitialize:function(){this.off("sizeNeedsUpdate",this.onSizeNeedsUpdate,this),this.veroldEngine.off("update",this.onUpdate,this),this.entityModel.subEntities.off("reset",this.onEntityLoadChildObjects,this),this.entityModel.subEntities.off("add",this.onEntityAddChildObject,this),this.entityModel.subEntities.off("remove",this.onEntityRemoveChildObject,this),n.prototype.uninitialize.call(this);for(var e in this.objects)this.objects[e].uninitialize(),delete this.objects[e]},load_base:function(e){var t=this;this.init_dependencies(),n.prototype.load_base.call(t,e)},init_hierarchy:function(){var e=this;this.entityModel.isPersistent&&"pending"===this.state_hierarchy?(this.state_hierarchy="registering",this.entityModel.loadSubEntities(function(){e.state_hierarchy="registered",e.init_dependency_hierarchy(),e.trigger("sizeNeedsUpdate",e),e.trigger("init_hierarchy",e)})):"pending"===this.state_hierarchy?(this.state_hierarchy="registered",this.init_dependency_hierarchy(),e.trigger("sizeNeedsUpdate",e),this.trigger("init_hierarchy",this)):"registering"!==this.state_hierarchy&&this.trigger("init_hierarchy",this)},init_dependency_hierarchy:function(){var e=this,i=0;t.each(this.objects,function(r){r.init_dependencies(function(){i++,i===t.size(e.objects)&&e.trigger("sizeNeedsUpdate",e)})},this),t.isEmpty(this.dependencies)&&this.trigger("load_dependencies",this)},_initEntityObjects:function(){for(var e=0;this.entityModel.subEntities.models.length>e;e++){var t=this.entityModel.subEntities.models[e];if(!this.objects[t.get("id")]){var i=this.generateUniqueObjectName(t.get("name"));t.set({name:i},{silent:!0}),this._registerEntityAsObject(t)}}},getAllObjects:function(e){if(e){if(e.autoLoad)for(var t in this.objects)"pending"==this.objects[t].state_base&&this.objects[t].load();if(e.filter){var i={};for(var t in this.objects)e.filter[this.objects[t].type]&&(i[t]=this.objects[t]);return i}}return this.objects},getObject:function(e,t){return t||(t={}),this.objects[e]?(t.autoLoad?this.objects[e].load(t):(t.load||t.load_base||t.load_hierarchy)&&console.error("Loading callback(s) were passed into getAsset but 'autoLoad: true' wasn't passed in the options object. Therefore these callbacks will never be run."),this.objects[e]):e===this.id?this:null
},onSizeNeedsUpdate:function(){this.sizeNeedsUpdate=!0},onUpdate:function(){this.sizeNeedsUpdate&&(this.sizeNeedsUpdate=!1,this.update_dataSize_hierarchy())},onEntityLoadChildObjects:function(e){for(var t=0;e.models.length>t;t++)this._registerEntityAsObject(e.models[t])},onEntityAddChildObject:function(e){this._registerEntityAsObject(e)},onEntityRemoveChildObject:function(e){this._unregisterEntityAsObject(e)},_registerEntityAsObject:function(e){if(!e)return console.error(this.veroldEngine.engineName+" - BaseAsset: Trying to create an object with no backbone model."),void 0;var t,i=e.get("type");if("camera"===i)t=new s;else if("light"===i){if(this.numLights||(this.numLights=0),this.numLights++,this.numLights>2&&50>this.veroldEngine.Renderer.caps.MAX_FRAGMENT_UNIFORM_VECTORS)return;t=new o}else if("mesh"===i)t=new a;else if("skinned_mesh"===i)t=new l;else if("model"===i)t=new d;else{if("node"!==i)return console.warn("TODO: support for object type, "+i+", under asset type, "+this.type),void 0;t=new n}var r=t.initialize({entityModel:e,veroldEngine:this.veroldEngine,type:i,parentAssetId:this.id});return r===!1?(console.error("Failed to initialize "+i+" object, "+e.id+", under "+this.entityModel.get("type")+" asset, "+this.id),t.uninitialize(),void 0):(this.objects[t.id]=t,e.creationCallbacks.success[this.veroldEngine.engineName]&&(e.creationCallbacks.success[this.veroldEngine.engineName](t),delete e.creationCallbacks.success[this.veroldEngine.engineName]),void 0)},_unregisterEntityAsObject:function(e){e||console.error(this.veroldEngine.engineName+" - BaseAsset: unregistering an object with no backbone model."),this.objects[e.id]&&(this.objects[e.id].unload({nonRecursive:!0}),delete this.objects[e.id])},createObject:function(e,t){var i=this;if(this.entityModel.isPersistent&&"pending"==this.state_hierarchy)this.state_hierarchy="registering",this.entityModel.loadSubEntities(function(){i.state_hierarchy="registered",i.createObject(e,t)});else{if(t||(t={}),!e.id&&!t.persistent)return console.error(this.veroldEngine.engineName+" - VeroldObject.createObject : You must specify a unique id for non-persistent objects."),void 0;if(this.objects[e.id]&&t.persistent)return console.error(this.veroldEngine.engineName+" - VeroldObject.createObject : Trying to create object with id, "+e.id+", that already exists."),void 0;e.payload||(e.payload={}),e.name||(e.name=""),e.name=this.generateUniqueObjectName(e.name),e.id=this.generateUniqueObjectID(e.id),e.type||console.error(this.veroldEngine.engineName+" - VeroldObject.createObject : Can't create a new VeroldObject without specifying a type!");var n=new r(e);n.isPersistent=t.persistent||t.alreadyInDatabase?!0:!1,t.alreadyInDatabase||!n.isPersistent?this._addEntityObject(n,t):this._addNewEntityObject(n,t)}},createInstance:function(e,t){var i={};if(t||(t={}),this===e)return console.error(this.veroldEngine.engineName+" - Can't create an instance of an object inside itself.",e),void 0;if(this.isInstance())return console.error(this.veroldEngine.engineName+" - Can't create an instance of an instance.",e),void 0;var r=this;if(t.persistent)i.connectionId=window.socket?window.socket.socket.sessionid:null,i.parentAssetId=this.getParentAsset().id,e.entityModel.getInstance(i,function(e){t&&t.success&&t.success(r.getObject(e.get("id")))});else{t||(t={});var n=e.getParentAsset(),s=e.entityModel.get("id")+"_instance";s=r.generateUniqueObjectID(s);var o=e.entityModel.get("name")+"_instance";o=r.generateUniqueObjectName(o),i={id:t.id?t.id:s,name:t.name?t.name:o,instanceOf:e.id,instanceOfAsset:n.id,type:e.entityModel.get("type"),payload:t.payload?t.payload:{}},this.createObject(i,{persistent:!1,success:function(i){var s=e.entityModel.get("children");for(var o in s){var a=n.getObject(o);r.createInstance(a,{persistent:!1,success:function(e){i.addChildObject(e,{save:!1})}})}t.success&&t.success(i)}})}},destroy:function(e){this.registry.destroyAsset(this.id,e)},destroyObject:function(e,i){var r=this.objects[e];if(!r)return console.warn(this.veroldEngine.engineName+" - AssetRegistry.destroy : You must specify a valid asset ID to destroy."),void 0;i||(i={}),r.flaggedForDelete=!0;var n=r.entityModel,s=n.get("children"),o=r.getParentObject();if(o&&!o.flaggedForDelete?o.removeChildObject(r,i):o&&console.log("Not removing "+r.type+", "+r.id+", from "+o.type+", "+o.id+", because it is being deleted anyway."),t.each(s,function(e,t){this.destroyObject(t,i)},this),n.isPersistent&&i.save){var a={};a.connectionId=window.socket?window.socket.socket.sessionid:null,a.syncObjects={stream1:"sceneUpdates"},a.parentAssetId=this.id,n.destroy(a)}else this.entityModel.subEntities.remove(n)},clone:function(e){if(e||(e={}),e.persistent){var t=this,i={};i.connectionId=window.socket?window.socket.socket.sessionid:null,this.entityModel.getClone(i,function(i){var r=t.veroldEngine.assetRegistry.getAsset(i.id);if(r){var n={name:""};n.name=e.name?t.veroldEngine.assetRegistry.generateUniqueAssetName(e.name):t.veroldEngine.assetRegistry.generateUniqueAssetName(r.entityModel.get("name")),r.set(n,{save:e.persistent}),e.success&&e.success(r)}else console.error(t.veroldEngine.engineName+" - 'getClone' returned but the cloned asset doesn't appear to exist.")})}else console.error("TODO: need to implement cloning of non-persistent assets.")},_addNewEntityObject:function(e,t){var i=this,r=e.toJSON();delete r.id,e.unset("id",{silent:!0}),delete e.id,e.set({projectId:this.projectId},{silent:!0}),window.socket&&window.socket.socket&&(r.connectionId=window.socket.socket.sessionid,r.parentAssetId=this.getParentAsset().id),e.save(r,{wait:!0,success:function(e){console.log(i.veroldEngine.engineName+" - New Asset saved: ",r),i._addEntityObject(e,t)},error:function(e,i){t&&t.failure&&t.failure(e,i)}})},_addEntityObject:function(e,t){t.success&&(e.creationCallbacks.success[this.veroldEngine.engineName]=t.success),this.entityModel.subEntities.add(e)},onEntityNameChanged:function(e,t){var i=e.changed;i.name&&(this.name=this.veroldEngine.assetRegistry.generateUniqueAssetName(t),this.threeData&&void 0!==this.threeData.name&&(this.threeData.name=t),this.name!==this.entityModel.get("name")&&this.set({name:this.name},{silent:!0}))},generateUniqueObjectID:function(e){for(var t=e,i=1;this.objects[t];)t=e+"_"+i++;return t},generateUniqueObjectName:function(e){var t=e,i=1,r=!1;do{r&&(t=e+"_"+i++),r=!1;for(var n in this.objects){var s=this.objects[n].entityModel.get("name");if(s==t){r=!0;break}}}while(r);return t}}),t.isObject(window.VAPI)&&(window.VAPI.BaseAsset=c),c}),i("scene/VeroldEngine/AssetRegistry/SceneAsset",["jquery","underscore","three","scene/VeroldEngine/AssetRegistry/BaseAsset","scene/Materials/EditorMaterials"],function(e,t,i,r,n){var s=function(){r.call(this)};return t.extend(s.prototype,r.prototype,{constructor:s,initialize:function(e){r.prototype.initialize.call(this,e),window.verold.veroldEvents.on("engine::mesh::materialDeleted",this.onMaterialDeleted,this),window.verold.veroldEvents.on("engine::scene::modelDeleted",this.onModelDeleted,this)},uninitialize:function(e){r.prototype.uninitialize.call(this,e),window.verold.veroldEvents.off("engine::mesh::materialDeleted",this.onMaterialDeleted,this),window.verold.veroldEvents.off("engine::scene::modelDeleted",this.onModelDeleted,this)},init_dependencies:function(e,i){var n=this;r.prototype.init_dependencies.call(this,function(){var i=n.entityModel.get("payload"),r=void 0!==i.environment?i.environment:{};r.skyboxCubemap?n.registerDependency(r.skyboxCubemap):n.registerDependency(n.registry.defaultEnvironment.skyboxCubemap),r.groundPlaneMaterial?n.registerDependency(r.groundPlaneMaterial):n.registerDependency(n.veroldEngine.assetRegistry.Materials.getMissingMaterial().id),t.isFunction(e)&&e.call(n)},i)},_loadThreeData:function(e){this.threeData=new i.Scene,this.threeData.childIDs={},this.threeData.veroldAssetID=this.id,this.threeData.name=this.entityModel.get("name");var t=this.entityModel.get("payload");t.environment||(t.environment={},e.payload.environment={});var r=t.environment;for(var n in this.registry.defaultEnvironment)void 0==r[n]&&(e.payload.environment[n]=!0,r[n]=this.registry.defaultEnvironment[n]);this.veroldEngine.assetRegistry.Textures.assets[r.skyboxCubemap]||(r.skyboxCubemap=this.registry.defaultEnvironment.skyboxCubemap),this.applyPayloadSettings_loaded(e.payload),this.trigger("load_base",this)},applyPayloadSettings_loaded:function(e){e.fog&&this.applyFogSettings(e.fog),e.environment&&(this.applyEnvironmentSettings(e.environment),this.trigger("updated",this))},applyEnvironmentSettings:function(e){if(this.threeData){var t=this.entityModel.get("payload").environment,r=this;if(this.threeData.ground)this.threeData.ground&&this.applyGroundSettings(e);else{this.threeData.ground&&(this.threeData.remove(this.threeData.ground),this.threeData.ground.dispose()),e.groundPlaneMaterialScale?t.groundPlaneMaterialScale:this.registry.defaultEnvironment.groundPlaneMaterialScale,e.groundPlaneTesselation?t.groundPlaneTesselation:this.registry.defaultEnvironment.groundPlaneTesselation;var s=new i.PlaneGeometry(1,1,120,120,30);s.applyMatrix((new i.Matrix4).makeRotationX(-Math.PI/2)),s.computeTangents(),this.threeData.ground=new i.Mesh(s),this.threeData.ground.useQuaternion=!0,this.threeData.ground.material=null,this.threeData.ground.castShadow=!1,this.threeData.ground.receiveShadow=!0,this.threeData.ground.name="Ground",this.threeData.add(this.threeData.ground),this.applyGroundSettings(e)}if(this.threeData.skybox)this.threeData.skybox&&this.applySkyboxSettings(e);else{console.log(this.veroldEngine.engineName+" - Creating the skybox.");var o=new i.CubeGeometry(2e3,2e3,2e3,1,1,1);o.computeTangents();var a=new i.ShaderMaterial(n.skybox);a.uniforms=i.UniformsUtils.clone(a.uniforms),a.useFog=!0,a.fog=!0,this.threeData.skybox=new i.Mesh(o,a),this.threeData.skybox.useQuaternion=!0,this.threeData.skybox.frustumCulled=!1,this.threeData.skybox.castShadow=!1,this.threeData.skybox.receiveShadow=!1,this.threeData.skybox.name="Skybox",console.log(r.veroldEngine.engineName+" - Adding the skybox to the scene, "+this.threeData),this.threeData.add(this.threeData.skybox),this.applySkyboxSettings(e)}}},applyFogSettings:function(e){if(this.threeData){var t=this.entityModel.get("payload").fog;(!this.threeData.fog||e.type)&&("FogExp2"==t.type?this.threeData.fog=new i.FogExp2(this.registry.defaultFog.color,this.registry.defaultFog.density):console.log(this.veroldEngine.engineName+" - SceneAsset.applyFogSettings: Invalid fog type, "+type+", in scene!")),void 0!==e.color&&this.threeData.fog.color.setHex(t.color),void 0!==e.density&&(this.threeData.fog.density=t.density)}},update:function(){},unloadDerived:function(e){if(this.assets[e].threeData){var t=this.assets[e].threeData;t.traverse(function(e){e.parent=void 0})}},applySkyboxSettings:function(e){if(this.threeData.skybox){var t=this,i=this.entityModel.get("payload").environment;if(void 0!==e.skyboxCubemap){var r=this.veroldEngine.assetRegistry.Textures.getAsset(i.skyboxCubemap);if(r){var n=this.entityModel.previous("payload");(!n||n.environment&&n.environment.skyboxCubemap!==r.id)&&this.registerDependency(r.id),r.load({load:function(e){t.veroldEngine.currentDefaultEnvMapID=e.id,t.threeData.skybox.material.uniforms.environmentTexture.value=e.threeData;var i=t.veroldEngine.assetRegistry.Materials.getAllAssets();for(var r in i)i[r].set({"payload.environmentTexture":e.id},{save:!1})}})}}void 0!==e.skyboxOn&&(this.threeData.skybox.visible=i.skyboxOn),void 0!==e.skyboxFogPower&&(this.threeData.skybox.material.uniforms.skyboxFogPower.value=i.skyboxFogPower),void 0!==e.skyboxFogScale&&(this.threeData.skybox.material.uniforms.skyboxFogScale.value=i.skyboxFogScale)}else console.error("Can't set environment texture when no skybox exists.")},applyGroundSettings:function(e){if(this.threeData.ground&&e){var t=this,i=this.entityModel.get("payload").environment;if(void 0!==e.groundPlaneOn&&(this.threeData.ground.visible=i.groundPlaneOn),void 0!==e.groundPlaneScale&&this.threeData.ground.scale.set(i.groundPlaneScale,i.groundPlaneScale,i.groundPlaneScale),void 0!==e.groundPlaneMaterial){var r=t.threeData.ground.visible;t.threeData.ground.visible=!1;var n=this.veroldEngine.assetRegistry.Materials.getAsset(i.groundPlaneMaterial);n||(n=t.veroldEngine.assetRegistry.Materials.getMissingMaterial());var s=this.entityModel.previous("payload");(!s||s.environment&&s.environment.groundPlaneMaterial!==n.id)&&this.registerDependency(n.id),n.on("load_base",function(e){t.threeData.ground.material=e.threeData.static,t.threeData.ground.visible=r},this),n.load()}}else console.error("Can't set ground properties when no ground exists.")},unload:function(){this.threeData&&(console.log(this.veroldEngine.engineName+" - Unloading scene, "+this.entityModel.get("name")),this.threeData&&this.threeData.skybox&&(this.threeData.remove(this.threeData.skybox),this.threeData.skybox.material.dispose(),this.threeData.skybox.geometry.dispose(),this.threeData.skybox=null),this.threeData&&this.threeData.ground&&(this.threeData.remove(this.threeData.ground),this.threeData.ground.geometry.dispose(),this.threeData.ground=null),r.prototype.unload.call(this))},onMaterialDeleted:function(e){if(this.threeData&&this.threeData.ground&&this.threeData.ground.material.veroldAssetID==e){var t=this;console.log("Material that is in-use by ground plane has been deleted"),this.veroldEngine.assetRegistry.Materials.getMissingMaterial({autoLoad:!0,load:function(e){t.threeData.ground.material=e.threeData["static"]}})}},onModelDeleted:function(e){if(this.threeData)for(var t in this.objects){var i=this.objects[t].entityModel.get("instanceOf");i==e&&this.destroyObject(t,{save:!0})}},getStartupCameraInfo:function(){var e=this.entityModel.get("payload");return e&&e.startupCamera?e.startupCamera:void 0},getWorldScale:function(){var e=this.entityModel.get("payload");return e&&e.worldScale?e.worldScale:null},setWorldScale:function(e,t){this.set({"payload.worldScale":{x:e.x,y:e.y,z:e.z}},t)},getSkyboxTextureID:function(){return this.entityModel.get("payload").environment.skyboxCubemap}}),t.isObject(window.VAPI)&&(window.VAPI.SceneAsset=s),s}),i("scene/VeroldEngine/AssetRegistry/SceneRegistry",["jquery","underscore","three","scene/VeroldEngine/AssetRegistry/SceneAsset"],function(e,t,i,r){return SceneRegistry=function(){this.assets=void 0,this.defaultFog={type:"FogExp2",color:12303291,density:.2},this.environmentTextures={environment_default:{name:"Default",id:"environment_default",type:"textureCube",payload:{tex_dxt:{width:32,height:32,size:3200,path:window.verold.glAssetsBaseUrl+"/textures/Materials/Default_EnvMap.dds"},tex:{width:32,height:32,path:[window.verold.glAssetsBaseUrl+"/textures/Materials/Default_EnvMap.png",window.verold.glAssetsBaseUrl+"/textures/Materials/Default_EnvMap.png",window.verold.glAssetsBaseUrl+"/textures/Materials/Default_EnvMap.png",window.verold.glAssetsBaseUrl+"/textures/Materials/Default_EnvMap.png",window.verold.glAssetsBaseUrl+"/textures/Materials/Default_EnvMap.png",window.verold.glAssetsBaseUrl+"/textures/Materials/Default_EnvMap.png"]},tex_dxt_low:{width:32,height:32,path:window.verold.glAssetsBaseUrl+"/textures/Materials/Default_EnvMap.dds"},tex_low:{width:32,height:32,path:[window.verold.glAssetsBaseUrl+"/textures/Materials/Default_EnvMap.png",window.verold.glAssetsBaseUrl+"/textures/Materials/Default_EnvMap.png",window.verold.glAssetsBaseUrl+"/textures/Materials/Default_EnvMap.png",window.verold.glAssetsBaseUrl+"/textures/Materials/Default_EnvMap.png",window.verold.glAssetsBaseUrl+"/textures/Materials/Default_EnvMap.png",window.verold.glAssetsBaseUrl+"/textures/Materials/Default_EnvMap.png"]},isLocal:!0}},environment_texture_ArstaBridge:{name:"ArstaBridge",id:"environment_texture_ArstaBridge",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/ArstaBridge.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/ArstaBridge.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/ArstaBridge-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/ArstaBridge-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/ArstaBridge-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/ArstaBridge-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/ArstaBridge-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/ArstaBridge-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/ArstaBridge-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/ArstaBridge-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/ArstaBridge-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/ArstaBridge-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/ArstaBridge-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/ArstaBridge-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8,credit:"Original author is blah"}},environment_texture_Backyard:{name:"Backyard",id:"environment_texture_Backyard",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Backyard.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Backyard.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Backyard-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Backyard-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Backyard-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Backyard-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Backyard-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Backyard-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Backyard-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Backyard-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Backyard-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Backyard-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Backyard-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Backyard-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_BerzeliiPark:{name:"BerzeliiPark",id:"environment_texture_BerzeliiPark",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/BerzeliiPark.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/BerzeliiPark.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/BerzeliiPark-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/BerzeliiPark-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/BerzeliiPark-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/BerzeliiPark-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/BerzeliiPark-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/BerzeliiPark-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/BerzeliiPark-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/BerzeliiPark-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/BerzeliiPark-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/BerzeliiPark-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/BerzeliiPark-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/BerzeliiPark-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Bridge:{name:"Bridge",id:"environment_texture_Bridge",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Bridge.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Bridge.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Bridge-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Bridge-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Bridge-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Bridge-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Bridge-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Bridge-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Bridge-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Bridge-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Bridge-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Bridge-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Bridge-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Bridge-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Bridge2:{name:"Bridge2",id:"environment_texture_Bridge2",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Bridge2.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Bridge2.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Bridge2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Bridge2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Bridge2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Bridge2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Bridge2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Bridge2-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Bridge2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Bridge2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Bridge2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Bridge2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Bridge2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Bridge2-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Brudslojan:{name:"Brudslojan",id:"environment_texture_Brudslojan",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Brudslojan.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Brudslojan.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Brudslojan-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Brudslojan-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Brudslojan-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Brudslojan-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Brudslojan-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Brudslojan-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Brudslojan-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Brudslojan-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Brudslojan-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Brudslojan-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Brudslojan-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Brudslojan-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Buddha:{name:"Buddha",id:"environment_texture_Buddha",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Buddha.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Buddha.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Buddha-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Buddha-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Buddha-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Buddha-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Buddha-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Buddha-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Buddha-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Buddha-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Buddha-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Buddha-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Buddha-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Buddha-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_CNTower:{name:"CNTower",id:"environment_texture_CNTower",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/CNTower.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/CNTower.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/CNTower-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/CNTower-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/CNTower-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/CNTower-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/CNTower-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/CNTower-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/CNTower-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/CNTower-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/CNTower-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/CNTower-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/CNTower-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/CNTower-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_CNTower2:{name:"CNTower2",id:"environment_texture_CNTower2",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/CNTower2.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/CNTower2.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/CNTower2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/CNTower2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/CNTower2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/CNTower2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/CNTower2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/CNTower2-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/CNTower2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/CNTower2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/CNTower2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/CNTower2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/CNTower2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/CNTower2-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Creek:{name:"Creek",id:"environment_texture_Creek",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Creek.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Creek.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Creek-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Creek-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Creek-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Creek-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Creek-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Creek-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Creek-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Creek-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Creek-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Creek-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Creek-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Creek-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_DallasW:{name:"DallasW",id:"environment_texture_DallasW",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/DallasW.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/DallasW.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/DallasW-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/DallasW-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/DallasW-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/DallasW-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/DallasW-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/DallasW-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/DallasW-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/DallasW-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/DallasW-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/DallasW-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/DallasW-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/DallasW-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_EarthOrbit:{name:"Earth Orbit",id:"environment_texture_EarthOrbit",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/EarthOrbit.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/EarthOrbit.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/EarthOrbit-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/EarthOrbit-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/EarthOrbit-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/EarthOrbit-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/EarthOrbit-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/EarthOrbit-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/EarthOrbit-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/EarthOrbit-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/EarthOrbit-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/EarthOrbit-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/EarthOrbit-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/EarthOrbit-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Fatbursparken:{name:"Fatbursparken",id:"environment_texture_Fatbursparken",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Fatbursparken.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Fatbursparken.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Fatbursparken-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Fatbursparken-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Fatbursparken-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Fatbursparken-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Fatbursparken-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Fatbursparken-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Fatbursparken-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Fatbursparken-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Fatbursparken-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Fatbursparken-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Fatbursparken-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Fatbursparken-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_FishPond:{name:"FishPond",id:"environment_texture_FishPond",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/FishPond.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/FishPond.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/FishPond-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/FishPond-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/FishPond-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/FishPond-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/FishPond-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/FishPond-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/FishPond-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/FishPond-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/FishPond-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/FishPond-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/FishPond-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/FishPond-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Footballfield:{name:"Footballfield",id:"environment_texture_Footballfield",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Footballfield.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Footballfield.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Footballfield-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Footballfield-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Footballfield-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Footballfield-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Footballfield-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Footballfield-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Footballfield-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Footballfield-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Footballfield-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Footballfield-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Footballfield-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Footballfield-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Footballfield2:{name:"Footballfield2",id:"environment_texture_Footballfield2",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Footballfield2.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Footballfield2.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Footballfield2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Footballfield2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Footballfield2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Footballfield2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Footballfield2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Footballfield2-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Footballfield2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Footballfield2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Footballfield2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Footballfield2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Footballfield2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Footballfield2-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Footballfield3:{name:"Footballfield3",id:"environment_texture_Footballfield3",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Footballfield3.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Footballfield3.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Footballfield3-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Footballfield3-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Footballfield3-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Footballfield3-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Footballfield3-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Footballfield3-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Footballfield3-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Footballfield3-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Footballfield3-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Footballfield3-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Footballfield3-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Footballfield3-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_ForbiddenCity:{name:"ForbiddenCity",id:"environment_texture_ForbiddenCity",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/ForbiddenCity.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/ForbiddenCity.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/ForbiddenCity-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/ForbiddenCity-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/ForbiddenCity-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/ForbiddenCity-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/ForbiddenCity-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/ForbiddenCity-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/ForbiddenCity-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/ForbiddenCity-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/ForbiddenCity-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/ForbiddenCity-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/ForbiddenCity-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/ForbiddenCity-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Forest:{name:"Forest",id:"environment_texture_Forest",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Forest.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Forest.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Forest-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Forest-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Forest-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Forest-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Forest-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Forest-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Forest-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Forest-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Forest-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Forest-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Forest-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Forest-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_GamlaStan:{name:"GamlaStan",id:"environment_texture_GamlaStan",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/GamlaStan.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/GamlaStan.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/GamlaStan-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/GamlaStan-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/GamlaStan-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/GamlaStan-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/GamlaStan-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/GamlaStan-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/GamlaStan-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/GamlaStan-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/GamlaStan-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/GamlaStan-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/GamlaStan-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/GamlaStan-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_GamlaStan2:{name:"GamlaStan2",id:"environment_texture_GamlaStan2",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/GamlaStan2.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/GamlaStan2.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/GamlaStan2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/GamlaStan2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/GamlaStan2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/GamlaStan2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/GamlaStan2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/GamlaStan2-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/GamlaStan2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/GamlaStan2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/GamlaStan2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/GamlaStan2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/GamlaStan2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/GamlaStan2-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_HeartInTheSand:{name:"HeartInTheSand",id:"environment_texture_HeartInTheSand",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/HeartInTheSand.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/HeartInTheSand.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/HeartInTheSand-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/HeartInTheSand-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/HeartInTheSand-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/HeartInTheSand-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/HeartInTheSand-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/HeartInTheSand-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/HeartInTheSand-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/HeartInTheSand-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/HeartInTheSand-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/HeartInTheSand-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/HeartInTheSand-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/HeartInTheSand-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_HornstullsStrand:{name:"HornstullsStrand",id:"environment_texture_HornstullsStrand",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/HornstullsStrand.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/HornstullsStrand.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/HornstullsStrand-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/HornstullsStrand-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/HornstullsStrand-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/HornstullsStrand-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/HornstullsStrand-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/HornstullsStrand-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/HornstullsStrand-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/HornstullsStrand-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/HornstullsStrand-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/HornstullsStrand-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/HornstullsStrand-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/HornstullsStrand-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_HornstullsStrand2:{name:"HornstullsStrand2",id:"environment_texture_HornstullsStrand2",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/HornstullsStrand2.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/HornstullsStrand2.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/HornstullsStrand2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/HornstullsStrand2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/HornstullsStrand2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/HornstullsStrand2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/HornstullsStrand2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/HornstullsStrand2-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/HornstullsStrand2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/HornstullsStrand2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/HornstullsStrand2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/HornstullsStrand2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/HornstullsStrand2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/HornstullsStrand2-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_House:{name:"House",id:"environment_texture_House",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/House.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/House.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/House-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/House-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/House-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/House-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/House-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/House-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/House-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/House-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/House-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/House-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/House-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/House-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_IceLake:{name:"IceLake",id:"environment_texture_IceLake",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/IceLake.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/IceLake.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/IceLake-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/IceLake-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/IceLake-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/IceLake-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/IceLake-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/IceLake-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/IceLake-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/IceLake-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/IceLake-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/IceLake-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/IceLake-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/IceLake-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_IceRiver:{name:"IceRiver",id:"environment_texture_IceRiver",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/IceRiver.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/IceRiver.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/IceRiver-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/IceRiver-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/IceRiver-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/IceRiver-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/IceRiver-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/IceRiver-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/IceRiver-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/IceRiver-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/IceRiver-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/IceRiver-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/IceRiver-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/IceRiver-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Kastellholmen:{name:"Kastellholmen",id:"environment_texture_Kastellholmen",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Kastellholmen.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Kastellholmen.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Kastellholmen-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Kastellholmen-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Kastellholmen-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Kastellholmen-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Kastellholmen-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Kastellholmen-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Kastellholmen-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Kastellholmen-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Kastellholmen-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Kastellholmen-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Kastellholmen-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Kastellholmen-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Langholmen:{name:"Langholmen",id:"environment_texture_Langholmen",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Langholmen.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Langholmen.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Langholmen-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Langholmen-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Langholmen-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Langholmen-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Langholmen-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Langholmen-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Langholmen-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Langholmen-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Langholmen-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Langholmen-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Langholmen-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Langholmen-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Langholmen2:{name:"Langholmen2",id:"environment_texture_Langholmen2",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Langholmen2.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Langholmen2.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Langholmen2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Langholmen2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Langholmen2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Langholmen2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Langholmen2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Langholmen2-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Langholmen2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Langholmen2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Langholmen2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Langholmen2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Langholmen2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Langholmen2-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Langholmen3:{name:"Langholmen3",id:"environment_texture_Langholmen3",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Langholmen3.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Langholmen3.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Langholmen3-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Langholmen3-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Langholmen3-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Langholmen3-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Langholmen3-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Langholmen3-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Langholmen3-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Langholmen3-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Langholmen3-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Langholmen3-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Langholmen3-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Langholmen3-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_LarnacaBeach:{name:"LarnacaBeach",id:"environment_texture_LarnacaBeach",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/LarnacaBeach.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/LarnacaBeach.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/LarnacaBeach-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/LarnacaBeach-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/LarnacaBeach-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/LarnacaBeach-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/LarnacaBeach-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/LarnacaBeach-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/LarnacaBeach-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/LarnacaBeach-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/LarnacaBeach-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/LarnacaBeach-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/LarnacaBeach-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/LarnacaBeach-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Lundagatan:{name:"Lundagatan",id:"environment_texture_Lundagatan",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Lundagatan.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Lundagatan.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Lundagatan-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Lundagatan-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Lundagatan-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Lundagatan-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Lundagatan-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Lundagatan-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Lundagatan-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Lundagatan-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Lundagatan-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Lundagatan-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Lundagatan-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Lundagatan-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_MarriottMadisonWest:{name:"MarriottMadisonWest",id:"environment_texture_MarriottMadisonWest",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/MarriottMadisonWest.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/MarriottMadisonWest.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/MarriottMadisonWest-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/MarriottMadisonWest-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/MarriottMadisonWest-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/MarriottMadisonWest-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/MarriottMadisonWest-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/MarriottMadisonWest-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/MarriottMadisonWest-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/MarriottMadisonWest-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/MarriottMadisonWest-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/MarriottMadisonWest-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/MarriottMadisonWest-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/MarriottMadisonWest-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Maskonaive:{name:"Maskonaive",id:"environment_texture_Maskonaive",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Maskonaive.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Maskonaive.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Maskonaive-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Maskonaive-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Maskonaive-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Maskonaive-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Maskonaive-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Maskonaive-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Maskonaive-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Maskonaive-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Maskonaive-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Maskonaive-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Maskonaive-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Maskonaive-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Maskonaive2:{name:"Maskonaive2",id:"environment_texture_Maskonaive2",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Maskonaive2.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Maskonaive2.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Maskonaive2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Maskonaive2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Maskonaive2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Maskonaive2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Maskonaive2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Maskonaive2-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Maskonaive2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Maskonaive2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Maskonaive2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Maskonaive2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Maskonaive2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Maskonaive2-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Maskonaive3:{name:"Maskonaive3",id:"environment_texture_Maskonaive3",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Maskonaive3.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Maskonaive3.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Maskonaive3-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Maskonaive3-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Maskonaive3-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Maskonaive3-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Maskonaive3-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Maskonaive3-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Maskonaive3-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Maskonaive3-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Maskonaive3-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Maskonaive3-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Maskonaive3-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Maskonaive3-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Meadow:{name:"Meadow",id:"environment_texture_Meadow",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Meadow.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Meadow.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Meadow-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Meadow-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Meadow-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Meadow-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Meadow-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Meadow-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Meadow-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Meadow-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Meadow-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Meadow-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Meadow-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Meadow-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Medborgarplatsen:{name:"Medborgarplatsen",id:"environment_texture_Medborgarplatsen",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Medborgarplatsen.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Medborgarplatsen.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Medborgarplatsen-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Medborgarplatsen-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Medborgarplatsen-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Medborgarplatsen-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Medborgarplatsen-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Medborgarplatsen-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Medborgarplatsen-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Medborgarplatsen-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Medborgarplatsen-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Medborgarplatsen-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Medborgarplatsen-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Medborgarplatsen-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_MilkyWay:{name:"Milky Way",id:"environment_texture_MilkyWay",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/MilkyWay.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/MilkyWay.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/MilkyWay-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/MilkyWay-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/MilkyWay-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/MilkyWay-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/MilkyWay-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/MilkyWay-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/MilkyWay-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/MilkyWay-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/MilkyWay-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/MilkyWay-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/MilkyWay-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/MilkyWay-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_MountainPath:{name:"MountainPath",id:"environment_texture_MountainPath",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/MountainPath.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/MountainPath.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/MountainPath-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/MountainPath-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/MountainPath-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/MountainPath-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/MountainPath-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/MountainPath-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/MountainPath-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/MountainPath-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/MountainPath-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/MountainPath-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/MountainPath-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/MountainPath-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Nalovardo:{name:"Nalovardo",id:"environment_texture_Nalovardo",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Nalovardo.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Nalovardo.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Nalovardo-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Nalovardo-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Nalovardo-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Nalovardo-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Nalovardo-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Nalovardo-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Nalovardo-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Nalovardo-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Nalovardo-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Nalovardo-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Nalovardo-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Nalovardo-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_NiagaraFalls1:{name:"NiagaraFalls1",id:"environment_texture_NiagaraFalls1",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/NiagaraFalls1.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/NiagaraFalls1.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NiagaraFalls1-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NiagaraFalls1-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NiagaraFalls1-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NiagaraFalls1-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NiagaraFalls1-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NiagaraFalls1-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NiagaraFalls1-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NiagaraFalls1-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NiagaraFalls1-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NiagaraFalls1-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NiagaraFalls1-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NiagaraFalls1-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_NiagaraFalls2:{name:"NiagaraFalls2",id:"environment_texture_NiagaraFalls2",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/NiagaraFalls2.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/NiagaraFalls2.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NiagaraFalls2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NiagaraFalls2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NiagaraFalls2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NiagaraFalls2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NiagaraFalls2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NiagaraFalls2-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NiagaraFalls2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NiagaraFalls2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NiagaraFalls2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NiagaraFalls2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NiagaraFalls2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NiagaraFalls2-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_NiagaraFalls3:{name:"NiagaraFalls3",id:"environment_texture_NiagaraFalls3",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/NiagaraFalls3.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/NiagaraFalls3.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NiagaraFalls3-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NiagaraFalls3-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NiagaraFalls3-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NiagaraFalls3-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NiagaraFalls3-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NiagaraFalls3-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NiagaraFalls3-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NiagaraFalls3-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NiagaraFalls3-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NiagaraFalls3-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NiagaraFalls3-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NiagaraFalls3-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_NightPath:{name:"NightPath",id:"environment_texture_NightPath",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/NightPath.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/NightPath.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NightPath-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NightPath-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NightPath-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NightPath-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NightPath-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/NightPath-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NightPath-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NightPath-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NightPath-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NightPath-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NightPath-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/NightPath-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_PalmTrees:{name:"PalmTrees",id:"environment_texture_PalmTrees",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/PalmTrees.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/PalmTrees.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/PalmTrees-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/PalmTrees-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/PalmTrees-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/PalmTrees-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/PalmTrees-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/PalmTrees-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/PalmTrees-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/PalmTrees-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/PalmTrees-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/PalmTrees-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/PalmTrees-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/PalmTrees-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Park:{name:"Park",id:"environment_texture_Park",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Park.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Park.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Park-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Park-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Park-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Park-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Park-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Park-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Park-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Park-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Park-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Park-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Park-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Park-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Park2:{name:"Park2",id:"environment_texture_Park2",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Park2.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Park2.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Park2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Park2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Park2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Park2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Park2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Park2-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Park2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Park2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Park2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Park2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Park2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Park2-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Park3:{name:"Park3",id:"environment_texture_Park3",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Park3.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Park3.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Park3-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Park3-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Park3-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Park3-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Park3-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Park3-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Park3-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Park3-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Park3-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Park3-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Park3-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Park3-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Parliament:{name:"Parliament",id:"environment_texture_Parliament",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Parliament.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Parliament.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Parliament-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Parliament-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Parliament-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Parliament-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Parliament-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Parliament-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Parliament-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Parliament-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Parliament-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Parliament-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Parliament-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Parliament-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Path:{name:"Path",id:"environment_texture_Path",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Path.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Path.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Path-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Path-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Path-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Path-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Path-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Path-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Path-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Path-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Path-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Path-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Path-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Path-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Plants:{name:"Plants",id:"environment_texture_Plants",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Plants.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Plants.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Plants-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Plants-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Plants-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Plants-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Plants-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Plants-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Plants-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Plants-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Plants-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Plants-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Plants-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Plants-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Pond:{name:"Pond",id:"environment_texture_Pond",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Pond.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Pond.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Pond-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Pond-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Pond-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Pond-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Pond-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Pond-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Pond-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Pond-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Pond-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Pond-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Pond-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Pond-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_PondNight:{name:"PondNight",id:"environment_texture_PondNight",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/PondNight.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/PondNight.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/PondNight-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/PondNight-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/PondNight-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/PondNight-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/PondNight-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/PondNight-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/PondNight-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/PondNight-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/PondNight-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/PondNight-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/PondNight-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/PondNight-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_PondWinter:{name:"PondWinter",id:"environment_texture_PondWinter",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/PondWinter.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/PondWinter.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/PondWinter-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/PondWinter-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/PondWinter-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/PondWinter-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/PondWinter-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/PondWinter-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/PondWinter-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/PondWinter-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/PondWinter-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/PondWinter-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/PondWinter-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/PondWinter-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Powerlines:{name:"Powerlines",id:"environment_texture_Powerlines",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Powerlines.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Powerlines.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Powerlines-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Powerlines-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Powerlines-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Powerlines-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Powerlines-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Powerlines-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Powerlines-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Powerlines-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Powerlines-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Powerlines-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Powerlines-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Powerlines-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Riddarfjarden:{name:"Riddarfjarden",id:"environment_texture_Riddarfjarden",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Riddarfjarden.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Riddarfjarden.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Riddarfjarden-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Riddarfjarden-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Riddarfjarden-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Riddarfjarden-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Riddarfjarden-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Riddarfjarden-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Riddarfjarden-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Riddarfjarden-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Riddarfjarden-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Riddarfjarden-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Riddarfjarden-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Riddarfjarden-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Roundabout:{name:"Roundabout",id:"environment_texture_Roundabout",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Roundabout.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Roundabout.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Roundabout-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Roundabout-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Roundabout-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Roundabout-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Roundabout-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Roundabout-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Roundabout-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Roundabout-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Roundabout-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Roundabout-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Roundabout-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Roundabout-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Ryfjallet:{name:"Ryfjallet",id:"environment_texture_Ryfjallet",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Ryfjallet.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Ryfjallet.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Ryfjallet-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Ryfjallet-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Ryfjallet-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Ryfjallet-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Ryfjallet-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Ryfjallet-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Ryfjallet-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Ryfjallet-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Ryfjallet-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Ryfjallet-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Ryfjallet-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Ryfjallet-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_SaintLazarusChurch:{name:"SaintLazarusChurch",id:"environment_texture_SaintLazarusChurch",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/SaintLazarusChurch.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/SaintLazarusChurch.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SaintLazarusChurch-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SaintLazarusChurch-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SaintLazarusChurch-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SaintLazarusChurch-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SaintLazarusChurch-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SaintLazarusChurch-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SaintLazarusChurch-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SaintLazarusChurch-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SaintLazarusChurch-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SaintLazarusChurch-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SaintLazarusChurch-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SaintLazarusChurch-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_SaintLazarusChurch2:{name:"SaintLazarusChurch2",id:"environment_texture_SaintLazarusChurch2",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/SaintLazarusChurch2.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/SaintLazarusChurch2.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SaintLazarusChurch2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SaintLazarusChurch2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SaintLazarusChurch2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SaintLazarusChurch2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SaintLazarusChurch2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SaintLazarusChurch2-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SaintLazarusChurch2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SaintLazarusChurch2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SaintLazarusChurch2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SaintLazarusChurch2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SaintLazarusChurch2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SaintLazarusChurch2-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_SaintLazarusChurch3:{name:"SaintLazarusChurch3",id:"environment_texture_SaintLazarusChurch3",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/SaintLazarusChurch3.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/SaintLazarusChurch3.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SaintLazarusChurch3-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SaintLazarusChurch3-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SaintLazarusChurch3-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SaintLazarusChurch3-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SaintLazarusChurch3-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SaintLazarusChurch3-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SaintLazarusChurch3-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SaintLazarusChurch3-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SaintLazarusChurch3-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SaintLazarusChurch3-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SaintLazarusChurch3-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SaintLazarusChurch3-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Skansen:{name:"Skansen",id:"environment_texture_Skansen",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Skansen.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Skansen.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Skansen2:{name:"Skansen2",id:"environment_texture_Skansen2",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Skansen2.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Skansen2.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen2-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen2-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Skansen3:{name:"Skansen3",id:"environment_texture_Skansen3",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Skansen3.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Skansen3.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen3-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen3-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen3-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen3-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen3-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen3-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen3-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen3-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen3-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen3-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen3-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen3-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Skansen4:{name:"Skansen4",id:"environment_texture_Skansen4",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Skansen4.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Skansen4.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen4-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen4-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen4-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen4-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen4-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen4-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen4-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen4-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen4-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen4-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen4-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen4-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Skansen5:{name:"Skansen5",id:"environment_texture_Skansen5",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Skansen5.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Skansen5.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen5-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen5-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen5-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen5-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen5-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skansen5-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen5-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen5-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen5-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen5-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen5-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skansen5-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Skinnarviksberget:{name:"Skinnarviksberget",id:"environment_texture_Skinnarviksberget",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Skinnarviksberget.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Skinnarviksberget.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skinnarviksberget-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skinnarviksberget-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skinnarviksberget-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skinnarviksberget-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skinnarviksberget-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Skinnarviksberget-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skinnarviksberget-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skinnarviksberget-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skinnarviksberget-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skinnarviksberget-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skinnarviksberget-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Skinnarviksberget-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Sodermalmsallen:{name:"Sodermalmsallen",id:"environment_texture_Sodermalmsallen",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Sodermalmsallen.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Sodermalmsallen.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sodermalmsallen-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sodermalmsallen-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sodermalmsallen-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sodermalmsallen-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sodermalmsallen-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sodermalmsallen-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sodermalmsallen-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sodermalmsallen-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sodermalmsallen-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sodermalmsallen-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sodermalmsallen-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sodermalmsallen-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Sodermalmsallen2:{name:"Sodermalmsallen2",id:"environment_texture_Sodermalmsallen2",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Sodermalmsallen2.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Sodermalmsallen2.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sodermalmsallen2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sodermalmsallen2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sodermalmsallen2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sodermalmsallen2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sodermalmsallen2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sodermalmsallen2-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sodermalmsallen2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sodermalmsallen2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sodermalmsallen2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sodermalmsallen2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sodermalmsallen2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sodermalmsallen2-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Sorsele:{name:"Sorsele",id:"environment_texture_Sorsele",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Sorsele.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Sorsele.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sorsele-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sorsele-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sorsele-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sorsele-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sorsele-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sorsele-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sorsele-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sorsele-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sorsele-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sorsele-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sorsele-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sorsele-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Sorsele2:{name:"Sorsele2",id:"environment_texture_Sorsele2",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Sorsele2.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Sorsele2.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sorsele2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sorsele2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sorsele2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sorsele2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sorsele2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sorsele2-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sorsele2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sorsele2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sorsele2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sorsele2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sorsele2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sorsele2-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Sorsele3:{name:"Sorsele3",id:"environment_texture_Sorsele3",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Sorsele3.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Sorsele3.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sorsele3-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sorsele3-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sorsele3-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sorsele3-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sorsele3-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Sorsele3-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sorsele3-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sorsele3-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sorsele3-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sorsele3-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sorsele3-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Sorsele3-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Stairs:{name:"Stairs",id:"environment_texture_Stairs",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Stairs.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Stairs.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Stairs-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Stairs-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Stairs-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Stairs-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Stairs-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Stairs-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Stairs-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Stairs-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Stairs-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Stairs-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Stairs-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Stairs-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_SwedishRoyalCastle:{name:"SwedishRoyalCastle",id:"environment_texture_SwedishRoyalCastle",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/SwedishRoyalCastle.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/SwedishRoyalCastle.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SwedishRoyalCastle-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SwedishRoyalCastle-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SwedishRoyalCastle-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SwedishRoyalCastle-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SwedishRoyalCastle-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/SwedishRoyalCastle-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SwedishRoyalCastle-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SwedishRoyalCastle-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SwedishRoyalCastle-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SwedishRoyalCastle-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SwedishRoyalCastle-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/SwedishRoyalCastle-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Tanto:{name:"Tanto",id:"environment_texture_Tanto",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Tanto.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Tanto.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tanto-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tanto-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tanto-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tanto-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tanto-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tanto-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tanto-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tanto-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tanto-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tanto-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tanto-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tanto-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Tantolunden:{name:"Tantolunden",id:"environment_texture_Tantolunden",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Tantolunden.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Tantolunden.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Tantolunden2:{name:"Tantolunden2",id:"environment_texture_Tantolunden2",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Tantolunden2.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Tantolunden2.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden2-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden2-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Tantolunden3:{name:"Tantolunden3",id:"environment_texture_Tantolunden3",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Tantolunden3.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Tantolunden3.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden3-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden3-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden3-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden3-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden3-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden3-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden3-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden3-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden3-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden3-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden3-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden3-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Tantolunden4:{name:"Tantolunden4",id:"environment_texture_Tantolunden4",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Tantolunden4.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Tantolunden4.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden4-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden4-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden4-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden4-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden4-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden4-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden4-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden4-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden4-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden4-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden4-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden4-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Tantolunden5:{name:"Tantolunden5",id:"environment_texture_Tantolunden5",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Tantolunden5.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Tantolunden5.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden5-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden5-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden5-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden5-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden5-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden5-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden5-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden5-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden5-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden5-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden5-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden5-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Tantolunden6:{name:"Tantolunden6",id:"environment_texture_Tantolunden6",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Tantolunden6.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Tantolunden6.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden6-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden6-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden6-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden6-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden6-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tantolunden6-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden6-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden6-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden6-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden6-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden6-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tantolunden6-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Teide:{name:"Teide",id:"environment_texture_Teide",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Teide.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Teide.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Teide-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Teide-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Teide-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Teide-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Teide-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Teide-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Teide-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Teide-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Teide-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Teide-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Teide-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Teide-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Tenerife:{name:"Tenerife",id:"environment_texture_Tenerife",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Tenerife.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Tenerife.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Tenerife2:{name:"Tenerife2",id:"environment_texture_Tenerife2",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Tenerife2.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Tenerife2.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife2-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife2-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife2-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife2-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife2-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife2-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife2-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Tenerife3:{name:"Tenerife3",id:"environment_texture_Tenerife3",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Tenerife3.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Tenerife3.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife3-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife3-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife3-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife3-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife3-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife3-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife3-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife3-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife3-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife3-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife3-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife3-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Tenerife4:{name:"Tenerife4",id:"environment_texture_Tenerife4",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Tenerife4.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Tenerife4.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife4-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife4-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife4-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife4-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife4-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Tenerife4-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife4-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife4-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife4-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife4-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife4-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Tenerife4-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_UnionSquare:{name:"UnionSquare",id:"environment_texture_UnionSquare",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/UnionSquare.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/UnionSquare.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/UnionSquare-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/UnionSquare-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/UnionSquare-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/UnionSquare-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/UnionSquare-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/UnionSquare-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/UnionSquare-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/UnionSquare-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/UnionSquare-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/UnionSquare-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/UnionSquare-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/UnionSquare-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Vasa:{name:"Vasa",id:"environment_texture_Vasa",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Vasa.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Vasa.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Vasa-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Vasa-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Vasa-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Vasa-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Vasa-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Vasa-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Vasa-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Vasa-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Vasa-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Vasa-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Vasa-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Vasa-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}},environment_texture_Vindelalven:{name:"Vindelalven",id:"environment_texture_Vindelalven",type:"textureCube",payload:{tex_dxt:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/Vindelalven.dds",width:1024,height:1024,size:4194512},tex_dxt_low:{path:window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_dxt_low/Vindelalven.dds",width:512,height:512},tex:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Vindelalven-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Vindelalven-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Vindelalven-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Vindelalven-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Vindelalven-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex/Vindelalven-5.jpg"],width:1024,height:1024},tex_low:{path:[window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Vindelalven-0.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Vindelalven-1.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Vindelalven-2.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Vindelalven-3.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Vindelalven-4.jpg",window.verold.glAssetsBaseUrl+"/textures/CubeMaps/tex_low/Vindelalven-5.jpg"],width:512,height:512},flipY:!1,isLocal:!0,filtering:"Trilinear",anisotropy:8}}},this.defaultEnvironment={skyboxCubemap:"environment_default",skyboxFogScale:.574,skyboxFogPower:.08,groundPlaneOn:!0,groundPlaneTesselation:120,groundPlaneMaterial:null,groundPlaneMaterialScale:30,groundPlaneScale:120},this.defaultFog={type:"FogExp2",color:12303291,density:.2}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment