UNPKG

cratedigger

Version:

3D vinyl records exploration & crate digging experience, using WebGL with Three.js

2 lines 112 kB
!function e(t,n,o){function i(a,s){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(r)return r(a,!0);var d=new Error("Cannot find module '"+a+"'");throw d.code="MODULE_NOT_FOUND",d}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return i(n?n:e)},c,c.exports,e,t,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a<o.length;a++)i(o[a]);return i}({1:[function(e,t,n){t.exports=e("./vendor/dat.gui"),t.exports.color=e("./vendor/dat.color")},{"./vendor/dat.color":2,"./vendor/dat.gui":3}],2:[function(e,t,n){var o=t.exports=o||{};o.color=o.color||{},o.utils=o.utils||{},o.utils.common=function(){var e=Array.prototype.forEach,t=Array.prototype.slice;return{BREAK:{},extend:function(e){return this.each(t.call(arguments,1),function(t){for(var n in t)this.isUndefined(t[n])||(e[n]=t[n])},this),e},defaults:function(e){return this.each(t.call(arguments,1),function(t){for(var n in t)this.isUndefined(e[n])&&(e[n]=t[n])},this),e},compose:function(){var e=t.call(arguments);return function(){for(var n=t.call(arguments),o=e.length-1;o>=0;o--)n=[e[o].apply(this,n)];return n[0]}},each:function(t,n,o){if(e&&t.forEach===e)t.forEach(n,o);else if(t.length===t.length+0){for(var i=0,r=t.length;r>i;i++)if(i in t&&n.call(o,t[i],i)===this.BREAK)return}else for(var i in t)if(n.call(o,t[i],i)===this.BREAK)return},defer:function(e){setTimeout(e,0)},toArray:function(e){return e.toArray?e.toArray():t.call(e)},isUndefined:function(e){return void 0===e},isNull:function(e){return null===e},isNaN:function(e){return e!==e},isArray:Array.isArray||function(e){return e.constructor===Array},isObject:function(e){return e===Object(e)},isNumber:function(e){return e===e+0},isString:function(e){return e===e+""},isBoolean:function(e){return e===!1||e===!0},isFunction:function(e){return"[object Function]"===Object.prototype.toString.call(e)}}}(),o.color.toString=function(e){return function(t){if(1==t.a||e.isUndefined(t.a)){for(var n=t.hex.toString(16);n.length<6;)n="0"+n;return"#"+n}return"rgba("+Math.round(t.r)+","+Math.round(t.g)+","+Math.round(t.b)+","+t.a+")"}}(o.utils.common),o.Color=o.color.Color=function(e,t,n,o){function i(e,t,n){Object.defineProperty(e,t,{get:function(){return"RGB"===this.__state.space?this.__state[t]:(a(this,t,n),this.__state[t])},set:function(e){"RGB"!==this.__state.space&&(a(this,t,n),this.__state.space="RGB"),this.__state[t]=e}})}function r(e,t){Object.defineProperty(e,t,{get:function(){return"HSV"===this.__state.space?this.__state[t]:(s(this),this.__state[t])},set:function(e){"HSV"!==this.__state.space&&(s(this),this.__state.space="HSV"),this.__state[t]=e}})}function a(e,n,i){if("HEX"===e.__state.space)e.__state[n]=t.component_from_hex(e.__state.hex,i);else{if("HSV"!==e.__state.space)throw"Corrupted color state";o.extend(e.__state,t.hsv_to_rgb(e.__state.h,e.__state.s,e.__state.v))}}function s(e){var n=t.rgb_to_hsv(e.r,e.g,e.b);o.extend(e.__state,{s:n.s,v:n.v}),o.isNaN(n.h)?o.isUndefined(e.__state.h)&&(e.__state.h=0):e.__state.h=n.h}var l=function(){if(this.__state=e.apply(this,arguments),this.__state===!1)throw"Failed to interpret color arguments";this.__state.a=this.__state.a||1};return l.COMPONENTS=["r","g","b","h","s","v","hex","a"],o.extend(l.prototype,{toString:function(){return n(this)},toOriginal:function(){return this.__state.conversion.write(this)}}),i(l.prototype,"r",2),i(l.prototype,"g",1),i(l.prototype,"b",0),r(l.prototype,"h"),r(l.prototype,"s"),r(l.prototype,"v"),Object.defineProperty(l.prototype,"a",{get:function(){return this.__state.a},set:function(e){this.__state.a=e}}),Object.defineProperty(l.prototype,"hex",{get:function(){return"HEX"!==!this.__state.space&&(this.__state.hex=t.rgb_to_hex(this.r,this.g,this.b)),this.__state.hex},set:function(e){this.__state.space="HEX",this.__state.hex=e}}),l}(o.color.interpret=function(e,t){var n,o,i=function(){o=!1;var e=arguments.length>1?t.toArray(arguments):arguments[0];return t.each(r,function(i){return i.litmus(e)?(t.each(i.conversions,function(i,r){return n=i.read(e),o===!1&&n!==!1?(o=n,n.conversionName=r,n.conversion=i,t.BREAK):void 0}),t.BREAK):void 0}),o},r=[{litmus:t.isString,conversions:{THREE_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null===t?!1:{space:"HEX",hex:parseInt("0x"+t[1].toString()+t[1].toString()+t[2].toString()+t[2].toString()+t[3].toString()+t[3].toString())}},write:e},SIX_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9]{6})$/i);return null===t?!1:{space:"HEX",hex:parseInt("0x"+t[1].toString())}},write:e},CSS_RGB:{read:function(e){var t=e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null===t?!1:{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3])}},write:e},CSS_RGBA:{read:function(e){var t=e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);return null===t?!1:{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3]),a:parseFloat(t[4])}},write:e}}},{litmus:t.isNumber,conversions:{HEX:{read:function(e){return{space:"HEX",hex:e,conversionName:"HEX"}},write:function(e){return e.hex}}}},{litmus:t.isArray,conversions:{RGB_ARRAY:{read:function(e){return 3!=e.length?!1:{space:"RGB",r:e[0],g:e[1],b:e[2]}},write:function(e){return[e.r,e.g,e.b]}},RGBA_ARRAY:{read:function(e){return 4!=e.length?!1:{space:"RGB",r:e[0],g:e[1],b:e[2],a:e[3]}},write:function(e){return[e.r,e.g,e.b,e.a]}}}},{litmus:t.isObject,conversions:{RGBA_OBJ:{read:function(e){return t.isNumber(e.r)&&t.isNumber(e.g)&&t.isNumber(e.b)&&t.isNumber(e.a)?{space:"RGB",r:e.r,g:e.g,b:e.b,a:e.a}:!1},write:function(e){return{r:e.r,g:e.g,b:e.b,a:e.a}}},RGB_OBJ:{read:function(e){return t.isNumber(e.r)&&t.isNumber(e.g)&&t.isNumber(e.b)?{space:"RGB",r:e.r,g:e.g,b:e.b}:!1},write:function(e){return{r:e.r,g:e.g,b:e.b}}},HSVA_OBJ:{read:function(e){return t.isNumber(e.h)&&t.isNumber(e.s)&&t.isNumber(e.v)&&t.isNumber(e.a)?{space:"HSV",h:e.h,s:e.s,v:e.v,a:e.a}:!1},write:function(e){return{h:e.h,s:e.s,v:e.v,a:e.a}}},HSV_OBJ:{read:function(e){return t.isNumber(e.h)&&t.isNumber(e.s)&&t.isNumber(e.v)?{space:"HSV",h:e.h,s:e.s,v:e.v}:!1},write:function(e){return{h:e.h,s:e.s,v:e.v}}}}}];return i}(o.color.toString,o.utils.common),o.color.math=function(){var e;return{hsv_to_rgb:function(e,t,n){var o=Math.floor(e/60)%6,i=e/60-Math.floor(e/60),r=n*(1-t),a=n*(1-i*t),s=n*(1-(1-i)*t),l=[[n,s,r],[a,n,r],[r,n,s],[r,a,n],[s,r,n],[n,r,a]][o];return{r:255*l[0],g:255*l[1],b:255*l[2]}},rgb_to_hsv:function(e,t,n){var o,i,r=Math.min(e,t,n),a=Math.max(e,t,n),s=a-r;return 0==a?{h:NaN,s:0,v:0}:(i=s/a,o=e==a?(t-n)/s:t==a?2+(n-e)/s:4+(e-t)/s,o/=6,0>o&&(o+=1),{h:360*o,s:i,v:a/255})},rgb_to_hex:function(e,t,n){var o=this.hex_with_component(0,2,e);return o=this.hex_with_component(o,1,t),o=this.hex_with_component(o,0,n)},component_from_hex:function(e,t){return e>>8*t&255},hex_with_component:function(t,n,o){return o<<(e=8*n)|t&~(255<<e)}}}(),o.color.toString,o.utils.common)},{}],3:[function(e,t,n){var o=t.exports=o||{};o.gui=o.gui||{},o.utils=o.utils||{},o.controllers=o.controllers||{},o.dom=o.dom||{},o.color=o.color||{},o.utils.css=function(){return{load:function(e,t){t=t||document;var n=t.createElement("link");n.type="text/css",n.rel="stylesheet",n.href=e,t.getElementsByTagName("head")[0].appendChild(n)},inject:function(e,t){t=t||document;var n=document.createElement("style");n.type="text/css",n.innerHTML=e,t.getElementsByTagName("head")[0].appendChild(n)}}}(),o.utils.common=function(){var e=Array.prototype.forEach,t=Array.prototype.slice;return{BREAK:{},extend:function(e){return this.each(t.call(arguments,1),function(t){for(var n in t)this.isUndefined(t[n])||(e[n]=t[n])},this),e},defaults:function(e){return this.each(t.call(arguments,1),function(t){for(var n in t)this.isUndefined(e[n])&&(e[n]=t[n])},this),e},compose:function(){var e=t.call(arguments);return function(){for(var n=t.call(arguments),o=e.length-1;o>=0;o--)n=[e[o].apply(this,n)];return n[0]}},each:function(t,n,o){if(e&&t.forEach===e)t.forEach(n,o);else if(t.length===t.length+0){for(var i=0,r=t.length;r>i;i++)if(i in t&&n.call(o,t[i],i)===this.BREAK)return}else for(var i in t)if(n.call(o,t[i],i)===this.BREAK)return},defer:function(e){setTimeout(e,0)},toArray:function(e){return e.toArray?e.toArray():t.call(e)},isUndefined:function(e){return void 0===e},isNull:function(e){return null===e},isNaN:function(e){return e!==e},isArray:Array.isArray||function(e){return e.constructor===Array},isObject:function(e){return e===Object(e)},isNumber:function(e){return e===e+0},isString:function(e){return e===e+""},isBoolean:function(e){return e===!1||e===!0},isFunction:function(e){return"[object Function]"===Object.prototype.toString.call(e)}}}(),o.controllers.Controller=function(e){var t=function(e,t){this.initialValue=e[t],this.domElement=document.createElement("div"),this.object=e,this.property=t,this.__onChange=void 0,this.__onFinishChange=void 0};return e.extend(t.prototype,{onChange:function(e){return this.__onChange=e,this},onFinishChange:function(e){return this.__onFinishChange=e,this},setValue:function(e){return this.object[this.property]=e,this.__onChange&&this.__onChange.call(this,e),this.updateDisplay(),this},getValue:function(){return this.object[this.property]},updateDisplay:function(){return this},isModified:function(){return this.initialValue!==this.getValue()}}),t}(o.utils.common),o.dom.dom=function(e){function t(t){if("0"===t||e.isUndefined(t))return 0;var n=t.match(i);return e.isNull(n)?0:parseFloat(n[1])}var n={HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},o={};e.each(n,function(t,n){e.each(t,function(e){o[e]=n})});var i=/(\d+(\.\d+)?)px/,r={makeSelectable:function(e,t){void 0!==e&&void 0!==e.style&&(e.onselectstart=t?function(){return!1}:function(){},e.style.MozUserSelect=t?"auto":"none",e.style.KhtmlUserSelect=t?"auto":"none",e.unselectable=t?"on":"off")},makeFullscreen:function(t,n,o){e.isUndefined(n)&&(n=!0),e.isUndefined(o)&&(o=!0),t.style.position="absolute",n&&(t.style.left=0,t.style.right=0),o&&(t.style.top=0,t.style.bottom=0)},fakeEvent:function(t,n,i,r){i=i||{};var a=o[n];if(!a)throw new Error("Event type "+n+" not supported.");var s=document.createEvent(a);switch(a){case"MouseEvents":var l=i.x||i.clientX||0,d=i.y||i.clientY||0;s.initMouseEvent(n,i.bubbles||!1,i.cancelable||!0,window,i.clickCount||1,0,0,l,d,!1,!1,!1,!1,0,null);break;case"KeyboardEvents":var c=s.initKeyboardEvent||s.initKeyEvent;e.defaults(i,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),c(n,i.bubbles||!1,i.cancelable,window,i.ctrlKey,i.altKey,i.shiftKey,i.metaKey,i.keyCode,i.charCode);break;default:s.initEvent(n,i.bubbles||!1,i.cancelable||!0)}e.defaults(s,r),t.dispatchEvent(s)},bind:function(e,t,n,o){return o=o||!1,e.addEventListener?e.addEventListener(t,n,o):e.attachEvent&&e.attachEvent("on"+t,n),r},unbind:function(e,t,n,o){return o=o||!1,e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent&&e.detachEvent("on"+t,n),r},addClass:function(e,t){if(void 0===e.className)e.className=t;else if(e.className!==t){var n=e.className.split(/ +/);-1==n.indexOf(t)&&(n.push(t),e.className=n.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}return r},removeClass:function(e,t){if(t)if(void 0===e.className);else if(e.className===t)e.removeAttribute("class");else{var n=e.className.split(/ +/),o=n.indexOf(t);-1!=o&&(n.splice(o,1),e.className=n.join(" "))}else e.className=void 0;return r},hasClass:function(e,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(e.className)||!1},getWidth:function(e){var n=getComputedStyle(e);return t(n["border-left-width"])+t(n["border-right-width"])+t(n["padding-left"])+t(n["padding-right"])+t(n.width)},getHeight:function(e){var n=getComputedStyle(e);return t(n["border-top-width"])+t(n["border-bottom-width"])+t(n["padding-top"])+t(n["padding-bottom"])+t(n.height)},getOffset:function(e){var t={left:0,top:0};if(e.offsetParent)do t.left+=e.offsetLeft,t.top+=e.offsetTop;while(e=e.offsetParent);return t},isActive:function(e){return e===document.activeElement&&(e.type||e.href)}};return r}(o.utils.common),o.controllers.OptionController=function(e,t,n){var o=function(e,i,r){o.superclass.call(this,e,i);var a=this;if(this.__select=document.createElement("select"),n.isArray(r)){var s={};n.each(r,function(e){s[e]=e}),r=s}n.each(r,function(e,t){var n=document.createElement("option");n.innerHTML=t,n.setAttribute("value",e),a.__select.appendChild(n)}),this.updateDisplay(),t.bind(this.__select,"change",function(){var e=this.options[this.selectedIndex].value;a.setValue(e)}),this.domElement.appendChild(this.__select)};return o.superclass=e,n.extend(o.prototype,e.prototype,{setValue:function(e){var t=o.superclass.prototype.setValue.call(this,e);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),t},updateDisplay:function(){return this.__select.value=this.getValue(),o.superclass.prototype.updateDisplay.call(this)}}),o}(o.controllers.Controller,o.dom.dom,o.utils.common),o.controllers.NumberController=function(e,t){function n(e){return e=e.toString(),e.indexOf(".")>-1?e.length-e.indexOf(".")-1:0}var o=function(e,i,r){o.superclass.call(this,e,i),r=r||{},this.__min=r.min,this.__max=r.max,this.__step=r.step,t.isUndefined(this.__step)?0==this.initialValue?this.__impliedStep=1:this.__impliedStep=Math.pow(10,Math.floor(Math.log(this.initialValue)/Math.LN10))/10:this.__impliedStep=this.__step,this.__precision=n(this.__impliedStep)};return o.superclass=e,t.extend(o.prototype,e.prototype,{setValue:function(e){return void 0!==this.__min&&e<this.__min?e=this.__min:void 0!==this.__max&&e>this.__max&&(e=this.__max),void 0!==this.__step&&e%this.__step!=0&&(e=Math.round(e/this.__step)*this.__step),o.superclass.prototype.setValue.call(this,e)},min:function(e){return this.__min=e,this},max:function(e){return this.__max=e,this},step:function(e){return this.__step=e,this}}),o}(o.controllers.Controller,o.utils.common),o.controllers.NumberControllerBox=function(e,t,n){function o(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}var i=function(e,o,r){function a(){var e=parseFloat(f.__input.value);n.isNaN(e)||f.setValue(e)}function s(){a(),f.__onFinishChange&&f.__onFinishChange.call(f,f.getValue())}function l(e){t.bind(window,"mousemove",d),t.bind(window,"mouseup",c),u=e.clientY}function d(e){var t=u-e.clientY;f.setValue(f.getValue()+t*f.__impliedStep),u=e.clientY}function c(){t.unbind(window,"mousemove",d),t.unbind(window,"mouseup",c)}this.__truncationSuspended=!1,i.superclass.call(this,e,o,r);var u,f=this;this.__input=document.createElement("input"),this.__input.setAttribute("type","text"),t.bind(this.__input,"change",a),t.bind(this.__input,"blur",s),t.bind(this.__input,"mousedown",l),t.bind(this.__input,"keydown",function(e){13===e.keyCode&&(f.__truncationSuspended=!0,this.blur(),f.__truncationSuspended=!1)}),this.updateDisplay(),this.domElement.appendChild(this.__input)};return i.superclass=e,n.extend(i.prototype,e.prototype,{updateDisplay:function(){return this.__input.value=this.__truncationSuspended?this.getValue():o(this.getValue(),this.__precision),i.superclass.prototype.updateDisplay.call(this)}}),i}(o.controllers.NumberController,o.dom.dom,o.utils.common),o.controllers.NumberControllerSlider=function(e,t,n,o,i){function r(e,t,n,o,i){return o+(i-o)*((e-t)/(n-t))}var a=function(e,n,o,i,s){function l(e){t.bind(window,"mousemove",d),t.bind(window,"mouseup",c),d(e)}function d(e){e.preventDefault();var n=t.getOffset(u.__background),o=t.getWidth(u.__background);return u.setValue(r(e.clientX,n.left,n.left+o,u.__min,u.__max)),!1}function c(){t.unbind(window,"mousemove",d),t.unbind(window,"mouseup",c),u.__onFinishChange&&u.__onFinishChange.call(u,u.getValue())}a.superclass.call(this,e,n,{min:o,max:i,step:s});var u=this;this.__background=document.createElement("div"),this.__foreground=document.createElement("div"),t.bind(this.__background,"mousedown",l),t.addClass(this.__background,"slider"),t.addClass(this.__foreground,"slider-fg"),this.updateDisplay(),this.__background.appendChild(this.__foreground),this.domElement.appendChild(this.__background)};return a.superclass=e,a.useDefaultStyles=function(){n.inject(i)},o.extend(a.prototype,e.prototype,{updateDisplay:function(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+"%",a.superclass.prototype.updateDisplay.call(this)}}),a}(o.controllers.NumberController,o.dom.dom,o.utils.css,o.utils.common,".slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}"),o.controllers.FunctionController=function(e,t,n){var o=function(e,n,i){o.superclass.call(this,e,n);var r=this;this.__button=document.createElement("div"),this.__button.innerHTML=void 0===i?"Fire":i,t.bind(this.__button,"click",function(e){return e.preventDefault(),r.fire(),!1}),t.addClass(this.__button,"button"),this.domElement.appendChild(this.__button)};return o.superclass=e,n.extend(o.prototype,e.prototype,{fire:function(){this.__onChange&&this.__onChange.call(this),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.getValue().call(this.object)}}),o}(o.controllers.Controller,o.dom.dom,o.utils.common),o.controllers.BooleanController=function(e,t,n){var o=function(e,n){function i(){r.setValue(!r.__prev)}o.superclass.call(this,e,n);var r=this;this.__prev=this.getValue(),this.__checkbox=document.createElement("input"),this.__checkbox.setAttribute("type","checkbox"),t.bind(this.__checkbox,"change",i,!1),this.domElement.appendChild(this.__checkbox),this.updateDisplay()};return o.superclass=e,n.extend(o.prototype,e.prototype,{setValue:function(e){var t=o.superclass.prototype.setValue.call(this,e);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),t},updateDisplay:function(){return this.getValue()===!0?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0):this.__checkbox.checked=!1,o.superclass.prototype.updateDisplay.call(this)}}),o}(o.controllers.Controller,o.dom.dom,o.utils.common),o.color.toString=function(e){return function(t){if(1==t.a||e.isUndefined(t.a)){for(var n=t.hex.toString(16);n.length<6;)n="0"+n;return"#"+n}return"rgba("+Math.round(t.r)+","+Math.round(t.g)+","+Math.round(t.b)+","+t.a+")"}}(o.utils.common),o.color.interpret=function(e,t){var n,o,i=function(){o=!1;var e=arguments.length>1?t.toArray(arguments):arguments[0];return t.each(r,function(i){return i.litmus(e)?(t.each(i.conversions,function(i,r){return n=i.read(e),o===!1&&n!==!1?(o=n,n.conversionName=r,n.conversion=i,t.BREAK):void 0}),t.BREAK):void 0}),o},r=[{litmus:t.isString,conversions:{THREE_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null===t?!1:{space:"HEX",hex:parseInt("0x"+t[1].toString()+t[1].toString()+t[2].toString()+t[2].toString()+t[3].toString()+t[3].toString())}},write:e},SIX_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9]{6})$/i);return null===t?!1:{space:"HEX",hex:parseInt("0x"+t[1].toString())}},write:e},CSS_RGB:{read:function(e){var t=e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null===t?!1:{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3])}},write:e},CSS_RGBA:{read:function(e){var t=e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);return null===t?!1:{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3]),a:parseFloat(t[4])}},write:e}}},{litmus:t.isNumber,conversions:{HEX:{read:function(e){return{space:"HEX",hex:e,conversionName:"HEX"}},write:function(e){return e.hex}}}},{litmus:t.isArray,conversions:{RGB_ARRAY:{read:function(e){return 3!=e.length?!1:{space:"RGB",r:e[0],g:e[1],b:e[2]}},write:function(e){return[e.r,e.g,e.b]}},RGBA_ARRAY:{read:function(e){return 4!=e.length?!1:{space:"RGB",r:e[0],g:e[1],b:e[2],a:e[3]}},write:function(e){return[e.r,e.g,e.b,e.a]}}}},{litmus:t.isObject,conversions:{RGBA_OBJ:{read:function(e){return t.isNumber(e.r)&&t.isNumber(e.g)&&t.isNumber(e.b)&&t.isNumber(e.a)?{space:"RGB",r:e.r,g:e.g,b:e.b,a:e.a}:!1},write:function(e){return{r:e.r,g:e.g,b:e.b,a:e.a}}},RGB_OBJ:{read:function(e){return t.isNumber(e.r)&&t.isNumber(e.g)&&t.isNumber(e.b)?{space:"RGB",r:e.r,g:e.g,b:e.b}:!1},write:function(e){return{r:e.r,g:e.g,b:e.b}}},HSVA_OBJ:{read:function(e){return t.isNumber(e.h)&&t.isNumber(e.s)&&t.isNumber(e.v)&&t.isNumber(e.a)?{space:"HSV",h:e.h,s:e.s,v:e.v,a:e.a}:!1},write:function(e){return{h:e.h,s:e.s,v:e.v,a:e.a}}},HSV_OBJ:{read:function(e){return t.isNumber(e.h)&&t.isNumber(e.s)&&t.isNumber(e.v)?{space:"HSV",h:e.h,s:e.s,v:e.v}:!1},write:function(e){return{h:e.h,s:e.s,v:e.v}}}}}];return i}(o.color.toString,o.utils.common),o.GUI=o.gui.GUI=function(e,t,n,o,i,r,a,s,l,d,c,u,f,h,p){function m(e,t,n,r){if(void 0===t[n])throw new Error("Object "+t+' has no property "'+n+'"');var a;if(r.color)a=new c(t,n);else{var s=[t,n].concat(r.factoryArgs);a=o.apply(e,s)}r.before instanceof i&&(r.before=r.before.__li),_(e,a),h.addClass(a.domElement,"c");var l=document.createElement("span");h.addClass(l,"property-name"),l.innerHTML=a.property;var d=document.createElement("div");d.appendChild(l),d.appendChild(a.domElement);var u=g(e,d,r.before);return h.addClass(u,I.CLASS_CONTROLLER_ROW),h.addClass(u,typeof a.getValue()),v(e,u,a),e.__controllers.push(a),a}function g(e,t,n){var o=document.createElement("li");return t&&o.appendChild(t),n?e.__ul.insertBefore(o,params.before):e.__ul.appendChild(o),e.onResize(),o}function v(e,t,n){if(n.__li=t,n.__gui=e,p.extend(n,{options:function(t){return arguments.length>1?(n.remove(),m(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[p.toArray(arguments)]})):p.isArray(t)||p.isObject(t)?(n.remove(),m(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[t]})):void 0},name:function(e){return n.__li.firstElementChild.firstElementChild.innerHTML=e,n},listen:function(){return n.__gui.listen(n),n},remove:function(){return n.__gui.remove(n),n}}),n instanceof l){var o=new s(n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});p.each(["updateDisplay","onChange","onFinishChange"],function(e){var t=n[e],i=o[e];n[e]=o[e]=function(){var e=Array.prototype.slice.call(arguments);return t.apply(n,e),i.apply(o,e)}}),h.addClass(t,"has-slider"),n.domElement.insertBefore(o.domElement,n.domElement.firstElementChild)}else if(n instanceof s){var i=function(t){return p.isNumber(n.__min)&&p.isNumber(n.__max)?(n.remove(),m(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]})):t};n.min=p.compose(i,n.min),n.max=p.compose(i,n.max)}else n instanceof r?(h.bind(t,"click",function(){h.fakeEvent(n.__checkbox,"click")}),h.bind(n.__checkbox,"click",function(e){e.stopPropagation()})):n instanceof a?(h.bind(t,"click",function(){h.fakeEvent(n.__button,"click")}),h.bind(t,"mouseover",function(){h.addClass(n.__button,"hover")}),h.bind(t,"mouseout",function(){h.removeClass(n.__button,"hover")})):n instanceof c&&(h.addClass(t,"color"),n.updateDisplay=p.compose(function(e){return t.style.borderLeftColor=n.__color.toString(),e},n.updateDisplay),n.updateDisplay());n.setValue=p.compose(function(t){return e.getRoot().__preset_select&&n.isModified()&&A(e.getRoot(),!0),t},n.setValue)}function _(e,t){var n=e.getRoot(),o=n.__rememberedObjects.indexOf(t.object);if(-1!=o){var i=n.__rememberedObjectIndecesToControllers[o];if(void 0===i&&(i={},n.__rememberedObjectIndecesToControllers[o]=i),i[t.property]=t,n.load&&n.load.remembered){var r,a=n.load.remembered;if(a[e.preset])r=a[e.preset];else{if(!a[D])return;r=a[D]}if(r[o]&&void 0!==r[o][t.property]){var s=r[o][t.property];t.initialValue=s,t.setValue(s)}}}}function b(e,t){return document.location.href+"."+t}function y(e){function t(){d.style.display=e.useLocalStorage?"block":"none"}var n=e.__save_row=document.createElement("li");h.addClass(e.domElement,"has-save"),e.__ul.insertBefore(n,e.__ul.firstChild),h.addClass(n,"save-row");var o=document.createElement("span");o.innerHTML="&nbsp;",h.addClass(o,"button gears");var i=document.createElement("span");i.innerHTML="Save",h.addClass(i,"button"),h.addClass(i,"save");var r=document.createElement("span");r.innerHTML="New",h.addClass(r,"button"),h.addClass(r,"save-as");var a=document.createElement("span");a.innerHTML="Revert",h.addClass(a,"button"),h.addClass(a,"revert");var s=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?p.each(e.load.remembered,function(t,n){S(e,n,n==e.preset)}):S(e,D,!1),h.bind(s,"change",function(){for(var t=0;t<e.__preset_select.length;t++)e.__preset_select[t].innerHTML=e.__preset_select[t].value;e.preset=this.value}),n.appendChild(s),n.appendChild(o),n.appendChild(i),n.appendChild(r),n.appendChild(a),L){var l=document.getElementById("dg-save-locally"),d=document.getElementById("dg-local-explain");l.style.display="block";var c=document.getElementById("dg-local-storage");"true"===localStorage.getItem(b(e,"isLocal"))&&c.setAttribute("checked","checked"),t(),h.bind(c,"change",function(){e.useLocalStorage=!e.useLocalStorage,t()})}var u=document.getElementById("dg-new-constructor");h.bind(u,"keydown",function(e){!e.metaKey||67!==e.which&&67!=e.keyCode||M.hide()}),h.bind(o,"click",function(){u.innerHTML=JSON.stringify(e.getSaveObject(),void 0,2),M.show(),u.focus(),u.select()}),h.bind(i,"click",function(){e.save()}),h.bind(r,"click",function(){var t=prompt("Enter a new preset name.");t&&e.saveAs(t)}),h.bind(a,"click",function(){e.revert()})}function x(e){function t(t){return t.preventDefault(),i=t.clientX,h.addClass(e.__closeButton,I.CLASS_DRAG),h.bind(window,"mousemove",n),h.bind(window,"mouseup",o),!1}function n(t){return t.preventDefault(),e.width+=i-t.clientX,e.onResize(),i=t.clientX,!1}function o(){h.removeClass(e.__closeButton,I.CLASS_DRAG),h.unbind(window,"mousemove",n),h.unbind(window,"mouseup",o)}e.__resize_handle=document.createElement("div"),p.extend(e.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"});var i;h.bind(e.__resize_handle,"mousedown",t),h.bind(e.__closeButton,"mousedown",t),e.domElement.insertBefore(e.__resize_handle,e.domElement.firstElementChild)}function w(e,t){e.domElement.style.width=t+"px",e.__save_row&&e.autoPlace&&(e.__save_row.style.width=t+"px"),e.__closeButton&&(e.__closeButton.style.width=t+"px")}function C(e,t){var n={};return p.each(e.__rememberedObjects,function(o,i){var r={},a=e.__rememberedObjectIndecesToControllers[i];p.each(a,function(e,n){r[n]=t?e.initialValue:e.getValue()}),n[i]=r}),n}function S(e,t,n){var o=document.createElement("option");o.innerHTML=t,o.value=t,e.__preset_select.appendChild(o),n&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function E(e){for(var t=0;t<e.__preset_select.length;t++)e.__preset_select[t].value==e.preset&&(e.__preset_select.selectedIndex=t)}function A(e,t){var n=e.__preset_select[e.__preset_select.selectedIndex];t?n.innerHTML=n.value+"*":n.innerHTML=n.value}function T(e){0!=e.length&&u(function(){T(e)}),p.each(e,function(e){e.updateDisplay()})}e.inject(n);var M,O,k="dg",B=72,P=20,D="Default",L=function(){try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}}(),R=!0,F=!1,z=[],I=function(e){function t(){localStorage.setItem(b(o,"gui"),JSON.stringify(o.getSaveObject()))}function n(){var e=o.getRoot();e.width+=1,p.defer(function(){e.width-=1})}var o=this;this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),h.addClass(this.domElement,k),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],e=e||{},e=p.defaults(e,{autoPlace:!0,width:I.DEFAULT_WIDTH}),e=p.defaults(e,{resizable:e.autoPlace,hideable:e.autoPlace}),p.isUndefined(e.load)?e.load={preset:D}:e.preset&&(e.load.preset=e.preset),p.isUndefined(e.parent)&&e.hideable&&z.push(this),e.resizable=p.isUndefined(e.parent)&&e.resizable,e.autoPlace&&p.isUndefined(e.scrollable)&&(e.scrollable=!0);var i=L&&"true"===localStorage.getItem(b(this,"isLocal"));if(Object.defineProperties(this,{parent:{get:function(){return e.parent}},scrollable:{get:function(){return e.scrollable}},autoPlace:{get:function(){return e.autoPlace}},preset:{get:function(){return o.parent?o.getRoot().preset:e.load.preset},set:function(t){o.parent?o.getRoot().preset=t:e.load.preset=t,E(this),o.revert()}},width:{get:function(){return e.width},set:function(t){e.width=t,w(o,t)}},name:{get:function(){return e.name},set:function(t){e.name=t,a&&(a.innerHTML=e.name)}},closed:{get:function(){return e.closed},set:function(t){e.closed=t,e.closed?h.addClass(o.__ul,I.CLASS_CLOSED):h.removeClass(o.__ul,I.CLASS_CLOSED),this.onResize(),o.__closeButton&&(o.__closeButton.innerHTML=t?I.TEXT_OPEN:I.TEXT_CLOSED)}},load:{get:function(){return e.load}},useLocalStorage:{get:function(){return i},set:function(e){L&&(i=e,e?h.bind(window,"unload",t):h.unbind(window,"unload",t),localStorage.setItem(b(o,"isLocal"),e))}}}),p.isUndefined(e.parent)){if(e.closed=!1,h.addClass(this.domElement,I.CLASS_MAIN),h.makeSelectable(this.domElement,!1),L&&i){o.useLocalStorage=!0;var r=localStorage.getItem(b(this,"gui"));r&&(e.load=JSON.parse(r))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=I.TEXT_CLOSED,h.addClass(this.__closeButton,I.CLASS_CLOSE_BUTTON),this.domElement.appendChild(this.__closeButton),h.bind(this.__closeButton,"click",function(){o.closed=!o.closed})}else{void 0===e.closed&&(e.closed=!0);var a=document.createTextNode(e.name);h.addClass(a,"controller-name");var s=g(o,a),l=function(e){return e.preventDefault(),o.closed=!o.closed,!1};h.addClass(this.__ul,I.CLASS_CLOSED),h.addClass(s,"title"),h.bind(s,"click",l),e.closed||(this.closed=!1)}e.autoPlace&&(p.isUndefined(e.parent)&&(R&&(O=document.createElement("div"),h.addClass(O,k),h.addClass(O,I.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(O),R=!1),O.appendChild(this.domElement),h.addClass(this.domElement,I.CLASS_AUTO_PLACE)),this.parent||w(o,e.width)),h.bind(window,"resize",function(){o.onResize()}),h.bind(this.__ul,"webkitTransitionEnd",function(){o.onResize()}),h.bind(this.__ul,"transitionend",function(){o.onResize()}),h.bind(this.__ul,"oTransitionEnd",function(){o.onResize()}),this.onResize(),e.resizable&&x(this);o.getRoot();e.parent||n()};return I.toggleHide=function(){F=!F,p.each(z,function(e){e.domElement.style.zIndex=F?-999:999,e.domElement.style.opacity=F?0:1})},I.CLASS_AUTO_PLACE="a",I.CLASS_AUTO_PLACE_CONTAINER="ac",I.CLASS_MAIN="main",I.CLASS_CONTROLLER_ROW="cr",I.CLASS_TOO_TALL="taller-than-window",I.CLASS_CLOSED="closed",I.CLASS_CLOSE_BUTTON="close-button",I.CLASS_DRAG="drag",I.DEFAULT_WIDTH=245,I.TEXT_CLOSED="Close Controls",I.TEXT_OPEN="Open Controls",h.bind(window,"keydown",function(e){"text"===document.activeElement.type||e.which!==B&&e.keyCode!=B||I.toggleHide()},!1),p.extend(I.prototype,{add:function(e,t){return m(this,e,t,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(e,t){return m(this,e,t,{color:!0})},remove:function(e){this.__ul.removeChild(e.__li),this.__controllers.slice(this.__controllers.indexOf(e),1);var t=this;p.defer(function(){t.onResize()})},destroy:function(){this.autoPlace&&O.removeChild(this.domElement)},addFolder:function(e){if(void 0!==this.__folders[e])throw new Error('You already have a folder in this GUI by the name "'+e+'"');var t={name:e,parent:this};t.autoPlace=this.autoPlace, this.load&&this.load.folders&&this.load.folders[e]&&(t.closed=this.load.folders[e].closed,t.load=this.load.folders[e]);var n=new I(t);this.__folders[e]=n;var o=g(this,n.domElement);return h.addClass(o,"folder"),n},open:function(){this.closed=!1},close:function(){this.closed=!0},onResize:function(){var e=this.getRoot();if(e.scrollable){var t=h.getOffset(e.__ul).top,n=0;p.each(e.__ul.childNodes,function(t){e.autoPlace&&t===e.__save_row||(n+=h.getHeight(t))}),window.innerHeight-t-P<n?(h.addClass(e.domElement,I.CLASS_TOO_TALL),e.__ul.style.height=window.innerHeight-t-P+"px"):(h.removeClass(e.domElement,I.CLASS_TOO_TALL),e.__ul.style.height="auto")}e.__resize_handle&&p.defer(function(){e.__resize_handle.style.height=e.__ul.offsetHeight+"px"}),e.__closeButton&&(e.__closeButton.style.width=e.width+"px")},remember:function(){if(p.isUndefined(M)&&(M=new f,M.domElement.innerHTML=t),this.parent)throw new Error("You can only call remember on a top level GUI.");var e=this;p.each(Array.prototype.slice.call(arguments),function(t){0==e.__rememberedObjects.length&&y(e),-1==e.__rememberedObjects.indexOf(t)&&e.__rememberedObjects.push(t)}),this.autoPlace&&w(this,this.width)},getRoot:function(){for(var e=this;e.parent;)e=e.parent;return e},getSaveObject:function(){var e=this.load;return e.closed=this.closed,this.__rememberedObjects.length>0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=C(this)),e.folders={},p.each(this.__folders,function(t,n){e.folders[n]=t.getSaveObject()}),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=C(this),A(this,!1)},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered[D]=C(this,!0)),this.load.remembered[e]=C(this),this.preset=e,S(this,e,!0)},revert:function(e){p.each(this.__controllers,function(t){this.getRoot().load.remembered?_(e||this.getRoot(),t):t.setValue(t.initialValue)},this),p.each(this.__folders,function(e){e.revert(e)}),e||A(this.getRoot(),!1)},listen:function(e){var t=0==this.__listening.length;this.__listening.push(e),t&&T(this.__listening)}}),I}(o.utils.css,'<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n \n </div>\n \n </div>\n\n</div>',".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear;border:0;position:absolute;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-x:hidden}.dg.a.has-save ul{margin-top:27px}.dg.a.has-save ul.closed{margin-top:0}.dg.a .save-row{position:fixed;top:0;z-index:1002}.dg li{-webkit-transition:height 0.1s ease-out;-o-transition:height 0.1s ease-out;-moz-transition:height 0.1s ease-out;transition:height 0.1s ease-out}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;overflow:hidden;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li > *{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:9px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n",o.controllers.factory=function(e,t,n,o,i,r,a){return function(s,l){var d=s[l];return a.isArray(arguments[2])||a.isObject(arguments[2])?new e(s,l,arguments[2]):a.isNumber(d)?a.isNumber(arguments[2])&&a.isNumber(arguments[3])?new n(s,l,arguments[2],arguments[3]):new t(s,l,{min:arguments[2],max:arguments[3]}):a.isString(d)?new o(s,l):a.isFunction(d)?new i(s,l,""):a.isBoolean(d)?new r(s,l):void 0}}(o.controllers.OptionController,o.controllers.NumberControllerBox,o.controllers.NumberControllerSlider,o.controllers.StringController=function(e,t,n){var o=function(e,n){function i(){a.setValue(a.__input.value)}function r(){a.__onFinishChange&&a.__onFinishChange.call(a,a.getValue())}o.superclass.call(this,e,n);var a=this;this.__input=document.createElement("input"),this.__input.setAttribute("type","text"),t.bind(this.__input,"keyup",i),t.bind(this.__input,"change",i),t.bind(this.__input,"blur",r),t.bind(this.__input,"keydown",function(e){13===e.keyCode&&this.blur()}),this.updateDisplay(),this.domElement.appendChild(this.__input)};return o.superclass=e,n.extend(o.prototype,e.prototype,{updateDisplay:function(){return t.isActive(this.__input)||(this.__input.value=this.getValue()),o.superclass.prototype.updateDisplay.call(this)}}),o}(o.controllers.Controller,o.dom.dom,o.utils.common),o.controllers.FunctionController,o.controllers.BooleanController,o.utils.common),o.controllers.Controller,o.controllers.BooleanController,o.controllers.FunctionController,o.controllers.NumberControllerBox,o.controllers.NumberControllerSlider,o.controllers.OptionController,o.controllers.ColorController=function(e,t,n,o,i){function r(e,t,n,o){e.style.background="",i.each(l,function(i){e.style.cssText+="background: "+i+"linear-gradient("+t+", "+n+" 0%, "+o+" 100%); "})}function a(e){e.style.background="",e.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",e.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}var s=function(e,l){function d(e){h(e),t.bind(window,"mousemove",h),t.bind(window,"mouseup",c)}function c(){t.unbind(window,"mousemove",h),t.unbind(window,"mouseup",c)}function u(){var e=o(this.value);e!==!1?(m.__color.__state=e,m.setValue(m.__color.toOriginal())):this.value=m.__color.toString()}function f(){t.unbind(window,"mousemove",p),t.unbind(window,"mouseup",f)}function h(e){e.preventDefault();var n=t.getWidth(m.__saturation_field),o=t.getOffset(m.__saturation_field),i=(e.clientX-o.left+document.body.scrollLeft)/n,r=1-(e.clientY-o.top+document.body.scrollTop)/n;return r>1?r=1:0>r&&(r=0),i>1?i=1:0>i&&(i=0),m.__color.v=r,m.__color.s=i,m.setValue(m.__color.toOriginal()),!1}function p(e){e.preventDefault();var n=t.getHeight(m.__hue_field),o=t.getOffset(m.__hue_field),i=1-(e.clientY-o.top+document.body.scrollTop)/n;return i>1?i=1:0>i&&(i=0),m.__color.h=360*i,m.setValue(m.__color.toOriginal()),!1}s.superclass.call(this,e,l),this.__color=new n(this.getValue()),this.__temp=new n(0);var m=this;this.domElement=document.createElement("div"),t.makeSelectable(this.domElement,!1),this.__selector=document.createElement("div"),this.__selector.className="selector",this.__saturation_field=document.createElement("div"),this.__saturation_field.className="saturation-field",this.__field_knob=document.createElement("div"),this.__field_knob.className="field-knob",this.__field_knob_border="2px solid ",this.__hue_knob=document.createElement("div"),this.__hue_knob.className="hue-knob",this.__hue_field=document.createElement("div"),this.__hue_field.className="hue-field",this.__input=document.createElement("input"),this.__input.type="text",this.__input_textShadow="0 1px 1px ",t.bind(this.__input,"keydown",function(e){13===e.keyCode&&u.call(this)}),t.bind(this.__input,"blur",u),t.bind(this.__selector,"mousedown",function(e){t.addClass(this,"drag").bind(window,"mouseup",function(e){t.removeClass(m.__selector,"drag")})});var g=document.createElement("div");i.extend(this.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),i.extend(this.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:this.__field_knob_border+(this.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),i.extend(this.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),i.extend(this.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),i.extend(g.style,{width:"100%",height:"100%",background:"none"}),r(g,"top","rgba(0,0,0,0)","#000"),i.extend(this.__hue_field.style,{width:"15px",height:"100px",display:"inline-block",border:"1px solid #555",cursor:"ns-resize"}),a(this.__hue_field),i.extend(this.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:this.__input_textShadow+"rgba(0,0,0,0.7)"}),t.bind(this.__saturation_field,"mousedown",d),t.bind(this.__field_knob,"mousedown",d),t.bind(this.__hue_field,"mousedown",function(e){p(e),t.bind(window,"mousemove",p),t.bind(window,"mouseup",f)}),this.__saturation_field.appendChild(g),this.__selector.appendChild(this.__field_knob),this.__selector.appendChild(this.__saturation_field),this.__selector.appendChild(this.__hue_field),this.__hue_field.appendChild(this.__hue_knob),this.domElement.appendChild(this.__input),this.domElement.appendChild(this.__selector),this.updateDisplay()};s.superclass=e,i.extend(s.prototype,e.prototype,{updateDisplay:function(){var e=o(this.getValue());if(e!==!1){var t=!1;i.each(n.COMPONENTS,function(n){return i.isUndefined(e[n])||i.isUndefined(this.__color.__state[n])||e[n]===this.__color.__state[n]?void 0:(t=!0,{})},this),t&&i.extend(this.__color.__state,e)}i.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var a=this.__color.v<.5||this.__color.s>.5?255:0,s=255-a;i.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toString(),border:this.__field_knob_border+"rgb("+a+","+a+","+a+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,r(this.__saturation_field,"left","#fff",this.__temp.toString()),i.extend(this.__input.style,{backgroundColor:this.__input.value=this.__color.toString(),color:"rgb("+a+","+a+","+a+")",textShadow:this.__input_textShadow+"rgba("+s+","+s+","+s+",.7)"})}});var l=["-moz-","-o-","-webkit-","-ms-",""];return s}(o.controllers.Controller,o.dom.dom,o.color.Color=function(e,t,n,o){function i(e,t,n){Object.defineProperty(e,t,{get:function(){return"RGB"===this.__state.space?this.__state[t]:(a(this,t,n),this.__state[t])},set:function(e){"RGB"!==this.__state.space&&(a(this,t,n),this.__state.space="RGB"),this.__state[t]=e}})}function r(e,t){Object.defineProperty(e,t,{get:function(){return"HSV"===this.__state.space?this.__state[t]:(s(this),this.__state[t])},set:function(e){"HSV"!==this.__state.space&&(s(this),this.__state.space="HSV"),this.__state[t]=e}})}function a(e,n,i){if("HEX"===e.__state.space)e.__state[n]=t.component_from_hex(e.__state.hex,i);else{if("HSV"!==e.__state.space)throw"Corrupted color state";o.extend(e.__state,t.hsv_to_rgb(e.__state.h,e.__state.s,e.__state.v))}}function s(e){var n=t.rgb_to_hsv(e.r,e.g,e.b);o.extend(e.__state,{s:n.s,v:n.v}),o.isNaN(n.h)?o.isUndefined(e.__state.h)&&(e.__state.h=0):e.__state.h=n.h}var l=function(){if(this.__state=e.apply(this,arguments),this.__state===!1)throw"Failed to interpret color arguments";this.__state.a=this.__state.a||1};return l.COMPONENTS=["r","g","b","h","s","v","hex","a"],o.extend(l.prototype,{toString:function(){return n(this)},toOriginal:function(){return this.__state.conversion.write(this)}}),i(l.prototype,"r",2),i(l.prototype,"g",1),i(l.prototype,"b",0),r(l.prototype,"h"),r(l.prototype,"s"),r(l.prototype,"v"),Object.defineProperty(l.prototype,"a",{get:function(){return this.__state.a},set:function(e){this.__state.a=e}}),Object.defineProperty(l.prototype,"hex",{get:function(){return"HEX"!==!this.__state.space&&(this.__state.hex=t.rgb_to_hex(this.r,this.g,this.b)),this.__state.hex},set:function(e){this.__state.space="HEX",this.__state.hex=e}}),l}(o.color.interpret,o.color.math=function(){var e;return{hsv_to_rgb:function(e,t,n){var o=Math.floor(e/60)%6,i=e/60-Math.floor(e/60),r=n*(1-t),a=n*(1-i*t),s=n*(1-(1-i)*t),l=[[n,s,r],[a,n,r],[r,n,s],[r,a,n],[s,r,n],[n,r,a]][o];return{r:255*l[0],g:255*l[1],b:255*l[2]}},rgb_to_hsv:function(e,t,n){var o,i,r=Math.min(e,t,n),a=Math.max(e,t,n),s=a-r;return 0==a?{h:NaN,s:0,v:0}:(i=s/a,o=e==a?(t-n)/s:t==a?2+(n-e)/s:4+(e-t)/s,o/=6,0>o&&(o+=1),{h:360*o,s:i,v:a/255})},rgb_to_hex:function(e,t,n){var o=this.hex_with_component(0,2,e);return o=this.hex_with_component(o,1,t),o=this.hex_with_component(o,0,n)},component_from_hex:function(e,t){return e>>8*t&255},hex_with_component:function(t,n,o){return o<<(e=8*n)|t&~(255<<e)}}}(),o.color.toString,o.utils.common),o.color.interpret,o.utils.common),o.utils.requestAnimationFrame=function(){return window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||fun