cbim-render-toolbar
Version:
渲染引擎独立工具条
9 lines • 118 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("TOOLBAR",[],t):"object"==typeof exports?exports.TOOLBAR=t():e.TOOLBAR=t()}(window,(function(){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="./",i(i.s=24)}([function(e,t){function i(t){return e.exports=i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,i(t)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function i(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(15).default,s=i(5);e.exports=function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return s(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(14);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(16),s=i(17),o=i(8),a=i(18);e.exports=function(e,t){return n(e)||s(e,t)||o(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(23);function s(){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=s=Reflect.get,e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=s=function(e,t,i){var s=n(e,t);if(s){var o=Object.getOwnPropertyDescriptor(s,t);return o.get?o.get.call(arguments.length<3?e:i):o.value}},e.exports.__esModule=!0,e.exports.default=e.exports),s.apply(this,arguments)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(9);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){
/**
* lil-gui
* https://lil-gui.georgealways.com
* @version 0.15.0
* @author George Michael Brower
* @license MIT
*/
!function(e){"use strict";class t{constructor(e,i,n,s,o="div"){this.parent=e,this.object=i,this.property=n,this._disabled=!1,this.initialValue=this.getValue(),this.domElement=document.createElement("div"),this.domElement.classList.add("controller"),this.domElement.classList.add(s),this.$name=document.createElement("div"),this.$name.classList.add("name"),t.nextNameID=t.nextNameID||0,this.$name.id="lil-gui-name-"+ ++t.nextNameID,this.$widget=document.createElement(o),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(n)}name(e){return this._name=e,this.$name.innerHTML=e,this}onChange(e){return this._onChange=e,this}_callOnChange(){this.parent._callOnChange(this),void 0!==this._onChange&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),void 0!==this._onFinishChange&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(e=!0){return this.disable(!e)}disable(e=!0){return e===this._disabled||(this._disabled=e,this.domElement.classList.toggle("disabled",e),this.$disable.toggleAttribute("disabled",e)),this}hide(e=!0){return this.domElement.classList.toggle("hide",e),this}options(e){const t=this.parent.add(this.object,this.property,e);let i=this.parent.children.indexOf(this),n=this.parent.controllers.indexOf(this),s=this.domElement.nextElementSibling;return t.name(this._name),this.parent.$children.insertBefore(t.domElement,s),this.destroy(),this.parent.children.splice(i,0,t),this.parent.controllers.splice(n,0,t),this.parent.children=this.parent.children.slice(0,-1),this.parent.controllers=this.parent.controllers.slice(0,-1),t}min(e){return this}max(e){return this}step(e){return this}listen(e=!0){return this._listening=e,void 0!==this._listenCallbackID&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback),this.updateDisplay()}getValue(){return this.object[this.property]}setValue(e){return this.object[this.property]=e,this._callOnChange(),this.updateDisplay(),this}updateDisplay(){return this}load(e){return this.setValue(e),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}_captureKeyEvents(e){e.addEventListener("keydown",e=>e.stopPropagation()),e.addEventListener("keyup",e=>e.stopPropagation())}}class i extends t{constructor(e,t,i){super(e,t,i,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}}function n(e){let t,i;return(t=e.match(/(#|0x)?([a-f0-9]{6})/i))?i=t[2]:(t=e.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?i=parseInt(t[1]).toString(16).padStart(2,0)+parseInt(t[2]).toString(16).padStart(2,0)+parseInt(t[3]).toString(16).padStart(2,0):(t=e.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(i=t[1]+t[1]+t[2]+t[2]+t[3]+t[3]),!!i&&"#"+i}const s={isPrimitive:!0,match:e=>"string"==typeof e,fromHexString:n,toHexString:n},o={isPrimitive:!0,match:e=>"number"==typeof e,fromHexString:e=>parseInt(e.substring(1),16),toHexString:e=>"#"+e.toString(16).padStart(6,0)},a={isPrimitive:!1,match:Array.isArray,fromHexString(e,t,i=1){const n=o.fromHexString(e);t[0]=(n>>16&255)/255*i,t[1]=(n>>8&255)/255*i,t[2]=(255&n)/255*i},toHexString:([e,t,i],n=1)=>o.toHexString(e*(n=255/n)<<16^t*n<<8^i*n<<0)},r={isPrimitive:!1,match:e=>Object(e)===e,fromHexString(e,t,i=1){const n=o.fromHexString(e);t.r=(n>>16&255)/255*i,t.g=(n>>8&255)/255*i,t.b=(255&n)/255*i},toHexString:({r:e,g:t,b:i},n=1)=>o.toHexString(e*(n=255/n)<<16^t*n<<8^i*n<<0)},l=[s,o,a,r];class c extends t{constructor(e,t,i,s){var o;super(e,t,i,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=(o=this.initialValue,l.find(e=>e.match(o))),this._rgbScale=s,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{const e=n(this.$text.value);e&&this._setValueFromHexString(e)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this._captureKeyEvents(this.$text),this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(e){if(this._format.isPrimitive){const t=this._format.fromHexString(e);this.setValue(t)}else this._format.fromHexString(e,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(e){return this._setValueFromHexString(e),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}}class h extends t{constructor(e,t,i,n="primary"){super(e,t,i,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$button.classList.add(n),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",e=>{e.preventDefault(),this.getValue().call(this.object)}),this.$button.addEventListener("touchstart",()=>{}),this.$disable=this.$button}}class d extends t{constructor(e,t,i,n,s,o){super(e,t,i,"number"),this._initInput(),this.min(n),this.max(s);const a=void 0!==o;this.step(a?o:this._getImplicitStep(),a),this.updateDisplay()}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,t=!0){return this._step=e,this._stepExplicit=t,this}updateDisplay(){const e=this.getValue();if(this._hasSlider){let t=(e-this._min)/(this._max-this._min);t=Math.max(0,Math.min(t,1)),this.$fill.style.width=100*t+"%"}return this._inputFocused||(this.$input.value=e),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$disable=this.$input,this._captureKeyEvents(this.$input);const e=e=>{const t=parseFloat(this.$input.value);isNaN(t)||(this._snapClampSetValue(t+e),this.$input.value=this.getValue())};let t,i,n,s,o,a=!1;const r=e=>{if(a){const n=e.clientX-t,s=e.clientY-i;Math.abs(s)>5?(e.preventDefault(),this.$input.blur(),a=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(n)>5&&l()}if(!a){const t=e.clientY-n;o-=t*this._step*this._arrowKeyMultiplier(e),s+o>this._max?o=this._max-s:s+o<this._min&&(o=this._min-s),this._snapClampSetValue(s+o)}n=e.clientY},l=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",l)};this.$input.addEventListener("input",()=>{const e=parseFloat(this.$input.value);isNaN(e)||this.setValue(this._clamp(e))}),this.$input.addEventListener("keydown",t=>{"Enter"===t.code&&this.$input.blur(),"ArrowUp"===t.code&&(t.preventDefault(),e(this._step*this._arrowKeyMultiplier(t))),"ArrowDown"===t.code&&(t.preventDefault(),e(this._step*this._arrowKeyMultiplier(t)*-1))}),this.$input.addEventListener("wheel",t=>{this._inputFocused&&(t.preventDefault(),e(this._step*this._normalizeMouseWheel(t)))}),this.$input.addEventListener("mousedown",e=>{t=e.clientX,i=n=e.clientY,a=!0,s=this.getValue(),o=0,window.addEventListener("mousemove",r),window.addEventListener("mouseup",l)}),this.$input.addEventListener("focus",()=>{this._inputFocused=!0}),this.$input.addEventListener("blur",()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()})}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");const e=e=>{const t=this.$slider.getBoundingClientRect();let i=(n=e,s=t.left,o=t.right,a=this._min,r=this._max,(n-s)/(o-s)*(r-a)+a);var n,s,o,a,r;this._snapClampSetValue(i)},t=t=>{e(t.clientX)},i=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",i)};let n,s,o=!1;const a=t=>{t.preventDefault(),this._setDraggingStyle(!0),e(t.touches[0].clientX),o=!1},r=t=>{if(o){const e=t.touches[0].clientX-n,i=t.touches[0].clientY-s;Math.abs(e)>Math.abs(i)?a(t):(window.removeEventListener("touchmove",r),window.removeEventListener("touchend",l))}else t.preventDefault(),e(t.touches[0].clientX)},l=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",r),window.removeEventListener("touchend",l)},c=this._callOnFinishChange.bind(this);let h;this.$slider.addEventListener("mousedown",n=>{this._setDraggingStyle(!0),e(n.clientX),window.addEventListener("mousemove",t),window.addEventListener("mouseup",i)}),this.$slider.addEventListener("touchstart",e=>{e.touches.length>1||(this._hasScrollBar?(n=e.touches[0].clientX,s=e.touches[0].clientY,o=!0):a(e),window.addEventListener("touchmove",r),window.addEventListener("touchend",l))}),this.$slider.addEventListener("wheel",e=>{if(Math.abs(e.deltaX)<Math.abs(e.deltaY)&&this._hasScrollBar)return;e.preventDefault();const t=this._normalizeMouseWheel(e)*this._step;this._snapClampSetValue(this.getValue()+t),this.$input.value=this.getValue(),clearTimeout(h),h=setTimeout(c,400)})}_setDraggingStyle(e,t="horizontal"){this.$slider&&this.$slider.classList.toggle("active",e),document.body.classList.toggle("lil-gui-dragging",e),document.body.classList.toggle("lil-gui-"+t,e)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(e){let{deltaX:t,deltaY:i}=e;return Math.floor(e.deltaY)!==e.deltaY&&e.wheelDelta&&(t=0,i=-e.wheelDelta/120,i*=this._stepExplicit?1:10),t+-i}_arrowKeyMultiplier(e){let t=this._stepExplicit?1:10;return e.shiftKey?t*=10:e.altKey&&(t/=10),t}_snap(e){const t=Math.round(e/this._step)*this._step;return parseFloat(t.toPrecision(15))}_clamp(e){return e<this._min&&(e=this._min),e>this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){const e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return void 0!==this._min}get _hasMax(){return void 0!==this._max}}class u extends t{constructor(e,t,i,n){super(e,t,i,"number"),this._initInput(),this.min(),this.max();const s=void 0!==n;this.step(s?n:this._getImplicitStep(),s),this.updateDisplay()}min(e){return this._min=0,this._onUpdateMinMax(),this}max(e){return this._max=23.9999999999,this._onUpdateMinMax(),this}step(e,t=!0){return this._step=e,this._stepExplicit=t,this}updateDisplay(){const e=this.getValue(),t=this._timeStrToNum(e);if(this._hasSlider){let e=(t-this._min)/(this._max-this._min);e=Math.max(0,Math.min(e,1)),this.$fill.style.width=100*e+"%"}return this._inputFocused||(this.$input.value=e),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("readonly",!0),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$disable=this.$input,this._captureKeyEvents(this.$input)}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");const e=e=>{const t=this.$slider.getBoundingClientRect();let i=(n=e,s=t.left,o=t.right,a=this._min,r=this._max,(n-s)*(r-a)/(o-s)+a);var n,s,o,a,r;this._snapClampSetValue(i)},t=t=>{e(t.clientX)},i=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",i)};let n,s,o=!1;const a=t=>{t.preventDefault(),this._setDraggingStyle(!0),e(t.touches[0].clientX),o=!1},r=t=>{if(o){const e=t.touches[0].clientX-n,i=t.touches[0].clientY-s;Math.abs(e)>Math.abs(i)?a(t):(window.removeEventListener("touchmove",r),window.removeEventListener("touchend",l))}else t.preventDefault(),e(t.touches[0].clientX)},l=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",r),window.removeEventListener("touchend",l)},c=this._callOnFinishChange.bind(this);let h;this.$slider.addEventListener("mousedown",n=>{this._setDraggingStyle(!0),e(n.clientX),window.addEventListener("mousemove",t),window.addEventListener("mouseup",i)}),this.$slider.addEventListener("touchstart",e=>{e.touches.length>1||(this._hasScrollBar?(n=e.touches[0].clientX,s=e.touches[0].clientY,o=!0):a(e),window.addEventListener("touchmove",r),window.addEventListener("touchend",l))}),this.$slider.addEventListener("wheel",e=>{if(Math.abs(e.deltaX)<Math.abs(e.deltaY)&&this._hasScrollBar)return;e.preventDefault();const t=this._normalizeMouseWheel(e)*this._step;this._snapClampSetValue(this._timeStrToNum(this.getValue())+t),this.$input.value=this.getValue(),clearTimeout(h),h=setTimeout(c,400)})}_setDraggingStyle(e,t="horizontal"){this.$slider&&this.$slider.classList.toggle("active",e),document.body.classList.toggle("lil-gui-dragging",e),document.body.classList.toggle("lil-gui-"+t,e)}_getImplicitStep(){return 1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(e){let{deltaX:t,deltaY:i}=e;return Math.floor(e.deltaY)!==e.deltaY&&e.wheelDelta&&(t=0,i=-e.wheelDelta/120,i*=this._stepExplicit?1:10),t+-i}_arrowKeyMultiplier(e){let t=this._stepExplicit?1:10;return e.shiftKey?t*=10:e.altKey&&(t/=10),t}_snap(e){let t=this._getMinutes(e);return Math.round(t/this._step)*this._step/60}_clamp(e){return e<this._min&&(e=this._min),e>this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._numToTimeStr(this._clamp(this._snap(e))))}get _hasScrollBar(){const e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return void 0!==this._min}get _hasMax(){return void 0!==this._max}_numToTimeStr(e){let t,i;return t=Math.floor(e),e-=t,e*=100,i=Math.floor(60*e/100),`${t>=10?t:"0"+t}:${i>=10?i:"0"+i}`}_timeStrToNum(e){let[t,i]=e.split(":");return parseInt(t)+i/60}_getMinutes(e){return 60*e}}class p extends t{constructor(e,t,i,n){super(e,t,i,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this._values=Array.isArray(n)?n:Object.values(n),this._names=Array.isArray(n)?n:Object.keys(n),this._names.forEach(e=>{let t="";t="object"==typeof e?e.name||e.label:e;const i=document.createElement("option");i.innerHTML=t,this.$select.appendChild(i)}),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.updateDisplay()}setOptions(e){this._values=Array.isArray(e)?e:Object.values(e),this._names=Array.isArray(e)?e:Object.keys(e),this.$select.innerHTML="",this._names.forEach(e=>{let t="";t="object"==typeof e?e.name||e.label:e;const i=document.createElement("option");i.innerHTML=t,this.$select.appendChild(i)})}updateDisplay(){const e=this.getValue(),t=this._values.indexOf(e);return this.$select.selectedIndex=t,this.$display.innerHTML=-1===t?e:"object"==typeof this._names[t]?this._names[t].name||this._names[t].label:this._names[t],this}}class f extends t{constructor(e,t,i){super(e,t,i,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",e=>{"Enter"===e.code&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this._captureKeyEvents(this.$input),this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}}class v extends t{constructor(e,t,i,n,s,o){super(e,t,i,"range"),this.min(n),this.max(s),this.moveHandler="";const a=void 0!==o;this.step(a?o:this._getImplicitStep(),a),this.updateDisplay()}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,t=!0){return this._step=e,this._stepExplicit=t,this}updateDisplay(){const e=this.getValue();if(this._hasSlider){let t=(e[0]-this._min)/(this._max-this._min),i=(this._max-e[1])/(this._max-this._min);this.$fillStart.style.width=100*t+"%",this.$fillEnd.style.width=100*i+"%"}return this}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fillStart=document.createElement("div"),this.$fillStart.classList.add("fill-start"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$fillEnd=document.createElement("div"),this.$fillEnd.classList.add("fill-end"),this.$min=document.createElement("div"),this.$min.classList.add("slider-min"),this.$max=document.createElement("div"),this.$max.classList.add("slider-max"),this.$fill.appendChild(this.$min),this.$fill.appendChild(this.$max),this.$slider.appendChild(this.$fillStart),this.$slider.appendChild(this.$fill),this.$slider.appendChild(this.$fillEnd),this.$widget.appendChild(this.$slider),this.domElement.classList.add("hasSlider");const e=(e,t,i,n,s)=>(e-t)/(i-t)*(s-n)+n,t=t=>{const i=this.$slider.getBoundingClientRect();let n=this.getValue();"min"==this.moveHandler?n[0]=Math.min(n[1],e(t,i.left,i.right,this._min,this._max)):"max"==this.moveHandler&&(n[1]=Math.max(n[0],e(t,i.left,i.right,this._min,this._max))),this._snapClampSetValue(n)},i=e=>{t(e.clientX)},n=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),this.moveHandler="",window.removeEventListener("mousemove",i),window.removeEventListener("mouseup",n)};let s,o,a=!1;const r=e=>{e.preventDefault(),this._setDraggingStyle(!0),t(e.touches[0].clientX),a=!1},l=e=>{if(a){const t=e.touches[0].clientX-s,i=e.touches[0].clientY-o;Math.abs(t)>Math.abs(i)?r(e):(window.removeEventListener("touchmove",l),window.removeEventListener("touchend",c))}else e.preventDefault(),t(e.touches[0].clientX)},c=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",l),window.removeEventListener("touchend",c)},h=this._callOnFinishChange.bind(this);let d;this.$slider.addEventListener("mousedown",e=>{let s=e.target;this.moveHandler=s==this.$max?"max":s==this.$min?"min":"",this._setDraggingStyle(!0),t(e.clientX),window.addEventListener("mousemove",i),window.addEventListener("mouseup",n)}),this.$slider.addEventListener("touchstart",e=>{e.touches.length>1||(this._hasScrollBar?(s=e.touches[0].clientX,o=e.touches[0].clientY,a=!0):r(e),window.addEventListener("touchmove",l),window.addEventListener("touchend",c))}),this.$slider.addEventListener("wheel",e=>{let t=this.$min.getBoundingClientRect(),i=this.$max.getBoundingClientRect();if(Math.abs(e.deltaX)<Math.abs(e.deltaY)&&this._hasScrollBar)return;e.preventDefault();const n=this._normalizeMouseWheel(e)*this._step;let s=this.getValue();Math.abs(t.x-e.clientX)<Math.abs(i.x-e.clientX)?(this.moveHandler="min",s[0]=Math.max(this._min,s[0]+n)):(s[1]=Math.min(this._max,s[1]+n),this.moveHandler="max"),this._snapClampSetValue(s),clearTimeout(d),d=setTimeout(h,400)})}_setDraggingStyle(e,t="horizontal"){this.$slider&&this.$slider.classList.toggle("active",e),document.body.classList.toggle("lil-gui-dragging",e),document.body.classList.toggle("lil-gui-"+t,e)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(e){let{deltaX:t,deltaY:i}=e;return Math.floor(e.deltaY)!==e.deltaY&&e.wheelDelta&&(t=0,i=-e.wheelDelta/120,i*=this._stepExplicit?1:10),t+-i}_arrowKeyMultiplier(e){let t=this._stepExplicit?1:10;return e.shiftKey?t*=10:e.altKey&&(t/=10),t}_snap(e){const t=Math.round(e[0]/this._step)*this._step,i=Math.round(e[1]/this._step)*this._step;return[parseFloat(t.toPrecision(15)),parseFloat(i.toPrecision(15))]}_clamp(e){return"min"==this.moveHandler&&(e[0]<this._min&&(e[0]=this._min),e[0]>e[1]&&(e[0]=e[1])),"max"==this.moveHandler&&(e[1]<e[0]&&(e[1]=e[0]),e[1]>this._max&&(e[1]=this._max)),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){const e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return void 0!==this._min}get _hasMax(){return void 0!==this._max}}class m extends t{constructor(e,t,i,n={nameKey:"属性",valueKey:"属性值"}){super(e,t,i,"table"),this.data=this.getValue(),this.$table=document.createElement("table"),this.$header=document.createElement("tr"),this.$header.innerHTML=`<th width="35%">${n.nameKey}</th><th>${n.valueKey}</th>`,this.$table.appendChild(this.$header),this.$widget.appendChild(this.$table),this.updateDisplay()}_initTable(){this.$tbody&&this.$table.removeChild(this.$tbody),this.$tbody=document.createElement("tbody"),this.$table.appendChild(this.$tbody),Object.keys(this.data).forEach(e=>{let t=document.createElement("tr");t.innerHTML=`<td>${e}</td><td>${this.data[e]}</td>`,this.$tbody.appendChild(t)})}updateDisplay(){return this.data=this.getValue(),this._initTable(),this}}class g extends t{constructor(e,t,i,n,s){super(e,t,i,"listOption"),this.initialValue=Array.from(this.getValue()),this.$select=document.createElement("div"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this._options=n,this._chks=[],this._optionDoms=[];let o={label:"label",value:"value",reclusive:!1,showCheckBox:!0,className:"",appendHtml:""};Object.assign(o,s||{}),o.html||(o.html=o.tpl||"{{"+o.label+"}}"),this._configs=o;let a=this.getValue();a.length>1&&this._configs.reclusive&&(this._configs.reclusive=!1);const r=e=>{e.stopPropagation&&e.stopPropagation();let t=[],i=this._chks,s=e.target;i.forEach((e,i)=>{this._configs.reclusive&&s!=e?e.checked=!1:e.checked&&t.push(n[i][o.value])}),this.setValue(t),this.updateDisplay(),this._callOnFinishChange()},l=(e,t,i)=>{let n=document.createElement("div");n.classList.add("listOption-option");let s=`<input class="listOption-checkbox ${i.showCheckBox?"":"hidden"}" type="${i.reclusive?"radio":"checkbox"}" ${a.includes(e[i.value])?"checked":""} id="${this.$name.id+"_"+t}" />`;return n.innerHTML=s+i.html.replace(/\{{2}([^}]*)\}{2}/g,(function(t,i){return e[i]||""})),this._chks.push(n.childNodes[0]),this._optionDoms.push(n),n};if(this.$widget.addEventListener("click",e=>{if(e.stopPropagation(),!(!e.target||e.target==this.$widget||e.target.classList&&e.target.classList.contains("listOption-checkbox")))if(e.target.closest(".listOption-option")){let t=e.target.closest(".listOption-option"),i=!0;if(o.onOptionClick){let n=-1;for(let e=0;e<this._optionDoms.length;e++)this._optionDoms[e]===t&&(n=e);i=!0===o.onOptionClick(e,n)}if(i){let e=t.querySelector(".listOption-checkbox");e&&(this._configs.reclusive?e.checked=!0:e.checked=!e.checked),r({target:e})}}else e.target.closest(".listOption-slot-end")&&o.onSlotListEndClick(e)}),this._options.forEach((e,t)=>{let i=l(e,t,o);this.$widget.appendChild(i)}),o.appendHtml){let e=((e,t)=>{let i=document.createElement("div");return i.classList.add(e),i.innerHTML=t,i})("listOption-slot-end",o.appendHtml);this.$widget.appendChild(e)}this.$widget.addEventListener("change",r),o.className&&this.domElement.classList.add(o.className),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.updateDisplay()}options(e){const t=this.parent.add(this.object,this.property,e,this._configs);let i=this.parent.children.indexOf(this),n=this.parent.controllers.indexOf(this),s=this.domElement.nextElementSibling;return t.name(this._name),this.parent.$children.insertBefore(t.domElement,s),this._chks=null,this.destroy(),this.parent.children.splice(i,0,t),this.parent.controllers.splice(n,0,t),this.parent.children=this.parent.children.slice(0,-1),this.parent.controllers=this.parent.controllers.slice(0,-1),this._onFinishChange&&(t._onFinishChange=this._onFinishChange),t}updateDisplay(){return this._chks.forEach(e=>{e.parentNode.classList[e.checked?"add":"remove"]("active")}),this}reset(){this.setValue(this.initialValue);let e=this._chks;return this._options.forEach((t,i)=>{let n=e[i];n&&(n.checked=this.initialValue.includes(t[this._configs.value]))}),this.updateDisplay(),this._callOnFinishChange(),this}load(e){return this.initialValue=Array.from(e),this.reset(),this}}let y=!1;class b{constructor({parent:e,autoPlace:t=void 0===e,container:i,width:n,title:s="",injectStyles:o=!0,touchStyles:a=!0}={}){if(this.parent=e,this.root=e?e.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),s&&(this.$title=document.createElement("div"),this.$title.classList.add("title"),this.$title.setAttribute("role","button"),this.$title.setAttribute("aria-expanded",!0),this.$title.setAttribute("tabindex",0),this.$title.addEventListener("click",()=>this.openAnimated(this._closed)),this.$title.addEventListener("keydown",e=>{"Enter"!==e.code&&"Space"!==e.code||(e.preventDefault(),this.$title.click())}),this.$title.addEventListener("touchstart",()=>{}),this.domElement.appendChild(this.$title),this.title(s)),this.$children=document.createElement("div"),this.$children.classList.add("children"),this.domElement.appendChild(this.$children),a&&this.domElement.classList.add("allow-touch-styles"),this.parent)return this.parent.children.push(this),this.parent.folders.push(this),void this.parent.$children.appendChild(this.domElement);this.domElement.classList.add("root"),!y&&o&&(function(e){const t=document.createElement("style");t.innerHTML=e;const i=document.querySelector("head link[rel=stylesheet], head style");i?document.head.insertBefore(t,i):document.head.appendChild(t)}('.lil-gui {\n font-family: var(--font-family);\n font-size: var(--font-size);\n line-height: 1;\n font-weight: normal;\n font-style: normal;\n text-align: left;\n background-color: var(--background-color);\n color: var(--text-color);\n user-select: none;\n -webkit-user-select: none;\n touch-action: manipulation;\n --main-color: #409eff;\n --success-color: #67c23a;\n --warn-color: #e6a23c;\n --error-color: #f56c6c;\n --background-color: transparent;\n --text-color: #666;\n --title-background-color: transparent;\n --title-text-color: #666;\n --widget-color: #f4f4f4;\n --hover-color: #f6f6f6;\n --focus-color: #f6f6f6;\n --number-color: #2cc9ff;\n --range-handler-color: #058ebd;\n --string-color: #a2db3c;\n --font-size: 11px;\n --input-font-size: 11px;\n --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;\n --font-family-mono: Menlo, Monaco, Consolas, "Droid Sans Mono", monospace;\n --padding: 4px;\n --spacing: 4px;\n --widget-height: 20px;\n --name-width: 45%;\n --slider-knob-width: 2px;\n --slider-input-width: 27%;\n --color-input-width: 27%;\n --slider-input-min-width: 45px;\n --color-input-min-width: 45px;\n --folder-indent: 7px;\n --widget-padding: 0 0 0 3px;\n --widget-border-radius: 2px;\n --checkbox-size: calc(0.75 * var(--widget-height));\n --scrollbar-width: 5px;\n}\n.lil-gui, .lil-gui * {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n.lil-gui.root {\n width: var(--width, 245px);\n display: flex;\n flex-direction: column;\n}\n.lil-gui.root > .title {\n background: var(--title-background-color);\n color: var(--title-text-color);\n}\n.lil-gui.root > .children {\n overflow-x: hidden;\n overflow-y: auto;\n}\n.lil-gui.root > .children::-webkit-scrollbar {\n width: var(--scrollbar-width);\n height: var(--scrollbar-width);\n background: var(--background-color);\n}\n.lil-gui.root > .children::-webkit-scrollbar-thumb {\n border-radius: var(--scrollbar-width);\n background: var(--focus-color);\n}\n@media (pointer: coarse) {\n .lil-gui.allow-touch-styles {\n --widget-height: 28px;\n --padding: 6px;\n --spacing: 6px;\n --font-size: 13px;\n --input-font-size: 16px;\n --folder-indent: 10px;\n --widget-padding: 0 0 0 3px;\n --scrollbar-width: 7px;\n --slider-input-min-width: 50px;\n --color-input-min-width: 65px;\n }\n}\n.lil-gui.force-touch-styles {\n --widget-height: 28px;\n --padding: 6px;\n --spacing: 6px;\n --font-size: 13px;\n --input-font-size: 16px;\n --folder-indent: 10px;\n --widget-padding: 0 0 0 3px;\n --scrollbar-width: 7px;\n --slider-input-min-width: 50px;\n --color-input-min-width: 65px;\n}\n.lil-gui.autoPlace {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 1001;\n}\n\n.lil-gui .controller {\n display: flex;\n align-items: center;\n padding: 0 var(--padding);\n margin: var(--spacing) 0;\n}\n.lil-gui .controller.disabled {\n opacity: 0.5;\n}\n.lil-gui .controller.disabled, .lil-gui .controller.disabled * {\n pointer-events: none !important;\n}\n.lil-gui .controller > .name {\n min-width: var(--name-width);\n flex-shrink: 0;\n white-space: pre;\n padding-right: var(--spacing);\n line-height: var(--widget-height);\n}\n.lil-gui .controller .widget {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n min-height: var(--widget-height);\n}\n.lil-gui .controller.hide {\n display: none;\n}\n.lil-gui .controller.string input {\n color: var(--string-color);\n}\n.lil-gui .controller.boolean .widget {\n cursor: pointer;\n}\n.lil-gui .controller.color .display {\n width: 100%;\n height: var(--widget-height);\n border-radius: var(--widget-border-radius);\n position: relative;\n}\n@media (hover: hover) {\n .lil-gui .controller.color .display:hover:before {\n content: " ";\n display: block;\n position: absolute;\n border-radius: var(--widget-border-radius);\n border: 1px solid #fff9;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n }\n}\n.lil-gui .controller.color input[type=color] {\n opacity: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n}\n.lil-gui .controller.color input[type=text] {\n margin-left: var(--spacing);\n font-family: var(--font-family-mono);\n min-width: var(--color-input-min-width);\n width: var(--color-input-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.option select {\n opacity: 0;\n position: absolute;\n width: 100%;\n max-width: 100%;\n}\n.lil-gui .controller.option .display {\n position: relative;\n pointer-events: none;\n border-radius: var(--widget-border-radius);\n height: var(--widget-height);\n line-height: var(--widget-height);\n max-width: 100%;\n width: 100%;\n overflow: hidden;\n word-break: break-all;\n padding-left: 0.55em;\n padding-right: 1.75em;\n background: var(--widget-color);\n}\n@media (hover: hover) {\n .lil-gui .controller.option .display.focus {\n background: var(--focus-color);\n }\n}\n.lil-gui .controller.option .display.active {\n background: var(--focus-color);\n}\n.lil-gui .controller.option .display:after {\n font-family: "lil-gui";\n content: "↕";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n padding-right: 0.375em;\n}\n.lil-gui .controller.option .widget,\n.lil-gui .controller.option select {\n cursor: pointer;\n}\n@media (hover: hover) {\n .lil-gui .controller.option .widget:hover .display {\n background: var(--hover-color);\n }\n}\n.lil-gui .controller.number input {\n color: var(--number-color);\n}\n.lil-gui .controller.number.hasSlider input {\n margin-left: var(--spacing);\n width: var(--slider-input-width);\n min-width: var(--slider-input-min-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.number .slider {\n width: 100%;\n height: var(--widget-height);\n background-color: var(--widget-color);\n border-radius: var(--widget-border-radius);\n padding-right: var(--slider-knob-width);\n overflow: hidden;\n cursor: ew-resize;\n touch-action: pan-y;\n}\n@media (hover: hover) {\n .lil-gui .controller.number .slider:hover {\n background-color: var(--hover-color);\n }\n}\n.lil-gui .controller.number .slider.active {\n background-color: var(--focus-color);\n}\n.lil-gui .controller.number .slider.active .fill {\n opacity: 0.95;\n}\n.lil-gui .controller.number .fill {\n height: 100%;\n border-right: var(--slider-knob-width) solid var(--number-color);\n background-color: var(--number-color);\n box-sizing: content-box;\n}\n.lil-gui .controller.range input {\n color: var(--number-color);\n}\n.lil-gui .controller.range.hasSlider input {\n margin-left: var(--spacing);\n width: var(--slider-input-width);\n min-width: var(--slider-input-min-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.range .slider {\n width: 100%;\n display: flex;\n flex-direction: row;\n height: var(--widget-height);\n background-color: var(--widget-color);\n border-radius: var(--widget-border-radius);\n overflow: hidden;\n touch-action: pan-y;\n}\n@media (hover: hover) {\n .lil-gui .controller.range .slider:hover {\n background-color: var(--hover-color);\n }\n}\n.lil-gui .controller.range .slider.active {\n background-color: var(--focus-color);\n}\n.lil-gui .controller.range .slider.active .fill {\n opacity: 0.95;\n}\n.lil-gui .controller.range .fill-start, .lil-gui .controller.range .fill-end {\n width: 0;\n}\n.lil-gui .controller.range .fill {\n position: relative;\n flex: 1;\n height: 100%;\n padding-right: 4px;\n padding-left: 4px;\n background-color: var(--number-color);\n box-sizing: border-box;\n overflow: hidden;\n}\n.lil-gui .controller.range .fill > .slider-min, .lil-gui .controller.range .fill > .slider-max {\n position: absolute;\n cursor: ew-resize;\n top: 0;\n height: 100%;\n width: 4px;\n background-color: var(--range-handler-color);\n}\n.lil-gui .controller.range .fill > .slider-min {\n left: 0px;\n}\n.lil-gui .controller.range .fill > .slider-max {\n right: 0px;\n}\n.lil-gui .controller.table > .name {\n display: none;\n}\n.lil-gui .controller.table table {\n border-collapse: collapse;\n}\n.lil-gui .controller.table table, .lil-gui .controller.table th, .lil-gui .controller.table td {\n border: 1px solid #FFF;\n}\n.lil-gui .controller.table table {\n width: 100%;\n}\n.lil-gui .controller.table th, .lil-gui .controller.table td {\n padding: 4px;\n line-height: 1.2;\n}\n.lil-gui .controller.listOption > .widget {\n display: flex;\n flex-wrap: wrap;\n}\n.lil-gui .controller.listOption > .widget .listOption-checkbox[type=radio] {\n width: auto;\n}\n.lil-gui .controller.listOption .listOption-option {\n margin-right: 4px;\n margin-bottom: 4px;\n max-width: 40%;\n flex: 0 0 auto;\n flex-wrap: wrap;\n}\n.lil-gui .controller.listOption .hidden {\n position: absolute;\n opacity: 0;\n visibility: hidden;\n width: 0;\n height: 0;\n}\n\n.lil-gui-dragging .lil-gui {\n --hover-color: var(--widget-color);\n}\n.lil-gui-dragging * {\n cursor: ew-resize !important;\n}\n\n.lil-gui-dragging.lil-gui-vertical * {\n cursor: ns-resize !important;\n}\n\n.lil-gui .title {\n --title-height: calc(var(--widget-height) + var(--spacing) * 1.25);\n height: var(--title-height);\n line-height: calc(var(--title-height) - 4px);\n font-weight: 600;\n padding: 0 var(--padding);\n -webkit-tap-highlight-color: transparent;\n cursor: pointer;\n outline: none;\n text-decoration-skip: objects;\n}\n.lil-gui .title:before {\n font-family: "lil-gui";\n content: "▾";\n padding-right: 2px;\n display: inline-block;\n}\n.lil-gui .title:active {\n background: var(--title-background-color);\n opacity: 0.75;\n}\n@media (hover: hover) {\n body:not(.lil-gui-dragging) .lil-gui .title:hover {\n background: var(--title-background-color);\n opacity: 0.85;\n }\n .lil-gui .title:focus {\n text-decoration: underline var(--focus-color);\n }\n}\n.lil-gui.root > .title:focus {\n text-decoration: none !important;\n}\n.lil-gui.closed > .title:before {\n content: "▸";\n}\n.lil-gui.closed > .children {\n transform: translateY(-7px);\n opacity: 0;\n}\n.lil-gui.closed:not(.transition) > .children {\n display: none;\n}\n.lil-gui.transition > .children {\n transition-duration: 300ms;\n transition-property: height, opacity, transform;\n transition-timing-function: cubic-bezier(0.2, 0.6, 0.35, 1);\n overflow: hidden;\n pointer-events: none;\n}\n.lil-gui .children:empty:before {\n content: "Empty";\n padding: 0 var(--padding);\n margin: var(--spacing) 0;\n display: block;\n height: var(--widget-height);\n font-style: italic;\n line-height: var(--widget-height);\n opacity: 0.5;\n}\n.lil-gui.root > .children > .lil-gui > .title {\n border: 0 solid var(--widget-color);\n border-width: 1px 0;\n transition: border-color 300ms;\n}\n.lil-gui.root > .children > .lil-gui.closed > .title {\n border-bottom-color: transparent;\n}\n.lil-gui + .controller {\n border-top: 1px solid var(--widget-color);\n margin-top: 0;\n padding-top: var(--spacing);\n}\n.lil-gui .lil-gui .lil-gui > .title {\n border: none;\n}\n.lil-gui .lil-gui .lil-gui > .children {\n border: none;\n margin-left: var(--folder-indent);\n border-left: 2px solid var(--widget-color);\n}\n.lil-gui .lil-gui .controller {\n border: none;\n}\n\n.lil-gui input {\n -webkit-tap-highlight-color: transparent;\n border: 0;\n outline: none;\n font-family: var(--font-family);\n font-size: var(--input-font-size);\n border-radius: var(--widget-border-radius);\n height: var(--widget-height);\n background: var(--widget-color);\n color: var(--text-color);\n width: 100%;\n}\n@media (hover: hover) {\n .lil-gui input:hover {\n background: var(--hover-color);\n }\n .lil-gui input:active {\n background: var(--focus-color);\n }\n}\n.lil-gui input:disabled {\n opacity: 1;\n}\n.lil-gui input[type=text],\n.lil-gui input[type=number] {\n padding: var(--widget-padding);\n}\n.lil-gui input[type=text]:focus,\n.lil-gui input[type=number]:focus {\n background: var(--focus-color);\n}\n.lil-gui input::-webkit-outer-spin-button,\n.lil-gui input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n.lil-gui input[type=number] {\n -moz-appearance: textfield;\n}\n.lil-gui input[type=checkbox] {\n appearance: none;\n -webkit-appearance: none;\n height: var(--checkbox-size);\n width: var(--checkbox-size);\n border-radius: var(--widget-border-radius);\n text-align: center;\n cursor: pointer;\n}\n.lil-gui input[type=checkbox]:checked:before {\n font-family: "lil-gui";\n content: "✓";\n font-size: var(--checkbox-size);\n line-height: var(--checkbox-size);\n}\n@media (hover: hover) {\n .lil-gui input[type=checkbox]:focus {\n box-shadow: inset 0 0 0 1px var(--focus-color);\n }\n}\n.lil-gui button {\n -webkit-tap-highlight-color: transparent;\n outline: none;\n cursor: pointer;\n font-family: var(--font-family);\n font-size: var(--font-size);\n color: var(--text-color);\n width: 100%;\n height: var(--widget-height);\n text-transform: none;\n background: var(--widget-color);\n border-radius: var(--widget-border-radius);\n border: 1px solid var(--widget-color);\n text-align: center;\n line-height: calc(var(--widget-height) - 4px);\n}\n.lil-gui button.primary, .lil-gui button.success, .lil-gui button.warn, .lil-gui button.danger {\n color: #FFF;\n}\n.lil-gui button.primary {\n background-color: var(--main-color);\n}\n.lil-gui button.success {\n background-color: var(--success-color);\n}\n.lil-gui button.warn {\n background-color: var(--warn-color);\n}\n.lil-gui button.danger {\n background-color: var(--error-color);\n}\n@media (hover: hover) {\n .lil-gui button:hover {\n opacity: 0.8;\n }\n}\n@font-face {\n font-family: "lil-gui";\n src: url("data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUsAAsAAAAACJwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAAH4AAADAImwmYE9TLzIAAAGIAAAAPwAAAGBKqH5SY21hcAAAAcgAAAD0AAACrukyyJBnbHlmAAACvAAAAF8AAACEIZpWH2hlYWQAAAMcAAAAJwAAADZfcj2zaGhlYQAAA0QAAAAYAAAAJAC5AHhobXR4AAADXAAAABAAAABMAZAAAGxvY2EAAANsAAAAFAAAACgCEgIybWF4cAAAA4AAAAAeAAAAIAEfABJuYW1lAAADoAAAASIAAAIK9SUU/XBvc3QAAATEAAAAZgAAAJCTcMc2eJxVjbEOgjAURU+hFRBK1dGRL+ALnAiToyMLEzFpnPz/eAshwSa97517c/MwwJmeB9kwPl+0cf5+uGPZXsqPu4nvZabcSZldZ6kfyWnomFY/eScKqZNWupKJO6kXN3K9uCVoL7iInPr1X5baXs3tjuMqCtzEuagm/AAlzQgPAAB4nGNgYRBlnMDAysDAYM/gBiT5oLQBAwuDJAMDEwMrMwNWEJDmmsJwgCFeXZghBcjlZMgFCzOiKOIFAB71Bb8AeJy1kjFuwkAQRZ+DwRAwBtNQRUGKQ8OdKCAWUhAgKLhIuAsVSpWz5Bbkj3dEgYiUIszqWdpZe+Z7/wB1oCYmIoboiwiLT2WjKl/jscrHfGg/pKdMkyklC5Zs2LEfHYpjcRoPzme9MWWmk3dWbK9ObkWkikOetJ554fWyoEsmdSlt+uR0pCJR34b6t/TVg1SY3sYvdf8vuiKrpyaDXDISiegp17p7579Gp3p++y7HPAiY9pmTibljrr85qSidtlg4+l25GLCaS8e6rRxNBmsnERunKbaOObRz7N72ju5vdAjYpBXHgJylOAVsMseDAPEP8LYoUHicY2BiAAEfhiAGJgZWBgZ7RnFRdnVJELCQlBSRlATJMoLV2DK4glSYs6ubq5vbKrJLSbGrgEmovDuDJVhe3VzcXFwNLCOILB/C4IuQ1xTn5FPilBTj5FPmBAB4WwoqAHicY2BkYGAA4sk1sR/j+W2+MnAzpDBgAyEMQUCSg4EJxAEAwUgFHgB4nGNgZGBgSGFggJMhDIwMqEAYAByHATJ4nGNgAIIUNEwmAABl3AGReJxjYAACIQYlBiMGJ3wQAEcQBEV4nGNgZGBgEGZgY2BiAAEQyQWEDAz/wXwGAAsPATIAAHicXdBNSsNAHAXwl35iA0UQXYnMShfS9GPZA7T7LgIu03SSpkwzYTIt1BN4Ak/gKTyAeCxfw39jZkjymzcvAwmAW/wgwHUEGDb36+jQQ3GXGot79L24jxCP4gHzF/EIr4jEIe7wxhOC3g2TMYy4Q7+Lu/SHuEd/ivt4wJd4wPxbPEKMX3GI5+DJFGaSn4qNzk8mcbKSR6xdXdhSzaOZJGtdapd4vVPbi6rP+cL7TGXOHtXKll4bY1Xl7EGnPtp7Xy2n00zyKLVHfkHBa4IcJ2oD3cgggWvt/V/FbDrUlEUJhTn/0azVWbNTNr0Ens8de1tceK9xZmfB1CPjOmPH4kitmvOubcNpmVTN3oFJyjzCvnmrwhJTzqzVj9jiSX911FjeAAB4nG3HMRKCMBBA0f0giiKi4DU8k0V2GWbIZDOh4PoWWvq6J5V8If9NVNQcaDhyouXMhY4rPTcG7jwYmXhKq8Wz+p762aNaeYXom2n3m2dLTVgsrCgFJ7OTmIkYbwIbC6vIB7WmFfAAAA==") format("woff");\n}'),y=!0),i?i.appendChild(this.domElement):t&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),n&&this.domElement.style.setProperty("--width",n+"px")}add(e,t,n,s,o){const a=e[t];if(Object(n)===n&&!0!==s)return a&&a instanceof Array?new g(this,e,t,n,s):new p(this,e,t,n);switch(typeof a){case"number":return new d(this,e,t,n,s,o);case"boolean":return new i(this,e,t);case"string":return"time"===n?new u(this,e,t,s):new f(this,e,t);case"function":return new h(this,e,t,n);case"object":let r=Object.prototype.toString.call(a),l=r.substring(8,r.length-1);if("Array"===l)return new v(this,e,t,n,s,o);if("Object"===l)return new m(this,e,t,n)}console.error("gui.add failed\n\tproperty:",t,"\n\tobject:",e,"\n\tvalue:",a)}addColor(e,t,i=1){return new c(this,e,t,i)}addFolder(e){return new b({parent:this,title:e})}load(e,t=!0){return e.controllers&&this.controllers.forEach(t=>{t instanceof h||t._name in e.controllers&&t.load(e.controllers[t._name])}),t&&e.folders&&this.folders.forEach(t=>{t._title in e.folders&&t.load(e.folders[t._title])}),this}save(e=!0){const t={controllers:{},folders:{}};return this.controllers.forEach(e=>{if(!(e instanceof h)){if(e._name in t.controllers)throw new Error(`Cannot save GUI with duplicate property "${e._name}"`);t.controllers[e._name]=e.save()}}),e&&this.folders.forEach(e=>{if(e._title in t.folders)throw new Error(`Cannot save GUI with duplicate folder "${e._title}"`);t.folders[e._title]=e.save()}),t}open(e=!0){return this._closed=!e,this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}openAnimated(e=!0){return this._closed=!e,this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{const t=this.$children.clientHeight;th