dat.gui/build/dat.gui.min.js

4 lines
108 KiB
JavaScript
Raw Normal View History

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.dat=e():t.dat=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";e.__esModule=!0,n(1),e["default"]=n(193),t.exports=e["default"]},function(t,e,n){t.exports=n(2)},function(t,e,n){t.exports=n(3)},function(t,e,n){(function(t){"use strict";if(n(4),n(191),t._babelPolyfill)throw new Error("only one instance of babel/polyfill is allowed");t._babelPolyfill=!0}).call(e,function(){return this}())},function(t,e,n){n(5),n(38),n(44),n(46),n(48),n(50),n(52),n(54),n(55),n(56),n(57),n(58),n(59),n(60),n(61),n(62),n(63),n(64),n(65),n(68),n(69),n(70),n(72),n(73),n(74),n(75),n(76),n(77),n(78),n(80),n(81),n(82),n(84),n(85),n(86),n(88),n(89),n(90),n(91),n(92),n(93),n(94),n(95),n(96),n(97),n(98),n(99),n(100),n(101),n(106),n(107),n(111),n(112),n(114),n(115),n(120),n(121),n(124),n(126),n(128),n(130),n(131),n(132),n(134),n(135),n(137),n(138),n(139),n(140),n(147),n(150),n(151),n(153),n(154),n(155),n(156),n(157),n(158),n(159),n(160),n(161),n(162),n(163),n(164),n(166),n(167),n(168),n(169),n(170),n(171),n(173),n(174),n(175),n(176),n(178),n(179),n(181),n(182),n(184),n(185),n(186),n(189),n(190),t.exports=n(9)},function(t,e,n){"use strict";var r,o=n(6),i=n(7),a=n(12),u=n(11),s=n(18),c=n(19),l=n(21),f=n(22),d=n(23),h=n(13),p=n(24),_=n(17),v=n(20),g=n(25),m=n(27),y=n(29),b=n(30),w=n(31),x=n(28),E=n(15)("__proto__"),S=n(32),A=n(37)(!1),C=Object.prototype,O=Array.prototype,k=O.slice,M=O.join,T=o.setDesc,N=o.getDesc,P=o.setDescs,j={};a||(r=!h(function(){return 7!=T(c("div"),"a",{get:function(){return 7}}).a}),o.setDesc=function(t,e,n){if(r)try{return T(t,e,n)}catch(o){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(p(t)[e]=n.value),t},o.getDesc=function(t,e){if(r)try{return N(t,e)}catch(n){}if(l(t,e))return u(!C.propertyIsEnumerable.call(t,e),t[e])},o.setDescs=P=function(t,e){p(t);for(var n,r=o.getKeys(e),i=r.length,a=0;i>a;)o.setDesc(t,n=r[a++],e[n]);return t}),i(i.S+i.F*!a,"Object",{getOwnPropertyDescriptor:o.getDesc,defineProperty:o.setDesc,defineProperties:P});var L="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),F=L.concat("length","prototype"),R=L.length,D=function(){var t,e=c("iframe"),n=R,r=">";for(e.style.display="none",s.appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("<script>document.F=Object</script"+r),t.close(),D=t.F;n--;)delete D.prototype[L[n]];return D()},I=function(t,e){return function(n){var r,o=m(n),i=0,a=[];for(r in o)r!=E&&l(o,r)&&a.push(r);for(;e>i;)l(o,r=t[i++])&&(~A(a,r)||a.push(r));return a}},B=function(){};i(i.S,"Object",{getPrototypeOf:o.getProto=o.getProto||function(t){return t=g(t),l(t,E)?t[E]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?C:null},getOwnPropertyNames:o.getNames=o.getNames||I(F,F.length,!0),create:o.create=o.create||function(t,e){var n;return null!==t?(B.prototype=p(t),n=new B,B.prototype=null,n[E]=t):n=D(),void 0===e?n:P(n,e)},keys:o.getKeys=o.getKeys||I(L,R,!1)});var H=function(t,e,n){if(!(e in j)){for(var r=[],o=0;o<e;o++)r[o]="a["+o+"]";j[e]=Function("F,a","return new F("+r.join(",")+")")}return j[e](t,n)};i(i.P,"Function",{bind:function(t){var e=_(this),n=k.call(arguments,1),r=function(){var o=n.concat(k.call(arguments));return this instanceof r?H(e,o.length,o):d(e,o,t)};return v(e.prototype)&&(r.prototype=e.prototype),r}}),i(i.P+i.F*h(function(){s&&k.call(s)}),"Array",{slice:function(t,e){var n=w(this.length),r=f(this);if(e=void 0===e?n:e,"Array"==r)return k.call(this,t,e);for(var o=b(t,n),i=b(e,n),a=w(i-o),u=Array(a),s=0;s<a;s++)u[s]="String"==r?this.charAt(o+s):this[o+s];return u}}),i(i.P+i.F*(x!=Object),"Array",{join:function(t){return M.call(x(this),
var e,n=new E(S);return t&&(n.constructor=function(t){t(S,S)}),(e=E.resolve(n))["catch"](S),e===n},C=function(){function t(e){var n=new E(e);return _(n,t.prototype),n}var e=!1;try{if(e=E&&E.resolve&&A(),_(t,E),t.prototype=o.create(E.prototype,{constructor:{value:t}}),t.resolve(5).then(function(){})instanceof t||(e=!1),e&&n(12)){var r=!1;E.resolve(o.setDesc({},"then",{get:function(){r=!0}})),e=r}}catch(i){e=!1}return e}(),O=function(t,e){return!(!i||t!==E||e!==r)||v(t,e)},k=function(t){var e=f(t)[g];return void 0!=e?e:t},M=function(t){var e;return!(!l(t)||"function"!=typeof(e=t.then))&&e},T=function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r}),this.resolve=d(e),this.reject=d(n)},N=function(t){try{t()}catch(e){return{error:e}}},P=function(t,e){if(!t.n){t.n=!0;var n=t.c;y(function(){for(var r=t.v,o=1==t.s,i=0,u=function(e){var n,i,a=o?e.ok:e.fail,u=e.resolve,s=e.reject;try{a?(o||(t.h=!0),n=a===!0?r:a(r),n===e.promise?s(TypeError("Promise-chain cycle")):(i=M(n))?i.call(n,u,s):u(n)):s(r)}catch(c){s(c)}};n.length>i;)u(n[i++]);n.length=0,t.n=!1,e&&setTimeout(function(){var e,n,o=t.p;j(o)&&(x?w.emit("unhandledRejection",r,o):(e=a.onunhandledrejection)?e({promise:o,reason:r}):(n=a.console)&&n.error&&n.error("Unhandled promise rejection",r)),t.a=void 0},1)})}},j=function(t){var e,n=t._d,r=n.a||n.c,o=0;if(n.h)return!1;for(;r.length>o;)if(e=r[o++],e.fail||!j(e.promise))return!1;return!0},L=function(t){var e=this;e.d||(e.d=!0,e=e.r||e,e.v=t,e.s=2,e.a=e.c.slice(),P(e,!0))},F=function(t){var e,n=this;if(!n.d){n.d=!0,n=n.r||n;try{if(n.p===t)throw TypeError("Promise can't be resolved itself");(e=M(t))?y(function(){var r={r:n,d:!1};try{e.call(t,u(F,r,1),u(L,r,1))}catch(o){L.call(r,o)}}):(n.v=t,n.s=1,P(n,!1))}catch(r){L.call({r:n,d:!1},r)}}};C||(E=function(t){d(t);var e=this._d={p:h(this,E,b),c:[],a:void 0,s:0,d:!1,v:void 0,h:!1,n:!1};try{t(u(F,e,1),u(L,e,1))}catch(n){L.call(e,n)}},n(146)(E.prototype,{then:function(t,e){var n=new T(m(this,E)),r=n.promise,o=this._d;return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,o.c.push(n),o.a&&o.a.push(n),o.s&&P(o,!1),r},"catch":function(t){return this.then(void 0,t)}})),c(c.G+c.W+c.F*!C,{Promise:E}),n(39)(E,b),n(125)(b),r=n(9)[b],c(c.S+c.F*!C,b,{reject:function(t){var e=new T(this),n=e.reject;return n(t),e.promise}}),c(c.S+c.F*(!C||A(!0)),b,{resolve:function(t){if(t instanceof E&&O(t.constructor,this))return t;var e=new T(this),n=e.resolve;return n(t),e.promise}}),c(c.S+c.F*!(C&&n(119)(function(t){E.all(t)["catch"](function(){})})),b,{all:function(t){var e=k(this),n=new T(e),r=n.resolve,i=n.reject,a=[],u=N(function(){p(t,!1,a.push,a);var n=a.length,u=Array(n);n?o.each.call(a,function(t,o){var a=!1;e.resolve(t).then(function(t){a||(a=!0,u[o]=t,--n||r(u))},i)}):r(u)});return u&&i(u.error),n.promise},race:function(t){var e=k(this),n=new T(e),r=n.reject,o=N(function(){p(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return o&&r(o.error),n.promise}})},function(t,e){t.exports=function(t,e,n){if(!(t instanceof e))throw TypeError(n+": use the 'new' operator!");return t}},function(t,e,n){var r=n(16),o=n(116),i=n(117),a=n(24),u=n(31),s=n(118);t.exports=function(t,e,n,c){var l,f,d,h=s(t),p=r(n,c,e?2:1),_=0;if("function"!=typeof h)throw TypeError(t+" is not iterable!");if(i(h))for(l=u(t.length);l>_;_++)e?p(a(f=t[_])[0],f[1]):p(t[_]);else for(d=h.call(t);!(f=d.next()).done;)o(d,p,f.value,e)}},function(t,e,n){var r=n(24),o=n(17),i=n(35)("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||void 0==(n=r(a)[i])?e:o(n)}},function(t,e,n){var r,o,i,a=n(8),u=n(145).set,s=a.MutationObserver||a.WebKitMutationObserver,c=a.process,l=a.Promise,f="process"==n(22)(c),d=function(){var t,e,n;for(f&&(t=c.domain)&&(c.domain=null,t.exit());r;)e=r.domain,n=r.fn,e&&e.enter(),n(),e&&e.exit(),r=r.next;o=void 0,t&&t.enter()};if(f)i=function(){c.nextTick(d)};else if(s){var h=1,p=document.createTextNode("");new s(d).observe(p,{characterData:!0}),i=function(){p.data=h=-h}}else i=l&&l.resolve?function(){l.resolve().the
}e.__esModule=!0;var r=function(){function t(e,r){n(this,t),this.initialValue=e[r],this.domElement=document.createElement("div"),this.object=e,this.property=r,this.__onChange=void 0,this.__onFinishChange=void 0}return t.prototype.onChange=function(t){return this.__onChange=t,this},t.prototype.onFinishChange=function(t){return this.__onFinishChange=t,this},t.prototype.setValue=function(t){return this.object[this.property]=t,this.__onChange&&this.__onChange.call(this,t),this.updateDisplay(),this},t.prototype.getValue=function(){return this.object[this.property]},t.prototype.updateDisplay=function(){return this},t.prototype.isModified=function(){return this.initialValue!==this.getValue()},t}();e["default"]=r,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.__esModule=!0;var a=n(199),u=r(a),s=n(201),c=r(s),l=function(t){function e(n,r){function i(){a.setValue(!a.__prev)}o(this,e),t.call(this,n,r);var a=this;this.__prev=this.getValue(),this.__checkbox=document.createElement("input"),this.__checkbox.setAttribute("type","checkbox"),c["default"].bind(this.__checkbox,"change",i,!1),this.domElement.appendChild(this.__checkbox),this.updateDisplay()}return i(e,t),e.prototype.setValue=function(e){var n=t.prototype.setValue.call(this,e);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),n},e.prototype.updateDisplay=function(){return this.getValue()===!0?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0):this.__checkbox.checked=!1,t.prototype.updateDisplay.call(this)},e}(u["default"]);e["default"]=l,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t){if("0"===t||a["default"].isUndefined(t))return 0;var e=t.match(c);return a["default"].isNull(e)?0:parseFloat(e[1])}e.__esModule=!0;var i=n(197),a=r(i),u={HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},s={};a["default"].each(u,function(t,e){a["default"].each(t,function(t){s[t]=e})});var c=/(\d+(\.\d+)?)px/,l={makeSelectable:function(t,e){void 0!==t&&void 0!==t.style&&(t.onselectstart=e?function(){return!1}:function(){},t.style.MozUserSelect=e?"auto":"none",t.style.KhtmlUserSelect=e?"auto":"none",t.unselectable=e?"on":"off")},makeFullscreen:function(t,e,n){var r=n,o=e;a["default"].isUndefined(o)&&(o=!0),a["default"].isUndefined(r)&&(r=!0),t.style.position="absolute",o&&(t.style.left=0,t.style.right=0),r&&(t.style.top=0,t.style.bottom=0)},fakeEvent:function(t,e,n,r){var o=n||{},i=s[e];if(!i)throw new Error("Event type "+e+" not supported.");var u=document.createEvent(i);switch(i){case"MouseEvents":var c=o.x||o.clientX||0,l=o.y||o.clientY||0;u.initMouseEvent(e,o.bubbles||!1,o.cancelable||!0,window,o.clickCount||1,0,0,c,l,!1,!1,!1,!1,0,null);break;case"KeyboardEvents":var f=u.initKeyboardEvent||u.initKeyEvent;a["default"].defaults(o,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),f(e,o.bubbles||!1,o.cancelable,window,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.keyCode,o.charCode);break;default:u.initEvent(e,o.bubbles||!1,o.cancelable||!0)}a["default"].defaults(u,r),t.dispatchEvent(u)},bind:function(t,e,n,r){var o=r||!1;return t.addEventListener?t.addEventListener(e,n,o):t.attachEvent&&t.attachEvent("on"+e,n),l},unbind:function(t,e,n,r){var o=r||!1;return t.removeEventListener?t.removeEventListener(e,n,o):t.detachEvent&&t.detachEvent("on"+e,n),l},addClass:function(t,e){if(void 0===t.className)t.className=e;else if(t.className!==e){var n=t.className.split(/ +/);n.indexOf(e)===
this.onResize(),r.resizable&&h(this),a=function(){Z&&"true"===localStorage.getItem(c(n,"isLocal"))&&localStorage.setItem(c(n,"gui"),JSON.stringify(n.getSaveObject()))},this.saveToLocalStorageIfPossible=a,r.parent||e()};ot.toggleHide=function(){nt=!nt,G["default"].each(rt,function(t){t.domElement.style.display=nt?"none":""})},ot.CLASS_AUTO_PLACE="a",ot.CLASS_AUTO_PLACE_CONTAINER="ac",ot.CLASS_MAIN="main",ot.CLASS_CONTROLLER_ROW="cr",ot.CLASS_TOO_TALL="taller-than-window",ot.CLASS_CLOSED="closed",ot.CLASS_CLOSE_BUTTON="close-button",ot.CLASS_DRAG="drag",ot.DEFAULT_WIDTH=245,ot.TEXT_CLOSED="Close Controls",ot.TEXT_OPEN="Open Controls",ot._keydownHandler=function(t){"text"===document.activeElement.type||t.which!==J&&t.keyCode!==J||ot.toggleHide()},V["default"].bind(window,"keydown",ot._keydownHandler,!1),G["default"].extend(ot.prototype,{add:function(t,e){return s(this,t,e,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(t,e){return s(this,t,e,{color:!0})},remove:function(t){this.__ul.removeChild(t.__li),this.__controllers.splice(this.__controllers.indexOf(t),1);var e=this;G["default"].defer(function(){e.onResize()})},destroy:function(){this.autoPlace&&et.removeChild(this.domElement),V["default"].unbind(window,"keydown",ot._keydownHandler,!1),V["default"].unbind(window,"resize",this.__resizeHandler),this.saveToLocalStorageIfPossible&&V["default"].unbind(window,"unload",this.saveToLocalStorageIfPossible)},addFolder:function(t){if(void 0!==this.__folders[t])throw new Error('You already have a folder in this GUI by the name "'+t+'"');var e={name:t,parent:this};e.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[t]&&(e.closed=this.load.folders[t].closed,e.load=this.load.folders[t]);var n=new ot(e);this.__folders[t]=n;var r=o(this,n.domElement);return V["default"].addClass(r,"folder"),n},open:function(){this.closed=!1},close:function(){this.closed=!0},onResize:G["default"].debounce(function(){var t=this.getRoot();if(t.scrollable){var e=V["default"].getOffset(t.__ul).top,n=0;G["default"].each(t.__ul.childNodes,function(e){t.autoPlace&&e===t.__save_row||(n+=V["default"].getHeight(e))}),window.innerHeight-e-Q<n?(V["default"].addClass(t.domElement,ot.CLASS_TOO_TALL),t.__ul.style.height=window.innerHeight-e-Q+"px"):(V["default"].removeClass(t.domElement,ot.CLASS_TOO_TALL),t.__ul.style.height="auto")}t.__resize_handle&&G["default"].defer(function(){t.__resize_handle.style.height=t.__ul.offsetHeight+"px"}),t.__closeButton&&(t.__closeButton.style.width=t.width+"px")},200),remember:function(){if(G["default"].isUndefined($)&&($=new B["default"],$.domElement.innerHTML=w["default"]),this.parent)throw new Error("You can only call remember on a top level GUI.");var t=this;G["default"].each(Array.prototype.slice.call(arguments),function(e){0===t.__rememberedObjects.length&&d(t),t.__rememberedObjects.indexOf(e)===-1&&t.__rememberedObjects.push(e)}),this.autoPlace&&p(this,this.width)},getRoot:function(){for(var t=this;t.parent;)t=t.parent;return t},getSaveObject:function(){var t=this.load;return t.closed=this.closed,this.__rememberedObjects.length>0&&(t.preset=this.preset,t.remembered||(t.remembered={}),t.remembered[this.preset]=_(this)),t.folders={},G["default"].each(this.__folders,function(e,n){t.folders[n]=e.getSaveObject()}),t},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=_(this),i(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(t){this.load.remembered||(this.load.remembered={},this.load.remembered[q]=_(this,!0)),this.load.remembered[t]=_(this),this.preset=t,l(this,t,!0),this.saveToLocalStorageIfPossible()},revert:function(t){G["default"].each(this.__controllers,function(e){this.getRoot().load.remembered?u(t||this.getRoot(),e):e.setValue(e.initialValue),e.__onFinishChange&&e.__onFinishChange.call(e,e.getValue())},this),G["default"].each(this.__folders,function(t){t.revert(t)}),t||i(this.getRoot(),!1)},listen:function(t){var e=0===this.__listening.length;this.__listening.push(t),e&&g(this.__listening)},updateDisplay:function(){G[