diff --git a/dist/demo.js b/dist/demo.js index c8dc658..f6b4b86 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -1 +1 @@ -(()=>{"use strict";var e={625:(e,t)=>{var n;t.z=function(e){if(void 0===e&&(e="https://mapgl.2gis.com/api/js"),"undefined"==typeof window)throw new Error("mapgl is supported only in browser environment");return n?Promise.resolve(n):function(e){return new Promise((function(t,n){var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.crossOrigin="anonymous",i.src=e,document.body.appendChild(i),i.addEventListener("load",(function(){t()})),i.addEventListener("error",(function(e){n(e)}))}))}(e).then((function(){return n=window.mapgl}))}}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={exports:{}};return e[i](r,r.exports,n),r.exports}(()=>{var e=function(){return(e=Object.assign||function(e){for(var t,n=1,i=arguments.length;n=0;n--)t=[e[n].apply(this,t)];return t[0]}},each:function(e,t,n){if(e)if(o&&e.forEach&&e.forEach===o)e.forEach(t,n);else if(e.length===e.length+0){var i,r=void 0;for(r=0,i=e.length;r1?a.toArray(arguments):arguments[0];return a.each(s,(function(t){if(t.litmus(e))return a.each(t.conversions,(function(t,n){if(l=t.read(e),!1===c&&!1!==l)return c=l,l.conversionName=n,l.conversion=t,a.BREAK})),a.BREAK})),c},u=void 0,h={hsv_to_rgb:function(e,t,n){var i=Math.floor(e/60)%6,o=e/60-Math.floor(e/60),r=n*(1-t),a=n*(1-o*t),s=n*(1-(1-o)*t),l=[[n,s,r],[a,n,r],[r,n,s],[r,a,n],[s,r,n],[n,r,a]][i];return{r:255*l[0],g:255*l[1],b:255*l[2]}},rgb_to_hsv:function(e,t,n){var i=Math.min(e,t,n),o=Math.max(e,t,n),r=o-i,a=void 0;return 0===o?{h:NaN,s:0,v:0}:(a=e===o?(t-n)/r:t===o?2+(n-e)/r:4+(e-t)/r,(a/=6)<0&&(a+=1),{h:360*a,s:r/o,v:o/255})},rgb_to_hex:function(e,t,n){var i=this.hex_with_component(0,2,e);return i=this.hex_with_component(i,1,t),this.hex_with_component(i,0,n)},component_from_hex:function(e,t){return e>>8*t&255},hex_with_component:function(e,t,n){return n<<(u=8*t)|e&~(255<-1?t.length-t.indexOf(".")-1:0}var L=function(e){function t(e,n,i){f(this,t);var o=b(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),r=i||{};return o.__min=r.min,o.__max=r.max,o.__step=r.step,a.isUndefined(o.__step)?0===o.initialValue?o.__impliedStep=1:o.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(o.initialValue))/Math.LN10))/10:o.__impliedStep=o.__step,o.__precision=B(o.__impliedStep),o}return g(t,e),p(t,[{key:"setValue",value:function(e){var n=e;return void 0!==this.__min&&nthis.__max&&(n=this.__max),void 0!==this.__step&&n%this.__step!=0&&(n=Math.round(n/this.__step)*this.__step),m(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,n)}},{key:"min",value:function(e){return this.__min=e,this}},{key:"max",value:function(e){return this.__max=e,this}},{key:"step",value:function(e){return this.__step=e,this.__impliedStep=e,this.__precision=B(e),this}}]),t}(x),R=function(e){function t(e,n,i){f(this,t);var o=b(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,i));o.__truncationSuspended=!1;var r=o,s=void 0;function l(){r.__onFinishChange&&r.__onFinishChange.call(r,r.getValue())}function c(e){var t=s-e.clientY;r.setValue(r.getValue()+t*r.__impliedStep),s=e.clientY}function d(){S.unbind(window,"mousemove",c),S.unbind(window,"mouseup",d),l()}return o.__input=document.createElement("input"),o.__input.setAttribute("type","text"),S.bind(o.__input,"change",(function(){var e=parseFloat(r.__input.value);a.isNaN(e)||r.setValue(e)})),S.bind(o.__input,"blur",(function(){l()})),S.bind(o.__input,"mousedown",(function(e){S.bind(window,"mousemove",c),S.bind(window,"mouseup",d),s=e.clientY})),S.bind(o.__input,"keydown",(function(e){13===e.keyCode&&(r.__truncationSuspended=!0,this.blur(),r.__truncationSuspended=!1,l())})),o.updateDisplay(),o.domElement.appendChild(o.__input),o}return g(t,e),p(t,[{key:"updateDisplay",value:function(){var e,n,i;return this.__input.value=this.__truncationSuspended?this.getValue():(e=this.getValue(),n=this.__precision,i=Math.pow(10,n),Math.round(e*i)/i),m(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(L);function P(e,t,n,i,o){return i+(e-t)/(n-t)*(o-i)}var N=function(e){function t(e,n,i,o,r){f(this,t);var a=b(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,{min:i,max:o,step:r})),s=a;function l(e){e.preventDefault();var t=s.__background.getBoundingClientRect();return s.setValue(P(e.clientX,t.left,t.right,s.__min,s.__max)),!1}function c(){S.unbind(window,"mousemove",l),S.unbind(window,"mouseup",c),s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}function d(e){var t=e.touches[0].clientX,n=s.__background.getBoundingClientRect();s.setValue(P(t,n.left,n.right,s.__min,s.__max))}function u(){S.unbind(window,"touchmove",d),S.unbind(window,"touchend",u),s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}return a.__background=document.createElement("div"),a.__foreground=document.createElement("div"),S.bind(a.__background,"mousedown",(function(e){document.activeElement.blur(),S.bind(window,"mousemove",l),S.bind(window,"mouseup",c),l(e)})),S.bind(a.__background,"touchstart",(function(e){1===e.touches.length&&(S.bind(window,"touchmove",d),S.bind(window,"touchend",u),d(e))})),S.addClass(a.__background,"slider"),S.addClass(a.__foreground,"slider-fg"),a.updateDisplay(),a.__background.appendChild(a.__foreground),a.domElement.appendChild(a.__background),a}return g(t,e),p(t,[{key:"updateDisplay",value:function(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+"%",m(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(L),F=function(e){function t(e,n,i){f(this,t);var o=b(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),r=o;return o.__button=document.createElement("div"),o.__button.innerHTML=void 0===i?"Fire":i,S.bind(o.__button,"click",(function(e){return e.preventDefault(),r.fire(),!1})),S.addClass(o.__button,"button"),o.domElement.appendChild(o.__button),o}return g(t,e),p(t,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),t}(x),D=function(e){function t(e,n){f(this,t);var i=b(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));i.__color=new v(i.getValue()),i.__temp=new v(0);var o=i;i.domElement=document.createElement("div"),S.makeSelectable(i.domElement,!1),i.__selector=document.createElement("div"),i.__selector.className="selector",i.__saturation_field=document.createElement("div"),i.__saturation_field.className="saturation-field",i.__field_knob=document.createElement("div"),i.__field_knob.className="field-knob",i.__field_knob_border="2px solid ",i.__hue_knob=document.createElement("div"),i.__hue_knob.className="hue-knob",i.__hue_field=document.createElement("div"),i.__hue_field.className="hue-field",i.__input=document.createElement("input"),i.__input.type="text",i.__input_textShadow="0 1px 1px ",S.bind(i.__input,"keydown",(function(e){13===e.keyCode&&_.call(this)})),S.bind(i.__input,"blur",_),S.bind(i.__selector,"mousedown",(function(){S.addClass(this,"drag").bind(window,"mouseup",(function(){S.removeClass(o.__selector,"drag")}))})),S.bind(i.__selector,"touchstart",(function(){S.addClass(this,"drag").bind(window,"touchend",(function(){S.removeClass(o.__selector,"drag")}))}));var r,s=document.createElement("div");function l(e){m(e),S.bind(window,"mousemove",m),S.bind(window,"touchmove",m),S.bind(window,"mouseup",u),S.bind(window,"touchend",u)}function c(e){g(e),S.bind(window,"mousemove",g),S.bind(window,"touchmove",g),S.bind(window,"mouseup",h),S.bind(window,"touchend",h)}function u(){S.unbind(window,"mousemove",m),S.unbind(window,"touchmove",m),S.unbind(window,"mouseup",u),S.unbind(window,"touchend",u),p()}function h(){S.unbind(window,"mousemove",g),S.unbind(window,"touchmove",g),S.unbind(window,"mouseup",h),S.unbind(window,"touchend",h),p()}function _(){var e=d(this.value);!1!==e?(o.__color.__state=e,o.setValue(o.__color.toOriginal())):this.value=o.__color.toString()}function p(){o.__onFinishChange&&o.__onFinishChange.call(o,o.__color.toOriginal())}function m(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=o.__saturation_field.getBoundingClientRect(),n=e.touches&&e.touches[0]||e,i=n.clientX,r=n.clientY,a=(i-t.left)/(t.right-t.left),s=1-(r-t.top)/(t.bottom-t.top);return s>1?s=1:s<0&&(s=0),a>1?a=1:a<0&&(a=0),o.__color.v=s,o.__color.s=a,o.setValue(o.__color.toOriginal()),!1}function g(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=o.__hue_field.getBoundingClientRect(),n=1-((e.touches&&e.touches[0]||e).clientY-t.top)/(t.bottom-t.top);return n>1?n=1:n<0&&(n=0),o.__color.h=360*n,o.setValue(o.__color.toOriginal()),!1}return a.extend(i.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),a.extend(i.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:i.__field_knob_border+(i.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),a.extend(i.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),a.extend(i.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),a.extend(s.style,{width:"100%",height:"100%",background:"none"}),M(s,"top","rgba(0,0,0,0)","#000"),a.extend(i.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),(r=i.__hue_field).style.background="",r.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",r.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",r.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",r.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",r.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",a.extend(i.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:i.__input_textShadow+"rgba(0,0,0,0.7)"}),S.bind(i.__saturation_field,"mousedown",l),S.bind(i.__saturation_field,"touchstart",l),S.bind(i.__field_knob,"mousedown",l),S.bind(i.__field_knob,"touchstart",l),S.bind(i.__hue_field,"mousedown",c),S.bind(i.__hue_field,"touchstart",c),i.__saturation_field.appendChild(s),i.__selector.appendChild(i.__field_knob),i.__selector.appendChild(i.__saturation_field),i.__selector.appendChild(i.__hue_field),i.__hue_field.appendChild(i.__hue_knob),i.domElement.appendChild(i.__input),i.domElement.appendChild(i.__selector),i.updateDisplay(),i}return g(t,e),p(t,[{key:"updateDisplay",value:function(){var e=d(this.getValue());if(!1!==e){var t=!1;a.each(v.COMPONENTS,(function(n){if(!a.isUndefined(e[n])&&!a.isUndefined(this.__color.__state[n])&&e[n]!==this.__color.__state[n])return t=!0,{}}),this),t&&a.extend(this.__color.__state,e)}a.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var n=this.__color.v<.5||this.__color.s>.5?255:0,i=255-n;a.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+n+","+n+","+n+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,M(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),a.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+i+","+i+","+i+",.7)"})}}]),t}(x),z=["-moz-","-o-","-webkit-","-ms-",""];function M(e,t,n,i){e.style.background="",a.each(z,(function(o){e.style.cssText+="background: "+o+"linear-gradient("+t+", "+n+" 0%, "+i+" 100%); "}))}var H='
\n\n Here\'s the new load parameter for your GUI\'s constructor:\n\n \n\n
\n\n Automatically save\n values to localStorage on exit.\n\n
The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n\n
\n\n
\n\n
',j=function(e,t){var n=e[t];return a.isArray(arguments[2])||a.isObject(arguments[2])?new O(e,t,arguments[2]):a.isNumber(n)?a.isNumber(arguments[2])&&a.isNumber(arguments[3])?a.isNumber(arguments[4])?new N(e,t,arguments[2],arguments[3],arguments[4]):new N(e,t,arguments[2],arguments[3]):a.isNumber(arguments[4])?new R(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new R(e,t,{min:arguments[2],max:arguments[3]}):a.isString(n)?new T(e,t):a.isFunction(n)?new F(e,t,""):a.isBoolean(n)?new k(e,t):null},I=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},V=function(){function e(){f(this,e),this.backgroundElement=document.createElement("div"),a.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),S.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),a.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var t=this;S.bind(this.backgroundElement,"click",(function(){t.hide()}))}return p(e,[{key:"show",value:function(){var e=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),a.defer((function(){e.backgroundElement.style.opacity=1,e.domElement.style.opacity=1,e.domElement.style.webkitTransform="scale(1)"}))}},{key:"hide",value:function(){var e=this,t=function t(){e.domElement.style.display="none",e.backgroundElement.style.display="none",S.unbind(e.domElement,"webkitTransitionEnd",t),S.unbind(e.domElement,"transitionend",t),S.unbind(e.domElement,"oTransitionEnd",t)};S.bind(this.domElement,"webkitTransitionEnd",t),S.bind(this.domElement,"transitionend",t),S.bind(this.domElement,"oTransitionEnd",t),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function(){this.domElement.style.left=window.innerWidth/2-S.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-S.getHeight(this.domElement)/2+"px"}}]),e}();!function(e,t){var n=t||document,i=document.createElement("style");i.type="text/css",i.innerHTML=e;var o=n.getElementsByTagName("head")[0];try{o.appendChild(i)}catch(e){}}(function(e){if("undefined"!=typeof window){var t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}}(".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 .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .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 .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;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;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%;position:relative}.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:7px}.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 .cr.color{overflow:visible}.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.color{border-left:3px solid}.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;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n"));var U="Default",G=function(){try{return!!window.localStorage}catch(e){return!1}}(),X=void 0,Y=!0,W=void 0,K=!1,J=[],Z=function e(t){var n=this,i=t||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),S.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],i=a.defaults(i,{closeOnTop:!1,autoPlace:!0,width:e.DEFAULT_WIDTH}),i=a.defaults(i,{resizable:i.autoPlace,hideable:i.autoPlace}),a.isUndefined(i.load)?i.load={preset:U}:i.preset&&(i.load.preset=i.preset),a.isUndefined(i.parent)&&i.hideable&&J.push(this),i.resizable=a.isUndefined(i.parent)&&i.resizable,i.autoPlace&&a.isUndefined(i.scrollable)&&(i.scrollable=!0);var o,r=G&&"true"===localStorage.getItem(ne(0,"isLocal")),s=void 0,l=void 0;if(Object.defineProperties(this,{parent:{get:function(){return i.parent}},scrollable:{get:function(){return i.scrollable}},autoPlace:{get:function(){return i.autoPlace}},closeOnTop:{get:function(){return i.closeOnTop}},preset:{get:function(){return n.parent?n.getRoot().preset:i.load.preset},set:function(e){n.parent?n.getRoot().preset=e:i.load.preset=e,function(e){for(var t=0;t1){var i=n.__li.nextElementSibling;return n.remove(),te(e,n.object,n.property,{before:i,factoryArgs:[a.toArray(arguments)]})}if(a.isArray(t)||a.isObject(t)){var o=n.__li.nextElementSibling;return n.remove(),te(e,n.object,n.property,{before:o,factoryArgs:[t]})}},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 N){var i=new R(n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});a.each(["updateDisplay","onChange","onFinishChange","step","min","max"],(function(e){var t=n[e],o=i[e];n[e]=i[e]=function(){var e=Array.prototype.slice.call(arguments);return o.apply(i,e),t.apply(n,e)}})),S.addClass(t,"has-slider"),n.domElement.insertBefore(i.domElement,n.domElement.firstElementChild)}else if(n instanceof R){var o=function(t){if(a.isNumber(n.__min)&&a.isNumber(n.__max)){var i=n.__li.firstElementChild.firstElementChild.innerHTML,o=n.__gui.__listening.indexOf(n)>-1;n.remove();var r=te(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]});return r.name(i),o&&r.listen(),r}return t};n.min=a.compose(o,n.min),n.max=a.compose(o,n.max)}else n instanceof k?(S.bind(t,"click",(function(){S.fakeEvent(n.__checkbox,"click")})),S.bind(n.__checkbox,"click",(function(e){e.stopPropagation()}))):n instanceof F?(S.bind(t,"click",(function(){S.fakeEvent(n.__button,"click")})),S.bind(t,"mouseover",(function(){S.addClass(n.__button,"hover")})),S.bind(t,"mouseout",(function(){S.removeClass(n.__button,"hover")}))):n instanceof D&&(S.addClass(t,"color"),n.updateDisplay=a.compose((function(e){return t.style.borderLeftColor=n.__color.toString(),e}),n.updateDisplay),n.updateDisplay());n.setValue=a.compose((function(t){return e.getRoot().__preset_select&&n.isModified()&&$(e.getRoot(),!0),t}),n.setValue)}(e,c,o),e.__controllers.push(o),o}function ne(e,t){return document.location.href+"."+t}function ie(e,t,n){var i=document.createElement("option");i.innerHTML=t,i.value=t,e.__preset_select.appendChild(i),n&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function oe(e,t){t.style.display=e.useLocalStorage?"block":"none"}function re(e){var t=e.__save_row=document.createElement("li");S.addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),S.addClass(t,"save-row");var n=document.createElement("span");n.innerHTML=" ",S.addClass(n,"button gears");var i=document.createElement("span");i.innerHTML="Save",S.addClass(i,"button"),S.addClass(i,"save");var o=document.createElement("span");o.innerHTML="New",S.addClass(o,"button"),S.addClass(o,"save-as");var r=document.createElement("span");r.innerHTML="Revert",S.addClass(r,"button"),S.addClass(r,"revert");var s=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?a.each(e.load.remembered,(function(t,n){ie(e,n,n===e.preset)})):ie(e,U,!1),S.bind(s,"change",(function(){for(var t=0;t0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=le(this)),e.folders={},a.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]=le(this),$(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=le(this,!0)),this.load.remembered[e]=le(this),this.preset=e,ie(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){a.each(this.__controllers,(function(t){this.getRoot().load.remembered?ee(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())}),this),a.each(this.__folders,(function(e){e.revert(e)})),e||$(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&ce(this.__listening)},updateDisplay:function(){a.each(this.__controllers,(function(e){e.updateDisplay()})),a.each(this.__folders,(function(e){e.updateDisplay()}))}});var de=Z,ue=n(625);class he{constructor(e,t){this._initData=e,this.byteLength=void 0!==e.byteLength?e.byteLength:e,this.type=he.ArrayBuffer,this.drawType=he.StaticDraw,this.options=Object.assign({},he.defaultOptions,t),this._glBuffer=null,this._glContext=null}bind(e,t,n){return this._glBuffer||this.prepare(e),this.type===he.ArrayBuffer?(e.bindBuffer(e.ARRAY_BUFFER,this._glBuffer),n=n||this.options,e.vertexAttribPointer(t,n.itemSize,this._toGlParam(e,n.dataType),n.normalized,n.stride,n.offset)):this.type===he.ElementArrayBuffer&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this._glBuffer),this}remove(){return this._unprepare(),this}subData(e,t,n){return e.bindBuffer(this._toGlParam(e,this.type),this._glBuffer),e.bufferSubData(this._toGlParam(e,this.type),t,n),this}prepare(e){return this._glContext=e,this._glBuffer=e.createBuffer(),e.bindBuffer(this._toGlParam(e,this.type),this._glBuffer),e.bufferData(this._toGlParam(e,this.type),this._initData,this._toGlParam(e,this.drawType)),this._initData=null,this}_unprepare(){this._glBuffer&&(this._glContext.deleteBuffer(this._glBuffer),this._glBuffer=null,this._glContext=null)}_toGlParam(e,t){return t===he.ArrayBuffer?e.ARRAY_BUFFER:t===he.ElementArrayBuffer?e.ELEMENT_ARRAY_BUFFER:t===he.StaticDraw?e.STATIC_DRAW:t===he.DynamicDraw?e.DYNAMIC_DRAW:t===he.Byte?e.BYTE:t===he.Short?e.SHORT:t===he.Int?e.INT:t===he.Float?e.FLOAT:t===he.UnsignedByte?e.UNSIGNED_BYTE:t===he.UnsignedShort?e.UNSIGNED_SHORT:t===he.UnsignedInt?e.UNSIGNED_INT:null}}he.ArrayBuffer=1,he.ElementArrayBuffer=2,he.StaticDraw=10,he.DynamicDraw=11,he.Float=20,he.UnsignedByte=21,he.UnsignedShort=22,he.UnsignedInt=23,he.Byte=24,he.Short=25,he.Int=26,he.defaultOptions={itemSize:3,dataType:he.Float,stride:0,offset:0,normalized:!1};const _e=he,fe=class{constructor(e,t={}){this._buffer=e,this.options=Object.assign({},_e.defaultOptions,t)}bind(e,t){this._buffer.bind(e,t,this.options)}};class pe{constructor(e,t,n=[]){this.type="vertex"===e?pe.Vertex:pe.Fragment,this._code=Array.isArray(t)?t.join("\n"):t||"",this._code=n.map((e=>void 0!==e.value?"#define "+e.type+" "+e.value:"#define "+e.type)).join("\n")+"\n"+this._code}get(e){return this._shader||this._compile(e),this._shader}remove(e){this._shader&&e.deleteShader(this._shader)}_compile(e){const t=this.type===pe.Vertex?e.VERTEX_SHADER:e.FRAGMENT_SHADER,n=this._shader=e.createShader(t);e.shaderSource(n,this._code),e.compileShader(n)}}pe.Vertex=1,pe.Fragment=2;const me=pe;let ge="undefined"!=typeof Float64Array?Float64Array:Array;Math.random;const be=Math.PI/180;!function(){let e=new ge(3);e[0]=0,e[1]=0,e[2]=0}();var ve=Math.pow(2,32);function ye(e){return e*Math.PI/180}function we(e,t,n){return Math.max(Math.min(e,n),t)}function xe(e,t){return Math.max(t[1],1e3)*ve/(512*Math.tan(ye(60)/2)*Math.pow(2,e))}function Ee(e,t){var n=t.center,i=t.rotation,o=t.zoom,r=t.pitch,a=xe(o,t.size),s=Math.max(a*Math.sin(r),1);e[0]=n[0]+Math.sin(i)*s,e[1]=n[1]-Math.cos(i)*s,e[2]=a*Math.cos(r)}var Ae=[0,0,0];function Ce(e){var t=ve/2,n=Math.sin(ye(e[1])),i=e[0]*ve/360,o=Math.log((1+n)/(1-n))*ve/(4*Math.PI);return[we(i,-t,t),we(o,-t,t),0]}var Se,ke=1e5,Oe=(Se=15,function(){return((Se=16807*Se%2147483647)-1)/2147483646});function Te(e,t){return Math.round(e+(t-e)*Oe())}var Be=[0,0,0],Le=[0,0,0],Re=function(){function t(e,t){var n=this;this.map=e,this.options={dispersion:50,velocityX:0,velocityY:0,velocityZ:500,particleNumber:5e4,size:6,color:[255,255,255,.7],minZoom:9},this.update=function(){requestAnimationFrame(n.update);var e,t=n.gl,i=window.devicePixelRatio,o=Ce(n.map.getCenter()),r=n.map.getZoom(),a=ye(n.map.getRotation()),s=ye(n.map.getPitch()),l=n.map.getSize(),c=xe(19,n.map.getSize()),d=(e=r-19)-1*Math.floor(e/1)+19,u=Math.pow(2,r-d);(function(e,t,n){e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2]})(Le,o,n.prevCenter),function(e,t){e[0]=t[0],e[1]=t[1],e[2]=t[2]}(n.prevCenter,o),function(e,t,n){e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n}(Le,Le,u),n.snowCenter[0]=(n.snowCenter[0]+Le[0])%c,n.snowCenter[1]=(n.snowCenter[1]+Le[1])%c,t.viewport(0,0,l[0]*i,l[1]*i),t.clear(t.COLOR_BUFFER_BIT);var h=n.options.size;if(rn.options.minZoom&&n.vao&&n.options.particleNumber>0){var _={center:n.snowCenter,zoom:d,rotation:a,size:l,pitch:s};!function(e,t,n,i){var o=t.center,r=t.size;Ee(Ae,t);var a=Math.max(r[1],1e3),s={x:0,y:0,width:r[0],height:r[1]};s.y+=(a-r[1])/2,function(e,t,n,i,o,r,a,s){const l=o[0]/o[1];let c=n*Math.tan(t*be/2),d=2*c,u=l*d,h=-u/2;s&&(h+=s.x*u/o[0],c-=s.y*d/o[1],u*=s.width/o[0],d*=s.height/o[1]);const _=h+u,f=c-d,p=2*n/(_-h),m=(_+h)/(_-h),g=(c+f)/(c-f),b=2*n/(c-f),v=-(i+n)/(i-n),y=-2*i*n/(i-n);let w=0,x=0,E=a[0]-r[0],A=a[1]-r[1],C=a[2]-r[2],S=E*E+A*A+C*C;if(S>0){const e=1/Math.sqrt(S);E*=e,A*=e,C*=e}if(S=A*A+E*E,S>0){const e=1/Math.sqrt(S);w=-A*e,x=E*e}const k=-C*x,O=C*w,T=E*x-A*w,B=-(w*a[0]+x*a[1]),L=-(k*a[0]+O*a[1]+T*a[2]),R=-(E*a[0]+A*a[1]+C*a[2]);e[0]=p*w+m*E,e[1]=b*k+g*E,e[2]=v*E,e[3]=-E,e[4]=p*x+m*A,e[5]=b*O+g*A,e[6]=v*A,e[7]=-A,e[8]=m*C,e[9]=b*T+g*C,e[10]=v*C,e[11]=-C,e[12]=p*B+m*R,e[13]=b*L+g*R,e[14]=v*R+y,e[15]=-R}(e,60,10,5e4,[r[0],a],o,Ae,s)}(n.projectionMatrix,_),Ee(Be,_);var f=n.options.color,p=f[0],m=f[1],g=f[2],b=f[3],v=Date.now();n.program.enable(t),n.program.bind(t,{u_size:c,u_flake_size:h*i,u_color:[p/255,m/255,g/255,b],u_eye:Be,u_projectionMatrix:n.projectionMatrix,u_time:(v-n.changeSnowTime)/1e3,u_start_time:(v-n.startTime)/1e3,u_common_velocity:[n.options.velocityX,n.options.velocityY,-n.options.velocityZ],u_local_center:n.snowLocalCenter}),n.vao.bind({gl:t,extensions:n.ext}),t.drawArrays(t.POINTS,0,Math.min(n.options.particleNumber,ke))}},this.canvas=document.createElement("canvas"),this.canvas.style.position="absolute",this.canvas.style.left="0",this.canvas.style.top="0",this.canvas.style.pointerEvents="none",e._impl.getContainer().appendChild(this.canvas);var i=e.getSize();this.setSize(i[0],i[1]),e.on("resize",(function(){var t=e.getSize();n.setSize(t[0],t[1])}));var o=this.gl=this.canvas.getContext("webgl",{antialias:!1,premultipliedAlpha:!1,alpha:!0});this.ext={OES_vertex_array_object:o.getExtension("OES_vertex_array_object")},o.clearColor(1,1,1,0),o.enable(o.CULL_FACE),o.disable(o.DEPTH_TEST),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA),this.projectionMatrix=new Float32Array(function(){let e=new ge(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}());var r=Ce(e.getCenter());this.prevCenter=r.slice(),this.snowCenter=r.slice(),this.snowLocalCenter=[0,0,0],this.program=new class{constructor(e){e=e||{},this._vertexShader=e.vertex,this._fragmentShader=e.fragment,this.uniforms={},e.uniforms=e.uniforms||[],e.uniforms.forEach((e=>{this.uniforms[e.name]=new class{constructor(e){this.name=e.name,this.type=e.type,this.location=-1}getLocation(e,t){return this.location=e.getUniformLocation(t,this.name),this}bind(e,t){const n=this.type;return"mat2"===n?e.uniformMatrix2fv(this.location,!1,t):"mat3"===n?e.uniformMatrix3fv(this.location,!1,t):"mat4"===n?e.uniformMatrix4fv(this.location,!1,t):"2f"===n?e.uniform2f(this.location,t[0],t[1]):"3f"===n?e.uniform3f(this.location,t[0],t[1],t[2]):"4f"===n?e.uniform4f(this.location,t[0],t[1],t[2],t[3]):"2i"===n?e.uniform2i(this.location,t[0],t[1]):"3i"===n?e.uniform3i(this.location,t[0],t[1],t[2]):"4i"===n?e.uniform4i(this.location,t[0],t[1],t[2],t[3]):e["uniform"+n](this.location,t),this}}(e)})),this.attributes={},e.attributes=e.attributes||[],e.attributes.forEach((e=>{this.attributes[e.name]=new class{constructor(e){this.name=e.name,this.index=e.index,this.location=void 0!==e.location?e.location:-1,this._enable=!1}bindLocation(e,t){return-1!==this.location&&!0!==this.index&&e.bindAttribLocation(t,this.location,this.name),this}getLocation(e,t){return-1===this.location&&!0!==this.index&&(this.location=e.getAttribLocation(t,this.name)),this}bind(e,t){return this._enable||!0===this.index||(e.enableVertexAttribArray(this.location),this._enable=!0),t.bind(e,this.location),this}disable(e){return this._enable&&!0!==this.index&&(e.disableVertexAttribArray(this.location),this._enable=!1),this}}(e)})),this._linked=!1,this._located=!1}enable(e){return this.link(e),this.locate(e),e.useProgram(this._webglProgram),this}bind(e,t,n){if(t)for(const n in t)this.uniforms[n].bind(e,t[n]);if(n)for(const t in n)this.attributes[t].bind(e,n[t]);return this}disable(e){for(const t in this.attributes)this.attributes[t].disable(e);return this}link(e){if(this._linked)return this;this._webglProgram=e.createProgram(),this._vertexShader&&e.attachShader(this._webglProgram,this._vertexShader.get(e)),this._fragmentShader&&e.attachShader(this._webglProgram,this._fragmentShader.get(e));for(const t in this.attributes)this.attributes[t].bindLocation(e,this._webglProgram);return e.linkProgram(this._webglProgram),this._linked=!0,this}locate(e){if(this._located)return this;for(const t in this.attributes)this.attributes[t].getLocation(e,this._webglProgram);for(const t in this.uniforms)this.uniforms[t].getLocation(e,this._webglProgram);return this._located=!0,this}}({vertex:new me("vertex","\n attribute vec3 a_position;\n attribute vec3 a_velocity;\n\n uniform mat4 u_projectionMatrix;\n uniform float u_time;\n uniform float u_start_time;\n uniform float u_size;\n uniform float u_flake_size;\n uniform vec3 u_eye;\n uniform vec3 u_common_velocity;\n uniform vec3 u_local_center;\n\n void main() {\n // Sinusoidal offset of a snowflake in time.\n // a_velocity.x is just a random component in the sinus calculating,\n // it allows to move flakes with diffrent offset in period.\n vec3 shift = sin(u_start_time + a_velocity.x) * a_velocity;\n\n vec3 pos = u_local_center + a_position + u_common_velocity * u_time + shift;\n\n vec3 min = u_eye - u_size / 2.0;\n vec3 position = min + mod(pos - min, u_size);\n\n gl_Position = u_projectionMatrix * vec4(position, 1.0);\n\n float scale = u_size / max(length(position - u_eye), 0.001);\n gl_PointSize = u_flake_size * scale / 5.0;\n }\n"),fragment:new me("fragment","\n precision mediump float;\n uniform vec4 u_color;\n\n void main() {\n float dist = distance(gl_PointCoord, vec2(0.5));\n float alpha = 1.0 - smoothstep(0.25, 0.5, dist);\n gl_FragColor = vec4(u_color.rgb, u_color.a * alpha);\n }\n"),attributes:[{name:"a_position",location:0},{name:"a_velocity",location:1}],uniforms:[{name:"u_projectionMatrix",type:"mat4"},{name:"u_time",type:"1f"},{name:"u_size",type:"1f"},{name:"u_eye",type:"3fv"},{name:"u_flake_size",type:"1f"},{name:"u_color",type:"4fv"},{name:"u_common_velocity",type:"3fv"},{name:"u_local_center",type:"3fv"},{name:"u_start_time",type:"1f"}]}),this.changeSnowTime=this.startTime=Date.now(),this.beforeInitedOptions={},t&&t.skipWaitingForMapIdle?(this.mapInited=!0,this.setOptions(this.beforeInitedOptions)):(this.mapInited=!1,e.once("idle",(function(){n.mapInited=!0,n.setOptions(n.beforeInitedOptions)}))),requestAnimationFrame(this.update)}return t.prototype.setOptions=function(t){if(this.mapInited){var n=t.dispersion!==this.options.dispersion,i=Date.now(),o=(i-this.changeSnowTime)/1e3;this.changeSnowTime=i,this.snowLocalCenter[0]+=this.options.velocityX*o,this.snowLocalCenter[1]+=this.options.velocityY*o,this.snowLocalCenter[2]-=this.options.velocityZ*o,this.options=e(e({},this.options),t),n&&this.initBuffer()}else this.beforeInitedOptions=t},t.prototype.setSize=function(e,t){var n=window.devicePixelRatio;this.canvas.width=e*n,this.canvas.height=t*n,this.canvas.style.width=e+"px",this.canvas.style.height=t+"px"},t.prototype.initBuffer=function(){this.vao&&this.vao.remove(),this.buffer&&this.buffer.remove();for(var e={array:new Float32Array(6e5),index:0},t=0;t{"use strict";var e={625:(e,t)=>{var n;t.z=function(e){if(void 0===e&&(e="https://mapgl.2gis.com/api/js"),"undefined"==typeof window)throw new Error("mapgl is supported only in browser environment");return n?Promise.resolve(n):function(e){return new Promise((function(t,n){var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.crossOrigin="anonymous",i.src=e,document.body.appendChild(i),i.addEventListener("load",(function(){t()})),i.addEventListener("error",(function(e){n(e)}))}))}(e).then((function(){return n=window.mapgl}))}}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={exports:{}};return e[i](r,r.exports,n),r.exports}(()=>{var e=function(){return(e=Object.assign||function(e){for(var t,n=1,i=arguments.length;n=0;n--)t=[e[n].apply(this,t)];return t[0]}},each:function(e,t,n){if(e)if(o&&e.forEach&&e.forEach===o)e.forEach(t,n);else if(e.length===e.length+0){var i,r=void 0;for(r=0,i=e.length;r1?a.toArray(arguments):arguments[0];return a.each(s,(function(t){if(t.litmus(e))return a.each(t.conversions,(function(t,n){if(l=t.read(e),!1===c&&!1!==l)return c=l,l.conversionName=n,l.conversion=t,a.BREAK})),a.BREAK})),c},u=void 0,h={hsv_to_rgb:function(e,t,n){var i=Math.floor(e/60)%6,o=e/60-Math.floor(e/60),r=n*(1-t),a=n*(1-o*t),s=n*(1-(1-o)*t),l=[[n,s,r],[a,n,r],[r,n,s],[r,a,n],[s,r,n],[n,r,a]][i];return{r:255*l[0],g:255*l[1],b:255*l[2]}},rgb_to_hsv:function(e,t,n){var i=Math.min(e,t,n),o=Math.max(e,t,n),r=o-i,a=void 0;return 0===o?{h:NaN,s:0,v:0}:(a=e===o?(t-n)/r:t===o?2+(n-e)/r:4+(e-t)/r,(a/=6)<0&&(a+=1),{h:360*a,s:r/o,v:o/255})},rgb_to_hex:function(e,t,n){var i=this.hex_with_component(0,2,e);return i=this.hex_with_component(i,1,t),this.hex_with_component(i,0,n)},component_from_hex:function(e,t){return e>>8*t&255},hex_with_component:function(e,t,n){return n<<(u=8*t)|e&~(255<-1?t.length-t.indexOf(".")-1:0}var L=function(e){function t(e,n,i){f(this,t);var o=b(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),r=i||{};return o.__min=r.min,o.__max=r.max,o.__step=r.step,a.isUndefined(o.__step)?0===o.initialValue?o.__impliedStep=1:o.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(o.initialValue))/Math.LN10))/10:o.__impliedStep=o.__step,o.__precision=B(o.__impliedStep),o}return g(t,e),p(t,[{key:"setValue",value:function(e){var n=e;return void 0!==this.__min&&nthis.__max&&(n=this.__max),void 0!==this.__step&&n%this.__step!=0&&(n=Math.round(n/this.__step)*this.__step),m(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,n)}},{key:"min",value:function(e){return this.__min=e,this}},{key:"max",value:function(e){return this.__max=e,this}},{key:"step",value:function(e){return this.__step=e,this.__impliedStep=e,this.__precision=B(e),this}}]),t}(x),R=function(e){function t(e,n,i){f(this,t);var o=b(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,i));o.__truncationSuspended=!1;var r=o,s=void 0;function l(){r.__onFinishChange&&r.__onFinishChange.call(r,r.getValue())}function c(e){var t=s-e.clientY;r.setValue(r.getValue()+t*r.__impliedStep),s=e.clientY}function d(){S.unbind(window,"mousemove",c),S.unbind(window,"mouseup",d),l()}return o.__input=document.createElement("input"),o.__input.setAttribute("type","text"),S.bind(o.__input,"change",(function(){var e=parseFloat(r.__input.value);a.isNaN(e)||r.setValue(e)})),S.bind(o.__input,"blur",(function(){l()})),S.bind(o.__input,"mousedown",(function(e){S.bind(window,"mousemove",c),S.bind(window,"mouseup",d),s=e.clientY})),S.bind(o.__input,"keydown",(function(e){13===e.keyCode&&(r.__truncationSuspended=!0,this.blur(),r.__truncationSuspended=!1,l())})),o.updateDisplay(),o.domElement.appendChild(o.__input),o}return g(t,e),p(t,[{key:"updateDisplay",value:function(){var e,n,i;return this.__input.value=this.__truncationSuspended?this.getValue():(e=this.getValue(),n=this.__precision,i=Math.pow(10,n),Math.round(e*i)/i),m(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(L);function P(e,t,n,i,o){return i+(e-t)/(n-t)*(o-i)}var N=function(e){function t(e,n,i,o,r){f(this,t);var a=b(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,{min:i,max:o,step:r})),s=a;function l(e){e.preventDefault();var t=s.__background.getBoundingClientRect();return s.setValue(P(e.clientX,t.left,t.right,s.__min,s.__max)),!1}function c(){S.unbind(window,"mousemove",l),S.unbind(window,"mouseup",c),s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}function d(e){var t=e.touches[0].clientX,n=s.__background.getBoundingClientRect();s.setValue(P(t,n.left,n.right,s.__min,s.__max))}function u(){S.unbind(window,"touchmove",d),S.unbind(window,"touchend",u),s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}return a.__background=document.createElement("div"),a.__foreground=document.createElement("div"),S.bind(a.__background,"mousedown",(function(e){document.activeElement.blur(),S.bind(window,"mousemove",l),S.bind(window,"mouseup",c),l(e)})),S.bind(a.__background,"touchstart",(function(e){1===e.touches.length&&(S.bind(window,"touchmove",d),S.bind(window,"touchend",u),d(e))})),S.addClass(a.__background,"slider"),S.addClass(a.__foreground,"slider-fg"),a.updateDisplay(),a.__background.appendChild(a.__foreground),a.domElement.appendChild(a.__background),a}return g(t,e),p(t,[{key:"updateDisplay",value:function(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+"%",m(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(L),F=function(e){function t(e,n,i){f(this,t);var o=b(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),r=o;return o.__button=document.createElement("div"),o.__button.innerHTML=void 0===i?"Fire":i,S.bind(o.__button,"click",(function(e){return e.preventDefault(),r.fire(),!1})),S.addClass(o.__button,"button"),o.domElement.appendChild(o.__button),o}return g(t,e),p(t,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),t}(x),D=function(e){function t(e,n){f(this,t);var i=b(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));i.__color=new v(i.getValue()),i.__temp=new v(0);var o=i;i.domElement=document.createElement("div"),S.makeSelectable(i.domElement,!1),i.__selector=document.createElement("div"),i.__selector.className="selector",i.__saturation_field=document.createElement("div"),i.__saturation_field.className="saturation-field",i.__field_knob=document.createElement("div"),i.__field_knob.className="field-knob",i.__field_knob_border="2px solid ",i.__hue_knob=document.createElement("div"),i.__hue_knob.className="hue-knob",i.__hue_field=document.createElement("div"),i.__hue_field.className="hue-field",i.__input=document.createElement("input"),i.__input.type="text",i.__input_textShadow="0 1px 1px ",S.bind(i.__input,"keydown",(function(e){13===e.keyCode&&_.call(this)})),S.bind(i.__input,"blur",_),S.bind(i.__selector,"mousedown",(function(){S.addClass(this,"drag").bind(window,"mouseup",(function(){S.removeClass(o.__selector,"drag")}))})),S.bind(i.__selector,"touchstart",(function(){S.addClass(this,"drag").bind(window,"touchend",(function(){S.removeClass(o.__selector,"drag")}))}));var r,s=document.createElement("div");function l(e){m(e),S.bind(window,"mousemove",m),S.bind(window,"touchmove",m),S.bind(window,"mouseup",u),S.bind(window,"touchend",u)}function c(e){g(e),S.bind(window,"mousemove",g),S.bind(window,"touchmove",g),S.bind(window,"mouseup",h),S.bind(window,"touchend",h)}function u(){S.unbind(window,"mousemove",m),S.unbind(window,"touchmove",m),S.unbind(window,"mouseup",u),S.unbind(window,"touchend",u),p()}function h(){S.unbind(window,"mousemove",g),S.unbind(window,"touchmove",g),S.unbind(window,"mouseup",h),S.unbind(window,"touchend",h),p()}function _(){var e=d(this.value);!1!==e?(o.__color.__state=e,o.setValue(o.__color.toOriginal())):this.value=o.__color.toString()}function p(){o.__onFinishChange&&o.__onFinishChange.call(o,o.__color.toOriginal())}function m(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=o.__saturation_field.getBoundingClientRect(),n=e.touches&&e.touches[0]||e,i=n.clientX,r=n.clientY,a=(i-t.left)/(t.right-t.left),s=1-(r-t.top)/(t.bottom-t.top);return s>1?s=1:s<0&&(s=0),a>1?a=1:a<0&&(a=0),o.__color.v=s,o.__color.s=a,o.setValue(o.__color.toOriginal()),!1}function g(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=o.__hue_field.getBoundingClientRect(),n=1-((e.touches&&e.touches[0]||e).clientY-t.top)/(t.bottom-t.top);return n>1?n=1:n<0&&(n=0),o.__color.h=360*n,o.setValue(o.__color.toOriginal()),!1}return a.extend(i.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),a.extend(i.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:i.__field_knob_border+(i.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),a.extend(i.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),a.extend(i.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),a.extend(s.style,{width:"100%",height:"100%",background:"none"}),M(s,"top","rgba(0,0,0,0)","#000"),a.extend(i.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),(r=i.__hue_field).style.background="",r.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",r.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",r.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",r.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",r.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",a.extend(i.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:i.__input_textShadow+"rgba(0,0,0,0.7)"}),S.bind(i.__saturation_field,"mousedown",l),S.bind(i.__saturation_field,"touchstart",l),S.bind(i.__field_knob,"mousedown",l),S.bind(i.__field_knob,"touchstart",l),S.bind(i.__hue_field,"mousedown",c),S.bind(i.__hue_field,"touchstart",c),i.__saturation_field.appendChild(s),i.__selector.appendChild(i.__field_knob),i.__selector.appendChild(i.__saturation_field),i.__selector.appendChild(i.__hue_field),i.__hue_field.appendChild(i.__hue_knob),i.domElement.appendChild(i.__input),i.domElement.appendChild(i.__selector),i.updateDisplay(),i}return g(t,e),p(t,[{key:"updateDisplay",value:function(){var e=d(this.getValue());if(!1!==e){var t=!1;a.each(v.COMPONENTS,(function(n){if(!a.isUndefined(e[n])&&!a.isUndefined(this.__color.__state[n])&&e[n]!==this.__color.__state[n])return t=!0,{}}),this),t&&a.extend(this.__color.__state,e)}a.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var n=this.__color.v<.5||this.__color.s>.5?255:0,i=255-n;a.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+n+","+n+","+n+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,M(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),a.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+i+","+i+","+i+",.7)"})}}]),t}(x),z=["-moz-","-o-","-webkit-","-ms-",""];function M(e,t,n,i){e.style.background="",a.each(z,(function(o){e.style.cssText+="background: "+o+"linear-gradient("+t+", "+n+" 0%, "+i+" 100%); "}))}var H='
\n\n Here\'s the new load parameter for your GUI\'s constructor:\n\n \n\n
\n\n Automatically save\n values to localStorage on exit.\n\n
The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n\n
\n\n
\n\n
',j=function(e,t){var n=e[t];return a.isArray(arguments[2])||a.isObject(arguments[2])?new O(e,t,arguments[2]):a.isNumber(n)?a.isNumber(arguments[2])&&a.isNumber(arguments[3])?a.isNumber(arguments[4])?new N(e,t,arguments[2],arguments[3],arguments[4]):new N(e,t,arguments[2],arguments[3]):a.isNumber(arguments[4])?new R(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new R(e,t,{min:arguments[2],max:arguments[3]}):a.isString(n)?new T(e,t):a.isFunction(n)?new F(e,t,""):a.isBoolean(n)?new k(e,t):null},I=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},V=function(){function e(){f(this,e),this.backgroundElement=document.createElement("div"),a.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),S.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),a.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var t=this;S.bind(this.backgroundElement,"click",(function(){t.hide()}))}return p(e,[{key:"show",value:function(){var e=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),a.defer((function(){e.backgroundElement.style.opacity=1,e.domElement.style.opacity=1,e.domElement.style.webkitTransform="scale(1)"}))}},{key:"hide",value:function(){var e=this,t=function t(){e.domElement.style.display="none",e.backgroundElement.style.display="none",S.unbind(e.domElement,"webkitTransitionEnd",t),S.unbind(e.domElement,"transitionend",t),S.unbind(e.domElement,"oTransitionEnd",t)};S.bind(this.domElement,"webkitTransitionEnd",t),S.bind(this.domElement,"transitionend",t),S.bind(this.domElement,"oTransitionEnd",t),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function(){this.domElement.style.left=window.innerWidth/2-S.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-S.getHeight(this.domElement)/2+"px"}}]),e}();!function(e,t){var n=t||document,i=document.createElement("style");i.type="text/css",i.innerHTML=e;var o=n.getElementsByTagName("head")[0];try{o.appendChild(i)}catch(e){}}(function(e){if("undefined"!=typeof window){var t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}}(".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 .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .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 .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;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;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%;position:relative}.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:7px}.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 .cr.color{overflow:visible}.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.color{border-left:3px solid}.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;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n"));var U="Default",G=function(){try{return!!window.localStorage}catch(e){return!1}}(),X=void 0,Y=!0,W=void 0,K=!1,J=[],Z=function e(t){var n=this,i=t||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),S.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],i=a.defaults(i,{closeOnTop:!1,autoPlace:!0,width:e.DEFAULT_WIDTH}),i=a.defaults(i,{resizable:i.autoPlace,hideable:i.autoPlace}),a.isUndefined(i.load)?i.load={preset:U}:i.preset&&(i.load.preset=i.preset),a.isUndefined(i.parent)&&i.hideable&&J.push(this),i.resizable=a.isUndefined(i.parent)&&i.resizable,i.autoPlace&&a.isUndefined(i.scrollable)&&(i.scrollable=!0);var o,r=G&&"true"===localStorage.getItem(ne(0,"isLocal")),s=void 0,l=void 0;if(Object.defineProperties(this,{parent:{get:function(){return i.parent}},scrollable:{get:function(){return i.scrollable}},autoPlace:{get:function(){return i.autoPlace}},closeOnTop:{get:function(){return i.closeOnTop}},preset:{get:function(){return n.parent?n.getRoot().preset:i.load.preset},set:function(e){n.parent?n.getRoot().preset=e:i.load.preset=e,function(e){for(var t=0;t1){var i=n.__li.nextElementSibling;return n.remove(),te(e,n.object,n.property,{before:i,factoryArgs:[a.toArray(arguments)]})}if(a.isArray(t)||a.isObject(t)){var o=n.__li.nextElementSibling;return n.remove(),te(e,n.object,n.property,{before:o,factoryArgs:[t]})}},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 N){var i=new R(n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});a.each(["updateDisplay","onChange","onFinishChange","step","min","max"],(function(e){var t=n[e],o=i[e];n[e]=i[e]=function(){var e=Array.prototype.slice.call(arguments);return o.apply(i,e),t.apply(n,e)}})),S.addClass(t,"has-slider"),n.domElement.insertBefore(i.domElement,n.domElement.firstElementChild)}else if(n instanceof R){var o=function(t){if(a.isNumber(n.__min)&&a.isNumber(n.__max)){var i=n.__li.firstElementChild.firstElementChild.innerHTML,o=n.__gui.__listening.indexOf(n)>-1;n.remove();var r=te(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]});return r.name(i),o&&r.listen(),r}return t};n.min=a.compose(o,n.min),n.max=a.compose(o,n.max)}else n instanceof k?(S.bind(t,"click",(function(){S.fakeEvent(n.__checkbox,"click")})),S.bind(n.__checkbox,"click",(function(e){e.stopPropagation()}))):n instanceof F?(S.bind(t,"click",(function(){S.fakeEvent(n.__button,"click")})),S.bind(t,"mouseover",(function(){S.addClass(n.__button,"hover")})),S.bind(t,"mouseout",(function(){S.removeClass(n.__button,"hover")}))):n instanceof D&&(S.addClass(t,"color"),n.updateDisplay=a.compose((function(e){return t.style.borderLeftColor=n.__color.toString(),e}),n.updateDisplay),n.updateDisplay());n.setValue=a.compose((function(t){return e.getRoot().__preset_select&&n.isModified()&&$(e.getRoot(),!0),t}),n.setValue)}(e,c,o),e.__controllers.push(o),o}function ne(e,t){return document.location.href+"."+t}function ie(e,t,n){var i=document.createElement("option");i.innerHTML=t,i.value=t,e.__preset_select.appendChild(i),n&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function oe(e,t){t.style.display=e.useLocalStorage?"block":"none"}function re(e){var t=e.__save_row=document.createElement("li");S.addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),S.addClass(t,"save-row");var n=document.createElement("span");n.innerHTML=" ",S.addClass(n,"button gears");var i=document.createElement("span");i.innerHTML="Save",S.addClass(i,"button"),S.addClass(i,"save");var o=document.createElement("span");o.innerHTML="New",S.addClass(o,"button"),S.addClass(o,"save-as");var r=document.createElement("span");r.innerHTML="Revert",S.addClass(r,"button"),S.addClass(r,"revert");var s=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?a.each(e.load.remembered,(function(t,n){ie(e,n,n===e.preset)})):ie(e,U,!1),S.bind(s,"change",(function(){for(var t=0;t0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=le(this)),e.folders={},a.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]=le(this),$(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=le(this,!0)),this.load.remembered[e]=le(this),this.preset=e,ie(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){a.each(this.__controllers,(function(t){this.getRoot().load.remembered?ee(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())}),this),a.each(this.__folders,(function(e){e.revert(e)})),e||$(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&ce(this.__listening)},updateDisplay:function(){a.each(this.__controllers,(function(e){e.updateDisplay()})),a.each(this.__folders,(function(e){e.updateDisplay()}))}});var de=Z,ue=n(625);class he{constructor(e,t){this._initData=e,this.byteLength=void 0!==e.byteLength?e.byteLength:e,this.type=he.ArrayBuffer,this.drawType=he.StaticDraw,this.options=Object.assign({},he.defaultOptions,t),this._glBuffer=null,this._glContext=null}bind(e,t,n){return this._glBuffer||this.prepare(e),this.type===he.ArrayBuffer?(e.bindBuffer(e.ARRAY_BUFFER,this._glBuffer),n=n||this.options,e.vertexAttribPointer(t,n.itemSize,this._toGlParam(e,n.dataType),n.normalized,n.stride,n.offset)):this.type===he.ElementArrayBuffer&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this._glBuffer),this}remove(){return this._unprepare(),this}subData(e,t,n){return e.bindBuffer(this._toGlParam(e,this.type),this._glBuffer),e.bufferSubData(this._toGlParam(e,this.type),t,n),this}prepare(e){return this._glContext=e,this._glBuffer=e.createBuffer(),e.bindBuffer(this._toGlParam(e,this.type),this._glBuffer),e.bufferData(this._toGlParam(e,this.type),this._initData,this._toGlParam(e,this.drawType)),this._initData=null,this}_unprepare(){this._glBuffer&&(this._glContext.deleteBuffer(this._glBuffer),this._glBuffer=null,this._glContext=null)}_toGlParam(e,t){return t===he.ArrayBuffer?e.ARRAY_BUFFER:t===he.ElementArrayBuffer?e.ELEMENT_ARRAY_BUFFER:t===he.StaticDraw?e.STATIC_DRAW:t===he.DynamicDraw?e.DYNAMIC_DRAW:t===he.Byte?e.BYTE:t===he.Short?e.SHORT:t===he.Int?e.INT:t===he.Float?e.FLOAT:t===he.UnsignedByte?e.UNSIGNED_BYTE:t===he.UnsignedShort?e.UNSIGNED_SHORT:t===he.UnsignedInt?e.UNSIGNED_INT:null}}he.ArrayBuffer=1,he.ElementArrayBuffer=2,he.StaticDraw=10,he.DynamicDraw=11,he.Float=20,he.UnsignedByte=21,he.UnsignedShort=22,he.UnsignedInt=23,he.Byte=24,he.Short=25,he.Int=26,he.defaultOptions={itemSize:3,dataType:he.Float,stride:0,offset:0,normalized:!1};const _e=he,fe=class{constructor(e,t={}){this._buffer=e,this.options=Object.assign({},_e.defaultOptions,t)}bind(e,t){this._buffer.bind(e,t,this.options)}};class pe{constructor(e,t,n=[]){this.type="vertex"===e?pe.Vertex:pe.Fragment,this._code=Array.isArray(t)?t.join("\n"):t||"",this._code=n.map((e=>void 0!==e.value?"#define "+e.type+" "+e.value:"#define "+e.type)).join("\n")+"\n"+this._code}get(e){return this._shader||this._compile(e),this._shader}remove(e){this._shader&&e.deleteShader(this._shader)}_compile(e){const t=this.type===pe.Vertex?e.VERTEX_SHADER:e.FRAGMENT_SHADER,n=this._shader=e.createShader(t);e.shaderSource(n,this._code),e.compileShader(n)}}pe.Vertex=1,pe.Fragment=2;const me=pe;let ge="undefined"!=typeof Float64Array?Float64Array:Array;Math.random;const be=Math.PI/180;!function(){let e=new ge(3);e[0]=0,e[1]=0,e[2]=0}();var ve=Math.pow(2,32);function ye(e){return e*Math.PI/180}function we(e,t,n){return Math.max(Math.min(e,n),t)}function xe(e,t){return Math.max(t[1],1e3)*ve/(512*Math.tan(ye(60)/2)*Math.pow(2,e))}function Ee(e,t){var n=t.center,i=t.rotation,o=t.zoom,r=t.pitch,a=xe(o,t.size),s=Math.max(a*Math.sin(r),1);e[0]=n[0]+Math.sin(i)*s,e[1]=n[1]-Math.cos(i)*s,e[2]=a*Math.cos(r)}var Ae=[0,0,0];function Ce(e){var t=ve/2,n=Math.sin(ye(e[1])),i=e[0]*ve/360,o=Math.log((1+n)/(1-n))*ve/(4*Math.PI);return[we(i,-t,t),we(o,-t,t),0]}var Se,ke=1e5,Oe=(Se=15,function(){return((Se=16807*Se%2147483647)-1)/2147483646});function Te(e,t){return Math.round(e+(t-e)*Oe())}var Be=[0,0,0],Le=[0,0,0],Re=function(){function t(e,t){var n=this;this.map=e,this.options={dispersion:50,velocityX:0,velocityY:0,velocityZ:500,particleNumber:5e4,size:6,color:[255,255,255,.7],minZoom:9},this.update=function(){requestAnimationFrame(n.update);var e,t=n.gl,i=window.devicePixelRatio,o=Ce(n.map.getCenter()),r=n.map.getZoom(),a=ye(n.map.getRotation()),s=ye(n.map.getPitch()),l=n.map.getSize(),c=xe(19,n.map.getSize()),d=(e=r-19)-1*Math.floor(e/1)+19,u=Math.pow(2,r-d);(function(e,t,n){e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2]})(Le,o,n.prevCenter),function(e,t){e[0]=t[0],e[1]=t[1],e[2]=t[2]}(n.prevCenter,o),function(e,t,n){e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n}(Le,Le,u),n.snowCenter[0]=(n.snowCenter[0]+Le[0])%c,n.snowCenter[1]=(n.snowCenter[1]+Le[1])%c,t.viewport(0,0,l[0]*i,l[1]*i),t.clear(t.COLOR_BUFFER_BIT);var h=n.options.size;if(rn.options.minZoom&&n.vao&&n.options.particleNumber>0){var _={center:n.snowCenter,zoom:d,rotation:a,size:l,pitch:s};!function(e,t,n,i){var o=t.center,r=t.size;Ee(Ae,t);var a=Math.max(r[1],1e3),s={x:0,y:0,width:r[0],height:r[1]};s.y+=(a-r[1])/2,function(e,t,n,i,o,r,a,s){const l=o[0]/o[1];let c=n*Math.tan(t*be/2),d=2*c,u=l*d,h=-u/2;s&&(h+=s.x*u/o[0],c-=s.y*d/o[1],u*=s.width/o[0],d*=s.height/o[1]);const _=h+u,f=c-d,p=2*n/(_-h),m=(_+h)/(_-h),g=(c+f)/(c-f),b=2*n/(c-f),v=-(i+n)/(i-n),y=-2*i*n/(i-n);let w=0,x=0,E=a[0]-r[0],A=a[1]-r[1],C=a[2]-r[2],S=E*E+A*A+C*C;if(S>0){const e=1/Math.sqrt(S);E*=e,A*=e,C*=e}if(S=A*A+E*E,S>0){const e=1/Math.sqrt(S);w=-A*e,x=E*e}const k=-C*x,O=C*w,T=E*x-A*w,B=-(w*a[0]+x*a[1]),L=-(k*a[0]+O*a[1]+T*a[2]),R=-(E*a[0]+A*a[1]+C*a[2]);e[0]=p*w+m*E,e[1]=b*k+g*E,e[2]=v*E,e[3]=-E,e[4]=p*x+m*A,e[5]=b*O+g*A,e[6]=v*A,e[7]=-A,e[8]=m*C,e[9]=b*T+g*C,e[10]=v*C,e[11]=-C,e[12]=p*B+m*R,e[13]=b*L+g*R,e[14]=v*R+y,e[15]=-R}(e,60,10,5e4,[r[0],a],o,Ae,s)}(n.projectionMatrix,_),Ee(Be,_);var f=n.options.color,p=f[0],m=f[1],g=f[2],b=f[3],v=Date.now();n.program.enable(t),n.program.bind(t,{u_size:c,u_flake_size:h*i,u_color:[p/255,m/255,g/255,b],u_eye:Be,u_projectionMatrix:n.projectionMatrix,u_time:(v-n.changeSnowTime)/1e3,u_start_time:(v-n.startTime)/1e3,u_common_velocity:[n.options.velocityX,n.options.velocityY,-n.options.velocityZ],u_local_center:n.snowLocalCenter}),n.vao.bind({gl:t,extensions:n.ext}),t.drawArrays(t.POINTS,0,Math.min(n.options.particleNumber,ke))}},this.canvas=document.createElement("canvas"),this.canvas.style.position="absolute",this.canvas.style.left="0",this.canvas.style.top="0",this.canvas.style.pointerEvents="none",e._impl.getContainer().appendChild(this.canvas);var i=e.getSize();this.setSize(i[0],i[1]),e.on("resize",(function(){var t=e.getSize();n.setSize(t[0],t[1])}));var o=this.gl=this.canvas.getContext("webgl",{antialias:!1,premultipliedAlpha:!0,alpha:!0});this.ext={OES_vertex_array_object:o.getExtension("OES_vertex_array_object")},o.enable(o.CULL_FACE),o.disable(o.DEPTH_TEST),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA),this.projectionMatrix=new Float32Array(function(){let e=new ge(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}());var r=Ce(e.getCenter());this.prevCenter=r.slice(),this.snowCenter=r.slice(),this.snowLocalCenter=[0,0,0],this.program=new class{constructor(e){e=e||{},this._vertexShader=e.vertex,this._fragmentShader=e.fragment,this.uniforms={},e.uniforms=e.uniforms||[],e.uniforms.forEach((e=>{this.uniforms[e.name]=new class{constructor(e){this.name=e.name,this.type=e.type,this.location=-1}getLocation(e,t){return this.location=e.getUniformLocation(t,this.name),this}bind(e,t){const n=this.type;return"mat2"===n?e.uniformMatrix2fv(this.location,!1,t):"mat3"===n?e.uniformMatrix3fv(this.location,!1,t):"mat4"===n?e.uniformMatrix4fv(this.location,!1,t):"2f"===n?e.uniform2f(this.location,t[0],t[1]):"3f"===n?e.uniform3f(this.location,t[0],t[1],t[2]):"4f"===n?e.uniform4f(this.location,t[0],t[1],t[2],t[3]):"2i"===n?e.uniform2i(this.location,t[0],t[1]):"3i"===n?e.uniform3i(this.location,t[0],t[1],t[2]):"4i"===n?e.uniform4i(this.location,t[0],t[1],t[2],t[3]):e["uniform"+n](this.location,t),this}}(e)})),this.attributes={},e.attributes=e.attributes||[],e.attributes.forEach((e=>{this.attributes[e.name]=new class{constructor(e){this.name=e.name,this.index=e.index,this.location=void 0!==e.location?e.location:-1,this._enable=!1}bindLocation(e,t){return-1!==this.location&&!0!==this.index&&e.bindAttribLocation(t,this.location,this.name),this}getLocation(e,t){return-1===this.location&&!0!==this.index&&(this.location=e.getAttribLocation(t,this.name)),this}bind(e,t){return this._enable||!0===this.index||(e.enableVertexAttribArray(this.location),this._enable=!0),t.bind(e,this.location),this}disable(e){return this._enable&&!0!==this.index&&(e.disableVertexAttribArray(this.location),this._enable=!1),this}}(e)})),this._linked=!1,this._located=!1}enable(e){return this.link(e),this.locate(e),e.useProgram(this._webglProgram),this}bind(e,t,n){if(t)for(const n in t)this.uniforms[n].bind(e,t[n]);if(n)for(const t in n)this.attributes[t].bind(e,n[t]);return this}disable(e){for(const t in this.attributes)this.attributes[t].disable(e);return this}link(e){if(this._linked)return this;this._webglProgram=e.createProgram(),this._vertexShader&&e.attachShader(this._webglProgram,this._vertexShader.get(e)),this._fragmentShader&&e.attachShader(this._webglProgram,this._fragmentShader.get(e));for(const t in this.attributes)this.attributes[t].bindLocation(e,this._webglProgram);return e.linkProgram(this._webglProgram),this._linked=!0,this}locate(e){if(this._located)return this;for(const t in this.attributes)this.attributes[t].getLocation(e,this._webglProgram);for(const t in this.uniforms)this.uniforms[t].getLocation(e,this._webglProgram);return this._located=!0,this}}({vertex:new me("vertex","\n attribute vec3 a_position;\n attribute vec3 a_velocity;\n\n uniform mat4 u_projectionMatrix;\n uniform float u_time;\n uniform float u_start_time;\n uniform float u_size;\n uniform float u_flake_size;\n uniform vec3 u_eye;\n uniform vec3 u_common_velocity;\n uniform vec3 u_local_center;\n\n void main() {\n // Sinusoidal offset of a snowflake in time.\n // a_velocity.x is just a random component in the sinus calculating,\n // it allows to move flakes with diffrent offset in period.\n vec3 shift = sin(u_start_time + a_velocity.x) * a_velocity;\n\n vec3 pos = u_local_center + a_position + u_common_velocity * u_time + shift;\n\n vec3 min = u_eye - u_size / 2.0;\n vec3 position = min + mod(pos - min, u_size);\n\n gl_Position = u_projectionMatrix * vec4(position, 1.0);\n\n float scale = u_size / max(length(position - u_eye), 0.001);\n gl_PointSize = u_flake_size * scale / 5.0;\n }\n"),fragment:new me("fragment","\n precision mediump float;\n uniform vec4 u_color;\n\n void main() {\n float dist = distance(gl_PointCoord, vec2(0.5));\n float alpha = 1.0 - smoothstep(0.25, 0.5, dist);\n gl_FragColor = vec4(u_color.rgb * u_color.a * alpha, u_color.a * alpha);\n }\n"),attributes:[{name:"a_position",location:0},{name:"a_velocity",location:1}],uniforms:[{name:"u_projectionMatrix",type:"mat4"},{name:"u_time",type:"1f"},{name:"u_size",type:"1f"},{name:"u_eye",type:"3fv"},{name:"u_flake_size",type:"1f"},{name:"u_color",type:"4fv"},{name:"u_common_velocity",type:"3fv"},{name:"u_local_center",type:"3fv"},{name:"u_start_time",type:"1f"}]}),this.changeSnowTime=this.startTime=Date.now(),this.beforeInitedOptions={},t&&t.skipWaitingForMapIdle?(this.mapInited=!0,this.setOptions(this.beforeInitedOptions)):(this.mapInited=!1,e.once("idle",(function(){n.mapInited=!0,n.setOptions(n.beforeInitedOptions)}))),requestAnimationFrame(this.update)}return t.prototype.setOptions=function(t){if(this.mapInited){var n=t.dispersion!==this.options.dispersion,i=Date.now(),o=(i-this.changeSnowTime)/1e3;this.changeSnowTime=i,this.snowLocalCenter[0]+=this.options.velocityX*o,this.snowLocalCenter[1]+=this.options.velocityY*o,this.snowLocalCenter[2]-=this.options.velocityZ*o,this.options=e(e({},this.options),t),n&&this.initBuffer()}else this.beforeInitedOptions=t},t.prototype.setSize=function(e,t){var n=window.devicePixelRatio;this.canvas.width=e*n,this.canvas.height=t*n,this.canvas.style.width=e+"px",this.canvas.style.height=t+"px"},t.prototype.initBuffer=function(){this.vao&&this.vao.remove(),this.buffer&&this.buffer.remove();for(var e={array:new Float32Array(6e5),index:0},t=0;t