You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

38 lines
1.7 MiB

define(["@jupyter-widgets/base"],function(__WEBPACK_EXTERNAL_MODULE__10__){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=147)}([function(t,e,n){"use strict";n.r(e);var i="http://www.w3.org/1999/xhtml",r={svg:"http://www.w3.org/2000/svg",xhtml:i,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},o=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),r.hasOwnProperty(e)?{space:r[e],local:t}:t};var a=function(t){var e=o(t);return(e.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===i&&e.documentElement.namespaceURI===i?e.createElement(t):e.createElementNS(n,t)}})(e)};function s(){}var c=function(t){return null==t?s:function(){return this.querySelector(t)}};function l(){return[]}var u=function(t){return null==t?l:function(){return this.querySelectorAll(t)}},h=function(t){return function(){return this.matches(t)}},d=function(t){return new Array(t.length)};function f(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}f.prototype={constructor:f,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var p="$";function m(t,e,n,i,r,o){for(var a,s=0,c=e.length,l=o.length;s<l;++s)(a=e[s])?(a.__data__=o[s],i[s]=a):n[s]=new f(t,o[s]);for(;s<c;++s)(a=e[s])&&(r[s]=a)}function g(t,e,n,i,r,o,a){var s,c,l,u={},h=e.length,d=o.length,m=new Array(h);for(s=0;s<h;++s)(c=e[s])&&(m[s]=l=p+a.call(c,c.__data__,s,e),l in u?r[s]=c:u[l]=c);for(s=0;s<d;++s)(c=u[l=p+a.call(t,o[s],s,o)])?(i[s]=c,c.__data__=o[s],u[l]=null):n[s]=new f(t,o[s]);for(s=0;s<h;++s)(c=e[s])&&u[m[s]]===c&&(r[s]=c)}function _(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function v(t){return function(){this.removeAttribute(t)}}function b(t){return function(){this.removeAttributeNS(t.space,t.local)}}function y(t,e){return function(){this.setAttribute(t,e)}}function x(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function w(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function M(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var E=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function S(t){return function(){this.style.removeProperty(t)}}function A(t,e,n){return function(){this.style.setProperty(t,e,n)}}function T(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function k(t,e){return t.style.getPropertyValue(e)||E(t).getComputedStyle(t,null).getPropertyValue(e)}function P(t){return function(){delete this[t]}}function L(t,e){return function(){this[t]=e}}function O(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function C(t){return t.trim().split(/^|\s+/)}function R(t){return t.classList||new I(t)}function I(t){this._node=t,this._names=C(t.getAttribute("class")||"")}function z(t,e){for(var n=R(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function B(t,e){for(var n=R(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function N(t){return function(){z(this,t)}}function D(t){return function(){B(this,t)}}function j(t,e){return function(){(e.apply(this,arguments)?z:B)(this,t)}}I.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function U(){this.textContent=""}function F(t){return function(){this.textContent=t}}function H(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function q(){this.innerHTML=""}function G(t){return function(){this.innerHTML=t}}function W(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function V(){this.nextSibling&&this.parentNode.appendChild(this)}function X(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Y(){return null}function K(){var t=this.parentNode;t&&t.removeChild(this)}function Z(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function J(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}var Q={},$=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(Q={mouseenter:"mouseover",mouseleave:"mouseout"}));function tt(t,e,n){return t=et(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function et(t,e,n){return function(i){var r=$;$=i;try{t.call(this,this.__data__,e,n)}finally{$=r}}}function nt(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}function it(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,o=e.length;i<o;++i)n=e[i],t.type&&n.type!==t.type||n.name!==t.name?e[++r]=n:this.removeEventListener(n.type,n.listener,n.capture);++r?e.length=r:delete this.__on}}}function rt(t,e,n){var i=Q.hasOwnProperty(t.type)?tt:et;return function(r,o,a){var s,c=this.__on,l=i(e,o,a);if(c)for(var u=0,h=c.length;u<h;++u)if((s=c[u]).type===t.type&&s.name===t.name)return this.removeEventListener(s.type,s.listener,s.capture),this.addEventListener(s.type,s.listener=l,s.capture=n),void(s.value=e);this.addEventListener(t.type,l,n),s={type:t.type,name:t.name,value:e,listener:l,capture:n},c?c.push(s):this.__on=[s]}}function ot(t,e,n,i){var r=$;t.sourceEvent=$,$=t;try{return e.apply(n,i)}finally{$=r}}function at(t,e,n){var i=E(t),r=i.CustomEvent;"function"==typeof r?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}var st=[null];function ct(t,e){this._groups=t,this._parents=e}function lt(){return new ct([[document.documentElement]],st)}ct.prototype=lt.prototype={constructor:ct,select:function(t){"function"!=typeof t&&(t=c(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,a,s=e[r],l=s.length,u=i[r]=new Array(l),h=0;h<l;++h)(o=s[h])&&(a=t.call(o,o.__data__,h,s))&&("__data__"in o&&(a.__data__=o.__data__),u[h]=a);return new ct(i,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=u(t));for(var e=this._groups,n=e.length,i=[],r=[],o=0;o<n;++o)for(var a,s=e[o],c=s.length,l=0;l<c;++l)(a=s[l])&&(i.push(t.call(a,a.__data__,l,s)),r.push(a));return new ct(i,r)},filter:function(t){"function"!=typeof t&&(t=h(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,a=e[r],s=a.length,c=i[r]=[],l=0;l<s;++l)(o=a[l])&&t.call(o,o.__data__,l,a)&&c.push(o);return new ct(i,this._parents)},data:function(t,e){if(!t)return p=new Array(this.size()),u=-1,this.each(function(t){p[++u]=t}),p;var n,i=e?g:m,r=this._parents,o=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var a=o.length,s=new Array(a),c=new Array(a),l=new Array(a),u=0;u<a;++u){var h=r[u],d=o[u],f=d.length,p=t.call(h,h&&h.__data__,u,r),_=p.length,v=c[u]=new Array(_),b=s[u]=new Array(_);i(h,d,v,b,l[u]=new Array(f),p,e);for(var y,x,w=0,M=0;w<_;++w)if(y=v[w]){for(w>=M&&(M=w+1);!(x=b[M])&&++M<_;);y._next=x||null}}return(s=new ct(s,r))._enter=c,s._exit=l,s},enter:function(){return new ct(this._enter||this._groups.map(d),this._parents)},exit:function(){return new ct(this._exit||this._groups.map(d),this._parents)},join:function(t,e,n){var i=this.enter(),r=this,o=this.exit();return i="function"==typeof t?t(i):i.append(t+""),null!=e&&(r=e(r)),null==n?o.remove():n(o),i&&r?i.merge(r).order():r},merge:function(t){for(var e=this._groups,n=t._groups,i=e.length,r=n.length,o=Math.min(i,r),a=new Array(i),s=0;s<o;++s)for(var c,l=e[s],u=n[s],h=l.length,d=a[s]=new Array(h),f=0;f<h;++f)(c=l[f]||u[f])&&(d[f]=c);for(;s<i;++s)a[s]=e[s];return new ct(a,this._parents)},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i,r=t[e],o=r.length-1,a=r[o];--o>=0;)(i=r[o])&&(a&&4^i.compareDocumentPosition(a)&&a.parentNode.insertBefore(i,a),a=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=_);for(var n=this._groups,i=n.length,r=new Array(i),o=0;o<i;++o){for(var a,s=n[o],c=s.length,l=r[o]=new Array(c),u=0;u<c;++u)(a=s[u])&&(l[u]=a);l.sort(e)}return new ct(r,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),e=-1;return this.each(function(){t[++e]=this}),t},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,o=i.length;r<o;++r){var a=i[r];if(a)return a}return null},size:function(){var t=0;return this.each(function(){++t}),t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r,o=e[n],a=0,s=o.length;a<s;++a)(r=o[a])&&t.call(r,r.__data__,a,o);return this},attr:function(t,e){var n=o(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((null==e?n.local?b:v:"function"==typeof e?n.local?M:w:n.local?x:y)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?S:"function"==typeof e?T:A)(t,e,null==n?"":n)):k(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?P:"function"==typeof e?O:L)(t,e)):this.node()[t]},classed:function(t,e){var n=C(t+"");if(arguments.length<2){for(var i=R(this.node()),r=-1,o=n.length;++r<o;)if(!i.contains(n[r]))return!1;return!0}return this.each(("function"==typeof e?j:e?N:D)(n,e))},text:function(t){return arguments.length?this.each(null==t?U:("function"==typeof t?H:F)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?q:("function"==typeof t?W:G)(t)):this.node().innerHTML},raise:function(){return this.each(V)},lower:function(){return this.each(X)},append:function(t){var e="function"==typeof t?t:a(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})},insert:function(t,e){var n="function"==typeof t?t:a(t),i=null==e?Y:"function"==typeof e?e:c(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})},remove:function(){return this.each(K)},clone:function(t){return this.select(t?J:Z)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var i,r,o=nt(t+""),a=o.length;if(!(arguments.length<2)){for(s=e?rt:it,null==n&&(n=!1),i=0;i<a;++i)this.each(s(o[i],e,n));return this}var s=this.node().__on;if(s)for(var c,l=0,u=s.length;l<u;++l)for(i=0,c=s[l];i<a;++i)if((r=o[i]).type===c.type&&r.name===c.name)return c.value},dispatch:function(t,e){return this.each(("function"==typeof e?function(t,e){return function(){return at(this,t,e.apply(this,arguments))}}:function(t,e){return function(){return at(this,t,e)}})(t,e))}};var ut=lt,ht=function(t){return"string"==typeof t?new ct([[document.querySelector(t)]],[document.documentElement]):new ct([[t]],st)},dt=function(t){return ht(a(t).call(document.documentElement))},ft=0;function pt(){return new mt}function mt(){this._="@"+(++ft).toString(36)}mt.prototype=pt.prototype={constructor:mt,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var gt=function(){for(var t,e=$;t=e.sourceEvent;)e=t;return e},_t=function(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,[(i=i.matrixTransform(t.getScreenCTM().inverse())).x,i.y]}var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]},vt=function(t){var e=gt();return e.changedTouches&&(e=e.changedTouches[0]),_t(t,e)},bt=function(t){return"string"==typeof t?new ct([document.querySelectorAll(t)],[document.documentElement]):new ct([null==t?[]:t],st)},yt=function(t,e,n){arguments.length<3&&(n=e,e=gt().changedTouches);for(var i,r=0,o=e?e.length:0;r<o;++r)if((i=e[r]).identifier===n)return _t(t,i);return null},xt=function(t,e){null==e&&(e=gt().touches);for(var n=0,i=e?e.length:0,r=new Array(i);n<i;++n)r[n]=_t(t,e[n]);return r};n.d(e,"create",function(){return dt}),n.d(e,"creator",function(){return a}),n.d(e,"local",function(){return pt}),n.d(e,"matcher",function(){return h}),n.d(e,"mouse",function(){return vt}),n.d(e,"namespace",function(){return o}),n.d(e,"namespaces",function(){return r}),n.d(e,"clientPoint",function(){return _t}),n.d(e,"select",function(){return ht}),n.d(e,"selectAll",function(){return bt}),n.d(e,"selection",function(){return ut}),n.d(e,"selector",function(){return c}),n.d(e,"selectorAll",function(){return u}),n.d(e,"style",function(){return k}),n.d(e,"touch",function(){return yt}),n.d(e,"touches",function(){return xt}),n.d(e,"window",function(){return E}),n.d(e,"event",function(){return $}),n.d(e,"customEvent",function(){return ot})},function(t,e,n){"use strict";var i=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},r=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return i(e(t),n)}),{left:function(e,n,i,r){for(null==i&&(i=0),null==r&&(r=e.length);i<r;){var o=i+r>>>1;t(e[o],n)<0?i=o+1:r=o}return i},right:function(e,n,i,r){for(null==i&&(i=0),null==r&&(r=e.length);i<r;){var o=i+r>>>1;t(e[o],n)>0?r=o:i=o+1}return i}}};var o=r(i),a=o.right,s=o.left,c=a,l=function(t,e){null==e&&(e=u);for(var n=0,i=t.length-1,r=t[0],o=new Array(i<0?0:i);n<i;)o[n]=e(r,r=t[++n]);return o};function u(t,e){return[t,e]}var h=function(t,e,n){var i,r,o,a,s=t.length,c=e.length,l=new Array(s*c);for(null==n&&(n=u),i=o=0;i<s;++i)for(a=t[i],r=0;r<c;++r,++o)l[o]=n(a,e[r]);return l},d=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},f=function(t){return null===t?NaN:+t},p=function(t,e){var n,i,r=t.length,o=0,a=-1,s=0,c=0;if(null==e)for(;++a<r;)isNaN(n=f(t[a]))||(c+=(i=n-s)*(n-(s+=i/++o)));else for(;++a<r;)isNaN(n=f(e(t[a],a,t)))||(c+=(i=n-s)*(n-(s+=i/++o)));if(o>1)return c/(o-1)},m=function(t,e){var n=p(t,e);return n?Math.sqrt(n):n},g=function(t,e){var n,i,r,o=t.length,a=-1;if(null==e){for(;++a<o;)if(null!=(n=t[a])&&n>=n)for(i=r=n;++a<o;)null!=(n=t[a])&&(i>n&&(i=n),r<n&&(r=n))}else for(;++a<o;)if(null!=(n=e(t[a],a,t))&&n>=n)for(i=r=n;++a<o;)null!=(n=e(t[a],a,t))&&(i>n&&(i=n),r<n&&(r=n));return[i,r]},_=Array.prototype,v=_.slice,b=_.map,y=function(t){return function(){return t}},x=function(t){return t},w=function(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(r);++i<r;)o[i]=t+i*n;return o},M=Math.sqrt(50),E=Math.sqrt(10),S=Math.sqrt(2),A=function(t,e,n){var i,r,o,a,s=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((i=e<t)&&(r=t,t=e,e=r),0===(a=T(t,e,n))||!isFinite(a))return[];if(a>0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(r=Math.ceil(e-t+1));++s<r;)o[s]=(t+s)*a;else for(t=Math.floor(t*a),e=Math.ceil(e*a),o=new Array(r=Math.ceil(t-e+1));++s<r;)o[s]=(t-s)/a;return i&&o.reverse(),o};function T(t,e,n){var i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),o=i/Math.pow(10,r);return r>=0?(o>=M?10:o>=E?5:o>=S?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(o>=M?10:o>=E?5:o>=S?2:1)}function k(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),o=i/r;return o>=M?r*=10:o>=E?r*=5:o>=S&&(r*=2),e<t?-r:r}var P=function(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1},L=function(){var t=x,e=g,n=P;function i(i){var r,o,a=i.length,s=new Array(a);for(r=0;r<a;++r)s[r]=t(i[r],r,i);var l=e(s),u=l[0],h=l[1],d=n(s,u,h);Array.isArray(d)||(d=k(u,h,d),d=w(Math.ceil(u/d)*d,h,d));for(var f=d.length;d[0]<=u;)d.shift(),--f;for(;d[f-1]>h;)d.pop(),--f;var p,m=new Array(f+1);for(r=0;r<=f;++r)(p=m[r]=[]).x0=r>0?d[r-1]:u,p.x1=r<f?d[r]:h;for(r=0;r<a;++r)u<=(o=s[r])&&o<=h&&m[c(d,o,0,f)].push(i[r]);return m}return i.value=function(e){return arguments.length?(t="function"==typeof e?e:y(e),i):t},i.domain=function(t){return arguments.length?(e="function"==typeof t?t:y([t[0],t[1]]),i):e},i.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?y(v.call(t)):y(t),i):n},i},O=function(t,e,n){if(null==n&&(n=f),i=t.length){if((e=+e)<=0||i<2)return+n(t[0],0,t);if(e>=1)return+n(t[i-1],i-1,t);var i,r=(i-1)*e,o=Math.floor(r),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(r-o)}},C=function(t,e,n){return t=b.call(t,f).sort(i),Math.ceil((n-e)/(2*(O(t,.75)-O(t,.25))*Math.pow(t.length,-1/3)))},R=function(t,e,n){return Math.ceil((n-e)/(3.5*m(t)*Math.pow(t.length,-1/3)))},I=function(t,e){var n,i,r=t.length,o=-1;if(null==e){for(;++o<r;)if(null!=(n=t[o])&&n>=n)for(i=n;++o<r;)null!=(n=t[o])&&n>i&&(i=n)}else for(;++o<r;)if(null!=(n=e(t[o],o,t))&&n>=n)for(i=n;++o<r;)null!=(n=e(t[o],o,t))&&n>i&&(i=n);return i},z=function(t,e){var n,i=t.length,r=i,o=-1,a=0;if(null==e)for(;++o<i;)isNaN(n=f(t[o]))?--r:a+=n;else for(;++o<i;)isNaN(n=f(e(t[o],o,t)))?--r:a+=n;if(r)return a/r},B=function(t,e){var n,r=t.length,o=-1,a=[];if(null==e)for(;++o<r;)isNaN(n=f(t[o]))||a.push(n);else for(;++o<r;)isNaN(n=f(e(t[o],o,t)))||a.push(n);return O(a.sort(i),.5)},N=function(t){for(var e,n,i,r=t.length,o=-1,a=0;++o<r;)a+=t[o].length;for(n=new Array(a);--r>=0;)for(e=(i=t[r]).length;--e>=0;)n[--a]=i[e];return n},D=function(t,e){var n,i,r=t.length,o=-1;if(null==e){for(;++o<r;)if(null!=(n=t[o])&&n>=n)for(i=n;++o<r;)null!=(n=t[o])&&i>n&&(i=n)}else for(;++o<r;)if(null!=(n=e(t[o],o,t))&&n>=n)for(i=n;++o<r;)null!=(n=e(t[o],o,t))&&i>n&&(i=n);return i},j=function(t,e){for(var n=e.length,i=new Array(n);n--;)i[n]=t[e[n]];return i},U=function(t,e){if(n=t.length){var n,r,o=0,a=0,s=t[a];for(null==e&&(e=i);++o<n;)(e(r=t[o],s)<0||0!==e(s,s))&&(s=r,a=o);return 0===e(s,s)?a:void 0}},F=function(t,e,n){for(var i,r,o=(null==n?t.length:n)-(e=null==e?0:+e);o;)r=Math.random()*o--|0,i=t[o+e],t[o+e]=t[r+e],t[r+e]=i;return t},H=function(t,e){var n,i=t.length,r=-1,o=0;if(null==e)for(;++r<i;)(n=+t[r])&&(o+=n);else for(;++r<i;)(n=+e(t[r],r,t))&&(o+=n);return o},q=function(t){if(!(r=t.length))return[];for(var e=-1,n=D(t,G),i=new Array(n);++e<n;)for(var r,o=-1,a=i[e]=new Array(r);++o<r;)a[o]=t[o][e];return i};function G(t){return t.length}var W=function(){return q(arguments)};n.d(e,"b",function(){return c}),n.d(e,"d",function(){return a}),n.d(e,"c",function(){return s}),n.d(e,"a",function(){return i}),n.d(e,"e",function(){return r}),n.d(e,"f",function(){return h}),n.d(e,"g",function(){return d}),n.d(e,"h",function(){return m}),n.d(e,"i",function(){return g}),n.d(e,"j",function(){return L}),n.d(e,"w",function(){return C}),n.d(e,"x",function(){return R}),n.d(e,"y",function(){return P}),n.d(e,"k",function(){return I}),n.d(e,"l",function(){return z}),n.d(e,"m",function(){return B}),n.d(e,"n",function(){return N}),n.d(e,"o",function(){return D}),n.d(e,"p",function(){return l}),n.d(e,"q",function(){return j}),n.d(e,"r",function(){return O}),n.d(e,"s",function(){return w}),n.d(e,"t",function(){return U}),n.d(e,"u",function(){return F}),n.d(e,"v",function(){return H}),n.d(e,"B",function(){return A}),n.d(e,"z",function(){return T}),n.d(e,"A",function(){return k}),n.d(e,"C",function(){return q}),n.d(e,"D",function(){return p}),n.d(e,"E",function(){return W})},function(t,e,n){"use strict";n.r(e);var i=n(1),r=Array.prototype.slice,o=function(t){return t},a=1,s=2,c=3,l=4,u=1e-6;function h(t){return"translate("+(t+.5)+",0)"}function d(t){return"translate(0,"+(t+.5)+")"}function f(){return!this.__axis}function p(t,e){var n=[],i=null,p=null,m=6,g=6,_=3,v=t===a||t===l?-1:1,b=t===l||t===s?"x":"y",y=t===a||t===c?h:d;function x(r){var h=null==i?e.ticks?e.ticks.apply(e,n):e.domain():i,d=null==p?e.tickFormat?e.tickFormat.apply(e,n):o:p,x=Math.max(m,0)+_,w=e.range(),M=+w[0]+.5,E=+w[w.length-1]+.5,S=(e.bandwidth?function(t){var e=Math.max(0,t.bandwidth()-1)/2;return t.round()&&(e=Math.round(e)),function(n){return+t(n)+e}}:function(t){return function(e){return+t(e)}})(e.copy()),A=r.selection?r.selection():r,T=A.selectAll(".domain").data([null]),k=A.selectAll(".tick").data(h,e).order(),P=k.exit(),L=k.enter().append("g").attr("class","tick"),O=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),O=O.merge(L.append("line").attr("stroke","currentColor").attr(b+"2",v*m)),C=C.merge(L.append("text").attr("fill","currentColor").attr(b,v*x).attr("dy",t===a?"0em":t===c?"0.71em":"0.32em")),r!==A&&(T=T.transition(r),k=k.transition(r),O=O.transition(r),C=C.transition(r),P=P.transition(r).attr("opacity",u).attr("transform",function(t){return isFinite(t=S(t))?y(t):this.getAttribute("transform")}),L.attr("opacity",u).attr("transform",function(t){var e=this.parentNode.__axis;return y(e&&isFinite(e=e(t))?e:S(t))})),P.remove(),T.attr("d",t===l||t==s?g?"M"+v*g+","+M+"H0.5V"+E+"H"+v*g:"M0.5,"+M+"V"+E:g?"M"+M+","+v*g+"V0.5H"+E+"V"+v*g:"M"+M+",0.5H"+E),k.attr("opacity",1).attr("transform",function(t){return y(S(t))}),O.attr(b+"2",v*m),C.attr(b,v*x).text(d),A.filter(f).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===s?"start":t===l?"end":"middle"),A.each(function(){this.__axis=S})}return x.scale=function(t){return arguments.length?(e=t,x):e},x.ticks=function(){return n=r.call(arguments),x},x.tickArguments=function(t){return arguments.length?(n=null==t?[]:r.call(t),x):n.slice()},x.tickValues=function(t){return arguments.length?(i=null==t?null:r.call(t),x):i&&i.slice()},x.tickFormat=function(t){return arguments.length?(p=t,x):p},x.tickSize=function(t){return arguments.length?(m=g=+t,x):m},x.tickSizeInner=function(t){return arguments.length?(m=+t,x):m},x.tickSizeOuter=function(t){return arguments.length?(g=+t,x):g},x.tickPadding=function(t){return arguments.length?(_=+t,x):_},x}function m(t){return p(a,t)}function g(t){return p(s,t)}function _(t){return p(c,t)}function v(t){return p(l,t)}var b=n(23),y=n(0);function x(){y.event.stopImmediatePropagation()}var w=function(){y.event.preventDefault(),y.event.stopImmediatePropagation()},M=function(t){var e=t.document.documentElement,n=Object(y.select)(t).on("dragstart.drag",w,!0);"onselectstart"in e?n.on("selectstart.drag",w,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")};function E(t,e){var n=t.document.documentElement,i=Object(y.select)(t).on("dragstart.drag",null);e&&(i.on("click.drag",w,!0),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var S=function(t){return function(){return t}};function A(t,e,n,i,r,o,a,s,c,l){this.target=t,this.type=e,this.subject=n,this.identifier=i,this.active=r,this.x=o,this.y=a,this.dx=s,this.dy=c,this._=l}function T(){return!y.event.button}function k(){return this.parentNode}function P(t){return null==t?{x:y.event.x,y:y.event.y}:t}function L(){return"ontouchstart"in this}A.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var O=function(){var t,e,n,i,r=T,o=k,a=P,s=L,c={},l=Object(b.a)("start","drag","end"),u=0,h=0;function d(t){t.on("mousedown.drag",f).filter(s).on("touchstart.drag",g).on("touchmove.drag",_).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(){if(!i&&r.apply(this,arguments)){var a=O("mouse",o.apply(this,arguments),y.mouse,this,arguments);a&&(Object(y.select)(y.event.view).on("mousemove.drag",p,!0).on("mouseup.drag",m,!0),M(y.event.view),x(),n=!1,t=y.event.clientX,e=y.event.clientY,a("start"))}}function p(){if(w(),!n){var i=y.event.clientX-t,r=y.event.clientY-e;n=i*i+r*r>h}c.mouse("drag")}function m(){Object(y.select)(y.event.view).on("mousemove.drag mouseup.drag",null),E(y.event.view,n),w(),c.mouse("end")}function g(){if(r.apply(this,arguments)){var t,e,n=y.event.changedTouches,i=o.apply(this,arguments),a=n.length;for(t=0;t<a;++t)(e=O(n[t].identifier,i,y.touch,this,arguments))&&(x(),e("start"))}}function _(){var t,e,n=y.event.changedTouches,i=n.length;for(t=0;t<i;++t)(e=c[n[t].identifier])&&(w(),e("drag"))}function v(){var t,e,n=y.event.changedTouches,r=n.length;for(i&&clearTimeout(i),i=setTimeout(function(){i=null},500),t=0;t<r;++t)(e=c[n[t].identifier])&&(x(),e("end"))}function O(t,e,n,i,r){var o,s,h,f=n(e,t),p=l.copy();if(Object(y.customEvent)(new A(d,"beforestart",o,t,u,f[0],f[1],0,0,p),function(){return null!=(y.event.subject=o=a.apply(i,r))&&(s=o.x-f[0]||0,h=o.y-f[1]||0,!0)}))return function a(l){var m,g=f;switch(l){case"start":c[t]=a,m=u++;break;case"end":delete c[t],--u;case"drag":f=n(e,t),m=u}Object(y.customEvent)(new A(d,l,o,t,m,f[0]+s,f[1]+h,f[0]-g[0],f[1]-g[1],p),p.apply,p,[l,i,r])}}return d.filter=function(t){return arguments.length?(r="function"==typeof t?t:S(!!t),d):r},d.container=function(t){return arguments.length?(o="function"==typeof t?t:S(t),d):o},d.subject=function(t){return arguments.length?(a="function"==typeof t?t:S(t),d):a},d.touchable=function(t){return arguments.length?(s="function"==typeof t?t:S(!!t),d):s},d.on=function(){var t=l.on.apply(l,arguments);return t===l?d:t},d.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,d):Math.sqrt(h)},d},C=n(8),R=n(24),I=function(t){return function(){return t}},z=function(t,e,n){this.target=t,this.type=e,this.selection=n};function B(){y.event.stopImmediatePropagation()}var N=function(){y.event.preventDefault(),y.event.stopImmediatePropagation()},D={name:"drag"},j={name:"space"},U={name:"handle"},F={name:"center"},H={name:"x",handles:["e","w"].map(Z),input:function(t,e){return t&&[[t[0],e[0][1]],[t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},q={name:"y",handles:["n","s"].map(Z),input:function(t,e){return t&&[[e[0][0],t[0]],[e[1][0],t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},G={name:"xy",handles:["n","e","s","w","nw","ne","se","sw"].map(Z),input:function(t){return t},output:function(t){return t}},W={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},V={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},X={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Y={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},K={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Z(t){return{type:t}}function J(){return!y.event.button}function Q(){var t=this.ownerSVGElement||this;return[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function $(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function tt(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function et(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function nt(){return ot(H)}function it(){return ot(q)}var rt=function(){return ot(G)};function ot(t){var e,n=Q,i=J,r=Object(b.a)(a,"start","brush","end"),o=6;function a(e){var n=e.property("__brush",h).selectAll(".overlay").data([Z("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",W.overlay).merge(n).each(function(){var t=$(this).extent;Object(y.select)(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])}),e.selectAll(".selection").data([Z("selection")]).enter().append("rect").attr("class","selection").attr("cursor",W.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var i=e.selectAll(".handle").data(t.handles,function(t){return t.type});i.exit().remove(),i.enter().append("rect").attr("class",function(t){return"handle handle--"+t.type}).attr("cursor",function(t){return W[t.type]}),e.each(s).attr("fill","none").attr("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush touchstart.brush",u)}function s(){var t=Object(y.select)(this),e=$(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",function(t){return"e"===t.type[t.type.length-1]?e[1][0]-o/2:e[0][0]-o/2}).attr("y",function(t){return"s"===t.type[0]?e[1][1]-o/2:e[0][1]-o/2}).attr("width",function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+o:o}).attr("height",function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+o:o})):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function c(t,e){return t.__brush.emitter||new l(t,e)}function l(t,e){this.that=t,this.args=e,this.state=t.__brush,this.active=0}function u(){if(y.event.touches){if(y.event.changedTouches.length<y.event.touches.length)return N()}else if(e)return;if(i.apply(this,arguments)){var n,r,o,a,l,u,h,d,f,p,m,g,_,v=this,b=y.event.target.__data__.type,x="selection"===(y.event.metaKey?b="overlay":b)?D:y.event.altKey?F:U,w=t===q?null:Y[b],S=t===H?null:K[b],A=$(v),T=A.extent,k=A.selection,P=T[0][0],L=T[0][1],O=T[1][0],C=T[1][1],I=w&&S&&y.event.shiftKey,z=Object(y.mouse)(v),G=z,Z=c(v,arguments).beforestart();"overlay"===b?A.selection=k=[[n=t===q?P:z[0],o=t===H?L:z[1]],[l=t===q?O:n,h=t===H?C:o]]:(n=k[0][0],o=k[0][1],l=k[1][0],h=k[1][1]),r=n,a=o,u=l,d=h;var J=Object(y.select)(v).attr("pointer-events","none"),Q=J.selectAll(".overlay").attr("cursor",W[b]);if(y.event.touches)J.on("touchmove.brush",nt,!0).on("touchend.brush touchcancel.brush",rt,!0);else{var et=Object(y.select)(y.event.view).on("keydown.brush",function(){switch(y.event.keyCode){case 16:I=w&&S;break;case 18:x===U&&(w&&(l=u-f*w,n=r+f*w),S&&(h=d-p*S,o=a+p*S),x=F,it());break;case 32:x!==U&&x!==F||(w<0?l=u-f:w>0&&(n=r-f),S<0?h=d-p:S>0&&(o=a-p),x=j,Q.attr("cursor",W.selection),it());break;default:return}N()},!0).on("keyup.brush",function(){switch(y.event.keyCode){case 16:I&&(g=_=I=!1,it());break;case 18:x===F&&(w<0?l=u:w>0&&(n=r),S<0?h=d:S>0&&(o=a),x=U,it());break;case 32:x===j&&(y.event.altKey?(w&&(l=u-f*w,n=r+f*w),S&&(h=d-p*S,o=a+p*S),x=F):(w<0?l=u:w>0&&(n=r),S<0?h=d:S>0&&(o=a),x=U),Q.attr("cursor",W[b]),it());break;default:return}N()},!0).on("mousemove.brush",nt,!0).on("mouseup.brush",rt,!0);M(y.event.view)}B(),Object(R.b)(v),s.call(v),Z.start()}function nt(){var t=Object(y.mouse)(v);!I||g||_||(Math.abs(t[0]-G[0])>Math.abs(t[1]-G[1])?_=!0:g=!0),G=t,m=!0,N(),it()}function it(){var t;switch(f=G[0]-z[0],p=G[1]-z[1],x){case j:case D:w&&(f=Math.max(P-n,Math.min(O-l,f)),r=n+f,u=l+f),S&&(p=Math.max(L-o,Math.min(C-h,p)),a=o+p,d=h+p);break;case U:w<0?(f=Math.max(P-n,Math.min(O-n,f)),r=n+f,u=l):w>0&&(f=Math.max(P-l,Math.min(O-l,f)),r=n,u=l+f),S<0?(p=Math.max(L-o,Math.min(C-o,p)),a=o+p,d=h):S>0&&(p=Math.max(L-h,Math.min(C-h,p)),a=o,d=h+p);break;case F:w&&(r=Math.max(P,Math.min(O,n-f*w)),u=Math.max(P,Math.min(O,l+f*w))),S&&(a=Math.max(L,Math.min(C,o-p*S)),d=Math.max(L,Math.min(C,h+p*S)))}u<r&&(w*=-1,t=n,n=l,l=t,t=r,r=u,u=t,b in V&&Q.attr("cursor",W[b=V[b]])),d<a&&(S*=-1,t=o,o=h,h=t,t=a,a=d,d=t,b in X&&Q.attr("cursor",W[b=X[b]])),A.selection&&(k=A.selection),g&&(r=k[0][0],u=k[1][0]),_&&(a=k[0][1],d=k[1][1]),k[0][0]===r&&k[0][1]===a&&k[1][0]===u&&k[1][1]===d||(A.selection=[[r,a],[u,d]],s.call(v),Z.brush())}function rt(){if(B(),y.event.touches){if(y.event.touches.length)return;e&&clearTimeout(e),e=setTimeout(function(){e=null},500),J.on("touchmove.brush touchend.brush touchcancel.brush",null)}else E(y.event.view,m),et.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);J.attr("pointer-events","all"),Q.attr("cursor",W.overlay),A.selection&&(k=A.selection),tt(k)&&(A.selection=null,s.call(v)),Z.end()}}function h(){var e=this.__brush||{selection:null};return e.extent=n.apply(this,arguments),e.dim=t,e}return a.move=function(e,n){e.selection?e.on("start.brush",function(){c(this,arguments).beforestart().start()}).on("interrupt.brush end.brush",function(){c(this,arguments).end()}).tween("brush",function(){var e=this,i=e.__brush,r=c(e,arguments),o=i.selection,a=t.input("function"==typeof n?n.apply(this,arguments):n,i.extent),l=Object(C.a)(o,a);function u(t){i.selection=1===t&&tt(a)?null:l(t),s.call(e),r.brush()}return o&&a?u:u(1)}):e.each(function(){var e=this,i=arguments,r=e.__brush,o=t.input("function"==typeof n?n.apply(e,i):n,r.extent),a=c(e,i).beforestart();Object(R.b)(e),r.selection=null==o||tt(o)?null:o,s.call(e),a.start().brush().end()})},l.prototype={beforestart:function(){return 1==++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(){return this.starting&&(this.starting=!1,this.emit("start")),this},brush:function(){return this.emit("brush"),this},end:function(){return 0==--this.active&&(delete this.state.emitter,this.emit("end")),this},emit:function(e){Object(y.customEvent)(new z(a,e,t.output(this.state.selection)),r.apply,r,[e,this.that,this.args])}},a.extent=function(t){return arguments.length?(n="function"==typeof t?t:I([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),a):n},a.filter=function(t){return arguments.length?(i="function"==typeof t?t:I(!!t),a):i},a.handleSize=function(t){return arguments.length?(o=+t,a):o},a.on=function(){var t=r.on.apply(r,arguments);return t===r?a:t},a}var at=Math.cos,st=Math.sin,ct=Math.PI,lt=ct/2,ut=2*ct,ht=Math.max;function dt(t){return function(e,n){return t(e.source.value+e.target.value,n.source.value+n.target.value)}}var ft=function(){var t=0,e=null,n=null,r=null;function o(o){var a,s,c,l,u,h,d=o.length,f=[],p=Object(i.s)(d),m=[],g=[],_=g.groups=new Array(d),v=new Array(d*d);for(a=0,u=-1;++u<d;){for(s=0,h=-1;++h<d;)s+=o[u][h];f.push(s),m.push(Object(i.s)(d)),a+=s}for(e&&p.sort(function(t,n){return e(f[t],f[n])}),n&&m.forEach(function(t,e){t.sort(function(t,i){return n(o[e][t],o[e][i])})}),l=(a=ht(0,ut-t*d)/a)?t:ut/d,s=0,u=-1;++u<d;){for(c=s,h=-1;++h<d;){var b=p[u],y=m[b][h],x=o[b][y],w=s,M=s+=x*a;v[y*d+b]={index:b,subindex:y,startAngle:w,endAngle:M,value:x}}_[b]={index:b,startAngle:c,endAngle:s,value:f[b]},s+=l}for(u=-1;++u<d;)for(h=u-1;++h<d;){var E=v[h*d+u],S=v[u*d+h];(E.value||S.value)&&g.push(E.value<S.value?{source:S,target:E}:{source:E,target:S})}return r?g.sort(r):g}return o.padAngle=function(e){return arguments.length?(t=ht(0,e),o):t},o.sortGroups=function(t){return arguments.length?(e=t,o):e},o.sortSubgroups=function(t){return arguments.length?(n=t,o):n},o.sortChords=function(t){return arguments.length?(null==t?r=null:(r=dt(t))._=t,o):r&&r._},o},pt=Array.prototype.slice,mt=function(t){return function(){return t}},gt=Math.PI,_t=2*gt,vt=_t-1e-6;function bt(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function yt(){return new bt}bt.prototype=yt.prototype={constructor:bt,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,r,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+o)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var o=this._x1,a=this._y1,s=n-t,c=i-e,l=o-t,u=a-e,h=l*l+u*u;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(h>1e-6)if(Math.abs(u*s-c*l)>1e-6&&r){var d=n-o,f=i-a,p=s*s+c*c,m=d*d+f*f,g=Math.sqrt(p),_=Math.sqrt(h),v=r*Math.tan((gt-Math.acos((p+h-m)/(2*g*_)))/2),b=v/_,y=v/g;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*l)+","+(e+b*u)),this._+="A"+r+","+r+",0,0,"+ +(u*d>l*f)+","+(this._x1=t+y*s)+","+(this._y1=e+y*c)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,i,r,o){t=+t,e=+e;var a=(n=+n)*Math.cos(i),s=n*Math.sin(i),c=t+a,l=e+s,u=1^o,h=o?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+c+","+l:(Math.abs(this._x1-c)>1e-6||Math.abs(this._y1-l)>1e-6)&&(this._+="L"+c+","+l),n&&(h<0&&(h=h%_t+_t),h>vt?this._+="A"+n+","+n+",0,1,"+u+","+(t-a)+","+(e-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=c)+","+(this._y1=l):h>1e-6&&(this._+="A"+n+","+n+",0,"+ +(h>=gt)+","+u+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};var xt=yt;function wt(t){return t.source}function Mt(t){return t.target}function Et(t){return t.radius}function St(t){return t.startAngle}function At(t){return t.endAngle}var Tt=function(){var t=wt,e=Mt,n=Et,i=St,r=At,o=null;function a(){var a,s=pt.call(arguments),c=t.apply(this,s),l=e.apply(this,s),u=+n.apply(this,(s[0]=c,s)),h=i.apply(this,s)-lt,d=r.apply(this,s)-lt,f=u*at(h),p=u*st(h),m=+n.apply(this,(s[0]=l,s)),g=i.apply(this,s)-lt,_=r.apply(this,s)-lt;if(o||(o=a=xt()),o.moveTo(f,p),o.arc(0,0,u,h,d),h===g&&d===_||(o.quadraticCurveTo(0,0,m*at(g),m*st(g)),o.arc(0,0,m,g,_)),o.quadraticCurveTo(0,0,f,p),o.closePath(),a)return o=null,a+""||null}return a.radius=function(t){return arguments.length?(n="function"==typeof t?t:mt(+t),a):n},a.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:mt(+t),a):i},a.endAngle=function(t){return arguments.length?(r="function"==typeof t?t:mt(+t),a):r},a.source=function(e){return arguments.length?(t=e,a):t},a.target=function(t){return arguments.length?(e=t,a):e},a.context=function(t){return arguments.length?(o=null==t?null:t,a):o},a},kt=n(32),Pt=n(7),Lt=Array.prototype.slice,Ot=function(t,e){return t-e},Ct=function(t){for(var e=0,n=t.length,i=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e<n;)i+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return i},Rt=function(t){return function(){return t}},It=function(t,e){for(var n,i=-1,r=e.length;++i<r;)if(n=zt(t,e[i]))return n;return 0};function zt(t,e){for(var n=e[0],i=e[1],r=-1,o=0,a=t.length,s=a-1;o<a;s=o++){var c=t[o],l=c[0],u=c[1],h=t[s],d=h[0],f=h[1];if(Bt(c,h,e))return 0;u>i!=f>i&&n<(d-l)*(i-u)/(f-u)+l&&(r=-r)}return r}function Bt(t,e,n){var i,r,o,a;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(r=t[i=+(t[0]===e[0])],o=n[i],a=e[i],r<=o&&o<=a||a<=o&&o<=r)}var Nt=function(){},Dt=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]],jt=function(){var t=1,e=1,n=i.y,r=c;function o(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(Ot);else{var r=Object(i.i)(t),o=r[0],s=r[1];e=Object(i.A)(o,s,e),e=Object(i.s)(Math.floor(o/e)*e,Math.floor(s/e)*e,e)}return e.map(function(e){return a(t,e)})}function a(n,i){var o=[],a=[];return function(n,i,r){var o,a,c,l,u,h,d=new Array,f=new Array;o=a=-1,l=n[0]>=i,Dt[l<<1].forEach(p);for(;++o<t-1;)c=l,l=n[o+1]>=i,Dt[c|l<<1].forEach(p);Dt[l<<0].forEach(p);for(;++a<e-1;){for(o=-1,l=n[a*t+t]>=i,u=n[a*t]>=i,Dt[l<<1|u<<2].forEach(p);++o<t-1;)c=l,l=n[a*t+t+o+1]>=i,h=u,u=n[a*t+o+1]>=i,Dt[c|l<<1|u<<2|h<<3].forEach(p);Dt[l|u<<3].forEach(p)}o=-1,u=n[a*t]>=i,Dt[u<<2].forEach(p);for(;++o<t-1;)h=u,u=n[a*t+o+1]>=i,Dt[u<<2|h<<3].forEach(p);function p(t){var e,n,i=[t[0][0]+o,t[0][1]+a],c=[t[1][0]+o,t[1][1]+a],l=s(i),u=s(c);(e=f[l])?(n=d[u])?(delete f[e.end],delete d[n.start],e===n?(e.ring.push(c),r(e.ring)):d[e.start]=f[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete f[e.end],e.ring.push(c),f[e.end=u]=e):(e=d[u])?(n=f[l])?(delete d[e.start],delete f[n.end],e===n?(e.ring.push(c),r(e.ring)):d[n.start]=f[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete d[e.start],e.ring.unshift(i),d[e.start=l]=e):d[l]=f[u]={start:l,end:u,ring:[i,c]}}Dt[u<<3].forEach(p)}(n,i,function(t){r(t,n,i),Ct(t)>0?o.push([t]):a.push(t)}),a.forEach(function(t){for(var e,n=0,i=o.length;n<i;++n)if(-1!==It((e=o[n])[0],t))return void e.push(t)}),{type:"MultiPolygon",value:i,coordinates:o}}function s(e){return 2*e[0]+e[1]*(t+1)*4}function c(n,i,r){n.forEach(function(n){var o,a=n[0],s=n[1],c=0|a,l=0|s,u=i[l*t+c];a>0&&a<t&&c===a&&(o=i[l*t+c-1],n[0]=a+(r-o)/(u-o)-.5),s>0&&s<e&&l===s&&(o=i[(l-1)*t+c],n[1]=s+(r-o)/(u-o)-.5)})}return o.contour=a,o.size=function(n){if(!arguments.length)return[t,e];var i=Math.ceil(n[0]),r=Math.ceil(n[1]);if(!(i>0&&r>0))throw new Error("invalid size");return t=i,e=r,o},o.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?Rt(Lt.call(t)):Rt(t),o):n},o.smooth=function(t){return arguments.length?(r=t?c:Nt,o):r===c},o};function Ut(t,e,n){for(var i=t.width,r=t.height,o=1+(n<<1),a=0;a<r;++a)for(var s=0,c=0;s<i+n;++s)s<i&&(c+=t.data[s+a*i]),s>=n&&(s>=o&&(c-=t.data[s-o+a*i]),e.data[s-n+a*i]=c/Math.min(s+1,i-1+o-s,o))}function Ft(t,e,n){for(var i=t.width,r=t.height,o=1+(n<<1),a=0;a<i;++a)for(var s=0,c=0;s<r+n;++s)s<r&&(c+=t.data[a+s*i]),s>=n&&(s>=o&&(c-=t.data[a+(s-o)*i]),e.data[a+(s-n)*i]=c/Math.min(s+1,r-1+o-s,o))}function Ht(t){return t[0]}function qt(t){return t[1]}function Gt(){return 1}var Wt=function(){var t=Ht,e=qt,n=Gt,r=960,o=500,a=20,s=2,c=3*a,l=r+2*c>>s,u=o+2*c>>s,h=Rt(20);function d(r){var o=new Float32Array(l*u),d=new Float32Array(l*u);r.forEach(function(i,r,a){var h=+t(i,r,a)+c>>s,d=+e(i,r,a)+c>>s,f=+n(i,r,a);h>=0&&h<l&&d>=0&&d<u&&(o[h+d*l]+=f)}),Ut({width:l,height:u,data:o},{width:l,height:u,data:d},a>>s),Ft({width:l,height:u,data:d},{width:l,height:u,data:o},a>>s),Ut({width:l,height:u,data:o},{width:l,height:u,data:d},a>>s),Ft({width:l,height:u,data:d},{width:l,height:u,data:o},a>>s),Ut({width:l,height:u,data:o},{width:l,height:u,data:d},a>>s),Ft({width:l,height:u,data:d},{width:l,height:u,data:o},a>>s);var p=h(o);if(!Array.isArray(p)){var m=Object(i.k)(o);p=Object(i.A)(0,m,p),(p=Object(i.s)(0,Math.floor(m/p)*p,p)).shift()}return jt().thresholds(p).size([l,u])(o).map(f)}function f(t){return t.value*=Math.pow(2,-2*s),t.coordinates.forEach(p),t}function p(t){t.forEach(m)}function m(t){t.forEach(g)}function g(t){t[0]=t[0]*Math.pow(2,s)-c,t[1]=t[1]*Math.pow(2,s)-c}function _(){return l=r+2*(c=3*a)>>s,u=o+2*c>>s,d}return d.x=function(e){return arguments.length?(t="function"==typeof e?e:Rt(+e),d):t},d.y=function(t){return arguments.length?(e="function"==typeof t?t:Rt(+t),d):e},d.weight=function(t){return arguments.length?(n="function"==typeof t?t:Rt(+t),d):n},d.size=function(t){if(!arguments.length)return[r,o];var e=Math.ceil(t[0]),n=Math.ceil(t[1]);if(!(e>=0||e>=0))throw new Error("invalid size");return r=e,o=n,_()},d.cellSize=function(t){if(!arguments.length)return 1<<s;if(!((t=+t)>=1))throw new Error("invalid cell size");return s=Math.floor(Math.log(t)/Math.LN2),_()},d.thresholds=function(t){return arguments.length?(h="function"==typeof t?t:Array.isArray(t)?Rt(Lt.call(t)):Rt(t),d):h},d.bandwidth=function(t){if(!arguments.length)return Math.sqrt(a*(a+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return a=Math.round((Math.sqrt(4*t*t+1)-1)/2),_()},d},Vt={},Xt={},Yt=34,Kt=10,Zt=13;function Jt(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}")}function Qt(t){var e=Object.create(null),n=[];return t.forEach(function(t){for(var i in t)i in e||n.push(e[i]=i)}),n}function $t(t,e){var n=t+"",i=n.length;return i<e?new Array(e-i+1).join(0)+n:n}function te(t){var e,n=t.getUTCHours(),i=t.getUTCMinutes(),r=t.getUTCSeconds(),o=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+$t(-e,6):e>9999?"+"+$t(e,6):$t(e,4))+"-"+$t(t.getUTCMonth()+1,2)+"-"+$t(t.getUTCDate(),2)+(o?"T"+$t(n,2)+":"+$t(i,2)+":"+$t(r,2)+"."+$t(o,3)+"Z":r?"T"+$t(n,2)+":"+$t(i,2)+":"+$t(r,2)+"Z":i||n?"T"+$t(n,2)+":"+$t(i,2)+"Z":"")}var ee=function(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function i(t,e){var i,r=[],o=t.length,a=0,s=0,c=o<=0,l=!1;function u(){if(c)return Xt;if(l)return l=!1,Vt;var e,i,r=a;if(t.charCodeAt(r)===Yt){for(;a++<o&&t.charCodeAt(a)!==Yt||t.charCodeAt(++a)===Yt;);return(e=a)>=o?c=!0:(i=t.charCodeAt(a++))===Kt?l=!0:i===Zt&&(l=!0,t.charCodeAt(a)===Kt&&++a),t.slice(r+1,e-1).replace(/""/g,'"')}for(;a<o;){if((i=t.charCodeAt(e=a++))===Kt)l=!0;else if(i===Zt)l=!0,t.charCodeAt(a)===Kt&&++a;else if(i!==n)continue;return t.slice(r,e)}return c=!0,t.slice(r,o)}for(t.charCodeAt(o-1)===Kt&&--o,t.charCodeAt(o-1)===Zt&&--o;(i=u())!==Xt;){for(var h=[];i!==Vt&&i!==Xt;)h.push(i),i=u();e&&null==(h=e(h,s++))||r.push(h)}return r}function r(e,n){return e.map(function(e){return n.map(function(t){return a(e[t])}).join(t)})}function o(e){return e.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?te(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,r,o=i(t,function(t,i){if(n)return n(t,i-1);r=t,n=e?function(t,e){var n=Jt(t);return function(i,r){return e(n(i),r,t)}}(t,e):Jt(t)});return o.columns=r||[],o},parseRows:i,format:function(e,n){return null==n&&(n=Qt(e)),[n.map(a).join(t)].concat(r(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=Qt(t)),r(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")}}},ne=ee(","),ie=ne.parse,re=ne.parseRows,oe=ne.format,ae=ne.formatBody,se=ne.formatRows,ce=ee("\t"),le=ce.parse,ue=ce.parseRows,he=ce.format,de=ce.formatBody,fe=ce.formatRows;function pe(t){for(var e in t){var n,i=t[e].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(n=+i)){if(!/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/.test(i))continue;i=new Date(i)}else i=n;else i=null;t[e]=i}return t}var me=n(65);function ge(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.blob()}var _e=function(t,e){return fetch(t,e).then(ge)};function ve(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.arrayBuffer()}var be=function(t,e){return fetch(t,e).then(ve)};function ye(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}var xe=function(t,e){return fetch(t,e).then(ye)};function we(t){return function(e,n,i){return 2===arguments.length&&"function"==typeof n&&(i=n,n=void 0),xe(e,n).then(function(e){return t(e,i)})}}function Me(t,e,n,i){3===arguments.length&&"function"==typeof n&&(i=n,n=void 0);var r=ee(t);return xe(e,n).then(function(t){return r.parse(t,i)})}var Ee=we(ie),Se=we(le),Ae=function(t,e){return new Promise(function(n,i){var r=new Image;for(var o in e)r[o]=e[o];r.onerror=i,r.onload=function(){n(r)},r.src=t})};function Te(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.json()}var ke=function(t,e){return fetch(t,e).then(Te)};function Pe(t){return function(e,n){return xe(e,n).then(function(e){return(new DOMParser).parseFromString(e,t)})}}var Le=Pe("application/xml"),Oe=Pe("text/html"),Ce=Pe("image/svg+xml"),Re=function(t,e){var n;function i(){var i,r,o=n.length,a=0,s=0;for(i=0;i<o;++i)a+=(r=n[i]).x,s+=r.y;for(a=a/o-t,s=s/o-e,i=0;i<o;++i)(r=n[i]).x-=a,r.y-=s}return null==t&&(t=0),null==e&&(e=0),i.initialize=function(t){n=t},i.x=function(e){return arguments.length?(t=+e,i):t},i.y=function(t){return arguments.length?(e=+t,i):e},i},Ie=function(t){return function(){return t}},ze=function(){return 1e-6*(Math.random()-.5)};function Be(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,o,a,s,c,l,u,h,d,f=t._root,p={data:i},m=t._x0,g=t._y0,_=t._x1,v=t._y1;if(!f)return t._root=p,t;for(;f.length;)if((l=e>=(o=(m+_)/2))?m=o:_=o,(u=n>=(a=(g+v)/2))?g=a:v=a,r=f,!(f=f[h=u<<1|l]))return r[h]=p,t;if(s=+t._x.call(null,f.data),c=+t._y.call(null,f.data),e===s&&n===c)return p.next=f,r?r[h]=p:t._root=p,t;do{r=r?r[h]=new Array(4):t._root=new Array(4),(l=e>=(o=(m+_)/2))?m=o:_=o,(u=n>=(a=(g+v)/2))?g=a:v=a}while((h=u<<1|l)==(d=(c>=a)<<1|s>=o));return r[d]=f,r[h]=p,t}var Ne=function(t,e,n,i,r){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=r};function De(t){return t[0]}function je(t){return t[1]}function Ue(t,e,n){var i=new Fe(null==e?De:e,null==n?je:n,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function Fe(t,e,n,i,r,o){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=r,this._y1=o,this._root=void 0}function He(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var qe=Ue.prototype=Fe.prototype;function Ge(t){return t.x+t.vx}function We(t){return t.y+t.vy}qe.copy=function(){var t,e,n=new Fe(this._x,this._y,this._x0,this._y0,this._x1,this._y1),i=this._root;if(!i)return n;if(!i.length)return n._root=He(i),n;for(t=[{source:i,target:n._root=new Array(4)}];i=t.pop();)for(var r=0;r<4;++r)(e=i.source[r])&&(e.length?t.push({source:e,target:i.target[r]=new Array(4)}):i.target[r]=He(e));return n},qe.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return Be(this.cover(e,n),e,n,t)},qe.addAll=function(t){var e,n,i,r,o=t.length,a=new Array(o),s=new Array(o),c=1/0,l=1/0,u=-1/0,h=-1/0;for(n=0;n<o;++n)isNaN(i=+this._x.call(null,e=t[n]))||isNaN(r=+this._y.call(null,e))||(a[n]=i,s[n]=r,i<c&&(c=i),i>u&&(u=i),r<l&&(l=r),r>h&&(h=r));if(c>u||l>h)return this;for(this.cover(c,l).cover(u,h),n=0;n<o;++n)Be(this,a[n],s[n],t[n]);return this},qe.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,i=this._y0,r=this._x1,o=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,o=(i=Math.floor(e))+1;else{for(var a,s,c=r-n,l=this._root;n>t||t>=r||i>e||e>=o;)switch(s=(e<i)<<1|t<n,(a=new Array(4))[s]=l,l=a,c*=2,s){case 0:r=n+c,o=i+c;break;case 1:n=r-c,o=i+c;break;case 2:r=n+c,i=o-c;break;case 3:n=r-c,i=o-c}this._root&&this._root.length&&(this._root=l)}return this._x0=n,this._y0=i,this._x1=r,this._y1=o,this},qe.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},qe.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},qe.find=function(t,e,n){var i,r,o,a,s,c,l,u=this._x0,h=this._y0,d=this._x1,f=this._y1,p=[],m=this._root;for(m&&p.push(new Ne(m,u,h,d,f)),null==n?n=1/0:(u=t-n,h=e-n,d=t+n,f=e+n,n*=n);c=p.pop();)if(!(!(m=c.node)||(r=c.x0)>d||(o=c.y0)>f||(a=c.x1)<u||(s=c.y1)<h))if(m.length){var g=(r+a)/2,_=(o+s)/2;p.push(new Ne(m[3],g,_,a,s),new Ne(m[2],r,_,g,s),new Ne(m[1],g,o,a,_),new Ne(m[0],r,o,g,_)),(l=(e>=_)<<1|t>=g)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=c)}else{var v=t-+this._x.call(null,m.data),b=e-+this._y.call(null,m.data),y=v*v+b*b;if(y<n){var x=Math.sqrt(n=y);u=t-x,h=e-x,d=t+x,f=e+x,i=m.data}}return i},qe.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,i,r,o,a,s,c,l,u,h,d,f=this._root,p=this._x0,m=this._y0,g=this._x1,_=this._y1;if(!f)return this;if(f.length)for(;;){if((l=o>=(s=(p+g)/2))?p=s:g=s,(u=a>=(c=(m+_)/2))?m=c:_=c,e=f,!(f=f[h=u<<1|l]))return this;if(!f.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(n=e,d=h)}for(;f.data!==t;)if(i=f,!(f=f.next))return this;return(r=f.next)&&delete f.next,i?(r?i.next=r:delete i.next,this):e?(r?e[h]=r:delete e[h],(f=e[0]||e[1]||e[2]||e[3])&&f===(e[3]||e[2]||e[1]||e[0])&&!f.length&&(n?n[d]=f:this._root=f),this):(this._root=r,this)},qe.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},qe.root=function(){return this._root},qe.size=function(){var t=0;return this.visit(function(e){if(!e.length)do{++t}while(e=e.next)}),t},qe.visit=function(t){var e,n,i,r,o,a,s=[],c=this._root;for(c&&s.push(new Ne(c,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(c=e.node,i=e.x0,r=e.y0,o=e.x1,a=e.y1)&&c.length){var l=(i+o)/2,u=(r+a)/2;(n=c[3])&&s.push(new Ne(n,l,u,o,a)),(n=c[2])&&s.push(new Ne(n,i,u,l,a)),(n=c[1])&&s.push(new Ne(n,l,r,o,u)),(n=c[0])&&s.push(new Ne(n,i,r,l,u))}return this},qe.visitAfter=function(t){var e,n=[],i=[];for(this._root&&n.push(new Ne(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var r=e.node;if(r.length){var o,a=e.x0,s=e.y0,c=e.x1,l=e.y1,u=(a+c)/2,h=(s+l)/2;(o=r[0])&&n.push(new Ne(o,a,s,u,h)),(o=r[1])&&n.push(new Ne(o,u,s,c,h)),(o=r[2])&&n.push(new Ne(o,a,h,u,l)),(o=r[3])&&n.push(new Ne(o,u,h,c,l))}i.push(e)}for(;e=i.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},qe.x=function(t){return arguments.length?(this._x=t,this):this._x},qe.y=function(t){return arguments.length?(this._y=t,this):this._y};var Ve=function(t){var e,n,i=1,r=1;function o(){for(var t,o,s,c,l,u,h,d=e.length,f=0;f<r;++f)for(o=Ue(e,Ge,We).visitAfter(a),t=0;t<d;++t)s=e[t],u=n[s.index],h=u*u,c=s.x+s.vx,l=s.y+s.vy,o.visit(p);function p(t,e,n,r,o){var a=t.data,d=t.r,f=u+d;if(!a)return e>c+f||r<c-f||n>l+f||o<l-f;if(a.index>s.index){var p=c-a.x-a.vx,m=l-a.y-a.vy,g=p*p+m*m;g<f*f&&(0===p&&(g+=(p=ze())*p),0===m&&(g+=(m=ze())*m),g=(f-(g=Math.sqrt(g)))/g*i,s.vx+=(p*=g)*(f=(d*=d)/(h+d)),s.vy+=(m*=g)*f,a.vx-=p*(f=1-f),a.vy-=m*f)}}}function a(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function s(){if(e){var i,r,o=e.length;for(n=new Array(o),i=0;i<o;++i)r=e[i],n[r.index]=+t(r,i,e)}}return"function"!=typeof t&&(t=Ie(null==t?1:+t)),o.initialize=function(t){e=t,s()},o.iterations=function(t){return arguments.length?(r=+t,o):r},o.strength=function(t){return arguments.length?(i=+t,o):i},o.radius=function(e){return arguments.length?(t="function"==typeof e?e:Ie(+e),s(),o):t},o};function Xe(t){return t.index}function Ye(t,e){var n=t.get(e);if(!n)throw new Error("missing: "+e);return n}var Ke=function(t){var e,n,i,r,o,a=Xe,s=function(t){return 1/Math.min(r[t.source.index],r[t.target.index])},c=Ie(30),l=1;function u(i){for(var r=0,a=t.length;r<l;++r)for(var s,c,u,h,d,f,p,m=0;m<a;++m)c=(s=t[m]).source,h=(u=s.target).x+u.vx-c.x-c.vx||ze(),d=u.y+u.vy-c.y-c.vy||ze(),h*=f=((f=Math.sqrt(h*h+d*d))-n[m])/f*i*e[m],d*=f,u.vx-=h*(p=o[m]),u.vy-=d*p,c.vx+=h*(p=1-p),c.vy+=d*p}function h(){if(i){var s,c,l=i.length,u=t.length,h=Object(kt.c)(i,a);for(s=0,r=new Array(l);s<u;++s)(c=t[s]).index=s,"object"!=typeof c.source&&(c.source=Ye(h,c.source)),"object"!=typeof c.target&&(c.target=Ye(h,c.target)),r[c.source.index]=(r[c.source.index]||0)+1,r[c.target.index]=(r[c.target.index]||0)+1;for(s=0,o=new Array(u);s<u;++s)c=t[s],o[s]=r[c.source.index]/(r[c.source.index]+r[c.target.index]);e=new Array(u),d(),n=new Array(u),f()}}function d(){if(i)for(var n=0,r=t.length;n<r;++n)e[n]=+s(t[n],n,t)}function f(){if(i)for(var e=0,r=t.length;e<r;++e)n[e]=+c(t[e],e,t)}return null==t&&(t=[]),u.initialize=function(t){i=t,h()},u.links=function(e){return arguments.length?(t=e,h(),u):t},u.id=function(t){return arguments.length?(a=t,u):a},u.iterations=function(t){return arguments.length?(l=+t,u):l},u.strength=function(t){return arguments.length?(s="function"==typeof t?t:Ie(+t),d(),u):s},u.distance=function(t){return arguments.length?(c="function"==typeof t?t:Ie(+t),f(),u):c},u},Ze=n(26);function Je(t){return t.x}function Qe(t){return t.y}var $e=10,tn=Math.PI*(3-Math.sqrt(5)),en=function(t){var e,n=1,i=.001,r=1-Math.pow(i,1/300),o=0,a=.6,s=Object(kt.c)(),c=Object(Ze.d)(u),l=Object(b.a)("tick","end");function u(){h(),l.call("tick",e),n<i&&(c.stop(),l.call("end",e))}function h(i){var c,l,u=t.length;void 0===i&&(i=1);for(var h=0;h<i;++h)for(n+=(o-n)*r,s.each(function(t){t(n)}),c=0;c<u;++c)null==(l=t[c]).fx?l.x+=l.vx*=a:(l.x=l.fx,l.vx=0),null==l.fy?l.y+=l.vy*=a:(l.y=l.fy,l.vy=0);return e}function d(){for(var e,n=0,i=t.length;n<i;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var r=$e*Math.sqrt(n),o=n*tn;e.x=r*Math.cos(o),e.y=r*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function f(e){return e.initialize&&e.initialize(t),e}return null==t&&(t=[]),d(),e={tick:h,restart:function(){return c.restart(u),e},stop:function(){return c.stop(),e},nodes:function(n){return arguments.length?(t=n,d(),s.each(f),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(i=+t,e):i},alphaDecay:function(t){return arguments.length?(r=+t,e):+r},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},force:function(t,n){return arguments.length>1?(null==n?s.remove(t):s.set(t,f(n)),e):s.get(t)},find:function(e,n,i){var r,o,a,s,c,l=0,u=t.length;for(null==i?i=1/0:i*=i,l=0;l<u;++l)(a=(r=e-(s=t[l]).x)*r+(o=n-s.y)*o)<i&&(c=s,i=a);return c},on:function(t,n){return arguments.length>1?(l.on(t,n),e):l.on(t)}}},nn=function(){var t,e,n,i,r=Ie(-30),o=1,a=1/0,s=.81;function c(i){var r,o=t.length,a=Ue(t,Je,Qe).visitAfter(u);for(n=i,r=0;r<o;++r)e=t[r],a.visit(h)}function l(){if(t){var e,n,o=t.length;for(i=new Array(o),e=0;e<o;++e)n=t[e],i[n.index]=+r(n,e,t)}}function u(t){var e,n,r,o,a,s=0,c=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(s+=e.value,c+=n,r+=n*e.x,o+=n*e.y);t.x=r/c,t.y=o/c}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function h(t,r,c,l){if(!t.value)return!0;var u=t.x-e.x,h=t.y-e.y,d=l-r,f=u*u+h*h;if(d*d/s<f)return f<a&&(0===u&&(f+=(u=ze())*u),0===h&&(f+=(h=ze())*h),f<o&&(f=Math.sqrt(o*f)),e.vx+=u*t.value*n/f,e.vy+=h*t.value*n/f),!0;if(!(t.length||f>=a)){(t.data!==e||t.next)&&(0===u&&(f+=(u=ze())*u),0===h&&(f+=(h=ze())*h),f<o&&(f=Math.sqrt(o*f)));do{t.data!==e&&(d=i[t.data.index]*n/f,e.vx+=u*d,e.vy+=h*d)}while(t=t.next)}}return c.initialize=function(e){t=e,l()},c.strength=function(t){return arguments.length?(r="function"==typeof t?t:Ie(+t),l(),c):r},c.distanceMin=function(t){return arguments.length?(o=t*t,c):Math.sqrt(o)},c.distanceMax=function(t){return arguments.length?(a=t*t,c):Math.sqrt(a)},c.theta=function(t){return arguments.length?(s=t*t,c):Math.sqrt(s)},c},rn=function(t,e,n){var i,r,o,a=Ie(.1);function s(t){for(var a=0,s=i.length;a<s;++a){var c=i[a],l=c.x-e||1e-6,u=c.y-n||1e-6,h=Math.sqrt(l*l+u*u),d=(o[a]-h)*r[a]*t/h;c.vx+=l*d,c.vy+=u*d}}function c(){if(i){var e,n=i.length;for(r=new Array(n),o=new Array(n),e=0;e<n;++e)o[e]=+t(i[e],e,i),r[e]=isNaN(o[e])?0:+a(i[e],e,i)}}return"function"!=typeof t&&(t=Ie(+t)),null==e&&(e=0),null==n&&(n=0),s.initialize=function(t){i=t,c()},s.strength=function(t){return arguments.length?(a="function"==typeof t?t:Ie(+t),c(),s):a},s.radius=function(e){return arguments.length?(t="function"==typeof e?e:Ie(+e),c(),s):t},s.x=function(t){return arguments.length?(e=+t,s):e},s.y=function(t){return arguments.length?(n=+t,s):n},s},on=function(t){var e,n,i,r=Ie(.1);function o(t){for(var r,o=0,a=e.length;o<a;++o)(r=e[o]).vx+=(i[o]-r.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),i=new Array(a),o=0;o<a;++o)n[o]=isNaN(i[o]=+t(e[o],o,e))?0:+r(e[o],o,e)}}return"function"!=typeof t&&(t=Ie(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(r="function"==typeof t?t:Ie(+t),a(),o):r},o.x=function(e){return arguments.length?(t="function"==typeof e?e:Ie(+e),a(),o):t},o},an=function(t){var e,n,i,r=Ie(.1);function o(t){for(var r,o=0,a=e.length;o<a;++o)(r=e[o]).vy+=(i[o]-r.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),i=new Array(a),o=0;o<a;++o)n[o]=isNaN(i[o]=+t(e[o],o,e))?0:+r(e[o],o,e)}}return"function"!=typeof t&&(t=Ie(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(r="function"==typeof t?t:Ie(+t),a(),o):r},o.y=function(e){return arguments.length?(t="function"==typeof e?e:Ie(+e),a(),o):t},o},sn=n(27),cn=function(){return new ln};function ln(){this.reset()}ln.prototype={constructor:ln,reset:function(){this.s=this.t=0},add:function(t){hn(un,t,this.t),hn(this,un.s,this.s),this.s?this.t+=un.t:this.s=un.t},valueOf:function(){return this.s}};var un=new ln;function hn(t,e,n){var i=t.s=e+n,r=i-e,o=i-r;t.t=e-o+(n-r)}var dn=1e-6,fn=Math.PI,pn=fn/2,mn=fn/4,gn=2*fn,_n=180/fn,vn=fn/180,bn=Math.abs,yn=Math.atan,xn=Math.atan2,wn=Math.cos,Mn=Math.ceil,En=Math.exp,Sn=(Math.floor,Math.log),An=Math.pow,Tn=Math.sin,kn=Math.sign||function(t){return t>0?1:t<0?-1:0},Pn=Math.sqrt,Ln=Math.tan;function On(t){return t>1?0:t<-1?fn:Math.acos(t)}function Cn(t){return t>1?pn:t<-1?-pn:Math.asin(t)}function Rn(t){return(t=Tn(t/2))*t}function In(){}function zn(t,e){t&&Nn.hasOwnProperty(t.type)&&Nn[t.type](t,e)}var Bn={Feature:function(t,e){zn(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)zn(n[i].geometry,e)}},Nn={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)t=n[i],e.point(t[0],t[1],t[2])},LineString:function(t,e){Dn(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)Dn(n[i],e,0)},Polygon:function(t,e){jn(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)jn(n[i],e)},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)zn(n[i],e)}};function Dn(t,e,n){var i,r=-1,o=t.length-n;for(e.lineStart();++r<o;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function jn(t,e){var n=-1,i=t.length;for(e.polygonStart();++n<i;)Dn(t[n],e,1);e.polygonEnd()}var Un,Fn,Hn,qn,Gn,Wn=function(t,e){t&&Bn.hasOwnProperty(t.type)?Bn[t.type](t,e):zn(t,e)},Vn=cn(),Xn=cn(),Yn={point:In,lineStart:In,lineEnd:In,polygonStart:function(){Vn.reset(),Yn.lineStart=Kn,Yn.lineEnd=Zn},polygonEnd:function(){var t=+Vn;Xn.add(t<0?gn+t:t),this.lineStart=this.lineEnd=this.point=In},sphere:function(){Xn.add(gn)}};function Kn(){Yn.point=Jn}function Zn(){Qn(Un,Fn)}function Jn(t,e){Yn.point=Qn,Un=t,Fn=e,Hn=t*=vn,qn=wn(e=(e*=vn)/2+mn),Gn=Tn(e)}function Qn(t,e){var n=(t*=vn)-Hn,i=n>=0?1:-1,r=i*n,o=wn(e=(e*=vn)/2+mn),a=Tn(e),s=Gn*a,c=qn*o+s*wn(r),l=s*i*Tn(r);Vn.add(xn(l,c)),Hn=t,qn=o,Gn=a}var $n=function(t){return Xn.reset(),Wn(t,Yn),2*Xn};function ti(t){return[xn(t[1],t[0]),Cn(t[2])]}function ei(t){var e=t[0],n=t[1],i=wn(n);return[i*wn(e),i*Tn(e),Tn(n)]}function ni(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ii(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function ri(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function oi(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function ai(t){var e=Pn(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var si,ci,li,ui,hi,di,fi,pi,mi,gi,_i=cn(),vi={point:bi,lineStart:xi,lineEnd:wi,polygonStart:function(){vi.point=Mi,vi.lineStart=Ei,vi.lineEnd=Si,_i.reset(),Yn.polygonStart()},polygonEnd:function(){Yn.polygonEnd(),vi.point=bi,vi.lineStart=xi,vi.lineEnd=wi,Vn<0?(si=-(li=180),ci=-(ui=90)):_i>dn?ui=90:_i<-dn&&(ci=-90),gi[0]=si,gi[1]=li}};function bi(t,e){mi.push(gi=[si=t,li=t]),e<ci&&(ci=e),e>ui&&(ui=e)}function yi(t,e){var n=ei([t*vn,e*vn]);if(pi){var i=ii(pi,n),r=ii([i[1],-i[0],0],i);ai(r),r=ti(r);var o,a=t-hi,s=a>0?1:-1,c=r[0]*_n*s,l=bn(a)>180;l^(s*hi<c&&c<s*t)?(o=r[1]*_n)>ui&&(ui=o):l^(s*hi<(c=(c+360)%360-180)&&c<s*t)?(o=-r[1]*_n)<ci&&(ci=o):(e<ci&&(ci=e),e>ui&&(ui=e)),l?t<hi?Ai(si,t)>Ai(si,li)&&(li=t):Ai(t,li)>Ai(si,li)&&(si=t):li>=si?(t<si&&(si=t),t>li&&(li=t)):t>hi?Ai(si,t)>Ai(si,li)&&(li=t):Ai(t,li)>Ai(si,li)&&(si=t)}else mi.push(gi=[si=t,li=t]);e<ci&&(ci=e),e>ui&&(ui=e),pi=n,hi=t}function xi(){vi.point=yi}function wi(){gi[0]=si,gi[1]=li,vi.point=bi,pi=null}function Mi(t,e){if(pi){var n=t-hi;_i.add(bn(n)>180?n+(n>0?360:-360):n)}else di=t,fi=e;Yn.point(t,e),yi(t,e)}function Ei(){Yn.lineStart()}function Si(){Mi(di,fi),Yn.lineEnd(),bn(_i)>dn&&(si=-(li=180)),gi[0]=si,gi[1]=li,pi=null}function Ai(t,e){return(e-=t)<0?e+360:e}function Ti(t,e){return t[0]-e[0]}function ki(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}var Pi,Li,Oi,Ci,Ri,Ii,zi,Bi,Ni,Di,ji,Ui,Fi,Hi,qi,Gi,Wi=function(t){var e,n,i,r,o,a,s;if(ui=li=-(si=ci=1/0),mi=[],Wn(t,vi),n=mi.length){for(mi.sort(Ti),e=1,o=[i=mi[0]];e<n;++e)ki(i,(r=mi[e])[0])||ki(i,r[1])?(Ai(i[0],r[1])>Ai(i[0],i[1])&&(i[1]=r[1]),Ai(r[0],i[1])>Ai(i[0],i[1])&&(i[0]=r[0])):o.push(i=r);for(a=-1/0,e=0,i=o[n=o.length-1];e<=n;i=r,++e)r=o[e],(s=Ai(i[1],r[0]))>a&&(a=s,si=r[0],li=i[1])}return mi=gi=null,si===1/0||ci===1/0?[[NaN,NaN],[NaN,NaN]]:[[si,ci],[li,ui]]},Vi={sphere:In,point:Xi,lineStart:Ki,lineEnd:Qi,polygonStart:function(){Vi.lineStart=$i,Vi.lineEnd=tr},polygonEnd:function(){Vi.lineStart=Ki,Vi.lineEnd=Qi}};function Xi(t,e){t*=vn;var n=wn(e*=vn);Yi(n*wn(t),n*Tn(t),Tn(e))}function Yi(t,e,n){Oi+=(t-Oi)/++Pi,Ci+=(e-Ci)/Pi,Ri+=(n-Ri)/Pi}function Ki(){Vi.point=Zi}function Zi(t,e){t*=vn;var n=wn(e*=vn);Hi=n*wn(t),qi=n*Tn(t),Gi=Tn(e),Vi.point=Ji,Yi(Hi,qi,Gi)}function Ji(t,e){t*=vn;var n=wn(e*=vn),i=n*wn(t),r=n*Tn(t),o=Tn(e),a=xn(Pn((a=qi*o-Gi*r)*a+(a=Gi*i-Hi*o)*a+(a=Hi*r-qi*i)*a),Hi*i+qi*r+Gi*o);Li+=a,Ii+=a*(Hi+(Hi=i)),zi+=a*(qi+(qi=r)),Bi+=a*(Gi+(Gi=o)),Yi(Hi,qi,Gi)}function Qi(){Vi.point=Xi}function $i(){Vi.point=er}function tr(){nr(Ui,Fi),Vi.point=Xi}function er(t,e){Ui=t,Fi=e,t*=vn,e*=vn,Vi.point=nr;var n=wn(e);Hi=n*wn(t),qi=n*Tn(t),Gi=Tn(e),Yi(Hi,qi,Gi)}function nr(t,e){t*=vn;var n=wn(e*=vn),i=n*wn(t),r=n*Tn(t),o=Tn(e),a=qi*o-Gi*r,s=Gi*i-Hi*o,c=Hi*r-qi*i,l=Pn(a*a+s*s+c*c),u=Cn(l),h=l&&-u/l;Ni+=h*a,Di+=h*s,ji+=h*c,Li+=u,Ii+=u*(Hi+(Hi=i)),zi+=u*(qi+(qi=r)),Bi+=u*(Gi+(Gi=o)),Yi(Hi,qi,Gi)}var ir=function(t){Pi=Li=Oi=Ci=Ri=Ii=zi=Bi=Ni=Di=ji=0,Wn(t,Vi);var e=Ni,n=Di,i=ji,r=e*e+n*n+i*i;return r<1e-12&&(e=Ii,n=zi,i=Bi,Li<dn&&(e=Oi,n=Ci,i=Ri),(r=e*e+n*n+i*i)<1e-12)?[NaN,NaN]:[xn(n,e)*_n,Cn(i/Pn(r))*_n]},rr=function(t){return function(){return t}},or=function(t,e){function n(n,i){return n=t(n,i),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,i){return(n=e.invert(n,i))&&t.invert(n[0],n[1])}),n};function ar(t,e){return[bn(t)>fn?t+Math.round(-t/gn)*gn:t,e]}function sr(t,e,n){return(t%=gn)?e||n?or(lr(t),ur(e,n)):lr(t):e||n?ur(e,n):ar}function cr(t){return function(e,n){return[(e+=t)>fn?e-gn:e<-fn?e+gn:e,n]}}function lr(t){var e=cr(t);return e.invert=cr(-t),e}function ur(t,e){var n=wn(t),i=Tn(t),r=wn(e),o=Tn(e);function a(t,e){var a=wn(e),s=wn(t)*a,c=Tn(t)*a,l=Tn(e),u=l*n+s*i;return[xn(c*r-u*o,s*n-l*i),Cn(u*r+c*o)]}return a.invert=function(t,e){var a=wn(e),s=wn(t)*a,c=Tn(t)*a,l=Tn(e),u=l*r-c*o;return[xn(c*r+l*o,s*n+u*i),Cn(u*n-s*i)]},a}ar.invert=ar;var hr=function(t){function e(e){return(e=t(e[0]*vn,e[1]*vn))[0]*=_n,e[1]*=_n,e}return t=sr(t[0]*vn,t[1]*vn,t.length>2?t[2]*vn:0),e.invert=function(e){return(e=t.invert(e[0]*vn,e[1]*vn))[0]*=_n,e[1]*=_n,e},e};function dr(t,e,n,i,r,o){if(n){var a=wn(e),s=Tn(e),c=i*n;null==r?(r=e+i*gn,o=e-c/2):(r=fr(a,r),o=fr(a,o),(i>0?r<o:r>o)&&(r+=i*gn));for(var l,u=r;i>0?u>o:u<o;u-=c)l=ti([a,-s*wn(u),-s*Tn(u)]),t.point(l[0],l[1])}}function fr(t,e){(e=ei(e))[0]-=t,ai(e);var n=On(-e[1]);return((-e[2]<0?-n:n)+gn-dn)%gn}var pr=function(){var t,e,n=rr([0,0]),i=rr(90),r=rr(6),o={point:function(n,i){t.push(n=e(n,i)),n[0]*=_n,n[1]*=_n}};function a(){var a=n.apply(this,arguments),s=i.apply(this,arguments)*vn,c=r.apply(this,arguments)*vn;return t=[],e=sr(-a[0]*vn,-a[1]*vn,0).invert,dr(o,s,c,1),a={type:"Polygon",coordinates:[t]},t=e=null,a}return a.center=function(t){return arguments.length?(n="function"==typeof t?t:rr([+t[0],+t[1]]),a):n},a.radius=function(t){return arguments.length?(i="function"==typeof t?t:rr(+t),a):i},a.precision=function(t){return arguments.length?(r="function"==typeof t?t:rr(+t),a):r},a},mr=function(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:In,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},gr=function(t,e){return bn(t[0]-e[0])<dn&&bn(t[1]-e[1])<dn};function _r(t,e,n,i){this.x=t,this.z=e,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}var vr=function(t,e,n,i,r){var o,a,s=[],c=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,i=t[0],a=t[e];if(gr(i,a)){for(r.lineStart(),o=0;o<e;++o)r.point((i=t[o])[0],i[1]);r.lineEnd()}else s.push(n=new _r(i,t,null,!0)),c.push(n.o=new _r(i,null,n,!1)),s.push(n=new _r(a,t,null,!1)),c.push(n.o=new _r(a,null,n,!0))}}),s.length){for(c.sort(e),br(s),br(c),o=0,a=c.length;o<a;++o)c[o].e=n=!n;for(var l,u,h=s[0];;){for(var d=h,f=!0;d.v;)if((d=d.n)===h)return;l=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(f)for(o=0,a=l.length;o<a;++o)r.point((u=l[o])[0],u[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(f)for(l=d.p.z,o=l.length-1;o>=0;--o)r.point((u=l[o])[0],u[1]);else i(d.x,d.p.x,-1,r);d=d.p}l=(d=d.o).z,f=!f}while(!d.v);r.lineEnd()}}};function br(t){if(e=t.length){for(var e,n,i=0,r=t[0];++i<e;)r.n=n=t[i],n.p=r,r=n;r.n=n=t[0],n.p=r}}var yr=cn(),xr=function(t,e){var n=e[0],i=e[1],r=Tn(i),o=[Tn(n),-wn(n),0],a=0,s=0;yr.reset(),1===r?i=pn+dn:-1===r&&(i=-pn-dn);for(var c=0,l=t.length;c<l;++c)if(h=(u=t[c]).length)for(var u,h,d=u[h-1],f=d[0],p=d[1]/2+mn,m=Tn(p),g=wn(p),_=0;_<h;++_,f=b,m=x,g=w,d=v){var v=u[_],b=v[0],y=v[1]/2+mn,x=Tn(y),w=wn(y),M=b-f,E=M>=0?1:-1,S=E*M,A=S>fn,T=m*x;if(yr.add(xn(T*E*Tn(S),g*w+T*wn(S))),a+=A?M+E*gn:M,A^f>=n^b>=n){var k=ii(ei(d),ei(v));ai(k);var P=ii(o,k);ai(P);var L=(A^M>=0?-1:1)*Cn(P[2]);(i>L||i===L&&(k[0]||k[1]))&&(s+=A^M>=0?1:-1)}}return(a<-dn||a<dn&&yr<-dn)^1&s},wr=function(t,e,n,r){return function(o){var a,s,c,l=e(o),u=mr(),h=e(u),d=!1,f={point:p,lineStart:g,lineEnd:_,polygonStart:function(){f.point=v,f.lineStart=b,f.lineEnd=y,s=[],a=[]},polygonEnd:function(){f.point=p,f.lineStart=g,f.lineEnd=_,s=Object(i.n)(s);var t=xr(a,r);s.length?(d||(o.polygonStart(),d=!0),vr(s,Er,t,n,o)):t&&(d||(o.polygonStart(),d=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),d&&(o.polygonEnd(),d=!1),s=a=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function p(e,n){t(e,n)&&o.point(e,n)}function m(t,e){l.point(t,e)}function g(){f.point=m,l.lineStart()}function _(){f.point=p,l.lineEnd()}function v(t,e){c.push([t,e]),h.point(t,e)}function b(){h.lineStart(),c=[]}function y(){v(c[0][0],c[0][1]),h.lineEnd();var t,e,n,i,r=h.clean(),l=u.result(),f=l.length;if(c.pop(),a.push(c),c=null,f)if(1&r){if((e=(n=l[0]).length-1)>0){for(d||(o.polygonStart(),d=!0),o.lineStart(),t=0;t<e;++t)o.point((i=n[t])[0],i[1]);o.lineEnd()}}else f>1&&2&r&&l.push(l.pop().concat(l.shift())),s.push(l.filter(Mr))}return f}};function Mr(t){return t.length>1}function Er(t,e){return((t=t.x)[0]<0?t[1]-pn-dn:pn-t[1])-((e=e.x)[0]<0?e[1]-pn-dn:pn-e[1])}var Sr=wr(function(){return!0},function(t){var e,n=NaN,i=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?fn:-fn,c=bn(o-n);bn(c-fn)<dn?(t.point(n,i=(i+a)/2>0?pn:-pn),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(s,i),t.point(o,i),e=0):r!==s&&c>=fn&&(bn(n-r)<dn&&(n-=r*dn),bn(o-s)<dn&&(o-=s*dn),i=function(t,e,n,i){var r,o,a=Tn(t-n);return bn(a)>dn?yn((Tn(e)*(o=wn(i))*Tn(n)-Tn(i)*(r=wn(e))*Tn(t))/(r*o*a)):(e+i)/2}(n,i,o,a),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(s,i),e=0),t.point(n=o,i=a),r=s},lineEnd:function(){t.lineEnd(),n=i=NaN},clean:function(){return 2-e}}},function(t,e,n,i){var r;if(null==t)r=n*pn,i.point(-fn,r),i.point(0,r),i.point(fn,r),i.point(fn,0),i.point(fn,-r),i.point(0,-r),i.point(-fn,-r),i.point(-fn,0),i.point(-fn,r);else if(bn(t[0]-e[0])>dn){var o=t[0]<e[0]?fn:-fn;r=n*o/2,i.point(-o,r),i.point(0,r),i.point(o,r)}else i.point(e[0],e[1])},[-fn,-pn]);var Ar=function(t){var e=wn(t),n=6*vn,i=e>0,r=bn(e)>dn;function o(t,n){return wn(t)*wn(n)>e}function a(t,n,i){var r=[1,0,0],o=ii(ei(t),ei(n)),a=ni(o,o),s=o[0],c=a-s*s;if(!c)return!i&&t;var l=e*a/c,u=-e*s/c,h=ii(r,o),d=oi(r,l);ri(d,oi(o,u));var f=h,p=ni(d,f),m=ni(f,f),g=p*p-m*(ni(d,d)-1);if(!(g<0)){var _=Pn(g),v=oi(f,(-p-_)/m);if(ri(v,d),v=ti(v),!i)return v;var b,y=t[0],x=n[0],w=t[1],M=n[1];x<y&&(b=y,y=x,x=b);var E=x-y,S=bn(E-fn)<dn;if(!S&&M<w&&(b=w,w=M,M=b),S||E<dn?S?w+M>0^v[1]<(bn(v[0]-y)<dn?w:M):w<=v[1]&&v[1]<=M:E>fn^(y<=v[0]&&v[0]<=x)){var A=oi(f,(-p+_)/m);return ri(A,d),[v,ti(A)]}}}function s(e,n){var r=i?t:fn-t,o=0;return e<-r?o|=1:e>r&&(o|=2),n<-r?o|=4:n>r&&(o|=8),o}return wr(o,function(t){var e,n,c,l,u;return{lineStart:function(){l=c=!1,u=1},point:function(h,d){var f,p=[h,d],m=o(h,d),g=i?m?0:s(h,d):m?s(h+(h<0?fn:-fn),d):0;if(!e&&(l=c=m)&&t.lineStart(),m!==c&&(!(f=a(e,p))||gr(e,f)||gr(p,f))&&(p[0]+=dn,p[1]+=dn,m=o(p[0],p[1])),m!==c)u=0,m?(t.lineStart(),f=a(p,e),t.point(f[0],f[1])):(f=a(e,p),t.point(f[0],f[1]),t.lineEnd()),e=f;else if(r&&e&&i^m){var _;g&n||!(_=a(p,e,!0))||(u=0,i?(t.lineStart(),t.point(_[0][0],_[0][1]),t.point(_[1][0],_[1][1]),t.lineEnd()):(t.point(_[1][0],_[1][1]),t.lineEnd(),t.lineStart(),t.point(_[0][0],_[0][1])))}!m||e&&gr(e,p)||t.point(p[0],p[1]),e=p,c=m,n=g},lineEnd:function(){c&&t.lineEnd(),e=null},clean:function(){return u|(l&&c)<<1}}},function(e,i,r,o){dr(o,t,n,r,e,i)},i?[0,-t]:[-fn,t-fn])},Tr=function(t,e,n,i,r,o){var a,s=t[0],c=t[1],l=0,u=1,h=e[0]-s,d=e[1]-c;if(a=n-s,h||!(a>0)){if(a/=h,h<0){if(a<l)return;a<u&&(u=a)}else if(h>0){if(a>u)return;a>l&&(l=a)}if(a=r-s,h||!(a<0)){if(a/=h,h<0){if(a>u)return;a>l&&(l=a)}else if(h>0){if(a<l)return;a<u&&(u=a)}if(a=i-c,d||!(a>0)){if(a/=d,d<0){if(a<l)return;a<u&&(u=a)}else if(d>0){if(a>u)return;a>l&&(l=a)}if(a=o-c,d||!(a<0)){if(a/=d,d<0){if(a>u)return;a>l&&(l=a)}else if(d>0){if(a<l)return;a<u&&(u=a)}return l>0&&(t[0]=s+l*h,t[1]=c+l*d),u<1&&(e[0]=s+u*h,e[1]=c+u*d),!0}}}}},kr=1e9,Pr=-kr;function Lr(t,e,n,r){function o(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function a(i,o,a,c){var u=0,h=0;if(null==i||(u=s(i,a))!==(h=s(o,a))||l(i,o)<0^a>0)do{c.point(0===u||3===u?t:n,u>1?r:e)}while((u=(u+a+4)%4)!==h);else c.point(o[0],o[1])}function s(i,r){return bn(i[0]-t)<dn?r>0?0:3:bn(i[0]-n)<dn?r>0?2:1:bn(i[1]-e)<dn?r>0?1:0:r>0?3:2}function c(t,e){return l(t.x,e.x)}function l(t,e){var n=s(t,1),i=s(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){var l,u,h,d,f,p,m,g,_,v,b,y=s,x=mr(),w={point:M,lineStart:function(){w.point=E,u&&u.push(h=[]);v=!0,_=!1,m=g=NaN},lineEnd:function(){l&&(E(d,f),p&&_&&x.rejoin(),l.push(x.result()));w.point=M,_&&y.lineEnd()},polygonStart:function(){y=x,l=[],u=[],b=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=u.length;n<i;++n)for(var o,a,s=u[n],c=1,l=s.length,h=s[0],d=h[0],f=h[1];c<l;++c)o=d,a=f,h=s[c],d=h[0],f=h[1],a<=r?f>r&&(d-o)*(r-a)>(f-a)*(t-o)&&++e:f<=r&&(d-o)*(r-a)<(f-a)*(t-o)&&--e;return e}(),n=b&&e,o=(l=Object(i.n)(l)).length;(n||o)&&(s.polygonStart(),n&&(s.lineStart(),a(null,null,1,s),s.lineEnd()),o&&vr(l,c,e,a,s),s.polygonEnd());y=s,l=u=h=null}};function M(t,e){o(t,e)&&y.point(t,e)}function E(i,a){var s=o(i,a);if(u&&h.push([i,a]),v)d=i,f=a,p=s,v=!1,s&&(y.lineStart(),y.point(i,a));else if(s&&_)y.point(i,a);else{var c=[m=Math.max(Pr,Math.min(kr,m)),g=Math.max(Pr,Math.min(kr,g))],l=[i=Math.max(Pr,Math.min(kr,i)),a=Math.max(Pr,Math.min(kr,a))];Tr(c,l,t,e,n,r)?(_||(y.lineStart(),y.point(c[0],c[1])),y.point(l[0],l[1]),s||y.lineEnd(),b=!1):s&&(y.lineStart(),y.point(i,a),b=!1)}m=i,g=a,_=s}return w}}var Or,Cr,Rr,Ir=function(){var t,e,n,i=0,r=0,o=960,a=500;return n={stream:function(n){return t&&e===n?t:t=Lr(i,r,o,a)(e=n)},extent:function(s){return arguments.length?(i=+s[0][0],r=+s[0][1],o=+s[1][0],a=+s[1][1],t=e=null,n):[[i,r],[o,a]]}}},zr=cn(),Br={sphere:In,point:In,lineStart:function(){Br.point=Dr,Br.lineEnd=Nr},lineEnd:In,polygonStart:In,polygonEnd:In};function Nr(){Br.point=Br.lineEnd=In}function Dr(t,e){Or=t*=vn,Cr=Tn(e*=vn),Rr=wn(e),Br.point=jr}function jr(t,e){t*=vn;var n=Tn(e*=vn),i=wn(e),r=bn(t-Or),o=wn(r),a=i*Tn(r),s=Rr*n-Cr*i*o,c=Cr*n+Rr*i*o;zr.add(xn(Pn(a*a+s*s),c)),Or=t,Cr=n,Rr=i}var Ur=function(t){return zr.reset(),Wn(t,Br),+zr},Fr=[null,null],Hr={type:"LineString",coordinates:Fr},qr=function(t,e){return Fr[0]=t,Fr[1]=e,Ur(Hr)},Gr={Feature:function(t,e){return Vr(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)if(Vr(n[i].geometry,e))return!0;return!1}},Wr={Sphere:function(){return!0},Point:function(t,e){return Xr(t.coordinates,e)},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)if(Xr(n[i],e))return!0;return!1},LineString:function(t,e){return Yr(t.coordinates,e)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)if(Yr(n[i],e))return!0;return!1},Polygon:function(t,e){return Kr(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)if(Kr(n[i],e))return!0;return!1},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)if(Vr(n[i],e))return!0;return!1}};function Vr(t,e){return!(!t||!Wr.hasOwnProperty(t.type))&&Wr[t.type](t,e)}function Xr(t,e){return 0===qr(t,e)}function Yr(t,e){var n=qr(t[0],t[1]);return qr(t[0],e)+qr(e,t[1])<=n+dn}function Kr(t,e){return!!xr(t.map(Zr),Jr(e))}function Zr(t){return(t=t.map(Jr)).pop(),t}function Jr(t){return[t[0]*vn,t[1]*vn]}var Qr=function(t,e){return(t&&Gr.hasOwnProperty(t.type)?Gr[t.type]:Vr)(t,e)};function $r(t,e,n){var r=Object(i.s)(t,e-dn,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function to(t,e,n){var r=Object(i.s)(t,e-dn,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function eo(){var t,e,n,r,o,a,s,c,l,u,h,d,f=10,p=f,m=90,g=360,_=2.5;function v(){return{type:"MultiLineString",coordinates:b()}}function b(){return Object(i.s)(Mn(r/m)*m,n,m).map(h).concat(Object(i.s)(Mn(c/g)*g,s,g).map(d)).concat(Object(i.s)(Mn(e/f)*f,t,f).filter(function(t){return bn(t%m)>dn}).map(l)).concat(Object(i.s)(Mn(a/p)*p,o,p).filter(function(t){return bn(t%g)>dn}).map(u))}return v.lines=function(){return b().map(function(t){return{type:"LineString",coordinates:t}})},v.outline=function(){return{type:"Polygon",coordinates:[h(r).concat(d(s).slice(1),h(n).reverse().slice(1),d(c).reverse().slice(1))]}},v.extent=function(t){return arguments.length?v.extentMajor(t).extentMinor(t):v.extentMinor()},v.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],c=+t[0][1],s=+t[1][1],r>n&&(t=r,r=n,n=t),c>s&&(t=c,c=s,s=t),v.precision(_)):[[r,c],[n,s]]},v.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],a=+n[0][1],o=+n[1][1],e>t&&(n=e,e=t,t=n),a>o&&(n=a,a=o,o=n),v.precision(_)):[[e,a],[t,o]]},v.step=function(t){return arguments.length?v.stepMajor(t).stepMinor(t):v.stepMinor()},v.stepMajor=function(t){return arguments.length?(m=+t[0],g=+t[1],v):[m,g]},v.stepMinor=function(t){return arguments.length?(f=+t[0],p=+t[1],v):[f,p]},v.precision=function(i){return arguments.length?(_=+i,l=$r(a,o,90),u=to(e,t,_),h=$r(c,s,90),d=to(r,n,_),v):_},v.extentMajor([[-180,-90+dn],[180,90-dn]]).extentMinor([[-180,-80-dn],[180,80+dn]])}function no(){return eo()()}var io,ro,oo,ao,so=function(t,e){var n=t[0]*vn,i=t[1]*vn,r=e[0]*vn,o=e[1]*vn,a=wn(i),s=Tn(i),c=wn(o),l=Tn(o),u=a*wn(n),h=a*Tn(n),d=c*wn(r),f=c*Tn(r),p=2*Cn(Pn(Rn(o-i)+a*c*Rn(r-n))),m=Tn(p),g=p?function(t){var e=Tn(t*=p)/m,n=Tn(p-t)/m,i=n*u+e*d,r=n*h+e*f,o=n*s+e*l;return[xn(r,i)*_n,xn(o,Pn(i*i+r*r))*_n]}:function(){return[n*_n,i*_n]};return g.distance=p,g},co=function(t){return t},lo=cn(),uo=cn(),ho={point:In,lineStart:In,lineEnd:In,polygonStart:function(){ho.lineStart=fo,ho.lineEnd=go},polygonEnd:function(){ho.lineStart=ho.lineEnd=ho.point=In,lo.add(bn(uo)),uo.reset()},result:function(){var t=lo/2;return lo.reset(),t}};function fo(){ho.point=po}function po(t,e){ho.point=mo,io=oo=t,ro=ao=e}function mo(t,e){uo.add(ao*t-oo*e),oo=t,ao=e}function go(){mo(io,ro)}var _o=ho,vo=1/0,bo=vo,yo=-vo,xo=yo;var wo,Mo,Eo,So,Ao={point:function(t,e){t<vo&&(vo=t);t>yo&&(yo=t);e<bo&&(bo=e);e>xo&&(xo=e)},lineStart:In,lineEnd:In,polygonStart:In,polygonEnd:In,result:function(){var t=[[vo,bo],[yo,xo]];return yo=xo=-(bo=vo=1/0),t}},To=0,ko=0,Po=0,Lo=0,Oo=0,Co=0,Ro=0,Io=0,zo=0,Bo={point:No,lineStart:Do,lineEnd:Fo,polygonStart:function(){Bo.lineStart=Ho,Bo.lineEnd=qo},polygonEnd:function(){Bo.point=No,Bo.lineStart=Do,Bo.lineEnd=Fo},result:function(){var t=zo?[Ro/zo,Io/zo]:Co?[Lo/Co,Oo/Co]:Po?[To/Po,ko/Po]:[NaN,NaN];return To=ko=Po=Lo=Oo=Co=Ro=Io=zo=0,t}};function No(t,e){To+=t,ko+=e,++Po}function Do(){Bo.point=jo}function jo(t,e){Bo.point=Uo,No(Eo=t,So=e)}function Uo(t,e){var n=t-Eo,i=e-So,r=Pn(n*n+i*i);Lo+=r*(Eo+t)/2,Oo+=r*(So+e)/2,Co+=r,No(Eo=t,So=e)}function Fo(){Bo.point=No}function Ho(){Bo.point=Go}function qo(){Wo(wo,Mo)}function Go(t,e){Bo.point=Wo,No(wo=Eo=t,Mo=So=e)}function Wo(t,e){var n=t-Eo,i=e-So,r=Pn(n*n+i*i);Lo+=r*(Eo+t)/2,Oo+=r*(So+e)/2,Co+=r,Ro+=(r=So*t-Eo*e)*(Eo+t),Io+=r*(So+e),zo+=3*r,No(Eo=t,So=e)}var Vo=Bo;function Xo(t){this._context=t}Xo.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,gn)}},result:In};var Yo,Ko,Zo,Jo,Qo,$o=cn(),ta={point:In,lineStart:function(){ta.point=ea},lineEnd:function(){Yo&&na(Ko,Zo),ta.point=In},polygonStart:function(){Yo=!0},polygonEnd:function(){Yo=null},result:function(){var t=+$o;return $o.reset(),t}};function ea(t,e){ta.point=na,Ko=Jo=t,Zo=Qo=e}function na(t,e){Jo-=t,Qo-=e,$o.add(Pn(Jo*Jo+Qo*Qo)),Jo=t,Qo=e}var ia=ta;function ra(){this._string=[]}function oa(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}ra.prototype={_radius:4.5,_circle:oa(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=oa(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var aa=function(t,e){var n,i,r=4.5;function o(t){return t&&("function"==typeof r&&i.pointRadius(+r.apply(this,arguments)),Wn(t,n(i))),i.result()}return o.area=function(t){return Wn(t,n(_o)),_o.result()},o.measure=function(t){return Wn(t,n(ia)),ia.result()},o.bounds=function(t){return Wn(t,n(Ao)),Ao.result()},o.centroid=function(t){return Wn(t,n(Vo)),Vo.result()},o.projection=function(e){return arguments.length?(n=null==e?(t=null,co):(t=e).stream,o):t},o.context=function(t){return arguments.length?(i=null==t?(e=null,new ra):new Xo(e=t),"function"!=typeof r&&i.pointRadius(r),o):e},o.pointRadius=function(t){return arguments.length?(r="function"==typeof t?t:(i.pointRadius(+t),+t),o):r},o.projection(t).context(e)},sa=function(t){return{stream:ca(t)}};function ca(t){return function(e){var n=new la;for(var i in t)n[i]=t[i];return n.stream=e,n}}function la(){}function ua(t,e,n){var i=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),Wn(n,t.stream(Ao)),e(Ao.result()),null!=i&&t.clipExtent(i),t}function ha(t,e,n){return ua(t,function(n){var i=e[1][0]-e[0][0],r=e[1][1]-e[0][1],o=Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])),a=+e[0][0]+(i-o*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(r-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,s])},n)}function da(t,e,n){return ha(t,[[0,0],e],n)}function fa(t,e,n){return ua(t,function(n){var i=+e,r=i/(n[1][0]-n[0][0]),o=(i-r*(n[1][0]+n[0][0]))/2,a=-r*n[0][1];t.scale(150*r).translate([o,a])},n)}function pa(t,e,n){return ua(t,function(n){var i=+e,r=i/(n[1][1]-n[0][1]),o=-r*n[0][0],a=(i-r*(n[1][1]+n[0][1]))/2;t.scale(150*r).translate([o,a])},n)}la.prototype={constructor:la,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var ma=16,ga=wn(30*vn),_a=function(t,e){return+e?function(t,e){function n(i,r,o,a,s,c,l,u,h,d,f,p,m,g){var _=l-i,v=u-r,b=_*_+v*v;if(b>4*e&&m--){var y=a+d,x=s+f,w=c+p,M=Pn(y*y+x*x+w*w),E=Cn(w/=M),S=bn(bn(w)-1)<dn||bn(o-h)<dn?(o+h)/2:xn(x,y),A=t(S,E),T=A[0],k=A[1],P=T-i,L=k-r,O=v*P-_*L;(O*O/b>e||bn((_*P+v*L)/b-.5)>.3||a*d+s*f+c*p<ga)&&(n(i,r,o,a,s,c,T,k,S,y/=M,x/=M,w,m,g),g.point(T,k),n(T,k,S,y,x,w,l,u,h,d,f,p,m,g))}}return function(e){var i,r,o,a,s,c,l,u,h,d,f,p,m={point:g,lineStart:_,lineEnd:b,polygonStart:function(){e.polygonStart(),m.lineStart=y},polygonEnd:function(){e.polygonEnd(),m.lineStart=_}};function g(n,i){n=t(n,i),e.point(n[0],n[1])}function _(){u=NaN,m.point=v,e.lineStart()}function v(i,r){var o=ei([i,r]),a=t(i,r);n(u,h,l,d,f,p,u=a[0],h=a[1],l=i,d=o[0],f=o[1],p=o[2],ma,e),e.point(u,h)}function b(){m.point=g,e.lineEnd()}function y(){_(),m.point=x,m.lineEnd=w}function x(t,e){v(i=t,e),r=u,o=h,a=d,s=f,c=p,m.point=v}function w(){n(u,h,l,d,f,p,r,o,i,a,s,c,ma,e),m.lineEnd=b,b()}return m}}(t,e):function(t){return ca({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)};var va=ca({point:function(t,e){this.stream.point(t*vn,e*vn)}});function ba(t,e,n,i){var r=wn(i),o=Tn(i),a=r*t,s=o*t,c=r/t,l=o/t,u=(o*n-r*e)/t,h=(o*e+r*n)/t;function d(t,i){return[a*t-s*i+e,n-s*t-a*i]}return d.invert=function(t,e){return[c*t-l*e+u,h-l*t-c*e]},d}function ya(t){return xa(function(){return t})()}function xa(t){var e,n,i,r,o,a,s,c,l,u,h=150,d=480,f=250,p=0,m=0,g=0,_=0,v=0,b=0,y=null,x=Sr,w=null,M=co,E=.5;function S(t){return c(t[0]*vn,t[1]*vn)}function A(t){return(t=c.invert(t[0],t[1]))&&[t[0]*_n,t[1]*_n]}function T(){var t=ba(h,0,0,b).apply(null,e(p,m)),i=(b?ba:function(t,e,n){function i(i,r){return[e+t*i,n-t*r]}return i.invert=function(i,r){return[(i-e)/t,(n-r)/t]},i})(h,d-t[0],f-t[1],b);return n=sr(g,_,v),s=or(e,i),c=or(n,s),a=_a(s,E),k()}function k(){return l=u=null,S}return S.stream=function(t){return l&&u===t?l:l=va(function(t){return ca({point:function(e,n){var i=t(e,n);return this.stream.point(i[0],i[1])}})}(n)(x(a(M(u=t)))))},S.preclip=function(t){return arguments.length?(x=t,y=void 0,k()):x},S.postclip=function(t){return arguments.length?(M=t,w=i=r=o=null,k()):M},S.clipAngle=function(t){return arguments.length?(x=+t?Ar(y=t*vn):(y=null,Sr),k()):y*_n},S.clipExtent=function(t){return arguments.length?(M=null==t?(w=i=r=o=null,co):Lr(w=+t[0][0],i=+t[0][1],r=+t[1][0],o=+t[1][1]),k()):null==w?null:[[w,i],[r,o]]},S.scale=function(t){return arguments.length?(h=+t,T()):h},S.translate=function(t){return arguments.length?(d=+t[0],f=+t[1],T()):[d,f]},S.center=function(t){return arguments.length?(p=t[0]%360*vn,m=t[1]%360*vn,T()):[p*_n,m*_n]},S.rotate=function(t){return arguments.length?(g=t[0]%360*vn,_=t[1]%360*vn,v=t.length>2?t[2]%360*vn:0,T()):[g*_n,_*_n,v*_n]},S.angle=function(t){return arguments.length?(b=t%360*vn,T()):b*_n},S.precision=function(t){return arguments.length?(a=_a(s,E=t*t),k()):Pn(E)},S.fitExtent=function(t,e){return ha(S,t,e)},S.fitSize=function(t,e){return da(S,t,e)},S.fitWidth=function(t,e){return fa(S,t,e)},S.fitHeight=function(t,e){return pa(S,t,e)},function(){return e=t.apply(this,arguments),S.invert=e.invert&&A,T()}}function wa(t){var e=0,n=fn/3,i=xa(t),r=i(e,n);return r.parallels=function(t){return arguments.length?i(e=t[0]*vn,n=t[1]*vn):[e*_n,n*_n]},r}function Ma(t,e){var n=Tn(t),i=(n+Tn(e))/2;if(bn(i)<dn)return function(t){var e=wn(t);function n(t,n){return[t*e,Tn(n)/e]}return n.invert=function(t,n){return[t/e,Cn(n*e)]},n}(t);var r=1+n*(2*i-n),o=Pn(r)/i;function a(t,e){var n=Pn(r-2*i*Tn(e))/i;return[n*Tn(t*=i),o-n*wn(t)]}return a.invert=function(t,e){var n=o-e;return[xn(t,bn(n))/i*kn(n),Cn((r-(t*t+n*n)*i*i)/(2*i))]},a}var Ea=function(){return wa(Ma).scale(155.424).center([0,33.6442])},Sa=function(){return Ea().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])};var Aa=function(){var t,e,n,i,r,o,a=Sa(),s=Ea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=Ea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,e){o=[t,e]}};function u(t){var e=t[0],a=t[1];return o=null,n.point(e,a),o||(i.point(e,a),o)||(r.point(e,a),o)}function h(){return t=e=null,u}return u.invert=function(t){var e=a.scale(),n=a.translate(),i=(t[0]-n[0])/e,r=(t[1]-n[1])/e;return(r>=.12&&r<.234&&i>=-.425&&i<-.214?s:r>=.166&&r<.234&&i>=-.214&&i<-.115?c:a).invert(t)},u.stream=function(n){return t&&e===n?t:(i=[a.stream(e=n),s.stream(n),c.stream(n)],r=i.length,t={point:function(t,e){for(var n=-1;++n<r;)i[n].point(t,e)},sphere:function(){for(var t=-1;++t<r;)i[t].sphere()},lineStart:function(){for(var t=-1;++t<r;)i[t].lineStart()},lineEnd:function(){for(var t=-1;++t<r;)i[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<r;)i[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<r;)i[t].polygonEnd()}});var i,r},u.precision=function(t){return arguments.length?(a.precision(t),s.precision(t),c.precision(t),h()):a.precision()},u.scale=function(t){return arguments.length?(a.scale(t),s.scale(.35*t),c.scale(t),u.translate(a.translate())):a.scale()},u.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),o=+t[0],u=+t[1];return n=a.translate(t).clipExtent([[o-.455*e,u-.238*e],[o+.455*e,u+.238*e]]).stream(l),i=s.translate([o-.307*e,u+.201*e]).clipExtent([[o-.425*e+dn,u+.12*e+dn],[o-.214*e-dn,u+.234*e-dn]]).stream(l),r=c.translate([o-.205*e,u+.212*e]).clipExtent([[o-.214*e+dn,u+.166*e+dn],[o-.115*e-dn,u+.234*e-dn]]).stream(l),h()},u.fitExtent=function(t,e){return ha(u,t,e)},u.fitSize=function(t,e){return da(u,t,e)},u.fitWidth=function(t,e){return fa(u,t,e)},u.fitHeight=function(t,e){return pa(u,t,e)},u.scale(1070)};function Ta(t){return function(e,n){var i=wn(e),r=wn(n),o=t(i*r);return[o*r*Tn(e),o*Tn(n)]}}function ka(t){return function(e,n){var i=Pn(e*e+n*n),r=t(i),o=Tn(r),a=wn(r);return[xn(e*o,i*a),Cn(i&&n*o/i)]}}var Pa=Ta(function(t){return Pn(2/(1+t))});Pa.invert=ka(function(t){return 2*Cn(t/2)});var La=function(){return ya(Pa).scale(124.75).clipAngle(179.999)},Oa=Ta(function(t){return(t=On(t))&&t/Tn(t)});Oa.invert=ka(function(t){return t});var Ca=function(){return ya(Oa).scale(79.4188).clipAngle(179.999)};function Ra(t,e){return[t,Sn(Ln((pn+e)/2))]}Ra.invert=function(t,e){return[t,2*yn(En(e))-pn]};var Ia=function(){return za(Ra).scale(961/gn)};function za(t){var e,n,i,r=ya(t),o=r.center,a=r.scale,s=r.translate,c=r.clipExtent,l=null;function u(){var o=fn*a(),s=r(hr(r.rotate()).invert([0,0]));return c(null==l?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:t===Ra?[[Math.max(s[0]-o,l),e],[Math.min(s[0]+o,n),i]]:[[l,Math.max(s[1]-o,e)],[n,Math.min(s[1]+o,i)]])}return r.scale=function(t){return arguments.length?(a(t),u()):a()},r.translate=function(t){return arguments.length?(s(t),u()):s()},r.center=function(t){return arguments.length?(o(t),u()):o()},r.clipExtent=function(t){return arguments.length?(null==t?l=e=n=i=null:(l=+t[0][0],e=+t[0][1],n=+t[1][0],i=+t[1][1]),u()):null==l?null:[[l,e],[n,i]]},u()}function Ba(t){return Ln((pn+t)/2)}function Na(t,e){var n=wn(t),i=t===e?Tn(t):Sn(n/wn(e))/Sn(Ba(e)/Ba(t)),r=n*An(Ba(t),i)/i;if(!i)return Ra;function o(t,e){r>0?e<-pn+dn&&(e=-pn+dn):e>pn-dn&&(e=pn-dn);var n=r/An(Ba(e),i);return[n*Tn(i*t),r-n*wn(i*t)]}return o.invert=function(t,e){var n=r-e,o=kn(i)*Pn(t*t+n*n);return[xn(t,bn(n))/i*kn(n),2*yn(An(r/o,1/i))-pn]},o}var Da=function(){return wa(Na).scale(109.5).parallels([30,30])};function ja(t,e){return[t,e]}ja.invert=ja;var Ua=function(){return ya(ja).scale(152.63)};function Fa(t,e){var n=wn(t),i=t===e?Tn(t):(n-wn(e))/(e-t),r=n/i+t;if(bn(i)<dn)return ja;function o(t,e){var n=r-e,o=i*t;return[n*Tn(o),r-n*wn(o)]}return o.invert=function(t,e){var n=r-e;return[xn(t,bn(n))/i*kn(n),r-kn(i)*Pn(t*t+n*n)]},o}var Ha=function(){return wa(Fa).scale(131.154).center([0,13.9389])},qa=1.340264,Ga=-.081106,Wa=893e-6,Va=.003796,Xa=Pn(3)/2;function Ya(t,e){var n=Cn(Xa*Tn(e)),i=n*n,r=i*i*i;return[t*wn(n)/(Xa*(qa+3*Ga*i+r*(7*Wa+9*Va*i))),n*(qa+Ga*i+r*(Wa+Va*i))]}Ya.invert=function(t,e){for(var n,i=e,r=i*i,o=r*r*r,a=0;a<12&&(o=(r=(i-=n=(i*(qa+Ga*r+o*(Wa+Va*r))-e)/(qa+3*Ga*r+o*(7*Wa+9*Va*r)))*i)*r*r,!(bn(n)<1e-12));++a);return[Xa*t*(qa+3*Ga*r+o*(7*Wa+9*Va*r))/wn(i),Cn(Tn(i)/Xa)]};var Ka=function(){return ya(Ya).scale(177.158)};function Za(t,e){var n=wn(e),i=wn(t)*n;return[n*Tn(t)/i,Tn(e)/i]}Za.invert=ka(yn);var Ja=function(){return ya(Za).scale(144.049).clipAngle(60)};function Qa(t,e,n,i){return 1===t&&1===e&&0===n&&0===i?co:ca({point:function(r,o){this.stream.point(r*t+n,o*e+i)}})}var $a=function(){var t,e,n,i,r,o,a=1,s=0,c=0,l=1,u=1,h=co,d=null,f=co;function p(){return i=r=null,o}return o={stream:function(t){return i&&r===t?i:i=h(f(r=t))},postclip:function(i){return arguments.length?(f=i,d=t=e=n=null,p()):f},clipExtent:function(i){return arguments.length?(f=null==i?(d=t=e=n=null,co):Lr(d=+i[0][0],t=+i[0][1],e=+i[1][0],n=+i[1][1]),p()):null==d?null:[[d,t],[e,n]]},scale:function(t){return arguments.length?(h=Qa((a=+t)*l,a*u,s,c),p()):a},translate:function(t){return arguments.length?(h=Qa(a*l,a*u,s=+t[0],c=+t[1]),p()):[s,c]},reflectX:function(t){return arguments.length?(h=Qa(a*(l=t?-1:1),a*u,s,c),p()):l<0},reflectY:function(t){return arguments.length?(h=Qa(a*l,a*(u=t?-1:1),s,c),p()):u<0},fitExtent:function(t,e){return ha(o,t,e)},fitSize:function(t,e){return da(o,t,e)},fitWidth:function(t,e){return fa(o,t,e)},fitHeight:function(t,e){return pa(o,t,e)}}};function ts(t,e){var n=e*e,i=n*n;return[t*(.8707-.131979*n+i*(i*(.003971*n-.001529*i)-.013791)),e*(1.007226+n*(.015085+i*(.028874*n-.044475-.005916*i)))]}ts.invert=function(t,e){var n,i=e,r=25;do{var o=i*i,a=o*o;i-=n=(i*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-e)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(bn(n)>dn&&--r>0);return[t/(.8707+(o=i*i)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),i]};var es=function(){return ya(ts).scale(175.295)};function ns(t,e){return[wn(e)*Tn(t),Tn(e)]}ns.invert=ka(Cn);var is=function(){return ya(ns).scale(249.5).clipAngle(90+dn)};function rs(t,e){var n=wn(e),i=1+wn(t)*n;return[n*Tn(t)/i,Tn(e)/i]}rs.invert=ka(function(t){return 2*yn(t)});var os=function(){return ya(rs).scale(250).clipAngle(142)};function as(t,e){return[Sn(Ln((pn+e)/2)),-t]}as.invert=function(t,e){return[-e,2*yn(En(t))-pn]};var ss=function(){var t=za(as),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)};function cs(t,e){return t.parent===e.parent?1:2}function ls(t,e){return t+e.x}function us(t,e){return Math.max(t,e.y)}var hs=function(){var t=cs,e=1,n=1,i=!1;function r(r){var o,a=0;r.eachAfter(function(e){var n=e.children;n?(e.x=function(t){return t.reduce(ls,0)/t.length}(n),e.y=function(t){return 1+t.reduce(us,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)});var s=function(t){for(var e;e=t.children;)t=e[0];return t}(r),c=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(r),l=s.x-t(s,c)/2,u=c.x+t(c,s)/2;return r.eachAfter(i?function(t){t.x=(t.x-r.x)*e,t.y=(r.y-t.y)*n}:function(t){t.x=(t.x-l)/(u-l)*e,t.y=(1-(r.y?t.y/r.y:1))*n})}return r.separation=function(e){return arguments.length?(t=e,r):t},r.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],r):i?null:[e,n]},r.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],r):i?[e,n]:null},r};function ds(t){var e=0,n=t.children,i=n&&n.length;if(i)for(;--i>=0;)e+=n[i].value;else e=1;t.value=e}function fs(t,e){var n,i,r,o,a,s=new _s(t),c=+t.value&&(s.value=t.value),l=[s];for(null==e&&(e=ps);n=l.pop();)if(c&&(n.value=+n.data.value),(r=e(n.data))&&(a=r.length))for(n.children=new Array(a),o=a-1;o>=0;--o)l.push(i=n.children[o]=new _s(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(gs)}function ps(t){return t.children}function ms(t){t.data=t.data.data}function gs(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function _s(t){this.data=t,this.depth=this.height=0,this.parent=null}_s.prototype=fs.prototype={constructor:_s,count:function(){return this.eachAfter(ds)},each:function(t){var e,n,i,r,o=this,a=[o];do{for(e=a.reverse(),a=[];o=e.pop();)if(t(o),n=o.children)for(i=0,r=n.length;i<r;++i)a.push(n[i])}while(a.length);return this},eachAfter:function(t){for(var e,n,i,r=this,o=[r],a=[];r=o.pop();)if(a.push(r),e=r.children)for(n=0,i=e.length;n<i;++n)o.push(e[n]);for(;r=a.pop();)t(r);return this},eachBefore:function(t){for(var e,n,i=this,r=[i];i=r.pop();)if(t(i),e=i.children)for(n=e.length-1;n>=0;--n)r.push(e[n]);return this},sum:function(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;for(t=n.pop(),e=i.pop();t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each(function(e){t.push(e)}),t},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e},copy:function(){return fs(this).eachBefore(ms)}};var vs=Array.prototype.slice;var bs=function(t){for(var e,n,i=0,r=(t=function(t){for(var e,n,i=t.length;i;)n=Math.random()*i--|0,e=t[i],t[i]=t[n],t[n]=e;return t}(vs.call(t))).length,o=[];i<r;)e=t[i],n&&ws(n,e)?++i:(n=Es(o=ys(o,e)),i=0);return n};function ys(t,e){var n,i;if(Ms(e,t))return[e];for(n=0;n<t.length;++n)if(xs(e,t[n])&&Ms(Ss(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(i=n+1;i<t.length;++i)if(xs(Ss(t[n],t[i]),e)&&xs(Ss(t[n],e),t[i])&&xs(Ss(t[i],e),t[n])&&Ms(As(t[n],t[i],e),t))return[t[n],t[i],e];throw new Error}function xs(t,e){var n=t.r-e.r,i=e.x-t.x,r=e.y-t.y;return n<0||n*n<i*i+r*r}function ws(t,e){var n=t.r-e.r+1e-6,i=e.x-t.x,r=e.y-t.y;return n>0&&n*n>i*i+r*r}function Ms(t,e){for(var n=0;n<e.length;++n)if(!ws(t,e[n]))return!1;return!0}function Es(t){switch(t.length){case 1:return{x:(e=t[0]).x,y:e.y,r:e.r};case 2:return Ss(t[0],t[1]);case 3:return As(t[0],t[1],t[2])}var e}function Ss(t,e){var n=t.x,i=t.y,r=t.r,o=e.x,a=e.y,s=e.r,c=o-n,l=a-i,u=s-r,h=Math.sqrt(c*c+l*l);return{x:(n+o+c/h*u)/2,y:(i+a+l/h*u)/2,r:(h+r+s)/2}}function As(t,e,n){var i=t.x,r=t.y,o=t.r,a=e.x,s=e.y,c=e.r,l=n.x,u=n.y,h=n.r,d=i-a,f=i-l,p=r-s,m=r-u,g=c-o,_=h-o,v=i*i+r*r-o*o,b=v-a*a-s*s+c*c,y=v-l*l-u*u+h*h,x=f*p-d*m,w=(p*y-m*b)/(2*x)-i,M=(m*g-p*_)/x,E=(f*b-d*y)/(2*x)-r,S=(d*_-f*g)/x,A=M*M+S*S-1,T=2*(o+w*M+E*S),k=w*w+E*E-o*o,P=-(A?(T+Math.sqrt(T*T-4*A*k))/(2*A):k/T);return{x:i+w+M*P,y:r+E+S*P,r:P}}function Ts(t,e,n){var i,r,o,a,s=t.x-e.x,c=t.y-e.y,l=s*s+c*c;l?(r=e.r+n.r,r*=r,a=t.r+n.r,r>(a*=a)?(i=(l+a-r)/(2*l),o=Math.sqrt(Math.max(0,a/l-i*i)),n.x=t.x-i*s-o*c,n.y=t.y-i*c+o*s):(i=(l+r-a)/(2*l),o=Math.sqrt(Math.max(0,r/l-i*i)),n.x=e.x+i*s-o*c,n.y=e.y+i*c+o*s)):(n.x=e.x+n.r,n.y=e.y)}function ks(t,e){var n=t.r+e.r-1e-6,i=e.x-t.x,r=e.y-t.y;return n>0&&n*n>i*i+r*r}function Ps(t){var e=t._,n=t.next._,i=e.r+n.r,r=(e.x*n.r+n.x*e.r)/i,o=(e.y*n.r+n.y*e.r)/i;return r*r+o*o}function Ls(t){this._=t,this.next=null,this.previous=null}function Os(t){if(!(r=t.length))return 0;var e,n,i,r,o,a,s,c,l,u,h;if((e=t[0]).x=0,e.y=0,!(r>1))return e.r;if(n=t[1],e.x=-n.r,n.x=e.r,n.y=0,!(r>2))return e.r+n.r;Ts(n,e,i=t[2]),e=new Ls(e),n=new Ls(n),i=new Ls(i),e.next=i.previous=n,n.next=e.previous=i,i.next=n.previous=e;t:for(s=3;s<r;++s){Ts(e._,n._,i=t[s]),i=new Ls(i),c=n.next,l=e.previous,u=n._.r,h=e._.r;do{if(u<=h){if(ks(c._,i._)){n=c,e.next=n,n.previous=e,--s;continue t}u+=c._.r,c=c.next}else{if(ks(l._,i._)){(e=l).next=n,n.previous=e,--s;continue t}h+=l._.r,l=l.previous}}while(c!==l.next);for(i.previous=e,i.next=n,e.next=n.previous=n=i,o=Ps(e);(i=i.next)!==n;)(a=Ps(i))<o&&(e=i,o=a);n=e.next}for(e=[n._],i=n;(i=i.next)!==n;)e.push(i._);for(i=bs(e),s=0;s<r;++s)(e=t[s]).x-=i.x,e.y-=i.y;return i.r}var Cs=function(t){return Os(t),t};function Rs(t){return null==t?null:Is(t)}function Is(t){if("function"!=typeof t)throw new Error;return t}function zs(){return 0}var Bs=function(t){return function(){return t}};function Ns(t){return Math.sqrt(t.value)}var Ds=function(){var t=null,e=1,n=1,i=zs;function r(r){return r.x=e/2,r.y=n/2,t?r.eachBefore(js(t)).eachAfter(Us(i,.5)).eachBefore(Fs(1)):r.eachBefore(js(Ns)).eachAfter(Us(zs,1)).eachAfter(Us(i,r.r/Math.min(e,n))).eachBefore(Fs(Math.min(e,n)/(2*r.r))),r}return r.radius=function(e){return arguments.length?(t=Rs(e),r):t},r.size=function(t){return arguments.length?(e=+t[0],n=+t[1],r):[e,n]},r.padding=function(t){return arguments.length?(i="function"==typeof t?t:Bs(+t),r):i},r};function js(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function Us(t,e){return function(n){if(i=n.children){var i,r,o,a=i.length,s=t(n)*e||0;if(s)for(r=0;r<a;++r)i[r].r+=s;if(o=Os(i),s)for(r=0;r<a;++r)i[r].r-=s;n.r=o+s}}}function Fs(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}var Hs=function(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)},qs=function(t,e,n,i,r){for(var o,a=t.children,s=-1,c=a.length,l=t.value&&(i-e)/t.value;++s<c;)(o=a[s]).y0=n,o.y1=r,o.x0=e,o.x1=e+=o.value*l},Gs=function(){var t=1,e=1,n=0,i=!1;function r(r){var o=r.height+1;return r.x0=r.y0=n,r.x1=t,r.y1=e/o,r.eachBefore(function(t,e){return function(i){i.children&&qs(i,i.x0,t*(i.depth+1)/e,i.x1,t*(i.depth+2)/e);var r=i.x0,o=i.y0,a=i.x1-n,s=i.y1-n;a<r&&(r=a=(r+a)/2),s<o&&(o=s=(o+s)/2),i.x0=r,i.y0=o,i.x1=a,i.y1=s}}(e,o)),i&&r.eachBefore(Hs),r}return r.round=function(t){return arguments.length?(i=!!t,r):i},r.size=function(n){return arguments.length?(t=+n[0],e=+n[1],r):[t,e]},r.padding=function(t){return arguments.length?(n=+t,r):n},r},Ws="$",Vs={depth:-1},Xs={};function Ys(t){return t.id}function Ks(t){return t.parentId}var Zs=function(){var t=Ys,e=Ks;function n(n){var i,r,o,a,s,c,l,u=n.length,h=new Array(u),d={};for(r=0;r<u;++r)i=n[r],s=h[r]=new _s(i),null!=(c=t(i,r,n))&&(c+="")&&(d[l=Ws+(s.id=c)]=l in d?Xs:s);for(r=0;r<u;++r)if(s=h[r],null!=(c=e(n[r],r,n))&&(c+="")){if(!(a=d[Ws+c]))throw new Error("missing: "+c);if(a===Xs)throw new Error("ambiguous: "+c);a.children?a.children.push(s):a.children=[s],s.parent=a}else{if(o)throw new Error("multiple roots");o=s}if(!o)throw new Error("no root");if(o.parent=Vs,o.eachBefore(function(t){t.depth=t.parent.depth+1,--u}).eachBefore(gs),o.parent=null,u>0)throw new Error("cycle");return o}return n.id=function(e){return arguments.length?(t=Is(e),n):t},n.parentId=function(t){return arguments.length?(e=Is(t),n):e},n};function Js(t,e){return t.parent===e.parent?1:2}function Qs(t){var e=t.children;return e?e[0]:t.t}function $s(t){var e=t.children;return e?e[e.length-1]:t.t}function tc(t,e,n){var i=n/(e.i-t.i);e.c-=i,e.s+=n,t.c+=i,e.z+=n,e.m+=n}function ec(t,e,n){return t.a.parent===e.parent?t.a:n}function nc(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}nc.prototype=Object.create(_s.prototype);var ic=function(){var t=Js,e=1,n=1,i=null;function r(r){var c=function(t){for(var e,n,i,r,o,a=new nc(t,0),s=[a];e=s.pop();)if(i=e._.children)for(e.children=new Array(o=i.length),r=o-1;r>=0;--r)s.push(n=e.children[r]=new nc(i[r],r)),n.parent=e;return(a.parent=new nc(null,0)).children=[a],a}(r);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),i)r.eachBefore(s);else{var l=r,u=r,h=r;r.eachBefore(function(t){t.x<l.x&&(l=t),t.x>u.x&&(u=t),t.depth>h.depth&&(h=t)});var d=l===u?1:t(l,u)/2,f=d-l.x,p=e/(u.x+d+f),m=n/(h.depth||1);r.eachBefore(function(t){t.x=(t.x+f)*p,t.y=t.depth*m})}return r}function o(e){var n=e.children,i=e.parent.children,r=e.i?i[e.i-1]:null;if(n){!function(t){for(var e,n=0,i=0,r=t.children,o=r.length;--o>=0;)(e=r[o]).z+=n,e.m+=n,n+=e.s+(i+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;r?(e.z=r.z+t(e._,r._),e.m=e.z-o):e.z=o}else r&&(e.z=r.z+t(e._,r._));e.parent.A=function(e,n,i){if(n){for(var r,o=e,a=e,s=n,c=o.parent.children[0],l=o.m,u=a.m,h=s.m,d=c.m;s=$s(s),o=Qs(o),s&&o;)c=Qs(c),(a=$s(a)).a=e,(r=s.z+h-o.z-l+t(s._,o._))>0&&(tc(ec(s,e,i),e,r),l+=r,u+=r),h+=s.m,l+=o.m,d+=c.m,u+=a.m;s&&!$s(a)&&(a.t=s,a.m+=h-u),o&&!Qs(c)&&(c.t=o,c.m+=l-d,i=e)}return i}(e,r,e.parent.A||i[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return r.separation=function(e){return arguments.length?(t=e,r):t},r.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],r):i?null:[e,n]},r.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],r):i?[e,n]:null},r},rc=function(t,e,n,i,r){for(var o,a=t.children,s=-1,c=a.length,l=t.value&&(r-n)/t.value;++s<c;)(o=a[s]).x0=e,o.x1=i,o.y0=n,o.y1=n+=o.value*l},oc=(1+Math.sqrt(5))/2;function ac(t,e,n,i,r,o){for(var a,s,c,l,u,h,d,f,p,m,g,_=[],v=e.children,b=0,y=0,x=v.length,w=e.value;b<x;){c=r-n,l=o-i;do{u=v[y++].value}while(!u&&y<x);for(h=d=u,g=u*u*(m=Math.max(l/c,c/l)/(w*t)),p=Math.max(d/g,g/h);y<x;++y){if(u+=s=v[y].value,s<h&&(h=s),s>d&&(d=s),g=u*u*m,(f=Math.max(d/g,g/h))>p){u-=s;break}p=f}_.push(a={value:u,dice:c<l,children:v.slice(b,y)}),a.dice?qs(a,n,i,r,w?i+=l*u/w:o):rc(a,n,i,w?n+=c*u/w:r,o),w-=u,b=y}return _}var sc=function t(e){function n(t,n,i,r,o){ac(e,t,n,i,r,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(oc),cc=function(){var t=sc,e=!1,n=1,i=1,r=[0],o=zs,a=zs,s=zs,c=zs,l=zs;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=i,t.eachBefore(h),r=[0],e&&t.eachBefore(Hs),t}function h(e){var n=r[e.depth],i=e.x0+n,u=e.y0+n,h=e.x1-n,d=e.y1-n;h<i&&(i=h=(i+h)/2),d<u&&(u=d=(u+d)/2),e.x0=i,e.y0=u,e.x1=h,e.y1=d,e.children&&(n=r[e.depth+1]=o(e)/2,i+=l(e)-n,u+=a(e)-n,(h-=s(e)-n)<i&&(i=h=(i+h)/2),(d-=c(e)-n)<u&&(u=d=(u+d)/2),t(e,i,u,h,d))}return u.round=function(t){return arguments.length?(e=!!t,u):e},u.size=function(t){return arguments.length?(n=+t[0],i=+t[1],u):[n,i]},u.tile=function(e){return arguments.length?(t=Is(e),u):t},u.padding=function(t){return arguments.length?u.paddingInner(t).paddingOuter(t):u.paddingInner()},u.paddingInner=function(t){return arguments.length?(o="function"==typeof t?t:Bs(+t),u):o},u.paddingOuter=function(t){return arguments.length?u.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):u.paddingTop()},u.paddingTop=function(t){return arguments.length?(a="function"==typeof t?t:Bs(+t),u):a},u.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:Bs(+t),u):s},u.paddingBottom=function(t){return arguments.length?(c="function"==typeof t?t:Bs(+t),u):c},u.paddingLeft=function(t){return arguments.length?(l="function"==typeof t?t:Bs(+t),u):l},u},lc=function(t,e,n,i,r){var o,a,s=t.children,c=s.length,l=new Array(c+1);for(l[0]=a=o=0;o<c;++o)l[o+1]=a+=s[o].value;!function t(e,n,i,r,o,a,c){if(e>=n-1){var u=s[e];return u.x0=r,u.y0=o,u.x1=a,void(u.y1=c)}var h=l[e],d=i/2+h,f=e+1,p=n-1;for(;f<p;){var m=f+p>>>1;l[m]<d?f=m+1:p=m}d-l[f-1]<l[f]-d&&e+1<f&&--f;var g=l[f]-h,_=i-g;if(a-r>c-o){var v=(r*_+a*g)/i;t(e,f,g,r,o,v,c),t(f,n,_,v,o,a,c)}else{var b=(o*_+c*g)/i;t(e,f,g,r,o,a,b),t(f,n,_,r,b,a,c)}}(0,c,t.value,e,n,i,r)},uc=function(t,e,n,i,r){(1&t.depth?rc:qs)(t,e,n,i,r)},hc=function t(e){function n(t,n,i,r,o){if((a=t._squarify)&&a.ratio===e)for(var a,s,c,l,u,h=-1,d=a.length,f=t.value;++h<d;){for(c=(s=a[h]).children,l=s.value=0,u=c.length;l<u;++l)s.value+=c[l].value;s.dice?qs(s,n,i,r,i+=(o-i)*s.value/f):rc(s,n,i,n+=(r-n)*s.value/f,o),f-=s.value}else t._squarify=a=ac(e,t,n,i,r,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(oc),dc=function(t){for(var e,n=-1,i=t.length,r=t[i-1],o=0;++n<i;)e=r,r=t[n],o+=e[1]*r[0]-e[0]*r[1];return o/2},fc=function(t){for(var e,n,i=-1,r=t.length,o=0,a=0,s=t[r-1],c=0;++i<r;)e=s,s=t[i],c+=n=e[0]*s[1]-s[0]*e[1],o+=(e[0]+s[0])*n,a+=(e[1]+s[1])*n;return[o/(c*=3),a/c]},pc=function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])};function mc(t,e){return t[0]-e[0]||t[1]-e[1]}function gc(t){for(var e=t.length,n=[0,1],i=2,r=2;r<e;++r){for(;i>1&&pc(t[n[i-2]],t[n[i-1]],t[r])<=0;)--i;n[i++]=r}return n.slice(0,i)}var _c=function(t){if((n=t.length)<3)return null;var e,n,i=new Array(n),r=new Array(n);for(e=0;e<n;++e)i[e]=[+t[e][0],+t[e][1],e];for(i.sort(mc),e=0;e<n;++e)r[e]=[i[e][0],-i[e][1]];var o=gc(i),a=gc(r),s=a[0]===o[0],c=a[a.length-1]===o[o.length-1],l=[];for(e=o.length-1;e>=0;--e)l.push(t[i[o[e]][2]]);for(e=+s;e<a.length-c;++e)l.push(t[i[a[e]][2]]);return l},vc=function(t,e){for(var n,i,r=t.length,o=t[r-1],a=e[0],s=e[1],c=o[0],l=o[1],u=!1,h=0;h<r;++h)n=(o=t[h])[0],(i=o[1])>s!=l>s&&a<(c-n)*(s-i)/(l-i)+n&&(u=!u),c=n,l=i;return u},bc=function(t){for(var e,n,i=-1,r=t.length,o=t[r-1],a=o[0],s=o[1],c=0;++i<r;)e=a,n=s,e-=a=(o=t[i])[0],n-=s=o[1],c+=Math.sqrt(e*e+n*n);return c},yc=function(){return Math.random()},xc=function t(e){function n(t,n){return t=null==t?0:+t,n=null==n?1:+n,1===arguments.length?(n=t,t=0):n-=t,function(){return e()*n+t}}return n.source=t,n}(yc),wc=function t(e){function n(t,n){var i,r;return t=null==t?0:+t,n=null==n?1:+n,function(){var o;if(null!=i)o=i,i=null;else do{i=2*e()-1,o=2*e()-1,r=i*i+o*o}while(!r||r>1);return t+n*o*Math.sqrt(-2*Math.log(r)/r)}}return n.source=t,n}(yc),Mc=function t(e){function n(){var t=wc.source(e).apply(this,arguments);return function(){return Math.exp(t())}}return n.source=t,n}(yc),Ec=function t(e){function n(t){return function(){for(var n=0,i=0;i<t;++i)n+=e();return n}}return n.source=t,n}(yc),Sc=function t(e){function n(t){var n=Ec.source(e)(t);return function(){return n()/t}}return n.source=t,n}(yc),Ac=function t(e){function n(t){return function(){return-Math.log(1-e())/t}}return n.source=t,n}(yc),Tc=n(87),kc=function(t){for(var e=t.length/6|0,n=new Array(e),i=0;i<e;)n[i]="#"+t.slice(6*i,6*++i);return n},Pc=kc("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),Lc=kc("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),Oc=kc("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),Cc=kc("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),Rc=kc("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),Ic=kc("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),zc=kc("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),Bc=kc("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),Nc=kc("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),Dc=function(t){return Object(C.r)(t[t.length-1])},jc=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(kc),Uc=Dc(jc),Fc=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(kc),Hc=Dc(Fc),qc=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(kc),Gc=Dc(qc),Wc=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(kc),Vc=Dc(Wc),Xc=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(kc),Yc=Dc(Xc),Kc=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(kc),Zc=Dc(Kc),Jc=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(kc),Qc=Dc(Jc),$c=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(kc),tl=Dc($c),el=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(kc),nl=Dc(el),il=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(kc),rl=Dc(il),ol=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(kc),al=Dc(ol),sl=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(kc),cl=Dc(sl),ll=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(kc),ul=Dc(ll),hl=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(kc),dl=Dc(hl),fl=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(kc),pl=Dc(fl),ml=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(kc),gl=Dc(ml),_l=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(kc),vl=Dc(_l),bl=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(kc),yl=Dc(bl),xl=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(kc),wl=Dc(xl),Ml=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(kc),El=Dc(Ml),Sl=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(kc),Al=Dc(Sl),Tl=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(kc),kl=Dc(Tl),Pl=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(kc),Ll=Dc(Pl),Ol=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(kc),Cl=Dc(Ol),Rl=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(kc),Il=Dc(Rl),zl=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(kc),Bl=Dc(zl),Nl=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(kc),Dl=Dc(Nl),jl=Object(C.f)(Object(Pt.b)(300,.5,0),Object(Pt.b)(-240,.5,1)),Ul=Object(C.f)(Object(Pt.b)(-100,.75,.35),Object(Pt.b)(80,1.5,.8)),Fl=Object(C.f)(Object(Pt.b)(260,.75,.35),Object(Pt.b)(80,1.5,.8)),Hl=Object(Pt.b)(),ql=function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return Hl.h=360*t-100,Hl.s=1.5-1.5*e,Hl.l=.8-.9*e,Hl+""},Gl=Object(Pt.h)(),Wl=Math.PI/3,Vl=2*Math.PI/3,Xl=function(t){var e;return t=(.5-t)*Math.PI,Gl.r=255*(e=Math.sin(t))*e,Gl.g=255*(e=Math.sin(t+Wl))*e,Gl.b=255*(e=Math.sin(t+Vl))*e,Gl+""};function Yl(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var Kl=Yl(kc("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),Zl=Yl(kc("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Jl=Yl(kc("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Ql=Yl(kc("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),$l=function(t){return function(){return t}},tu=Math.abs,eu=Math.atan2,nu=Math.cos,iu=Math.max,ru=Math.min,ou=Math.sin,au=Math.sqrt,su=1e-12,cu=Math.PI,lu=cu/2,uu=2*cu;function hu(t){return t>=1?lu:t<=-1?-lu:Math.asin(t)}function du(t){return t.innerRadius}function fu(t){return t.outerRadius}function pu(t){return t.startAngle}function mu(t){return t.endAngle}function gu(t){return t&&t.padAngle}function _u(t,e,n,i,r,o,a){var s=t-n,c=e-i,l=(a?o:-o)/au(s*s+c*c),u=l*c,h=-l*s,d=t+u,f=e+h,p=n+u,m=i+h,g=(d+p)/2,_=(f+m)/2,v=p-d,b=m-f,y=v*v+b*b,x=r-o,w=d*m-p*f,M=(b<0?-1:1)*au(iu(0,x*x*y-w*w)),E=(w*b-v*M)/y,S=(-w*v-b*M)/y,A=(w*b+v*M)/y,T=(-w*v+b*M)/y,k=E-g,P=S-_,L=A-g,O=T-_;return k*k+P*P>L*L+O*O&&(E=A,S=T),{cx:E,cy:S,x01:-u,y01:-h,x11:E*(r/x-1),y11:S*(r/x-1)}}var vu=function(){var t=du,e=fu,n=$l(0),i=null,r=pu,o=mu,a=gu,s=null;function c(){var c,l,u,h=+t.apply(this,arguments),d=+e.apply(this,arguments),f=r.apply(this,arguments)-lu,p=o.apply(this,arguments)-lu,m=tu(p-f),g=p>f;if(s||(s=c=xt()),d<h&&(l=d,d=h,h=l),d>su)if(m>uu-su)s.moveTo(d*nu(f),d*ou(f)),s.arc(0,0,d,f,p,!g),h>su&&(s.moveTo(h*nu(p),h*ou(p)),s.arc(0,0,h,p,f,g));else{var _,v,b=f,y=p,x=f,w=p,M=m,E=m,S=a.apply(this,arguments)/2,A=S>su&&(i?+i.apply(this,arguments):au(h*h+d*d)),T=ru(tu(d-h)/2,+n.apply(this,arguments)),k=T,P=T;if(A>su){var L=hu(A/h*ou(S)),O=hu(A/d*ou(S));(M-=2*L)>su?(x+=L*=g?1:-1,w-=L):(M=0,x=w=(f+p)/2),(E-=2*O)>su?(b+=O*=g?1:-1,y-=O):(E=0,b=y=(f+p)/2)}var C=d*nu(b),R=d*ou(b),I=h*nu(w),z=h*ou(w);if(T>su){var B,N=d*nu(y),D=d*ou(y),j=h*nu(x),U=h*ou(x);if(m<cu&&(B=function(t,e,n,i,r,o,a,s){var c=n-t,l=i-e,u=a-r,h=s-o,d=h*c-u*l;if(!(d*d<su))return[t+(d=(u*(e-o)-h*(t-r))/d)*c,e+d*l]}(C,R,j,U,N,D,I,z))){var F=C-B[0],H=R-B[1],q=N-B[0],G=D-B[1],W=1/ou(((u=(F*q+H*G)/(au(F*F+H*H)*au(q*q+G*G)))>1?0:u<-1?cu:Math.acos(u))/2),V=au(B[0]*B[0]+B[1]*B[1]);k=ru(T,(h-V)/(W-1)),P=ru(T,(d-V)/(W+1))}}E>su?P>su?(_=_u(j,U,C,R,d,P,g),v=_u(N,D,I,z,d,P,g),s.moveTo(_.cx+_.x01,_.cy+_.y01),P<T?s.arc(_.cx,_.cy,P,eu(_.y01,_.x01),eu(v.y01,v.x01),!g):(s.arc(_.cx,_.cy,P,eu(_.y01,_.x01),eu(_.y11,_.x11),!g),s.arc(0,0,d,eu(_.cy+_.y11,_.cx+_.x11),eu(v.cy+v.y11,v.cx+v.x11),!g),s.arc(v.cx,v.cy,P,eu(v.y11,v.x11),eu(v.y01,v.x01),!g))):(s.moveTo(C,R),s.arc(0,0,d,b,y,!g)):s.moveTo(C,R),h>su&&M>su?k>su?(_=_u(I,z,N,D,h,-k,g),v=_u(C,R,j,U,h,-k,g),s.lineTo(_.cx+_.x01,_.cy+_.y01),k<T?s.arc(_.cx,_.cy,k,eu(_.y01,_.x01),eu(v.y01,v.x01),!g):(s.arc(_.cx,_.cy,k,eu(_.y01,_.x01),eu(_.y11,_.x11),!g),s.arc(0,0,h,eu(_.cy+_.y11,_.cx+_.x11),eu(v.cy+v.y11,v.cx+v.x11),g),s.arc(v.cx,v.cy,k,eu(v.y11,v.x11),eu(v.y01,v.x01),!g))):s.arc(0,0,h,w,x,g):s.lineTo(I,z)}else s.moveTo(0,0);if(s.closePath(),c)return s=null,c+""||null}return c.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-cu/2;return[nu(i)*n,ou(i)*n]},c.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:$l(+e),c):t},c.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:$l(+t),c):e},c.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:$l(+t),c):n},c.padRadius=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:$l(+t),c):i},c.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:$l(+t),c):r},c.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:$l(+t),c):o},c.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:$l(+t),c):a},c.context=function(t){return arguments.length?(s=null==t?null:t,c):s},c};function bu(t){this._context=t}bu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var yu=function(t){return new bu(t)};function xu(t){return t[0]}function wu(t){return t[1]}var Mu=function(){var t=xu,e=wu,n=$l(!0),i=null,r=yu,o=null;function a(a){var s,c,l,u=a.length,h=!1;for(null==i&&(o=r(l=xt())),s=0;s<=u;++s)!(s<u&&n(c=a[s],s,a))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+t(c,s,a),+e(c,s,a));if(l)return o=null,l+""||null}return a.x=function(e){return arguments.length?(t="function"==typeof e?e:$l(+e),a):t},a.y=function(t){return arguments.length?(e="function"==typeof t?t:$l(+t),a):e},a.defined=function(t){return arguments.length?(n="function"==typeof t?t:$l(!!t),a):n},a.curve=function(t){return arguments.length?(r=t,null!=i&&(o=r(i)),a):r},a.context=function(t){return arguments.length?(null==t?i=o=null:o=r(i=t),a):i},a},Eu=function(){var t=xu,e=null,n=$l(0),i=wu,r=$l(!0),o=null,a=yu,s=null;function c(c){var l,u,h,d,f,p=c.length,m=!1,g=new Array(p),_=new Array(p);for(null==o&&(s=a(f=xt())),l=0;l<=p;++l){if(!(l<p&&r(d=c[l],l,c))===m)if(m=!m)u=l,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=l-1;h>=u;--h)s.point(g[h],_[h]);s.lineEnd(),s.areaEnd()}m&&(g[l]=+t(d,l,c),_[l]=+n(d,l,c),s.point(e?+e(d,l,c):g[l],i?+i(d,l,c):_[l]))}if(f)return s=null,f+""||null}function l(){return Mu().defined(r).curve(a).context(o)}return c.x=function(n){return arguments.length?(t="function"==typeof n?n:$l(+n),e=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:$l(+e),c):t},c.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:$l(+t),c):e},c.y=function(t){return arguments.length?(n="function"==typeof t?t:$l(+t),i=null,c):n},c.y0=function(t){return arguments.length?(n="function"==typeof t?t:$l(+t),c):n},c.y1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:$l(+t),c):i},c.lineX0=c.lineY0=function(){return l().x(t).y(n)},c.lineY1=function(){return l().x(t).y(i)},c.lineX1=function(){return l().x(e).y(n)},c.defined=function(t){return arguments.length?(r="function"==typeof t?t:$l(!!t),c):r},c.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),c):a},c.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),c):o},c},Su=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},Au=function(t){return t},Tu=function(){var t=Au,e=Su,n=null,i=$l(0),r=$l(uu),o=$l(0);function a(a){var s,c,l,u,h,d=a.length,f=0,p=new Array(d),m=new Array(d),g=+i.apply(this,arguments),_=Math.min(uu,Math.max(-uu,r.apply(this,arguments)-g)),v=Math.min(Math.abs(_)/d,o.apply(this,arguments)),b=v*(_<0?-1:1);for(s=0;s<d;++s)(h=m[p[s]=s]=+t(a[s],s,a))>0&&(f+=h);for(null!=e?p.sort(function(t,n){return e(m[t],m[n])}):null!=n&&p.sort(function(t,e){return n(a[t],a[e])}),s=0,l=f?(_-d*b)/f:0;s<d;++s,g=u)c=p[s],u=g+((h=m[c])>0?h*l:0)+b,m[c]={data:a[c],index:s,value:h,startAngle:g,endAngle:u,padAngle:v};return m}return a.value=function(e){return arguments.length?(t="function"==typeof e?e:$l(+e),a):t},a.sortValues=function(t){return arguments.length?(e=t,n=null,a):e},a.sort=function(t){return arguments.length?(n=t,e=null,a):n},a.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:$l(+t),a):i},a.endAngle=function(t){return arguments.length?(r="function"==typeof t?t:$l(+t),a):r},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:$l(+t),a):o},a},ku=Lu(yu);function Pu(t){this._curve=t}function Lu(t){function e(e){return new Pu(t(e))}return e._curve=t,e}function Ou(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(Lu(t)):e()._curve},t}Pu.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var Cu=function(){return Ou(Mu().curve(ku))},Ru=function(){var t=Eu().curve(ku),e=t.curve,n=t.lineX0,i=t.lineX1,r=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return Ou(n())},delete t.lineX0,t.lineEndAngle=function(){return Ou(i())},delete t.lineX1,t.lineInnerRadius=function(){return Ou(r())},delete t.lineY0,t.lineOuterRadius=function(){return Ou(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(Lu(t)):e()._curve},t},Iu=function(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]},zu=Array.prototype.slice;function Bu(t){return t.source}function Nu(t){return t.target}function Du(t){var e=Bu,n=Nu,i=xu,r=wu,o=null;function a(){var a,s=zu.call(arguments),c=e.apply(this,s),l=n.apply(this,s);if(o||(o=a=xt()),t(o,+i.apply(this,(s[0]=c,s)),+r.apply(this,s),+i.apply(this,(s[0]=l,s)),+r.apply(this,s)),a)return o=null,a+""||null}return a.source=function(t){return arguments.length?(e=t,a):e},a.target=function(t){return arguments.length?(n=t,a):n},a.x=function(t){return arguments.length?(i="function"==typeof t?t:$l(+t),a):i},a.y=function(t){return arguments.length?(r="function"==typeof t?t:$l(+t),a):r},a.context=function(t){return arguments.length?(o=null==t?null:t,a):o},a}function ju(t,e,n,i,r){t.moveTo(e,n),t.bezierCurveTo(e=(e+i)/2,n,e,r,i,r)}function Uu(t,e,n,i,r){t.moveTo(e,n),t.bezierCurveTo(e,n=(n+r)/2,i,n,i,r)}function Fu(t,e,n,i,r){var o=Iu(e,n),a=Iu(e,n=(n+r)/2),s=Iu(i,n),c=Iu(i,r);t.moveTo(o[0],o[1]),t.bezierCurveTo(a[0],a[1],s[0],s[1],c[0],c[1])}function Hu(){return Du(ju)}function qu(){return Du(Uu)}function Gu(){var t=Du(Fu);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}var Wu={draw:function(t,e){var n=Math.sqrt(e/cu);t.moveTo(n,0),t.arc(0,0,n,0,uu)}},Vu={draw:function(t,e){var n=Math.sqrt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},Xu=Math.sqrt(1/3),Yu=2*Xu,Ku={draw:function(t,e){var n=Math.sqrt(e/Yu),i=n*Xu;t.moveTo(0,-n),t.lineTo(i,0),t.lineTo(0,n),t.lineTo(-i,0),t.closePath()}},Zu=Math.sin(cu/10)/Math.sin(7*cu/10),Ju=Math.sin(uu/10)*Zu,Qu=-Math.cos(uu/10)*Zu,$u={draw:function(t,e){var n=Math.sqrt(.8908130915292852*e),i=Ju*n,r=Qu*n;t.moveTo(0,-n),t.lineTo(i,r);for(var o=1;o<5;++o){var a=uu*o/5,s=Math.cos(a),c=Math.sin(a);t.lineTo(c*n,-s*n),t.lineTo(s*i-c*r,c*i+s*r)}t.closePath()}},th={draw:function(t,e){var n=Math.sqrt(e),i=-n/2;t.rect(i,i,n,n)}},eh=Math.sqrt(3),nh={draw:function(t,e){var n=-Math.sqrt(e/(3*eh));t.moveTo(0,2*n),t.lineTo(-eh*n,-n),t.lineTo(eh*n,-n),t.closePath()}},ih=Math.sqrt(3)/2,rh=1/Math.sqrt(12),oh=3*(rh/2+1),ah={draw:function(t,e){var n=Math.sqrt(e/oh),i=n/2,r=n*rh,o=i,a=n*rh+n,s=-o,c=a;t.moveTo(i,r),t.lineTo(o,a),t.lineTo(s,c),t.lineTo(-.5*i-ih*r,ih*i+-.5*r),t.lineTo(-.5*o-ih*a,ih*o+-.5*a),t.lineTo(-.5*s-ih*c,ih*s+-.5*c),t.lineTo(-.5*i+ih*r,-.5*r-ih*i),t.lineTo(-.5*o+ih*a,-.5*a-ih*o),t.lineTo(-.5*s+ih*c,-.5*c-ih*s),t.closePath()}},sh=[Wu,Vu,Ku,th,$u,nh,ah],ch=function(){var t=$l(Wu),e=$l(64),n=null;function i(){var i;if(n||(n=i=xt()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),i)return n=null,i+""||null}return i.type=function(e){return arguments.length?(t="function"==typeof e?e:$l(e),i):t},i.size=function(t){return arguments.length?(e="function"==typeof t?t:$l(+t),i):e},i.context=function(t){return arguments.length?(n=null==t?null:t,i):n},i},lh=function(){};function uh(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function hh(t){this._context=t}hh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:uh(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:uh(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var dh=function(t){return new hh(t)};function fh(t){this._context=t}fh.prototype={areaStart:lh,areaEnd:lh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:uh(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var ph=function(t){return new fh(t)};function mh(t){this._context=t}mh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:uh(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var gh=function(t){return new mh(t)};function _h(t,e){this._basis=new hh(t),this._beta=e}_h.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var i,r=t[0],o=e[0],a=t[n]-r,s=e[n]-o,c=-1;++c<=n;)i=c/n,this._basis.point(this._beta*t[c]+(1-this._beta)*(r+i*a),this._beta*e[c]+(1-this._beta)*(o+i*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var vh=function t(e){function n(t){return 1===e?new hh(t):new _h(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function bh(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function yh(t,e){this._context=t,this._k=(1-e)/6}yh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:bh(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:bh(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var xh=function t(e){function n(t){return new yh(t,e)}return n.tension=function(e){return t(+e)},n}(0);function wh(t,e){this._context=t,this._k=(1-e)/6}wh.prototype={areaStart:lh,areaEnd:lh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:bh(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Mh=function t(e){function n(t){return new wh(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Eh(t,e){this._context=t,this._k=(1-e)/6}Eh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:bh(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Sh=function t(e){function n(t){return new Eh(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Ah(t,e,n){var i=t._x1,r=t._y1,o=t._x2,a=t._y2;if(t._l01_a>su){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,r=(r*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>su){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/u,a=(a*l+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(i,r,o,a,t._x2,t._y2)}function Th(t,e){this._context=t,this._alpha=e}Th.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Ah(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var kh=function t(e){function n(t){return e?new Th(t,e):new yh(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Ph(t,e){this._context=t,this._alpha=e}Ph.prototype={areaStart:lh,areaEnd:lh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Ah(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Lh=function t(e){function n(t){return e?new Ph(t,e):new wh(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Oh(t,e){this._context=t,this._alpha=e}Oh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ah(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Ch=function t(e){function n(t){return e?new Oh(t,e):new Eh(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Rh(t){this._context=t}Rh.prototype={areaStart:lh,areaEnd:lh,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};var Ih=function(t){return new Rh(t)};function zh(t){return t<0?-1:1}function Bh(t,e,n){var i=t._x1-t._x0,r=e-t._x1,o=(t._y1-t._y0)/(i||r<0&&-0),a=(n-t._y1)/(r||i<0&&-0),s=(o*r+a*i)/(i+r);return(zh(o)+zh(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Nh(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Dh(t,e,n){var i=t._x0,r=t._y0,o=t._x1,a=t._y1,s=(o-i)/3;t._context.bezierCurveTo(i+s,r+s*e,o-s,a-s*n,o,a)}function jh(t){this._context=t}function Uh(t){this._context=new Fh(t)}function Fh(t){this._context=t}function Hh(t){return new jh(t)}function qh(t){return new Uh(t)}function Gh(t){this._context=t}function Wh(t){var e,n,i=t.length-1,r=new Array(i),o=new Array(i),a=new Array(i);for(r[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e<i-1;++e)r[e]=1,o[e]=4,a[e]=4*t[e]+2*t[e+1];for(r[i-1]=2,o[i-1]=7,a[i-1]=8*t[i-1]+t[i],e=1;e<i;++e)n=r[e]/o[e-1],o[e]-=n,a[e]-=n*a[e-1];for(r[i-1]=a[i-1]/o[i-1],e=i-2;e>=0;--e)r[e]=(a[e]-r[e+1])/o[e];for(o[i-1]=(t[i]+r[i-1])/2,e=0;e<i-1;++e)o[e]=2*t[e+1]-r[e+1];return[r,o]}jh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Dh(this,this._t0,Nh(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Dh(this,Nh(this,n=Bh(this,t,e)),n);break;default:Dh(this,this._t0,n=Bh(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(Uh.prototype=Object.create(jh.prototype)).point=function(t,e){jh.prototype.point.call(this,e,t)},Fh.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,r,o){this._context.bezierCurveTo(e,t,i,n,o,r)}},Gh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var i=Wh(t),r=Wh(e),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],t[a],e[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var Vh=function(t){return new Gh(t)};function Xh(t,e){this._context=t,this._t=e}Xh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var Yh=function(t){return new Xh(t,.5)};function Kh(t){return new Xh(t,0)}function Zh(t){return new Xh(t,1)}var Jh=function(t,e){if((r=t.length)>1)for(var n,i,r,o=1,a=t[e[0]],s=a.length;o<r;++o)for(i=a,a=t[e[o]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]},Qh=function(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n};function $h(t,e){return t[e]}var td=function(){var t=$l([]),e=Qh,n=Jh,i=$h;function r(r){var o,a,s=t.apply(this,arguments),c=r.length,l=s.length,u=new Array(l);for(o=0;o<l;++o){for(var h,d=s[o],f=u[o]=new Array(c),p=0;p<c;++p)f[p]=h=[0,+i(r[p],d,p,r)],h.data=r[p];f.key=d}for(o=0,a=e(u);o<l;++o)u[a[o]].index=o;return n(u,a),u}return r.keys=function(e){return arguments.length?(t="function"==typeof e?e:$l(zu.call(e)),r):t},r.value=function(t){return arguments.length?(i="function"==typeof t?t:$l(+t),r):i},r.order=function(t){return arguments.length?(e=null==t?Qh:"function"==typeof t?t:$l(zu.call(t)),r):e},r.offset=function(t){return arguments.length?(n=null==t?Jh:t,r):n},r},ed=function(t,e){if((i=t.length)>0){for(var n,i,r,o=0,a=t[0].length;o<a;++o){for(r=n=0;n<i;++n)r+=t[n][o][1]||0;if(r)for(n=0;n<i;++n)t[n][o][1]/=r}Jh(t,e)}},nd=function(t,e){if((s=t.length)>0)for(var n,i,r,o,a,s,c=0,l=t[e[0]].length;c<l;++c)for(o=a=0,n=0;n<s;++n)(r=(i=t[e[n]][c])[1]-i[0])>=0?(i[0]=o,i[1]=o+=r):r<0?(i[1]=a,i[0]=a+=r):i[0]=o},id=function(t,e){if((n=t.length)>0){for(var n,i=0,r=t[e[0]],o=r.length;i<o;++i){for(var a=0,s=0;a<n;++a)s+=t[a][i][1]||0;r[i][1]+=r[i][0]=-s/2}Jh(t,e)}},rd=function(t,e){if((r=t.length)>0&&(i=(n=t[e[0]]).length)>0){for(var n,i,r,o=0,a=1;a<i;++a){for(var s=0,c=0,l=0;s<r;++s){for(var u=t[e[s]],h=u[a][1]||0,d=(h-(u[a-1][1]||0))/2,f=0;f<s;++f){var p=t[e[f]];d+=(p[a][1]||0)-(p[a-1][1]||0)}c+=h,l+=d*h}n[a-1][1]+=n[a-1][0]=o,c&&(o-=l/c)}n[a-1][1]+=n[a-1][0]=o,Jh(t,e)}},od=function(t){var e=t.map(ad);return Qh(t).sort(function(t,n){return e[t]-e[n]})};function ad(t){for(var e,n=-1,i=0,r=t.length,o=-1/0;++n<r;)(e=+t[n][1])>o&&(o=e,i=n);return i}var sd=function(t){var e=t.map(cd);return Qh(t).sort(function(t,n){return e[t]-e[n]})};function cd(t){for(var e,n=0,i=-1,r=t.length;++i<r;)(e=+t[i][1])&&(n+=e);return n}var ld=function(t){return sd(t).reverse()},ud=function(t){var e,n,i=t.length,r=t.map(cd),o=od(t),a=0,s=0,c=[],l=[];for(e=0;e<i;++e)n=o[e],a<s?(a+=r[n],c.push(n)):(s+=r[n],l.push(n));return l.reverse().concat(c)},hd=function(t){return Qh(t).reverse()},dd=n(3),fd=n(40),pd=function(t){return function(){return t}};function md(t){return t[0]}function gd(t){return t[1]}function _d(){this._=null}function vd(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function bd(t,e){var n=e,i=e.R,r=n.U;r?r.L===n?r.L=i:r.R=i:t._=i,i.U=r,n.U=i,n.R=i.L,n.R&&(n.R.U=n),i.L=n}function yd(t,e){var n=e,i=e.L,r=n.U;r?r.L===n?r.L=i:r.R=i:t._=i,i.U=r,n.U=i,n.L=i.R,n.L&&(n.L.U=n),i.R=n}function xd(t){for(;t.L;)t=t.L;return t}_d.prototype={constructor:_d,insert:function(t,e){var n,i,r;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=xd(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)n===(i=n.U).L?(r=i.R)&&r.C?(n.C=r.C=!1,i.C=!0,t=i):(t===n.R&&(bd(this,n),n=(t=n).U),n.C=!1,i.C=!0,yd(this,i)):(r=i.L)&&r.C?(n.C=r.C=!1,i.C=!0,t=i):(t===n.L&&(yd(this,n),n=(t=n).U),n.C=!1,i.C=!0,bd(this,i)),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,i,r=t.U,o=t.L,a=t.R;if(n=o?a?xd(a):o:a,r?r.L===t?r.L=n:r.R=n:this._=n,o&&a?(i=n.C,n.C=t.C,n.L=o,o.U=n,n!==a?(r=n.U,n.U=t.U,t=n.R,r.L=t,n.R=a,a.U=n):(n.U=r,r=n,t=n.R)):(i=t.C,t=n),t&&(t.U=r),!i)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===r.L){if((e=r.R).C&&(e.C=!1,r.C=!0,bd(this,r),e=r.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,yd(this,e),e=r.R),e.C=r.C,r.C=e.R.C=!1,bd(this,r),t=this._;break}}else if((e=r.L).C&&(e.C=!1,r.C=!0,yd(this,r),e=r.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,bd(this,e),e=r.L),e.C=r.C,r.C=e.L.C=!1,yd(this,r),t=this._;break}e.C=!0,t=r,r=r.U}while(!t.C);t&&(t.C=!1)}}};var wd=_d;function Md(t,e,n,i){var r=[null,null],o=Xd.push(r)-1;return r.left=t,r.right=e,n&&Sd(r,t,e,n),i&&Sd(r,e,t,i),Wd[t.index].halfedges.push(o),Wd[e.index].halfedges.push(o),r}function Ed(t,e,n){var i=[e,n];return i.left=t,i}function Sd(t,e,n,i){t[0]||t[1]?t.left===n?t[1]=i:t[0]=i:(t[0]=i,t.left=e,t.right=n)}function Ad(t,e,n,i,r){var o,a=t[0],s=t[1],c=a[0],l=a[1],u=0,h=1,d=s[0]-c,f=s[1]-l;if(o=e-c,d||!(o>0)){if(o/=d,d<0){if(o<u)return;o<h&&(h=o)}else if(d>0){if(o>h)return;o>u&&(u=o)}if(o=i-c,d||!(o<0)){if(o/=d,d<0){if(o>h)return;o>u&&(u=o)}else if(d>0){if(o<u)return;o<h&&(h=o)}if(o=n-l,f||!(o>0)){if(o/=f,f<0){if(o<u)return;o<h&&(h=o)}else if(f>0){if(o>h)return;o>u&&(u=o)}if(o=r-l,f||!(o<0)){if(o/=f,f<0){if(o>h)return;o>u&&(u=o)}else if(f>0){if(o<u)return;o<h&&(h=o)}return!(u>0||h<1)||(u>0&&(t[0]=[c+u*d,l+u*f]),h<1&&(t[1]=[c+h*d,l+h*f]),!0)}}}}}function Td(t,e,n,i,r){var o=t[1];if(o)return!0;var a,s,c=t[0],l=t.left,u=t.right,h=l[0],d=l[1],f=u[0],p=u[1],m=(h+f)/2,g=(d+p)/2;if(p===d){if(m<e||m>=i)return;if(h>f){if(c){if(c[1]>=r)return}else c=[m,n];o=[m,r]}else{if(c){if(c[1]<n)return}else c=[m,r];o=[m,n]}}else if(s=g-(a=(h-f)/(p-d))*m,a<-1||a>1)if(h>f){if(c){if(c[1]>=r)return}else c=[(n-s)/a,n];o=[(r-s)/a,r]}else{if(c){if(c[1]<n)return}else c=[(r-s)/a,r];o=[(n-s)/a,n]}else if(d<p){if(c){if(c[0]>=i)return}else c=[e,a*e+s];o=[i,a*i+s]}else{if(c){if(c[0]<e)return}else c=[i,a*i+s];o=[e,a*e+s]}return t[0]=c,t[1]=o,!0}function kd(t,e){var n=t.site,i=e.left,r=e.right;return n===r&&(r=i,i=n),r?Math.atan2(r[1]-i[1],r[0]-i[0]):(n===i?(i=e[1],r=e[0]):(i=e[0],r=e[1]),Math.atan2(i[0]-r[0],r[1]-i[1]))}function Pd(t,e){return e[+(e.left!==t.site)]}function Ld(t,e){return e[+(e.left===t.site)]}var Od,Cd=[];function Rd(){vd(this),this.x=this.y=this.arc=this.site=this.cy=null}function Id(t){var e=t.P,n=t.N;if(e&&n){var i=e.site,r=t.site,o=n.site;if(i!==o){var a=r[0],s=r[1],c=i[0]-a,l=i[1]-s,u=o[0]-a,h=o[1]-s,d=2*(c*h-l*u);if(!(d>=-Kd)){var f=c*c+l*l,p=u*u+h*h,m=(h*f-l*p)/d,g=(c*p-u*f)/d,_=Cd.pop()||new Rd;_.arc=t,_.site=r,_.x=m+a,_.y=(_.cy=g+s)+Math.sqrt(m*m+g*g),t.circle=_;for(var v=null,b=Vd._;b;)if(_.y<b.y||_.y===b.y&&_.x<=b.x){if(!b.L){v=b.P;break}b=b.L}else{if(!b.R){v=b;break}b=b.R}Vd.insert(v,_),v||(Od=_)}}}}function zd(t){var e=t.circle;e&&(e.P||(Od=e.N),Vd.remove(e),Cd.push(e),vd(e),t.circle=null)}var Bd=[];function Nd(){vd(this),this.edge=this.site=this.circle=null}function Dd(t){var e=Bd.pop()||new Nd;return e.site=t,e}function jd(t){zd(t),Gd.remove(t),Bd.push(t),vd(t)}function Ud(t){var e=t.circle,n=e.x,i=e.cy,r=[n,i],o=t.P,a=t.N,s=[t];jd(t);for(var c=o;c.circle&&Math.abs(n-c.circle.x)<Yd&&Math.abs(i-c.circle.cy)<Yd;)o=c.P,s.unshift(c),jd(c),c=o;s.unshift(c),zd(c);for(var l=a;l.circle&&Math.abs(n-l.circle.x)<Yd&&Math.abs(i-l.circle.cy)<Yd;)a=l.N,s.push(l),jd(l),l=a;s.push(l),zd(l);var u,h=s.length;for(u=1;u<h;++u)l=s[u],c=s[u-1],Sd(l.edge,c.site,l.site,r);c=s[0],(l=s[h-1]).edge=Md(c.site,l.site,null,r),Id(c),Id(l)}function Fd(t){for(var e,n,i,r,o=t[0],a=t[1],s=Gd._;s;)if((i=Hd(s,a)-o)>Yd)s=s.L;else{if(!((r=o-qd(s,a))>Yd)){i>-Yd?(e=s.P,n=s):r>-Yd?(e=s,n=s.N):e=n=s;break}if(!s.R){e=s;break}s=s.R}!function(t){Wd[t.index]={site:t,halfedges:[]}}(t);var c=Dd(t);if(Gd.insert(e,c),e||n){if(e===n)return zd(e),n=Dd(e.site),Gd.insert(c,n),c.edge=n.edge=Md(e.site,c.site),Id(e),void Id(n);if(n){zd(e),zd(n);var l=e.site,u=l[0],h=l[1],d=t[0]-u,f=t[1]-h,p=n.site,m=p[0]-u,g=p[1]-h,_=2*(d*g-f*m),v=d*d+f*f,b=m*m+g*g,y=[(g*v-f*b)/_+u,(d*b-m*v)/_+h];Sd(n.edge,l,p,y),c.edge=Md(l,t,null,y),n.edge=Md(t,p,null,y),Id(e),Id(n)}else c.edge=Md(e.site,c.site)}}function Hd(t,e){var n=t.site,i=n[0],r=n[1],o=r-e;if(!o)return i;var a=t.P;if(!a)return-1/0;var s=(n=a.site)[0],c=n[1],l=c-e;if(!l)return s;var u=s-i,h=1/o-1/l,d=u/l;return h?(-d+Math.sqrt(d*d-2*h*(u*u/(-2*l)-c+l/2+r-o/2)))/h+i:(i+s)/2}function qd(t,e){var n=t.N;if(n)return Hd(n,e);var i=t.site;return i[1]===e?i[0]:1/0}var Gd,Wd,Vd,Xd,Yd=1e-6,Kd=1e-12;function Zd(t,e){return e[1]-t[1]||e[0]-t[0]}function Jd(t,e){var n,i,r,o=t.sort(Zd).pop();for(Xd=[],Wd=new Array(t.length),Gd=new wd,Vd=new wd;;)if(r=Od,o&&(!r||o[1]<r.y||o[1]===r.y&&o[0]<r.x))o[0]===n&&o[1]===i||(Fd(o),n=o[0],i=o[1]),o=t.pop();else{if(!r)break;Ud(r.arc)}if(function(){for(var t,e,n,i,r=0,o=Wd.length;r<o;++r)if((t=Wd[r])&&(i=(e=t.halfedges).length)){var a=new Array(i),s=new Array(i);for(n=0;n<i;++n)a[n]=n,s[n]=kd(t,Xd[e[n]]);for(a.sort(function(t,e){return s[e]-s[t]}),n=0;n<i;++n)s[n]=e[a[n]];for(n=0;n<i;++n)e[n]=s[n]}}(),e){var a=+e[0][0],s=+e[0][1],c=+e[1][0],l=+e[1][1];!function(t,e,n,i){for(var r,o=Xd.length;o--;)Td(r=Xd[o],t,e,n,i)&&Ad(r,t,e,n,i)&&(Math.abs(r[0][0]-r[1][0])>Yd||Math.abs(r[0][1]-r[1][1])>Yd)||delete Xd[o]}(a,s,c,l),function(t,e,n,i){var r,o,a,s,c,l,u,h,d,f,p,m,g=Wd.length,_=!0;for(r=0;r<g;++r)if(o=Wd[r]){for(a=o.site,s=(c=o.halfedges).length;s--;)Xd[c[s]]||c.splice(s,1);for(s=0,l=c.length;s<l;)p=(f=Ld(o,Xd[c[s]]))[0],m=f[1],h=(u=Pd(o,Xd[c[++s%l]]))[0],d=u[1],(Math.abs(p-h)>Yd||Math.abs(m-d)>Yd)&&(c.splice(s,0,Xd.push(Ed(a,f,Math.abs(p-t)<Yd&&i-m>Yd?[t,Math.abs(h-t)<Yd?d:i]:Math.abs(m-i)<Yd&&n-p>Yd?[Math.abs(d-i)<Yd?h:n,i]:Math.abs(p-n)<Yd&&m-e>Yd?[n,Math.abs(h-n)<Yd?d:e]:Math.abs(m-e)<Yd&&p-t>Yd?[Math.abs(d-e)<Yd?h:t,e]:null))-1),++l);l&&(_=!1)}if(_){var v,b,y,x=1/0;for(r=0,_=null;r<g;++r)(o=Wd[r])&&(y=(v=(a=o.site)[0]-t)*v+(b=a[1]-e)*b)<x&&(x=y,_=o);if(_){var w=[t,e],M=[t,i],E=[n,i],S=[n,e];_.halfedges.push(Xd.push(Ed(a=_.site,w,M))-1,Xd.push(Ed(a,M,E))-1,Xd.push(Ed(a,E,S))-1,Xd.push(Ed(a,S,w))-1)}}for(r=0;r<g;++r)(o=Wd[r])&&(o.halfedges.length||delete Wd[r])}(a,s,c,l)}this.edges=Xd,this.cells=Wd,Gd=Vd=Xd=Wd=null}Jd.prototype={constructor:Jd,polygons:function(){var t=this.edges;return this.cells.map(function(e){var n=e.halfedges.map(function(n){return Pd(e,t[n])});return n.data=e.site.data,n})},triangles:function(){var t=[],e=this.edges;return this.cells.forEach(function(n,i){if(o=(r=n.halfedges).length)for(var r,o,a,s,c,l,u=n.site,h=-1,d=e[r[o-1]],f=d.left===u?d.right:d.left;++h<o;)a=f,f=(d=e[r[h]]).left===u?d.right:d.left,a&&f&&i<a.index&&i<f.index&&(c=a,l=f,((s=u)[0]-l[0])*(c[1]-s[1])-(s[0]-c[0])*(l[1]-s[1])<0)&&t.push([u.data,a.data,f.data])}),t},links:function(){return this.edges.filter(function(t){return t.right}).map(function(t){return{source:t.left.data,target:t.right.data}})},find:function(t,e,n){for(var i,r,o=this,a=o._found||0,s=o.cells.length;!(r=o.cells[a]);)if(++a>=s)return null;var c=t-r.site[0],l=e-r.site[1],u=c*c+l*l;do{r=o.cells[i=a],a=null,r.halfedges.forEach(function(n){var i=o.edges[n],s=i.left;if(s!==r.site&&s||(s=i.right)){var c=t-s[0],l=e-s[1],h=c*c+l*l;h<u&&(u=h,a=s.index)}})}while(null!==a);return o._found=i,null==n||u<=n*n?r.site:null}};var Qd=function(){var t=md,e=gd,n=null;function i(i){return new Jd(i.map(function(n,r){var o=[Math.round(t(n,r,i)/Yd)*Yd,Math.round(e(n,r,i)/Yd)*Yd];return o.index=r,o.data=n,o}),n)}return i.polygons=function(t){return i(t).polygons()},i.links=function(t){return i(t).links()},i.triangles=function(t){return i(t).triangles()},i.x=function(e){return arguments.length?(t="function"==typeof e?e:pd(+e),i):t},i.y=function(t){return arguments.length?(e="function"==typeof t?t:pd(+t),i):e},i.extent=function(t){return arguments.length?(n=null==t?null:[[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]],i):n&&[[n[0][0],n[0][1]],[n[1][0],n[1][1]]]},i.size=function(t){return arguments.length?(n=null==t?null:[[0,0],[+t[0],+t[1]]],i):n&&[n[1][0]-n[0][0],n[1][1]-n[0][1]]},i},$d=function(t){return function(){return t}};function tf(t,e,n){this.target=t,this.type=e,this.transform=n}function ef(t,e,n){this.k=t,this.x=e,this.y=n}ef.prototype={constructor:ef,scale:function(t){return 1===t?this:new ef(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new ef(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var nf=new ef(1,0,0);function rf(t){return t.__zoom||nf}function of(){y.event.stopImmediatePropagation()}rf.prototype=ef.prototype;var af=function(){y.event.preventDefault(),y.event.stopImmediatePropagation()};function sf(){return!y.event.button}function cf(){var t,e,n=this;return n instanceof SVGElement?(t=(n=n.ownerSVGElement||n).width.baseVal.value,e=n.height.baseVal.value):(t=n.clientWidth,e=n.clientHeight),[[0,0],[t,e]]}function lf(){return this.__zoom||nf}function uf(){return-y.event.deltaY*(y.event.deltaMode?120:1)/500}function hf(){return"ontouchstart"in this}function df(t,e,n){var i=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}var ff=function(){var t,e,n=sf,i=cf,r=df,o=uf,a=hf,s=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],l=250,u=C.x,h=[],d=Object(b.a)("start","zoom","end"),f=500,p=150,m=0;function g(t){t.property("__zoom",lf).on("wheel.zoom",T).on("mousedown.zoom",k).on("dblclick.zoom",P).filter(a).on("touchstart.zoom",L).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",I).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(t,e){return(e=Math.max(s[0],Math.min(s[1],e)))===t.k?t:new ef(e,t.x,t.y)}function v(t,e,n){var i=e[0]-n[0]*t.k,r=e[1]-n[1]*t.k;return i===t.x&&r===t.y?t:new ef(t.k,i,r)}function x(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function w(t,e,n){t.on("start.zoom",function(){S(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).end()}).tween("zoom",function(){var t=this,r=arguments,o=S(t,r),a=i.apply(t,r),s=n||x(a),c=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),l=t.__zoom,h="function"==typeof e?e.apply(t,r):e,d=u(l.invert(s).concat(c/l.k),h.invert(s).concat(c/h.k));return function(t){if(1===t)t=h;else{var e=d(t),n=c/e[2];t=new ef(n,s[0]-e[0]*n,s[1]-e[1]*n)}o.zoom(null,t)}})}function S(t,e){for(var n,i=0,r=h.length;i<r;++i)if((n=h[i]).that===t)return n;return new A(t,e)}function A(t,e){this.that=t,this.args=e,this.index=-1,this.active=0,this.extent=i.apply(t,e)}function T(){if(n.apply(this,arguments)){var t=S(this,arguments),e=this.__zoom,i=Math.max(s[0],Math.min(s[1],e.k*Math.pow(2,o.apply(this,arguments)))),a=Object(y.mouse)(this);if(t.wheel)t.mouse[0][0]===a[0]&&t.mouse[0][1]===a[1]||(t.mouse[1]=e.invert(t.mouse[0]=a)),clearTimeout(t.wheel);else{if(e.k===i)return;t.mouse=[a,e.invert(a)],Object(R.b)(this),t.start()}af(),t.wheel=setTimeout(function(){t.wheel=null,t.end()},p),t.zoom("mouse",r(v(_(e,i),t.mouse[0],t.mouse[1]),t.extent,c))}}function k(){if(!e&&n.apply(this,arguments)){var t=S(this,arguments),i=Object(y.select)(y.event.view).on("mousemove.zoom",function(){if(af(),!t.moved){var e=y.event.clientX-a,n=y.event.clientY-s;t.moved=e*e+n*n>m}t.zoom("mouse",r(v(t.that.__zoom,t.mouse[0]=Object(y.mouse)(t.that),t.mouse[1]),t.extent,c))},!0).on("mouseup.zoom",function(){i.on("mousemove.zoom mouseup.zoom",null),E(y.event.view,t.moved),af(),t.end()},!0),o=Object(y.mouse)(this),a=y.event.clientX,s=y.event.clientY;M(y.event.view),of(),t.mouse=[o,this.__zoom.invert(o)],Object(R.b)(this),t.start()}}function P(){if(n.apply(this,arguments)){var t=this.__zoom,e=Object(y.mouse)(this),o=t.invert(e),a=t.k*(y.event.shiftKey?.5:2),s=r(v(_(t,a),e,o),i.apply(this,arguments),c);af(),l>0?Object(y.select)(this).transition().duration(l).call(w,s,e):Object(y.select)(this).call(g.transform,s)}}function L(){if(n.apply(this,arguments)){var e,i,r,o,a=S(this,arguments),s=y.event.changedTouches,c=s.length;for(of(),i=0;i<c;++i)r=s[i],o=[o=Object(y.touch)(this,s,r.identifier),this.__zoom.invert(o),r.identifier],a.touch0?a.touch1||(a.touch1=o):(a.touch0=o,e=!0);if(t&&(t=clearTimeout(t),!a.touch1))return a.end(),void((o=Object(y.select)(this).on("dblclick.zoom"))&&o.apply(this,arguments));e&&(t=setTimeout(function(){t=null},f),Object(R.b)(this),a.start())}}function O(){var e,n,i,o,a=S(this,arguments),s=y.event.changedTouches,l=s.length;for(af(),t&&(t=clearTimeout(t)),e=0;e<l;++e)n=s[e],i=Object(y.touch)(this,s,n.identifier),a.touch0&&a.touch0[2]===n.identifier?a.touch0[0]=i:a.touch1&&a.touch1[2]===n.identifier&&(a.touch1[0]=i);if(n=a.that.__zoom,a.touch1){var u=a.touch0[0],h=a.touch0[1],d=a.touch1[0],f=a.touch1[1],p=(p=d[0]-u[0])*p+(p=d[1]-u[1])*p,m=(m=f[0]-h[0])*m+(m=f[1]-h[1])*m;n=_(n,Math.sqrt(p/m)),i=[(u[0]+d[0])/2,(u[1]+d[1])/2],o=[(h[0]+f[0])/2,(h[1]+f[1])/2]}else{if(!a.touch0)return;i=a.touch0[0],o=a.touch0[1]}a.zoom("touch",r(v(n,i,o),a.extent,c))}function I(){var t,n,i=S(this,arguments),r=y.event.changedTouches,o=r.length;for(of(),e&&clearTimeout(e),e=setTimeout(function(){e=null},f),t=0;t<o;++t)n=r[t],i.touch0&&i.touch0[2]===n.identifier?delete i.touch0:i.touch1&&i.touch1[2]===n.identifier&&delete i.touch1;i.touch1&&!i.touch0&&(i.touch0=i.touch1,delete i.touch1),i.touch0?i.touch0[1]=this.__zoom.invert(i.touch0[0]):i.end()}return g.transform=function(t,e){var n=t.selection?t.selection():t;n.property("__zoom",lf),t!==n?w(t,e):n.interrupt().each(function(){S(this,arguments).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()})},g.scaleBy=function(t,e){g.scaleTo(t,function(){var t=this.__zoom.k,n="function"==typeof e?e.apply(this,arguments):e;return t*n})},g.scaleTo=function(t,e){g.transform(t,function(){var t=i.apply(this,arguments),n=this.__zoom,o=x(t),a=n.invert(o),s="function"==typeof e?e.apply(this,arguments):e;return r(v(_(n,s),o,a),t,c)})},g.translateBy=function(t,e,n){g.transform(t,function(){return r(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),i.apply(this,arguments),c)})},g.translateTo=function(t,e,n){g.transform(t,function(){var t=i.apply(this,arguments),o=this.__zoom,a=x(t);return r(nf.translate(a[0],a[1]).scale(o.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,c)})},A.prototype={start:function(){return 1==++this.active&&(this.index=h.push(this)-1,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(h.splice(this.index,1),this.index=-1,this.emit("end")),this},emit:function(t){Object(y.customEvent)(new tf(g,t,this.that.__zoom),d.apply,d,[t,this.that,this.args])}},g.wheelDelta=function(t){return arguments.length?(o="function"==typeof t?t:$d(+t),g):o},g.filter=function(t){return arguments.length?(n="function"==typeof t?t:$d(!!t),g):n},g.touchable=function(t){return arguments.length?(a="function"==typeof t?t:$d(!!t),g):a},g.extent=function(t){return arguments.length?(i="function"==typeof t?t:$d([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),g):i},g.scaleExtent=function(t){return arguments.length?(s[0]=+t[0],s[1]=+t[1],g):[s[0],s[1]]},g.translateExtent=function(t){return arguments.length?(c[0][0]=+t[0][0],c[1][0]=+t[1][0],c[0][1]=+t[0][1],c[1][1]=+t[1][1],g):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},g.constrain=function(t){return arguments.length?(r=t,g):r},g.duration=function(t){return arguments.length?(l=+t,g):l},g.interpolate=function(t){return arguments.length?(u=t,g):u},g.on=function(){var t=d.on.apply(d,arguments);return t===d?g:t},g.clickDistance=function(t){return arguments.length?(m=(t=+t)*t,g):Math.sqrt(m)},g};n.d(e,"version",function(){return"5.9.2"}),n.d(e,"bisect",function(){return i.b}),n.d(e,"bisectRight",function(){return i.d}),n.d(e,"bisectLeft",function(){return i.c}),n.d(e,"ascending",function(){return i.a}),n.d(e,"bisector",function(){return i.e}),n.d(e,"cross",function(){return i.f}),n.d(e,"descending",function(){return i.g}),n.d(e,"deviation",function(){return i.h}),n.d(e,"extent",function(){return i.i}),n.d(e,"histogram",function(){return i.j}),n.d(e,"thresholdFreedmanDiaconis",function(){return i.w}),n.d(e,"thresholdScott",function(){return i.x}),n.d(e,"thresholdSturges",function(){return i.y}),n.d(e,"max",function(){return i.k}),n.d(e,"mean",function(){return i.l}),n.d(e,"median",function(){return i.m}),n.d(e,"merge",function(){return i.n}),n.d(e,"min",function(){return i.o}),n.d(e,"pairs",function(){return i.p}),n.d(e,"permute",function(){return i.q}),n.d(e,"quantile",function(){return i.r}),n.d(e,"range",function(){return i.s}),n.d(e,"scan",function(){return i.t}),n.d(e,"shuffle",function(){return i.u}),n.d(e,"sum",function(){return i.v}),n.d(e,"ticks",function(){return i.B}),n.d(e,"tickIncrement",function(){return i.z}),n.d(e,"tickStep",function(){return i.A}),n.d(e,"transpose",function(){return i.C}),n.d(e,"variance",function(){return i.D}),n.d(e,"zip",function(){return i.E}),n.d(e,"axisTop",function(){return m}),n.d(e,"axisRight",function(){return g}),n.d(e,"axisBottom",function(){return _}),n.d(e,"axisLeft",function(){return v}),n.d(e,"brush",function(){return rt}),n.d(e,"brushX",function(){return nt}),n.d(e,"brushY",function(){return it}),n.d(e,"brushSelection",function(){return et}),n.d(e,"chord",function(){return ft}),n.d(e,"ribbon",function(){return Tt}),n.d(e,"nest",function(){return kt.d}),n.d(e,"set",function(){return kt.e}),n.d(e,"map",function(){return kt.c}),n.d(e,"keys",function(){return kt.b}),n.d(e,"values",function(){return kt.f}),n.d(e,"entries",function(){return kt.a}),n.d(e,"color",function(){return Pt.a}),n.d(e,"rgb",function(){return Pt.h}),n.d(e,"hsl",function(){return Pt.e}),n.d(e,"lab",function(){return Pt.f}),n.d(e,"hcl",function(){return Pt.d}),n.d(e,"lch",function(){return Pt.g}),n.d(e,"gray",function(){return Pt.c}),n.d(e,"cubehelix",function(){return Pt.b}),n.d(e,"contours",function(){return jt}),n.d(e,"contourDensity",function(){return Wt}),n.d(e,"dispatch",function(){return b.a}),n.d(e,"drag",function(){return O}),n.d(e,"dragDisable",function(){return M}),n.d(e,"dragEnable",function(){return E}),n.d(e,"dsvFormat",function(){return ee}),n.d(e,"csvParse",function(){return ie}),n.d(e,"csvParseRows",function(){return re}),n.d(e,"csvFormat",function(){return oe}),n.d(e,"csvFormatBody",function(){return ae}),n.d(e,"csvFormatRows",function(){return se}),n.d(e,"tsvParse",function(){return le}),n.d(e,"tsvParseRows",function(){return ue}),n.d(e,"tsvFormat",function(){return he}),n.d(e,"tsvFormatBody",function(){return de}),n.d(e,"tsvFormatRows",function(){return fe}),n.d(e,"autoType",function(){return pe}),n.d(e,"easeLinear",function(){return me.y}),n.d(e,"easeQuad",function(){return me.D}),n.d(e,"easeQuadIn",function(){return me.E}),n.d(e,"easeQuadOut",function(){return me.G}),n.d(e,"easeQuadInOut",function(){return me.F}),n.d(e,"easeCubic",function(){return me.m}),n.d(e,"easeCubicIn",function(){return me.n}),n.d(e,"easeCubicOut",function(){return me.p}),n.d(e,"easeCubicInOut",function(){return me.o}),n.d(e,"easePoly",function(){return me.z}),n.d(e,"easePolyIn",function(){return me.A}),n.d(e,"easePolyOut",function(){return me.C}),n.d(e,"easePolyInOut",function(){return me.B}),n.d(e,"easeSin",function(){return me.H}),n.d(e,"easeSinIn",function(){return me.I}),n.d(e,"easeSinOut",function(){return me.K}),n.d(e,"easeSinInOut",function(){return me.J}),n.d(e,"easeExp",function(){return me.u}),n.d(e,"easeExpIn",function(){return me.v}),n.d(e,"easeExpOut",function(){return me.x}),n.d(e,"easeExpInOut",function(){return me.w}),n.d(e,"easeCircle",function(){return me.i}),n.d(e,"easeCircleIn",function(){return me.j}),n.d(e,"easeCircleOut",function(){return me.l}),n.d(e,"easeCircleInOut",function(){return me.k}),n.d(e,"easeBounce",function(){return me.e}),n.d(e,"easeBounceIn",function(){return me.f}),n.d(e,"easeBounceOut",function(){return me.h}),n.d(e,"easeBounceInOut",function(){return me.g}),n.d(e,"easeBack",function(){return me.a}),n.d(e,"easeBackIn",function(){return me.b}),n.d(e,"easeBackOut",function(){return me.d}),n.d(e,"easeBackInOut",function(){return me.c}),n.d(e,"easeElastic",function(){return me.q}),n.d(e,"easeElasticIn",function(){return me.r}),n.d(e,"easeElasticOut",function(){return me.t}),n.d(e,"easeElasticInOut",function(){return me.s}),n.d(e,"blob",function(){return _e}),n.d(e,"buffer",function(){return be}),n.d(e,"dsv",function(){return Me}),n.d(e,"csv",function(){return Ee}),n.d(e,"tsv",function(){return Se}),n.d(e,"image",function(){return Ae}),n.d(e,"json",function(){return ke}),n.d(e,"text",function(){return xe}),n.d(e,"xml",function(){return Le}),n.d(e,"html",function(){return Oe}),n.d(e,"svg",function(){return Ce}),n.d(e,"forceCenter",function(){return Re}),n.d(e,"forceCollide",function(){return Ve}),n.d(e,"forceLink",function(){return Ke}),n.d(e,"forceManyBody",function(){return nn}),n.d(e,"forceRadial",function(){return rn}),n.d(e,"forceSimulation",function(){return en}),n.d(e,"forceX",function(){return on}),n.d(e,"forceY",function(){return an}),n.d(e,"formatDefaultLocale",function(){return sn.b}),n.d(e,"format",function(){return sn.a}),n.d(e,"formatPrefix",function(){return sn.d}),n.d(e,"formatLocale",function(){return sn.c}),n.d(e,"formatSpecifier",function(){return sn.e}),n.d(e,"precisionFixed",function(){return sn.f}),n.d(e,"precisionPrefix",function(){return sn.g}),n.d(e,"precisionRound",function(){return sn.h}),n.d(e,"geoArea",function(){return $n}),n.d(e,"geoBounds",function(){return Wi}),n.d(e,"geoCentroid",function(){return ir}),n.d(e,"geoCircle",function(){return pr}),n.d(e,"geoClipAntimeridian",function(){return Sr}),n.d(e,"geoClipCircle",function(){return Ar}),n.d(e,"geoClipExtent",function(){return Ir}),n.d(e,"geoClipRectangle",function(){return Lr}),n.d(e,"geoContains",function(){return Qr}),n.d(e,"geoDistance",function(){return qr}),n.d(e,"geoGraticule",function(){return eo}),n.d(e,"geoGraticule10",function(){return no}),n.d(e,"geoInterpolate",function(){return so}),n.d(e,"geoLength",function(){return Ur}),n.d(e,"geoPath",function(){return aa}),n.d(e,"geoAlbers",function(){return Sa}),n.d(e,"geoAlbersUsa",function(){return Aa}),n.d(e,"geoAzimuthalEqualArea",function(){return La}),n.d(e,"geoAzimuthalEqualAreaRaw",function(){return Pa}),n.d(e,"geoAzimuthalEquidistant",function(){return Ca}),n.d(e,"geoAzimuthalEquidistantRaw",function(){return Oa}),n.d(e,"geoConicConformal",function(){return Da}),n.d(e,"geoConicConformalRaw",function(){return Na}),n.d(e,"geoConicEqualArea",function(){return Ea}),n.d(e,"geoConicEqualAreaRaw",function(){return Ma}),n.d(e,"geoConicEquidistant",function(){return Ha}),n.d(e,"geoConicEquidistantRaw",function(){return Fa}),n.d(e,"geoEqualEarth",function(){return Ka}),n.d(e,"geoEqualEarthRaw",function(){return Ya}),n.d(e,"geoEquirectangular",function(){return Ua}),n.d(e,"geoEquirectangularRaw",function(){return ja}),n.d(e,"geoGnomonic",function(){return Ja}),n.d(e,"geoGnomonicRaw",function(){return Za}),n.d(e,"geoIdentity",function(){return $a}),n.d(e,"geoProjection",function(){return ya}),n.d(e,"geoProjectionMutator",function(){return xa}),n.d(e,"geoMercator",function(){return Ia}),n.d(e,"geoMercatorRaw",function(){return Ra}),n.d(e,"geoNaturalEarth1",function(){return es}),n.d(e,"geoNaturalEarth1Raw",function(){return ts}),n.d(e,"geoOrthographic",function(){return is}),n.d(e,"geoOrthographicRaw",function(){return ns}),n.d(e,"geoStereographic",function(){return os}),n.d(e,"geoStereographicRaw",function(){return rs}),n.d(e,"geoTransverseMercator",function(){return ss}),n.d(e,"geoTransverseMercatorRaw",function(){return as}),n.d(e,"geoRotation",function(){return hr}),n.d(e,"geoStream",function(){return Wn}),n.d(e,"geoTransform",function(){return sa}),n.d(e,"cluster",function(){return hs}),n.d(e,"hierarchy",function(){return fs}),n.d(e,"pack",function(){return Ds}),n.d(e,"packSiblings",function(){return Cs}),n.d(e,"packEnclose",function(){return bs}),n.d(e,"partition",function(){return Gs}),n.d(e,"stratify",function(){return Zs}),n.d(e,"tree",function(){return ic}),n.d(e,"treemap",function(){return cc}),n.d(e,"treemapBinary",function(){return lc}),n.d(e,"treemapDice",function(){return qs}),n.d(e,"treemapSlice",function(){return rc}),n.d(e,"treemapSliceDice",function(){return uc}),n.d(e,"treemapSquarify",function(){return sc}),n.d(e,"treemapResquarify",function(){return hc}),n.d(e,"interpolate",function(){return C.a}),n.d(e,"interpolateArray",function(){return C.b}),n.d(e,"interpolateBasis",function(){return C.c}),n.d(e,"interpolateBasisClosed",function(){return C.d}),n.d(e,"interpolateDate",function(){return C.g}),n.d(e,"interpolateDiscrete",function(){return C.h}),n.d(e,"interpolateHue",function(){return C.m}),n.d(e,"interpolateNumber",function(){return C.o}),n.d(e,"interpolateObject",function(){return C.p}),n.d(e,"interpolateRound",function(){return C.t}),n.d(e,"interpolateString",function(){return C.u}),n.d(e,"interpolateTransformCss",function(){return C.v}),n.d(e,"interpolateTransformSvg",function(){return C.w}),n.d(e,"interpolateZoom",function(){return C.x}),n.d(e,"interpolateRgb",function(){return C.q}),n.d(e,"interpolateRgbBasis",function(){return C.r}),n.d(e,"interpolateRgbBasisClosed",function(){return C.s}),n.d(e,"interpolateHsl",function(){return C.k}),n.d(e,"interpolateHslLong",function(){return C.l}),n.d(e,"interpolateLab",function(){return C.n}),n.d(e,"interpolateHcl",function(){return C.i}),n.d(e,"interpolateHclLong",function(){return C.j}),n.d(e,"interpolateCubehelix",function(){return C.e}),n.d(e,"interpolateCubehelixLong",function(){return C.f}),n.d(e,"piecewise",function(){return C.y}),n.d(e,"quantize",function(){return C.z}),n.d(e,"path",function(){return xt}),n.d(e,"polygonArea",function(){return dc}),n.d(e,"polygonCentroid",function(){return fc}),n.d(e,"polygonHull",function(){return _c}),n.d(e,"polygonContains",function(){return vc}),n.d(e,"polygonLength",function(){return bc}),n.d(e,"quadtree",function(){return Ue}),n.d(e,"randomUniform",function(){return xc}),n.d(e,"randomNormal",function(){return wc}),n.d(e,"randomLogNormal",function(){return Mc}),n.d(e,"randomBates",function(){return Sc}),n.d(e,"randomIrwinHall",function(){return Ec}),n.d(e,"randomExponential",function(){return Ac}),n.d(e,"scaleBand",function(){return Tc.scaleBand}),n.d(e,"scalePoint",function(){return Tc.scalePoint}),n.d(e,"scaleIdentity",function(){return Tc.scaleIdentity}),n.d(e,"scaleLinear",function(){return Tc.scaleLinear}),n.d(e,"scaleLog",function(){return Tc.scaleLog}),n.d(e,"scaleSymlog",function(){return Tc.scaleSymlog}),n.d(e,"scaleOrdinal",function(){return Tc.scaleOrdinal}),n.d(e,"scaleImplicit",function(){return Tc.scaleImplicit}),n.d(e,"scalePow",function(){return Tc.scalePow}),n.d(e,"scaleSqrt",function(){return Tc.scaleSqrt}),n.d(e,"scaleQuantile",function(){return Tc.scaleQuantile}),n.d(e,"scaleQuantize",function(){return Tc.scaleQuantize}),n.d(e,"scaleThreshold",function(){return Tc.scaleThreshold}),n.d(e,"scaleTime",function(){return Tc.scaleTime}),n.d(e,"scaleUtc",function(){return Tc.scaleUtc}),n.d(e,"scaleSequential",function(){return Tc.scaleSequential}),n.d(e,"scaleSequentialLog",function(){return Tc.scaleSequentialLog}),n.d(e,"scaleSequentialPow",function(){return Tc.scaleSequentialPow}),n.d(e,"scaleSequentialSqrt",function(){return Tc.scaleSequentialSqrt}),n.d(e,"scaleSequentialSymlog",function(){return Tc.scaleSequentialSymlog}),n.d(e,"scaleSequentialQuantile",function(){return Tc.scaleSequentialQuantile}),n.d(e,"scaleDiverging",function(){return Tc.scaleDiverging}),n.d(e,"scaleDivergingLog",function(){return Tc.scaleDivergingLog}),n.d(e,"scaleDivergingPow",function(){return Tc.scaleDivergingPow}),n.d(e,"scaleDivergingSqrt",function(){return Tc.scaleDivergingSqrt}),n.d(e,"scaleDivergingSymlog",function(){return Tc.scaleDivergingSymlog}),n.d(e,"tickFormat",function(){return Tc.tickFormat}),n.d(e,"schemeCategory10",function(){return Pc}),n.d(e,"schemeAccent",function(){return Lc}),n.d(e,"schemeDark2",function(){return Oc}),n.d(e,"schemePaired",function(){return Cc}),n.d(e,"schemePastel1",function(){return Rc}),n.d(e,"schemePastel2",function(){return Ic}),n.d(e,"schemeSet1",function(){return zc}),n.d(e,"schemeSet2",function(){return Bc}),n.d(e,"schemeSet3",function(){return Nc}),n.d(e,"interpolateBrBG",function(){return Uc}),n.d(e,"schemeBrBG",function(){return jc}),n.d(e,"interpolatePRGn",function(){return Hc}),n.d(e,"schemePRGn",function(){return Fc}),n.d(e,"interpolatePiYG",function(){return Gc}),n.d(e,"schemePiYG",function(){return qc}),n.d(e,"interpolatePuOr",function(){return Vc}),n.d(e,"schemePuOr",function(){return Wc}),n.d(e,"interpolateRdBu",function(){return Yc}),n.d(e,"schemeRdBu",function(){return Xc}),n.d(e,"interpolateRdGy",function(){return Zc}),n.d(e,"schemeRdGy",function(){return Kc}),n.d(e,"interpolateRdYlBu",function(){return Qc}),n.d(e,"schemeRdYlBu",function(){return Jc}),n.d(e,"interpolateRdYlGn",function(){return tl}),n.d(e,"schemeRdYlGn",function(){return $c}),n.d(e,"interpolateSpectral",function(){return nl}),n.d(e,"schemeSpectral",function(){return el}),n.d(e,"interpolateBuGn",function(){return rl}),n.d(e,"schemeBuGn",function(){return il}),n.d(e,"interpolateBuPu",function(){return al}),n.d(e,"schemeBuPu",function(){return ol}),n.d(e,"interpolateGnBu",function(){return cl}),n.d(e,"schemeGnBu",function(){return sl}),n.d(e,"interpolateOrRd",function(){return ul}),n.d(e,"schemeOrRd",function(){return ll}),n.d(e,"interpolatePuBuGn",function(){return dl}),n.d(e,"schemePuBuGn",function(){return hl}),n.d(e,"interpolatePuBu",function(){return pl}),n.d(e,"schemePuBu",function(){return fl}),n.d(e,"interpolatePuRd",function(){return gl}),n.d(e,"schemePuRd",function(){return ml}),n.d(e,"interpolateRdPu",function(){return vl}),n.d(e,"schemeRdPu",function(){return _l}),n.d(e,"interpolateYlGnBu",function(){return yl}),n.d(e,"schemeYlGnBu",function(){return bl}),n.d(e,"interpolateYlGn",function(){return wl}),n.d(e,"schemeYlGn",function(){return xl}),n.d(e,"interpolateYlOrBr",function(){return El}),n.d(e,"schemeYlOrBr",function(){return Ml}),n.d(e,"interpolateYlOrRd",function(){return Al}),n.d(e,"schemeYlOrRd",function(){return Sl}),n.d(e,"interpolateBlues",function(){return kl}),n.d(e,"schemeBlues",function(){return Tl}),n.d(e,"interpolateGreens",function(){return Ll}),n.d(e,"schemeGreens",function(){return Pl}),n.d(e,"interpolateGreys",function(){return Cl}),n.d(e,"schemeGreys",function(){return Ol}),n.d(e,"interpolatePurples",function(){return Il}),n.d(e,"schemePurples",function(){return Rl}),n.d(e,"interpolateReds",function(){return Bl}),n.d(e,"schemeReds",function(){return zl}),n.d(e,"interpolateOranges",function(){return Dl}),n.d(e,"schemeOranges",function(){return Nl}),n.d(e,"interpolateCubehelixDefault",function(){return jl}),n.d(e,"interpolateRainbow",function(){return ql}),n.d(e,"interpolateWarm",function(){return Ul}),n.d(e,"interpolateCool",function(){return Fl}),n.d(e,"interpolateSinebow",function(){return Xl}),n.d(e,"interpolateViridis",function(){return Kl}),n.d(e,"interpolateMagma",function(){return Zl}),n.d(e,"interpolateInferno",function(){return Jl}),n.d(e,"interpolatePlasma",function(){return Ql}),n.d(e,"create",function(){return y.create}),n.d(e,"creator",function(){return y.creator}),n.d(e,"local",function(){return y.local}),n.d(e,"matcher",function(){return y.matcher}),n.d(e,"mouse",function(){return y.mouse}),n.d(e,"namespace",function(){return y.namespace}),n.d(e,"namespaces",function(){return y.namespaces}),n.d(e,"clientPoint",function(){return y.clientPoint}),n.d(e,"select",function(){return y.select}),n.d(e,"selectAll",function(){return y.selectAll}),n.d(e,"selection",function(){return y.selection}),n.d(e,"selector",function(){return y.selector}),n.d(e,"selectorAll",function(){return y.selectorAll}),n.d(e,"style",function(){return y.style}),n.d(e,"touch",function(){return y.touch}),n.d(e,"touches",function(){return y.touches}),n.d(e,"window",function(){return y.window}),n.d(e,"event",function(){return y.event}),n.d(e,"customEvent",function(){return y.customEvent}),n.d(e,"arc",function(){return vu}),n.d(e,"area",function(){return Eu}),n.d(e,"line",function(){return Mu}),n.d(e,"pie",function(){return Tu}),n.d(e,"areaRadial",function(){return Ru}),n.d(e,"radialArea",function(){return Ru}),n.d(e,"lineRadial",function(){return Cu}),n.d(e,"radialLine",function(){return Cu}),n.d(e,"pointRadial",function(){return Iu}),n.d(e,"linkHorizontal",function(){return Hu}),n.d(e,"linkVertical",function(){return qu}),n.d(e,"linkRadial",function(){return Gu}),n.d(e,"symbol",function(){return ch}),n.d(e,"symbols",function(){return sh}),n.d(e,"symbolCircle",function(){return Wu}),n.d(e,"symbolCross",function(){return Vu}),n.d(e,"symbolDiamond",function(){return Ku}),n.d(e,"symbolSquare",function(){return th}),n.d(e,"symbolStar",function(){return $u}),n.d(e,"symbolTriangle",function(){return nh}),n.d(e,"symbolWye",function(){return ah}),n.d(e,"curveBasisClosed",function(){return ph}),n.d(e,"curveBasisOpen",function(){return gh}),n.d(e,"curveBasis",function(){return dh}),n.d(e,"curveBundle",function(){return vh}),n.d(e,"curveCardinalClosed",function(){return Mh}),n.d(e,"curveCardinalOpen",function(){return Sh}),n.d(e,"curveCardinal",function(){return xh}),n.d(e,"curveCatmullRomClosed",function(){return Lh}),n.d(e,"curveCatmullRomOpen",function(){return Ch}),n.d(e,"curveCatmullRom",function(){return kh}),n.d(e,"curveLinearClosed",function(){return Ih}),n.d(e,"curveLinear",function(){return yu}),n.d(e,"curveMonotoneX",function(){return Hh}),n.d(e,"curveMonotoneY",function(){return qh}),n.d(e,"curveNatural",function(){return Vh}),n.d(e,"curveStep",function(){return Yh}),n.d(e,"curveStepAfter",function(){return Zh}),n.d(e,"curveStepBefore",function(){return Kh}),n.d(e,"stack",function(){return td}),n.d(e,"stackOffsetExpand",function(){return ed}),n.d(e,"stackOffsetDiverging",function(){return nd}),n.d(e,"stackOffsetNone",function(){return Jh}),n.d(e,"stackOffsetSilhouette",function(){return id}),n.d(e,"stackOffsetWiggle",function(){return rd}),n.d(e,"stackOrderAppearance",function(){return od}),n.d(e,"stackOrderAscending",function(){return sd}),n.d(e,"stackOrderDescending",function(){return ld}),n.d(e,"stackOrderInsideOut",function(){return ud}),n.d(e,"stackOrderNone",function(){return Qh}),n.d(e,"stackOrderReverse",function(){return hd}),n.d(e,"timeInterval",function(){return dd.g}),n.d(e,"timeMillisecond",function(){return dd.h}),n.d(e,"timeMilliseconds",function(){return dd.i}),n.d(e,"utcMillisecond",function(){return dd.L}),n.d(e,"utcMilliseconds",function(){return dd.M}),n.d(e,"timeSecond",function(){return dd.r}),n.d(e,"timeSeconds",function(){return dd.s}),n.d(e,"utcSecond",function(){return dd.V}),n.d(e,"utcSeconds",function(){return dd.W}),n.d(e,"timeMinute",function(){return dd.j}),n.d(e,"timeMinutes",function(){return dd.k}),n.d(e,"timeHour",function(){return dd.e}),n.d(e,"timeHours",function(){return dd.f}),n.d(e,"timeDay",function(){return dd.a}),n.d(e,"timeDays",function(){return dd.b}),n.d(e,"timeWeek",function(){return dd.B}),n.d(e,"timeWeeks",function(){return dd.C}),n.d(e,"timeSunday",function(){return dd.t}),n.d(e,"timeSundays",function(){return dd.u}),n.d(e,"timeMonday",function(){return dd.l}),n.d(e,"timeMondays",function(){return dd.m}),n.d(e,"timeTuesday",function(){return dd.x}),n.d(e,"timeTuesdays",function(){return dd.y}),n.d(e,"timeWednesday",function(){return dd.z}),n.d(e,"timeWednesdays",function(){return dd.A}),n.d(e,"timeThursday",function(){return dd.v}),n.d(e,"timeThursdays",function(){return dd.w}),n.d(e,"timeFriday",function(){return dd.c}),n.d(e,"timeFridays",function(){return dd.d}),n.d(e,"timeSaturday",function(){return dd.p}),n.d(e,"timeSaturdays",function(){return dd.q}),n.d(e,"timeMonth",function(){return dd.n}),n.d(e,"timeMonths",function(){return dd.o}),n.d(e,"timeYear",function(){return dd.D}),n.d(e,"timeYears",function(){return dd.E}),n.d(e,"utcMinute",function(){return dd.N}),n.d(e,"utcMinutes",function(){return dd.O}),n.d(e,"utcHour",function(){return dd.J}),n.d(e,"utcHours",function(){return dd.K}),n.d(e,"utcDay",function(){return dd.F}),n.d(e,"utcDays",function(){return dd.G}),n.d(e,"utcWeek",function(){return dd.fb}),n.d(e,"utcWeeks",function(){return dd.gb}),n.d(e,"utcSunday",function(){return dd.X}),n.d(e,"utcSundays",function(){return dd.Y}),n.d(e,"utcMonday",function(){return dd.P}),n.d(e,"utcMondays",function(){return dd.Q}),n.d(e,"utcTuesday",function(){return dd.bb}),n.d(e,"utcTuesdays",function(){return dd.cb}),n.d(e,"utcWednesday",function(){return dd.db}),n.d(e,"utcWednesdays",function(){return dd.eb}),n.d(e,"utcThursday",function(){return dd.Z}),n.d(e,"utcThursdays",function(){return dd.ab}),n.d(e,"utcFriday",function(){return dd.H}),n.d(e,"utcFridays",function(){return dd.I}),n.d(e,"utcSaturday",function(){return dd.T}),n.d(e,"utcSaturdays",function(){return dd.U}),n.d(e,"utcMonth",function(){return dd.R}),n.d(e,"utcMonths",function(){return dd.S}),n.d(e,"utcYear",function(){return dd.hb}),n.d(e,"utcYears",function(){return dd.ib}),n.d(e,"timeFormatDefaultLocale",function(){return fd.d}),n.d(e,"timeFormat",function(){return fd.c}),n.d(e,"timeParse",function(){return fd.f}),n.d(e,"utcFormat",function(){return fd.g}),n.d(e,"utcParse",function(){return fd.h}),n.d(e,"timeFormatLocale",function(){return fd.e}),n.d(e,"isoFormat",function(){return fd.a}),n.d(e,"isoParse",function(){return fd.b}),n.d(e,"now",function(){return Ze.b}),n.d(e,"timer",function(){return Ze.d}),n.d(e,"timerFlush",function(){return Ze.e}),n.d(e,"timeout",function(){return Ze.c}),n.d(e,"interval",function(){return Ze.a}),n.d(e,"transition",function(){return R.c}),n.d(e,"active",function(){return R.a}),n.d(e,"interrupt",function(){return R.b}),n.d(e,"voronoi",function(){return Qd}),n.d(e,"zoom",function(){return ff}),n.d(e,"zoomTransform",function(){return rf}),n.d(e,"zoomIdentity",function(){return nf})},function(t,e,n){"use strict";var i=new Date,r=new Date;function o(t,e,n,a){function s(e){return t(e=new Date(+e)),e}return s.floor=s,s.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},s.round=function(t){var e=s(t),n=s.ceil(t);return t-e<n-t?e:n},s.offset=function(t,n){return e(t=new Date(+t),null==n?1:Math.floor(n)),t},s.range=function(n,i,r){var o,a=[];if(n=s.ceil(n),r=null==r?1:Math.floor(r),!(n<i&&r>0))return a;do{a.push(o=new Date(+n)),e(n,r),t(n)}while(o<n&&n<i);return a},s.filter=function(n){return o(function(e){if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)},function(t,i){if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););})},n&&(s.count=function(e,o){return i.setTime(+e),r.setTime(+o),t(i),t(r),Math.floor(n(i,r))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(a?function(e){return a(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}var a=o(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});a.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?o(function(e){e.setTime(Math.floor(e/t)*t)},function(e,n){e.setTime(+e+n*t)},function(e,n){return(n-e)/t}):a:null};var s=a,c=a.range,l=6e4,u=6048e5,h=o(function(t){t.setTime(t-t.getMilliseconds())},function(t,e){t.setTime(+t+1e3*e)},function(t,e){return(e-t)/1e3},function(t){return t.getUTCSeconds()}),d=h,f=h.range,p=o(function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())},function(t,e){t.setTime(+t+e*l)},function(t,e){return(e-t)/l},function(t){return t.getMinutes()}),m=p,g=p.range,_=o(function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-t.getMinutes()*l)},function(t,e){t.setTime(+t+36e5*e)},function(t,e){return(e-t)/36e5},function(t){return t.getHours()}),v=_,b=_.range,y=o(function(t){t.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*l)/864e5},function(t){return t.getDate()-1}),x=y,w=y.range;function M(t){return o(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+7*e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*l)/u})}var E=M(0),S=M(1),A=M(2),T=M(3),k=M(4),P=M(5),L=M(6),O=E.range,C=S.range,R=A.range,I=T.range,z=k.range,B=P.range,N=L.range,D=o(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,e){t.setMonth(t.getMonth()+e)},function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),j=D,U=D.range,F=o(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});F.every=function(t){return isFinite(t=Math.floor(t))&&t>0?o(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,n){e.setFullYear(e.getFullYear()+n*t)}):null};var H=F,q=F.range,G=o(function(t){t.setUTCSeconds(0,0)},function(t,e){t.setTime(+t+e*l)},function(t,e){return(e-t)/l},function(t){return t.getUTCMinutes()}),W=G,V=G.range,X=o(function(t){t.setUTCMinutes(0,0,0)},function(t,e){t.setTime(+t+36e5*e)},function(t,e){return(e-t)/36e5},function(t){return t.getUTCHours()}),Y=X,K=X.range,Z=o(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/864e5},function(t){return t.getUTCDate()-1}),J=Z,Q=Z.range;function $(t){return o(function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+7*e)},function(t,e){return(e-t)/u})}var tt=$(0),et=$(1),nt=$(2),it=$(3),rt=$(4),ot=$(5),at=$(6),st=tt.range,ct=et.range,lt=nt.range,ut=it.range,ht=rt.range,dt=ot.range,ft=at.range,pt=o(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCMonth(t.getUTCMonth()+e)},function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()}),mt=pt,gt=pt.range,_t=o(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)},function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});_t.every=function(t){return isFinite(t=Math.floor(t))&&t>0?o(function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)}):null};var vt=_t,bt=_t.range;n.d(e,"g",function(){return o}),n.d(e,"h",function(){return s}),n.d(e,"i",function(){return c}),n.d(e,"L",function(){return s}),n.d(e,"M",function(){return c}),n.d(e,"r",function(){return d}),n.d(e,"s",function(){return f}),n.d(e,"V",function(){return d}),n.d(e,"W",function(){return f}),n.d(e,"j",function(){return m}),n.d(e,"k",function(){return g}),n.d(e,"e",function(){return v}),n.d(e,"f",function(){return b}),n.d(e,"a",function(){return x}),n.d(e,"b",function(){return w}),n.d(e,"B",function(){return E}),n.d(e,"C",function(){return O}),n.d(e,"t",function(){return E}),n.d(e,"u",function(){return O}),n.d(e,"l",function(){return S}),n.d(e,"m",function(){return C}),n.d(e,"x",function(){return A}),n.d(e,"y",function(){return R}),n.d(e,"z",function(){return T}),n.d(e,"A",function(){return I}),n.d(e,"v",function(){return k}),n.d(e,"w",function(){return z}),n.d(e,"c",function(){return P}),n.d(e,"d",function(){return B}),n.d(e,"p",function(){return L}),n.d(e,"q",function(){return N}),n.d(e,"n",function(){return j}),n.d(e,"o",function(){return U}),n.d(e,"D",function(){return H}),n.d(e,"E",function(){return q}),n.d(e,"N",function(){return W}),n.d(e,"O",function(){return V}),n.d(e,"J",function(){return Y}),n.d(e,"K",function(){return K}),n.d(e,"F",function(){return J}),n.d(e,"G",function(){return Q}),n.d(e,"fb",function(){return tt}),n.d(e,"gb",function(){return st}),n.d(e,"X",function(){return tt}),n.d(e,"Y",function(){return st}),n.d(e,"P",function(){return et}),n.d(e,"Q",function(){return ct}),n.d(e,"bb",function(){return nt}),n.d(e,"cb",function(){return lt}),n.d(e,"db",function(){return it}),n.d(e,"eb",function(){return ut}),n.d(e,"Z",function(){return rt}),n.d(e,"ab",function(){return ht}),n.d(e,"H",function(){return ot}),n.d(e,"I",function(){return dt}),n.d(e,"T",function(){return at}),n.d(e,"U",function(){return ft}),n.d(e,"R",function(){return mt}),n.d(e,"S",function(){return gt}),n.d(e,"hb",function(){return vt}),n.d(e,"ib",function(){return bt})},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e,n){var i=n(15),r=i.Buffer;function o(t,e){for(var n in t)e[n]=t[n]}function a(t,e,n){return r(t,e,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=a),o(r,a),a.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return r(t,e,n)},a.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=r(t);return void 0!==e?"string"==typeof n?i.fill(e,n):i.fill(e):i.fill(0),i},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e,n){(function(t,n){var i;!function(){var r="object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t||this||{},o=r._,a=Array.prototype,s=Object.prototype,c="undefined"!=typeof Symbol?Symbol.prototype:null,l=a.push,u=a.slice,h=s.toString,d=s.hasOwnProperty,f=Array.isArray,p=Object.keys,m=Object.create,g=function(){},_=function(t){return t instanceof _?t:this instanceof _?void(this._wrapped=t):new _(t)};e.nodeType?r._=_:(!n.nodeType&&n.exports&&(e=n.exports=_),e._=_),_.VERSION="1.9.1";var v,b=function(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,i,r){return t.call(e,n,i,r)};case 4:return function(n,i,r,o){return t.call(e,n,i,r,o)}}return function(){return t.apply(e,arguments)}},y=function(t,e,n){return _.iteratee!==v?_.iteratee(t,e):null==t?_.identity:_.isFunction(t)?b(t,e,n):_.isObject(t)&&!_.isArray(t)?_.matcher(t):_.property(t)};_.iteratee=v=function(t,e){return y(t,e,1/0)};var x=function(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),i=Array(n),r=0;r<n;r++)i[r]=arguments[r+e];switch(e){case 0:return t.call(this,i);case 1:return t.call(this,arguments[0],i);case 2:return t.call(this,arguments[0],arguments[1],i)}var o=Array(e+1);for(r=0;r<e;r++)o[r]=arguments[r];return o[e]=i,t.apply(this,o)}},w=function(t){if(!_.isObject(t))return{};if(m)return m(t);g.prototype=t;var e=new g;return g.prototype=null,e},M=function(t){return function(e){return null==e?void 0:e[t]}},E=function(t,e){return null!=t&&d.call(t,e)},S=function(t,e){for(var n=e.length,i=0;i<n;i++){if(null==t)return;t=t[e[i]]}return n?t:void 0},A=Math.pow(2,53)-1,T=M("length"),k=function(t){var e=T(t);return"number"==typeof e&&e>=0&&e<=A};_.each=_.forEach=function(t,e,n){var i,r;if(e=b(e,n),k(t))for(i=0,r=t.length;i<r;i++)e(t[i],i,t);else{var o=_.keys(t);for(i=0,r=o.length;i<r;i++)e(t[o[i]],o[i],t)}return t},_.map=_.collect=function(t,e,n){e=y(e,n);for(var i=!k(t)&&_.keys(t),r=(i||t).length,o=Array(r),a=0;a<r;a++){var s=i?i[a]:a;o[a]=e(t[s],s,t)}return o};var P=function(t){var e=function(e,n,i,r){var o=!k(e)&&_.keys(e),a=(o||e).length,s=t>0?0:a-1;for(r||(i=e[o?o[s]:s],s+=t);s>=0&&s<a;s+=t){var c=o?o[s]:s;i=n(i,e[c],c,e)}return i};return function(t,n,i,r){var o=arguments.length>=3;return e(t,b(n,r,4),i,o)}};_.reduce=_.foldl=_.inject=P(1),_.reduceRight=_.foldr=P(-1),_.find=_.detect=function(t,e,n){var i=(k(t)?_.findIndex:_.findKey)(t,e,n);if(void 0!==i&&-1!==i)return t[i]},_.filter=_.select=function(t,e,n){var i=[];return e=y(e,n),_.each(t,function(t,n,r){e(t,n,r)&&i.push(t)}),i},_.reject=function(t,e,n){return _.filter(t,_.negate(y(e)),n)},_.every=_.all=function(t,e,n){e=y(e,n);for(var i=!k(t)&&_.keys(t),r=(i||t).length,o=0;o<r;o++){var a=i?i[o]:o;if(!e(t[a],a,t))return!1}return!0},_.some=_.any=function(t,e,n){e=y(e,n);for(var i=!k(t)&&_.keys(t),r=(i||t).length,o=0;o<r;o++){var a=i?i[o]:o;if(e(t[a],a,t))return!0}return!1},_.contains=_.includes=_.include=function(t,e,n,i){return k(t)||(t=_.values(t)),("number"!=typeof n||i)&&(n=0),_.indexOf(t,e,n)>=0},_.invoke=x(function(t,e,n){var i,r;return _.isFunction(e)?r=e:_.isArray(e)&&(i=e.slice(0,-1),e=e[e.length-1]),_.map(t,function(t){var o=r;if(!o){if(i&&i.length&&(t=S(t,i)),null==t)return;o=t[e]}return null==o?o:o.apply(t,n)})}),_.pluck=function(t,e){return _.map(t,_.property(e))},_.where=function(t,e){return _.filter(t,_.matcher(e))},_.findWhere=function(t,e){return _.find(t,_.matcher(e))},_.max=function(t,e,n){var i,r,o=-1/0,a=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,c=(t=k(t)?t:_.values(t)).length;s<c;s++)null!=(i=t[s])&&i>o&&(o=i);else e=y(e,n),_.each(t,function(t,n,i){((r=e(t,n,i))>a||r===-1/0&&o===-1/0)&&(o=t,a=r)});return o},_.min=function(t,e,n){var i,r,o=1/0,a=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,c=(t=k(t)?t:_.values(t)).length;s<c;s++)null!=(i=t[s])&&i<o&&(o=i);else e=y(e,n),_.each(t,function(t,n,i){((r=e(t,n,i))<a||r===1/0&&o===1/0)&&(o=t,a=r)});return o},_.shuffle=function(t){return _.sample(t,1/0)},_.sample=function(t,e,n){if(null==e||n)return k(t)||(t=_.values(t)),t[_.random(t.length-1)];var i=k(t)?_.clone(t):_.values(t),r=T(i);e=Math.max(Math.min(e,r),0);for(var o=r-1,a=0;a<e;a++){var s=_.random(a,o),c=i[a];i[a]=i[s],i[s]=c}return i.slice(0,e)},_.sortBy=function(t,e,n){var i=0;return e=y(e,n),_.pluck(_.map(t,function(t,n,r){return{value:t,index:i++,criteria:e(t,n,r)}}).sort(function(t,e){var n=t.criteria,i=e.criteria;if(n!==i){if(n>i||void 0===n)return 1;if(n<i||void 0===i)return-1}return t.index-e.index}),"value")};var L=function(t,e){return function(n,i,r){var o=e?[[],[]]:{};return i=y(i,r),_.each(n,function(e,r){var a=i(e,r,n);t(o,e,a)}),o}};_.groupBy=L(function(t,e,n){E(t,n)?t[n].push(e):t[n]=[e]}),_.indexBy=L(function(t,e,n){t[n]=e}),_.countBy=L(function(t,e,n){E(t,n)?t[n]++:t[n]=1});var O=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;_.toArray=function(t){return t?_.isArray(t)?u.call(t):_.isString(t)?t.match(O):k(t)?_.map(t,_.identity):_.values(t):[]},_.size=function(t){return null==t?0:k(t)?t.length:_.keys(t).length},_.partition=L(function(t,e,n){t[n?0:1].push(e)},!0),_.first=_.head=_.take=function(t,e,n){return null==t||t.length<1?null==e?void 0:[]:null==e||n?t[0]:_.initial(t,t.length-e)},_.initial=function(t,e,n){return u.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},_.last=function(t,e,n){return null==t||t.length<1?null==e?void 0:[]:null==e||n?t[t.length-1]:_.rest(t,Math.max(0,t.length-e))},_.rest=_.tail=_.drop=function(t,e,n){return u.call(t,null==e||n?1:e)},_.compact=function(t){return _.filter(t,Boolean)};var C=function(t,e,n,i){for(var r=(i=i||[]).length,o=0,a=T(t);o<a;o++){var s=t[o];if(k(s)&&(_.isArray(s)||_.isArguments(s)))if(e)for(var c=0,l=s.length;c<l;)i[r++]=s[c++];else C(s,e,n,i),r=i.length;else n||(i[r++]=s)}return i};_.flatten=function(t,e){return C(t,e,!1)},_.without=x(function(t,e){return _.difference(t,e)}),_.uniq=_.unique=function(t,e,n,i){_.isBoolean(e)||(i=n,n=e,e=!1),null!=n&&(n=y(n,i));for(var r=[],o=[],a=0,s=T(t);a<s;a++){var c=t[a],l=n?n(c,a,t):c;e&&!n?(a&&o===l||r.push(c),o=l):n?_.contains(o,l)||(o.push(l),r.push(c)):_.contains(r,c)||r.push(c)}return r},_.union=x(function(t){return _.uniq(C(t,!0,!0))}),_.intersection=function(t){for(var e=[],n=arguments.length,i=0,r=T(t);i<r;i++){var o=t[i];if(!_.contains(e,o)){var a;for(a=1;a<n&&_.contains(arguments[a],o);a++);a===n&&e.push(o)}}return e},_.difference=x(function(t,e){return e=C(e,!0,!0),_.filter(t,function(t){return!_.contains(e,t)})}),_.unzip=function(t){for(var e=t&&_.max(t,T).length||0,n=Array(e),i=0;i<e;i++)n[i]=_.pluck(t,i);return n},_.zip=x(_.unzip),_.object=function(t,e){for(var n={},i=0,r=T(t);i<r;i++)e?n[t[i]]=e[i]:n[t[i][0]]=t[i][1];return n};var R=function(t){return function(e,n,i){n=y(n,i);for(var r=T(e),o=t>0?0:r-1;o>=0&&o<r;o+=t)if(n(e[o],o,e))return o;return-1}};_.findIndex=R(1),_.findLastIndex=R(-1),_.sortedIndex=function(t,e,n,i){for(var r=(n=y(n,i,1))(e),o=0,a=T(t);o<a;){var s=Math.floor((o+a)/2);n(t[s])<r?o=s+1:a=s}return o};var I=function(t,e,n){return function(i,r,o){var a=0,s=T(i);if("number"==typeof o)t>0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(n&&o&&s)return i[o=n(i,r)]===r?o:-1;if(r!=r)return(o=e(u.call(i,a,s),_.isNaN))>=0?o+a:-1;for(o=t>0?a:s-1;o>=0&&o<s;o+=t)if(i[o]===r)return o;return-1}};_.indexOf=I(1,_.findIndex,_.sortedIndex),_.lastIndexOf=I(-1,_.findLastIndex),_.range=function(t,e,n){null==e&&(e=t||0,t=0),n||(n=e<t?-1:1);for(var i=Math.max(Math.ceil((e-t)/n),0),r=Array(i),o=0;o<i;o++,t+=n)r[o]=t;return r},_.chunk=function(t,e){if(null==e||e<1)return[];for(var n=[],i=0,r=t.length;i<r;)n.push(u.call(t,i,i+=e));return n};var z=function(t,e,n,i,r){if(!(i instanceof e))return t.apply(n,r);var o=w(t.prototype),a=t.apply(o,r);return _.isObject(a)?a:o};_.bind=x(function(t,e,n){if(!_.isFunction(t))throw new TypeError("Bind must be called on a function");var i=x(function(r){return z(t,i,e,this,n.concat(r))});return i}),_.partial=x(function(t,e){var n=_.partial.placeholder,i=function(){for(var r=0,o=e.length,a=Array(o),s=0;s<o;s++)a[s]=e[s]===n?arguments[r++]:e[s];for(;r<arguments.length;)a.push(arguments[r++]);return z(t,i,this,this,a)};return i}),_.partial.placeholder=_,_.bindAll=x(function(t,e){var n=(e=C(e,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var i=e[n];t[i]=_.bind(t[i],t)}}),_.memoize=function(t,e){var n=function(i){var r=n.cache,o=""+(e?e.apply(this,arguments):i);return E(r,o)||(r[o]=t.apply(this,arguments)),r[o]};return n.cache={},n},_.delay=x(function(t,e,n){return setTimeout(function(){return t.apply(null,n)},e)}),_.defer=_.partial(_.delay,_,1),_.throttle=function(t,e,n){var i,r,o,a,s=0;n||(n={});var c=function(){s=!1===n.leading?0:_.now(),i=null,a=t.apply(r,o),i||(r=o=null)},l=function(){var l=_.now();s||!1!==n.leading||(s=l);var u=e-(l-s);return r=this,o=arguments,u<=0||u>e?(i&&(clearTimeout(i),i=null),s=l,a=t.apply(r,o),i||(r=o=null)):i||!1===n.trailing||(i=setTimeout(c,u)),a};return l.cancel=function(){clearTimeout(i),s=0,i=r=o=null},l},_.debounce=function(t,e,n){var i,r,o=function(e,n){i=null,n&&(r=t.apply(e,n))},a=x(function(a){if(i&&clearTimeout(i),n){var s=!i;i=setTimeout(o,e),s&&(r=t.apply(this,a))}else i=_.delay(o,e,this,a);return r});return a.cancel=function(){clearTimeout(i),i=null},a},_.wrap=function(t,e){return _.partial(e,t)},_.negate=function(t){return function(){return!t.apply(this,arguments)}},_.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,i=t[e].apply(this,arguments);n--;)i=t[n].call(this,i);return i}},_.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},_.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},_.once=_.partial(_.before,2),_.restArguments=x;var B=!{toString:null}.propertyIsEnumerable("toString"),N=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],D=function(t,e){var n=N.length,i=t.constructor,r=_.isFunction(i)&&i.prototype||s,o="constructor";for(E(t,o)&&!_.contains(e,o)&&e.push(o);n--;)(o=N[n])in t&&t[o]!==r[o]&&!_.contains(e,o)&&e.push(o)};_.keys=function(t){if(!_.isObject(t))return[];if(p)return p(t);var e=[];for(var n in t)E(t,n)&&e.push(n);return B&&D(t,e),e},_.allKeys=function(t){if(!_.isObject(t))return[];var e=[];for(var n in t)e.push(n);return B&&D(t,e),e},_.values=function(t){for(var e=_.keys(t),n=e.length,i=Array(n),r=0;r<n;r++)i[r]=t[e[r]];return i},_.mapObject=function(t,e,n){e=y(e,n);for(var i=_.keys(t),r=i.length,o={},a=0;a<r;a++){var s=i[a];o[s]=e(t[s],s,t)}return o},_.pairs=function(t){for(var e=_.keys(t),n=e.length,i=Array(n),r=0;r<n;r++)i[r]=[e[r],t[e[r]]];return i},_.invert=function(t){for(var e={},n=_.keys(t),i=0,r=n.length;i<r;i++)e[t[n[i]]]=n[i];return e},_.functions=_.methods=function(t){var e=[];for(var n in t)_.isFunction(t[n])&&e.push(n);return e.sort()};var j=function(t,e){return function(n){var i=arguments.length;if(e&&(n=Object(n)),i<2||null==n)return n;for(var r=1;r<i;r++)for(var o=arguments[r],a=t(o),s=a.length,c=0;c<s;c++){var l=a[c];e&&void 0!==n[l]||(n[l]=o[l])}return n}};_.extend=j(_.allKeys),_.extendOwn=_.assign=j(_.keys),_.findKey=function(t,e,n){e=y(e,n);for(var i,r=_.keys(t),o=0,a=r.length;o<a;o++)if(e(t[i=r[o]],i,t))return i};var U,F,H=function(t,e,n){return e in n};_.pick=x(function(t,e){var n={},i=e[0];if(null==t)return n;_.isFunction(i)?(e.length>1&&(i=b(i,e[1])),e=_.allKeys(t)):(i=H,e=C(e,!1,!1),t=Object(t));for(var r=0,o=e.length;r<o;r++){var a=e[r],s=t[a];i(s,a,t)&&(n[a]=s)}return n}),_.omit=x(function(t,e){var n,i=e[0];return _.isFunction(i)?(i=_.negate(i),e.length>1&&(n=e[1])):(e=_.map(C(e,!1,!1),String),i=function(t,n){return!_.contains(e,n)}),_.pick(t,i,n)}),_.defaults=j(_.allKeys,!0),_.create=function(t,e){var n=w(t);return e&&_.extendOwn(n,e),n},_.clone=function(t){return _.isObject(t)?_.isArray(t)?t.slice():_.extend({},t):t},_.tap=function(t,e){return e(t),t},_.isMatch=function(t,e){var n=_.keys(e),i=n.length;if(null==t)return!i;for(var r=Object(t),o=0;o<i;o++){var a=n[o];if(e[a]!==r[a]||!(a in r))return!1}return!0},U=function(t,e,n,i){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var r=typeof t;return("function"===r||"object"===r||"object"==typeof e)&&F(t,e,n,i)},F=function(t,e,n,i){t instanceof _&&(t=t._wrapped),e instanceof _&&(e=e._wrapped);var r=h.call(t);if(r!==h.call(e))return!1;switch(r){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return c.valueOf.call(t)===c.valueOf.call(e)}var o="[object Array]"===r;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,s=e.constructor;if(a!==s&&!(_.isFunction(a)&&a instanceof a&&_.isFunction(s)&&s instanceof s)&&"constructor"in t&&"constructor"in e)return!1}i=i||[];for(var l=(n=n||[]).length;l--;)if(n[l]===t)return i[l]===e;if(n.push(t),i.push(e),o){if((l=t.length)!==e.length)return!1;for(;l--;)if(!U(t[l],e[l],n,i))return!1}else{var u,d=_.keys(t);if(l=d.length,_.keys(e).length!==l)return!1;for(;l--;)if(u=d[l],!E(e,u)||!U(t[u],e[u],n,i))return!1}return n.pop(),i.pop(),!0},_.isEqual=function(t,e){return U(t,e)},_.isEmpty=function(t){return null==t||(k(t)&&(_.isArray(t)||_.isString(t)||_.isArguments(t))?0===t.length:0===_.keys(t).length)},_.isElement=function(t){return!(!t||1!==t.nodeType)},_.isArray=f||function(t){return"[object Array]"===h.call(t)},_.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},_.each(["Arguments","Function","String","Number","Date","RegExp","Error","Symbol","Map","WeakMap","Set","WeakSet"],function(t){_["is"+t]=function(e){return h.call(e)==="[object "+t+"]"}}),_.isArguments(arguments)||(_.isArguments=function(t){return E(t,"callee")});var q=r.document&&r.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof q&&(_.isFunction=function(t){return"function"==typeof t||!1}),_.isFinite=function(t){return!_.isSymbol(t)&&isFinite(t)&&!isNaN(parseFloat(t))},_.isNaN=function(t){return _.isNumber(t)&&isNaN(t)},_.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"===h.call(t)},_.isNull=function(t){return null===t},_.isUndefined=function(t){return void 0===t},_.has=function(t,e){if(!_.isArray(e))return E(t,e);for(var n=e.length,i=0;i<n;i++){var r=e[i];if(null==t||!d.call(t,r))return!1;t=t[r]}return!!n},_.noConflict=function(){return r._=o,this},_.identity=function(t){return t},_.constant=function(t){return function(){return t}},_.noop=function(){},_.property=function(t){return _.isArray(t)?function(e){return S(e,t)}:M(t)},_.propertyOf=function(t){return null==t?function(){}:function(e){return _.isArray(e)?S(t,e):t[e]}},_.matcher=_.matches=function(t){return t=_.extendOwn({},t),function(e){return _.isMatch(e,t)}},_.times=function(t,e,n){var i=Array(Math.max(0,t));e=b(e,n,1);for(var r=0;r<t;r++)i[r]=e(r);return i},_.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},_.now=Date.now||function(){return(new Date).getTime()};var G={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},W=_.invert(G),V=function(t){var e=function(e){return t[e]},n="(?:"+_.keys(t).join("|")+")",i=RegExp(n),r=RegExp(n,"g");return function(t){return t=null==t?"":""+t,i.test(t)?t.replace(r,e):t}};_.escape=V(G),_.unescape=V(W),_.result=function(t,e,n){_.isArray(e)||(e=[e]);var i=e.length;if(!i)return _.isFunction(n)?n.call(t):n;for(var r=0;r<i;r++){var o=null==t?void 0:t[e[r]];void 0===o&&(o=n,r=i),t=_.isFunction(o)?o.call(t):o}return t};var X=0;_.uniqueId=function(t){var e=++X+"";return t?t+e:e},_.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Y=/(.)^/,K={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Z=/\\|'|\r|\n|\u2028|\u2029/g,J=function(t){return"\\"+K[t]};_.template=function(t,e,n){!e&&n&&(e=n),e=_.defaults({},e,_.templateSettings);var i,r=RegExp([(e.escape||Y).source,(e.interpolate||Y).source,(e.evaluate||Y).source].join("|")+"|$","g"),o=0,a="__p+='";t.replace(r,function(e,n,i,r,s){return a+=t.slice(o,s).replace(Z,J),o=s+e.length,n?a+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":i?a+="'+\n((__t=("+i+"))==null?'':__t)+\n'":r&&(a+="';\n"+r+"\n__p+='"),e}),a+="';\n",e.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{i=new Function(e.variable||"obj","_",a)}catch(t){throw t.source=a,t}var s=function(t){return i.call(this,t,_)},c=e.variable||"obj";return s.source="function("+c+"){\n"+a+"}",s},_.chain=function(t){var e=_(t);return e._chain=!0,e};var Q=function(t,e){return t._chain?_(e).chain():e};_.mixin=function(t){return _.each(_.functions(t),function(e){var n=_[e]=t[e];_.prototype[e]=function(){var t=[this._wrapped];return l.apply(t,arguments),Q(this,n.apply(_,t))}}),_},_.mixin(_),_.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=a[t];_.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],Q(this,n)}}),_.each(["concat","join","slice"],function(t){var e=a[t];_.prototype[t]=function(){return Q(this,e.apply(this._wrapped,arguments))}}),_.prototype.value=function(){return this._wrapped},_.prototype.valueOf=_.prototype.toJSON=_.prototype.value,_.prototype.toString=function(){return String(this._wrapped)},void 0===(i=function(){return _}.apply(e,[]))||(n.exports=i)}()}).call(this,n(25),n(90)(t))},function(t,e,n){"use strict";var i=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function r(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function o(){}var a="\\s*([+-]?\\d+)\\s*",s="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",c="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",l=/^#([0-9a-f]{3})$/,u=/^#([0-9a-f]{6})$/,h=new RegExp("^rgb\\("+[a,a,a]+"\\)$"),d=new RegExp("^rgb\\("+[c,c,c]+"\\)$"),f=new RegExp("^rgba\\("+[a,a,a,s]+"\\)$"),p=new RegExp("^rgba\\("+[c,c,c,s]+"\\)$"),m=new RegExp("^hsl\\("+[s,c,c]+"\\)$"),g=new RegExp("^hsla\\("+[s,c,c,s]+"\\)$"),_={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function v(t){var e;return t=(t+"").trim().toLowerCase(),(e=l.exec(t))?new M((e=parseInt(e[1],16))>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=u.exec(t))?b(parseInt(e[1],16)):(e=h.exec(t))?new M(e[1],e[2],e[3],1):(e=d.exec(t))?new M(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=f.exec(t))?y(e[1],e[2],e[3],e[4]):(e=p.exec(t))?y(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=m.exec(t))?S(e[1],e[2]/100,e[3]/100,1):(e=g.exec(t))?S(e[1],e[2]/100,e[3]/100,e[4]):_.hasOwnProperty(t)?b(_[t]):"transparent"===t?new M(NaN,NaN,NaN,0):null}function b(t){return new M(t>>16&255,t>>8&255,255&t,1)}function y(t,e,n,i){return i<=0&&(t=e=n=NaN),new M(t,e,n,i)}function x(t){return t instanceof o||(t=v(t)),t?new M((t=t.rgb()).r,t.g,t.b,t.opacity):new M}function w(t,e,n,i){return 1===arguments.length?x(t):new M(t,e,n,null==i?1:i)}function M(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function E(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function S(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new T(t,e,n,i)}function A(t,e,n,i){return 1===arguments.length?function(t){if(t instanceof T)return new T(t.h,t.s,t.l,t.opacity);if(t instanceof o||(t=v(t)),!t)return new T;if(t instanceof T)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),a=Math.max(e,n,i),s=NaN,c=a-r,l=(a+r)/2;return c?(s=e===a?(n-i)/c+6*(n<i):n===a?(i-e)/c+2:(e-n)/c+4,c/=l<.5?a+r:2-a-r,s*=60):c=l>0&&l<1?0:s,new T(s,c,l,t.opacity)}(t):new T(t,e,n,null==i?1:i)}function T(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function k(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}i(o,v,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),i(M,w,r(o,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new M(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new M(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+E(this.r)+E(this.g)+E(this.b)},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),i(T,A,r(o,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new T(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new T(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new M(k(t>=240?t-240:t+120,r,i),k(t,r,i),k(t<120?t+240:t-120,r,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var P=Math.PI/180,L=180/Math.PI,O=.96422,C=1,R=.82521,I=4/29,z=6/29,B=3*z*z,N=z*z*z;function D(t){if(t instanceof F)return new F(t.l,t.a,t.b,t.opacity);if(t instanceof K){if(isNaN(t.h))return new F(t.l,0,0,t.opacity);var e=t.h*P;return new F(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof M||(t=x(t));var n,i,r=W(t.r),o=W(t.g),a=W(t.b),s=H((.2225045*r+.7168786*o+.0606169*a)/C);return r===o&&o===a?n=i=s:(n=H((.4360747*r+.3850649*o+.1430804*a)/O),i=H((.0139322*r+.0971045*o+.7141733*a)/R)),new F(116*s-16,500*(n-s),200*(s-i),t.opacity)}function j(t,e){return new F(t,0,0,null==e?1:e)}function U(t,e,n,i){return 1===arguments.length?D(t):new F(t,e,n,null==i?1:i)}function F(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function H(t){return t>N?Math.pow(t,1/3):t/B+I}function q(t){return t>z?t*t*t:B*(t-I)}function G(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function W(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function V(t){if(t instanceof K)return new K(t.h,t.c,t.l,t.opacity);if(t instanceof F||(t=D(t)),0===t.a&&0===t.b)return new K(NaN,0,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*L;return new K(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function X(t,e,n,i){return 1===arguments.length?V(t):new K(n,e,t,null==i?1:i)}function Y(t,e,n,i){return 1===arguments.length?V(t):new K(t,e,n,null==i?1:i)}function K(t,e,n,i){this.h=+t,this.c=+e,this.l=+n,this.opacity=+i}i(F,U,r(o,{brighter:function(t){return new F(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new F(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new M(G(3.1338561*(e=O*q(e))-1.6168667*(t=C*q(t))-.4906146*(n=R*q(n))),G(-.9787684*e+1.9161415*t+.033454*n),G(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),i(K,Y,r(o,{brighter:function(t){return new K(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new K(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return D(this).rgb()}}));var Z=-.14861,J=1.78277,Q=-.29227,$=-.90649,tt=1.97294,et=tt*$,nt=tt*J,it=J*Q-$*Z;function rt(t,e,n,i){return 1===arguments.length?function(t){if(t instanceof ot)return new ot(t.h,t.s,t.l,t.opacity);t instanceof M||(t=x(t));var e=t.r/255,n=t.g/255,i=t.b/255,r=(it*i+et*e-nt*n)/(it+et-nt),o=i-r,a=(tt*(n-r)-Q*o)/$,s=Math.sqrt(a*a+o*o)/(tt*r*(1-r)),c=s?Math.atan2(a,o)*L-120:NaN;return new ot(c<0?c+360:c,s,r,t.opacity)}(t):new ot(t,e,n,null==i?1:i)}function ot(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}i(ot,rt,r(o,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new ot(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new ot(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*P,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),i=Math.cos(t),r=Math.sin(t);return new M(255*(e+n*(Z*i+J*r)),255*(e+n*(Q*i+$*r)),255*(e+n*(tt*i)),this.opacity)}})),n.d(e,"a",function(){return v}),n.d(e,"h",function(){return w}),n.d(e,"e",function(){return A}),n.d(e,"f",function(){return U}),n.d(e,"d",function(){return Y}),n.d(e,"g",function(){return X}),n.d(e,"c",function(){return j}),n.d(e,"b",function(){return rt})},function(t,e,n){"use strict";var i=n(7);function r(t,e,n,i,r){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*i+a*r)/6}var o=function(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),o=t[i],a=t[i+1],s=i>0?t[i-1]:2*o-a,c=i<e-1?t[i+2]:2*a-o;return r((n-i/e)*e,s,o,a,c)}},a=function(t){var e=t.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*e),o=t[(i+e-1)%e],a=t[i%e],s=t[(i+1)%e],c=t[(i+2)%e];return r((n-i/e)*e,o,a,s,c)}},s=function(t){return function(){return t}};function c(t,e){return function(n){return t+n*e}}function l(t,e){var n=e-t;return n?c(t,n>180||n<-180?n-360*Math.round(n/360):n):s(isNaN(t)?e:t)}function u(t){return 1==(t=+t)?h:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):s(isNaN(e)?n:e)}}function h(t,e){var n=e-t;return n?c(t,n):s(isNaN(t)?e:t)}var d=function t(e){var n=u(e);function r(t,e){var r=n((t=Object(i.h)(t)).r,(e=Object(i.h)(e)).r),o=n(t.g,e.g),a=n(t.b,e.b),s=h(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=o(e),t.b=a(e),t.opacity=s(e),t+""}}return r.gamma=t,r}(1);function f(t){return function(e){var n,r,o=e.length,a=new Array(o),s=new Array(o),c=new Array(o);for(n=0;n<o;++n)r=Object(i.h)(e[n]),a[n]=r.r||0,s[n]=r.g||0,c[n]=r.b||0;return a=t(a),s=t(s),c=t(c),r.opacity=1,function(t){return r.r=a(t),r.g=s(t),r.b=c(t),r+""}}}var p=f(o),m=f(a),g=function(t,e){var n,i=e?e.length:0,r=t?Math.min(i,t.length):0,o=new Array(r),a=new Array(i);for(n=0;n<r;++n)o[n]=T(t[n],e[n]);for(;n<i;++n)a[n]=e[n];return function(t){for(n=0;n<r;++n)a[n]=o[n](t);return a}},_=function(t,e){var n=new Date;return e-=t=+t,function(i){return n.setTime(t+e*i),n}},v=function(t,e){return e-=t=+t,function(n){return t+e*n}},b=function(t,e){var n,i={},r={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?i[n]=T(t[n],e[n]):r[n]=e[n];return function(t){for(n in i)r[n]=i[n](t);return r}},y=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,x=new RegExp(y.source,"g");var w,M,E,S,A=function(t,e){var n,i,r,o=y.lastIndex=x.lastIndex=0,a=-1,s=[],c=[];for(t+="",e+="";(n=y.exec(t))&&(i=x.exec(e));)(r=i.index)>o&&(r=e.slice(o,r),s[a]?s[a]+=r:s[++a]=r),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,c.push({i:a,x:v(n,i)})),o=x.lastIndex;return o<e.length&&(r=e.slice(o),s[a]?s[a]+=r:s[++a]=r),s.length<2?c[0]?function(t){return function(e){return t(e)+""}}(c[0].x):function(t){return function(){return t}}(e):(e=c.length,function(t){for(var n,i=0;i<e;++i)s[(n=c[i]).i]=n.x(t);return s.join("")})},T=function(t,e){var n,r=typeof e;return null==e||"boolean"===r?s(e):("number"===r?v:"string"===r?(n=Object(i.a)(e))?(e=n,d):A:e instanceof i.a?d:e instanceof Date?_:Array.isArray(e)?g:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?b:v)(t,e)},k=function(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}},P=function(t,e){var n=l(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}},L=function(t,e){return e-=t=+t,function(n){return Math.round(t+e*n)}},O=180/Math.PI,C={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},R=function(t,e,n,i,r,o){var a,s,c;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(c=t*n+e*i)&&(n-=t*c,i-=e*c),(s=Math.sqrt(n*n+i*i))&&(n/=s,i/=s,c/=s),t*i<e*n&&(t=-t,e=-e,c=-c,a=-a),{translateX:r,translateY:o,rotate:Math.atan2(e,t)*O,skewX:Math.atan(c)*O,scaleX:a,scaleY:s}};function I(t,e,n,i){function r(t){return t.length?t.pop()+" ":""}return function(o,a){var s=[],c=[];return o=t(o),a=t(a),function(t,i,r,o,a,s){if(t!==r||i!==o){var c=a.push("translate(",null,e,null,n);s.push({i:c-4,x:v(t,r)},{i:c-2,x:v(i,o)})}else(r||o)&&a.push("translate("+r+e+o+n)}(o.translateX,o.translateY,a.translateX,a.translateY,s,c),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(r(n)+"rotate(",null,i)-2,x:v(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(o.rotate,a.rotate,s,c),function(t,e,n,o){t!==e?o.push({i:n.push(r(n)+"skewX(",null,i)-2,x:v(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(o.skewX,a.skewX,s,c),function(t,e,n,i,o,a){if(t!==n||e!==i){var s=o.push(r(o)+"scale(",null,",",null,")");a.push({i:s-4,x:v(t,n)},{i:s-2,x:v(e,i)})}else 1===n&&1===i||o.push(r(o)+"scale("+n+","+i+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,c),o=a=null,function(t){for(var e,n=-1,i=c.length;++n<i;)s[(e=c[n]).i]=e.x(t);return s.join("")}}}var z=I(function(t){return"none"===t?C:(w||(w=document.createElement("DIV"),M=document.documentElement,E=document.defaultView),w.style.transform=t,t=E.getComputedStyle(M.appendChild(w),null).getPropertyValue("transform"),M.removeChild(w),t=t.slice(7,-1).split(","),R(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))},"px, ","px)","deg)"),B=I(function(t){return null==t?C:(S||(S=document.createElementNS("http://www.w3.org/2000/svg","g")),S.setAttribute("transform",t),(t=S.transform.baseVal.consolidate())?(t=t.matrix,R(t.a,t.b,t.c,t.d,t.e,t.f)):C)},", ",")",")"),N=Math.SQRT2;function D(t){return((t=Math.exp(t))+1/t)/2}var j=function(t,e){var n,i,r=t[0],o=t[1],a=t[2],s=e[0],c=e[1],l=e[2],u=s-r,h=c-o,d=u*u+h*h;if(d<1e-12)i=Math.log(l/a)/N,n=function(t){return[r+t*u,o+t*h,a*Math.exp(N*t*i)]};else{var f=Math.sqrt(d),p=(l*l-a*a+4*d)/(2*a*2*f),m=(l*l-a*a-4*d)/(2*l*2*f),g=Math.log(Math.sqrt(p*p+1)-p),_=Math.log(Math.sqrt(m*m+1)-m);i=(_-g)/N,n=function(t){var e,n=t*i,s=D(g),c=a/(2*f)*(s*(e=N*n+g,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[r+c*u,o+c*h,a*s/D(N*n+g)]}}return n.duration=1e3*i,n};function U(t){return function(e,n){var r=t((e=Object(i.e)(e)).h,(n=Object(i.e)(n)).h),o=h(e.s,n.s),a=h(e.l,n.l),s=h(e.opacity,n.opacity);return function(t){return e.h=r(t),e.s=o(t),e.l=a(t),e.opacity=s(t),e+""}}}var F=U(l),H=U(h);function q(t,e){var n=h((t=Object(i.f)(t)).l,(e=Object(i.f)(e)).l),r=h(t.a,e.a),o=h(t.b,e.b),a=h(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=o(e),t.opacity=a(e),t+""}}function G(t){return function(e,n){var r=t((e=Object(i.d)(e)).h,(n=Object(i.d)(n)).h),o=h(e.c,n.c),a=h(e.l,n.l),s=h(e.opacity,n.opacity);return function(t){return e.h=r(t),e.c=o(t),e.l=a(t),e.opacity=s(t),e+""}}}var W=G(l),V=G(h);function X(t){return function e(n){function r(e,r){var o=t((e=Object(i.b)(e)).h,(r=Object(i.b)(r)).h),a=h(e.s,r.s),s=h(e.l,r.l),c=h(e.opacity,r.opacity);return function(t){return e.h=o(t),e.s=a(t),e.l=s(Math.pow(t,n)),e.opacity=c(t),e+""}}return n=+n,r.gamma=e,r}(1)}var Y=X(l),K=X(h);function Z(t,e){for(var n=0,i=e.length-1,r=e[0],o=new Array(i<0?0:i);n<i;)o[n]=t(r,r=e[++n]);return function(t){var e=Math.max(0,Math.min(i-1,Math.floor(t*=i)));return o[e](t-e)}}var J=function(t,e){for(var n=new Array(e),i=0;i<e;++i)n[i]=t(i/(e-1));return n};n.d(e,"a",function(){return T}),n.d(e,"b",function(){return g}),n.d(e,"c",function(){return o}),n.d(e,"d",function(){return a}),n.d(e,"g",function(){return _}),n.d(e,"h",function(){return k}),n.d(e,"m",function(){return P}),n.d(e,"o",function(){return v}),n.d(e,"p",function(){return b}),n.d(e,"t",function(){return L}),n.d(e,"u",function(){return A}),n.d(e,"v",function(){return z}),n.d(e,"w",function(){return B}),n.d(e,"x",function(){return j}),n.d(e,"q",function(){return d}),n.d(e,"r",function(){return p}),n.d(e,"s",function(){return m}),n.d(e,"k",function(){return F}),n.d(e,"l",function(){return H}),n.d(e,"n",function(){return q}),n.d(e,"i",function(){return W}),n.d(e,"j",function(){return V}),n.d(e,"e",function(){return Y}),n.d(e,"f",function(){return K}),n.d(e,"y",function(){return Z}),n.d(e,"z",function(){return J})},function(t,e,n){"use strict";function i(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),i(n(156)),i(n(157)),i(n(158)),i(n(159)),i(n(160)),i(n(29)),i(n(161)),i(n(162)),i(n(163)),i(n(164)),i(n(165)),i(n(166)),i(n(167)),i(n(168)),i(n(169)),i(n(170))},function(t,e){t.exports=__WEBPACK_EXTERNAL_MODULE__10__},function(t,e,n){(function(t){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function r(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function o(t,e,n){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var a;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a=n(218).Buffer}catch(t){}function s(t,e,n){for(var i=0,r=Math.min(t.length,n),o=e;o<r;o++){var a=t.charCodeAt(o)-48;i<<=4,i|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return i}function c(t,e,n,i){for(var r=0,o=Math.min(t.length,n),a=e;a<o;a++){var s=t.charCodeAt(a)-48;r*=i,r+=s>=49?s-49+10:s>=17?s-17+10:s}return r}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this._parseHex(t,r):this._parseBase(t,e,r),"-"===t[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},o.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},o.prototype._initArray=function(t,e,n){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var o,a,s=0;if("be"===n)for(r=t.length-1,o=0;r>=0;r-=3)a=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(r=0,o=0;r<t.length;r+=3)a=t[r]|t[r+1]<<8|t[r+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,r,o=0;for(n=t.length-6,i=0;n>=e;n-=6)r=s(t,n,n+6),this.words[i]|=r<<o&67108863,this.words[i+1]|=r>>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);n+6!==e&&(r=s(t,e,n+6),this.words[i]|=r<<o&67108863,this.words[i+1]|=r>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var i=0,r=1;r<=67108863;r*=e)i++;i--,r=r/e|0;for(var o=t.length-n,a=o%i,s=Math.min(o,o-a)+n,l=0,u=n;u<s;u+=i)l=c(t,u,u+i,e),this.imuln(r),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==a){var h=1;for(l=c(t,u,t.length,e),u=0;u<a;u++)h*=e;this.imuln(h),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,n){n.negative=e.negative^t.negative;var i=t.length+e.length|0;n.length=i,i=i-1|0;var r=0|t.words[0],o=0|e.words[0],a=r*o,s=67108863&a,c=a/67108864|0;n.words[0]=s;for(var l=1;l<i;l++){for(var u=c>>>26,h=67108863&c,d=Math.min(l,e.length-1),f=Math.max(0,l-t.length+1);f<=d;f++){var p=l-f|0;u+=(a=(r=0|t.words[p])*(o=0|e.words[f])+h)/67108864|0,h=67108863&a}n.words[l]=0|h,c=0|u}return 0!==c?n.words[l]=0|c:n.length--,n.strip()}o.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var r=0,o=0,a=0;a<this.length;a++){var s=this.words[a],c=(16777215&(s<<r|o)).toString(16);n=0!==(o=s>>>24-r&16777215)||a!==this.length-1?l[6-c.length]+c+n:c+n,(r+=2)>=26&&(r-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var d=u[t],f=h[t];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(t);n=(p=p.idivn(f)).isZero()?m+n:l[d-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,n){var r=this.byteLength(),o=n||Math.max(1,r);i(r<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===e,l=new t(o),u=this.clone();if(c){for(s=0;!u.isZero();s++)a=u.andln(255),u.iushrn(8),l[s]=a;for(;s<o;s++)l[s]=0}else{for(s=0;s<o-r;s++)l[s]=0;for(s=0;!u.isZero();s++)a=u.andln(255),u.iushrn(8),l[o-s-1]=a}return l},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var n=this._zeroBits(this.words[e]);if(t+=n,26!==n)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;n<e.length;n++)this.words[n]=this.words[n]&t.words[n];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var i=0;i<n.length;i++)this.words[i]=e.words[i]^n.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var r=0;r<e;r++)this.words[r]=67108863&~this.words[r];return n>0&&(this.words[r]=~this.words[r]&67108863>>26-n),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var n=t/26|0,r=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<<r:this.words[n]&~(1<<r),this.strip()},o.prototype.iadd=function(t){var e,n,i;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(n=this,i=t):(n=t,i=this);for(var r=0,o=0;o<i.length;o++)e=(0|n.words[o])+(0|i.words[o])+r,this.words[o]=67108863&e,r=e>>>26;for(;0!==r&&o<n.length;o++)e=(0|n.words[o])+r,this.words[o]=67108863&e,r=e>>>26;if(this.length=n.length,0!==r)this.words[this.length]=r,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,i,r=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(n=this,i=t):(n=t,i=this);for(var o=0,a=0;a<i.length;a++)o=(e=(0|n.words[a])-(0|i.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<n.length;a++)o=(e=(0|n.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var f=function(t,e,n){var i,r,o,a=t.words,s=e.words,c=n.words,l=0,u=0|a[0],h=8191&u,d=u>>>13,f=0|a[1],p=8191&f,m=f>>>13,g=0|a[2],_=8191&g,v=g>>>13,b=0|a[3],y=8191&b,x=b>>>13,w=0|a[4],M=8191&w,E=w>>>13,S=0|a[5],A=8191&S,T=S>>>13,k=0|a[6],P=8191&k,L=k>>>13,O=0|a[7],C=8191&O,R=O>>>13,I=0|a[8],z=8191&I,B=I>>>13,N=0|a[9],D=8191&N,j=N>>>13,U=0|s[0],F=8191&U,H=U>>>13,q=0|s[1],G=8191&q,W=q>>>13,V=0|s[2],X=8191&V,Y=V>>>13,K=0|s[3],Z=8191&K,J=K>>>13,Q=0|s[4],$=8191&Q,tt=Q>>>13,et=0|s[5],nt=8191&et,it=et>>>13,rt=0|s[6],ot=8191&rt,at=rt>>>13,st=0|s[7],ct=8191&st,lt=st>>>13,ut=0|s[8],ht=8191&ut,dt=ut>>>13,ft=0|s[9],pt=8191&ft,mt=ft>>>13;n.negative=t.negative^e.negative,n.length=19;var gt=(l+(i=Math.imul(h,F))|0)+((8191&(r=(r=Math.imul(h,H))+Math.imul(d,F)|0))<<13)|0;l=((o=Math.imul(d,H))+(r>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(p,F),r=(r=Math.imul(p,H))+Math.imul(m,F)|0,o=Math.imul(m,H);var _t=(l+(i=i+Math.imul(h,G)|0)|0)+((8191&(r=(r=r+Math.imul(h,W)|0)+Math.imul(d,G)|0))<<13)|0;l=((o=o+Math.imul(d,W)|0)+(r>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(_,F),r=(r=Math.imul(_,H))+Math.imul(v,F)|0,o=Math.imul(v,H),i=i+Math.imul(p,G)|0,r=(r=r+Math.imul(p,W)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,W)|0;var vt=(l+(i=i+Math.imul(h,X)|0)|0)+((8191&(r=(r=r+Math.imul(h,Y)|0)+Math.imul(d,X)|0))<<13)|0;l=((o=o+Math.imul(d,Y)|0)+(r>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(y,F),r=(r=Math.imul(y,H))+Math.imul(x,F)|0,o=Math.imul(x,H),i=i+Math.imul(_,G)|0,r=(r=r+Math.imul(_,W)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,W)|0,i=i+Math.imul(p,X)|0,r=(r=r+Math.imul(p,Y)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,Y)|0;var bt=(l+(i=i+Math.imul(h,Z)|0)|0)+((8191&(r=(r=r+Math.imul(h,J)|0)+Math.imul(d,Z)|0))<<13)|0;l=((o=o+Math.imul(d,J)|0)+(r>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(M,F),r=(r=Math.imul(M,H))+Math.imul(E,F)|0,o=Math.imul(E,H),i=i+Math.imul(y,G)|0,r=(r=r+Math.imul(y,W)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(_,X)|0,r=(r=r+Math.imul(_,Y)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,Y)|0,i=i+Math.imul(p,Z)|0,r=(r=r+Math.imul(p,J)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,J)|0;var yt=(l+(i=i+Math.imul(h,$)|0)|0)+((8191&(r=(r=r+Math.imul(h,tt)|0)+Math.imul(d,$)|0))<<13)|0;l=((o=o+Math.imul(d,tt)|0)+(r>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(A,F),r=(r=Math.imul(A,H))+Math.imul(T,F)|0,o=Math.imul(T,H),i=i+Math.imul(M,G)|0,r=(r=r+Math.imul(M,W)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(y,X)|0,r=(r=r+Math.imul(y,Y)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Y)|0,i=i+Math.imul(_,Z)|0,r=(r=r+Math.imul(_,J)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,J)|0,i=i+Math.imul(p,$)|0,r=(r=r+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0;var xt=(l+(i=i+Math.imul(h,nt)|0)|0)+((8191&(r=(r=r+Math.imul(h,it)|0)+Math.imul(d,nt)|0))<<13)|0;l=((o=o+Math.imul(d,it)|0)+(r>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(P,F),r=(r=Math.imul(P,H))+Math.imul(L,F)|0,o=Math.imul(L,H),i=i+Math.imul(A,G)|0,r=(r=r+Math.imul(A,W)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,W)|0,i=i+Math.imul(M,X)|0,r=(r=r+Math.imul(M,Y)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,Y)|0,i=i+Math.imul(y,Z)|0,r=(r=r+Math.imul(y,J)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(_,$)|0,r=(r=r+Math.imul(_,tt)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,tt)|0,i=i+Math.imul(p,nt)|0,r=(r=r+Math.imul(p,it)|0)+Math.imul(m,nt)|0,o=o+Math.imul(m,it)|0;var wt=(l+(i=i+Math.imul(h,ot)|0)|0)+((8191&(r=(r=r+Math.imul(h,at)|0)+Math.imul(d,ot)|0))<<13)|0;l=((o=o+Math.imul(d,at)|0)+(r>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(C,F),r=(r=Math.imul(C,H))+Math.imul(R,F)|0,o=Math.imul(R,H),i=i+Math.imul(P,G)|0,r=(r=r+Math.imul(P,W)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,W)|0,i=i+Math.imul(A,X)|0,r=(r=r+Math.imul(A,Y)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,Y)|0,i=i+Math.imul(M,Z)|0,r=(r=r+Math.imul(M,J)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(y,$)|0,r=(r=r+Math.imul(y,tt)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(_,nt)|0,r=(r=r+Math.imul(_,it)|0)+Math.imul(v,nt)|0,o=o+Math.imul(v,it)|0,i=i+Math.imul(p,ot)|0,r=(r=r+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var Mt=(l+(i=i+Math.imul(h,ct)|0)|0)+((8191&(r=(r=r+Math.imul(h,lt)|0)+Math.imul(d,ct)|0))<<13)|0;l=((o=o+Math.imul(d,lt)|0)+(r>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(z,F),r=(r=Math.imul(z,H))+Math.imul(B,F)|0,o=Math.imul(B,H),i=i+Math.imul(C,G)|0,r=(r=r+Math.imul(C,W)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(P,X)|0,r=(r=r+Math.imul(P,Y)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,Y)|0,i=i+Math.imul(A,Z)|0,r=(r=r+Math.imul(A,J)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,J)|0,i=i+Math.imul(M,$)|0,r=(r=r+Math.imul(M,tt)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(y,nt)|0,r=(r=r+Math.imul(y,it)|0)+Math.imul(x,nt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(_,ot)|0,r=(r=r+Math.imul(_,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,i=i+Math.imul(p,ct)|0,r=(r=r+Math.imul(p,lt)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,lt)|0;var Et=(l+(i=i+Math.imul(h,ht)|0)|0)+((8191&(r=(r=r+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;l=((o=o+Math.imul(d,dt)|0)+(r>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(D,F),r=(r=Math.imul(D,H))+Math.imul(j,F)|0,o=Math.imul(j,H),i=i+Math.imul(z,G)|0,r=(r=r+Math.imul(z,W)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,W)|0,i=i+Math.imul(C,X)|0,r=(r=r+Math.imul(C,Y)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Y)|0,i=i+Math.imul(P,Z)|0,r=(r=r+Math.imul(P,J)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,J)|0,i=i+Math.imul(A,$)|0,r=(r=r+Math.imul(A,tt)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,tt)|0,i=i+Math.imul(M,nt)|0,r=(r=r+Math.imul(M,it)|0)+Math.imul(E,nt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(y,ot)|0,r=(r=r+Math.imul(y,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,i=i+Math.imul(_,ct)|0,r=(r=r+Math.imul(_,lt)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,lt)|0,i=i+Math.imul(p,ht)|0,r=(r=r+Math.imul(p,dt)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,dt)|0;var St=(l+(i=i+Math.imul(h,pt)|0)|0)+((8191&(r=(r=r+Math.imul(h,mt)|0)+Math.imul(d,pt)|0))<<13)|0;l=((o=o+Math.imul(d,mt)|0)+(r>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(D,G),r=(r=Math.imul(D,W))+Math.imul(j,G)|0,o=Math.imul(j,W),i=i+Math.imul(z,X)|0,r=(r=r+Math.imul(z,Y)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,Y)|0,i=i+Math.imul(C,Z)|0,r=(r=r+Math.imul(C,J)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,J)|0,i=i+Math.imul(P,$)|0,r=(r=r+Math.imul(P,tt)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(A,nt)|0,r=(r=r+Math.imul(A,it)|0)+Math.imul(T,nt)|0,o=o+Math.imul(T,it)|0,i=i+Math.imul(M,ot)|0,r=(r=r+Math.imul(M,at)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,at)|0,i=i+Math.imul(y,ct)|0,r=(r=r+Math.imul(y,lt)|0)+Math.imul(x,ct)|0,o=o+Math.imul(x,lt)|0,i=i+Math.imul(_,ht)|0,r=(r=r+Math.imul(_,dt)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,dt)|0;var At=(l+(i=i+Math.imul(p,pt)|0)|0)+((8191&(r=(r=r+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;l=((o=o+Math.imul(m,mt)|0)+(r>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(D,X),r=(r=Math.imul(D,Y))+Math.imul(j,X)|0,o=Math.imul(j,Y),i=i+Math.imul(z,Z)|0,r=(r=r+Math.imul(z,J)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,J)|0,i=i+Math.imul(C,$)|0,r=(r=r+Math.imul(C,tt)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(P,nt)|0,r=(r=r+Math.imul(P,it)|0)+Math.imul(L,nt)|0,o=o+Math.imul(L,it)|0,i=i+Math.imul(A,ot)|0,r=(r=r+Math.imul(A,at)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,at)|0,i=i+Math.imul(M,ct)|0,r=(r=r+Math.imul(M,lt)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,lt)|0,i=i+Math.imul(y,ht)|0,r=(r=r+Math.imul(y,dt)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,dt)|0;var Tt=(l+(i=i+Math.imul(_,pt)|0)|0)+((8191&(r=(r=r+Math.imul(_,mt)|0)+Math.imul(v,pt)|0))<<13)|0;l=((o=o+Math.imul(v,mt)|0)+(r>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(D,Z),r=(r=Math.imul(D,J))+Math.imul(j,Z)|0,o=Math.imul(j,J),i=i+Math.imul(z,$)|0,r=(r=r+Math.imul(z,tt)|0)+Math.imul(B,$)|0,o=o+Math.imul(B,tt)|0,i=i+Math.imul(C,nt)|0,r=(r=r+Math.imul(C,it)|0)+Math.imul(R,nt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(P,ot)|0,r=(r=r+Math.imul(P,at)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,at)|0,i=i+Math.imul(A,ct)|0,r=(r=r+Math.imul(A,lt)|0)+Math.imul(T,ct)|0,o=o+Math.imul(T,lt)|0,i=i+Math.imul(M,ht)|0,r=(r=r+Math.imul(M,dt)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,dt)|0;var kt=(l+(i=i+Math.imul(y,pt)|0)|0)+((8191&(r=(r=r+Math.imul(y,mt)|0)+Math.imul(x,pt)|0))<<13)|0;l=((o=o+Math.imul(x,mt)|0)+(r>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(D,$),r=(r=Math.imul(D,tt))+Math.imul(j,$)|0,o=Math.imul(j,tt),i=i+Math.imul(z,nt)|0,r=(r=r+Math.imul(z,it)|0)+Math.imul(B,nt)|0,o=o+Math.imul(B,it)|0,i=i+Math.imul(C,ot)|0,r=(r=r+Math.imul(C,at)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,at)|0,i=i+Math.imul(P,ct)|0,r=(r=r+Math.imul(P,lt)|0)+Math.imul(L,ct)|0,o=o+Math.imul(L,lt)|0,i=i+Math.imul(A,ht)|0,r=(r=r+Math.imul(A,dt)|0)+Math.imul(T,ht)|0,o=o+Math.imul(T,dt)|0;var Pt=(l+(i=i+Math.imul(M,pt)|0)|0)+((8191&(r=(r=r+Math.imul(M,mt)|0)+Math.imul(E,pt)|0))<<13)|0;l=((o=o+Math.imul(E,mt)|0)+(r>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(D,nt),r=(r=Math.imul(D,it))+Math.imul(j,nt)|0,o=Math.imul(j,it),i=i+Math.imul(z,ot)|0,r=(r=r+Math.imul(z,at)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,at)|0,i=i+Math.imul(C,ct)|0,r=(r=r+Math.imul(C,lt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,lt)|0,i=i+Math.imul(P,ht)|0,r=(r=r+Math.imul(P,dt)|0)+Math.imul(L,ht)|0,o=o+Math.imul(L,dt)|0;var Lt=(l+(i=i+Math.imul(A,pt)|0)|0)+((8191&(r=(r=r+Math.imul(A,mt)|0)+Math.imul(T,pt)|0))<<13)|0;l=((o=o+Math.imul(T,mt)|0)+(r>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,i=Math.imul(D,ot),r=(r=Math.imul(D,at))+Math.imul(j,ot)|0,o=Math.imul(j,at),i=i+Math.imul(z,ct)|0,r=(r=r+Math.imul(z,lt)|0)+Math.imul(B,ct)|0,o=o+Math.imul(B,lt)|0,i=i+Math.imul(C,ht)|0,r=(r=r+Math.imul(C,dt)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,dt)|0;var Ot=(l+(i=i+Math.imul(P,pt)|0)|0)+((8191&(r=(r=r+Math.imul(P,mt)|0)+Math.imul(L,pt)|0))<<13)|0;l=((o=o+Math.imul(L,mt)|0)+(r>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(D,ct),r=(r=Math.imul(D,lt))+Math.imul(j,ct)|0,o=Math.imul(j,lt),i=i+Math.imul(z,ht)|0,r=(r=r+Math.imul(z,dt)|0)+Math.imul(B,ht)|0,o=o+Math.imul(B,dt)|0;var Ct=(l+(i=i+Math.imul(C,pt)|0)|0)+((8191&(r=(r=r+Math.imul(C,mt)|0)+Math.imul(R,pt)|0))<<13)|0;l=((o=o+Math.imul(R,mt)|0)+(r>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,i=Math.imul(D,ht),r=(r=Math.imul(D,dt))+Math.imul(j,ht)|0,o=Math.imul(j,dt);var Rt=(l+(i=i+Math.imul(z,pt)|0)|0)+((8191&(r=(r=r+Math.imul(z,mt)|0)+Math.imul(B,pt)|0))<<13)|0;l=((o=o+Math.imul(B,mt)|0)+(r>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var It=(l+(i=Math.imul(D,pt))|0)+((8191&(r=(r=Math.imul(D,mt))+Math.imul(j,pt)|0))<<13)|0;return l=((o=Math.imul(j,mt))+(r>>>13)|0)+(It>>>26)|0,It&=67108863,c[0]=gt,c[1]=_t,c[2]=vt,c[3]=bt,c[4]=yt,c[5]=xt,c[6]=wt,c[7]=Mt,c[8]=Et,c[9]=St,c[10]=At,c[11]=Tt,c[12]=kt,c[13]=Pt,c[14]=Lt,c[15]=Ot,c[16]=Ct,c[17]=Rt,c[18]=It,0!==l&&(c[19]=l,n.length++),n};function p(t,e,n){return(new m).mulp(t,e,n)}function m(t,e){this.x=t,this.y=e}Math.imul||(f=d),o.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?f(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var i=0,r=0,o=0;o<n.length-1;o++){var a=r;r=0;for(var s=67108863&i,c=Math.min(o,e.length-1),l=Math.max(0,o-t.length+1);l<=c;l++){var u=o-l,h=(0|t.words[u])*(0|e.words[l]),d=67108863&h;s=67108863&(d=d+s|0),r+=(a=(a=a+(h/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}n.words[o]=s,i=a,a=r}return 0!==i?n.words[o]=i:n.length--,n.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),n=o.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,n,t);return e},m.prototype.revBin=function(t,e,n){if(0===t||t===n-1)return t;for(var i=0,r=0;r<e;r++)i|=(1&t)<<e-r-1,t>>=1;return i},m.prototype.permute=function(t,e,n,i,r,o){for(var a=0;a<o;a++)i[a]=e[t[a]],r[a]=n[t[a]]},m.prototype.transform=function(t,e,n,i,r,o){this.permute(o,t,e,n,i,r);for(var a=1;a<r;a<<=1)for(var s=a<<1,c=Math.cos(2*Math.PI/s),l=Math.sin(2*Math.PI/s),u=0;u<r;u+=s)for(var h=c,d=l,f=0;f<a;f++){var p=n[u+f],m=i[u+f],g=n[u+f+a],_=i[u+f+a],v=h*g-d*_;_=h*_+d*g,g=v,n[u+f]=p+g,i[u+f]=m+_,n[u+f+a]=p-g,i[u+f+a]=m-_,f!==s&&(v=c*h-l*d,d=c*d+l*h,h=v)}},m.prototype.guessLen13b=function(t,e){var n=1|Math.max(e,t),i=1&n,r=0;for(n=n/2|0;n;n>>>=1)r++;return 1<<r+1+i},m.prototype.conjugate=function(t,e,n){if(!(n<=1))for(var i=0;i<n/2;i++){var r=t[i];t[i]=t[n-i-1],t[n-i-1]=r,r=e[i],e[i]=-e[n-i-1],e[n-i-1]=-r}},m.prototype.normalize13b=function(t,e){for(var n=0,i=0;i<e/2;i++){var r=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+n;t[i]=67108863&r,n=r<67108864?0:r/67108864|0}return t},m.prototype.convert13b=function(t,e,n,r){for(var o=0,a=0;a<e;a++)o+=0|t[a],n[2*a]=8191&o,o>>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*e;a<r;++a)n[a]=0;i(0===o),i(0==(-8192&o))},m.prototype.stub=function(t){for(var e=new Array(t),n=0;n<t;n++)e[n]=0;return e},m.prototype.mulp=function(t,e,n){var i=2*this.guessLen13b(t.length,e.length),r=this.makeRBT(i),o=this.stub(i),a=new Array(i),s=new Array(i),c=new Array(i),l=new Array(i),u=new Array(i),h=new Array(i),d=n.words;d.length=i,this.convert13b(t.words,t.length,a,i),this.convert13b(e.words,e.length,l,i),this.transform(a,o,s,c,i,r),this.transform(l,o,u,h,i,r);for(var f=0;f<i;f++){var p=s[f]*u[f]-c[f]*h[f];c[f]=s[f]*h[f]+c[f]*u[f],s[f]=p}return this.conjugate(s,c,i),this.transform(s,c,d,o,i,r),this.conjugate(d,o,i),this.normalize13b(d,i),n.negative=t.negative^e.negative,n.length=t.length+e.length,n.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),p(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,n=0;n<this.length;n++){var r=(0|this.words[n])*t,o=(67108863&r)+(67108863&e);e>>=26,e+=r/67108864|0,e+=o>>>26,this.words[n]=67108863&o}return 0!==e&&(this.words[n]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n<e.length;n++){var i=n/26|0,r=n%26;e[n]=(t.words[i]&1<<r)>>>r}return e}(t);if(0===e.length)return new o(1);for(var n=this,i=0;i<e.length&&0===e[i];i++,n=n.sqr());if(++i<e.length)for(var r=n.sqr();i<e.length;i++,r=r.sqr())0!==e[i]&&(n=n.mul(r));return n},o.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,n=t%26,r=(t-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(e=0;e<this.length;e++){var s=this.words[e]&o,c=(0|this.words[e])-s<<n;this.words[e]=c|a,a=s>>>26-n}a&&(this.words[e]=a,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e<r;e++)this.words[e]=0;this.length+=r}return this.strip()},o.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,n){var r;i("number"==typeof t&&t>=0),r=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<<o,c=n;if(r-=a,r=Math.max(0,r),c){for(var l=0;l<a;l++)c.words[l]=this.words[l];c.length=a}if(0===a);else if(this.length>a)for(this.length-=a,l=0;l<this.length;l++)this.words[l]=this.words[l+a];else this.words[0]=0,this.length=1;var u=0;for(l=this.length-1;l>=0&&(0!==u||l>=r);l--){var h=0|this.words[l];this.words[l]=u<<26-o|h>>>o,u=h&s}return c&&0!==u&&(c.words[c.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,n){return i(0===this.negative),this.iushrn(t,e,n)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,r=1<<e;return!(this.length<=n)&&!!(this.words[n]&r)},o.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var r=67108863^67108863>>>e<<e;this.words[this.length-1]&=r}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return i("number"==typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,n){var r,o,a=t.length+n;this._expand(a);var s=0;for(r=0;r<t.length;r++){o=(0|this.words[r+n])+s;var c=(0|t.words[r])*e;s=((o-=67108863&c)>>26)-(c/67108864|0),this.words[r+n]=67108863&o}for(;r<this.length-n;r++)s=(o=(0|this.words[r+n])+s)>>26,this.words[r+n]=67108863&o;if(0===s)return this.strip();for(i(-1===s),s=0,r=0;r<this.length;r++)s=(o=-(0|this.words[r])+s)>>26,this.words[r]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var n=(this.length,t.length),i=this.clone(),r=t,a=0|r.words[r.length-1];0!==(n=26-this._countBits(a))&&(r=r.ushln(n),i.iushln(n),a=0|r.words[r.length-1]);var s,c=i.length-r.length;if("mod"!==e){(s=new o(null)).length=c+1,s.words=new Array(s.length);for(var l=0;l<s.length;l++)s.words[l]=0}var u=i.clone()._ishlnsubmul(r,1,c);0===u.negative&&(i=u,s&&(s.words[c]=1));for(var h=c-1;h>=0;h--){var d=67108864*(0|i.words[r.length+h])+(0|i.words[r.length+h-1]);for(d=Math.min(d/a|0,67108863),i._ishlnsubmul(r,d,h);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(r,1,h),i.isZero()||(i.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),i.strip(),"div"!==e&&0!==n&&i.iushrn(n),{div:s||null,mod:i}},o.prototype.divmod=function(t,e,n){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(r=s.div.neg()),"div"!==e&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(t)),{div:r,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(r=s.div.neg()),{div:r,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var r,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),r=t.andln(1),o=n.cmp(i);return o<0||1===r&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,n=0,r=this.length-1;r>=0;r--)n=(e*n+(0|this.words[r]))%t;return n},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var r=(0|this.words[n])+67108864*e;this.words[n]=r/t|0,e=r%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var r=new o(1),a=new o(0),s=new o(0),c=new o(1),l=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++l;for(var u=n.clone(),h=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(r.isOdd()||a.isOdd())&&(r.iadd(u),a.isub(h)),r.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(u),c.isub(h)),s.iushrn(1),c.iushrn(1);e.cmp(n)>=0?(e.isub(n),r.isub(s),a.isub(c)):(n.isub(e),s.isub(r),c.isub(a))}return{a:s,b:c,gcd:n.iushln(l)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var r,a=new o(1),s=new o(0),c=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var l=0,u=1;0==(e.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(e.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var h=0,d=1;0==(n.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(n.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);e.cmp(n)>=0?(e.isub(n),a.isub(s)):(n.isub(e),s.isub(a))}return(r=0===e.cmpn(1)?a:s).cmpn(0)<0&&r.iadd(t),r},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var i=0;e.isEven()&&n.isEven();i++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var r=e.cmp(n);if(r<0){var o=e;e=n,n=o}else if(0===r||0===n.cmpn(1))break;e.isub(n)}return n.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,n=(t-e)/26,r=1<<e;if(this.length<=n)return this._expand(n+1),this.words[n]|=r,this;for(var o=r,a=n;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)e=1;else{n&&(t=-t),i(t<=67108863,"Number is too big");var r=0|this.words[0];e=r===t?0:r<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,n=this.length-1;n>=0;n--){var i=0|this.words[n],r=0|t.words[n];if(i!==r){i<r?e=-1:i>r&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new w(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function _(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}_.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},_.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:n.ucmp(this.p);return 0===i?(n.words[0]=0,n.length=1):i>0?n.isub(this.p):n.strip(),n},_.prototype.split=function(t,e){t.iushrn(this.n,0,e)},_.prototype.imulK=function(t){return t.imul(this.k)},r(v,_),v.prototype.split=function(t,e){for(var n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var r=t.words[9];for(e.words[e.length++]=4194303&r,i=10;i<t.length;i++){var o=0|t.words[i];t.words[i-10]=(4194303&o)<<4|r>>>22,r=o}r>>>=22,t.words[i-10]=r,0===r&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n<t.length;n++){var i=0|t.words[n];e+=977*i,t.words[n]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},r(b,_),r(y,_),r(x,_),x.prototype.imulK=function(t){for(var e=0,n=0;n<t.length;n++){var i=19*(0|t.words[n])+e,r=67108863&i;i>>>=26,t.words[n]=r,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new b;else if("p192"===t)e=new y;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new x}return g[t]=e,e},w.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},w.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},w.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var n=this.m.add(new o(1)).iushrn(2);return this.pow(t,n)}for(var r=this.m.subn(1),a=0;!r.isZero()&&0===r.andln(1);)a++,r.iushrn(1);i(!r.isZero());var s=new o(1).toRed(this),c=s.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new o(2*u*u).toRed(this);0!==this.pow(u,l).cmp(c);)u.redIAdd(c);for(var h=this.pow(u,r),d=this.pow(t,r.addn(1).iushrn(1)),f=this.pow(t,r),p=a;0!==f.cmp(s);){for(var m=f,g=0;0!==m.cmp(s);g++)m=m.redSqr();i(g<p);var _=this.pow(h,new o(1).iushln(p-g-1));d=d.redMul(_),h=_.redSqr(),f=f.redMul(h),p=g}return d},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var n=new Array(16);n[0]=new o(1).toRed(this),n[1]=t;for(var i=2;i<n.length;i++)n[i]=this.mul(n[i-1],t);var r=n[0],a=0,s=0,c=e.bitLength()%26;for(0===c&&(c=26),i=e.length-1;i>=0;i--){for(var l=e.words[i],u=c-1;u>=0;u--){var h=l>>u&1;r!==n[0]&&(r=this.sqr(r)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===i&&0===u)&&(r=this.mul(r,n[a]),s=0,a=0)):s=0}c=26}return r},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new M(t)},r(M,w),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),i=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=n.isub(i).iushrn(this.shift),o=r;return r.cmp(this.m)>=0?o=r.isub(this.m):r.cmpn(0)<0&&(o=r.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var n=t.mul(e),i=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=n.isub(i).iushrn(this.shift),a=r;return r.cmp(this.m)>=0?a=r.isub(this.m):r.cmpn(0)<0&&(a=r.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,n(90)(t))},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(6)),a=r(n(89)),s={int8:Int8Array,int16:Int16Array,int32:Int32Array,uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array,float32:Float32Array,float64:Float64Array},c={Int8Array:"int8",Int16Array:"int16",Int32Array:"int32",Uint8Array:"uint8",Uint16Array:"uint16",Uint32Array:"uint32",Float32Array:"float32",Float64Array:"float64"};e.array_or_json={deserialize:function t(e,n){if(null==e)return null;let i=null;return o.isNumber(e)?e:(o.isArray(e)?0==e.length||(i=o.isArray(e[0])?o.map(e,function(e){return t(e,n)}):e):e.value&&e.dtype?i=function(t,e){const n=s[t.dtype];null==t&&console.log("data is null"),t.value||console.log("data.buffer is null"),t.value.buffer||console.log("data.buffer is null");const i=new n(t.value.buffer);if(i.type=t.type,t.shape&&t.shape.length>=2){if(t.shape.length>2)throw new Error("only arrays with rank 1 or 2 supported");const e=[];for(let n=0;n<t.shape[0];n++)e.push(i.slice(n*t.shape[1],(n+1)*t.shape[1]));return e}return i}(e):console.error("not sure what the data is"),i)},serialize:function t(e,n){return null==e?null:o.isNumber(e)?e:o.isArray(e)?e.map(e=>t(e,n)):a.default(e)?function(t,e){null==t&&console.log("data is null"),t.buffer||console.log("ar.buffer is null or not defined");const n=c[t.constructor.name],i=t.type||null;return{dtype:n,value:new DataView(t.buffer),shape:[t.length],type:i}}(e):void 0}}},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o,a=n(9),s=n(14),c=n(37),l=n(21),u=n(67),h=function(){function t(t){void 0===t&&(t={}),this._flags=0,this._layout=null,this._parent=null,this._disposed=new l.Signal(this),this.node=o.createNode(t),this.addClass("p-Widget")}return t.prototype.dispose=function(){this.isDisposed||(this.setFlag(t.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&t.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),l.Signal.clearData(this),s.MessageLoop.clearData(this),c.AttachedProperty.clearData(this))},Object.defineProperty(t.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this.testFlag(t.Flag.IsDisposed)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAttached",{get:function(){return this.testFlag(t.Flag.IsAttached)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isHidden",{get:function(){return this.testFlag(t.Flag.IsHidden)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this.testFlag(t.Flag.IsVisible)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return o.titleProperty.get(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this.node.id},set:function(t){this.node.id=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return this.node.dataset},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},set:function(e){if(this._parent!==e){if(e&&this.contains(e))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){var n=new t.ChildMessage("child-removed",this);s.MessageLoop.sendMessage(this._parent,n)}if(this._parent=e,this._parent&&!this._parent.isDisposed){n=new t.ChildMessage("child-added",this);s.MessageLoop.sendMessage(this._parent,n)}this.isDisposed||s.MessageLoop.sendMessage(this,t.Msg.ParentChanged)}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layout",{get:function(){return this._layout},set:function(e){if(this._layout!==e){if(this.testFlag(t.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(e.parent)throw new Error("Cannot change layout parent.");this._layout=e,e.parent=this}},enumerable:!0,configurable:!0}),t.prototype.children=function(){return this._layout?this._layout.iter():a.empty()},t.prototype.contains=function(t){for(var e=t;e;e=e._parent)if(e===this)return!0;return!1},t.prototype.hasClass=function(t){return this.node.classList.contains(t)},t.prototype.addClass=function(t){this.node.classList.add(t)},t.prototype.removeClass=function(t){this.node.classList.remove(t)},t.prototype.toggleClass=function(t,e){return!0===e?(this.node.classList.add(t),!0):!1===e?(this.node.classList.remove(t),!1):this.node.classList.toggle(t)},t.prototype.update=function(){s.MessageLoop.postMessage(this,t.Msg.UpdateRequest)},t.prototype.fit=function(){s.MessageLoop.postMessage(this,t.Msg.FitRequest)},t.prototype.activate=function(){s.MessageLoop.postMessage(this,t.Msg.ActivateRequest)},t.prototype.close=function(){s.MessageLoop.sendMessage(this,t.Msg.CloseRequest)},t.prototype.show=function(){if(this.testFlag(t.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||s.MessageLoop.sendMessage(this,t.Msg.BeforeShow),this.clearFlag(t.Flag.IsHidden),this.removeClass("p-mod-hidden"),!this.isAttached||this.parent&&!this.parent.isVisible||s.MessageLoop.sendMessage(this,t.Msg.AfterShow),this.parent)){var e=new t.ChildMessage("child-shown",this);s.MessageLoop.sendMessage(this.parent,e)}},t.prototype.hide=function(){if(!this.testFlag(t.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||s.MessageLoop.sendMessage(this,t.Msg.BeforeHide),this.setFlag(t.Flag.IsHidden),this.addClass("p-mod-hidden"),!this.isAttached||this.parent&&!this.parent.isVisible||s.MessageLoop.sendMessage(this,t.Msg.AfterHide),this.parent)){var e=new t.ChildMessage("child-hidden",this);s.MessageLoop.sendMessage(this.parent,e)}},t.prototype.setHidden=function(t){t?this.hide():this.show()},t.prototype.testFlag=function(t){return 0!=(this._flags&t)},t.prototype.setFlag=function(t){this._flags|=t},t.prototype.clearFlag=function(t){this._flags&=~t},t.prototype.processMessage=function(e){switch(e.type){case"resize":this.notifyLayout(e),this.onResize(e);break;case"update-request":this.notifyLayout(e),this.onUpdateRequest(e);break;case"fit-request":this.notifyLayout(e),this.onFitRequest(e);break;case"before-show":this.notifyLayout(e),this.onBeforeShow(e);break;case"after-show":this.setFlag(t.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(t.Flag.IsVisible),this.notifyLayout(e),this.onAfterHide(e);break;case"before-attach":this.notifyLayout(e),this.onBeforeAttach(e);break;case"after-attach":this.isHidden||this.parent&&!this.parent.isVisible||this.setFlag(t.Flag.IsVisible),this.setFlag(t.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(t.Flag.IsVisible),this.clearFlag(t.Flag.IsAttached),this.notifyLayout(e),this.onAfterDetach(e);break;case"activate-request":this.notifyLayout(e),this.onActivateRequest(e);break;case"close-request":this.notifyLayout(e),this.onCloseRequest(e);break;case"child-added":this.notifyLayout(e),this.onChildAdded(e);break;case"child-removed":this.notifyLayout(e),this.onChildRemoved(e);break;default:this.notifyLayout(e)}},t.prototype.notifyLayout=function(t){this._layout&&this._layout.processParentMessage(t)},t.prototype.onCloseRequest=function(e){this.parent?this.parent=null:this.isAttached&&t.detach(this)},t.prototype.onResize=function(t){},t.prototype.onUpdateRequest=function(t){},t.prototype.onFitRequest=function(t){},t.prototype.onActivateRequest=function(t){},t.prototype.onBeforeShow=function(t){},t.prototype.onAfterShow=function(t){},t.prototype.onBeforeHide=function(t){},t.prototype.onAfterHide=function(t){},t.prototype.onBeforeAttach=function(t){},t.prototype.onAfterAttach=function(t){},t.prototype.onBeforeDetach=function(t){},t.prototype.onAfterDetach=function(t){},t.prototype.onChildAdded=function(t){},t.prototype.onChildRemoved=function(t){},t}();e.Widget=h,function(t){!function(t){t[t.IsDisposed=1]="IsDisposed",t[t.IsAttached=2]="IsAttached",t[t.IsHidden=4]="IsHidden",t[t.IsVisible=8]="IsVisible",t[t.DisallowLayout=16]="DisallowLayout"}(t.Flag||(t.Flag={})),function(t){t.BeforeShow=new s.Message("before-show"),t.AfterShow=new s.Message("after-show"),t.BeforeHide=new s.Message("before-hide"),t.AfterHide=new s.Message("after-hide"),t.BeforeAttach=new s.Message("before-attach"),t.AfterAttach=new s.Message("after-attach"),t.BeforeDetach=new s.Message("before-detach"),t.AfterDetach=new s.Message("after-detach"),t.ParentChanged=new s.Message("parent-changed"),t.UpdateRequest=new s.ConflatableMessage("update-request"),t.FitRequest=new s.ConflatableMessage("fit-request"),t.ActivateRequest=new s.ConflatableMessage("activate-request"),t.CloseRequest=new s.ConflatableMessage("close-request")}(t.Msg||(t.Msg={}));var e=function(t){function e(e,n){var i=t.call(this,e)||this;return i.child=n,i}return r(e,t),e}(s.Message);t.ChildMessage=e;var n=function(t){function e(e,n){var i=t.call(this,"resize")||this;return i.width=e,i.height=n,i}return r(e,t),e}(s.Message);t.ResizeMessage=n,function(t){t.UnknownSize=new t(-1,-1)}(n=t.ResizeMessage||(t.ResizeMessage={})),t.attach=function(e,n,i){if(void 0===i&&(i=null),e.parent)throw new Error("Cannot attach a child widget.");if(e.isAttached||document.body.contains(e.node))throw new Error("Widget is already attached.");if(!document.body.contains(n))throw new Error("Host is not attached.");s.MessageLoop.sendMessage(e,t.Msg.BeforeAttach),n.insertBefore(e.node,i),s.MessageLoop.sendMessage(e,t.Msg.AfterAttach)},t.detach=function(e){if(e.parent)throw new Error("Cannot detach a child widget.");if(!e.isAttached||!document.body.contains(e.node))throw new Error("Widget is not attached.");s.MessageLoop.sendMessage(e,t.Msg.BeforeDetach),e.node.parentNode.removeChild(e.node),s.MessageLoop.sendMessage(e,t.Msg.AfterDetach)}}(h=e.Widget||(e.Widget={})),e.Widget=h,function(t){t.titleProperty=new c.AttachedProperty({name:"title",create:function(t){return new u.Title({owner:t})}}),t.createNode=function(t){return t.node||document.createElement("div")}}(o||(o={}))},function(t,e,n){"use strict";(function(t,i){var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var a=n(9),s=n(171),c=function(){function t(t){this.type=t}return Object.defineProperty(t.prototype,"isConflatable",{get:function(){return!1},enumerable:!0,configurable:!0}),t.prototype.conflate=function(t){return!1},t}();e.Message=c;var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),Object.defineProperty(e.prototype,"isConflatable",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype.conflate=function(t){return!0},e}(c);e.ConflatableMessage=l,function(e){function n(t,e){var n=o.get(t);n&&0!==n.length?a.every(a.retro(n),function(n){return!n||function(t,e,n){var i=!0;try{i="function"==typeof t?t(e,n):t.messageHook(e,n)}catch(t){l(t)}return i}(n,t,e)})&&p(t,e):p(t,e)}e.sendMessage=n,e.postMessage=function(t,e){e.isConflatable&&a.some(r,function(n){return n.handler===t&&!!n.msg&&n.msg.type===e.type&&!!n.msg.isConflatable&&n.msg.conflate(e)})||m(t,e)},e.installMessageHook=function(t,e){var n=o.get(t);n&&-1!==n.indexOf(e)||(n?n.push(e):o.set(t,[e]))},e.removeMessageHook=function(t,e){var n=o.get(t);if(n){var i=n.indexOf(e);-1!==i&&(n[i]=null,_(n))}},e.clearData=function(t){var e=o.get(t);e&&e.length>0&&(a.ArrayExt.fill(e,null),_(e)),a.each(r,function(e){e.handler===t&&(e.handler=null,e.msg=null)})},e.flush=function(){h||0===u||(f(u),h=!0,g(),h=!1)},e.getExceptionHandler=function(){return l},e.setExceptionHandler=function(t){var e=l;return l=t,e};var r=new s.LinkedList,o=new WeakMap,c=new Set,l=function(t){console.error(t)},u=0,h=!1,d="function"==typeof requestAnimationFrame?requestAnimationFrame:t,f="function"==typeof cancelAnimationFrame?cancelAnimationFrame:i;function p(t,e){try{t.processMessage(e)}catch(t){l(t)}}function m(t,e){r.addLast({handler:t,msg:e}),0===u&&(u=d(g))}function g(){if(u=0,!r.isEmpty){var t={handler:null,msg:null};for(r.addLast(t);;){var e=r.removeFirst();if(e===t)return;e.handler&&e.msg&&n(e.handler,e.msg)}}}function _(t){0===c.size&&d(v),c.add(t)}function v(){c.forEach(b),c.clear()}function b(t){a.ArrayExt.removeAllWhere(t,y)}function y(t){return null===t}}(e.MessageLoop||(e.MessageLoop={}))}).call(this,n(51).setImmediate,n(51).clearImmediate)},function(t,e,n){"use strict";(function(t){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
var i=n(182),r=n(183),o=n(94);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,n){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return l(this,t,e,n)}function l(t,e,n,i){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,i){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(i||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,n):new Uint8Array(e,n,i);c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=d(t,e);return t}(t,e,n,i):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!c.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var i=0|p(e,n),r=(t=s(t,i)).write(e,n);r!==i&&(t=t.slice(0,r));return t}(t,e,n):function(t,e){if(c.isBuffer(e)){var n=0|f(e.length);return 0===(t=s(t,n)).length?t:(e.copy(t,0,0,n),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(i=e.length)!=i?s(t,0):d(t,e);if("Buffer"===e.type&&o(e.data))return d(t,e.data)}var i;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(u(e),t=s(t,e<0?0:0|f(e)),!c.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function d(t,e){var n=e.length<0?0:0|f(e.length);t=s(t,n);for(var i=0;i<n;i+=1)t[i]=255&e[i];return t}function f(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function p(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return H(t).length;default:if(i)return F(t).length;e=(""+e).toLowerCase(),i=!0}}function m(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return L(this,e,n);case"utf8":case"utf-8":return A(this,e,n);case"ascii":return k(this,e,n);case"latin1":case"binary":return P(this,e,n);case"base64":return S(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function g(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function _(t,e,n,i,r){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof e&&(e=c.from(e,i)),c.isBuffer(e))return 0===e.length?-1:v(t,e,n,i,r);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):v(t,[e],n,i,r);throw new TypeError("val must be string, number or Buffer")}function v(t,e,n,i,r){var o,a=1,s=t.length,c=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;a=2,s/=2,c/=2,n/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(r){var u=-1;for(o=n;o<s;o++)if(l(t,o)===l(e,-1===u?0:o-u)){if(-1===u&&(u=o),o-u+1===c)return u*a}else-1!==u&&(o-=o-u),u=-1}else for(n+c>s&&(n=s-c),o=n;o>=0;o--){for(var h=!0,d=0;d<c;d++)if(l(t,o+d)!==l(e,d)){h=!1;break}if(h)return o}return-1}function b(t,e,n,i){n=Number(n)||0;var r=t.length-n;i?(i=Number(i))>r&&(i=r):i=r;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var a=0;a<i;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[n+a]=s}return a}function y(t,e,n,i){return q(F(e,t.length-n),t,n,i)}function x(t,e,n,i){return q(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,i)}function w(t,e,n,i){return x(t,e,n,i)}function M(t,e,n,i){return q(H(e),t,n,i)}function E(t,e,n,i){return q(function(t,e){for(var n,i,r,o=[],a=0;a<t.length&&!((e-=2)<0);++a)n=t.charCodeAt(a),i=n>>8,r=n%256,o.push(r),o.push(i);return o}(e,t.length-n),t,n,i)}function S(t,e,n){return 0===e&&n===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,n))}function A(t,e,n){n=Math.min(t.length,n);for(var i=[],r=e;r<n;){var o,a,s,c,l=t[r],u=null,h=l>239?4:l>223?3:l>191?2:1;if(r+h<=n)switch(h){case 1:l<128&&(u=l);break;case 2:128==(192&(o=t[r+1]))&&(c=(31&l)<<6|63&o)>127&&(u=c);break;case 3:o=t[r+1],a=t[r+2],128==(192&o)&&128==(192&a)&&(c=(15&l)<<12|(63&o)<<6|63&a)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:o=t[r+1],a=t[r+2],s=t[r+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(c=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(u=c)}null===u?(u=65533,h=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|1023&u),i.push(u),r+=h}return function(t){var e=t.length;if(e<=T)return String.fromCharCode.apply(String,t);var n="",i=0;for(;i<e;)n+=String.fromCharCode.apply(String,t.slice(i,i+=T));return n}(i)}e.Buffer=c,e.SlowBuffer=function(t){+t!=t&&(t=0);return c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,n){return l(null,t,e,n)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,n){return function(t,e,n,i){return u(e),e<=0?s(t,e):void 0!==n?"string"==typeof i?s(t,e).fill(n,i):s(t,e).fill(n):s(t,e)}(null,t,e,n)},c.allocUnsafe=function(t){return h(null,t)},c.allocUnsafeSlow=function(t){return h(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,r=0,o=Math.min(n,i);r<o;++r)if(t[r]!==e[r]){n=t[r],i=e[r];break}return n<i?-1:i<n?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var i=c.allocUnsafe(e),r=0;for(n=0;n<t.length;++n){var a=t[n];if(!c.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,r),r+=a.length}return i},c.byteLength=p,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?A(this,0,t):m.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,n,i,r){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),e<0||n>t.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&e>=n)return 0;if(i>=r)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(r>>>=0)-(i>>>=0),a=(n>>>=0)-(e>>>=0),s=Math.min(o,a),l=this.slice(i,r),u=t.slice(e,n),h=0;h<s;++h)if(l[h]!==u[h]){o=l[h],a=u[h];break}return o<a?-1:a<o?1:0},c.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},c.prototype.indexOf=function(t,e,n){return _(this,t,e,n,!0)},c.prototype.lastIndexOf=function(t,e,n){return _(this,t,e,n,!1)},c.prototype.write=function(t,e,n,i){if(void 0===e)i="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)i=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var r=this.length-e;if((void 0===n||n>r)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return y(this,t,e,n);case"ascii":return x(this,t,e,n);case"latin1":case"binary":return w(this,t,e,n);case"base64":return M(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function k(t,e,n){var i="";n=Math.min(t.length,n);for(var r=e;r<n;++r)i+=String.fromCharCode(127&t[r]);return i}function P(t,e,n){var i="";n=Math.min(t.length,n);for(var r=e;r<n;++r)i+=String.fromCharCode(t[r]);return i}function L(t,e,n){var i=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>i)&&(n=i);for(var r="",o=e;o<n;++o)r+=U(t[o]);return r}function O(t,e,n){for(var i=t.slice(e,n),r="",o=0;o<i.length;o+=2)r+=String.fromCharCode(i[o]+256*i[o+1]);return r}function C(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function R(t,e,n,i,r,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||e<o)throw new RangeError('"value" argument is out of bounds');if(n+i>t.length)throw new RangeError("Index out of range")}function I(t,e,n,i){e<0&&(e=65535+e+1);for(var r=0,o=Math.min(t.length-n,2);r<o;++r)t[n+r]=(e&255<<8*(i?r:1-r))>>>8*(i?r:1-r)}function z(t,e,n,i){e<0&&(e=4294967295+e+1);for(var r=0,o=Math.min(t.length-n,4);r<o;++r)t[n+r]=e>>>8*(i?r:3-r)&255}function B(t,e,n,i,r,o){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(t,e,n,i,o){return o||B(t,0,n,4),r.write(t,e,n,i,23,4),n+4}function D(t,e,n,i,o){return o||B(t,0,n,8),r.write(t,e,n,i,52,8),n+8}c.prototype.slice=function(t,e){var n,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=c.prototype;else{var r=e-t;n=new c(r,void 0);for(var o=0;o<r;++o)n[o]=this[o+t]}return n},c.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var i=this[t],r=1,o=0;++o<e&&(r*=256);)i+=this[t+o]*r;return i},c.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var i=this[t+--e],r=1;e>0&&(r*=256);)i+=this[t+--e]*r;return i},c.prototype.readUInt8=function(t,e){return e||C(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||C(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||C(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var i=this[t],r=1,o=0;++o<e&&(r*=256);)i+=this[t+o]*r;return i>=(r*=128)&&(i-=Math.pow(2,8*e)),i},c.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var i=e,r=1,o=this[t+--i];i>0&&(r*=256);)o+=this[t+--i]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||C(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(t,e){e||C(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(t,e){return e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||C(t,4,this.length),r.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||C(t,4,this.length),r.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||C(t,8,this.length),r.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||C(t,8,this.length),r.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,n,i){(t=+t,e|=0,n|=0,i)||R(this,t,e,n,Math.pow(2,8*n)-1,0);var r=1,o=0;for(this[e]=255&t;++o<n&&(r*=256);)this[e+o]=t/r&255;return e+n},c.prototype.writeUIntBE=function(t,e,n,i){(t=+t,e|=0,n|=0,i)||R(this,t,e,n,Math.pow(2,8*n)-1,0);var r=n-1,o=1;for(this[e+r]=255&t;--r>=0&&(o*=256);)this[e+r]=t/o&255;return e+n},c.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):z(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):z(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=Math.pow(2,8*n-1);R(this,t,e,n,r-1,-r)}var o=0,a=1,s=0;for(this[e]=255&t;++o<n&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},c.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=Math.pow(2,8*n-1);R(this,t,e,n,r-1,-r)}var o=n-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},c.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):z(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):z(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,n){return N(this,t,e,!0,n)},c.prototype.writeFloatBE=function(t,e,n){return N(this,t,e,!1,n)},c.prototype.writeDoubleLE=function(t,e,n){return D(this,t,e,!0,n)},c.prototype.writeDoubleBE=function(t,e,n){return D(this,t,e,!1,n)},c.prototype.copy=function(t,e,n,i){if(n||(n=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-n&&(i=t.length-e+n);var r,o=i-n;if(this===t&&n<e&&e<i)for(r=o-1;r>=0;--r)t[r+e]=this[r+n];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(r=0;r<o;++r)t[r+e]=this[r+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},c.prototype.fill=function(t,e,n,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),1===t.length){var r=t.charCodeAt(0);r<256&&(t=r)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!c.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var a=c.isBuffer(t)?t:F(new c(t,i).toString()),s=a.length;for(o=0;o<n-e;++o)this[o+e]=a[o%s]}return this};var j=/[^+\/0-9A-Za-z-_]/g;function U(t){return t<16?"0"+t.toString(16):t.toString(16)}function F(t,e){var n;e=e||1/0;for(var i=t.length,r=null,o=[],a=0;a<i;++a){if((n=t.charCodeAt(a))>55295&&n<57344){if(!r){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===i){(e-=3)>-1&&o.push(239,191,189);continue}r=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(e-=3)>-1&&o.push(239,191,189);if(r=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function H(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(j,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,n,i){for(var r=0;r<i&&!(r+n>=e.length||r>=t.length);++r)e[r+n]=t[r];return r}}).call(this,n(25))},function(t,e,n){"use strict";function i(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),i(n(173)),i(n(174)),i(n(175))},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(2)),a=r(n(89)),s=i(n(6)),c=new RegExp("^(((((\\*)|(/*)|(-*))(\\s*)%([aAbBdeHIjmMLpSUwWyYZ]{1}))+)|((\\s*)%([cxX]{1})))$");e.deepCopy=function t(e){if(a.default(e))return e.slice();if(s.isArray(e))return e.map(e=>t(e));if(s.isNumber(e)||s.isString(e))return e;if(s.isDate(e))return new Date(e.getTime());{const n={};for(let i in e)e.hasOwnProperty(i)&&(n[i]=t(e[i]));return n}},e.convert_dates=function(t){if(a.default(t))return t;const e=function(t){const e=new Float64Array(t.map(Number));return e.type="date",e};return t[0]instanceof Array&&t[0][0]instanceof Date?t=t.map(e):t[0]instanceof Date&&(t=e(t)),t},e.getCustomRange=function(t){const e=t[0],n=t[t.length-1];let i;return i=t[0]>t[1]?o.min(t):o.max(t),[o.scaleLinear().range([e,i]),o.scaleLinear().range([i,n])]},e.is_valid_time_format=function(t){return c.test(t)},e.is_array=function(t){return t instanceof Array||a.default(t)},e.getDate=function(t){return null==t?null:new Date(t)}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(10)),o=n(28),a=i(n(12));class s extends r.WidgetModel{defaults(){return Object.assign({},r.WidgetModel.prototype.defaults(),{_model_name:"MarkModel",_model_module:"bqplot",_view_module:"bqplot",_model_module_version:o.semver_range,_view_module_version:o.semver_range,scales:{},scales_metadata:{},preserve_domain:{},display_legend:!1,labels:[],apply_clip:!0,visible:!0,selected_style:{},unselected_style:{},selected:null,enable_hover:!0,tooltip:null,tooltip_style:{opacity:.9},interactions:{hover:"tooltip"},tooltip_location:"mouse"})}initialize(t,e){super.initialize(t,e),this.on("change:scales",this.update_scales,this),this.once("destroy",this.handle_destroy,this),this.dirty=!1,this.display_el_classes=["mark"],this.update_scales()}update_data(){this.update_domains(),this.trigger("data_updated")}update_domains(){}update_scales(){this.unregister_all_scales(this.previous("scales")),this.trigger("scales_updated"),this.update_domains()}unregister_all_scales(t){this.dirty=!0;for(let e in t)t[e].del_domain([],this.model_id+"_"+e);this.dirty=!1}handle_destroy(){this.unregister_all_scales(this.get("scales"))}get_key_for_dimension(t){const e=this.get("scales_metadata");for(let n in e)if(e[n].dimension===t)return n;return null}get_key_for_orientation(t){const e=this.get("scales_metadata");for(let n in e)if(e[n].orientation===t)return n;return null}get_data_dict(t,e){return t}}s.serializers=Object.assign({},r.WidgetModel.serializers,{scales:{deserialize:r.unpack_models},tooltip:{deserialize:r.unpack_models},selected:a.array_or_json}),e.MarkModel=s},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(10)),o=i(n(2));n(31);const a=n(14),s=n(92),c=function(){return n(0).event}.bind(this),l=i(n(6));function u(t){return null!=t}e.Mark=class extends r.WidgetView{initialize(){this.setElement(document.createElementNS(o.namespaces.svg,"g")),this.d3el=o.select(this.el),super.initialize.apply(this,arguments)}render(){this.x_padding=0,this.y_padding=0,this.parent=this.options.parent,this.uuid=r.uuid();const t=this.set_scale_views();return this.listenTo(this.model,"scales_updated",()=>{this.set_scale_views().then(l.bind(this.draw,this))}),this.colors=this.model.get("colors"),this.options.clip_id&&this.model.get("apply_clip")&&this.d3el.attr("clip-path","url(#"+this.options.clip_id+")"),this.tooltip_div=o.select(document.createElement("div")).attr("class","mark_tooltip").attr("id","tooltip_"+this.uuid).style("display","none").style("opacity",0),this.bisect=o.bisector(function(t){return t}).left,this.d3el.style("display",this.model.get("visible")?"inline":"none"),this.display_el_classes=[],this.event_metadata={mouse_over:{msg_name:"hover",lookup_data:!0,hit_test:!0},legend_clicked:{msg_name:"legend_click",hit_test:!0},element_clicked:{msg_name:"element_click",lookup_data:!0,hit_test:!0},parent_clicked:{msg_name:"background_click",hit_test:!1},legend_mouse_over:{msg_name:"legend_hover",hit_test:!0}},t}set_scale_views(){for(var t in this.scales)this.stopListening(this.scales[t]);const e=this.model.get("scales"),n=this,i={};return l.each(e,function(t,e){i[e]=n.create_child_view(t)}),r.resolvePromisesDict(i).then(function(t){n.scales=t,n.set_positional_scales(),n.initialize_additional_scales(),n.set_ranges(),n.trigger("mark_scales_updated")})}set_positional_scales(){}initialize_additional_scales(){}set_internal_scales(){}create_listeners(){this.listenTo(this.model,"change:visible",this.update_visibility),this.listenTo(this.model,"change:selected_style",this.selected_style_updated),this.listenTo(this.model,"change:unselected_style",this.unselected_style_updated),this.parent.on("margin_updated",this.relayout,this),this.model.on_some_change(["labels","display_legend"],function(){this.model.trigger("redraw_legend")},this)}remove(){this.model.off(null,null,this),this.d3el.transition("remove").duration(0).remove(),this.tooltip_div.remove(),super.remove()}draw_legend(t,e,n,i,r){return t.selectAll(".legend"+this.uuid).remove(),t.append("g").attr("transform","translate("+e+", "+n+")").attr("class","legend"+this.uuid).on("mouseover",l.bind(this.highlight_axes,this)).on("mouseout",l.bind(this.unhighlight_axes,this)).append("text").text(this.model.get("labels")[0]),[1,1]}highlight_axes(){l.each(this.model.get("scales"),function(t){t.trigger("highlight_axis")})}unhighlight_axes(){l.each(this.model.get("scales"),function(t){t.trigger("unhighlight_axis")})}relayout(){}invert_range(t,e){return[t,e]}invert_point(t){}invert_multi_range(t){return t}update_visibility(t,e){this.d3el.style("display",e?"inline":"none")}get_colors(t){this.colors=this.model.get("colors");const e=this.colors.length;return this.colors[t%e]}get_mark_color(t,e){const n=this.scales.color,i=this.model.get("colors");return n&&void 0!==t.color&&null!==t.color?n.scale(t.color):i[e%i.length]}get_mark_opacity(t,e){const n=this.scales.opacity,i=this.model.get("opacities");return n&&void 0!==t.opacity&&null!==t.opacity?n.scale(t.opacity):i[e%i.length]}selected_style_updated(t,e){this.selected_style=e,this.clear_style(t.previous("selected_style"),this.selected_indices),this.style_updated(e,this.selected_indices)}unselected_style_updated(t,e){this.unselected_style=e;const n=this.selected_indices,i=n?l.range(this.model.mark_data.length).filter(function(t){return-1===n.indexOf(t)}):[];this.clear_style(t.previous("unselected_style"),i),this.style_updated(e,i)}style_updated(t,e,n){this.set_default_style(e),this.set_style_on_elements(t,e)}apply_styles(t){void 0!==t&&null!=t||(t=[this.selected_style,this.unselected_style]);const e=l.range(this.model.mark_data.length);for(var n=0;n<t.length;n++)this.clear_style(t[n]);this.set_default_style(e),this.set_style_on_elements(this.selected_style,Array.from(this.selected_indices||[]));const i=this.selected_indices?l.difference(e,Array.from(this.selected_indices)):[];this.set_style_on_elements(this.unselected_style,i)}show_tooltip(t){this.tooltip_view&&(null!=t&&t?this.tooltip_div.style("pointer-events","all"):this.tooltip_div.style("pointer-events","none"),this.tooltip_div.styles(this.model.get("tooltip_style")).style("display",null),a.MessageLoop.sendMessage(this.tooltip_view.pWidget,s.Widget.Msg.AfterAttach),this.parent.popper.enableEventListeners(),this.move_tooltip())}move_tooltip(t){this.tooltip_view&&(this.parent.popper_reference.x=c().clientX,this.parent.popper_reference.y=c().clientY,this.parent.popper.scheduleUpdate())}hide_tooltip(){this.parent.popper.disableEventListeners(),this.tooltip_div.style("pointer-events","none"),this.tooltip_div.style("opacity",0).style("display","none")}refresh_tooltip(t=!1){const e=o.select(c().target);if(this.is_hover_element(e)){const n=e.data()[0],i=this.model.get_data_dict(n,n.index);this.trigger("update_tooltip",i),this.show_tooltip(t)}}create_tooltip(){const t=this.model.get("tooltip"),e=this;this.tooltip_view&&this.tooltip_view.remove(),t&&this.create_child_view(t).then(function(t){e.tooltip_view=t,a.MessageLoop.sendMessage(t.pWidget,s.Widget.Msg.BeforeAttach),e.tooltip_div.node().appendChild(t.el),a.MessageLoop.sendMessage(t.pWidget,s.Widget.Msg.AfterAttach)})}event_dispatcher(t,e){this.custom_msg_sender(t),void 0!==this.event_listeners[t]&&l.bind(this.event_listeners[t],this,e)()}custom_msg_sender(t){const e=this.event_metadata[t];if(void 0!==e){let t=null;if(e.hit_test){const n=o.select(c().target);if(!this.is_hover_element(n))return;t=n.data()[0],e.lookup_data&&(t=this.model.get_data_dict(t,t.index))}this.send({event:e.msg_name,data:t})}}reset_click(){this.event_listeners.element_clicked=function(){},this.event_listeners.parent_clicked=function(){}}reset_hover(){this.event_listeners.mouse_over=function(){},this.event_listeners.mouse_move=function(){},this.event_listeners.mouse_out=function(){}}reset_legend_click(){this.event_listeners.legend_clicked=function(){}}reset_legend_hover(){this.event_listeners.legend_mouse_over=function(){},this.event_listeners.legend_mouse_out=function(){}}process_click(t){const e=this;"tooltip"===t&&(this.event_listeners.element_clicked=function(){return e.refresh_tooltip(!0)},this.event_listeners.parent_clicked=this.hide_tooltip)}process_hover(t){"tooltip"===t&&(this.event_listeners.mouse_over=this.refresh_tooltip,this.event_listeners.mouse_move=this.move_tooltip,this.event_listeners.mouse_out=this.hide_tooltip)}process_legend_click(t){const e=this;"tooltip"===t&&(this.event_listeners.legend_clicked=function(){return e.refresh_tooltip(!0)},this.event_listeners.parent_clicked=this.hide_tooltip)}process_legend_hover(t){"highlight_axes"===t&&(this.event_listeners.legend_mouse_over=l.bind(this.highlight_axes,this),this.event_listeners.legend_mouse_out=l.bind(this.unhighlight_axes,this))}process_interactions(){const t=this.model.get("interactions");u(t.click)?this.process_click(t.click):this.reset_click(),u(t.hover)?this.process_hover(t.hover):this.reset_hover(),u(t.legend_click)?this.process_legend_click(t.legend_click):this.reset_legend_click(),u(t.legend_hover)?this.process_legend_hover(t.legend_hover):this.reset_legend_hover()}mouse_over(){if(this.model.get("enable_hover")){const t=o.select(c().target);if(this.is_hover_element(t)){const e=t.data()[0],n=this.model.get_data_dict(e,e.index);this.trigger("update_tooltip",n),this.show_tooltip(),this.send({event:"hover",point:n})}}}mouse_out(){if(this.model.get("enable_hover")){const t=o.select(c().target);if(this.is_hover_element(t)){const e=t.data()[0],n=this.model.get_data_dict(e,e.index);this.hide_tooltip(),this.send({event:"hover",point:n})}}}mouse_move(){this.model.get("enable_hover")&&this.is_hover_element(o.select(c().target))&&this.move_tooltip()}is_hover_element(t){const e=this.display_el_classes.map(function(e){return t.classed(e)});return l.compact(e).length>0}}},function(t,e,n){"use strict";var i=e;i.version=n(224).version,i.utils=n(225),i.rand=n(116),i.curve=n(57),i.curves=n(230),i.ec=n(238),i.eddsa=n(242)},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(9),o=function(){function t(t){this.sender=t}return t.prototype.connect=function(t,e){return i.connect(this,t,e)},t.prototype.disconnect=function(t,e){return i.disconnect(this,t,e)},t.prototype.emit=function(t){i.emit(this,t)},t}();e.Signal=o,function(t){t.disconnectBetween=function(t,e){i.disconnectBetween(t,e)},t.disconnectSender=function(t){i.disconnectSender(t)},t.disconnectReceiver=function(t){i.disconnectReceiver(t)},t.disconnectAll=function(t){i.disconnectAll(t)},t.clearData=function(t){i.disconnectAll(t)},t.getExceptionHandler=function(){return i.exceptionHandler},t.setExceptionHandler=function(t){var e=i.exceptionHandler;return i.exceptionHandler=t,e}}(o=e.Signal||(e.Signal={})),e.Signal=o,function(e){e.exceptionHandler=function(t){console.error(t)},e.connect=function(t,e,r){r=r||void 0;var o=n.get(t.sender);if(o||(o=[],n.set(t.sender,o)),s(o,t,e,r))return!1;var a=r||e,c=i.get(a);c||(c=[],i.set(a,c));var l={signal:t,slot:e,thisArg:r};return o.push(l),c.push(l),!0},e.disconnect=function(t,e,r){r=r||void 0;var o=n.get(t.sender);if(!o||0===o.length)return!1;var a=s(o,t,e,r);if(!a)return!1;var c=r||e,u=i.get(c);return a.signal=null,l(o),l(u),!0},e.disconnectBetween=function(t,e){var o=n.get(t);if(o&&0!==o.length){var a=i.get(e);a&&0!==a.length&&(r.each(a,function(e){e.signal&&e.signal.sender===t&&(e.signal=null)}),l(o),l(a))}},e.disconnectSender=function(t){var e=n.get(t);e&&0!==e.length&&(r.each(e,function(t){if(t.signal){var e=t.thisArg||t.slot;t.signal=null,l(i.get(e))}}),l(e))},e.disconnectReceiver=function(t){var e=i.get(t);e&&0!==e.length&&(r.each(e,function(t){if(t.signal){var e=t.signal.sender;t.signal=null,l(n.get(e))}}),l(e))},e.disconnectAll=function(t){var e=n.get(t);e&&e.length>0&&(r.each(e,function(t){t.signal=null}),l(e));var o=i.get(t);o&&o.length>0&&(r.each(o,function(t){t.signal=null}),l(o))},e.emit=function(t,e){var i=n.get(t.sender);if(i&&0!==i.length)for(var r=0,o=i.length;r<o;++r){var a=i[r];a.signal===t&&c(a,e)}};var n=new WeakMap,i=new WeakMap,o=new Set,a="function"==typeof requestAnimationFrame?requestAnimationFrame:t;function s(t,e,n,i){return r.find(t,function(t){return t.signal===e&&t.slot===n&&t.thisArg===i})}function c(t,n){var i=t.signal,r=t.slot,o=t.thisArg;try{r.call(o,i.sender,n)}catch(t){e.exceptionHandler(t)}}function l(t){0===o.size&&a(u),o.add(t)}function u(){o.forEach(h),o.clear()}function h(t){r.ArrayExt.removeAllWhere(t,d)}function d(t){return null===t.signal}}(i||(i={}))}).call(this,n(51).setImmediate)},function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=n,n.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)}},function(t,e,n){"use strict";var i={value:function(){}};function r(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i)throw new Error("illegal type: "+t);i[t]=[]}return new o(i)}function o(t){this._=t}function a(t,e){return t.trim().split(/^|\s+/).map(function(t){var n="",i=t.indexOf(".");if(i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}function s(t,e){for(var n,i=0,r=t.length;i<r;++i)if((n=t[i]).name===e)return n.value}function c(t,e,n){for(var r=0,o=t.length;r<o;++r)if(t[r].name===e){t[r]=i,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}o.prototype=r.prototype={constructor:o,on:function(t,e){var n,i=this._,r=a(t+"",i),o=-1,l=r.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<l;)if(n=(t=r[o]).type)i[n]=c(i[n],t.name,e);else if(null==e)for(n in i)i[n]=c(i[n],t.name,null);return this}for(;++o<l;)if((n=(t=r[o]).type)&&(n=s(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new o(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,i,r=new Array(n),o=0;o<n;++o)r[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(i=this._[t]).length;o<n;++o)i[o].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(e,n)}};var l=r;n.d(e,"a",function(){return l})},function(t,e,n){"use strict";var i=n(0),r=n(23),o=n(26),a=Object(r.a)("start","end","cancel","interrupt"),s=[],c=0,l=1,u=2,h=3,d=4,f=5,p=6,m=function(t,e,n,i,r,m){var g=t.__transition;if(g){if(n in g)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function a(f){var m,g,_,v;if(n.state!==l)return c();for(m in r)if((v=r[m]).name===n.name){if(v.state===h)return Object(o.c)(a);v.state===d?(v.state=p,v.timer.stop(),v.on.call("interrupt",t,t.__data__,v.index,v.group),delete r[m]):+m<e&&(v.state=p,v.timer.stop(),v.on.call("cancel",t,t.__data__,v.index,v.group),delete r[m])}if(Object(o.c)(function(){n.state===h&&(n.state=d,n.timer.restart(s,n.delay,n.time),s(f))}),n.state=u,n.on.call("start",t,t.__data__,n.index,n.group),n.state===u){for(n.state=h,i=new Array(_=n.tween.length),m=0,g=-1;m<_;++m)(v=n.tween[m].value.call(t,t.__data__,n.index,n.group))&&(i[++g]=v);i.length=g+1}}function s(e){for(var r=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(c),n.state=f,1),o=-1,a=i.length;++o<a;)i[o].call(t,r);n.state===f&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){for(var i in n.state=p,n.timer.stop(),delete r[e],r)return;delete t.__transition}r[e]=n,n.timer=Object(o.d)(function(t){n.state=l,n.timer.restart(a,n.delay,n.time),n.delay<=t&&a(t-n.delay)},0,n.time)}(t,n,{name:e,index:i,group:r,on:a,tween:s,time:m.time,delay:m.delay,duration:m.duration,ease:m.ease,timer:null,state:c})};function g(t,e){var n=v(t,e);if(n.state>c)throw new Error("too late; already scheduled");return n}function _(t,e){var n=v(t,e);if(n.state>h)throw new Error("too late; already running");return n}function v(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var b=function(t,e){var n,i,r,o=t.__transition,a=!0;if(o){for(r in e=null==e?null:e+"",o)(n=o[r]).name===e?(i=n.state>u&&n.state<f,n.state=p,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[r]):a=!1;a&&delete t.__transition}},y=n(8);function x(t,e){var n,i;return function(){var r=_(this,t),o=r.tween;if(o!==n)for(var a=0,s=(i=n=o).length;a<s;++a)if(i[a].name===e){(i=i.slice()).splice(a,1);break}r.tween=i}}function w(t,e,n){var i,r;if("function"!=typeof n)throw new Error;return function(){var o=_(this,t),a=o.tween;if(a!==i){r=(i=a).slice();for(var s={name:e,value:n},c=0,l=r.length;c<l;++c)if(r[c].name===e){r[c]=s;break}c===l&&r.push(s)}o.tween=r}}function M(t,e,n){var i=t._id;return t.each(function(){var t=_(this,i);(t.value||(t.value={}))[e]=n.apply(this,arguments)}),function(t){return v(t,i).value[e]}}var E=n(7),S=function(t,e){var n;return("number"==typeof e?y.o:e instanceof E.a?y.q:(n=Object(E.a)(e))?(e=n,y.q):y.u)(t,e)};function A(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e(n))}}(t,r)),n}return r._value=e,r}function T(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&function(t,e){return function(n){this.setAttribute(t,e(n))}}(t,r)),n}return r._value=e,r}function k(t,e){return function(){g(this,t).delay=+e.apply(this,arguments)}}function P(t,e){return e=+e,function(){g(this,t).delay=e}}function L(t,e){return function(){_(this,t).duration=+e.apply(this,arguments)}}function O(t,e){return e=+e,function(){_(this,t).duration=e}}function C(t,e){if("function"!=typeof e)throw new Error;return function(){_(this,t).ease=e}}function R(t,e,n){var i,r,o=function(t){return(t+"").trim().split(/^|\s+/).every(function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t})}(e)?g:_;return function(){var a=o(this,t),s=a.on;s!==i&&(r=(i=s).copy()).on(e,n),a.on=r}}var I=i.selection.prototype.constructor;function z(t){return function(){this.style.removeProperty(t)}}function B(t,e,n){var i,r;function o(){var o=e.apply(this,arguments);return o!==r&&(i=(r=o)&&function(t,e,n){return function(i){this.style.setProperty(t,e(i),n)}}(t,o,n)),i}return o._value=e,o}var N=0;function D(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function j(t){return Object(i.selection)().transition(t)}function U(){return++N}var F=i.selection.prototype;D.prototype=j.prototype={constructor:D,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Object(i.selector)(t));for(var r=this._groups,o=r.length,a=new Array(o),s=0;s<o;++s)for(var c,l,u=r[s],h=u.length,d=a[s]=new Array(h),f=0;f<h;++f)(c=u[f])&&(l=t.call(c,c.__data__,f,u))&&("__data__"in c&&(l.__data__=c.__data__),d[f]=l,m(d[f],e,n,f,d,v(c,n)));return new D(a,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Object(i.selectorAll)(t));for(var r=this._groups,o=r.length,a=[],s=[],c=0;c<o;++c)for(var l,u=r[c],h=u.length,d=0;d<h;++d)if(l=u[d]){for(var f,p=t.call(l,l.__data__,d,u),g=v(l,n),_=0,b=p.length;_<b;++_)(f=p[_])&&m(f,e,n,_,p,g);a.push(p),s.push(l)}return new D(a,s,e,n)},filter:function(t){"function"!=typeof t&&(t=Object(i.matcher)(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var a,s=e[o],c=s.length,l=r[o]=[],u=0;u<c;++u)(a=s[u])&&t.call(a,a.__data__,u,s)&&l.push(a);return new D(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,r=n.length,o=Math.min(i,r),a=new Array(i),s=0;s<o;++s)for(var c,l=e[s],u=n[s],h=l.length,d=a[s]=new Array(h),f=0;f<h;++f)(c=l[f]||u[f])&&(d[f]=c);for(;s<i;++s)a[s]=e[s];return new D(a,this._parents,this._name,this._id)},selection:function(){return new I(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=U(),i=this._groups,r=i.length,o=0;o<r;++o)for(var a,s=i[o],c=s.length,l=0;l<c;++l)if(a=s[l]){var u=v(a,e);m(a,t,n,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new D(i,this._parents,t,n)},call:F.call,nodes:F.nodes,node:F.node,size:F.size,empty:F.empty,each:F.each,on:function(t,e){var n=this._id;return arguments.length<2?v(this.node(),n).on.on(t):this.each(R(n,t,e))},attr:function(t,e){var n=Object(i.namespace)(t),r="transform"===n?y.w:S;return this.attrTween(t,"function"==typeof e?(n.local?function(t,e,n){var i,r,o;return function(){var a,s,c=n(this);if(null!=c)return(a=this.getAttributeNS(t.space,t.local))===(s=c+"")?null:a===i&&s===r?o:(r=s,o=e(i=a,c));this.removeAttributeNS(t.space,t.local)}}:function(t,e,n){var i,r,o;return function(){var a,s,c=n(this);if(null!=c)return(a=this.getAttribute(t))===(s=c+"")?null:a===i&&s===r?o:(r=s,o=e(i=a,c));this.removeAttribute(t)}})(n,r,M(this,"attr."+t,e)):null==e?(n.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(n):(n.local?function(t,e,n){var i,r,o=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===i?r:r=e(i=a,n)}}:function(t,e,n){var i,r,o=n+"";return function(){var a=this.getAttribute(t);return a===o?null:a===i?r:r=e(i=a,n)}})(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=Object(i.namespace)(t);return this.tween(n,(r.local?A:T)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?y.v:S;return null==e?this.styleTween(t,function(t,e){var n,r,o;return function(){var a=Object(i.style)(this,t),s=(this.style.removeProperty(t),Object(i.style)(this,t));return a===s?null:a===n&&s===r?o:o=e(n=a,r=s)}}(t,r)).on("end.style."+t,z(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,o,a;return function(){var s=Object(i.style)(this,t),c=n(this),l=c+"";return null==c&&(this.style.removeProperty(t),l=c=Object(i.style)(this,t)),s===l?null:s===r&&l===o?a:(o=l,a=e(r=s,c))}}(t,r,M(this,"style."+t,e))).each(function(t,e){var n,i,r,o,a="style."+e,s="end."+a;return function(){var c=_(this,t),l=c.on,u=null==c.value[a]?o||(o=z(e)):void 0;l===n&&r===u||(i=(n=l).copy()).on(s,r=u),c.on=i}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,o,a=n+"";return function(){var s=Object(i.style)(this,t);return s===a?null:s===r?o:o=e(r=s,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,B(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(M(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",(t=this._id,function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}));var t},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,r=v(this.node(),n).tween,o=0,a=r.length;o<a;++o)if((i=r[o]).name===t)return i.value;return null}return this.each((null==e?x:w)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?k:P)(e,t)):v(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?L:O)(e,t)):v(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(C(e,t)):v(this.node(),e).ease},end:function(){var t,e,n=this,i=n._id,r=n.size();return new Promise(function(o,a){var s={value:a},c={value:function(){0==--r&&o()}};n.each(function(){var n=_(this,i),r=n.on;r!==t&&((e=(t=r).copy())._.cancel.push(s),e._.interrupt.push(s),e._.end.push(c)),n.on=e})})}};var H={time:null,delay:0,duration:250,ease:n(65).o};function q(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))return H.time=Object(o.b)(),H;return n}i.selection.prototype.interrupt=function(t){return this.each(function(){b(this,t)})},i.selection.prototype.transition=function(t){var e,n;t instanceof D?(e=t._id,t=t._name):(e=U(),(n=H).time=Object(o.b)(),t=null==t?null:t+"");for(var i=this._groups,r=i.length,a=0;a<r;++a)for(var s,c=i[a],l=c.length,u=0;u<l;++u)(s=c[u])&&m(s,t,e,u,c,n||q(s,e));return new D(i,this._parents,t,e)};var G=[null],W=function(t,e){var n,i,r=t.__transition;if(r)for(i in e=null==e?null:e+"",r)if((n=r[i]).state>l&&n.name===e)return new D([[t]],G,e,+i);return null};n.d(e,"c",function(){return j}),n.d(e,"a",function(){return W}),n.d(e,"b",function(){return b})},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";var i,r,o=0,a=0,s=0,c=1e3,l=0,u=0,h=0,d="object"==typeof performance&&performance.now?performance:Date,f="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function p(){return u||(f(m),u=d.now()+h)}function m(){u=0}function g(){this._call=this._time=this._next=null}function _(t,e,n){var i=new g;return i.restart(t,e,n),i}function v(){p(),++o;for(var t,e=i;e;)(t=u-e._time)>=0&&e._call.call(null,t),e=e._next;--o}function b(){u=(l=d.now())+h,o=a=0;try{v()}finally{o=0,function(){var t,e,n=i,o=1/0;for(;n;)n._call?(o>n._time&&(o=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:i=e);r=t,x(o)}(),u=0}}function y(){var t=d.now(),e=t-l;e>c&&(h-=e,l=t)}function x(t){o||(a&&(a=clearTimeout(a)),t-u>24?(t<1/0&&(a=setTimeout(b,t-d.now()-h)),s&&(s=clearInterval(s))):(s||(l=d.now(),s=setInterval(y,c)),o=1,f(b)))}g.prototype=_.prototype={constructor:g,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?p():+n)+(null==e?0:+e),this._next||r===this||(r?r._next=this:i=this,r=this),this._call=t,this._time=n,x()},stop:function(){this._call&&(this._call=null,this._time=1/0,x())}};var w=function(t,e,n){var i=new g;return e=null==e?0:+e,i.restart(function(n){i.stop(),t(n+e)},e,n),i},M=function(t,e,n){var i=new g,r=e;return null==e?(i.restart(t,e,n),i):(e=+e,n=null==n?p():+n,i.restart(function o(a){a+=r,i.restart(o,r+=e,n),t(a)},e,n),i)};n.d(e,"b",function(){return p}),n.d(e,"d",function(){return _}),n.d(e,"e",function(){return v}),n.d(e,"c",function(){return w}),n.d(e,"a",function(){return M})},function(t,e,n){"use strict";var i=function(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]},r=function(t){return(t=i(Math.abs(t)))?t[1]:NaN},o=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function a(t){return new s(t)}function s(t){if(!(e=o.exec(t)))throw new Error("invalid format: "+t);var e;this.fill=e[1]||" ",this.align=e[2]||">",this.sign=e[3]||"-",this.symbol=e[4]||"",this.zero=!!e[5],this.width=e[6]&&+e[6],this.comma=!!e[7],this.precision=e[8]&&+e[8].slice(1),this.trim=!!e[9],this.type=e[10]||""}a.prototype=s.prototype,s.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var c,l,u,h,d=function(t){t:for(var e,n=t.length,i=1,r=-1;i<n;++i)switch(t[i]){case".":r=e=i;break;case"0":0===r&&(r=i),e=i;break;default:if(r>0){if(!+t[i])break t;r=0}}return r>0?t.slice(0,r)+t.slice(e+1):t},f=function(t,e){var n=i(t,e);if(!n)return t+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")},p={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return f(100*t,e)},r:f,s:function(t,e){var n=i(t,e);if(!n)return t+"";var r=n[0],o=n[1],a=o-(c=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,s=r.length;return a===s?r:a>s?r+new Array(a-s+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+i(t,Math.max(0,e+a-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},m=function(t){return t},g=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],_=function(t){var e,n,i=t.grouping&&t.thousands?(e=t.grouping,n=t.thousands,function(t,i){for(var r=t.length,o=[],a=0,s=e[0],c=0;r>0&&s>0&&(c+s+1>i&&(s=Math.max(1,i-c)),o.push(t.substring(r-=s,r+s)),!((c+=s+1)>i));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}):m,o=t.currency,s=t.decimal,l=t.numerals?function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(t.numerals):m,u=t.percent||"%";function h(t){var e=(t=a(t)).fill,n=t.align,r=t.sign,h=t.symbol,f=t.zero,m=t.width,_=t.comma,v=t.precision,b=t.trim,y=t.type;"n"===y?(_=!0,y="g"):p[y]||(null==v&&(v=12),b=!0,y="g"),(f||"0"===e&&"="===n)&&(f=!0,e="0",n="=");var x="$"===h?o[0]:"#"===h&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",w="$"===h?o[1]:/[%p]/.test(y)?u:"",M=p[y],E=/[defgprs%]/.test(y);function S(t){var o,a,u,h=x,p=w;if("c"===y)p=M(t)+p,t="";else{var S=(t=+t)<0;if(t=M(Math.abs(t),v),b&&(t=d(t)),S&&0==+t&&(S=!1),h=(S?"("===r?r:"-":"-"===r||"("===r?"":r)+h,p=("s"===y?g[8+c/3]:"")+p+(S&&"("===r?")":""),E)for(o=-1,a=t.length;++o<a;)if(48>(u=t.charCodeAt(o))||u>57){p=(46===u?s+t.slice(o+1):t.slice(o))+p,t=t.slice(0,o);break}}_&&!f&&(t=i(t,1/0));var A=h.length+t.length+p.length,T=A<m?new Array(m-A+1).join(e):"";switch(_&&f&&(t=i(T+t,T.length?m-p.length:1/0),T=""),n){case"<":t=h+t+p+T;break;case"=":t=h+T+t+p;break;case"^":t=T.slice(0,A=T.length>>1)+h+t+p+T.slice(A);break;default:t=T+h+t+p}return l(t)}return v=null==v?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),S.toString=function(){return t+""},S}return{format:h,formatPrefix:function(t,e){var n=h(((t=a(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(r(e)/3))),o=Math.pow(10,-i),s=g[8+i/3];return function(t){return n(o*t)+s}}}};function v(t){return l=_(t),u=l.format,h=l.formatPrefix,l}v({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var b=function(t){return Math.max(0,-r(Math.abs(t)))},y=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(e)/3)))-r(Math.abs(t)))},x=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,r(e)-r(t))+1};n.d(e,"b",function(){return v}),n.d(e,"a",function(){return u}),n.d(e,"d",function(){return h}),n.d(e,"c",function(){return _}),n.d(e,"e",function(){return a}),n.d(e,"f",function(){return b}),n.d(e,"g",function(){return y}),n.d(e,"h",function(){return x})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.semver_range="^"+n(91).version},function(t,e,n){"use strict";function i(t){return"function"==typeof t.iter?t.iter():new r(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.iter=i,e.each=function(t,e){for(var n,r=0,o=i(t);void 0!==(n=o.next());)if(!1===e(n,r++))return},e.every=function(t,e){for(var n,r=0,o=i(t);void 0!==(n=o.next());)if(!e(n,r++))return!1;return!0},e.some=function(t,e){for(var n,r=0,o=i(t);void 0!==(n=o.next());)if(e(n,r++))return!0;return!1},e.toArray=function(t){for(var e,n=0,r=[],o=i(t);void 0!==(e=o.next());)r[n++]=e;return r};var r=function(){function t(t){this._index=0,this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},t}();e.ArrayIterator=r},function(t,e,n){"use strict";var i=n(22),r=n(4);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function a(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function c(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=r,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),r=0;r<t.length;r+=2)n.push(parseInt(t[r]+t[r+1],16))}else for(var i=0,r=0;r<t.length;r++){var a=t.charCodeAt(r);a<128?n[i++]=a:a<2048?(n[i++]=a>>6|192,n[i++]=63&a|128):o(t,r)?(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++r)),n[i++]=a>>18|240,n[i++]=a>>12&63|128,n[i++]=a>>6&63|128,n[i++]=63&a|128):(n[i++]=a>>12|224,n[i++]=a>>6&63|128,n[i++]=63&a|128)}else for(r=0;r<t.length;r++)n[r]=0|t[r];return n},e.toHex=function(t){for(var e="",n=0;n<t.length;n++)e+=s(t[n].toString(16));return e},e.htonl=a,e.toHex32=function(t,e){for(var n="",i=0;i<t.length;i++){var r=t[i];"little"===e&&(r=a(r)),n+=c(r.toString(16))}return n},e.zero2=s,e.zero8=c,e.join32=function(t,e,n,r){var o=n-e;i(o%4==0);for(var a=new Array(o/4),s=0,c=e;s<a.length;s++,c+=4){var l;l="big"===r?t[c]<<24|t[c+1]<<16|t[c+2]<<8|t[c+3]:t[c+3]<<24|t[c+2]<<16|t[c+1]<<8|t[c],a[s]=l>>>0}return a},e.split32=function(t,e){for(var n=new Array(4*t.length),i=0,r=0;i<t.length;i++,r+=4){var o=t[i];"big"===e?(n[r]=o>>>24,n[r+1]=o>>>16&255,n[r+2]=o>>>8&255,n[r+3]=255&o):(n[r+3]=o>>>24,n[r+2]=o>>>16&255,n[r+1]=o>>>8&255,n[r]=255&o)}return n},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,n){return t+e+n>>>0},e.sum32_4=function(t,e,n,i){return t+e+n+i>>>0},e.sum32_5=function(t,e,n,i,r){return t+e+n+i+r>>>0},e.sum64=function(t,e,n,i){var r=t[e],o=i+t[e+1]>>>0,a=(o<i?1:0)+n+r;t[e]=a>>>0,t[e+1]=o},e.sum64_hi=function(t,e,n,i){return(e+i>>>0<e?1:0)+t+n>>>0},e.sum64_lo=function(t,e,n,i){return e+i>>>0},e.sum64_4_hi=function(t,e,n,i,r,o,a,s){var c=0,l=e;return c+=(l=l+i>>>0)<e?1:0,c+=(l=l+o>>>0)<o?1:0,t+n+r+a+(c+=(l=l+s>>>0)<s?1:0)>>>0},e.sum64_4_lo=function(t,e,n,i,r,o,a,s){return e+i+o+s>>>0},e.sum64_5_hi=function(t,e,n,i,r,o,a,s,c,l){var u=0,h=e;return u+=(h=h+i>>>0)<e?1:0,u+=(h=h+o>>>0)<o?1:0,u+=(h=h+s>>>0)<s?1:0,t+n+r+a+c+(u+=(h=h+l>>>0)<l?1:0)>>>0},e.sum64_5_lo=function(t,e,n,i,r,o,a,s,c,l){return e+i+o+s+l>>>0},e.rotr64_hi=function(t,e,n){return(e<<32-n|t>>>n)>>>0},e.rotr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0},e.shr64_hi=function(t,e,n){return t>>>n},e.shr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0}},function(t,e,n){"use strict";n.r(e);var i=n(0),r=n(24);i.selection.prototype.attrs=function(t){return("function"==typeof t?function(t,e){return t.each(function(){var t=e.apply(this,arguments),n=Object(i.select)(this);for(var r in t)n.attr(r,t[r])})}:function(t,e){for(var n in e)t.attr(n,e[n]);return t})(this,t)},i.selection.prototype.styles=function(t,e){return("function"==typeof t?function(t,e,n){return t.each(function(){var t=e.apply(this,arguments),r=Object(i.select)(this);for(var o in t)r.style(o,t[o],n)})}:function(t,e,n){for(var i in e)t.style(i,e[i],n);return t})(this,t,null==e?"":e)},i.selection.prototype.properties=function(t){return("function"==typeof t?function(t,e){return t.each(function(){var t=e.apply(this,arguments),n=Object(i.select)(this);for(var r in t)n.property(r,t[r])})}:function(t,e){for(var n in e)t.property(n,e[n]);return t})(this,t)},r.c.prototype.attrs=function(t){return("function"==typeof t?function(t,e){return t.each(function(){var n=e.apply(this,arguments),r=Object(i.select)(this).transition(t);for(var o in n)r.attr(o,n[o])})}:function(t,e){for(var n in e)t.attr(n,e[n]);return t})(this,t)},r.c.prototype.styles=function(t,e){return("function"==typeof t?function(t,e,n){return t.each(function(){var r=e.apply(this,arguments),o=Object(i.select)(this).transition(t);for(var a in r)o.style(a,r[a],n)})}:function(t,e,n){for(var i in e)t.style(i,e[i],n);return t})(this,t,null==e?"":e)}},function(t,e,n){"use strict";function i(){}function r(t,e){var n=new i;if(t instanceof i)t.each(function(t,e){n.set(e,t)});else if(Array.isArray(t)){var r,o=-1,a=t.length;if(null==e)for(;++o<a;)n.set(o,t[o]);else for(;++o<a;)n.set(e(r=t[o],o,t),r)}else if(t)for(var s in t)n.set(s,t[s]);return n}i.prototype=r.prototype={constructor:i,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,e){return this["$"+t]=e,this},remove:function(t){var e="$"+t;return e in this&&delete this[e]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)"$"===e[0]&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)"$"===e[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var e in this)"$"===e[0]&&t(this[e],e.slice(1),this)}};var o=r,a=function(){var t,e,n,i=[],r=[];function a(n,r,s,c){if(r>=i.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var l,u,h,d=-1,f=n.length,p=i[r++],m=o(),g=s();++d<f;)(h=m.get(l=p(u=n[d])+""))?h.push(u):m.set(l,[u]);return m.each(function(t,e){c(g,e,a(t,r,s,c))}),g}return n={object:function(t){return a(t,0,s,c)},map:function(t){return a(t,0,l,u)},entries:function(t){return function t(n,o){if(++o>i.length)return n;var a,s=r[o-1];return null!=e&&o>=i.length?a=n.entries():(a=[],n.each(function(e,n){a.push({key:n,values:t(e,o)})})),null!=s?a.sort(function(t,e){return s(t.key,e.key)}):a}(a(t,0,l,u),0)},key:function(t){return i.push(t),n},sortKeys:function(t){return r[i.length-1]=t,n},sortValues:function(e){return t=e,n},rollup:function(t){return e=t,n}}};function s(){return{}}function c(t,e,n){t[e]=n}function l(){return o()}function u(t,e,n){t.set(e,n)}function h(){}var d=o.prototype;function f(t,e){var n=new h;if(t instanceof h)t.each(function(t){n.add(t)});else if(t){var i=-1,r=t.length;if(null==e)for(;++i<r;)n.add(t[i]);else for(;++i<r;)n.add(e(t[i],i,t))}return n}h.prototype=f.prototype={constructor:h,has:d.has,add:function(t){return this["$"+(t+="")]=t,this},remove:d.remove,clear:d.clear,values:d.keys,size:d.size,empty:d.empty,each:d.each};var p=f,m=function(t){var e=[];for(var n in t)e.push(n);return e},g=function(t){var e=[];for(var n in t)e.push(t[n]);return e},_=function(t){var e=[];for(var n in t)e.push({key:n,value:t[n]});return e};n.d(e,"d",function(){return a}),n.d(e,"e",function(){return p}),n.d(e,"c",function(){return o}),n.d(e,"b",function(){return m}),n.d(e,"f",function(){return g}),n.d(e,"a",function(){return _})},function(t,e){var n,i,r=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(t){i=a}}();var c,l=[],u=!1,h=-1;function d(){u&&c&&(u=!1,c.length?l=c.concat(l):h=-1,l.length&&f())}function f(){if(!u){var t=s(d);u=!0;for(var e=l.length;e;){for(c=l,l=[];++h<e;)c&&c[h].run();h=-1,e=l.length}c=null,u=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function m(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new p(t,e)),1!==l.length||u||s(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=m,r.addListener=m,r.once=m,r.off=m,r.removeListener=m,r.removeAllListeners=m,r.emit=m,r.prependListener=m,r.prependOnceListener=m,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9),r=n(16),o=n(14),a=n(37),s=n(21),c=n(13),l=function(){function t(t){void 0===t&&(t={}),this._disposed=!1,this._parent=null,this._fitPolicy=t.fitPolicy||"set-min-size"}return t.prototype.dispose=function(){this._parent=null,this._disposed=!0,s.Signal.clearData(this),a.AttachedProperty.clearData(this)},Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},set:function(t){if(this._parent!==t){if(this._parent)throw new Error("Cannot change parent widget.");if(t.layout!==this)throw new Error("Invalid parent widget.");this._parent=t,this.init()}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fitPolicy",{get:function(){return this._fitPolicy},set:function(t){if(this._fitPolicy!==t&&(this._fitPolicy=t,this._parent)){var e=this._parent.node.style;e.minWidth="",e.minHeight="",e.maxWidth="",e.maxHeight="",this._parent.fit()}},enumerable:!0,configurable:!0}),t.prototype.processParentMessage=function(t){switch(t.type){case"resize":this.onResize(t);break;case"update-request":this.onUpdateRequest(t);break;case"fit-request":this.onFitRequest(t);break;case"before-show":this.onBeforeShow(t);break;case"after-show":this.onAfterShow(t);break;case"before-hide":this.onBeforeHide(t);break;case"after-hide":this.onAfterHide(t);break;case"before-attach":this.onBeforeAttach(t);break;case"after-attach":this.onAfterAttach(t);break;case"before-detach":this.onBeforeDetach(t);break;case"after-detach":this.onAfterDetach(t);break;case"child-removed":this.onChildRemoved(t);break;case"child-shown":this.onChildShown(t);break;case"child-hidden":this.onChildHidden(t)}},t.prototype.init=function(){var t=this;i.each(this,function(e){e.parent=t.parent})},t.prototype.onResize=function(t){i.each(this,function(t){o.MessageLoop.sendMessage(t,c.Widget.ResizeMessage.UnknownSize)})},t.prototype.onUpdateRequest=function(t){i.each(this,function(t){o.MessageLoop.sendMessage(t,c.Widget.ResizeMessage.UnknownSize)})},t.prototype.onBeforeAttach=function(t){i.each(this,function(e){o.MessageLoop.sendMessage(e,t)})},t.prototype.onAfterAttach=function(t){i.each(this,function(e){o.MessageLoop.sendMessage(e,t)})},t.prototype.onBeforeDetach=function(t){i.each(this,function(e){o.MessageLoop.sendMessage(e,t)})},t.prototype.onAfterDetach=function(t){i.each(this,function(e){o.MessageLoop.sendMessage(e,t)})},t.prototype.onBeforeShow=function(t){i.each(this,function(e){e.isHidden||o.MessageLoop.sendMessage(e,t)})},t.prototype.onAfterShow=function(t){i.each(this,function(e){e.isHidden||o.MessageLoop.sendMessage(e,t)})},t.prototype.onBeforeHide=function(t){i.each(this,function(e){e.isHidden||o.MessageLoop.sendMessage(e,t)})},t.prototype.onAfterHide=function(t){i.each(this,function(e){e.isHidden||o.MessageLoop.sendMessage(e,t)})},t.prototype.onChildRemoved=function(t){this.removeWidget(t.child)},t.prototype.onFitRequest=function(t){},t.prototype.onChildShown=function(t){},t.prototype.onChildHidden=function(t){},t}();e.Layout=l,function(t){t.getHorizontalAlignment=function(t){return u.horizontalAlignmentProperty.get(t)},t.setHorizontalAlignment=function(t,e){u.horizontalAlignmentProperty.set(t,e)},t.getVerticalAlignment=function(t){return u.verticalAlignmentProperty.get(t)},t.setVerticalAlignment=function(t,e){u.verticalAlignmentProperty.set(t,e)}}(l=e.Layout||(e.Layout={})),e.Layout=l;var u,h=function(){function t(t){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=t,this.widget.node.style.position="absolute"}return t.prototype.dispose=function(){if(!this._disposed){this._disposed=!0;var t=this.widget.node.style;t.position="",t.top="",t.left="",t.width="",t.height=""}},Object.defineProperty(t.prototype,"minWidth",{get:function(){return this._minWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minHeight",{get:function(){return this._minHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxWidth",{get:function(){return this._maxWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxHeight",{get:function(){return this._maxHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isHidden",{get:function(){return this.widget.isHidden},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this.widget.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAttached",{get:function(){return this.widget.isAttached},enumerable:!0,configurable:!0}),t.prototype.fit=function(){var t=r.ElementExt.sizeLimits(this.widget.node);this._minWidth=t.minWidth,this._minHeight=t.minHeight,this._maxWidth=t.maxWidth,this._maxHeight=t.maxHeight},t.prototype.update=function(t,e,n,i){var r=Math.max(this._minWidth,Math.min(n,this._maxWidth)),a=Math.max(this._minHeight,Math.min(i,this._maxHeight));if(r<n)switch(l.getHorizontalAlignment(this.widget)){case"left":break;case"center":t+=(n-r)/2;break;case"right":t+=n-r;break;default:throw"unreachable"}if(a<i)switch(l.getVerticalAlignment(this.widget)){case"top":break;case"center":e+=(i-a)/2;break;case"bottom":e+=i-a;break;default:throw"unreachable"}var s=!1,u=this.widget.node.style;if(this._top!==e&&(this._top=e,u.top=e+"px"),this._left!==t&&(this._left=t,u.left=t+"px"),this._width!==r&&(s=!0,this._width=r,u.width=r+"px"),this._height!==a&&(s=!0,this._height=a,u.height=a+"px"),s){var h=new c.Widget.ResizeMessage(r,a);o.MessageLoop.sendMessage(this.widget,h)}},t}();e.LayoutItem=h,function(t){function e(t){t.parent&&t.parent.layout&&t.parent.update()}t.horizontalAlignmentProperty=new a.AttachedProperty({name:"horizontalAlignment",create:function(){return"center"},changed:e}),t.verticalAlignmentProperty=new a.AttachedProperty({name:"verticalAlignment",create:function(){return"top"},changed:e})}(u||(u={}))},function(t,e,n){var i=n(5).Buffer,r=n(69).Transform,o=n(73).StringDecoder;function a(t){r.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}n(4)(a,r),a.prototype.update=function(t,e,n){"string"==typeof t&&(t=i.from(t,e));var r=this._update(t);return this.hashMode?this:(n&&(r=this._toString(r,n)),r)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(t,e,n){var i;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){i=t}finally{n(i)}},a.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},a.prototype._finalOrDigest=function(t){var e=this.__final()||i.alloc(0);return t&&(e=this._toString(e,t,!0)),e},a.prototype._toString=function(t,e,n){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var i=this._decoder.write(t);return n&&(i+=this._decoder.end()),i},t.exports=a},function(t,e,n){"use strict";var i=n(54),r=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=h;var o=n(44);o.inherits=n(4);var a=n(96),s=n(72);o.inherits(h,a);for(var c=r(s.prototype),l=0;l<c.length;l++){var u=c[l];h.prototype[u]||(h.prototype[u]=s.prototype[u])}function h(t){if(!(this instanceof h))return new h(t);a.call(this,t),s.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",d)}function d(){this.allowHalfOpen||this._writableState.ended||i.nextTick(f,this)}function f(t){t.end()}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(h.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),h.prototype._destroy=function(t,e){this.push(null),this.end(),i.nextTick(e,t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(t){this._pid=i.nextPID(),this.name=t.name,this._create=t.create,this._coerce=t.coerce||null,this._compare=t.compare||null,this._changed=t.changed||null}return t.prototype.get=function(t){var e=i.ensureMap(t);return this._pid in e?e[this._pid]:e[this._pid]=this._createValue(t)},t.prototype.set=function(t,e){var n,r=i.ensureMap(t);n=this._pid in r?r[this._pid]:r[this._pid]=this._createValue(t);var o=this._coerceValue(t,e);this._maybeNotify(t,n,r[this._pid]=o)},t.prototype.coerce=function(t){var e,n=i.ensureMap(t);e=this._pid in n?n[this._pid]:n[this._pid]=this._createValue(t);var r=this._coerceValue(t,e);this._maybeNotify(t,e,n[this._pid]=r)},t.prototype._createValue=function(t){return(0,this._create)(t)},t.prototype._coerceValue=function(t,e){var n=this._coerce;return n?n(t,e):e},t.prototype._compareValue=function(t,e){var n=this._compare;return n?n(t,e):t===e},t.prototype._maybeNotify=function(t,e,n){var i=this._changed;i&&!this._compareValue(e,n)&&i(t,e,n)},t}();e.AttachedProperty=r,function(t){t.clearData=function(t){i.ownerData.delete(t)}}(r=e.AttachedProperty||(e.AttachedProperty={})),e.AttachedProperty=r,function(t){var e;t.ownerData=new WeakMap,t.nextPID=(e=0,function(){return"pid-"+(""+Math.random()).slice(2)+"-"+e++}),t.ensureMap=function(e){var n=t.ownerData.get(e);return n||(n=Object.create(null),t.ownerData.set(e,n),n)}}(i||(i={}))},function(t,e,n){"use strict";(function(e,i){var r=65536,o=4294967295;var a=n(5).Buffer,s=e.crypto||e.msCrypto;s&&s.getRandomValues?t.exports=function(t,e){if(t>o)throw new RangeError("requested too many random bytes");var n=a.allocUnsafe(t);if(t>0)if(t>r)for(var c=0;c<t;c+=r)s.getRandomValues(n.slice(c,c+r));else s.getRandomValues(n);if("function"==typeof e)return i.nextTick(function(){e(null,n)});return n}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,n(25),n(33))},function(t,e,n){var i=n(5).Buffer;function r(t,e){this._block=i.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}r.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=i.from(t,e));for(var n=this._block,r=this._blockSize,o=t.length,a=this._len,s=0;s<o;){for(var c=a%r,l=Math.min(o-s,r-c),u=0;u<l;u++)n[c+u]=t[s+u];s+=l,(a+=l)%r==0&&this._update(n)}return this._len+=o,this},r.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var i=(4294967295&n)>>>0,r=(n-i)/4294967296;this._block.writeUInt32BE(r,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=r},function(t,e,n){"use strict";var i=n(3);function r(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function o(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function a(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function s(t){var e=t.dateTime,n=t.date,s=t.time,c=t.periods,l=t.days,u=t.shortDays,h=t.months,d=t.shortMonths,p=b(c),m=y(c),g=b(l),_=y(l),v=b(u),Mt=y(u),Et=b(h),St=y(h),At=b(d),Tt=y(d),kt={a:function(t){return u[t.getDay()]},A:function(t){return l[t.getDay()]},b:function(t){return d[t.getMonth()]},B:function(t){return h[t.getMonth()]},c:null,d:U,e:U,f:W,H:F,I:H,j:q,L:G,m:V,M:X,p:function(t){return c[+(t.getHours()>=12)]},Q:xt,s:wt,S:Y,u:K,U:Z,V:J,w:Q,W:$,x:null,X:null,y:tt,Y:et,Z:nt,"%":yt},Pt={a:function(t){return u[t.getUTCDay()]},A:function(t){return l[t.getUTCDay()]},b:function(t){return d[t.getUTCMonth()]},B:function(t){return h[t.getUTCMonth()]},c:null,d:it,e:it,f:ct,H:rt,I:ot,j:at,L:st,m:lt,M:ut,p:function(t){return c[+(t.getUTCHours()>=12)]},Q:xt,s:wt,S:ht,u:dt,U:ft,V:pt,w:mt,W:gt,x:null,X:null,y:_t,Y:vt,Z:bt,"%":yt},Lt={a:function(t,e,n){var i=v.exec(e.slice(n));return i?(t.w=Mt[i[0].toLowerCase()],n+i[0].length):-1},A:function(t,e,n){var i=g.exec(e.slice(n));return i?(t.w=_[i[0].toLowerCase()],n+i[0].length):-1},b:function(t,e,n){var i=At.exec(e.slice(n));return i?(t.m=Tt[i[0].toLowerCase()],n+i[0].length):-1},B:function(t,e,n){var i=Et.exec(e.slice(n));return i?(t.m=St[i[0].toLowerCase()],n+i[0].length):-1},c:function(t,n,i){return Rt(t,e,n,i)},d:L,e:L,f:B,H:C,I:C,j:O,L:z,m:P,M:R,p:function(t,e,n){var i=p.exec(e.slice(n));return i?(t.p=m[i[0].toLowerCase()],n+i[0].length):-1},Q:D,s:j,S:I,u:w,U:M,V:E,w:x,W:S,x:function(t,e,i){return Rt(t,n,e,i)},X:function(t,e,n){return Rt(t,s,e,n)},y:T,Y:A,Z:k,"%":N};function Ot(t,e){return function(n){var i,r,o,a=[],s=-1,c=0,l=t.length;for(n instanceof Date||(n=new Date(+n));++s<l;)37===t.charCodeAt(s)&&(a.push(t.slice(c,s)),null!=(r=f[i=t.charAt(++s)])?i=t.charAt(++s):r="e"===i?" ":"0",(o=e[i])&&(i=o(n,r)),a.push(i),c=s+1);return a.push(t.slice(c,s)),a.join("")}}function Ct(t,e){return function(n){var r,s,c=a(1900);if(Rt(c,t,n+="",0)!=n.length)return null;if("Q"in c)return new Date(c.Q);if("p"in c&&(c.H=c.H%12+12*c.p),"V"in c){if(c.V<1||c.V>53)return null;"w"in c||(c.w=1),"Z"in c?(s=(r=o(a(c.y))).getUTCDay(),r=s>4||0===s?i.P.ceil(r):Object(i.P)(r),r=i.F.offset(r,7*(c.V-1)),c.y=r.getUTCFullYear(),c.m=r.getUTCMonth(),c.d=r.getUTCDate()+(c.w+6)%7):(s=(r=e(a(c.y))).getDay(),r=s>4||0===s?i.l.ceil(r):Object(i.l)(r),r=i.a.offset(r,7*(c.V-1)),c.y=r.getFullYear(),c.m=r.getMonth(),c.d=r.getDate()+(c.w+6)%7)}else("W"in c||"U"in c)&&("w"in c||(c.w="u"in c?c.u%7:"W"in c?1:0),s="Z"in c?o(a(c.y)).getUTCDay():e(a(c.y)).getDay(),c.m=0,c.d="W"in c?(c.w+6)%7+7*c.W-(s+5)%7:c.w+7*c.U-(s+6)%7);return"Z"in c?(c.H+=c.Z/100|0,c.M+=c.Z%100,o(c)):e(c)}}function Rt(t,e,n,i){for(var r,o,a=0,s=e.length,c=n.length;a<s;){if(i>=c)return-1;if(37===(r=e.charCodeAt(a++))){if(r=e.charAt(a++),!(o=Lt[r in f?e.charAt(a++):r])||(i=o(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return kt.x=Ot(n,kt),kt.X=Ot(s,kt),kt.c=Ot(e,kt),Pt.x=Ot(n,Pt),Pt.X=Ot(s,Pt),Pt.c=Ot(e,Pt),{format:function(t){var e=Ot(t+="",kt);return e.toString=function(){return t},e},parse:function(t){var e=Ct(t+="",r);return e.toString=function(){return t},e},utcFormat:function(t){var e=Ot(t+="",Pt);return e.toString=function(){return t},e},utcParse:function(t){var e=Ct(t,o);return e.toString=function(){return t},e}}}var c,l,u,h,d,f={"-":"",_:" ",0:"0"},p=/^\s*\d+/,m=/^%/,g=/[\\^$*+?|[\]().{}]/g;function _(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(e)+r:r)}function v(t){return t.replace(g,"\\$&")}function b(t){return new RegExp("^(?:"+t.map(v).join("|")+")","i")}function y(t){for(var e={},n=-1,i=t.length;++n<i;)e[t[n].toLowerCase()]=n;return e}function x(t,e,n){var i=p.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function w(t,e,n){var i=p.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function M(t,e,n){var i=p.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function E(t,e,n){var i=p.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function S(t,e,n){var i=p.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function A(t,e,n){var i=p.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function T(t,e,n){var i=p.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function k(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function P(t,e,n){var i=p.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function L(t,e,n){var i=p.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function O(t,e,n){var i=p.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function C(t,e,n){var i=p.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function R(t,e,n){var i=p.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function I(t,e,n){var i=p.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function z(t,e,n){var i=p.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function B(t,e,n){var i=p.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function N(t,e,n){var i=m.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function D(t,e,n){var i=p.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function j(t,e,n){var i=p.exec(e.slice(n));return i?(t.Q=1e3*+i[0],n+i[0].length):-1}function U(t,e){return _(t.getDate(),e,2)}function F(t,e){return _(t.getHours(),e,2)}function H(t,e){return _(t.getHours()%12||12,e,2)}function q(t,e){return _(1+i.a.count(Object(i.D)(t),t),e,3)}function G(t,e){return _(t.getMilliseconds(),e,3)}function W(t,e){return G(t,e)+"000"}function V(t,e){return _(t.getMonth()+1,e,2)}function X(t,e){return _(t.getMinutes(),e,2)}function Y(t,e){return _(t.getSeconds(),e,2)}function K(t){var e=t.getDay();return 0===e?7:e}function Z(t,e){return _(i.t.count(Object(i.D)(t),t),e,2)}function J(t,e){var n=t.getDay();return t=n>=4||0===n?Object(i.v)(t):i.v.ceil(t),_(i.v.count(Object(i.D)(t),t)+(4===Object(i.D)(t).getDay()),e,2)}function Q(t){return t.getDay()}function $(t,e){return _(i.l.count(Object(i.D)(t),t),e,2)}function tt(t,e){return _(t.getFullYear()%100,e,2)}function et(t,e){return _(t.getFullYear()%1e4,e,4)}function nt(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+_(e/60|0,"0",2)+_(e%60,"0",2)}function it(t,e){return _(t.getUTCDate(),e,2)}function rt(t,e){return _(t.getUTCHours(),e,2)}function ot(t,e){return _(t.getUTCHours()%12||12,e,2)}function at(t,e){return _(1+i.F.count(Object(i.hb)(t),t),e,3)}function st(t,e){return _(t.getUTCMilliseconds(),e,3)}function ct(t,e){return st(t,e)+"000"}function lt(t,e){return _(t.getUTCMonth()+1,e,2)}function ut(t,e){return _(t.getUTCMinutes(),e,2)}function ht(t,e){return _(t.getUTCSeconds(),e,2)}function dt(t){var e=t.getUTCDay();return 0===e?7:e}function ft(t,e){return _(i.X.count(Object(i.hb)(t),t),e,2)}function pt(t,e){var n=t.getUTCDay();return t=n>=4||0===n?Object(i.Z)(t):i.Z.ceil(t),_(i.Z.count(Object(i.hb)(t),t)+(4===Object(i.hb)(t).getUTCDay()),e,2)}function mt(t){return t.getUTCDay()}function gt(t,e){return _(i.P.count(Object(i.hb)(t),t),e,2)}function _t(t,e){return _(t.getUTCFullYear()%100,e,2)}function vt(t,e){return _(t.getUTCFullYear()%1e4,e,4)}function bt(){return"+0000"}function yt(){return"%"}function xt(t){return+t}function wt(t){return Math.floor(+t/1e3)}function Mt(t){return c=s(t),l=c.format,u=c.parse,h=c.utcFormat,d=c.utcParse,c}Mt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var Et=Date.prototype.toISOString?function(t){return t.toISOString()}:h("%Y-%m-%dT%H:%M:%S.%LZ");var St=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:d("%Y-%m-%dT%H:%M:%S.%LZ");n.d(e,"d",function(){return Mt}),n.d(e,"c",function(){return l}),n.d(e,"f",function(){return u}),n.d(e,"g",function(){return h}),n.d(e,"h",function(){return d}),n.d(e,"e",function(){return s}),n.d(e,"a",function(){return Et}),n.d(e,"b",function(){return St})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1};e.BoxSizer=i,function(t){t.calc=function(t,e){var n=t.length;if(0===n)return e;for(var i=0,r=0,o=0,a=0,s=0,c=0;c<n;++c){var l=(_=t[c]).minSize,u=_.maxSize,h=_.sizeHint;_.done=!1,_.size=Math.max(l,Math.min(h,u)),o+=_.size,i+=l,r+=u,_.stretch>0&&(a+=_.stretch,s++)}if(e===o)return 0;if(e<=i){for(c=0;c<n;++c)(_=t[c]).size=_.minSize;return e-i}if(e>=r){for(c=0;c<n;++c)(_=t[c]).size=_.maxSize;return e-r}var d=n;if(e<o){for(var f=o-e;s>0&&f>.01;){var p=f,m=a;for(c=0;c<n;++c)if(!(_=t[c]).done&&0!==_.stretch){var g=_.stretch*p/m;_.size-g<=_.minSize?(f-=_.size-_.minSize,a-=_.stretch,_.size=_.minSize,_.done=!0,d--,s--):(f-=g,_.size-=g)}}for(;d>0&&f>.01;)for(g=f/d,c=0;c<n;++c)(_=t[c]).done||(_.size-g<=_.minSize?(f-=_.size-_.minSize,_.size=_.minSize,_.done=!0,d--):(f-=g,_.size-=g))}else{for(f=e-o;s>0&&f>.01;)for(p=f,m=a,c=0;c<n;++c)(_=t[c]).done||0===_.stretch||(g=_.stretch*p/m,_.size+g>=_.maxSize?(f-=_.maxSize-_.size,a-=_.stretch,_.size=_.maxSize,_.done=!0,d--,s--):(f-=g,_.size+=g));for(;d>0&&f>.01;)for(g=f/d,c=0;c<n;++c){var _;(_=t[c]).done||(_.size+g>=_.maxSize?(f-=_.maxSize-_.size,_.size=_.maxSize,_.done=!0,d--):(f-=g,_.size+=g))}}return 0},t.adjust=function(t,e,n){0!==t.length&&0!==n&&(n>0?function(t,e,n){for(var i=0,r=0;r<=e;++r){var o=t[r];i+=o.maxSize-o.size}for(var a=0,r=e+1,s=t.length;r<s;++r){var o=t[r];a+=o.size-o.minSize}for(var c=n=Math.min(n,i,a),r=e;r>=0&&c>0;--r){var o=t[r],l=o.maxSize-o.size;l>=c?(o.sizeHint=o.size+c,c=0):(o.sizeHint=o.size+l,c-=l)}for(var u=n,r=e+1,s=t.length;r<s&&u>0;++r){var o=t[r],l=o.size-o.minSize;l>=u?(o.sizeHint=o.size-u,u=0):(o.sizeHint=o.size-l,u-=l)}}(t,e,n):function(t,e,n){for(var i=0,r=e+1,o=t.length;r<o;++r){var a=t[r];i+=a.maxSize-a.size}for(var s=0,r=0;r<=e;++r){var a=t[r];s+=a.size-a.minSize}for(var c=n=Math.min(n,i,s),r=e+1,o=t.length;r<o&&c>0;++r){var a=t[r],l=a.maxSize-a.size;l>=c?(a.sizeHint=a.size+c,c=0):(a.sizeHint=a.size+l,c-=l)}for(var u=n,r=e;r>=0&&u>0;--r){var a=t[r],l=a.size-a.minSize;l>=u?(a.sizeHint=a.size-u,u=0):(a.sizeHint=a.size-l,u-=l)}}(t,e,-n))}}(e.BoxEngine||(e.BoxEngine={}))},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(9),a=n(14),s=n(34),c=n(13),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._widgets=[],e}return r(e,t),e.prototype.dispose=function(){for(;this._widgets.length>0;)this._widgets.pop().dispose();t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return o.iter(this._widgets)},e.prototype.addWidget=function(t){this.insertWidget(this._widgets.length,t)},e.prototype.insertWidget=function(t,e){e.parent=this.parent;var n=this._widgets.indexOf(e),i=Math.max(0,Math.min(t,this._widgets.length));if(-1===n)return o.ArrayExt.insert(this._widgets,i,e),void(this.parent&&this.attachWidget(i,e));i===this._widgets.length&&i--,n!==i&&(o.ArrayExt.move(this._widgets,n,i),this.parent&&this.moveWidget(n,i,e))},e.prototype.removeWidget=function(t){this.removeWidgetAt(this._widgets.indexOf(t))},e.prototype.removeWidgetAt=function(t){var e=o.ArrayExt.removeAt(this._widgets,t);e&&this.parent&&this.detachWidget(t,e)},e.prototype.init=function(){var e=this;t.prototype.init.call(this),o.each(this,function(t,n){e.attachWidget(n,t)})},e.prototype.attachWidget=function(t,e){var n=this.parent.node.children[t];this.parent.isAttached&&a.MessageLoop.sendMessage(e,c.Widget.Msg.BeforeAttach),this.parent.node.insertBefore(e.node,n),this.parent.isAttached&&a.MessageLoop.sendMessage(e,c.Widget.Msg.AfterAttach)},e.prototype.moveWidget=function(t,e,n){this.parent.isAttached&&a.MessageLoop.sendMessage(n,c.Widget.Msg.BeforeDetach),this.parent.node.removeChild(n.node),this.parent.isAttached&&a.MessageLoop.sendMessage(n,c.Widget.Msg.AfterDetach);var i=this.parent.node.children[e];this.parent.isAttached&&a.MessageLoop.sendMessage(n,c.Widget.Msg.BeforeAttach),this.parent.node.insertBefore(n.node,i),this.parent.isAttached&&a.MessageLoop.sendMessage(n,c.Widget.Msg.AfterAttach)},e.prototype.detachWidget=function(t,e){this.parent.isAttached&&a.MessageLoop.sendMessage(e,c.Widget.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&a.MessageLoop.sendMessage(e,c.Widget.Msg.AfterDetach)},e}(s.Layout);e.PanelLayout=l},function(t,e,n){"use strict";var i=n(4),r=n(68),o=n(74),a=n(75),s=n(35);function c(t){s.call(this,"digest"),this._hash=t}i(c,s),c.prototype._update=function(t){this._hash.update(t)},c.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new r:"rmd160"===t||"ripemd160"===t?new o:new c(a(t))}},function(t,e,n){(function(t){function n(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===n(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===n(t)},e.isObject=function(t){return"object"==typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===n(t)},e.isError=function(t){return"[object Error]"===n(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=t.isBuffer}).call(this,n(15).Buffer)},function(t,e,n){(function(e){t.exports=function(t,n){for(var i=Math.min(t.length,n.length),r=new e(i),o=0;o<i;++o)r[o]=t[o]^n[o];return r}}).call(this,n(15).Buffer)},function(t,e,n){"use strict";var i=n(30),r=n(22);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=o,o.prototype.update=function(t,e){if(t=i.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=i.join32(t,0,t.length-n,this.endian);for(var r=0;r<t.length;r+=this._delta32)this._update(t,r,r+this._delta32)}return this},o.prototype.digest=function(t){return this.update(this._pad()),r(null===this.pending),this._digest(t)},o.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,n=e-(t+this.padLength)%e,i=new Array(n+this.padLength);i[0]=128;for(var r=1;r<n;r++)i[r]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)i[r++]=0;i[r++]=0,i[r++]=0,i[r++]=0,i[r++]=0,i[r++]=t>>>24&255,i[r++]=t>>>16&255,i[r++]=t>>>8&255,i[r++]=255&t}else for(i[r++]=255&t,i[r++]=t>>>8&255,i[r++]=t>>>16&255,i[r++]=t>>>24&255,i[r++]=0,i[r++]=0,i[r++]=0,i[r++]=0,o=8;o<this.padLength;o++)i[r++]=0;return i}},function(t,e,n){var i=e;i.bignum=n(11),i.define=n(246).define,i.base=n(48),i.constants=n(122),i.decoders=n(251),i.encoders=n(253)},function(t,e,n){var i=e;i.Reporter=n(248).Reporter,i.DecoderBuffer=n(121).DecoderBuffer,i.EncoderBuffer=n(121).EncoderBuffer,i.Node=n(249)},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=n(61),a=n(17).convert_dates,s=n(10);class c extends o.Interaction{initialize(t){this.setElement(document.createElementNS(r.namespaces.svg,"g")),this.d3el=r.select(this.el),s.WidgetView.prototype.initialize.call(this,t)}render(){this.parent=this.options.parent,this.width=this.parent.width-this.parent.margin.left-this.parent.margin.right,this.height=this.parent.height-this.parent.margin.top-this.parent.margin.bottom,this.mark_views_promise=this.populate_mark_views()}create_listeners(){this.parent.on("margin_updated",this.relayout,this),this.listenTo(this.model,"change:selected",this.selected_changed),this.listenTo(this.model,"change:marks",this.marks_changed),this.listenTo(this.model,"msg:custom",this.handle_custom_messages)}relayout(){this.height=this.parent.height-this.parent.margin.top-this.parent.margin.bottom,this.width=this.parent.width-this.parent.margin.left-this.parent.margin.right}async populate_mark_views(){const t=this.parent,e=this.model.get("marks").map(t=>t.model_id),n=await Promise.all(t.mark_views.views),i=t.mark_views._models.map(t=>t.model_id),r=e.map(t=>i.indexOf(t));this.mark_views=r.map(t=>n[t])}marks_changed(){this.populate_mark_views().then(()=>this.selected_changed())}handle_custom_messages(t){"reset"===t.type&&this.reset()}set_selected(t,e){this.model.set(t,a(e))}}e.BaseSelector=c;e.BaseXSelector=class extends c{create_scales(){if(this.scale&&this.scale.remove(),this.model.get("scale")){const t=this;return this.create_child_view(this.model.get("scale")).then(function(e){return t.scale=e,t.update_scale_domain(!0),t.set_range([t.scale]),t.scale.on("domain_changed",t.update_scale_domain,t),e})}}update_scale_domain(t=!1){const e="vertical"==this.model.get("orientation")?"y":"x",n=this.parent.padded_range(e,this.scale.model),i=this.parent.range(e);this.scale.expand_domain(n,i)}set_range(t){const e="vertical"==this.model.get("orientation")?"y":"x";for(let n=0;n<t.length;n++)t[n].set_range(this.parent.range(e))}};e.BaseXYSelector=class extends c{create_scales(){const t=this;this.x_scale&&this.x_scale.remove(),this.y_scale&&this.y_scale.remove();const e=[];return this.model.get("x_scale")&&e.push(this.create_child_view(this.model.get("x_scale")).then(function(e){return t.x_scale=e,t.update_xscale_domain(),t.set_x_range([t.x_scale]),t.x_scale.on("domain_changed",t.update_xscale_domain,t),e})),this.model.get("y_scale")&&e.push(this.create_child_view(this.model.get("y_scale")).then(function(e){return t.y_scale=e,t.update_yscale_domain(),t.set_y_range([t.y_scale]),t.y_scale.on("domain_changed",t.update_yscale_domain,t),e})),Promise.all(e)}set_x_range(t){for(let e=0;e<t.length;e++)t[e].set_range(this.parent.range("x"))}set_y_range(t){for(var e=0;e<t.length;e++)t[e].set_range(this.parent.range("y"))}update_xscale_domain(){const t=this.parent.padded_range("x",this.x_scale.model),e=this.parent.range("x");this.x_scale.expand_domain(t,e)}update_yscale_domain(){const t=this.parent.padded_range("y",this.y_scale.model),e=this.parent.range("y");this.y_scale.expand_domain(t,e)}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(10));e.Scale=class extends r.WidgetView{render(){this.offset=0}create_event_listeners(){this.listenTo(this.model,"domain_changed",this.model_domain_changed),this.listenTo(this.model,"highlight_axis",this.highlight_axis),this.listenTo(this.model,"unhighlight_axis",this.unhighlight_axis)}set_range(t,e){this.scale.range(t)}compute_and_set_domain(t,e){this.model.compute_and_set_domain(t,e)}set_domain(t,e){this.model.set_domain(t,e)}model_domain_changed(){this.scale.domain(this.model.domain),this.trigger("domain_changed")}highlight_axis(){this.trigger("highlight_axis")}unhighlight_axis(){this.trigger("unhighlight_axis")}expand_domain(t,e){}}},function(t,e,n){(function(t){var i=void 0!==t&&t||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(r.call(setTimeout,i,arguments),clearTimeout)},e.setInterval=function(){return new o(r.call(setInterval,i,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(i,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(155),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(25))},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o,a=n(42),s=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.addClass("p-Panel"),n.layout=o.createLayout(e),n}return r(e,t),Object.defineProperty(e.prototype,"widgets",{get:function(){return this.layout.widgets},enumerable:!0,configurable:!0}),e.prototype.addWidget=function(t){this.layout.addWidget(t)},e.prototype.insertWidget=function(t,e){this.layout.insertWidget(t,e)},e}(n(13).Widget);e.Panel=s,function(t){t.createLayout=function(t){return t.layout||new a.PanelLayout}}(o||(o={}))},function(t,e,n){"use strict";function i(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),i(n(178)),i(n(179)),i(n(180)),i(n(93)),i(n(264)),i(n(265))},function(t,e,n){"use strict";(function(e){!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,n,i,r){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,n)});case 3:return e.nextTick(function(){t.call(null,n,i)});case 4:return e.nextTick(function(){t.call(null,n,i,r)});default:for(o=new Array(s-1),a=0;a<o.length;)o[a++]=arguments[a];return e.nextTick(function(){t.apply(null,o)})}}}:t.exports=e}).call(this,n(33))},function(t,e,n){var i=n(5).Buffer;function r(t){i.isBuffer(t)||(t=i.from(t));for(var e=t.length/4|0,n=new Array(e),r=0;r<e;r++)n[r]=t.readUInt32BE(4*r);return n}function o(t){for(;0<t.length;t++)t[0]=0}function a(t,e,n,i,r){for(var o,a,s,c,l=n[0],u=n[1],h=n[2],d=n[3],f=t[0]^e[0],p=t[1]^e[1],m=t[2]^e[2],g=t[3]^e[3],_=4,v=1;v<r;v++)o=l[f>>>24]^u[p>>>16&255]^h[m>>>8&255]^d[255&g]^e[_++],a=l[p>>>24]^u[m>>>16&255]^h[g>>>8&255]^d[255&f]^e[_++],s=l[m>>>24]^u[g>>>16&255]^h[f>>>8&255]^d[255&p]^e[_++],c=l[g>>>24]^u[f>>>16&255]^h[p>>>8&255]^d[255&m]^e[_++],f=o,p=a,m=s,g=c;return o=(i[f>>>24]<<24|i[p>>>16&255]<<16|i[m>>>8&255]<<8|i[255&g])^e[_++],a=(i[p>>>24]<<24|i[m>>>16&255]<<16|i[g>>>8&255]<<8|i[255&f])^e[_++],s=(i[m>>>24]<<24|i[g>>>16&255]<<16|i[f>>>8&255]<<8|i[255&p])^e[_++],c=(i[g>>>24]<<24|i[f>>>16&255]<<16|i[p>>>8&255]<<8|i[255&m])^e[_++],[o>>>=0,a>>>=0,s>>>=0,c>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var n=[],i=[],r=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,c=0;c<256;++c){var l=s^s<<1^s<<2^s<<3^s<<4;l=l>>>8^255&l^99,n[a]=l,i[l]=a;var u=t[a],h=t[u],d=t[h],f=257*t[l]^16843008*l;r[0][a]=f<<24|f>>>8,r[1][a]=f<<16|f>>>16,r[2][a]=f<<8|f>>>24,r[3][a]=f,f=16843009*d^65537*h^257*u^16843008*a,o[0][l]=f<<24|f>>>8,o[1][l]=f<<16|f>>>16,o[2][l]=f<<8|f>>>24,o[3][l]=f,0===a?a=s=1:(a=u^t[t[t[d^u]]],s^=t[t[s]])}return{SBOX:n,INV_SBOX:i,SUB_MIX:r,INV_SUB_MIX:o}}();function l(t){this._key=r(t),this._reset()}l.blockSize=16,l.keySize=32,l.prototype.blockSize=l.blockSize,l.prototype.keySize=l.keySize,l.prototype._reset=function(){for(var t=this._key,e=t.length,n=e+6,i=4*(n+1),r=[],o=0;o<e;o++)r[o]=t[o];for(o=e;o<i;o++){var a=r[o-1];o%e==0?(a=a<<8|a>>>24,a=c.SBOX[a>>>24]<<24|c.SBOX[a>>>16&255]<<16|c.SBOX[a>>>8&255]<<8|c.SBOX[255&a],a^=s[o/e|0]<<24):e>6&&o%e==4&&(a=c.SBOX[a>>>24]<<24|c.SBOX[a>>>16&255]<<16|c.SBOX[a>>>8&255]<<8|c.SBOX[255&a]),r[o]=r[o-e]^a}for(var l=[],u=0;u<i;u++){var h=i-u,d=r[h-(u%4?0:4)];l[u]=u<4||h<=4?d:c.INV_SUB_MIX[0][c.SBOX[d>>>24]]^c.INV_SUB_MIX[1][c.SBOX[d>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[d>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&d]]}this._nRounds=n,this._keySchedule=r,this._invKeySchedule=l},l.prototype.encryptBlockRaw=function(t){return a(t=r(t),this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},l.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),n=i.allocUnsafe(16);return n.writeUInt32BE(e[0],0),n.writeUInt32BE(e[1],4),n.writeUInt32BE(e[2],8),n.writeUInt32BE(e[3],12),n},l.prototype.decryptBlock=function(t){var e=(t=r(t))[1];t[1]=t[3],t[3]=e;var n=a(t,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),o=i.allocUnsafe(16);return o.writeUInt32BE(n[0],0),o.writeUInt32BE(n[3],4),o.writeUInt32BE(n[2],8),o.writeUInt32BE(n[1],12),o},l.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=l},function(t,e,n){var i=n(5).Buffer,r=n(68);t.exports=function(t,e,n,o){if(i.isBuffer(t)||(t=i.from(t,"binary")),e&&(i.isBuffer(e)||(e=i.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=n/8,s=i.alloc(a),c=i.alloc(o||0),l=i.alloc(0);a>0||o>0;){var u=new r;u.update(l),u.update(t),e&&u.update(e),l=u.digest();var h=0;if(a>0){var d=s.length-a;h=Math.min(a,l.length),l.copy(s,d,0,h),a-=h}if(h<l.length&&o>0){var f=c.length-o,p=Math.min(o,l.length-h);l.copy(c,f,h,h+p),o-=p}}return l.fill(0),{key:s,iv:c}}},function(t,e,n){"use strict";var i=e;i.base=n(226),i.short=n(227),i.mont=n(228),i.edwards=n(229)},function(t,e,n){var i=n(245),r=n(256),o=n(257),a=n(77),s=n(105),c=n(5).Buffer;function l(t){var e;"object"!=typeof t||c.isBuffer(t)||(e=t.passphrase,t=t.key),"string"==typeof t&&(t=c.from(t));var n,l,u=o(t,e),h=u.tag,d=u.data;switch(h){case"CERTIFICATE":l=i.certificate.decode(d,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(l||(l=i.PublicKey.decode(d,"der")),n=l.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPublicKey.decode(l.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return l.subjectPrivateKey=l.subjectPublicKey,{type:"ec",data:l};case"1.2.840.10040.4.1":return l.algorithm.params.pub_key=i.DSAparam.decode(l.subjectPublicKey.data,"der"),{type:"dsa",data:l.algorithm.params};default:throw new Error("unknown key id "+n)}throw new Error("unknown key type "+h);case"ENCRYPTED PRIVATE KEY":d=function(t,e){var n=t.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=r[t.algorithm.decrypt.cipher.algo.join(".")],l=t.algorithm.decrypt.cipher.iv,u=t.subjectPrivateKey,h=parseInt(o.split("-")[1],10)/8,d=s.pbkdf2Sync(e,n,i,h,"sha1"),f=a.createDecipheriv(o,d,l),p=[];return p.push(f.update(u)),p.push(f.final()),c.concat(p)}(d=i.EncryptedPrivateKey.decode(d,"der"),e);case"PRIVATE KEY":switch(n=(l=i.PrivateKey.decode(d,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPrivateKey.decode(l.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:l.algorithm.curve,privateKey:i.ECPrivateKey.decode(l.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return l.algorithm.params.priv_key=i.DSAparam.decode(l.subjectPrivateKey,"der"),{type:"dsa",params:l.algorithm.params};default:throw new Error("unknown key id "+n)}throw new Error("unknown key type "+h);case"RSA PUBLIC KEY":return i.RSAPublicKey.decode(d,"der");case"RSA PRIVATE KEY":return i.RSAPrivateKey.decode(d,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:i.DSAPrivateKey.decode(d,"der")};case"EC PRIVATE KEY":return{curve:(d=i.ECPrivateKey.decode(d,"der")).parameters.value,privateKey:d.privateKey};default:throw new Error("unknown key type "+h)}}t.exports=l,l.signature=i.signature},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9),r=function(t){this.type="text",this.content=t};e.VirtualText=r;var o,a=function(t,e,n){this.type="element",this.tag=t,this.attrs=e,this.children=n};function s(t){for(var e={},n=[],i=1,o=arguments.length;i<o;++i){var s=arguments[i];"string"==typeof s?n.push(new r(s)):s instanceof r?n.push(s):s instanceof a?n.push(s):s instanceof Array?c(n,s):1===i&&s&&"object"==typeof s&&(e=s)}return new a(t,e,n);function c(t,e){for(var n=0,i=e;n<i.length;n++){var o=i[n];"string"==typeof o?t.push(new r(o)):o instanceof r?t.push(o):o instanceof a&&t.push(o)}}}e.VirtualElement=a,e.h=s,function(t){t.a=t.bind(void 0,"a"),t.abbr=t.bind(void 0,"abbr"),t.address=t.bind(void 0,"address"),t.area=t.bind(void 0,"area"),t.article=t.bind(void 0,"article"),t.aside=t.bind(void 0,"aside"),t.audio=t.bind(void 0,"audio"),t.b=t.bind(void 0,"b"),t.bdi=t.bind(void 0,"bdi"),t.bdo=t.bind(void 0,"bdo"),t.blockquote=t.bind(void 0,"blockquote"),t.br=t.bind(void 0,"br"),t.button=t.bind(void 0,"button"),t.canvas=t.bind(void 0,"canvas"),t.caption=t.bind(void 0,"caption"),t.cite=t.bind(void 0,"cite"),t.code=t.bind(void 0,"code"),t.col=t.bind(void 0,"col"),t.colgroup=t.bind(void 0,"colgroup"),t.data=t.bind(void 0,"data"),t.datalist=t.bind(void 0,"datalist"),t.dd=t.bind(void 0,"dd"),t.del=t.bind(void 0,"del"),t.dfn=t.bind(void 0,"dfn"),t.div=t.bind(void 0,"div"),t.dl=t.bind(void 0,"dl"),t.dt=t.bind(void 0,"dt"),t.em=t.bind(void 0,"em"),t.embed=t.bind(void 0,"embed"),t.fieldset=t.bind(void 0,"fieldset"),t.figcaption=t.bind(void 0,"figcaption"),t.figure=t.bind(void 0,"figure"),t.footer=t.bind(void 0,"footer"),t.form=t.bind(void 0,"form"),t.h1=t.bind(void 0,"h1"),t.h2=t.bind(void 0,"h2"),t.h3=t.bind(void 0,"h3"),t.h4=t.bind(void 0,"h4"),t.h5=t.bind(void 0,"h5"),t.h6=t.bind(void 0,"h6"),t.header=t.bind(void 0,"header"),t.hr=t.bind(void 0,"hr"),t.i=t.bind(void 0,"i"),t.iframe=t.bind(void 0,"iframe"),t.img=t.bind(void 0,"img"),t.input=t.bind(void 0,"input"),t.ins=t.bind(void 0,"ins"),t.kbd=t.bind(void 0,"kbd"),t.label=t.bind(void 0,"label"),t.legend=t.bind(void 0,"legend"),t.li=t.bind(void 0,"li"),t.main=t.bind(void 0,"main"),t.map=t.bind(void 0,"map"),t.mark=t.bind(void 0,"mark"),t.meter=t.bind(void 0,"meter"),t.nav=t.bind(void 0,"nav"),t.noscript=t.bind(void 0,"noscript"),t.object=t.bind(void 0,"object"),t.ol=t.bind(void 0,"ol"),t.optgroup=t.bind(void 0,"optgroup"),t.option=t.bind(void 0,"option"),t.output=t.bind(void 0,"output"),t.p=t.bind(void 0,"p"),t.param=t.bind(void 0,"param"),t.pre=t.bind(void 0,"pre"),t.progress=t.bind(void 0,"progress"),t.q=t.bind(void 0,"q"),t.rp=t.bind(void 0,"rp"),t.rt=t.bind(void 0,"rt"),t.ruby=t.bind(void 0,"ruby"),t.s=t.bind(void 0,"s"),t.samp=t.bind(void 0,"samp"),t.section=t.bind(void 0,"section"),t.select=t.bind(void 0,"select"),t.small=t.bind(void 0,"small"),t.source=t.bind(void 0,"source"),t.span=t.bind(void 0,"span"),t.strong=t.bind(void 0,"strong"),t.sub=t.bind(void 0,"sub"),t.summary=t.bind(void 0,"summary"),t.sup=t.bind(void 0,"sup"),t.table=t.bind(void 0,"table"),t.tbody=t.bind(void 0,"tbody"),t.td=t.bind(void 0,"td"),t.textarea=t.bind(void 0,"textarea"),t.tfoot=t.bind(void 0,"tfoot"),t.th=t.bind(void 0,"th"),t.thead=t.bind(void 0,"thead"),t.time=t.bind(void 0,"time"),t.title=t.bind(void 0,"title"),t.tr=t.bind(void 0,"tr"),t.track=t.bind(void 0,"track"),t.u=t.bind(void 0,"u"),t.ul=t.bind(void 0,"ul"),t.var_=t.bind(void 0,"var"),t.video=t.bind(void 0,"video"),t.wbr=t.bind(void 0,"wbr")}(s=e.h||(e.h={})),function(t){t.realize=function(t){return o.createDOMNode(t)},t.render=function(t,e){var n=o.hostMap.get(e)||[],i=o.asContentArray(t);o.hostMap.set(e,i),o.updateContent(e,n,i)}}(e.VirtualDOM||(e.VirtualDOM={})),function(t){function e(t){if("text"===t.type)return document.createTextNode(t.content);var i=document.createElement(t.tag);!function(t,e){for(var i in e)i in n||("on"===i.substr(0,2)?t[i]=e[i]:t.setAttribute(i,e[i]));void 0!==e.className&&t.setAttribute("class",e.className);void 0!==e.htmlFor&&t.setAttribute("for",e.htmlFor);e.dataset&&function(t,e){for(var n in e)t.setAttribute("data-"+n,e[n])}(t,e.dataset);e.style&&function(t,e){var n,i=t.style;for(n in e)i[n]=e[n]}(t,e.style)}(i,t.attrs);for(var r=0,o=t.children.length;r<o;++r)i.appendChild(e(t.children[r]));return i}t.hostMap=new WeakMap,t.asContentArray=function(t){return t?t instanceof Array?t:[t]:[]},t.createDOMNode=e,t.updateContent=function t(n,o,a){if(o!==a){for(var s=function(t,e){for(var n=t.firstChild,i=Object.create(null),r=0,o=e;r<o.length;r++){var a=o[r];"element"===a.type&&a.attrs.key&&(i[a.attrs.key]={vNode:a,element:n}),n=n.nextSibling}return i}(n,o),c=o.slice(),l=n.firstChild,u=a.length,h=0;h<u;++h)if(h>=c.length)n.appendChild(e(a[h]));else{var d=c[h],f=a[h];if(d!==f)if("text"!==d.type||"text"!==f.type)if("text"!==d.type&&"text"!==f.type){var p=f.attrs.key;if(p&&p in s){var m=s[p];m.vNode!==d&&(i.ArrayExt.move(c,c.indexOf(m.vNode,h+1),h),n.insertBefore(m.element,l),d=m.vNode,l=m.element)}if(d!==f){var g=d.attrs.key;g&&g!==p?(i.ArrayExt.insert(c,h,f),n.insertBefore(e(f),l)):d.tag===f.tag?(r(l,d.attrs,f.attrs),t(l,d.children,f.children),l=l.nextSibling):(i.ArrayExt.insert(c,h,f),n.insertBefore(e(f),l))}else l=l.nextSibling}else i.ArrayExt.insert(c,h,f),n.insertBefore(e(f),l);else l.textContent=f.content,l=l.nextSibling;else l=l.nextSibling}for(h=c.length-u;h>0;--h)n.removeChild(n.lastChild)}};var n={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function r(t,e,i){if(e!==i){var r;for(r in e)r in n||r in i||("on"===r.substr(0,2)?t[r]=null:t.removeAttribute(r));for(r in i)r in n||e[r]===i[r]||("on"===r.substr(0,2)?t[r]=i[r]:t.setAttribute(r,i[r]));e.className!==i.className&&(void 0!==i.className?t.setAttribute("class",i.className):t.removeAttribute("class")),e.htmlFor!==i.htmlFor&&(void 0!==i.htmlFor?t.setAttribute("for",i.htmlFor):t.removeAttribute("for")),e.dataset!==i.dataset&&function(t,e,n){for(var i in e)i in n||t.removeAttribute("data-"+i);for(var r in n)e[r]!==n[r]&&t.setAttribute("data-"+r,n[r])}(t,e.dataset||{},i.dataset||{}),e.style!==i.style&&function(t,e,n){var i,r=t.style;for(i in e)i in n||(r[i]="");for(i in n)e[i]!==n[i]&&(r[i]=n[i])}(t,e.style||{},i.style||{})}}}(o||(o={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(81),o=function(){function t(t){var e=this;this._onScrollFrame=function(){if(e._scrollTarget){var t=e._scrollTarget,n=t.element,r=t.edge,o=t.distance,a=i.SCROLL_EDGE_SIZE-o,s=Math.pow(a/i.SCROLL_EDGE_SIZE,2),c=Math.max(1,Math.round(s*i.SCROLL_EDGE_SIZE));switch(r){case"top":n.scrollTop-=c;break;case"left":n.scrollLeft-=c;break;case"right":n.scrollLeft+=c;break;case"bottom":n.scrollTop+=c}requestAnimationFrame(e._onScrollFrame)}},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.mimeData=t.mimeData,this.dragImage=t.dragImage||null,this.proposedAction=t.proposedAction||"copy",this.supportedActions=t.supportedActions||"all",this.source=t.source||null}return t.prototype.dispose=function(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){var t=i.createMouseEvent("mouseup",-1,-1);i.dispatchDragLeave(this,this._currentTarget,null,t)}this._finalize("none")}},Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),t.prototype.start=function(t,e){var n=this;if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(t,e),this._promise=new Promise(function(t,e){n._resolve=t});var r=i.createMouseEvent("mousemove",t,e);return document.dispatchEvent(r),this._promise},t.prototype.handleEvent=function(t){switch(t.type){case"mousemove":this._evtMouseMove(t);break;case"mouseup":this._evtMouseUp(t);break;case"keydown":this._evtKeyDown(t);break;default:t.preventDefault(),t.stopPropagation()}},t.prototype._evtMouseMove=function(t){t.preventDefault(),t.stopPropagation(),this._updateCurrentTarget(t),this._updateDragScroll(t),this._moveDragImage(t.clientX,t.clientY)},t.prototype._evtMouseUp=function(t){if(t.preventDefault(),t.stopPropagation(),0===t.button)if(this._updateCurrentTarget(t),this._currentTarget){if("none"===this._dropAction)return i.dispatchDragLeave(this,this._currentTarget,null,t),void this._finalize("none");var e=i.dispatchDrop(this,this._currentTarget,t);this._finalize(e)}else this._finalize("none")},t.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation(),27===t.keyCode&&this.dispose()},t.prototype._addListeners=function(){document.addEventListener("mousedown",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("mouseenter",this,!0),document.addEventListener("mouseleave",this,!0),document.addEventListener("mouseover",this,!0),document.addEventListener("mouseout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)},t.prototype._removeListeners=function(){document.removeEventListener("mousedown",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("mouseenter",this,!0),document.removeEventListener("mouseleave",this,!0),document.removeEventListener("mouseover",this,!0),document.removeEventListener("mouseout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)},t.prototype._updateDragScroll=function(t){var e=i.findScrollTarget(t);(this._scrollTarget||e)&&(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=e)},t.prototype._updateCurrentTarget=function(t){var e=this._currentTarget,n=this._currentTarget,r=this._currentElement,o=document.elementFromPoint(t.clientX,t.clientY);this._currentElement=o,o!==r&&o!==n&&i.dispatchDragExit(this,n,o,t),o!==r&&o!==n&&(n=i.dispatchDragEnter(this,o,n,t)),n!==e&&(this._currentTarget=n,i.dispatchDragLeave(this,e,n,t));var a=i.dispatchDragOver(this,n,t);this._setDropAction(a)},t.prototype._attachDragImage=function(t,e){if(this.dragImage){this.dragImage.classList.add("p-mod-drag-image");var n=this.dragImage.style;n.pointerEvents="none",n.position="fixed",n.top=e+"px",n.left=t+"px",document.body.appendChild(this.dragImage)}},t.prototype._moveDragImage=function(t,e){if(this.dragImage){var n=this.dragImage.style;n.top=e+"px",n.left=t+"px"}},t.prototype._detachDragImage=function(){if(this.dragImage){var t=this.dragImage.parentNode;t&&t.removeChild(this.dragImage)}},t.prototype._setDropAction=function(e){if(e=i.validateAction(e,this.supportedActions),!this._override||this._dropAction!==e)switch(e){case"none":this._dropAction=e,this._override=t.overrideCursor("no-drop");break;case"copy":this._dropAction=e,this._override=t.overrideCursor("copy");break;case"link":this._dropAction=e,this._override=t.overrideCursor("alias");break;case"move":this._dropAction=e,this._override=t.overrideCursor("move")}},t.prototype._finalize=function(t){var e=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,e&&e(t)},t}();e.Drag=o,function(t){t.overrideCursor=function(t){var n=++e;return document.body.style.cursor=t,document.body.classList.add("p-mod-override-cursor"),new r.DisposableDelegate(function(){n===e&&(document.body.style.cursor="",document.body.classList.remove("p-mod-override-cursor"))})};var e=0}(o=e.Drag||(e.Drag={})),e.Drag=o,function(t){t.SCROLL_EDGE_SIZE=20,t.validateAction=function(t,i){return e[t]&n[i]?t:"none"},t.createMouseEvent=function(t,e,n){var i=document.createEvent("MouseEvent");return i.initMouseEvent(t,!0,!0,window,0,0,0,e,n,!1,!1,!1,!1,0,null),i},t.findScrollTarget=function(e){for(var n=e.clientX,i=e.clientY,r=document.elementFromPoint(n,i);r;r=r.parentElement)if(r.hasAttribute("data-p-dragscroll")){var o=0,a=0;r===document.body&&(o=window.pageXOffset,a=window.pageYOffset);var s=r.getBoundingClientRect(),c=s.top+a,l=s.left+o,u=l+s.width,h=c+s.height;if(!(n<l||n>=u||i<c||i>=h)){var d=n-l+1,f=i-c+1,p=u-n,m=h-i,g=Math.min(d,f,p,m);if(!(g>t.SCROLL_EDGE_SIZE)){var _=void 0;switch(g){case m:_="bottom";break;case f:_="top";break;case p:_="right";break;case d:_="left";break;default:throw"unreachable"}var v=r.scrollWidth-r.clientWidth,b=r.scrollHeight-r.clientHeight,y=void 0;switch(_){case"top":y=b>0&&r.scrollTop>0;break;case"left":y=v>0&&r.scrollLeft>0;break;case"right":y=v>0&&r.scrollLeft<v;break;case"bottom":y=b>0&&r.scrollTop<b;break;default:throw"unreachable"}if(y)return{element:r,edge:_,distance:g}}}}return null},t.dispatchDragEnter=function(t,e,n,r){if(!e)return null;var o=i("p-dragenter",t,r,n);return e.dispatchEvent(o)?e===document.body?n:(o=i("p-dragenter",t,r,n),document.body.dispatchEvent(o),document.body):e},t.dispatchDragExit=function(t,e,n,r){if(e){var o=i("p-dragexit",t,r,n);e.dispatchEvent(o)}},t.dispatchDragLeave=function(t,e,n,r){if(e){var o=i("p-dragleave",t,r,n);e.dispatchEvent(o)}},t.dispatchDragOver=function(t,e,n){if(!e)return"none";var r=i("p-dragover",t,n,null);return e.dispatchEvent(r)?"none":r.dropAction},t.dispatchDrop=function(t,e,n){if(!e)return"none";var r=i("p-drop",t,n,null);return e.dispatchEvent(r)?"none":r.dropAction};var e={none:0,copy:1,link:2,move:4},n={none:e.none,copy:e.copy,link:e.link,move:e.move,"copy-link":e.copy|e.link,"copy-move":e.copy|e.move,"link-move":e.link|e.move,all:e.copy|e.link|e.move};function i(t,e,n,i){var r=document.createEvent("MouseEvent");return r.initMouseEvent(t,!0,!0,window,0,n.screenX,n.screenY,n.clientX,n.clientY,n.ctrlKey,n.altKey,n.shiftKey,n.metaKey,n.button,i),r.dropAction="none",r.mimeData=e.mimeData,r.proposedAction=e.proposedAction,r.supportedActions=e.supportedActions,r.source=e.source,r}}(i||(i={}))},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(10)),o=i(n(2)),a=i(n(6));e.Interaction=class extends r.WidgetView{initialize(t){this.setElement(document.createElementNS(o.namespaces.svg,"rect")),this.d3el=o.select(this.el),super.initialize.call(this,t)}render(){this.parent=this.options.parent,this.d3el.attr("x",0).attr("y",0).attr("width",this.parent.width-this.parent.margin.left-this.parent.margin.right).attr("height",this.parent.height-this.parent.margin.top-this.parent.margin.bottom).attr("pointer-events","all").attr("visibility","hidden"),this.parent.on("margin_updated",this.relayout,this)}relayout(){this.d3el.attr("width",this.parent.width-this.parent.margin.left-this.parent.margin.right).attr("height",this.parent.height-this.parent.margin.top-this.parent.margin.bottom)}remove(){a.each(this.mark_views,function(t){t.invert_range()}),this.d3el.remove(),super.remove.apply(this)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(10),r=n(28);e.ScaleModel=class extends i.WidgetModel{defaults(){return Object.assign({},i.WidgetModel.prototype.defaults(),{_model_name:"ScaleModel",_view_name:"Scale",_model_module:"bqplot",_view_module:"bqplot",_model_module_version:r.semver_range,_view_module_version:r.semver_range,reverse:!1,allow_padding:!0})}initialize(t,e){super.initialize(t,e),this.domains={},this.domain=[],this.set_init_state(),this.set_listeners()}set_init_state(){this.type="base"}set_listeners(){}set_domain(t,e){this.domains[e]=t,this.update_domain()}del_domain(t,e){void 0!==this.domains[e]&&(delete this.domains[e],this.update_domain())}get_domain_slice_in_order(){return this.reverse?this.domain.slice().reverse():this.domain.slice()}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(6)),o=i(n(2)),a=n(62);e.LinearScaleModel=class extends a.ScaleModel{defaults(){return Object.assign({},a.ScaleModel.prototype.defaults(),{_model_name:"LinearScaleModel",_view_name:"LinearScale",min:null,max:null,min_range:.6,mid_range:.8})}set_init_state(){this.type="linear",this.global_min=Number.NEGATIVE_INFINITY,this.global_max=Number.POSITIVE_INFINITY}set_listeners(){this.on("change:reverse",this.reverse_changed,this),this.reverse_changed(void 0,void 0,void 0),this.on_some_change(["min","max"],this.min_max_changed,this),this.min_max_changed(),this.on_some_change(["min_range","mid_range","stabilized"],this.update_domain,this)}min_max_changed(){this.min=this.get("min"),this.max=this.get("max"),this.min_from_data=null===this.min,this.max_from_data=null===this.max,this.update_domain()}reverse_changed(t,e,n){const i=void 0!==t&&t.previous("reverse");this.reverse=this.get("reverse");const r=(i+this.reverse)%2;this.domain.length>0&&1===r&&(this.domain.reverse(),this.trigger("domain_changed",this.domain))}update_domain(){const t=this,e=this.min_from_data?o.min(r.map(this.domains,function(e){return e.length>0?e[0]:t.global_max})):this.min,n=this.max_from_data?o.max(r.map(this.domains,function(e){return e.length>1?e[1]:t.global_min})):this.max,i=.5*(e+n),a=.5*(n-e)/this.get("mid_range"),s=this.domain,c=this.reverse?1:0,l=s[c],u=s[1-c],h=.5*(u+l),d=.5*(u-l)*this.get("min_range"),f=this.get("stabilized");if(f?!(e>=l&&e<=h-d&&n<=u&&n>=h+d):e!==l||n!==u){const t=f?i-a:e,r=f?i+a:n;this.domain=this.reverse?[r,t]:[t,r],this.trigger("domain_changed",this.domain)}}compute_and_set_domain(t,e){if(!t||0===t.length)return void this.set_domain([],e);const n=t[0]instanceof Array?t:[t],i=o.min(n.map(function(t){return o.min(t)})),r=o.max(n.map(function(t){return o.max(t)}));this.set_domain([i,r],e)}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=Math.PI,a=o/180,s=Math.sqrt(3),c=Math.tan(o/6),l=function(t){const e=Math.sqrt(t/o);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"},u=r.map({circle:l,cross:function(t,e){const n=Math.sqrt(t/5)/2;return"M"+-3*n+","+-n+"H"+-n+"V"+-3*n+"H"+n+"V"+-n+"H"+3*n+"V"+n+"H"+n+"V"+3*n+"H"+-n+"V"+n+"H"+-3*n+"Z"},diamond:function(t,e){const n=Math.sqrt(t/(2*c)),i=n*c;return"M0,"+-n+"L"+i+",0 0,"+n+" "+-i+",0Z"},square:function(t,e){const n=Math.sqrt(t)/2;return"M"+-n+","+-n+"L"+n+","+-n+" "+n+","+n+" "+-n+","+n+"Z"},"triangle-down":function(t,e){const n=Math.sqrt(t/s),i=n*s/2;return"M0,"+i+"L"+n+","+-i+" "+-n+","+-i+"Z"},"triangle-up":function(t,e){const n=Math.sqrt(t/s),i=n*s/2;return"M0,"+-i+"L"+n+","+i+" "+-n+","+i+"Z"},arrow:function(t,e){const n=60+-55*e,i=Math.tan(n*a),r=Math.sqrt(t/i),o=r*i/2;return"M0,"+-r+"L"+o+","+r+" "+-o+","+r+"Z"},ellipse:function(t,e){const n=Math.pow(10,e),i=Math.sqrt(t/(o*n)),r=i*n;return"M0,"+r+"A"+i+","+r+" 0 1,1 0,"+-r+"A"+i+","+r+" 0 1,1 0,"+r+"Z"},rectangle:function(t,e){const n=Math.pow(10,e),i=Math.sqrt(t/n)/2,r=i*n;return"M"+-i+","+-r+"L"+i+","+-r+" "+i+","+r+" "+-i+","+r+"Z"}});function h(){return 64}function d(){return"circle"}function f(){return.5}function p(t){return"function"==typeof t?t:function(t){return function(){return t}}(t)}e.symbol=function(){let t=d,e=h,n=f;function i(i,r){return(u.get(t.call(this,i,r))||l)(e.call(this,i,r),n.call(this,i,r))}return i.type=function(e){return arguments.length?(t=p(e),i):t},i.size=function(t){return arguments.length?(e=p(t),i):e},i.skew=function(t){return arguments.length?(n=p(t),i):n},i},e.types=u.keys()},function(t,e,n){"use strict";function i(t){return+t}function r(t){return t*t}function o(t){return t*(2-t)}function a(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function s(t){return t*t*t}function c(t){return--t*t*t+1}function l(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var u=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),h=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),d=function t(e){function n(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,n.exponent=t,n}(3),f=Math.PI,p=f/2;function m(t){return 1-Math.cos(t*p)}function g(t){return Math.sin(t*p)}function _(t){return(1-Math.cos(f*t))/2}function v(t){return Math.pow(2,10*t-10)}function b(t){return 1-Math.pow(2,-10*t)}function y(t){return((t*=2)<=1?Math.pow(2,10*t-10):2-Math.pow(2,10-10*t))/2}function x(t){return 1-Math.sqrt(1-t*t)}function w(t){return Math.sqrt(1- --t*t)}function M(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var E=4/11,S=6/11,A=8/11,T=.75,k=9/11,P=10/11,L=.9375,O=21/22,C=63/64,R=1/E/E;function I(t){return 1-z(1-t)}function z(t){return(t=+t)<E?R*t*t:t<A?R*(t-=S)*t+T:t<P?R*(t-=k)*t+L:R*(t-=O)*t+C}function B(t){return((t*=2)<=1?1-z(1-t):z(t-1)+1)/2}var N=function t(e){function n(t){return t*t*((e+1)*t-e)}return e=+e,n.overshoot=t,n}(1.70158),D=function t(e){function n(t){return--t*t*((e+1)*t+e)+1}return e=+e,n.overshoot=t,n}(1.70158),j=function t(e){function n(t){return((t*=2)<1?t*t*((e+1)*t-e):(t-=2)*t*((e+1)*t+e)+2)/2}return e=+e,n.overshoot=t,n}(1.70158),U=2*Math.PI,F=function t(e,n){var i=Math.asin(1/(e=Math.max(1,e)))*(n/=U);function r(t){return e*Math.pow(2,10*--t)*Math.sin((i-t)/n)}return r.amplitude=function(e){return t(e,n*U)},r.period=function(n){return t(e,n)},r}(1,.3),H=function t(e,n){var i=Math.asin(1/(e=Math.max(1,e)))*(n/=U);function r(t){return 1-e*Math.pow(2,-10*(t=+t))*Math.sin((t+i)/n)}return r.amplitude=function(e){return t(e,n*U)},r.period=function(n){return t(e,n)},r}(1,.3),q=function t(e,n){var i=Math.asin(1/(e=Math.max(1,e)))*(n/=U);function r(t){return((t=2*t-1)<0?e*Math.pow(2,10*t)*Math.sin((i-t)/n):2-e*Math.pow(2,-10*t)*Math.sin((i+t)/n))/2}return r.amplitude=function(e){return t(e,n*U)},r.period=function(n){return t(e,n)},r}(1,.3);n.d(e,"y",function(){return i}),n.d(e,"D",function(){return a}),n.d(e,"E",function(){return r}),n.d(e,"G",function(){return o}),n.d(e,"F",function(){return a}),n.d(e,"m",function(){return l}),n.d(e,"n",function(){return s}),n.d(e,"p",function(){return c}),n.d(e,"o",function(){return l}),n.d(e,"z",function(){return d}),n.d(e,"A",function(){return u}),n.d(e,"C",function(){return h}),n.d(e,"B",function(){return d}),n.d(e,"H",function(){return _}),n.d(e,"I",function(){return m}),n.d(e,"K",function(){return g}),n.d(e,"J",function(){return _}),n.d(e,"u",function(){return y}),n.d(e,"v",function(){return v}),n.d(e,"x",function(){return b}),n.d(e,"w",function(){return y}),n.d(e,"i",function(){return M}),n.d(e,"j",function(){return x}),n.d(e,"l",function(){return w}),n.d(e,"k",function(){return M}),n.d(e,"e",function(){return z}),n.d(e,"f",function(){return I}),n.d(e,"h",function(){return z}),n.d(e,"g",function(){return B}),n.d(e,"a",function(){return j}),n.d(e,"b",function(){return N}),n.d(e,"d",function(){return D}),n.d(e,"c",function(){return j}),n.d(e,"q",function(){return H}),n.d(e,"r",function(){return F}),n.d(e,"t",function(){return H}),n.d(e,"s",function(){return q})},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o,a=n(9),s=n(16),c=n(14),l=n(37),u=n(41),h=n(34),d=n(42),f=n(13),p=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n._fixed=0,n._spacing=4,n._dirty=!1,n._sizers=[],n._items=[],n._box=null,n._alignment="start",n._direction="top-to-bottom",void 0!==e.direction&&(n._direction=e.direction),void 0!==e.alignment&&(n._alignment=e.alignment),void 0!==e.spacing&&(n._spacing=o.clampSpacing(e.spacing)),n}return r(e,t),e.prototype.dispose=function(){a.each(this._items,function(t){t.dispose()}),this._box=null,this._items.length=0,this._sizers.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"direction",{get:function(){return this._direction},set:function(t){this._direction!==t&&(this._direction=t,this.parent&&(this.parent.dataset.direction=t,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this._alignment},set:function(t){this._alignment!==t&&(this._alignment=t,this.parent&&(this.parent.dataset.alignment=t,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(t){t=o.clampSpacing(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,t.prototype.init.call(this)},e.prototype.attachWidget=function(t,e){a.ArrayExt.insert(this._items,t,new h.LayoutItem(e)),a.ArrayExt.insert(this._sizers,t,new u.BoxSizer),this.parent.isAttached&&c.MessageLoop.sendMessage(e,f.Widget.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&c.MessageLoop.sendMessage(e,f.Widget.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(t,e,n){a.ArrayExt.move(this._items,t,e),a.ArrayExt.move(this._sizers,t,e),this.parent.update()},e.prototype.detachWidget=function(t,e){var n=a.ArrayExt.removeAt(this._items,t);a.ArrayExt.removeAt(this._sizers,t),this.parent.isAttached&&c.MessageLoop.sendMessage(e,f.Widget.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&c.MessageLoop.sendMessage(e,f.Widget.Msg.AfterDetach),n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var t=0,n=0,i=this._items.length;n<i;++n)t+=+!this._items[n].isHidden;this._fixed=this._spacing*Math.max(0,t-1);var r=o.isHorizontal(this._direction),a=r?this._fixed:0,l=r?0:this._fixed;for(n=0,i=this._items.length;n<i;++n){var u=this._items[n],h=this._sizers[n];u.isHidden?(h.minSize=0,h.maxSize=0):(u.fit(),h.sizeHint=e.getSizeBasis(u.widget),h.stretch=e.getStretch(u.widget),r?(h.minSize=u.minWidth,h.maxSize=u.maxWidth,a+=u.minWidth,l=Math.max(l,u.minHeight)):(h.minSize=u.minHeight,h.maxSize=u.maxHeight,l+=u.minHeight,a=Math.max(a,u.minWidth)))}var d=this._box=s.ElementExt.boxSizing(this.parent.node);a+=d.horizontalSum,l+=d.verticalSum;var p=this.parent.node.style;p.minWidth=a+"px",p.minHeight=l+"px",this._dirty=!0,this.parent.parent&&c.MessageLoop.sendMessage(this.parent.parent,f.Widget.Msg.FitRequest),this._dirty&&c.MessageLoop.sendMessage(this.parent,f.Widget.Msg.UpdateRequest)},e.prototype._update=function(t,e){this._dirty=!1;for(var n=0,i=0,r=this._items.length;i<r;++i)n+=+!this._items[i].isHidden;if(0!==n){t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=s.ElementExt.boxSizing(this.parent.node));var o,a=this._box.paddingTop,c=this._box.paddingLeft,l=t-this._box.horizontalSum,h=e-this._box.verticalSum;switch(this._direction){case"left-to-right":o=u.BoxEngine.calc(this._sizers,Math.max(0,l-this._fixed));break;case"top-to-bottom":o=u.BoxEngine.calc(this._sizers,Math.max(0,h-this._fixed));break;case"right-to-left":o=u.BoxEngine.calc(this._sizers,Math.max(0,l-this._fixed)),c+=l;break;case"bottom-to-top":o=u.BoxEngine.calc(this._sizers,Math.max(0,h-this._fixed)),a+=h;break;default:throw"unreachable"}var d=0,f=0;if(o>0)switch(this._alignment){case"start":break;case"center":d=0,f=o/2;break;case"end":d=0,f=o;break;case"justify":d=o/n,f=0;break;default:throw"unreachable"}for(i=0,r=this._items.length;i<r;++i){var p=this._items[i];if(!p.isHidden){var m=this._sizers[i].size;switch(this._direction){case"left-to-right":p.update(c+f,a,m+d,h),c+=m+d+this._spacing;break;case"top-to-bottom":p.update(c,a+f,l,m+d),a+=m+d+this._spacing;break;case"right-to-left":p.update(c-f-m-d,a,m+d,h),c-=m+d+this._spacing;break;case"bottom-to-top":p.update(c,a-f-m-d,l,m+d),a-=m+d+this._spacing;break;default:throw"unreachable"}}}}},e}(d.PanelLayout);e.BoxLayout=p,function(t){t.getStretch=function(t){return o.stretchProperty.get(t)},t.setStretch=function(t,e){o.stretchProperty.set(t,e)},t.getSizeBasis=function(t){return o.sizeBasisProperty.get(t)},t.setSizeBasis=function(t,e){o.sizeBasisProperty.set(t,e)}}(p=e.BoxLayout||(e.BoxLayout={})),e.BoxLayout=p,function(t){function e(t){t.parent&&t.parent.layout instanceof p&&t.parent.fit()}t.stretchProperty=new l.AttachedProperty({name:"stretch",create:function(){return 0},coerce:function(t,e){return Math.max(0,Math.floor(e))},changed:e}),t.sizeBasisProperty=new l.AttachedProperty({name:"sizeBasis",create:function(){return 0},coerce:function(t,e){return Math.max(0,Math.floor(e))},changed:e}),t.isHorizontal=function(t){return"left-to-right"===t||"right-to-left"===t},t.clampSpacing=function(t){return Math.max(0,Math.floor(t))}}(o||(o={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(21),r=function(){function t(t){this._label="",this._caption="",this._mnemonic=-1,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new i.Signal(this),this.owner=t.owner,void 0!==t.label&&(this._label=t.label),void 0!==t.mnemonic&&(this._mnemonic=t.mnemonic),void 0!==t.icon&&(this._iconClass=t.icon),void 0!==t.iconClass&&(this._iconClass=t.iconClass),void 0!==t.iconLabel&&(this._iconLabel=t.iconLabel),void 0!==t.caption&&(this._caption=t.caption),void 0!==t.className&&(this._className=t.className),void 0!==t.closable&&(this._closable=t.closable),this._dataset=t.dataset||{}}return Object.defineProperty(t.prototype,"changed",{get:function(){return this._changed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"label",{get:function(){return this._label},set:function(t){this._label!==t&&(this._label=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mnemonic",{get:function(){return this._mnemonic},set:function(t){this._mnemonic!==t&&(this._mnemonic=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return this.iconClass},set:function(t){this.iconClass=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconClass",{get:function(){return this._iconClass},set:function(t){this._iconClass!==t&&(this._iconClass=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconLabel",{get:function(){return this._iconLabel},set:function(t){this._iconLabel!==t&&(this._iconLabel=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"caption",{get:function(){return this._caption},set:function(t){this._caption!==t&&(this._caption=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return this._className},set:function(t){this._className!==t&&(this._className=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"closable",{get:function(){return this._closable},set:function(t){this._closable!==t&&(this._closable=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return this._dataset},set:function(t){this._dataset!==t&&(this._dataset=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),t}();e.Title=r},function(t,e,n){"use strict";var i=n(4),r=n(95),o=n(5).Buffer,a=new Array(16);function s(){r.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(t,e){return t<<e|t>>>32-e}function l(t,e,n,i,r,o,a){return c(t+(e&n|~e&i)+r+o|0,a)+e|0}function u(t,e,n,i,r,o,a){return c(t+(e&i|n&~i)+r+o|0,a)+e|0}function h(t,e,n,i,r,o,a){return c(t+(e^n^i)+r+o|0,a)+e|0}function d(t,e,n,i,r,o,a){return c(t+(n^(e|~i))+r+o|0,a)+e|0}i(s,r),s.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var n=this._a,i=this._b,r=this._c,o=this._d;n=l(n,i,r,o,t[0],3614090360,7),o=l(o,n,i,r,t[1],3905402710,12),r=l(r,o,n,i,t[2],606105819,17),i=l(i,r,o,n,t[3],3250441966,22),n=l(n,i,r,o,t[4],4118548399,7),o=l(o,n,i,r,t[5],1200080426,12),r=l(r,o,n,i,t[6],2821735955,17),i=l(i,r,o,n,t[7],4249261313,22),n=l(n,i,r,o,t[8],1770035416,7),o=l(o,n,i,r,t[9],2336552879,12),r=l(r,o,n,i,t[10],4294925233,17),i=l(i,r,o,n,t[11],2304563134,22),n=l(n,i,r,o,t[12],1804603682,7),o=l(o,n,i,r,t[13],4254626195,12),r=l(r,o,n,i,t[14],2792965006,17),n=u(n,i=l(i,r,o,n,t[15],1236535329,22),r,o,t[1],4129170786,5),o=u(o,n,i,r,t[6],3225465664,9),r=u(r,o,n,i,t[11],643717713,14),i=u(i,r,o,n,t[0],3921069994,20),n=u(n,i,r,o,t[5],3593408605,5),o=u(o,n,i,r,t[10],38016083,9),r=u(r,o,n,i,t[15],3634488961,14),i=u(i,r,o,n,t[4],3889429448,20),n=u(n,i,r,o,t[9],568446438,5),o=u(o,n,i,r,t[14],3275163606,9),r=u(r,o,n,i,t[3],4107603335,14),i=u(i,r,o,n,t[8],1163531501,20),n=u(n,i,r,o,t[13],2850285829,5),o=u(o,n,i,r,t[2],4243563512,9),r=u(r,o,n,i,t[7],1735328473,14),n=h(n,i=u(i,r,o,n,t[12],2368359562,20),r,o,t[5],4294588738,4),o=h(o,n,i,r,t[8],2272392833,11),r=h(r,o,n,i,t[11],1839030562,16),i=h(i,r,o,n,t[14],4259657740,23),n=h(n,i,r,o,t[1],2763975236,4),o=h(o,n,i,r,t[4],1272893353,11),r=h(r,o,n,i,t[7],4139469664,16),i=h(i,r,o,n,t[10],3200236656,23),n=h(n,i,r,o,t[13],681279174,4),o=h(o,n,i,r,t[0],3936430074,11),r=h(r,o,n,i,t[3],3572445317,16),i=h(i,r,o,n,t[6],76029189,23),n=h(n,i,r,o,t[9],3654602809,4),o=h(o,n,i,r,t[12],3873151461,11),r=h(r,o,n,i,t[15],530742520,16),n=d(n,i=h(i,r,o,n,t[2],3299628645,23),r,o,t[0],4096336452,6),o=d(o,n,i,r,t[7],1126891415,10),r=d(r,o,n,i,t[14],2878612391,15),i=d(i,r,o,n,t[5],4237533241,21),n=d(n,i,r,o,t[12],1700485571,6),o=d(o,n,i,r,t[3],2399980690,10),r=d(r,o,n,i,t[10],4293915773,15),i=d(i,r,o,n,t[1],2240044497,21),n=d(n,i,r,o,t[8],1873313359,6),o=d(o,n,i,r,t[15],4264355552,10),r=d(r,o,n,i,t[6],2734768916,15),i=d(i,r,o,n,t[13],1309151649,21),n=d(n,i,r,o,t[4],4149444226,6),o=d(o,n,i,r,t[11],3174756917,10),r=d(r,o,n,i,t[2],718787259,15),i=d(i,r,o,n,t[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+i|0,this._c=this._c+r|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=s},function(t,e,n){t.exports=r;var i=n(70).EventEmitter;function r(){i.call(this)}n(4)(r,i),r.Readable=n(71),r.Writable=n(189),r.Duplex=n(190),r.Transform=n(191),r.PassThrough=n(192),r.Stream=r,r.prototype.pipe=function(t,e){var n=this;function r(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",r),t.on("drain",o),t._isStdio||e&&!1===e.end||(n.on("end",s),n.on("close",c));var a=!1;function s(){a||(a=!0,t.end())}function c(){a||(a=!0,"function"==typeof t.destroy&&t.destroy())}function l(t){if(u(),0===i.listenerCount(this,"error"))throw t}function u(){n.removeListener("data",r),t.removeListener("drain",o),n.removeListener("end",s),n.removeListener("close",c),n.removeListener("error",l),t.removeListener("error",l),n.removeListener("end",u),n.removeListener("close",u),t.removeListener("close",u)}return n.on("error",l),t.on("error",l),n.on("end",u),n.on("close",u),t.on("close",u),t.emit("pipe",n),t}},function(t,e,n){"use strict";var i,r="object"==typeof Reflect?Reflect:null,o=r&&"function"==typeof r.apply?r.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};i=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function u(t,e,n,i){var r,o,a,s;if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);if(void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),a=o[e]),void 0===a)a=o[e]=n,++t._eventsCount;else if("function"==typeof a?a=o[e]=i?[n,a]:[a,n]:i?a.unshift(n):a.push(n),(r=l(t))>0&&a.length>r&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=a.length,s=c,console&&console.warn&&console.warn(s)}return t}function h(t,e,n){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},r=function(){for(var t=[],e=0;e<arguments.length;e++)t.push(arguments[e]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,o(this.listener,this.target,t))}.bind(i);return r.listener=n,i.wrapFn=r,r}function d(t,e,n){var i=t._events;if(void 0===i)return[];var r=i[e];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(r):p(r,r.length)}function f(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(t,e){for(var n=new Array(e),i=0;i<e;++i)n[i]=t[i];return n}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");c=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var i="error"===t,r=this._events;if(void 0!==r)i=i&&void 0===r.error;else if(!i)return!1;if(i){var a;if(e.length>0&&(a=e[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=r[t];if(void 0===c)return!1;if("function"==typeof c)o(c,this,e);else{var l=c.length,u=p(c,l);for(n=0;n<l;++n)o(u[n],this,e)}return!0},s.prototype.addListener=function(t,e){return u(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return u(this,t,e,!0)},s.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);return this.on(t,h(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);return this.prependListener(t,h(this,t,e)),this},s.prototype.removeListener=function(t,e){var n,i,r,o,a;if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);if(void 0===(i=this._events))return this;if(void 0===(n=i[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(r=-1,o=n.length-1;o>=0;o--)if(n[o]===e||n[o].listener===e){a=n[o].listener,r=o;break}if(r<0)return this;0===r?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,r),1===n.length&&(i[t]=n[0]),void 0!==i.removeListener&&this.emit("removeListener",t,a||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,n,i;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var r,o=Object.keys(n);for(i=0;i<o.length;++i)"removeListener"!==(r=o[i])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},s.prototype.listenerCount=f,s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},function(t,e,n){(e=t.exports=n(96)).Stream=e,e.Readable=e,e.Writable=n(72),e.Duplex=n(36),e.Transform=n(99),e.PassThrough=n(188)},function(t,e,n){"use strict";(function(e,i,r){var o=n(54);function a(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,n){var i=t.entry;t.entry=null;for(;i;){var r=i.callback;e.pendingcb--,r(n),i=i.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=v;var s,c=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?i:o.nextTick;v.WritableState=_;var l=n(44);l.inherits=n(4);var u={deprecate:n(187)},h=n(97),d=n(5).Buffer,f=r.Uint8Array||function(){};var p,m=n(98);function g(){}function _(t,e){s=s||n(36),t=t||{};var i=e instanceof s;this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var r=t.highWaterMark,l=t.writableHighWaterMark,u=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i&&(l||0===l)?l:u,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===t.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,i=n.sync,r=n.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,i,r){--e.pendingcb,n?(o.nextTick(r,i),o.nextTick(E,t,e),t._writableState.errorEmitted=!0,t.emit("error",i)):(r(i),t._writableState.errorEmitted=!0,t.emit("error",i),E(t,e))}(t,n,i,e,r);else{var a=w(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||x(t,n),i?c(y,t,n,a,r):y(t,n,a,r)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function v(t){if(s=s||n(36),!(p.call(v,this)||this instanceof s))return new v(t);this._writableState=new _(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),h.call(this)}function b(t,e,n,i,r,o,a){e.writelen=i,e.writecb=a,e.writing=!0,e.sync=!0,n?t._writev(r,e.onwrite):t._write(r,o,e.onwrite),e.sync=!1}function y(t,e,n,i){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),E(t,e)}function x(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var i=e.bufferedRequestCount,r=new Array(i),o=e.corkedRequestsFree;o.entry=n;for(var s=0,c=!0;n;)r[s]=n,n.isBuf||(c=!1),n=n.next,s+=1;r.allBuffers=c,b(t,e,!0,e.length,r,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new a(e),e.bufferedRequestCount=0}else{for(;n;){var l=n.chunk,u=n.encoding,h=n.callback;if(b(t,e,!1,e.objectMode?1:l.length,l,u,h),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function w(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function M(t,e){t._final(function(n){e.pendingcb--,n&&t.emit("error",n),e.prefinished=!0,t.emit("prefinish"),E(t,e)})}function E(t,e){var n=w(e);return n&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(M,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),n}l.inherits(v,h),_.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(_.prototype,"buffer",{get:u.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(t){return!!p.call(this,t)||this===v&&(t&&t._writableState instanceof _)}})):p=function(t){return t instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(t,e,n){var i,r=this._writableState,a=!1,s=!r.objectMode&&(i=t,d.isBuffer(i)||i instanceof f);return s&&!d.isBuffer(t)&&(t=function(t){return d.from(t)}(t)),"function"==typeof e&&(n=e,e=null),s?e="buffer":e||(e=r.defaultEncoding),"function"!=typeof n&&(n=g),r.ended?function(t,e){var n=new Error("write after end");t.emit("error",n),o.nextTick(e,n)}(this,n):(s||function(t,e,n,i){var r=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(t.emit("error",a),o.nextTick(i,a),r=!1),r}(this,r,t,n))&&(r.pendingcb++,a=function(t,e,n,i,r,o){if(!n){var a=function(t,e,n){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=d.from(e,n));return e}(e,i,r);i!==a&&(n=!0,r="buffer",i=a)}var s=e.objectMode?1:i.length;e.length+=s;var c=e.length<e.highWaterMark;c||(e.needDrain=!0);if(e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:r,isBuf:n,callback:o,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else b(t,e,!1,s,i,r,o);return c}(this,r,s,t,e,n)),a},v.prototype.cork=function(){this._writableState.corked++},v.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||x(this,t))},v.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(t,e,n){n(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(t,e,n){var i=this._writableState;"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function(t,e,n){e.ending=!0,E(t,e),n&&(e.finished?o.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,i,n)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),v.prototype.destroy=m.destroy,v.prototype._undestroy=m.undestroy,v.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,n(33),n(51).setImmediate,n(25))},function(t,e,n){"use strict";var i=n(5).Buffer,r=i.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===r||!r(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=c,this.end=l,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=u,this.end=h,e=3;break;default:return this.write=d,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function c(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function l(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function u(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function d(t){return t.toString(this.encoding)}function f(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<t.length?e?e+this.text(t,n):this.text(t,n):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},o.prototype.text=function(t,e){var n=function(t,e,n){var i=e.length-1;if(i<n)return 0;var r=a(e[i]);if(r>=0)return r>0&&(t.lastNeed=r-1),r;if(--i<n||-2===r)return 0;if((r=a(e[i]))>=0)return r>0&&(t.lastNeed=r-2),r;if(--i<n||-2===r)return 0;if((r=a(e[i]))>=0)return r>0&&(2===r?r=0:t.lastNeed=r-3),r;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var i=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,n){"use strict";var i=n(15).Buffer,r=n(4),o=n(95),a=new Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],l=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],u=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],h=[0,1518500249,1859775393,2400959708,2840853838],d=[1352829926,1548603684,1836072691,2053994217,0];function f(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(t,e){return t<<e|t>>>32-e}function m(t,e,n,i,r,o,a,s){return p(t+(e^n^i)+o+a|0,s)+r|0}function g(t,e,n,i,r,o,a,s){return p(t+(e&n|~e&i)+o+a|0,s)+r|0}function _(t,e,n,i,r,o,a,s){return p(t+((e|~n)^i)+o+a|0,s)+r|0}function v(t,e,n,i,r,o,a,s){return p(t+(e&i|n&~i)+o+a|0,s)+r|0}function b(t,e,n,i,r,o,a,s){return p(t+(e^(n|~i))+o+a|0,s)+r|0}r(f,o),f.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var n=0|this._a,i=0|this._b,r=0|this._c,o=0|this._d,f=0|this._e,y=0|this._a,x=0|this._b,w=0|this._c,M=0|this._d,E=0|this._e,S=0;S<80;S+=1){var A,T;S<16?(A=m(n,i,r,o,f,t[s[S]],h[0],l[S]),T=b(y,x,w,M,E,t[c[S]],d[0],u[S])):S<32?(A=g(n,i,r,o,f,t[s[S]],h[1],l[S]),T=v(y,x,w,M,E,t[c[S]],d[1],u[S])):S<48?(A=_(n,i,r,o,f,t[s[S]],h[2],l[S]),T=_(y,x,w,M,E,t[c[S]],d[2],u[S])):S<64?(A=v(n,i,r,o,f,t[s[S]],h[3],l[S]),T=g(y,x,w,M,E,t[c[S]],d[3],u[S])):(A=b(n,i,r,o,f,t[s[S]],h[4],l[S]),T=m(y,x,w,M,E,t[c[S]],d[4],u[S])),n=f,f=o,o=p(r,10),r=i,i=A,y=E,E=M,M=p(w,10),w=x,x=T}var k=this._b+r+M|0;this._b=this._c+o+E|0,this._c=this._d+f+y|0,this._d=this._e+n+x|0,this._e=this._a+i+w|0,this._a=k},f.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=i.alloc?i.alloc(20):new i(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=f},function(t,e,n){(e=t.exports=function(t){t=t.toLowerCase();var n=e[t];if(!n)throw new Error(t+" is not supported (we accept pull requests)");return new n}).sha=n(193),e.sha1=n(194),e.sha224=n(195),e.sha256=n(100),e.sha384=n(196),e.sha512=n(101)},function(t,e,n){"use strict";e.utils=n(202),e.Cipher=n(203),e.DES=n(204),e.CBC=n(205),e.EDE=n(206)},function(t,e,n){var i=n(207),r=n(215),o=n(111);e.createCipher=e.Cipher=i.createCipher,e.createCipheriv=e.Cipheriv=i.createCipheriv,e.createDecipher=e.Decipher=r.createDecipher,e.createDecipheriv=e.Decipheriv=r.createDecipheriv,e.listCiphers=e.getCiphers=function(){return Object.keys(o)}},function(t,e,n){var i={ECB:n(208),CBC:n(209),CFB:n(210),CFB8:n(211),CFB1:n(212),OFB:n(213),CTR:n(109),GCM:n(109)},r=n(111);for(var o in r)r[o].module=i[r[o].mode];t.exports=r},function(t,e,n){(function(e){var i=n(11),r=n(38);function o(t,n){var r=function(t){var e=a(t);return{blinder:e.toRed(i.mont(t.modulus)).redPow(new i(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}(n),o=n.modulus.byteLength(),s=(i.mont(n.modulus),new i(t).mul(r.blinder).umod(n.modulus)),c=s.toRed(i.mont(n.prime1)),l=s.toRed(i.mont(n.prime2)),u=n.coefficient,h=n.prime1,d=n.prime2,f=c.redPow(n.exponent1),p=l.redPow(n.exponent2);f=f.fromRed(),p=p.fromRed();var m=f.isub(p).imul(u).umod(h);return m.imul(d),p.iadd(m),new e(p.imul(r.unblinder).umod(n.modulus).toArray(!1,o))}function a(t){for(var e=t.modulus.byteLength(),n=new i(r(e));n.cmp(t.modulus)>=0||!n.umod(t.prime1)||!n.umod(t.prime2);)n=new i(r(e));return n}t.exports=o,o.getr=a}).call(this,n(15).Buffer)},function(t,e,n){var i=e;i.utils=n(30),i.common=n(46),i.sha=n(231),i.ripemd=n(235),i.hmac=n(236),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(9),a=n(21),s=function(){function t(t){this._fn=t}return Object.defineProperty(t.prototype,"isDisposed",{get:function(){return!this._fn},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){if(this._fn){var t=this._fn;this._fn=null,t()}},t}();e.DisposableDelegate=s;var c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._disposed=new a.Signal(e),e}return r(e,t),Object.defineProperty(e.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._disposed.emit(void 0),a.Signal.clearData(this))},e}(s);e.ObservableDisposableDelegate=c;var l=function(){function t(){this._isDisposed=!1,this._items=new Set}return Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this._isDisposed||(this._isDisposed=!0,this._items.forEach(function(t){t.dispose()}),this._items.clear())},t.prototype.contains=function(t){return this._items.has(t)},t.prototype.add=function(t){this._items.add(t)},t.prototype.remove=function(t){this._items.delete(t)},t.prototype.clear=function(){this._items.clear()},t}();e.DisposableSet=l,function(t){t.from=function(e){var n=new t;return o.each(e,function(t){n.add(t)}),n}}(l=e.DisposableSet||(e.DisposableSet={})),e.DisposableSet=l;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._disposed=new a.Signal(e),e}return r(e,t),Object.defineProperty(e.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._disposed.emit(void 0),a.Signal.clearData(this))},e}(l);e.ObservableDisposableSet=u,function(t){t.from=function(e){var n=new t;return o.each(e,function(t){n.add(t)}),n}}(u=e.ObservableDisposableSet||(e.ObservableDisposableSet={})),e.ObservableDisposableSet=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getKeyboardLayout=function(){return i.keyboardLayout},e.setKeyboardLayout=function(t){i.keyboardLayout=t};var i,r=function(){function t(e,n){this.name=e,this._codes=n,this._keys=t.extractKeys(n)}return t.prototype.keys=function(){return Object.keys(this._keys)},t.prototype.isValidKey=function(t){return t in this._keys},t.prototype.keyForKeydownEvent=function(t){return this._codes[t.keyCode]||""},t}();e.KeycodeLayout=r,function(t){t.extractKeys=function(t){var e=Object.create(null);for(var n in t)e[t[n]]=!0;return e}}(r=e.KeycodeLayout||(e.KeycodeLayout={})),e.KeycodeLayout=r,e.EN_US=new r("en-us",{8:"Backspace",9:"Tab",13:"Enter",19:"Pause",27:"Escape",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",93:"ContextMenu",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}),function(t){t.keyboardLayout=e.EN_US}(i||(i={}))},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o,a=n(9),s=n(16),c=n(60),l=n(14),u=n(21),h=n(59),d=n(67),f=n(13),p=function(t){function e(n){void 0===n&&(n={});var i=t.call(this,{node:o.createNode()})||this;return i._currentIndex=-1,i._titles=[],i._previousTitle=null,i._dragData=null,i._tabMoved=new u.Signal(i),i._currentChanged=new u.Signal(i),i._tabCloseRequested=new u.Signal(i),i._tabDetachRequested=new u.Signal(i),i._tabActivateRequested=new u.Signal(i),i.addClass("p-TabBar"),i.setFlag(f.Widget.Flag.DisallowLayout),i.tabsMovable=n.tabsMovable||!1,i.allowDeselect=n.allowDeselect||!1,i.insertBehavior=n.insertBehavior||"select-tab-if-needed",i.removeBehavior=n.removeBehavior||"select-tab-after",i.renderer=n.renderer||e.defaultRenderer,i._orientation=n.orientation||"horizontal",i.dataset.orientation=i._orientation,i}return r(e,t),e.prototype.dispose=function(){this._releaseMouse(),this._titles.length=0,this._previousTitle=null,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabMoved",{get:function(){return this._tabMoved},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabActivateRequested",{get:function(){return this._tabActivateRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabCloseRequested",{get:function(){return this._tabCloseRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabDetachRequested",{get:function(){return this._tabDetachRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTitle",{get:function(){return this._titles[this._currentIndex]||null},set:function(t){this.currentIndex=t?this._titles.indexOf(t):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentIndex",{get:function(){return this._currentIndex},set:function(t){if((t<0||t>=this._titles.length)&&(t=-1),this._currentIndex!==t){var e=this._currentIndex,n=this._titles[e]||null,i=t,r=this._titles[i]||null;this._currentIndex=i,this._previousTitle=n,this.update(),this._currentChanged.emit({previousIndex:e,previousTitle:n,currentIndex:i,currentTitle:r})}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(t){this._orientation!==t&&(this._releaseMouse(),this._orientation=t,this.dataset.orientation=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titles",{get:function(){return this._titles},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("p-TabBar-content")[0]},enumerable:!0,configurable:!0}),e.prototype.addTab=function(t){return this.insertTab(this._titles.length,t)},e.prototype.insertTab=function(t,e){this._releaseMouse();var n=o.asTitle(e),i=this._titles.indexOf(n),r=Math.max(0,Math.min(t,this._titles.length));return-1===i?(a.ArrayExt.insert(this._titles,r,n),n.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(r,n),n):(r===this._titles.length&&r--,i===r?n:(a.ArrayExt.move(this._titles,i,r),this.update(),this._adjustCurrentForMove(i,r),n))},e.prototype.removeTab=function(t){this.removeTabAt(this._titles.indexOf(t))},e.prototype.removeTabAt=function(t){this._releaseMouse();var e=a.ArrayExt.removeAt(this._titles,t);e&&(e.changed.disconnect(this._onTitleChanged,this),e===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(t,e))},e.prototype.clearTabs=function(){if(0!==this._titles.length){this._releaseMouse();for(var t=0,e=this._titles;t<e.length;t++){e[t].changed.disconnect(this._onTitleChanged,this)}var n=this.currentIndex,i=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),-1!==n&&this._currentChanged.emit({previousIndex:n,previousTitle:i,currentIndex:-1,currentTitle:null})}},e.prototype.releaseMouse=function(){this._releaseMouse()},e.prototype.handleEvent=function(t){switch(t.type){case"mousedown":this._evtMouseDown(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseup":this._evtMouseUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("mousedown",this)},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("mousedown",this),this._releaseMouse()},e.prototype.onUpdateRequest=function(t){for(var e=this._titles,n=this.renderer,i=this.currentTitle,r=new Array(e.length),o=0,a=e.length;o<a;++o){var s=e[o],c=s===i,l=c?a:a-o-1;r[o]=n.renderTab({title:s,current:c,zIndex:l})}h.VirtualDOM.render(r,this.contentNode)},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation(),27===t.keyCode&&this._releaseMouse()},e.prototype._evtMouseDown=function(t){if((0===t.button||1===t.button)&&!this._dragData){var e=this.contentNode.children,n=a.ArrayExt.findFirstIndex(e,function(e){return s.ElementExt.hitTest(e,t.clientX,t.clientY)});if(-1!==n&&(t.preventDefault(),t.stopPropagation(),this._dragData={tab:e[n],index:n,pressX:t.clientX,pressY:t.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},document.addEventListener("mouseup",this,!0),1!==t.button)){var i=e[n].querySelector(this.renderer.closeIconSelector);i&&i.contains(t.target)||(this.tabsMovable&&(document.addEventListener("mousemove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===n?this.currentIndex=-1:this.currentIndex=n,-1!==this.currentIndex&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}}},e.prototype._evtMouseMove=function(t){var e=this._dragData;if(e){t.preventDefault(),t.stopPropagation();var n=this.contentNode.children;if(e.dragActive||o.dragExceeded(e,t)){if(!e.dragActive){var i=e.tab.getBoundingClientRect();"horizontal"===this._orientation?(e.tabPos=e.tab.offsetLeft,e.tabSize=i.width,e.tabPressPos=e.pressX-i.left):(e.tabPos=e.tab.offsetTop,e.tabSize=i.height,e.tabPressPos=e.pressY-i.top),e.tabLayout=o.snapTabLayout(n,this._orientation),e.contentRect=this.contentNode.getBoundingClientRect(),e.override=c.Drag.overrideCursor("default"),e.tab.classList.add("p-mod-dragging"),this.addClass("p-mod-dragging"),e.dragActive=!0}if(!e.detachRequested&&o.detachExceeded(e,t)){e.detachRequested=!0;var r=e.index,a=t.clientX,s=t.clientY,l=n[r],u=this._titles[r];if(this._tabDetachRequested.emit({index:r,title:u,tab:l,clientX:a,clientY:s}),e.dragAborted)return}o.layoutTabs(n,e,t,this._orientation)}}},e.prototype._evtMouseUp=function(t){var e=this;if(0===t.button||1===t.button){var n=this._dragData;if(n){if(t.preventDefault(),t.stopPropagation(),document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("contextmenu",this,!0),!n.dragActive){this._dragData=null;var i=this.contentNode.children,r=a.ArrayExt.findFirstIndex(i,function(e){return s.ElementExt.hitTest(e,t.clientX,t.clientY)});if(r!==n.index)return;var c=this._titles[r];if(!c.closable)return;if(1===t.button)return void this._tabCloseRequested.emit({index:r,title:c});var u=i[r].querySelector(this.renderer.closeIconSelector);return u&&u.contains(t.target)?void this._tabCloseRequested.emit({index:r,title:c}):void 0}if(0===t.button){o.finalizeTabPosition(n,this._orientation),n.tab.classList.remove("p-mod-dragging");var h=o.parseTransitionDuration(n.tab);setTimeout(function(){if(!n.dragAborted){e._dragData=null,o.resetTabPositions(e.contentNode.children,e._orientation),n.override.dispose(),e.removeClass("p-mod-dragging");var t=n.index,i=n.targetIndex;-1!==i&&t!==i&&(a.ArrayExt.move(e._titles,t,i),e._adjustCurrentForMove(t,i),e._tabMoved.emit({fromIndex:t,toIndex:i,title:e._titles[i]}),l.MessageLoop.sendMessage(e,f.Widget.Msg.UpdateRequest))}},h)}}}},e.prototype._releaseMouse=function(){var t=this._dragData;t&&(this._dragData=null,document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("contextmenu",this,!0),t.dragAborted=!0,t.dragActive&&(o.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),t.tab.classList.remove("p-mod-dragging"),this.removeClass("p-mod-dragging")))},e.prototype._adjustCurrentForInsert=function(t,e){var n=this.currentTitle,i=this._currentIndex,r=this.insertBehavior;if("select-tab"===r||"select-tab-if-needed"===r&&-1===i)return this._currentIndex=t,this._previousTitle=n,void this._currentChanged.emit({previousIndex:i,previousTitle:n,currentIndex:t,currentTitle:e});i>=t&&this._currentIndex++},e.prototype._adjustCurrentForMove=function(t,e){this._currentIndex===t?this._currentIndex=e:this._currentIndex<t&&this._currentIndex>=e?this._currentIndex++:this._currentIndex>t&&this._currentIndex<=e&&this._currentIndex--},e.prototype._adjustCurrentForRemove=function(t,e){var n=this._currentIndex,i=this.removeBehavior;if(n===t){if(0===this._titles.length)return this._currentIndex=-1,void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:-1,currentTitle:null});if("select-tab-after"===i)return this._currentIndex=Math.min(t,this._titles.length-1),void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:this._currentIndex,currentTitle:this.currentTitle});if("select-tab-before"===i)return this._currentIndex=Math.max(0,t-1),void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:this._currentIndex,currentTitle:this.currentTitle});if("select-previous-tab"===i)return this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(t,this._titles.length-1),void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:this._currentIndex,currentTitle:this.currentTitle});this._currentIndex=-1,this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:-1,currentTitle:null})}else n>t&&this._currentIndex--},e.prototype._onTitleChanged=function(t){this.update()},e}(f.Widget);e.TabBar=p,function(t){var e=function(){function t(){this.closeIconSelector=".p-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap}return t.prototype.renderTab=function(t){var e=t.title.caption,n=this.createTabKey(t),i=this.createTabStyle(t),r=this.createTabClass(t),o=this.createTabDataset(t);return h.h.li({key:n,className:r,title:e,style:i,dataset:o},this.renderIcon(t),this.renderLabel(t),this.renderCloseIcon(t))},t.prototype.renderIcon=function(t){var e=this.createIconClass(t);return h.h.div({className:e},t.title.iconLabel)},t.prototype.renderLabel=function(t){return h.h.div({className:"p-TabBar-tabLabel"},t.title.label)},t.prototype.renderCloseIcon=function(t){return h.h.div({className:"p-TabBar-tabCloseIcon"})},t.prototype.createTabKey=function(t){var e=this._tabKeys.get(t.title);return void 0===e&&(e="tab-key-"+this._tabID++,this._tabKeys.set(t.title,e)),e},t.prototype.createTabStyle=function(t){return{zIndex:""+t.zIndex}},t.prototype.createTabClass=function(t){var e="p-TabBar-tab";return t.title.className&&(e+=" "+t.title.className),t.title.closable&&(e+=" p-mod-closable"),t.current&&(e+=" p-mod-current"),e},t.prototype.createTabDataset=function(t){return t.title.dataset},t.prototype.createIconClass=function(t){var e="p-TabBar-tabIcon",n=t.title.iconClass;return n?e+" "+n:e},t}();t.Renderer=e,t.defaultRenderer=new e}(p=e.TabBar||(e.TabBar={})),e.TabBar=p,function(t){t.DRAG_THRESHOLD=5,t.DETACH_THRESHOLD=20,t.createNode=function(){var t=document.createElement("div"),e=document.createElement("ul");return e.className="p-TabBar-content",t.appendChild(e),t},t.asTitle=function(t){return t instanceof d.Title?t:new d.Title(t)},t.parseTransitionDuration=function(t){var e=window.getComputedStyle(t);return 1e3*(parseFloat(e.transitionDuration)||0)},t.snapTabLayout=function(t,e){for(var n=new Array(t.length),i=0,r=t.length;i<r;++i){var o=t[i],a=window.getComputedStyle(o);n[i]="horizontal"===e?{pos:o.offsetLeft,size:o.offsetWidth,margin:parseFloat(a.marginLeft)||0}:{pos:o.offsetTop,size:o.offsetHeight,margin:parseFloat(a.marginTop)||0}}return n},t.dragExceeded=function(e,n){var i=Math.abs(n.clientX-e.pressX),r=Math.abs(n.clientY-e.pressY);return i>=t.DRAG_THRESHOLD||r>=t.DRAG_THRESHOLD},t.detachExceeded=function(e,n){var i=e.contentRect;return n.clientX<i.left-t.DETACH_THRESHOLD||n.clientX>=i.right+t.DETACH_THRESHOLD||n.clientY<i.top-t.DETACH_THRESHOLD||n.clientY>=i.bottom+t.DETACH_THRESHOLD},t.layoutTabs=function(t,e,n,i){var r,o,a,s;"horizontal"===i?(r=e.pressX,o=n.clientX-e.contentRect.left,a=n.clientX,s=e.contentRect.width):(r=e.pressY,o=n.clientY-e.contentRect.top,a=n.clientY,s=e.contentRect.height);for(var c=e.index,l=o-e.tabPressPos,u=l+e.tabSize,h=0,d=t.length;h<d;++h){var f=void 0,p=e.tabLayout[h],m=p.pos+(p.size>>1);if(h<e.index&&l<m)f=e.tabSize+e.tabLayout[h+1].margin+"px",c=Math.min(c,h);else if(h>e.index&&u>m)f=-e.tabSize-p.margin+"px",c=Math.max(c,h);else if(h===e.index){var g=a-r,_=s-(e.tabPos+e.tabSize);f=Math.max(-e.tabPos,Math.min(g,_))+"px"}else f="";"horizontal"===i?t[h].style.left=f:t[h].style.top=f}e.targetIndex=c},t.finalizeTabPosition=function(t,e){var n,i;if(n="horizontal"===e?t.contentRect.width:t.contentRect.height,t.targetIndex===t.index)i=0;else if(t.targetIndex>t.index)i=(r=t.tabLayout[t.targetIndex]).pos+r.size-t.tabSize-t.tabPos;else{var r;i=(r=t.tabLayout[t.targetIndex]).pos-t.tabPos}var o=n-(t.tabPos+t.tabSize),a=Math.max(-t.tabPos,Math.min(i,o));"horizontal"===e?t.tab.style.left=a+"px":t.tab.style.top=a+"px"},t.resetTabPositions=function(t,e){a.each(t,function(t){"horizontal"===e?t.style.left="":t.style.top=""})}}(o||(o={}))},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(2)),a=r(n(135)),s="RdYlGn";function c(t){return o.max(Object.keys(t).map(Number))}e.cycle_colors=function(t,e){const n=t.length;if(n>e)return t.slice(0,e);{let i=[],r=Math.floor(e/n);for(;r>0;r--)i=i.concat(t);return i.concat(t.slice(0,e%n))}},e.cycle_colors_from_scheme=function(t,e){t=t in a.default?t:s;const n=a.default[t];let i=e.toString();return 2===e?[n[3][0],n[3][2]]:i in n?n[i]:(i=c(n).toString(),this.cycle_colors(n[i],e))},e.get_linear_scale=function(t){t=t in a.default&&"qual"!==a.default[t].type?t:s;const e=a.default[t],n=e[c(e).toString()];return o.scaleLinear().range(n)},e.get_ordinal_scale=function(t,e){const n=o.scaleOrdinal();return n.range(this.cycle_colors_from_scheme(t,e)),n},e.get_linear_scale_range=function(t){return this.get_linear_scale(t).range()},e.get_ordinal_scale_range=function(t,e){return this.get_ordinal_scale(t,e).range()}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(139);function r(t,e,n){if(0==e.length&&0==n.length)return!1;let i=!0;return 0!=e.length&&(i=i&&e[0]<=t[0]&&t[0]<=e[1]),0!=n.length&&(i=i&&n[0]<=t[1]&&t[1]<=n[1]),i}function o(t,e){return 0==t.length||0==e.length?0!=t.length||0!=e.length:(t.sort(function(t,e){return t-e}),e.sort(function(t,e){return t-e}),t[0]<e[0]!=t[0]<e[1]||t[1]<e[0]!=t[1]<e[1]||e[0]<t[0]!=e[0]<t[1]||e[1]<t[0]!=e[1]<t[1])}e.point_in_lasso=i.point_in_lasso,e.point_in_rectangle=r,e.rect_inter_rect=function(t,e,n,i){return o(t,n)&&o(e,i)},e.lasso_inter_rect=function(t,e,n){for(let i=0;i<n.length;i++)if(r(n[i],t,e))return!0;return!1}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(87)),o=n(50);e.LinearScale=class extends o.Scale{render(){this.scale=r.scaleLinear(),this.model.domain.length>0&&this.scale.domain(this.model.domain),this.offset=0,this.create_event_listeners()}expand_domain(t,e){const n=this.scale.copy();n.clamp(!1),n.domain(this.model.domain),n.range(t),this.scale.domain(e.map(function(t){return n.invert(t)}))}invert(t){return this.scale.invert(t)}invert_range(t){const e=this;return t.map(function(t){return e.invert(t)})}}},function(t,e,n){"use strict";n.r(e);var i=n(1);function r(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function o(t,e){switch(arguments.length){case 0:break;case 1:this.interpolator(t);break;default:this.interpolator(e).domain(t)}return this}var a=n(32),s=Array.prototype,c=s.map,l=s.slice,u={name:"implicit"};function h(){var t=Object(a.c)(),e=[],n=[],i=u;function o(r){var o=r+"",a=t.get(o);if(!a){if(i!==u)return i;t.set(o,a=e.push(r))}return n[(a-1)%n.length]}return o.domain=function(n){if(!arguments.length)return e.slice();e=[],t=Object(a.c)();for(var i,r,s=-1,c=n.length;++s<c;)t.has(r=(i=n[s])+"")||t.set(r,e.push(i));return o},o.range=function(t){return arguments.length?(n=l.call(t),o):n.slice()},o.unknown=function(t){return arguments.length?(i=t,o):i},o.copy=function(){return h(e,n).unknown(i)},r.apply(o,arguments),o}function d(){var t,e,n=h().unknown(void 0),o=n.domain,a=n.range,s=[0,1],c=!1,l=0,u=0,f=.5;function p(){var n=o().length,r=s[1]<s[0],h=s[r-0],d=s[1-r];t=(d-h)/Math.max(1,n-l+2*u),c&&(t=Math.floor(t)),h+=(d-h-t*(n-l))*f,e=t*(1-l),c&&(h=Math.round(h),e=Math.round(e));var p=Object(i.s)(n).map(function(e){return h+t*e});return a(r?p.reverse():p)}return delete n.unknown,n.domain=function(t){return arguments.length?(o(t),p()):o()},n.range=function(t){return arguments.length?(s=[+t[0],+t[1]],p()):s.slice()},n.rangeRound=function(t){return s=[+t[0],+t[1]],c=!0,p()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(c=!!t,p()):c},n.padding=function(t){return arguments.length?(l=Math.min(1,u=+t),p()):l},n.paddingInner=function(t){return arguments.length?(l=Math.min(1,t),p()):l},n.paddingOuter=function(t){return arguments.length?(u=+t,p()):u},n.align=function(t){return arguments.length?(f=Math.max(0,Math.min(1,t)),p()):f},n.copy=function(){return d(o(),s).round(c).paddingInner(l).paddingOuter(u).align(f)},r.apply(p(),arguments)}function f(){return function t(e){var n=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return t(n())},e}(d.apply(null,arguments).paddingInner(1))}var p=n(8),m=function(t){return function(){return t}},g=function(t){return+t},_=[0,1];function v(t){return t}function b(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:m(isNaN(e)?NaN:.5)}function y(t){var e,n=t[0],i=t[t.length-1];return n>i&&(e=n,n=i,i=e),function(t){return Math.max(n,Math.min(i,t))}}function x(t,e,n){var i=t[0],r=t[1],o=e[0],a=e[1];return r<i?(i=b(r,i),o=n(a,o)):(i=b(i,r),o=n(o,a)),function(t){return o(i(t))}}function w(t,e,n){var r=Math.min(t.length,e.length)-1,o=new Array(r),a=new Array(r),s=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<r;)o[s]=b(t[s],t[s+1]),a[s]=n(e[s],e[s+1]);return function(e){var n=Object(i.b)(t,e,1,r)-1;return a[n](o[n](e))}}function M(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function E(){var t,e,n,i,r,o,a=_,s=_,u=p.a,h=v;function d(){return i=Math.min(a.length,s.length)>2?w:x,r=o=null,f}function f(e){return isNaN(e=+e)?n:(r||(r=i(a.map(t),s,u)))(t(h(e)))}return f.invert=function(n){return h(e((o||(o=i(s,a.map(t),p.o)))(n)))},f.domain=function(t){return arguments.length?(a=c.call(t,g),h===v||(h=y(a)),d()):a.slice()},f.range=function(t){return arguments.length?(s=l.call(t),d()):s.slice()},f.rangeRound=function(t){return s=l.call(t),u=p.t,d()},f.clamp=function(t){return arguments.length?(h=t?y(a):v,f):h!==v},f.interpolate=function(t){return arguments.length?(u=t,d()):u},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,i){return t=n,e=i,d()}}function S(t,e){return E()(t,e)}var A=n(27),T=function(t,e,n,r){var o,a=Object(i.A)(t,e,n);switch((r=Object(A.e)(null==r?",f":r)).type){case"s":var s=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(o=Object(A.g)(a,s))||(r.precision=o),Object(A.d)(r,s);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(o=Object(A.h)(a,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=o-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(o=Object(A.f)(a))||(r.precision=o-2*("%"===r.type))}return Object(A.a)(r)};function k(t){var e=t.domain;return t.ticks=function(t){var n=e();return Object(i.B)(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var i=e();return T(i[0],i[i.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,o=e(),a=0,s=o.length-1,c=o[a],l=o[s];return l<c&&(r=c,c=l,l=r,r=a,a=s,s=r),(r=Object(i.z)(c,l,n))>0?(c=Math.floor(c/r)*r,l=Math.ceil(l/r)*r,r=Object(i.z)(c,l,n)):r<0&&(c=Math.ceil(c*r)/r,l=Math.floor(l*r)/r,r=Object(i.z)(c,l,n)),r>0?(o[a]=Math.floor(c/r)*r,o[s]=Math.ceil(l/r)*r,e(o)):r<0&&(o[a]=Math.ceil(c*r)/r,o[s]=Math.floor(l*r)/r,e(o)),t},t}function P(){var t=S(v,v);return t.copy=function(){return M(t,P())},r.apply(t,arguments),k(t)}function L(t){var e;function n(t){return isNaN(t=+t)?e:t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=c.call(e,g),n):t.slice()},n.unknown=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return L(t).unknown(e)},t=arguments.length?c.call(t,g):[0,1],k(n)}var O=function(t,e){var n,i=0,r=(t=t.slice()).length-1,o=t[i],a=t[r];return a<o&&(n=i,i=r,r=n,n=o,o=a,a=n),t[i]=e.floor(o),t[r]=e.ceil(a),t};function C(t){return Math.log(t)}function R(t){return Math.exp(t)}function I(t){return-Math.log(-t)}function z(t){return-Math.exp(-t)}function B(t){return isFinite(t)?+("1e"+t):t<0?0:t}function N(t){return function(e){return-t(-e)}}function D(t){var e,n,r=t(C,R),o=r.domain,a=10;function s(){return e=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),function(e){return Math.log(e)/t})}(a),n=function(t){return 10===t?B:t===Math.E?Math.exp:function(e){return Math.pow(t,e)}}(a),o()[0]<0?(e=N(e),n=N(n),t(I,z)):t(C,R),r}return r.base=function(t){return arguments.length?(a=+t,s()):a},r.domain=function(t){return arguments.length?(o(t),s()):o()},r.ticks=function(t){var r,s=o(),c=s[0],l=s[s.length-1];(r=l<c)&&(f=c,c=l,l=f);var u,h,d,f=e(c),p=e(l),m=null==t?10:+t,g=[];if(!(a%1)&&p-f<m){if(f=Math.round(f)-1,p=Math.round(p)+1,c>0){for(;f<p;++f)for(h=1,u=n(f);h<a;++h)if(!((d=u*h)<c)){if(d>l)break;g.push(d)}}else for(;f<p;++f)for(h=a-1,u=n(f);h>=1;--h)if(!((d=u*h)<c)){if(d>l)break;g.push(d)}}else g=Object(i.B)(f,p,Math.min(p-f,m)).map(n);return r?g.reverse():g},r.tickFormat=function(t,i){if(null==i&&(i=10===a?".0e":","),"function"!=typeof i&&(i=Object(A.a)(i)),t===1/0)return i;null==t&&(t=10);var o=Math.max(1,a*t/r.ticks().length);return function(t){var r=t/n(Math.round(e(t)));return r*a<a-.5&&(r*=a),r<=o?i(t):""}},r.nice=function(){return o(O(o(),{floor:function(t){return n(Math.floor(e(t)))},ceil:function(t){return n(Math.ceil(e(t)))}}))},r}function j(){var t=D(E()).domain([1,10]);return t.copy=function(){return M(t,j()).base(t.base())},r.apply(t,arguments),t}function U(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function F(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function H(t){var e=1,n=t(U(e),F(e));return n.constant=function(n){return arguments.length?t(U(e=+n),F(e)):e},k(n)}function q(){var t=H(E());return t.copy=function(){return M(t,q()).constant(t.constant())},r.apply(t,arguments)}function G(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function W(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function V(t){return t<0?-t*t:t*t}function X(t){var e=t(v,v),n=1;function i(){return 1===n?t(v,v):.5===n?t(W,V):t(G(n),G(1/n))}return e.exponent=function(t){return arguments.length?(n=+t,i()):n},k(e)}function Y(){var t=X(E());return t.copy=function(){return M(t,Y()).exponent(t.exponent())},r.apply(t,arguments),t}function K(){return Y.apply(null,arguments).exponent(.5)}function Z(){var t,e=[],n=[],o=[];function a(){var t=0,r=Math.max(1,n.length);for(o=new Array(r-1);++t<r;)o[t-1]=Object(i.r)(e,t/r);return s}function s(e){return isNaN(e=+e)?t:n[Object(i.b)(o,e)]}return s.invertExtent=function(t){var i=n.indexOf(t);return i<0?[NaN,NaN]:[i>0?o[i-1]:e[0],i<o.length?o[i]:e[e.length-1]]},s.domain=function(t){if(!arguments.length)return e.slice();e=[];for(var n,r=0,o=t.length;r<o;++r)null==(n=t[r])||isNaN(n=+n)||e.push(n);return e.sort(i.a),a()},s.range=function(t){return arguments.length?(n=l.call(t),a()):n.slice()},s.unknown=function(e){return arguments.length?(t=e,s):t},s.quantiles=function(){return o.slice()},s.copy=function(){return Z().domain(e).range(n).unknown(t)},r.apply(s,arguments)}function J(){var t,e=0,n=1,o=1,a=[.5],s=[0,1];function c(e){return e<=e?s[Object(i.b)(a,e,0,o)]:t}function u(){var t=-1;for(a=new Array(o);++t<o;)a[t]=((t+1)*n-(t-o)*e)/(o+1);return c}return c.domain=function(t){return arguments.length?(e=+t[0],n=+t[1],u()):[e,n]},c.range=function(t){return arguments.length?(o=(s=l.call(t)).length-1,u()):s.slice()},c.invertExtent=function(t){var i=s.indexOf(t);return i<0?[NaN,NaN]:i<1?[e,a[0]]:i>=o?[a[o-1],n]:[a[i-1],a[i]]},c.unknown=function(e){return arguments.length?(t=e,c):c},c.thresholds=function(){return a.slice()},c.copy=function(){return J().domain([e,n]).range(s).unknown(t)},r.apply(k(c),arguments)}function Q(){var t,e=[.5],n=[0,1],o=1;function a(r){return r<=r?n[Object(i.b)(e,r,0,o)]:t}return a.domain=function(t){return arguments.length?(e=l.call(t),o=Math.min(e.length,n.length-1),a):e.slice()},a.range=function(t){return arguments.length?(n=l.call(t),o=Math.min(e.length,n.length-1),a):n.slice()},a.invertExtent=function(t){var i=n.indexOf(t);return[e[i-1],e[i]]},a.unknown=function(e){return arguments.length?(t=e,a):t},a.copy=function(){return Q().domain(e).range(n).unknown(t)},r.apply(a,arguments)}var $=n(3),tt=n(40),et=1e3,nt=60*et,it=60*nt,rt=24*it,ot=7*rt,at=30*rt,st=365*rt;function ct(t){return new Date(t)}function lt(t){return t instanceof Date?+t:+new Date(+t)}function ut(t,e,n,r,o,a,s,l,u){var h=S(v,v),d=h.invert,f=h.domain,p=u(".%L"),m=u(":%S"),g=u("%I:%M"),_=u("%I %p"),b=u("%a %d"),y=u("%b %d"),x=u("%B"),w=u("%Y"),E=[[s,1,et],[s,5,5*et],[s,15,15*et],[s,30,30*et],[a,1,nt],[a,5,5*nt],[a,15,15*nt],[a,30,30*nt],[o,1,it],[o,3,3*it],[o,6,6*it],[o,12,12*it],[r,1,rt],[r,2,2*rt],[n,1,ot],[e,1,at],[e,3,3*at],[t,1,st]];function A(i){return(s(i)<i?p:a(i)<i?m:o(i)<i?g:r(i)<i?_:e(i)<i?n(i)<i?b:y:t(i)<i?x:w)(i)}function T(e,n,r,o){if(null==e&&(e=10),"number"==typeof e){var a=Math.abs(r-n)/e,s=Object(i.e)(function(t){return t[2]}).right(E,a);s===E.length?(o=Object(i.A)(n/st,r/st,e),e=t):s?(o=(s=E[a/E[s-1][2]<E[s][2]/a?s-1:s])[1],e=s[0]):(o=Math.max(Object(i.A)(n,r,e),1),e=l)}return null==o?e:e.every(o)}return h.invert=function(t){return new Date(d(t))},h.domain=function(t){return arguments.length?f(c.call(t,lt)):f().map(ct)},h.ticks=function(t,e){var n,i=f(),r=i[0],o=i[i.length-1],a=o<r;return a&&(n=r,r=o,o=n),n=(n=T(t,r,o,e))?n.range(r,o+1):[],a?n.reverse():n},h.tickFormat=function(t,e){return null==e?A:u(e)},h.nice=function(t,e){var n=f();return(t=T(t,n[0],n[n.length-1],e))?f(O(n,t)):h},h.copy=function(){return M(h,ut(t,e,n,r,o,a,s,l,u))},h}var ht=function(){return r.apply(ut($.D,$.n,$.B,$.a,$.e,$.j,$.r,$.h,tt.c).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},dt=function(){return r.apply(ut($.hb,$.R,$.fb,$.F,$.J,$.N,$.V,$.L,tt.g).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)};function ft(){var t,e,n,i,r,o=0,a=1,s=v,c=!1;function l(e){return isNaN(e=+e)?r:s(0===n?.5:(e=(i(e)-t)*n,c?Math.max(0,Math.min(1,e)):e))}return l.domain=function(r){return arguments.length?(t=i(o=+r[0]),e=i(a=+r[1]),n=t===e?0:1/(e-t),l):[o,a]},l.clamp=function(t){return arguments.length?(c=!!t,l):c},l.interpolator=function(t){return arguments.length?(s=t,l):s},l.unknown=function(t){return arguments.length?(r=t,l):r},function(r){return i=r,t=r(o),e=r(a),n=t===e?0:1/(e-t),l}}function pt(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function mt(){var t=k(ft()(v));return t.copy=function(){return pt(t,mt())},o.apply(t,arguments)}function gt(){var t=D(ft()).domain([1,10]);return t.copy=function(){return pt(t,gt()).base(t.base())},o.apply(t,arguments)}function _t(){var t=H(ft());return t.copy=function(){return pt(t,_t()).constant(t.constant())},o.apply(t,arguments)}function vt(){var t=X(ft());return t.copy=function(){return pt(t,vt()).exponent(t.exponent())},o.apply(t,arguments)}function bt(){return vt.apply(null,arguments).exponent(.5)}function yt(){var t=[],e=v;function n(n){if(!isNaN(n=+n))return e((Object(i.b)(t,n)-1)/(t.length-1))}return n.domain=function(e){if(!arguments.length)return t.slice();t=[];for(var r,o=0,a=e.length;o<a;++o)null==(r=e[o])||isNaN(r=+r)||t.push(r);return t.sort(i.a),n},n.interpolator=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return yt(e).domain(t)},o.apply(n,arguments)}function xt(){var t,e,n,i,r,o,a,s=0,c=.5,l=1,u=v,h=!1;function d(t){return isNaN(t=+t)?a:(t=.5+((t=+o(t))-e)*(t<e?i:r),u(h?Math.max(0,Math.min(1,t)):t))}return d.domain=function(a){return arguments.length?(t=o(s=+a[0]),e=o(c=+a[1]),n=o(l=+a[2]),i=t===e?0:.5/(e-t),r=e===n?0:.5/(n-e),d):[s,c,l]},d.clamp=function(t){return arguments.length?(h=!!t,d):h},d.interpolator=function(t){return arguments.length?(u=t,d):u},d.unknown=function(t){return arguments.length?(a=t,d):a},function(a){return o=a,t=a(s),e=a(c),n=a(l),i=t===e?0:.5/(e-t),r=e===n?0:.5/(n-e),d}}function wt(){var t=k(xt()(v));return t.copy=function(){return pt(t,wt())},o.apply(t,arguments)}function Mt(){var t=D(xt()).domain([.1,1,10]);return t.copy=function(){return pt(t,Mt()).base(t.base())},o.apply(t,arguments)}function Et(){var t=H(xt());return t.copy=function(){return pt(t,Et()).constant(t.constant())},o.apply(t,arguments)}function St(){var t=X(xt());return t.copy=function(){return pt(t,St()).exponent(t.exponent())},o.apply(t,arguments)}function At(){return St.apply(null,arguments).exponent(.5)}n.d(e,"scaleBand",function(){return d}),n.d(e,"scalePoint",function(){return f}),n.d(e,"scaleIdentity",function(){return L}),n.d(e,"scaleLinear",function(){return P}),n.d(e,"scaleLog",function(){return j}),n.d(e,"scaleSymlog",function(){return q}),n.d(e,"scaleOrdinal",function(){return h}),n.d(e,"scaleImplicit",function(){return u}),n.d(e,"scalePow",function(){return Y}),n.d(e,"scaleSqrt",function(){return K}),n.d(e,"scaleQuantile",function(){return Z}),n.d(e,"scaleQuantize",function(){return J}),n.d(e,"scaleThreshold",function(){return Q}),n.d(e,"scaleTime",function(){return ht}),n.d(e,"scaleUtc",function(){return dt}),n.d(e,"scaleSequential",function(){return mt}),n.d(e,"scaleSequentialLog",function(){return gt}),n.d(e,"scaleSequentialPow",function(){return vt}),n.d(e,"scaleSequentialSqrt",function(){return bt}),n.d(e,"scaleSequentialSymlog",function(){return _t}),n.d(e,"scaleSequentialQuantile",function(){return yt}),n.d(e,"scaleDiverging",function(){return wt}),n.d(e,"scaleDivergingLog",function(){return Mt}),n.d(e,"scaleDivergingPow",function(){return St}),n.d(e,"scaleDivergingSqrt",function(){return At}),n.d(e,"scaleDivergingSymlog",function(){return Et}),n.d(e,"tickFormat",function(){return T})},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=n(10),o=i(n(2));n(31);const a=i(n(17)),s=i(n(6));Math.log10=Math.log10||function(t){return Math.log(t)/Math.LN10};const c=500,l=["em","ex","px"];e.Axis=class extends r.WidgetView{initialize(){this.setElement(document.createElementNS(o.namespaces.svg,"g")),this.d3el=o.select(this.el),super.initialize.apply(this,arguments)}render(){this.d3el.style("display",this.model.get("visible")?"inline":"none"),this.parent=this.options.parent;const t=this.set_scale_promise(this.model.get("scale")),e=this.get_offset_promise();Promise.all([t,e]).then(()=>{this.create_listeners(),this.tick_format=this.generate_tick_formatter(),this.set_scales_range(),this.append_axis()})}create_listeners(){this.listenTo(this.model,"change:scale",(t,e)=>{this.update_scale(t.previous("scale"),e),this.axis.scale(this.axis_scale.scale),this.rescale_axis()}),this.listenTo(this.model,"change:tick_values",this.set_tick_values),this.listenTo(this.model,"change:tick_format",this.tickformat_changed),this.listenTo(this.model,"change:num_ticks",this.set_tick_values),this.listenTo(this.model,"change:tick_rotate",this.apply_tick_styling),this.listenTo(this.model,"change:tick_style",this.apply_tick_styling),this.model.on_some_change(["label","label_color"],this.update_label,this),this.listenTo(this.model,"change:color",this.update_color),this.model.on_some_change(["grid_color","grid_lines"],this.update_grid_lines,this),this.listenTo(this.model,"change:label_location",this.update_label_location),this.listenTo(this.model,"change:label_offset",this.update_label_offset),this.listenTo(this.model,"change:visible",this.update_visibility),this.model.on_some_change(["side","orientation"],this.update_display,this),this.listenTo(this.model,"change:offset",this.update_offset),this.parent.on("margin_updated",this.parent_margin_updated,this)}update_offset(){this.get_offset_promise().then(()=>{this.set_scales_range(),this.update_offset_scale_domain(),this.g_axisline.attr("transform",this.get_axis_transform()),this.update_grid_lines()})}update_display(){this.g_axisline.remove(),this.set_scales_range(),this.append_axis()}set_tick_values(t){let e=[];const n=this.model.get("tick_values"),i=this.model.get("num_ticks");if(null!=n&&n.length>0)this.axis.tickValues(this.get_ticks_from_array_or_length(n));else if(null!=i)this.axis.tickValues(this.get_ticks_from_array_or_length());else if("ordinal"===this.axis_scale.model.type)this.axis.tickValues(this.axis_scale.scale.domain());else if("date"===this.axis_scale.model.type){const t=this.width<c?5:void 0;this.axis.tickValues(this.axis_scale.scale.ticks(t))}else if("log"===this.axis_scale.model.type){let t,n;const i=this.axis_scale.scale.ticks(),r=Math.abs(Math.log10(this.axis_scale.scale.domain()[1]/this.axis_scale.scale.domain()[0]));if(r<2)this.axis.tickValues(i);else if(r<7){for(e=[],t=0;t<i.length;t++)n=Math.abs(Math.log10(i[t])%1),(Math.abs(n)<.001||Math.abs(n-1)<.001||Math.abs(n-.30103)<.001||Math.abs(n-.69897)<.001)&&e.push(i[t]);this.axis.tickValues(e)}else{e=[];const o=Math.round(r/10);for(t=0;t<i.length;t++)n=Math.abs(Math.log10(i[t])%o),(Math.abs(n)<.001||Math.abs(n-o)<.001)&&e.push(i[t]);this.axis.tickValues(e)}}else this.axis.tickValues(this.axis_scale.scale.ticks());null!==this.model.get("tick_format")&&void 0!==this.model.get("tick_format")||"ordinal"!==this.axis_scale.type&&(this.tick_format=this.guess_tick_format(this.axis.tickValues())),this.axis.tickFormat(this.tick_format),this.g_axisline&&(this.g_axisline.transition("set_tick_values").duration(!0===t?this.parent.model.get("animation_duration"):0).call(this.axis),this.apply_tick_styling())}tickformat_changed(){this.tick_format=this.generate_tick_formatter(),this.axis.tickFormat(this.tick_format),this.g_axisline&&this.g_axisline.call(this.axis),this.apply_tick_styling()}apply_tick_styling(){this.g_axisline.selectAll(".tick text").styles(this.model.get("tick_style")).attr("transform",this.get_tick_transforms())}get_tick_transforms(){return`rotate(${this.model.get("tick_rotate")})`}update_scales(){this.update_scale_domain(),this.update_offset_scale_domain()}update_scale_domain(){const t="vertical"===this.model.get("orientation"),e=t?this.parent.padded_range("y",this.axis_scale.model):this.parent.padded_range("x",this.axis_scale.model),n=t?this.parent.range("y"):this.parent.range("x");this.axis_scale.expand_domain(e,n),this.axis.scale(this.axis_scale.scale)}update_offset_scale_domain(){const t="vertical"===this.model.get("orientation");if(this.offset_scale){const e=t?this.parent.padded_range("x",this.offset_scale.model):this.parent.padded_range("y",this.offset_scale.model),n=t?this.parent.range("x"):this.parent.range("y");this.offset_scale.expand_domain(e,n)}}generate_tick_formatter(){if("date"===this.axis_scale.model.type||"date_color_linear"===this.axis_scale.model.type)return this.model.get("tick_format")?o.timeFormat(this.model.get("tick_format")):this.guess_tick_format();if("ordinal"===this.axis_scale.model.type){const t=this.model.get("tick_format");return t?a.is_valid_time_format(t)?o.timeFormat(t):o.format(t):t=>t}return this.model.get("tick_format")?o.format(this.model.get("tick_format")):this.guess_tick_format()}set_scales_range(){const t="vertical"===this.model.get("orientation");this.axis_scale.set_range(t?[this.height,0]:[0,this.width]),this.offset_scale&&this.offset_scale.set_range(t?[0,this.width]:[this.height,0])}create_axis(){const t="vertical"===this.model.get("orientation"),e=this.model.get("side");this.axis=t?"right"===e?o.axisRight(this.axis_scale.scale):o.axisLeft(this.axis_scale.scale):"top"===e?o.axisTop(this.axis_scale.scale):o.axisBottom(this.axis_scale.scale)}append_axis(){this.create_axis(),this.update_scales(),this.g_axisline=this.d3el.append("g").attr("class","axis").attr("transform",this.get_axis_transform()).call(this.axis),this.g_axisline.append("text").attr("class","axislabel").attrs(this.get_label_attributes()).styles(this.get_text_styling()).text(this.model.get("label")),this.set_tick_values(),this.update_grid_lines(),this.update_color(),this.apply_tick_styling(),this.update_label()}get_offset_promise(){let t=Promise.resolve();const e=this.model.get("offset"),n="vertical"===this.model.get("orientation");return void 0!==e.value&&null!==e.value?(void 0===e.scale?this.offset_scale=n?this.parent.scale_x:this.parent.scale_y:t=this.create_child_view(e.scale).then(t=>{this.offset_scale=t,"ordinal"!==this.offset_scale.model.type&&this.offset_scale.scale.clamp(!0),this.offset_scale.on("domain_changed",()=>{this.update_offset_scale_domain(),this.g_axisline.attr("transform",this.get_axis_transform()),this.update_grid_lines()})}),this.offset_value=e.value):this.offset_scale=this.offset_value=void 0,t}highlight(){this.g_axisline.classed("axisbold",!0)}unhighlight(){this.g_axisline.classed("axisbold",!1)}get_basic_transform(){const t="vertical"===this.model.get("orientation"),e=this.model.get("side");return t?"right"===e?this.width:0:"top"===e?0:this.height}get_axis_transform(){return"vertical"===this.model.get("orientation")?"translate("+this.process_offset()+", 0)":"translate(0, "+this.process_offset()+")"}process_offset(){if(void 0===this.offset_scale||null===this.offset_scale)return this.get_basic_transform();{let t=this.offset_scale.scale(this.offset_value);return t=void 0===t?this.get_basic_transform():t,this.offset_scale.offset+t}}get_label_attributes(){let t=0;const e=this.model.get("label_location"),n=this.calculate_label_offset(),i="vertical"===this.model.get("orientation"),r=this.model.get("side");return i?("start"===e?t=-this.height:"middle"===e&&(t=-this.height/2),"right"===r?{transform:"rotate(-90)",x:t,y:n,dy:"1ex",dx:"0em"}:{transform:"rotate(-90)",x:t,y:n,dy:"0em",dx:"0em"}):("middle"===e?t=this.width/2:"end"===e&&(t=this.width),"top"===r?{x:t,y:n,dy:"0.75ex",dx:"0em",transform:""}:{x:t,y:n,dy:"0.25ex",dx:"0em",transform:""})}get_text_styling(){const t=this.model.get("label_location");return"start"===t?{"text-anchor":"start"}:"end"===t?{"text-anchor":"end"}:{"text-anchor":"middle"}}update_label(){this.g_axisline.select("text.axislabel").text(this.model.get("label")),this.d3el.selectAll(".axislabel").selectAll("text"),""!==this.model.get("label_color")&&null!==this.model.get("label_color")&&(this.g_axisline.select("text.axislabel").style("fill",this.model.get("label_color")),this.d3el.selectAll(".axislabel").selectAll("text").style("fill",this.model.get("label_color")))}update_label_location(){this.g_axisline.select("text.axislabel").attrs(this.get_label_attributes()).styles(this.get_text_styling())}update_label_offset(t,e){this.label_offset=this.calculate_label_offset(),this.g_axisline.select("text.axislabel").attr("y",this.label_offset)}calculate_label_offset(){let t=this.model.get("label_offset");const e="vertical"===this.model.get("orientation"),n=this.model.get("side");t||(t=e?"4ex":"2em");let i=-1;for(let e=0;e<l.length&&-1===i;e++)i=t.indexOf(l[e]);if(-1===i)return t;if("top"===n||"left"===n){const e=-1*parseInt(t.substring(0,i));t=e+t.substring(i)}return t}update_grid_lines(t){const e=this.model.get("grid_lines"),n=this.model.get("side"),i=this.model.get("orientation"),r="vertical"!==i,o=!0===t?this.parent.model.get("animation_duration"):0;let a="vertical"===i?-this.width:-this.height,s=0;if(this.offset_scale){const t=this.offset_scale.scale(this.offset_value);"bottom"===n||"right"==n?(a=-t,s=r?this.height-t:this.width-t):(a+=t,s=-t)}"none"!==e?this.axis.tickSizeInner(a).tickSizeOuter(6):this.axis.tickSize(6),this.g_axisline.selectAll(".tick").classed("short","none"===e),this.g_axisline.transition("update_grid_lines").duration(o).call(this.axis).selectAll(".tick line").attr(r?"y1":"x1",this.offset_scale&&"none"!==e?s:null).style("stroke-dasharray","dashed"===e?"5, 5":null),this.apply_tick_styling(),this.model.get("grid_color")&&this.g_axisline.selectAll(".tick line").style("stroke",this.model.get("grid_color"))}update_color(){this.model.get("color")&&(this.d3el.selectAll(".tick").selectAll("text").style("fill",this.model.get("color")),this.d3el.selectAll(".domain").style("stroke",this.model.get("color")))}redraw_axisline(){this.update_scales(),this.set_tick_values(!0),this.update_grid_lines(!0)}rescale_axis(){this.set_scales_range(),this.update_axis_domain(),this.update_scales(),this.g_axisline.attr("transform",this.get_axis_transform()),this.g_axisline.call(this.axis),this.g_axisline.select("text.axislabel").attrs(this.get_label_attributes()).styles(this.get_text_styling()),this.set_tick_values(),this.update_grid_lines(),this.apply_tick_styling()}update_axis_domain(){const t=this.vertical?this.parent.padded_range("y",this.axis_scale.model):this.parent.padded_range("x",this.axis_scale.model),e=this.vertical?this.parent.range("y"):this.parent.range("x");this.axis_scale.expand_domain(t,e),this.axis.scale(this.axis_scale.scale)}parent_margin_updated(){this.rescale_axis()}update_visibility(t,e){this.d3el.style("display",e?"inline":"none")}get_ticks_from_array_or_length(t){let e,n;const i=this.model.get("num_ticks");if("ordinal"===this.axis_scale.model.type&&(t=this.axis_scale.scale.domain()),null!=i&&i<2)return[];if(t)return null==i||null==i||t.length<=i?t:(e=Math.floor(t.length/(i-1)),s.range(0,t.length,e).map(e=>t[e]));const r=this.axis_scale.scale.domain(),o=this.axis_scale.scale.domain().length-1;return e=(r[o]-r[0])/(i-1),"date"===this.axis_scale.model.type||"date_color_linear"===this.axis_scale.model.type?(r[0]=r[0].getTime(),r[o]=r[o].getTime(),n=r[o]+.5*e,s.range(r[0],n,e).map(t=>new Date(t))):(n=r[o]+.5*e,s.range(r[0],n,e))}set_scale_promise(t){return this.axis_scale&&this.axis_scale.remove(),this.create_child_view(t).then(t=>{this.displayed.then(()=>{t.trigger("displayed")}),this.axis_scale=t,this.axis_scale.on("domain_changed",this.redraw_axisline,this),this.axis_scale.on("highlight_axis",this.highlight,this),this.axis_scale.on("unhighlight_axis",this.unhighlight,this)})}update_scale(t,e){this.axis_scale.off(),this.set_scale_promise(e)}_get_digits(t){return 0===t?1:Math.floor(Math.log10(Math.abs(t)))+1}_replace_trailing_zeros(t){const e=t.search("e");return-1!=e?t.substring(0,e).replace(/(\.[0-9]*?)0+$/gi,"$1").replace(/\.$/,"")+t.substring(e):t.replace(/(\.[0-9]*?)0+$/gi,"$1").replace(/\.$/,"")}get_format_func(t){if(0===t)return t=>o.format("d")(Math.round(t));const e=-1==t?"":"."+t;return t=>{const n=o.format(e+"g")(t);if(n.replace(/-|\.|e/gi,"").length<6)return this._replace_trailing_zeros(n);if(""===e){let n=o.format(e+"e")(t);return n.length>=7&&(n=o.format(".6e")(t)),this._replace_trailing_zeros(n)}return this._replace_trailing_zeros(o.format(e+"e")(t))}}_linear_scale_precision(t){t=null==t?this.axis_scale.scale.ticks():t;const e=Math.abs(t[1]-t[0]),n=Math.max(Math.abs(t[0]),Math.abs(t[t.length-1])),i=this._get_digits(n),r=this._get_digits(e),o=Math.abs(i-r);return i>=0&&r>0?i<=6?0:Math.min(o,6)+1:r<=0?Math.min(Math.abs(r)+i,6)+1:void 0}linear_sc_format(t){return this.get_format_func(this._linear_scale_precision(t))}date_sc_format(t){t=null==t?this.axis_scale.scale.ticks():t;const e=Math.abs(t[1]-t[0]),n=o.timeFormat(".%L"),i=o.timeFormat(":%S"),r=o.timeFormat("%I:%M"),a=o.timeFormat("%I %p"),s=o.timeFormat("%b %d"),c=o.timeFormat("%b %Y"),l=o.timeFormat("%Y");return t=>{let u=1e3;return 0===Math.floor(e/u)?o.timeSecond(t)<t?n(t):o.timeMinute(t)<t?i(t):r(t):0===Math.floor(e/(u*=60))?o.timeMinute(t)<t?i(t):r(t):0===Math.floor(e/(u*=60))?o.timeHour(t)<t?r(t):a(t):0===Math.floor(e/(u*=24))?o.timeDay(t)<t?a(t):s(t):0===Math.floor(e/(u*=27))?o.timeMonth(t)<t?s(t):c(t):0===Math.floor(e/(u*=12))?o.timeMonth(t)<t?s(t):c(t):o.timeMonth(t)<t?s(t):o.timeYear(t)<t?c(t):l(t)}}log_sc_format(t){return this.get_format_func(this._log_sc_precision(t))}_log_sc_precision(t){return t=null==t?this.axis_scale.scale.ticks():t,Math.abs(Math.log10(t[1]/t[0]))>=.301?-1:3}guess_tick_format(t){return"linear"==this.axis_scale.model.type||"color_linear"==this.axis_scale.model.type?this.linear_sc_format(t):"date"==this.axis_scale.model.type||"date_color_linear"==this.axis_scale.model.type?this.date_sc_format(t):"log"==this.axis_scale.model.type?this.log_sc_format(t):void 0}get width(){return this.parent.width-this.parent.margin.right-this.parent.margin.left}get height(){return this.parent.height-this.parent.margin.top-this.parent.margin.bottom}get margin(){return this.parent.margin}}},function(t,e){t.exports=r,r.strict=o,r.loose=a;var n=Object.prototype.toString,i={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function r(t){return o(t)||a(t)}function o(t){return t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array}function a(t){return i[n.call(t)]}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t){t.exports=JSON.parse('{"name":"bqplot","version":"0.5.6","description":"bqplot","author":{"name":"BQPlot Development team","email":"bqplot@bloomberg.net"},"license":"Apache-2.0","main":"lib/index.js","repository":{"type":"git","url":"https://github.com/bloomberg/bqplot.git"},"scripts":{"build":"npm run build:css && npm run build:js && webpack","build:css":"lessc less/bqplot.less css/bqplot.css","build:js":"tsc","watch:js":"tsc --watch","prepublish":"npm run build","test":"karma start --single-run"},"devDependencies":{"@jupyter-widgets/controls":"^1.5.0","@types/chai":"^4.1.7","@types/d3":"^5.7.2","@types/expect.js":"^0.3.29","@types/mocha":"^5.2.7","@types/node":"^12.0.2","@types/sinon":"^7.0.11","chai":"^4.1.2","css-loader":"^3.0.0","file-loader":"^4.0.0","imports-loader":"^0.6.5","json-loader":"^0.5.7","karma":"^4.0.0","karma-chai":"^0.1.0","karma-chrome-launcher":"^2.2.0","karma-mocha":"^1.3.0","karma-mocha-reporter":"^2.2.5","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.7","karma-typescript":"^3.0.9","karma-typescript-es6-transform":"^1.0.3","karma-webpack":"^3.0.5","less":"^3.8.1","less-loader":"^4.1.0","mocha":"^5.2.0","raw-loader":"~2.0.0","rimraf":"^2.6.1","sinon":"^7.3.2","sinon-chai":"^3.3.0","style-loader":"^0.23.1","typescript":"^3.5.2","webpack":"^4.35.0","webpack-cli":"^3.0.8"},"dependencies":{"@jupyter-widgets/base":"^2 || ^3","@phosphor/messaging":"^1","@phosphor/widgets":"^1","d3":"^5.7.0","d3-selection-multi":"^1.0.1","is-typedarray":"^1.0.0","popper.js":"^1.0.0","three":"^0.91.0","topojson":"^1.6.24","underscore":"^1.8.3"},"files":["dist/","css/","lib/","shaders/"],"jupyterlab":{"extension":"lib/jupyterlab-plugin"}}')},function(t,e,n){"use strict";function i(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),i(n(41)),i(n(66)),i(n(176)),i(n(177)),i(n(266)),i(n(131)),i(n(267)),i(n(268)),i(n(269)),i(n(34)),i(n(130)),i(n(270)),i(n(52)),i(n(42)),i(n(271)),i(n(272)),i(n(132)),i(n(273)),i(n(133)),i(n(134)),i(n(83)),i(n(274)),i(n(67)),i(n(13))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){var e;t.getRandomValues=(e="undefined"!=typeof window&&(window.crypto||window.msCrypto)||n(181)||null)&&"function"==typeof e.getRandomValues?function(t){return e.getRandomValues(t)}:e&&"function"==typeof e.randomFillSync?function(t){return e.randomFillSync(t)}:e&&"function"==typeof e.randomBytes?function(t){for(var n=e.randomBytes(t.length),i=0,r=n.length;i<r;++i)t[i]=n[i]}:function(t){for(var e=0,n=0,i=t.length;n<i;++n)n%4==0&&(e=4294967295*Math.random()>>>0),t[n]=255&e,e>>>=8}}(e.Random||(e.Random={}))},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){"use strict";var i=n(5).Buffer,r=n(69).Transform;function o(t){r.call(this),this._block=i.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}n(4)(o,r),o.prototype._transform=function(t,e,n){var i=null;try{this.update(t,e)}catch(t){i=t}n(i)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!i.isBuffer(t)&&"string"!=typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");i.isBuffer(t)||(t=i.from(t,e));for(var n=this._block,r=0;this._blockOffset+t.length-r>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)n[o++]=t[r++];this._update(),this._blockOffset=0}for(;r<t.length;)n[this._blockOffset++]=t[r++];for(var a=0,s=8*t.length;s>0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var n=0;n<4;++n)this._length[n]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},function(t,e,n){"use strict";(function(e,i){var r=n(54);t.exports=b;var o,a=n(94);b.ReadableState=v;n(70).EventEmitter;var s=function(t,e){return t.listeners(e).length},c=n(97),l=n(5).Buffer,u=e.Uint8Array||function(){};var h=n(44);h.inherits=n(4);var d=n(184),f=void 0;f=d&&d.debuglog?d.debuglog("stream"):function(){};var p,m=n(185),g=n(98);h.inherits(b,c);var _=["error","close","destroy","pause","resume"];function v(t,e){t=t||{};var i=e instanceof(o=o||n(36));this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var r=t.highWaterMark,a=t.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=n(73).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function b(t){if(o=o||n(36),!(this instanceof b))return new b(t);this._readableState=new v(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),c.call(this)}function y(t,e,n,i,r){var o,a=t._readableState;null===e?(a.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,E(t)}(t,a)):(r||(o=function(t,e){var n;i=e,l.isBuffer(i)||i instanceof u||"string"==typeof e||void 0===e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var i;return n}(a,e)),o?t.emit("error",o):a.objectMode||e&&e.length>0?("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===l.prototype||(e=function(t){return l.from(t)}(e)),i?a.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):x(t,a,e,!0):a.ended?t.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(e=a.decoder.write(e),a.objectMode||0!==e.length?x(t,a,e,!1):A(t,a)):x(t,a,e,!1))):i||(a.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(a)}function x(t,e,n,i){e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,i?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&E(t)),A(t,e)}Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),b.prototype.destroy=g.destroy,b.prototype._undestroy=g.undestroy,b.prototype._destroy=function(t,e){this.push(null),e(t)},b.prototype.push=function(t,e){var n,i=this._readableState;return i.objectMode?n=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=l.from(t,e),e=""),n=!0),y(this,t,e,!1,n)},b.prototype.unshift=function(t){return y(this,t,null,!0,!1)},b.prototype.isPaused=function(){return!1===this._readableState.flowing},b.prototype.setEncoding=function(t){return p||(p=n(73).StringDecoder),this._readableState.decoder=new p(t),this._readableState.encoding=t,this};var w=8388608;function M(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=w?t=w:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function E(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(f("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?r.nextTick(S,t):S(t))}function S(t){f("emit readable"),t.emit("readable"),L(t)}function A(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(T,t,e))}function T(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(f("maybeReadMore read 0"),t.read(0),n!==e.length);)n=e.length;e.readingMore=!1}function k(t){f("readable nexttick read 0"),t.read(0)}function P(t,e){e.reading||(f("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),L(t),e.flowing&&!e.reading&&t.read(0)}function L(t){var e=t._readableState;for(f("flow",e.flowing);e.flowing&&null!==t.read(););}function O(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=function(t,e,n){var i;t<e.head.data.length?(i=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):i=t===e.head.data.length?e.shift():n?function(t,e){var n=e.head,i=1,r=n.data;t-=r.length;for(;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(a===o.length?r+=o:r+=o.slice(0,t),0===(t-=a)){a===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(a));break}++i}return e.length-=i,r}(t,e):function(t,e){var n=l.allocUnsafe(t),i=e.head,r=1;i.data.copy(n),t-=i.data.length;for(;i=i.next;){var o=i.data,a=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,a),0===(t-=a)){a===o.length?(++r,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=o.slice(a));break}++r}return e.length-=r,n}(t,e);return i}(t,e.buffer,e.decoder),n);var n}function C(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,r.nextTick(R,e,t))}function R(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function I(t,e){for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1}b.prototype.read=function(t){f("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return f("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?C(this):E(this),null;if(0===(t=M(t,e))&&e.ended)return 0===e.length&&C(this),null;var i,r=e.needReadable;return f("need readable",r),(0===e.length||e.length-t<e.highWaterMark)&&f("length less than watermark",r=!0),e.ended||e.reading?f("reading or ended",r=!1):r&&(f("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=M(n,e))),null===(i=t>0?O(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&C(this)),null!==i&&this.emit("data",i),i},b.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(t,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,f("pipe count=%d opts=%j",o.pipesCount,e);var c=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr?u:b;function l(e,i){f("onunpipe"),e===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,f("cleanup"),t.removeListener("close",_),t.removeListener("finish",v),t.removeListener("drain",h),t.removeListener("error",g),t.removeListener("unpipe",l),n.removeListener("end",u),n.removeListener("end",b),n.removeListener("data",m),d=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function u(){f("onend"),t.end()}o.endEmitted?r.nextTick(c):n.once("end",c),t.on("unpipe",l);var h=function(t){return function(){var e=t._readableState;f("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,L(t))}}(n);t.on("drain",h);var d=!1;var p=!1;function m(e){f("ondata"),p=!1,!1!==t.write(e)||p||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==I(o.pipes,t))&&!d&&(f("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,p=!0),n.pause())}function g(e){f("onerror",e),b(),t.removeListener("error",g),0===s(t,"error")&&t.emit("error",e)}function _(){t.removeListener("finish",v),b()}function v(){f("onfinish"),t.removeListener("close",_),b()}function b(){f("unpipe"),n.unpipe(t)}return n.on("data",m),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?a(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",g),t.once("close",_),t.once("finish",v),t.emit("pipe",n),o.flowing||(f("pipe resume"),n.resume()),t},b.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n),this);if(!t){var i=e.pipes,r=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<r;o++)i[o].emit("unpipe",this,n);return this}var a=I(e.pipes,t);return-1===a?this:(e.pipes.splice(a,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,n),this)},b.prototype.on=function(t,e){var n=c.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var i=this._readableState;i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.emittedReadable=!1,i.reading?i.length&&E(this):r.nextTick(k,this))}return n},b.prototype.addListener=b.prototype.on,b.prototype.resume=function(){var t=this._readableState;return t.flowing||(f("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(P,t,e))}(this,t)),this},b.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this},b.prototype.wrap=function(t){var e=this,n=this._readableState,i=!1;for(var r in t.on("end",function(){if(f("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(r){(f("wrapped data"),n.decoder&&(r=n.decoder.write(r)),n.objectMode&&null==r)||(n.objectMode||r&&r.length)&&(e.push(r)||(i=!0,t.pause()))}),t)void 0===this[r]&&"function"==typeof t[r]&&(this[r]=function(e){return function(){return t[e].apply(t,arguments)}}(r));for(var o=0;o<_.length;o++)t.on(_[o],this.emit.bind(this,_[o]));return this._read=function(e){f("wrapped _read",e),i&&(i=!1,t.resume())},this},Object.defineProperty(b.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),b._fromList=O}).call(this,n(25),n(33))},function(t,e,n){t.exports=n(70).EventEmitter},function(t,e,n){"use strict";var i=n(54);function r(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var n=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||i.nextTick(r,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(i.nextTick(r,n,t),n._writableState&&(n._writableState.errorEmitted=!0)):e&&e(t)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(t,e,n){"use strict";t.exports=a;var i=n(36),r=n(44);function o(t,e){var n=this._transformState;n.transforming=!1;var i=n.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=e&&this.push(e),i(t);var r=this._readableState;r.reading=!1,(r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}function a(t){if(!(this instanceof a))return new a(t);i.call(this,t),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",s)}function s(){var t=this;"function"==typeof this._flush?this._flush(function(e,n){c(t,e,n)}):c(this,null,null)}function c(t,e,n){if(e)return t.emit("error",e);if(null!=n&&t.push(n),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}r.inherits=n(4),r.inherits(a,i),a.prototype.push=function(t,e){return this._transformState.needTransform=!1,i.prototype.push.call(this,t,e)},a.prototype._transform=function(t,e,n){throw new Error("_transform() is not implemented")},a.prototype._write=function(t,e,n){var i=this._transformState;if(i.writecb=n,i.writechunk=t,i.writeencoding=e,!i.transforming){var r=this._readableState;(i.needTransform||r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}},a.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},a.prototype._destroy=function(t,e){var n=this;i.prototype._destroy.call(this,t,function(t){e(t),n.emit("close")})}},function(t,e,n){var i=n(4),r=n(39),o=n(5).Buffer,a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function c(){this.init(),this._w=s,r.call(this,64,56)}function l(t,e,n){return n^t&(e^n)}function u(t,e,n){return t&e|n&(t|e)}function h(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function d(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function f(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}i(c,r),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(t){for(var e,n=this._w,i=0|this._a,r=0|this._b,o=0|this._c,s=0|this._d,c=0|this._e,p=0|this._f,m=0|this._g,g=0|this._h,_=0;_<16;++_)n[_]=t.readInt32BE(4*_);for(;_<64;++_)n[_]=0|(((e=n[_-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+n[_-7]+f(n[_-15])+n[_-16];for(var v=0;v<64;++v){var b=g+d(c)+l(c,p,m)+a[v]+n[v]|0,y=h(i)+u(i,r,o)|0;g=m,m=p,p=c,c=s+b|0,s=o,o=r,r=i,i=b+y|0}this._a=i+this._a|0,this._b=r+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},c.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=c},function(t,e,n){var i=n(4),r=n(39),o=n(5).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function c(){this.init(),this._w=s,r.call(this,128,112)}function l(t,e,n){return n^t&(e^n)}function u(t,e,n){return t&e|n&(t|e)}function h(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function d(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function f(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function g(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function _(t,e){return t>>>0<e>>>0?1:0}i(c,r),c.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},c.prototype._update=function(t){for(var e=this._w,n=0|this._ah,i=0|this._bh,r=0|this._ch,o=0|this._dh,s=0|this._eh,c=0|this._fh,v=0|this._gh,b=0|this._hh,y=0|this._al,x=0|this._bl,w=0|this._cl,M=0|this._dl,E=0|this._el,S=0|this._fl,A=0|this._gl,T=0|this._hl,k=0;k<32;k+=2)e[k]=t.readInt32BE(4*k),e[k+1]=t.readInt32BE(4*k+4);for(;k<160;k+=2){var P=e[k-30],L=e[k-30+1],O=f(P,L),C=p(L,P),R=m(P=e[k-4],L=e[k-4+1]),I=g(L,P),z=e[k-14],B=e[k-14+1],N=e[k-32],D=e[k-32+1],j=C+B|0,U=O+z+_(j,C)|0;U=(U=U+R+_(j=j+I|0,I)|0)+N+_(j=j+D|0,D)|0,e[k]=U,e[k+1]=j}for(var F=0;F<160;F+=2){U=e[F],j=e[F+1];var H=u(n,i,r),q=u(y,x,w),G=h(n,y),W=h(y,n),V=d(s,E),X=d(E,s),Y=a[F],K=a[F+1],Z=l(s,c,v),J=l(E,S,A),Q=T+X|0,$=b+V+_(Q,T)|0;$=($=($=$+Z+_(Q=Q+J|0,J)|0)+Y+_(Q=Q+K|0,K)|0)+U+_(Q=Q+j|0,j)|0;var tt=W+q|0,et=G+H+_(tt,W)|0;b=v,T=A,v=c,A=S,c=s,S=E,s=o+$+_(E=M+Q|0,M)|0,o=r,M=w,r=i,w=x,i=n,x=y,n=$+et+_(y=Q+tt|0,Q)|0}this._al=this._al+y|0,this._bl=this._bl+x|0,this._cl=this._cl+w|0,this._dl=this._dl+M|0,this._el=this._el+E|0,this._fl=this._fl+S|0,this._gl=this._gl+A|0,this._hl=this._hl+T|0,this._ah=this._ah+n+_(this._al,y)|0,this._bh=this._bh+i+_(this._bl,x)|0,this._ch=this._ch+r+_(this._cl,w)|0,this._dh=this._dh+o+_(this._dl,M)|0,this._eh=this._eh+s+_(this._el,E)|0,this._fh=this._fh+c+_(this._fl,S)|0,this._gh=this._gh+v+_(this._gl,A)|0,this._hh=this._hh+b+_(this._hl,T)|0},c.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,n,i){t.writeInt32BE(e,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=c},function(t,e,n){"use strict";var i=n(4),r=n(197),o=n(35),a=n(5).Buffer,s=n(103),c=n(74),l=n(75),u=a.alloc(128);function h(t,e){o.call(this,"digest"),"string"==typeof e&&(e=a.from(e));var n="sha512"===t||"sha384"===t?128:64;(this._alg=t,this._key=e,e.length>n)?e=("rmd160"===t?new c:l(t)).update(e).digest():e.length<n&&(e=a.concat([e,u],n));for(var i=this._ipad=a.allocUnsafe(n),r=this._opad=a.allocUnsafe(n),s=0;s<n;s++)i[s]=54^e[s],r[s]=92^e[s];this._hash="rmd160"===t?new c:l(t),this._hash.update(i)}i(h,o),h.prototype._update=function(t){this._hash.update(t)},h.prototype._final=function(){var t=this._hash.digest();return("rmd160"===this._alg?new c:l(this._alg)).update(this._opad).update(t).digest()},t.exports=function(t,e){return"rmd160"===(t=t.toLowerCase())||"ripemd160"===t?new h("rmd160",e):"md5"===t?new r(s,e):new h(t,e)}},function(t,e,n){var i=n(68);t.exports=function(t){return(new i).update(t).digest()}},function(t){t.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},function(t,e,n){e.pbkdf2=n(199),e.pbkdf2Sync=n(108)},function(t,e,n){(function(e){var n=Math.pow(2,30)-1;function i(t,n){if("string"!=typeof t&&!e.isBuffer(t))throw new TypeError(n+" must be a buffer or string")}t.exports=function(t,e,r,o){if(i(t,"Password"),i(e,"Salt"),"number"!=typeof r)throw new TypeError("Iterations not a number");if(r<0)throw new TypeError("Bad iterations");if("number"!=typeof o)throw new TypeError("Key length not a number");if(o<0||o>n||o!=o)throw new TypeError("Bad key length")}}).call(this,n(15).Buffer)},function(t,e,n){(function(e){var n;e.browser?n="utf-8":n=parseInt(e.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary";t.exports=n}).call(this,n(33))},function(t,e,n){var i=n(103),r=n(74),o=n(75),a=n(106),s=n(107),c=n(5).Buffer,l=c.alloc(128),u={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function h(t,e,n){var a=function(t){return"rmd160"===t||"ripemd160"===t?function(t){return(new r).update(t).digest()}:"md5"===t?i:function(e){return o(t).update(e).digest()}}(t),s="sha512"===t||"sha384"===t?128:64;e.length>s?e=a(e):e.length<s&&(e=c.concat([e,l],s));for(var h=c.allocUnsafe(s+u[t]),d=c.allocUnsafe(s+u[t]),f=0;f<s;f++)h[f]=54^e[f],d[f]=92^e[f];var p=c.allocUnsafe(s+n+4);h.copy(p,0,0,s),this.ipad1=p,this.ipad2=h,this.opad=d,this.alg=t,this.blocksize=s,this.hash=a,this.size=u[t]}h.prototype.run=function(t,e){return t.copy(e,this.blocksize),this.hash(e).copy(this.opad,this.blocksize),this.hash(this.opad)},t.exports=function(t,e,n,i,r){a(t,e,n,i),c.isBuffer(t)||(t=c.from(t,s)),c.isBuffer(e)||(e=c.from(e,s));var o=new h(r=r||"sha1",t,e.length),l=c.allocUnsafe(i),d=c.allocUnsafe(e.length+4);e.copy(d,0,0,e.length);for(var f=0,p=u[r],m=Math.ceil(i/p),g=1;g<=m;g++){d.writeUInt32BE(g,e.length);for(var _=o.run(d,o.ipad1),v=_,b=1;b<n;b++){v=o.run(v,o.ipad2);for(var y=0;y<p;y++)_[y]^=v[y]}_.copy(l,f),f+=p}return l}},function(t,e,n){var i=n(45),r=n(5).Buffer,o=n(110);function a(t){var e=t._cipher.encryptBlockRaw(t._prev);return o(t._prev),e}e.encrypt=function(t,e){var n=Math.ceil(e.length/16),o=t._cache.length;t._cache=r.concat([t._cache,r.allocUnsafe(16*n)]);for(var s=0;s<n;s++){var c=a(t),l=o+16*s;t._cache.writeUInt32BE(c[0],l+0),t._cache.writeUInt32BE(c[1],l+4),t._cache.writeUInt32BE(c[2],l+8),t._cache.writeUInt32BE(c[3],l+12)}var u=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),i(e,u)}},function(t,e){t.exports=function(t){for(var e,n=t.length;n--;){if(255!==(e=t.readUInt8(n))){e++,t.writeUInt8(e,n);break}t.writeUInt8(0,n)}}},function(t){t.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},function(t,e,n){var i=n(55),r=n(5).Buffer,o=n(35),a=n(4),s=n(214),c=n(45),l=n(110);function u(t,e,n,a){o.call(this);var c=r.alloc(4,0);this._cipher=new i.AES(e);var u=this._cipher.encryptBlock(c);this._ghash=new s(u),n=function(t,e,n){if(12===e.length)return t._finID=r.concat([e,r.from([0,0,0,1])]),r.concat([e,r.from([0,0,0,2])]);var i=new s(n),o=e.length,a=o%16;i.update(e),a&&(a=16-a,i.update(r.alloc(a,0))),i.update(r.alloc(8,0));var c=8*o,u=r.alloc(8);u.writeUIntBE(c,0,8),i.update(u),t._finID=i.state;var h=r.from(t._finID);return l(h),h}(this,n,u),this._prev=r.from(n),this._cache=r.allocUnsafe(0),this._secCache=r.allocUnsafe(0),this._decrypt=a,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}a(u,o),u.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=r.alloc(e,0),this._ghash.update(e))}this._called=!0;var n=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(n),this._len+=t.length,n},u.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=c(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var n=0;t.length!==e.length&&n++;for(var i=Math.min(t.length,e.length),r=0;r<i;++r)n+=t[r]^e[r];return n}(t,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=t,this._cipher.scrub()},u.prototype.getAuthTag=function(){if(this._decrypt||!r.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},u.prototype.setAuthTag=function(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t},u.prototype.setAAD=function(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length},t.exports=u},function(t,e,n){var i=n(55),r=n(5).Buffer,o=n(35);function a(t,e,n,a){o.call(this),this._cipher=new i.AES(e),this._prev=r.from(n),this._cache=r.allocUnsafe(0),this._secCache=r.allocUnsafe(0),this._decrypt=a,this._mode=t}n(4)(a,o),a.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},a.prototype._final=function(){this._cipher.scrub()},t.exports=a},function(t,e,n){var i=n(38);t.exports=v,v.simpleSieve=g,v.fermatTest=_;var r=n(11),o=new r(24),a=new(n(115)),s=new r(1),c=new r(2),l=new r(5),u=(new r(16),new r(8),new r(10)),h=new r(3),d=(new r(7),new r(11)),f=new r(4),p=(new r(12),null);function m(){if(null!==p)return p;var t=[];t[0]=2;for(var e=1,n=3;n<1048576;n+=2){for(var i=Math.ceil(Math.sqrt(n)),r=0;r<e&&t[r]<=i&&n%t[r]!=0;r++);e!==r&&t[r]<=i||(t[e++]=n)}return p=t,t}function g(t){for(var e=m(),n=0;n<e.length;n++)if(0===t.modn(e[n]))return 0===t.cmpn(e[n]);return!0}function _(t){var e=r.mont(t);return 0===c.toRed(e).redPow(t.subn(1)).fromRed().cmpn(1)}function v(t,e){if(t<16)return new r(2===e||5===e?[140,123]:[140,39]);var n,p;for(e=new r(e);;){for(n=new r(i(Math.ceil(t/8)));n.bitLength()>t;)n.ishrn(1);if(n.isEven()&&n.iadd(s),n.testn(1)||n.iadd(c),e.cmp(c)){if(!e.cmp(l))for(;n.mod(u).cmp(h);)n.iadd(f)}else for(;n.mod(o).cmp(d);)n.iadd(f);if(g(p=n.shrn(1))&&g(n)&&_(p)&&_(n)&&a.test(p)&&a.test(n))return n}}},function(t,e,n){var i=n(11),r=n(116);function o(t){this.rand=t||new r.Rand}t.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),n=Math.ceil(e/8);do{var r=new i(this.rand.generate(n))}while(r.cmp(t)>=0);return r},o.prototype._randrange=function(t,e){var n=e.sub(t);return t.add(this._randbelow(n))},o.prototype.test=function(t,e,n){var r=t.bitLength(),o=i.mont(t),a=new i(1).toRed(o);e||(e=Math.max(1,r/48|0));for(var s=t.subn(1),c=0;!s.testn(c);c++);for(var l=t.shrn(c),u=s.toRed(o);e>0;e--){var h=this._randrange(new i(2),s);n&&n(h);var d=h.toRed(o).redPow(l);if(0!==d.cmp(a)&&0!==d.cmp(u)){for(var f=1;f<c;f++){if(0===(d=d.redSqr()).cmp(a))return!1;if(0===d.cmp(u))break}if(f===c)return!1}}return!0},o.prototype.getDivisor=function(t,e){var n=t.bitLength(),r=i.mont(t),o=new i(1).toRed(r);e||(e=Math.max(1,n/48|0));for(var a=t.subn(1),s=0;!a.testn(s);s++);for(var c=t.shrn(s),l=a.toRed(r);e>0;e--){var u=this._randrange(new i(2),a),h=t.gcd(u);if(0!==h.cmpn(1))return h;var d=u.toRed(r).redPow(c);if(0!==d.cmp(o)&&0!==d.cmp(l)){for(var f=1;f<s;f++){if(0===(d=d.redSqr()).cmp(o))return d.fromRed().subn(1).gcd(t);if(0===d.cmp(l))break}if(f===s)return(d=d.redSqr()).fromRed().subn(1).gcd(t)}}return!1}},function(t,e,n){var i;function r(t){this.rand=t}if(t.exports=function(t){return i||(i=new r(null)),i.generate(t)},t.exports.Rand=r,r.prototype.generate=function(t){return this._rand(t)},r.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),n=0;n<e.length;n++)e[n]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?r.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?r.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(r.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=n(219);if("function"!=typeof o.randomBytes)throw new Error("Not supported");r.prototype._rand=function(t){return o.randomBytes(t)}}catch(t){}},function(t,e,n){"use strict";var i=e;function r(t){return 1===t.length?"0"+t:t}function o(t){for(var e="",n=0;n<t.length;n++)e+=r(t[n].toString(16));return e}i.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"!=typeof t){for(var i=0;i<t.length;i++)n[i]=0|t[i];return n}if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)n.push(parseInt(t[i]+t[i+1],16));else for(i=0;i<t.length;i++){var r=t.charCodeAt(i),o=r>>8,a=255&r;o?n.push(o,a):n.push(a)}return n},i.zero2=r,i.toHex=o,i.encode=function(t,e){return"hex"===e?o(t):t}},function(t,e,n){"use strict";var i=n(30).rotr32;function r(t,e,n){return t&e^~t&n}function o(t,e,n){return t&e^t&n^e&n}function a(t,e,n){return t^e^n}e.ft_1=function(t,e,n,i){return 0===t?r(e,n,i):1===t||3===t?a(e,n,i):2===t?o(e,n,i):void 0},e.ch32=r,e.maj32=o,e.p32=a,e.s0_256=function(t){return i(t,2)^i(t,13)^i(t,22)},e.s1_256=function(t){return i(t,6)^i(t,11)^i(t,25)},e.g0_256=function(t){return i(t,7)^i(t,18)^t>>>3},e.g1_256=function(t){return i(t,17)^i(t,19)^t>>>10}},function(t,e,n){"use strict";var i=n(30),r=n(46),o=n(118),a=n(22),s=i.sum32,c=i.sum32_4,l=i.sum32_5,u=o.ch32,h=o.maj32,d=o.s0_256,f=o.s1_256,p=o.g0_256,m=o.g1_256,g=r.BlockHash,_=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=_,this.W=new Array(64)}i.inherits(v,g),t.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(t,e){for(var n=this.W,i=0;i<16;i++)n[i]=t[e+i];for(;i<n.length;i++)n[i]=c(m(n[i-2]),n[i-7],p(n[i-15]),n[i-16]);var r=this.h[0],o=this.h[1],g=this.h[2],_=this.h[3],v=this.h[4],b=this.h[5],y=this.h[6],x=this.h[7];for(a(this.k.length===n.length),i=0;i<n.length;i++){var w=l(x,f(v),u(v,b,y),this.k[i],n[i]),M=s(d(r),h(r,o,g));x=y,y=b,b=v,v=s(_,w),_=g,g=o,o=r,r=s(w,M)}this.h[0]=s(this.h[0],r),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],g),this.h[3]=s(this.h[3],_),this.h[4]=s(this.h[4],v),this.h[5]=s(this.h[5],b),this.h[6]=s(this.h[6],y),this.h[7]=s(this.h[7],x)},v.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},function(t,e,n){"use strict";var i=n(30),r=n(46),o=n(22),a=i.rotr64_hi,s=i.rotr64_lo,c=i.shr64_hi,l=i.shr64_lo,u=i.sum64,h=i.sum64_hi,d=i.sum64_lo,f=i.sum64_4_hi,p=i.sum64_4_lo,m=i.sum64_5_hi,g=i.sum64_5_lo,_=r.BlockHash,v=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function b(){if(!(this instanceof b))return new b;_.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function y(t,e,n,i,r){var o=t&n^~t&r;return o<0&&(o+=4294967296),o}function x(t,e,n,i,r,o){var a=e&i^~e&o;return a<0&&(a+=4294967296),a}function w(t,e,n,i,r){var o=t&n^t&r^n&r;return o<0&&(o+=4294967296),o}function M(t,e,n,i,r,o){var a=e&i^e&o^i&o;return a<0&&(a+=4294967296),a}function E(t,e){var n=a(t,e,28)^a(e,t,2)^a(e,t,7);return n<0&&(n+=4294967296),n}function S(t,e){var n=s(t,e,28)^s(e,t,2)^s(e,t,7);return n<0&&(n+=4294967296),n}function A(t,e){var n=a(t,e,14)^a(t,e,18)^a(e,t,9);return n<0&&(n+=4294967296),n}function T(t,e){var n=s(t,e,14)^s(t,e,18)^s(e,t,9);return n<0&&(n+=4294967296),n}function k(t,e){var n=a(t,e,1)^a(t,e,8)^c(t,e,7);return n<0&&(n+=4294967296),n}function P(t,e){var n=s(t,e,1)^s(t,e,8)^l(t,e,7);return n<0&&(n+=4294967296),n}function L(t,e){var n=a(t,e,19)^a(e,t,29)^c(t,e,6);return n<0&&(n+=4294967296),n}function O(t,e){var n=s(t,e,19)^s(e,t,29)^l(t,e,6);return n<0&&(n+=4294967296),n}i.inherits(b,_),t.exports=b,b.blockSize=1024,b.outSize=512,b.hmacStrength=192,b.padLength=128,b.prototype._prepareBlock=function(t,e){for(var n=this.W,i=0;i<32;i++)n[i]=t[e+i];for(;i<n.length;i+=2){var r=L(n[i-4],n[i-3]),o=O(n[i-4],n[i-3]),a=n[i-14],s=n[i-13],c=k(n[i-30],n[i-29]),l=P(n[i-30],n[i-29]),u=n[i-32],h=n[i-31];n[i]=f(r,o,a,s,c,l,u,h),n[i+1]=p(r,o,a,s,c,l,u,h)}},b.prototype._update=function(t,e){this._prepareBlock(t,e);var n=this.W,i=this.h[0],r=this.h[1],a=this.h[2],s=this.h[3],c=this.h[4],l=this.h[5],f=this.h[6],p=this.h[7],_=this.h[8],v=this.h[9],b=this.h[10],k=this.h[11],P=this.h[12],L=this.h[13],O=this.h[14],C=this.h[15];o(this.k.length===n.length);for(var R=0;R<n.length;R+=2){var I=O,z=C,B=A(_,v),N=T(_,v),D=y(_,v,b,k,P),j=x(_,v,b,k,P,L),U=this.k[R],F=this.k[R+1],H=n[R],q=n[R+1],G=m(I,z,B,N,D,j,U,F,H,q),W=g(I,z,B,N,D,j,U,F,H,q);I=E(i,r),z=S(i,r),B=w(i,r,a,s,c),N=M(i,r,a,s,c,l);var V=h(I,z,B,N),X=d(I,z,B,N);O=P,C=L,P=b,L=k,b=_,k=v,_=h(f,p,G,W),v=d(p,p,G,W),f=c,p=l,c=a,l=s,a=i,s=r,i=h(G,W,V,X),r=d(G,W,V,X)}u(this.h,0,i,r),u(this.h,2,a,s),u(this.h,4,c,l),u(this.h,6,f,p),u(this.h,8,_,v),u(this.h,10,b,k),u(this.h,12,P,L),u(this.h,14,O,C)},b.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},function(t,e,n){var i=n(4),r=n(48).Reporter,o=n(15).Buffer;function a(t,e){r.call(this,e),o.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function s(t,e){if(Array.isArray(t))this.length=0,this.value=t.map(function(t){return t instanceof s||(t=new s(t,e)),this.length+=t.length,t},this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=o.byteLength(t);else{if(!o.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}i(a,r),e.DecoderBuffer=a,a.prototype.save=function(){return{offset:this.offset,reporter:r.prototype.save.call(this)}},a.prototype.restore=function(t){var e=new a(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,r.prototype.restore.call(this,t.reporter),e},a.prototype.isEmpty=function(){return this.offset===this.length},a.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},a.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");var n=new a(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+t,this.offset+=t,n},a.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},e.EncoderBuffer=s,s.prototype.join=function(t,e){return t||(t=new o(this.length)),e||(e=0),0===this.length?t:(Array.isArray(this.value)?this.value.forEach(function(n){n.join(t,e),e+=n.length}):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):o.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length),t)}},function(t,e,n){var i=e;i._reverse=function(t){var e={};return Object.keys(t).forEach(function(n){(0|n)==n&&(n|=0);var i=t[n];e[i]=n}),e},i.der=n(250)},function(t,e,n){var i=n(4),r=n(47),o=r.base,a=r.bignum,s=r.constants.der;function c(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new l,this.tree._init(t.body)}function l(t){o.Node.call(this,"der",t)}function u(t,e){var n=t.readUInt8(e);if(t.isError(n))return n;var i=s.tagClass[n>>6],r=0==(32&n);if(31==(31&n)){var o=n;for(n=0;128==(128&o);){if(o=t.readUInt8(e),t.isError(o))return o;n<<=7,n|=127&o}}else n&=31;return{cls:i,primitive:r,tag:n,tagStr:s.tag[n]}}function h(t,e,n){var i=t.readUInt8(n);if(t.isError(i))return i;if(!e&&128===i)return null;if(0==(128&i))return i;var r=127&i;if(r>4)return t.error("length octect is too long");i=0;for(var o=0;o<r;o++){i<<=8;var a=t.readUInt8(n);if(t.isError(a))return a;i|=a}return i}t.exports=c,c.prototype.decode=function(t,e){return t instanceof o.DecoderBuffer||(t=new o.DecoderBuffer(t,e)),this.tree._decode(t,e)},i(l,o.Node),l.prototype._peekTag=function(t,e,n){if(t.isEmpty())return!1;var i=t.save(),r=u(t,'Failed to peek tag: "'+e+'"');return t.isError(r)?r:(t.restore(i),r.tag===e||r.tagStr===e||r.tagStr+"of"===e||n)},l.prototype._decodeTag=function(t,e,n){var i=u(t,'Failed to decode tag of "'+e+'"');if(t.isError(i))return i;var r=h(t,i.primitive,'Failed to get length of "'+e+'"');if(t.isError(r))return r;if(!n&&i.tag!==e&&i.tagStr!==e&&i.tagStr+"of"!==e)return t.error('Failed to match tag: "'+e+'"');if(i.primitive||null!==r)return t.skip(r,'Failed to match body of: "'+e+'"');var o=t.save(),a=this._skipUntilEnd(t,'Failed to skip indefinite length body: "'+this.tag+'"');return t.isError(a)?a:(r=t.offset-o.offset,t.restore(o),t.skip(r,'Failed to match body of: "'+e+'"'))},l.prototype._skipUntilEnd=function(t,e){for(;;){var n=u(t,e);if(t.isError(n))return n;var i,r=h(t,n.primitive,e);if(t.isError(r))return r;if(i=n.primitive||null!==r?t.skip(r):this._skipUntilEnd(t,e),t.isError(i))return i;if("end"===n.tagStr)break}},l.prototype._decodeList=function(t,e,n,i){for(var r=[];!t.isEmpty();){var o=this._peekTag(t,"end");if(t.isError(o))return o;var a=n.decode(t,"der",i);if(t.isError(a)&&o)break;r.push(a)}return r},l.prototype._decodeStr=function(t,e){if("bitstr"===e){var n=t.readUInt8();return t.isError(n)?n:{unused:n,data:t.raw()}}if("bmpstr"===e){var i=t.raw();if(i.length%2==1)return t.error("Decoding of string type: bmpstr length mismatch");for(var r="",o=0;o<i.length/2;o++)r+=String.fromCharCode(i.readUInt16BE(2*o));return r}if("numstr"===e){var a=t.raw().toString("ascii");return this._isNumstr(a)?a:t.error("Decoding of string type: numstr unsupported characters")}if("octstr"===e)return t.raw();if("objDesc"===e)return t.raw();if("printstr"===e){var s=t.raw().toString("ascii");return this._isPrintstr(s)?s:t.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(e)?t.raw().toString():t.error("Decoding of string type: "+e+" unsupported")},l.prototype._decodeObjid=function(t,e,n){for(var i,r=[],o=0;!t.isEmpty();){var a=t.readUInt8();o<<=7,o|=127&a,0==(128&a)&&(r.push(o),o=0)}128&a&&r.push(o);var s=r[0]/40|0,c=r[0]%40;if(i=n?r:[s,c].concat(r.slice(1)),e){var l=e[i.join(" ")];void 0===l&&(l=e[i.join(".")]),void 0!==l&&(i=l)}return i},l.prototype._decodeTime=function(t,e){var n=t.raw().toString();if("gentime"===e)var i=0|n.slice(0,4),r=0|n.slice(4,6),o=0|n.slice(6,8),a=0|n.slice(8,10),s=0|n.slice(10,12),c=0|n.slice(12,14);else{if("utctime"!==e)return t.error("Decoding "+e+" time is not supported yet");i=0|n.slice(0,2),r=0|n.slice(2,4),o=0|n.slice(4,6),a=0|n.slice(6,8),s=0|n.slice(8,10),c=0|n.slice(10,12);i=i<70?2e3+i:1900+i}return Date.UTC(i,r-1,o,a,s,c,0)},l.prototype._decodeNull=function(t){return null},l.prototype._decodeBool=function(t){var e=t.readUInt8();return t.isError(e)?e:0!==e},l.prototype._decodeInt=function(t,e){var n=t.raw(),i=new a(n);return e&&(i=e[i.toString(10)]||i),i},l.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getDecoder("der").tree}},function(t,e,n){var i=n(4),r=n(15).Buffer,o=n(47),a=o.base,s=o.constants.der;function c(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new l,this.tree._init(t.body)}function l(t){a.Node.call(this,"der",t)}function u(t){return t<10?"0"+t:t}t.exports=c,c.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},i(l,a.Node),l.prototype._encodeComposite=function(t,e,n,i){var o,a=function(t,e,n,i){var r;"seqof"===t?t="seq":"setof"===t&&(t="set");if(s.tagByName.hasOwnProperty(t))r=s.tagByName[t];else{if("number"!=typeof t||(0|t)!==t)return i.error("Unknown tag: "+t);r=t}if(r>=31)return i.error("Multi-octet tag encoding unsupported");e||(r|=32);return r|=s.tagClassByName[n||"universal"]<<6}(t,e,n,this.reporter);if(i.length<128)return(o=new r(2))[0]=a,o[1]=i.length,this._createEncoderBuffer([o,i]);for(var c=1,l=i.length;l>=256;l>>=8)c++;(o=new r(2+c))[0]=a,o[1]=128|c;l=1+c;for(var u=i.length;u>0;l--,u>>=8)o[l]=255&u;return this._createEncoderBuffer([o,i])},l.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){for(var n=new r(2*t.length),i=0;i<t.length;i++)n.writeUInt16BE(t.charCodeAt(i),2*i);return this._createEncoderBuffer(n)}return"numstr"===e?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===e?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(e)?this._createEncoderBuffer(t):"objDesc"===e?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+e+" unsupported")},l.prototype._encodeObjid=function(t,e,n){if("string"==typeof t){if(!e)return this.reporter.error("string objid given, but no values map found");if(!e.hasOwnProperty(t))return this.reporter.error("objid not found in values map");t=e[t].split(/[\s\.]+/g);for(var i=0;i<t.length;i++)t[i]|=0}else if(Array.isArray(t)){t=t.slice();for(i=0;i<t.length;i++)t[i]|=0}if(!Array.isArray(t))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(t));if(!n){if(t[1]>=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}var o=0;for(i=0;i<t.length;i++){var a=t[i];for(o++;a>=128;a>>=7)o++}var s=new r(o),c=s.length-1;for(i=t.length-1;i>=0;i--){a=t[i];for(s[c--]=127&a;(a>>=7)>0;)s[c--]=128|127&a}return this._createEncoderBuffer(s)},l.prototype._encodeTime=function(t,e){var n,i=new Date(t);return"gentime"===e?n=[u(i.getFullYear()),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):"utctime"===e?n=[u(i.getFullYear()%100),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(n,"octstr")},l.prototype._encodeNull=function(){return this._createEncoderBuffer("")},l.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!r.isBuffer(t)){var n=t.toArray();!t.sign&&128&n[0]&&n.unshift(0),t=new r(n)}if(r.isBuffer(t)){var i=t.length;0===t.length&&i++;var o=new r(i);return t.copy(o),0===t.length&&(o[0]=0),this._createEncoderBuffer(o)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);i=1;for(var a=t;a>=256;a>>=8)i++;for(a=(o=new Array(i)).length-1;a>=0;a--)o[a]=255&t,t>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new r(o))},l.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},l.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},l.prototype._skipDefault=function(t,e,n){var i,r=this._baseState;if(null===r.default)return!1;var o=t.join();if(void 0===r.defaultBuffer&&(r.defaultBuffer=this._encodeValue(r.default,e,n).join()),o.length!==r.defaultBuffer.length)return!1;for(i=0;i<o.length;i++)if(o[i]!==r.defaultBuffer[i])return!1;return!0}},function(t){t.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},function(t,e,n){var i=n(43),r=n(5).Buffer;function o(t){var e=r.allocUnsafe(4);return e.writeUInt32BE(t,0),e}t.exports=function(t,e){for(var n,a=r.alloc(0),s=0;a.length<e;)n=o(s++),a=r.concat([a,i("sha1").update(t).update(n).digest()]);return a.slice(0,e)}},function(t,e){t.exports=function(t,e){for(var n=t.length,i=-1;++i<n;)t[i]^=e[i];return t}},function(t,e,n){var i=n(11),r=n(5).Buffer;t.exports=function(t,e){return r.from(t.toRed(i.mont(e.modulus)).redPow(new i(e.publicExponent)).fromRed().toArray())}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(9),o=n(53),a=n(81),s=n(16),c=n(82),l=n(21),u=function(){function t(){this._timerID=0,this._replaying=!1,this._keystrokes=[],this._keydownEvents=[],this._keyBindings=[],this._exactKeyMatch=null,this._commands=Object.create(null),this._commandChanged=new l.Signal(this),this._commandExecuted=new l.Signal(this),this._keyBindingChanged=new l.Signal(this)}return Object.defineProperty(t.prototype,"commandChanged",{get:function(){return this._commandChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"commandExecuted",{get:function(){return this._commandExecuted},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keyBindingChanged",{get:function(){return this._keyBindingChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keyBindings",{get:function(){return this._keyBindings},enumerable:!0,configurable:!0}),t.prototype.listCommands=function(){return Object.keys(this._commands)},t.prototype.hasCommand=function(t){return t in this._commands},t.prototype.addCommand=function(t,e){var n=this;if(t in this._commands)throw new Error("Command '"+t+"' already registered.");return this._commands[t]=i.createCommand(e),this._commandChanged.emit({id:t,type:"added"}),new a.DisposableDelegate(function(){delete n._commands[t],n._commandChanged.emit({id:t,type:"removed"})})},t.prototype.notifyCommandChanged=function(t){if(void 0!==t&&!(t in this._commands))throw new Error("Command '"+t+"' is not registered.");this._commandChanged.emit({id:t,type:t?"changed":"many-changed"})},t.prototype.label=function(t,e){void 0===e&&(e=o.JSONExt.emptyObject);var n=this._commands[t];return n?n.label.call(void 0,e):""},t.prototype.mnemonic=function(t,e){void 0===e&&(e=o.JSONExt.emptyObject);var n=this._commands[t];return n?n.mnemonic.call(void 0,e):-1},t.prototype.icon=function(t,e){return void 0===e&&(e=o.JSONExt.emptyObject),this.iconClass(t,e)},t.prototype.iconClass=function(t,e){void 0===e&&(e=o.JSONExt.emptyObject);var n=this._commands[t];return n?n.iconClass.call(void 0,e):""},t.prototype.iconLabel=function(t,e){void 0===e&&(e=o.JSONExt.emptyObject);var n=this._commands[t];return n?n.iconLabel.call(void 0,e):""},t.prototype.caption=function(t,e){void 0===e&&(e=o.JSONExt.emptyObject);var n=this._commands[t];return n?n.caption.call(void 0,e):""},t.prototype.usage=function(t,e){void 0===e&&(e=o.JSONExt.emptyObject);var n=this._commands[t];return n?n.usage.call(void 0,e):""},t.prototype.className=function(t,e){void 0===e&&(e=o.JSONExt.emptyObject);var n=this._commands[t];return n?n.className.call(void 0,e):""},t.prototype.dataset=function(t,e){void 0===e&&(e=o.JSONExt.emptyObject);var n=this._commands[t];return n?n.dataset.call(void 0,e):{}},t.prototype.isEnabled=function(t,e){void 0===e&&(e=o.JSONExt.emptyObject);var n=this._commands[t];return!!n&&n.isEnabled.call(void 0,e)},t.prototype.isToggled=function(t,e){void 0===e&&(e=o.JSONExt.emptyObject);var n=this._commands[t];return!!n&&n.isToggled.call(void 0,e)},t.prototype.isVisible=function(t,e){void 0===e&&(e=o.JSONExt.emptyObject);var n=this._commands[t];return!!n&&n.isVisible.call(void 0,e)},t.prototype.execute=function(t,e){void 0===e&&(e=o.JSONExt.emptyObject);var n,i=this._commands[t];if(!i)return Promise.reject(new Error("Command '"+t+"' not registered."));try{n=i.execute.call(void 0,e)}catch(t){n=Promise.reject(t)}var r=Promise.resolve(n);return this._commandExecuted.emit({id:t,args:e,result:r}),r},t.prototype.addKeyBinding=function(t){var e=this,n=i.createKeyBinding(t);return this._keyBindings.push(n),this._keyBindingChanged.emit({binding:n,type:"added"}),new a.DisposableDelegate(function(){r.ArrayExt.removeFirstOf(e._keyBindings,n),e._keyBindingChanged.emit({binding:n,type:"removed"})})},t.prototype.processKeydownEvent=function(e){if(!this._replaying){var n=t.keystrokeForKeydownEvent(e);if(!n)return this._replayKeydownEvents(),void this._clearPendingState();this._keystrokes.push(n);var r=i.matchKeyBinding(this._keyBindings,this._keystrokes,e),o=r.exact,a=r.partial;if(!o&&!a)return this._replayKeydownEvents(),void this._clearPendingState();if(e.preventDefault(),e.stopPropagation(),o&&!a)return this._executeKeyBinding(o),void this._clearPendingState();o&&(this._exactKeyMatch=o),this._keydownEvents.push(e),this._startTimer()}},t.prototype._startTimer=function(){var t=this;this._clearTimer(),this._timerID=window.setTimeout(function(){t._onPendingTimeout()},i.CHORD_TIMEOUT)},t.prototype._clearTimer=function(){0!==this._timerID&&(clearTimeout(this._timerID),this._timerID=0)},t.prototype._replayKeydownEvents=function(){0!==this._keydownEvents.length&&(this._replaying=!0,this._keydownEvents.forEach(i.replayKeyEvent),this._replaying=!1)},t.prototype._executeKeyBinding=function(t){var e=t.command,n=t.args;if(this.hasCommand(e)&&this.isEnabled(e,n))this.execute(e,n);else{var i=this.hasCommand(e)?"enabled":"registered",r="Cannot execute key binding '"+t.keys.join(", ")+"':",o="command '"+e+"' is not "+i+".";console.warn(r+" "+o)}},t.prototype._clearPendingState=function(){this._clearTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0},t.prototype._onPendingTimeout=function(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()},t}();e.CommandRegistry=u,function(t){function e(t){for(var e="",n=!1,i=!1,r=!1,o=!1,a=0,c=t.split(/\s+/);a<c.length;a++){var l=c[a];"Accel"===l?s.Platform.IS_MAC?i=!0:r=!0:"Alt"===l?n=!0:"Cmd"===l?i=!0:"Ctrl"===l?r=!0:"Shift"===l?o=!0:l.length>0&&(e=l)}return{cmd:i,ctrl:r,alt:n,shift:o,key:e}}t.parseKeystroke=e,t.normalizeKeystroke=function(t){var n="",i=e(t);return i.ctrl&&(n+="Ctrl "),i.alt&&(n+="Alt "),i.shift&&(n+="Shift "),i.cmd&&s.Platform.IS_MAC&&(n+="Cmd "),n+i.key},t.formatKeystroke=function(t){var n="",i=e(t);return s.Platform.IS_MAC?(i.ctrl&&(n+="⌃ "),i.alt&&(n+="⌥ "),i.shift&&(n+="⇧ "),i.cmd&&(n+="⌘ ")):(i.ctrl&&(n+="Ctrl+"),i.alt&&(n+="Alt+"),i.shift&&(n+="Shift+")),n+i.key},t.keystrokeForKeydownEvent=function(t){var e=c.getKeyboardLayout().keyForKeydownEvent(t);if(!e)return"";var n="";return t.ctrlKey&&(n+="Ctrl "),t.altKey&&(n+="Alt "),t.shiftKey&&(n+="Shift "),t.metaKey&&s.Platform.IS_MAC&&(n+="Cmd "),n+e}}(u=e.CommandRegistry||(e.CommandRegistry={})),e.CommandRegistry=u,function(t){t.CHORD_TIMEOUT=1e3,t.createCommand=function(t){return{execute:t.execute,label:c(t.label,e),mnemonic:c(t.mnemonic,n),iconClass:c(t.iconClass||t.icon,e),iconLabel:c(t.iconLabel,e),caption:c(t.caption,e),usage:c(t.usage,e),className:c(t.className,e),dataset:c(t.dataset,a),isEnabled:t.isEnabled||i,isToggled:t.isToggled||r,isVisible:t.isVisible||i}},t.createKeyBinding=function(t){return{keys:l(t),selector:h(t),command:t.command,args:t.args||o.JSONExt.emptyObject}},t.matchKeyBinding=function(t,e,n){for(var i=null,r=!1,o=1/0,a=0,c=0,l=t.length;c<l;++c){var u=t[c],h=d(u.keys,e);if(0!==h)if(2!==h){var p=f(u.selector,n);if(!(-1===p||p>o)){var m=s.Selector.calculateSpecificity(u.selector);(!i||p<o||m>=a)&&(i=u,o=p,a=m)}}else r||-1===f(u.selector,n)||(r=!0)}return{exact:i,partial:r}},t.replayKeyEvent=function(t){t.target.dispatchEvent(function(t){var e=document.createEvent("Event"),n=t.bubbles||!0,i=t.cancelable||!0;return e.initEvent(t.type||"keydown",n,i),e.key=t.key||"",e.keyCode=t.keyCode||0,e.which=t.keyCode||0,e.ctrlKey=t.ctrlKey||!1,e.altKey=t.altKey||!1,e.shiftKey=t.shiftKey||!1,e.metaKey=t.metaKey||!1,e.view=t.view||window,e}(t))};var e=function(){return""},n=function(){return-1},i=function(){return!0},r=function(){return!1},a=function(){return{}};function c(t,e){return void 0===t?e:"function"==typeof t?t:function(){return t}}function l(t){return(s.Platform.IS_WIN?t.winKeys||t.keys:s.Platform.IS_MAC?t.macKeys||t.keys:t.linuxKeys||t.keys).map(u.normalizeKeystroke)}function h(t){if(-1!==t.selector.indexOf(","))throw new Error("Selector cannot contain commas: "+t.selector);if(!s.Selector.isValid(t.selector))throw new Error("Invalid selector: "+t.selector);return t.selector}function d(t,e){if(t.length<e.length)return 0;for(var n=0,i=e.length;n<i;++n)if(t[n]!==e[n])return 0;return t.length>e.length?2:1}function f(t,e){for(var n=e.target,i=e.currentTarget,r=0;null!==n;n=n.parentElement,++r){if(s.Selector.matches(n,t))return r;if(n===i)return-1}return-1}}(i||(i={}))},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var a,s=n(9),c=n(129),l=n(53),u=n(16),h=n(82),d=n(14),f=n(21),p=n(59),m=n(13),g=function(t){function e(n){var i=t.call(this,{node:a.createNode()})||this;return i._childIndex=-1,i._activeIndex=-1,i._openTimerID=0,i._closeTimerID=0,i._items=[],i._childMenu=null,i._parentMenu=null,i._aboutToClose=new f.Signal(i),i._menuRequested=new f.Signal(i),i.addClass("p-Menu"),i.setFlag(m.Widget.Flag.DisallowLayout),i.commands=n.commands,i.renderer=n.renderer||e.defaultRenderer,i}return r(e,t),e.prototype.dispose=function(){this.close(),this._items.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"aboutToClose",{get:function(){return this._aboutToClose},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"menuRequested",{get:function(){return this._menuRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentMenu",{get:function(){return this._parentMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rootMenu",{get:function(){for(var t=this;t._parentMenu;)t=t._parentMenu;return t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leafMenu",{get:function(){for(var t=this;t._childMenu;)t=t._childMenu;return t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("p-Menu-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeItem",{get:function(){return this._items[this._activeIndex]||null},set:function(t){this.activeIndex=t?this._items.indexOf(t):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(t){(t<0||t>=this._items.length)&&(t=-1),-1===t||a.canActivate(this._items[t])||(t=-1),this._activeIndex!==t&&(this._activeIndex=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),e.prototype.activateNextItem=function(){var t=this._items.length,e=this._activeIndex,n=e<t-1?e+1:0,i=0===n?t-1:n-1;this.activeIndex=s.ArrayExt.findFirstIndex(this._items,a.canActivate,n,i)},e.prototype.activatePreviousItem=function(){var t=this._items.length,e=this._activeIndex,n=e<=0?t-1:e-1,i=n===t-1?0:n+1;this.activeIndex=s.ArrayExt.findLastIndex(this._items,a.canActivate,n,i)},e.prototype.triggerActiveItem=function(){if(this.isAttached){var t=this.activeItem;if(t)if(this._cancelOpenTimer(),this._cancelCloseTimer(),"submenu"!==t.type){this.rootMenu.close();var e=t.command,n=t.args;this.commands.isEnabled(e,n)?this.commands.execute(e,n):console.log("Command '"+e+"' is disabled.")}else this._openChildMenu(!0)}},e.prototype.addItem=function(t){return this.insertItem(this._items.length,t)},e.prototype.insertItem=function(t,e){this.isAttached&&this.close(),this.activeIndex=-1;var n=Math.max(0,Math.min(t,this._items.length)),i=a.createItem(this,e);return s.ArrayExt.insert(this._items,n,i),this.update(),i},e.prototype.removeItem=function(t){this.removeItemAt(this._items.indexOf(t))},e.prototype.removeItemAt=function(t){this.isAttached&&this.close(),this.activeIndex=-1,s.ArrayExt.removeAt(this._items,t)&&this.update()},e.prototype.clearItems=function(){this.isAttached&&this.close(),this.activeIndex=-1,0!==this._items.length&&(this._items.length=0,this.update())},e.prototype.open=function(t,e,n){if(void 0===n&&(n={}),!this.isAttached){var i=n.forceX||!1,r=n.forceY||!1;a.openRootMenu(this,t,e,i,r),this.activate()}},e.prototype.handleEvent=function(t){switch(t.type){case"keydown":this._evtKeyDown(t);break;case"mouseup":this._evtMouseUp(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseenter":this._evtMouseEnter(t);break;case"mouseleave":this._evtMouseLeave(t);break;case"mousedown":this._evtMouseDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("keydown",this),this.node.addEventListener("mouseup",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseenter",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this),document.addEventListener("mousedown",this,!0)},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mouseup",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseenter",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),document.removeEventListener("mousedown",this,!0)},e.prototype.onActivateRequest=function(t){this.isAttached&&this.node.focus()},e.prototype.onUpdateRequest=function(t){for(var e=this._items,n=this.renderer,i=this._activeIndex,r=a.computeCollapsed(e),o=new Array(e.length),s=0,c=e.length;s<c;++s){var l=e[s],u=s===i,h=r[s];o[s]=n.renderItem({item:l,active:u,collapsed:h})}p.VirtualDOM.render(o,this.contentNode)},e.prototype.onCloseRequest=function(e){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;var n=this._childMenu;n&&(this._childIndex=-1,this._childMenu=null,n._parentMenu=null,n.close());var i=this._parentMenu;i&&(this._parentMenu=null,i._childIndex=-1,i._childMenu=null,i.activate()),this.isAttached&&this._aboutToClose.emit(void 0),t.prototype.onCloseRequest.call(this,e)},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation();var e=t.keyCode;if(13!==e)if(27!==e)if(37!==e)if(38!==e)if(39!==e)if(40!==e){var n=h.getKeyboardLayout().keyForKeydownEvent(t);if(n){var i=this._activeIndex+1,r=a.findMnemonic(this._items,n,i);-1===r.index||r.multiple?-1!==r.index?this.activeIndex=r.index:-1!==r.auto&&(this.activeIndex=r.auto):(this.activeIndex=r.index,this.triggerActiveItem())}}else this.activateNextItem();else{var o=this.activeItem;o&&"submenu"===o.type?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next")}else this.activatePreviousItem();else this._parentMenu?this.close():this._menuRequested.emit("previous");else this.close();else this.triggerActiveItem()},e.prototype._evtMouseUp=function(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this.triggerActiveItem())},e.prototype._evtMouseMove=function(t){var e=s.ArrayExt.findFirstIndex(this.contentNode.children,function(e){return u.ElementExt.hitTest(e,t.clientX,t.clientY)});if(e!==this._activeIndex){if(this.activeIndex=e,(e=this.activeIndex)===this._childIndex)return this._cancelOpenTimer(),void this._cancelCloseTimer();-1!==this._childIndex&&this._startCloseTimer(),this._cancelOpenTimer();var n=this.activeItem;n&&"submenu"===n.type&&n.submenu&&this._startOpenTimer()}},e.prototype._evtMouseEnter=function(t){for(var e=this._parentMenu;e;e=e._parentMenu)e._cancelOpenTimer(),e._cancelCloseTimer(),e.activeIndex=e._childIndex},e.prototype._evtMouseLeave=function(t){if(this._cancelOpenTimer(),this._childMenu){var e=t.clientX,n=t.clientY;u.ElementExt.hitTest(this._childMenu.node,e,n)?this._cancelCloseTimer():(this.activeIndex=-1,this._startCloseTimer())}else this.activeIndex=-1},e.prototype._evtMouseDown=function(t){this._parentMenu||(a.hitTestMenus(this,t.clientX,t.clientY)?(t.preventDefault(),t.stopPropagation()):this.close())},e.prototype._openChildMenu=function(t){void 0===t&&(t=!1);var e=this.activeItem;if(e&&"submenu"===e.type&&e.submenu){var n=e.submenu;if(n!==this._childMenu){this._closeChildMenu(),this._childMenu=n,this._childIndex=this._activeIndex,n._parentMenu=this,d.MessageLoop.sendMessage(this,m.Widget.Msg.UpdateRequest);var i=this.contentNode.children[this._activeIndex];a.openSubmenu(n,i),t&&(n.activeIndex=-1,n.activateNextItem()),n.activate()}}else this._closeChildMenu()},e.prototype._closeChildMenu=function(){this._childMenu&&this._childMenu.close()},e.prototype._startOpenTimer=function(){var t=this;0===this._openTimerID&&(this._openTimerID=window.setTimeout(function(){t._openTimerID=0,t._openChildMenu()},a.TIMER_DELAY))},e.prototype._startCloseTimer=function(){var t=this;0===this._closeTimerID&&(this._closeTimerID=window.setTimeout(function(){t._closeTimerID=0,t._closeChildMenu()},a.TIMER_DELAY))},e.prototype._cancelOpenTimer=function(){0!==this._openTimerID&&(clearTimeout(this._openTimerID),this._openTimerID=0)},e.prototype._cancelCloseTimer=function(){0!==this._closeTimerID&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)},e}(m.Widget);e.Menu=g,function(t){var e=function(){function t(){}return t.prototype.renderItem=function(t){var e=this.createItemClass(t),n=this.createItemDataset(t);return p.h.li({className:e,dataset:n},this.renderIcon(t),this.renderLabel(t),this.renderShortcut(t),this.renderSubmenu(t))},t.prototype.renderIcon=function(t){var e=this.createIconClass(t);return p.h.div({className:e},t.item.iconLabel)},t.prototype.renderLabel=function(t){var e=this.formatLabel(t);return p.h.div({className:"p-Menu-itemLabel"},e)},t.prototype.renderShortcut=function(t){var e=this.formatShortcut(t);return p.h.div({className:"p-Menu-itemShortcut"},e)},t.prototype.renderSubmenu=function(t){return p.h.div({className:"p-Menu-itemSubmenuIcon"})},t.prototype.createItemClass=function(t){var e="p-Menu-item";t.item.isEnabled||(e+=" p-mod-disabled"),t.item.isToggled&&(e+=" p-mod-toggled"),t.item.isVisible||(e+=" p-mod-hidden"),t.active&&(e+=" p-mod-active"),t.collapsed&&(e+=" p-mod-collapsed");var n=t.item.className;return n&&(e+=" "+n),e},t.prototype.createItemDataset=function(t){var e=t.item,n=e.type,i=e.command,r=e.dataset;return o({},r,"command"===n?{type:n,command:i}:{type:n})},t.prototype.createIconClass=function(t){var e="p-Menu-itemIcon",n=t.item.iconClass;return n?e+" "+n:e},t.prototype.formatLabel=function(t){var e=t.item,n=e.label,i=e.mnemonic;if(i<0||i>=n.length)return n;var r=n.slice(0,i),o=n.slice(i+1),a=n[i];return[r,p.h.span({className:"p-Menu-itemMnemonic"},a),o]},t.prototype.formatShortcut=function(t){var e=t.item.keyBinding;return e?e.keys.map(c.CommandRegistry.formatKeystroke).join(", "):null},t}();t.Renderer=e,t.defaultRenderer=new e}(g=e.Menu||(e.Menu={})),e.Menu=g,function(t){function e(t){return"separator"!==t.type&&t.isEnabled&&t.isVisible}t.TIMER_DELAY=300,t.SUBMENU_OVERLAP=3,t.createNode=function(){var t=document.createElement("div"),e=document.createElement("ul");return e.className="p-Menu-content",t.appendChild(e),t.tabIndex=-1,t},t.canActivate=e,t.createItem=function(t,e){return new n(t.commands,e)},t.hitTestMenus=function(t,e,n){for(var i=t;i;i=i.childMenu)if(u.ElementExt.hitTest(i.node,e,n))return!0;return!1},t.computeCollapsed=function(t){var e=new Array(t.length);s.ArrayExt.fill(e,!1);for(var n=0,i=t.length;n<i;++n)if((a=t[n]).isVisible){if("separator"!==a.type)break;e[n]=!0}for(var r=i-1;r>=0;--r)if((a=t[r]).isVisible){if("separator"!==a.type)break;e[r]=!0}for(var o=!1;++n<r;){var a;(a=t[n]).isVisible&&("separator"!==a.type?o=!1:o?e[n]=!0:o=!0)}return e},t.openRootMenu=function(t,e,n,i,r){d.MessageLoop.sendMessage(t,m.Widget.Msg.UpdateRequest);var o=window.pageXOffset,a=window.pageYOffset,s=document.documentElement.clientWidth,c=document.documentElement.clientHeight,l=c-(r?n:0),u=t.node,h=u.style;h.top="",h.left="",h.width="",h.height="",h.visibility="hidden",h.maxHeight=l+"px",m.Widget.attach(t,document.body);var f=u.getBoundingClientRect(),p=f.width,g=f.height;!i&&e+p>o+s&&(e=o+s-p),!r&&n+g>a+c&&(n>a+c?n=a+c-g:n-=g),h.top=Math.max(0,n)+"px",h.left=Math.max(0,e)+"px",h.visibility=""},t.openSubmenu=function(e,n){d.MessageLoop.sendMessage(e,m.Widget.Msg.UpdateRequest);var i=window.pageXOffset,r=window.pageYOffset,o=document.documentElement.clientWidth,a=document.documentElement.clientHeight,s=a,c=e.node,l=c.style;l.top="",l.left="",l.width="",l.height="",l.visibility="hidden",l.maxHeight=s+"px",m.Widget.attach(e,document.body);var h=c.getBoundingClientRect(),f=h.width,p=h.height,g=u.ElementExt.boxSizing(e.node),_=n.getBoundingClientRect(),v=_.right-t.SUBMENU_OVERLAP;v+f>i+o&&(v=_.left+t.SUBMENU_OVERLAP-f);var b=_.top-g.borderTop-g.paddingTop;b+p>r+a&&(b=_.bottom+g.borderBottom+g.paddingBottom-p),l.top=Math.max(0,b)+"px",l.left=Math.max(0,v)+"px",l.visibility=""},t.findMnemonic=function(t,n,i){for(var r=-1,o=-1,a=!1,s=n.toUpperCase(),c=0,l=t.length;c<l;++c){var u=(c+i)%l,h=t[u];if(e(h)){var d=h.label;if(0!==d.length){var f=h.mnemonic;f>=0&&f<d.length?d[f].toUpperCase()===s&&(-1===r?r=u:a=!0):-1===o&&d[0].toUpperCase()===s&&(o=u)}}}return{index:r,multiple:a,auto:o}};var n=function(){function t(t,e){this._commands=t,this.type=e.type||"command",this.command=e.command||"",this.args=e.args||l.JSONExt.emptyObject,this.submenu=e.submenu||null}return Object.defineProperty(t.prototype,"label",{get:function(){return"command"===this.type?this._commands.label(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.label:""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mnemonic",{get:function(){return"command"===this.type?this._commands.mnemonic(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.mnemonic:-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return this.iconClass},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconClass",{get:function(){return"command"===this.type?this._commands.iconClass(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.iconClass:""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconLabel",{get:function(){return"command"===this.type?this._commands.iconLabel(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.iconLabel:""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"caption",{get:function(){return"command"===this.type?this._commands.caption(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.caption:""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return"command"===this.type?this._commands.className(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.className:""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return"command"===this.type?this._commands.dataset(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.dataset:{}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isEnabled",{get:function(){return"command"===this.type?this._commands.isEnabled(this.command,this.args):"submenu"!==this.type||null!==this.submenu},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isToggled",{get:function(){return"command"===this.type&&this._commands.isToggled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return"command"===this.type?this._commands.isVisible(this.command,this.args):"submenu"!==this.type||null!==this.submenu},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keyBinding",{get:function(){if("command"===this.type){var t=this.command,e=this.args;return s.ArrayExt.findLastValue(this._commands.keyBindings,function(n){return n.command===t&&l.JSONExt.deepEqual(n.args,e)})||null}return null},enumerable:!0,configurable:!0}),t}()}(a||(a={}))},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o,a=n(9),s=n(16),c=n(14),l=n(41),u=n(34),h=n(13),d=function(t){function e(e){var n=t.call(this)||this;return n._spacing=4,n._dirty=!1,n._root=null,n._box=null,n._items=new Map,n.renderer=e.renderer,void 0!==e.spacing&&(n._spacing=o.clampSpacing(e.spacing)),n}return r(e,t),e.prototype.dispose=function(){var e=this.iter();this._items.forEach(function(t){t.dispose()}),this._box=null,this._root=null,this._items.clear(),a.each(e,function(t){t.dispose()}),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(t){t=o.clampSpacing(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return null===this._root},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return this._root?this._root.iterAllWidgets():a.empty()},e.prototype.widgets=function(){return this._root?this._root.iterUserWidgets():a.empty()},e.prototype.selectedWidgets=function(){return this._root?this._root.iterSelectedWidgets():a.empty()},e.prototype.tabBars=function(){return this._root?this._root.iterTabBars():a.empty()},e.prototype.handles=function(){return this._root?this._root.iterHandles():a.empty()},e.prototype.moveHandle=function(t,e,n){if(this._root&&!t.classList.contains("p-mod-hidden")){var i,r=this._root.findSplitNode(t);if(r)0!==(i="horizontal"===r.node.orientation?e-t.offsetLeft:n-t.offsetTop)&&(r.node.holdSizes(),l.BoxEngine.adjust(r.node.sizers,r.index,i),this.parent&&this.parent.update())}},e.prototype.saveLayout=function(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}},e.prototype.restoreLayout=function(t){var e,n=this,i=new Set;e=t.main?o.normalizeAreaConfig(t.main,i):null;var r=this.widgets(),s=this.tabBars(),c=this.handles();this._root=null,a.each(r,function(t){i.has(t)||(t.parent=null)}),a.each(s,function(t){t.dispose()}),a.each(c,function(t){t.parentNode&&t.parentNode.removeChild(t)}),i.forEach(function(t){t.parent=n.parent}),this._root=e?o.realizeAreaConfig(e,{createTabBar:function(){return n._createTabBar()},createHandle:function(){return n._createHandle()}}):null,this.parent&&(i.forEach(function(t){n.attachWidget(t)}),this.parent.fit())},e.prototype.addWidget=function(t,e){void 0===e&&(e={});var n=e.ref||null,i=e.mode||"tab-after",r=null;if(this._root&&n&&(r=this._root.findTabNode(n)),n&&!r)throw new Error("Reference widget is not in the layout.");switch(t.parent=this.parent,i){case"tab-after":this._insertTab(t,n,r,!0);break;case"tab-before":this._insertTab(t,n,r,!1);break;case"split-top":this._insertSplit(t,n,r,"vertical",!1);break;case"split-left":this._insertSplit(t,n,r,"horizontal",!1);break;case"split-right":this._insertSplit(t,n,r,"horizontal",!0);break;case"split-bottom":this._insertSplit(t,n,r,"vertical",!0)}this.parent&&(this.attachWidget(t),this.parent.fit())},e.prototype.removeWidget=function(t){this._removeWidget(t),this.parent&&(this.detachWidget(t),this.parent.fit())},e.prototype.hitTestTabAreas=function(t,e){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=s.ElementExt.boxSizing(this.parent.node));var n=this.parent.node.getBoundingClientRect(),i=t-n.left-this._box.borderLeft,r=e-n.top-this._box.borderTop,o=this._root.hitTestTabNodes(i,r);if(!o)return null;var a=o.tabBar,c=o.top,l=o.left,u=o.width,h=o.height,d=this._box.borderLeft+this._box.borderRight,f=this._box.borderTop+this._box.borderBottom;return{tabBar:a,x:i,y:r,top:c,left:l,right:n.width-d-(l+u),bottom:n.height-f-(c+h),width:u,height:h}},e.prototype.init=function(){var e=this;t.prototype.init.call(this),a.each(this,function(t){e.attachWidget(t)}),a.each(this.handles(),function(t){e.parent.node.appendChild(t)}),this.parent.fit()},e.prototype.attachWidget=function(t){this.parent.node!==t.node.parentNode&&(this._items.set(t,new u.LayoutItem(t)),this.parent.isAttached&&c.MessageLoop.sendMessage(t,h.Widget.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&c.MessageLoop.sendMessage(t,h.Widget.Msg.AfterAttach))},e.prototype.detachWidget=function(t){if(this.parent.node===t.node.parentNode){this.parent.isAttached&&c.MessageLoop.sendMessage(t,h.Widget.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&c.MessageLoop.sendMessage(t,h.Widget.Msg.AfterDetach);var e=this._items.get(t);e&&(this._items.delete(t),e.dispose())}},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._removeWidget=function(t){if(this._root){var e=this._root.findTabNode(t);if(e)if(e.tabBar.titles.length>1)e.tabBar.removeTab(t.title);else if(e.tabBar.dispose(),this._root!==e){this._root.holdAllSizes();var n=e.parent;e.parent=null;var i=a.ArrayExt.removeFirstOf(n.children,e),r=a.ArrayExt.removeAt(n.handles,i);if(a.ArrayExt.removeAt(n.sizers,i),r.parentNode&&r.parentNode.removeChild(r),n.children.length>1)n.syncHandles();else{var s=n.parent;n.parent=null;var c=n.children[0],l=n.handles[0];if(n.children.length=0,n.handles.length=0,n.sizers.length=0,l.parentNode&&l.parentNode.removeChild(l),this._root===n)return c.parent=null,void(this._root=c);var u=s,h=u.children.indexOf(n);if(c instanceof o.TabLayoutNode)return c.parent=u,void(u.children[h]=c);var d=a.ArrayExt.removeAt(u.handles,h);a.ArrayExt.removeAt(u.children,h),a.ArrayExt.removeAt(u.sizers,h),d.parentNode&&d.parentNode.removeChild(d);for(var f=0,p=c.children.length;f<p;++f){var m=c.children[f],g=c.handles[f],_=c.sizers[f];a.ArrayExt.insert(u.children,h+f,m),a.ArrayExt.insert(u.handles,h+f,g),a.ArrayExt.insert(u.sizers,h+f,_),m.parent=u}c.children.length=0,c.handles.length=0,c.sizers.length=0,c.parent=null,u.syncHandles()}}else this._root=null}},e.prototype._insertTab=function(t,e,n,i){if(t!==e){if(!this._root){var r=new o.TabLayoutNode(this._createTabBar());return r.tabBar.addTab(t.title),void(this._root=r)}var a;n||(n=this._root.findFirstTabNode()),-1===n.tabBar.titles.indexOf(t.title)&&(this._removeWidget(t),t.hide()),a=e?n.tabBar.titles.indexOf(e.title):n.tabBar.currentIndex,n.tabBar.insertTab(a+(i?1:0),t.title)}},e.prototype._insertSplit=function(t,e,n,i,r){if(t!==e||!n||1!==n.tabBar.titles.length){this._removeWidget(t);var s=new o.TabLayoutNode(this._createTabBar());if(s.tabBar.addTab(t.title),this._root){if(!n||!n.parent){var c=this._splitRoot(i),l=r?c.children.length:0;c.normalizeSizes();var u=o.createSizer(n?1:o.GOLDEN_RATIO);return a.ArrayExt.insert(c.children,l,s),a.ArrayExt.insert(c.sizers,l,u),a.ArrayExt.insert(c.handles,l,this._createHandle()),s.parent=c,c.normalizeSizes(),void c.syncHandles()}var h=n.parent;if(h.orientation===i){var d=h.children.indexOf(n);h.normalizeSizes();var f=h.sizers[d].sizeHint/=2,p=d+(r?1:0);return a.ArrayExt.insert(h.children,p,s),a.ArrayExt.insert(h.sizers,p,o.createSizer(f)),a.ArrayExt.insert(h.handles,p,this._createHandle()),s.parent=h,void h.syncHandles()}var m=a.ArrayExt.removeFirstOf(h.children,n),g=new o.SplitLayoutNode(i);g.normalized=!0,g.children.push(n),g.sizers.push(o.createSizer(.5)),g.handles.push(this._createHandle()),n.parent=g;var _=r?1:0;a.ArrayExt.insert(g.children,_,s),a.ArrayExt.insert(g.sizers,_,o.createSizer(.5)),a.ArrayExt.insert(g.handles,_,this._createHandle()),s.parent=g,g.syncHandles(),a.ArrayExt.insert(h.children,m,g),g.parent=h}else this._root=s}},e.prototype._splitRoot=function(t){var e=this._root;if(e instanceof o.SplitLayoutNode&&e.orientation===t)return e;var n=this._root=new o.SplitLayoutNode(t);return e&&(n.children.push(e),n.sizers.push(o.createSizer(0)),n.handles.push(this._createHandle()),e.parent=n),n},e.prototype._fit=function(){var t=0,e=0;if(this._root){var n=this._root.fit(this._spacing,this._items);t=n.minWidth,e=n.minHeight}var i=this._box=s.ElementExt.boxSizing(this.parent.node);t+=i.horizontalSum,e+=i.verticalSum;var r=this.parent.node.style;r.minWidth=t+"px",r.minHeight=e+"px",this._dirty=!0,this.parent.parent&&c.MessageLoop.sendMessage(this.parent.parent,h.Widget.Msg.FitRequest),this._dirty&&c.MessageLoop.sendMessage(this.parent,h.Widget.Msg.UpdateRequest)},e.prototype._update=function(t,e){if(this._dirty=!1,this._root){t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=s.ElementExt.boxSizing(this.parent.node));var n=this._box.paddingTop,i=this._box.paddingLeft,r=t-this._box.horizontalSum,o=e-this._box.verticalSum;this._root.update(n,i,r,o,this._spacing,this._items)}},e.prototype._createTabBar=function(){var t=this.renderer.createTabBar();return t.orientation="horizontal",this.parent&&(t.parent=this.parent,this.attachWidget(t)),t},e.prototype._createHandle=function(){var t=this.renderer.createHandle(),e=t.style;return e.position="absolute",e.top="0",e.left="0",e.width="0",e.height="0",this.parent&&this.parent.node.appendChild(t),t},e}(u.Layout);e.DockLayout=d,function(t){function e(t){var e=new l.BoxSizer;return e.sizeHint=t,e.size=t,e}function n(t,e){return"tab-area"===t.type?function(t,e){if(0===t.widgets.length)return null;var n=[];if(a.each(t.widgets,function(t){e.has(t)||(e.add(t),n.push(t))}),0===n.length)return null;var i=t.currentIndex;-1!==i&&(i<0||i>=n.length)&&(i=0);return{type:"tab-area",widgets:n,currentIndex:i}}(t,e):function(t,e){for(var i=t.orientation,r=[],o=[],a=0,s=t.children.length;a<s;++a){var c=n(t.children[a],e);c&&("tab-area"===c.type||c.orientation!==i?(r.push(c),o.push(Math.abs(t.sizes[a]||0))):(r.push.apply(r,c.children),o.push.apply(o,c.sizes)))}if(0===r.length)return null;if(1===r.length)return r[0];return{type:"split-area",orientation:i,children:r,sizes:o}}(t,e)}function i(t,n){return"tab-area"===t.type?function(t,e){var n=e.createTabBar();return a.each(t.widgets,function(t){t.hide(),n.addTab(t.title)}),n.currentIndex=t.currentIndex,new r(n)}(t,n):function(t,n){var r=new o(t.orientation);return a.each(t.children,function(o,a){var s=i(o,n),c=e(t.sizes[a]),l=n.createHandle();r.children.push(s),r.handles.push(l),r.sizers.push(c),s.parent=r}),r.syncHandles(),r.normalizeSizes(),r}(t,n)}t.GOLDEN_RATIO=.618,t.clampSpacing=function(t){return Math.max(0,Math.floor(t))},t.createSizer=e,t.normalizeAreaConfig=n,t.realizeAreaConfig=i;var r=function(){function t(t){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;var e=new l.BoxSizer,n=new l.BoxSizer;e.stretch=0,n.stretch=1,this.tabBar=t,this.sizers=[e,n]}return Object.defineProperty(t.prototype,"top",{get:function(){return this._top},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this._left},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),t.prototype.iterAllWidgets=function(){return a.chain(a.once(this.tabBar),this.iterUserWidgets())},t.prototype.iterUserWidgets=function(){return a.map(this.tabBar.titles,function(t){return t.owner})},t.prototype.iterSelectedWidgets=function(){var t=this.tabBar.currentTitle;return t?a.once(t.owner):a.empty()},t.prototype.iterTabBars=function(){return a.once(this.tabBar)},t.prototype.iterHandles=function(){return a.empty()},t.prototype.findTabNode=function(t){return-1!==this.tabBar.titles.indexOf(t.title)?this:null},t.prototype.findSplitNode=function(t){return null},t.prototype.findFirstTabNode=function(){return this},t.prototype.hitTestTabNodes=function(t,e){return t<this._left||t>=this._left+this._width?null:e<this._top||e>=this._top+this._height?null:this},t.prototype.createConfig=function(){return{type:"tab-area",widgets:this.tabBar.titles.map(function(t){return t.owner}),currentIndex:this.tabBar.currentIndex}},t.prototype.holdAllSizes=function(){},t.prototype.fit=function(t,e){var n=0,i=0,r=e.get(this.tabBar),o=this.tabBar.currentTitle,a=o?e.get(o.owner):void 0,s=this.sizers,c=s[0],l=s[1];return r&&r.fit(),a&&a.fit(),r&&!r.isHidden?(n=Math.max(n,r.minWidth),i+=r.minHeight,c.minSize=r.minHeight,c.maxSize=r.maxHeight):(c.minSize=0,c.maxSize=0),a&&!a.isHidden?(n=Math.max(n,a.minWidth),i+=a.minHeight,l.minSize=a.minHeight,l.maxSize=1/0):(l.minSize=0,l.maxSize=1/0),{minWidth:n,minHeight:i,maxWidth:1/0,maxHeight:1/0}},t.prototype.update=function(t,e,n,i,r,o){this._top=e,this._left=t,this._width=n,this._height=i;var a=o.get(this.tabBar),s=this.tabBar.currentTitle,c=s?o.get(s.owner):void 0;if(l.BoxEngine.calc(this.sizers,i),a&&!a.isHidden){var u=this.sizers[0].size;a.update(t,e,n,u),e+=u}if(c&&!c.isHidden){u=this.sizers[1].size;c.update(t,e,n,u)}},t}();t.TabLayoutNode=r;var o=function(){function t(t){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=t}return t.prototype.iterAllWidgets=function(){var t=a.map(this.children,function(t){return t.iterAllWidgets()});return new a.ChainIterator(t)},t.prototype.iterUserWidgets=function(){var t=a.map(this.children,function(t){return t.iterUserWidgets()});return new a.ChainIterator(t)},t.prototype.iterSelectedWidgets=function(){var t=a.map(this.children,function(t){return t.iterSelectedWidgets()});return new a.ChainIterator(t)},t.prototype.iterTabBars=function(){var t=a.map(this.children,function(t){return t.iterTabBars()});return new a.ChainIterator(t)},t.prototype.iterHandles=function(){var t=a.map(this.children,function(t){return t.iterHandles()});return a.chain(this.handles,new a.ChainIterator(t))},t.prototype.findTabNode=function(t){for(var e=0,n=this.children.length;e<n;++e){var i=this.children[e].findTabNode(t);if(i)return i}return null},t.prototype.findSplitNode=function(t){var e=this.handles.indexOf(t);if(-1!==e)return{index:e,node:this};for(var n=0,i=this.children.length;n<i;++n){var r=this.children[n].findSplitNode(t);if(r)return r}return null},t.prototype.findFirstTabNode=function(){return 0===this.children.length?null:this.children[0].findFirstTabNode()},t.prototype.hitTestTabNodes=function(t,e){for(var n=0,i=this.children.length;n<i;++n){var r=this.children[n].hitTestTabNodes(t,e);if(r)return r}return null},t.prototype.createConfig=function(){var t=this.orientation,e=this.createNormalizedSizes();return{type:"split-area",orientation:t,children:this.children.map(function(t){return t.createConfig()}),sizes:e}},t.prototype.syncHandles=function(){var t=this;a.each(this.handles,function(e,n){e.setAttribute("data-orientation",t.orientation),n===t.handles.length-1?e.classList.add("p-mod-hidden"):e.classList.remove("p-mod-hidden")})},t.prototype.holdSizes=function(){a.each(this.sizers,function(t){t.sizeHint=t.size})},t.prototype.holdAllSizes=function(){a.each(this.children,function(t){return t.holdAllSizes()}),this.holdSizes()},t.prototype.normalizeSizes=function(){var t=this.sizers.length;if(0!==t){this.holdSizes();var e=a.reduce(this.sizers,function(t,e){return t+e.sizeHint},0);0===e?a.each(this.sizers,function(e){e.size=e.sizeHint=1/t}):a.each(this.sizers,function(t){t.size=t.sizeHint/=e}),this.normalized=!0}},t.prototype.createNormalizedSizes=function(){var t=this.sizers.length;if(0===t)return[];var e=this.sizers.map(function(t){return t.size}),n=a.reduce(e,function(t,e){return t+e},0);return 0===n?a.each(e,function(n,i){e[i]=1/t}):a.each(e,function(t,i){e[i]=t/n}),e},t.prototype.fit=function(t,e){for(var n="horizontal"===this.orientation,i=Math.max(0,this.children.length-1)*t,r=n?i:0,o=n?0:i,a=0,s=this.children.length;a<s;++a){var c=this.children[a].fit(t,e);n?(o=Math.max(o,c.minHeight),r+=c.minWidth,this.sizers[a].minSize=c.minWidth):(r=Math.max(r,c.minWidth),o+=c.minHeight,this.sizers[a].minSize=c.minHeight)}return{minWidth:r,minHeight:o,maxWidth:1/0,maxHeight:1/0}},t.prototype.update=function(t,e,n,i,r,o){var s="horizontal"===this.orientation,c=Math.max(0,this.children.length-1)*r,u=Math.max(0,(s?n:i)-c);this.normalized&&(a.each(this.sizers,function(t){t.sizeHint*=u}),this.normalized=!1),l.BoxEngine.calc(this.sizers,u);for(var h=0,d=this.children.length;h<d;++h){var f=this.children[h],p=this.sizers[h].size,m=this.handles[h].style;s?(f.update(t,e,p,i,r,o),t+=p,m.top=e+"px",m.left=t+"px",m.width=r+"px",m.height=i+"px",t+=r):(f.update(t,e,n,p,r,o),e+=p,m.top=e+"px",m.left=t+"px",m.width=n+"px",m.height=r+"px",e+=r)}},t}();t.SplitLayoutNode=o}(o||(o={}))},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o,a=n(9),s=n(16),c=n(14),l=n(37),u=n(41),h=n(34),d=n(42),f=n(13),p=function(t){function e(e){var n=t.call(this)||this;return n._fixed=0,n._spacing=4,n._dirty=!1,n._hasNormedSizes=!1,n._sizers=[],n._items=[],n._handles=[],n._box=null,n._alignment="start",n._orientation="horizontal",n.renderer=e.renderer,void 0!==e.orientation&&(n._orientation=e.orientation),void 0!==e.alignment&&(n._alignment=e.alignment),void 0!==e.spacing&&(n._spacing=o.clampSpacing(e.spacing)),n}return r(e,t),e.prototype.dispose=function(){a.each(this._items,function(t){t.dispose()}),this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(t){this._orientation!==t&&(this._orientation=t,this.parent&&(this.parent.dataset.orientation=t,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this._alignment},set:function(t){this._alignment!==t&&(this._alignment=t,this.parent&&(this.parent.dataset.alignment=t,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(t){t=o.clampSpacing(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handles",{get:function(){return this._handles},enumerable:!0,configurable:!0}),e.prototype.relativeSizes=function(){return o.normalize(this._sizers.map(function(t){return t.size}))},e.prototype.setRelativeSizes=function(t){for(var e=this._sizers.length,n=t.slice(0,e);n.length<e;)n.push(0);for(var i=o.normalize(n),r=0;r<e;++r){var a=this._sizers[r];a.sizeHint=i[r],a.size=i[r]}this._hasNormedSizes=!0,this.parent&&this.parent.update()},e.prototype.moveHandle=function(t,e){var n,i=this._handles[t];if(i&&!i.classList.contains("p-mod-hidden")&&0!==(n="horizontal"===this._orientation?e-i.offsetLeft:e-i.offsetTop)){for(var r=0,o=this._sizers;r<o.length;r++){var a=o[r];a.size>0&&(a.sizeHint=a.size)}u.BoxEngine.adjust(this._sizers,t,n),this.parent&&this.parent.update()}},e.prototype.init=function(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,t.prototype.init.call(this)},e.prototype.attachWidget=function(t,e){var n=new h.LayoutItem(e),i=o.createHandle(this.renderer),r=o.averageSize(this._sizers),s=o.createSizer(r);a.ArrayExt.insert(this._items,t,n),a.ArrayExt.insert(this._sizers,t,s),a.ArrayExt.insert(this._handles,t,i),this.parent.isAttached&&c.MessageLoop.sendMessage(e,f.Widget.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.node.appendChild(i),this.parent.isAttached&&c.MessageLoop.sendMessage(e,f.Widget.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(t,e,n){a.ArrayExt.move(this._items,t,e),a.ArrayExt.move(this._sizers,t,e),a.ArrayExt.move(this._handles,t,e),this.parent.fit()},e.prototype.detachWidget=function(t,e){var n=a.ArrayExt.removeAt(this._items,t),i=a.ArrayExt.removeAt(this._handles,t);a.ArrayExt.removeAt(this._sizers,t),this.parent.isAttached&&c.MessageLoop.sendMessage(e,f.Widget.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.node.removeChild(i),this.parent.isAttached&&c.MessageLoop.sendMessage(e,f.Widget.Msg.AfterDetach),n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var t=0,n=-1,i=0,r=this._items.length;i<r;++i)this._items[i].isHidden?this._handles[i].classList.add("p-mod-hidden"):(this._handles[i].classList.remove("p-mod-hidden"),n=i,t++);-1!==n&&this._handles[n].classList.add("p-mod-hidden"),this._fixed=this._spacing*Math.max(0,t-1);var o="horizontal"===this._orientation,a=o?this._fixed:0,l=o?0:this._fixed;for(i=0,r=this._items.length;i<r;++i){var u=this._items[i],h=this._sizers[i];h.size>0&&(h.sizeHint=h.size),u.isHidden?(h.minSize=0,h.maxSize=0):(u.fit(),h.stretch=e.getStretch(u.widget),o?(h.minSize=u.minWidth,h.maxSize=u.maxWidth,a+=u.minWidth,l=Math.max(l,u.minHeight)):(h.minSize=u.minHeight,h.maxSize=u.maxHeight,l+=u.minHeight,a=Math.max(a,u.minWidth)))}var d=this._box=s.ElementExt.boxSizing(this.parent.node);a+=d.horizontalSum,l+=d.verticalSum;var p=this.parent.node.style;p.minWidth=a+"px",p.minHeight=l+"px",this._dirty=!0,this.parent.parent&&c.MessageLoop.sendMessage(this.parent.parent,f.Widget.Msg.FitRequest),this._dirty&&c.MessageLoop.sendMessage(this.parent,f.Widget.Msg.UpdateRequest)},e.prototype._update=function(t,e){this._dirty=!1;for(var n=0,i=0,r=this._items.length;i<r;++i)n+=+!this._items[i].isHidden;if(0!==n){t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=s.ElementExt.boxSizing(this.parent.node));var o,a=this._box.paddingTop,c=this._box.paddingLeft,l=t-this._box.horizontalSum,h=e-this._box.verticalSum,d="horizontal"===this._orientation;if(o=d?Math.max(0,l-this._fixed):Math.max(0,h-this._fixed),this._hasNormedSizes){for(var f=0,p=this._sizers;f<p.length;f++){p[f].sizeHint*=o}this._hasNormedSizes=!1}var m=u.BoxEngine.calc(this._sizers,o),g=0,_=0;if(m>0)switch(this._alignment){case"start":break;case"center":g=0,_=m/2;break;case"end":g=0,_=m;break;case"justify":g=m/n,_=0;break;default:throw"unreachable"}for(i=0,r=this._items.length;i<r;++i){var v=this._items[i];if(!v.isHidden){var b=this._sizers[i].size,y=this._handles[i].style;d?(v.update(c+_,a,b+g,h),c+=b+g,y.top=a+"px",y.left=c+_+"px",y.width=this._spacing+"px",y.height=h+"px",c+=this._spacing):(v.update(c,a+_,l,b+g),a+=b+g,y.top=a+_+"px",y.left=c+"px",y.width=l+"px",y.height=this._spacing+"px",a+=this._spacing)}}}},e}(d.PanelLayout);e.SplitLayout=p,function(t){t.getStretch=function(t){return o.stretchProperty.get(t)},t.setStretch=function(t,e){o.stretchProperty.set(t,e)}}(p=e.SplitLayout||(e.SplitLayout={})),e.SplitLayout=p,function(t){t.stretchProperty=new l.AttachedProperty({name:"stretch",create:function(){return 0},coerce:function(t,e){return Math.max(0,Math.floor(e))},changed:function(t){t.parent&&t.parent.layout instanceof p&&t.parent.fit()}}),t.createSizer=function(t){var e=new u.BoxSizer;return e.sizeHint=Math.floor(t),e},t.createHandle=function(t){var e=t.createHandle();return e.style.position="absolute",e},t.clampSpacing=function(t){return Math.max(0,Math.floor(t))},t.averageSize=function(t){return t.reduce(function(t,e){return t+e.size},0)/t.length||0},t.normalize=function(t){var e=t.length;if(0===e)return[];var n=t.reduce(function(t,e){return t+Math.abs(e)},0);return 0===n?t.map(function(t){return 1/e}):t.map(function(t){return t/n})}}(o||(o={}))},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(9),a=n(16),s=n(14),c=n(34),l=n(42),u=n(13),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._dirty=!1,e._items=[],e._box=null,e}return r(e,t),e.prototype.dispose=function(){o.each(this._items,function(t){t.dispose()}),this._box=null,this._items.length=0,t.prototype.dispose.call(this)},e.prototype.attachWidget=function(t,e){o.ArrayExt.insert(this._items,t,new c.LayoutItem(e)),this.parent.isAttached&&s.MessageLoop.sendMessage(e,u.Widget.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&s.MessageLoop.sendMessage(e,u.Widget.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(t,e,n){o.ArrayExt.move(this._items,t,e),this.parent.update()},e.prototype.detachWidget=function(t,e){var n=o.ArrayExt.removeAt(this._items,t);this.parent.isAttached&&s.MessageLoop.sendMessage(e,u.Widget.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&s.MessageLoop.sendMessage(e,u.Widget.Msg.AfterDetach),n.widget.node.style.zIndex="",n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var t=0,e=0,n=0,i=this._items.length;n<i;++n){var r=this._items[n];r.isHidden||(r.fit(),t=Math.max(t,r.minWidth),e=Math.max(e,r.minHeight))}var o=this._box=a.ElementExt.boxSizing(this.parent.node);t+=o.horizontalSum,e+=o.verticalSum;var c=this.parent.node.style;c.minWidth=t+"px",c.minHeight=e+"px",this._dirty=!0,this.parent.parent&&s.MessageLoop.sendMessage(this.parent.parent,u.Widget.Msg.FitRequest),this._dirty&&s.MessageLoop.sendMessage(this.parent,u.Widget.Msg.UpdateRequest)},e.prototype._update=function(t,e){this._dirty=!1;for(var n=0,i=0,r=this._items.length;i<r;++i)n+=+!this._items[i].isHidden;if(0!==n){t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=a.ElementExt.boxSizing(this.parent.node));var o=this._box.paddingTop,s=this._box.paddingLeft,c=t-this._box.horizontalSum,l=e-this._box.verticalSum;for(i=0,r=this._items.length;i<r;++i){var u=this._items[i];u.isHidden||(u.widget.node.style.zIndex=""+i,u.update(s,o,c,l))}}},e}(l.PanelLayout);e.StackedLayout=h},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o,a=n(21),s=n(52),c=n(133),l=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,{layout:o.createLayout(e)})||this;return n._widgetRemoved=new a.Signal(n),n.addClass("p-StackedPanel"),n}return r(e,t),Object.defineProperty(e.prototype,"widgetRemoved",{get:function(){return this._widgetRemoved},enumerable:!0,configurable:!0}),e.prototype.onChildAdded=function(t){t.child.addClass("p-StackedPanel-child")},e.prototype.onChildRemoved=function(t){t.child.removeClass("p-StackedPanel-child"),this._widgetRemoved.emit(t.child)},e}(s.Panel);e.StackedPanel=l,function(t){t.createLayout=function(t){return t.layout||new c.StackedLayout}}(o||(o={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.matplotlib={viridis:{256:["#440154","#440256","#450457","#450559","#46075a","#46085c","#460a5d","#460b5e","#470d60","#470e61","#471063","#471164","#471365","#481467","#481668","#481769","#48186a","#481a6c","#481b6d","#481c6e","#481d6f","#481f70","#482071","#482173","#482374","#482475","#482576","#482677","#482878","#482979","#472a7a","#472c7a","#472d7b","#472e7c","#472f7d","#46307e","#46327e","#46337f","#463480","#453581","#453781","#453882","#443983","#443a83","#443b84","#433d84","#433e85","#423f85","#424086","#424186","#414287","#414487","#404588","#404688","#3f4788","#3f4889","#3e4989","#3e4a89","#3e4c8a","#3d4d8a","#3d4e8a","#3c4f8a","#3c508b","#3b518b","#3b528b","#3a538b","#3a548c","#39558c","#39568c","#38588c","#38598c","#375a8c","#375b8d","#365c8d","#365d8d","#355e8d","#355f8d","#34608d","#34618d","#33628d","#33638d","#32648e","#32658e","#31668e","#31678e","#31688e","#30698e","#306a8e","#2f6b8e","#2f6c8e","#2e6d8e","#2e6e8e","#2e6f8e","#2d708e","#2d718e","#2c718e","#2c728e","#2c738e","#2b748e","#2b758e","#2a768e","#2a778e","#2a788e","#29798e","#297a8e","#297b8e","#287c8e","#287d8e","#277e8e","#277f8e","#27808e","#26818e","#26828e","#26828e","#25838e","#25848e","#25858e","#24868e","#24878e","#23888e","#23898e","#238a8d","#228b8d","#228c8d","#228d8d","#218e8d","#218f8d","#21908d","#21918c","#20928c","#20928c","#20938c","#1f948c","#1f958b","#1f968b","#1f978b","#1f988b","#1f998a","#1f9a8a","#1e9b8a","#1e9c89","#1e9d89","#1f9e89","#1f9f88","#1fa088","#1fa188","#1fa187","#1fa287","#20a386","#20a486","#21a585","#21a685","#22a785","#22a884","#23a983","#24aa83","#25ab82","#25ac82","#26ad81","#27ad81","#28ae80","#29af7f","#2ab07f","#2cb17e","#2db27d","#2eb37c","#2fb47c","#31b57b","#32b67a","#34b679","#35b779","#37b878","#38b977","#3aba76","#3bbb75","#3dbc74","#3fbc73","#40bd72","#42be71","#44bf70","#46c06f","#48c16e","#4ac16d","#4cc26c","#4ec36b","#50c46a","#52c569","#54c568","#56c667","#58c765","#5ac864","#5cc863","#5ec962","#60ca60","#63cb5f","#65cb5e","#67cc5c","#69cd5b","#6ccd5a","#6ece58","#70cf57","#73d056","#75d054","#77d153","#7ad151","#7cd250","#7fd34e","#81d34d","#84d44b","#86d549","#89d548","#8bd646","#8ed645","#90d743","#93d741","#95d840","#98d83e","#9bd93c","#9dd93b","#a0da39","#a2da37","#a5db36","#a8db34","#aadc32","#addc30","#b0dd2f","#b2dd2d","#b5de2b","#b8de29","#bade28","#bddf26","#c0df25","#c2df23","#c5e021","#c8e020","#cae11f","#cde11d","#d0e11c","#d2e21b","#d5e21a","#d8e219","#dae319","#dde318","#dfe318","#e2e418","#e5e419","#e7e419","#eae51a","#ece51b","#efe51c","#f1e51d","#f4e61e","#f6e620","#f8e621","#fbe723","#fde725"],type:"seq"}},e.default={Spectral:{3:["rgb(252,141,89)","rgb(255,255,191)","rgb(153,213,148)"],4:["rgb(215,25,28)","rgb(253,174,97)","rgb(171,221,164)","rgb(43,131,186)"],5:["rgb(215,25,28)","rgb(253,174,97)","rgb(255,255,191)","rgb(171,221,164)","rgb(43,131,186)"],6:["rgb(213,62,79)","rgb(252,141,89)","rgb(254,224,139)","rgb(230,245,152)","rgb(153,213,148)","rgb(50,136,189)"],7:["rgb(213,62,79)","rgb(252,141,89)","rgb(254,224,139)","rgb(255,255,191)","rgb(230,245,152)","rgb(153,213,148)","rgb(50,136,189)"],8:["rgb(213,62,79)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,139)","rgb(230,245,152)","rgb(171,221,164)","rgb(102,194,165)","rgb(50,136,189)"],9:["rgb(213,62,79)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,139)","rgb(255,255,191)","rgb(230,245,152)","rgb(171,221,164)","rgb(102,194,165)","rgb(50,136,189)"],10:["rgb(158,1,66)","rgb(213,62,79)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,139)","rgb(230,245,152)","rgb(171,221,164)","rgb(102,194,165)","rgb(50,136,189)","rgb(94,79,162)"],11:["rgb(158,1,66)","rgb(213,62,79)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,139)","rgb(255,255,191)","rgb(230,245,152)","rgb(171,221,164)","rgb(102,194,165)","rgb(50,136,189)","rgb(94,79,162)"],type:"div"},RdYlGn:{3:["rgb(252,141,89)","rgb(255,255,191)","rgb(145,207,96)"],4:["rgb(215,25,28)","rgb(253,174,97)","rgb(166,217,106)","rgb(26,150,65)"],5:["rgb(215,25,28)","rgb(253,174,97)","rgb(255,255,191)","rgb(166,217,106)","rgb(26,150,65)"],6:["rgb(215,48,39)","rgb(252,141,89)","rgb(254,224,139)","rgb(217,239,139)","rgb(145,207,96)","rgb(26,152,80)"],7:["rgb(215,48,39)","rgb(252,141,89)","rgb(254,224,139)","rgb(255,255,191)","rgb(217,239,139)","rgb(145,207,96)","rgb(26,152,80)"],8:["rgb(215,48,39)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,139)","rgb(217,239,139)","rgb(166,217,106)","rgb(102,189,99)","rgb(26,152,80)"],9:["rgb(215,48,39)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,139)","rgb(255,255,191)","rgb(217,239,139)","rgb(166,217,106)","rgb(102,189,99)","rgb(26,152,80)"],10:["rgb(165,0,38)","rgb(215,48,39)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,139)","rgb(217,239,139)","rgb(166,217,106)","rgb(102,189,99)","rgb(26,152,80)","rgb(0,104,55)"],11:["rgb(165,0,38)","rgb(215,48,39)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,139)","rgb(255,255,191)","rgb(217,239,139)","rgb(166,217,106)","rgb(102,189,99)","rgb(26,152,80)","rgb(0,104,55)"],type:"div"},RdBu:{3:["rgb(239,138,98)","rgb(247,247,247)","rgb(103,169,207)"],4:["rgb(202,0,32)","rgb(244,165,130)","rgb(146,197,222)","rgb(5,113,176)"],5:["rgb(202,0,32)","rgb(244,165,130)","rgb(247,247,247)","rgb(146,197,222)","rgb(5,113,176)"],6:["rgb(178,24,43)","rgb(239,138,98)","rgb(253,219,199)","rgb(209,229,240)","rgb(103,169,207)","rgb(33,102,172)"],7:["rgb(178,24,43)","rgb(239,138,98)","rgb(253,219,199)","rgb(247,247,247)","rgb(209,229,240)","rgb(103,169,207)","rgb(33,102,172)"],8:["rgb(178,24,43)","rgb(214,96,77)","rgb(244,165,130)","rgb(253,219,199)","rgb(209,229,240)","rgb(146,197,222)","rgb(67,147,195)","rgb(33,102,172)"],9:["rgb(178,24,43)","rgb(214,96,77)","rgb(244,165,130)","rgb(253,219,199)","rgb(247,247,247)","rgb(209,229,240)","rgb(146,197,222)","rgb(67,147,195)","rgb(33,102,172)"],10:["rgb(103,0,31)","rgb(178,24,43)","rgb(214,96,77)","rgb(244,165,130)","rgb(253,219,199)","rgb(209,229,240)","rgb(146,197,222)","rgb(67,147,195)","rgb(33,102,172)","rgb(5,48,97)"],11:["rgb(103,0,31)","rgb(178,24,43)","rgb(214,96,77)","rgb(244,165,130)","rgb(253,219,199)","rgb(247,247,247)","rgb(209,229,240)","rgb(146,197,222)","rgb(67,147,195)","rgb(33,102,172)","rgb(5,48,97)"],type:"div"},PiYG:{3:["rgb(233,163,201)","rgb(247,247,247)","rgb(161,215,106)"],4:["rgb(208,28,139)","rgb(241,182,218)","rgb(184,225,134)","rgb(77,172,38)"],5:["rgb(208,28,139)","rgb(241,182,218)","rgb(247,247,247)","rgb(184,225,134)","rgb(77,172,38)"],6:["rgb(197,27,125)","rgb(233,163,201)","rgb(253,224,239)","rgb(230,245,208)","rgb(161,215,106)","rgb(77,146,33)"],7:["rgb(197,27,125)","rgb(233,163,201)","rgb(253,224,239)","rgb(247,247,247)","rgb(230,245,208)","rgb(161,215,106)","rgb(77,146,33)"],8:["rgb(197,27,125)","rgb(222,119,174)","rgb(241,182,218)","rgb(253,224,239)","rgb(230,245,208)","rgb(184,225,134)","rgb(127,188,65)","rgb(77,146,33)"],9:["rgb(197,27,125)","rgb(222,119,174)","rgb(241,182,218)","rgb(253,224,239)","rgb(247,247,247)","rgb(230,245,208)","rgb(184,225,134)","rgb(127,188,65)","rgb(77,146,33)"],10:["rgb(142,1,82)","rgb(197,27,125)","rgb(222,119,174)","rgb(241,182,218)","rgb(253,224,239)","rgb(230,245,208)","rgb(184,225,134)","rgb(127,188,65)","rgb(77,146,33)","rgb(39,100,25)"],11:["rgb(142,1,82)","rgb(197,27,125)","rgb(222,119,174)","rgb(241,182,218)","rgb(253,224,239)","rgb(247,247,247)","rgb(230,245,208)","rgb(184,225,134)","rgb(127,188,65)","rgb(77,146,33)","rgb(39,100,25)"],type:"div"},PRGn:{3:["rgb(175,141,195)","rgb(247,247,247)","rgb(127,191,123)"],4:["rgb(123,50,148)","rgb(194,165,207)","rgb(166,219,160)","rgb(0,136,55)"],5:["rgb(123,50,148)","rgb(194,165,207)","rgb(247,247,247)","rgb(166,219,160)","rgb(0,136,55)"],6:["rgb(118,42,131)","rgb(175,141,195)","rgb(231,212,232)","rgb(217,240,211)","rgb(127,191,123)","rgb(27,120,55)"],7:["rgb(118,42,131)","rgb(175,141,195)","rgb(231,212,232)","rgb(247,247,247)","rgb(217,240,211)","rgb(127,191,123)","rgb(27,120,55)"],8:["rgb(118,42,131)","rgb(153,112,171)","rgb(194,165,207)","rgb(231,212,232)","rgb(217,240,211)","rgb(166,219,160)","rgb(90,174,97)","rgb(27,120,55)"],9:["rgb(118,42,131)","rgb(153,112,171)","rgb(194,165,207)","rgb(231,212,232)","rgb(247,247,247)","rgb(217,240,211)","rgb(166,219,160)","rgb(90,174,97)","rgb(27,120,55)"],10:["rgb(64,0,75)","rgb(118,42,131)","rgb(153,112,171)","rgb(194,165,207)","rgb(231,212,232)","rgb(217,240,211)","rgb(166,219,160)","rgb(90,174,97)","rgb(27,120,55)","rgb(0,68,27)"],11:["rgb(64,0,75)","rgb(118,42,131)","rgb(153,112,171)","rgb(194,165,207)","rgb(231,212,232)","rgb(247,247,247)","rgb(217,240,211)","rgb(166,219,160)","rgb(90,174,97)","rgb(27,120,55)","rgb(0,68,27)"],type:"div"},RdYlBu:{3:["rgb(252,141,89)","rgb(255,255,191)","rgb(145,191,219)"],4:["rgb(215,25,28)","rgb(253,174,97)","rgb(171,217,233)","rgb(44,123,182)"],5:["rgb(215,25,28)","rgb(253,174,97)","rgb(255,255,191)","rgb(171,217,233)","rgb(44,123,182)"],6:["rgb(215,48,39)","rgb(252,141,89)","rgb(254,224,144)","rgb(224,243,248)","rgb(145,191,219)","rgb(69,117,180)"],7:["rgb(215,48,39)","rgb(252,141,89)","rgb(254,224,144)","rgb(255,255,191)","rgb(224,243,248)","rgb(145,191,219)","rgb(69,117,180)"],8:["rgb(215,48,39)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,144)","rgb(224,243,248)","rgb(171,217,233)","rgb(116,173,209)","rgb(69,117,180)"],9:["rgb(215,48,39)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,144)","rgb(255,255,191)","rgb(224,243,248)","rgb(171,217,233)","rgb(116,173,209)","rgb(69,117,180)"],10:["rgb(165,0,38)","rgb(215,48,39)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,144)","rgb(224,243,248)","rgb(171,217,233)","rgb(116,173,209)","rgb(69,117,180)","rgb(49,54,149)"],11:["rgb(165,0,38)","rgb(215,48,39)","rgb(244,109,67)","rgb(253,174,97)","rgb(254,224,144)","rgb(255,255,191)","rgb(224,243,248)","rgb(171,217,233)","rgb(116,173,209)","rgb(69,117,180)","rgb(49,54,149)"],type:"div"},BrBG:{3:["rgb(216,179,101)","rgb(245,245,245)","rgb(90,180,172)"],4:["rgb(166,97,26)","rgb(223,194,125)","rgb(128,205,193)","rgb(1,133,113)"],5:["rgb(166,97,26)","rgb(223,194,125)","rgb(245,245,245)","rgb(128,205,193)","rgb(1,133,113)"],6:["rgb(140,81,10)","rgb(216,179,101)","rgb(246,232,195)","rgb(199,234,229)","rgb(90,180,172)","rgb(1,102,94)"],7:["rgb(140,81,10)","rgb(216,179,101)","rgb(246,232,195)","rgb(245,245,245)","rgb(199,234,229)","rgb(90,180,172)","rgb(1,102,94)"],8:["rgb(140,81,10)","rgb(191,129,45)","rgb(223,194,125)","rgb(246,232,195)","rgb(199,234,229)","rgb(128,205,193)","rgb(53,151,143)","rgb(1,102,94)"],9:["rgb(140,81,10)","rgb(191,129,45)","rgb(223,194,125)","rgb(246,232,195)","rgb(245,245,245)","rgb(199,234,229)","rgb(128,205,193)","rgb(53,151,143)","rgb(1,102,94)"],10:["rgb(84,48,5)","rgb(140,81,10)","rgb(191,129,45)","rgb(223,194,125)","rgb(246,232,195)","rgb(199,234,229)","rgb(128,205,193)","rgb(53,151,143)","rgb(1,102,94)","rgb(0,60,48)"],11:["rgb(84,48,5)","rgb(140,81,10)","rgb(191,129,45)","rgb(223,194,125)","rgb(246,232,195)","rgb(245,245,245)","rgb(199,234,229)","rgb(128,205,193)","rgb(53,151,143)","rgb(1,102,94)","rgb(0,60,48)"],type:"div"},RdGy:{3:["rgb(239,138,98)","rgb(255,255,255)","rgb(153,153,153)"],4:["rgb(202,0,32)","rgb(244,165,130)","rgb(186,186,186)","rgb(64,64,64)"],5:["rgb(202,0,32)","rgb(244,165,130)","rgb(255,255,255)","rgb(186,186,186)","rgb(64,64,64)"],6:["rgb(178,24,43)","rgb(239,138,98)","rgb(253,219,199)","rgb(224,224,224)","rgb(153,153,153)","rgb(77,77,77)"],7:["rgb(178,24,43)","rgb(239,138,98)","rgb(253,219,199)","rgb(255,255,255)","rgb(224,224,224)","rgb(153,153,153)","rgb(77,77,77)"],8:["rgb(178,24,43)","rgb(214,96,77)","rgb(244,165,130)","rgb(253,219,199)","rgb(224,224,224)","rgb(186,186,186)","rgb(135,135,135)","rgb(77,77,77)"],9:["rgb(178,24,43)","rgb(214,96,77)","rgb(244,165,130)","rgb(253,219,199)","rgb(255,255,255)","rgb(224,224,224)","rgb(186,186,186)","rgb(135,135,135)","rgb(77,77,77)"],10:["rgb(103,0,31)","rgb(178,24,43)","rgb(214,96,77)","rgb(244,165,130)","rgb(253,219,199)","rgb(224,224,224)","rgb(186,186,186)","rgb(135,135,135)","rgb(77,77,77)","rgb(26,26,26)"],11:["rgb(103,0,31)","rgb(178,24,43)","rgb(214,96,77)","rgb(244,165,130)","rgb(253,219,199)","rgb(255,255,255)","rgb(224,224,224)","rgb(186,186,186)","rgb(135,135,135)","rgb(77,77,77)","rgb(26,26,26)"],type:"div"},PuOr:{3:["rgb(241,163,64)","rgb(247,247,247)","rgb(153,142,195)"],4:["rgb(230,97,1)","rgb(253,184,99)","rgb(178,171,210)","rgb(94,60,153)"],5:["rgb(230,97,1)","rgb(253,184,99)","rgb(247,247,247)","rgb(178,171,210)","rgb(94,60,153)"],6:["rgb(179,88,6)","rgb(241,163,64)","rgb(254,224,182)","rgb(216,218,235)","rgb(153,142,195)","rgb(84,39,136)"],7:["rgb(179,88,6)","rgb(241,163,64)","rgb(254,224,182)","rgb(247,247,247)","rgb(216,218,235)","rgb(153,142,195)","rgb(84,39,136)"],8:["rgb(179,88,6)","rgb(224,130,20)","rgb(253,184,99)","rgb(254,224,182)","rgb(216,218,235)","rgb(178,171,210)","rgb(128,115,172)","rgb(84,39,136)"],9:["rgb(179,88,6)","rgb(224,130,20)","rgb(253,184,99)","rgb(254,224,182)","rgb(247,247,247)","rgb(216,218,235)","rgb(178,171,210)","rgb(128,115,172)","rgb(84,39,136)"],10:["rgb(127,59,8)","rgb(179,88,6)","rgb(224,130,20)","rgb(253,184,99)","rgb(254,224,182)","rgb(216,218,235)","rgb(178,171,210)","rgb(128,115,172)","rgb(84,39,136)","rgb(45,0,75)"],11:["rgb(127,59,8)","rgb(179,88,6)","rgb(224,130,20)","rgb(253,184,99)","rgb(254,224,182)","rgb(247,247,247)","rgb(216,218,235)","rgb(178,171,210)","rgb(128,115,172)","rgb(84,39,136)","rgb(45,0,75)"],type:"div"},Set2:{3:["rgb(102,194,165)","rgb(252,141,98)","rgb(141,160,203)"],4:["rgb(102,194,165)","rgb(252,141,98)","rgb(141,160,203)","rgb(231,138,195)"],5:["rgb(102,194,165)","rgb(252,141,98)","rgb(141,160,203)","rgb(231,138,195)","rgb(166,216,84)"],6:["rgb(102,194,165)","rgb(252,141,98)","rgb(141,160,203)","rgb(231,138,195)","rgb(166,216,84)","rgb(255,217,47)"],7:["rgb(102,194,165)","rgb(252,141,98)","rgb(141,160,203)","rgb(231,138,195)","rgb(166,216,84)","rgb(255,217,47)","rgb(229,196,148)"],8:["rgb(102,194,165)","rgb(252,141,98)","rgb(141,160,203)","rgb(231,138,195)","rgb(166,216,84)","rgb(255,217,47)","rgb(229,196,148)","rgb(179,179,179)"],type:"qual"},Accent:{3:["rgb(127,201,127)","rgb(190,174,212)","rgb(253,192,134)"],4:["rgb(127,201,127)","rgb(190,174,212)","rgb(253,192,134)","rgb(255,255,153)"],5:["rgb(127,201,127)","rgb(190,174,212)","rgb(253,192,134)","rgb(255,255,153)","rgb(56,108,176)"],6:["rgb(127,201,127)","rgb(190,174,212)","rgb(253,192,134)","rgb(255,255,153)","rgb(56,108,176)","rgb(240,2,127)"],7:["rgb(127,201,127)","rgb(190,174,212)","rgb(253,192,134)","rgb(255,255,153)","rgb(56,108,176)","rgb(240,2,127)","rgb(191,91,23)"],8:["rgb(127,201,127)","rgb(190,174,212)","rgb(253,192,134)","rgb(255,255,153)","rgb(56,108,176)","rgb(240,2,127)","rgb(191,91,23)","rgb(102,102,102)"],type:"qual"},Set1:{3:["rgb(228,26,28)","rgb(55,126,184)","rgb(77,175,74)"],4:["rgb(228,26,28)","rgb(55,126,184)","rgb(77,175,74)","rgb(152,78,163)"],5:["rgb(228,26,28)","rgb(55,126,184)","rgb(77,175,74)","rgb(152,78,163)","rgb(255,127,0)"],6:["rgb(228,26,28)","rgb(55,126,184)","rgb(77,175,74)","rgb(152,78,163)","rgb(255,127,0)","rgb(255,255,51)"],7:["rgb(228,26,28)","rgb(55,126,184)","rgb(77,175,74)","rgb(152,78,163)","rgb(255,127,0)","rgb(255,255,51)","rgb(166,86,40)"],8:["rgb(228,26,28)","rgb(55,126,184)","rgb(77,175,74)","rgb(152,78,163)","rgb(255,127,0)","rgb(255,255,51)","rgb(166,86,40)","rgb(247,129,191)"],9:["rgb(228,26,28)","rgb(55,126,184)","rgb(77,175,74)","rgb(152,78,163)","rgb(255,127,0)","rgb(255,255,51)","rgb(166,86,40)","rgb(247,129,191)","rgb(153,153,153)"],type:"qual"},Set3:{3:["rgb(141,211,199)","rgb(255,255,179)","rgb(190,186,218)"],4:["rgb(141,211,199)","rgb(255,255,179)","rgb(190,186,218)","rgb(251,128,114)"],5:["rgb(141,211,199)","rgb(255,255,179)","rgb(190,186,218)","rgb(251,128,114)","rgb(128,177,211)"],6:["rgb(141,211,199)","rgb(255,255,179)","rgb(190,186,218)","rgb(251,128,114)","rgb(128,177,211)","rgb(253,180,98)"],7:["rgb(141,211,199)","rgb(255,255,179)","rgb(190,186,218)","rgb(251,128,114)","rgb(128,177,211)","rgb(253,180,98)","rgb(179,222,105)"],8:["rgb(141,211,199)","rgb(255,255,179)","rgb(190,186,218)","rgb(251,128,114)","rgb(128,177,211)","rgb(253,180,98)","rgb(179,222,105)","rgb(252,205,229)"],9:["rgb(141,211,199)","rgb(255,255,179)","rgb(190,186,218)","rgb(251,128,114)","rgb(128,177,211)","rgb(253,180,98)","rgb(179,222,105)","rgb(252,205,229)","rgb(217,217,217)"],10:["rgb(141,211,199)","rgb(255,255,179)","rgb(190,186,218)","rgb(251,128,114)","rgb(128,177,211)","rgb(253,180,98)","rgb(179,222,105)","rgb(252,205,229)","rgb(217,217,217)","rgb(188,128,189)"],11:["rgb(141,211,199)","rgb(255,255,179)","rgb(190,186,218)","rgb(251,128,114)","rgb(128,177,211)","rgb(253,180,98)","rgb(179,222,105)","rgb(252,205,229)","rgb(217,217,217)","rgb(188,128,189)","rgb(204,235,197)"],12:["rgb(141,211,199)","rgb(255,255,179)","rgb(190,186,218)","rgb(251,128,114)","rgb(128,177,211)","rgb(253,180,98)","rgb(179,222,105)","rgb(252,205,229)","rgb(217,217,217)","rgb(188,128,189)","rgb(204,235,197)","rgb(255,237,111)"],type:"qual"},Dark2:{3:["rgb(27,158,119)","rgb(217,95,2)","rgb(117,112,179)"],4:["rgb(27,158,119)","rgb(217,95,2)","rgb(117,112,179)","rgb(231,41,138)"],5:["rgb(27,158,119)","rgb(217,95,2)","rgb(117,112,179)","rgb(231,41,138)","rgb(102,166,30)"],6:["rgb(27,158,119)","rgb(217,95,2)","rgb(117,112,179)","rgb(231,41,138)","rgb(102,166,30)","rgb(230,171,2)"],7:["rgb(27,158,119)","rgb(217,95,2)","rgb(117,112,179)","rgb(231,41,138)","rgb(102,166,30)","rgb(230,171,2)","rgb(166,118,29)"],8:["rgb(27,158,119)","rgb(217,95,2)","rgb(117,112,179)","rgb(231,41,138)","rgb(102,166,30)","rgb(230,171,2)","rgb(166,118,29)","rgb(102,102,102)"],type:"qual"},Paired:{3:["rgb(166,206,227)","rgb(31,120,180)","rgb(178,223,138)"],4:["rgb(166,206,227)","rgb(31,120,180)","rgb(178,223,138)","rgb(51,160,44)"],5:["rgb(166,206,227)","rgb(31,120,180)","rgb(178,223,138)","rgb(51,160,44)","rgb(251,154,153)"],6:["rgb(166,206,227)","rgb(31,120,180)","rgb(178,223,138)","rgb(51,160,44)","rgb(251,154,153)","rgb(227,26,28)"],7:["rgb(166,206,227)","rgb(31,120,180)","rgb(178,223,138)","rgb(51,160,44)","rgb(251,154,153)","rgb(227,26,28)","rgb(253,191,111)"],8:["rgb(166,206,227)","rgb(31,120,180)","rgb(178,223,138)","rgb(51,160,44)","rgb(251,154,153)","rgb(227,26,28)","rgb(253,191,111)","rgb(255,127,0)"],9:["rgb(166,206,227)","rgb(31,120,180)","rgb(178,223,138)","rgb(51,160,44)","rgb(251,154,153)","rgb(227,26,28)","rgb(253,191,111)","rgb(255,127,0)","rgb(202,178,214)"],10:["rgb(166,206,227)","rgb(31,120,180)","rgb(178,223,138)","rgb(51,160,44)","rgb(251,154,153)","rgb(227,26,28)","rgb(253,191,111)","rgb(255,127,0)","rgb(202,178,214)","rgb(106,61,154)"],11:["rgb(166,206,227)","rgb(31,120,180)","rgb(178,223,138)","rgb(51,160,44)","rgb(251,154,153)","rgb(227,26,28)","rgb(253,191,111)","rgb(255,127,0)","rgb(202,178,214)","rgb(106,61,154)","rgb(255,255,153)"],12:["rgb(166,206,227)","rgb(31,120,180)","rgb(178,223,138)","rgb(51,160,44)","rgb(251,154,153)","rgb(227,26,28)","rgb(253,191,111)","rgb(255,127,0)","rgb(202,178,214)","rgb(106,61,154)","rgb(255,255,153)","rgb(177,89,40)"],type:"qual"},Pastel2:{3:["rgb(179,226,205)","rgb(253,205,172)","rgb(203,213,232)"],4:["rgb(179,226,205)","rgb(253,205,172)","rgb(203,213,232)","rgb(244,202,228)"],5:["rgb(179,226,205)","rgb(253,205,172)","rgb(203,213,232)","rgb(244,202,228)","rgb(230,245,201)"],6:["rgb(179,226,205)","rgb(253,205,172)","rgb(203,213,232)","rgb(244,202,228)","rgb(230,245,201)","rgb(255,242,174)"],7:["rgb(179,226,205)","rgb(253,205,172)","rgb(203,213,232)","rgb(244,202,228)","rgb(230,245,201)","rgb(255,242,174)","rgb(241,226,204)"],8:["rgb(179,226,205)","rgb(253,205,172)","rgb(203,213,232)","rgb(244,202,228)","rgb(230,245,201)","rgb(255,242,174)","rgb(241,226,204)","rgb(204,204,204)"],type:"qual"},Pastel1:{3:["rgb(251,180,174)","rgb(179,205,227)","rgb(204,235,197)"],4:["rgb(251,180,174)","rgb(179,205,227)","rgb(204,235,197)","rgb(222,203,228)"],5:["rgb(251,180,174)","rgb(179,205,227)","rgb(204,235,197)","rgb(222,203,228)","rgb(254,217,166)"],6:["rgb(251,180,174)","rgb(179,205,227)","rgb(204,235,197)","rgb(222,203,228)","rgb(254,217,166)","rgb(255,255,204)"],7:["rgb(251,180,174)","rgb(179,205,227)","rgb(204,235,197)","rgb(222,203,228)","rgb(254,217,166)","rgb(255,255,204)","rgb(229,216,189)"],8:["rgb(251,180,174)","rgb(179,205,227)","rgb(204,235,197)","rgb(222,203,228)","rgb(254,217,166)","rgb(255,255,204)","rgb(229,216,189)","rgb(253,218,236)"],9:["rgb(251,180,174)","rgb(179,205,227)","rgb(204,235,197)","rgb(222,203,228)","rgb(254,217,166)","rgb(255,255,204)","rgb(229,216,189)","rgb(253,218,236)","rgb(242,242,242)"],type:"qual"},OrRd:{3:["rgb(254,232,200)","rgb(253,187,132)","rgb(227,74,51)"],4:["rgb(254,240,217)","rgb(253,204,138)","rgb(252,141,89)","rgb(215,48,31)"],5:["rgb(254,240,217)","rgb(253,204,138)","rgb(252,141,89)","rgb(227,74,51)","rgb(179,0,0)"],6:["rgb(254,240,217)","rgb(253,212,158)","rgb(253,187,132)","rgb(252,141,89)","rgb(227,74,51)","rgb(179,0,0)"],7:["rgb(254,240,217)","rgb(253,212,158)","rgb(253,187,132)","rgb(252,141,89)","rgb(239,101,72)","rgb(215,48,31)","rgb(153,0,0)"],8:["rgb(255,247,236)","rgb(254,232,200)","rgb(253,212,158)","rgb(253,187,132)","rgb(252,141,89)","rgb(239,101,72)","rgb(215,48,31)","rgb(153,0,0)"],9:["rgb(255,247,236)","rgb(254,232,200)","rgb(253,212,158)","rgb(253,187,132)","rgb(252,141,89)","rgb(239,101,72)","rgb(215,48,31)","rgb(179,0,0)","rgb(127,0,0)"],type:"seq"},PuBu:{3:["rgb(236,231,242)","rgb(166,189,219)","rgb(43,140,190)"],4:["rgb(241,238,246)","rgb(189,201,225)","rgb(116,169,207)","rgb(5,112,176)"],5:["rgb(241,238,246)","rgb(189,201,225)","rgb(116,169,207)","rgb(43,140,190)","rgb(4,90,141)"],6:["rgb(241,238,246)","rgb(208,209,230)","rgb(166,189,219)","rgb(116,169,207)","rgb(43,140,190)","rgb(4,90,141)"],7:["rgb(241,238,246)","rgb(208,209,230)","rgb(166,189,219)","rgb(116,169,207)","rgb(54,144,192)","rgb(5,112,176)","rgb(3,78,123)"],8:["rgb(255,247,251)","rgb(236,231,242)","rgb(208,209,230)","rgb(166,189,219)","rgb(116,169,207)","rgb(54,144,192)","rgb(5,112,176)","rgb(3,78,123)"],9:["rgb(255,247,251)","rgb(236,231,242)","rgb(208,209,230)","rgb(166,189,219)","rgb(116,169,207)","rgb(54,144,192)","rgb(5,112,176)","rgb(4,90,141)","rgb(2,56,88)"],type:"seq"},BuPu:{3:["rgb(224,236,244)","rgb(158,188,218)","rgb(136,86,167)"],4:["rgb(237,248,251)","rgb(179,205,227)","rgb(140,150,198)","rgb(136,65,157)"],5:["rgb(237,248,251)","rgb(179,205,227)","rgb(140,150,198)","rgb(136,86,167)","rgb(129,15,124)"],6:["rgb(237,248,251)","rgb(191,211,230)","rgb(158,188,218)","rgb(140,150,198)","rgb(136,86,167)","rgb(129,15,124)"],7:["rgb(237,248,251)","rgb(191,211,230)","rgb(158,188,218)","rgb(140,150,198)","rgb(140,107,177)","rgb(136,65,157)","rgb(110,1,107)"],8:["rgb(247,252,253)","rgb(224,236,244)","rgb(191,211,230)","rgb(158,188,218)","rgb(140,150,198)","rgb(140,107,177)","rgb(136,65,157)","rgb(110,1,107)"],9:["rgb(247,252,253)","rgb(224,236,244)","rgb(191,211,230)","rgb(158,188,218)","rgb(140,150,198)","rgb(140,107,177)","rgb(136,65,157)","rgb(129,15,124)","rgb(77,0,75)"],type:"seq"},Oranges:{3:["rgb(254,230,206)","rgb(253,174,107)","rgb(230,85,13)"],4:["rgb(254,237,222)","rgb(253,190,133)","rgb(253,141,60)","rgb(217,71,1)"],5:["rgb(254,237,222)","rgb(253,190,133)","rgb(253,141,60)","rgb(230,85,13)","rgb(166,54,3)"],6:["rgb(254,237,222)","rgb(253,208,162)","rgb(253,174,107)","rgb(253,141,60)","rgb(230,85,13)","rgb(166,54,3)"],7:["rgb(254,237,222)","rgb(253,208,162)","rgb(253,174,107)","rgb(253,141,60)","rgb(241,105,19)","rgb(217,72,1)","rgb(140,45,4)"],8:["rgb(255,245,235)","rgb(254,230,206)","rgb(253,208,162)","rgb(253,174,107)","rgb(253,141,60)","rgb(241,105,19)","rgb(217,72,1)","rgb(140,45,4)"],9:["rgb(255,245,235)","rgb(254,230,206)","rgb(253,208,162)","rgb(253,174,107)","rgb(253,141,60)","rgb(241,105,19)","rgb(217,72,1)","rgb(166,54,3)","rgb(127,39,4)"],type:"seq"},BuGn:{3:["rgb(229,245,249)","rgb(153,216,201)","rgb(44,162,95)"],4:["rgb(237,248,251)","rgb(178,226,226)","rgb(102,194,164)","rgb(35,139,69)"],5:["rgb(237,248,251)","rgb(178,226,226)","rgb(102,194,164)","rgb(44,162,95)","rgb(0,109,44)"],6:["rgb(237,248,251)","rgb(204,236,230)","rgb(153,216,201)","rgb(102,194,164)","rgb(44,162,95)","rgb(0,109,44)"],7:["rgb(237,248,251)","rgb(204,236,230)","rgb(153,216,201)","rgb(102,194,164)","rgb(65,174,118)","rgb(35,139,69)","rgb(0,88,36)"],8:["rgb(247,252,253)","rgb(229,245,249)","rgb(204,236,230)","rgb(153,216,201)","rgb(102,194,164)","rgb(65,174,118)","rgb(35,139,69)","rgb(0,88,36)"],9:["rgb(247,252,253)","rgb(229,245,249)","rgb(204,236,230)","rgb(153,216,201)","rgb(102,194,164)","rgb(65,174,118)","rgb(35,139,69)","rgb(0,109,44)","rgb(0,68,27)"],type:"seq"},YlOrBr:{3:["rgb(255,247,188)","rgb(254,196,79)","rgb(217,95,14)"],4:["rgb(255,255,212)","rgb(254,217,142)","rgb(254,153,41)","rgb(204,76,2)"],5:["rgb(255,255,212)","rgb(254,217,142)","rgb(254,153,41)","rgb(217,95,14)","rgb(153,52,4)"],6:["rgb(255,255,212)","rgb(254,227,145)","rgb(254,196,79)","rgb(254,153,41)","rgb(217,95,14)","rgb(153,52,4)"],7:["rgb(255,255,212)","rgb(254,227,145)","rgb(254,196,79)","rgb(254,153,41)","rgb(236,112,20)","rgb(204,76,2)","rgb(140,45,4)"],8:["rgb(255,255,229)","rgb(255,247,188)","rgb(254,227,145)","rgb(254,196,79)","rgb(254,153,41)","rgb(236,112,20)","rgb(204,76,2)","rgb(140,45,4)"],9:["rgb(255,255,229)","rgb(255,247,188)","rgb(254,227,145)","rgb(254,196,79)","rgb(254,153,41)","rgb(236,112,20)","rgb(204,76,2)","rgb(153,52,4)","rgb(102,37,6)"],type:"seq"},YlGn:{3:["rgb(247,252,185)","rgb(173,221,142)","rgb(49,163,84)"],4:["rgb(255,255,204)","rgb(194,230,153)","rgb(120,198,121)","rgb(35,132,67)"],5:["rgb(255,255,204)","rgb(194,230,153)","rgb(120,198,121)","rgb(49,163,84)","rgb(0,104,55)"],6:["rgb(255,255,204)","rgb(217,240,163)","rgb(173,221,142)","rgb(120,198,121)","rgb(49,163,84)","rgb(0,104,55)"],7:["rgb(255,255,204)","rgb(217,240,163)","rgb(173,221,142)","rgb(120,198,121)","rgb(65,171,93)","rgb(35,132,67)","rgb(0,90,50)"],8:["rgb(255,255,229)","rgb(247,252,185)","rgb(217,240,163)","rgb(173,221,142)","rgb(120,198,121)","rgb(65,171,93)","rgb(35,132,67)","rgb(0,90,50)"],9:["rgb(255,255,229)","rgb(247,252,185)","rgb(217,240,163)","rgb(173,221,142)","rgb(120,198,121)","rgb(65,171,93)","rgb(35,132,67)","rgb(0,104,55)","rgb(0,69,41)"],type:"seq"},Reds:{3:["rgb(254,224,210)","rgb(252,146,114)","rgb(222,45,38)"],4:["rgb(254,229,217)","rgb(252,174,145)","rgb(251,106,74)","rgb(203,24,29)"],5:["rgb(254,229,217)","rgb(252,174,145)","rgb(251,106,74)","rgb(222,45,38)","rgb(165,15,21)"],6:["rgb(254,229,217)","rgb(252,187,161)","rgb(252,146,114)","rgb(251,106,74)","rgb(222,45,38)","rgb(165,15,21)"],7:["rgb(254,229,217)","rgb(252,187,161)","rgb(252,146,114)","rgb(251,106,74)","rgb(239,59,44)","rgb(203,24,29)","rgb(153,0,13)"],8:["rgb(255,245,240)","rgb(254,224,210)","rgb(252,187,161)","rgb(252,146,114)","rgb(251,106,74)","rgb(239,59,44)","rgb(203,24,29)","rgb(153,0,13)"],9:["rgb(255,245,240)","rgb(254,224,210)","rgb(252,187,161)","rgb(252,146,114)","rgb(251,106,74)","rgb(239,59,44)","rgb(203,24,29)","rgb(165,15,21)","rgb(103,0,13)"],type:"seq"},RdPu:{3:["rgb(253,224,221)","rgb(250,159,181)","rgb(197,27,138)"],4:["rgb(254,235,226)","rgb(251,180,185)","rgb(247,104,161)","rgb(174,1,126)"],5:["rgb(254,235,226)","rgb(251,180,185)","rgb(247,104,161)","rgb(197,27,138)","rgb(122,1,119)"],6:["rgb(254,235,226)","rgb(252,197,192)","rgb(250,159,181)","rgb(247,104,161)","rgb(197,27,138)","rgb(122,1,119)"],7:["rgb(254,235,226)","rgb(252,197,192)","rgb(250,159,181)","rgb(247,104,161)","rgb(221,52,151)","rgb(174,1,126)","rgb(122,1,119)"],8:["rgb(255,247,243)","rgb(253,224,221)","rgb(252,197,192)","rgb(250,159,181)","rgb(247,104,161)","rgb(221,52,151)","rgb(174,1,126)","rgb(122,1,119)"],9:["rgb(255,247,243)","rgb(253,224,221)","rgb(252,197,192)","rgb(250,159,181)","rgb(247,104,161)","rgb(221,52,151)","rgb(174,1,126)","rgb(122,1,119)","rgb(73,0,106)"],type:"seq"},Greens:{3:["rgb(229,245,224)","rgb(161,217,155)","rgb(49,163,84)"],4:["rgb(237,248,233)","rgb(186,228,179)","rgb(116,196,118)","rgb(35,139,69)"],5:["rgb(237,248,233)","rgb(186,228,179)","rgb(116,196,118)","rgb(49,163,84)","rgb(0,109,44)"],6:["rgb(237,248,233)","rgb(199,233,192)","rgb(161,217,155)","rgb(116,196,118)","rgb(49,163,84)","rgb(0,109,44)"],7:["rgb(237,248,233)","rgb(199,233,192)","rgb(161,217,155)","rgb(116,196,118)","rgb(65,171,93)","rgb(35,139,69)","rgb(0,90,50)"],8:["rgb(247,252,245)","rgb(229,245,224)","rgb(199,233,192)","rgb(161,217,155)","rgb(116,196,118)","rgb(65,171,93)","rgb(35,139,69)","rgb(0,90,50)"],9:["rgb(247,252,245)","rgb(229,245,224)","rgb(199,233,192)","rgb(161,217,155)","rgb(116,196,118)","rgb(65,171,93)","rgb(35,139,69)","rgb(0,109,44)","rgb(0,68,27)"],type:"seq"},YlGnBu:{3:["rgb(237,248,177)","rgb(127,205,187)","rgb(44,127,184)"],4:["rgb(255,255,204)","rgb(161,218,180)","rgb(65,182,196)","rgb(34,94,168)"],5:["rgb(255,255,204)","rgb(161,218,180)","rgb(65,182,196)","rgb(44,127,184)","rgb(37,52,148)"],6:["rgb(255,255,204)","rgb(199,233,180)","rgb(127,205,187)","rgb(65,182,196)","rgb(44,127,184)","rgb(37,52,148)"],7:["rgb(255,255,204)","rgb(199,233,180)","rgb(127,205,187)","rgb(65,182,196)","rgb(29,145,192)","rgb(34,94,168)","rgb(12,44,132)"],8:["rgb(255,255,217)","rgb(237,248,177)","rgb(199,233,180)","rgb(127,205,187)","rgb(65,182,196)","rgb(29,145,192)","rgb(34,94,168)","rgb(12,44,132)"],9:["rgb(255,255,217)","rgb(237,248,177)","rgb(199,233,180)","rgb(127,205,187)","rgb(65,182,196)","rgb(29,145,192)","rgb(34,94,168)","rgb(37,52,148)","rgb(8,29,88)"],type:"seq"},Purples:{3:["rgb(239,237,245)","rgb(188,189,220)","rgb(117,107,177)"],4:["rgb(242,240,247)","rgb(203,201,226)","rgb(158,154,200)","rgb(106,81,163)"],5:["rgb(242,240,247)","rgb(203,201,226)","rgb(158,154,200)","rgb(117,107,177)","rgb(84,39,143)"],6:["rgb(242,240,247)","rgb(218,218,235)","rgb(188,189,220)","rgb(158,154,200)","rgb(117,107,177)","rgb(84,39,143)"],7:["rgb(242,240,247)","rgb(218,218,235)","rgb(188,189,220)","rgb(158,154,200)","rgb(128,125,186)","rgb(106,81,163)","rgb(74,20,134)"],8:["rgb(252,251,253)","rgb(239,237,245)","rgb(218,218,235)","rgb(188,189,220)","rgb(158,154,200)","rgb(128,125,186)","rgb(106,81,163)","rgb(74,20,134)"],9:["rgb(252,251,253)","rgb(239,237,245)","rgb(218,218,235)","rgb(188,189,220)","rgb(158,154,200)","rgb(128,125,186)","rgb(106,81,163)","rgb(84,39,143)","rgb(63,0,125)"],type:"seq"},GnBu:{3:["rgb(224,243,219)","rgb(168,221,181)","rgb(67,162,202)"],4:["rgb(240,249,232)","rgb(186,228,188)","rgb(123,204,196)","rgb(43,140,190)"],5:["rgb(240,249,232)","rgb(186,228,188)","rgb(123,204,196)","rgb(67,162,202)","rgb(8,104,172)"],6:["rgb(240,249,232)","rgb(204,235,197)","rgb(168,221,181)","rgb(123,204,196)","rgb(67,162,202)","rgb(8,104,172)"],7:["rgb(240,249,232)","rgb(204,235,197)","rgb(168,221,181)","rgb(123,204,196)","rgb(78,179,211)","rgb(43,140,190)","rgb(8,88,158)"],8:["rgb(247,252,240)","rgb(224,243,219)","rgb(204,235,197)","rgb(168,221,181)","rgb(123,204,196)","rgb(78,179,211)","rgb(43,140,190)","rgb(8,88,158)"],9:["rgb(247,252,240)","rgb(224,243,219)","rgb(204,235,197)","rgb(168,221,181)","rgb(123,204,196)","rgb(78,179,211)","rgb(43,140,190)","rgb(8,104,172)","rgb(8,64,129)"],type:"seq"},Greys:{3:["rgb(240,240,240)","rgb(189,189,189)","rgb(99,99,99)"],4:["rgb(247,247,247)","rgb(204,204,204)","rgb(150,150,150)","rgb(82,82,82)"],5:["rgb(247,247,247)","rgb(204,204,204)","rgb(150,150,150)","rgb(99,99,99)","rgb(37,37,37)"],6:["rgb(247,247,247)","rgb(217,217,217)","rgb(189,189,189)","rgb(150,150,150)","rgb(99,99,99)","rgb(37,37,37)"],7:["rgb(247,247,247)","rgb(217,217,217)","rgb(189,189,189)","rgb(150,150,150)","rgb(115,115,115)","rgb(82,82,82)","rgb(37,37,37)"],8:["rgb(255,255,255)","rgb(240,240,240)","rgb(217,217,217)","rgb(189,189,189)","rgb(150,150,150)","rgb(115,115,115)","rgb(82,82,82)","rgb(37,37,37)"],9:["rgb(255,255,255)","rgb(240,240,240)","rgb(217,217,217)","rgb(189,189,189)","rgb(150,150,150)","rgb(115,115,115)","rgb(82,82,82)","rgb(37,37,37)","rgb(0,0,0)"],type:"seq"},YlOrRd:{3:["rgb(255,237,160)","rgb(254,178,76)","rgb(240,59,32)"],4:["rgb(255,255,178)","rgb(254,204,92)","rgb(253,141,60)","rgb(227,26,28)"],5:["rgb(255,255,178)","rgb(254,204,92)","rgb(253,141,60)","rgb(240,59,32)","rgb(189,0,38)"],6:["rgb(255,255,178)","rgb(254,217,118)","rgb(254,178,76)","rgb(253,141,60)","rgb(240,59,32)","rgb(189,0,38)"],7:["rgb(255,255,178)","rgb(254,217,118)","rgb(254,178,76)","rgb(253,141,60)","rgb(252,78,42)","rgb(227,26,28)","rgb(177,0,38)"],8:["rgb(255,255,204)","rgb(255,237,160)","rgb(254,217,118)","rgb(254,178,76)","rgb(253,141,60)","rgb(252,78,42)","rgb(227,26,28)","rgb(177,0,38)"],type:"seq"},PuRd:{3:["rgb(231,225,239)","rgb(201,148,199)","rgb(221,28,119)"],4:["rgb(241,238,246)","rgb(215,181,216)","rgb(223,101,176)","rgb(206,18,86)"],5:["rgb(241,238,246)","rgb(215,181,216)","rgb(223,101,176)","rgb(221,28,119)","rgb(152,0,67)"],6:["rgb(241,238,246)","rgb(212,185,218)","rgb(201,148,199)","rgb(223,101,176)","rgb(221,28,119)","rgb(152,0,67)"],7:["rgb(241,238,246)","rgb(212,185,218)","rgb(201,148,199)","rgb(223,101,176)","rgb(231,41,138)","rgb(206,18,86)","rgb(145,0,63)"],8:["rgb(247,244,249)","rgb(231,225,239)","rgb(212,185,218)","rgb(201,148,199)","rgb(223,101,176)","rgb(231,41,138)","rgb(206,18,86)","rgb(145,0,63)"],9:["rgb(247,244,249)","rgb(231,225,239)","rgb(212,185,218)","rgb(201,148,199)","rgb(223,101,176)","rgb(231,41,138)","rgb(206,18,86)","rgb(152,0,67)","rgb(103,0,31)"],type:"seq"},Blues:{3:["rgb(222,235,247)","rgb(158,202,225)","rgb(49,130,189)"],4:["rgb(239,243,255)","rgb(189,215,231)","rgb(107,174,214)","rgb(33,113,181)"],5:["rgb(239,243,255)","rgb(189,215,231)","rgb(107,174,214)","rgb(49,130,189)","rgb(8,81,156)"],6:["rgb(239,243,255)","rgb(198,219,239)","rgb(158,202,225)","rgb(107,174,214)","rgb(49,130,189)","rgb(8,81,156)"],7:["rgb(239,243,255)","rgb(198,219,239)","rgb(158,202,225)","rgb(107,174,214)","rgb(66,146,198)","rgb(33,113,181)","rgb(8,69,148)"],8:["rgb(247,251,255)","rgb(222,235,247)","rgb(198,219,239)","rgb(158,202,225)","rgb(107,174,214)","rgb(66,146,198)","rgb(33,113,181)","rgb(8,69,148)"],9:["rgb(247,251,255)","rgb(222,235,247)","rgb(198,219,239)","rgb(158,202,225)","rgb(107,174,214)","rgb(66,146,198)","rgb(33,113,181)","rgb(8,81,156)","rgb(8,48,107)"],type:"seq"},PuBuGn:{3:["rgb(236,226,240)","rgb(166,189,219)","rgb(28,144,153)"],4:["rgb(246,239,247)","rgb(189,201,225)","rgb(103,169,207)","rgb(2,129,138)"],5:["rgb(246,239,247)","rgb(189,201,225)","rgb(103,169,207)","rgb(28,144,153)","rgb(1,108,89)"],6:["rgb(246,239,247)","rgb(208,209,230)","rgb(166,189,219)","rgb(103,169,207)","rgb(28,144,153)","rgb(1,108,89)"],7:["rgb(246,239,247)","rgb(208,209,230)","rgb(166,189,219)","rgb(103,169,207)","rgb(54,144,192)","rgb(2,129,138)","rgb(1,100,80)"],8:["rgb(255,247,251)","rgb(236,226,240)","rgb(208,209,230)","rgb(166,189,219)","rgb(103,169,207)","rgb(54,144,192)","rgb(2,129,138)","rgb(1,100,80)"],9:["rgb(255,247,251)","rgb(236,226,240)","rgb(208,209,230)","rgb(166,189,219)","rgb(103,169,207)","rgb(54,144,192)","rgb(2,129,138)","rgb(1,108,89)","rgb(1,70,54)"],type:"seq"},viridis:{256:["#440154","#440256","#450457","#450559","#46075a","#46085c","#460a5d","#460b5e","#470d60","#470e61","#471063","#471164","#471365","#481467","#481668","#481769","#48186a","#481a6c","#481b6d","#481c6e","#481d6f","#481f70","#482071","#482173","#482374","#482475","#482576","#482677","#482878","#482979","#472a7a","#472c7a","#472d7b","#472e7c","#472f7d","#46307e","#46327e","#46337f","#463480","#453581","#453781","#453882","#443983","#443a83","#443b84","#433d84","#433e85","#423f85","#424086","#424186","#414287","#414487","#404588","#404688","#3f4788","#3f4889","#3e4989","#3e4a89","#3e4c8a","#3d4d8a","#3d4e8a","#3c4f8a","#3c508b","#3b518b","#3b528b","#3a538b","#3a548c","#39558c","#39568c","#38588c","#38598c","#375a8c","#375b8d","#365c8d","#365d8d","#355e8d","#355f8d","#34608d","#34618d","#33628d","#33638d","#32648e","#32658e","#31668e","#31678e","#31688e","#30698e","#306a8e","#2f6b8e","#2f6c8e","#2e6d8e","#2e6e8e","#2e6f8e","#2d708e","#2d718e","#2c718e","#2c728e","#2c738e","#2b748e","#2b758e","#2a768e","#2a778e","#2a788e","#29798e","#297a8e","#297b8e","#287c8e","#287d8e","#277e8e","#277f8e","#27808e","#26818e","#26828e","#26828e","#25838e","#25848e","#25858e","#24868e","#24878e","#23888e","#23898e","#238a8d","#228b8d","#228c8d","#228d8d","#218e8d","#218f8d","#21908d","#21918c","#20928c","#20928c","#20938c","#1f948c","#1f958b","#1f968b","#1f978b","#1f988b","#1f998a","#1f9a8a","#1e9b8a","#1e9c89","#1e9d89","#1f9e89","#1f9f88","#1fa088","#1fa188","#1fa187","#1fa287","#20a386","#20a486","#21a585","#21a685","#22a785","#22a884","#23a983","#24aa83","#25ab82","#25ac82","#26ad81","#27ad81","#28ae80","#29af7f","#2ab07f","#2cb17e","#2db27d","#2eb37c","#2fb47c","#31b57b","#32b67a","#34b679","#35b779","#37b878","#38b977","#3aba76","#3bbb75","#3dbc74","#3fbc73","#40bd72","#42be71","#44bf70","#46c06f","#48c16e","#4ac16d","#4cc26c","#4ec36b","#50c46a","#52c569","#54c568","#56c667","#58c765","#5ac864","#5cc863","#5ec962","#60ca60","#63cb5f","#65cb5e","#67cc5c","#69cd5b","#6ccd5a","#6ece58","#70cf57","#73d056","#75d054","#77d153","#7ad151","#7cd250","#7fd34e","#81d34d","#84d44b","#86d549","#89d548","#8bd646","#8ed645","#90d743","#93d741","#95d840","#98d83e","#9bd93c","#9dd93b","#a0da39","#a2da37","#a5db36","#a8db34","#aadc32","#addc30","#b0dd2f","#b2dd2d","#b5de2b","#b8de29","#bade28","#bddf26","#c0df25","#c2df23","#c5e021","#c8e020","#cae11f","#cde11d","#d0e11c","#d2e21b","#d5e21a","#d8e219","#dae319","#dde318","#dfe318","#e2e418","#e5e419","#e7e419","#eae51a","#ece51b","#efe51c","#f1e51d","#f4e61e","#f6e620","#f8e621","#fbe723","#fde725"],type:"seq"},plasma:{256:["#0d0887","#100788","#130789","#16078a","#19068c","#1b068d","#1d068e","#20068f","#220690","#240691","#260591","#280592","#2a0593","#2c0594","#2e0595","#2f0596","#310597","#330597","#350498","#370499","#38049a","#3a049a","#3c049b","#3e049c","#3f049c","#41049d","#43039e","#44039e","#46039f","#48039f","#4903a0","#4b03a1","#4c02a1","#4e02a2","#5002a2","#5102a3","#5302a3","#5502a4","#5601a4","#5801a4","#5901a5","#5b01a5","#5c01a6","#5e01a6","#6001a6","#6100a7","#6300a7","#6400a7","#6600a7","#6700a8","#6900a8","#6a00a8","#6c00a8","#6e00a8","#6f00a8","#7100a8","#7201a8","#7401a8","#7501a8","#7701a8","#7801a8","#7a02a8","#7b02a8","#7d03a8","#7e03a8","#8004a8","#8104a7","#8305a7","#8405a7","#8606a6","#8707a6","#8808a6","#8a09a5","#8b0aa5","#8d0ba5","#8e0ca4","#8f0da4","#910ea3","#920fa3","#9410a2","#9511a1","#9613a1","#9814a0","#99159f","#9a169f","#9c179e","#9d189d","#9e199d","#a01a9c","#a11b9b","#a21d9a","#a31e9a","#a51f99","#a62098","#a72197","#a82296","#aa2395","#ab2494","#ac2694","#ad2793","#ae2892","#b02991","#b12a90","#b22b8f","#b32c8e","#b42e8d","#b52f8c","#b6308b","#b7318a","#b83289","#ba3388","#bb3488","#bc3587","#bd3786","#be3885","#bf3984","#c03a83","#c13b82","#c23c81","#c33d80","#c43e7f","#c5407e","#c6417d","#c7427c","#c8437b","#c9447a","#ca457a","#cb4679","#cc4778","#cc4977","#cd4a76","#ce4b75","#cf4c74","#d04d73","#d14e72","#d24f71","#d35171","#d45270","#d5536f","#d5546e","#d6556d","#d7566c","#d8576b","#d9586a","#da5a6a","#da5b69","#db5c68","#dc5d67","#dd5e66","#de5f65","#de6164","#df6263","#e06363","#e16462","#e26561","#e26660","#e3685f","#e4695e","#e56a5d","#e56b5d","#e66c5c","#e76e5b","#e76f5a","#e87059","#e97158","#e97257","#ea7457","#eb7556","#eb7655","#ec7754","#ed7953","#ed7a52","#ee7b51","#ef7c51","#ef7e50","#f07f4f","#f0804e","#f1814d","#f1834c","#f2844b","#f3854b","#f3874a","#f48849","#f48948","#f58b47","#f58c46","#f68d45","#f68f44","#f79044","#f79143","#f79342","#f89441","#f89540","#f9973f","#f9983e","#f99a3e","#fa9b3d","#fa9c3c","#fa9e3b","#fb9f3a","#fba139","#fba238","#fca338","#fca537","#fca636","#fca835","#fca934","#fdab33","#fdac33","#fdae32","#fdaf31","#fdb130","#fdb22f","#fdb42f","#fdb52e","#feb72d","#feb82c","#feba2c","#febb2b","#febd2a","#febe2a","#fec029","#fdc229","#fdc328","#fdc527","#fdc627","#fdc827","#fdca26","#fdcb26","#fccd25","#fcce25","#fcd025","#fcd225","#fbd324","#fbd524","#fbd724","#fad824","#fada24","#f9dc24","#f9dd25","#f8df25","#f8e125","#f7e225","#f7e425","#f6e626","#f6e826","#f5e926","#f5eb27","#f4ed27","#f3ee27","#f3f027","#f2f227","#f1f426","#f1f525","#f0f724","#f0f921"],type:"seq"},inferno:{256:["#000004","#010005","#010106","#010108","#02010a","#02020c","#02020e","#030210","#040312","#040314","#050417","#060419","#07051b","#08051d","#09061f","#0a0722","#0b0724","#0c0826","#0d0829","#0e092b","#10092d","#110a30","#120a32","#140b34","#150b37","#160b39","#180c3c","#190c3e","#1b0c41","#1c0c43","#1e0c45","#1f0c48","#210c4a","#230c4c","#240c4f","#260c51","#280b53","#290b55","#2b0b57","#2d0b59","#2f0a5b","#310a5c","#320a5e","#340a5f","#360961","#380962","#390963","#3b0964","#3d0965","#3e0966","#400a67","#420a68","#440a68","#450a69","#470b6a","#490b6a","#4a0c6b","#4c0c6b","#4d0d6c","#4f0d6c","#510e6c","#520e6d","#540f6d","#550f6d","#57106e","#59106e","#5a116e","#5c126e","#5d126e","#5f136e","#61136e","#62146e","#64156e","#65156e","#67166e","#69166e","#6a176e","#6c186e","#6d186e","#6f196e","#71196e","#721a6e","#741a6e","#751b6e","#771c6d","#781c6d","#7a1d6d","#7c1d6d","#7d1e6d","#7f1e6c","#801f6c","#82206c","#84206b","#85216b","#87216b","#88226a","#8a226a","#8c2369","#8d2369","#8f2469","#902568","#922568","#932667","#952667","#972766","#982766","#9a2865","#9b2964","#9d2964","#9f2a63","#a02a63","#a22b62","#a32c61","#a52c60","#a62d60","#a82e5f","#a92e5e","#ab2f5e","#ad305d","#ae305c","#b0315b","#b1325a","#b3325a","#b43359","#b63458","#b73557","#b93556","#ba3655","#bc3754","#bd3853","#bf3952","#c03a51","#c13a50","#c33b4f","#c43c4e","#c63d4d","#c73e4c","#c83f4b","#ca404a","#cb4149","#cc4248","#ce4347","#cf4446","#d04545","#d24644","#d34743","#d44842","#d54a41","#d74b3f","#d84c3e","#d94d3d","#da4e3c","#db503b","#dd513a","#de5238","#df5337","#e05536","#e15635","#e25734","#e35933","#e45a31","#e55c30","#e65d2f","#e75e2e","#e8602d","#e9612b","#ea632a","#eb6429","#eb6628","#ec6726","#ed6925","#ee6a24","#ef6c23","#ef6e21","#f06f20","#f1711f","#f1731d","#f2741c","#f3761b","#f37819","#f47918","#f57b17","#f57d15","#f67e14","#f68013","#f78212","#f78410","#f8850f","#f8870e","#f8890c","#f98b0b","#f98c0a","#f98e09","#fa9008","#fa9207","#fa9407","#fb9606","#fb9706","#fb9906","#fb9b06","#fb9d07","#fc9f07","#fca108","#fca309","#fca50a","#fca60c","#fca80d","#fcaa0f","#fcac11","#fcae12","#fcb014","#fcb216","#fcb418","#fbb61a","#fbb81d","#fbba1f","#fbbc21","#fbbe23","#fac026","#fac228","#fac42a","#fac62d","#f9c72f","#f9c932","#f9cb35","#f8cd37","#f8cf3a","#f7d13d","#f7d340","#f6d543","#f6d746","#f5d949","#f5db4c","#f4dd4f","#f4df53","#f4e156","#f3e35a","#f3e55d","#f2e661","#f2e865","#f2ea69","#f1ec6d","#f1ed71","#f1ef75","#f1f179","#f2f27d","#f2f482","#f3f586","#f3f68a","#f4f88e","#f5f992","#f6fa96","#f8fb9a","#f9fc9d","#fafda1","#fcffa4"],type:"seq"},magma:{256:["#000004","#010005","#010106","#010108","#020109","#02020b","#02020d","#03030f","#030312","#040414","#050416","#060518","#06051a","#07061c","#08071e","#090720","#0a0822","#0b0924","#0c0926","#0d0a29","#0e0b2b","#100b2d","#110c2f","#120d31","#130d34","#140e36","#150e38","#160f3b","#180f3d","#19103f","#1a1042","#1c1044","#1d1147","#1e1149","#20114b","#21114e","#221150","#241253","#251255","#271258","#29115a","#2a115c","#2c115f","#2d1161","#2f1163","#311165","#331067","#341069","#36106b","#38106c","#390f6e","#3b0f70","#3d0f71","#3f0f72","#400f74","#420f75","#440f76","#451077","#471078","#491078","#4a1079","#4c117a","#4e117b","#4f127b","#51127c","#52137c","#54137d","#56147d","#57157e","#59157e","#5a167e","#5c167f","#5d177f","#5f187f","#601880","#621980","#641a80","#651a80","#671b80","#681c81","#6a1c81","#6b1d81","#6d1d81","#6e1e81","#701f81","#721f81","#732081","#752181","#762181","#782281","#792282","#7b2382","#7c2382","#7e2482","#802582","#812581","#832681","#842681","#862781","#882781","#892881","#8b2981","#8c2981","#8e2a81","#902a81","#912b81","#932b80","#942c80","#962c80","#982d80","#992d80","#9b2e7f","#9c2e7f","#9e2f7f","#a02f7f","#a1307e","#a3307e","#a5317e","#a6317d","#a8327d","#aa337d","#ab337c","#ad347c","#ae347b","#b0357b","#b2357b","#b3367a","#b5367a","#b73779","#b83779","#ba3878","#bc3978","#bd3977","#bf3a77","#c03a76","#c23b75","#c43c75","#c53c74","#c73d73","#c83e73","#ca3e72","#cc3f71","#cd4071","#cf4070","#d0416f","#d2426f","#d3436e","#d5446d","#d6456c","#d8456c","#d9466b","#db476a","#dc4869","#de4968","#df4a68","#e04c67","#e24d66","#e34e65","#e44f64","#e55064","#e75263","#e85362","#e95462","#ea5661","#eb5760","#ec5860","#ed5a5f","#ee5b5e","#ef5d5e","#f05f5e","#f1605d","#f2625d","#f2645c","#f3655c","#f4675c","#f4695c","#f56b5c","#f66c5c","#f66e5c","#f7705c","#f7725c","#f8745c","#f8765c","#f9785d","#f9795d","#f97b5d","#fa7d5e","#fa7f5e","#fa815f","#fb835f","#fb8560","#fb8761","#fc8961","#fc8a62","#fc8c63","#fc8e64","#fc9065","#fd9266","#fd9467","#fd9668","#fd9869","#fd9a6a","#fd9b6b","#fe9d6c","#fe9f6d","#fea16e","#fea36f","#fea571","#fea772","#fea973","#feaa74","#feac76","#feae77","#feb078","#feb27a","#feb47b","#feb67c","#feb77e","#feb97f","#febb81","#febd82","#febf84","#fec185","#fec287","#fec488","#fec68a","#fec88c","#feca8d","#fecc8f","#fecd90","#fecf92","#fed194","#fed395","#fed597","#fed799","#fed89a","#fdda9c","#fddc9e","#fddea0","#fde0a1","#fde2a3","#fde3a5","#fde5a7","#fde7a9","#fde9aa","#fdebac","#fcecae","#fceeb0","#fcf0b2","#fcf2b4","#fcf4b6","#fcf6b8","#fcf7b9","#fcf9bb","#fcfbbd","#fcfdbf"],type:"seq"}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2));n(31);const o=function(){return n(0).event}.bind(this),a=n(19),s=i(n(6));e.ScatterBase=class extends a.Mark{render(){const t=super.render(),e=this;return this.drag_listener=r.drag().subject(function(t){return{x:e.x_scale.scale(t.x),y:e.y_scale.scale(t.y)}}).on("start",function(t,n){return e.drag_start(t,n,this)}).on("drag",function(t,n){return e.on_drag(t,n,this)}).on("end",function(t,n){return e.drag_ended(t,n,this)}),this.selected_style=this.model.get("selected_style"),this.unselected_style=this.model.get("unselected_style"),this.selected_indices=this.model.get("selected"),this.hovered_style=this.model.get("hovered_style"),this.unhovered_style=this.model.get("unhovered_style"),this.hovered_index=this.model.get("hovered_point")?[this.model.get("hovered_point")]:null,this.display_el_classes=["dot","legendtext"],this.event_metadata={mouse_over:{msg_name:"hover",lookup_data:!1,hit_test:!0},legend_clicked:{msg_name:"legend_click",hit_test:!0},element_clicked:{msg_name:"element_click",lookup_data:!1,hit_test:!0},parent_clicked:{msg_name:"background_click",hit_test:!1}},this.displayed.then(()=>{this.parent.tooltip_div.node().appendChild(this.tooltip_div.node()),this.create_tooltip()}),t.then(()=>{this.event_listeners={},this.process_interactions(),this.create_listeners(),this.compute_view_padding(),this.draw()})}set_ranges(){const t=this.scales.x,e=this.scales.y,n=this.scales.size,i=this.scales.opacity,r=this.scales.skew,o=this.scales.rotation;t&&t.set_range(this.parent.padded_range("x",t.model)),e&&e.set_range(this.parent.padded_range("y",e.model)),n&&n.set_range([0,this.model.get("default_size")]),i&&i.set_range([.2,1]),r&&r.set_range([0,1]),o&&o.set_range([0,180])}set_positional_scales(){this.x_scale=this.scales.x,this.y_scale=this.scales.y,this.x_scale||(this.x_scale=this.parent.scale_x),this.y_scale||(this.y_scale=this.parent.scale_y),this.listenTo(this.x_scale,"domain_changed",()=>{if(!this.model.dirty){const t=!0;this.update_position(t)}}),this.listenTo(this.y_scale,"domain_changed",()=>{if(!this.model.dirty){const t=!0;this.update_position(t)}})}initialize_additional_scales(){const t=this.scales.color,e=this.scales.size,n=this.scales.opacity,i=this.scales.skew,r=this.scales.rotation;t&&(this.listenTo(t,"domain_changed",()=>{this.model.dirty||this.color_scale_updated(!0)}),t.on("color_scale_range_changed",this.color_scale_updated,this)),e&&this.listenTo(e,"domain_changed",()=>{this.update_default_size(!0)}),n&&this.listenTo(n,"domain_changed",()=>{this.update_default_opacities(!0)}),i&&this.listenTo(i,"domain_changed",()=>{this.update_default_skew(!0)}),r&&this.listenTo(r,"domain_changed",()=>{this.update_position(!0)})}create_listeners(){super.create_listeners(),this.d3el.on("mouseover",()=>{this.event_dispatcher("mouse_over")}).on("mousemove",()=>{this.event_dispatcher("mouse_move")}).on("mouseout",()=>{this.event_dispatcher("mouse_out")}),this.listenTo(this.model,"data_updated",()=>{this.draw(!0)}),this.listenTo(this.model,"change:tooltip",this.create_tooltip),this.listenTo(this.model,"change:enable_hover",()=>{this.hide_tooltip()}),this.listenTo(this.model,"change:interactions",this.process_interactions),this.listenTo(this.model,"change:enable_move",this.set_drag_behavior),this.listenTo(this.model,"change:selected",this.update_selected),this.listenTo(this.model,"change:hovered_point",this.update_hovered),this.listenTo(this.model,"change:hovered_style",this.hovered_style_updated),this.listenTo(this.model,"change:unhovered_style",this.unhovered_style_updated),this.listenTo(this.parent,"bg_clicked",()=>{this.event_dispatcher("parent_clicked")})}get_element_color(t,e){const n=this.scales.color,i=this.model.get("colors"),r=i.length;return n&&void 0!==t.color&&null!==t.color?n.scale(t.color):i[e%r]}get_element_size(t){const e=this.scales.size;return e&&void 0!==t.size?e.scale(t.size):this.model.get("default_size")}get_element_opacity(t,e){const n=this.scales.opacity,i=this.model.get("default_opacities"),r=i.length;return n&&void 0!==t.opacity?n.scale(t.opacity):i[e%r]}get_element_skew(t){const e=this.scales.skew;return e&&void 0!==t.skew?e.scale(t.skew):this.model.get("default_skew")}get_element_rotation(t){const e=this.scales.rotation;return e&&t.rotation?"rotate("+e.scale(t.rotation)+")":""}relayout(){this.set_ranges(),this.update_position()}update_position(t){const e=this.scales.x,n=this.scales.y,i=!0===t?this.parent.model.get("animation_duration"):0;this.d3el.selectAll(".object_grp").transition("update_position").duration(i).attr("transform",t=>"translate("+(e.scale(t.x)+e.offset)+","+(n.scale(t.y)+n.offset)+")"+this.get_element_rotation(t)),this.x_pixels=this.model.mark_data.map(t=>e.scale(t.x)+e.offset),this.y_pixels=this.model.mark_data.map(t=>n.scale(t.y)+n.offset),this.pixel_coords=this.model.mark_data.map(t=>[e.scale(t.x)+e.offset,n.scale(t.y)+n.offset])}draw(t){this.set_ranges();const e=this.d3el.selectAll(".object_grp").data(this.model.mark_data,t=>t.unique_id),n=e.enter().append("g").attr("class","object_grp");this.update_position(t),this.set_drag_behavior(),n.on("click",(t,e)=>{this.event_dispatcher("element_clicked",{data:t,index:e})}),n.on("mouseover",(t,e)=>{this.scatter_hover_handler({data:t,index:e})}),n.on("mouseout",()=>{this.reset_hover_points()}),this.draw_elements(t,n),e.exit().remove()}draw_elements(t,e){}process_click(t){switch(super.process_click(t),t){case"add":this.event_listeners.parent_clicked=this.add_element,this.event_listeners.element_clicked=()=>{};break;case"delete":this.event_listeners.parent_clicked=()=>{},this.event_listeners.element_clicked=this.delete_element;break;case"select":this.event_listeners.parent_clicked=this.reset_selection,this.event_listeners.element_clicked=this.scatter_click_handler}}reset_hover_points(){this.model.set("hovered_point",null),this.hovered_index=null,this.touch()}scatter_hover_handler(t){const e=t.index;this.model.set("hovered_point",e,{updated_view:this}),this.touch()}reset_selection(){this.model.set("selected",null),this.selected_indices=null,this.touch()}scatter_click_handler(t){const e=t.index,n=this.model.get("selected")||[];let i=Array.from(n);const r=i.indexOf(e),a=o().ctrlKey||o().metaKey;r>-1&&a?i.splice(r,1):a?i.push(e):(i=[]).push(e),this.model.set("selected",0===i.length?null:new Uint32Array(i),{updated_view:this}),this.touch();let s=o();s||(s=window.event),void 0!==s.cancelBubble&&(s.cancelBubble=!0),s.stopPropagation&&s.stopPropagation(),s.preventDefault()}hovered_style_updated(t,e){this.hovered_style=e,this.clear_style(t.previous("hovered_style"),this.hovered_index),this.style_updated(e,this.hovered_index)}unhovered_style_updated(t,e){this.unhovered_style=e;const n=this.hovered_index,i=n?s.range(this.model.mark_data.length).filter(t=>-1===n.indexOf(t)):[];this.clear_style(t.previous("unhovered_style"),i),this.style_updated(e,i)}draw_legend(t,e,n,i,o){this.legend_el=t.selectAll(".legend"+this.uuid).data([this.model.mark_data[0]]);const a=this.model.get("colors"),s=a.length,c=.8*o,l=this.legend_el.enter().append("g").attr("class","legend"+this.uuid).attr("transform",(t,e)=>"translate(0, "+(e*o+n)+")").on("mouseover",()=>{this.event_dispatcher("legend_mouse_over")}).on("mouseout",()=>{this.event_dispatcher("legend_mouse_out")}).on("click",()=>{this.event_dispatcher("legend_clicked")});this.draw_legend_elements(l,c),this.legend_el.append("text").attr("class","legendtext").attr("x",1.2*c).attr("y",c/2).attr("dy","0.35em").text((t,e)=>this.model.get("labels")[e]).style("fill",(t,e)=>a[e%s]);const u=r.max(this.model.get("labels"),t=>Number(t.length));return this.legend_el.exit().remove(),[1,u]}draw_legend_elements(t,e){}invert_point(t){if(void 0===t)return this.model.set("selected",null),void this.touch();const e=this.x_pixels.map(e=>Math.abs(e-t)),n=e.indexOf(r.min(e));this.model.set("selected",new Uint32Array([n])),this.touch()}selector_changed(t,e){if(void 0===t)return this.model.set("selected",null),this.touch(),[];const n=this.pixel_coords,i=new Uint32Array(s.range(n.length)).filter(e=>t(n[e]));this.model.set("selected",i),this.touch()}update_selected(t,e){this.selected_indices=e,this.apply_styles()}update_hovered(t,e){this.hovered_index=null===e?e:[e],this.apply_styles()}apply_styles(t){void 0!==t&&null!=t||(t=[this.selected_style,this.unselected_style,this.hovered_style,this.unhovered_style]),super.apply_styles([t]);const e=s.range(this.model.mark_data.length);this.set_style_on_elements(this.hovered_style,this.hovered_index);const n=this.hovered_index?s.difference(e,this.hovered_index):[];this.set_style_on_elements(this.unhovered_style,n)}clear_style(t,e){let n=this.d3el.selectAll(".element");e&&(n=n.filter((t,n)=>-1!==e.indexOf(n)));const i={};for(let e in t)i[e]=null;n.styles(i)}set_style_on_elements(t,e){if(!e||0===e.length)return;if(0===Object.keys(t).length)return;let n=this.d3el.selectAll(".element");(n=n.filter((t,n)=>-1!==e.indexOf(n))).styles(t)}compute_view_padding(){const t=Math.sqrt(this.model.get("default_size"))/2+1;t===this.x_padding&&t===this.y_padding||(this.x_padding=t,this.y_padding=t,this.trigger("mark_padding_updated"))}update_array(t,e){const n=this.scales.x,i=this.scales.y;if(!this.model.get("restrict_y")){const i=this.model.get("x").slice();i[e]=n.invert(t[0]),this.model.set("x",i)}if(!this.model.get("restrict_x")){const n=this.model.get("y").slice();n[e]=i.invert(t[1]),this.model.set("y",n)}this.touch()}set_drag_behavior(){const t=this.d3el.selectAll(".object_grp");this.model.get("enable_move")?t.call(this.drag_listener):t.on(".drag",null)}set_drag_style(t,e,n){}reset_drag_style(t,e,n){}drag_start(t,e,n){const i=this.scales.x,r=this.scales.y;t[0]=i.scale(t.x)+i.offset,t[1]=r.scale(t.y)+r.offset,this.set_drag_style(t,e,n),this.send({event:"drag_start",point:{x:t.x,y:t.y},index:e})}on_drag(t,e,n){const i=this.scales.x,a=this.scales.y,s=this.model.get("restrict_x"),c=this.model.get("restrict_y");s&&c||(c||(t[0]=o().x),s||(t[1]=o().y),r.select(n).attr("transform",()=>"translate("+t[0]+","+t[1]+")"),this.send({event:"drag",origin:{x:t.x,y:t.y},point:{x:i.invert(t[0]),y:a.invert(t[1])},index:e}),this.model.get("update_on_move")&&this.update_array(t,e))}drag_ended(t,e,n){const i=this.scales.x,r=this.scales.y;this.reset_drag_style(t,e,n),this.update_array(t,e),this.send({event:"drag_end",point:{x:i.invert(t[0]),y:r.invert(t[1])},index:e})}selected_deleter(){o().stopPropagation()}add_element(){const t=r.mouse(this.el),e=[t[0],t[1]],n=this.scales.x,i=this.scales.y,o=this.model.get("x"),a=this.model.get("y"),s=new o.constructor(o.length+1),c=new a.constructor(a.length+1);s.set(o),c.set(a),s[o.length]=n.invert(e[0]),c[a.length]=i.invert(e[1]),this.model.set("x",s),this.model.set("y",c),this.touch()}delete_element(t){const e=t.index;let n=this.model.get("x").slice(),i=this.model.get("y").slice();n.copyWithin(e,e+1,n.length),i.copyWithin(e,e+1,i.length),n=n.slice(0,n.length-1),i=i.slice(0,i.length-1),this.model.set("x",n),this.model.set("y",i),this.touch()}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=n(18),o=i(n(12));class a extends r.MarkModel{defaults(){return Object.assign({},r.MarkModel.prototype.defaults(),{_model_name:"ScatterBaseModel",_view_name:"ScatterBase",x:[],y:[],color:null,opacity:null,size:null,rotation:null,hovered_point:null,scales_metadata:{x:{orientation:"horizontal",dimension:"x"},y:{orientation:"vertical",dimension:"y"},color:{dimension:"color"},size:{dimension:"size"},opacity:{dimension:"opacity"},rotation:{dimension:"rotation"}},hovered_style:{},unhovered_style:{},colors:["steelblue"],default_opacities:[1],enable_move:!1,enable_delete:!1,restrict_x:!1,restrict_y:!1,update_on_move:!1})}initialize(t,e){super.initialize(t,e),this.on_some_change(["x","y","color","opacity","size","rotation"],this.update_data,this),this.on_some_change(["preserve_domain"],this.update_domains,this),this.update_data()}update_mark_data(){let t=this.get("x");const e=this.get("y");if(0===t.length||0===e.length)this.mark_data=[];else{const n=Math.min(t.length,e.length);t=t.slice(0,n);const i=this.get("color")||[],r=this.get("size")||[],o=this.get("opacity")||[],a=this.get("rotation")||[];this.mark_data=Array.prototype.map.call(t,function(t,n){return{x:t,y:e[n],color:i[n],size:r[n],opacity:o[n],rotation:a[n],index:n}})}}update_data(){this.dirty=!0,this.update_mark_data(),this.update_unique_ids(),this.update_domains(),this.dirty=!1,this.trigger("data_updated")}update_unique_ids(){}get_data_dict(t,e){return t}update_domains(){if(!this.mark_data)return;const t=this.get("scales");for(let e in t)if(t.hasOwnProperty(e)){const n=t[e];this.get("preserve_domain")[e]?n.del_domain([],this.model_id+e):n.compute_and_set_domain(this.mark_data.map(function(t){return t[e]}),this.model_id+e)}}}a.serializers=Object.assign({},r.MarkModel.serializers,{x:o.array_or_json,y:o.array_or_json,color:o.array_or_json,opacity:o.array_or_json,size:o.array_or_json,rotation:o.array_or_json,default_opacities:o.array_or_json}),e.ScatterBaseModel=a},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=n(62),o=i(n(6));e.OrdinalScaleModel=class extends r.ScaleModel{defaults(){return Object.assign({},r.ScaleModel.prototype.defaults(),{_model_name:"OrdinalScaleModel",_view_name:"OrdinalScale",domain:[]})}initialize(t,e){super.initialize(t,e)}set_init_state(){this.type="ordinal",this.min_from_data=!0,this.max_from_data=!0}set_listeners(){this.on("change:domain",this.domain_changed,this),this.domain_changed(),this.on("change:reverse",this.reverse_changed,this),this.reverse_changed()}domain_changed(){this.ord_domain=this.get("domain"),null!==this.ord_domain&&0!==this.ord_domain.length?(this.max_from_data=!1,this.min_from_data=!1,this.domain=this.ord_domain.map(function(t){return t}),this.trigger("domain_changed")):(this.max_from_data=!0,this.min_from_data=!0,this.domain=[],this.update_domain())}reverse_changed(t){const e=void 0!==t&&t.previous("reverse");this.reverse=this.get("reverse");const n=(e+this.reverse)%2;this.domain.length>0&&1===n&&(this.domain.reverse(),this.trigger("domain_changed",this.domain))}update_domain(){let t=[];for(let e in this.domains)t=o.union(t,this.domains[e]);this.domain.length===t.length&&o.intersection(this.domain,t).length===t.length||(this.domain=t,this.trigger("domain_changed",t))}compute_and_set_domain(t,e){if(!this.min_from_data&&!this.max_from_data)return;if(0===t.length)return void this.set_domain([],e);const n=o.flatten(t);this.get("reverse")&&n.reverse(),this.set_domain(n,e)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.point_in_lasso=function(t,e){for(var n,i,r,o,a=t[0],s=t[1],c=!1,l=0,u=e.length-1;l<e.length;u=l++)n=e[l][0],r=e[l][1],i=e[u][0],r>s!=(o=e[u][1])>s&&a<(i-n)*(s-r)/(o-r)+n&&(c=!c);return c}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=n(50);e.ColorScale=class extends o.Scale{render(){this.create_d3_scale(),this.update_extrapolation(),this.model.domain.length>0&&this.scale.domain(this.model.domain),this.offset=0,this.create_event_listeners(),this.set_range()}create_d3_scale(){this.scale=r.scaleLinear()}create_event_listeners(){super.create_event_listeners(),this.listenTo(this.model,"colors_changed",this.set_range),this.model.on("change:extrapolation",function(){this.update_extrapolation(),this.trigger("color_scale_range_changed")},this)}update_extrapolation(){this.scale.clamp("constant"===this.model.get("extrapolation"))}set_range(){this.scale.range(this.model.color_range),this.trigger("color_scale_range_changed")}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(6)),o=i(n(2)),a=n(63),s=i(n(84));e.ColorScaleModel=class extends a.LinearScaleModel{defaults(){return Object.assign({},a.LinearScaleModel.prototype.defaults(),{_model_name:"ColorScaleModel",_view_name:"ColorScale",mid:null,scheme:"RdYlGn",extrapolation:"constant",colors:null})}set_init_state(){this.type="color_linear",this.color_range=[],this.mid=null}set_listeners(){super.set_listeners(),this.on_some_change(["colors","scheme"],this.colors_changed,this),this.on("change:mid",this.update_domain,this),this.colors_changed()}update_domain(){const t=this,e=this.min_from_data?o.min(r.map(this.domains,function(e){return e.length>0?e[0]:t.global_max})):this.min,n=this.max_from_data?o.max(r.map(this.domains,function(e){return e.length>0?e[e.length-1]:t.global_min})):this.max,i=this.mid;this.mid=this.get("mid");const a=this.domain,s=a.length,c=this.color_range.length;e==a[0]&&n==a[s-1]&&c==s&&this.mid==i||(this.domain=this.create_domain(e,this.mid,n,c),this.trigger("domain_changed",this.domain))}create_domain(t,e,n,i){const r=o.scaleLinear();if(null==e)r.domain([0,i-1]).range([t,n]);else{const o=i/2;r.domain([0,o,i-1]).range([t,e,n])}const a=[];for(let t=0;t<i;t++){const e=this.reverse?i-1-t:t;a.push(this.toDomainType(r(e)))}return a}colors_changed(){const t=this.get("colors");this.color_range=t.length>0?t:s.get_linear_scale_range(this.get("scheme")),this.update_domain(),this.trigger("colors_changed")}toDomainType(t){return t}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(6)),o=i(n(2)),a=n(19),s=i(n(64)).symbol;e.Lines=class extends a.Mark{render(){const t=super.render(),e=this;return this.dot=s().size(this.model.get("marker_size")),this.model.get("marker")&&this.dot.type(this.model.get("marker")),this.displayed.then(function(){e.parent.tooltip_div.node().appendChild(e.tooltip_div.node()),e.create_tooltip()}),this.display_el_classes=["line","legendtext","dot"],t.then(function(){e.event_listeners={},e.process_interactions(),e.create_listeners(),e.compute_view_padding(),e.draw(!1)})}set_ranges(){const t=this.scales.x;t&&t.set_range(this.parent.padded_range("x",t.model));const e=this.scales.y;e&&e.set_range(this.parent.padded_range("y",e.model))}set_positional_scales(){const t=this.scales.x,e=this.scales.y;this.listenTo(t,"domain_changed",function(){this.model.dirty||this.update_line_xy()}),this.listenTo(e,"domain_changed",function(){this.model.dirty||this.update_line_xy()})}initialize_additional_scales(){const t=this.scales.color;t&&(this.listenTo(t,"domain_changed",function(){this.update_style()}),t.on("color_scale_range_changed",this.update_style,this))}create_listeners(){super.create_listeners(),this.d3el.on("mouseover",r.bind(function(){this.event_dispatcher("mouse_over")},this)).on("mousemove",r.bind(function(){this.event_dispatcher("mouse_move")},this)).on("mouseout",r.bind(function(){this.event_dispatcher("mouse_out")},this)),this.listenTo(this.model,"change:tooltip",this.create_tooltip),this.listenTo(this.model,"change:interpolation",this.update_path_style),this.listenTo(this.model,"change:close_path",this.update_path_style),this.listenTo(this.model,"change:colors",this.update_style),this.listenTo(this.model,"change:opacities",this.update_style),this.listenTo(this.model,"change:fill_opacities",this.update_style),this.listenTo(this.model,"change:fill_colors",this.update_style),this.listenTo(this.model,"change:fill",this.update_fill),this.listenTo(this.model,"data_updated",function(){this.draw(!0)}),this.listenTo(this.model,"labels_updated",this.update_labels),this.listenTo(this.model,"change:stroke_width",this.update_stroke_width),this.listenTo(this.model,"change:labels_visibility",this.update_legend_labels),this.listenTo(this.model,"change:curves_subset",this.update_curves_subset),this.listenTo(this.model,"change:line_style",this.update_line_style),this.listenTo(this.model,"change:interactions",this.process_interactions),this.listenTo(this.parent,"bg_clicked",function(){this.event_dispatcher("parent_clicked")}),this.listenTo(this.model,"change:marker",this.update_marker),this.listenTo(this.model,"change:marker_size",this.update_marker_size)}update_legend_labels(){"none"===this.model.get("labels_visibility")?(this.d3el.selectAll(".legend").attr("display","none"),this.d3el.selectAll(".curve_label").attr("display","none")):"label"===this.model.get("labels_visibility")?(this.d3el.selectAll(".legend").attr("display","none"),this.d3el.selectAll(".curve_label").attr("display","inline")):(this.d3el.selectAll(".legend").attr("display","inline"),this.d3el.selectAll(".curve_label").attr("display","none"))}update_labels(){this.d3el.selectAll(".curve").data(this.model.mark_data).select(".curve_label").text(function(t){return t.name})}get_line_style(){switch(this.model.get("line_style")){case"solid":return"none";case"dashed":return"10,10";case"dotted":return"2,10";case"dash_dotted":return"10,5,2,5"}}update_line_style(){this.d3el.selectAll(".curve").select(".line").style("stroke-dasharray",r.bind(this.get_line_style,this)),this.legend_el&&this.legend_el.select("path").style("stroke-dasharray",r.bind(this.get_line_style,this))}update_stroke_width(t,e){this.compute_view_padding(),this.d3el.selectAll(".curve").select(".line").style("stroke-width",e),this.legend_el&&this.legend_el.select("path").style("stroke-width",e)}update_style(){const t=this,e=this.model.get("fill"),n=this.model.get("fill_colors"),i=this.model.get("opacities"),r=this.model.get("fill_opacities"),o=this.d3el.selectAll(".curve");o.select(".line").style("opacity",function(t,e){return i[e]}).style("stroke",function(e,i){return t.get_element_color(e,i)||n[i]}).style("fill",function(n,i){return"inside"===e?t.get_fill_color(n,i):""}).style("fill-opacity",function(t,n){return"inside"===e?r[n]:""}),o.select(".area").style("fill",function(e,n){return t.get_fill_color(e,n)}).style("opacity",function(t,e){return r[e]}),this.update_marker_style(),this.legend_el&&(this.legend_el.select(".line").style("stroke",function(e,i){return t.get_element_color(e,i)||n[i]}).style("opacity",function(t,e){return i[e]}).style("fill",function(e,n){return"none"===t.model.get("fill")?"":t.get_fill_color(e,n)}),this.legend_el.select(".dot").style("stroke",function(e,i){return t.get_element_color(e,i)||n[i]}).style("opacity",function(t,e){return i[e]}).style("fill",function(e,i){return t.get_element_color(e,i)||n[i]}),this.legend_el.select("text").style("fill",function(e,i){return t.get_element_color(e,i)||n[i]}).style("opacity",function(t,e){return i[e]})),this.update_stroke_width(this.model,this.model.get("stroke_width")),this.update_line_style()}path_closure(){return this.model.get("close_path")?"Z":""}update_path_style(){const t=this.get_interpolation();this.line.curve(t),this.area.curve(t);const e=this;this.d3el.selectAll(".curve").select(".line").attr("d",function(t){return e.line(t.values)+e.path_closure()}),this.d3el.selectAll(".curve").select(".area").transition("update_path_style").duration(0).attr("d",function(t){return e.area(t.values)}),this.legend_el&&(this.legend_line.curve(t),this.legend_el.selectAll("path").attr("d",this.legend_line(this.legend_path_data)+this.path_closure()))}relayout(){this.set_ranges(),this.update_line_xy(!1)}selector_changed(t,e){if(void 0===t)return this.model.set("selected",null),this.touch(),[];const n=this.pixel_coords,i=new Uint32Array(r.range(n.length)).filter(e=>t(n[e]));this.model.set("selected",i),this.touch()}invert_point(t){if(void 0===t)return this.model.set("selected",null),void this.touch();const e=Math.min(this.bisect(this.x_pixels,t),Math.max(this.x_pixels.length-1,0));this.model.set("selected",new Uint32Array([e])),this.touch()}update_multi_range(t){const e=t[0],n=t[1],i=this.model.x_data[0]instanceof Array?this.model.x_data[0]:this.model.x_data,r=this.bisect(i,e),o=Math.min(this.bisect(i,n),Math.max(i.length-1,0));this.selector_model.set("selected",[r,o]),this.selector.touch()}draw_legend(t,e,n,i,a){const s=this.model.get_labels(),c=this.model.mark_data.map(function(t){return{index:t.index,name:t.name,color:t.color}});this.legend_el=t.selectAll(".legend"+this.uuid).data(c);const l=this,u=.8*a,h=this.model.get("fill_colors"),d=this.model.get("opacities");this.legend_line=o.line().curve(this.get_interpolation()).x(function(t){return t[0]}).y(function(t){return t[1]}),this.legend_path_data=[[0,u],[u/2,0],[u,u/2]];const f=this.legend_el.enter().append("g").attr("class","legend"+this.uuid).attr("transform",function(t,e){return"translate(0, "+(e*a+n)+")"}).on("mouseover",r.bind(function(){this.event_dispatcher("legend_mouse_over")},this)).on("mouseout",r.bind(function(){this.event_dispatcher("legend_mouse_out")},this)).on("click",r.bind(function(){this.event_dispatcher("legend_clicked")},this));f.append("path").attr("class","line").attr("fill","none").attr("d",this.legend_line(this.legend_path_data)+this.path_closure()).style("stroke",function(t,e){return l.get_element_color(t,e)||h[e]}).style("fill",function(t,e){return"none"===l.model.get("fill")?"":l.get_fill_color(t,e)}).style("opacity",function(t,e){return d[e]}).style("stroke-width",this.model.get("stroke_width")).style("stroke-dasharray",r.bind(this.get_line_style,this)),this.model.get("marker")&&f.append("path").attr("class","dot").attr("transform","translate("+u/2+",0)").attr("d",l.dot.size(25)).style("fill",function(t,e){return l.get_element_color(t,e)}),f.append("text").attr("class","legendtext").attr("x",1.2*u).attr("y",u/2).attr("dy","0.35em").text(function(t,e){return s[e]}).style("fill",function(t,e){return l.get_element_color(t,e)||h[e]}).style("opacity",function(t,e){return d[e]}),f.merge(this.legend_el);const p=o.max(s,function(t){return t.length});return this.legend_el.exit().remove(),[this.model.mark_data.length,p]}update_curves_subset(){const t="label"===this.model.get("labels_visibility"),e=this.model.get("curves_subset");e.length>0?(this.d3el.selectAll(".curve").attr("display",function(t,n){return-1!==e.indexOf(n)?"inline":"none"}).select(".curve_label").attr("display",function(n,i){return-1!==e.indexOf(i)&&t?"inline":"none"}),this.legend_el&&this.legend_el.attr("display",function(t,n){return-1!==e.indexOf(n)?"inline":"none"}),this.d3el.selectAll(".curve")):(this.d3el.selectAll(".curve").attr("display","inline").select(".curve_label").attr("display",function(e){return t?"inline":"none"}),this.legend_el&&this.legend_el.attr("display","inline"))}update_fill(){const t=this.model.get("fill"),e="top"===t||"bottom"===t||"between"===t,n=this.scales.y;this.area.defined(function(t){return e&&null!==t.y&&isFinite(n.scale(t.y))}),"bottom"==t?this.area.y0(this.parent.plotarea_height):"top"==t?this.area.y0(0):"between"==t&&this.area.y0(function(t){return n.scale(t.y0)+n.offset});const i=this;this.d3el.selectAll(".curve").select(".area").attr("d",function(t){return i.area(t.values)}),this.d3el.selectAll(".curve").select(".line").style("fill",function(e,n){return"inside"===t?i.get_fill_color(e,n):""}),this.legend_el&&this.legend_el.select("path").style("fill",function(e,n){return"none"===t?"":i.get_fill_color(e,n)})}get_element_color(t,e){const n=this.scales.color;return n&&void 0!==t.color&&null!==t.color?n.scale(t.color):this.get_colors(e)}get_fill_color(t,e){const n=this.model.get("fill_colors");return 0===n.length?this.get_element_color(t,e):n[e]}update_line_xy(t){const e=this.scales.x,n=this.scales.y,i=!0===t?this.parent.model.get("animation_duration"):0;this.line.x(function(t){return e.scale(t.x)+e.offset}).y(function(t){return n.scale(t.y)+n.offset});const r=this.model.get("fill");this.area.x(function(t){return e.scale(t.x)+e.offset}).y1(function(t){return n.scale(t.y)+n.offset}),"bottom"==r?this.area.y0(this.parent.plotarea_height):"top"==r?this.area.y0(0):"between"==r&&this.area.y0(function(t){return n.scale(t.y0)+n.offset});const o=this,a=this.d3el.selectAll(".curve");a.select(".line").transition("update_line_xy").attr("d",function(t){return o.line(t.values)+o.path_closure()}).duration(i),a.select(".area").transition("update_line_xy").attr("d",function(t,e){return o.area(t.values)}).duration(i),a.select(".curve_label").transition("update_line_xy").attr("transform",function(t){const i=t.values[t.values.length-1];return"translate("+e.scale(i.x)+","+n.scale(i.y)+")"}).duration(i),this.update_dots_xy(t),this.x_pixels=this.model.mark_data.length>0?this.model.mark_data[0].values.map(function(t){return e.scale(t.x)+e.offset}):[],this.y_pixels=this.model.mark_data.length>0?this.model.mark_data[0].values.map(function(t){return n.scale(t.y)+n.offset}):[],this.pixel_coords=this.model.mark_data.length>0?this.model.mark_data[0].values.map(function(t){return[e.scale(t.x)+e.offset,n.scale(t.y)+n.offset]}):[]}get_interpolation(){return{linear:o.curveLinear,basis:o.curveBasis,cardinal:o.curveCardinal,monotone:o.curveMonotoneY}[this.model.get("interpolation")]}draw(t){this.set_ranges();const e=this.d3el.selectAll(".curve").data(this.model.mark_data),n=this.scales.y,i=e.enter().append("g").attr("class","curve");i.append("path").attr("class","line").attr("fill","none"),i.append("path").attr("class","area"),i.append("text").attr("class","curve_label").attr("x",3).attr("dy",".35em").attr("display","label"!==this.model.get("labels_visibility")?"none":"inline").text(function(t){return t.name});const a=this.model.get("fill"),s="top"===a||"bottom"===a||"between"===a;e.select(".line").attr("id",function(t,e){return"curve"+(e+1)}).on("click",r.bind(function(){this.event_dispatcher("element_clicked")},this)),this.draw_dots(),this.line=o.line().curve(this.get_interpolation()).defined(function(t){return null!==t.y&&isFinite(n.scale(t.y))}),this.area=o.area().curve(this.get_interpolation()).defined(function(t){return s&&null!==t.y&&isFinite(n.scale(t.y))}),e.exit().remove(),this.update_line_xy(t),this.update_style(),this.update_curves_subset()}draw_dots(){if(this.model.get("marker")){const t=this.d3el.selectAll(".curve").selectAll(".dot").data(function(t,e){return t.values.map(function(t){return{x:t.x,y:t.y,sub_index:t.sub_index}})});t.enter().append("path").attr("class","dot"),t.exit().remove()}}update_dots_xy(t){if(this.model.get("marker")){const e=this.scales.x,n=this.scales.y,i=!0===t?this.parent.model.get("animation_duration"):0;this.d3el.selectAll(".curve").selectAll(".dot").transition("update_dots_xy").duration(i).attr("transform",function(t){return"translate("+(e.scale(t.x)+e.offset)+","+(n.scale(t.y)+n.offset)+")"}).attr("d",this.dot.size(this.model.get("marker_size")).type(this.model.get("marker")))}}compute_view_padding(){let t;if(this.model.get("marker")){const e=Math.sqrt(this.model.get("marker_size"))/2+1,n=this.model.get("stroke_width")/2;t=Math.max(e,n)}else t=this.model.get("stroke_width")/2;const e=t;t===this.x_padding&&e===this.y_padding||(this.x_padding=t,this.y_padding=e,this.trigger("mark_padding_updated"))}update_marker_style(){const t=this,e=this.model.get("fill_colors"),n=this.model.get("opacities");this.d3el.selectAll(".curve").each(function(i,r){o.select(this).selectAll(".dot").style("opacity",n[r]).style("fill",t.get_element_color(i,r)||e[r])})}update_marker(t,e){e?(this.draw_dots(),this.update_dots_xy(!1),this.update_marker_style(),this.legend_el&&this.legend_el.select(".dot").attr("d",this.dot.type(e).size(25))):(this.d3el.selectAll(".dot").remove(),this.legend_el&&this.legend_el.select(".dot").attr("d",this.dot.size(0)))}update_marker_size(t,e){this.compute_view_padding(),this.d3el.selectAll(".dot").attr("d",this.dot.size(e))}clear_style(t,e){}set_default_style(t){}set_style_on_elements(t,e){}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(10)),a=i(n(2));n(31);const s=i(n(6)),c=i(n(144)),l=r(n(145)),u=i(n(146));u.ShaderChunk.scales=n(309).default;e.Figure=class extends o.DOMWidgetView{constructor(){super(...arguments),this.relayoutRequested=!1}initialize(){this.el.classList.add("bqplot"),this.el.classList.add("figure"),this.el.classList.add("jupyter-widgets"),this.change_theme();const t=document.createElementNS(a.namespaces.svg,"svg");t.classList.add("svg-figure"),this.svg=a.select(t);const e=document.createElementNS(a.namespaces.svg,"svg");e.classList.add("svg-background"),this.svg_background=a.select(e),this.el.appendChild(e),this.el.appendChild(t),this._initial_marks_created=new Promise(t=>{this._initial_marks_created_resolve=t}),super.initialize.apply(this,arguments)}getFigureSize(){const t=this.el.getBoundingClientRect(),e=t.width/t.height,n=this.model.get("min_aspect_ratio"),i=this.model.get("max_aspect_ratio");return e<n?t.height=t.width/n:e>i&&(t.width=t.height*i),t}render(){this.displayed.then(()=>{this.layoutPromise.then(this.renderImpl.bind(this))})}renderImpl(){const t=this.getFigureSize();return this.width=t.width,this.height=t.height,this.id=o.uuid(),this.x_pad_dict={},this.y_pad_dict={},this.x_padding_arr={},this.y_padding_arr={},this.figure_padding_x=this.model.get("padding_x"),this.figure_padding_y=this.model.get("padding_y"),this.clip_id="clip_path_"+this.id,this.margin=this.model.get("fig_margin"),this.update_plotarea_dimensions(),this.plotarea_width<1||this.plotarea_width<1?this.el.style.visibility="hidden":this.el.style.visibility="",this.fig=this.svg.append("g").attr("transform","translate("+this.margin.left+","+this.margin.top+")"),this.fig_background=this.svg_background.append("g").attr("transform","translate("+this.margin.left+","+this.margin.top+")"),this.tooltip_div=a.select(document.createElement("div")).attr("class","tooltip_div"),this.popper_reference=new c.PositionReference({x:0,y:0,width:20,height:20}),this.popper=new l.default(this.popper_reference,this.tooltip_div.node(),{placement:"auto"}),this.bg=this.fig_background.append("rect").attr("class","plotarea_background").attr("x",0).attr("y",0).attr("width",this.plotarea_width).attr("height",this.plotarea_height).styles(this.model.get("background_style")).style("pointer-events","inherit"),this.bg_events=this.fig.append("rect").attr("class","plotarea_events").attr("x",0).attr("y",0).attr("width",this.plotarea_width).attr("height",this.plotarea_height).style("pointer-events","inherit"),this.bg_events.on("click",()=>{this.trigger("bg_clicked")}),this.fig_axes=this.fig_background.append("g"),this.fig_marks=this.fig.append("g"),this.interaction=this.fig.append("g"),this.clip_path=this.svg.append("svg:defs").append("svg:clipPath").attr("id",this.clip_id).append("rect").attr("x",0).attr("y",0).attr("width",this.plotarea_width).attr("height",this.plotarea_height),this.title=this.fig.append("text").attr("class","mainheading").attr("x",.5*this.plotarea_width).attr("y",-this.margin.top/2).attr("dy","1em").styles(this.model.get("title_style")),this.title.text(this.model.get("title")),this.model.on("save_png",this.save_png,this),this.model.on("save_svg",this.save_svg,this),this.create_figure_scales().then(()=>{this.mark_views=new o.ViewList(this.add_mark,this.remove_mark,this);const t=this.mark_views.update(this.model.get("marks")).then(t=>{this.replace_dummy_nodes(t),this.update_marks(t),this.update_legend(),this.set_interaction(this.model.get("interaction")),this._initial_marks_created_resolve(),this.update_gl()});this.axis_views=new o.ViewList(this.add_axis,null,this);const e=this.axis_views.update(this.model.get("axes"));return this.model.on_some_change(["fig_margin","min_aspect_ratio","max_aspect_ratio"],this.relayout,this),this.model.on_some_change(["padding_x","padding_y"],()=>{this.figure_padding_x=this.model.get("padding_x"),this.figure_padding_y=this.model.get("padding_y"),this.trigger("margin_updated")},this),this.model.on("change:axes",(t,e,n)=>{this.axis_views.update(e)},this),this.model.on("change:marks",(t,e,n)=>{this.mark_views.update(e).then(t=>{this.replace_dummy_nodes(t),this.update_marks(t),this.update_legend(),this.update_gl()})},this),this.model.on("change:legend_location",this.update_legend,this),this.model.on("change:title",this.update_title,this),this.model.on("change:interaction",(t,e)=>{Promise.all(this.mark_views.views).then(t=>{this.set_interaction(e)})},this),document.body.appendChild(this.tooltip_div.node()),this.create_listeners(),this.debouncedRelayout=s.debounce(()=>{this.relayout()},300),window.addEventListener("resize",this.debouncedRelayout),this.once("remove",()=>{window.removeEventListener("resize",this.debouncedRelayout)}),Promise.all([t,e])})}createWebGLRenderer(){this.renderer||(this.renderer=new u.WebGLRenderer({antialias:!0,alpha:!0,premultipliedAlpha:!0}),this.renderer.setSize(100,100),this.renderer.setClearAlpha(0),this.renderer.setPixelRatio(this.model.get("pixel_ratio")||window.devicePixelRatio)),this.renderer&&!this.el.contains(this.renderer.domElement)&&this.el.insertBefore(this.renderer.domElement,this.el.childNodes[1]),this.layout_webgl_canvas()}replace_dummy_nodes(t){s.each(t,function(t){null!==t.dummy_node&&(t.dummy_node.parentNode.replaceChild(t.el,t.dummy_node),t.dummy_node=null,this.displayed.then(function(){t.trigger("displayed")}))},this)}create_listeners(){this.listenTo(this.model,"change:title_style",this.title_style_updated),this.listenTo(this.model,"change:background_style",this.background_style_updated),this.listenTo(this.model,"change:layout",this.change_layout),this.listenTo(this.model,"change:legend_style",this.legend_style_updated),this.listenTo(this.model,"change:legend_text",this.legend_text_updated),this.listenTo(this.model,"change:pixel_ratio",()=>{this.renderer&&(this.renderer.setPixelRatio(this.model.get("pixel_ratio")||window.devicePixelRatio),this.update_gl())}),this.listenTo(this.model,"change:theme",this.change_theme)}title_style_updated(){this.title.styles(this.model.get("title_style"))}background_style_updated(){this.bg.styles(this.model.get("background_style"))}legend_style_updated(){this.fig_marks.selectAll(".g_legend").selectAll(".axis").selectAll("rect").styles(this.model.get("legend_style"))}legend_text_updated(){this.fig_marks.selectAll(".g_legend").selectAll("text.legendtext").styles(this.model.get("legend_text"))}create_figure_scales(){const t=this,e=this.create_child_view(this.model.get("scale_x")).then(function(e){t.scale_x=e,t.scale_x.scale.clamp(!0),t.scale_x.set_range([0,t.plotarea_width])}),n=this.create_child_view(this.model.get("scale_y")).then(function(e){t.scale_y=e,t.scale_y.scale.clamp(!0),t.scale_y.set_range([t.plotarea_height,0])});return Promise.all([e,n])}padded_range(t,e){if(!e.get("allow_padding"))return this.range(t);const n=e.model_id;if("x"===t){const t=void 0!==this.x_padding_arr[n]?this.x_padding_arr[n]:0,e=this.plotarea_width*this.figure_padding_x;return[e+t,this.plotarea_width-e-t]}if("y"===t){const t=void 0!==this.y_padding_arr[n]?this.y_padding_arr[n]:0,e=this.plotarea_height*this.figure_padding_y;return[this.plotarea_height-t-e,t+e]}}range(t){return"x"===t?[0,this.plotarea_width]:"y"===t?[this.plotarea_height,0]:void 0}get_mark_plotarea_height(t){if(!t.get("allow_padding"))return this.plotarea_height;const e=t.model_id,n=void 0!==this.y_padding_arr[e]?this.y_padding_arr[e]:0;return this.plotarea_height*(1-this.figure_padding_y)-n-n}get_mark_plotarea_width(t){if(!t.get("allow_padding"))return this.plotarea_width;const e=t.model_id,n=void 0!==this.x_padding_arr[e]?this.x_padding_arr[e]:0;return this.plotarea_width*(1-this.figure_padding_x)-n-n}add_axis(t){const e=this;return this.create_child_view(t).then(function(t){return e.fig_axes.node().appendChild(t.el),e.displayed.then(function(){t.trigger("displayed")}),t})}remove_from_padding_dict(t,e,n){if(null==n)return;const i=n.model_id;void 0!==t[i]&&(delete t[i][e.model.model_id+"_"+e.cid],0===Object.keys(t[i]).length&&delete t[i])}update_padding_dict(t,e,n,i){const r=n.model_id;t[r]||(t[r]={}),t[r][e.model.model_id+"_"+e.cid]=i}mark_scales_updated(t){const e=t.model,n=e.previous("scales");this.remove_from_padding_dict(this.x_pad_dict,t,n[e.get_key_for_orientation("horizontal")]),this.remove_from_padding_dict(this.y_pad_dict,t,n[e.get_key_for_orientation("vertical")]);const i=e.get("scales");this.update_padding_dict(this.x_pad_dict,t,i[e.get_key_for_orientation("horizontal")],t.x_padding),this.update_padding_dict(this.y_pad_dict,t,i[e.get_key_for_orientation("vertical")],t.y_padding),this.update_paddings()}mark_padding_updated(t){const e=t.model,n=e.get("scales");this.update_padding_dict(this.x_pad_dict,t,n[e.get_key_for_orientation("horizontal")],t.x_padding),this.update_padding_dict(this.y_pad_dict,t,n[e.get_key_for_orientation("vertical")],t.y_padding),this.update_paddings()}update_marks(t){this.update_paddings()}remove_mark(t){const e=t.model;e.off("redraw_legend",null,this),e.off("data_updated",null,this),e.off("scales_updated",null,this),e.off("mark_padding_updated",null,this);const n=e.get("scales");this.remove_from_padding_dict(this.x_pad_dict,t,n[e.get_key_for_orientation("horizontal")]),this.remove_from_padding_dict(this.y_pad_dict,t,n[e.get_key_for_orientation("vertical")]),t.remove()}add_mark(t){t.state_change.then(()=>{t.on("data_updated redraw_legend",this.update_legend,this)});const e=this.fig_marks.node().appendChild(document.createElementNS(a.namespaces.svg,"g"));return this.create_child_view(t,{clip_id:this.clip_id}).then(t=>{t.dummy_node=e,t.on("mark_padding_updated",()=>{this.mark_padding_updated(t)},this),t.on("mark_scales_updated",()=>{this.mark_scales_updated(t)},this);let n=t.model.get("scales")[t.model.get_key_for_dimension("x")],i=t.model.get("scales")[t.model.get_key_for_dimension("y")];return void 0===n&&(n=this.scale_x.model),void 0===i&&(i=this.scale_y.model),this.update_padding_dict(this.x_pad_dict,t,n,t.x_padding),this.update_padding_dict(this.y_pad_dict,t,i,t.y_padding),t.render_gl&&this.createWebGLRenderer(),t})}update_paddings(){this.x_padding_arr={},this.y_padding_arr={};const t=this;s.forEach(this.x_pad_dict,function(e,n){let i=0;s.forEach(e,function(t,e){i=Math.max(i,t)}),t.x_padding_arr[n]=i}),s.forEach(this.y_pad_dict,function(e,n){let i=0;s.forEach(e,function(t,e){i=Math.max(i,t)}),t.y_padding_arr[n]=i}),this.trigger("margin_updated")}update_plotarea_dimensions(){this.plotarea_width=this.width-this.margin.left-this.margin.right,this.plotarea_height=this.height-this.margin.top-this.margin.bottom}processPhosphorMessage(t){switch(super.processPhosphorMessage.apply(this,arguments),t.type){case"resize":case"after-show":case"after-attach":if(this.pWidget.isVisible){const t=this.getFigureSize();this.width===t.width&&this.height===t.height||this.debouncedRelayout()}}}relayout(){const t=()=>{this.relayoutRequested=!1;const t=this.getFigureSize();this.width=t.width,this.height=t.height,this.margin=this.model.get("fig_margin"),this.update_plotarea_dimensions(),this.plotarea_width<1||this.plotarea_width<1?this.el.style.visibility="hidden":(this.el.style.visibility="",void 0!==this.scale_x&&null!==this.scale_x&&this.scale_x.set_range([0,this.plotarea_width]),void 0!==this.scale_y&&null!==this.scale_y&&this.scale_y.set_range([this.plotarea_height,0]),this.fig.attr("transform","translate("+this.margin.left+","+this.margin.top+")"),this.fig_background.attr("transform","translate("+this.margin.left+","+this.margin.top+")"),this.title.attrs({x:.5*this.plotarea_width,y:-this.margin.top/2,dy:"1em"}),this.bg.attr("width",this.plotarea_width).attr("height",this.plotarea_height),this.bg_events.attr("width",this.plotarea_width).attr("height",this.plotarea_height),this.clip_path.attr("width",this.plotarea_width).attr("height",this.plotarea_height),this.trigger("margin_updated"),this.update_legend(),this.layout_webgl_canvas())};this.relayoutRequested||(this.relayoutRequested=!0,requestAnimationFrame(t.bind(this)))}layout_webgl_canvas(){this.renderer&&(this.renderer.domElement.style="left: "+this.margin.left+"px; top: "+this.margin.top+"px;",this.renderer.setSize(this.plotarea_width,this.plotarea_height),this.update_gl())}update_legend(){this.fig_marks.selectAll(".g_legend").remove();const t=this.model.get("legend_location"),e=this.fig_marks.append("g").attr("class","g_legend"),n=this;let i=1,r=1;void 0!==this.mark_views&&null!==this.mark_views&&Promise.all(this.mark_views.views).then(function(o){o.forEach(function(t){if(t.model.get("display_legend")){const n=t.draw_legend(e,0,16*i,0,16);i+=n[0],r=n[1]?Math.max(r,n[1]):r}});const a=n.get_legend_coords(t,24,16*(i+1),0);1!==i&&e.insert("g",":first-child").attr("class","axis").append("rect").attr("y",8).attr("x",-8).attr("width",r+2+"em").attr("height",16*i),r="top-right"===t||"right"===t||"bottom-right"===t?-(r+2):1,e.attr("transform","translate("+String(a[0]+16*r)+" "+String(a[1])+") "),e.selectAll("text.legendtext").styles(n.model.get("legend_text")),e.selectAll(".axis").selectAll("rect").styles(n.model.get("legend_style"))})}get_legend_coords(t,e,n,i){let r=0,o=0;const a=this.plotarea_width,s=this.plotarea_height;switch(t){case"top":r=.5*a-e,o=0;break;case"top-right":r=a-i,o=0;break;case"right":r=a-i,o=.5*s-n;break;case"bottom-right":r=a-i,o=s-n;break;case"bottom":r=.5*a-e,o=s-n;break;case"bottom-left":r=0,o=s-n;break;case"left":r=0,o=.5*s-n;break;default:r=0,o=0}return[r,o]}set_interaction(t){return t?t.state_change.then(()=>this.create_child_view(t).then(t=>(this.interaction_view&&this.interaction_view.remove(),this.interaction_view=t,this.interaction.node().appendChild(t.el),this.displayed.then(()=>{t.trigger("displayed")}),t))):(this.interaction_view&&this.interaction_view.remove(),Promise.resolve(null))}update_title(t,e){this.title.text(this.model.get("title"))}remove(){return void 0!==this.mark_views&&null!==this.mark_views&&this.mark_views.remove(),void 0!==this.axis_views&&null!==this.axis_views&&this.axis_views.remove(),void 0!==this.tooltip_div&&this.tooltip_div.remove(),super.remove.apply(this,arguments)}get_svg(){return this.render_gl().then(()=>{const t=this.svg_background.node(),e=this.svg.node(),n=this.plotarea_width,i=this.plotarea_height,r=e.cloneNode(!0);r.setAttribute("version","1.1"),r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),r.style.background=window.getComputedStyle(document.body).background;const o=window.getComputedStyle(this.el);var s=function(t,e){let n="";const i=document.styleSheets;let r;for(let s=0;s<i.length;s++){let c=null;try{c=i[s].cssRules}catch(t){}if(c)for(let i=0;i<c.length;i++){const s=c[i];if(void 0!==s.style){let i=null;try{i=t.querySelectorAll(s.selectorText)}catch(t){console.warn("Invalid CSS selector '"+s.selectorText+"'",t)}if(i){if(t.querySelectorAll(s.selectorText).length>0){r=s.selectorText;for(let t=0;t<e.length;t++)o=e[t],a="",r=r.replace(new RegExp(o,"g"),a);n+=`${r} { ${s.style.cssText} }\n `}}else s.cssText.match(/^@font-face/)&&(n+=s.cssText+"\n")}}}var o,a;return n+="svg { font-size: 10px; }\n"}(this.el,[".theme-dark",".theme-light",".bqplot > ",":root"])+"\n",c=(s.match(/(--\w[\w-]*)/g)||[]).reduce((t,e)=>`${t}\n\t${e}: ${o.getPropertyValue(e)};`,":root {")+"\n}\n";const l=document.createElement("style");l.setAttribute("type","text/css"),l.innerHTML="<![CDATA[\n"+c+s+"]]>";const u=document.createElement("defs");u.appendChild(l);const h=r.children[0],d=t.cloneNode(!0);if(h.insertBefore(d.children[0].children[1],h.children[0]),h.insertBefore(d.children[0].children[0],h.children[0]),this.renderer){const t=this.renderer.domElement.toDataURL("image/png");a.select(h.children[2]).append("image").attr("x",0).attr("y",0).attr("width",1).attr("height",1).attr("preserveAspectRatio","none").attr("transform","scale("+n+", "+i+")").attr("href",t)}return r.insertBefore(u,r.firstChild),r.outerHTML})}get_rendered_canvas(t){return t=t||window.devicePixelRatio,this.get_svg().then(e=>new Promise(n=>{const i=new Image;i.onload=()=>{const e=document.createElement("canvas");e.classList.add("bqplot"),e.width=this.width*t,e.height=this.height*t,e.style.width=this.width,e.style.height=this.height;const r=e.getContext("2d");r.scale(t,t),r.drawImage(i,0,0),n(e)},i.src="data:image/svg+xml;base64,"+btoa(e)}))}save_png(t,e){this.get_rendered_canvas(e).then(e=>{const n=document.createElement("a");n.download=t||"image.png",n.href=e.toDataURL("image/png"),document.body.appendChild(n),n.click()})}save_svg(t){this.get_svg().then(e=>{const n=document.createElement("a");n.download=t||"bqplot.svg",n.href="data:text/plain;charset=utf-8,"+encodeURIComponent(e),document.body.appendChild(n),n.click(),document.body.removeChild(n)})}update_gl(){this._update_requested||(this._update_requested=!0,requestAnimationFrame(this._update_gl.bind(this)))}_update_gl(){this.render_gl(),this._update_requested=!1}render_gl(){return this.renderer?Promise.all(this.mark_views.views).then(t=>{this.renderer.autoClear=!1,this.renderer.autoClearColor=new u.Color(0),this.renderer.clear();let e=s.filter(t,t=>t.render_gl);s.each(e,t=>{t.render_gl()})}):Promise.resolve()}change_theme(){this.el.classList.remove(this.model.previous("theme")),this.el.classList.add(this.model.get("theme"))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ElementReference=function(){function t(t){this.elt=t}return t.prototype.getBoundingClientRect=function(){return this.elt.getBoundingClientRect()},Object.defineProperty(t.prototype,"clientWidth",{get:function(){return this.elt.clientWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clientHeight",{get:function(){return this.elt.clientHeight},enumerable:!0,configurable:!0}),t}(),e.PositionReference=function(){function t(t){const e=t.x,n=t.y,i=t.width,r=t.height;this.x=e,this.y=n,this.width=i,this.height=r}return t.prototype.getBoundingClientRect=function(){const t=this.width/2,e=this.height/2;return{left:this.x-t,right:this.x+t,top:this.y-e,bottom:this.y+e,width:this.width,height:this.height}},Object.defineProperty(t.prototype,"clientWidth",{get:function(){return this.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clientHeight",{get:function(){return this.height},enumerable:!0,configurable:!0}),t}()},function(t,e,n){"use strict";n.r(e),function(t){for(
/**!
* @fileOverview Kickass library to create and place poppers near their reference elements.
* @version 1.15.0
* @license
* Copyright (c) 2016 Federico Zivolo and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
var n="undefined"!=typeof window&&"undefined"!=typeof document,i=["Edge","Trident","Firefox"],r=0,o=0;o<i.length;o+=1)if(n&&navigator.userAgent.indexOf(i[o])>=0){r=1;break}var a=n&&window.Promise?function(t){var e=!1;return function(){e||(e=!0,window.Promise.resolve().then(function(){e=!1,t()}))}}:function(t){var e=!1;return function(){e||(e=!0,setTimeout(function(){e=!1,t()},r))}};function s(t){return t&&"[object Function]"==={}.toString.call(t)}function c(t,e){if(1!==t.nodeType)return[];var n=t.ownerDocument.defaultView.getComputedStyle(t,null);return e?n[e]:n}function l(t){return"HTML"===t.nodeName?t:t.parentNode||t.host}function u(t){if(!t)return document.body;switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=c(t),n=e.overflow,i=e.overflowX,r=e.overflowY;return/(auto|scroll|overlay)/.test(n+r+i)?t:u(l(t))}var h=n&&!(!window.MSInputMethodContext||!document.documentMode),d=n&&/MSIE 10/.test(navigator.userAgent);function f(t){return 11===t?h:10===t?d:h||d}function p(t){if(!t)return document.documentElement;for(var e=f(10)?document.body:null,n=t.offsetParent||null;n===e&&t.nextElementSibling;)n=(t=t.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&"BODY"!==i&&"HTML"!==i?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===c(n,"position")?p(n):n:t?t.ownerDocument.documentElement:document.documentElement}function m(t){return null!==t.parentNode?m(t.parentNode):t}function g(t,e){if(!(t&&t.nodeType&&e&&e.nodeType))return document.documentElement;var n=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,i=n?t:e,r=n?e:t,o=document.createRange();o.setStart(i,0),o.setEnd(r,0);var a,s,c=o.commonAncestorContainer;if(t!==c&&e!==c||i.contains(r))return"BODY"===(s=(a=c).nodeName)||"HTML"!==s&&p(a.firstElementChild)!==a?p(c):c;var l=m(t);return l.host?g(l.host,e):g(t,m(e).host)}function _(t){var e="top"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top")?"scrollTop":"scrollLeft",n=t.nodeName;if("BODY"===n||"HTML"===n){var i=t.ownerDocument.documentElement;return(t.ownerDocument.scrollingElement||i)[e]}return t[e]}function v(t,e){var n="x"===e?"Left":"Top",i="Left"===n?"Right":"Bottom";return parseFloat(t["border"+n+"Width"],10)+parseFloat(t["border"+i+"Width"],10)}function b(t,e,n,i){return Math.max(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],f(10)?parseInt(n["offset"+t])+parseInt(i["margin"+("Height"===t?"Top":"Left")])+parseInt(i["margin"+("Height"===t?"Bottom":"Right")]):0)}function y(t){var e=t.body,n=t.documentElement,i=f(10)&&getComputedStyle(n);return{height:b("Height",e,n,i),width:b("Width",e,n,i)}}var x=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},w=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),M=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},E=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t};function S(t){return E({},t,{right:t.left+t.width,bottom:t.top+t.height})}function A(t){var e={};try{if(f(10)){e=t.getBoundingClientRect();var n=_(t,"top"),i=_(t,"left");e.top+=n,e.left+=i,e.bottom+=n,e.right+=i}else e=t.getBoundingClientRect()}catch(t){}var r={left:e.left,top:e.top,width:e.right-e.left,height:e.bottom-e.top},o="HTML"===t.nodeName?y(t.ownerDocument):{},a=o.width||t.clientWidth||r.right-r.left,s=o.height||t.clientHeight||r.bottom-r.top,l=t.offsetWidth-a,u=t.offsetHeight-s;if(l||u){var h=c(t);l-=v(h,"x"),u-=v(h,"y"),r.width-=l,r.height-=u}return S(r)}function T(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=f(10),r="HTML"===e.nodeName,o=A(t),a=A(e),s=u(t),l=c(e),h=parseFloat(l.borderTopWidth,10),d=parseFloat(l.borderLeftWidth,10);n&&r&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var p=S({top:o.top-a.top-h,left:o.left-a.left-d,width:o.width,height:o.height});if(p.marginTop=0,p.marginLeft=0,!i&&r){var m=parseFloat(l.marginTop,10),g=parseFloat(l.marginLeft,10);p.top-=h-m,p.bottom-=h-m,p.left-=d-g,p.right-=d-g,p.marginTop=m,p.marginLeft=g}return(i&&!n?e.contains(s):e===s&&"BODY"!==s.nodeName)&&(p=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=_(e,"top"),r=_(e,"left"),o=n?-1:1;return t.top+=i*o,t.bottom+=i*o,t.left+=r*o,t.right+=r*o,t}(p,e)),p}function k(t){if(!t||!t.parentElement||f())return document.documentElement;for(var e=t.parentElement;e&&"none"===c(e,"transform");)e=e.parentElement;return e||document.documentElement}function P(t,e,n,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},a=r?k(t):g(t,e);if("viewport"===i)o=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.ownerDocument.documentElement,i=T(t,n),r=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),a=e?0:_(n),s=e?0:_(n,"left");return S({top:a-i.top+i.marginTop,left:s-i.left+i.marginLeft,width:r,height:o})}(a,r);else{var s=void 0;"scrollParent"===i?"BODY"===(s=u(l(e))).nodeName&&(s=t.ownerDocument.documentElement):s="window"===i?t.ownerDocument.documentElement:i;var h=T(s,a,r);if("HTML"!==s.nodeName||function t(e){var n=e.nodeName;if("BODY"===n||"HTML"===n)return!1;if("fixed"===c(e,"position"))return!0;var i=l(e);return!!i&&t(i)}(a))o=h;else{var d=y(t.ownerDocument),f=d.height,p=d.width;o.top+=h.top-h.marginTop,o.bottom=f+h.top,o.left+=h.left-h.marginLeft,o.right=p+h.left}}var m="number"==typeof(n=n||0);return o.left+=m?n:n.left||0,o.top+=m?n:n.top||0,o.right-=m?n:n.right||0,o.bottom-=m?n:n.bottom||0,o}function L(t,e,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===t.indexOf("auto"))return t;var a=P(n,i,o,r),s={top:{width:a.width,height:e.top-a.top},right:{width:a.right-e.right,height:a.height},bottom:{width:a.width,height:a.bottom-e.bottom},left:{width:e.left-a.left,height:a.height}},c=Object.keys(s).map(function(t){return E({key:t},s[t],{area:(e=s[t],e.width*e.height)});var e}).sort(function(t,e){return e.area-t.area}),l=c.filter(function(t){var e=t.width,i=t.height;return e>=n.clientWidth&&i>=n.clientHeight}),u=l.length>0?l[0].key:c[0].key,h=t.split("-")[1];return u+(h?"-"+h:"")}function O(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return T(n,i?k(e):g(e,n),i)}function C(t){var e=t.ownerDocument.defaultView.getComputedStyle(t),n=parseFloat(e.marginTop||0)+parseFloat(e.marginBottom||0),i=parseFloat(e.marginLeft||0)+parseFloat(e.marginRight||0);return{width:t.offsetWidth+i,height:t.offsetHeight+n}}function R(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,function(t){return e[t]})}function I(t,e,n){n=n.split("-")[0];var i=C(t),r={width:i.width,height:i.height},o=-1!==["right","left"].indexOf(n),a=o?"top":"left",s=o?"left":"top",c=o?"height":"width",l=o?"width":"height";return r[a]=e[a]+e[c]/2-i[c]/2,r[s]=n===s?e[s]-i[l]:e[R(s)],r}function z(t,e){return Array.prototype.find?t.find(e):t.filter(e)[0]}function B(t,e,n){return(void 0===n?t:t.slice(0,function(t,e,n){if(Array.prototype.findIndex)return t.findIndex(function(t){return t[e]===n});var i=z(t,function(t){return t[e]===n});return t.indexOf(i)}(t,"name",n))).forEach(function(t){t.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=t.function||t.fn;t.enabled&&s(n)&&(e.offsets.popper=S(e.offsets.popper),e.offsets.reference=S(e.offsets.reference),e=n(e,t))}),e}function N(t,e){return t.some(function(t){var n=t.name;return t.enabled&&n===e})}function D(t){for(var e=[!1,"ms","Webkit","Moz","O"],n=t.charAt(0).toUpperCase()+t.slice(1),i=0;i<e.length;i++){var r=e[i],o=r?""+r+n:t;if(void 0!==document.body.style[o])return o}return null}function j(t){var e=t.ownerDocument;return e?e.defaultView:window}function U(t,e,n,i){n.updateBound=i,j(t).addEventListener("resize",n.updateBound,{passive:!0});var r=u(t);return function t(e,n,i,r){var o="BODY"===e.nodeName,a=o?e.ownerDocument.defaultView:e;a.addEventListener(n,i,{passive:!0}),o||t(u(a.parentNode),n,i,r),r.push(a)}(r,"scroll",n.updateBound,n.scrollParents),n.scrollElement=r,n.eventsEnabled=!0,n}function F(){var t,e;this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=(t=this.reference,e=this.state,j(t).removeEventListener("resize",e.updateBound),e.scrollParents.forEach(function(t){t.removeEventListener("scroll",e.updateBound)}),e.updateBound=null,e.scrollParents=[],e.scrollElement=null,e.eventsEnabled=!1,e))}function H(t){return""!==t&&!isNaN(parseFloat(t))&&isFinite(t)}function q(t,e){Object.keys(e).forEach(function(n){var i="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&H(e[n])&&(i="px"),t.style[n]=e[n]+i})}var G=n&&/Firefox/i.test(navigator.userAgent);function W(t,e,n){var i=z(t,function(t){return t.name===e}),r=!!i&&t.some(function(t){return t.name===n&&t.enabled&&t.order<i.order});if(!r){var o="`"+e+"`",a="`"+n+"`";console.warn(a+" modifier is required by "+o+" modifier in order to work, be sure to include it before "+o+"!")}return r}var V=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],X=V.slice(3);function Y(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=X.indexOf(t),i=X.slice(n+1).concat(X.slice(0,n));return e?i.reverse():i}var K={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function Z(t,e,n,i){var r=[0,0],o=-1!==["right","left"].indexOf(i),a=t.split(/(\+|\-)/).map(function(t){return t.trim()}),s=a.indexOf(z(a,function(t){return-1!==t.search(/,|\s/)}));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var c=/\s*,\s*|\s+/,l=-1!==s?[a.slice(0,s).concat([a[s].split(c)[0]]),[a[s].split(c)[1]].concat(a.slice(s+1))]:[a];return(l=l.map(function(t,i){var r=(1===i?!o:o)?"height":"width",a=!1;return t.reduce(function(t,e){return""===t[t.length-1]&&-1!==["+","-"].indexOf(e)?(t[t.length-1]=e,a=!0,t):a?(t[t.length-1]+=e,a=!1,t):t.concat(e)},[]).map(function(t){return function(t,e,n,i){var r=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+r[1],a=r[2];if(!o)return t;if(0===a.indexOf("%")){var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=i}return S(s)[e]/100*o}if("vh"===a||"vw"===a)return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o;return o}(t,r,e,n)})})).forEach(function(t,e){t.forEach(function(n,i){H(n)&&(r[e]+=n*("-"===t[i-1]?-1:1))})}),r}var J={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(t){var e=t.placement,n=e.split("-")[0],i=e.split("-")[1];if(i){var r=t.offsets,o=r.reference,a=r.popper,s=-1!==["bottom","top"].indexOf(n),c=s?"left":"top",l=s?"width":"height",u={start:M({},c,o[c]),end:M({},c,o[c]+o[l]-a[l])};t.offsets.popper=E({},a,u[i])}return t}},offset:{order:200,enabled:!0,fn:function(t,e){var n=e.offset,i=t.placement,r=t.offsets,o=r.popper,a=r.reference,s=i.split("-")[0],c=void 0;return c=H(+n)?[+n,0]:Z(n,o,a,s),"left"===s?(o.top+=c[0],o.left-=c[1]):"right"===s?(o.top+=c[0],o.left+=c[1]):"top"===s?(o.left+=c[0],o.top-=c[1]):"bottom"===s&&(o.left+=c[0],o.top+=c[1]),t.popper=o,t},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(t,e){var n=e.boundariesElement||p(t.instance.popper);t.instance.reference===n&&(n=p(n));var i=D("transform"),r=t.instance.popper.style,o=r.top,a=r.left,s=r[i];r.top="",r.left="",r[i]="";var c=P(t.instance.popper,t.instance.reference,e.padding,n,t.positionFixed);r.top=o,r.left=a,r[i]=s,e.boundaries=c;var l=e.priority,u=t.offsets.popper,h={primary:function(t){var n=u[t];return u[t]<c[t]&&!e.escapeWithReference&&(n=Math.max(u[t],c[t])),M({},t,n)},secondary:function(t){var n="right"===t?"left":"top",i=u[n];return u[t]>c[t]&&!e.escapeWithReference&&(i=Math.min(u[n],c[t]-("right"===t?u.width:u.height))),M({},n,i)}};return l.forEach(function(t){var e=-1!==["left","top"].indexOf(t)?"primary":"secondary";u=E({},u,h[e](t))}),t.offsets.popper=u,t},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(t){var e=t.offsets,n=e.popper,i=e.reference,r=t.placement.split("-")[0],o=Math.floor,a=-1!==["top","bottom"].indexOf(r),s=a?"right":"bottom",c=a?"left":"top",l=a?"width":"height";return n[s]<o(i[c])&&(t.offsets.popper[c]=o(i[c])-n[l]),n[c]>o(i[s])&&(t.offsets.popper[c]=o(i[s])),t}},arrow:{order:500,enabled:!0,fn:function(t,e){var n;if(!W(t.instance.modifiers,"arrow","keepTogether"))return t;var i=e.element;if("string"==typeof i){if(!(i=t.instance.popper.querySelector(i)))return t}else if(!t.instance.popper.contains(i))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),t;var r=t.placement.split("-")[0],o=t.offsets,a=o.popper,s=o.reference,l=-1!==["left","right"].indexOf(r),u=l?"height":"width",h=l?"Top":"Left",d=h.toLowerCase(),f=l?"left":"top",p=l?"bottom":"right",m=C(i)[u];s[p]-m<a[d]&&(t.offsets.popper[d]-=a[d]-(s[p]-m)),s[d]+m>a[p]&&(t.offsets.popper[d]+=s[d]+m-a[p]),t.offsets.popper=S(t.offsets.popper);var g=s[d]+s[u]/2-m/2,_=c(t.instance.popper),v=parseFloat(_["margin"+h],10),b=parseFloat(_["border"+h+"Width"],10),y=g-t.offsets.popper[d]-v-b;return y=Math.max(Math.min(a[u]-m,y),0),t.arrowElement=i,t.offsets.arrow=(M(n={},d,Math.round(y)),M(n,f,""),n),t},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(t,e){if(N(t.instance.modifiers,"inner"))return t;if(t.flipped&&t.placement===t.originalPlacement)return t;var n=P(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement,t.positionFixed),i=t.placement.split("-")[0],r=R(i),o=t.placement.split("-")[1]||"",a=[];switch(e.behavior){case K.FLIP:a=[i,r];break;case K.CLOCKWISE:a=Y(i);break;case K.COUNTERCLOCKWISE:a=Y(i,!0);break;default:a=e.behavior}return a.forEach(function(s,c){if(i!==s||a.length===c+1)return t;i=t.placement.split("-")[0],r=R(i);var l=t.offsets.popper,u=t.offsets.reference,h=Math.floor,d="left"===i&&h(l.right)>h(u.left)||"right"===i&&h(l.left)<h(u.right)||"top"===i&&h(l.bottom)>h(u.top)||"bottom"===i&&h(l.top)<h(u.bottom),f=h(l.left)<h(n.left),p=h(l.right)>h(n.right),m=h(l.top)<h(n.top),g=h(l.bottom)>h(n.bottom),_="left"===i&&f||"right"===i&&p||"top"===i&&m||"bottom"===i&&g,v=-1!==["top","bottom"].indexOf(i),b=!!e.flipVariations&&(v&&"start"===o&&f||v&&"end"===o&&p||!v&&"start"===o&&m||!v&&"end"===o&&g),y=!!e.flipVariationsByContent&&(v&&"start"===o&&p||v&&"end"===o&&f||!v&&"start"===o&&g||!v&&"end"===o&&m),x=b||y;(d||_||x)&&(t.flipped=!0,(d||_)&&(i=a[c+1]),x&&(o=function(t){return"end"===t?"start":"start"===t?"end":t}(o)),t.placement=i+(o?"-"+o:""),t.offsets.popper=E({},t.offsets.popper,I(t.instance.popper,t.offsets.reference,t.placement)),t=B(t.instance.modifiers,t,"flip"))}),t},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(t){var e=t.placement,n=e.split("-")[0],i=t.offsets,r=i.popper,o=i.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return r[a?"left":"top"]=o[n]-(s?r[a?"width":"height"]:0),t.placement=R(e),t.offsets.popper=S(r),t}},hide:{order:800,enabled:!0,fn:function(t){if(!W(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,n=z(t.instance.modifiers,function(t){return"preventOverflow"===t.name}).boundaries;if(e.bottom<n.top||e.left>n.right||e.top>n.bottom||e.right<n.left){if(!0===t.hide)return t;t.hide=!0,t.attributes["x-out-of-boundaries"]=""}else{if(!1===t.hide)return t;t.hide=!1,t.attributes["x-out-of-boundaries"]=!1}return t}},computeStyle:{order:850,enabled:!0,fn:function(t,e){var n=e.x,i=e.y,r=t.offsets.popper,o=z(t.instance.modifiers,function(t){return"applyStyle"===t.name}).gpuAcceleration;void 0!==o&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var a=void 0!==o?o:e.gpuAcceleration,s=p(t.instance.popper),c=A(s),l={position:r.position},u=function(t,e){var n=t.offsets,i=n.popper,r=n.reference,o=Math.round,a=Math.floor,s=function(t){return t},c=o(r.width),l=o(i.width),u=-1!==["left","right"].indexOf(t.placement),h=-1!==t.placement.indexOf("-"),d=e?u||h||c%2==l%2?o:a:s,f=e?o:s;return{left:d(c%2==1&&l%2==1&&!h&&e?i.left-1:i.left),top:f(i.top),bottom:f(i.bottom),right:d(i.right)}}(t,window.devicePixelRatio<2||!G),h="bottom"===n?"top":"bottom",d="right"===i?"left":"right",f=D("transform"),m=void 0,g=void 0;if(g="bottom"===h?"HTML"===s.nodeName?-s.clientHeight+u.bottom:-c.height+u.bottom:u.top,m="right"===d?"HTML"===s.nodeName?-s.clientWidth+u.right:-c.width+u.right:u.left,a&&f)l[f]="translate3d("+m+"px, "+g+"px, 0)",l[h]=0,l[d]=0,l.willChange="transform";else{var _="bottom"===h?-1:1,v="right"===d?-1:1;l[h]=g*_,l[d]=m*v,l.willChange=h+", "+d}var b={"x-placement":t.placement};return t.attributes=E({},b,t.attributes),t.styles=E({},l,t.styles),t.arrowStyles=E({},t.offsets.arrow,t.arrowStyles),t},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(t){var e,n;return q(t.instance.popper,t.styles),e=t.instance.popper,n=t.attributes,Object.keys(n).forEach(function(t){!1!==n[t]?e.setAttribute(t,n[t]):e.removeAttribute(t)}),t.arrowElement&&Object.keys(t.arrowStyles).length&&q(t.arrowElement,t.arrowStyles),t},onLoad:function(t,e,n,i,r){var o=O(r,e,t,n.positionFixed),a=L(n.placement,o,e,t,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return e.setAttribute("x-placement",a),q(e,{position:n.positionFixed?"fixed":"absolute"}),n},gpuAcceleration:void 0}}},Q=function(){function t(e,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};x(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=a(this.update.bind(this)),this.options=E({},t.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(E({},t.Defaults.modifiers,r.modifiers)).forEach(function(e){i.options.modifiers[e]=E({},t.Defaults.modifiers[e]||{},r.modifiers?r.modifiers[e]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(t){return E({name:t},i.options.modifiers[t])}).sort(function(t,e){return t.order-e.order}),this.modifiers.forEach(function(t){t.enabled&&s(t.onLoad)&&t.onLoad(i.reference,i.popper,i.options,t,i.state)}),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return w(t,[{key:"update",value:function(){return function(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=O(this.state,this.popper,this.reference,this.options.positionFixed),t.placement=L(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.positionFixed=this.options.positionFixed,t.offsets.popper=I(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",t=B(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}.call(this)}},{key:"destroy",value:function(){return function(){return this.state.isDestroyed=!0,N(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[D("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}.call(this)}},{key:"enableEventListeners",value:function(){return function(){this.state.eventsEnabled||(this.state=U(this.reference,this.options,this.state,this.scheduleUpdate))}.call(this)}},{key:"disableEventListeners",value:function(){return F.call(this)}}]),t}();Q.Utils=("undefined"!=typeof window?window:t).PopperUtils,Q.placements=V,Q.Defaults=J,e.default=Q}.call(this,n(25))},function(t,e,n){"use strict";function i(){}n.r(e),n.d(e,"WebGLRenderTargetCube",function(){return sn}),n.d(e,"WebGLRenderTarget",function(){return an}),n.d(e,"WebGLRenderer",function(){return to}),n.d(e,"ShaderLib",function(){return yn}),n.d(e,"UniformsLib",function(){return bn}),n.d(e,"UniformsUtils",function(){return mn}),n.d(e,"ShaderChunk",function(){return pn}),n.d(e,"FogExp2",function(){return eo}),n.d(e,"Fog",function(){return no}),n.d(e,"Scene",function(){return io}),n.d(e,"Sprite",function(){return oo}),n.d(e,"LOD",function(){return ao}),n.d(e,"SkinnedMesh",function(){return lo}),n.d(e,"Skeleton",function(){return so}),n.d(e,"Bone",function(){return co}),n.d(e,"Mesh",function(){return mi}),n.d(e,"LineSegments",function(){return fo}),n.d(e,"LineLoop",function(){return po}),n.d(e,"Line",function(){return ho}),n.d(e,"Points",function(){return go}),n.d(e,"Group",function(){return _o}),n.d(e,"VideoTexture",function(){return vo}),n.d(e,"DataTexture",function(){return cn}),n.d(e,"CompressedTexture",function(){return bo}),n.d(e,"CubeTexture",function(){return Ti}),n.d(e,"CanvasTexture",function(){return Vr}),n.d(e,"DepthTexture",function(){return yo}),n.d(e,"Texture",function(){return rn}),n.d(e,"CompressedTextureLoader",function(){return Xa}),n.d(e,"DataTextureLoader",function(){return Ya}),n.d(e,"CubeTextureLoader",function(){return Za}),n.d(e,"TextureLoader",function(){return Ja}),n.d(e,"ObjectLoader",function(){return ec}),n.d(e,"MaterialLoader",function(){return Ws}),n.d(e,"BufferGeometryLoader",function(){return Vs}),n.d(e,"DefaultLoadingManager",function(){return Ga}),n.d(e,"LoadingManager",function(){return qa}),n.d(e,"JSONLoader",function(){return tc}),n.d(e,"ImageLoader",function(){return Ka}),n.d(e,"ImageBitmapLoader",function(){return ac}),n.d(e,"FontLoader",function(){return uc}),n.d(e,"FileLoader",function(){return Va}),n.d(e,"Loader",function(){return Qs}),n.d(e,"LoaderUtils",function(){return $s}),n.d(e,"Cache",function(){return Ha}),n.d(e,"AudioLoader",function(){return wc}),n.d(e,"SpotLightShadow",function(){return Es}),n.d(e,"SpotLight",function(){return Ss}),n.d(e,"PointLight",function(){return As}),n.d(e,"RectAreaLight",function(){return Ls}),n.d(e,"HemisphereLight",function(){return ws}),n.d(e,"DirectionalLightShadow",function(){return Ts}),n.d(e,"DirectionalLight",function(){return ks}),n.d(e,"AmbientLight",function(){return Ps}),n.d(e,"LightShadow",function(){return Ms}),n.d(e,"Light",function(){return xs}),n.d(e,"StereoCamera",function(){return Mc}),n.d(e,"PerspectiveCamera",function(){return Jr}),n.d(e,"OrthographicCamera",function(){return On}),n.d(e,"CubeCamera",function(){return Ec}),n.d(e,"ArrayCamera",function(){return Qr}),n.d(e,"Camera",function(){return Ln}),n.d(e,"AudioListener",function(){return Sc}),n.d(e,"PositionalAudio",function(){return Tc}),n.d(e,"AudioContext",function(){return xc}),n.d(e,"AudioAnalyser",function(){return kc}),n.d(e,"Audio",function(){return Ac}),n.d(e,"VectorKeyframeTrack",function(){return qs}),n.d(e,"StringKeyframeTrack",function(){return Os}),n.d(e,"QuaternionKeyframeTrack",function(){return zs}),n.d(e,"NumberKeyframeTrack",function(){return Ns}),n.d(e,"ColorKeyframeTrack",function(){return Bs}),n.d(e,"BooleanKeyframeTrack",function(){return Cs}),n.d(e,"PropertyMixer",function(){return Pc}),n.d(e,"PropertyBinding",function(){return Gc}),n.d(e,"KeyframeTrack",function(){return Hs}),n.d(e,"AnimationUtils",function(){return Fs}),n.d(e,"AnimationObjectGroup",function(){return Wc}),n.d(e,"AnimationMixer",function(){return Xc}),n.d(e,"AnimationClip",function(){return Gs}),n.d(e,"Uniform",function(){return Yc}),n.d(e,"InstancedBufferGeometry",function(){return Kc}),n.d(e,"BufferGeometry",function(){return Zn}),n.d(e,"Geometry",function(){return Bn}),n.d(e,"InterleavedBufferAttribute",function(){return Zc}),n.d(e,"InstancedInterleavedBuffer",function(){return Qc}),n.d(e,"InterleavedBuffer",function(){return Jc}),n.d(e,"InstancedBufferAttribute",function(){return $c}),n.d(e,"Face3",function(){return Cn}),n.d(e,"Object3D",function(){return Pn}),n.d(e,"Raycaster",function(){return tl}),n.d(e,"Layers",function(){return Mn}),n.d(e,"EventDispatcher",function(){return i}),n.d(e,"Clock",function(){return il}),n.d(e,"QuaternionLinearInterpolant",function(){return Is}),n.d(e,"LinearInterpolant",function(){return js}),n.d(e,"DiscreteInterpolant",function(){return Us}),n.d(e,"CubicInterpolant",function(){return Ds}),n.d(e,"Interpolant",function(){return Rs}),n.d(e,"Triangle",function(){return pi}),n.d(e,"Math",function(){return Ge}),n.d(e,"Spherical",function(){return rl}),n.d(e,"Cylindrical",function(){return ol}),n.d(e,"Plane",function(){return hn}),n.d(e,"Frustum",function(){return dn}),n.d(e,"Sphere",function(){return un}),n.d(e,"Ray",function(){return di}),n.d(e,"Matrix4",function(){return Ve}),n.d(e,"Matrix3",function(){return Ke}),n.d(e,"Box3",function(){return ln}),n.d(e,"Box2",function(){return al}),n.d(e,"Line3",function(){return fi}),n.d(e,"Euler",function(){return wn}),n.d(e,"Vector4",function(){return on}),n.d(e,"Vector3",function(){return Ye}),n.d(e,"Vector2",function(){return We}),n.d(e,"Quaternion",function(){return Xe}),n.d(e,"Color",function(){return _n}),n.d(e,"ImmediateRenderObject",function(){return sl}),n.d(e,"VertexNormalsHelper",function(){return cl}),n.d(e,"SpotLightHelper",function(){return ll}),n.d(e,"SkeletonHelper",function(){return ul}),n.d(e,"PointLightHelper",function(){return hl}),n.d(e,"RectAreaLightHelper",function(){return dl}),n.d(e,"HemisphereLightHelper",function(){return fl}),n.d(e,"GridHelper",function(){return pl}),n.d(e,"PolarGridHelper",function(){return ml}),n.d(e,"FaceNormalsHelper",function(){return gl}),n.d(e,"DirectionalLightHelper",function(){return _l}),n.d(e,"CameraHelper",function(){return vl}),n.d(e,"BoxHelper",function(){return bl}),n.d(e,"Box3Helper",function(){return yl}),n.d(e,"PlaneHelper",function(){return xl}),n.d(e,"ArrowHelper",function(){return wl}),n.d(e,"AxesHelper",function(){return Ml}),n.d(e,"Shape",function(){return ys}),n.d(e,"Path",function(){return bs}),n.d(e,"ShapePath",function(){return sc}),n.d(e,"Font",function(){return cc}),n.d(e,"CurvePath",function(){return vs}),n.d(e,"Curve",function(){return Qa}),n.d(e,"ShapeUtils",function(){return ca}),n.d(e,"WebGLUtils",function(){return Zr}),n.d(e,"WireframeGeometry",function(){return xo}),n.d(e,"ParametricGeometry",function(){return wo}),n.d(e,"ParametricBufferGeometry",function(){return Mo}),n.d(e,"TetrahedronGeometry",function(){return Ao}),n.d(e,"TetrahedronBufferGeometry",function(){return To}),n.d(e,"OctahedronGeometry",function(){return ko}),n.d(e,"OctahedronBufferGeometry",function(){return Po}),n.d(e,"IcosahedronGeometry",function(){return Lo}),n.d(e,"IcosahedronBufferGeometry",function(){return Oo}),n.d(e,"DodecahedronGeometry",function(){return Co}),n.d(e,"DodecahedronBufferGeometry",function(){return Ro}),n.d(e,"PolyhedronGeometry",function(){return Eo}),n.d(e,"PolyhedronBufferGeometry",function(){return So}),n.d(e,"TubeGeometry",function(){return Io}),n.d(e,"TubeBufferGeometry",function(){return zo}),n.d(e,"TorusKnotGeometry",function(){return Bo}),n.d(e,"TorusKnotBufferGeometry",function(){return No}),n.d(e,"TorusGeometry",function(){return Do}),n.d(e,"TorusBufferGeometry",function(){return jo}),n.d(e,"TextGeometry",function(){return fa}),n.d(e,"TextBufferGeometry",function(){return pa}),n.d(e,"SphereGeometry",function(){return ma}),n.d(e,"SphereBufferGeometry",function(){return ga}),n.d(e,"RingGeometry",function(){return _a}),n.d(e,"RingBufferGeometry",function(){return va}),n.d(e,"PlaneGeometry",function(){return $n}),n.d(e,"PlaneBufferGeometry",function(){return ti}),n.d(e,"LatheGeometry",function(){return ba}),n.d(e,"LatheBufferGeometry",function(){return ya}),n.d(e,"ShapeGeometry",function(){return xa}),n.d(e,"ShapeBufferGeometry",function(){return wa}),n.d(e,"ExtrudeGeometry",function(){return ha}),n.d(e,"ExtrudeBufferGeometry",function(){return da}),n.d(e,"EdgesGeometry",function(){return Ea}),n.d(e,"ConeGeometry",function(){return Ta}),n.d(e,"ConeBufferGeometry",function(){return ka}),n.d(e,"CylinderGeometry",function(){return Sa}),n.d(e,"CylinderBufferGeometry",function(){return Aa}),n.d(e,"CircleGeometry",function(){return Pa}),n.d(e,"CircleBufferGeometry",function(){return La}),n.d(e,"BoxGeometry",function(){return Jn}),n.d(e,"BoxBufferGeometry",function(){return Qn}),n.d(e,"ShadowMaterial",function(){return Ca}),n.d(e,"SpriteMaterial",function(){return ro}),n.d(e,"RawShaderMaterial",function(){return Ra}),n.d(e,"ShaderMaterial",function(){return hi}),n.d(e,"PointsMaterial",function(){return mo}),n.d(e,"MeshPhysicalMaterial",function(){return za}),n.d(e,"MeshStandardMaterial",function(){return Ia}),n.d(e,"MeshPhongMaterial",function(){return Ba}),n.d(e,"MeshToonMaterial",function(){return Na}),n.d(e,"MeshNormalMaterial",function(){return Da}),n.d(e,"MeshLambertMaterial",function(){return ja}),n.d(e,"MeshDepthMaterial",function(){return qr}),n.d(e,"MeshDistanceMaterial",function(){return Gr}),n.d(e,"MeshBasicMaterial",function(){return ui}),n.d(e,"LineDashedMaterial",function(){return Ua}),n.d(e,"LineBasicMaterial",function(){return uo}),n.d(e,"Material",function(){return li}),n.d(e,"Float64BufferAttribute",function(){return Vn}),n.d(e,"Float32BufferAttribute",function(){return Wn}),n.d(e,"Uint32BufferAttribute",function(){return Gn}),n.d(e,"Int32BufferAttribute",function(){return qn}),n.d(e,"Uint16BufferAttribute",function(){return Hn}),n.d(e,"Int16BufferAttribute",function(){return Fn}),n.d(e,"Uint8ClampedBufferAttribute",function(){return Un}),n.d(e,"Uint8BufferAttribute",function(){return jn}),n.d(e,"Int8BufferAttribute",function(){return Dn}),n.d(e,"BufferAttribute",function(){return Nn}),n.d(e,"ArcCurve",function(){return ts}),n.d(e,"CatmullRomCurve3",function(){return as}),n.d(e,"CubicBezierCurve",function(){return us}),n.d(e,"CubicBezierCurve3",function(){return hs}),n.d(e,"EllipseCurve",function(){return $a}),n.d(e,"LineCurve",function(){return ds}),n.d(e,"LineCurve3",function(){return fs}),n.d(e,"QuadraticBezierCurve",function(){return ps}),n.d(e,"QuadraticBezierCurve3",function(){return ms}),n.d(e,"SplineCurve",function(){return gs}),n.d(e,"REVISION",function(){return f}),n.d(e,"MOUSE",function(){return p}),n.d(e,"CullFaceNone",function(){return m}),n.d(e,"CullFaceBack",function(){return g}),n.d(e,"CullFaceFront",function(){return _}),n.d(e,"CullFaceFrontBack",function(){return v}),n.d(e,"FrontFaceDirectionCW",function(){return b}),n.d(e,"FrontFaceDirectionCCW",function(){return y}),n.d(e,"BasicShadowMap",function(){return x}),n.d(e,"PCFShadowMap",function(){return w}),n.d(e,"PCFSoftShadowMap",function(){return M}),n.d(e,"FrontSide",function(){return E}),n.d(e,"BackSide",function(){return S}),n.d(e,"DoubleSide",function(){return A}),n.d(e,"FlatShading",function(){return T}),n.d(e,"SmoothShading",function(){return k}),n.d(e,"NoColors",function(){return P}),n.d(e,"FaceColors",function(){return L}),n.d(e,"VertexColors",function(){return O}),n.d(e,"NoBlending",function(){return C}),n.d(e,"NormalBlending",function(){return R}),n.d(e,"AdditiveBlending",function(){return I}),n.d(e,"SubtractiveBlending",function(){return z}),n.d(e,"MultiplyBlending",function(){return B}),n.d(e,"CustomBlending",function(){return N}),n.d(e,"AddEquation",function(){return D}),n.d(e,"SubtractEquation",function(){return j}),n.d(e,"ReverseSubtractEquation",function(){return U}),n.d(e,"MinEquation",function(){return F}),n.d(e,"MaxEquation",function(){return H}),n.d(e,"ZeroFactor",function(){return q}),n.d(e,"OneFactor",function(){return G}),n.d(e,"SrcColorFactor",function(){return W}),n.d(e,"OneMinusSrcColorFactor",function(){return V}),n.d(e,"SrcAlphaFactor",function(){return X}),n.d(e,"OneMinusSrcAlphaFactor",function(){return Y}),n.d(e,"DstAlphaFactor",function(){return K}),n.d(e,"OneMinusDstAlphaFactor",function(){return Z}),n.d(e,"DstColorFactor",function(){return J}),n.d(e,"OneMinusDstColorFactor",function(){return Q}),n.d(e,"SrcAlphaSaturateFactor",function(){return $}),n.d(e,"NeverDepth",function(){return tt}),n.d(e,"AlwaysDepth",function(){return et}),n.d(e,"LessDepth",function(){return nt}),n.d(e,"LessEqualDepth",function(){return it}),n.d(e,"EqualDepth",function(){return rt}),n.d(e,"GreaterEqualDepth",function(){return ot}),n.d(e,"GreaterDepth",function(){return at}),n.d(e,"NotEqualDepth",function(){return st}),n.d(e,"MultiplyOperation",function(){return ct}),n.d(e,"MixOperation",function(){return lt}),n.d(e,"AddOperation",function(){return ut}),n.d(e,"NoToneMapping",function(){return ht}),n.d(e,"LinearToneMapping",function(){return dt}),n.d(e,"ReinhardToneMapping",function(){return ft}),n.d(e,"Uncharted2ToneMapping",function(){return pt}),n.d(e,"CineonToneMapping",function(){return mt}),n.d(e,"UVMapping",function(){return gt}),n.d(e,"CubeReflectionMapping",function(){return _t}),n.d(e,"CubeRefractionMapping",function(){return vt}),n.d(e,"EquirectangularReflectionMapping",function(){return bt}),n.d(e,"EquirectangularRefractionMapping",function(){return yt}),n.d(e,"SphericalReflectionMapping",function(){return xt}),n.d(e,"CubeUVReflectionMapping",function(){return wt}),n.d(e,"CubeUVRefractionMapping",function(){return Mt}),n.d(e,"RepeatWrapping",function(){return Et}),n.d(e,"ClampToEdgeWrapping",function(){return St}),n.d(e,"MirroredRepeatWrapping",function(){return At}),n.d(e,"NearestFilter",function(){return Tt}),n.d(e,"NearestMipMapNearestFilter",function(){return kt}),n.d(e,"NearestMipMapLinearFilter",function(){return Pt}),n.d(e,"LinearFilter",function(){return Lt}),n.d(e,"LinearMipMapNearestFilter",function(){return Ot}),n.d(e,"LinearMipMapLinearFilter",function(){return Ct}),n.d(e,"UnsignedByteType",function(){return Rt}),n.d(e,"ByteType",function(){return It}),n.d(e,"ShortType",function(){return zt}),n.d(e,"UnsignedShortType",function(){return Bt}),n.d(e,"IntType",function(){return Nt}),n.d(e,"UnsignedIntType",function(){return Dt}),n.d(e,"FloatType",function(){return jt}),n.d(e,"HalfFloatType",function(){return Ut}),n.d(e,"UnsignedShort4444Type",function(){return Ft}),n.d(e,"UnsignedShort5551Type",function(){return Ht}),n.d(e,"UnsignedShort565Type",function(){return qt}),n.d(e,"UnsignedInt248Type",function(){return Gt}),n.d(e,"AlphaFormat",function(){return Wt}),n.d(e,"RGBFormat",function(){return Vt}),n.d(e,"RGBAFormat",function(){return Xt}),n.d(e,"LuminanceFormat",function(){return Yt}),n.d(e,"LuminanceAlphaFormat",function(){return Kt}),n.d(e,"RGBEFormat",function(){return Zt}),n.d(e,"DepthFormat",function(){return Jt}),n.d(e,"DepthStencilFormat",function(){return Qt}),n.d(e,"RGB_S3TC_DXT1_Format",function(){return $t}),n.d(e,"RGBA_S3TC_DXT1_Format",function(){return te}),n.d(e,"RGBA_S3TC_DXT3_Format",function(){return ee}),n.d(e,"RGBA_S3TC_DXT5_Format",function(){return ne}),n.d(e,"RGB_PVRTC_4BPPV1_Format",function(){return ie}),n.d(e,"RGB_PVRTC_2BPPV1_Format",function(){return re}),n.d(e,"RGBA_PVRTC_4BPPV1_Format",function(){return oe}),n.d(e,"RGBA_PVRTC_2BPPV1_Format",function(){return ae}),n.d(e,"RGB_ETC1_Format",function(){return se}),n.d(e,"RGBA_ASTC_4x4_Format",function(){return ce}),n.d(e,"RGBA_ASTC_5x4_Format",function(){return le}),n.d(e,"RGBA_ASTC_5x5_Format",function(){return ue}),n.d(e,"RGBA_ASTC_6x5_Format",function(){return he}),n.d(e,"RGBA_ASTC_6x6_Format",function(){return de}),n.d(e,"RGBA_ASTC_8x5_Format",function(){return fe}),n.d(e,"RGBA_ASTC_8x6_Format",function(){return pe}),n.d(e,"RGBA_ASTC_8x8_Format",function(){return me}),n.d(e,"RGBA_ASTC_10x5_Format",function(){return ge}),n.d(e,"RGBA_ASTC_10x6_Format",function(){return _e}),n.d(e,"RGBA_ASTC_10x8_Format",function(){return ve}),n.d(e,"RGBA_ASTC_10x10_Format",function(){return be}),n.d(e,"RGBA_ASTC_12x10_Format",function(){return ye}),n.d(e,"RGBA_ASTC_12x12_Format",function(){return xe}),n.d(e,"LoopOnce",function(){return we}),n.d(e,"LoopRepeat",function(){return Me}),n.d(e,"LoopPingPong",function(){return Ee}),n.d(e,"InterpolateDiscrete",function(){return Se}),n.d(e,"InterpolateLinear",function(){return Ae}),n.d(e,"InterpolateSmooth",function(){return Te}),n.d(e,"ZeroCurvatureEnding",function(){return ke}),n.d(e,"ZeroSlopeEnding",function(){return Pe}),n.d(e,"WrapAroundEnding",function(){return Le}),n.d(e,"TrianglesDrawMode",function(){return Oe}),n.d(e,"TriangleStripDrawMode",function(){return Ce}),n.d(e,"TriangleFanDrawMode",function(){return Re}),n.d(e,"LinearEncoding",function(){return Ie}),n.d(e,"sRGBEncoding",function(){return ze}),n.d(e,"GammaEncoding",function(){return Be}),n.d(e,"RGBEEncoding",function(){return Ne}),n.d(e,"LogLuvEncoding",function(){return De}),n.d(e,"RGBM7Encoding",function(){return je}),n.d(e,"RGBM16Encoding",function(){return Ue}),n.d(e,"RGBDEncoding",function(){return Fe}),n.d(e,"BasicDepthPacking",function(){return He}),n.d(e,"RGBADepthPacking",function(){return qe}),n.d(e,"CubeGeometry",function(){return Jn}),n.d(e,"Face4",function(){return El}),n.d(e,"LineStrip",function(){return Sl}),n.d(e,"LinePieces",function(){return Al}),n.d(e,"MeshFaceMaterial",function(){return Tl}),n.d(e,"MultiMaterial",function(){return kl}),n.d(e,"PointCloud",function(){return Pl}),n.d(e,"Particle",function(){return Ll}),n.d(e,"ParticleSystem",function(){return Ol}),n.d(e,"PointCloudMaterial",function(){return Cl}),n.d(e,"ParticleBasicMaterial",function(){return Rl}),n.d(e,"ParticleSystemMaterial",function(){return Il}),n.d(e,"Vertex",function(){return zl}),n.d(e,"DynamicBufferAttribute",function(){return Bl}),n.d(e,"Int8Attribute",function(){return Nl}),n.d(e,"Uint8Attribute",function(){return Dl}),n.d(e,"Uint8ClampedAttribute",function(){return jl}),n.d(e,"Int16Attribute",function(){return Ul}),n.d(e,"Uint16Attribute",function(){return Fl}),n.d(e,"Int32Attribute",function(){return Hl}),n.d(e,"Uint32Attribute",function(){return ql}),n.d(e,"Float32Attribute",function(){return Gl}),n.d(e,"Float64Attribute",function(){return Wl}),n.d(e,"ClosedSplineCurve3",function(){return Vl}),n.d(e,"SplineCurve3",function(){return Xl}),n.d(e,"Spline",function(){return Yl}),n.d(e,"AxisHelper",function(){return Kl}),n.d(e,"BoundingBoxHelper",function(){return Zl}),n.d(e,"EdgesHelper",function(){return Jl}),n.d(e,"WireframeHelper",function(){return Ql}),n.d(e,"XHRLoader",function(){return $l}),n.d(e,"BinaryTextureLoader",function(){return tu}),n.d(e,"GeometryUtils",function(){return eu}),n.d(e,"ImageUtils",function(){return nu}),n.d(e,"Projector",function(){return iu}),n.d(e,"CanvasRenderer",function(){return ru}),n.d(e,"SceneUtils",function(){return ou}),n.d(e,"LensFlare",function(){return au}),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:t>0?1:+t}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}),Object.assign(i.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var n=this._listeners[t];if(void 0!==n){var i=n.indexOf(e);-1!==i&&n.splice(i,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var n=e.slice(0),i=0,r=n.length;i<r;i++)n[i].call(this,t)}}}});var r,o,a,s,c,l,u,h,d,f="91",p={LEFT:0,MIDDLE:1,RIGHT:2},m=0,g=1,_=2,v=3,b=0,y=1,x=0,w=1,M=2,E=0,S=1,A=2,T=1,k=2,P=0,L=1,O=2,C=0,R=1,I=2,z=3,B=4,N=5,D=100,j=101,U=102,F=103,H=104,q=200,G=201,W=202,V=203,X=204,Y=205,K=206,Z=207,J=208,Q=209,$=210,tt=0,et=1,nt=2,it=3,rt=4,ot=5,at=6,st=7,ct=0,lt=1,ut=2,ht=0,dt=1,ft=2,pt=3,mt=4,gt=300,_t=301,vt=302,bt=303,yt=304,xt=305,wt=306,Mt=307,Et=1e3,St=1001,At=1002,Tt=1003,kt=1004,Pt=1005,Lt=1006,Ot=1007,Ct=1008,Rt=1009,It=1010,zt=1011,Bt=1012,Nt=1013,Dt=1014,jt=1015,Ut=1016,Ft=1017,Ht=1018,qt=1019,Gt=1020,Wt=1021,Vt=1022,Xt=1023,Yt=1024,Kt=1025,Zt=Xt,Jt=1026,Qt=1027,$t=33776,te=33777,ee=33778,ne=33779,ie=35840,re=35841,oe=35842,ae=35843,se=36196,ce=37808,le=37809,ue=37810,he=37811,de=37812,fe=37813,pe=37814,me=37815,ge=37816,_e=37817,ve=37818,be=37819,ye=37820,xe=37821,we=2200,Me=2201,Ee=2202,Se=2300,Ae=2301,Te=2302,ke=2400,Pe=2401,Le=2402,Oe=0,Ce=1,Re=2,Ie=3e3,ze=3001,Be=3007,Ne=3002,De=3003,je=3004,Ue=3005,Fe=3006,He=3200,qe=3201,Ge={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var t=[],e=0;e<256;e++)t[e]=(e<16?"0":"")+e.toString(16).toUpperCase();return function(){var e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return t[255&e]+t[e>>8&255]+t[e>>16&255]+t[e>>24&255]+"-"+t[255&n]+t[n>>8&255]+"-"+t[n>>16&15|64]+t[n>>24&255]+"-"+t[63&i|128]+t[i>>8&255]+"-"+t[i>>16&255]+t[i>>24&255]+t[255&r]+t[r>>8&255]+t[r>>16&255]+t[r>>24&255]}}(),clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*Ge.DEG2RAD},radToDeg:function(t){return t*Ge.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}};function We(t,e){this.x=t||0,this.y=e||0}function Ve(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function Xe(t,e,n,i){this._x=t||0,this._y=e||0,this._z=n||0,this._w=void 0!==i?i:1}function Ye(t,e,n){this.x=t||0,this.y=e||0,this.z=n||0}function Ke(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(We.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(We.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:(r=new We,o=new We,function(t,e){return r.set(t,t),o.set(e,e),this.clamp(r,o)}),clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*n-o*i+t.x,this.y=r*i+o*n+t.y,this}}),Object.assign(Ve.prototype,{isMatrix4:!0,set:function(t,e,n,i,r,o,a,s,c,l,u,h,d,f,p,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=r,g[5]=o,g[9]=a,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=h,g[3]=d,g[7]=f,g[11]=p,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new Ve).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this},copyPosition:function(t){var e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this},extractBasis:function(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this},extractRotation:(h=new Ye,function(t){var e=this.elements,n=t.elements,i=1/h.setFromMatrixColumn(t,0).length(),r=1/h.setFromMatrixColumn(t,1).length(),o=1/h.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,this}),makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,n=t.x,i=t.y,r=t.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(i),c=Math.sin(i),l=Math.cos(r),u=Math.sin(r);if("XYZ"===t.order){var h=o*l,d=o*u,f=a*l,p=a*u;e[0]=s*l,e[4]=-s*u,e[8]=c,e[1]=d+f*c,e[5]=h-p*c,e[9]=-a*s,e[2]=p-h*c,e[6]=f+d*c,e[10]=o*s}else if("YXZ"===t.order){var m=s*l,g=s*u,_=c*l,v=c*u;e[0]=m+v*a,e[4]=_*a-g,e[8]=o*c,e[1]=o*u,e[5]=o*l,e[9]=-a,e[2]=g*a-_,e[6]=v+m*a,e[10]=o*s}else if("ZXY"===t.order){m=s*l,g=s*u,_=c*l,v=c*u;e[0]=m-v*a,e[4]=-o*u,e[8]=_+g*a,e[1]=g+_*a,e[5]=o*l,e[9]=v-m*a,e[2]=-o*c,e[6]=a,e[10]=o*s}else if("ZYX"===t.order){h=o*l,d=o*u,f=a*l,p=a*u;e[0]=s*l,e[4]=f*c-d,e[8]=h*c+p,e[1]=s*u,e[5]=p*c+h,e[9]=d*c-f,e[2]=-c,e[6]=a*s,e[10]=o*s}else if("YZX"===t.order){var b=o*s,y=o*c,x=a*s,w=a*c;e[0]=s*l,e[4]=w-b*u,e[8]=x*u+y,e[1]=u,e[5]=o*l,e[9]=-a*l,e[2]=-c*l,e[6]=y*u+x,e[10]=b-w*u}else if("XZY"===t.order){b=o*s,y=o*c,x=a*s,w=a*c;e[0]=s*l,e[4]=-u,e[8]=c*l,e[1]=b*u+w,e[5]=o*l,e[9]=y*u-x,e[2]=x*u-y,e[6]=a*l,e[10]=w*u+b}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){var e=this.elements,n=t._x,i=t._y,r=t._z,o=t._w,a=n+n,s=i+i,c=r+r,l=n*a,u=n*s,h=n*c,d=i*s,f=i*c,p=r*c,m=o*a,g=o*s,_=o*c;return e[0]=1-(d+p),e[4]=u-_,e[8]=h+g,e[1]=u+_,e[5]=1-(l+p),e[9]=f-m,e[2]=h-g,e[6]=f+m,e[10]=1-(l+d),e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},lookAt:(c=new Ye,l=new Ye,u=new Ye,function(t,e,n){var i=this.elements;return u.subVectors(t,e),0===u.lengthSq()&&(u.z=1),u.normalize(),c.crossVectors(n,u),0===c.lengthSq()&&(1===Math.abs(n.z)?u.x+=1e-4:u.z+=1e-4,u.normalize(),c.crossVectors(n,u)),c.normalize(),l.crossVectors(u,c),i[0]=c.x,i[4]=l.x,i[8]=u.x,i[1]=c.y,i[5]=l.y,i[9]=u.y,i[2]=c.z,i[6]=l.z,i[10]=u.z,this}),multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,i=e.elements,r=this.elements,o=n[0],a=n[4],s=n[8],c=n[12],l=n[1],u=n[5],h=n[9],d=n[13],f=n[2],p=n[6],m=n[10],g=n[14],_=n[3],v=n[7],b=n[11],y=n[15],x=i[0],w=i[4],M=i[8],E=i[12],S=i[1],A=i[5],T=i[9],k=i[13],P=i[2],L=i[6],O=i[10],C=i[14],R=i[3],I=i[7],z=i[11],B=i[15];return r[0]=o*x+a*S+s*P+c*R,r[4]=o*w+a*A+s*L+c*I,r[8]=o*M+a*T+s*O+c*z,r[12]=o*E+a*k+s*C+c*B,r[1]=l*x+u*S+h*P+d*R,r[5]=l*w+u*A+h*L+d*I,r[9]=l*M+u*T+h*O+d*z,r[13]=l*E+u*k+h*C+d*B,r[2]=f*x+p*S+m*P+g*R,r[6]=f*w+p*A+m*L+g*I,r[10]=f*M+p*T+m*O+g*z,r[14]=f*E+p*k+m*C+g*B,r[3]=_*x+v*S+b*P+y*R,r[7]=_*w+v*A+b*L+y*I,r[11]=_*M+v*T+b*O+y*z,r[15]=_*E+v*k+b*C+y*B,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},applyToBufferAttribute:function(){var t=new Ye;return function(e){for(var n=0,i=e.count;n<i;n++)t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.applyMatrix4(this),e.setXYZ(n,t.x,t.y,t.z);return e}}(),determinant:function(){var t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],o=t[1],a=t[5],s=t[9],c=t[13],l=t[2],u=t[6],h=t[10],d=t[14];return t[3]*(+r*s*u-i*c*u-r*a*h+n*c*h+i*a*d-n*s*d)+t[7]*(+e*s*d-e*c*h+r*o*h-i*o*d+i*c*l-r*s*l)+t[11]*(+e*c*u-e*a*d-r*o*u+n*o*d+r*a*l-n*c*l)+t[15]*(-i*a*l-e*s*u+e*a*h+i*o*u-n*o*h+n*s*l)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(t){var e=this.elements;return e[12]=t.x,e[13]=t.y,e[14]=t.z,this},getInverse:function(t,e){var n=this.elements,i=t.elements,r=i[0],o=i[1],a=i[2],s=i[3],c=i[4],l=i[5],u=i[6],h=i[7],d=i[8],f=i[9],p=i[10],m=i[11],g=i[12],_=i[13],v=i[14],b=i[15],y=f*v*h-_*p*h+_*u*m-l*v*m-f*u*b+l*p*b,x=g*p*h-d*v*h-g*u*m+c*v*m+d*u*b-c*p*b,w=d*_*h-g*f*h+g*l*m-c*_*m-d*l*b+c*f*b,M=g*f*u-d*_*u-g*l*p+c*_*p+d*l*v-c*f*v,E=r*y+o*x+a*w+s*M;if(0===E){var S="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(S);return console.warn(S),this.identity()}var A=1/E;return n[0]=y*A,n[1]=(_*p*s-f*v*s-_*a*m+o*v*m+f*a*b-o*p*b)*A,n[2]=(l*v*s-_*u*s+_*a*h-o*v*h-l*a*b+o*u*b)*A,n[3]=(f*u*s-l*p*s-f*a*h+o*p*h+l*a*m-o*u*m)*A,n[4]=x*A,n[5]=(d*v*s-g*p*s+g*a*m-r*v*m-d*a*b+r*p*b)*A,n[6]=(g*u*s-c*v*s-g*a*h+r*v*h+c*a*b-r*u*b)*A,n[7]=(c*p*s-d*u*s+d*a*h-r*p*h-c*a*m+r*u*m)*A,n[8]=w*A,n[9]=(g*f*s-d*_*s-g*o*m+r*_*m+d*o*b-r*f*b)*A,n[10]=(c*_*s-g*l*s+g*o*h-r*_*h-c*o*b+r*l*b)*A,n[11]=(d*l*s-c*f*s-d*o*h+r*f*h+c*o*m-r*l*m)*A,n[12]=M*A,n[13]=(d*_*a-g*f*a+g*o*p-r*_*p-d*o*v+r*f*v)*A,n[14]=(g*l*a-c*_*a-g*o*u+r*_*u+c*o*v-r*l*v)*A,n[15]=(c*f*a-d*l*a+d*o*u-r*f*u-c*o*p+r*l*p)*A,this},scale:function(t){var e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))},makeTranslation:function(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=1-n,o=t.x,a=t.y,s=t.z,c=r*o,l=r*a;return this.set(c*o+n,c*a-i*s,c*s+i*a,0,c*a+i*s,l*a+n,l*s-i*o,0,c*s-i*a,l*s+i*o,r*s*s+n,0,0,0,0,1),this},makeScale:function(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,n){return this.makeRotationFromQuaternion(e),this.scale(n),this.setPosition(t),this},decompose:(a=new Ye,s=new Ve,function(t,e,n){var i=this.elements,r=a.set(i[0],i[1],i[2]).length(),o=a.set(i[4],i[5],i[6]).length(),c=a.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],s.copy(this);var l=1/r,u=1/o,h=1/c;return s.elements[0]*=l,s.elements[1]*=l,s.elements[2]*=l,s.elements[4]*=u,s.elements[5]*=u,s.elements[6]*=u,s.elements[8]*=h,s.elements[9]*=h,s.elements[10]*=h,e.setFromRotationMatrix(s),n.x=r,n.y=o,n.z=c,this}),makePerspective:function(t,e,n,i,r,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*r/(e-t),c=2*r/(n-i),l=(e+t)/(e-t),u=(n+i)/(n-i),h=-(o+r)/(o-r),d=-2*o*r/(o-r);return a[0]=s,a[4]=0,a[8]=l,a[12]=0,a[1]=0,a[5]=c,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makeOrthographic:function(t,e,n,i,r,o){var a=this.elements,s=1/(e-t),c=1/(n-i),l=1/(o-r),u=(e+t)*s,h=(n+i)*c,d=(o+r)*l;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*l,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},equals:function(t){for(var e=this.elements,n=t.elements,i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<16;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}),Object.assign(Xe,{slerp:function(t,e,n,i){return n.copy(t).slerp(e,i)},slerpFlat:function(t,e,n,i,r,o,a){var s=n[i+0],c=n[i+1],l=n[i+2],u=n[i+3],h=r[o+0],d=r[o+1],f=r[o+2],p=r[o+3];if(u!==p||s!==h||c!==d||l!==f){var m=1-a,g=s*h+c*d+l*f+u*p,_=g>=0?1:-1,v=1-g*g;if(v>Number.EPSILON){var b=Math.sqrt(v),y=Math.atan2(b,g*_);m=Math.sin(m*y)/b,a=Math.sin(a*y)/b}var x=a*_;if(s=s*m+h*x,c=c*m+d*x,l=l*m+f*x,u=u*m+p*x,m===1-a){var w=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=w,c*=w,l*=w,u*=w}}t[e]=s,t[e+1]=c,t[e+2]=l,t[e+3]=u}}),Object.defineProperties(Xe.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback()}}}),Object.assign(Xe.prototype,{set:function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this.onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=t._x,i=t._y,r=t._z,o=t.order,a=Math.cos,s=Math.sin,c=a(n/2),l=a(i/2),u=a(r/2),h=s(n/2),d=s(i/2),f=s(r/2);return"XYZ"===o?(this._x=h*l*u+c*d*f,this._y=c*d*u-h*l*f,this._z=c*l*f+h*d*u,this._w=c*l*u-h*d*f):"YXZ"===o?(this._x=h*l*u+c*d*f,this._y=c*d*u-h*l*f,this._z=c*l*f-h*d*u,this._w=c*l*u+h*d*f):"ZXY"===o?(this._x=h*l*u-c*d*f,this._y=c*d*u+h*l*f,this._z=c*l*f+h*d*u,this._w=c*l*u-h*d*f):"ZYX"===o?(this._x=h*l*u-c*d*f,this._y=c*d*u+h*l*f,this._z=c*l*f-h*d*u,this._w=c*l*u+h*d*f):"YZX"===o?(this._x=h*l*u+c*d*f,this._y=c*d*u+h*l*f,this._z=c*l*f-h*d*u,this._w=c*l*u-h*d*f):"XZY"===o&&(this._x=h*l*u-c*d*f,this._y=c*d*u-h*l*f,this._z=c*l*f+h*d*u,this._w=c*l*u+h*d*f),!1!==e&&this.onChangeCallback(),this},setFromAxisAngle:function(t,e){var n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this.onChangeCallback(),this},setFromRotationMatrix:function(t){var e,n=t.elements,i=n[0],r=n[4],o=n[8],a=n[1],s=n[5],c=n[9],l=n[2],u=n[6],h=n[10],d=i+s+h;return d>0?(e=.5/Math.sqrt(d+1),this._w=.25/e,this._x=(u-c)*e,this._y=(o-l)*e,this._z=(a-r)*e):i>s&&i>h?(e=2*Math.sqrt(1+i-s-h),this._w=(u-c)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(o+l)/e):s>h?(e=2*Math.sqrt(1+s-i-h),this._w=(o-l)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(c+u)/e):(e=2*Math.sqrt(1+h-i-s),this._w=(a-r)/e,this._x=(o+l)/e,this._y=(c+u)/e,this._z=.25*e),this.onChangeCallback(),this},setFromUnitVectors:function(){var t,e=new Ye;return function(n,i){return void 0===e&&(e=new Ye),(t=n.dot(i)+1)<1e-6?(t=0,Math.abs(n.x)>Math.abs(n.z)?e.set(-n.y,n.x,0):e.set(0,-n.z,n.y)):e.crossVectors(n,i),this._x=e.x,this._y=e.y,this._z=e.z,this._w=t,this.normalize()}}(),inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this.onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var n=t._x,i=t._y,r=t._z,o=t._w,a=e._x,s=e._y,c=e._z,l=e._w;return this._x=n*l+o*a+i*c-r*s,this._y=i*l+o*s+r*a-n*c,this._z=r*l+o*c+n*s-i*a,this._w=o*l-n*a-i*s-r*c,this.onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,i=this._y,r=this._z,o=this._w,a=o*t._w+n*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=i,this._z=r,this;var s=Math.sqrt(1-a*a);if(Math.abs(s)<.001)return this._w=.5*(o+this._w),this._x=.5*(n+this._x),this._y=.5*(i+this._y),this._z=.5*(r+this._z),this;var c=Math.atan2(s,a),l=Math.sin((1-e)*c)/s,u=Math.sin(e*c)/s;return this._w=o*l+this._w*u,this._x=n*l+this._x*u,this._y=i*l+this._y*u,this._z=r*l+this._z*u,this.onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(Ye.prototype,{isVector3:!0,set:function(t,e,n){return this.x=t,this.y=e,this.z=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:(d=new Xe,function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(d.setFromEuler(t))}),applyAxisAngle:function(){var t=new Xe;return function(e,n){return this.applyQuaternion(t.setFromAxisAngle(e,n))}}(),applyMatrix3:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this},applyMatrix4:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements,o=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*o,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*o,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*o,this},applyQuaternion:function(t){var e=this.x,n=this.y,i=this.z,r=t.x,o=t.y,a=t.z,s=t.w,c=s*e+o*i-a*n,l=s*n+a*e-r*i,u=s*i+r*n-o*e,h=-r*e-o*n-a*i;return this.x=c*s+h*-r+l*-a-u*-o,this.y=l*s+h*-o+u*-r-c*-a,this.z=u*s+h*-a+c*-o-l*-r,this},project:function(){var t=new Ve;return function(e){return t.multiplyMatrices(e.projectionMatrix,t.getInverse(e.matrixWorld)),this.applyMatrix4(t)}}(),unproject:function(){var t=new Ve;return function(e){return t.multiplyMatrices(e.matrixWorld,t.getInverse(e.projectionMatrix)),this.applyMatrix4(t)}}(),transformDirection:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(){var t=new Ye,e=new Ye;return function(n,i){return t.set(n,n,n),e.set(i,i,i),this.clamp(t,e)}}(),clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},cross:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},crossVectors:function(t,e){var n=t.x,i=t.y,r=t.z,o=e.x,a=e.y,s=e.z;return this.x=i*s-r*a,this.y=r*o-n*s,this.z=n*a-i*o,this},projectOnVector:function(t){var e=t.dot(this)/t.lengthSq();return this.copy(t).multiplyScalar(e)},projectOnPlane:function(){var t=new Ye;return function(e){return t.copy(this).projectOnVector(e),this.sub(t)}}(),reflect:function(){var t=new Ye;return function(e){return this.sub(t.copy(e).multiplyScalar(2*this.dot(e)))}}(),angleTo:function(t){var e=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq());return Math.acos(Ge.clamp(e,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){var e=Math.sin(t.phi)*t.radius;return this.x=e*Math.sin(t.theta),this.y=Math.cos(t.phi)*t.radius,this.z=e*Math.cos(t.theta),this},setFromCylindrical:function(t){return this.x=t.radius*Math.sin(t.theta),this.y=t.y,this.z=t.radius*Math.cos(t.theta),this},setFromMatrixPosition:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}}),Object.assign(Ke.prototype,{isMatrix3:!0,set:function(t,e,n,i,r,o,a,s,c){var l=this.elements;return l[0]=t,l[1]=i,l[2]=a,l[3]=e,l[4]=r,l[5]=s,l[6]=n,l[7]=o,l[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToBufferAttribute:function(){var t=new Ye;return function(e){for(var n=0,i=e.count;n<i;n++)t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.applyMatrix3(this),e.setXYZ(n,t.x,t.y,t.z);return e}}(),multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,i=e.elements,r=this.elements,o=n[0],a=n[3],s=n[6],c=n[1],l=n[4],u=n[7],h=n[2],d=n[5],f=n[8],p=i[0],m=i[3],g=i[6],_=i[1],v=i[4],b=i[7],y=i[2],x=i[5],w=i[8];return r[0]=o*p+a*_+s*y,r[3]=o*m+a*v+s*x,r[6]=o*g+a*b+s*w,r[1]=c*p+l*_+u*y,r[4]=c*m+l*v+u*x,r[7]=c*g+l*b+u*w,r[2]=h*p+d*_+f*y,r[5]=h*m+d*v+f*x,r[8]=h*g+d*b+f*w,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],s=t[6],c=t[7],l=t[8];return e*o*l-e*a*c-n*r*l+n*a*s+i*r*c-i*o*s},getInverse:function(t,e){t&&t.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=t.elements,i=this.elements,r=n[0],o=n[1],a=n[2],s=n[3],c=n[4],l=n[5],u=n[6],h=n[7],d=n[8],f=d*c-l*h,p=l*u-d*s,m=h*s-c*u,g=r*f+o*p+a*m;if(0===g){var _="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(_);return console.warn(_),this.identity()}var v=1/g;return i[0]=f*v,i[1]=(a*h-d*o)*v,i[2]=(l*o-a*c)*v,i[3]=p*v,i[4]=(d*r-a*u)*v,i[5]=(a*s-l*r)*v,i[6]=m*v,i[7]=(o*u-h*r)*v,i[8]=(c*r-o*s)*v,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,n,i,r,o,a){var s=Math.cos(r),c=Math.sin(r);this.set(n*s,n*c,-n*(s*o+c*a)+o+t,-i*c,i*s,-i*(-c*o+s*a)+a+e,0,0,1)},scale:function(t,e){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this},rotate:function(t){var e=Math.cos(t),n=Math.sin(t),i=this.elements,r=i[0],o=i[3],a=i[6],s=i[1],c=i[4],l=i[7];return i[0]=e*r+n*s,i[3]=e*o+n*c,i[6]=e*a+n*l,i[1]=-n*r+e*s,i[4]=-n*o+e*c,i[7]=-n*a+e*l,this},translate:function(t,e){var n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this},equals:function(t){for(var e=this.elements,n=t.elements,i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<9;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}});var Ze,Je,Qe,$e,tn,en,nn=0;function rn(t,e,n,i,r,o,a,s,c,l){Object.defineProperty(this,"id",{value:nn++}),this.uuid=Ge.generateUUID(),this.name="",this.image=void 0!==t?t:rn.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:rn.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:St,this.wrapT=void 0!==i?i:St,this.magFilter=void 0!==r?r:Lt,this.minFilter=void 0!==o?o:Ct,this.anisotropy=void 0!==c?c:1,this.format=void 0!==a?a:Xt,this.type=void 0!==s?s:Rt,this.offset=new We(0,0),this.repeat=new We(1,1),this.center=new We(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ke,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==l?l:Ie,this.version=0,this.onUpdate=null}function on(t,e,n,i){this.x=t||0,this.y=e||0,this.z=n||0,this.w=void 0!==i?i:1}function an(t,e,n){this.width=t,this.height=e,this.scissor=new on(0,0,t,e),this.scissorTest=!1,this.viewport=new on(0,0,t,e),void 0===(n=n||{}).minFilter&&(n.minFilter=Lt),this.texture=new rn(void 0,void 0,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function sn(t,e,n){an.call(this,t,e,n),this.activeCubeFace=0,this.activeMipMapLevel=0}function cn(t,e,n,i,r,o,a,s,c,l,u,h){rn.call(this,null,o,a,s,c,l,i,r,u,h),this.image={data:t,width:e,height:n},this.magFilter=void 0!==c?c:Tt,this.minFilter=void 0!==l?l:Tt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function ln(t,e){this.min=void 0!==t?t:new Ye(1/0,1/0,1/0),this.max=void 0!==e?e:new Ye(-1/0,-1/0,-1/0)}function un(t,e){this.center=void 0!==t?t:new Ye,this.radius=void 0!==e?e:0}function hn(t,e){this.normal=void 0!==t?t:new Ye(1,0,0),this.constant=void 0!==e?e:0}function dn(t,e,n,i,r,o){this.planes=[void 0!==t?t:new hn,void 0!==e?e:new hn,void 0!==n?n:new hn,void 0!==i?i:new hn,void 0!==r?r:new hn,void 0!==o?o:new hn]}rn.DEFAULT_IMAGE=void 0,rn.DEFAULT_MAPPING=gt,rn.prototype=Object.assign(Object.create(i.prototype),{constructor:rn,isTexture:!0,clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var i=this.image;void 0===i.uuid&&(i.uuid=Ge.generateUUID()),e||void 0!==t.images[i.uuid]||(t.images[i.uuid]={uuid:i.uuid,url:function(t){var e;if(t instanceof HTMLCanvasElement)e=t;else{(e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")).width=t.width,e.height=t.height;var n=e.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height)}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}(i)}),n.image=i.uuid}return e||(t.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(this.mapping===gt){if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Et:t.x=t.x-Math.floor(t.x);break;case St:t.x=t.x<0?0:1;break;case At:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case Et:t.y=t.y-Math.floor(t.y);break;case St:t.y=t.y<0?0:1;break;case At:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}this.flipY&&(t.y=1-t.y)}}}),Object.defineProperty(rn.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(on.prototype,{isVector4:!0,set:function(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,n=this.y,i=this.z,r=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*i+o[12]*r,this.y=o[1]*e+o[5]*n+o[9]*i+o[13]*r,this.z=o[2]*e+o[6]*n+o[10]*i+o[14]*r,this.w=o[3]*e+o[7]*n+o[11]*i+o[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,n,i,r,o=t.elements,a=o[0],s=o[4],c=o[8],l=o[1],u=o[5],h=o[9],d=o[2],f=o[6],p=o[10];if(Math.abs(s-l)<.01&&Math.abs(c-d)<.01&&Math.abs(h-f)<.01){if(Math.abs(s+l)<.1&&Math.abs(c+d)<.1&&Math.abs(h+f)<.1&&Math.abs(a+u+p-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var m=(a+1)/2,g=(u+1)/2,_=(p+1)/2,v=(s+l)/4,b=(c+d)/4,y=(h+f)/4;return m>g&&m>_?m<.01?(n=0,i=.707106781,r=.707106781):(i=v/(n=Math.sqrt(m)),r=b/n):g>_?g<.01?(n=.707106781,i=0,r=.707106781):(n=v/(i=Math.sqrt(g)),r=y/i):_<.01?(n=.707106781,i=.707106781,r=0):(n=b/(r=Math.sqrt(_)),i=y/r),this.set(n,i,r,e),this}var x=Math.sqrt((f-h)*(f-h)+(c-d)*(c-d)+(l-s)*(l-s));return Math.abs(x)<.001&&(x=1),this.x=(f-h)/x,this.y=(c-d)/x,this.z=(l-s)/x,this.w=Math.acos((a+u+p-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(){var t,e;return function(n,i){return void 0===t&&(t=new on,e=new on),t.set(n,n,n,n),e.set(i,i,i,i),this.clamp(t,e)}}(),clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}}),an.prototype=Object.assign(Object.create(i.prototype),{constructor:an,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),sn.prototype=Object.create(an.prototype),sn.prototype.constructor=sn,sn.prototype.isWebGLRenderTargetCube=!0,cn.prototype=Object.create(rn.prototype),cn.prototype.constructor=cn,cn.prototype.isDataTexture=!0,Object.assign(ln.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,a=-1/0,s=0,c=t.length;s<c;s+=3){var l=t[s],u=t[s+1],h=t[s+2];l<e&&(e=l),u<n&&(n=u),h<i&&(i=h),l>r&&(r=l),u>o&&(o=u),h>a&&(a=h)}return this.min.set(e,n,i),this.max.set(r,o,a),this},setFromBufferAttribute:function(t){for(var e=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,a=-1/0,s=0,c=t.count;s<c;s++){var l=t.getX(s),u=t.getY(s),h=t.getZ(s);l<e&&(e=l),u<n&&(n=u),h<i&&(i=h),l>r&&(r=l),u>o&&(o=u),h>a&&(a=h)}return this.min.set(e,n,i),this.max.set(r,o,a),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new Ye;return function(e,n){var i=t.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}}(),setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box3: .getCenter() target is now required"),t=new Ye),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new Ye),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:function(){var t,e,n,i=new Ye;function r(r){var o=r.geometry;if(void 0!==o)if(o.isGeometry){var a=o.vertices;for(e=0,n=a.length;e<n;e++)i.copy(a[e]),i.applyMatrix4(r.matrixWorld),t.expandByPoint(i)}else if(o.isBufferGeometry){var s=o.attributes.position;if(void 0!==s)for(e=0,n=s.count;e<n;e++)i.fromBufferAttribute(s,e).applyMatrix4(r.matrixWorld),t.expandByPoint(i)}}return function(e){return t=this,e.updateMatrixWorld(!0),e.traverse(r),this}}(),containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new Ye),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:(Je=new Ye,function(t){return this.clampPoint(t.center,Je),Je.distanceToSquared(t.center)<=t.radius*t.radius}),intersectsPlane:function(t){var e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=t.constant&&n>=t.constant},intersectsTriangle:function(){var t=new Ye,e=new Ye,n=new Ye,i=new Ye,r=new Ye,o=new Ye,a=new Ye,s=new Ye,c=new Ye,l=new Ye;function u(i){var r,o;for(r=0,o=i.length-3;r<=o;r+=3){a.fromArray(i,r);var s=c.x*Math.abs(a.x)+c.y*Math.abs(a.y)+c.z*Math.abs(a.z),l=t.dot(a),u=e.dot(a),h=n.dot(a);if(Math.max(-Math.max(l,u,h),Math.min(l,u,h))>s)return!1}return!0}return function(a){if(this.isEmpty())return!1;this.getCenter(s),c.subVectors(this.max,s),t.subVectors(a.a,s),e.subVectors(a.b,s),n.subVectors(a.c,s),i.subVectors(e,t),r.subVectors(n,e),o.subVectors(t,n);var h=[0,-i.z,i.y,0,-r.z,r.y,0,-o.z,o.y,i.z,0,-i.x,r.z,0,-r.x,o.z,0,-o.x,-i.y,i.x,0,-r.y,r.x,0,-o.y,o.x,0];return!!u(h)&&(!!u(h=[1,0,0,0,1,0,0,0,1])&&(l.crossVectors(i,r),u(h=[l.x,l.y,l.z])))}}(),clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new Ye),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new Ye;return function(e){return t.copy(e).clamp(this.min,this.max).sub(e).length()}}(),getBoundingSphere:function(){var t=new Ye;return function(e){return void 0===e&&(console.warn("THREE.Box3: .getBoundingSphere() target is now required"),e=new un),this.getCenter(e.center),e.radius=.5*this.getSize(t).length(),e}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:(Ze=[new Ye,new Ye,new Ye,new Ye,new Ye,new Ye,new Ye,new Ye],function(t){return this.isEmpty()?this:(Ze[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Ze[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Ze[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Ze[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Ze[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Ze[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Ze[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Ze[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Ze),this)}),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Object.assign(un.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:(Qe=new ln,function(t,e){var n=this.center;void 0!==e?n.copy(e):Qe.setFromPoints(t).getCenter(n);for(var i=0,r=0,o=t.length;r<o;r++)i=Math.max(i,n.distanceToSquared(t[r]));return this.radius=Math.sqrt(i),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,e){var n=this.center.distanceToSquared(t);return void 0===e&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),e=new Ye),e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new ln),t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}}),Object.assign(hn.prototype,{set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(){var t=new Ye,e=new Ye;return function(n,i,r){var o=t.subVectors(r,i).cross(e.subVectors(n,i)).normalize();return this.setFromNormalAndCoplanarPoint(o,n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new Ye),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(){var t=new Ye;return function(e,n){void 0===n&&(console.warn("THREE.Plane: .intersectLine() target is now required"),n=new Ye);var i=e.delta(t),r=this.normal.dot(i);if(0===r)return 0===this.distanceToPoint(e.start)?n.copy(e.start):void 0;var o=-(e.start.dot(this.normal)+this.constant)/r;return o<0||o>1?void 0:n.copy(i).multiplyScalar(o).add(e.start)}}(),intersectsLine:function(t){var e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new Ye),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var t=new Ye,e=new Ke;return function(n,i){var r=i||e.getNormalMatrix(n),o=this.coplanarPoint(t).applyMatrix4(n),a=this.normal.applyMatrix3(r).normalize();return this.constant=-o.dot(a),this}}(),translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}}),Object.assign(dn.prototype,{set:function(t,e,n,i,r,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(r),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,n=0;n<6;n++)e[n].copy(t.planes[n]);return this},setFromMatrix:function(t){var e=this.planes,n=t.elements,i=n[0],r=n[1],o=n[2],a=n[3],s=n[4],c=n[5],l=n[6],u=n[7],h=n[8],d=n[9],f=n[10],p=n[11],m=n[12],g=n[13],_=n[14],v=n[15];return e[0].setComponents(a-i,u-s,p-h,v-m).normalize(),e[1].setComponents(a+i,u+s,p+h,v+m).normalize(),e[2].setComponents(a+r,u+c,p+d,v+g).normalize(),e[3].setComponents(a-r,u-c,p-d,v-g).normalize(),e[4].setComponents(a-o,u-l,p-f,v-_).normalize(),e[5].setComponents(a+o,u+l,p+f,v+_).normalize(),this},intersectsObject:(en=new un,function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),en.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(en)}),intersectsSprite:function(){var t=new un;return function(e){return t.center.set(0,0,0),t.radius=.7071067811865476,t.applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSphere:function(t){for(var e=this.planes,n=t.center,i=-t.radius,r=0;r<6;r++){if(e[r].distanceToPoint(n)<i)return!1}return!0},intersectsBox:($e=new Ye,tn=new Ye,function(t){for(var e=this.planes,n=0;n<6;n++){var i=e[n];$e.x=i.normal.x>0?t.min.x:t.max.x,tn.x=i.normal.x>0?t.max.x:t.min.x,$e.y=i.normal.y>0?t.min.y:t.max.y,tn.y=i.normal.y>0?t.max.y:t.min.y,$e.z=i.normal.z>0?t.min.z:t.max.z,tn.z=i.normal.z>0?t.max.z:t.min.z;var r=i.distanceToPoint($e),o=i.distanceToPoint(tn);if(r<0&&o<0)return!1}return!0}),containsPoint:function(t){for(var e=this.planes,n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}});var fn,pn={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"\nvec3 transformed = vec3( position );\n",beginnormal_vertex:"\nvec3 objectNormal = vec3( normal );\n",bsdfs:"float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t}\n\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif\n",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\n",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif\n",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",encodings_fragment:" gl_FragColor = linearToOutputTexel( gl_FragColor );\n",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract(Le);\n\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n\treturn vec4( max(vRGB, 0.0), 1.0 );\n}\n",envmap_fragment:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif\n",envmap_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif\n",fog_vertex:"\n#ifdef USE_FOG\nfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n varying float fogDepth;\n#endif\n",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif\n",gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif\n",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",lights_pars_begin:"uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n",lights_pars_maps:"#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif\n",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearCoatRadiance = vec3( 0.0 );\n#endif\n",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), maxMipLevel );\n\t#ifndef STANDARD\n\t\tclearCoatRadiance += getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), maxMipLevel );\n\t#endif\n#endif\n",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\tgl_Position.z *= gl_Position.w;\n\t#endif\n#endif\n",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",map_particle_fragment:"#ifdef USE_MAP\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\n#endif\n",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif\n",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n#endif\n",normal_fragment_maps:"#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;\n",dithering_fragment:"#if defined( DITHERING )\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif\n",dithering_pars_fragment:"#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif\n",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif\n",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif\n",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",tonemapping_pars_fragment:"#ifndef saturate\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\n",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif\n",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n",cube_vert:"varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}\n",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\n",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}\n",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}\n",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}\n",equirect_vert:"varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}\n",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}\n",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_pars_maps>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_pars_maps>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_pars_maps>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",meshphysical_frag:"#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars_begin>\n#include <lights_pars_maps>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}\n",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}\n",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <fog_fragment>\n}\n",shadow_vert:"#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n"},mn={merge:function(t){for(var e={},n=0;n<t.length;n++){var i=this.clone(t[n]);for(var r in i)e[r]=i[r]}return e},clone:function(t){var e={};for(var n in t)for(var i in e[n]={},t[n]){var r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}return e}},gn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function _n(t,e,n){return void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}Object.assign(_n.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,n){return this.r=t,this.g=e,this.b=n,this},setHSL:function(){function t(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}return function(e,n,i){if(e=Ge.euclideanModulo(e,1),n=Ge.clamp(n,0,1),i=Ge.clamp(i,0,1),0===n)this.r=this.g=this.b=i;else{var r=i<=.5?i*(1+n):i+n-i*n,o=2*i-r;this.r=t(o,r,e+1/3),this.g=t(o,r,e),this.b=t(o,r,e-1/3)}return this}}(),setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var i,r=n[1],o=n[2];switch(r){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,e(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,e(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var a=parseFloat(i[1])/360,s=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return e(i[5]),this.setHSL(a,s,c)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(t)){var l,u=(l=n[1]).length;if(3===u)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===u)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}t&&t.length>0&&(void 0!==(l=gn[t])?this.setHex(l):console.warn("THREE.Color: Unknown color "+t));return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},convertGammaToLinear:function(){var t=this.r,e=this.g,n=this.b;return this.r=t*t,this.g=e*e,this.b=n*n,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var e,n,i=this.r,r=this.g,o=this.b,a=Math.max(i,r,o),s=Math.min(i,r,o),c=(s+a)/2;if(s===a)e=0,n=0;else{var l=a-s;switch(n=c<=.5?l/(a+s):l/(2-a-s),a){case i:e=(r-o)/l+(r<o?6:0);break;case r:e=(o-i)/l+2;break;case o:e=(i-r)/l+4}e/=6}return t.h=e,t.s=n,t.l=c,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:(fn={},function(t,e,n){return this.getHSL(fn),fn.h+=t,fn.s+=e,fn.l+=n,this.setHSL(fn.h,fn.s,fn.l),this}),add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},toJSON:function(){return this.getHex()}});var vn,bn={common:{diffuse:{value:new _n(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Ke},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new We(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new _n(16777215)}},lights:{ambientLightColor:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new _n(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new Ke}}},yn={basic:{uniforms:mn.merge([bn.common,bn.specularmap,bn.envmap,bn.aomap,bn.lightmap,bn.fog]),vertexShader:pn.meshbasic_vert,fragmentShader:pn.meshbasic_frag},lambert:{uniforms:mn.merge([bn.common,bn.specularmap,bn.envmap,bn.aomap,bn.lightmap,bn.emissivemap,bn.fog,bn.lights,{emissive:{value:new _n(0)}}]),vertexShader:pn.meshlambert_vert,fragmentShader:pn.meshlambert_frag},phong:{uniforms:mn.merge([bn.common,bn.specularmap,bn.envmap,bn.aomap,bn.lightmap,bn.emissivemap,bn.bumpmap,bn.normalmap,bn.displacementmap,bn.gradientmap,bn.fog,bn.lights,{emissive:{value:new _n(0)},specular:{value:new _n(1118481)},shininess:{value:30}}]),vertexShader:pn.meshphong_vert,fragmentShader:pn.meshphong_frag},standard:{uniforms:mn.merge([bn.common,bn.envmap,bn.aomap,bn.lightmap,bn.emissivemap,bn.bumpmap,bn.normalmap,bn.displacementmap,bn.roughnessmap,bn.metalnessmap,bn.fog,bn.lights,{emissive:{value:new _n(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:pn.meshphysical_vert,fragmentShader:pn.meshphysical_frag},points:{uniforms:mn.merge([bn.points,bn.fog]),vertexShader:pn.points_vert,fragmentShader:pn.points_frag},dashed:{uniforms:mn.merge([bn.common,bn.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:pn.linedashed_vert,fragmentShader:pn.linedashed_frag},depth:{uniforms:mn.merge([bn.common,bn.displacementmap]),vertexShader:pn.depth_vert,fragmentShader:pn.depth_frag},normal:{uniforms:mn.merge([bn.common,bn.bumpmap,bn.normalmap,bn.displacementmap,{opacity:{value:1}}]),vertexShader:pn.normal_vert,fragmentShader:pn.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:pn.cube_vert,fragmentShader:pn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:pn.equirect_vert,fragmentShader:pn.equirect_frag},distanceRGBA:{uniforms:mn.merge([bn.common,bn.displacementmap,{referencePosition:{value:new Ye},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:pn.distanceRGBA_vert,fragmentShader:pn.distanceRGBA_frag},shadow:{uniforms:mn.merge([bn.lights,bn.fog,{color:{value:new _n(0)},opacity:{value:1}}]),vertexShader:pn.shadow_vert,fragmentShader:pn.shadow_frag}};function xn(t){var e=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),e.get(t)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);var i=e.get(n);i&&(t.deleteBuffer(i.buffer),e.delete(n))},update:function(n,i){n.isInterleavedBufferAttribute&&(n=n.data);var r=e.get(n);void 0===r?e.set(n,function(e,n){var i=e.array,r=e.dynamic?t.DYNAMIC_DRAW:t.STATIC_DRAW,o=t.createBuffer();t.bindBuffer(n,o),t.bufferData(n,i,r),e.onUploadCallback();var a=t.FLOAT;return i instanceof Float32Array?a=t.FLOAT:i instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):i instanceof Uint16Array?a=t.UNSIGNED_SHORT:i instanceof Int16Array?a=t.SHORT:i instanceof Uint32Array?a=t.UNSIGNED_INT:i instanceof Int32Array?a=t.INT:i instanceof Int8Array?a=t.BYTE:i instanceof Uint8Array&&(a=t.UNSIGNED_BYTE),{buffer:o,type:a,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version}}(n,i)):r.version<n.version&&(function(e,n,i){var r=n.array,o=n.updateRange;t.bindBuffer(i,e),!1===n.dynamic?t.bufferData(i,r,t.STATIC_DRAW):-1===o.count?t.bufferSubData(i,0,r):0===o.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(t.bufferSubData(i,o.offset*r.BYTES_PER_ELEMENT,r.subarray(o.offset,o.offset+o.count)),o.count=-1)}(r.buffer,n,i),r.version=n.version)}}}function wn(t,e,n,i){this._x=t||0,this._y=e||0,this._z=n||0,this._order=i||wn.DefaultOrder}function Mn(){this.mask=1}yn.physical={uniforms:mn.merge([yn.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:pn.meshphysical_vert,fragmentShader:pn.meshphysical_frag},wn.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],wn.DefaultOrder="XYZ",Object.defineProperties(wn.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback()}}}),Object.assign(wn.prototype,{isEuler:!0,set:function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._order=i||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this.onChangeCallback(),this},setFromRotationMatrix:function(t,e,n){var i=Ge.clamp,r=t.elements,o=r[0],a=r[4],s=r[8],c=r[1],l=r[5],u=r[9],h=r[2],d=r[6],f=r[10];return"XYZ"===(e=e||this._order)?(this._y=Math.asin(i(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(d,l),this._z=0)):"YXZ"===e?(this._x=Math.asin(-i(u,-1,1)),Math.abs(u)<.99999?(this._y=Math.atan2(s,f),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-h,o),this._z=0)):"ZXY"===e?(this._x=Math.asin(i(d,-1,1)),Math.abs(d)<.99999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(c,o))):"ZYX"===e?(this._y=Math.asin(-i(h,-1,1)),Math.abs(h)<.99999?(this._x=Math.atan2(d,f),this._z=Math.atan2(c,o)):(this._x=0,this._z=Math.atan2(-a,l))):"YZX"===e?(this._z=Math.asin(i(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(s,f))):"XZY"===e?(this._z=Math.asin(-i(a,-1,1)),Math.abs(a)<.99999?(this._x=Math.atan2(d,l),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-u,f),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,!1!==n&&this.onChangeCallback(),this},setFromQuaternion:function(){var t=new Ve;return function(e,n,i){return t.makeRotationFromQuaternion(e),this.setFromRotationMatrix(t,n,i)}}(),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:(vn=new Xe,function(t){return vn.setFromEuler(this),this.setFromQuaternion(vn,t)}),equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new Ye(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(Mn.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},test:function(t){return 0!=(this.mask&t.mask)}});var En,Sn,An,Tn,kn=0;function Pn(){Object.defineProperty(this,"id",{value:kn++}),this.uuid=Ge.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Pn.DefaultUp.clone();var t=new Ye,e=new wn,n=new Xe,i=new Ye(1,1,1);e.onChange(function(){n.setFromEuler(e,!1)}),n.onChange(function(){e.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{enumerable:!0,value:t},rotation:{enumerable:!0,value:e},quaternion:{enumerable:!0,value:n},scale:{enumerable:!0,value:i},modelViewMatrix:{value:new Ve},normalMatrix:{value:new Ke}}),this.matrix=new Ve,this.matrixWorld=new Ve,this.matrixAutoUpdate=Pn.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Mn,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function Ln(){Pn.call(this),this.type="Camera",this.matrixWorldInverse=new Ve,this.projectionMatrix=new Ve}function On(t,e,n,i,r,o){Ln.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=void 0!==r?r:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}function Cn(t,e,n,i,r,o){this.a=t,this.b=e,this.c=n,this.normal=i&&i.isVector3?i:new Ye,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new _n,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==o?o:0}Pn.DefaultUp=new Ye(0,1,0),Pn.DefaultMatrixAutoUpdate=!0,Pn.prototype=Object.assign(Object.create(i.prototype),{constructor:Pn,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(t){this.matrix.multiplyMatrices(t,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:(Tn=new Xe,function(t,e){return Tn.setFromAxisAngle(t,e),this.quaternion.multiply(Tn),this}),rotateOnWorldAxis:function(){var t=new Xe;return function(e,n){return t.setFromAxisAngle(e,n),this.quaternion.premultiply(t),this}}(),rotateX:function(){var t=new Ye(1,0,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateY:function(){var t=new Ye(0,1,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateZ:function(){var t=new Ye(0,0,1);return function(e){return this.rotateOnAxis(t,e)}}(),translateOnAxis:function(){var t=new Ye;return function(e,n){return t.copy(e).applyQuaternion(this.quaternion),this.position.add(t.multiplyScalar(n)),this}}(),translateX:function(){var t=new Ye(1,0,0);return function(e){return this.translateOnAxis(t,e)}}(),translateY:function(){var t=new Ye(0,1,0);return function(e){return this.translateOnAxis(t,e)}}(),translateZ:function(){var t=new Ye(0,0,1);return function(e){return this.translateOnAxis(t,e)}}(),localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:(An=new Ve,function(t){return t.applyMatrix4(An.getInverse(this.matrixWorld))}),lookAt:function(){var t=new Ve,e=new Ye;return function(n,i,r){n.isVector3?e.copy(n):e.set(n,i,r),this.isCamera?t.lookAt(this.position,e,this.up):t.lookAt(e,this.position,this.up),this.quaternion.setFromRotationMatrix(t)}}(),add:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,t.dispatchEvent({type:"added"}),this.children.push(t)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)},remove:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var n=this.children.indexOf(t);return-1!==n&&(t.parent=null,t.dispatchEvent({type:"removed"}),this.children.splice(n,1)),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var n=0,i=this.children.length;n<i;n++){var r=this.children[n].getObjectByProperty(t,e);if(void 0!==r)return r}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new Ye),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:(En=new Ye,Sn=new Ye,function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),t=new Xe),this.updateMatrixWorld(!0),this.matrixWorld.decompose(En,t,Sn),t}),getWorldScale:function(){var t=new Ye,e=new Xe;return function(n){return void 0===n&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),n=new Ye),this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,e,n),n}}(),getWorldDirection:function(){var t=new Xe;return function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),e=new Ye),this.getWorldQuaternion(t),e.set(0,0,1).applyQuaternion(t)}}(),raycast:function(){},traverse:function(t){t(this);for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].updateMatrixWorld(t)},toJSON:function(t){var e=void 0===t||"string"==typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var i={};function r(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),i.matrix=this.matrix.toArray(),void 0!==this.geometry){i.geometry=r(t.geometries,this.geometry);var o=this.geometry.parameters;if(void 0!==o&&void 0!==o.shapes){var a=o.shapes;if(Array.isArray(a))for(var s=0,c=a.length;s<c;s++){var l=a[s];r(t.shapes,l)}else r(t.shapes,a)}}if(void 0!==this.material)if(Array.isArray(this.material)){var u=[];for(s=0,c=this.material.length;s<c;s++)u.push(r(t.materials,this.material[s]));i.material=u}else i.material=r(t.materials,this.material);if(this.children.length>0){i.children=[];for(s=0;s<this.children.length;s++)i.children.push(this.children[s].toJSON(t).object)}if(e){var h=m(t.geometries),d=m(t.materials),f=m(t.textures),p=m(t.images);a=m(t.shapes);h.length>0&&(n.geometries=h),d.length>0&&(n.materials=d),f.length>0&&(n.textures=f),p.length>0&&(n.images=p),a.length>0&&(n.shapes=a)}return n.object=i,n;function m(t){var e=[];for(var n in t){var i=t[n];delete i.metadata,e.push(i)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var n=0;n<t.children.length;n++){var i=t.children[n];this.add(i.clone())}return this}}),Ln.prototype=Object.assign(Object.create(Pn.prototype),{constructor:Ln,isCamera:!0,copy:function(t,e){return Pn.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this},getWorldDirection:function(){var t=new Xe;return function(e){return void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new Ye),this.getWorldQuaternion(t),e.set(0,0,-1).applyQuaternion(t)}}(),updateMatrixWorld:function(t){Pn.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),On.prototype=Object.assign(Object.create(Ln.prototype),{constructor:On,isOrthographicCamera:!0,copy:function(t,e){return Ln.prototype.copy.call(this,t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,n,i,r,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,r=n-t,o=n+t,a=i+e,s=i-e;if(null!==this.view&&this.view.enabled){var c=this.zoom/(this.view.width/this.view.fullWidth),l=this.zoom/(this.view.height/this.view.fullHeight),u=(this.right-this.left)/this.view.width,h=(this.top-this.bottom)/this.view.height;o=(r+=u*(this.view.offsetX/c))+u*(this.view.width/c),s=(a-=h*(this.view.offsetY/l))-h*(this.view.height/l)}this.projectionMatrix.makeOrthographic(r,o,a,s,this.near,this.far)},toJSON:function(t){var e=Pn.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),Object.assign(Cn.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,n=t.vertexNormals.length;e<n;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(e=0,n=t.vertexColors.length;e<n;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}});var Rn,In,zn=0;function Bn(){Object.defineProperty(this,"id",{value:zn+=2}),this.uuid=Ge.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}function Nn(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function Dn(t,e,n){Nn.call(this,new Int8Array(t),e,n)}function jn(t,e,n){Nn.call(this,new Uint8Array(t),e,n)}function Un(t,e,n){Nn.call(this,new Uint8ClampedArray(t),e,n)}function Fn(t,e,n){Nn.call(this,new Int16Array(t),e,n)}function Hn(t,e,n){Nn.call(this,new Uint16Array(t),e,n)}function qn(t,e,n){Nn.call(this,new Int32Array(t),e,n)}function Gn(t,e,n){Nn.call(this,new Uint32Array(t),e,n)}function Wn(t,e,n){Nn.call(this,new Float32Array(t),e,n)}function Vn(t,e,n){Nn.call(this,new Float64Array(t),e,n)}function Xn(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function Yn(t){if(0===t.length)return-1/0;for(var e=t[0],n=1,i=t.length;n<i;++n)t[n]>e&&(e=t[n]);return e}Bn.prototype=Object.assign(Object.create(i.prototype),{constructor:Bn,isGeometry:!0,applyMatrix:function(t){for(var e=(new Ke).getNormalMatrix(t),n=0,i=this.vertices.length;n<i;n++){this.vertices[n].applyMatrix4(t)}for(n=0,i=this.faces.length;n<i;n++){var r=this.faces[n];r.normal.applyMatrix3(e).normalize();for(var o=0,a=r.vertexNormals.length;o<a;o++)r.vertexNormals[o].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var t=new Ve;return function(e){return t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t=new Ve;return function(e){return t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t=new Ve;return function(e){return t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t=new Ve;return function(e,n,i){return t.makeTranslation(e,n,i),this.applyMatrix(t),this}}(),scale:function(){var t=new Ve;return function(e,n,i){return t.makeScale(e,n,i),this.applyMatrix(t),this}}(),lookAt:(In=new Pn,function(t){In.lookAt(t),In.updateMatrix(),this.applyMatrix(In.matrix)}),fromBufferGeometry:function(t){var e=this,n=null!==t.index?t.index.array:void 0,i=t.attributes,r=i.position.array,o=void 0!==i.normal?i.normal.array:void 0,a=void 0!==i.color?i.color.array:void 0,s=void 0!==i.uv?i.uv.array:void 0,c=void 0!==i.uv2?i.uv2.array:void 0;void 0!==c&&(this.faceVertexUvs[1]=[]);for(var l=[],u=[],h=[],d=0,f=0;d<r.length;d+=3,f+=2)e.vertices.push(new Ye(r[d],r[d+1],r[d+2])),void 0!==o&&l.push(new Ye(o[d],o[d+1],o[d+2])),void 0!==a&&e.colors.push(new _n(a[d],a[d+1],a[d+2])),void 0!==s&&u.push(new We(s[f],s[f+1])),void 0!==c&&h.push(new We(c[f],c[f+1]));function p(t,n,i,r){var d=new Cn(t,n,i,void 0!==o?[l[t].clone(),l[n].clone(),l[i].clone()]:[],void 0!==a?[e.colors[t].clone(),e.colors[n].clone(),e.colors[i].clone()]:[],r);e.faces.push(d),void 0!==s&&e.faceVertexUvs[0].push([u[t].clone(),u[n].clone(),u[i].clone()]),void 0!==c&&e.faceVertexUvs[1].push([h[t].clone(),h[n].clone(),h[i].clone()])}var m=t.groups;if(m.length>0)for(d=0;d<m.length;d++)for(var g=m[d],_=g.start,v=(f=_,_+g.count);f<v;f+=3)void 0!==n?p(n[f],n[f+1],n[f+2],g.materialIndex):p(f,f+1,f+2,g.materialIndex);else if(void 0!==n)for(d=0;d<n.length;d+=3)p(n[d],n[d+1],n[d+2]);else for(d=0;d<r.length/3;d+=3)p(d,d+1,d+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:(Rn=new Ye,function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Rn).negate(),this.translate(Rn.x,Rn.y,Rn.z),this}),normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,n=0===e?1:1/e,i=new Ve;return i.set(n,0,0,-n*t.x,0,n,0,-n*t.y,0,0,n,-n*t.z,0,0,0,1),this.applyMatrix(i),this},computeFaceNormals:function(){for(var t=new Ye,e=new Ye,n=0,i=this.faces.length;n<i;n++){var r=this.faces[n],o=this.vertices[r.a],a=this.vertices[r.b],s=this.vertices[r.c];t.subVectors(s,a),e.subVectors(o,a),t.cross(e),t.normalize(),r.normal.copy(t)}},computeVertexNormals:function(t){var e,n,i,r,o,a;for(void 0===t&&(t=!0),a=new Array(this.vertices.length),e=0,n=this.vertices.length;e<n;e++)a[e]=new Ye;if(t){var s,c,l,u=new Ye,h=new Ye;for(i=0,r=this.faces.length;i<r;i++)o=this.faces[i],s=this.vertices[o.a],c=this.vertices[o.b],l=this.vertices[o.c],u.subVectors(l,c),h.subVectors(s,c),u.cross(h),a[o.a].add(u),a[o.b].add(u),a[o.c].add(u)}else for(this.computeFaceNormals(),i=0,r=this.faces.length;i<r;i++)a[(o=this.faces[i]).a].add(o.normal),a[o.b].add(o.normal),a[o.c].add(o.normal);for(e=0,n=this.vertices.length;e<n;e++)a[e].normalize();for(i=0,r=this.faces.length;i<r;i++){var d=(o=this.faces[i]).vertexNormals;3===d.length?(d[0].copy(a[o.a]),d[1].copy(a[o.b]),d[2].copy(a[o.c])):(d[0]=a[o.a].clone(),d[1]=a[o.b].clone(),d[2]=a[o.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,n;for(this.computeFaceNormals(),t=0,e=this.faces.length;t<e;t++){var i=(n=this.faces[t]).vertexNormals;3===i.length?(i[0].copy(n.normal),i[1].copy(n.normal),i[2].copy(n.normal)):(i[0]=n.normal.clone(),i[1]=n.normal.clone(),i[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,n,i,r;for(n=0,i=this.faces.length;n<i;n++)for((r=this.faces[n]).__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),t=0,e=r.vertexNormals.length;t<e;t++)r.__originalVertexNormals[t]?r.__originalVertexNormals[t].copy(r.vertexNormals[t]):r.__originalVertexNormals[t]=r.vertexNormals[t].clone();var o=new Bn;for(o.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];var a=this.morphNormals[t].faceNormals,s=this.morphNormals[t].vertexNormals;for(n=0,i=this.faces.length;n<i;n++)c=new Ye,l={a:new Ye,b:new Ye,c:new Ye},a.push(c),s.push(l)}var c,l,u=this.morphNormals[t];for(o.vertices=this.morphTargets[t].vertices,o.computeFaceNormals(),o.computeVertexNormals(),n=0,i=this.faces.length;n<i;n++)r=this.faces[n],c=u.faceNormals[n],l=u.vertexNormals[n],c.copy(r.normal),l.a.copy(r.vertexNormals[0]),l.b.copy(r.vertexNormals[1]),l.c.copy(r.vertexNormals[2])}for(n=0,i=this.faces.length;n<i;n++)(r=this.faces[n]).normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new ln),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new un),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,n){if(t&&t.isGeometry){var i,r=this.vertices.length,o=this.vertices,a=t.vertices,s=this.faces,c=t.faces,l=this.faceVertexUvs[0],u=t.faceVertexUvs[0],h=this.colors,d=t.colors;void 0===n&&(n=0),void 0!==e&&(i=(new Ke).getNormalMatrix(e));for(var f=0,p=a.length;f<p;f++){var m=a[f].clone();void 0!==e&&m.applyMatrix4(e),o.push(m)}for(f=0,p=d.length;f<p;f++)h.push(d[f].clone());for(f=0,p=c.length;f<p;f++){var g,_,v,b=c[f],y=b.vertexNormals,x=b.vertexColors;(g=new Cn(b.a+r,b.b+r,b.c+r)).normal.copy(b.normal),void 0!==i&&g.normal.applyMatrix3(i).normalize();for(var w=0,M=y.length;w<M;w++)_=y[w].clone(),void 0!==i&&_.applyMatrix3(i).normalize(),g.vertexNormals.push(_);g.color.copy(b.color);for(w=0,M=x.length;w<M;w++)v=x[w],g.vertexColors.push(v.clone());g.materialIndex=b.materialIndex+n,s.push(g)}for(f=0,p=u.length;f<p;f++){var E=u[f],S=[];if(void 0!==E){for(w=0,M=E.length;w<M;w++)S.push(E[w].clone());l.push(S)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t)},mergeMesh:function(t){t&&t.isMesh?(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t)},mergeVertices:function(){var t,e,n,i,r,o,a,s,c={},l=[],u=[],h=Math.pow(10,4);for(n=0,i=this.vertices.length;n<i;n++)t=this.vertices[n],void 0===c[e=Math.round(t.x*h)+"_"+Math.round(t.y*h)+"_"+Math.round(t.z*h)]?(c[e]=n,l.push(this.vertices[n]),u[n]=l.length-1):u[n]=u[c[e]];var d=[];for(n=0,i=this.faces.length;n<i;n++){(r=this.faces[n]).a=u[r.a],r.b=u[r.b],r.c=u[r.c],o=[r.a,r.b,r.c];for(var f=0;f<3;f++)if(o[f]===o[(f+1)%3]){d.push(n);break}}for(n=d.length-1;n>=0;n--){var p=d[n];for(this.faces.splice(p,1),a=0,s=this.faceVertexUvs.length;a<s;a++)this.faceVertexUvs[a].splice(p,1)}var m=this.vertices.length-l.length;return this.vertices=l,m},setFromPoints:function(t){this.vertices=[];for(var e=0,n=t.length;e<n;e++){var i=t[e];this.vertices.push(new Ye(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){for(var t=this.faces,e=t.length,n=0;n<e;n++)t[n]._id=n;t.sort(function(t,e){return t.materialIndex-e.materialIndex});var i,r,o=this.faceVertexUvs[0],a=this.faceVertexUvs[1];o&&o.length===e&&(i=[]),a&&a.length===e&&(r=[]);for(n=0;n<e;n++){var s=t[n]._id;i&&i.push(o[s]),r&&r.push(a[s])}i&&(this.faceVertexUvs[0]=i),r&&(this.faceVertexUvs[1]=r)},toJSON:function(){var t={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}for(var i=[],r=0;r<this.vertices.length;r++){var o=this.vertices[r];i.push(o.x,o.y,o.z)}var a=[],s=[],c={},l=[],u={},h=[],d={};for(r=0;r<this.faces.length;r++){var f=this.faces[r],p=void 0!==this.faceVertexUvs[0][r],m=f.normal.length()>0,g=f.vertexNormals.length>0,_=1!==f.color.r||1!==f.color.g||1!==f.color.b,v=f.vertexColors.length>0,b=0;if(b=M(b,0,0),b=M(b,1,!0),b=M(b,2,!1),b=M(b,3,p),b=M(b,4,m),b=M(b,5,g),b=M(b,6,_),b=M(b,7,v),a.push(b),a.push(f.a,f.b,f.c),a.push(f.materialIndex),p){var y=this.faceVertexUvs[0][r];a.push(A(y[0]),A(y[1]),A(y[2]))}if(m&&a.push(E(f.normal)),g){var x=f.vertexNormals;a.push(E(x[0]),E(x[1]),E(x[2]))}if(_&&a.push(S(f.color)),v){var w=f.vertexColors;a.push(S(w[0]),S(w[1]),S(w[2]))}}function M(t,e,n){return n?t|1<<e:t&~(1<<e)}function E(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==c[e]?c[e]:(c[e]=s.length/3,s.push(t.x,t.y,t.z),c[e])}function S(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==u[e]?u[e]:(u[e]=l.length,l.push(t.getHex()),u[e])}function A(t){var e=t.x.toString()+t.y.toString();return void 0!==d[e]?d[e]:(d[e]=h.length/2,h.push(t.x,t.y),d[e])}return t.data={},t.data.vertices=i,t.data.normals=s,l.length>0&&(t.data.colors=l),h.length>0&&(t.data.uvs=[h]),t.data.faces=a,t},clone:function(){return(new Bn).copy(this)},copy:function(t){var e,n,i,r,o,a;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var s=t.vertices;for(e=0,n=s.length;e<n;e++)this.vertices.push(s[e].clone());var c=t.colors;for(e=0,n=c.length;e<n;e++)this.colors.push(c[e].clone());var l=t.faces;for(e=0,n=l.length;e<n;e++)this.faces.push(l[e].clone());for(e=0,n=t.faceVertexUvs.length;e<n;e++){var u=t.faceVertexUvs[e];for(void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]),i=0,r=u.length;i<r;i++){var h=u[i],d=[];for(o=0,a=h.length;o<a;o++){var f=h[o];d.push(f.clone())}this.faceVertexUvs[e].push(d)}}var p=t.morphTargets;for(e=0,n=p.length;e<n;e++){var m={};if(m.name=p[e].name,void 0!==p[e].vertices)for(m.vertices=[],i=0,r=p[e].vertices.length;i<r;i++)m.vertices.push(p[e].vertices[i].clone());if(void 0!==p[e].normals)for(m.normals=[],i=0,r=p[e].normals.length;i<r;i++)m.normals.push(p[e].normals[i].clone());this.morphTargets.push(m)}var g=t.morphNormals;for(e=0,n=g.length;e<n;e++){var _={};if(void 0!==g[e].vertexNormals)for(_.vertexNormals=[],i=0,r=g[e].vertexNormals.length;i<r;i++){var v=g[e].vertexNormals[i],b={};b.a=v.a.clone(),b.b=v.b.clone(),b.c=v.c.clone(),_.vertexNormals.push(b)}if(void 0!==g[e].faceNormals)for(_.faceNormals=[],i=0,r=g[e].faceNormals.length;i<r;i++)_.faceNormals.push(g[e].faceNormals[i].clone());this.morphNormals.push(_)}var y=t.skinWeights;for(e=0,n=y.length;e<n;e++)this.skinWeights.push(y[e].clone());var x=t.skinIndices;for(e=0,n=x.length;e<n;e++)this.skinIndices.push(x[e].clone());var w=t.lineDistances;for(e=0,n=w.length;e<n;e++)this.lineDistances.push(w[e]);var M=t.boundingBox;null!==M&&(this.boundingBox=M.clone());var E=t.boundingSphere;return null!==E&&(this.boundingSphere=E.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Nn.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Nn.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==t?t.length/this.itemSize:0,this.array=t},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.dynamic=t.dynamic,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(var i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),o=new _n),e[n++]=o.r,e[n++]=o.g,e[n++]=o.b}return this},copyVector2sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),o=new We),e[n++]=o.x,e[n++]=o.y}return this},copyVector3sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),o=new Ye),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z}return this},copyVector4sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),o=new on),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z,e[n++]=o.w}return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this},setXYZ:function(t,e,n,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this},setXYZW:function(t,e,n,i,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),Dn.prototype=Object.create(Nn.prototype),Dn.prototype.constructor=Dn,jn.prototype=Object.create(Nn.prototype),jn.prototype.constructor=jn,Un.prototype=Object.create(Nn.prototype),Un.prototype.constructor=Un,Fn.prototype=Object.create(Nn.prototype),Fn.prototype.constructor=Fn,Hn.prototype=Object.create(Nn.prototype),Hn.prototype.constructor=Hn,qn.prototype=Object.create(Nn.prototype),qn.prototype.constructor=qn,Gn.prototype=Object.create(Nn.prototype),Gn.prototype.constructor=Gn,Wn.prototype=Object.create(Nn.prototype),Wn.prototype.constructor=Wn,Vn.prototype=Object.create(Nn.prototype),Vn.prototype.constructor=Vn,Object.assign(Xn.prototype,{computeGroups:function(t){for(var e,n=[],i=void 0,r=t.faces,o=0;o<r.length;o++){var a=r[o];a.materialIndex!==i&&(i=a.materialIndex,void 0!==e&&(e.count=3*o-e.start,n.push(e)),e={start:3*o,materialIndex:i})}void 0!==e&&(e.count=3*o-e.start,n.push(e)),this.groups=n},fromGeometry:function(t){var e,n=t.faces,i=t.vertices,r=t.faceVertexUvs,o=r[0]&&r[0].length>0,a=r[1]&&r[1].length>0,s=t.morphTargets,c=s.length;if(c>0){e=[];for(var l=0;l<c;l++)e[l]=[];this.morphTargets.position=e}var u,h=t.morphNormals,d=h.length;if(d>0){u=[];for(l=0;l<d;l++)u[l]=[];this.morphTargets.normal=u}var f=t.skinIndices,p=t.skinWeights,m=f.length===i.length,g=p.length===i.length;for(l=0;l<n.length;l++){var _=n[l];this.vertices.push(i[_.a],i[_.b],i[_.c]);var v=_.vertexNormals;if(3===v.length)this.normals.push(v[0],v[1],v[2]);else{var b=_.normal;this.normals.push(b,b,b)}var y,x=_.vertexColors;if(3===x.length)this.colors.push(x[0],x[1],x[2]);else{var w=_.color;this.colors.push(w,w,w)}if(!0===o)void 0!==(y=r[0][l])?this.uvs.push(y[0],y[1],y[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new We,new We,new We));if(!0===a)void 0!==(y=r[1][l])?this.uvs2.push(y[0],y[1],y[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",l),this.uvs2.push(new We,new We,new We));for(var M=0;M<c;M++){var E=s[M].vertices;e[M].push(E[_.a],E[_.b],E[_.c])}for(M=0;M<d;M++){var S=h[M].vertexNormals[l];u[M].push(S.a,S.b,S.c)}m&&this.skinIndices.push(f[_.a],f[_.b],f[_.c]),g&&this.skinWeights.push(p[_.a],p[_.b],p[_.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this}});var Kn=1;function Zn(){Object.defineProperty(this,"id",{value:Kn+=2}),this.uuid=Ge.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0}}function Jn(t,e,n,i,r,o){Bn.call(this),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:o},this.fromBufferGeometry(new Qn(t,e,n,i,r,o)),this.mergeVertices()}function Qn(t,e,n,i,r,o){Zn.call(this),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:o};var a=this;t=t||1,e=e||1,n=n||1,i=Math.floor(i)||1,r=Math.floor(r)||1,o=Math.floor(o)||1;var s=[],c=[],l=[],u=[],h=0,d=0;function f(t,e,n,i,r,o,f,p,m,g,_){var v,b,y=o/m,x=f/g,w=o/2,M=f/2,E=p/2,S=m+1,A=g+1,T=0,k=0,P=new Ye;for(b=0;b<A;b++){var L=b*x-M;for(v=0;v<S;v++){var O=v*y-w;P[t]=O*i,P[e]=L*r,P[n]=E,c.push(P.x,P.y,P.z),P[t]=0,P[e]=0,P[n]=p>0?1:-1,l.push(P.x,P.y,P.z),u.push(v/m),u.push(1-b/g),T+=1}}for(b=0;b<g;b++)for(v=0;v<m;v++){var C=h+v+S*b,R=h+v+S*(b+1),I=h+(v+1)+S*(b+1),z=h+(v+1)+S*b;s.push(C,R,z),s.push(R,I,z),k+=6}a.addGroup(d,k,_),d+=k,h+=T}f("z","y","x",-1,-1,n,e,t,o,r,0),f("z","y","x",1,-1,n,e,-t,o,r,1),f("x","z","y",1,1,t,n,e,i,o,2),f("x","z","y",1,-1,t,n,-e,i,o,3),f("x","y","z",1,-1,t,e,n,i,r,4),f("x","y","z",-1,-1,t,e,-n,i,r,5),this.setIndex(s),this.addAttribute("position",new Wn(c,3)),this.addAttribute("normal",new Wn(l,3)),this.addAttribute("uv",new Wn(u,2))}function $n(t,e,n,i){Bn.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i},this.fromBufferGeometry(new ti(t,e,n,i)),this.mergeVertices()}function ti(t,e,n,i){Zn.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};var r,o,a=(t=t||1)/2,s=(e=e||1)/2,c=Math.floor(n)||1,l=Math.floor(i)||1,u=c+1,h=l+1,d=t/c,f=e/l,p=[],m=[],g=[],_=[];for(o=0;o<h;o++){var v=o*f-s;for(r=0;r<u;r++){var b=r*d-a;m.push(b,-v,0),g.push(0,0,1),_.push(r/c),_.push(1-o/l)}}for(o=0;o<l;o++)for(r=0;r<c;r++){var y=r+u*o,x=r+u*(o+1),w=r+1+u*(o+1),M=r+1+u*o;p.push(y,x,M),p.push(x,w,M)}this.setIndex(p),this.addAttribute("position",new Wn(m,3)),this.addAttribute("normal",new Wn(g,3)),this.addAttribute("uv",new Wn(_,2))}Zn.prototype=Object.assign(Object.create(i.prototype),{constructor:Zn,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(Yn(t)>65535?Gn:Hn)(t,1):this.index=t},addAttribute:function(t,e){return e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),void this.setIndex(e)):(this.attributes[t]=e,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),void this.addAttribute(t,new Nn(arguments[1],arguments[2])))},getAttribute:function(t){return this.attributes[t]},removeAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,n){this.groups.push({start:t,count:e,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix:function(t){var e=this.attributes.position;void 0!==e&&(t.applyToBufferAttribute(e),e.needsUpdate=!0);var n=this.attributes.normal;void 0!==n&&((new Ke).getNormalMatrix(t).applyToBufferAttribute(n),n.needsUpdate=!0);return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var t=new Ve;return function(e){return t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t=new Ve;return function(e){return t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t=new Ve;return function(e){return t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t=new Ve;return function(e,n,i){return t.makeTranslation(e,n,i),this.applyMatrix(t),this}}(),scale:function(){var t=new Ve;return function(e,n,i){return t.makeScale(e,n,i),this.applyMatrix(t),this}}(),lookAt:function(){var t=new Pn;return function(e){t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),center:function(){var t=new Ye;return function(){return this.computeBoundingBox(),this.boundingBox.getCenter(t).negate(),this.translate(t.x,t.y,t.z),this}}(),setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var n=new Wn(3*e.vertices.length,3),i=new Wn(3*e.colors.length,3);if(this.addAttribute("position",n.copyVector3sArray(e.vertices)),this.addAttribute("color",i.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var r=new Wn(e.lineDistances.length,1);this.addAttribute("lineDistance",r.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},setFromPoints:function(t){for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n];e.push(r.x,r.y,r.z||0)}return this.addAttribute("position",new Wn(e,3)),this},updateFromObject:function(t){var e,n=t.geometry;if(t.isMesh){var i=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(i=void 0,n.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(n);i.verticesNeedUpdate=n.verticesNeedUpdate,i.normalsNeedUpdate=n.normalsNeedUpdate,i.colorsNeedUpdate=n.colorsNeedUpdate,i.uvsNeedUpdate=n.uvsNeedUpdate,i.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=i}return!0===n.verticesNeedUpdate&&(void 0!==(e=this.attributes.position)&&(e.copyVector3sArray(n.vertices),e.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(e=this.attributes.normal)&&(e.copyVector3sArray(n.normals),e.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(e=this.attributes.color)&&(e.copyColorsArray(n.colors),e.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(e=this.attributes.uv)&&(e.copyVector2sArray(n.uvs),e.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(e=this.attributes.lineDistance)&&(e.copyArray(n.lineDistances),e.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(t.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new Xn).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.addAttribute("position",new Nn(e,3).copyVector3sArray(t.vertices)),t.normals.length>0){var n=new Float32Array(3*t.normals.length);this.addAttribute("normal",new Nn(n,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var i=new Float32Array(3*t.colors.length);this.addAttribute("color",new Nn(i,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var r=new Float32Array(2*t.uvs.length);this.addAttribute("uv",new Nn(r,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var o=new Float32Array(2*t.uvs2.length);this.addAttribute("uv2",new Nn(o,2).copyVector2sArray(t.uvs2))}for(var a in this.groups=t.groups,t.morphTargets){for(var s=[],c=t.morphTargets[a],l=0,u=c.length;l<u;l++){var h=c[l],d=new Wn(3*h.length,3);s.push(d.copyVector3sArray(h))}this.morphAttributes[a]=s}if(t.skinIndices.length>0){var f=new Wn(4*t.skinIndices.length,4);this.addAttribute("skinIndex",f.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var p=new Wn(4*t.skinWeights.length,4);this.addAttribute("skinWeight",p.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new ln);var t=this.attributes.position;void 0!==t?this.boundingBox.setFromBufferAttribute(t):this.boundingBox.makeEmpty(),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var t=new ln,e=new Ye;return function(){null===this.boundingSphere&&(this.boundingSphere=new un);var n=this.attributes.position;if(n){var i=this.boundingSphere.center;t.setFromBufferAttribute(n),t.getCenter(i);for(var r=0,o=0,a=n.count;o<a;o++)e.x=n.getX(o),e.y=n.getY(o),e.z=n.getZ(o),r=Math.max(r,i.distanceToSquared(e));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,e=this.attributes,n=this.groups;if(e.position){var i=e.position.array;if(void 0===e.normal)this.addAttribute("normal",new Nn(new Float32Array(i.length),3));else for(var r=e.normal.array,o=0,a=r.length;o<a;o++)r[o]=0;var s,c,l,u=e.normal.array,h=new Ye,d=new Ye,f=new Ye,p=new Ye,m=new Ye;if(t){var g=t.array;0===n.length&&this.addGroup(0,g.length);for(var _=0,v=n.length;_<v;++_){var b=n[_],y=b.start;for(o=y,a=y+b.count;o<a;o+=3)s=3*g[o+0],c=3*g[o+1],l=3*g[o+2],h.fromArray(i,s),d.fromArray(i,c),f.fromArray(i,l),p.subVectors(f,d),m.subVectors(h,d),p.cross(m),u[s]+=p.x,u[s+1]+=p.y,u[s+2]+=p.z,u[c]+=p.x,u[c+1]+=p.y,u[c+2]+=p.z,u[l]+=p.x,u[l+1]+=p.y,u[l+2]+=p.z}}else for(o=0,a=i.length;o<a;o+=9)h.fromArray(i,o),d.fromArray(i,o+3),f.fromArray(i,o+6),p.subVectors(f,d),m.subVectors(h,d),p.cross(m),u[o]=p.x,u[o+1]=p.y,u[o+2]=p.z,u[o+3]=p.x,u[o+4]=p.y,u[o+5]=p.z,u[o+6]=p.x,u[o+7]=p.y,u[o+8]=p.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(t&&t.isBufferGeometry){void 0===e&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var i in n)if(void 0!==t.attributes[i])for(var r=n[i].array,o=t.attributes[i],a=o.array,s=0,c=o.itemSize*e;s<a.length;s++,c++)r[c]=a[s];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t)},normalizeNormals:function(){var t=new Ye;return function(){for(var e=this.attributes.normal,n=0,i=e.count;n<i;n++)t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.normalize(),e.setXYZ(n,t.x,t.y,t.z)}}(),toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new Zn,e=this.index.array,n=this.attributes;for(var i in n){for(var r=n[i],o=r.array,a=r.itemSize,s=new o.constructor(e.length*a),c=0,l=0,u=0,h=e.length;u<h;u++){c=e[u]*a;for(var d=0;d<a;d++)s[l++]=o[c++]}t.addAttribute(i,new Nn(s,a))}var f=this.groups;for(u=0,h=f.length;u<h;u++){var p=f[u];t.addGroup(p.start,p.count,p.materialIndex)}return t},toJSON:function(){var t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};var i=this.index;if(null!==i){var r=Array.prototype.slice.call(i.array);t.data.index={type:i.array.constructor.name,array:r}}var o=this.attributes;for(var n in o){var a=o[n];r=Array.prototype.slice.call(a.array);t.data.attributes[n]={itemSize:a.itemSize,type:a.array.constructor.name,array:r,normalized:a.normalized}}var s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));var c=this.boundingSphere;return null!==c&&(t.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),t},clone:function(){return(new Zn).copy(this)},copy:function(t){var e,n,i;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var r=t.index;null!==r&&this.setIndex(r.clone());var o=t.attributes;for(e in o){var a=o[e];this.addAttribute(e,a.clone())}var s=t.morphAttributes;for(e in s){var c=[],l=s[e];for(n=0,i=l.length;n<i;n++)c.push(l[n].clone());this.morphAttributes[e]=c}var u=t.groups;for(n=0,i=u.length;n<i;n++){var h=u[n];this.addGroup(h.start,h.count,h.materialIndex)}var d=t.boundingBox;null!==d&&(this.boundingBox=d.clone());var f=t.boundingSphere;return null!==f&&(this.boundingSphere=f.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Jn.prototype=Object.create(Bn.prototype),Jn.prototype.constructor=Jn,Qn.prototype=Object.create(Zn.prototype),Qn.prototype.constructor=Qn,$n.prototype=Object.create(Bn.prototype),$n.prototype.constructor=$n,ti.prototype=Object.create(Zn.prototype),ti.prototype.constructor=ti;var ei,ni,ii,ri,oi,ai,si,ci=0;function li(){Object.defineProperty(this,"id",{value:ci++}),this.uuid=Ge.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=R,this.side=E,this.flatShading=!1,this.vertexColors=P,this.opacity=1,this.transparent=!1,this.blendSrc=X,this.blendDst=Y,this.blendEquation=D,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=it,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this.userData={},this.needsUpdate=!0}function ui(t){li.call(this),this.type="MeshBasicMaterial",this.color=new _n(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ct,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.lights=!1,this.setValues(t)}function hi(t){li.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function di(t,e){this.origin=void 0!==t?t:new Ye,this.direction=void 0!==e?e:new Ye}function fi(t,e){this.start=void 0!==t?t:new Ye,this.end=void 0!==e?e:new Ye}function pi(t,e,n){this.a=void 0!==t?t:new Ye,this.b=void 0!==e?e:new Ye,this.c=void 0!==n?n:new Ye}function mi(t,e){Pn.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new Zn,this.material=void 0!==e?e:new ui({color:16777215*Math.random()}),this.drawMode=Oe,this.updateMorphTargets()}function gi(t,e,n,i){var r,o,a,s=new _n(0),c=0;function l(t,n){e.buffers.color.setClear(t.r,t.g,t.b,n,i)}return{getClearColor:function(){return s},setClearColor:function(t,e){s.set(t),l(s,c=void 0!==e?e:1)},getClearAlpha:function(){return c},setClearAlpha:function(t){l(s,c=t)},render:function(e,i,u,h){var d=i.background;null===d?l(s,c):d&&d.isColor&&(l(d,1),h=!0),(t.autoClear||h)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),d&&d.isCubeTexture?(void 0===a&&((a=new mi(new Qn(1,1,1),new hi({uniforms:yn.cube.uniforms,vertexShader:yn.cube.vertexShader,fragmentShader:yn.cube.fragmentShader,side:S,depthTest:!0,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),a.geometry.removeAttribute("uv"),a.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},n.update(a.geometry)),a.material.uniforms.tCube.value=d,e.push(a,a.geometry,a.material,0,null)):d&&d.isTexture&&(void 0===r&&(r=new On(-1,1,1,-1,0,1),o=new mi(new ti(2,2),new ui({depthTest:!1,depthWrite:!1,fog:!1})),n.update(o.geometry)),o.material.map=d,t.renderBufferDirect(r,null,o.geometry,o.material,o,null))}}}function _i(t,e,n){var i;this.setMode=function(t){i=t},this.render=function(e,r){t.drawArrays(i,e,r),n.update(r,i)},this.renderInstances=function(t,r,o){var a=e.get("ANGLE_instanced_arrays");if(null!==a){var s=t.attributes.position;s.isInterleavedBufferAttribute?(o=s.data.count,a.drawArraysInstancedANGLE(i,0,o,t.maxInstancedCount)):a.drawArraysInstancedANGLE(i,r,o,t.maxInstancedCount),n.update(o,i,t.maxInstancedCount)}else console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")}}function vi(t,e,n){var i;function r(e){if("highp"===e){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var o=void 0!==n.precision?n.precision:"highp",a=r(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);var s=!0===n.logarithmicDepthBuffer,c=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),l=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),u=t.getParameter(t.MAX_TEXTURE_SIZE),h=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),d=t.getParameter(t.MAX_VERTEX_ATTRIBS),f=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),p=t.getParameter(t.MAX_VARYING_VECTORS),m=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),g=l>0,_=!!e.get("OES_texture_float");return{getMaxAnisotropy:function(){if(void 0!==i)return i;var n=e.get("EXT_texture_filter_anisotropic");return i=null!==n?t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:r,precision:o,logarithmicDepthBuffer:s,maxTextures:c,maxVertexTextures:l,maxTextureSize:u,maxCubemapSize:h,maxAttributes:d,maxVertexUniforms:f,maxVaryings:p,maxFragmentUniforms:m,vertexTextures:g,floatFragmentTextures:_,floatVertexTextures:g&&_}}function bi(){var t=this,e=null,n=0,i=!1,r=!1,o=new hn,a=new Ke,s={value:null,needsUpdate:!1};function c(){s.value!==e&&(s.value=e,s.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function l(e,n,i,r){var c=null!==e?e.length:0,l=null;if(0!==c){if(l=s.value,!0!==r||null===l){var u=i+4*c,h=n.matrixWorldInverse;a.getNormalMatrix(h),(null===l||l.length<u)&&(l=new Float32Array(u));for(var d=0,f=i;d!==c;++d,f+=4)o.copy(e[d]).applyMatrix4(h,a),o.normal.toArray(l,f),l[f+3]=o.constant}s.value=l,s.needsUpdate=!0}return t.numPlanes=c,l}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(t,r,o){var a=0!==t.length||r||0!==n||i;return i=r,e=l(t,o,0),n=t.length,a},this.beginShadows=function(){r=!0,l(null)},this.endShadows=function(){r=!1,c()},this.setState=function(t,o,a,u,h,d){if(!i||null===t||0===t.length||r&&!a)r?l(null):c();else{var f=r?0:n,p=4*f,m=h.clippingState||null;s.value=m,m=l(t,u,p,d);for(var g=0;g!==p;++g)m[g]=e[g];h.clippingState=m,this.numIntersection=o?this.numPlanes:0,this.numPlanes+=f}}}function yi(t){var e={};return{get:function(n){if(void 0!==e[n])return e[n];var i;switch(n){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":i=t.getExtension("WEBGL_compressed_texture_etc1");break;default:i=t.getExtension(n)}return null===i&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),e[n]=i,i}}}function xi(t,e,n){var i={},r={};function o(t){var a=t.target,s=i[a.id];for(var c in null!==s.index&&e.remove(s.index),s.attributes)e.remove(s.attributes[c]);a.removeEventListener("dispose",o),delete i[a.id];var l=r[a.id];l&&(e.remove(l),delete r[a.id]),(l=r[s.id])&&(e.remove(l),delete r[s.id]),n.memory.geometries--}return{get:function(t,e){var r=i[e.id];return r||(e.addEventListener("dispose",o),e.isBufferGeometry?r=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new Zn).setFromObject(t)),r=e._bufferGeometry),i[e.id]=r,n.memory.geometries++,r)},update:function(n){var i=n.index,r=n.attributes;for(var o in null!==i&&e.update(i,t.ELEMENT_ARRAY_BUFFER),r)e.update(r[o],t.ARRAY_BUFFER);var a=n.morphAttributes;for(var o in a)for(var s=a[o],c=0,l=s.length;c<l;c++)e.update(s[c],t.ARRAY_BUFFER)},getWireframeAttribute:function(n){var i=r[n.id];if(i)return i;var o,a=[],s=n.index,c=n.attributes;if(null!==s)for(var l=0,u=(o=s.array).length;l<u;l+=3){var h=o[l+0],d=o[l+1],f=o[l+2];a.push(h,d,d,f,f,h)}else for(l=0,u=(o=c.position.array).length/3-1;l<u;l+=3)h=l+0,d=l+1,f=l+2,a.push(h,d,d,f,f,h);return i=new(Yn(a)>65535?Gn:Hn)(a,1),e.update(i,t.ELEMENT_ARRAY_BUFFER),r[n.id]=i,i}}}function wi(t,e,n){var i,r,o;this.setMode=function(t){i=t},this.setIndex=function(t){r=t.type,o=t.bytesPerElement},this.render=function(e,a){t.drawElements(i,a,r,e*o),n.update(a,i)},this.renderInstances=function(t,a,s){var c=e.get("ANGLE_instanced_arrays");null!==c?(c.drawElementsInstancedANGLE(i,s,r,a*o,t.maxInstancedCount),n.update(s,i,t.maxInstancedCount)):console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")}}function Mi(t){var e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(n,i,r){switch(r=r||1,e.calls++,i){case t.TRIANGLES:e.triangles+=r*(n/3);break;case t.TRIANGLE_STRIP:case t.TRIANGLE_FAN:e.triangles+=r*(n-2);break;case t.LINES:e.lines+=r*(n/2);break;case t.LINE_STRIP:e.lines+=r*(n-1);break;case t.LINE_LOOP:e.lines+=r*n;break;case t.POINTS:e.points+=r*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",i)}}}}function Ei(t,e){return Math.abs(e[1])-Math.abs(t[1])}function Si(t){var e={},n=new Float32Array(8);return{update:function(i,r,o,a){var s=i.morphTargetInfluences,c=s.length,l=e[r.id];if(void 0===l){l=[];for(var u=0;u<c;u++)l[u]=[u,0];e[r.id]=l}var h=o.morphTargets&&r.morphAttributes.position,d=o.morphNormals&&r.morphAttributes.normal;for(u=0;u<c;u++)0!==(f=l[u])[1]&&(h&&r.removeAttribute("morphTarget"+u),d&&r.removeAttribute("morphNormal"+u));for(u=0;u<c;u++)(f=l[u])[0]=u,f[1]=s[u];for(l.sort(Ei),u=0;u<8;u++){var f;if(f=l[u]){var p=f[0],m=f[1];if(m){h&&r.addAttribute("morphTarget"+u,h[p]),d&&r.addAttribute("morphNormal"+u,d[p]),n[u]=m;continue}}n[u]=0}a.getUniforms().setValue(t,"morphTargetInfluences",n)}}}function Ai(t,e){var n={};return{update:function(i){var r=e.render.frame,o=i.geometry,a=t.get(i,o);return n[a.id]!==r&&(o.isGeometry&&a.updateFromObject(i),t.update(a),n[a.id]=r),a},dispose:function(){n={}}}}function Ti(t,e,n,i,r,o,a,s,c,l){t=void 0!==t?t:[],e=void 0!==e?e:_t,rn.call(this,t,e,n,i,r,o,a,s,c,l),this.flipY=!1}li.prototype=Object.assign(Object.create(i.prototype),{constructor:li,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var e in t){var n=t[e];if(void 0!==n)if("shading"!==e){var i=this[e];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]="overdraw"===e?Number(n):n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===T;else console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},toJSON:function(t){var e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function i(t){var e=[];for(var n in t){var i=t[n];delete i.metadata,e.push(i)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearCoat&&(n.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(n.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,n.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==R&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),this.side!==E&&(n.side=this.side),this.vertexColors!==P&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,0!==this.rotation&&(n.rotation=this.rotation),1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){var r=i(t.textures),o=i(t.images);r.length>0&&(n.textures=r),o.length>0&&(n.images=o)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.lights=t.lights,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.overdraw=t.overdraw,this.visible=t.visible,this.userData=JSON.parse(JSON.stringify(t.userData)),this.clipShadows=t.clipShadows,this.clipIntersection=t.clipIntersection;var e=t.clippingPlanes,n=null;if(null!==e){var i=e.length;n=new Array(i);for(var r=0;r!==i;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.shadowSide=t.shadowSide,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),ui.prototype=Object.create(li.prototype),ui.prototype.constructor=ui,ui.prototype.isMeshBasicMaterial=!0,ui.prototype.copy=function(t){return li.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this},hi.prototype=Object.create(li.prototype),hi.prototype.constructor=hi,hi.prototype.isShaderMaterial=!0,hi.prototype.copy=function(t){return li.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=mn.clone(t.uniforms),this.defines=t.defines,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},hi.prototype.toJSON=function(t){var e=li.prototype.toJSON.call(this,t);return e.uniforms=this.uniforms,e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e},Object.assign(di.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new Ye),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(){var t=new Ye;return function(e){return this.origin.copy(this.at(e,t)),this}}(),closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new Ye),e.subVectors(t,this.origin);var n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(){var t=new Ye;return function(e){var n=t.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(t.copy(this.direction).multiplyScalar(n).add(this.origin),t.distanceToSquared(e))}}(),distanceSqToSegment:(ni=new Ye,ii=new Ye,ri=new Ye,function(t,e,n,i){ni.copy(t).add(e).multiplyScalar(.5),ii.copy(e).sub(t).normalize(),ri.copy(this.origin).sub(ni);var r,o,a,s,c=.5*t.distanceTo(e),l=-this.direction.dot(ii),u=ri.dot(this.direction),h=-ri.dot(ii),d=ri.lengthSq(),f=Math.abs(1-l*l);if(f>0)if(o=l*u-h,s=c*f,(r=l*h-u)>=0)if(o>=-s)if(o<=s){var p=1/f;a=(r*=p)*(r+l*(o*=p)+2*u)+o*(l*r+o+2*h)+d}else o=c,a=-(r=Math.max(0,-(l*o+u)))*r+o*(o+2*h)+d;else o=-c,a=-(r=Math.max(0,-(l*o+u)))*r+o*(o+2*h)+d;else o<=-s?a=-(r=Math.max(0,-(-l*c+u)))*r+(o=r>0?-c:Math.min(Math.max(-c,-h),c))*(o+2*h)+d:o<=s?(r=0,a=(o=Math.min(Math.max(-c,-h),c))*(o+2*h)+d):a=-(r=Math.max(0,-(l*c+u)))*r+(o=r>0?c:Math.min(Math.max(-c,-h),c))*(o+2*h)+d;else o=l>0?-c:c,a=-(r=Math.max(0,-(l*o+u)))*r+o*(o+2*h)+d;return n&&n.copy(this.direction).multiplyScalar(r).add(this.origin),i&&i.copy(ii).multiplyScalar(o).add(ni),a}),intersectSphere:function(){var t=new Ye;return function(e,n){t.subVectors(e.center,this.origin);var i=t.dot(this.direction),r=t.dot(t)-i*i,o=e.radius*e.radius;if(r>o)return null;var a=Math.sqrt(o-r),s=i-a,c=i+a;return s<0&&c<0?null:s<0?this.at(c,n):this.at(s,n)}}(),intersectsSphere:function(t){return this.distanceToPoint(t.center)<=t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null},intersectPlane:function(t,e){var n=this.distanceToPlane(t);return null===n?null:this.at(n,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){var n,i,r,o,a,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,h=this.origin;return c>=0?(n=(t.min.x-h.x)*c,i=(t.max.x-h.x)*c):(n=(t.max.x-h.x)*c,i=(t.min.x-h.x)*c),l>=0?(r=(t.min.y-h.y)*l,o=(t.max.y-h.y)*l):(r=(t.max.y-h.y)*l,o=(t.min.y-h.y)*l),n>o||r>i?null:((r>n||n!=n)&&(n=r),(o<i||i!=i)&&(i=o),u>=0?(a=(t.min.z-h.z)*u,s=(t.max.z-h.z)*u):(a=(t.max.z-h.z)*u,s=(t.min.z-h.z)*u),n>s||a>i?null:((a>n||n!=n)&&(n=a),(s<i||i!=i)&&(i=s),i<0?null:this.at(n>=0?n:i,e)))},intersectsBox:(ei=new Ye,function(t){return null!==this.intersectBox(t,ei)}),intersectTriangle:function(){var t=new Ye,e=new Ye,n=new Ye,i=new Ye;return function(r,o,a,s,c){e.subVectors(o,r),n.subVectors(a,r),i.crossVectors(e,n);var l,u=this.direction.dot(i);if(u>0){if(s)return null;l=1}else{if(!(u<0))return null;l=-1,u=-u}t.subVectors(this.origin,r);var h=l*this.direction.dot(n.crossVectors(t,n));if(h<0)return null;var d=l*this.direction.dot(e.cross(t));if(d<0)return null;if(h+d>u)return null;var f=-l*t.dot(i);return f<0?null:this.at(f/u,c)}}(),applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}}),Object.assign(fi.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new Ye),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new Ye),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new Ye),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:(oi=new Ye,ai=new Ye,function(t,e){oi.subVectors(t,this.start),ai.subVectors(this.end,this.start);var n=ai.dot(ai),i=ai.dot(oi)/n;return e&&(i=Ge.clamp(i,0,1)),i}),closestPointToPoint:function(t,e,n){var i=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Ye),this.delta(n).multiplyScalar(i).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),Object.assign(pi,{getNormal:(si=new Ye,function(t,e,n,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new Ye),i.subVectors(n,e),si.subVectors(t,e),i.cross(si);var r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}),getBarycoord:function(){var t=new Ye,e=new Ye,n=new Ye;return function(i,r,o,a,s){t.subVectors(a,r),e.subVectors(o,r),n.subVectors(i,r);var c=t.dot(t),l=t.dot(e),u=t.dot(n),h=e.dot(e),d=e.dot(n),f=c*h-l*l;if(void 0===s&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),s=new Ye),0===f)return s.set(-2,-1,-1);var p=1/f,m=(h*u-l*d)*p,g=(c*d-l*u)*p;return s.set(1-m-g,g,m)}}(),containsPoint:function(){var t=new Ye;return function(e,n,i,r){return pi.getBarycoord(e,n,i,r,t),t.x>=0&&t.y>=0&&t.x+t.y<=1}}()}),Object.assign(pi.prototype,{set:function(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this},setFromPointsAndIndices:function(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:function(){var t=new Ye,e=new Ye;return function(){return t.subVectors(this.c,this.b),e.subVectors(this.a,this.b),.5*t.cross(e).length()}}(),getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new Ye),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return pi.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new Ye),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return pi.getBarycoord(t,this.a,this.b,this.c,e)},containsPoint:function(t){return pi.containsPoint(t,this.a,this.b,this.c)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(){var t=new hn,e=[new fi,new fi,new fi],n=new Ye,i=new Ye;return function(r,o){void 0===o&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),o=new Ye);var a=1/0;if(t.setFromCoplanarPoints(this.a,this.b,this.c),t.projectPoint(r,n),!0===this.containsPoint(n))o.copy(n);else{e[0].set(this.a,this.b),e[1].set(this.b,this.c),e[2].set(this.c,this.a);for(var s=0;s<e.length;s++){e[s].closestPointToPoint(n,!0,i);var c=n.distanceToSquared(i);c<a&&(a=c,o.copy(i))}}return o}}(),equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}),mi.prototype=Object.assign(Object.create(Pn.prototype),{constructor:mi,isMesh:!0,setDrawMode:function(t){this.drawMode=t},copy:function(t){return Pn.prototype.copy.call(this,t),this.drawMode=t.drawMode,void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,e,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,o=Object.keys(r);if(o.length>0){var a=r[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;t<e;t++)n=a[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{var s=i.morphTargets;if(void 0!==s&&s.length>0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=s.length;t<e;t++)n=s[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}},raycast:function(){var t=new Ve,e=new di,n=new un,i=new Ye,r=new Ye,o=new Ye,a=new Ye,s=new Ye,c=new Ye,l=new We,u=new We,h=new We,d=new Ye,f=new Ye,p=new Ye;function m(t,e,n,i,r,o,a){return pi.getBarycoord(t,e,n,i,d),r.multiplyScalar(d.x),o.multiplyScalar(d.y),a.multiplyScalar(d.z),r.add(o).add(a),r.clone()}function g(t,e,n,i,r,o,a,s){if(null===(e.side===S?i.intersectTriangle(a,o,r,!0,s):i.intersectTriangle(r,o,a,e.side!==A,s)))return null;p.copy(s),p.applyMatrix4(t.matrixWorld);var c=n.ray.origin.distanceTo(p);return c<n.near||c>n.far?null:{distance:c,point:p.clone(),object:t}}function _(t,e,n,a,s,c,d,p){i.fromBufferAttribute(a,c),r.fromBufferAttribute(a,d),o.fromBufferAttribute(a,p);var _=g(t,t.material,e,n,i,r,o,f);if(_){s&&(l.fromBufferAttribute(s,c),u.fromBufferAttribute(s,d),h.fromBufferAttribute(s,p),_.uv=m(f,i,r,o,l,u,h));var v=new Cn(c,d,p);pi.getNormal(i,r,o,v.normal),_.face=v,_.faceIndex=c}return _}return function(d,p){var v,b=this.geometry,y=this.material,x=this.matrixWorld;if(void 0!==y&&(null===b.boundingSphere&&b.computeBoundingSphere(),n.copy(b.boundingSphere),n.applyMatrix4(x),!1!==d.ray.intersectsSphere(n)&&(t.getInverse(x),e.copy(d.ray).applyMatrix4(t),null===b.boundingBox||!1!==e.intersectsBox(b.boundingBox))))if(b.isBufferGeometry){var w,M,E,S,A,T=b.index,k=b.attributes.position,P=b.attributes.uv;if(null!==T)for(S=0,A=T.count;S<A;S+=3)w=T.getX(S),M=T.getX(S+1),E=T.getX(S+2),(v=_(this,d,e,k,P,w,M,E))&&(v.faceIndex=Math.floor(S/3),p.push(v));else if(void 0!==k)for(S=0,A=k.count;S<A;S+=3)(v=_(this,d,e,k,P,w=S,M=S+1,E=S+2))&&(v.index=w,p.push(v))}else if(b.isGeometry){var L,O,C,R,I=Array.isArray(y),z=b.vertices,B=b.faces,N=b.faceVertexUvs[0];N.length>0&&(R=N);for(var D=0,j=B.length;D<j;D++){var U=B[D],F=I?y[U.materialIndex]:y;if(void 0!==F){if(L=z[U.a],O=z[U.b],C=z[U.c],!0===F.morphTargets){var H=b.morphTargets,q=this.morphTargetInfluences;i.set(0,0,0),r.set(0,0,0),o.set(0,0,0);for(var G=0,W=H.length;G<W;G++){var V=q[G];if(0!==V){var X=H[G].vertices;i.addScaledVector(a.subVectors(X[U.a],L),V),r.addScaledVector(s.subVectors(X[U.b],O),V),o.addScaledVector(c.subVectors(X[U.c],C),V)}}i.add(L),r.add(O),o.add(C),L=i,O=r,C=o}if(v=g(this,F,d,e,L,O,C,f)){if(R&&R[D]){var Y=R[D];l.copy(Y[0]),u.copy(Y[1]),h.copy(Y[2]),v.uv=m(f,L,O,C,l,u,h)}v.face=U,v.faceIndex=D,p.push(v)}}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Ti.prototype=Object.create(rn.prototype),Ti.prototype.constructor=Ti,Ti.prototype.isCubeTexture=!0,Object.defineProperty(Ti.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}});var ki=new rn,Pi=new Ti;function Li(){this.seq=[],this.map={}}var Oi=[],Ci=[],Ri=new Float32Array(16),Ii=new Float32Array(9);function zi(t,e,n){var i=t[0];if(i<=0||i>0)return t;var r=e*n,o=Oi[r];if(void 0===o&&(o=new Float32Array(r),Oi[r]=o),0!==e){i.toArray(o,0);for(var a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function Bi(t,e){var n=Ci[e];void 0===n&&(n=new Int32Array(e),Ci[e]=n);for(var i=0;i!==e;++i)n[i]=t.allocTextureUnit();return n}function Ni(t,e){t.uniform1f(this.addr,e)}function Di(t,e){t.uniform1i(this.addr,e)}function ji(t,e){void 0===e.x?t.uniform2fv(this.addr,e):t.uniform2f(this.addr,e.x,e.y)}function Ui(t,e){void 0!==e.x?t.uniform3f(this.addr,e.x,e.y,e.z):void 0!==e.r?t.uniform3f(this.addr,e.r,e.g,e.b):t.uniform3fv(this.addr,e)}function Fi(t,e){void 0===e.x?t.uniform4fv(this.addr,e):t.uniform4f(this.addr,e.x,e.y,e.z,e.w)}function Hi(t,e){t.uniformMatrix2fv(this.addr,!1,e.elements||e)}function qi(t,e){void 0===e.elements?t.uniformMatrix3fv(this.addr,!1,e):(Ii.set(e.elements),t.uniformMatrix3fv(this.addr,!1,Ii))}function Gi(t,e){void 0===e.elements?t.uniformMatrix4fv(this.addr,!1,e):(Ri.set(e.elements),t.uniformMatrix4fv(this.addr,!1,Ri))}function Wi(t,e,n){var i=n.allocTextureUnit();t.uniform1i(this.addr,i),n.setTexture2D(e||ki,i)}function Vi(t,e,n){var i=n.allocTextureUnit();t.uniform1i(this.addr,i),n.setTextureCube(e||Pi,i)}function Xi(t,e){t.uniform2iv(this.addr,e)}function Yi(t,e){t.uniform3iv(this.addr,e)}function Ki(t,e){t.uniform4iv(this.addr,e)}function Zi(t,e){t.uniform1fv(this.addr,e)}function Ji(t,e){t.uniform1iv(this.addr,e)}function Qi(t,e){t.uniform2fv(this.addr,zi(e,this.size,2))}function $i(t,e){t.uniform3fv(this.addr,zi(e,this.size,3))}function tr(t,e){t.uniform4fv(this.addr,zi(e,this.size,4))}function er(t,e){t.uniformMatrix2fv(this.addr,!1,zi(e,this.size,4))}function nr(t,e){t.uniformMatrix3fv(this.addr,!1,zi(e,this.size,9))}function ir(t,e){t.uniformMatrix4fv(this.addr,!1,zi(e,this.size,16))}function rr(t,e,n){var i=e.length,r=Bi(n,i);t.uniform1iv(this.addr,r);for(var o=0;o!==i;++o)n.setTexture2D(e[o]||ki,r[o])}function or(t,e,n){var i=e.length,r=Bi(n,i);t.uniform1iv(this.addr,r);for(var o=0;o!==i;++o)n.setTextureCube(e[o]||Pi,r[o])}function ar(t,e,n){this.id=t,this.addr=n,this.setValue=function(t){switch(t){case 5126:return Ni;case 35664:return ji;case 35665:return Ui;case 35666:return Fi;case 35674:return Hi;case 35675:return qi;case 35676:return Gi;case 35678:case 36198:return Wi;case 35680:return Vi;case 5124:case 35670:return Di;case 35667:case 35671:return Xi;case 35668:case 35672:return Yi;case 35669:case 35673:return Ki}}(e.type)}function sr(t,e,n){this.id=t,this.addr=n,this.size=e.size,this.setValue=function(t){switch(t){case 5126:return Zi;case 35664:return Qi;case 35665:return $i;case 35666:return tr;case 35674:return er;case 35675:return nr;case 35676:return ir;case 35678:return rr;case 35680:return or;case 5124:case 35670:return Ji;case 35667:case 35671:return Xi;case 35668:case 35672:return Yi;case 35669:case 35673:return Ki}}(e.type)}function cr(t){this.id=t,Li.call(this)}cr.prototype.setValue=function(t,e){for(var n=this.seq,i=0,r=n.length;i!==r;++i){var o=n[i];o.setValue(t,e[o.id])}};var lr=/([\w\d_]+)(\])?(\[|\.)?/g;function ur(t,e){t.seq.push(e),t.map[e.id]=e}function hr(t,e,n){var i=t.name,r=i.length;for(lr.lastIndex=0;;){var o=lr.exec(i),a=lr.lastIndex,s=o[1],c="]"===o[2],l=o[3];if(c&&(s|=0),void 0===l||"["===l&&a+2===r){ur(n,void 0===l?new ar(s,t,e):new sr(s,t,e));break}var u=n.map[s];void 0===u&&ur(n,u=new cr(s)),n=u}}function dr(t,e,n){Li.call(this),this.renderer=n;for(var i=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),r=0;r<i;++r){var o=t.getActiveUniform(e,r),a=o.name;hr(o,t.getUniformLocation(e,a),this)}}function fr(t,e,n){var i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),!1===t.getShaderParameter(i,t.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==t.getShaderInfoLog(i)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",e===t.VERTEX_SHADER?"vertex":"fragment",t.getShaderInfoLog(i),function(t){for(var e=t.split("\n"),n=0;n<e.length;n++)e[n]=n+1+": "+e[n];return e.join("\n")}(n)),i}dr.prototype.setValue=function(t,e,n){var i=this.map[e];void 0!==i&&i.setValue(t,n,this.renderer)},dr.prototype.setOptional=function(t,e,n){var i=e[n];void 0!==i&&this.setValue(t,n,i)},dr.upload=function(t,e,n,i){for(var r=0,o=e.length;r!==o;++r){var a=e[r],s=n[a.id];!1!==s.needsUpdate&&a.setValue(t,s.value,i)}},dr.seqWithValue=function(t,e){for(var n=[],i=0,r=t.length;i!==r;++i){var o=t[i];o.id in e&&n.push(o)}return n};var pr=0;function mr(t){switch(t){case Ie:return["Linear","( value )"];case ze:return["sRGB","( value )"];case Ne:return["RGBE","( value )"];case je:return["RGBM","( value, 7.0 )"];case Ue:return["RGBM","( value, 16.0 )"];case Fe:return["RGBD","( value, 256.0 )"];case Be:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+t)}}function gr(t,e){var n=mr(e);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function _r(t,e){var n;switch(e){case dt:n="Linear";break;case ft:n="Reinhard";break;case pt:n="Uncharted2";break;case mt:n="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function vr(t){return""!==t}function br(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights)}function yr(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}function xr(t){return t.replace(/^[ \t]*#include +<([\w\d.]+)>/gm,function(t,e){var n=pn[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return xr(n)})}function wr(t){return t.replace(/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,function(t,e,n,i){for(var r="",o=parseInt(e);o<parseInt(n);o++)r+=i.replace(/\[ i \]/g,"[ "+o+" ]");return r})}function Mr(t,e,n,i,r,o){var a=t.context,s=i.defines,c=r.vertexShader,l=r.fragmentShader,u="SHADOWMAP_TYPE_BASIC";o.shadowMapType===w?u="SHADOWMAP_TYPE_PCF":o.shadowMapType===M&&(u="SHADOWMAP_TYPE_PCF_SOFT");var h="ENVMAP_TYPE_CUBE",d="ENVMAP_MODE_REFLECTION",f="ENVMAP_BLENDING_MULTIPLY";if(o.envMap){switch(i.envMap.mapping){case _t:case vt:h="ENVMAP_TYPE_CUBE";break;case wt:case Mt:h="ENVMAP_TYPE_CUBE_UV";break;case bt:case yt:h="ENVMAP_TYPE_EQUIREC";break;case xt:h="ENVMAP_TYPE_SPHERE"}switch(i.envMap.mapping){case vt:case yt:d="ENVMAP_MODE_REFRACTION"}switch(i.combine){case ct:f="ENVMAP_BLENDING_MULTIPLY";break;case lt:f="ENVMAP_BLENDING_MIX";break;case ut:f="ENVMAP_BLENDING_ADD"}}var p,m,g,_,v,b=t.gammaFactor>0?t.gammaFactor:1,y=function(t,e,n){return[(t=t||{}).derivatives||e.envMapCubeUV||e.bumpMap||e.normalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(t.fragDepth||e.logarithmicDepthBuffer)&&n.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",t.drawBuffers&&n.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(t.shaderTextureLOD||e.envMap)&&n.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(vr).join("\n")}(i.extensions,o,e),x=function(t){var e=[];for(var n in t){var i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}(s),E=a.createProgram();i.isRawShaderMaterial?((p=[x].filter(vr).join("\n")).length>0&&(p+="\n"),(m=[y,x].filter(vr).join("\n")).length>0&&(m+="\n")):(p=["precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+r.name,x,o.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+b,"#define MAX_BONES "+o.maxBones,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+d:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.displacementMap&&o.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexColors?"#define USE_COLOR":"",o.flatShading?"#define FLAT_SHADED":"",o.skinning?"#define USE_SKINNING":"",o.useVertexTexture?"#define BONE_TEXTURE":"",o.morphTargets?"#define USE_MORPHTARGETS":"",o.morphNormals&&!1===o.flatShading?"#define USE_MORPHNORMALS":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+u:"",o.sizeAttenuation?"#define USE_SIZEATTENUATION":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&e.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(vr).join("\n"),m=[y,"precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+r.name,x,o.alphaTest?"#define ALPHATEST "+o.alphaTest:"","#define GAMMA_FACTOR "+b,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+h:"",o.envMap?"#define "+d:"",o.envMap?"#define "+f:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexColors?"#define USE_COLOR":"",o.gradientMap?"#define USE_GRADIENTMAP":"",o.flatShading?"#define FLAT_SHADED":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+u:"",o.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",o.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&e.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",o.envMap&&e.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",o.toneMapping!==ht?"#define TONE_MAPPING":"",o.toneMapping!==ht?pn.tonemapping_pars_fragment:"",o.toneMapping!==ht?_r("toneMapping",o.toneMapping):"",o.dithering?"#define DITHERING":"",o.outputEncoding||o.mapEncoding||o.envMapEncoding||o.emissiveMapEncoding?pn.encodings_pars_fragment:"",o.mapEncoding?gr("mapTexelToLinear",o.mapEncoding):"",o.envMapEncoding?gr("envMapTexelToLinear",o.envMapEncoding):"",o.emissiveMapEncoding?gr("emissiveMapTexelToLinear",o.emissiveMapEncoding):"",o.outputEncoding?(g="linearToOutputTexel",_=o.outputEncoding,v=mr(_),"vec4 "+g+"( vec4 value ) { return LinearTo"+v[0]+v[1]+"; }"):"",o.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(vr).join("\n")),c=yr(c=br(c=xr(c),o),o),l=yr(l=br(l=xr(l),o),o);var S=p+(c=wr(c)),A=m+(l=wr(l)),T=fr(a,a.VERTEX_SHADER,S),k=fr(a,a.FRAGMENT_SHADER,A);a.attachShader(E,T),a.attachShader(E,k),void 0!==i.index0AttributeName?a.bindAttribLocation(E,0,i.index0AttributeName):!0===o.morphTargets&&a.bindAttribLocation(E,0,"position"),a.linkProgram(E);var P,L,O=a.getProgramInfoLog(E).trim(),C=a.getShaderInfoLog(T).trim(),R=a.getShaderInfoLog(k).trim(),I=!0,z=!0;return!1===a.getProgramParameter(E,a.LINK_STATUS)?(I=!1,console.error("THREE.WebGLProgram: shader error: ",a.getError(),"gl.VALIDATE_STATUS",a.getProgramParameter(E,a.VALIDATE_STATUS),"gl.getProgramInfoLog",O,C,R)):""!==O?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",O):""!==C&&""!==R||(z=!1),z&&(this.diagnostics={runnable:I,material:i,programLog:O,vertexShader:{log:C,prefix:p},fragmentShader:{log:R,prefix:m}}),a.deleteShader(T),a.deleteShader(k),this.getUniforms=function(){return void 0===P&&(P=new dr(a,E,t)),P},this.getAttributes=function(){return void 0===L&&(L=function(t,e){for(var n={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),r=0;r<i;r++){var o=t.getActiveAttrib(e,r).name;n[o]=t.getAttribLocation(e,o)}return n}(a,E)),L},this.destroy=function(){a.deleteProgram(E),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.id=pr++,this.code=n,this.usedTimes=1,this.program=E,this.vertexShader=T,this.fragmentShader=k,this}function Er(t,e,n){var i=[],r={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow"},o=["precision","supportsVertexTextures","map","mapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];function a(t,e){var n;return t?t.isTexture?n=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=t.texture.encoding):n=Ie,n===Ie&&e&&(n=Be),n}this.getParameters=function(e,i,o,s,c,l,u){var h=r[e.type],d=u.isSkinnedMesh?function(t){var e=t.skeleton.bones;if(n.floatVertexTextures)return 1024;var i=n.maxVertexUniforms,r=Math.floor((i-20)/4),o=Math.min(r,e.length);return o<e.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+e.length+" bones. This GPU supports "+o+"."),0):o}(u):0,f=n.precision;null!==e.precision&&(f=n.getMaxPrecision(e.precision))!==e.precision&&console.warn("THREE.WebGLProgram.getParameters:",e.precision,"not supported, using",f,"instead.");var p=t.getRenderTarget();return{shaderID:h,precision:f,supportsVertexTextures:n.vertexTextures,outputEncoding:a(p?p.texture:null,t.gammaOutput),map:!!e.map,mapEncoding:a(e.map,t.gammaInput),envMap:!!e.envMap,envMapMode:e.envMap&&e.envMap.mapping,envMapEncoding:a(e.envMap,t.gammaInput),envMapCubeUV:!!e.envMap&&(e.envMap.mapping===wt||e.envMap.mapping===Mt),lightMap:!!e.lightMap,aoMap:!!e.aoMap,emissiveMap:!!e.emissiveMap,emissiveMapEncoding:a(e.emissiveMap,t.gammaInput),bumpMap:!!e.bumpMap,normalMap:!!e.normalMap,displacementMap:!!e.displacementMap,roughnessMap:!!e.roughnessMap,metalnessMap:!!e.metalnessMap,specularMap:!!e.specularMap,alphaMap:!!e.alphaMap,gradientMap:!!e.gradientMap,combine:e.combine,vertexColors:e.vertexColors,fog:!!s,useFog:e.fog,fogExp:s&&s.isFogExp2,flatShading:e.flatShading,sizeAttenuation:e.sizeAttenuation,logarithmicDepthBuffer:n.logarithmicDepthBuffer,skinning:e.skinning&&d>0,maxBones:d,useVertexTexture:n.floatVertexTextures,morphTargets:e.morphTargets,morphNormals:e.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:i.directional.length,numPointLights:i.point.length,numSpotLights:i.spot.length,numRectAreaLights:i.rectArea.length,numHemiLights:i.hemi.length,numClippingPlanes:c,numClipIntersection:l,dithering:e.dithering,shadowMapEnabled:t.shadowMap.enabled&&u.receiveShadow&&o.length>0,shadowMapType:t.shadowMap.type,toneMapping:t.toneMapping,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:e.premultipliedAlpha,alphaTest:e.alphaTest,doubleSided:e.side===A,flipSided:e.side===S,depthPacking:void 0!==e.depthPacking&&e.depthPacking}},this.getProgramCode=function(e,n){var i=[];if(n.shaderID?i.push(n.shaderID):(i.push(e.fragmentShader),i.push(e.vertexShader)),void 0!==e.defines)for(var r in e.defines)i.push(r),i.push(e.defines[r]);for(var a=0;a<o.length;a++)i.push(n[o[a]]);return i.push(e.onBeforeCompile.toString()),i.push(t.gammaOutput),i.join()},this.acquireProgram=function(n,r,o,a){for(var s,c=0,l=i.length;c<l;c++){var u=i[c];if(u.code===a){++(s=u).usedTimes;break}}return void 0===s&&(s=new Mr(t,e,a,n,r,o),i.push(s)),s},this.releaseProgram=function(t){if(0==--t.usedTimes){var e=i.indexOf(t);i[e]=i[i.length-1],i.pop(),t.destroy()}},this.programs=i}function Sr(){var t=new WeakMap;return{get:function(e){var n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n},remove:function(e){t.delete(e)},update:function(e,n,i){t.get(e)[n]=i},dispose:function(){t=new WeakMap}}}function Ar(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program&&e.program&&t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function Tr(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function kr(){var t=[],e=0,n=[],i=[];return{opaque:n,transparent:i,init:function(){e=0,n.length=0,i.length=0},push:function(r,o,a,s,c){var l=t[e];void 0===l?(l={id:r.id,object:r,geometry:o,material:a,program:a.program,renderOrder:r.renderOrder,z:s,group:c},t[e]=l):(l.id=r.id,l.object=r,l.geometry=o,l.material=a,l.program=a.program,l.renderOrder=r.renderOrder,l.z=s,l.group=c),(!0===a.transparent?i:n).push(l),e++},sort:function(){n.length>1&&n.sort(Ar),i.length>1&&i.sort(Tr)}}}function Pr(){var t={};return{get:function(e,n){var i=e.id+","+n.id,r=t[i];return void 0===r&&(r=new kr,t[i]=r),r},dispose:function(){t={}}}}function Lr(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":n={direction:new Ye,color:new _n,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new We};break;case"SpotLight":n={position:new Ye,direction:new Ye,color:new _n,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new We};break;case"PointLight":n={position:new Ye,color:new _n,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new We,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new Ye,skyColor:new _n,groundColor:new _n};break;case"RectAreaLight":n={color:new _n,position:new Ye,halfWidth:new Ye,halfHeight:new Ye}}return t[e.id]=n,n}}}var Or,Cr,Rr,Ir,zr,Br,Nr,Dr,jr=0;function Ur(){var t=new Lr,e={id:jr++,hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},n=new Ye,i=new Ve,r=new Ve;return{setup:function(o,a,s){for(var c=0,l=0,u=0,h=0,d=0,f=0,p=0,m=0,g=s.matrixWorldInverse,_=0,v=o.length;_<v;_++){var b=o[_],y=b.color,x=b.intensity,w=b.distance,M=b.shadow&&b.shadow.map?b.shadow.map.texture:null;if(b.isAmbientLight)c+=y.r*x,l+=y.g*x,u+=y.b*x;else if(b.isDirectionalLight){if((S=t.get(b)).color.copy(b.color).multiplyScalar(b.intensity),S.direction.setFromMatrixPosition(b.matrixWorld),n.setFromMatrixPosition(b.target.matrixWorld),S.direction.sub(n),S.direction.transformDirection(g),S.shadow=b.castShadow,b.castShadow){var E=b.shadow;S.shadowBias=E.bias,S.shadowRadius=E.radius,S.shadowMapSize=E.mapSize}e.directionalShadowMap[h]=M,e.directionalShadowMatrix[h]=b.shadow.matrix,e.directional[h]=S,h++}else if(b.isSpotLight)(S=t.get(b)).position.setFromMatrixPosition(b.matrixWorld),S.position.applyMatrix4(g),S.color.copy(y).multiplyScalar(x),S.distance=w,S.direction.setFromMatrixPosition(b.matrixWorld),n.setFromMatrixPosition(b.target.matrixWorld),S.direction.sub(n),S.direction.transformDirection(g),S.coneCos=Math.cos(b.angle),S.penumbraCos=Math.cos(b.angle*(1-b.penumbra)),S.decay=0===b.distance?0:b.decay,S.shadow=b.castShadow,b.castShadow&&(E=b.shadow,S.shadowBias=E.bias,S.shadowRadius=E.radius,S.shadowMapSize=E.mapSize),e.spotShadowMap[f]=M,e.spotShadowMatrix[f]=b.shadow.matrix,e.spot[f]=S,f++;else if(b.isRectAreaLight)(S=t.get(b)).color.copy(y).multiplyScalar(x),S.position.setFromMatrixPosition(b.matrixWorld),S.position.applyMatrix4(g),r.identity(),i.copy(b.matrixWorld),i.premultiply(g),r.extractRotation(i),S.halfWidth.set(.5*b.width,0,0),S.halfHeight.set(0,.5*b.height,0),S.halfWidth.applyMatrix4(r),S.halfHeight.applyMatrix4(r),e.rectArea[p]=S,p++;else if(b.isPointLight)(S=t.get(b)).position.setFromMatrixPosition(b.matrixWorld),S.position.applyMatrix4(g),S.color.copy(b.color).multiplyScalar(b.intensity),S.distance=b.distance,S.decay=0===b.distance?0:b.decay,S.shadow=b.castShadow,b.castShadow&&(E=b.shadow,S.shadowBias=E.bias,S.shadowRadius=E.radius,S.shadowMapSize=E.mapSize,S.shadowCameraNear=E.camera.near,S.shadowCameraFar=E.camera.far),e.pointShadowMap[d]=M,e.pointShadowMatrix[d]=b.shadow.matrix,e.point[d]=S,d++;else if(b.isHemisphereLight){var S;(S=t.get(b)).direction.setFromMatrixPosition(b.matrixWorld),S.direction.transformDirection(g),S.direction.normalize(),S.skyColor.copy(b.color).multiplyScalar(x),S.groundColor.copy(b.groundColor).multiplyScalar(x),e.hemi[m]=S,m++}}e.ambient[0]=c,e.ambient[1]=l,e.ambient[2]=u,e.directional.length=h,e.spot.length=f,e.rectArea.length=p,e.point.length=d,e.hemi.length=m,e.hash=e.id+","+h+","+d+","+f+","+p+","+m+","+a.length},state:e}}function Fr(){var t=new Ur,e=[],n=[],i=[];return{init:function(){e.length=0,n.length=0,i.length=0},state:{lightsArray:e,shadowsArray:n,spritesArray:i,lights:t},setupLights:function(i){t.setup(e,n,i)},pushLight:function(t){e.push(t)},pushShadow:function(t){n.push(t)},pushSprite:function(t){i.push(t)}}}function Hr(){var t={};return{get:function(e,n){var i=e.id+","+n.id,r=t[i];return void 0===r&&(r=new Fr,t[i]=r),r},dispose:function(){t={}}}}function qr(t){li.call(this),this.type="MeshDepthMaterial",this.depthPacking=He,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(t)}function Gr(t){li.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Ye,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.lights=!1,this.setValues(t)}function Wr(t,e,n){for(var i=new dn,r=new Ve,o=new We,a=new We(n,n),s=new Ye,c=new Ye,l=1,u=2,h=1+(l|u),d=new Array(h),f=new Array(h),p={},m={0:S,1:E,2:A},g=[new Ye(1,0,0),new Ye(-1,0,0),new Ye(0,0,1),new Ye(0,0,-1),new Ye(0,1,0),new Ye(0,-1,0)],_=[new Ye(0,1,0),new Ye(0,1,0),new Ye(0,1,0),new Ye(0,1,0),new Ye(0,0,1),new Ye(0,0,-1)],v=[new on,new on,new on,new on,new on,new on],b=0;b!==h;++b){var y=0!=(b&l),x=0!=(b&u),M=new qr({depthPacking:qe,morphTargets:y,skinning:x});d[b]=M;var T=new Gr({morphTargets:y,skinning:x});f[b]=T}var k=this;function P(e,n,i,r,o,a){var s=e.geometry,c=null,h=d,g=e.customDepthMaterial;if(i&&(h=f,g=e.customDistanceMaterial),g)c=g;else{var _=!1;n.morphTargets&&(s&&s.isBufferGeometry?_=s.morphAttributes&&s.morphAttributes.position&&s.morphAttributes.position.length>0:s&&s.isGeometry&&(_=s.morphTargets&&s.morphTargets.length>0)),e.isSkinnedMesh&&!1===n.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e);var v=e.isSkinnedMesh&&n.skinning,b=0;_&&(b|=l),v&&(b|=u),c=h[b]}if(t.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var y=c.uuid,x=n.uuid,w=p[y];void 0===w&&(w={},p[y]=w);var M=w[x];void 0===M&&(M=c.clone(),w[x]=M),c=M}return c.visible=n.visible,c.wireframe=n.wireframe,c.side=null!=n.shadowSide?n.shadowSide:m[n.side],c.clipShadows=n.clipShadows,c.clippingPlanes=n.clippingPlanes,c.clipIntersection=n.clipIntersection,c.wireframeLinewidth=n.wireframeLinewidth,c.linewidth=n.linewidth,i&&c.isMeshDistanceMaterial&&(c.referencePosition.copy(r),c.nearDistance=o,c.farDistance=a),c}function L(n,r,o,a){if(!1!==n.visible){if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&n.castShadow&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);var s=e.update(n),l=n.material;if(Array.isArray(l))for(var u=s.groups,h=0,d=u.length;h<d;h++){var f=u[h],p=l[f.materialIndex];if(p&&p.visible){var m=P(n,p,a,c,o.near,o.far);t.renderBufferDirect(o,null,s,m,n,f)}}else if(l.visible){m=P(n,l,a,c,o.near,o.far);t.renderBufferDirect(o,null,s,m,n,null)}}for(var g=n.children,_=0,v=g.length;_<v;_++)L(g[_],r,o,a)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=w,this.render=function(e,n,l){if(!1!==k.enabled&&(!1!==k.autoUpdate||!1!==k.needsUpdate)&&0!==e.length){var u,h=t.context,d=t.state;d.disable(h.BLEND),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(var f=0,p=e.length;f<p;f++){var m=e[f],b=m.shadow,y=m&&m.isPointLight;if(void 0!==b){var x=b.camera;if(o.copy(b.mapSize),o.min(a),y){var w=o.x,M=o.y;v[0].set(2*w,M,w,M),v[1].set(0,M,w,M),v[2].set(3*w,M,w,M),v[3].set(w,M,w,M),v[4].set(3*w,0,w,M),v[5].set(w,0,w,M),o.x*=4,o.y*=2}if(null===b.map){var E={minFilter:Tt,magFilter:Tt,format:Xt};b.map=new an(o.x,o.y,E),b.map.texture.name=m.name+".shadowMap",x.updateProjectionMatrix()}b.isSpotLightShadow&&b.update(m);var S=b.map,A=b.matrix;c.setFromMatrixPosition(m.matrixWorld),x.position.copy(c),y?(u=6,A.makeTranslation(-c.x,-c.y,-c.z)):(u=1,s.setFromMatrixPosition(m.target.matrixWorld),x.lookAt(s),x.updateMatrixWorld(),A.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),A.multiply(x.projectionMatrix),A.multiply(x.matrixWorldInverse)),t.setRenderTarget(S),t.clear();for(var T=0;T<u;T++){if(y){s.copy(x.position),s.add(g[T]),x.up.copy(_[T]),x.lookAt(s),x.updateMatrixWorld();var P=v[T];d.viewport(P)}r.multiplyMatrices(x.projectionMatrix,x.matrixWorldInverse),i.setFromMatrix(r),L(n,l,x,y)}}else console.warn("THREE.WebGLShadowMap:",m,"has no shadow.")}k.needsUpdate=!1}}}function Vr(t,e,n,i,r,o,a,s,c){rn.call(this,t,e,n,i,r,o,a,s,c),this.needsUpdate=!0}function Xr(t,e,n,i,r){var o,a,s,c,l,u,h=new Ye,d=new Xe,f=new Ye;function p(){var t=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),n=new Uint16Array([0,1,2,0,2,3]);o=e.createBuffer(),a=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,o),e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,a),e.bufferData(e.ELEMENT_ARRAY_BUFFER,n,e.STATIC_DRAW),s=function(){var t=e.createProgram(),n=e.createShader(e.VERTEX_SHADER),i=e.createShader(e.FRAGMENT_SHADER);return e.shaderSource(n,["precision "+r.precision+" float;","#define SHADER_NAME SpriteMaterial","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 center;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float fogDepth;","void main() {","\tvUV = uvOffset + uv * uvScale;","\tvec2 alignedPosition = ( position - center ) * scale;","\tvec2 rotatedPosition;","\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","\tvec4 mvPosition;","\tmvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","\tmvPosition.xy += rotatedPosition;","\tgl_Position = projectionMatrix * mvPosition;","\tfogDepth = - mvPosition.z;","}"].join("\n")),e.shaderSource(i,["precision "+r.precision+" float;","#define SHADER_NAME SpriteMaterial","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","varying float fogDepth;","void main() {","\tvec4 texture = texture2D( map, vUV );","\tgl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","\tif ( gl_FragColor.a < alphaTest ) discard;","\tif ( fogType > 0 ) {","\t\tfloat fogFactor = 0.0;","\t\tif ( fogType == 1 ) {","\t\t\tfogFactor = smoothstep( fogNear, fogFar, fogDepth );","\t\t} else {","\t\t\tconst float LOG2 = 1.442695;","\t\t\tfogFactor = exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 );","\t\t\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","\t\t}","\t\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );","\t}","}"].join("\n")),e.compileShader(n),e.compileShader(i),e.attachShader(t,n),e.attachShader(t,i),e.linkProgram(t),t}(),c={position:e.getAttribLocation(s,"position"),uv:e.getAttribLocation(s,"uv")},l={uvOffset:e.getUniformLocation(s,"uvOffset"),uvScale:e.getUniformLocation(s,"uvScale"),rotation:e.getUniformLocation(s,"rotation"),center:e.getUniformLocation(s,"center"),scale:e.getUniformLocation(s,"scale"),color:e.getUniformLocation(s,"color"),map:e.getUniformLocation(s,"map"),opacity:e.getUniformLocation(s,"opacity"),modelViewMatrix:e.getUniformLocation(s,"modelViewMatrix"),projectionMatrix:e.getUniformLocation(s,"projectionMatrix"),fogType:e.getUniformLocation(s,"fogType"),fogDensity:e.getUniformLocation(s,"fogDensity"),fogNear:e.getUniformLocation(s,"fogNear"),fogFar:e.getUniformLocation(s,"fogFar"),fogColor:e.getUniformLocation(s,"fogColor"),fogDepth:e.getUniformLocation(s,"fogDepth"),alphaTest:e.getUniformLocation(s,"alphaTest")};var i=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");i.width=8,i.height=8;var h=i.getContext("2d");h.fillStyle="white",h.fillRect(0,0,8,8),u=new Vr(i)}function m(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:e.id-t.id}this.render=function(r,g,_){if(0!==r.length){void 0===s&&p(),n.useProgram(s),n.initAttributes(),n.enableAttribute(c.position),n.enableAttribute(c.uv),n.disableUnusedAttributes(),n.disable(e.CULL_FACE),n.enable(e.BLEND),e.bindBuffer(e.ARRAY_BUFFER,o),e.vertexAttribPointer(c.position,2,e.FLOAT,!1,16,0),e.vertexAttribPointer(c.uv,2,e.FLOAT,!1,16,8),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,a),e.uniformMatrix4fv(l.projectionMatrix,!1,_.projectionMatrix.elements),n.activeTexture(e.TEXTURE0),e.uniform1i(l.map,0);var v=0,b=0,y=g.fog;y?(e.uniform3f(l.fogColor,y.color.r,y.color.g,y.color.b),y.isFog?(e.uniform1f(l.fogNear,y.near),e.uniform1f(l.fogFar,y.far),e.uniform1i(l.fogType,1),v=1,b=1):y.isFogExp2&&(e.uniform1f(l.fogDensity,y.density),e.uniform1i(l.fogType,2),v=2,b=2)):(e.uniform1i(l.fogType,0),v=0,b=0);for(var x=0,w=r.length;x<w;x++){(S=r[x]).modelViewMatrix.multiplyMatrices(_.matrixWorldInverse,S.matrixWorld),S.z=-S.modelViewMatrix.elements[14]}r.sort(m);var M=[],E=[];for(x=0,w=r.length;x<w;x++){var S,A=(S=r[x]).material;if(!1!==A.visible){S.onBeforeRender(t,g,_,void 0,A,void 0),e.uniform1f(l.alphaTest,A.alphaTest),e.uniformMatrix4fv(l.modelViewMatrix,!1,S.modelViewMatrix.elements),S.matrixWorld.decompose(h,d,f),M[0]=f.x,M[1]=f.y,E[0]=S.center.x-.5,E[1]=S.center.y-.5;var T=0;g.fog&&A.fog&&(T=b),v!==T&&(e.uniform1i(l.fogType,T),v=T),null!==A.map?(e.uniform2f(l.uvOffset,A.map.offset.x,A.map.offset.y),e.uniform2f(l.uvScale,A.map.repeat.x,A.map.repeat.y)):(e.uniform2f(l.uvOffset,0,0),e.uniform2f(l.uvScale,1,1)),e.uniform1f(l.opacity,A.opacity),e.uniform3f(l.color,A.color.r,A.color.g,A.color.b),e.uniform1f(l.rotation,A.rotation),e.uniform2fv(l.center,E),e.uniform2fv(l.scale,M),n.setBlending(A.blending,A.blendEquation,A.blendSrc,A.blendDst,A.blendEquationAlpha,A.blendSrcAlpha,A.blendDstAlpha,A.premultipliedAlpha),n.buffers.depth.setTest(A.depthTest),n.buffers.depth.setMask(A.depthWrite),n.buffers.color.setMask(A.colorWrite),i.setTexture2D(A.map||u,0),e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0),S.onAfterRender(t,g,_,void 0,A,void 0)}}n.enable(e.CULL_FACE),n.reset()}}}function Yr(t,e,n){var i=new function(){var e=!1,n=new on,i=null,r=new on(0,0,0,0);return{setMask:function(n){i===n||e||(t.colorMask(n,n,n,n),i=n)},setLocked:function(t){e=t},setClear:function(e,i,o,a,s){!0===s&&(e*=a,i*=a,o*=a),n.set(e,i,o,a),!1===r.equals(n)&&(t.clearColor(e,i,o,a),r.copy(n))},reset:function(){e=!1,i=null,r.set(-1,0,0,0)}}},r=new function(){var e=!1,n=null,i=null,r=null;return{setTest:function(e){e?X(t.DEPTH_TEST):Y(t.DEPTH_TEST)},setMask:function(i){n===i||e||(t.depthMask(i),n=i)},setFunc:function(e){if(i!==e){if(e)switch(e){case tt:t.depthFunc(t.NEVER);break;case et:t.depthFunc(t.ALWAYS);break;case nt:t.depthFunc(t.LESS);break;case it:t.depthFunc(t.LEQUAL);break;case rt:t.depthFunc(t.EQUAL);break;case ot:t.depthFunc(t.GEQUAL);break;case at:t.depthFunc(t.GREATER);break;case st:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}else t.depthFunc(t.LEQUAL);i=e}},setLocked:function(t){e=t},setClear:function(e){r!==e&&(t.clearDepth(e),r=e)},reset:function(){e=!1,n=null,i=null,r=null}}},o=new function(){var e=!1,n=null,i=null,r=null,o=null,a=null,s=null,c=null,l=null;return{setTest:function(e){e?X(t.STENCIL_TEST):Y(t.STENCIL_TEST)},setMask:function(i){n===i||e||(t.stencilMask(i),n=i)},setFunc:function(e,n,a){i===e&&r===n&&o===a||(t.stencilFunc(e,n,a),i=e,r=n,o=a)},setOp:function(e,n,i){a===e&&s===n&&c===i||(t.stencilOp(e,n,i),a=e,s=n,c=i)},setLocked:function(t){e=t},setClear:function(e){l!==e&&(t.clearStencil(e),l=e)},reset:function(){e=!1,n=null,i=null,r=null,o=null,a=null,s=null,c=null,l=null}}},a=t.getParameter(t.MAX_VERTEX_ATTRIBS),s=new Uint8Array(a),c=new Uint8Array(a),l=new Uint8Array(a),u={},h=null,d=null,f=null,p=null,v=null,b=null,y=null,x=null,w=null,M=!1,E=null,T=null,k=null,P=null,L=null,O=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS),D=!1,j=0,U=t.getParameter(t.VERSION);-1!==U.indexOf("WebGL")?(j=parseFloat(/^WebGL\ ([0-9])/.exec(U)[1]),D=j>=1):-1!==U.indexOf("OpenGL ES")&&(j=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(U)[1]),D=j>=2);var F=null,H={},q=new on,G=new on;function W(e,n,i){var r=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(var a=0;a<i;a++)t.texImage2D(n+a,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,r);return o}var V={};function X(e){!0!==u[e]&&(t.enable(e),u[e]=!0)}function Y(e){!1!==u[e]&&(t.disable(e),u[e]=!1)}function K(e,i,r,o,a,s,c,l){if(e!==C?X(t.BLEND):Y(t.BLEND),e!==N){if(e!==f||l!==M)switch(e){case I:l?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ONE,t.ONE,t.ONE,t.ONE)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.SRC_ALPHA,t.ONE));break;case z:l?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ZERO,t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ONE_MINUS_SRC_ALPHA)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ZERO,t.ONE_MINUS_SRC_COLOR));break;case B:l?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ZERO,t.SRC_COLOR,t.ZERO,t.SRC_ALPHA)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ZERO,t.SRC_COLOR));break;default:l?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA)):(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA))}p=null,v=null,b=null,y=null,x=null,w=null}else a=a||i,s=s||r,c=c||o,i===p&&a===y||(t.blendEquationSeparate(n.convert(i),n.convert(a)),p=i,y=a),r===v&&o===b&&s===x&&c===w||(t.blendFuncSeparate(n.convert(r),n.convert(o),n.convert(s),n.convert(c)),v=r,b=o,x=s,w=c);f=e,M=l}function Z(e){E!==e&&(e?t.frontFace(t.CW):t.frontFace(t.CCW),E=e)}function J(e){e!==m?(X(t.CULL_FACE),e!==T&&(e===g?t.cullFace(t.BACK):e===_?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):Y(t.CULL_FACE),T=e}function Q(e,n,i){e?(X(t.POLYGON_OFFSET_FILL),P===n&&L===i||(t.polygonOffset(n,i),P=n,L=i)):Y(t.POLYGON_OFFSET_FILL)}function $(e){void 0===e&&(e=t.TEXTURE0+O-1),F!==e&&(t.activeTexture(e),F=e)}return V[t.TEXTURE_2D]=W(t.TEXTURE_2D,t.TEXTURE_2D,1),V[t.TEXTURE_CUBE_MAP]=W(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),i.setClear(0,0,0,1),r.setClear(1),o.setClear(0),X(t.DEPTH_TEST),r.setFunc(it),Z(!1),J(g),X(t.CULL_FACE),X(t.BLEND),K(R),{buffers:{color:i,depth:r,stencil:o},initAttributes:function(){for(var t=0,e=s.length;t<e;t++)s[t]=0},enableAttribute:function(n){s[n]=1,0===c[n]&&(t.enableVertexAttribArray(n),c[n]=1),0!==l[n]&&(e.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(n,0),l[n]=0)},enableAttributeAndDivisor:function(n,i){s[n]=1,0===c[n]&&(t.enableVertexAttribArray(n),c[n]=1),l[n]!==i&&(e.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(n,i),l[n]=i)},disableUnusedAttributes:function(){for(var e=0,n=c.length;e!==n;++e)c[e]!==s[e]&&(t.disableVertexAttribArray(e),c[e]=0)},enable:X,disable:Y,getCompressedTextureFormats:function(){if(null===h&&(h=[],e.get("WEBGL_compressed_texture_pvrtc")||e.get("WEBGL_compressed_texture_s3tc")||e.get("WEBGL_compressed_texture_etc1")||e.get("WEBGL_compressed_texture_astc")))for(var n=t.getParameter(t.COMPRESSED_TEXTURE_FORMATS),i=0;i<n.length;i++)h.push(n[i]);return h},useProgram:function(e){return d!==e&&(t.useProgram(e),d=e,!0)},setBlending:K,setMaterial:function(e,n){e.side===A?Y(t.CULL_FACE):X(t.CULL_FACE);var o=e.side===S;n&&(o=!o),Z(o),!0===e.transparent?K(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha):K(C),r.setFunc(e.depthFunc),r.setTest(e.depthTest),r.setMask(e.depthWrite),i.setMask(e.colorWrite),Q(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)},setFlipSided:Z,setCullFace:J,setLineWidth:function(e){e!==k&&(D&&t.lineWidth(e),k=e)},setPolygonOffset:Q,setScissorTest:function(e){e?X(t.SCISSOR_TEST):Y(t.SCISSOR_TEST)},activeTexture:$,bindTexture:function(e,n){null===F&&$();var i=H[F];void 0===i&&(i={type:void 0,texture:void 0},H[F]=i),i.type===e&&i.texture===n||(t.bindTexture(e,n||V[e]),i.type=e,i.texture=n)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===q.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),q.copy(e))},viewport:function(e){!1===G.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),G.copy(e))},reset:function(){for(var e=0;e<c.length;e++)1===c[e]&&(t.disableVertexAttribArray(e),c[e]=0);u={},h=null,F=null,H={},d=null,f=null,E=null,T=null,i.reset(),r.reset(),o.reset()}}}function Kr(t,e,n,i,r,o,a){var s,c="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext,l={};function u(t,e){if(t.width>e||t.height>e){if("data"in t)return void console.warn("THREE.WebGLRenderer: image in DataTexture is too big ("+t.width+"x"+t.height+").");var n=e/Math.max(t.width,t.height),i=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return i.width=Math.floor(t.width*n),i.height=Math.floor(t.height*n),i.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,i.width,i.height),console.warn("THREE.WebGLRenderer: image is too big ("+t.width+"x"+t.height+"). Resized to "+i.width+"x"+i.height,t),i}return t}function h(t){return Ge.isPowerOfTwo(t.width)&&Ge.isPowerOfTwo(t.height)}function d(t,e){return t.generateMipmaps&&e&&t.minFilter!==Tt&&t.minFilter!==Lt}function f(e,n,r,o){t.generateMipmap(e),i.get(n).__maxMipLevel=Math.log2(Math.max(r,o))}function p(e){return e===Tt||e===kt||e===Pt?t.NEAREST:t.LINEAR}function m(e){var n=e.target;n.removeEventListener("dispose",m),function(e){var n=i.get(e);if(e.image&&n.__image__webglTextureCube)t.deleteTexture(n.__image__webglTextureCube);else{if(void 0===n.__webglInit)return;t.deleteTexture(n.__webglTexture)}i.remove(e)}(n),n.isVideoTexture&&delete l[n.id],a.memory.textures--}function g(e){var n=e.target;n.removeEventListener("dispose",g),function(e){var n=i.get(e),r=i.get(e.texture);if(!e)return;void 0!==r.__webglTexture&&t.deleteTexture(r.__webglTexture);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLRenderTargetCube)for(var o=0;o<6;o++)t.deleteFramebuffer(n.__webglFramebuffer[o]),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[o]);else t.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer);i.remove(e.texture),i.remove(e)}(n),a.memory.textures--}function _(e,p){var g=i.get(e);if(e.isVideoTexture&&function(t){var e=t.id,n=a.render.frame;l[e]!==n&&(l[e]=n,t.update())}(e),e.version>0&&g.__version!==e.version){var _=e.image;if(void 0===_)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",e);else{if(!1!==_.complete)return void function(e,i,l){void 0===e.__webglInit&&(e.__webglInit=!0,i.addEventListener("dispose",m),e.__webglTexture=t.createTexture(),a.memory.textures++);n.activeTexture(t.TEXTURE0+l),n.bindTexture(t.TEXTURE_2D,e.__webglTexture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,i.unpackAlignment);var p=u(i.image,r.maxTextureSize);(function(t){return t.wrapS!==St||t.wrapT!==St||t.minFilter!==Tt&&t.minFilter!==Lt})(i)&&!1===h(p)&&(p=function(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof ImageBitmap?(void 0===s&&(s=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),s.width=Ge.floorPowerOfTwo(t.width),s.height=Ge.floorPowerOfTwo(t.height),s.getContext("2d").drawImage(t,0,0,s.width,s.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+t.width+"x"+t.height+"). Resized to "+s.width+"x"+s.height,t),s):t}(p));var g=h(p),_=o.convert(i.format),b=o.convert(i.type);v(t.TEXTURE_2D,i,g);var y,x=i.mipmaps;if(i.isDepthTexture){var w=t.DEPTH_COMPONENT;if(i.type===jt){if(!c)throw new Error("Float Depth Texture only supported in WebGL2.0");w=t.DEPTH_COMPONENT32F}else c&&(w=t.DEPTH_COMPONENT16);i.format===Jt&&w===t.DEPTH_COMPONENT&&i.type!==Bt&&i.type!==Dt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=Bt,b=o.convert(i.type)),i.format===Qt&&(w=t.DEPTH_STENCIL,i.type!==Gt&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=Gt,b=o.convert(i.type))),n.texImage2D(t.TEXTURE_2D,0,w,p.width,p.height,0,_,b,null)}else if(i.isDataTexture)if(x.length>0&&g){for(var M=0,E=x.length;M<E;M++)y=x[M],n.texImage2D(t.TEXTURE_2D,M,_,y.width,y.height,0,_,b,y.data);i.generateMipmaps=!1,e.__maxMipLevel=x.length-1}else n.texImage2D(t.TEXTURE_2D,0,_,p.width,p.height,0,_,b,p.data),e.__maxMipLevel=0;else if(i.isCompressedTexture){for(var M=0,E=x.length;M<E;M++)y=x[M],i.format!==Xt&&i.format!==Vt?n.getCompressedTextureFormats().indexOf(_)>-1?n.compressedTexImage2D(t.TEXTURE_2D,M,_,y.width,y.height,0,y.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(t.TEXTURE_2D,M,_,y.width,y.height,0,_,b,y.data);e.__maxMipLevel=x.length-1}else if(x.length>0&&g){for(var M=0,E=x.length;M<E;M++)y=x[M],n.texImage2D(t.TEXTURE_2D,M,_,_,b,y);i.generateMipmaps=!1,e.__maxMipLevel=x.length-1}else n.texImage2D(t.TEXTURE_2D,0,_,_,b,p),e.__maxMipLevel=0;d(i,g)&&f(t.TEXTURE_2D,i,p.width,p.height);e.__version=i.version,i.onUpdate&&i.onUpdate(i)}(g,e,p);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",e)}}n.activeTexture(t.TEXTURE0+p),n.bindTexture(t.TEXTURE_2D,g.__webglTexture)}function v(n,a,s){var c;if(s?(t.texParameteri(n,t.TEXTURE_WRAP_S,o.convert(a.wrapS)),t.texParameteri(n,t.TEXTURE_WRAP_T,o.convert(a.wrapT)),t.texParameteri(n,t.TEXTURE_MAG_FILTER,o.convert(a.magFilter)),t.texParameteri(n,t.TEXTURE_MIN_FILTER,o.convert(a.minFilter))):(t.texParameteri(n,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(n,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),a.wrapS===St&&a.wrapT===St||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",a),t.texParameteri(n,t.TEXTURE_MAG_FILTER,p(a.magFilter)),t.texParameteri(n,t.TEXTURE_MIN_FILTER,p(a.minFilter)),a.minFilter!==Tt&&a.minFilter!==Lt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",a)),c=e.get("EXT_texture_filter_anisotropic")){if(a.type===jt&&null===e.get("OES_texture_float_linear"))return;if(a.type===Ut&&null===e.get("OES_texture_half_float_linear"))return;(a.anisotropy>1||i.get(a).__currentAnisotropy)&&(t.texParameterf(n,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),i.get(a).__currentAnisotropy=a.anisotropy)}}function b(e,r,a,s){var c=o.convert(r.texture.format),l=o.convert(r.texture.type);n.texImage2D(s,0,c,r.width,r.height,0,c,l,null),t.bindFramebuffer(t.FRAMEBUFFER,e),t.framebufferTexture2D(t.FRAMEBUFFER,a,s,i.get(r.texture).__webglTexture,0),t.bindFramebuffer(t.FRAMEBUFFER,null)}function y(e,n){t.bindRenderbuffer(t.RENDERBUFFER,e),n.depthBuffer&&!n.stencilBuffer?(t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,n.width,n.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)):n.depthBuffer&&n.stencilBuffer?(t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,n.width,n.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)):t.renderbufferStorage(t.RENDERBUFFER,t.RGBA4,n.width,n.height),t.bindRenderbuffer(t.RENDERBUFFER,null)}function x(e){var n=i.get(e),r=!0===e.isWebGLRenderTargetCube;if(e.depthTexture){if(r)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,n){if(n&&n.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(t.FRAMEBUFFER,e),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");i.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),_(n.depthTexture,0);var r=i.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===Jt)t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,r,0);else{if(n.depthTexture.format!==Qt)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,r,0)}}(n.__webglFramebuffer,e)}else if(r){n.__webglDepthbuffer=[];for(var o=0;o<6;o++)t.bindFramebuffer(t.FRAMEBUFFER,n.__webglFramebuffer[o]),n.__webglDepthbuffer[o]=t.createRenderbuffer(),y(n.__webglDepthbuffer[o],e)}else t.bindFramebuffer(t.FRAMEBUFFER,n.__webglFramebuffer),n.__webglDepthbuffer=t.createRenderbuffer(),y(n.__webglDepthbuffer,e);t.bindFramebuffer(t.FRAMEBUFFER,null)}this.setTexture2D=_,this.setTextureCube=function(e,s){var c=i.get(e);if(6===e.image.length)if(e.version>0&&c.__version!==e.version){c.__image__webglTextureCube||(e.addEventListener("dispose",m),c.__image__webglTextureCube=t.createTexture(),a.memory.textures++),n.activeTexture(t.TEXTURE0+s),n.bindTexture(t.TEXTURE_CUBE_MAP,c.__image__webglTextureCube),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e.flipY);for(var l=e&&e.isCompressedTexture,p=e.image[0]&&e.image[0].isDataTexture,g=[],_=0;_<6;_++)g[_]=l||p?p?e.image[_].image:e.image[_]:u(e.image[_],r.maxCubemapSize);var b=g[0],y=h(b),x=o.convert(e.format),w=o.convert(e.type);for(v(t.TEXTURE_CUBE_MAP,e,y),_=0;_<6;_++)if(l)for(var M,E=g[_].mipmaps,S=0,A=E.length;S<A;S++)M=E[S],e.format!==Xt&&e.format!==Vt?n.getCompressedTextureFormats().indexOf(x)>-1?n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_,S,x,M.width,M.height,0,M.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_,S,x,M.width,M.height,0,x,w,M.data);else p?n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_,0,x,g[_].width,g[_].height,0,x,w,g[_].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_,0,x,x,w,g[_]);c.__maxMipLevel=l?E.length-1:0,d(e,y)&&f(t.TEXTURE_CUBE_MAP,e,b.width,b.height),c.__version=e.version,e.onUpdate&&e.onUpdate(e)}else n.activeTexture(t.TEXTURE0+s),n.bindTexture(t.TEXTURE_CUBE_MAP,c.__image__webglTextureCube)},this.setTextureCubeDynamic=function(e,r){n.activeTexture(t.TEXTURE0+r),n.bindTexture(t.TEXTURE_CUBE_MAP,i.get(e).__webglTexture)},this.setupRenderTarget=function(e){var r=i.get(e),o=i.get(e.texture);e.addEventListener("dispose",g),o.__webglTexture=t.createTexture(),a.memory.textures++;var s=!0===e.isWebGLRenderTargetCube,c=h(e);if(s){r.__webglFramebuffer=[];for(var l=0;l<6;l++)r.__webglFramebuffer[l]=t.createFramebuffer()}else r.__webglFramebuffer=t.createFramebuffer();if(s){for(n.bindTexture(t.TEXTURE_CUBE_MAP,o.__webglTexture),v(t.TEXTURE_CUBE_MAP,e.texture,c),l=0;l<6;l++)b(r.__webglFramebuffer[l],e,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+l);d(e.texture,c)&&f(t.TEXTURE_CUBE_MAP,e.texture,e.width,e.height),n.bindTexture(t.TEXTURE_CUBE_MAP,null)}else n.bindTexture(t.TEXTURE_2D,o.__webglTexture),v(t.TEXTURE_2D,e.texture,c),b(r.__webglFramebuffer,e,t.COLOR_ATTACHMENT0,t.TEXTURE_2D),d(e.texture,c)&&f(t.TEXTURE_2D,e.texture,e.width,e.height),n.bindTexture(t.TEXTURE_2D,null);e.depthBuffer&&x(e)},this.updateRenderTargetMipmap=function(e){var r=e.texture;if(d(r,h(e))){var o=e.isWebGLRenderTargetCube?t.TEXTURE_CUBE_MAP:t.TEXTURE_2D,a=i.get(r).__webglTexture;n.bindTexture(o,a),f(o,r,e.width,e.height),n.bindTexture(o,null)}}}function Zr(t,e){return{convert:function(n){var i;if(n===Et)return t.REPEAT;if(n===St)return t.CLAMP_TO_EDGE;if(n===At)return t.MIRRORED_REPEAT;if(n===Tt)return t.NEAREST;if(n===kt)return t.NEAREST_MIPMAP_NEAREST;if(n===Pt)return t.NEAREST_MIPMAP_LINEAR;if(n===Lt)return t.LINEAR;if(n===Ot)return t.LINEAR_MIPMAP_NEAREST;if(n===Ct)return t.LINEAR_MIPMAP_LINEAR;if(n===Rt)return t.UNSIGNED_BYTE;if(n===Ft)return t.UNSIGNED_SHORT_4_4_4_4;if(n===Ht)return t.UNSIGNED_SHORT_5_5_5_1;if(n===qt)return t.UNSIGNED_SHORT_5_6_5;if(n===It)return t.BYTE;if(n===zt)return t.SHORT;if(n===Bt)return t.UNSIGNED_SHORT;if(n===Nt)return t.INT;if(n===Dt)return t.UNSIGNED_INT;if(n===jt)return t.FLOAT;if(n===Ut&&null!==(i=e.get("OES_texture_half_float")))return i.HALF_FLOAT_OES;if(n===Wt)return t.ALPHA;if(n===Vt)return t.RGB;if(n===Xt)return t.RGBA;if(n===Yt)return t.LUMINANCE;if(n===Kt)return t.LUMINANCE_ALPHA;if(n===Jt)return t.DEPTH_COMPONENT;if(n===Qt)return t.DEPTH_STENCIL;if(n===D)return t.FUNC_ADD;if(n===j)return t.FUNC_SUBTRACT;if(n===U)return t.FUNC_REVERSE_SUBTRACT;if(n===q)return t.ZERO;if(n===G)return t.ONE;if(n===W)return t.SRC_COLOR;if(n===V)return t.ONE_MINUS_SRC_COLOR;if(n===X)return t.SRC_ALPHA;if(n===Y)return t.ONE_MINUS_SRC_ALPHA;if(n===K)return t.DST_ALPHA;if(n===Z)return t.ONE_MINUS_DST_ALPHA;if(n===J)return t.DST_COLOR;if(n===Q)return t.ONE_MINUS_DST_COLOR;if(n===$)return t.SRC_ALPHA_SATURATE;if((n===$t||n===te||n===ee||n===ne)&&null!==(i=e.get("WEBGL_compressed_texture_s3tc"))){if(n===$t)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===te)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===ee)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===ne)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((n===ie||n===re||n===oe||n===ae)&&null!==(i=e.get("WEBGL_compressed_texture_pvrtc"))){if(n===ie)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===re)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===oe)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===ae)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===se&&null!==(i=e.get("WEBGL_compressed_texture_etc1")))return i.COMPRESSED_RGB_ETC1_WEBGL;if((n===ce||n===le||n===ue||n===he||n===de||n===fe||n===pe||n===me||n===ge||n===_e||n===ve||n===be||n===ye||n===xe)&&null!==(i=e.get("WEBGL_compressed_texture_astc")))return n;if((n===F||n===H)&&null!==(i=e.get("EXT_blend_minmax"))){if(n===F)return i.MIN_EXT;if(n===H)return i.MAX_EXT}return n===Gt&&null!==(i=e.get("WEBGL_depth_texture"))?i.UNSIGNED_INT_24_8_WEBGL:0}}}function Jr(t,e,n,i){Ln.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==i?i:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function Qr(t){Jr.call(this),this.cameras=t||[]}function $r(t){var e=this,n=null,i=null,r=null,o=new Ve,a=new Ve;"undefined"!=typeof window&&"VRFrameData"in window&&(i=new window.VRFrameData);var s=new Ve,c=new Xe,l=new Ye,u=new Jr;u.bounds=new on(0,0,.5,1),u.layers.enable(1);var h=new Jr;h.bounds=new on(.5,0,.5,1),h.layers.enable(2);var d,f,p=new Qr([u,h]);function m(){if(null!==n&&n.isPresenting){var i=n.getEyeParameters("left"),r=i.renderWidth,o=i.renderHeight;f=t.getPixelRatio(),d=t.getSize(),t.setDrawingBufferSize(2*r,o,1)}else e.enabled&&t.setDrawingBufferSize(d.width,d.height,f)}p.layers.enable(1),p.layers.enable(2),"undefined"!=typeof window&&window.addEventListener("vrdisplaypresentchange",m,!1),this.enabled=!1,this.userHeight=1.6,this.getDevice=function(){return n},this.setDevice=function(t){void 0!==t&&(n=t)},this.setPoseTarget=function(t){void 0!==t&&(r=t)},this.getCamera=function(t){if(null===n)return t;n.depthNear=t.near,n.depthFar=t.far,n.getFrameData(i);var d=n.stageParameters;d?o.fromArray(d.sittingToStandingTransform):o.makeTranslation(0,e.userHeight,0);var f=i.pose,m=null!==r?r:t;if(m.matrix.copy(o),m.matrix.decompose(m.position,m.quaternion,m.scale),null!==f.orientation&&(c.fromArray(f.orientation),m.quaternion.multiply(c)),null!==f.position&&(c.setFromRotationMatrix(o),l.fromArray(f.position),l.applyQuaternion(c),m.position.add(l)),m.updateMatrixWorld(),!1===n.isPresenting)return t;u.near=t.near,h.near=t.near,u.far=t.far,h.far=t.far,p.matrixWorld.copy(t.matrixWorld),p.matrixWorldInverse.copy(t.matrixWorldInverse),u.matrixWorldInverse.fromArray(i.leftViewMatrix),h.matrixWorldInverse.fromArray(i.rightViewMatrix),a.getInverse(o),u.matrixWorldInverse.multiply(a),h.matrixWorldInverse.multiply(a);var g=m.parent;null!==g&&(s.getInverse(g.matrixWorld),u.matrixWorldInverse.multiply(s),h.matrixWorldInverse.multiply(s)),u.matrixWorld.getInverse(u.matrixWorldInverse),h.matrixWorld.getInverse(h.matrixWorldInverse),u.projectionMatrix.fromArray(i.leftProjectionMatrix),h.projectionMatrix.fromArray(i.rightProjectionMatrix),p.projectionMatrix.copy(u.projectionMatrix);var _=n.getLayers();if(_.length){var v=_[0];null!==v.leftBounds&&4===v.leftBounds.length&&u.bounds.fromArray(v.leftBounds),null!==v.rightBounds&&4===v.rightBounds.length&&h.bounds.fromArray(v.rightBounds)}return p},this.getStandingMatrix=function(){return o},this.submitFrame=function(){n&&n.isPresenting&&n.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",m)}}function to(t){console.log("THREE.WebGLRenderer",f);var e=void 0!==(t=t||{}).canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==t.context?t.context:null,i=void 0!==t.alpha&&t.alpha,r=void 0===t.depth||t.depth,o=void 0===t.stencil||t.stencil,a=void 0!==t.antialias&&t.antialias,s=void 0===t.premultipliedAlpha||t.premultipliedAlpha,c=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,l=void 0!==t.powerPreference?t.powerPreference:"default",u=null,h=null;this.domElement=e,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=dt,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var d,p,m,g,_,v,b,y,x,w,M,E,S,A,T,k,L,O,C,R=this,I=!1,z=null,B=null,N=-1,D="",j=null,U=null,F=new on,H=new on,q=null,G=0,W=e.width,V=e.height,X=1,Y=new on(0,0,W,V),K=new on(0,0,W,V),Z=!1,J=new dn,Q=new bi,$=!1,tt=!1,et=new Ve,nt=new Ye;function it(){return null===z?X:1}try{var rt={alpha:i,depth:r,stencil:o,antialias:a,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l};if(e.addEventListener("webglcontextlost",ct,!1),e.addEventListener("webglcontextrestored",lt,!1),null===(d=n||e.getContext("webgl",rt)||e.getContext("experimental-webgl",rt)))throw null!==e.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===d.getShaderPrecisionFormat&&(d.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){console.error("THREE.WebGLRenderer: "+t.message)}function ot(){(p=new yi(d)).get("WEBGL_depth_texture"),p.get("OES_texture_float"),p.get("OES_texture_float_linear"),p.get("OES_texture_half_float"),p.get("OES_texture_half_float_linear"),p.get("OES_standard_derivatives"),p.get("OES_element_index_uint"),p.get("ANGLE_instanced_arrays"),C=new Zr(d,p),m=new vi(d,p,t),(g=new Yr(d,p,C)).scissor(H.copy(K).multiplyScalar(X)),g.viewport(F.copy(Y).multiplyScalar(X)),_=new Mi(d),v=new Sr,b=new Kr(d,p,g,v,m,C,_),y=new xn(d),x=new xi(d,y,_),w=new Ai(x,_),T=new Si(d),M=new Er(R,p,m),E=new Pr,S=new Hr,A=new gi(R,g,x,s),k=new _i(d,p,_),L=new wi(d,p,_),O=new Xr(R,d,g,b,m),_.programs=M.programs,R.context=d,R.capabilities=m,R.extensions=p,R.properties=v,R.renderLists=E,R.state=g,R.info=_}ot();var at=new $r(R);this.vr=at;var st=new Wr(R,w,m.maxTextureSize);function ct(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),I=!0}function lt(){console.log("THREE.WebGLRenderer: Context Restored."),I=!1,ot()}function ut(t){var e=t.target;e.removeEventListener("dispose",ut),function(t){ht(t),v.remove(t)}(e)}function ht(t){var e=v.get(t).program;t.program=void 0,void 0!==e&&M.releaseProgram(e)}this.shadowMap=st,this.getContext=function(){return d},this.getContextAttributes=function(){return d.getContextAttributes()},this.forceContextLoss=function(){var t=p.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=p.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return X},this.setPixelRatio=function(t){void 0!==t&&(X=t,this.setSize(W,V,!1))},this.getSize=function(){return{width:W,height:V}},this.setSize=function(t,n,i){var r=at.getDevice();r&&r.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(W=t,V=n,e.width=t*X,e.height=n*X,!1!==i&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(){return{width:W*X,height:V*X}},this.setDrawingBufferSize=function(t,n,i){W=t,V=n,X=i,e.width=t*i,e.height=n*i,this.setViewport(0,0,t,n)},this.getCurrentViewport=function(){return F},this.setViewport=function(t,e,n,i){Y.set(t,V-e-i,n,i),g.viewport(F.copy(Y).multiplyScalar(X))},this.setScissor=function(t,e,n,i){K.set(t,V-e-i,n,i),g.scissor(H.copy(K).multiplyScalar(X))},this.setScissorTest=function(t){g.setScissorTest(Z=t)},this.getClearColor=function(){return A.getClearColor()},this.setClearColor=function(){A.setClearColor.apply(A,arguments)},this.getClearAlpha=function(){return A.getClearAlpha()},this.setClearAlpha=function(){A.setClearAlpha.apply(A,arguments)},this.clear=function(t,e,n){var i=0;(void 0===t||t)&&(i|=d.COLOR_BUFFER_BIT),(void 0===e||e)&&(i|=d.DEPTH_BUFFER_BIT),(void 0===n||n)&&(i|=d.STENCIL_BUFFER_BIT),d.clear(i)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.clearTarget=function(t,e,n,i){this.setRenderTarget(t),this.clear(e,n,i)},this.dispose=function(){e.removeEventListener("webglcontextlost",ct,!1),e.removeEventListener("webglcontextrestored",lt,!1),E.dispose(),S.dispose(),v.dispose(),w.dispose(),at.dispose(),gt()},this.renderBufferImmediate=function(t,e,n){g.initAttributes();var i=v.get(t);t.hasPositions&&!i.position&&(i.position=d.createBuffer()),t.hasNormals&&!i.normal&&(i.normal=d.createBuffer()),t.hasUvs&&!i.uv&&(i.uv=d.createBuffer()),t.hasColors&&!i.color&&(i.color=d.createBuffer());var r=e.getAttributes();if(t.hasPositions&&(d.bindBuffer(d.ARRAY_BUFFER,i.position),d.bufferData(d.ARRAY_BUFFER,t.positionArray,d.DYNAMIC_DRAW),g.enableAttribute(r.position),d.vertexAttribPointer(r.position,3,d.FLOAT,!1,0,0)),t.hasNormals){if(d.bindBuffer(d.ARRAY_BUFFER,i.normal),!n.isMeshPhongMaterial&&!n.isMeshStandardMaterial&&!n.isMeshNormalMaterial&&!0===n.flatShading)for(var o=0,a=3*t.count;o<a;o+=9){var s=t.normalArray,c=(s[o+0]+s[o+3]+s[o+6])/3,l=(s[o+1]+s[o+4]+s[o+7])/3,u=(s[o+2]+s[o+5]+s[o+8])/3;s[o+0]=c,s[o+1]=l,s[o+2]=u,s[o+3]=c,s[o+4]=l,s[o+5]=u,s[o+6]=c,s[o+7]=l,s[o+8]=u}d.bufferData(d.ARRAY_BUFFER,t.normalArray,d.DYNAMIC_DRAW),g.enableAttribute(r.normal),d.vertexAttribPointer(r.normal,3,d.FLOAT,!1,0,0)}t.hasUvs&&n.map&&(d.bindBuffer(d.ARRAY_BUFFER,i.uv),d.bufferData(d.ARRAY_BUFFER,t.uvArray,d.DYNAMIC_DRAW),g.enableAttribute(r.uv),d.vertexAttribPointer(r.uv,2,d.FLOAT,!1,0,0)),t.hasColors&&n.vertexColors!==P&&(d.bindBuffer(d.ARRAY_BUFFER,i.color),d.bufferData(d.ARRAY_BUFFER,t.colorArray,d.DYNAMIC_DRAW),g.enableAttribute(r.color),d.vertexAttribPointer(r.color,3,d.FLOAT,!1,0,0)),g.disableUnusedAttributes(),d.drawArrays(d.TRIANGLES,0,t.count),t.count=0},this.renderBufferDirect=function(t,e,n,i,r,o){var a=r.isMesh&&r.matrixWorld.determinant()<0;g.setMaterial(i,a);var s=wt(t,e,i,r),c=n.id+"_"+s.id+"_"+(!0===i.wireframe),l=!1;c!==D&&(D=c,l=!0),r.morphTargetInfluences&&(T.update(r,n,i,s),l=!0);var u,h=n.index,f=n.attributes.position,m=1;!0===i.wireframe&&(h=x.getWireframeAttribute(n),m=2);var _=k;null!==h&&(u=y.get(h),(_=L).setIndex(u)),l&&(!function(t,e,n,i){if(n&&n.isInstancedBufferGeometry&&null===p.get("ANGLE_instanced_arrays"))return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");void 0===i&&(i=0);g.initAttributes();var r=n.attributes,o=e.getAttributes(),a=t.defaultAttributeValues;for(var s in o){var c=o[s];if(c>=0){var l=r[s];if(void 0!==l){var u=l.normalized,h=l.itemSize,f=y.get(l);if(void 0===f)continue;var m=f.buffer,_=f.type,v=f.bytesPerElement;if(l.isInterleavedBufferAttribute){var b=l.data,x=b.stride,w=l.offset;b&&b.isInstancedInterleavedBuffer?(g.enableAttributeAndDivisor(c,b.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=b.meshPerAttribute*b.count)):g.enableAttribute(c),d.bindBuffer(d.ARRAY_BUFFER,m),d.vertexAttribPointer(c,h,_,u,x*v,(i*x+w)*v)}else l.isInstancedBufferAttribute?(g.enableAttributeAndDivisor(c,l.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=l.meshPerAttribute*l.count)):g.enableAttribute(c),d.bindBuffer(d.ARRAY_BUFFER,m),d.vertexAttribPointer(c,h,_,u,0,i*h*v)}else if(void 0!==a){var M=a[s];if(void 0!==M)switch(M.length){case 2:d.vertexAttrib2fv(c,M);break;case 3:d.vertexAttrib3fv(c,M);break;case 4:d.vertexAttrib4fv(c,M);break;default:d.vertexAttrib1fv(c,M)}}}}g.disableUnusedAttributes()}(i,s,n),null!==h&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,u.buffer));var v=1/0;null!==h?v=h.count:void 0!==f&&(v=f.count);var b=n.drawRange.start*m,w=n.drawRange.count*m,M=null!==o?o.start*m:0,E=null!==o?o.count*m:1/0,S=Math.max(b,M),A=Math.min(v,b+w,M+E)-1,P=Math.max(0,A-S+1);if(0!==P){if(r.isMesh)if(!0===i.wireframe)g.setLineWidth(i.wireframeLinewidth*it()),_.setMode(d.LINES);else switch(r.drawMode){case Oe:_.setMode(d.TRIANGLES);break;case Ce:_.setMode(d.TRIANGLE_STRIP);break;case Re:_.setMode(d.TRIANGLE_FAN)}else if(r.isLine){var O=i.linewidth;void 0===O&&(O=1),g.setLineWidth(O*it()),r.isLineSegments?_.setMode(d.LINES):r.isLineLoop?_.setMode(d.LINE_LOOP):_.setMode(d.LINE_STRIP)}else r.isPoints&&_.setMode(d.POINTS);n&&n.isInstancedBufferGeometry?n.maxInstancedCount>0&&_.renderInstances(n,S,P):_.render(S,P)}},this.compile=function(t,e){(h=S.get(t,e)).init(),t.traverse(function(t){t.isLight&&(h.pushLight(t),t.castShadow&&h.pushShadow(t))}),h.setupLights(e),t.traverse(function(e){if(e.material)if(Array.isArray(e.material))for(var n=0;n<e.material.length;n++)xt(e.material[n],t.fog,e);else xt(e.material,t.fog,e)})};var ft,pt=!1,mt=null;function gt(){pt=!1}function _t(){var t=at.getDevice();t&&t.isPresenting?t.requestAnimationFrame(vt):window.requestAnimationFrame(vt)}function vt(t){!1!==pt&&(mt(t),_t())}function bt(t,e,n,i){for(var r=0,o=t.length;r<o;r++){var a=t[r],s=a.object,c=a.geometry,l=void 0===i?a.material:i,u=a.group;if(n.isArrayCamera){U=n;for(var h=n.cameras,d=0,f=h.length;d<f;d++){var p=h[d];if(s.layers.test(p.layers)){var m=p.bounds,_=m.x*W,v=m.y*V,b=m.z*W,y=m.w*V;g.viewport(F.set(_,v,b,y).multiplyScalar(X)),yt(s,e,p,c,l,u)}}}else U=null,yt(s,e,n,c,l,u)}}function yt(t,e,n,i,r,o){if(t.onBeforeRender(R,e,n,i,r,o),h=S.get(e,U||n),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){var a=t.isMesh&&t.matrixWorld.determinant()<0;g.setMaterial(r,a);var s=wt(n,e.fog,r,t);D="",function(t,e,n){t.render(function(t){R.renderBufferImmediate(t,e,n)})}(t,s,r)}else R.renderBufferDirect(n,e.fog,i,r,t,o);t.onAfterRender(R,e,n,i,r,o),h=S.get(e,U||n)}function xt(t,e,n){var i=v.get(t),r=h.state.lights,o=h.state.shadowsArray,a=M.getParameters(t,r.state,o,e,Q.numPlanes,Q.numIntersection,n),s=M.getProgramCode(t,a),c=i.program,l=!0;if(void 0===c)t.addEventListener("dispose",ut);else if(c.code!==s)ht(t);else if(i.lightsHash!==r.state.hash)v.update(t,"lightsHash",r.state.hash),l=!1;else{if(void 0!==a.shaderID)return;l=!1}if(l){if(a.shaderID){var u=yn[a.shaderID];i.shader={name:t.type,uniforms:mn.clone(u.uniforms),vertexShader:u.vertexShader,fragmentShader:u.fragmentShader}}else i.shader={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};t.onBeforeCompile(i.shader,R),c=M.acquireProgram(t,i.shader,a,s),i.program=c,t.program=c}var d=c.getAttributes();if(t.morphTargets){t.numSupportedMorphTargets=0;for(var f=0;f<R.maxMorphTargets;f++)d["morphTarget"+f]>=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(f=0;f<R.maxMorphNormals;f++)d["morphNormal"+f]>=0&&t.numSupportedMorphNormals++}var p=i.shader.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(i.numClippingPlanes=Q.numPlanes,i.numIntersection=Q.numIntersection,p.clippingPlanes=Q.uniform),i.fog=e,i.lightsHash=r.state.hash,t.lights&&(p.ambientLightColor.value=r.state.ambient,p.directionalLights.value=r.state.directional,p.spotLights.value=r.state.spot,p.rectAreaLights.value=r.state.rectArea,p.pointLights.value=r.state.point,p.hemisphereLights.value=r.state.hemi,p.directionalShadowMap.value=r.state.directionalShadowMap,p.directionalShadowMatrix.value=r.state.directionalShadowMatrix,p.spotShadowMap.value=r.state.spotShadowMap,p.spotShadowMatrix.value=r.state.spotShadowMatrix,p.pointShadowMap.value=r.state.pointShadowMap,p.pointShadowMatrix.value=r.state.pointShadowMatrix);var m=i.program.getUniforms(),g=dr.seqWithValue(m.seq,p);i.uniformsList=g}function wt(t,e,n,i){G=0;var r=v.get(n),o=h.state.lights;if($&&(tt||t!==j)){var a=t===j&&n.id===N;Q.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,t,r,a)}!1===n.needsUpdate&&(void 0===r.program?n.needsUpdate=!0:n.fog&&r.fog!==e?n.needsUpdate=!0:n.lights&&r.lightsHash!==o.state.hash?n.needsUpdate=!0:void 0===r.numClippingPlanes||r.numClippingPlanes===Q.numPlanes&&r.numIntersection===Q.numIntersection||(n.needsUpdate=!0)),n.needsUpdate&&(xt(n,e,i),n.needsUpdate=!1);var s,c,l=!1,u=!1,f=!1,p=r.program,_=p.getUniforms(),b=r.shader.uniforms;if(g.useProgram(p.program)&&(l=!0,u=!0,f=!0),n.id!==N&&(N=n.id,u=!0),l||t!==j){if(_.setValue(d,"projectionMatrix",t.projectionMatrix),m.logarithmicDepthBuffer&&_.setValue(d,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),j!==(U||t)&&(j=U||t,u=!0,f=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.envMap){var y=_.map.cameraPosition;void 0!==y&&y.setValue(d,nt.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&_.setValue(d,"viewMatrix",t.matrixWorldInverse)}if(n.skinning){_.setOptional(d,i,"bindMatrix"),_.setOptional(d,i,"bindMatrixInverse");var x=i.skeleton;if(x){var w=x.bones;if(m.floatVertexTextures){if(void 0===x.boneTexture){var M=Math.sqrt(4*w.length);M=Ge.ceilPowerOfTwo(M),M=Math.max(M,4);var E=new Float32Array(M*M*4);E.set(x.boneMatrices);var S=new cn(E,M,M,Xt,jt);S.needsUpdate=!0,x.boneMatrices=E,x.boneTexture=S,x.boneTextureSize=M}_.setValue(d,"boneTexture",x.boneTexture),_.setValue(d,"boneTextureSize",x.boneTextureSize)}else _.setOptional(d,x,"boneMatrices")}}return u&&(_.setValue(d,"toneMappingExposure",R.toneMappingExposure),_.setValue(d,"toneMappingWhitePoint",R.toneMappingWhitePoint),n.lights&&(c=f,(s=b).ambientLightColor.needsUpdate=c,s.directionalLights.needsUpdate=c,s.pointLights.needsUpdate=c,s.spotLights.needsUpdate=c,s.rectAreaLights.needsUpdate=c,s.hemisphereLights.needsUpdate=c),e&&n.fog&&function(t,e){t.fogColor.value=e.color,e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)}(b,e),n.isMeshBasicMaterial?Mt(b,n):n.isMeshLambertMaterial?(Mt(b,n),function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(b,n)):n.isMeshPhongMaterial?(Mt(b,n),n.isMeshToonMaterial?function(t,e){Et(t,e),e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(b,n):Et(b,n)):n.isMeshStandardMaterial?(Mt(b,n),n.isMeshPhysicalMaterial?function(t,e){t.clearCoat.value=e.clearCoat,t.clearCoatRoughness.value=e.clearCoatRoughness,St(t,e)}(b,n):St(b,n)):n.isMeshDepthMaterial?(Mt(b,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(b,n)):n.isMeshDistanceMaterial?(Mt(b,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias);t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(b,n)):n.isMeshNormalMaterial?(Mt(b,n),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale);e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale));e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(b,n)):n.isLineBasicMaterial?(function(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity}(b,n),n.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(b,n)):n.isPointsMaterial?function(t,e){if(t.diffuse.value=e.color,t.opacity.value=e.opacity,t.size.value=e.size*X,t.scale.value=.5*V,t.map.value=e.map,null!==e.map){if(!0===e.map.matrixAutoUpdate){var n=e.map.offset,i=e.map.repeat,r=e.map.rotation,o=e.map.center;e.map.matrix.setUvTransform(n.x,n.y,i.x,i.y,r,o.x,o.y)}t.uvTransform.value.copy(e.map.matrix)}}(b,n):n.isShadowMaterial&&(b.color.value=n.color,b.opacity.value=n.opacity),void 0!==b.ltc_1&&(b.ltc_1.value=bn.LTC_1),void 0!==b.ltc_2&&(b.ltc_2.value=bn.LTC_2),dr.upload(d,r.uniformsList,b,R)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(dr.upload(d,r.uniformsList,b,R),n.uniformsNeedUpdate=!1),_.setValue(d,"modelViewMatrix",i.modelViewMatrix),_.setValue(d,"normalMatrix",i.normalMatrix),_.setValue(d,"modelMatrix",i.matrixWorld),p}function Mt(t,e){var n;if(t.opacity.value=e.opacity,e.color&&(t.diffuse.value=e.color),e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.specularMap&&(t.specularMap.value=e.specularMap),e.envMap&&(t.envMap.value=e.envMap,t.flipEnvMap.value=e.envMap&&e.envMap.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio,t.maxMipLevel.value=v.get(e.envMap).__maxMipLevel),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity),e.map?n=e.map:e.specularMap?n=e.specularMap:e.displacementMap?n=e.displacementMap:e.normalMap?n=e.normalMap:e.bumpMap?n=e.bumpMap:e.roughnessMap?n=e.roughnessMap:e.metalnessMap?n=e.metalnessMap:e.alphaMap?n=e.alphaMap:e.emissiveMap&&(n=e.emissiveMap),void 0!==n){if(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate){var i=n.offset,r=n.repeat,o=n.rotation,a=n.center;n.matrix.setUvTransform(i.x,i.y,r.x,r.y,o,a.x,a.y)}t.uvTransform.value.copy(n.matrix)}}function Et(t,e){t.specular.value=e.specular,t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale)),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function St(t,e){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale)),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}this.animate=function(t){null!==(mt=t)?pt||(_t(),pt=!0):gt()},this.render=function(t,e,n,i){if(e&&e.isCamera){if(!I){D="",N=-1,j=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),at.enabled&&(e=at.getCamera(e)),(h=S.get(t,e)).init(),t.onBeforeRender(R,t,e,n),et.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),J.setFromMatrix(et),tt=this.localClippingEnabled,$=Q.init(this.clippingPlanes,tt,e),(u=E.get(t,e)).init(),function t(e,n,i){if(!1===e.visible)return;var r=e.layers.test(n.layers);if(r)if(e.isLight)h.pushLight(e),e.castShadow&&h.pushShadow(e);else if(e.isSprite)e.frustumCulled&&!J.intersectsSprite(e)||h.pushSprite(e);else if(e.isImmediateRenderObject)i&&nt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(et),u.push(e,null,e.material,nt.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.update(),!e.frustumCulled||J.intersectsObject(e))){i&&nt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(et);var o=w.update(e),a=e.material;if(Array.isArray(a))for(var s=o.groups,c=0,l=s.length;c<l;c++){var d=s[c],f=a[d.materialIndex];f&&f.visible&&u.push(e,o,f,nt.z,d)}else a.visible&&u.push(e,o,a,nt.z,null)}var p=e.children;for(var c=0,l=p.length;c<l;c++)t(p[c],n,i)}(t,e,R.sortObjects),!0===R.sortObjects&&u.sort(),$&&Q.beginShadows();var r=h.state.shadowsArray;st.render(r,t,e),h.setupLights(e),$&&Q.endShadows(),this.info.autoReset&&this.info.reset(),void 0===n&&(n=null),this.setRenderTarget(n),A.render(u,t,e,i);var o=u.opaque,a=u.transparent;if(t.overrideMaterial){var s=t.overrideMaterial;o.length&&bt(o,t,e,s),a.length&&bt(a,t,e,s)}else o.length&&bt(o,t,e),a.length&&bt(a,t,e);var c=h.state.spritesArray;O.render(c,t,e),n&&b.updateRenderTargetMipmap(n),g.buffers.depth.setTest(!0),g.buffers.depth.setMask(!0),g.buffers.color.setMask(!0),g.setPolygonOffset(!1),t.onAfterRender(R,t,e),at.enabled&&at.submitFrame(),u=null,h=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.allocTextureUnit=function(){var t=G;return t>=m.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+t+" texture units while this GPU supports only "+m.maxTextures),G+=1,t},this.setTexture2D=(ft=!1,function(t,e){t&&t.isWebGLRenderTarget&&(ft||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),ft=!0),t=t.texture),b.setTexture2D(t,e)}),this.setTexture=function(){var t=!1;return function(e,n){t||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),t=!0),b.setTexture2D(e,n)}}(),this.setTextureCube=function(){var t=!1;return function(e,n){e&&e.isWebGLRenderTargetCube&&(t||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),t=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?b.setTextureCube(e,n):b.setTextureCubeDynamic(e,n)}}(),this.getRenderTarget=function(){return z},this.setRenderTarget=function(t){z=t,t&&void 0===v.get(t).__webglFramebuffer&&b.setupRenderTarget(t);var e=null,n=!1;if(t){var i=v.get(t).__webglFramebuffer;t.isWebGLRenderTargetCube?(e=i[t.activeCubeFace],n=!0):e=i,F.copy(t.viewport),H.copy(t.scissor),q=t.scissorTest}else F.copy(Y).multiplyScalar(X),H.copy(K).multiplyScalar(X),q=Z;if(B!==e&&(d.bindFramebuffer(d.FRAMEBUFFER,e),B=e),g.viewport(F),g.scissor(H),g.setScissorTest(q),n){var r=v.get(t.texture);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_CUBE_MAP_POSITIVE_X+t.activeCubeFace,r.__webglTexture,t.activeMipMapLevel)}},this.readRenderTargetPixels=function(t,e,n,i,r,o){if(t&&t.isWebGLRenderTarget){var a=v.get(t).__webglFramebuffer;if(a){var s=!1;a!==B&&(d.bindFramebuffer(d.FRAMEBUFFER,a),s=!0);try{var c=t.texture,l=c.format,u=c.type;if(l!==Xt&&C.convert(l)!==d.getParameter(d.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(u===Rt||C.convert(u)===d.getParameter(d.IMPLEMENTATION_COLOR_READ_TYPE)||u===jt&&(p.get("OES_texture_float")||p.get("WEBGL_color_buffer_float"))||u===Ut&&p.get("EXT_color_buffer_half_float")))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");d.checkFramebufferStatus(d.FRAMEBUFFER)===d.FRAMEBUFFER_COMPLETE?e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r&&d.readPixels(e,n,i,r,C.convert(l),C.convert(u),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&d.bindFramebuffer(d.FRAMEBUFFER,B)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,e,n){var i=e.image.width,r=e.image.height,o=C.convert(e.format);this.setTexture2D(e,0),d.copyTexImage2D(d.TEXTURE_2D,n||0,o,t.x,t.y,i,r,0)},this.copyTextureToTexture=function(t,e,n,i){var r=e.image.width,o=e.image.height,a=C.convert(n.format),s=C.convert(n.type),c=e.isDataTexture?e.image.data:e.image;this.setTexture2D(n,0),d.texSubImage2D(d.TEXTURE_2D,i||0,t.x,t.y,r,o,a,s,c)}}function eo(t,e){this.name="",this.color=new _n(t),this.density=void 0!==e?e:25e-5}function no(t,e,n){this.name="",this.color=new _n(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3}function io(){Pn.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function ro(t){li.call(this),this.type="SpriteMaterial",this.color=new _n(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(t)}function oo(t){Pn.call(this),this.type="Sprite",this.material=void 0!==t?t:new ro,this.center=new We(.5,.5)}function ao(){Pn.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function so(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new Ve)}}function co(){Pn.call(this),this.type="Bone"}function lo(t,e){mi.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Ve,this.bindMatrixInverse=new Ve;var n=new so(this.initBones());this.bind(n,this.matrixWorld),this.normalizeSkinWeights()}function uo(t){li.call(this),this.type="LineBasicMaterial",this.color=new _n(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(t)}function ho(t,e,n){if(1===n)return console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new fo(t,e);Pn.call(this),this.type="Line",this.geometry=void 0!==t?t:new Zn,this.material=void 0!==e?e:new uo({color:16777215*Math.random()})}function fo(t,e){ho.call(this,t,e),this.type="LineSegments"}function po(t,e){ho.call(this,t,e),this.type="LineLoop"}function mo(t){li.call(this),this.type="PointsMaterial",this.color=new _n(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.lights=!1,this.setValues(t)}function go(t,e){Pn.call(this),this.type="Points",this.geometry=void 0!==t?t:new Zn,this.material=void 0!==e?e:new mo({color:16777215*Math.random()})}function _o(){Pn.call(this),this.type="Group"}function vo(t,e,n,i,r,o,a,s,c){rn.call(this,t,e,n,i,r,o,a,s,c),this.generateMipmaps=!1}function bo(t,e,n,i,r,o,a,s,c,l,u,h){rn.call(this,null,o,a,s,c,l,i,r,u,h),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function yo(t,e,n,i,r,o,a,s,c,l){if((l=void 0!==l?l:Jt)!==Jt&&l!==Qt)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&l===Jt&&(n=Bt),void 0===n&&l===Qt&&(n=Gt),rn.call(this,null,i,r,o,a,s,l,n,c),this.image={width:t,height:e},this.magFilter=void 0!==a?a:Tt,this.minFilter=void 0!==s?s:Tt,this.flipY=!1,this.generateMipmaps=!1}function xo(t){Zn.call(this),this.type="WireframeGeometry";var e,n,i,r,o,a,s,c,l,u,h=[],d=[0,0],f={},p=["a","b","c"];if(t&&t.isGeometry){var m=t.faces;for(e=0,i=m.length;e<i;e++){var g=m[e];for(n=0;n<3;n++)s=g[p[n]],c=g[p[(n+1)%3]],d[0]=Math.min(s,c),d[1]=Math.max(s,c),void 0===f[l=d[0]+","+d[1]]&&(f[l]={index1:d[0],index2:d[1]})}for(l in f)a=f[l],u=t.vertices[a.index1],h.push(u.x,u.y,u.z),u=t.vertices[a.index2],h.push(u.x,u.y,u.z)}else if(t&&t.isBufferGeometry){var _,v,b,y,x,w,M;if(u=new Ye,null!==t.index){for(_=t.attributes.position,v=t.index,0===(b=t.groups).length&&(b=[{start:0,count:v.count,materialIndex:0}]),r=0,o=b.length;r<o;++r)for(e=x=(y=b[r]).start,i=x+y.count;e<i;e+=3)for(n=0;n<3;n++)s=v.getX(e+n),c=v.getX(e+(n+1)%3),d[0]=Math.min(s,c),d[1]=Math.max(s,c),void 0===f[l=d[0]+","+d[1]]&&(f[l]={index1:d[0],index2:d[1]});for(l in f)a=f[l],u.fromBufferAttribute(_,a.index1),h.push(u.x,u.y,u.z),u.fromBufferAttribute(_,a.index2),h.push(u.x,u.y,u.z)}else for(e=0,i=(_=t.attributes.position).count/3;e<i;e++)for(n=0;n<3;n++)w=3*e+n,u.fromBufferAttribute(_,w),h.push(u.x,u.y,u.z),M=3*e+(n+1)%3,u.fromBufferAttribute(_,M),h.push(u.x,u.y,u.z)}this.addAttribute("position",new Wn(h,3))}function wo(t,e,n){Bn.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:n},this.fromBufferGeometry(new Mo(t,e,n)),this.mergeVertices()}function Mo(t,e,n){Zn.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:n};var i,r,o=[],a=[],s=[],c=[],l=new Ye,u=new Ye,h=new Ye,d=new Ye,f=new Ye,p=e+1;for(i=0;i<=n;i++){var m=i/n;for(r=0;r<=e;r++){var g=r/e;t(g,m,u),a.push(u.x,u.y,u.z),g-1e-5>=0?(t(g-1e-5,m,h),d.subVectors(u,h)):(t(g+1e-5,m,h),d.subVectors(h,u)),m-1e-5>=0?(t(g,m-1e-5,h),f.subVectors(u,h)):(t(g,m+1e-5,h),f.subVectors(h,u)),l.crossVectors(d,f).normalize(),s.push(l.x,l.y,l.z),c.push(g,m)}}for(i=0;i<n;i++)for(r=0;r<e;r++){var _=i*p+r,v=i*p+r+1,b=(i+1)*p+r+1,y=(i+1)*p+r;o.push(_,v,y),o.push(v,b,y)}this.setIndex(o),this.addAttribute("position",new Wn(a,3)),this.addAttribute("normal",new Wn(s,3)),this.addAttribute("uv",new Wn(c,2))}function Eo(t,e,n,i){Bn.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i},this.fromBufferGeometry(new So(t,e,n,i)),this.mergeVertices()}function So(t,e,n,i){Zn.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i},n=n||1;var r=[],o=[];function a(t,e,n,i){var r,o,a=Math.pow(2,i),c=[];for(r=0;r<=a;r++){c[r]=[];var l=t.clone().lerp(n,r/a),u=e.clone().lerp(n,r/a),h=a-r;for(o=0;o<=h;o++)c[r][o]=0===o&&r===a?l:l.clone().lerp(u,o/h)}for(r=0;r<a;r++)for(o=0;o<2*(a-r)-1;o++){var d=Math.floor(o/2);o%2==0?(s(c[r][d+1]),s(c[r+1][d]),s(c[r][d])):(s(c[r][d+1]),s(c[r+1][d+1]),s(c[r+1][d]))}}function s(t){r.push(t.x,t.y,t.z)}function c(e,n){var i=3*e;n.x=t[i+0],n.y=t[i+1],n.z=t[i+2]}function l(t,e,n,i){i<0&&1===t.x&&(o[e]=t.x-1),0===n.x&&0===n.z&&(o[e]=i/2/Math.PI+.5)}function u(t){return Math.atan2(t.z,-t.x)}function h(t){return Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))}!function(t){for(var n=new Ye,i=new Ye,r=new Ye,o=0;o<e.length;o+=3)c(e[o+0],n),c(e[o+1],i),c(e[o+2],r),a(n,i,r,t)}(i=i||0),function(t){for(var e=new Ye,n=0;n<r.length;n+=3)e.x=r[n+0],e.y=r[n+1],e.z=r[n+2],e.normalize().multiplyScalar(t),r[n+0]=e.x,r[n+1]=e.y,r[n+2]=e.z}(n),function(){for(var t=new Ye,e=0;e<r.length;e+=3){t.x=r[e+0],t.y=r[e+1],t.z=r[e+2];var n=u(t)/2/Math.PI+.5,i=h(t)/Math.PI+.5;o.push(n,1-i)}(function(){for(var t=new Ye,e=new Ye,n=new Ye,i=new Ye,a=new We,s=new We,c=new We,h=0,d=0;h<r.length;h+=9,d+=6){t.set(r[h+0],r[h+1],r[h+2]),e.set(r[h+3],r[h+4],r[h+5]),n.set(r[h+6],r[h+7],r[h+8]),a.set(o[d+0],o[d+1]),s.set(o[d+2],o[d+3]),c.set(o[d+4],o[d+5]),i.copy(t).add(e).add(n).divideScalar(3);var f=u(i);l(a,d+0,t,f),l(s,d+2,e,f),l(c,d+4,n,f)}})(),function(){for(var t=0;t<o.length;t+=6){var e=o[t+0],n=o[t+2],i=o[t+4],r=Math.max(e,n,i),a=Math.min(e,n,i);r>.9&&a<.1&&(e<.2&&(o[t+0]+=1),n<.2&&(o[t+2]+=1),i<.2&&(o[t+4]+=1))}}()}(),this.addAttribute("position",new Wn(r,3)),this.addAttribute("normal",new Wn(r.slice(),3)),this.addAttribute("uv",new Wn(o,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}function Ao(t,e){Bn.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new To(t,e)),this.mergeVertices()}function To(t,e){So.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function ko(t,e){Bn.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Po(t,e)),this.mergeVertices()}function Po(t,e){So.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Lo(t,e){Bn.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Oo(t,e)),this.mergeVertices()}function Oo(t,e){var n=(1+Math.sqrt(5))/2,i=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];So.call(this,i,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Co(t,e){Bn.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Ro(t,e)),this.mergeVertices()}function Ro(t,e){var n=(1+Math.sqrt(5))/2,i=1/n,r=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i];So.call(this,r,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Io(t,e,n,i,r,o){Bn.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");var a=new zo(t,e,n,i,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,this.fromBufferGeometry(a),this.mergeVertices()}function zo(t,e,n,i,r){Zn.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r},e=e||64,n=n||1,i=i||8,r=r||!1;var o=t.computeFrenetFrames(e,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;var a,s,c=new Ye,l=new Ye,u=new We,h=new Ye,d=[],f=[],p=[],m=[];function g(r){h=t.getPointAt(r/e,h);var a=o.normals[r],u=o.binormals[r];for(s=0;s<=i;s++){var p=s/i*Math.PI*2,m=Math.sin(p),g=-Math.cos(p);l.x=g*a.x+m*u.x,l.y=g*a.y+m*u.y,l.z=g*a.z+m*u.z,l.normalize(),f.push(l.x,l.y,l.z),c.x=h.x+n*l.x,c.y=h.y+n*l.y,c.z=h.z+n*l.z,d.push(c.x,c.y,c.z)}}!function(){for(a=0;a<e;a++)g(a);g(!1===r?e:0),function(){for(a=0;a<=e;a++)for(s=0;s<=i;s++)u.x=a/e,u.y=s/i,p.push(u.x,u.y)}(),function(){for(s=1;s<=e;s++)for(a=1;a<=i;a++){var t=(i+1)*(s-1)+(a-1),n=(i+1)*s+(a-1),r=(i+1)*s+a,o=(i+1)*(s-1)+a;m.push(t,n,o),m.push(n,r,o)}}()}(),this.setIndex(m),this.addAttribute("position",new Wn(d,3)),this.addAttribute("normal",new Wn(f,3)),this.addAttribute("uv",new Wn(p,2))}function Bo(t,e,n,i,r,o,a){Bn.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:i,p:r,q:o},void 0!==a&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new No(t,e,n,i,r,o)),this.mergeVertices()}function No(t,e,n,i,r,o){Zn.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:i,p:r,q:o},t=t||1,e=e||.4,n=Math.floor(n)||64,i=Math.floor(i)||8,r=r||2,o=o||3;var a,s,c=[],l=[],u=[],h=[],d=new Ye,f=new Ye,p=new Ye,m=new Ye,g=new Ye,_=new Ye,v=new Ye;for(a=0;a<=n;++a){var b=a/n*r*Math.PI*2;for(T(b,r,o,t,p),T(b+.01,r,o,t,m),_.subVectors(m,p),v.addVectors(m,p),g.crossVectors(_,v),v.crossVectors(g,_),g.normalize(),v.normalize(),s=0;s<=i;++s){var y=s/i*Math.PI*2,x=-e*Math.cos(y),w=e*Math.sin(y);d.x=p.x+(x*v.x+w*g.x),d.y=p.y+(x*v.y+w*g.y),d.z=p.z+(x*v.z+w*g.z),l.push(d.x,d.y,d.z),f.subVectors(d,p).normalize(),u.push(f.x,f.y,f.z),h.push(a/n),h.push(s/i)}}for(s=1;s<=n;s++)for(a=1;a<=i;a++){var M=(i+1)*(s-1)+(a-1),E=(i+1)*s+(a-1),S=(i+1)*s+a,A=(i+1)*(s-1)+a;c.push(M,E,A),c.push(E,S,A)}function T(t,e,n,i,r){var o=Math.cos(t),a=Math.sin(t),s=n/e*t,c=Math.cos(s);r.x=i*(2+c)*.5*o,r.y=i*(2+c)*a*.5,r.z=i*Math.sin(s)*.5}this.setIndex(c),this.addAttribute("position",new Wn(l,3)),this.addAttribute("normal",new Wn(u,3)),this.addAttribute("uv",new Wn(h,2))}function Do(t,e,n,i,r){Bn.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:i,arc:r},this.fromBufferGeometry(new jo(t,e,n,i,r)),this.mergeVertices()}function jo(t,e,n,i,r){Zn.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:i,arc:r},t=t||1,e=e||.4,n=Math.floor(n)||8,i=Math.floor(i)||6,r=r||2*Math.PI;var o,a,s=[],c=[],l=[],u=[],h=new Ye,d=new Ye,f=new Ye;for(o=0;o<=n;o++)for(a=0;a<=i;a++){var p=a/i*r,m=o/n*Math.PI*2;d.x=(t+e*Math.cos(m))*Math.cos(p),d.y=(t+e*Math.cos(m))*Math.sin(p),d.z=e*Math.sin(m),c.push(d.x,d.y,d.z),h.x=t*Math.cos(p),h.y=t*Math.sin(p),f.subVectors(d,h).normalize(),l.push(f.x,f.y,f.z),u.push(a/i),u.push(o/n)}for(o=1;o<=n;o++)for(a=1;a<=i;a++){var g=(i+1)*o+a-1,_=(i+1)*(o-1)+a-1,v=(i+1)*(o-1)+a,b=(i+1)*o+a;s.push(g,_,b),s.push(_,v,b)}this.setIndex(s),this.addAttribute("position",new Wn(c,3)),this.addAttribute("normal",new Wn(l,3)),this.addAttribute("uv",new Wn(u,2))}qr.prototype=Object.create(li.prototype),qr.prototype.constructor=qr,qr.prototype.isMeshDepthMaterial=!0,qr.prototype.copy=function(t){return li.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},Gr.prototype=Object.create(li.prototype),Gr.prototype.constructor=Gr,Gr.prototype.isMeshDistanceMaterial=!0,Gr.prototype.copy=function(t){return li.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this},Vr.prototype=Object.create(rn.prototype),Vr.prototype.constructor=Vr,Jr.prototype=Object.assign(Object.create(Ln.prototype),{constructor:Jr,isPerspectiveCamera:!0,copy:function(t,e){return Ln.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*Ge.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*Ge.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*Ge.RAD2DEG*Math.atan(Math.tan(.5*Ge.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,n,i,r,o){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*Ge.DEG2RAD*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;r+=o.offsetX*i/a,e-=o.offsetY*n/s,i*=o.width/a,n*=o.height/s}var c=this.filmOffset;0!==c&&(r+=t*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far)},toJSON:function(t){var e=Pn.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}),Qr.prototype=Object.assign(Object.create(Jr.prototype),{constructor:Qr,isArrayCamera:!0}),eo.prototype.isFogExp2=!0,eo.prototype.clone=function(){return new eo(this.color.getHex(),this.density)},eo.prototype.toJSON=function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},no.prototype.isFog=!0,no.prototype.clone=function(){return new no(this.color.getHex(),this.near,this.far)},no.prototype.toJSON=function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},io.prototype=Object.assign(Object.create(Pn.prototype),{constructor:io,copy:function(t,e){return Pn.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},toJSON:function(t){var e=Pn.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}),ro.prototype=Object.create(li.prototype),ro.prototype.constructor=ro,ro.prototype.isSpriteMaterial=!0,ro.prototype.copy=function(t){return li.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.rotation=t.rotation,this},oo.prototype=Object.assign(Object.create(Pn.prototype),{constructor:oo,isSprite:!0,raycast:(Or=new Ye,Cr=new Ye,Rr=new Ye,function(t,e){Cr.setFromMatrixPosition(this.matrixWorld),t.ray.closestPointToPoint(Cr,Or),Rr.setFromMatrixScale(this.matrixWorld);var n=Rr.x*Rr.y/4;if(!(Cr.distanceToSquared(Or)>n)){var i=t.ray.origin.distanceTo(Or);i<t.near||i>t.far||e.push({distance:i,point:Or.clone(),face:null,object:this})}}),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return Pn.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}}),ao.prototype=Object.assign(Object.create(Pn.prototype),{constructor:ao,copy:function(t){Pn.prototype.copy.call(this,t,!1);for(var e=t.levels,n=0,i=e.length;n<i;n++){var r=e[n];this.addLevel(r.object.clone(),r.distance)}return this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var n=this.levels,i=0;i<n.length&&!(e<n[i].distance);i++);n.splice(i,0,{distance:e,object:t}),this.add(t)},getObjectForDistance:function(t){for(var e=this.levels,n=1,i=e.length;n<i&&!(t<e[n].distance);n++);return e[n-1].object},raycast:(Ir=new Ye,function(t,e){Ir.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(Ir);this.getObjectForDistance(n).raycast(t,e)}),update:function(){var t=new Ye,e=new Ye;return function(n){var i=this.levels;if(i.length>1){t.setFromMatrixPosition(n.matrixWorld),e.setFromMatrixPosition(this.matrixWorld);var r=t.distanceTo(e);i[0].object.visible=!0;for(var o=1,a=i.length;o<a&&r>=i[o].distance;o++)i[o-1].object.visible=!1,i[o].object.visible=!0;for(;o<a;o++)i[o].object.visible=!1}}}(),toJSON:function(t){var e=Pn.prototype.toJSON.call(this,t);e.object.levels=[];for(var n=this.levels,i=0,r=n.length;i<r;i++){var o=n[i];e.object.levels.push({object:o.object.uuid,distance:o.distance})}return e}}),Object.assign(so.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var n=new Ve;this.bones[t]&&n.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(n)}},pose:function(){var t,e,n;for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:(zr=new Ve,Br=new Ve,function(){for(var t=this.bones,e=this.boneInverses,n=this.boneMatrices,i=this.boneTexture,r=0,o=t.length;r<o;r++){var a=t[r]?t[r].matrixWorld:Br;zr.multiplyMatrices(a,e[r]),zr.toArray(n,16*r)}void 0!==i&&(i.needsUpdate=!0)}),clone:function(){return new so(this.bones,this.boneInverses)},getBoneByName:function(t){for(var e=0,n=this.bones.length;e<n;e++){var i=this.bones[e];if(i.name===t)return i}}}),co.prototype=Object.assign(Object.create(Pn.prototype),{constructor:co,isBone:!0}),lo.prototype=Object.assign(Object.create(mi.prototype),{constructor:lo,isSkinnedMesh:!0,initBones:function(){var t,e,n,i,r=[];if(this.geometry&&void 0!==this.geometry.bones){for(n=0,i=this.geometry.bones.length;n<i;n++)e=this.geometry.bones[n],t=new co,r.push(t),t.name=e.name,t.position.fromArray(e.pos),t.quaternion.fromArray(e.rotq),void 0!==e.scl&&t.scale.fromArray(e.scl);for(n=0,i=this.geometry.bones.length;n<i;n++)-1!==(e=this.geometry.bones[n]).parent&&null!==e.parent&&void 0!==r[e.parent]?r[e.parent].add(r[n]):this.add(r[n])}return this.updateMatrixWorld(!0),r},bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){var t,e;if(this.geometry&&this.geometry.isGeometry)for(e=0;e<this.geometry.skinWeights.length;e++){var n=this.geometry.skinWeights[e];(t=1/n.manhattanLength())!==1/0?n.multiplyScalar(t):n.set(1,0,0,0)}else if(this.geometry&&this.geometry.isBufferGeometry){var i=new on,r=this.geometry.attributes.skinWeight;for(e=0;e<r.count;e++)i.x=r.getX(e),i.y=r.getY(e),i.z=r.getZ(e),i.w=r.getW(e),(t=1/i.manhattanLength())!==1/0?i.multiplyScalar(t):i.set(1,0,0,0),r.setXYZW(e,i.x,i.y,i.z,i.w)}},updateMatrixWorld:function(t){mi.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),uo.prototype=Object.create(li.prototype),uo.prototype.constructor=uo,uo.prototype.isLineBasicMaterial=!0,uo.prototype.copy=function(t){return li.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},ho.prototype=Object.assign(Object.create(Pn.prototype),{constructor:ho,isLine:!0,computeLineDistances:(Nr=new Ye,Dr=new Ye,function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[0],i=1,r=e.count;i<r;i++)Nr.fromBufferAttribute(e,i-1),Dr.fromBufferAttribute(e,i),n[i]=n[i-1],n[i]+=Nr.distanceTo(Dr);t.addAttribute("lineDistance",new THREE.Float32BufferAttribute(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var o=t.vertices;for((n=t.lineDistances)[0]=0,i=1,r=o.length;i<r;i++)n[i]=n[i-1],n[i]+=o[i-1].distanceTo(o[i])}return this}),raycast:function(){var t=new Ve,e=new di,n=new un;return function(i,r){var o=i.linePrecision,a=o*o,s=this.geometry,c=this.matrixWorld;if(null===s.boundingSphere&&s.computeBoundingSphere(),n.copy(s.boundingSphere),n.applyMatrix4(c),!1!==i.ray.intersectsSphere(n)){t.getInverse(c),e.copy(i.ray).applyMatrix4(t);var l=new Ye,u=new Ye,h=new Ye,d=new Ye,f=this&&this.isLineSegments?2:1;if(s.isBufferGeometry){var p=s.index,m=s.attributes.position.array;if(null!==p)for(var g=p.array,_=0,v=g.length-1;_<v;_+=f){var b=g[_],y=g[_+1];if(l.fromArray(m,3*b),u.fromArray(m,3*y),!(e.distanceSqToSegment(l,u,d,h)>a))d.applyMatrix4(this.matrixWorld),(M=i.ray.origin.distanceTo(d))<i.near||M>i.far||r.push({distance:M,point:h.clone().applyMatrix4(this.matrixWorld),index:_,face:null,faceIndex:null,object:this})}else for(_=0,v=m.length/3-1;_<v;_+=f){if(l.fromArray(m,3*_),u.fromArray(m,3*_+3),!(e.distanceSqToSegment(l,u,d,h)>a))d.applyMatrix4(this.matrixWorld),(M=i.ray.origin.distanceTo(d))<i.near||M>i.far||r.push({distance:M,point:h.clone().applyMatrix4(this.matrixWorld),index:_,face:null,faceIndex:null,object:this})}}else if(s.isGeometry){var x=s.vertices,w=x.length;for(_=0;_<w-1;_+=f){var M;if(!(e.distanceSqToSegment(x[_],x[_+1],d,h)>a))d.applyMatrix4(this.matrixWorld),(M=i.ray.origin.distanceTo(d))<i.near||M>i.far||r.push({distance:M,point:h.clone().applyMatrix4(this.matrixWorld),index:_,face:null,faceIndex:null,object:this})}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),fo.prototype=Object.assign(Object.create(ho.prototype),{constructor:fo,isLineSegments:!0,computeLineDistances:function(){var t=new Ye,e=new Ye;return function(){var n=this.geometry;if(n.isBufferGeometry)if(null===n.index){for(var i=n.attributes.position,r=[],o=0,a=i.count;o<a;o+=2)t.fromBufferAttribute(i,o),e.fromBufferAttribute(i,o+1),r[o]=0===o?0:r[o-1],r[o+1]=r[o]+t.distanceTo(e);n.addAttribute("lineDistance",new THREE.Float32BufferAttribute(r,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(n.isGeometry){var s=n.vertices;for(r=n.lineDistances,o=0,a=s.length;o<a;o+=2)t.copy(s[o]),e.copy(s[o+1]),r[o]=0===o?0:r[o-1],r[o+1]=r[o]+t.distanceTo(e)}return this}}()}),po.prototype=Object.assign(Object.create(ho.prototype),{constructor:po,isLineLoop:!0}),mo.prototype=Object.create(li.prototype),mo.prototype.constructor=mo,mo.prototype.isPointsMaterial=!0,mo.prototype.copy=function(t){return li.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this},go.prototype=Object.assign(Object.create(Pn.prototype),{constructor:go,isPoints:!0,raycast:function(){var t=new Ve,e=new di,n=new un;return function(i,r){var o=this,a=this.geometry,s=this.matrixWorld,c=i.params.Points.threshold;if(null===a.boundingSphere&&a.computeBoundingSphere(),n.copy(a.boundingSphere),n.applyMatrix4(s),n.radius+=c,!1!==i.ray.intersectsSphere(n)){t.getInverse(s),e.copy(i.ray).applyMatrix4(t);var l=c/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l,h=new Ye,d=new Ye;if(a.isBufferGeometry){var f=a.index,p=a.attributes.position.array;if(null!==f)for(var m=f.array,g=0,_=m.length;g<_;g++){var v=m[g];h.fromArray(p,3*v),x(h,v)}else{g=0;for(var b=p.length/3;g<b;g++)h.fromArray(p,3*g),x(h,g)}}else{var y=a.vertices;for(g=0,b=y.length;g<b;g++)x(y[g],g)}}function x(t,n){var a=e.distanceSqToPoint(t);if(a<u){e.closestPointToPoint(t,d),d.applyMatrix4(s);var c=i.ray.origin.distanceTo(d);if(c<i.near||c>i.far)return;r.push({distance:c,distanceToRay:Math.sqrt(a),point:d.clone(),index:n,face:null,object:o})}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),_o.prototype=Object.assign(Object.create(Pn.prototype),{constructor:_o,isGroup:!0}),vo.prototype=Object.assign(Object.create(rn.prototype),{constructor:vo,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),bo.prototype=Object.create(rn.prototype),bo.prototype.constructor=bo,bo.prototype.isCompressedTexture=!0,yo.prototype=Object.create(rn.prototype),yo.prototype.constructor=yo,yo.prototype.isDepthTexture=!0,xo.prototype=Object.create(Zn.prototype),xo.prototype.constructor=xo,wo.prototype=Object.create(Bn.prototype),wo.prototype.constructor=wo,Mo.prototype=Object.create(Zn.prototype),Mo.prototype.constructor=Mo,Eo.prototype=Object.create(Bn.prototype),Eo.prototype.constructor=Eo,So.prototype=Object.create(Zn.prototype),So.prototype.constructor=So,Ao.prototype=Object.create(Bn.prototype),Ao.prototype.constructor=Ao,To.prototype=Object.create(So.prototype),To.prototype.constructor=To,ko.prototype=Object.create(Bn.prototype),ko.prototype.constructor=ko,Po.prototype=Object.create(So.prototype),Po.prototype.constructor=Po,Lo.prototype=Object.create(Bn.prototype),Lo.prototype.constructor=Lo,Oo.prototype=Object.create(So.prototype),Oo.prototype.constructor=Oo,Co.prototype=Object.create(Bn.prototype),Co.prototype.constructor=Co,Ro.prototype=Object.create(So.prototype),Ro.prototype.constructor=Ro,Io.prototype=Object.create(Bn.prototype),Io.prototype.constructor=Io,zo.prototype=Object.create(Zn.prototype),zo.prototype.constructor=zo,Bo.prototype=Object.create(Bn.prototype),Bo.prototype.constructor=Bo,No.prototype=Object.create(Zn.prototype),No.prototype.constructor=No,Do.prototype=Object.create(Bn.prototype),Do.prototype.constructor=Do,jo.prototype=Object.create(Zn.prototype),jo.prototype.constructor=jo;var Uo=function(t,e,n){n=n||2;var i,r,o,a,s,c,l,u=e&&e.length,h=u?e[0]*n:t.length,d=Fo(t,0,h,n,!0),f=[];if(!d)return f;if(u&&(d=function(t,e,n,i){var r,o,a,s,c,l=[];for(r=0,o=e.length;r<o;r++)a=e[r]*i,s=r<o-1?e[r+1]*i:t.length,(c=Fo(t,a,s,i,!1))===c.next&&(c.steiner=!0),l.push(Jo(c));for(l.sort(Yo),r=0;r<l.length;r++)Ko(l[r],n),n=Ho(n,n.next);return n}(t,e,d,n)),t.length>80*n){i=o=t[0],r=a=t[1];for(var p=n;p<h;p+=n)(s=t[p])<i&&(i=s),(c=t[p+1])<r&&(r=c),s>o&&(o=s),c>a&&(a=c);l=0!==(l=Math.max(o-i,a-r))?1/l:0}return qo(d,f,n,i,r,l),f};function Fo(t,e,n,i,r){var o,a;if(r===function(t,e,n,i){for(var r=0,o=e,a=n-i;o<n;o+=i)r+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return r}(t,e,n,i)>0)for(o=e;o<n;o+=i)a=oa(o,t[o],t[o+1],a);else for(o=n-i;o>=e;o-=i)a=oa(o,t[o],t[o+1],a);return a&&ea(a,a.next)&&(aa(a),a=a.next),a}function Ho(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=!1,i.steiner||!ea(i,i.next)&&0!==ta(i.prev,i,i.next))i=i.next;else{if(aa(i),(i=e=i.prev)===i.next)break;n=!0}}while(n||i!==e);return e}function qo(t,e,n,i,r,o,a){if(t){!a&&o&&function(t,e,n,i){var r=t;do{null===r.z&&(r.z=Zo(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,n,i,r,o,a,s,c,l=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,i=n,s=0,e=0;e<l&&(s++,i=i.nextZ);e++);for(c=l;s>0||c>0&&i;)0!==s&&(0===c||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,c--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}o.nextZ=null,l*=2}while(a>1)}(r)}(t,i,r,o);for(var s,c,l=t;t.prev!==t.next;)if(s=t.prev,c=t.next,o?Wo(t,i,r,o):Go(t))e.push(s.i/n),e.push(t.i/n),e.push(c.i/n),aa(t),t=c.next,l=c.next;else if((t=c)===l){a?1===a?qo(t=Vo(t,e,n),e,n,i,r,o,2):2===a&&Xo(t,e,n,i,r,o):qo(Ho(t),e,n,i,r,o,1);break}}}function Go(t){var e=t.prev,n=t,i=t.next;if(ta(e,n,i)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(Qo(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&ta(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Wo(t,e,n,i){var r=t.prev,o=t,a=t.next;if(ta(r,o,a)>=0)return!1;for(var s=r.x<o.x?r.x<a.x?r.x:a.x:o.x<a.x?o.x:a.x,c=r.y<o.y?r.y<a.y?r.y:a.y:o.y<a.y?o.y:a.y,l=r.x>o.x?r.x>a.x?r.x:a.x:o.x>a.x?o.x:a.x,u=r.y>o.y?r.y>a.y?r.y:a.y:o.y>a.y?o.y:a.y,h=Zo(s,c,e,n,i),d=Zo(l,u,e,n,i),f=t.nextZ;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&Qo(r.x,r.y,o.x,o.y,a.x,a.y,f.x,f.y)&&ta(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=h;){if(f!==t.prev&&f!==t.next&&Qo(r.x,r.y,o.x,o.y,a.x,a.y,f.x,f.y)&&ta(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}function Vo(t,e,n){var i=t;do{var r=i.prev,o=i.next.next;!ea(r,o)&&na(r,i,i.next,o)&&ia(r,o)&&ia(o,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(o.i/n),aa(i),aa(i.next),i=t=o),i=i.next}while(i!==t);return i}function Xo(t,e,n,i,r,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&$o(a,s)){var c=ra(a,s);return a=Ho(a,a.next),c=Ho(c,c.next),qo(a,e,n,i,r,o),void qo(c,e,n,i,r,o)}s=s.next}a=a.next}while(a!==t)}function Yo(t,e){return t.x-e.x}function Ko(t,e){if(e=function(t,e){var n,i=e,r=t.x,o=t.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>a){if(a=s,s===r){if(o===i.y)return i;if(o===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!n)return null;if(r===a)return n.prev;var c,l=n,u=n.x,h=n.y,d=1/0;i=n.next;for(;i!==l;)r>=i.x&&i.x>=u&&r!==i.x&&Qo(o<h?r:a,o,u,h,o<h?a:r,o,i.x,i.y)&&((c=Math.abs(o-i.y)/(r-i.x))<d||c===d&&i.x>n.x)&&ia(i,t)&&(n=i,d=c),i=i.next;return n}(t,e)){var n=ra(e,t);Ho(n,n.next)}}function Zo(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Jo(t){var e=t,n=t;do{e.x<n.x&&(n=e),e=e.next}while(e!==t);return n}function Qo(t,e,n,i,r,o,a,s){return(r-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(i-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(r-a)*(i-s)>=0}function $o(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&na(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&ia(t,e)&&ia(e,t)&&function(t,e){var n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)}function ta(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function ea(t,e){return t.x===e.x&&t.y===e.y}function na(t,e,n,i){return!!(ea(t,e)&&ea(n,i)||ea(t,i)&&ea(n,e))||ta(t,e,n)>0!=ta(t,e,i)>0&&ta(n,i,t)>0!=ta(n,i,e)>0}function ia(t,e){return ta(t.prev,t,t.next)<0?ta(t,e,t.next)>=0&&ta(t,t.prev,e)>=0:ta(t,e,t.prev)<0||ta(t,t.next,e)<0}function ra(t,e){var n=new sa(t.i,t.x,t.y),i=new sa(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function oa(t,e,n,i){var r=new sa(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function aa(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function sa(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var ca={area:function(t){for(var e=t.length,n=0,i=e-1,r=0;r<e;i=r++)n+=t[i].x*t[r].y-t[r].x*t[i].y;return.5*n},isClockWise:function(t){return ca.area(t)<0},triangulateShape:function(t,e){var n=[],i=[],r=[];la(t),ua(n,t);var o=t.length;e.forEach(la);for(var a=0;a<e.length;a++)i.push(o),o+=e[a].length,ua(n,e[a]);var s=Uo(n,i);for(a=0;a<s.length;a+=3)r.push(s.slice(a,a+3));return r}};function la(t){var e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function ua(t,e){for(var n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}function ha(t,e){Bn.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new da(t,e)),this.mergeVertices()}function da(t,e){void 0!==t&&(Zn.call(this),this.type="ExtrudeBufferGeometry",t=Array.isArray(t)?t:[t],this.addShapeList(t,e),this.computeVertexNormals())}function fa(t,e){Bn.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new pa(t,e)),this.mergeVertices()}function pa(t,e){var n=(e=e||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Bn;var i=n.generateShapes(t,e.size,e.curveSegments);e.amount=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),da.call(this,i,e),this.type="TextBufferGeometry"}function ma(t,e,n,i,r,o,a){Bn.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:o,thetaLength:a},this.fromBufferGeometry(new ga(t,e,n,i,r,o,a)),this.mergeVertices()}function ga(t,e,n,i,r,o,a){Zn.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:o,thetaLength:a},t=t||1,e=Math.max(3,Math.floor(e)||8),n=Math.max(2,Math.floor(n)||6),i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI;var s,c,l=(o=void 0!==o?o:0)+(a=void 0!==a?a:Math.PI),u=0,h=[],d=new Ye,f=new Ye,p=[],m=[],g=[],_=[];for(c=0;c<=n;c++){var v=[],b=c/n;for(s=0;s<=e;s++){var y=s/e;d.x=-t*Math.cos(i+y*r)*Math.sin(o+b*a),d.y=t*Math.cos(o+b*a),d.z=t*Math.sin(i+y*r)*Math.sin(o+b*a),m.push(d.x,d.y,d.z),f.set(d.x,d.y,d.z).normalize(),g.push(f.x,f.y,f.z),_.push(y,1-b),v.push(u++)}h.push(v)}for(c=0;c<n;c++)for(s=0;s<e;s++){var x=h[c][s+1],w=h[c][s],M=h[c+1][s],E=h[c+1][s+1];(0!==c||o>0)&&p.push(x,w,E),(c!==n-1||l<Math.PI)&&p.push(w,M,E)}this.setIndex(p),this.addAttribute("position",new Wn(m,3)),this.addAttribute("normal",new Wn(g,3)),this.addAttribute("uv",new Wn(_,2))}function _a(t,e,n,i,r,o){Bn.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:o},this.fromBufferGeometry(new va(t,e,n,i,r,o)),this.mergeVertices()}function va(t,e,n,i,r,o){Zn.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:o},t=t||.5,e=e||1,r=void 0!==r?r:0,o=void 0!==o?o:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var a,s,c,l=[],u=[],h=[],d=[],f=t,p=(e-t)/(i=void 0!==i?Math.max(1,i):1),m=new Ye,g=new We;for(s=0;s<=i;s++){for(c=0;c<=n;c++)a=r+c/n*o,m.x=f*Math.cos(a),m.y=f*Math.sin(a),u.push(m.x,m.y,m.z),h.push(0,0,1),g.x=(m.x/e+1)/2,g.y=(m.y/e+1)/2,d.push(g.x,g.y);f+=p}for(s=0;s<i;s++){var _=s*(n+1);for(c=0;c<n;c++){var v=a=c+_,b=a+n+1,y=a+n+2,x=a+1;l.push(v,b,x),l.push(b,y,x)}}this.setIndex(l),this.addAttribute("position",new Wn(u,3)),this.addAttribute("normal",new Wn(h,3)),this.addAttribute("uv",new Wn(d,2))}function ba(t,e,n,i){Bn.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},this.fromBufferGeometry(new ya(t,e,n,i)),this.mergeVertices()}function ya(t,e,n,i){Zn.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},e=Math.floor(e)||12,n=n||0,i=i||2*Math.PI,i=Ge.clamp(i,0,2*Math.PI);var r,o,a,s=[],c=[],l=[],u=1/e,h=new Ye,d=new We;for(o=0;o<=e;o++){var f=n+o*u*i,p=Math.sin(f),m=Math.cos(f);for(a=0;a<=t.length-1;a++)h.x=t[a].x*p,h.y=t[a].y,h.z=t[a].x*m,c.push(h.x,h.y,h.z),d.x=o/e,d.y=a/(t.length-1),l.push(d.x,d.y)}for(o=0;o<e;o++)for(a=0;a<t.length-1;a++){var g=r=a+o*t.length,_=r+t.length,v=r+t.length+1,b=r+1;s.push(g,_,b),s.push(_,v,b)}if(this.setIndex(s),this.addAttribute("position",new Wn(c,3)),this.addAttribute("uv",new Wn(l,2)),this.computeVertexNormals(),i===2*Math.PI){var y=this.attributes.normal.array,x=new Ye,w=new Ye,M=new Ye;for(r=e*t.length*3,o=0,a=0;o<t.length;o++,a+=3)x.x=y[a+0],x.y=y[a+1],x.z=y[a+2],w.x=y[r+a+0],w.y=y[r+a+1],w.z=y[r+a+2],M.addVectors(x,w).normalize(),y[a+0]=y[r+a+0]=M.x,y[a+1]=y[r+a+1]=M.y,y[a+2]=y[r+a+2]=M.z}}function xa(t,e){Bn.call(this),this.type="ShapeGeometry","object"==typeof e&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new wa(t,e)),this.mergeVertices()}function wa(t,e){Zn.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:e},e=e||12;var n=[],i=[],r=[],o=[],a=0,s=0;if(!1===Array.isArray(t))l(t);else for(var c=0;c<t.length;c++)l(t[c]),this.addGroup(a,s,c),a+=s,s=0;function l(t){var a,c,l,u=i.length/3,h=t.extractPoints(e),d=h.shape,f=h.holes;if(!1===ca.isClockWise(d))for(d=d.reverse(),a=0,c=f.length;a<c;a++)l=f[a],!0===ca.isClockWise(l)&&(f[a]=l.reverse());var p=ca.triangulateShape(d,f);for(a=0,c=f.length;a<c;a++)l=f[a],d=d.concat(l);for(a=0,c=d.length;a<c;a++){var m=d[a];i.push(m.x,m.y,0),r.push(0,0,1),o.push(m.x,m.y)}for(a=0,c=p.length;a<c;a++){var g=p[a],_=g[0]+u,v=g[1]+u,b=g[2]+u;n.push(_,v,b),s+=3}}this.setIndex(n),this.addAttribute("position",new Wn(i,3)),this.addAttribute("normal",new Wn(r,3)),this.addAttribute("uv",new Wn(o,2))}function Ma(t,e){if(e.shapes=[],Array.isArray(t))for(var n=0,i=t.length;n<i;n++){var r=t[n];e.shapes.push(r.uuid)}else e.shapes.push(t.uuid);return e}function Ea(t,e){Zn.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;var n,i,r,o,a=[],s=Math.cos(Ge.DEG2RAD*e),c=[0,0],l={},u=["a","b","c"];t.isBufferGeometry?(o=new Bn).fromBufferGeometry(t):o=t.clone(),o.mergeVertices(),o.computeFaceNormals();for(var h=o.vertices,d=o.faces,f=0,p=d.length;f<p;f++)for(var m=d[f],g=0;g<3;g++)n=m[u[g]],i=m[u[(g+1)%3]],c[0]=Math.min(n,i),c[1]=Math.max(n,i),void 0===l[r=c[0]+","+c[1]]?l[r]={index1:c[0],index2:c[1],face1:f,face2:void 0}:l[r].face2=f;for(r in l){var _=l[r];if(void 0===_.face2||d[_.face1].normal.dot(d[_.face2].normal)<=s){var v=h[_.index1];a.push(v.x,v.y,v.z),v=h[_.index2],a.push(v.x,v.y,v.z)}}this.addAttribute("position",new Wn(a,3))}function Sa(t,e,n,i,r,o,a,s){Bn.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:o,thetaStart:a,thetaLength:s},this.fromBufferGeometry(new Aa(t,e,n,i,r,o,a,s)),this.mergeVertices()}function Aa(t,e,n,i,r,o,a,s){Zn.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:o,thetaStart:a,thetaLength:s};var c=this;t=void 0!==t?t:1,e=void 0!==e?e:1,n=n||1,i=Math.floor(i)||8,r=Math.floor(r)||1,o=void 0!==o&&o,a=void 0!==a?a:0,s=void 0!==s?s:2*Math.PI;var l=[],u=[],h=[],d=[],f=0,p=[],m=n/2,g=0;function _(n){var r,o,p,_=new We,v=new Ye,b=0,y=!0===n?t:e,x=!0===n?1:-1;for(o=f,r=1;r<=i;r++)u.push(0,m*x,0),h.push(0,x,0),d.push(.5,.5),f++;for(p=f,r=0;r<=i;r++){var w=r/i*s+a,M=Math.cos(w),E=Math.sin(w);v.x=y*E,v.y=m*x,v.z=y*M,u.push(v.x,v.y,v.z),h.push(0,x,0),_.x=.5*M+.5,_.y=.5*E*x+.5,d.push(_.x,_.y),f++}for(r=0;r<i;r++){var S=o+r,A=p+r;!0===n?l.push(A,A+1,S):l.push(A+1,A,S),b+=3}c.addGroup(g,b,!0===n?1:2),g+=b}!function(){var o,_,v=new Ye,b=new Ye,y=0,x=(e-t)/n;for(_=0;_<=r;_++){var w=[],M=_/r,E=M*(e-t)+t;for(o=0;o<=i;o++){var S=o/i,A=S*s+a,T=Math.sin(A),k=Math.cos(A);b.x=E*T,b.y=-M*n+m,b.z=E*k,u.push(b.x,b.y,b.z),v.set(T,x,k).normalize(),h.push(v.x,v.y,v.z),d.push(S,1-M),w.push(f++)}p.push(w)}for(o=0;o<i;o++)for(_=0;_<r;_++){var P=p[_][o],L=p[_+1][o],O=p[_+1][o+1],C=p[_][o+1];l.push(P,L,C),l.push(L,O,C),y+=6}c.addGroup(g,y,0),g+=y}(),!1===o&&(t>0&&_(!0),e>0&&_(!1)),this.setIndex(l),this.addAttribute("position",new Wn(u,3)),this.addAttribute("normal",new Wn(h,3)),this.addAttribute("uv",new Wn(d,2))}function Ta(t,e,n,i,r,o,a){Sa.call(this,0,t,e,n,i,r,o,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:o,thetaLength:a}}function ka(t,e,n,i,r,o,a){Aa.call(this,0,t,e,n,i,r,o,a),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:o,thetaLength:a}}function Pa(t,e,n,i){Bn.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},this.fromBufferGeometry(new La(t,e,n,i)),this.mergeVertices()}function La(t,e,n,i){Zn.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},t=t||1,e=void 0!==e?Math.max(3,e):8,n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI;var r,o,a=[],s=[],c=[],l=[],u=new Ye,h=new We;for(s.push(0,0,0),c.push(0,0,1),l.push(.5,.5),o=0,r=3;o<=e;o++,r+=3){var d=n+o/e*i;u.x=t*Math.cos(d),u.y=t*Math.sin(d),s.push(u.x,u.y,u.z),c.push(0,0,1),h.x=(s[r]/t+1)/2,h.y=(s[r+1]/t+1)/2,l.push(h.x,h.y)}for(r=1;r<=e;r++)a.push(r,r+1,0);this.setIndex(a),this.addAttribute("position",new Wn(s,3)),this.addAttribute("normal",new Wn(c,3)),this.addAttribute("uv",new Wn(l,2))}ha.prototype=Object.create(Bn.prototype),ha.prototype.constructor=ha,da.prototype=Object.create(Zn.prototype),da.prototype.constructor=da,da.prototype.getArrays=function(){var t=this.getAttribute("position"),e=t?Array.prototype.slice.call(t.array):[],n=this.getAttribute("uv"),i=n?Array.prototype.slice.call(n.array):[],r=this.index;return{position:e,uv:i,index:r?Array.prototype.slice.call(r.array):[]}},da.prototype.addShapeList=function(t,e){var n=t.length;e.arrays=this.getArrays();for(var i=0;i<n;i++){var r=t[i];this.addShape(r,e)}this.setIndex(e.arrays.index),this.addAttribute("position",new Wn(e.arrays.position,3)),this.addAttribute("uv",new Wn(e.arrays.uv,2))},da.prototype.addShape=function(t,e){var n,i,r,o,a,s,c,l,u=e.arrays?e.arrays:this.getArrays(),h=u.position,d=u.index,f=u.uv,p=[],m=void 0!==e.amount?e.amount:100,g=void 0!==e.bevelThickness?e.bevelThickness:6,_=void 0!==e.bevelSize?e.bevelSize:g-2,v=void 0!==e.bevelSegments?e.bevelSegments:3,b=void 0===e.bevelEnabled||e.bevelEnabled,y=void 0!==e.curveSegments?e.curveSegments:12,x=void 0!==e.steps?e.steps:1,w=e.extrudePath,M=!1,E=void 0!==e.UVGenerator?e.UVGenerator:ha.WorldUVGenerator;w&&(n=w.getSpacedPoints(x),M=!0,b=!1,i=void 0!==e.frames?e.frames:w.computeFrenetFrames(x,!1),r=new Ye,o=new Ye,a=new Ye),b||(v=0,g=0,_=0);var S=this,A=t.extractPoints(y),T=A.shape,k=A.holes;if(!ca.isClockWise(T))for(T=T.reverse(),c=0,l=k.length;c<l;c++)s=k[c],ca.isClockWise(s)&&(k[c]=s.reverse());var P=ca.triangulateShape(T,k),L=T;for(c=0,l=k.length;c<l;c++)s=k[c],T=T.concat(s);function O(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(n).add(t)}var C,R,I,z,B,N,D=T.length,j=P.length;function U(t,e,n){var i,r,o,a=t.x-e.x,s=t.y-e.y,c=n.x-t.x,l=n.y-t.y,u=a*a+s*s,h=a*l-s*c;if(Math.abs(h)>Number.EPSILON){var d=Math.sqrt(u),f=Math.sqrt(c*c+l*l),p=e.x-s/d,m=e.y+a/d,g=((n.x-l/f-p)*l-(n.y+c/f-m)*c)/(a*l-s*c),_=(i=p+a*g-t.x)*i+(r=m+s*g-t.y)*r;if(_<=2)return new We(i,r);o=Math.sqrt(_/2)}else{var v=!1;a>Number.EPSILON?c>Number.EPSILON&&(v=!0):a<-Number.EPSILON?c<-Number.EPSILON&&(v=!0):Math.sign(s)===Math.sign(l)&&(v=!0),v?(i=-s,r=a,o=Math.sqrt(u)):(i=a,r=s,o=Math.sqrt(u/2))}return new We(i/o,r/o)}for(var F=[],H=0,q=L.length,G=q-1,W=H+1;H<q;H++,G++,W++)G===q&&(G=0),W===q&&(W=0),F[H]=U(L[H],L[G],L[W]);var V,X,Y=[],K=F.concat();for(c=0,l=k.length;c<l;c++){for(s=k[c],V=[],H=0,G=(q=s.length)-1,W=H+1;H<q;H++,G++,W++)G===q&&(G=0),W===q&&(W=0),V[H]=U(s[H],s[G],s[W]);Y.push(V),K=K.concat(V)}for(C=0;C<v;C++){for(I=C/v,z=g*Math.cos(I*Math.PI/2),R=_*Math.sin(I*Math.PI/2),H=0,q=L.length;H<q;H++)J((B=O(L[H],F[H],R)).x,B.y,-z);for(c=0,l=k.length;c<l;c++)for(s=k[c],V=Y[c],H=0,q=s.length;H<q;H++)J((B=O(s[H],V[H],R)).x,B.y,-z)}for(R=_,H=0;H<D;H++)B=b?O(T[H],K[H],R):T[H],M?(o.copy(i.normals[0]).multiplyScalar(B.x),r.copy(i.binormals[0]).multiplyScalar(B.y),a.copy(n[0]).add(o).add(r),J(a.x,a.y,a.z)):J(B.x,B.y,0);for(X=1;X<=x;X++)for(H=0;H<D;H++)B=b?O(T[H],K[H],R):T[H],M?(o.copy(i.normals[X]).multiplyScalar(B.x),r.copy(i.binormals[X]).multiplyScalar(B.y),a.copy(n[X]).add(o).add(r),J(a.x,a.y,a.z)):J(B.x,B.y,m/x*X);for(C=v-1;C>=0;C--){for(I=C/v,z=g*Math.cos(I*Math.PI/2),R=_*Math.sin(I*Math.PI/2),H=0,q=L.length;H<q;H++)J((B=O(L[H],F[H],R)).x,B.y,m+z);for(c=0,l=k.length;c<l;c++)for(s=k[c],V=Y[c],H=0,q=s.length;H<q;H++)B=O(s[H],V[H],R),M?J(B.x,B.y+n[x-1].y,n[x-1].x+z):J(B.x,B.y,m+z)}function Z(t,e){var n,i;for(H=t.length;--H>=0;){n=H,(i=H-1)<0&&(i=t.length-1);var r=0,o=x+2*v;for(r=0;r<o;r++){var a=D*r,s=D*(r+1);$(e+n+a,e+i+a,e+i+s,e+n+s)}}}function J(t,e,n){p.push(t),p.push(e),p.push(n)}function Q(t,e,n){tt(t),tt(e),tt(n);var i=h.length/3,r=E.generateTopUV(S,h,i-3,i-2,i-1);et(r[0]),et(r[1]),et(r[2])}function $(t,e,n,i){tt(t),tt(e),tt(i),tt(e),tt(n),tt(i);var r=h.length/3,o=E.generateSideWallUV(S,h,r-6,r-3,r-2,r-1);et(o[0]),et(o[1]),et(o[3]),et(o[1]),et(o[2]),et(o[3])}function tt(t){d.push(h.length/3),h.push(p[3*t+0]),h.push(p[3*t+1]),h.push(p[3*t+2])}function et(t){f.push(t.x),f.push(t.y)}!function(){var t=h.length/3;if(b){var e=0,n=D*e;for(H=0;H<j;H++)Q((N=P[H])[2]+n,N[1]+n,N[0]+n);for(n=D*(e=x+2*v),H=0;H<j;H++)Q((N=P[H])[0]+n,N[1]+n,N[2]+n)}else{for(H=0;H<j;H++)Q((N=P[H])[2],N[1],N[0]);for(H=0;H<j;H++)Q((N=P[H])[0]+D*x,N[1]+D*x,N[2]+D*x)}S.addGroup(t,h.length/3-t,0)}(),function(){var t=h.length/3,e=0;for(Z(L,e),e+=L.length,c=0,l=k.length;c<l;c++)Z(s=k[c],e),e+=s.length;S.addGroup(t,h.length/3-t,1)}(),e.arrays||(this.setIndex(d),this.addAttribute("position",new Wn(h,3)),this.addAttribute("uv",new Wn(f,2)))},ha.WorldUVGenerator={generateTopUV:function(t,e,n,i,r){var o=e[3*n],a=e[3*n+1],s=e[3*i],c=e[3*i+1],l=e[3*r],u=e[3*r+1];return[new We(o,a),new We(s,c),new We(l,u)]},generateSideWallUV:function(t,e,n,i,r,o){var a=e[3*n],s=e[3*n+1],c=e[3*n+2],l=e[3*i],u=e[3*i+1],h=e[3*i+2],d=e[3*r],f=e[3*r+1],p=e[3*r+2],m=e[3*o],g=e[3*o+1],_=e[3*o+2];return Math.abs(s-u)<.01?[new We(a,1-c),new We(l,1-h),new We(d,1-p),new We(m,1-_)]:[new We(s,1-c),new We(u,1-h),new We(f,1-p),new We(g,1-_)]}},fa.prototype=Object.create(Bn.prototype),fa.prototype.constructor=fa,pa.prototype=Object.create(da.prototype),pa.prototype.constructor=pa,ma.prototype=Object.create(Bn.prototype),ma.prototype.constructor=ma,ga.prototype=Object.create(Zn.prototype),ga.prototype.constructor=ga,_a.prototype=Object.create(Bn.prototype),_a.prototype.constructor=_a,va.prototype=Object.create(Zn.prototype),va.prototype.constructor=va,ba.prototype=Object.create(Bn.prototype),ba.prototype.constructor=ba,ya.prototype=Object.create(Zn.prototype),ya.prototype.constructor=ya,xa.prototype=Object.create(Bn.prototype),xa.prototype.constructor=xa,xa.prototype.toJSON=function(){var t=Bn.prototype.toJSON.call(this);return Ma(this.parameters.shapes,t)},wa.prototype=Object.create(Zn.prototype),wa.prototype.constructor=wa,wa.prototype.toJSON=function(){var t=Zn.prototype.toJSON.call(this);return Ma(this.parameters.shapes,t)},Ea.prototype=Object.create(Zn.prototype),Ea.prototype.constructor=Ea,Sa.prototype=Object.create(Bn.prototype),Sa.prototype.constructor=Sa,Aa.prototype=Object.create(Zn.prototype),Aa.prototype.constructor=Aa,Ta.prototype=Object.create(Sa.prototype),Ta.prototype.constructor=Ta,ka.prototype=Object.create(Aa.prototype),ka.prototype.constructor=ka,Pa.prototype=Object.create(Bn.prototype),Pa.prototype.constructor=Pa,La.prototype=Object.create(Zn.prototype),La.prototype.constructor=La;var Oa=Object.freeze({WireframeGeometry:xo,ParametricGeometry:wo,ParametricBufferGeometry:Mo,TetrahedronGeometry:Ao,TetrahedronBufferGeometry:To,OctahedronGeometry:ko,OctahedronBufferGeometry:Po,IcosahedronGeometry:Lo,IcosahedronBufferGeometry:Oo,DodecahedronGeometry:Co,DodecahedronBufferGeometry:Ro,PolyhedronGeometry:Eo,PolyhedronBufferGeometry:So,TubeGeometry:Io,TubeBufferGeometry:zo,TorusKnotGeometry:Bo,TorusKnotBufferGeometry:No,TorusGeometry:Do,TorusBufferGeometry:jo,TextGeometry:fa,TextBufferGeometry:pa,SphereGeometry:ma,SphereBufferGeometry:ga,RingGeometry:_a,RingBufferGeometry:va,PlaneGeometry:$n,PlaneBufferGeometry:ti,LatheGeometry:ba,LatheBufferGeometry:ya,ShapeGeometry:xa,ShapeBufferGeometry:wa,ExtrudeGeometry:ha,ExtrudeBufferGeometry:da,EdgesGeometry:Ea,ConeGeometry:Ta,ConeBufferGeometry:ka,CylinderGeometry:Sa,CylinderBufferGeometry:Aa,CircleGeometry:Pa,CircleBufferGeometry:La,BoxGeometry:Jn,BoxBufferGeometry:Qn});function Ca(t){li.call(this),this.type="ShadowMaterial",this.color=new _n(0),this.transparent=!0,this.setValues(t)}function Ra(t){hi.call(this,t),this.type="RawShaderMaterial"}function Ia(t){li.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new _n(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _n(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new We(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function za(t){Ia.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(t)}function Ba(t){li.call(this),this.type="MeshPhongMaterial",this.color=new _n(16777215),this.specular=new _n(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _n(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new We(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ct,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Na(t){Ba.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(t)}function Da(t){li.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new We(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function ja(t){li.call(this),this.type="MeshLambertMaterial",this.color=new _n(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _n(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ct,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Ua(t){uo.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}Ca.prototype=Object.create(li.prototype),Ca.prototype.constructor=Ca,Ca.prototype.isShadowMaterial=!0,Ca.prototype.copy=function(t){return li.prototype.copy.call(this,t),this.color.copy(t.color),this},Ra.prototype=Object.create(hi.prototype),Ra.prototype.constructor=Ra,Ra.prototype.isRawShaderMaterial=!0,Ia.prototype=Object.create(li.prototype),Ia.prototype.constructor=Ia,Ia.prototype.isMeshStandardMaterial=!0,Ia.prototype.copy=function(t){return li.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},za.prototype=Object.create(Ia.prototype),za.prototype.constructor=za,za.prototype.isMeshPhysicalMaterial=!0,za.prototype.copy=function(t){return Ia.prototype.copy.call(this,t),this.defines={PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearCoat=t.clearCoat,this.clearCoatRoughness=t.clearCoatRoughness,this},Ba.prototype=Object.create(li.prototype),Ba.prototype.constructor=Ba,Ba.prototype.isMeshPhongMaterial=!0,Ba.prototype.copy=function(t){return li.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Na.prototype=Object.create(Ba.prototype),Na.prototype.constructor=Na,Na.prototype.isMeshToonMaterial=!0,Na.prototype.copy=function(t){return Ba.prototype.copy.call(this,t),this.gradientMap=t.gradientMap,this},Da.prototype=Object.create(li.prototype),Da.prototype.constructor=Da,Da.prototype.isMeshNormalMaterial=!0,Da.prototype.copy=function(t){return li.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},ja.prototype=Object.create(li.prototype),ja.prototype.constructor=ja,ja.prototype.isMeshLambertMaterial=!0,ja.prototype.copy=function(t){return li.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Ua.prototype=Object.create(uo.prototype),Ua.prototype.constructor=Ua,Ua.prototype.isLineDashedMaterial=!0,Ua.prototype.copy=function(t){return uo.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var Fa=Object.freeze({ShadowMaterial:Ca,SpriteMaterial:ro,RawShaderMaterial:Ra,ShaderMaterial:hi,PointsMaterial:mo,MeshPhysicalMaterial:za,MeshStandardMaterial:Ia,MeshPhongMaterial:Ba,MeshToonMaterial:Na,MeshNormalMaterial:Da,MeshLambertMaterial:ja,MeshDepthMaterial:qr,MeshDistanceMaterial:Gr,MeshBasicMaterial:ui,LineDashedMaterial:Ua,LineBasicMaterial:uo,Material:li}),Ha={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function qa(t,e,n){var i=this,r=!1,o=0,a=0,s=void 0;this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){a++,!1===r&&void 0!==i.onStart&&i.onStart(t,o,a),r=!0},this.itemEnd=function(t){o++,void 0!==i.onProgress&&i.onProgress(t,o,a),o===a&&(r=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(t){void 0!==i.onError&&i.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this}}var Ga=new qa,Wa={};function Va(t){this.manager=void 0!==t?t:Ga}function Xa(t){this.manager=void 0!==t?t:Ga,this._parser=null}function Ya(t){this.manager=void 0!==t?t:Ga,this._parser=null}function Ka(t){this.manager=void 0!==t?t:Ga}function Za(t){this.manager=void 0!==t?t:Ga}function Ja(t){this.manager=void 0!==t?t:Ga}function Qa(){this.type="Curve",this.arcLengthDivisions=200}function $a(t,e,n,i,r,o,a,s){Qa.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=n||1,this.yRadius=i||1,this.aStartAngle=r||0,this.aEndAngle=o||2*Math.PI,this.aClockwise=a||!1,this.aRotation=s||0}function ts(t,e,n,i,r,o){$a.call(this,t,e,n,n,i,r,o),this.type="ArcCurve"}function es(){var t=0,e=0,n=0,i=0;function r(r,o,a,s){t=r,e=a,n=-3*r+3*o-2*a-s,i=2*r-2*o+a+s}return{initCatmullRom:function(t,e,n,i,o){r(e,n,o*(n-t),o*(i-e))},initNonuniformCatmullRom:function(t,e,n,i,o,a,s){var c=(e-t)/o-(n-t)/(o+a)+(n-e)/a,l=(n-e)/a-(i-e)/(a+s)+(i-n)/s;r(e,n,c*=a,l*=a)},calc:function(r){var o=r*r;return t+e*r+n*o+i*(o*r)}}}Object.assign(Va.prototype,{load:function(t,e,n,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,o=Ha.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout(function(){e&&e(o),r.manager.itemEnd(t)},0),o;if(void 0===Wa[t]){var a=t.match(/^data:(.*?)(;base64)?,(.*)$/);if(a){var s=a[1],c=!!a[2],l=a[3];l=window.decodeURIComponent(l),c&&(l=window.atob(l));try{var u,h=(this.responseType||"").toLowerCase();switch(h){case"arraybuffer":case"blob":for(var d=new Uint8Array(l.length),f=0;f<l.length;f++)d[f]=l.charCodeAt(f);u="blob"===h?new Blob([d.buffer],{type:s}):d.buffer;break;case"document":var p=new DOMParser;u=p.parseFromString(l,s);break;case"json":u=JSON.parse(l);break;default:u=l}window.setTimeout(function(){e&&e(u),r.manager.itemEnd(t)},0)}catch(e){window.setTimeout(function(){i&&i(e),r.manager.itemEnd(t),r.manager.itemError(t)},0)}}else{Wa[t]=[],Wa[t].push({onLoad:e,onProgress:n,onError:i});var m=new XMLHttpRequest;for(var g in m.open("GET",t,!0),m.addEventListener("load",function(e){var n=this.response;Ha.add(t,n);var i=Wa[t];if(delete Wa[t],200===this.status){for(var o=0,a=i.length;o<a;o++){(s=i[o]).onLoad&&s.onLoad(n)}r.manager.itemEnd(t)}else if(0===this.status){console.warn("THREE.FileLoader: HTTP Status 0 received.");for(o=0,a=i.length;o<a;o++){(s=i[o]).onLoad&&s.onLoad(n)}r.manager.itemEnd(t)}else{for(o=0,a=i.length;o<a;o++){var s;(s=i[o]).onError&&s.onError(e)}r.manager.itemEnd(t),r.manager.itemError(t)}},!1),m.addEventListener("progress",function(e){for(var n=Wa[t],i=0,r=n.length;i<r;i++){var o=n[i];o.onProgress&&o.onProgress(e)}},!1),m.addEventListener("error",function(e){var n=Wa[t];delete Wa[t];for(var i=0,o=n.length;i<o;i++){var a=n[i];a.onError&&a.onError(e)}r.manager.itemEnd(t),r.manager.itemError(t)},!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(g,this.requestHeader[g]);m.send(null)}return r.manager.itemStart(t),m}Wa[t].push({onLoad:e,onProgress:n,onError:i})},setPath:function(t){return this.path=t,this},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}}),Object.assign(Xa.prototype,{load:function(t,e,n,i){var r=this,o=[],a=new bo;a.image=o;var s=new Va(this.manager);function c(c){s.load(t[c],function(t){var n=r._parser(t,!0);o[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(l+=1)&&(1===n.mipmapCount&&(a.minFilter=Lt),a.format=n.format,a.needsUpdate=!0,e&&e(a))},n,i)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(t))for(var l=0,u=0,h=t.length;u<h;++u)c(u);else s.load(t,function(t){var n=r._parser(t,!0);if(n.isCubemap)for(var i=n.mipmaps.length/n.mipmapCount,s=0;s<i;s++){o[s]={mipmaps:[]};for(var c=0;c<n.mipmapCount;c++)o[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+c]),o[s].format=n.format,o[s].width=n.width,o[s].height=n.height}else a.image.width=n.width,a.image.height=n.height,a.mipmaps=n.mipmaps;1===n.mipmapCount&&(a.minFilter=Lt),a.format=n.format,a.needsUpdate=!0,e&&e(a)},n,i);return a},setPath:function(t){return this.path=t,this}}),Object.assign(Ya.prototype,{load:function(t,e,n,i){var r=this,o=new cn,a=new Va(this.manager);return a.setResponseType("arraybuffer"),a.load(t,function(t){var n=r._parser(t);n&&(void 0!==n.image?o.image=n.image:void 0!==n.data&&(o.image.width=n.width,o.image.height=n.height,o.image.data=n.data),o.wrapS=void 0!==n.wrapS?n.wrapS:St,o.wrapT=void 0!==n.wrapT?n.wrapT:St,o.magFilter=void 0!==n.magFilter?n.magFilter:Lt,o.minFilter=void 0!==n.minFilter?n.minFilter:Ct,o.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(o.format=n.format),void 0!==n.type&&(o.type=n.type),void 0!==n.mipmaps&&(o.mipmaps=n.mipmaps),1===n.mipmapCount&&(o.minFilter=Lt),o.needsUpdate=!0,e&&e(o,n))},n,i),o}}),Object.assign(Ka.prototype,{crossOrigin:"Anonymous",load:function(t,e,n,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,o=Ha.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout(function(){e&&e(o),r.manager.itemEnd(t)},0),o;var a=document.createElementNS("http://www.w3.org/1999/xhtml","img");return a.addEventListener("load",function(){Ha.add(t,this),e&&e(this),r.manager.itemEnd(t)},!1),a.addEventListener("error",function(e){i&&i(e),r.manager.itemEnd(t),r.manager.itemError(t)},!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(t),a.src=t,a},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Za.prototype,{crossOrigin:"Anonymous",load:function(t,e,n,i){var r=new Ti,o=new Ka(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);var a=0;function s(n){o.load(t[n],function(t){r.images[n]=t,6===++a&&(r.needsUpdate=!0,e&&e(r))},void 0,i)}for(var c=0;c<t.length;++c)s(c);return r},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Ja.prototype,{crossOrigin:"Anonymous",load:function(t,e,n,i){var r=new rn,o=new Ka(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,function(n){r.image=n;var i=t.search(/\.(jpg|jpeg)$/)>0||0===t.search(/^data\:image\/jpeg/);r.format=i?Vt:Xt,r.needsUpdate=!0,void 0!==e&&e(r)},n,i),r},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Qa.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){var n=this.getUtoTmapping(t);return this.getPoint(n,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,n,i=[],r=this.getPoint(0),o=0;for(i.push(0),n=1;n<=t;n++)o+=(e=this.getPoint(n/t)).distanceTo(r),i.push(o),r=e;return this.cacheArcLengths=i,i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var n,i=this.getLengths(),r=0,o=i.length;n=e||t*i[o-1];for(var a,s=0,c=o-1;s<=c;)if((a=i[r=Math.floor(s+(c-s)/2)]-n)<0)s=r+1;else{if(!(a>0)){c=r;break}c=r-1}if(i[r=c]===n)return r/(o-1);var l=i[r];return(r+(n-l)/(i[r+1]-l))/(o-1)},getTangent:function(t){var e=t-1e-4,n=t+1e-4;e<0&&(e=0),n>1&&(n=1);var i=this.getPoint(e);return this.getPoint(n).clone().sub(i).normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)},computeFrenetFrames:function(t,e){var n,i,r,o=new Ye,a=[],s=[],c=[],l=new Ye,u=new Ve;for(n=0;n<=t;n++)i=n/t,a[n]=this.getTangentAt(i),a[n].normalize();s[0]=new Ye,c[0]=new Ye;var h=Number.MAX_VALUE,d=Math.abs(a[0].x),f=Math.abs(a[0].y),p=Math.abs(a[0].z);for(d<=h&&(h=d,o.set(1,0,0)),f<=h&&(h=f,o.set(0,1,0)),p<=h&&o.set(0,0,1),l.crossVectors(a[0],o).normalize(),s[0].crossVectors(a[0],l),c[0].crossVectors(a[0],s[0]),n=1;n<=t;n++)s[n]=s[n-1].clone(),c[n]=c[n-1].clone(),l.crossVectors(a[n-1],a[n]),l.length()>Number.EPSILON&&(l.normalize(),r=Math.acos(Ge.clamp(a[n-1].dot(a[n]),-1,1)),s[n].applyMatrix4(u.makeRotationAxis(l,r))),c[n].crossVectors(a[n],s[n]);if(!0===e)for(r=Math.acos(Ge.clamp(s[0].dot(s[t]),-1,1)),r/=t,a[0].dot(l.crossVectors(s[0],s[t]))>0&&(r=-r),n=1;n<=t;n++)s[n].applyMatrix4(u.makeRotationAxis(a[n],r*n)),c[n].crossVectors(a[n],s[n]);return{tangents:a,normals:s,binormals:c}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),$a.prototype=Object.create(Qa.prototype),$a.prototype.constructor=$a,$a.prototype.isEllipseCurve=!0,$a.prototype.getPoint=function(t,e){for(var n=e||new We,i=2*Math.PI,r=this.aEndAngle-this.aStartAngle,o=Math.abs(r)<Number.EPSILON;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(r=o?0:i),!0!==this.aClockwise||o||(r===i?r=-i:r-=i);var a=this.aStartAngle+t*r,s=this.aX+this.xRadius*Math.cos(a),c=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){var l=Math.cos(this.aRotation),u=Math.sin(this.aRotation),h=s-this.aX,d=c-this.aY;s=h*l-d*u+this.aX,c=h*u+d*l+this.aY}return n.set(s,c)},$a.prototype.copy=function(t){return Qa.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},$a.prototype.toJSON=function(){var t=Qa.prototype.toJSON.call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t},$a.prototype.fromJSON=function(t){return Qa.prototype.fromJSON.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},ts.prototype=Object.create($a.prototype),ts.prototype.constructor=ts,ts.prototype.isArcCurve=!0;var ns=new Ye,is=new es,rs=new es,os=new es;function as(t,e,n,i){Qa.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||!1,this.curveType=n||"centripetal",this.tension=i||.5}function ss(t,e,n,i,r){var o=.5*(i-e),a=.5*(r-n),s=t*t;return(2*n-2*i+o+a)*(t*s)+(-3*n+3*i-2*o-a)*s+o*t+n}function cs(t,e,n,i){return function(t,e){var n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,i)}function ls(t,e,n,i,r){return function(t,e){var n=1-t;return n*n*n*e}(t,e)+function(t,e){var n=1-t;return 3*n*n*t*e}(t,n)+function(t,e){return 3*(1-t)*t*t*e}(t,i)+function(t,e){return t*t*t*e}(t,r)}function us(t,e,n,i){Qa.call(this),this.type="CubicBezierCurve",this.v0=t||new We,this.v1=e||new We,this.v2=n||new We,this.v3=i||new We}function hs(t,e,n,i){Qa.call(this),this.type="CubicBezierCurve3",this.v0=t||new Ye,this.v1=e||new Ye,this.v2=n||new Ye,this.v3=i||new Ye}function ds(t,e){Qa.call(this),this.type="LineCurve",this.v1=t||new We,this.v2=e||new We}function fs(t,e){Qa.call(this),this.type="LineCurve3",this.v1=t||new Ye,this.v2=e||new Ye}function ps(t,e,n){Qa.call(this),this.type="QuadraticBezierCurve",this.v0=t||new We,this.v1=e||new We,this.v2=n||new We}function ms(t,e,n){Qa.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new Ye,this.v1=e||new Ye,this.v2=n||new Ye}function gs(t){Qa.call(this),this.type="SplineCurve",this.points=t||[]}as.prototype=Object.create(Qa.prototype),as.prototype.constructor=as,as.prototype.isCatmullRomCurve3=!0,as.prototype.getPoint=function(t,e){var n,i,r,o,a=e||new Ye,s=this.points,c=s.length,l=(c-(this.closed?0:1))*t,u=Math.floor(l),h=l-u;if(this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/s.length)+1)*s.length:0===h&&u===c-1&&(u=c-2,h=1),this.closed||u>0?n=s[(u-1)%c]:(ns.subVectors(s[0],s[1]).add(s[0]),n=ns),i=s[u%c],r=s[(u+1)%c],this.closed||u+2<c?o=s[(u+2)%c]:(ns.subVectors(s[c-1],s[c-2]).add(s[c-1]),o=ns),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,f=Math.pow(n.distanceToSquared(i),d),p=Math.pow(i.distanceToSquared(r),d),m=Math.pow(r.distanceToSquared(o),d);p<1e-4&&(p=1),f<1e-4&&(f=p),m<1e-4&&(m=p),is.initNonuniformCatmullRom(n.x,i.x,r.x,o.x,f,p,m),rs.initNonuniformCatmullRom(n.y,i.y,r.y,o.y,f,p,m),os.initNonuniformCatmullRom(n.z,i.z,r.z,o.z,f,p,m)}else"catmullrom"===this.curveType&&(is.initCatmullRom(n.x,i.x,r.x,o.x,this.tension),rs.initCatmullRom(n.y,i.y,r.y,o.y,this.tension),os.initCatmullRom(n.z,i.z,r.z,o.z,this.tension));return a.set(is.calc(h),rs.calc(h),os.calc(h)),a},as.prototype.copy=function(t){Qa.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},as.prototype.toJSON=function(){var t=Qa.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var i=this.points[e];t.points.push(i.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},as.prototype.fromJSON=function(t){Qa.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push((new Ye).fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},us.prototype=Object.create(Qa.prototype),us.prototype.constructor=us,us.prototype.isCubicBezierCurve=!0,us.prototype.getPoint=function(t,e){var n=e||new We,i=this.v0,r=this.v1,o=this.v2,a=this.v3;return n.set(ls(t,i.x,r.x,o.x,a.x),ls(t,i.y,r.y,o.y,a.y)),n},us.prototype.copy=function(t){return Qa.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},us.prototype.toJSON=function(){var t=Qa.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},us.prototype.fromJSON=function(t){return Qa.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},hs.prototype=Object.create(Qa.prototype),hs.prototype.constructor=hs,hs.prototype.isCubicBezierCurve3=!0,hs.prototype.getPoint=function(t,e){var n=e||new Ye,i=this.v0,r=this.v1,o=this.v2,a=this.v3;return n.set(ls(t,i.x,r.x,o.x,a.x),ls(t,i.y,r.y,o.y,a.y),ls(t,i.z,r.z,o.z,a.z)),n},hs.prototype.copy=function(t){return Qa.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},hs.prototype.toJSON=function(){var t=Qa.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},hs.prototype.fromJSON=function(t){return Qa.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},ds.prototype=Object.create(Qa.prototype),ds.prototype.constructor=ds,ds.prototype.isLineCurve=!0,ds.prototype.getPoint=function(t,e){var n=e||new We;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},ds.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},ds.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},ds.prototype.copy=function(t){return Qa.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},ds.prototype.toJSON=function(){var t=Qa.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},ds.prototype.fromJSON=function(t){return Qa.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},fs.prototype=Object.create(Qa.prototype),fs.prototype.constructor=fs,fs.prototype.isLineCurve3=!0,fs.prototype.getPoint=function(t,e){var n=e||new Ye;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},fs.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},fs.prototype.copy=function(t){return Qa.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},fs.prototype.toJSON=function(){var t=Qa.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},fs.prototype.fromJSON=function(t){return Qa.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},ps.prototype=Object.create(Qa.prototype),ps.prototype.constructor=ps,ps.prototype.isQuadraticBezierCurve=!0,ps.prototype.getPoint=function(t,e){var n=e||new We,i=this.v0,r=this.v1,o=this.v2;return n.set(cs(t,i.x,r.x,o.x),cs(t,i.y,r.y,o.y)),n},ps.prototype.copy=function(t){return Qa.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},ps.prototype.toJSON=function(){var t=Qa.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},ps.prototype.fromJSON=function(t){return Qa.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},ms.prototype=Object.create(Qa.prototype),ms.prototype.constructor=ms,ms.prototype.isQuadraticBezierCurve3=!0,ms.prototype.getPoint=function(t,e){var n=e||new Ye,i=this.v0,r=this.v1,o=this.v2;return n.set(cs(t,i.x,r.x,o.x),cs(t,i.y,r.y,o.y),cs(t,i.z,r.z,o.z)),n},ms.prototype.copy=function(t){return Qa.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},ms.prototype.toJSON=function(){var t=Qa.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},ms.prototype.fromJSON=function(t){return Qa.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},gs.prototype=Object.create(Qa.prototype),gs.prototype.constructor=gs,gs.prototype.isSplineCurve=!0,gs.prototype.getPoint=function(t,e){var n=e||new We,i=this.points,r=(i.length-1)*t,o=Math.floor(r),a=r-o,s=i[0===o?o:o-1],c=i[o],l=i[o>i.length-2?i.length-1:o+1],u=i[o>i.length-3?i.length-1:o+2];return n.set(ss(a,s.x,c.x,l.x,u.x),ss(a,s.y,c.y,l.y,u.y)),n},gs.prototype.copy=function(t){Qa.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push(i.clone())}return this},gs.prototype.toJSON=function(){var t=Qa.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var i=this.points[e];t.points.push(i.toArray())}return t},gs.prototype.fromJSON=function(t){Qa.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push((new We).fromArray(i))}return this};var _s=Object.freeze({ArcCurve:ts,CatmullRomCurve3:as,CubicBezierCurve:us,CubicBezierCurve3:hs,EllipseCurve:$a,LineCurve:ds,LineCurve3:fs,QuadraticBezierCurve:ps,QuadraticBezierCurve3:ms,SplineCurve:gs});function vs(){Qa.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function bs(t){vs.call(this),this.type="Path",this.currentPoint=new We,t&&this.setFromPoints(t)}function ys(t){bs.call(this,t),this.uuid=Ge.generateUUID(),this.type="Shape",this.holes=[]}function xs(t,e){Pn.call(this),this.type="Light",this.color=new _n(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function ws(t,e,n){xs.call(this,t,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(Pn.DefaultUp),this.updateMatrix(),this.groundColor=new _n(e)}function Ms(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new We(512,512),this.map=null,this.matrix=new Ve}function Es(){Ms.call(this,new Jr(50,1,.5,500))}function Ss(t,e,n,i,r,o){xs.call(this,t,e),this.type="SpotLight",this.position.copy(Pn.DefaultUp),this.updateMatrix(),this.target=new Pn,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==i?i:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==o?o:1,this.shadow=new Es}function As(t,e,n,i){xs.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==i?i:1,this.shadow=new Ms(new Jr(90,1,.5,500))}function Ts(){Ms.call(this,new On(-5,5,5,-5,.5,500))}function ks(t,e){xs.call(this,t,e),this.type="DirectionalLight",this.position.copy(Pn.DefaultUp),this.updateMatrix(),this.target=new Pn,this.shadow=new Ts}function Ps(t,e){xs.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function Ls(t,e,n,i){xs.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==i?i:10}function Os(t,e,n,i){Hs.call(this,t,e,n,i)}function Cs(t,e,n){Hs.call(this,t,e,n)}function Rs(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n}function Is(t,e,n,i){Rs.call(this,t,e,n,i)}function zs(t,e,n,i){Hs.call(this,t,e,n,i)}function Bs(t,e,n,i){Hs.call(this,t,e,n,i)}function Ns(t,e,n,i){Hs.call(this,t,e,n,i)}function Ds(t,e,n,i){Rs.call(this,t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function js(t,e,n,i){Rs.call(this,t,e,n,i)}function Us(t,e,n,i){Rs.call(this,t,e,n,i)}vs.prototype=Object.assign(Object.create(Qa.prototype),{constructor:vs,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new ds(e,t))},getPoint:function(t){for(var e=t*this.getLength(),n=this.getCurveLengths(),i=0;i<n.length;){if(n[i]>=e){var r=n[i]-e,o=this.curves[i],a=o.getLength(),s=0===a?0:1-r/a;return o.getPointAt(s)}i++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,n=0,i=this.curves.length;n<i;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t){t=t||12;for(var e,n=[],i=0,r=this.curves;i<r.length;i++)for(var o=r[i],a=o&&o.isEllipseCurve?2*t:o&&o.isLineCurve?1:o&&o.isSplineCurve?t*o.points.length:t,s=o.getPoints(a),c=0;c<s.length;c++){var l=s[c];e&&e.equals(l)||(n.push(l),e=l)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(t){Qa.prototype.copy.call(this,t),this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var i=t.curves[e];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){var t=Qa.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(var e=0,n=this.curves.length;e<n;e++){var i=this.curves[e];t.curves.push(i.toJSON())}return t},fromJSON:function(t){Qa.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var i=t.curves[e];this.curves.push((new _s[i.type]).fromJSON(i))}return this}}),bs.prototype=Object.assign(Object.create(vs.prototype),{constructor:bs,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y)},moveTo:function(t,e){this.currentPoint.set(t,e)},lineTo:function(t,e){var n=new ds(this.currentPoint.clone(),new We(t,e));this.curves.push(n),this.currentPoint.set(t,e)},quadraticCurveTo:function(t,e,n,i){var r=new ps(this.currentPoint.clone(),new We(t,e),new We(n,i));this.curves.push(r),this.currentPoint.set(n,i)},bezierCurveTo:function(t,e,n,i,r,o){var a=new us(this.currentPoint.clone(),new We(t,e),new We(n,i),new We(r,o));this.curves.push(a),this.currentPoint.set(r,o)},splineThru:function(t){var e=new gs([this.currentPoint.clone()].concat(t));this.curves.push(e),this.currentPoint.copy(t[t.length-1])},arc:function(t,e,n,i,r,o){var a=this.currentPoint.x,s=this.currentPoint.y;this.absarc(t+a,e+s,n,i,r,o)},absarc:function(t,e,n,i,r,o){this.absellipse(t,e,n,n,i,r,o)},ellipse:function(t,e,n,i,r,o,a,s){var c=this.currentPoint.x,l=this.currentPoint.y;this.absellipse(t+c,e+l,n,i,r,o,a,s)},absellipse:function(t,e,n,i,r,o,a,s){var c=new $a(t,e,n,i,r,o,a,s);if(this.curves.length>0){var l=c.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(c);var u=c.getPoint(1);this.currentPoint.copy(u)},copy:function(t){return vs.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=vs.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return vs.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),ys.prototype=Object.assign(Object.create(bs.prototype),{constructor:ys,getPointsHoles:function(t){for(var e=[],n=0,i=this.holes.length;n<i;n++)e[n]=this.holes[n].getPoints(t);return e},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){bs.prototype.copy.call(this,t),this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var i=t.holes[e];this.holes.push(i.clone())}return this},toJSON:function(){var t=bs.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(var e=0,n=this.holes.length;e<n;e++){var i=this.holes[e];t.holes.push(i.toJSON())}return t},fromJSON:function(t){bs.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var i=t.holes[e];this.holes.push((new bs).fromJSON(i))}return this}}),xs.prototype=Object.assign(Object.create(Pn.prototype),{constructor:xs,isLight:!0,copy:function(t){return Pn.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=Pn.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),ws.prototype=Object.assign(Object.create(xs.prototype),{constructor:ws,isHemisphereLight:!0,copy:function(t){return xs.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(Ms.prototype,{copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),Es.prototype=Object.assign(Object.create(Ms.prototype),{constructor:Es,isSpotLightShadow:!0,update:function(t){var e=this.camera,n=2*Ge.RAD2DEG*t.angle,i=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;n===e.fov&&i===e.aspect&&r===e.far||(e.fov=n,e.aspect=i,e.far=r,e.updateProjectionMatrix())}}),Ss.prototype=Object.assign(Object.create(xs.prototype),{constructor:Ss,isSpotLight:!0,copy:function(t){return xs.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),As.prototype=Object.assign(Object.create(xs.prototype),{constructor:As,isPointLight:!0,copy:function(t){return xs.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),Ts.prototype=Object.assign(Object.create(Ms.prototype),{constructor:Ts}),ks.prototype=Object.assign(Object.create(xs.prototype),{constructor:ks,isDirectionalLight:!0,copy:function(t){return xs.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Ps.prototype=Object.assign(Object.create(xs.prototype),{constructor:Ps,isAmbientLight:!0}),Ls.prototype=Object.assign(Object.create(xs.prototype),{constructor:Ls,isRectAreaLight:!0,copy:function(t){return xs.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){var e=xs.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}}),Os.prototype=Object.assign(Object.create(Hs.prototype),{constructor:Os,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Se,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Cs.prototype=Object.assign(Object.create(Hs.prototype),{constructor:Cs,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Se,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Object.assign(Rs.prototype,{evaluate:function(t){var e=this.parameterPositions,n=this._cachedIndex,i=e[n],r=e[n-1];t:{e:{var o;n:{i:if(!(t<i)){for(var a=n+2;;){if(void 0===i){if(t<r)break i;return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,t,r)}if(n===a)break;if(r=i,t<(i=e[++n]))break e}o=e.length;break n}if(t>=r)break t;var s=e[1];t<s&&(n=2,r=s);for(a=n-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,i);if(n===a)break;if(i=r,t>=(r=e[--n-1]))break e}o=n,n=0}for(;n<o;){var c=n+o>>>1;t<e[c]?o=c:n=c+1}if(i=e[n],void 0===(r=e[n-1]))return this._cachedIndex=0,this.beforeStart_(0,t,i);if(void 0===i)return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,r,t)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,t,i)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=t*i,o=0;o!==i;++o)e[o]=n[r+o];return e},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),
//!\ DECLARE ALIAS AFTER assign prototype !
Object.assign(Rs.prototype,{beforeStart_:Rs.prototype.copySampleValue_,afterEnd_:Rs.prototype.copySampleValue_}),Is.prototype=Object.assign(Object.create(Rs.prototype),{constructor:Is,interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=(n-e)/(i-e),l=s+a;s!==l;s+=4)Xe.slerpFlat(r,0,o,s-a,o,s,c);return r}}),zs.prototype=Object.assign(Object.create(Hs.prototype),{constructor:zs,ValueTypeName:"quaternion",DefaultInterpolation:Ae,InterpolantFactoryMethodLinear:function(t){return new Is(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),Bs.prototype=Object.assign(Object.create(Hs.prototype),{constructor:Bs,ValueTypeName:"color"}),Ns.prototype=Object.assign(Object.create(Hs.prototype),{constructor:Ns,ValueTypeName:"number"}),Ds.prototype=Object.assign(Object.create(Rs.prototype),{constructor:Ds,DefaultSettings_:{endingStart:ke,endingEnd:ke},intervalChanged_:function(t,e,n){var i=this.parameterPositions,r=t-2,o=t+1,a=i[r],s=i[o];if(void 0===a)switch(this.getSettings_().endingStart){case Pe:r=t,a=2*e-n;break;case Le:a=e+i[r=i.length-2]-i[r+1];break;default:r=t,a=n}if(void 0===s)switch(this.getSettings_().endingEnd){case Pe:o=t,s=2*n-e;break;case Le:o=1,s=n+i[1]-i[0];break;default:o=t-1,s=e}var c=.5*(n-e),l=this.valueSize;this._weightPrev=c/(e-a),this._weightNext=c/(s-n),this._offsetPrev=r*l,this._offsetNext=o*l},interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=s-a,l=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,d=this._weightNext,f=(n-e)/(i-e),p=f*f,m=p*f,g=-h*m+2*h*p-h*f,_=(1+h)*m+(-1.5-2*h)*p+(-.5+h)*f+1,v=(-1-d)*m+(1.5+d)*p+.5*f,b=d*m-d*p,y=0;y!==a;++y)r[y]=g*o[l+y]+_*o[c+y]+v*o[s+y]+b*o[u+y];return r}}),js.prototype=Object.assign(Object.create(Rs.prototype),{constructor:js,interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=s-a,l=(n-e)/(i-e),u=1-l,h=0;h!==a;++h)r[h]=o[c+h]*u+o[s+h]*l;return r}}),Us.prototype=Object.assign(Object.create(Rs.prototype),{constructor:Us,interpolate_:function(t){return this.copySampleValue_(t-1)}});var Fs={arraySlice:function(t,e,n){return Fs.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)},convertArray:function(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){for(var e=t.length,n=new Array(e),i=0;i!==e;++i)n[i]=i;return n.sort(function(e,n){return t[e]-t[n]}),n},sortedArray:function(t,e,n){for(var i=t.length,r=new t.constructor(i),o=0,a=0;a!==i;++o)for(var s=n[o]*e,c=0;c!==e;++c)r[a++]=t[s+c];return r},flattenJSON:function(t,e,n,i){for(var r=1,o=t[0];void 0!==o&&void 0===o[i];)o=t[r++];if(void 0!==o){var a=o[i];if(void 0!==a)if(Array.isArray(a))do{void 0!==(a=o[i])&&(e.push(o.time),n.push.apply(n,a)),o=t[r++]}while(void 0!==o);else if(void 0!==a.toArray)do{void 0!==(a=o[i])&&(e.push(o.time),a.toArray(n,n.length)),o=t[r++]}while(void 0!==o);else do{void 0!==(a=o[i])&&(e.push(o.time),n.push(a)),o=t[r++]}while(void 0!==o)}}};function Hs(t,e,n,i){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Fs.convertArray(e,this.TimeBufferType),this.values=Fs.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation),this.validate(),this.optimize()}function qs(t,e,n,i){Hs.call(this,t,e,n,i)}function Gs(t,e,n){this.name=t,this.tracks=n,this.duration=void 0!==e?e:-1,this.uuid=Ge.generateUUID(),this.duration<0&&this.resetDuration(),this.optimize()}function Ws(t){this.manager=void 0!==t?t:Ga,this.textures={}}function Vs(t){this.manager=void 0!==t?t:Ga}Object.assign(Hs,{parse:function(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var e=Hs._getTrackTypeForValueTypeName(t.type);if(void 0===t.times){var n=[],i=[];Fs.flattenJSON(t.keys,n,i,"value"),t.times=n,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)},toJSON:function(t){var e,n=t.constructor;if(void 0!==n.toJSON)e=n.toJSON(t);else{e={name:t.name,times:Fs.convertArray(t.times,Array),values:Fs.convertArray(t.values,Array)};var i=t.getInterpolation();i!==t.DefaultInterpolation&&(e.interpolation=i)}return e.type=t.ValueTypeName,e},_getTrackTypeForValueTypeName:function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ns;case"vector":case"vector2":case"vector3":case"vector4":return qs;case"color":return Bs;case"quaternion":return zs;case"bool":case"boolean":return Cs;case"string":return Os}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}}),Object.assign(Hs.prototype,{constructor:Hs,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:Ae,InterpolantFactoryMethodDiscrete:function(t){return new Us(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new js(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new Ds(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case Se:e=this.InterpolantFactoryMethodDiscrete;break;case Ae:e=this.InterpolantFactoryMethodLinear;break;case Te:e=this.InterpolantFactoryMethodSmooth}if(void 0!==e)this.createInterpolant=e;else{var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}console.warn("THREE.KeyframeTrack:",n)}},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Se;case this.InterpolantFactoryMethodLinear:return Ae;case this.InterpolantFactoryMethodSmooth:return Te}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,n=0,i=e.length;n!==i;++n)e[n]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,n=0,i=e.length;n!==i;++n)e[n]*=t;return this},trim:function(t,e){for(var n=this.times,i=n.length,r=0,o=i-1;r!==i&&n[r]<t;)++r;for(;-1!==o&&n[o]>e;)--o;if(++o,0!==r||o!==i){r>=o&&(r=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=Fs.arraySlice(n,r,o),this.values=Fs.arraySlice(this.values,r*a,o*a)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var o=null,a=0;a!==r;a++){var s=n[a];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),t=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),t=!1;break}o=s}if(void 0!==i&&Fs.isTypedArray(i)){a=0;for(var c=i.length;a!==c;++a){var l=i[a];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,l),t=!1;break}}}return t},optimize:function(){for(var t=this.times,e=this.values,n=this.getValueSize(),i=this.getInterpolation()===Te,r=1,o=t.length-1,a=1;a<o;++a){var s=!1,c=t[a];if(c!==t[a+1]&&(1!==a||c!==c[0]))if(i)s=!0;else for(var l=a*n,u=l-n,h=l+n,d=0;d!==n;++d){var f=e[l+d];if(f!==e[u+d]||f!==e[h+d]){s=!0;break}}if(s){if(a!==r){t[r]=t[a];var p=a*n,m=r*n;for(d=0;d!==n;++d)e[m+d]=e[p+d]}++r}}if(o>0){t[r]=t[o];for(p=o*n,m=r*n,d=0;d!==n;++d)e[m+d]=e[p+d];++r}return r!==t.length&&(this.times=Fs.arraySlice(t,0,r),this.values=Fs.arraySlice(e,0,r*n)),this}}),qs.prototype=Object.assign(Object.create(Hs.prototype),{constructor:qs,ValueTypeName:"vector"}),Object.assign(Gs,{parse:function(t){for(var e=[],n=t.tracks,i=1/(t.fps||1),r=0,o=n.length;r!==o;++r)e.push(Hs.parse(n[r]).scale(i));return new Gs(t.name,t.duration,e)},toJSON:function(t){for(var e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e},r=0,o=n.length;r!==o;++r)e.push(Hs.toJSON(n[r]));return i},CreateFromMorphTargetSequence:function(t,e,n,i){for(var r=e.length,o=[],a=0;a<r;a++){var s=[],c=[];s.push((a+r-1)%r,a,(a+1)%r),c.push(0,1,0);var l=Fs.getKeyframeOrder(s);s=Fs.sortedArray(s,1,l),c=Fs.sortedArray(c,1,l),i||0!==s[0]||(s.push(r),c.push(c[0])),o.push(new Ns(".morphTargetInfluences["+e[a].name+"]",s,c).scale(1/n))}return new Gs(t,-1,o)},findByName:function(t,e){var n=t;if(!Array.isArray(t)){var i=t;n=i.geometry&&i.geometry.animations||i.animations}for(var r=0;r<n.length;r++)if(n[r].name===e)return n[r];return null},CreateClipsFromMorphTargetSequences:function(t,e,n){for(var i={},r=/^([\w-]*?)([\d]+)$/,o=0,a=t.length;o<a;o++){var s=t[o],c=s.name.match(r);if(c&&c.length>1){var l=i[h=c[1]];l||(i[h]=l=[]),l.push(s)}}var u=[];for(var h in i)u.push(Gs.CreateFromMorphTargetSequence(h,i[h],e,n));return u},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,e,n,i,r){if(0!==n.length){var o=[],a=[];Fs.flattenJSON(n,o,a,i),0!==o.length&&r.push(new t(e,o,a))}},i=[],r=t.name||"default",o=t.length||-1,a=t.fps||30,s=t.hierarchy||[],c=0;c<s.length;c++){var l=s[c].keys;if(l&&0!==l.length)if(l[0].morphTargets){for(var u={},h=0;h<l.length;h++)if(l[h].morphTargets)for(var d=0;d<l[h].morphTargets.length;d++)u[l[h].morphTargets[d]]=-1;for(var f in u){var p=[],m=[];for(d=0;d!==l[h].morphTargets.length;++d){var g=l[h];p.push(g.time),m.push(g.morphTarget===f?1:0)}i.push(new Ns(".morphTargetInfluence["+f+"]",p,m))}o=u.length*(a||1)}else{var _=".bones["+e[c].name+"]";n(qs,_+".position",l,"pos",i),n(zs,_+".quaternion",l,"rot",i),n(qs,_+".scale",l,"scl",i)}}return 0===i.length?null:new Gs(r,o,i)}}),Object.assign(Gs.prototype,{resetDuration:function(){for(var t=0,e=0,n=this.tracks.length;e!==n;++e){var i=this.tracks[e];t=Math.max(t,i.times[i.times.length-1])}this.duration=t},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}}),Object.assign(Ws.prototype,{load:function(t,e,n,i){var r=this;new Va(r.manager).load(t,function(t){e(r.parse(JSON.parse(t)))},n,i)},setTextures:function(t){this.textures=t},parse:function(t){var e=this.textures;function n(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}var i=new Fa[t.type];if(void 0!==t.uuid&&(i.uuid=t.uuid),void 0!==t.name&&(i.name=t.name),void 0!==t.color&&i.color.setHex(t.color),void 0!==t.roughness&&(i.roughness=t.roughness),void 0!==t.metalness&&(i.metalness=t.metalness),void 0!==t.emissive&&i.emissive.setHex(t.emissive),void 0!==t.specular&&i.specular.setHex(t.specular),void 0!==t.shininess&&(i.shininess=t.shininess),void 0!==t.clearCoat&&(i.clearCoat=t.clearCoat),void 0!==t.clearCoatRoughness&&(i.clearCoatRoughness=t.clearCoatRoughness),void 0!==t.uniforms&&(i.uniforms=t.uniforms),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.vertexColors&&(i.vertexColors=t.vertexColors),void 0!==t.fog&&(i.fog=t.fog),void 0!==t.flatShading&&(i.flatShading=t.flatShading),void 0!==t.blending&&(i.blending=t.blending),void 0!==t.side&&(i.side=t.side),void 0!==t.opacity&&(i.opacity=t.opacity),void 0!==t.transparent&&(i.transparent=t.transparent),void 0!==t.alphaTest&&(i.alphaTest=t.alphaTest),void 0!==t.depthTest&&(i.depthTest=t.depthTest),void 0!==t.depthWrite&&(i.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(i.colorWrite=t.colorWrite),void 0!==t.wireframe&&(i.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(i.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(i.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(i.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(i.rotation=t.rotation),1!==t.linewidth&&(i.linewidth=t.linewidth),void 0!==t.dashSize&&(i.dashSize=t.dashSize),void 0!==t.gapSize&&(i.gapSize=t.gapSize),void 0!==t.scale&&(i.scale=t.scale),void 0!==t.polygonOffset&&(i.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(i.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(i.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(i.skinning=t.skinning),void 0!==t.morphTargets&&(i.morphTargets=t.morphTargets),void 0!==t.dithering&&(i.dithering=t.dithering),void 0!==t.visible&&(i.visible=t.visible),void 0!==t.userData&&(i.userData=t.userData),void 0!==t.shading&&(i.flatShading=1===t.shading),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=n(t.map)),void 0!==t.alphaMap&&(i.alphaMap=n(t.alphaMap),i.transparent=!0),void 0!==t.bumpMap&&(i.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=n(t.normalMap)),void 0!==t.normalScale){var r=t.normalScale;!1===Array.isArray(r)&&(r=[r,r]),i.normalScale=(new We).fromArray(r)}return void 0!==t.displacementMap&&(i.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=n(t.specularMap)),void 0!==t.envMap&&(i.envMap=n(t.envMap)),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.lightMap&&(i.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=n(t.gradientMap)),i}}),Object.assign(Vs.prototype,{load:function(t,e,n,i){var r=this;new Va(r.manager).load(t,function(t){e(r.parse(JSON.parse(t)))},n,i)},parse:function(t){var e=new Zn,n=t.data.index;if(void 0!==n){var i=new Js[n.type](n.array);e.setIndex(new Nn(i,1))}var r=t.data.attributes;for(var o in r){var a=r[o];i=new Js[a.type](a.array);e.addAttribute(o,new Nn(i,a.itemSize,a.normalized))}var s=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==s)for(var c=0,l=s.length;c!==l;++c){var u=s[c];e.addGroup(u.start,u.count,u.materialIndex)}var h=t.data.boundingSphere;if(void 0!==h){var d=new Ye;void 0!==h.center&&d.fromArray(h.center),e.boundingSphere=new un(d,h.radius)}return e}});var Xs,Ys,Ks,Zs,Js={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function Qs(){}Qs.Handlers={handlers:[],add:function(t,e){this.handlers.push(t,e)},get:function(t){for(var e=this.handlers,n=0,i=e.length;n<i;n+=2){var r=e[n],o=e[n+1];if(r.test(t))return o}return null}},Object.assign(Qs.prototype,{crossOrigin:void 0,onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(t,e,n){for(var i=[],r=0;r<t.length;++r)i[r]=this.createMaterial(t[r],e,n);return i},createMaterial:(Xs={NoBlending:C,NormalBlending:R,AdditiveBlending:I,SubtractiveBlending:z,MultiplyBlending:B,CustomBlending:N},Ys=new _n,Ks=new Ja,Zs=new Ws,function(t,e,n){var i={};function r(t,r,o,a,s){var c,l=e+t,u=Qs.Handlers.get(l);null!==u?c=u.load(l):(Ks.setCrossOrigin(n),c=Ks.load(l)),void 0!==r&&(c.repeat.fromArray(r),1!==r[0]&&(c.wrapS=Et),1!==r[1]&&(c.wrapT=Et)),void 0!==o&&c.offset.fromArray(o),void 0!==a&&("repeat"===a[0]&&(c.wrapS=Et),"mirror"===a[0]&&(c.wrapS=At),"repeat"===a[1]&&(c.wrapT=Et),"mirror"===a[1]&&(c.wrapT=At)),void 0!==s&&(c.anisotropy=s);var h=Ge.generateUUID();return i[h]=c,h}var o={uuid:Ge.generateUUID(),type:"MeshLambertMaterial"};for(var a in t){var s=t[a];switch(a){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":o.name=s;break;case"blending":o.blending=Xs[s];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",a,"is no longer supported.");break;case"colorDiffuse":o.color=Ys.fromArray(s).getHex();break;case"colorSpecular":o.specular=Ys.fromArray(s).getHex();break;case"colorEmissive":o.emissive=Ys.fromArray(s).getHex();break;case"specularCoef":o.shininess=s;break;case"shading":"basic"===s.toLowerCase()&&(o.type="MeshBasicMaterial"),"phong"===s.toLowerCase()&&(o.type="MeshPhongMaterial"),"standard"===s.toLowerCase()&&(o.type="MeshStandardMaterial");break;case"mapDiffuse":o.map=r(s,t.mapDiffuseRepeat,t.mapDiffuseOffset,t.mapDiffuseWrap,t.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":o.emissiveMap=r(s,t.mapEmissiveRepeat,t.mapEmissiveOffset,t.mapEmissiveWrap,t.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":o.lightMap=r(s,t.mapLightRepeat,t.mapLightOffset,t.mapLightWrap,t.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":o.aoMap=r(s,t.mapAORepeat,t.mapAOOffset,t.mapAOWrap,t.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":o.bumpMap=r(s,t.mapBumpRepeat,t.mapBumpOffset,t.mapBumpWrap,t.mapBumpAnisotropy);break;case"mapBumpScale":o.bumpScale=s;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":o.normalMap=r(s,t.mapNormalRepeat,t.mapNormalOffset,t.mapNormalWrap,t.mapNormalAnisotropy);break;case"mapNormalFactor":o.normalScale=s;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":o.specularMap=r(s,t.mapSpecularRepeat,t.mapSpecularOffset,t.mapSpecularWrap,t.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":o.metalnessMap=r(s,t.mapMetalnessRepeat,t.mapMetalnessOffset,t.mapMetalnessWrap,t.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":o.roughnessMap=r(s,t.mapRoughnessRepeat,t.mapRoughnessOffset,t.mapRoughnessWrap,t.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":o.alphaMap=r(s,t.mapAlphaRepeat,t.mapAlphaOffset,t.mapAlphaWrap,t.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":o.side=S;break;case"doubleSided":o.side=A;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),o.opacity=s;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":o[a]=s;break;case"vertexColors":!0===s&&(o.vertexColors=O),"face"===s&&(o.vertexColors=L);break;default:console.error("THREE.Loader.createMaterial: Unsupported",a,s)}}return"MeshBasicMaterial"===o.type&&delete o.emissive,"MeshPhongMaterial"!==o.type&&delete o.specular,o.opacity<1&&(o.transparent=!0),Zs.setTextures(i),Zs.parse(o)})});var $s={decodeText:function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var e="",n=0,i=t.length;n<i;n++)e+=String.fromCharCode(t[n]);return decodeURIComponent(escape(e))},extractUrlBase:function(t){var e=t.split("/");return 1===e.length?"./":(e.pop(),e.join("/")+"/")}};function tc(t){"boolean"==typeof t&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),t=void 0),this.manager=void 0!==t?t:Ga,this.withCredentials=!1}function ec(t){this.manager=void 0!==t?t:Ga,this.texturePath=""}Object.assign(tc.prototype,{load:function(t,e,n,i){var r=this,o=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:$s.extractUrlBase(t),a=new Va(this.manager);a.setWithCredentials(this.withCredentials),a.load(t,function(n){var i=JSON.parse(n),a=i.metadata;if(void 0!==a){var s=a.type;if(void 0!==s&&"object"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+t+" should be loaded with THREE.ObjectLoader instead.")}var c=r.parse(i,o);e(c.geometry,c.materials)},n,i)},setTexturePath:function(t){this.texturePath=t},parse:function(t,e){void 0!==t.data&&(t=t.data),void 0!==t.scale?t.scale=1/t.scale:t.scale=1;var n=new Bn;return function(t,e){function n(t,e){return t&1<<e}var i,r,o,a,s,c,l,u,h,d,f,p,m,g,_,v,b,y,x,w,M,E,S,A,T,k=t.faces,P=t.vertices,L=t.normals,O=t.colors,C=t.scale,R=0;if(void 0!==t.uvs){for(i=0;i<t.uvs.length;i++)t.uvs[i].length&&R++;for(i=0;i<R;i++)e.faceVertexUvs[i]=[]}for(a=0,s=P.length;a<s;)(y=new Ye).x=P[a++]*C,y.y=P[a++]*C,y.z=P[a++]*C,e.vertices.push(y);for(a=0,s=k.length;a<s;)if(f=n(d=k[a++],0),p=n(d,1),m=n(d,3),g=n(d,4),_=n(d,5),v=n(d,6),b=n(d,7),f){if((w=new Cn).a=k[a],w.b=k[a+1],w.c=k[a+3],(M=new Cn).a=k[a+1],M.b=k[a+2],M.c=k[a+3],a+=4,p&&(h=k[a++],w.materialIndex=h,M.materialIndex=h),o=e.faces.length,m)for(i=0;i<R;i++)for(A=t.uvs[i],e.faceVertexUvs[i][o]=[],e.faceVertexUvs[i][o+1]=[],r=0;r<4;r++)T=new We(A[2*(u=k[a++])],A[2*u+1]),2!==r&&e.faceVertexUvs[i][o].push(T),0!==r&&e.faceVertexUvs[i][o+1].push(T);if(g&&(l=3*k[a++],w.normal.set(L[l++],L[l++],L[l]),M.normal.copy(w.normal)),_)for(i=0;i<4;i++)l=3*k[a++],S=new Ye(L[l++],L[l++],L[l]),2!==i&&w.vertexNormals.push(S),0!==i&&M.vertexNormals.push(S);if(v&&(E=O[c=k[a++]],w.color.setHex(E),M.color.setHex(E)),b)for(i=0;i<4;i++)E=O[c=k[a++]],2!==i&&w.vertexColors.push(new _n(E)),0!==i&&M.vertexColors.push(new _n(E));e.faces.push(w),e.faces.push(M)}else{if((x=new Cn).a=k[a++],x.b=k[a++],x.c=k[a++],p&&(h=k[a++],x.materialIndex=h),o=e.faces.length,m)for(i=0;i<R;i++)for(A=t.uvs[i],e.faceVertexUvs[i][o]=[],r=0;r<3;r++)T=new We(A[2*(u=k[a++])],A[2*u+1]),e.faceVertexUvs[i][o].push(T);if(g&&(l=3*k[a++],x.normal.set(L[l++],L[l++],L[l])),_)for(i=0;i<3;i++)l=3*k[a++],S=new Ye(L[l++],L[l++],L[l]),x.vertexNormals.push(S);if(v&&(c=k[a++],x.color.setHex(O[c])),b)for(i=0;i<3;i++)c=k[a++],x.vertexColors.push(new _n(O[c]));e.faces.push(x)}}(t,n),function(t,e){var n=void 0!==t.influencesPerVertex?t.influencesPerVertex:2;if(t.skinWeights)for(var i=0,r=t.skinWeights.length;i<r;i+=n){var o=t.skinWeights[i],a=n>1?t.skinWeights[i+1]:0,s=n>2?t.skinWeights[i+2]:0,c=n>3?t.skinWeights[i+3]:0;e.skinWeights.push(new on(o,a,s,c))}if(t.skinIndices)for(i=0,r=t.skinIndices.length;i<r;i+=n){var l=t.skinIndices[i],u=n>1?t.skinIndices[i+1]:0,h=n>2?t.skinIndices[i+2]:0,d=n>3?t.skinIndices[i+3]:0;e.skinIndices.push(new on(l,u,h,d))}e.bones=t.bones,e.bones&&e.bones.length>0&&(e.skinWeights.length!==e.skinIndices.length||e.skinIndices.length!==e.vertices.length)&&console.warn("When skinning, number of vertices ("+e.vertices.length+"), skinIndices ("+e.skinIndices.length+"), and skinWeights ("+e.skinWeights.length+") should match.")}(t,n),function(t,e){var n=t.scale;if(void 0!==t.morphTargets)for(var i=0,r=t.morphTargets.length;i<r;i++){e.morphTargets[i]={},e.morphTargets[i].name=t.morphTargets[i].name,e.morphTargets[i].vertices=[];for(var o=e.morphTargets[i].vertices,a=t.morphTargets[i].vertices,s=0,c=a.length;s<c;s+=3){var l=new Ye;l.x=a[s]*n,l.y=a[s+1]*n,l.z=a[s+2]*n,o.push(l)}}if(void 0!==t.morphColors&&t.morphColors.length>0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');var u=e.faces,h=t.morphColors[0].colors;for(i=0,r=u.length;i<r;i++)u[i].color.fromArray(h,3*i)}}(t,n),function(t,e){var n=[],i=[];void 0!==t.animation&&i.push(t.animation),void 0!==t.animations&&(t.animations.length?i=i.concat(t.animations):i.push(t.animations));for(var r=0;r<i.length;r++){var o=Gs.parseAnimation(i[r],e.bones);o&&n.push(o)}if(e.morphTargets){var a=Gs.CreateClipsFromMorphTargetSequences(e.morphTargets,10);n=n.concat(a)}n.length>0&&(e.animations=n)}(t,n),n.computeFaceNormals(),n.computeBoundingSphere(),void 0===t.materials||0===t.materials.length?{geometry:n}:{geometry:n,materials:Qs.prototype.initMaterials(t.materials,e,this.crossOrigin)}}}),Object.assign(ec.prototype,{load:function(t,e,n,i){""===this.texturePath&&(this.texturePath=t.substring(0,t.lastIndexOf("/")+1));var r=this;new Va(r.manager).load(t,function(n){var o=null;try{o=JSON.parse(n)}catch(e){return void 0!==i&&i(e),void console.error("THREE:ObjectLoader: Can't parse "+t+".",e.message)}var a=o.metadata;void 0!==a&&void 0!==a.type&&"geometry"!==a.type.toLowerCase()?r.parse(o,e):console.error("THREE.ObjectLoader: Can't load "+t+". Use THREE.JSONLoader instead.")},n,i)},setTexturePath:function(t){this.texturePath=t},setCrossOrigin:function(t){this.crossOrigin=t},parse:function(t,e){var n=this.parseShape(t.shapes),i=this.parseGeometries(t.geometries,n),r=this.parseImages(t.images,function(){void 0!==e&&e(s)}),o=this.parseTextures(t.textures,r),a=this.parseMaterials(t.materials,o),s=this.parseObject(t.object,i,a);return t.animations&&(s.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(s),s},parseShape:function(t){var e={};if(void 0!==t)for(var n=0,i=t.length;n<i;n++){var r=(new ys).fromJSON(t[n]);e[r.uuid]=r}return e},parseGeometries:function(t,e){var n={};if(void 0!==t)for(var i=new tc,r=new Vs,o=0,a=t.length;o<a;o++){var s,c=t[o];switch(c.type){case"PlaneGeometry":case"PlaneBufferGeometry":s=new Oa[c.type](c.width,c.height,c.widthSegments,c.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":s=new Oa[c.type](c.width,c.height,c.depth,c.widthSegments,c.heightSegments,c.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":s=new Oa[c.type](c.radius,c.segments,c.thetaStart,c.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":s=new Oa[c.type](c.radiusTop,c.radiusBottom,c.height,c.radialSegments,c.heightSegments,c.openEnded,c.thetaStart,c.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":s=new Oa[c.type](c.radius,c.height,c.radialSegments,c.heightSegments,c.openEnded,c.thetaStart,c.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":s=new Oa[c.type](c.radius,c.widthSegments,c.heightSegments,c.phiStart,c.phiLength,c.thetaStart,c.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":s=new Oa[c.type](c.radius,c.detail);break;case"RingGeometry":case"RingBufferGeometry":s=new Oa[c.type](c.innerRadius,c.outerRadius,c.thetaSegments,c.phiSegments,c.thetaStart,c.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":s=new Oa[c.type](c.radius,c.tube,c.radialSegments,c.tubularSegments,c.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":s=new Oa[c.type](c.radius,c.tube,c.tubularSegments,c.radialSegments,c.p,c.q);break;case"LatheGeometry":case"LatheBufferGeometry":s=new Oa[c.type](c.points,c.segments,c.phiStart,c.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":s=new Oa[c.type](c.vertices,c.indices,c.radius,c.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":var l=[];for(o=0,a=c.shapes.length;o<a;o++){var u=e[c.shapes[o]];l.push(u)}s=new Oa[c.type](l,c.curveSegments);break;case"BufferGeometry":s=r.parse(c);break;case"Geometry":s=i.parse(c,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+c.type+'"');continue}s.uuid=c.uuid,void 0!==c.name&&(s.name=c.name),n[c.uuid]=s}return n},parseMaterials:function(t,e){var n={};if(void 0!==t){var i=new Ws;i.setTextures(e);for(var r=0,o=t.length;r<o;r++){var a=t[r];if("MultiMaterial"===a.type){for(var s=[],c=0;c<a.materials.length;c++)s.push(i.parse(a.materials[c]));n[a.uuid]=s}else n[a.uuid]=i.parse(a)}}return n},parseAnimations:function(t){for(var e=[],n=0;n<t.length;n++){var i=Gs.parse(t[n]);e.push(i)}return e},parseImages:function(t,e){var n=this,i={};function r(t){return n.manager.itemStart(t),o.load(t,function(){n.manager.itemEnd(t)},void 0,function(){n.manager.itemEnd(t),n.manager.itemError(t)})}if(void 0!==t&&t.length>0){var o=new Ka(new qa(e));o.setCrossOrigin(this.crossOrigin);for(var a=0,s=t.length;a<s;a++){var c=t[a],l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url)?c.url:n.texturePath+c.url;i[c.uuid]=r(l)}}return i},parseTextures:function(t,e){function n(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}var i={};if(void 0!==t)for(var r=0,o=t.length;r<o;r++){var a=t[r];void 0===a.image&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),void 0===e[a.image]&&console.warn("THREE.ObjectLoader: Undefined image",a.image);var s=new rn(e[a.image]);s.needsUpdate=!0,s.uuid=a.uuid,void 0!==a.name&&(s.name=a.name),void 0!==a.mapping&&(s.mapping=n(a.mapping,ic)),void 0!==a.offset&&s.offset.fromArray(a.offset),void 0!==a.repeat&&s.repeat.fromArray(a.repeat),void 0!==a.center&&s.center.fromArray(a.center),void 0!==a.rotation&&(s.rotation=a.rotation),void 0!==a.wrap&&(s.wrapS=n(a.wrap[0],rc),s.wrapT=n(a.wrap[1],rc)),void 0!==a.format&&(s.format=a.format),void 0!==a.minFilter&&(s.minFilter=n(a.minFilter,oc)),void 0!==a.magFilter&&(s.magFilter=n(a.magFilter,oc)),void 0!==a.anisotropy&&(s.anisotropy=a.anisotropy),void 0!==a.flipY&&(s.flipY=a.flipY),i[a.uuid]=s}return i},parseObject:function(t,e,n){var i;function r(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function o(t){if(void 0!==t){if(Array.isArray(t)){for(var e=[],i=0,r=t.length;i<r;i++){var o=t[i];void 0===n[o]&&console.warn("THREE.ObjectLoader: Undefined material",o),e.push(n[o])}return e}return void 0===n[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),n[t]}}switch(t.type){case"Scene":i=new io,void 0!==t.background&&Number.isInteger(t.background)&&(i.background=new _n(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?i.fog=new no(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(i.fog=new eo(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":i=new Jr(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(i.focus=t.focus),void 0!==t.zoom&&(i.zoom=t.zoom),void 0!==t.filmGauge&&(i.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(i.filmOffset=t.filmOffset),void 0!==t.view&&(i.view=Object.assign({},t.view));break;case"OrthographicCamera":i=new On(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(i.zoom=t.zoom),void 0!==t.view&&(i.view=Object.assign({},t.view));break;case"AmbientLight":i=new Ps(t.color,t.intensity);break;case"DirectionalLight":i=new ks(t.color,t.intensity);break;case"PointLight":i=new As(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":i=new Ls(t.color,t.intensity,t.width,t.height);break;case"SpotLight":i=new Ss(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":i=new ws(t.color,t.groundColor,t.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var a=r(t.geometry),s=o(t.material);i=a.bones&&a.bones.length>0?new lo(a,s):new mi(a,s);break;case"LOD":i=new ao;break;case"Line":i=new ho(r(t.geometry),o(t.material),t.mode);break;case"LineLoop":i=new po(r(t.geometry),o(t.material));break;case"LineSegments":i=new fo(r(t.geometry),o(t.material));break;case"PointCloud":case"Points":i=new go(r(t.geometry),o(t.material));break;case"Sprite":i=new oo(o(t.material));break;case"Group":i=new _o;break;default:i=new Pn}if(i.uuid=t.uuid,void 0!==t.name&&(i.name=t.name),void 0!==t.matrix?(i.matrix.fromArray(t.matrix),i.matrix.decompose(i.position,i.quaternion,i.scale)):(void 0!==t.position&&i.position.fromArray(t.position),void 0!==t.rotation&&i.rotation.fromArray(t.rotation),void 0!==t.quaternion&&i.quaternion.fromArray(t.quaternion),void 0!==t.scale&&i.scale.fromArray(t.scale)),void 0!==t.castShadow&&(i.castShadow=t.castShadow),void 0!==t.receiveShadow&&(i.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(i.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(i.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&i.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(i.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(i.visible=t.visible),void 0!==t.frustumCulled&&(i.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(i.renderOrder=t.renderOrder),void 0!==t.userData&&(i.userData=t.userData),void 0!==t.children)for(var c=t.children,l=0;l<c.length;l++)i.add(this.parseObject(c[l],e,n));if("LOD"===t.type)for(var u=t.levels,h=0;h<u.length;h++){var d=u[h],f=i.getObjectByProperty("uuid",d.object);void 0!==f&&i.addLevel(f,d.distance)}return i}});var nc,ic={UVMapping:gt,CubeReflectionMapping:_t,CubeRefractionMapping:vt,EquirectangularReflectionMapping:bt,EquirectangularRefractionMapping:yt,SphericalReflectionMapping:xt,CubeUVReflectionMapping:wt,CubeUVRefractionMapping:Mt},rc={RepeatWrapping:Et,ClampToEdgeWrapping:St,MirroredRepeatWrapping:At},oc={NearestFilter:Tt,NearestMipMapNearestFilter:kt,NearestMipMapLinearFilter:Pt,LinearFilter:Lt,LinearMipMapNearestFilter:Ot,LinearMipMapLinearFilter:Ct};function ac(t){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.manager=void 0!==t?t:Ga,this.options=void 0}function sc(){this.type="ShapePath",this.subPaths=[],this.currentPath=null}function cc(t){this.type="Font",this.data=t}function lc(t,e,n,i,r,o){var a=o.glyphs[t]||o.glyphs["?"];if(a){var s,c,l,u,h,d,f,p,m=new sc;if(a.o)for(var g=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),_=0,v=g.length;_<v;){switch(g[_++]){case"m":s=g[_++]*n+i,c=g[_++]*n+r,m.moveTo(s,c);break;case"l":s=g[_++]*n+i,c=g[_++]*n+r,m.lineTo(s,c);break;case"q":l=g[_++]*n+i,u=g[_++]*n+r,h=g[_++]*n+i,d=g[_++]*n+r,m.quadraticCurveTo(h,d,l,u);break;case"b":l=g[_++]*n+i,u=g[_++]*n+r,h=g[_++]*n+i,d=g[_++]*n+r,f=g[_++]*n+i,p=g[_++]*n+r,m.bezierCurveTo(h,d,f,p,l,u)}}return{offsetX:a.ha*n,path:m}}}function uc(t){this.manager=void 0!==t?t:Ga}ac.prototype={constructor:ac,setOptions:function(t){return this.options=t,this},load:function(t,e,n,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t);var r=this,o=Ha.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout(function(){e&&e(o),r.manager.itemEnd(t)},0),o;fetch(t).then(function(t){return t.blob()}).then(function(t){return createImageBitmap(t,r.options)}).then(function(n){Ha.add(t,n),e&&e(n),r.manager.itemEnd(t)}).catch(function(e){i&&i(e),r.manager.itemEnd(t),r.manager.itemError(t)})},setCrossOrigin:function(){return this},setPath:function(t){return this.path=t,this}},Object.assign(sc.prototype,{moveTo:function(t,e){this.currentPath=new bs,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e)},lineTo:function(t,e){this.currentPath.lineTo(t,e)},quadraticCurveTo:function(t,e,n,i){this.currentPath.quadraticCurveTo(t,e,n,i)},bezierCurveTo:function(t,e,n,i,r,o){this.currentPath.bezierCurveTo(t,e,n,i,r,o)},splineThru:function(t){this.currentPath.splineThru(t)},toShapes:function(t,e){function n(t){for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n],o=new ys;o.curves=r.curves,e.push(o)}return e}function i(t,e){for(var n=e.length,i=!1,r=n-1,o=0;o<n;r=o++){var a=e[r],s=e[o],c=s.x-a.x,l=s.y-a.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(a=e[o],c=-c,s=e[r],l=-l),t.y<a.y||t.y>s.y)continue;if(t.y===a.y){if(t.x===a.x)return!0}else{var u=l*(t.x-a.x)-c*(t.y-a.y);if(0===u)return!0;if(u<0)continue;i=!i}}else{if(t.y!==a.y)continue;if(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x)return!0}}return i}var r=ca.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===e)return n(o);var a,s,c,l=[];if(1===o.length)return s=o[0],(c=new ys).curves=s.curves,l.push(c),l;var u=!r(o[0].getPoints());u=t?!u:u;var h,d,f=[],p=[],m=[],g=0;p[g]=void 0,m[g]=[];for(var _=0,v=o.length;_<v;_++)a=r(h=(s=o[_]).getPoints()),(a=t?!a:a)?(!u&&p[g]&&g++,p[g]={s:new ys,p:h},p[g].s.curves=s.curves,u&&g++,m[g]=[]):m[g].push({h:s,p:h[0]});if(!p[0])return n(o);if(p.length>1){for(var b=!1,y=[],x=0,w=p.length;x<w;x++)f[x]=[];for(x=0,w=p.length;x<w;x++)for(var M=m[x],E=0;E<M.length;E++){for(var S=M[E],A=!0,T=0;T<p.length;T++)i(S.p,p[T].p)&&(x!==T&&y.push({froms:x,tos:T,hole:E}),A?(A=!1,f[T].push(S)):b=!0);A&&f[x].push(S)}y.length>0&&(b||(m=f))}_=0;for(var k=p.length;_<k;_++){c=p[_].s,l.push(c);for(var P=0,L=(d=m[_]).length;P<L;P++)c.holes.push(d[P].h)}return l}}),Object.assign(cc.prototype,{isFont:!0,generateShapes:function(t,e,n){void 0===e&&(e=100),void 0===n&&(n=4);for(var i=[],r=function(t,e,n,i){for(var r=String(t).split(""),o=e/i.resolution,a=(i.boundingBox.yMax-i.boundingBox.yMin+i.underlineThickness)*o,s=[],c=0,l=0,u=0;u<r.length;u++){var h=r[u];if("\n"===h)c=0,l-=a;else{var d=lc(h,n,o,c,l,i);c+=d.offsetX,s.push(d.path)}}return s}(t,e,n,this.data),o=0,a=r.length;o<a;o++)Array.prototype.push.apply(i,r[o].toShapes());return i}}),Object.assign(uc.prototype,{load:function(t,e,n,i){var r=this,o=new Va(this.manager);o.setPath(this.path),o.load(t,function(t){var n;try{n=JSON.parse(t)}catch(e){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(t.substring(65,t.length-2))}var i=r.parse(n);e&&e(i)},n,i)},parse:function(t){return new cc(t)},setPath:function(t){return this.path=t,this}});var hc,dc,fc,pc,mc,gc,_c,vc,bc,yc,xc={getContext:function(){return void 0===nc&&(nc=new(window.AudioContext||window.webkitAudioContext)),nc},setContext:function(t){nc=t}};function wc(t){this.manager=void 0!==t?t:Ga}function Mc(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Jr,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Jr,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function Ec(t,e,n){Pn.call(this),this.type="CubeCamera";var i=new Jr(90,1,t,e);i.up.set(0,-1,0),i.lookAt(new Ye(1,0,0)),this.add(i);var r=new Jr(90,1,t,e);r.up.set(0,-1,0),r.lookAt(new Ye(-1,0,0)),this.add(r);var o=new Jr(90,1,t,e);o.up.set(0,0,1),o.lookAt(new Ye(0,1,0)),this.add(o);var a=new Jr(90,1,t,e);a.up.set(0,0,-1),a.lookAt(new Ye(0,-1,0)),this.add(a);var s=new Jr(90,1,t,e);s.up.set(0,-1,0),s.lookAt(new Ye(0,0,1)),this.add(s);var c=new Jr(90,1,t,e);c.up.set(0,-1,0),c.lookAt(new Ye(0,0,-1)),this.add(c);var l={format:Vt,magFilter:Lt,minFilter:Lt};this.renderTarget=new sn(n,n,l),this.renderTarget.texture.name="CubeCamera",this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var n=this.renderTarget,l=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,n.activeCubeFace=0,t.render(e,i,n),n.activeCubeFace=1,t.render(e,r,n),n.activeCubeFace=2,t.render(e,o,n),n.activeCubeFace=3,t.render(e,a,n),n.activeCubeFace=4,t.render(e,s,n),n.texture.generateMipmaps=l,n.activeCubeFace=5,t.render(e,c,n),t.setRenderTarget(null)},this.clear=function(t,e,n,i){for(var r=this.renderTarget,o=0;o<6;o++)r.activeCubeFace=o,t.setRenderTarget(r),t.clear(e,n,i);t.setRenderTarget(null)}}function Sc(){Pn.call(this),this.type="AudioListener",this.context=xc.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null}function Ac(t){Pn.call(this),this.type="Audio",this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.loop=!1,this.startTime=0,this.offset=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function Tc(t){Ac.call(this,t),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function kc(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function Pc(t,e,n){this.binding=t,this.valueSize=n;var i,r=Float64Array;switch(e){case"quaternion":i=this._slerp;break;case"string":case"bool":r=Array,i=this._select;break;default:i=this._lerp}this.buffer=new r(4*n),this._mixBufferRegion=i,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}Object.assign(wc.prototype,{load:function(t,e,n,i){var r=new Va(this.manager);r.setResponseType("arraybuffer"),r.load(t,function(t){xc.getContext().decodeAudioData(t,function(t){e(t)})},n,i)}}),Object.assign(Mc.prototype,{update:(bc=new Ve,yc=new Ve,function(t){if(hc!==this||dc!==t.focus||fc!==t.fov||pc!==t.aspect*this.aspect||mc!==t.near||gc!==t.far||_c!==t.zoom||vc!==this.eyeSep){hc=this,dc=t.focus,fc=t.fov,pc=t.aspect*this.aspect,mc=t.near,gc=t.far,_c=t.zoom;var e,n,i=t.projectionMatrix.clone(),r=(vc=this.eyeSep/2)*mc/dc,o=mc*Math.tan(Ge.DEG2RAD*fc*.5)/_c;yc.elements[12]=-vc,bc.elements[12]=vc,e=-o*pc+r,n=o*pc+r,i.elements[0]=2*mc/(n-e),i.elements[8]=(n+e)/(n-e),this.cameraL.projectionMatrix.copy(i),e=-o*pc-r,n=o*pc-r,i.elements[0]=2*mc/(n-e),i.elements[8]=(n+e)/(n-e),this.cameraR.projectionMatrix.copy(i)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(yc),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(bc)})}),Ec.prototype=Object.create(Pn.prototype),Ec.prototype.constructor=Ec,Sc.prototype=Object.assign(Object.create(Pn.prototype),{constructor:Sc,getInput:function(){return this.gain},removeFilter:function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null)},getFilter:function(){return this.filter},setFilter:function(t){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination)},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){this.gain.gain.value=t},updateMatrixWorld:function(){var t=new Ye,e=new Xe,n=new Ye,i=new Ye;return function(r){Pn.prototype.updateMatrixWorld.call(this,r);var o=this.context.listener,a=this.up;this.matrixWorld.decompose(t,e,n),i.set(0,0,-1).applyQuaternion(e),o.positionX?(o.positionX.setValueAtTime(t.x,this.context.currentTime),o.positionY.setValueAtTime(t.y,this.context.currentTime),o.positionZ.setValueAtTime(t.z,this.context.currentTime),o.forwardX.setValueAtTime(i.x,this.context.currentTime),o.forwardY.setValueAtTime(i.y,this.context.currentTime),o.forwardZ.setValueAtTime(i.z,this.context.currentTime),o.upX.setValueAtTime(a.x,this.context.currentTime),o.upY.setValueAtTime(a.y,this.context.currentTime),o.upZ.setValueAtTime(a.z,this.context.currentTime)):(o.setPosition(t.x,t.y,t.z),o.setOrientation(i.x,i.y,i.z,a.x,a.y,a.z))}}()}),Ac.prototype=Object.assign(Object.create(Pn.prototype),{constructor:Ac,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.onended=this.onEnded.bind(this),t.playbackRate.setValueAtTime(this.playbackRate,this.startTime),this.startTime=this.context.currentTime,t.start(this.startTime,this.offset),this.isPlaying=!0,this.source=t,this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this.source.stop(),this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this.source.stop(),this.offset=0,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t||(t=[]),!0===this.isPlaying?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},getFilter:function(){return this.getFilters()[0]},setFilter:function(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setValueAtTime(this.playbackRate,this.context.currentTime),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.value=t,this}}),Tc.prototype=Object.assign(Object.create(Ac.prototype),{constructor:Tc,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){this.panner.refDistance=t},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){this.panner.rolloffFactor=t},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){this.panner.distanceModel=t},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){this.panner.maxDistance=t},updateMatrixWorld:function(){var t=new Ye;return function(e){Pn.prototype.updateMatrixWorld.call(this,e),t.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(t.x,t.y,t.z)}}()}),Object.assign(kc.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var t=0,e=this.getFrequencyData(),n=0;n<e.length;n++)t+=e[n];return t/e.length}}),Object.assign(Pc.prototype,{accumulate:function(t,e){var n=this.buffer,i=this.valueSize,r=t*i+i,o=this.cumulativeWeight;if(0===o){for(var a=0;a!==i;++a)n[r+a]=n[a];o=e}else{var s=e/(o+=e);this._mixBufferRegion(n,r,0,s,i)}this.cumulativeWeight=o},apply:function(t){var e=this.valueSize,n=this.buffer,i=t*e+e,r=this.cumulativeWeight,o=this.binding;if(this.cumulativeWeight=0,r<1){var a=3*e;this._mixBufferRegion(n,i,a,1-r,e)}for(var s=e,c=e+e;s!==c;++s)if(n[s]!==n[s+e]){o.setValue(n,i);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,n=this.valueSize,i=3*n;t.getValue(e,i);for(var r=n,o=i;r!==o;++r)e[r]=e[i+r%n];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_select:function(t,e,n,i,r){if(i>=.5)for(var o=0;o!==r;++o)t[e+o]=t[n+o]},_slerp:function(t,e,n,i){Xe.slerpFlat(t,e,t,e,t,n,i)},_lerp:function(t,e,n,i,r){for(var o=1-i,a=0;a!==r;++a){var s=e+a;t[s]=t[s]*o+t[n+a]*i}}});var Lc,Oc,Cc,Rc,Ic,zc,Bc,Nc,Dc,jc,Uc,Fc,Hc;function qc(t,e,n){var i=n||Gc.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}function Gc(t,e,n){this.path=e,this.parsedPath=n||Gc.parseTrackName(e),this.node=Gc.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function Wc(){this.uuid=Ge.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,n=arguments.length;e!==n;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}function Vc(t,e,n){this._mixer=t,this._clip=e,this._localRoot=n||null;for(var i=e.tracks,r=i.length,o=new Array(r),a={endingStart:ke,endingEnd:ke},s=0;s!==r;++s){var c=i[s].createInterpolant(null);o[s]=c,c.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Me,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function Xc(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Yc(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function Kc(){Zn.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function Zc(t,e,n,i){this.data=t,this.itemSize=e,this.offset=n,this.normalized=!0===i}function Jc(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function Qc(t,e,n){Jc.call(this,t,e),this.meshPerAttribute=n||1}function $c(t,e,n){Nn.call(this,t,e),this.meshPerAttribute=n||1}function tl(t,e,n,i){this.ray=new di(t,e),this.near=n||0,this.far=i||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function el(t,e){return t.distance-e.distance}function nl(t,e,n,i){if(!1!==t.visible&&(t.raycast(e,n),!0===i))for(var r=t.children,o=0,a=r.length;o<a;o++)nl(r[o],e,n,!0)}function il(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function rl(t,e,n){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==n?n:0,this}function ol(t,e,n){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==n?n:0,this}function al(t,e){this.min=void 0!==t?t:new We(1/0,1/0),this.max=void 0!==e?e:new We(-1/0,-1/0)}function sl(t){Pn.call(this),this.material=t,this.render=function(){}}function cl(t,e,n,i){this.object=t,this.size=void 0!==e?e:1;var r=void 0!==n?n:16711680,o=void 0!==i?i:1,a=0,s=this.object.geometry;s&&s.isGeometry?a=3*s.faces.length:s&&s.isBufferGeometry&&(a=s.attributes.normal.count);var c=new Zn,l=new Wn(2*a*3,3);c.addAttribute("position",l),fo.call(this,c,new uo({color:r,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function ll(t,e){Pn.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var n=new Zn,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],r=0,o=1;r<32;r++,o++){var a=r/32*Math.PI*2,s=o/32*Math.PI*2;i.push(Math.cos(a),Math.sin(a),1,Math.cos(s),Math.sin(s),1)}n.addAttribute("position",new Wn(i,3));var c=new uo({fog:!1});this.cone=new fo(n,c),this.add(this.cone),this.update()}function ul(t){for(var e=function t(e){var n=[];e&&e.isBone&&n.push(e);for(var i=0;i<e.children.length;i++)n.push.apply(n,t(e.children[i]));return n}(t),n=new Zn,i=[],r=[],o=new _n(0,0,1),a=new _n(0,1,0),s=0;s<e.length;s++){var c=e[s];c.parent&&c.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(o.r,o.g,o.b),r.push(a.r,a.g,a.b))}n.addAttribute("position",new Wn(i,3)),n.addAttribute("color",new Wn(r,3));var l=new uo({vertexColors:O,depthTest:!1,depthWrite:!1,transparent:!0});fo.call(this,n,l),this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}function hl(t,e,n){this.light=t,this.light.updateMatrixWorld(),this.color=n;var i=new ga(e,4,2),r=new ui({wireframe:!0,fog:!1});mi.call(this,i,r),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function dl(t,e){Pn.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;var n=new uo({fog:!1}),i=new Zn;i.addAttribute("position",new Nn(new Float32Array(15),3)),this.line=new ho(i,n),this.add(this.line),this.update()}function fl(t,e,n){Pn.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var i=new Po(e);i.rotateY(.5*Math.PI),this.material=new ui({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=O);var r=i.getAttribute("position"),o=new Float32Array(3*r.count);i.addAttribute("color",new Nn(o,3)),this.add(new mi(i,this.material)),this.update()}function pl(t,e,n,i){t=t||10,e=e||10,n=new _n(void 0!==n?n:4473924),i=new _n(void 0!==i?i:8947848);for(var r=e/2,o=t/e,a=t/2,s=[],c=[],l=0,u=0,h=-a;l<=e;l++,h+=o){s.push(-a,0,h,a,0,h),s.push(h,0,-a,h,0,a);var d=l===r?n:i;d.toArray(c,u),u+=3,d.toArray(c,u),u+=3,d.toArray(c,u),u+=3,d.toArray(c,u),u+=3}var f=new Zn;f.addAttribute("position",new Wn(s,3)),f.addAttribute("color",new Wn(c,3));var p=new uo({vertexColors:O});fo.call(this,f,p)}function ml(t,e,n,i,r,o){t=t||10,e=e||16,n=n||8,i=i||64,r=new _n(void 0!==r?r:4473924),o=new _n(void 0!==o?o:8947848);var a,s,c,l,u,h,d,f=[],p=[];for(l=0;l<=e;l++)c=l/e*(2*Math.PI),a=Math.sin(c)*t,s=Math.cos(c)*t,f.push(0,0,0),f.push(a,0,s),d=1&l?r:o,p.push(d.r,d.g,d.b),p.push(d.r,d.g,d.b);for(l=0;l<=n;l++)for(d=1&l?r:o,h=t-t/n*l,u=0;u<i;u++)c=u/i*(2*Math.PI),a=Math.sin(c)*h,s=Math.cos(c)*h,f.push(a,0,s),p.push(d.r,d.g,d.b),c=(u+1)/i*(2*Math.PI),a=Math.sin(c)*h,s=Math.cos(c)*h,f.push(a,0,s),p.push(d.r,d.g,d.b);var m=new Zn;m.addAttribute("position",new Wn(f,3)),m.addAttribute("color",new Wn(p,3));var g=new uo({vertexColors:O});fo.call(this,m,g)}function gl(t,e,n,i){this.object=t,this.size=void 0!==e?e:1;var r=void 0!==n?n:16776960,o=void 0!==i?i:1,a=0,s=this.object.geometry;s&&s.isGeometry?a=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var c=new Zn,l=new Wn(2*a*3,3);c.addAttribute("position",l),fo.call(this,c,new uo({color:r,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function _l(t,e,n){Pn.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===e&&(e=1);var i=new Zn;i.addAttribute("position",new Wn([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var r=new uo({fog:!1});this.lightPlane=new ho(i,r),this.add(this.lightPlane),(i=new Zn).addAttribute("position",new Wn([0,0,0,0,0,1],3)),this.targetLine=new ho(i,r),this.add(this.targetLine),this.update()}function vl(t){var e=new Zn,n=new uo({color:16777215,vertexColors:L}),i=[],r=[],o={},a=new _n(16755200),s=new _n(16711680),c=new _n(43775),l=new _n(16777215),u=new _n(3355443);function h(t,e,n){d(t,n),d(e,n)}function d(t,e){i.push(0,0,0),r.push(e.r,e.g,e.b),void 0===o[t]&&(o[t]=[]),o[t].push(i.length/3-1)}h("n1","n2",a),h("n2","n4",a),h("n4","n3",a),h("n3","n1",a),h("f1","f2",a),h("f2","f4",a),h("f4","f3",a),h("f3","f1",a),h("n1","f1",a),h("n2","f2",a),h("n3","f3",a),h("n4","f4",a),h("p","n1",s),h("p","n2",s),h("p","n3",s),h("p","n4",s),h("u1","u2",c),h("u2","u3",c),h("u3","u1",c),h("c","t",l),h("p","c",u),h("cn1","cn2",u),h("cn3","cn4",u),h("cf1","cf2",u),h("cf3","cf4",u),e.addAttribute("position",new Wn(i,3)),e.addAttribute("color",new Wn(r,3)),fo.call(this,e,n),this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}function bl(t,e){this.object=t,void 0===e&&(e=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),r=new Zn;r.setIndex(new Nn(n,1)),r.addAttribute("position",new Nn(i,3)),fo.call(this,r,new uo({color:e})),this.matrixAutoUpdate=!1,this.update()}function yl(t,e){this.type="Box3Helper",this.box=t;var n=void 0!==e?e:16776960,i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Zn;r.setIndex(new Nn(i,1)),r.addAttribute("position",new Wn([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),fo.call(this,r,new uo({color:n})),this.geometry.computeBoundingSphere()}function xl(t,e,n){this.type="PlaneHelper",this.plane=t,this.size=void 0===e?1:e;var i=void 0!==n?n:16776960,r=new Zn;r.addAttribute("position",new Wn([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),r.computeBoundingSphere(),ho.call(this,r,new uo({color:i}));var o=new Zn;o.addAttribute("position",new Wn([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),o.computeBoundingSphere(),this.add(new mi(o,new ui({color:i,opacity:.2,transparent:!0,depthWrite:!1})))}function wl(t,e,n,i,r,o){Pn.call(this),void 0===i&&(i=16776960),void 0===n&&(n=1),void 0===r&&(r=.2*n),void 0===o&&(o=.2*r),void 0===jc&&((jc=new Zn).addAttribute("position",new Wn([0,0,0,0,1,0],3)),(Uc=new Aa(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(e),this.line=new ho(jc,new uo({color:i})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new mi(Uc,new ui({color:i})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(n,r,o)}function Ml(t){var e=[0,0,0,t=t||1,0,0,0,0,0,0,t,0,0,0,0,0,0,t],n=new Zn;n.addAttribute("position",new Wn(e,3)),n.addAttribute("color",new Wn([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var i=new uo({vertexColors:O});fo.call(this,n,i)}function El(t,e,n,i,r,o,a){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new Cn(t,e,n,r,o,a)}Object.assign(qc.prototype,{getValue:function(t,e){this.bind();var n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(t,e)},setValue:function(t,e){for(var n=this._bindings,i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(Gc,{Composite:qc,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new Gc.Composite(t,e,n):new Gc(t,e,n)},sanitizeNodeName:(Dc=new RegExp("[\\[\\]\\.:\\/]","g"),function(t){return t.replace(/\s/g,"_").replace(Dc,"")}),parseTrackName:(Lc="[^\\[\\]\\.:\\/]",Oc="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Cc=/((?:WC+[\/:])*)/.source.replace("WC",Lc),Rc=/(WCOD+)?/.source.replace("WCOD",Oc),Ic=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Lc),zc=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Lc),Bc=new RegExp("^"+Cc+Rc+Ic+zc+"$"),Nc=["material","materials","bones"],function(t){var e=Bc.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){var r=n.nodeName.substring(i+1);-1!==Nc.indexOf(r)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=r)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}),findNode:function(t,e){if(!e||""===e||"root"===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){var i=function(t){for(var n=0;n<t.length;n++){var r=t[n];if(r.name===e||r.uuid===e)return r;var o=i(r.children);if(o)return o}return null},r=i(t.children);if(r)return r}return null}}),Object.assign(Gc.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)t[e++]=n[i]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++]},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,n=e.objectName,i=e.propertyName,r=e.propertyIndex;if(t||(t=Gc.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(n){var o=e.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var a=0;a<t.length;a++)if(t[a].name===o){o=a;break}break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==o){if(void 0===t[o])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[o]}}var s=t[i];if(void 0!==s){var c=this.Versioning.None;void 0!==t.needsUpdate?(c=this.Versioning.NeedsUpdate,this.targetObject=t):void 0!==t.matrixWorldNeedsUpdate&&(c=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=t);var l=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===i){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(t.geometry.isBufferGeometry){if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(a=0;a<this.node.geometry.morphAttributes.position.length;a++)if(t.geometry.morphAttributes.position[a].name===r){r=a;break}}else{if(!t.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(a=0;a<this.node.geometry.morphTargets.length;a++)if(t.geometry.morphTargets[a].name===r){r=a;break}}}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=i;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][c]}else{var u=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+i+" but it wasn't found.",t)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),
//!\ DECLARE ALIAS AFTER assign prototype !
Object.assign(Gc.prototype,{_getValue_unbound:Gc.prototype.getValue,_setValue_unbound:Gc.prototype.setValue}),Object.assign(Wc.prototype,{isAnimationObjectGroup:!0,add:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._paths,o=this._parsedPaths,a=this._bindings,s=a.length,c=void 0,l=0,u=arguments.length;l!==u;++l){var h=arguments[l],d=h.uuid,f=i[d];if(void 0===f){f=e++,i[d]=f,t.push(h);for(var p=0,m=s;p!==m;++p)a[p].push(new Gc(h,r[p],o[p]))}else if(f<n){c=t[f];var g=--n,_=t[g];i[_.uuid]=f,t[f]=_,i[d]=g,t[g]=h;for(p=0,m=s;p!==m;++p){var v=a[p],b=v[g],y=v[f];v[f]=b,void 0===y&&(y=new Gc(h,r[p],o[p])),v[g]=y}}else t[f]!==c&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var t=this._objects,e=this.nCachedObjects_,n=this._indicesByUUID,i=this._bindings,r=i.length,o=0,a=arguments.length;o!==a;++o){var s=arguments[o],c=s.uuid,l=n[c];if(void 0!==l&&l>=e){var u=e++,h=t[u];n[h.uuid]=l,t[l]=h,n[c]=u,t[u]=s;for(var d=0,f=r;d!==f;++d){var p=i[d],m=p[u],g=p[l];p[l]=m,p[u]=g}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._bindings,o=r.length,a=0,s=arguments.length;a!==s;++a){var c=arguments[a],l=c.uuid,u=i[l];if(void 0!==u)if(delete i[l],u<n){var h=--n,d=t[h],f=t[v=--e];i[d.uuid]=u,t[u]=d,i[f.uuid]=h,t[h]=f,t.pop();for(var p=0,m=o;p!==m;++p){var g=(b=r[p])[h],_=b[v];b[u]=g,b[h]=_,b.pop()}}else{var v;i[(f=t[v=--e]).uuid]=u,t[u]=f,t.pop();for(p=0,m=o;p!==m;++p){var b;(b=r[p])[u]=b[v],b.pop()}}}this.nCachedObjects_=n},subscribe_:function(t,e){var n=this._bindingsIndicesByPath,i=n[t],r=this._bindings;if(void 0!==i)return r[i];var o=this._paths,a=this._parsedPaths,s=this._objects,c=s.length,l=this.nCachedObjects_,u=new Array(c);i=r.length,n[t]=i,o.push(t),a.push(e),r.push(u);for(var h=l,d=s.length;h!==d;++h){var f=s[h];u[h]=new Gc(f,t,e)}return u},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){var i=this._paths,r=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a];e[t[a]]=n,o[n]=s,o.pop(),r[n]=r[a],r.pop(),i[n]=i[a],i.pop()}}}),Object.assign(Vc.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){var i=this._clip.duration,r=t._clip.duration,o=r/i,a=i/r;t.warp(1,o,e),this.warp(a,1,e)}return this},crossFadeTo:function(t,e,n){return t.crossFadeFrom(this,e,n)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._effectiveTimeScale,0,t)},warp:function(t,e,n){var i=this._mixer,r=i.time,o=this._timeScaleInterpolant,a=this.timeScale;null===o&&(o=i._lendControlInterpolant(),this._timeScaleInterpolant=o);var s=o.parameterPositions,c=o.sampleValues;return s[0]=r,s[1]=r+n,c[0]=t/a,c[1]=e/a,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,n,i){if(this.enabled){var r=this._startTime;if(null!==r){var o=(t-r)*n;if(o<0||0===n)return;this._startTime=null,e=n*o}e*=this._updateTimeScale(t);var a=this._updateTime(e),s=this._updateWeight(t);if(s>0)for(var c=this._interpolants,l=this._propertyBindings,u=0,h=c.length;u!==h;++u)c[u].evaluate(a),l[u].accumulate(i,s)}else this._updateWeight(t)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var n=this._weightInterpolant;if(null!==n){var i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}return this._effectiveTimeScale=e,e},_updateTime:function(t){var e=this.time+t;if(0===t)return e;var n=this._clip.duration,i=this.loop,r=this._loopCount;if(i===we){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(e>=n)e=n;else{if(!(e<0))break t;e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{var o=i===Ee;if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),e>=n||e<0){var a=Math.floor(e/n);e-=n*a,r+=Math.abs(a);var s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=t>0?n:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){var c=t<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}if(o&&1==(1&r))return this.time=e,n-e}return this.time=e,e},_setEndings:function(t,e,n){var i=this._interpolantSettings;n?(i.endingStart=Pe,i.endingEnd=Pe):(i.endingStart=t?this.zeroSlopeAtStart?Pe:ke:Le,i.endingEnd=e?this.zeroSlopeAtEnd?Pe:ke:Le)},_scheduleFading:function(t,e,n){var i=this._mixer,r=i.time,o=this._weightInterpolant;null===o&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=r,s[0]=e,a[1]=r+t,s[1]=n,this}}),Xc.prototype=Object.assign(Object.create(i.prototype),{constructor:Xc,_bindAction:function(t,e){var n=t._localRoot||this._root,i=t._clip.tracks,r=i.length,o=t._propertyBindings,a=t._interpolants,s=n.uuid,c=this._bindingsByRootAndName,l=c[s];void 0===l&&(l={},c[s]=l);for(var u=0;u!==r;++u){var h=i[u],d=h.name,f=l[d];if(void 0!==f)o[u]=f;else{if(void 0!==(f=o[u])){null===f._cacheIndex&&(++f.referenceCount,this._addInactiveBinding(f,s,d));continue}var p=e&&e._propertyBindings[u].binding.parsedPath;++(f=new Pc(Gc.create(n,d,p),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(f,s,d),o[u]=f}a[u].resultBuffer=f.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,n=t._clip.uuid,i=this._actionsByClip[n];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,n,e)}for(var r=t._propertyBindings,o=0,a=r.length;o!==a;++o){var s=r[o];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,n=0,i=e.length;n!==i;++n){var r=e[n];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,n){var i=this._actions,r=this._actionsByClip,o=r[e];if(void 0===o)o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=o;else{var a=o.knownActions;t._byClipCacheIndex=a.length,a.push(t)}t._cacheIndex=i.length,i.push(t),o.actionByRoot[n]=t},_removeInactiveAction:function(t){var e=this._actions,n=e[e.length-1],i=t._cacheIndex;n._cacheIndex=i,e[i]=n,e.pop(),t._cacheIndex=null;var r=t._clip.uuid,o=this._actionsByClip,a=o[r],s=a.knownActions,c=s[s.length-1],l=t._byClipCacheIndex;c._byClipCacheIndex=l,s[l]=c,s.pop(),t._byClipCacheIndex=null,delete a.actionByRoot[(t._localRoot||this._root).uuid],0===s.length&&delete o[r],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=t._propertyBindings,n=0,i=e.length;n!==i;++n){var r=e[n];0==--r.referenceCount&&this._removeInactiveBinding(r)}},_lendAction:function(t){var e=this._actions,n=t._cacheIndex,i=this._nActiveActions++,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_takeBackAction:function(t){var e=this._actions,n=t._cacheIndex,i=--this._nActiveActions,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_addInactiveBinding:function(t,e,n){var i=this._bindingsByRootAndName,r=i[e],o=this._bindings;void 0===r&&(r={},i[e]=r),r[n]=t,t._cacheIndex=o.length,o.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,n=t.binding,i=n.rootNode.uuid,r=n.path,o=this._bindingsByRootAndName,a=o[i],s=e[e.length-1],c=t._cacheIndex;s._cacheIndex=c,e[c]=s,e.pop(),delete a[r];t:{for(var l in a)break t;delete o[i]}},_lendBinding:function(t){var e=this._bindings,n=t._cacheIndex,i=this._nActiveBindings++,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_takeBackBinding:function(t){var e=this._bindings,n=t._cacheIndex,i=--this._nActiveBindings,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,n=t[e];return void 0===n&&((n=new js(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=e,t[e]=n),n},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,n=t.__cacheIndex,i=--this._nActiveControlInterpolants,r=e[i];t.__cacheIndex=i,e[i]=t,r.__cacheIndex=n,e[n]=r},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e){var n=e||this._root,i=n.uuid,r="string"==typeof t?Gs.findByName(n,t):t,o=null!==r?r.uuid:t,a=this._actionsByClip[o],s=null;if(void 0!==a){var c=a.actionByRoot[i];if(void 0!==c)return c;s=a.knownActions[0],null===r&&(r=s._clip)}if(null===r)return null;var l=new Vc(this,r,e);return this._bindAction(l,s),this._addInactiveAction(l,o,i),l},existingAction:function(t,e){var n=e||this._root,i=n.uuid,r="string"==typeof t?Gs.findByName(n,t):t,o=r?r.uuid:t,a=this._actionsByClip[o];return void 0!==a&&a.actionByRoot[i]||null},stopAllAction:function(){var t=this._actions,e=this._nActiveActions,n=this._bindings,i=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var r=0;r!==e;++r)t[r].reset();for(r=0;r!==i;++r)n[r].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,n=this._nActiveActions,i=this.time+=t,r=Math.sign(t),o=this._accuIndex^=1,a=0;a!==n;++a){e[a]._update(i,t,r,o)}var s=this._bindings,c=this._nActiveBindings;for(a=0;a!==c;++a)s[a].apply(o);return this},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions,n=t.uuid,i=this._actionsByClip,r=i[n];if(void 0!==r){for(var o=r.knownActions,a=0,s=o.length;a!==s;++a){var c=o[a];this._deactivateAction(c);var l=c._cacheIndex,u=e[e.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,u._cacheIndex=l,e[l]=u,e.pop(),this._removeInactiveBindingsForAction(c)}delete i[n]}},uncacheRoot:function(t){var e=t.uuid,n=this._actionsByClip;for(var i in n){var r=n[i].actionByRoot[e];void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}var o=this._bindingsByRootAndName[e];if(void 0!==o)for(var a in o){var s=o[a];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(t,e){var n=this.existingAction(t,e);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),Yc.prototype.clone=function(){return new Yc(void 0===this.value.clone?this.value:this.value.clone())},Kc.prototype=Object.assign(Object.create(Zn.prototype),{constructor:Kc,isInstancedBufferGeometry:!0,copy:function(t){return Zn.prototype.copy.call(this,t),this.maxInstancedCount=t.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)}}),Object.defineProperties(Zc.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(Zc.prototype,{isInterleavedBufferAttribute:!0,setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this},setXYZ:function(t,e,n,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this},setXYZW:function(t,e,n,i,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this.data.array[t+3]=r,this}}),Object.defineProperty(Jc.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Jc.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==t?t.length/this.stride:0,this.array=t},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.dynamic=t.dynamic,this},copyAt:function(t,e,n){t*=this.stride,n*=e.stride;for(var i=0,r=this.stride;i<r;i++)this.array[t+i]=e.array[n+i];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}}),Qc.prototype=Object.assign(Object.create(Jc.prototype),{constructor:Qc,isInstancedInterleavedBuffer:!0,copy:function(t){return Jc.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),$c.prototype=Object.assign(Object.create(Nn.prototype),{constructor:$c,isInstancedBufferAttribute:!0,copy:function(t){return Nn.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),Object.assign(tl.prototype,{linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize()):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,e,n){var i=n||[];return nl(t,this,i,e),i.sort(el),i},intersectObjects:function(t,e,n){var i=n||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var r=0,o=t.length;r<o;r++)nl(t[r],this,i,e);return i.sort(el),i}}),Object.assign(il.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var e=("undefined"==typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}),Object.assign(rl.prototype,{set:function(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(t){return this.radius=t.length(),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t.x,t.z),this.phi=Math.acos(Ge.clamp(t.y/this.radius,-1,1))),this}}),Object.assign(ol.prototype,{set:function(t,e,n){return this.radius=t,this.theta=e,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.radius=Math.sqrt(t.x*t.x+t.z*t.z),this.theta=Math.atan2(t.x,t.z),this.y=t.y,this}}),Object.assign(al.prototype,{set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new We;return function(e,n){var i=t.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new We),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new We),this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new We),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new We),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new We;return function(e){return t.copy(e).clamp(this.min,this.max).sub(e).length()}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),sl.prototype=Object.create(Pn.prototype),sl.prototype.constructor=sl,sl.prototype.isImmediateRenderObject=!0,cl.prototype=Object.create(fo.prototype),cl.prototype.constructor=cl,cl.prototype.update=function(){var t=new Ye,e=new Ye,n=new Ke;return function(){var i=["a","b","c"];this.object.updateMatrixWorld(!0),n.getNormalMatrix(this.object.matrixWorld);var r=this.object.matrixWorld,o=this.geometry.attributes.position,a=this.object.geometry;if(a&&a.isGeometry)for(var s=a.vertices,c=a.faces,l=0,u=0,h=c.length;u<h;u++)for(var d=c[u],f=0,p=d.vertexNormals.length;f<p;f++){var m=s[d[i[f]]],g=d.vertexNormals[f];t.copy(m).applyMatrix4(r),e.copy(g).applyMatrix3(n).normalize().multiplyScalar(this.size).add(t),o.setXYZ(l,t.x,t.y,t.z),l+=1,o.setXYZ(l,e.x,e.y,e.z),l+=1}else if(a&&a.isBufferGeometry){var _=a.attributes.position,v=a.attributes.normal;for(l=0,f=0,p=_.count;f<p;f++)t.set(_.getX(f),_.getY(f),_.getZ(f)).applyMatrix4(r),e.set(v.getX(f),v.getY(f),v.getZ(f)),e.applyMatrix3(n).normalize().multiplyScalar(this.size).add(t),o.setXYZ(l,t.x,t.y,t.z),l+=1,o.setXYZ(l,e.x,e.y,e.z),l+=1}o.needsUpdate=!0}}(),ll.prototype=Object.create(Pn.prototype),ll.prototype.constructor=ll,ll.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},ll.prototype.update=function(){var t=new Ye,e=new Ye;return function(){this.light.updateMatrixWorld();var n=this.light.distance?this.light.distance:1e3,i=n*Math.tan(this.light.angle);this.cone.scale.set(i,i,n),t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(e.sub(t)),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}(),ul.prototype=Object.create(fo.prototype),ul.prototype.constructor=ul,ul.prototype.updateMatrixWorld=function(){var t=new Ye,e=new Ve,n=new Ve;return function(i){var r=this.bones,o=this.geometry,a=o.getAttribute("position");n.getInverse(this.root.matrixWorld);for(var s=0,c=0;s<r.length;s++){var l=r[s];l.parent&&l.parent.isBone&&(e.multiplyMatrices(n,l.matrixWorld),t.setFromMatrixPosition(e),a.setXYZ(c,t.x,t.y,t.z),e.multiplyMatrices(n,l.parent.matrixWorld),t.setFromMatrixPosition(e),a.setXYZ(c+1,t.x,t.y,t.z),c+=2)}o.getAttribute("position").needsUpdate=!0,Pn.prototype.updateMatrixWorld.call(this,i)}}(),hl.prototype=Object.create(mi.prototype),hl.prototype.constructor=hl,hl.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},hl.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},dl.prototype=Object.create(Pn.prototype),dl.prototype.constructor=dl,dl.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},dl.prototype.update=function(){var t=.5*this.light.width,e=.5*this.light.height,n=this.line.geometry.attributes.position,i=n.array;i[0]=t,i[1]=-e,i[2]=0,i[3]=t,i[4]=e,i[5]=0,i[6]=-t,i[7]=e,i[8]=0,i[9]=-t,i[10]=-e,i[11]=0,i[12]=t,i[13]=-e,i[14]=0,n.needsUpdate=!0,void 0!==this.color?this.line.material.color.set(this.color):this.line.material.color.copy(this.light.color)},fl.prototype=Object.create(Pn.prototype),fl.prototype.constructor=fl,fl.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},fl.prototype.update=function(){var t=new Ye,e=new _n,n=new _n;return function(){var i=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var r=i.geometry.getAttribute("color");e.copy(this.light.color),n.copy(this.light.groundColor);for(var o=0,a=r.count;o<a;o++){var s=o<a/2?e:n;r.setXYZ(o,s.r,s.g,s.b)}r.needsUpdate=!0}i.lookAt(t.setFromMatrixPosition(this.light.matrixWorld).negate())}}(),pl.prototype=Object.create(fo.prototype),pl.prototype.constructor=pl,ml.prototype=Object.create(fo.prototype),ml.prototype.constructor=ml,gl.prototype=Object.create(fo.prototype),gl.prototype.constructor=gl,gl.prototype.update=function(){var t=new Ye,e=new Ye,n=new Ke;return function(){this.object.updateMatrixWorld(!0),n.getNormalMatrix(this.object.matrixWorld);for(var i=this.object.matrixWorld,r=this.geometry.attributes.position,o=this.object.geometry,a=o.vertices,s=o.faces,c=0,l=0,u=s.length;l<u;l++){var h=s[l],d=h.normal;t.copy(a[h.a]).add(a[h.b]).add(a[h.c]).divideScalar(3).applyMatrix4(i),e.copy(d).applyMatrix3(n).normalize().multiplyScalar(this.size).add(t),r.setXYZ(c,t.x,t.y,t.z),c+=1,r.setXYZ(c,e.x,e.y,e.z),c+=1}r.needsUpdate=!0}}(),_l.prototype=Object.create(Pn.prototype),_l.prototype.constructor=_l,_l.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},_l.prototype.update=function(){var t=new Ye,e=new Ye,n=new Ye;return function(){t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),n.subVectors(e,t),this.lightPlane.lookAt(n),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(n),this.targetLine.scale.z=n.length()}}(),vl.prototype=Object.create(fo.prototype),vl.prototype.constructor=vl,vl.prototype.update=function(){var t,e,n=new Ye,i=new Ln;function r(r,o,a,s){n.set(o,a,s).unproject(i);var c=e[r];if(void 0!==c)for(var l=t.getAttribute("position"),u=0,h=c.length;u<h;u++)l.setXYZ(c[u],n.x,n.y,n.z)}return function(){t=this.geometry,e=this.pointMap;i.projectionMatrix.copy(this.camera.projectionMatrix),r("c",0,0,-1),r("t",0,0,1),r("n1",-1,-1,-1),r("n2",1,-1,-1),r("n3",-1,1,-1),r("n4",1,1,-1),r("f1",-1,-1,1),r("f2",1,-1,1),r("f3",-1,1,1),r("f4",1,1,1),r("u1",.7,1.1,-1),r("u2",-.7,1.1,-1),r("u3",0,2,-1),r("cf1",-1,0,1),r("cf2",1,0,1),r("cf3",0,-1,1),r("cf4",0,1,1),r("cn1",-1,0,-1),r("cn2",1,0,-1),r("cn3",0,-1,-1),r("cn4",0,1,-1),t.getAttribute("position").needsUpdate=!0}}(),bl.prototype=Object.create(fo.prototype),bl.prototype.constructor=bl,bl.prototype.update=function(){var t=new ln;return function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&t.setFromObject(this.object),!t.isEmpty()){var n=t.min,i=t.max,r=this.geometry.attributes.position,o=r.array;o[0]=i.x,o[1]=i.y,o[2]=i.z,o[3]=n.x,o[4]=i.y,o[5]=i.z,o[6]=n.x,o[7]=n.y,o[8]=i.z,o[9]=i.x,o[10]=n.y,o[11]=i.z,o[12]=i.x,o[13]=i.y,o[14]=n.z,o[15]=n.x,o[16]=i.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=i.x,o[22]=n.y,o[23]=n.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),bl.prototype.setFromObject=function(t){return this.object=t,this.update(),this},yl.prototype=Object.create(fo.prototype),yl.prototype.constructor=yl,yl.prototype.updateMatrixWorld=function(t){var e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),Pn.prototype.updateMatrixWorld.call(this,t))},xl.prototype=Object.create(ho.prototype),xl.prototype.constructor=xl,xl.prototype.updateMatrixWorld=function(t){var e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.lookAt(this.plane.normal),Pn.prototype.updateMatrixWorld.call(this,t)},wl.prototype=Object.create(Pn.prototype),wl.prototype.constructor=wl,wl.prototype.setDirection=(Hc=new Ye,function(t){t.y>.99999?this.quaternion.set(0,0,0,1):t.y<-.99999?this.quaternion.set(1,0,0,0):(Hc.set(t.z,0,-t.x).normalize(),Fc=Math.acos(t.y),this.quaternion.setFromAxisAngle(Hc,Fc))}),wl.prototype.setLength=function(t,e,n){void 0===e&&(e=.2*t),void 0===n&&(n=.2*e),this.line.scale.set(1,Math.max(0,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()},wl.prototype.setColor=function(t){this.line.material.color.copy(t),this.cone.material.color.copy(t)},Ml.prototype=Object.create(fo.prototype),Ml.prototype.constructor=Ml;var Sl=0,Al=1;function Tl(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t}function kl(t){return void 0===t&&(t=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),t.isMultiMaterial=!0,t.materials=t,t.clone=function(){return t.slice()},t}function Pl(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new go(t,e)}function Ll(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new oo(t)}function Ol(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new go(t,e)}function Cl(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new mo(t)}function Rl(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new mo(t)}function Il(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new mo(t)}function zl(t,e,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new Ye(t,e,n)}function Bl(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new Nn(t,e).setDynamic(!0)}function Nl(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new Dn(t,e)}function Dl(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new jn(t,e)}function jl(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new Un(t,e)}function Ul(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new Fn(t,e)}function Fl(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Hn(t,e)}function Hl(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new qn(t,e)}function ql(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Gn(t,e)}function Gl(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Wn(t,e)}function Wl(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Vn(t,e)}function Vl(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),as.call(this,t),this.type="catmullrom",this.closed=!0}function Xl(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),as.call(this,t),this.type="catmullrom"}function Yl(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),as.call(this,t),this.type="catmullrom"}function Kl(t){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Ml(t)}function Zl(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new bl(t,e)}function Jl(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new fo(new Ea(t.geometry),new uo({color:void 0!==e?e:16777215}))}function Ql(t,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new fo(new xo(t.geometry),new uo({color:void 0!==e?e:16777215}))}function $l(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new Va(t)}function tu(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new Ya(t)}Qa.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Qa.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(vs.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var e=new Bn,n=0,i=t.length;n<i;n++){var r=t[n];e.vertices.push(new Ye(r.x,r.y,r.z||0))}return e}}),Object.assign(bs.prototype,{fromPoints:function(t){console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),Vl.prototype=Object.create(as.prototype),Xl.prototype=Object.create(as.prototype),Yl.prototype=Object.create(as.prototype),Object.assign(Yl.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),pl.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},ul.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(Qs.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),$s.extractUrlBase(t)}}),Object.assign(al.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(ln.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),fi.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(Ge,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),Ge.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),Ge.ceilPowerOfTwo(t)}}),Object.assign(Ke.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(t){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(Ve.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){var t;return function(){return void 0===t&&(t=new Ye),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),t.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(t){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,n,i,r,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,i,n,r,o)}}),hn.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},Xe.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(di.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(pi.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(pi,{barycoordFromPoint:function(t,e,n,i,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),pi.getBarycoord(t,e,n,i,r)},normal:function(t,e,n,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),pi.getNormal(t,e,n,i)}}),Object.assign(ys.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new ha(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new xa(this,t)}}),Object.assign(We.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Ye.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(on.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Bn.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}}),Object.assign(Pn.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")}}),Object.defineProperties(Pn.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(ao.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(so.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Object.defineProperty(Qa.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),Jr.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(xs.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(Nn.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")}}),Object.assign(Zn.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addDrawCall:function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}),Object.defineProperties(Zn.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(Yc.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(li.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new _n}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=t===T}}}),Object.defineProperties(Ba.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(hi.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(to.prototype,{getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")}}),Object.defineProperties(to.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(Wr.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(an.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties($r.prototype,{standing:{set:function(){console.warn("THREE.WebVRManager: .standing has been removed.")}}}),Ac.prototype.load=function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this;return(new wc).load(t,function(t){e.setBuffer(t)}),this},kc.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Ec.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)};var eu={merge:function(t,e,n){var i;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),e.isMesh&&(e.matrixAutoUpdate&&e.updateMatrix(),i=e.matrix,e=e.geometry),t.merge(e,i,n)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}},nu={crossOrigin:void 0,loadTexture:function(t,e,n,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var r=new Ja;r.setCrossOrigin(this.crossOrigin);var o=r.load(t,n,void 0,i);return e&&(o.mapping=e),o},loadTextureCube:function(t,e,n,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var r=new Za;r.setCrossOrigin(this.crossOrigin);var o=r.load(t,n,void 0,i);return e&&(o.mapping=e),o},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")}};function iu(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(t,e){console.warn("THREE.Projector: .projectVector() is now vector.project()."),t.project(e)},this.unprojectVector=function(t,e){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),t.unproject(e)},this.pickingRay=function(){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}}function ru(){console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}}var ou={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")}};function au(){console.error("THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js")}},function(t,e,n){n(148),t.exports=n(153)},function(t,e,n){var i=n(149);"string"==typeof i&&(i=[[t.i,i,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(151)(i,r);i.locals&&(t.exports=i.locals)},function(t,e,n){(t.exports=n(150)(!1)).push([t.i,'/* Copyright 2015 Bloomberg Finance L.P.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n:root {\n --bq-content-font-color: var(--jp-content-font-color1);\n --bq-plotarea-background-fill: var(--jp-layout-color1);\n --bq-background: var(--jp-layout-color0);\n --bq-axislabel-font: 14px sans-serif;\n --bq-axis-rect-opacity: 1;\n --bq-axis-tick-stroke-width: 1;\n --bq-axis-tick-opacity: 1;\n --bq-axis-tick-text-font: 12px sans-serif;\n --bq-mark-tooltip-border-radius: 5px;\n --bq-mark-tooltip--webkit-user-select: none;\n --bq-mark-tooltip--moz-user-select: none;\n --bq-mainheading-font: 16px sans-serif;\n --bq-mainheading-font-size: large;\n --bq-world-map-path-stroke-width: 0.25px;\n --bq-pie-polyline-stroke-width: 1px;\n --bq-pie-polyline-fill: none;\n --bq-network-node-element-stroke: #000;\n --bq-network-node-element-stroke-width: 1.5px;\n --bq-network-link-fill: none;\n --bq-network-link-stroke: #666;\n --bq-network-link-stroke-width: 1.5px;\n --bq-network-node-label-pointer-events: none;\n --bq-network-node-label-font: 12px sans-serif;\n --bq-selector-fill: var(--jp-border-color1);\n --bq-mark-tooltip-border: 2px solid var(--jp-border-color0);\n --bq-mark-tooltip-box-shadow: 1px 1px 2px rgba(245, 245, 245, 0.8);\n --bq-mark-tooltip-background-color: var(--jp-layout-color0);\n --bq-mark-tooltip-td-border: 1px solid var(--jp-border-color1);\n --bq-world-map-path-stroke: black;\n --bq-world-map-path-fill: seagreen;\n --bq-pie-polyline-opacity: 0.3;\n --bq-pie-polyline-stroke: var(--bq-content-font-color);\n --bq-network-node-element-fill: #666;\n --bq-network-node-label-text-shadow: 0 1px 0 #000, 1px 0 0 #000, 0 -1px 0 #000, -1px 0 0 #000;\n --bq-linkarrow-fill: #ccc;\n}\n/* Ideally this should be in :root */\n.gg {\n --bq-axis-lines-color: var(--jp-layout-color1);\n --bq-plotarea-background-fill: var(--jp-layout-color2);\n --bq-tick-color: var(--bq-axis-lines-color);\n --bq-axis-tick-text-fill: var(--jp-content-font-color2);\n --bq-axis-rect-stroke: var(--bq-tick-color);\n --bq-axis-path-stroke: var(--bq-tick-color);\n --bq-axis-tick-stroke: var(--bq-tick-color);\n --bq-axis-tick-short-stroke: var(--bq-tick-color);\n --bq-mainheading-fill: var(--bq-content-font-color);\n --bq-axislabel-fill: var(--bq-content-font-color);\n --bq-stick-stroke: var(--bq-content-font-color);\n --bq-stick-fill: var(--bq-content-font-color);\n --bq-sticktext-fill: var(--bq-content-font-color);\n --bq-default-stroke: var(--bq-content-font-color);\n}\n.classic {\n --bq-axis-lines-color: var(--jp-ui-font-color3);\n --bq-tick-color: var(--bq-axis-lines-color);\n --bq-axis-tick-text-fill: var(--jp-ui-font-color2);\n --bq-axis-rect-stroke: var(--bq-tick-color);\n --bq-axis-path-stroke: var(--bq-tick-color);\n --bq-axis-tick-stroke: var(--bq-tick-color);\n --bq-axis-tick-short-stroke: var(--bq-tick-color);\n --bq-mainheading-fill: var(--bq-content-font-color);\n --bq-axislabel-fill: var(--bq-content-font-color);\n --bq-stick-stroke: var(--bq-content-font-color);\n --bq-stick-fill: var(--bq-content-font-color);\n --bq-sticktext-fill: var(--bq-content-font-color);\n --bq-default-stroke: var(--bq-content-font-color);\n}\n.bbg,\n[data-theme-light="false"] {\n --bq-content-font-color: orange;\n --bq-axis-rect-stroke: var(--bq-tick-color);\n --bq-axis-path-stroke: var(--bq-tick-color);\n --bq-axis-tick-stroke: var(--bq-tick-color);\n --bq-axis-tick-short-stroke: var(--bq-tick-color);\n --bq-mainheading-fill: var(--bq-content-font-color);\n --bq-axislabel-fill: var(--bq-content-font-color);\n --bq-stick-stroke: var(--bq-content-font-color);\n --bq-stick-fill: var(--bq-content-font-color);\n --bq-sticktext-fill: var(--bq-content-font-color);\n --bq-default-stroke: var(--bq-content-font-color);\n}\n.bqplot {\n box-sizing: border-box;\n display: flex;\n width: auto;\n height: 480px;\n}\n.bqplot > .svg-background {\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 0;\n}\n.bqplot > canvas {\n position: absolute;\n pointer-events: none;\n z-index: 0;\n}\n.bqplot > svg {\n z-index: 0;\n font: 11px sans-serif;\n user-select: none;\n -ms-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n flex-grow: 1;\n}\n.bqplot > svg .svg-figure {\n background: var(--bq-background);\n}\n.bqplot > svg .axis rect {\n stroke: var(--bq-axis-rect-stroke);\n opacity: var(--bq-axis-rect-opacity);\n}\n.bqplot > svg .axis .tick line {\n stroke: var(--bq-axis-tick-stroke);\n stroke-width: var(--bq-axis-tick-stroke-width);\n opacity: var(--bq-axis-tick-opacity);\n}\n.bqplot > svg .axis .tick.short line {\n stroke: var(--bq-axis-tick-short-stroke);\n}\n.bqplot > svg .axis .tick text {\n fill: var(--bq-axis-tick-text-fill);\n font: var(--bq-axis-tick-text-font);\n}\n.bqplot > svg .axis line {\n shape-rendering: crispEdges;\n font: 10px sans-serif;\n stroke-width: 1px;\n}\n.bqplot > svg .axis path,\n.bqplot > svg .axis line {\n fill: none;\n}\n.bqplot > svg .axis path {\n stroke: var(--bq-axis-path-stroke);\n}\n.bqplot > svg .axis text.axislabel,\n.bqplot > svg .axis tspan.axislabel {\n text-anchor: end;\n fill: var(--bq-axislabel-fill);\n font: var(--bq-axislabel-font);\n}\n.bqplot > svg .axis .tick text {\n cursor: default;\n}\n.bqplot > svg .axis.axisbold path {\n stroke-width: 3px;\n}\n.bqplot > svg .axis.axisbold text,\n.bqplot > svg .axis.axisbold text.axislabel {\n font-weight: bolder;\n}\n.bqplot > svg .stick,\n.bqplot > svg .zeroLine {\n stroke: var(--bq-stick-stroke);\n fill: var(--bq-stick-fill);\n}\n.bqplot > svg .sticktext {\n fill: var(--bq-sticktext-fill);\n}\n.bqplot > svg .bargroup rect,\n.bqplot > svg .boxplot rect,\n.bqplot > svg .slice rect,\n.bqplot > svg .bargroup path,\n.bqplot > svg .boxplot path,\n.bqplot > svg .slice path,\n.bqplot > svg .bargroup line,\n.bqplot > svg .boxplot line,\n.bqplot > svg .slice line {\n stroke: var(--bq-default-stroke);\n}\n.bqplot > svg .zeroLine {\n shape-rendering: crispEdges;\n}\n.bqplot > svg text.mainheading {\n text-anchor: middle;\n fill: var(--bq-mainheading-fill);\n font: var(--bq-mainheading-font);\n font-size: var(--bq-mainheading-font-size);\n}\n.bqplot > svg text.legendtext {\n text-anchor: start;\n font: 14px sans-serif;\n}\n.bqplot > svg text.dot_text {\n fill: var(--bq-content-font-color);\n}\n.bqplot > svg .indsel {\n stroke: red;\n}\n.bqplot > svg .brushintsel .selection {\n fill: var(--bq-selector-fill);\n stroke: none;\n}\n.bqplot > svg .intsel {\n fill: var(--bq-selector-fill);\n stroke: none;\n fill-opacity: 0.3;\n}\n.bqplot > svg .intselmouse {\n visibility: hidden;\n pointer-events: all;\n /*none?*/\n}\n.bqplot > svg .multiselector .active {\n pointer-events: all;\n}\n.bqplot > svg .multiselector .active .selection {\n stroke: green;\n}\n.bqplot > svg .multiselector .active .overlay {\n pointer-events: all;\n}\n.bqplot > svg .multiselector .inactive {\n pointer-events: none;\n}\n.bqplot > svg .multiselector .inactive .selection {\n stroke: red;\n}\n.bqplot > svg .multiselector .inactive .overlay {\n pointer-events: none;\n}\n.bqplot > svg .multiselector .visible {\n pointer-events: all;\n}\n.bqplot > svg .multiselector .visible .selection {\n stroke: red;\n}\n.bqplot > svg .multiselector .visible .overlay {\n pointer-events: none;\n}\n.bqplot > svg .lassoselector .selected {\n opacity: 0.3;\n}\n.bqplot > svg .lassoselector path {\n fill: none;\n stroke: orange;\n stroke-width: 4;\n}\n.bqplot > svg .plotarea_background {\n fill: var(--bq-plotarea-background-fill);\n}\n.bqplot > svg .plotarea_events {\n opacity: 0;\n}\n.tooltip_div {\n z-index: 1001;\n}\n.mark_tooltip {\n pointer-events: none;\n z-index: 1001;\n border: var(--bq-mark-tooltip-border);\n border-radius: var(--bq-mark-tooltip-border-radius);\n box-shadow: var(--bq-mark-tooltip-box-shadow);\n -webkit-user-select: var(--bq-mark-tooltip--webkit-user-select);\n -moz-user-select: var(--bq-mark-tooltip--moz-user-select);\n background-color: var(--bq-mark-tooltip-background-color);\n}\n.mark_tooltip > .bqplot.figure {\n width: 427px;\n height: 320px;\n}\n.mark_tooltip td {\n border: var(--bq-mark-tooltip-td-border);\n}\n.mark_tooltip table {\n border-radius: 5px;\n background: var(--bq-mark-tooltip-background);\n}\n.mark_tooltip .tooltiptext {\n text-align: center;\n padding: 0.5em;\n}\n.world_map path {\n stroke: var(--bq-world-map-path-stroke);\n stroke-width: var(--bq-world-map-path-stroke-width);\n fill: var(--bq-world-map-path-fill);\n}\n.world_map .hovered {\n fill: Orange;\n stroke: Orange;\n stroke-width: 2.5px;\n}\n.world_map #container {\n margin: 10px 10%;\n border: 2px solid #000;\n border-radius: 5px;\n height: 100%;\n overflow: hidden;\n background: #F0F8FF;\n}\n.world_map .graticule {\n fill: none;\n stroke: #bbb;\n stroke-width: 0.5px;\n stroke-opacity: 0.5;\n}\n.g_legend {\n fill: none;\n}\n.pie polyline {\n opacity: var(--bq-pie-polyline-opacity);\n stroke: var(--bq-pie-polyline-stroke);\n stroke-width: var(--bq-pie-polyline-stroke-width);\n fill: var(--bq-pie-polyline-fill);\n}\n.network .node .element {\n fill: var(--bq-network-node-element-fill);\n stroke: var(--bq-network-node-element-stroke);\n stroke-width: var(--bq-network-node-element-stroke-width);\n}\n.network .link {\n fill: var(--bq-network-link-fill);\n stroke: var(--bq-network-link-stroke);\n stroke-width: var(--bq-network-link-stroke-width);\n}\n.network .node .label {\n font: var(--bq-network-node-label-font);\n pointer-events: var(--bq-network-node-label-pointer-events);\n text-shadow: var(--bq-network-node-label-text-shadow);\n}\n.linkarrow {\n fill: var(--bq-linkarrow-fill);\n}\n',""])},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=function(t,e){var n=t[1]||"",i=t[3];if(!i)return n;if(e&&"function"==typeof btoa){var r=(a=i,s=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(c," */")),o=i.sources.map(function(t){return"/*# sourceURL=".concat(i.sourceRoot).concat(t," */")});return[n].concat(o).concat([r]).join("\n")}var a,s,c;return[n].join("\n")}(e,t);return e[2]?"@media ".concat(e[2],"{").concat(n,"}"):n}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var i={},r=0;r<this.length;r++){var o=this[r][0];null!=o&&(i[o]=!0)}for(var a=0;a<t.length;a++){var s=t[a];null!=s[0]&&i[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="(".concat(s[2],") and (").concat(n,")")),e.push(s))}},e}},function(t,e,n){var i,r,o={},a=(i=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===r&&(r=i.apply(this,arguments)),r}),s=function(t){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var i=function(t,e){return e?e.querySelector(t):document.querySelector(t)}.call(this,t,n);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}e[t]=i}return e[t]}}(),c=null,l=0,u=[],h=n(152);function d(t,e){for(var n=0;n<t.length;n++){var i=t[n],r=o[i.id];if(r){r.refs++;for(var a=0;a<r.parts.length;a++)r.parts[a](i.parts[a]);for(;a<i.parts.length;a++)r.parts.push(v(i.parts[a],e))}else{var s=[];for(a=0;a<i.parts.length;a++)s.push(v(i.parts[a],e));o[i.id]={id:i.id,refs:1,parts:s}}}}function f(t,e){for(var n=[],i={},r=0;r<t.length;r++){var o=t[r],a=e.base?o[0]+e.base:o[0],s={css:o[1],media:o[2],sourceMap:o[3]};i[a]?i[a].parts.push(s):n.push(i[a]={id:a,parts:[s]})}return n}function p(t,e){var n=s(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var i=u[u.length-1];if("top"===t.insertAt)i?i.nextSibling?n.insertBefore(e,i.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),u.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=s(t.insertAt.before,n);n.insertBefore(e,r)}}function m(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=u.indexOf(t);e>=0&&u.splice(e,1)}function g(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var i=function(){0;return n.nc}();i&&(t.attrs.nonce=i)}return _(e,t.attrs),p(t,e),e}function _(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function v(t,e){var n,i,r,o;if(e.transform&&t.css){if(!(o="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=o}if(e.singleton){var a=l++;n=c||(c=g(e)),i=x.bind(null,n,a,!1),r=x.bind(null,n,a,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",_(e,t.attrs),p(t,e),e}(e),i=function(t,e,n){var i=n.css,r=n.sourceMap,o=void 0===e.convertToAbsoluteUrls&&r;(e.convertToAbsoluteUrls||o)&&(i=h(i));r&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([i],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}.bind(null,n,e),r=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(e),i=function(t,e){var n=e.css,i=e.media;i&&t.setAttribute("media",i);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),r=function(){m(n)});return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else r()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=a()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=f(t,e);return d(n,e),function(t){for(var i=[],r=0;r<n.length;r++){var a=n[r];(s=o[a.id]).refs--,i.push(s)}t&&d(f(t,e),e);for(r=0;r<i.length;r++){var s;if(0===(s=i[r]).refs){for(var c=0;c<s.parts.length;c++)s.parts[c]();delete o[s.id]}}}};var b,y=(b=[],function(t,e){return b[t]=e,b.filter(Boolean).join("\n")});function x(t,e,n,i){var r=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=y(e,r);else{var o=document.createTextNode(r),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,i=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var r,o=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(o)?t:(r=0===o.indexOf("//")?o:0===o.indexOf("/")?n+o:i+o.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")})}},function(t,e,n){"use strict";function i(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),i(n(88)),i(n(154)),i(n(19)),i(n(275)),i(n(276)),i(n(18)),i(n(277)),i(n(278)),i(n(279)),i(n(280)),i(n(281)),i(n(282)),i(n(283)),i(n(284)),i(n(285)),i(n(286)),i(n(287)),i(n(288)),i(n(61)),i(n(289)),i(n(290)),i(n(291)),i(n(138)),i(n(292)),i(n(293)),i(n(294)),i(n(295)),i(n(296)),i(n(139)),i(n(297)),i(n(135)),i(n(140)),i(n(298)),i(n(84)),i(n(141)),i(n(299)),i(n(300)),i(n(86)),i(n(50)),i(n(301)),i(n(63)),i(n(62)),i(n(302)),i(n(142)),i(n(303)),i(n(304)),i(n(305)),i(n(306)),i(n(307)),i(n(308)),i(n(49)),i(n(143)),i(n(310)),i(n(311)),i(n(312)),i(n(313)),i(n(314)),i(n(315)),i(n(316)),i(n(318)),i(n(64)),i(n(17)),i(n(319)),i(n(320)),i(n(321)),i(n(322)),i(n(323)),i(n(324)),i(n(325)),i(n(326)),i(n(327)),i(n(328)),i(n(329)),i(n(330)),i(n(333)),e.version=n(91).version},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(6)),o=n(18),a=i(n(12));class s extends o.MarkModel{defaults(){return Object.assign({},o.MarkModel.prototype.defaults(),{_model_name:"GridHeatMapModel",_view_name:"GridHeatMap",row:null,column:null,color:null,scales_metadata:{row:{orientation:"vertical",dimension:"y"},column:{orientation:"horizontal",dimension:"x"},color:{dimension:"color"}},row_align:"start",column_align:"start",null_color:"black",stroke:"black",opacity:1,anchor_style:{},display_format:null,font_style:{}})}initialize(t,e){super.initialize(t,e),this.on_some_change(["row","column","color"],this.update_data,this),this.on_some_change(["preserve_domain"],this.update_domains,this),this.update_data(),this.update_domains()}update_data(){this.dirty=!0,this.colors=this.get("color");const t=this.colors.length,e=this.colors[0].length;this.rows=this.get("row")||r.range(t),this.columns=this.get("column")||r.range(e);const n=[].concat.apply([],this.colors.map(t=>Array.prototype.slice.call(t,0)));this.mark_data=n.map((t,n)=>{const i=Math.floor(n/e),r=n%e;return{row_num:i,row:this.rows[i],column:this.columns[r],column_num:r,color:t,_cell_num:n}}),this.identify_modes(),this.update_domains(),this.dirty=!1,this.trigger("data_updated")}update_domains(){if(!this.mark_data)return;const t=this.get("scales"),e=t.row,n=t.column,i=t.color;this.get("preserve_domain").row?e.del_domain([],this.model_id+"_row"):e.compute_and_set_domain(this.rows,this.model_id+"_row"),this.get("preserve_domain").column?n.del_domain([],this.model_id+"_column"):n.compute_and_set_domain(this.columns,this.model_id+"_column"),null!=i&&(this.get("preserve_domain").color?i.del_domain([],this.model_id+"_color"):i.compute_and_set_domain(this.mark_data.map(function(t){return t.color}),this.model_id+"_color"))}get_data_dict(t,e){return t}identify_modes(){const t={},e=this.get("scales"),n=e.row,i=e.column,r=this.colors.length,o=this.colors[0].length;"ordinal"===n.type?t.row="middle":r===this.rows.length-1?t.row="boundaries":r===this.rows.length?t.row="expand_one":r===this.rows.length+1&&(t.row="expand_two"),"ordinal"===i.type?t.column="middle":o===this.columns.length-1?t.column="boundaries":o===this.columns.length?t.column="expand_one":o===this.columns.length+1&&(t.column="expand_two"),this.modes=t}}s.serializers=Object.assign({},o.MarkModel.serializers,{row:a.array_or_json,column:a.array_or_json,color:a.array_or_json}),e.GridHeatMapModel=s},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var i,r,o,a,s,c=1,l={},u=!1,h=t.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(t);d=d&&d.setTimeout?d:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick(function(){p(t)})}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},i=function(t){o.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(r=h.documentElement,i=function(t){var e=h.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,r.removeChild(e),e=null},r.appendChild(e)}):i=function(t){setTimeout(p,0,t)}:(a="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&p(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),i=function(e){t.postMessage(a+e,"*")}),d.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var r={callback:t,args:e};return l[c]=r,i(c),c++},d.clearImmediate=f}function f(t){delete l[t]}function p(t){if(u)setTimeout(p,0,t);else{var e=l[t];if(e){u=!0;try{!function(t){var e=t.callback,i=t.args;switch(i.length){case 0:e();break;case 1:e(i[0]);break;case 2:e(i[0],i[1]);break;case 3:e(i[0],i[1],i[2]);break;default:e.apply(n,i)}}(e)}finally{f(t),u=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,n(25),n(33))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,o=t.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))<n?i+1+(o-n):i-n+1;for(var a=0;a<r;++a){var s=(n+a)%o;if(t[s]===e)return s}return-1}function n(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var r,o=t.length;if(0===o)return-1;r=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(i=i<0?Math.max(0,i+o):Math.min(i,o-1))?n+1+(o-i):n-i+1;for(var a=0;a<r;++a){var s=(n-a+o)%o;if(t[s]===e)return s}return-1}function i(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,o=t.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))<n?i+1+(o-n):i-n+1;for(var a=0;a<r;++a){var s=(n+a)%o;if(e(t[s],s))return s}return-1}function r(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var r,o=t.length;if(0===o)return-1;r=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(i=i<0?Math.max(0,i+o):Math.min(i,o-1))?n+1+(o-i):n-i+1;for(var a=0;a<r;++a){var s=(n-a+o)%o;if(e(t[s],s))return s}return-1}function o(t,e,n){void 0===e&&(e=0),void 0===n&&(n=-1);var i=t.length;if(!(i<=1))for(e=e<0?Math.max(0,e+i):Math.min(e,i-1),n=n<0?Math.max(0,n+i):Math.min(n,i-1);e<n;){var r=t[e],o=t[n];t[e++]=o,t[n--]=r}}function a(t,e){var n=t.length;if(e<0&&(e+=n),!(e<0||e>=n)){for(var i=t[e],r=e+1;r<n;++r)t[r-1]=t[r];return t.length=n-1,i}}t.firstIndexOf=e,t.lastIndexOf=n,t.findFirstIndex=i,t.findLastIndex=r,t.findFirstValue=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=-1);var o=i(t,e,n,r);return-1!==o?t[o]:void 0},t.findLastValue=function(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var o=r(t,e,n,i);return-1!==o?t[o]:void 0},t.lowerBound=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=t.length;if(0===o)return 0;for(var a=i=i<0?Math.max(0,i+o):Math.min(i,o-1),s=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))-i+1;s>0;){var c=s>>1,l=a+c;n(t[l],e)<0?(a=l+1,s-=c+1):s=c}return a},t.upperBound=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=t.length;if(0===o)return 0;for(var a=i=i<0?Math.max(0,i+o):Math.min(i,o-1),s=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))-i+1;s>0;){var c=s>>1,l=a+c;n(t[l],e)>0?s=c:(a=l+1,s-=c+1)}return a},t.move=function(t,e,n){var i=t.length;if(!(i<=1)&&(e=e<0?Math.max(0,e+i):Math.min(e,i-1))!==(n=n<0?Math.max(0,n+i):Math.min(n,i-1))){for(var r=t[e],o=e<n?1:-1,a=e;a!==n;a+=o)t[a]=t[a+o];t[n]=r}},t.reverse=o,t.rotate=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(!(r<=1||(n=n<0?Math.max(0,n+r):Math.min(n,r-1))>=(i=i<0?Math.max(0,i+r):Math.min(i,r-1)))){var a=i-n+1;if(e>0?e%=a:e<0&&(e=(e%a+a)%a),0!==e){var s=n+e;o(t,n,s-1),o(t,s,i),o(t,n,i)}}},t.fill=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0!==r){var o;n=n<0?Math.max(0,n+r):Math.min(n,r-1),o=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))<n?i+1+(r-n):i-n+1;for(var a=0;a<o;++a)t[(n+a)%r]=e}},t.insert=function(t,e,n){var i=t.length;e=e<0?Math.max(0,e+i):Math.min(e,i);for(var r=i;r>e;--r)t[r]=t[r-1];t[e]=n},t.removeAt=a,t.removeFirstOf=function(t,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=e(t,n,i,r);return-1!==o&&a(t,o),o},t.removeLastOf=function(t,e,i,r){void 0===i&&(i=-1),void 0===r&&(r=0);var o=n(t,e,i,r);return-1!==o&&a(t,o),o},t.removeAllOf=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var o=0,a=0;a<r;++a)n<=i&&a>=n&&a<=i&&t[a]===e?o++:i<n&&(a<=i||a>=n)&&t[a]===e?o++:o>0&&(t[a-o]=t[a]);return o>0&&(t.length=r-o),o},t.removeFirstWhere=function(t,e,n,r){var o;void 0===n&&(n=0),void 0===r&&(r=-1);var s=i(t,e,n,r);return-1!==s&&(o=a(t,s)),{index:s,value:o}},t.removeLastWhere=function(t,e,n,i){var o;void 0===n&&(n=-1),void 0===i&&(i=0);var s=r(t,e,n,i);return-1!==s&&(o=a(t,s)),{index:s,value:o}},t.removeAllWhere=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var o=0,a=0;a<r;++a)n<=i&&a>=n&&a<=i&&e(t[a],a)?o++:i<n&&(a<=i||a>=n)&&e(t[a],a)?o++:o>0&&(t[a-o]=t[a]);return o>0&&(t.length=r-o),o}}(e.ArrayExt||(e.ArrayExt={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(29);e.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new r(i.iter(t.map(i.iter)))};var r=function(){function t(t){this._cloned=!1,this._source=t,this._active=void 0}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone());return e._active=this._active&&this._active.clone(),e._cloned=!0,this._cloned=!0,e},t.prototype.next=function(){if(void 0===this._active){var t=this._source.next();if(void 0===t)return;this._active=this._cloned?t.clone():t}var e=this._active.next();return void 0!==e?e:(this._active=void 0,this.next())},t}();e.ChainIterator=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.empty=function(){return new i};var i=function(){function t(){}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t},t.prototype.next=function(){},t}();e.EmptyIterator=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(29);e.filter=function(t,e){return new r(i.iter(t),e)};var r=function(){function t(t,e){this._index=0,this._source=t,this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){for(var t,e=this._fn,n=this._source;void 0!==(t=n.next());)if(e(t,this._index++))return t},t}();e.FilterIterator=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(29);e.find=function(t,e){for(var n,r=0,o=i.iter(t);void 0!==(n=o.next());)if(e(n,r++))return n},e.min=function(t,e){var n=i.iter(t),r=n.next();if(void 0!==r){for(var o=r;void 0!==(r=n.next());)e(r,o)<0&&(o=r);return o}},e.max=function(t,e){var n=i.iter(t),r=n.next();if(void 0!==r){for(var o=r;void 0!==(r=n.next());)e(r,o)>0&&(o=r);return o}},e.minmax=function(t,e){var n=i.iter(t),r=n.next();if(void 0!==r){for(var o=r,a=r;void 0!==(r=n.next());)e(r,o)<0?o=r:e(r,a)>0&&(a=r);return[o,a]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(29);e.map=function(t,e){return new r(i.iter(t),e)};var r=function(){function t(t,e){this._index=0,this._source=t,this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return this._fn.call(void 0,t,this._index++)},t}();e.MapIterator=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.range=function(t,e,n){return void 0===e?new r(0,t,1):new r(t,e,void 0===n?1:n)};var i,r=function(){function t(t,e,n){this._index=0,this._start=t,this._stop=e,this._step=n,this._length=i.rangeLength(t,e,n)}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._start,this._stop,this._step);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++},t}();e.RangeIterator=r,function(t){t.rangeLength=function(t,e,n){return 0===n?1/0:t>e&&n>0?0:t<e&&n<0?0:Math.ceil((e-t)/n)}}(i||(i={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(29);e.reduce=function(t,e,n){var r=0,o=i.iter(t),a=o.next();if(void 0===a&&void 0===n)throw new TypeError("Reduce of empty iterable with no initial value.");if(void 0===a)return n;var s,c,l=o.next();if(void 0===l&&void 0===n)return a;if(void 0===l)return e(n,a,r++);for(s=e(void 0===n?a:e(n,a,r++),l,r++);void 0!==(c=o.next());)s=e(s,c,r++);return s}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.repeat=function(t,e){return new i(t,e)},e.once=function(t){return new i(t,1)};var i=function(){function t(t,e){this._value=t,this._count=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._value,this._count)},t.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},t}();e.RepeatIterator=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.retro=function(t){return"function"==typeof t.retro?t.retro():new i(t)};var i=function(){function t(t){this._source=t,this._index=t.length-1}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},t}();e.RetroArrayIterator=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(29);e.topologicSort=function(t){var e=[],n=new Set,r=new Map;return i.each(t,function(t){var e=t[0],n=t[1],i=r.get(n);i?i.push(e):r.set(n,[e])}),r.forEach(function(t,e){o(e)}),e;function o(t){if(!n.has(t)){n.add(t);var i=r.get(t);i&&i.forEach(o),e.push(t)}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(29);e.stride=function(t,e){return new r(i.iter(t),e)};var r=function(){function t(t,e){this._source=t,this._step=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._step)},t.prototype.next=function(){for(var t=this._source.next(),e=this._step-1;e>0;--e)this._source.next();return t},t}();e.StrideIterator=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t,e,n){void 0===n&&(n=0);for(var i=new Array(e.length),r=0,o=n,a=e.length;r<a;++r,++o){if(-1===(o=t.indexOf(e[r],o)))return null;i[r]=o}return i}t.findIndices=e,t.matchSumOfSquares=function(t,n,i){void 0===i&&(i=0);var r=e(t,n,i);if(!r)return null;for(var o=0,a=0,s=r.length;a<s;++a){var c=r[a]-i;o+=c*c}return{score:o,indices:r}},t.matchSumOfDeltas=function(t,n,i){void 0===i&&(i=0);var r=e(t,n,i);if(!r)return null;for(var o=0,a=i-1,s=0,c=r.length;s<c;++s){var l=r[s];o+=l-a-1,a=l}return{score:o,indices:r}},t.highlight=function(t,e,n){for(var i=[],r=0,o=0,a=e.length;r<a;){for(var s=e[r],c=e[r];++r<a&&e[r]===c+1;)c++;o<s&&i.push(t.slice(o,s)),s<c+1&&i.push(n(t.slice(s,c+1))),o=c+1}return o<t.length&&i.push(t.slice(o)),i}}(e.StringExt||(e.StringExt={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(29);e.take=function(t,e){return new r(i.iter(t),e)};var r=function(){function t(t,e){this._source=t,this._count=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._count)},t.prototype.next=function(){if(!(this._count<=0)){var t=this._source.next();if(void 0!==t)return this._count--,t}},t}();e.TakeIterator=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(29);e.zip=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new r(t.map(i.iter))};var r=function(){function t(t){this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.map(function(t){return t.clone()}))},t.prototype.next=function(){for(var t=new Array(this._source.length),e=0,n=this._source.length;e<n;++e){var i=this._source[e].next();if(void 0===i)return;t[e]=i}return t},t}();e.ZipIterator=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n(172))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(9),o=function(){function t(){this._first=null,this._last=null,this._length=0}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return 0===this._length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"first",{get:function(){return this._first?this._first.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"last",{get:function(){return this._last?this._last.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstNode",{get:function(){return this._first},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lastNode",{get:function(){return this._last},enumerable:!0,configurable:!0}),t.prototype.iter=function(){return new t.ForwardValueIterator(this._first)},t.prototype.retro=function(){return new t.RetroValueIterator(this._last)},t.prototype.nodes=function(){return new t.ForwardNodeIterator(this._first)},t.prototype.retroNodes=function(){return new t.RetroNodeIterator(this._last)},t.prototype.addFirst=function(t){var e=new i.LinkedListNode(this,t);return this._first?(e.next=this._first,this._first.prev=e,this._first=e):(this._first=e,this._last=e),this._length++,e},t.prototype.addLast=function(t){var e=new i.LinkedListNode(this,t);return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._first=e,this._last=e),this._length++,e},t.prototype.insertBefore=function(t,e){if(!e||e===this._first)return this.addFirst(t);if(!(e instanceof i.LinkedListNode)||e.list!==this)throw new Error("Reference node is not owned by the list.");var n=new i.LinkedListNode(this,t),r=e,o=r.prev;return n.next=r,n.prev=o,r.prev=n,o.next=n,this._length++,n},t.prototype.insertAfter=function(t,e){if(!e||e===this._last)return this.addLast(t);if(!(e instanceof i.LinkedListNode)||e.list!==this)throw new Error("Reference node is not owned by the list.");var n=new i.LinkedListNode(this,t),r=e,o=r.next;return n.next=o,n.prev=r,r.next=n,o.prev=n,this._length++,n},t.prototype.removeFirst=function(){var t=this._first;if(t)return t===this._last?(this._first=null,this._last=null):(this._first=t.next,this._first.prev=null),t.list=null,t.next=null,t.prev=null,this._length--,t.value},t.prototype.removeLast=function(){var t=this._last;if(t)return t===this._first?(this._first=null,this._last=null):(this._last=t.prev,this._last.next=null),t.list=null,t.next=null,t.prev=null,this._length--,t.value},t.prototype.removeNode=function(t){if(!(t instanceof i.LinkedListNode)||t.list!==this)throw new Error("Node is not owned by the list.");var e=t;e===this._first&&e===this._last?(this._first=null,this._last=null):e===this._first?(this._first=e.next,this._first.prev=null):e===this._last?(this._last=e.prev,this._last.next=null):(e.next.prev=e.prev,e.prev.next=e.next),e.list=null,e.next=null,e.prev=null,this._length--},t.prototype.clear=function(){for(var t=this._first;t;){var e=t.next;t.list=null,t.prev=null,t.next=null,t=e}this._first=null,this._last=null,this._length=0},t}();e.LinkedList=o,function(t){t.from=function(e){var n=new t;return r.each(e,function(t){n.addLast(t)}),n};var e=function(){function t(t){this._node=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node)},t.prototype.next=function(){if(this._node){var t=this._node;return this._node=t.next,t.value}},t}();t.ForwardValueIterator=e;var n=function(){function t(t){this._node=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node)},t.prototype.next=function(){if(this._node){var t=this._node;return this._node=t.prev,t.value}},t}();t.RetroValueIterator=n;var i=function(){function t(t){this._node=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node)},t.prototype.next=function(){if(this._node){var t=this._node;return this._node=t.next,t}},t}();t.ForwardNodeIterator=i;var o=function(){function t(t){this._node=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node)},t.prototype.next=function(){if(this._node){var t=this._node;return this._node=t.prev,t}},t}();t.RetroNodeIterator=o}(o=e.LinkedList||(e.LinkedList={})),e.LinkedList=o,function(t){var e=function(t,e){this.list=null,this.next=null,this.prev=null,this.list=t,this.value=e};t.LinkedListNode=e}(i||(i={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.boxSizing=function(t){var e=window.getComputedStyle(t),n=parseFloat(e.borderTopWidth)||0,i=parseFloat(e.borderLeftWidth)||0,r=parseFloat(e.borderRightWidth)||0,o=parseFloat(e.borderBottomWidth)||0,a=parseFloat(e.paddingTop)||0,s=parseFloat(e.paddingLeft)||0,c=parseFloat(e.paddingRight)||0,l=parseFloat(e.paddingBottom)||0;return{borderTop:n,borderLeft:i,borderRight:r,borderBottom:o,paddingTop:a,paddingLeft:s,paddingRight:c,paddingBottom:l,horizontalSum:i+s+c+r,verticalSum:n+a+l+o}},t.sizeLimits=function(t){var e=window.getComputedStyle(t),n=parseFloat(e.minWidth)||0,i=parseFloat(e.minHeight)||0,r=parseFloat(e.maxWidth)||1/0,o=parseFloat(e.maxHeight)||1/0;return{minWidth:n,minHeight:i,maxWidth:r=Math.max(n,r),maxHeight:o=Math.max(i,o)}},t.hitTest=function(t,e,n){var i=t.getBoundingClientRect();return e>=i.left&&e<i.right&&n>=i.top&&n<i.bottom},t.scrollIntoViewIfNeeded=function(t,e){var n=t.getBoundingClientRect(),i=e.getBoundingClientRect();i.top<=n.top&&i.bottom>=n.bottom||(i.top<n.top&&i.height<=n.height?t.scrollTop-=n.top-i.top:i.bottom>n.bottom&&i.height>=n.height?t.scrollTop-=n.top-i.top:i.top<n.top&&i.height>n.height?t.scrollTop-=n.bottom-i.bottom:i.bottom>n.bottom&&i.height<n.height&&(t.scrollTop-=n.bottom-i.bottom))}}(e.ElementExt||(e.ElementExt={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.IS_MAC=!!navigator.platform.match(/Mac/i),t.IS_WIN=!!navigator.platform.match(/Win/i),t.IS_IE=/Trident/.test(navigator.userAgent),t.IS_EDGE=/Edge/.test(navigator.userAgent)}(e.Platform||(e.Platform={}))},function(t,e,n){"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.calculateSpecificity=function(t){if(t in i.specificityCache)return i.specificityCache[t];var e=i.calculateSingle(t);return i.specificityCache[t]=e},t.isValid=function(t){if(t in i.validityCache)return i.validityCache[t];var e=!0;try{i.testElem.querySelector(t)}catch(t){e=!1}return i.validityCache[t]=e},t.matches=function(t,e){return i.protoMatchFunc.call(t,e)}}(e.Selector||(e.Selector={})),function(t){var e;t.specificityCache=Object.create(null),t.validityCache=Object.create(null),t.testElem=document.createElement("div"),t.protoMatchFunc=(e=Element.prototype).matches||e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector||function(t){var e=this.ownerDocument.querySelectorAll(t);return-1!==Array.prototype.indexOf.call(e,this)},t.calculateSingle=function(t){var e=0,u=0,h=0;function d(e){var n=t.match(e);return null!==n&&(t=t.slice(n[0].length),!0)}for(t=(t=t.split(",",1)[0]).replace(l," $1 ");t.length>0;)if(d(n))e++;else if(d(i))u++;else if(d(r))u++;else if(d(a))h++;else if(d(s))u++;else if(d(o))h++;else if(!d(c))return 0;return(e=Math.min(e,255))<<16|(u=Math.min(u,255))<<8|(h=Math.min(h,255))};var n=/^#[^\s\+>~#\.\[:]+/,i=/^\.[^\s\+>~#\.\[:]+/,r=/^\[[^\]]+\]/,o=/^[^\s\+>~#\.\[:]+/,a=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,s=/^:[^\s\+>~#\.\[:]+/,c=/^[\s\+>~\*]+/,l=/:not\(([^\)]+)\)/g}(i||(i={}))},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o,a=n(66),s=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,{layout:o.createLayout(e)})||this;return n.addClass("p-BoxPanel"),n}return r(e,t),Object.defineProperty(e.prototype,"direction",{get:function(){return this.layout.direction},set:function(t){this.layout.direction=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(t){this.layout.alignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(t){this.layout.spacing=t},enumerable:!0,configurable:!0}),e.prototype.onChildAdded=function(t){t.child.addClass("p-BoxPanel-child")},e.prototype.onChildRemoved=function(t){t.child.removeClass("p-BoxPanel-child")},e}(n(52).Panel);e.BoxPanel=s,function(t){t.getStretch=function(t){return a.BoxLayout.getStretch(t)},t.setStretch=function(t,e){a.BoxLayout.setStretch(t,e)},t.getSizeBasis=function(t){return a.BoxLayout.getSizeBasis(t)},t.setSizeBasis=function(t,e){a.BoxLayout.setSizeBasis(t,e)}}(s=e.BoxPanel||(e.BoxPanel={})),e.BoxPanel=s,function(t){t.createLayout=function(t){return t.layout||new a.BoxLayout(t)}}(o||(o={}))},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var a,s=n(9),c=n(53),l=n(129),u=n(16),h=n(59),d=n(13),f=function(t){function e(n){var i=t.call(this,{node:a.createNode()})||this;return i._activeIndex=-1,i._items=[],i._results=null,i.addClass("p-CommandPalette"),i.setFlag(d.Widget.Flag.DisallowLayout),i.commands=n.commands,i.renderer=n.renderer||e.defaultRenderer,i.commands.commandChanged.connect(i._onGenericChange,i),i.commands.keyBindingChanged.connect(i._onGenericChange,i),i}return r(e,t),e.prototype.dispose=function(){this._items.length=0,this._results=null,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"searchNode",{get:function(){return this.node.getElementsByClassName("p-CommandPalette-search")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputNode",{get:function(){return this.node.getElementsByClassName("p-CommandPalette-input")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("p-CommandPalette-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),e.prototype.addItem=function(t){var e=a.createItem(this.commands,t);return this._items.push(e),this.refresh(),e},e.prototype.removeItem=function(t){this.removeItemAt(this._items.indexOf(t))},e.prototype.removeItemAt=function(t){s.ArrayExt.removeAt(this._items,t)&&this.refresh()},e.prototype.clearItems=function(){0!==this._items.length&&(this._items.length=0,this.refresh())},e.prototype.refresh=function(){this._results=null,this.update()},e.prototype.handleEvent=function(t){switch(t.type){case"click":this._evtClick(t);break;case"keydown":this._evtKeyDown(t);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)},e.prototype.onActivateRequest=function(t){if(this.isAttached){var e=this.inputNode;e.focus(),e.select()}},e.prototype.onUpdateRequest=function(t){var e=this.inputNode.value,n=this.contentNode,i=this._results;if(i||(i=this._results=a.search(this._items,e),this._activeIndex=e?s.ArrayExt.findFirstIndex(i,a.canActivate):-1),e||0!==i.length)if(e&&0===i.length){var r=this.renderer.renderEmptyMessage({query:e});h.VirtualDOM.render(r,n)}else{for(var o=this.renderer,c=this._activeIndex,l=new Array(i.length),d=0,f=i.length;d<f;++d){var p=i[d];if("header"===p.type){var m=p.indices,g=p.category;l[d]=o.renderHeader({category:g,indices:m})}else{var _=p.item,v=(m=p.indices,d===c);l[d]=o.renderItem({item:_,indices:m,active:v})}}if(h.VirtualDOM.render(l,n),c<0||c>=i.length)n.scrollTop=0;else{var b=n.children[c];u.ElementExt.scrollIntoViewIfNeeded(n,b)}}else h.VirtualDOM.render(null,n)},e.prototype._evtClick=function(t){if(0===t.button){var e=s.ArrayExt.findFirstIndex(this.contentNode.children,function(e){return e.contains(t.target)});-1!==e&&(t.preventDefault(),t.stopPropagation(),this._execute(e))}},e.prototype._evtKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey))switch(t.keyCode){case 13:t.preventDefault(),t.stopPropagation(),this._execute(this._activeIndex);break;case 38:t.preventDefault(),t.stopPropagation(),this._activatePreviousItem();break;case 40:t.preventDefault(),t.stopPropagation(),this._activateNextItem()}},e.prototype._activateNextItem=function(){if(this._results&&0!==this._results.length){var t=this._activeIndex,e=this._results.length,n=t<e-1?t+1:0,i=0===n?e-1:n-1;this._activeIndex=s.ArrayExt.findFirstIndex(this._results,a.canActivate,n,i),this.update()}},e.prototype._activatePreviousItem=function(){if(this._results&&0!==this._results.length){var t=this._activeIndex,e=this._results.length,n=t<=0?e-1:t-1,i=n===e-1?0:n+1;this._activeIndex=s.ArrayExt.findLastIndex(this._results,a.canActivate,n,i),this.update()}},e.prototype._execute=function(t){if(this._results){var e=this._results[t];if(e){if("header"===e.type){var n=this.inputNode;return n.value=e.category.toLowerCase()+" ",n.focus(),void this.refresh()}e.item.isEnabled&&(this.commands.execute(e.item.command,e.item.args),this.inputNode.value="",this.refresh())}}},e.prototype._toggleFocused=function(){var t=document.activeElement===this.inputNode;this.toggleClass("p-mod-focused",t)},e.prototype._onGenericChange=function(){this.refresh()},e}(d.Widget);e.CommandPalette=f,function(t){var e=function(){function t(){}return t.prototype.renderHeader=function(t){var e=this.formatHeader(t);return h.h.li({className:"p-CommandPalette-header"},e)},t.prototype.renderItem=function(t){var e=this.createItemClass(t),n=this.createItemDataset(t);return h.h.li({className:e,dataset:n},this.renderItemIcon(t),this.renderItemContent(t),this.renderItemShortcut(t))},t.prototype.renderEmptyMessage=function(t){var e=this.formatEmptyMessage(t);return h.h.li({className:"p-CommandPalette-emptyMessage"},e)},t.prototype.renderItemIcon=function(t){var e=this.createIconClass(t);return h.h.div({className:e},t.item.iconLabel)},t.prototype.renderItemContent=function(t){return h.h.div({className:"p-CommandPalette-itemContent"},this.renderItemLabel(t),this.renderItemCaption(t))},t.prototype.renderItemLabel=function(t){var e=this.formatItemLabel(t);return h.h.div({className:"p-CommandPalette-itemLabel"},e)},t.prototype.renderItemCaption=function(t){var e=this.formatItemCaption(t);return h.h.div({className:"p-CommandPalette-itemCaption"},e)},t.prototype.renderItemShortcut=function(t){var e=this.formatItemShortcut(t);return h.h.div({className:"p-CommandPalette-itemShortcut"},e)},t.prototype.createItemClass=function(t){var e="p-CommandPalette-item";t.item.isEnabled||(e+=" p-mod-disabled"),t.item.isToggled&&(e+=" p-mod-toggled"),t.active&&(e+=" p-mod-active");var n=t.item.className;return n&&(e+=" "+n),e},t.prototype.createItemDataset=function(t){return o({},t.item.dataset,{command:t.item.command})},t.prototype.createIconClass=function(t){var e="p-CommandPalette-itemIcon",n=t.item.iconClass;return n?e+" "+n:e},t.prototype.formatHeader=function(t){return t.indices&&0!==t.indices.length?s.StringExt.highlight(t.category,t.indices,h.h.mark):t.category},t.prototype.formatEmptyMessage=function(t){return"No commands found that match '"+t.query+"'"},t.prototype.formatItemShortcut=function(t){var e=t.item.keyBinding;return e?e.keys.map(l.CommandRegistry.formatKeystroke).join(", "):null},t.prototype.formatItemLabel=function(t){return t.indices&&0!==t.indices.length?s.StringExt.highlight(t.item.label,t.indices,h.h.mark):t.item.label},t.prototype.formatItemCaption=function(t){return t.item.caption},t}();t.Renderer=e,t.defaultRenderer=new e}(f=e.CommandPalette||(e.CommandPalette={})),e.CommandPalette=f,function(t){function e(t,e){for(var n=t.category.toLowerCase(),i=n+" "+t.label.toLowerCase(),r=1/0,o=null,a=/\b\w/g;;){var c=a.exec(i);if(!c)break;var l=s.StringExt.matchSumOfDeltas(i,e,c.index);if(!l)break;l&&l.score<=r&&(r=l.score,o=l.indices)}if(!o||r===1/0)return null;for(var u=n.length+1,h=s.ArrayExt.lowerBound(o,u,function(t,e){return t-e}),d=o.slice(0,h),f=o.slice(h),p=0,m=f.length;p<m;++p)f[p]-=u;return 0===d.length?{matchType:0,categoryIndices:null,labelIndices:f,score:r,item:t}:0===f.length?{matchType:1,categoryIndices:d,labelIndices:null,score:r,item:t}:{matchType:2,categoryIndices:d,labelIndices:f,score:r,item:t}}function n(t,e){var n=t.matchType-e.matchType;if(0!==n)return n;var i=t.score-e.score;if(0!==i)return i;var r=0,o=0;switch(t.matchType){case 0:r=t.labelIndices[0],o=e.labelIndices[0];break;case 1:case 2:r=t.categoryIndices[0],o=e.categoryIndices[0]}if(r!==o)return r-o;var a=t.item.category.localeCompare(e.item.category);if(0!==a)return a;var s=t.item.rank,c=e.item.rank;return s!==c?s<c?-1:1:t.item.label.localeCompare(e.item.label)}t.createNode=function(){var t=document.createElement("div"),e=document.createElement("div"),n=document.createElement("div"),i=document.createElement("input"),r=document.createElement("ul");return e.className="p-CommandPalette-search",n.className="p-CommandPalette-wrapper",i.className="p-CommandPalette-input",r.className="p-CommandPalette-content",i.spellcheck=!1,n.appendChild(i),e.appendChild(n),t.appendChild(e),t.appendChild(r),t},t.createItem=function(t,e){return new i(t,e)},t.search=function(t,i){var r=function(t,n){n=n.replace(/\s+/g,"").toLowerCase();for(var i=[],r=0,o=t.length;r<o;++r){var a=t[r];if(a.isVisible)if(n){var s=e(a,n);s&&(a.isEnabled||(s.score+=1e3),i.push(s))}else i.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item:a})}return i}(t,i);return r.sort(n),function(t){var e=new Array(t.length);s.ArrayExt.fill(e,!1);for(var n=[],i=0,r=t.length;i<r;++i)if(!e[i]){var o=t[i],a=o.item,c=o.categoryIndices,l=a.category;n.push({type:"header",category:l,indices:c});for(var u=i;u<r;++u)if(!e[u]){var h=t[u],d=h.item,f=h.labelIndices;d.category===l&&(n.push({type:"item",item:d,indices:f}),e[u]=!0)}}return n}(r)},t.canActivate=function(t){return"item"===t.type&&t.item.isEnabled};var i=function(){function t(t,e){this._commands=t,this.category=e.category.trim().replace(/\s+/g," "),this.command=e.command,this.args=e.args||c.JSONExt.emptyObject,this.rank=void 0!==e.rank?e.rank:1/0}return Object.defineProperty(t.prototype,"label",{get:function(){return this._commands.label(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconClass",{get:function(){return this._commands.iconClass(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconLabel",{get:function(){return this._commands.iconLabel(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"caption",{get:function(){return this._commands.caption(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return this._commands.className(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return this._commands.dataset(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this._commands.isEnabled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isToggled",{get:function(){return this._commands.isToggled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this._commands.isVisible(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keyBinding",{get:function(){var t=this.command,e=this.args;return s.ArrayExt.findLastValue(this._commands.keyBindings,function(n){return n.command===t&&c.JSONExt.deepEqual(n.args,e)})||null},enumerable:!0,configurable:!0}),t}()}(a||(a={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t}function n(t){return Array.isArray(t)}function i(t,r){if(t===r)return!0;if(e(t)||e(r))return!1;var o=n(t),a=n(r);return o===a&&(o&&a?function(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(var n=0,r=t.length;n<r;++n)if(!i(t[n],e[n]))return!1;return!0}(t,r):function(t,e){if(t===e)return!0;for(var n in t)if(!(n in e))return!1;for(var n in e)if(!(n in t))return!1;for(var n in t)if(!i(t[n],e[n]))return!1;return!0}(t,r))}function r(t){return e(t)?t:n(t)?function(t){for(var e=new Array(t.length),n=0,i=t.length;n<i;++n)e[n]=r(t[n]);return e}(t):function(t){var e={};for(var n in t)e[n]=r(t[n]);return e}(t)}t.emptyObject=Object.freeze({}),t.emptyArray=Object.freeze([]),t.isPrimitive=e,t.isArray=n,t.isObject=function(t){return!e(t)&&!n(t)},t.deepEqual=i,t.deepCopy=r}(e.JSONExt||(e.JSONExt={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){this._types=[],this._values=[]}return t.prototype.types=function(){return this._types.slice()},t.prototype.hasData=function(t){return-1!==this._types.indexOf(t)},t.prototype.getData=function(t){var e=this._types.indexOf(t);return-1!==e?this._values[e]:void 0},t.prototype.setData=function(t,e){this.clearData(t),this._types.push(t),this._values.push(e)},t.prototype.clearData=function(t){var e=this._types.indexOf(t);-1!==e&&(this._types.splice(e,1),this._values.splice(e,1))},t.prototype.clear=function(){this._types.length=0,this._values.length=0},t}();e.MimeData=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){var t=this;this.promise=new Promise(function(e,n){t._resolve=e,t._reject=n})}return t.prototype.resolve=function(t){(0,this._resolve)(t)},t.prototype.reject=function(t){(0,this._reject)(t)},t}();e.PromiseDelegate=i},function(t,e,n){"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=n(38),e.createHash=e.Hash=n(43),e.createHmac=e.Hmac=n(102);var i=n(198),r=Object.keys(i),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(r);e.getHashes=function(){return o};var a=n(105);e.pbkdf2=a.pbkdf2,e.pbkdf2Sync=a.pbkdf2Sync;var s=n(200);e.Cipher=s.Cipher,e.createCipher=s.createCipher,e.Cipheriv=s.Cipheriv,e.createCipheriv=s.createCipheriv,e.Decipher=s.Decipher,e.createDecipher=s.createDecipher,e.Decipheriv=s.Decipheriv,e.createDecipheriv=s.createDecipheriv,e.getCiphers=s.getCiphers,e.listCiphers=s.listCiphers;var c=n(217);e.DiffieHellmanGroup=c.DiffieHellmanGroup,e.createDiffieHellmanGroup=c.createDiffieHellmanGroup,e.getDiffieHellman=c.getDiffieHellman,e.createDiffieHellman=c.createDiffieHellman,e.DiffieHellman=c.DiffieHellman;var l=n(222);e.createSign=l.createSign,e.Sign=l.Sign,e.createVerify=l.createVerify,e.Verify=l.Verify,e.createECDH=n(259);var u=n(260);e.publicEncrypt=u.publicEncrypt,e.privateEncrypt=u.privateEncrypt,e.publicDecrypt=u.publicDecrypt,e.privateDecrypt=u.privateDecrypt;var h=n(263);e.randomFill=h.randomFill,e.randomFillSync=h.randomFillSync,e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},function(t,e,n){"use strict";e.byteLength=function(t){var e=l(t),n=e[0],i=e[1];return 3*(n+i)/4-i},e.toByteArray=function(t){for(var e,n=l(t),i=n[0],a=n[1],s=new o(function(t,e,n){return 3*(e+n)/4-n}(0,i,a)),c=0,u=a>0?i-4:i,h=0;h<u;h+=4)e=r[t.charCodeAt(h)]<<18|r[t.charCodeAt(h+1)]<<12|r[t.charCodeAt(h+2)]<<6|r[t.charCodeAt(h+3)],s[c++]=e>>16&255,s[c++]=e>>8&255,s[c++]=255&e;2===a&&(e=r[t.charCodeAt(h)]<<2|r[t.charCodeAt(h+1)]>>4,s[c++]=255&e);1===a&&(e=r[t.charCodeAt(h)]<<10|r[t.charCodeAt(h+1)]<<4|r[t.charCodeAt(h+2)]>>2,s[c++]=e>>8&255,s[c++]=255&e);return s},e.fromByteArray=function(t){for(var e,n=t.length,r=n%3,o=[],a=0,s=n-r;a<s;a+=16383)o.push(u(t,a,a+16383>s?s:a+16383));1===r?(e=t[n-1],o.push(i[e>>2]+i[e<<4&63]+"==")):2===r&&(e=(t[n-2]<<8)+t[n-1],o.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"="));return o.join("")};for(var i=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,c=a.length;s<c;++s)i[s]=a[s],r[a.charCodeAt(s)]=s;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function u(t,e,n){for(var r,o,a=[],s=e;s<n;s+=3)r=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(i[(o=r)>>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,i,r){var o,a,s=8*r-i-1,c=(1<<s)-1,l=c>>1,u=-7,h=n?r-1:0,d=n?-1:1,f=t[e+h];for(h+=d,o=f&(1<<-u)-1,f>>=-u,u+=s;u>0;o=256*o+t[e+h],h+=d,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=i;u>0;a=256*a+t[e+h],h+=d,u-=8);if(0===o)o=1-l;else{if(o===c)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,i),o-=l}return(f?-1:1)*a*Math.pow(2,o-i)},e.write=function(t,e,n,i,r,o){var a,s,c,l=8*o-r-1,u=(1<<l)-1,h=u>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,p=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+h>=1?d/c:d*Math.pow(2,1-h))*c>=2&&(a++,c/=2),a+h>=u?(s=0,a=u):a+h>=1?(s=(e*c-1)*Math.pow(2,r),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,r),a=0));r>=8;t[n+f]=255&s,f+=p,s/=256,r-=8);for(a=a<<r|s,l+=r;l>0;t[n+f]=255&a,f+=p,a/=256,l-=8);t[n+f-p]|=128*m}},function(t,e){},function(t,e,n){"use strict";var i=n(5).Buffer,r=n(186);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},t.prototype.concat=function(t){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;for(var e,n,r,o=i.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,n=o,r=s,e.copy(n,r),s+=a.data.length,a=a.next;return o},t}(),r&&r.inspect&&r.inspect.custom&&(t.exports.prototype[r.inspect.custom]=function(){var t=r.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,n){(function(e){function n(t){try{if(!e.localStorage)return!1}catch(t){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var i=!1;return function(){if(!i){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}}}).call(this,n(25))},function(t,e,n){"use strict";t.exports=o;var i=n(99),r=n(44);function o(t){if(!(this instanceof o))return new o(t);i.call(this,t)}r.inherits=n(4),r.inherits(o,i),o.prototype._transform=function(t,e,n){n(null,t)}},function(t,e,n){t.exports=n(72)},function(t,e,n){t.exports=n(36)},function(t,e,n){t.exports=n(71).Transform},function(t,e,n){t.exports=n(71).PassThrough},function(t,e,n){var i=n(4),r=n(39),o=n(5).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,r.call(this,64,56)}function l(t){return t<<30|t>>>2}function u(t,e,n,i){return 0===t?e&n|~e&i:2===t?e&n|e&i|n&i:e^n^i}i(c,r),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(t){for(var e,n=this._w,i=0|this._a,r=0|this._b,o=0|this._c,s=0|this._d,c=0|this._e,h=0;h<16;++h)n[h]=t.readInt32BE(4*h);for(;h<80;++h)n[h]=n[h-3]^n[h-8]^n[h-14]^n[h-16];for(var d=0;d<80;++d){var f=~~(d/20),p=0|((e=i)<<5|e>>>27)+u(f,r,o,s)+c+n[d]+a[f];c=s,s=o,o=l(r),r=i,i=p}this._a=i+this._a|0,this._b=r+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=c},function(t,e,n){var i=n(4),r=n(39),o=n(5).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,r.call(this,64,56)}function l(t){return t<<5|t>>>27}function u(t){return t<<30|t>>>2}function h(t,e,n,i){return 0===t?e&n|~e&i:2===t?e&n|e&i|n&i:e^n^i}i(c,r),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(t){for(var e,n=this._w,i=0|this._a,r=0|this._b,o=0|this._c,s=0|this._d,c=0|this._e,d=0;d<16;++d)n[d]=t.readInt32BE(4*d);for(;d<80;++d)n[d]=(e=n[d-3]^n[d-8]^n[d-14]^n[d-16])<<1|e>>>31;for(var f=0;f<80;++f){var p=~~(f/20),m=l(i)+h(p,r,o,s)+c+n[f]+a[p]|0;c=s,s=o,o=u(r),r=i,i=m}this._a=i+this._a|0,this._b=r+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=c},function(t,e,n){var i=n(4),r=n(100),o=n(39),a=n(5).Buffer,s=new Array(64);function c(){this.init(),this._w=s,o.call(this,64,56)}i(c,r),c.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},c.prototype._hash=function(){var t=a.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=c},function(t,e,n){var i=n(4),r=n(101),o=n(39),a=n(5).Buffer,s=new Array(160);function c(){this.init(),this._w=s,o.call(this,128,112)}i(c,r),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var t=a.allocUnsafe(48);function e(e,n,i){t.writeInt32BE(e,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=c},function(t,e,n){"use strict";var i=n(4),r=n(5).Buffer,o=n(35),a=r.alloc(128),s=64;function c(t,e){o.call(this,"digest"),"string"==typeof e&&(e=r.from(e)),this._alg=t,this._key=e,e.length>s?e=t(e):e.length<s&&(e=r.concat([e,a],s));for(var n=this._ipad=r.allocUnsafe(s),i=this._opad=r.allocUnsafe(s),c=0;c<s;c++)n[c]=54^e[c],i[c]=92^e[c];this._hash=[n]}i(c,o),c.prototype._update=function(t){this._hash.push(t)},c.prototype._final=function(){var t=this._alg(r.concat(this._hash));return this._alg(r.concat([this._opad,t]))},t.exports=c},function(t,e,n){t.exports=n(104)},function(t,e,n){(function(e,i){var r,o=n(106),a=n(107),s=n(108),c=n(5).Buffer,l=e.crypto&&e.crypto.subtle,u={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[];function d(t,e,n,i,r){return l.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then(function(t){return l.deriveBits({name:"PBKDF2",salt:e,iterations:n,hash:{name:r}},t,i<<3)}).then(function(t){return c.from(t)})}t.exports=function(t,n,f,p,m,g){"function"==typeof m&&(g=m,m=void 0);var _=u[(m=m||"sha1").toLowerCase()];if(!_||"function"!=typeof e.Promise)return i.nextTick(function(){var e;try{e=s(t,n,f,p,m)}catch(t){return g(t)}g(null,e)});if(o(t,n,f,p),"function"!=typeof g)throw new Error("No callback provided to pbkdf2");c.isBuffer(t)||(t=c.from(t,a)),c.isBuffer(n)||(n=c.from(n,a)),function(t,e){t.then(function(t){i.nextTick(function(){e(null,t)})},function(t){i.nextTick(function(){e(t)})})}(function(t){if(e.process&&!e.process.browser)return Promise.resolve(!1);if(!l||!l.importKey||!l.deriveBits)return Promise.resolve(!1);if(void 0!==h[t])return h[t];var n=d(r=r||c.alloc(8),r,10,128,t).then(function(){return!0}).catch(function(){return!1});return h[t]=n,n}(_).then(function(e){return e?d(t,n,f,p,_):s(t,n,f,p,m)}),g)}}).call(this,n(25),n(33))},function(t,e,n){var i=n(201),r=n(77),o=n(78),a=n(216),s=n(56);function c(t,e,n){if(t=t.toLowerCase(),o[t])return r.createCipheriv(t,e,n);if(a[t])return new i({key:e,iv:n,mode:t});throw new TypeError("invalid suite type")}function l(t,e,n){if(t=t.toLowerCase(),o[t])return r.createDecipheriv(t,e,n);if(a[t])return new i({key:e,iv:n,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}e.createCipher=e.Cipher=function(t,e){var n,i;if(t=t.toLowerCase(),o[t])n=o[t].key,i=o[t].iv;else{if(!a[t])throw new TypeError("invalid suite type");n=8*a[t].key,i=a[t].iv}var r=s(e,!1,n,i);return c(t,r.key,r.iv)},e.createCipheriv=e.Cipheriv=c,e.createDecipher=e.Decipher=function(t,e){var n,i;if(t=t.toLowerCase(),o[t])n=o[t].key,i=o[t].iv;else{if(!a[t])throw new TypeError("invalid suite type");n=8*a[t].key,i=a[t].iv}var r=s(e,!1,n,i);return l(t,r.key,r.iv)},e.createDecipheriv=e.Decipheriv=l,e.listCiphers=e.getCiphers=function(){return Object.keys(a).concat(r.getCiphers())}},function(t,e,n){var i=n(35),r=n(76),o=n(4),a=n(5).Buffer,s={"des-ede3-cbc":r.CBC.instantiate(r.EDE),"des-ede3":r.EDE,"des-ede-cbc":r.CBC.instantiate(r.EDE),"des-ede":r.EDE,"des-cbc":r.CBC.instantiate(r.DES),"des-ecb":r.DES};function c(t){i.call(this);var e,n=t.mode.toLowerCase(),r=s[n];e=t.decrypt?"decrypt":"encrypt";var o=t.key;a.isBuffer(o)||(o=a.from(o)),"des-ede"!==n&&"des-ede-cbc"!==n||(o=a.concat([o,o.slice(0,8)]));var c=t.iv;a.isBuffer(c)||(c=a.from(c)),this._des=r.create({key:o,iv:c,type:e})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],t.exports=c,o(c,i),c.prototype._update=function(t){return a.from(this._des.update(t))},c.prototype._final=function(){return a.from(this._des.final())}},function(t,e,n){"use strict";e.readUInt32BE=function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},e.writeUInt32BE=function(t,e,n){t[0+n]=e>>>24,t[1+n]=e>>>16&255,t[2+n]=e>>>8&255,t[3+n]=255&e},e.ip=function(t,e,n,i){for(var r=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)r<<=1,r|=e>>>s+a&1;for(s=0;s<=24;s+=8)r<<=1,r|=t>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1}n[i+0]=r>>>0,n[i+1]=o>>>0},e.rip=function(t,e,n,i){for(var r=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)r<<=1,r|=e>>>s+a&1,r<<=1,r|=t>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=e>>>s+a&1,o<<=1,o|=t>>>s+a&1;n[i+0]=r>>>0,n[i+1]=o>>>0},e.pc1=function(t,e,n,i){for(var r=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)r<<=1,r|=e>>s+a&1;for(s=0;s<=24;s+=8)r<<=1,r|=t>>s+a&1}for(s=0;s<=24;s+=8)r<<=1,r|=e>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;n[i+0]=r>>>0,n[i+1]=o>>>0},e.r28shl=function(t,e){return t<<e&268435455|t>>>28-e};var i=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];e.pc2=function(t,e,n,r){for(var o=0,a=0,s=i.length>>>1,c=0;c<s;c++)o<<=1,o|=t>>>i[c]&1;for(c=s;c<i.length;c++)a<<=1,a|=e>>>i[c]&1;n[r+0]=o>>>0,n[r+1]=a>>>0},e.expand=function(t,e,n){var i=0,r=0;i=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)i<<=6,i|=t>>>o&63;for(o=11;o>=3;o-=4)r|=t>>>o&63,r<<=6;r|=(31&t)<<1|t>>>31,e[n+0]=i>>>0,e[n+1]=r>>>0};var r=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];e.substitute=function(t,e){for(var n=0,i=0;i<4;i++){n<<=4,n|=r[64*i+(t>>>18-6*i&63)]}for(i=0;i<4;i++){n<<=4,n|=r[256+64*i+(e>>>18-6*i&63)]}return n>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];e.permute=function(t){for(var e=0,n=0;n<o.length;n++)e<<=1,e|=t>>>o[n]&1;return e>>>0},e.padSplit=function(t,e,n){for(var i=t.toString(2);i.length<e;)i="0"+i;for(var r=[],o=0;o<e;o+=n)r.push(i.slice(o,o+n));return r.join(" ")}},function(t,e,n){"use strict";var i=n(22);function r(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}t.exports=r,r.prototype._init=function(){},r.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},r.prototype._buffer=function(t,e){for(var n=Math.min(this.buffer.length-this.bufferOff,t.length-e),i=0;i<n;i++)this.buffer[this.bufferOff+i]=t[e+i];return this.bufferOff+=n,n},r.prototype._flushBuffer=function(t,e){return this._update(this.buffer,0,t,e),this.bufferOff=0,this.blockSize},r.prototype._updateEncrypt=function(t){var e=0,n=0,i=(this.bufferOff+t.length)/this.blockSize|0,r=new Array(i*this.blockSize);0!==this.bufferOff&&(e+=this._buffer(t,e),this.bufferOff===this.buffer.length&&(n+=this._flushBuffer(r,n)));for(var o=t.length-(t.length-e)%this.blockSize;e<o;e+=this.blockSize)this._update(t,e,r,n),n+=this.blockSize;for(;e<t.length;e++,this.bufferOff++)this.buffer[this.bufferOff]=t[e];return r},r.prototype._updateDecrypt=function(t){for(var e=0,n=0,i=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,r=new Array(i*this.blockSize);i>0;i--)e+=this._buffer(t,e),n+=this._flushBuffer(r,n);return e+=this._buffer(t,e),r},r.prototype.final=function(t){var e,n;return t&&(e=this.update(t)),n="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(n):n},r.prototype._pad=function(t,e){if(0===e)return!1;for(;e<t.length;)t[e++]=0;return!0},r.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t},r.prototype._unpad=function(t){return t},r.prototype._finalDecrypt=function(){i.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)}},function(t,e,n){"use strict";var i=n(22),r=n(4),o=n(76),a=o.utils,s=o.Cipher;function c(){this.tmp=new Array(2),this.keys=null}function l(t){s.call(this,t);var e=new c;this._desState=e,this.deriveKeys(e,t.key)}r(l,s),t.exports=l,l.create=function(t){return new l(t)};var u=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];l.prototype.deriveKeys=function(t,e){t.keys=new Array(32),i.equal(e.length,this.blockSize,"Invalid key length");var n=a.readUInt32BE(e,0),r=a.readUInt32BE(e,4);a.pc1(n,r,t.tmp,0),n=t.tmp[0],r=t.tmp[1];for(var o=0;o<t.keys.length;o+=2){var s=u[o>>>1];n=a.r28shl(n,s),r=a.r28shl(r,s),a.pc2(n,r,t.keys,o)}},l.prototype._update=function(t,e,n,i){var r=this._desState,o=a.readUInt32BE(t,e),s=a.readUInt32BE(t,e+4);a.ip(o,s,r.tmp,0),o=r.tmp[0],s=r.tmp[1],"encrypt"===this.type?this._encrypt(r,o,s,r.tmp,0):this._decrypt(r,o,s,r.tmp,0),o=r.tmp[0],s=r.tmp[1],a.writeUInt32BE(n,o,i),a.writeUInt32BE(n,s,i+4)},l.prototype._pad=function(t,e){for(var n=t.length-e,i=e;i<t.length;i++)t[i]=n;return!0},l.prototype._unpad=function(t){for(var e=t[t.length-1],n=t.length-e;n<t.length;n++)i.equal(t[n],e);return t.slice(0,t.length-e)},l.prototype._encrypt=function(t,e,n,i,r){for(var o=e,s=n,c=0;c<t.keys.length;c+=2){var l=t.keys[c],u=t.keys[c+1];a.expand(s,t.tmp,0),l^=t.tmp[0],u^=t.tmp[1];var h=a.substitute(l,u),d=s;s=(o^a.permute(h))>>>0,o=d}a.rip(s,o,i,r)},l.prototype._decrypt=function(t,e,n,i,r){for(var o=n,s=e,c=t.keys.length-2;c>=0;c-=2){var l=t.keys[c],u=t.keys[c+1];a.expand(o,t.tmp,0),l^=t.tmp[0],u^=t.tmp[1];var h=a.substitute(l,u),d=o;o=(s^a.permute(h))>>>0,s=d}a.rip(o,s,i,r)}},function(t,e,n){"use strict";var i=n(22),r=n(4),o={};function a(t){i.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=t[e]}e.instantiate=function(t){function e(e){t.call(this,e),this._cbcInit()}r(e,t);for(var n=Object.keys(o),i=0;i<n.length;i++){var a=n[i];e.prototype[a]=o[a]}return e.create=function(t){return new e(t)},e},o._cbcInit=function(){var t=new a(this.options.iv);this._cbcState=t},o._update=function(t,e,n,i){var r=this._cbcState,o=this.constructor.super_.prototype,a=r.iv;if("encrypt"===this.type){for(var s=0;s<this.blockSize;s++)a[s]^=t[e+s];o._update.call(this,a,0,n,i);for(s=0;s<this.blockSize;s++)a[s]=n[i+s]}else{o._update.call(this,t,e,n,i);for(s=0;s<this.blockSize;s++)n[i+s]^=a[s];for(s=0;s<this.blockSize;s++)a[s]=t[e+s]}}},function(t,e,n){"use strict";var i=n(22),r=n(4),o=n(76),a=o.Cipher,s=o.DES;function c(t,e){i.equal(e.length,24,"Invalid key length");var n=e.slice(0,8),r=e.slice(8,16),o=e.slice(16,24);this.ciphers="encrypt"===t?[s.create({type:"encrypt",key:n}),s.create({type:"decrypt",key:r}),s.create({type:"encrypt",key:o})]:[s.create({type:"decrypt",key:o}),s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:n})]}function l(t){a.call(this,t);var e=new c(this.type,this.options.key);this._edeState=e}r(l,a),t.exports=l,l.create=function(t){return new l(t)},l.prototype._update=function(t,e,n,i){var r=this._edeState;r.ciphers[0]._update(t,e,n,i),r.ciphers[1]._update(n,i,n,i),r.ciphers[2]._update(n,i,n,i)},l.prototype._pad=s.prototype._pad,l.prototype._unpad=s.prototype._unpad},function(t,e,n){var i=n(78),r=n(112),o=n(5).Buffer,a=n(113),s=n(35),c=n(55),l=n(56);function u(t,e,n){s.call(this),this._cache=new d,this._cipher=new c.AES(e),this._prev=o.from(n),this._mode=t,this._autopadding=!0}n(4)(u,s),u.prototype._update=function(t){var e,n;this._cache.add(t);for(var i=[];e=this._cache.get();)n=this._mode.encrypt(this,e),i.push(n);return o.concat(i)};var h=o.alloc(16,16);function d(){this.cache=o.allocUnsafe(0)}function f(t,e,n){var s=i[t.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=o.from(e)),e.length!==s.key/8)throw new TypeError("invalid key length "+e.length);if("string"==typeof n&&(n=o.from(n)),"GCM"!==s.mode&&n.length!==s.iv)throw new TypeError("invalid iv length "+n.length);return"stream"===s.type?new a(s.module,e,n):"auth"===s.type?new r(s.module,e,n):new u(s.module,e,n)}u.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(h))throw this._cipher.scrub(),new Error("data not multiple of block length")},u.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},d.prototype.add=function(t){this.cache=o.concat([this.cache,t])},d.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},d.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),n=-1;++n<t;)e.writeUInt8(t,n);return o.concat([this.cache,e])},e.createCipheriv=f,e.createCipher=function(t,e){var n=i[t.toLowerCase()];if(!n)throw new TypeError("invalid suite type");var r=l(e,!1,n.key,n.iv);return f(t,r.key,r.iv)}},function(t,e){e.encrypt=function(t,e){return t._cipher.encryptBlock(e)},e.decrypt=function(t,e){return t._cipher.decryptBlock(e)}},function(t,e,n){var i=n(45);e.encrypt=function(t,e){var n=i(e,t._prev);return t._prev=t._cipher.encryptBlock(n),t._prev},e.decrypt=function(t,e){var n=t._prev;t._prev=e;var r=t._cipher.decryptBlock(e);return i(r,n)}},function(t,e,n){var i=n(5).Buffer,r=n(45);function o(t,e,n){var o=e.length,a=r(e,t._cache);return t._cache=t._cache.slice(o),t._prev=i.concat([t._prev,n?e:a]),a}e.encrypt=function(t,e,n){for(var r,a=i.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=i.allocUnsafe(0)),!(t._cache.length<=e.length)){a=i.concat([a,o(t,e,n)]);break}r=t._cache.length,a=i.concat([a,o(t,e.slice(0,r),n)]),e=e.slice(r)}return a}},function(t,e,n){var i=n(5).Buffer;function r(t,e,n){var r=t._cipher.encryptBlock(t._prev)[0]^e;return t._prev=i.concat([t._prev.slice(1),i.from([n?e:r])]),r}e.encrypt=function(t,e,n){for(var o=e.length,a=i.allocUnsafe(o),s=-1;++s<o;)a[s]=r(t,e[s],n);return a}},function(t,e,n){var i=n(5).Buffer;function r(t,e,n){for(var i,r,a=-1,s=0;++a<8;)i=e&1<<7-a?128:0,s+=(128&(r=t._cipher.encryptBlock(t._prev)[0]^i))>>a%8,t._prev=o(t._prev,n?i:r);return s}function o(t,e){var n=t.length,r=-1,o=i.allocUnsafe(t.length);for(t=i.concat([t,i.from([e])]);++r<n;)o[r]=t[r]<<1|t[r+1]>>7;return o}e.encrypt=function(t,e,n){for(var o=e.length,a=i.allocUnsafe(o),s=-1;++s<o;)a[s]=r(t,e[s],n);return a}},function(t,e,n){(function(t){var i=n(45);function r(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}e.encrypt=function(e,n){for(;e._cache.length<n.length;)e._cache=t.concat([e._cache,r(e)]);var o=e._cache.slice(0,n.length);return e._cache=e._cache.slice(n.length),i(n,o)}}).call(this,n(15).Buffer)},function(t,e,n){var i=n(5).Buffer,r=i.alloc(16,0);function o(t){var e=i.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function a(t){this.h=t,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(t){for(var e=-1;++e<t.length;)this.state[e]^=t[e];this._multiply()},a.prototype._multiply=function(){for(var t,e,n,i=[(t=this.h).readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)],r=[0,0,0,0],a=-1;++a<128;){for(0!=(this.state[~~(a/8)]&1<<7-a%8)&&(r[0]^=i[0],r[1]^=i[1],r[2]^=i[2],r[3]^=i[3]),n=0!=(1&i[3]),e=3;e>0;e--)i[e]=i[e]>>>1|(1&i[e-1])<<31;i[0]=i[0]>>>1,n&&(i[0]=i[0]^225<<24)}this.state=o(r)},a.prototype.update=function(t){var e;for(this.cache=i.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},a.prototype.final=function(t,e){return this.cache.length&&this.ghash(i.concat([this.cache,r],16)),this.ghash(o([0,t,0,e])),this.state},t.exports=a},function(t,e,n){var i=n(112),r=n(5).Buffer,o=n(78),a=n(113),s=n(35),c=n(55),l=n(56);function u(t,e,n){s.call(this),this._cache=new h,this._last=void 0,this._cipher=new c.AES(e),this._prev=r.from(n),this._mode=t,this._autopadding=!0}function h(){this.cache=r.allocUnsafe(0)}function d(t,e,n){var s=o[t.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof n&&(n=r.from(n)),"GCM"!==s.mode&&n.length!==s.iv)throw new TypeError("invalid iv length "+n.length);if("string"==typeof e&&(e=r.from(e)),e.length!==s.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===s.type?new a(s.module,e,n,!0):"auth"===s.type?new i(s.module,e,n,!0):new u(s.module,e,n)}n(4)(u,s),u.prototype._update=function(t){var e,n;this._cache.add(t);for(var i=[];e=this._cache.get(this._autopadding);)n=this._mode.decrypt(this,e),i.push(n);return r.concat(i)},u.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");var n=-1;for(;++n<e;)if(t[n+(16-e)]!==e)throw new Error("unable to decrypt data");if(16===e)return;return t.slice(0,16-e)}(this._mode.decrypt(this,t));if(t)throw new Error("data not multiple of block length")},u.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},h.prototype.add=function(t){this.cache=r.concat([this.cache,t])},h.prototype.get=function(t){var e;if(t){if(this.cache.length>16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},h.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=function(t,e){var n=o[t.toLowerCase()];if(!n)throw new TypeError("invalid suite type");var i=l(e,!1,n.key,n.iv);return d(t,i.key,i.iv)},e.createDecipheriv=d},function(t,e){e["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}},function(t,e,n){(function(t){var i=n(114),r=n(220),o=n(221);var a={binary:!0,hex:!0,base64:!0};e.DiffieHellmanGroup=e.createDiffieHellmanGroup=e.getDiffieHellman=function(e){var n=new t(r[e].prime,"hex"),i=new t(r[e].gen,"hex");return new o(n,i)},e.createDiffieHellman=e.DiffieHellman=function e(n,r,s,c){return t.isBuffer(r)||void 0===a[r]?e(n,"binary",r,s):(r=r||"binary",c=c||"binary",s=s||new t([2]),t.isBuffer(s)||(s=new t(s,c)),"number"==typeof n?new o(i(n,s),s,!0):(t.isBuffer(n)||(n=new t(n,r)),new o(n,s,!0)))}}).call(this,n(15).Buffer)},function(t,e){},function(t,e){},function(t){t.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},function(t,e,n){(function(e){var i=n(11),r=new(n(115)),o=new i(24),a=new i(11),s=new i(10),c=new i(3),l=new i(7),u=n(114),h=n(38);function d(t,n){return n=n||"utf8",e.isBuffer(t)||(t=new e(t,n)),this._pub=new i(t),this}function f(t,n){return n=n||"utf8",e.isBuffer(t)||(t=new e(t,n)),this._priv=new i(t),this}t.exports=m;var p={};function m(t,e,n){this.setGenerator(e),this.__prime=new i(t),this._prime=i.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,n?(this.setPublicKey=d,this.setPrivateKey=f):this._primeCode=8}function g(t,n){var i=new e(t.toArray());return n?i.toString(n):i}Object.defineProperty(m.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(t,e){var n=e.toString("hex"),i=[n,t.toString(16)].join("_");if(i in p)return p[i];var h,d=0;if(t.isEven()||!u.simpleSieve||!u.fermatTest(t)||!r.test(t))return d+=1,d+="02"===n||"05"===n?8:4,p[i]=d,d;switch(r.test(t.shrn(1))||(d+=2),n){case"02":t.mod(o).cmp(a)&&(d+=8);break;case"05":(h=t.mod(s)).cmp(c)&&h.cmp(l)&&(d+=8);break;default:d+=4}return p[i]=d,d}(this.__prime,this.__gen)),this._primeCode}}),m.prototype.generateKeys=function(){return this._priv||(this._priv=new i(h(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},m.prototype.computeSecret=function(t){var n=(t=(t=new i(t)).toRed(this._prime)).redPow(this._priv).fromRed(),r=new e(n.toArray()),o=this.getPrime();if(r.length<o.length){var a=new e(o.length-r.length);a.fill(0),r=e.concat([a,r])}return r},m.prototype.getPublicKey=function(t){return g(this._pub,t)},m.prototype.getPrivateKey=function(t){return g(this._priv,t)},m.prototype.getPrime=function(t){return g(this.__prime,t)},m.prototype.getGenerator=function(t){return g(this._gen,t)},m.prototype.setGenerator=function(t,n){return n=n||"utf8",e.isBuffer(t)||(t=new e(t,n)),this.__gen=t,this._gen=new i(t),this}}).call(this,n(15).Buffer)},function(t,e,n){(function(e){var i=n(43),r=n(69),o=n(4),a=n(223),s=n(258),c=n(104);function l(t){r.Writable.call(this);var e=c[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function u(t){r.Writable.call(this);var e=c[t];if(!e)throw new Error("Unknown message digest");this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function h(t){return new l(t)}function d(t){return new u(t)}Object.keys(c).forEach(function(t){c[t].id=new e(c[t].id,"hex"),c[t.toLowerCase()]=c[t]}),o(l,r.Writable),l.prototype._write=function(t,e,n){this._hash.update(t),n()},l.prototype.update=function(t,n){return"string"==typeof t&&(t=new e(t,n)),this._hash.update(t),this},l.prototype.sign=function(t,e){this.end();var n=this._hash.digest(),i=a(n,t,this._hashType,this._signType,this._tag);return e?i.toString(e):i},o(u,r.Writable),u.prototype._write=function(t,e,n){this._hash.update(t),n()},u.prototype.update=function(t,n){return"string"==typeof t&&(t=new e(t,n)),this._hash.update(t),this},u.prototype.verify=function(t,n,i){"string"==typeof n&&(n=new e(n,i)),this.end();var r=this._hash.digest();return s(n,r,t,this._signType,this._tag)},t.exports={Sign:h,Verify:d,createSign:h,createVerify:d}}).call(this,n(15).Buffer)},function(t,e,n){(function(e){var i=n(102),r=n(79),o=n(20).ec,a=n(11),s=n(58),c=n(125);function l(t,n,r,o){if((t=new e(t.toArray())).length<n.byteLength()){var a=new e(n.byteLength()-t.length);a.fill(0),t=e.concat([a,t])}var s=r.length,c=function(t,n){t=(t=u(t,n)).mod(n);var i=new e(t.toArray());if(i.length<n.byteLength()){var r=new e(n.byteLength()-i.length);r.fill(0),i=e.concat([r,i])}return i}(r,n),l=new e(s);l.fill(1);var h=new e(s);return h.fill(0),h=i(o,h).update(l).update(new e([0])).update(t).update(c).digest(),l=i(o,h).update(l).digest(),{k:h=i(o,h).update(l).update(new e([1])).update(t).update(c).digest(),v:l=i(o,h).update(l).digest()}}function u(t,e){var n=new a(t),i=(t.length<<3)-e.bitLength();return i>0&&n.ishrn(i),n}function h(t,n,r){var o,a;do{for(o=new e(0);8*o.length<t.bitLength();)n.v=i(r,n.k).update(n.v).digest(),o=e.concat([o,n.v]);a=u(o,t),n.k=i(r,n.k).update(n.v).update(new e([0])).digest(),n.v=i(r,n.k).update(n.v).digest()}while(-1!==a.cmp(t));return a}function d(t,e,n,i){return t.toRed(a.mont(n)).redPow(e).fromRed().mod(i)}t.exports=function(t,n,i,f,p){var m=s(n);if(m.curve){if("ecdsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong private key type");return function(t,n){var i=c[n.curve.join(".")];if(!i)throw new Error("unknown curve "+n.curve.join("."));var r=new o(i).keyFromPrivate(n.privateKey).sign(t);return new e(r.toDER())}(t,m)}if("dsa"===m.type){if("dsa"!==f)throw new Error("wrong private key type");return function(t,n,i){for(var r,o=n.params.priv_key,s=n.params.p,c=n.params.q,f=n.params.g,p=new a(0),m=u(t,c).mod(c),g=!1,_=l(o,c,t,i);!1===g;)r=h(c,_,i),p=d(f,r,s,c),0===(g=r.invm(c).imul(m.add(o.mul(p))).mod(c)).cmpn(0)&&(g=!1,p=new a(0));return function(t,n){t=t.toArray(),n=n.toArray(),128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n));var i=[48,t.length+n.length+4,2,t.length];return i=i.concat(t,[2,n.length],n),new e(i)}(p,g)}(t,m,i)}if("rsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong private key type");t=e.concat([p,t]);for(var g=m.modulus.byteLength(),_=[0,1];t.length+_.length+1<g;)_.push(255);_.push(0);for(var v=-1;++v<t.length;)_.push(t[v]);return r(_,m)},t.exports.getKey=l,t.exports.makeKey=h}).call(this,n(15).Buffer)},function(t){t.exports=JSON.parse('{"_args":[["elliptic@6.4.1","/home/sylvain/dev/bloomberg/bqplot/js"]],"_development":true,"_from":"elliptic@6.4.1","_id":"elliptic@6.4.1","_inBundle":false,"_integrity":"sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==","_location":"/elliptic","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"elliptic@6.4.1","name":"elliptic","escapedName":"elliptic","rawSpec":"6.4.1","saveSpec":null,"fetchSpec":"6.4.1"},"_requiredBy":["/browserify-sign","/create-ecdh"],"_resolved":"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz","_spec":"6.4.1","_where":"/home/sylvain/dev/bloomberg/bqplot/js","author":{"name":"Fedor Indutny","email":"fedor@indutny.com"},"bugs":{"url":"https://github.com/indutny/elliptic/issues"},"dependencies":{"bn.js":"^4.4.0","brorand":"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0","inherits":"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},"description":"EC cryptography","devDependencies":{"brfs":"^1.4.3","coveralls":"^2.11.3","grunt":"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2","istanbul":"^0.4.2","jscs":"^2.9.0","jshint":"^2.6.0","mocha":"^2.1.0"},"files":["lib"],"homepage":"https://github.com/indutny/elliptic","keywords":["EC","Elliptic","curve","Cryptography"],"license":"MIT","main":"lib/elliptic.js","name":"elliptic","repository":{"type":"git","url":"git+ssh://git@github.com/indutny/elliptic.git"},"scripts":{"jscs":"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js","jshint":"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js","lint":"npm run jscs && npm run jshint","test":"npm run lint && npm run unit","unit":"istanbul test _mocha --reporter=spec test/index.js","version":"grunt dist && git add dist/"},"version":"6.4.1"}')},function(t,e,n){"use strict";var i=e,r=n(11),o=n(22),a=n(117);i.assert=o,i.toArray=a.toArray,i.zero2=a.zero2,i.toHex=a.toHex,i.encode=a.encode,i.getNAF=function(t,e){for(var n=[],i=1<<e+1,r=t.clone();r.cmpn(1)>=0;){var o;if(r.isOdd()){var a=r.andln(i-1);o=a>(i>>1)-1?(i>>1)-a:a,r.isubn(o)}else o=0;n.push(o);for(var s=0!==r.cmpn(0)&&0===r.andln(i-1)?e+1:1,c=1;c<s;c++)n.push(0);r.iushrn(s)}return n},i.getJSF=function(t,e){var n=[[],[]];t=t.clone(),e=e.clone();for(var i=0,r=0;t.cmpn(-i)>0||e.cmpn(-r)>0;){var o,a,s,c=t.andln(3)+i&3,l=e.andln(3)+r&3;3===c&&(c=-1),3===l&&(l=-1),o=0==(1&c)?0:3!=(s=t.andln(7)+i&7)&&5!==s||2!==l?c:-c,n[0].push(o),a=0==(1&l)?0:3!=(s=e.andln(7)+r&7)&&5!==s||2!==c?l:-l,n[1].push(a),2*i===o+1&&(i=1-i),2*r===a+1&&(r=1-r),t.iushrn(1),e.iushrn(1)}return n},i.cachedProperty=function(t,e,n){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=n.call(this)}},i.parseBytes=function(t){return"string"==typeof t?i.toArray(t,"hex"):t},i.intFromLE=function(t){return new r(t,"hex","le")}},function(t,e,n){"use strict";var i=n(11),r=n(20).utils,o=r.getNAF,a=r.getJSF,s=r.assert;function c(t,e){this.type=t,this.p=new i(e.p,16),this.red=e.prime?i.red(e.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=e.n&&new i(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function l(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(t,e){s(t.precomputed);var n=t._getDoubles(),i=o(e,1),r=(1<<n.step+1)-(n.step%2==0?2:1);r/=3;for(var a=[],c=0;c<i.length;c+=n.step){var l=0;for(e=c+n.step-1;e>=c;e--)l=(l<<1)+i[e];a.push(l)}for(var u=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=r;d>0;d--){for(c=0;c<a.length;c++){(l=a[c])===d?h=h.mixedAdd(n.points[c]):l===-d&&(h=h.mixedAdd(n.points[c].neg()))}u=u.add(h)}return u.toP()},c.prototype._wnafMul=function(t,e){var n=4,i=t._getNAFPoints(n);n=i.wnd;for(var r=i.points,a=o(e,n),c=this.jpoint(null,null,null),l=a.length-1;l>=0;l--){for(e=0;l>=0&&0===a[l];l--)e++;if(l>=0&&e++,c=c.dblp(e),l<0)break;var u=a[l];s(0!==u),c="affine"===t.type?u>0?c.mixedAdd(r[u-1>>1]):c.mixedAdd(r[-u-1>>1].neg()):u>0?c.add(r[u-1>>1]):c.add(r[-u-1>>1].neg())}return"affine"===t.type?c.toP():c},c.prototype._wnafMulAdd=function(t,e,n,i,r){for(var s=this._wnafT1,c=this._wnafT2,l=this._wnafT3,u=0,h=0;h<i;h++){var d=(S=e[h])._getNAFPoints(t);s[h]=d.wnd,c[h]=d.points}for(h=i-1;h>=1;h-=2){var f=h-1,p=h;if(1===s[f]&&1===s[p]){var m=[e[f],null,null,e[p]];0===e[f].y.cmp(e[p].y)?(m[1]=e[f].add(e[p]),m[2]=e[f].toJ().mixedAdd(e[p].neg())):0===e[f].y.cmp(e[p].y.redNeg())?(m[1]=e[f].toJ().mixedAdd(e[p]),m[2]=e[f].add(e[p].neg())):(m[1]=e[f].toJ().mixedAdd(e[p]),m[2]=e[f].toJ().mixedAdd(e[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],_=a(n[f],n[p]);u=Math.max(_[0].length,u),l[f]=new Array(u),l[p]=new Array(u);for(var v=0;v<u;v++){var b=0|_[0][v],y=0|_[1][v];l[f][v]=g[3*(b+1)+(y+1)],l[p][v]=0,c[f]=m}}else l[f]=o(n[f],s[f]),l[p]=o(n[p],s[p]),u=Math.max(l[f].length,u),u=Math.max(l[p].length,u)}var x=this.jpoint(null,null,null),w=this._wnafT4;for(h=u;h>=0;h--){for(var M=0;h>=0;){var E=!0;for(v=0;v<i;v++)w[v]=0|l[v][h],0!==w[v]&&(E=!1);if(!E)break;M++,h--}if(h>=0&&M++,x=x.dblp(M),h<0)break;for(v=0;v<i;v++){var S,A=w[v];0!==A&&(A>0?S=c[v][A-1>>1]:A<0&&(S=c[v][-A-1>>1].neg()),x="affine"===S.type?x.mixedAdd(S):x.add(S))}}for(h=0;h<i;h++)c[h]=null;return r?x:x.toP()},c.BasePoint=l,l.prototype.eq=function(){throw new Error("Not implemented")},l.prototype.validate=function(){return this.curve.validate(this)},c.prototype.decodePoint=function(t,e){t=r.toArray(t,e);var n=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*n)return 6===t[0]?s(t[t.length-1]%2==0):7===t[0]&&s(t[t.length-1]%2==1),this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));if((2===t[0]||3===t[0])&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),3===t[0]);throw new Error("Unknown point format")},l.prototype.encodeCompressed=function(t){return this.encode(t,!0)},l.prototype._encode=function(t){var e=this.curve.p.byteLength(),n=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",e))},l.prototype.encode=function(t,e){return r.encode(this._encode(e),t)},l.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},l.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},l.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,r=0;r<e;r+=t){for(var o=0;o<t;o++)i=i.dbl();n.push(i)}return{step:t,points:n}},l.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],n=(1<<t)-1,i=1===n?null:this.dbl(),r=1;r<n;r++)e[r]=e[r-1].add(i);return{wnd:t,points:e}},l.prototype._getBeta=function(){return null},l.prototype.dblp=function(t){for(var e=this,n=0;n<t;n++)e=e.dbl();return e}},function(t,e,n){"use strict";var i=n(57),r=n(20),o=n(11),a=n(4),s=i.base,c=r.utils.assert;function l(t){s.call(this,"short",t),this.a=new o(t.a,16).toRed(this.red),this.b=new o(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(t,e,n,i){s.BasePoint.call(this,t,"affine"),null===e&&null===n?(this.x=null,this.y=null,this.inf=!0):(this.x=new o(e,16),this.y=new o(n,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function h(t,e,n,i){s.BasePoint.call(this,t,"jacobian"),null===e&&null===n&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new o(0)):(this.x=new o(e,16),this.y=new o(n,16),this.z=new o(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(l,s),t.exports=l,l.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,n;if(t.beta)e=new o(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);e=(e=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(t.lambda)n=new o(t.lambda,16);else{var r=this._getEndoRoots(this.n);0===this.g.mul(r[0]).x.cmp(this.g.x.redMul(e))?n=r[0]:(n=r[1],c(0===this.g.mul(n).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:n,basis:t.basis?t.basis.map(function(t){return{a:new o(t.a,16),b:new o(t.b,16)}}):this._getEndoBasis(n)}}},l.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:o.mont(t),n=new o(2).toRed(e).redInvm(),i=n.redNeg(),r=new o(3).toRed(e).redNeg().redSqrt().redMul(n);return[i.redAdd(r).fromRed(),i.redSub(r).fromRed()]},l.prototype._getEndoBasis=function(t){for(var e,n,i,r,a,s,c,l,u,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=t,f=this.n.clone(),p=new o(1),m=new o(0),g=new o(0),_=new o(1),v=0;0!==d.cmpn(0);){var b=f.div(d);l=f.sub(b.mul(d)),u=g.sub(b.mul(p));var y=_.sub(b.mul(m));if(!i&&l.cmp(h)<0)e=c.neg(),n=p,i=l.neg(),r=u;else if(i&&2==++v)break;c=l,f=d,d=l,g=p,p=u,_=m,m=y}a=l.neg(),s=u;var x=i.sqr().add(r.sqr());return a.sqr().add(s.sqr()).cmp(x)>=0&&(a=e,s=n),i.negative&&(i=i.neg(),r=r.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:i,b:r},{a:a,b:s}]},l.prototype._endoSplit=function(t){var e=this.endo.basis,n=e[0],i=e[1],r=i.b.mul(t).divRound(this.n),o=n.b.neg().mul(t).divRound(this.n),a=r.mul(n.a),s=o.mul(i.a),c=r.mul(n.b),l=o.mul(i.b);return{k1:t.sub(a).sub(s),k2:c.add(l).neg()}},l.prototype.pointFromX=function(t,e){(t=new o(t,16)).red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(0!==i.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var r=i.fromRed().isOdd();return(e&&!r||!e&&r)&&(i=i.redNeg()),this.point(t,i)},l.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,n=t.y,i=this.a.redMul(e),r=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===n.redSqr().redISub(r).cmpn(0)},l.prototype._endoWnafMulAdd=function(t,e,n){for(var i=this._endoWnafT1,r=this._endoWnafT2,o=0;o<t.length;o++){var a=this._endoSplit(e[o]),s=t[o],c=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),c=c.neg(!0)),i[2*o]=s,i[2*o+1]=c,r[2*o]=a.k1,r[2*o+1]=a.k2}for(var l=this._wnafMulAdd(1,i,r,2*o,n),u=0;u<2*o;u++)i[u]=null,r[u]=null;return l},a(u,s.BasePoint),l.prototype.point=function(t,e,n){return new u(this,t,e,n)},l.prototype.pointFromJSON=function(t,e){return u.fromJSON(this,t,e)},u.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var n=this.curve,i=function(t){return n.point(t.x.redMul(n.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e}},u.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},u.fromJSON=function(t,e,n){"string"==typeof e&&(e=JSON.parse(e));var i=t.point(e[0],e[1],n);if(!e[2])return i;function r(e){return t.point(e[0],e[1],n)}var o=e[2];return i.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[i].concat(o.doubles.points.map(r))},naf:o.naf&&{wnd:o.naf.wnd,points:[i].concat(o.naf.points.map(r))}},i},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var n=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)},u.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,n=this.x.redSqr(),i=t.redInvm(),r=n.redAdd(n).redIAdd(n).redIAdd(e).redMul(i),o=r.redSqr().redISub(this.x.redAdd(this.x)),a=r.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(t){return t=new o(t,16),this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,n){var i=[this,e],r=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,r):this.curve._wnafMulAdd(1,i,r,2)},u.prototype.jmulAdd=function(t,e,n){var i=[this,e],r=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,r,!0):this.curve._wnafMulAdd(1,i,r,2,!0)},u.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},u.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var n=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return e},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(h,s.BasePoint),l.prototype.jpoint=function(t,e,n){return new h(this,t,e,n)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),n=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(n,i)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(e),r=t.x.redMul(n),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(n.redMul(this.z)),s=i.redSub(r),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=s.redSqr(),u=l.redMul(s),h=i.redMul(l),d=c.redSqr().redIAdd(u).redISub(h).redISub(h),f=c.redMul(h.redISub(d)).redISub(o.redMul(u)),p=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(d,f,p)},h.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),n=this.x,i=t.x.redMul(e),r=this.y,o=t.y.redMul(e).redMul(this.z),a=n.redSub(i),s=r.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),l=c.redMul(a),u=n.redMul(c),h=s.redSqr().redIAdd(l).redISub(u).redISub(u),d=s.redMul(u.redISub(h)).redISub(r.redMul(l)),f=this.z.redMul(a);return this.curve.jpoint(h,d,f)},h.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,n=0;n<t;n++)e=e.dbl();return e}var i=this.curve.a,r=this.curve.tinv,o=this.x,a=this.y,s=this.z,c=s.redSqr().redSqr(),l=a.redAdd(a);for(n=0;n<t;n++){var u=o.redSqr(),h=l.redSqr(),d=h.redSqr(),f=u.redAdd(u).redIAdd(u).redIAdd(i.redMul(c)),p=o.redMul(h),m=f.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),_=f.redMul(g);_=_.redIAdd(_).redISub(d);var v=l.redMul(s);n+1<t&&(c=c.redMul(d)),o=m,s=v,l=_}return this.curve.jpoint(o,l.redMul(r),s)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},h.prototype._zeroDbl=function(){var t,e,n;if(this.zOne){var i=this.x.redSqr(),r=this.y.redSqr(),o=r.redSqr(),a=this.x.redAdd(r).redSqr().redISub(i).redISub(o);a=a.redIAdd(a);var s=i.redAdd(i).redIAdd(i),c=s.redSqr().redISub(a).redISub(a),l=o.redIAdd(o);l=(l=l.redIAdd(l)).redIAdd(l),t=c,e=s.redMul(a.redISub(c)).redISub(l),n=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),h=this.y.redSqr(),d=h.redSqr(),f=this.x.redAdd(h).redSqr().redISub(u).redISub(d);f=f.redIAdd(f);var p=u.redAdd(u).redIAdd(u),m=p.redSqr(),g=d.redIAdd(d);g=(g=g.redIAdd(g)).redIAdd(g),t=m.redISub(f).redISub(f),e=p.redMul(f.redISub(t)).redISub(g),n=(n=this.y.redMul(this.z)).redIAdd(n)}return this.curve.jpoint(t,e,n)},h.prototype._threeDbl=function(){var t,e,n;if(this.zOne){var i=this.x.redSqr(),r=this.y.redSqr(),o=r.redSqr(),a=this.x.redAdd(r).redSqr().redISub(i).redISub(o);a=a.redIAdd(a);var s=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),c=s.redSqr().redISub(a).redISub(a);t=c;var l=o.redIAdd(o);l=(l=l.redIAdd(l)).redIAdd(l),e=s.redMul(a.redISub(c)).redISub(l),n=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),h=this.y.redSqr(),d=this.x.redMul(h),f=this.x.redSub(u).redMul(this.x.redAdd(u));f=f.redAdd(f).redIAdd(f);var p=d.redIAdd(d),m=(p=p.redIAdd(p)).redAdd(p);t=f.redSqr().redISub(m),n=this.y.redAdd(this.z).redSqr().redISub(h).redISub(u);var g=h.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),e=f.redMul(p.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,n)},h.prototype._dbl=function(){var t=this.curve.a,e=this.x,n=this.y,i=this.z,r=i.redSqr().redSqr(),o=e.redSqr(),a=n.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(r)),c=e.redAdd(e),l=(c=c.redIAdd(c)).redMul(a),u=s.redSqr().redISub(l.redAdd(l)),h=l.redISub(u),d=a.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var f=s.redMul(h).redISub(d),p=n.redAdd(n).redMul(i);return this.curve.jpoint(u,f,p)},h.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),n=this.z.redSqr(),i=e.redSqr(),r=t.redAdd(t).redIAdd(t),o=r.redSqr(),a=this.x.redAdd(e).redSqr().redISub(t).redISub(i),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),c=i.redIAdd(i);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var l=r.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(c),u=e.redMul(l);u=(u=u.redIAdd(u)).redIAdd(u);var h=this.x.redMul(s).redISub(u);h=(h=h.redIAdd(h)).redIAdd(h);var d=this.y.redMul(l.redMul(c.redISub(l)).redISub(a.redMul(s)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var f=this.z.redAdd(a).redSqr().redISub(n).redISub(s);return this.curve.jpoint(h,d,f)},h.prototype.mul=function(t,e){return t=new o(t,e),this.curve._wnafMul(this,t)},h.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),n=t.z.redSqr();if(0!==this.x.redMul(n).redISub(t.x.redMul(e)).cmpn(0))return!1;var i=e.redMul(this.z),r=n.redMul(t.z);return 0===this.y.redMul(r).redISub(t.y.redMul(i)).cmpn(0)},h.prototype.eqXToP=function(t){var e=this.z.redSqr(),n=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(n))return!0;for(var i=t.clone(),r=this.curve.redN.redMul(e);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(r),0===this.x.cmp(n))return!0}},h.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(t,e,n){"use strict";var i=n(57),r=n(11),o=n(4),a=i.base,s=n(20).utils;function c(t){a.call(this,"mont",t),this.a=new r(t.a,16).toRed(this.red),this.b=new r(t.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function l(t,e,n){a.BasePoint.call(this,t,"projective"),null===e&&null===n?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new r(e,16),this.z=new r(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(c,a),t.exports=c,c.prototype.validate=function(t){var e=t.normalize().x,n=e.redSqr(),i=n.redMul(e).redAdd(n.redMul(this.a)).redAdd(e);return 0===i.redSqrt().redSqr().cmp(i)},o(l,a.BasePoint),c.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},c.prototype.point=function(t,e){return new l(this,t,e)},c.prototype.pointFromJSON=function(t){return l.fromJSON(this,t)},l.prototype.precompute=function(){},l.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},l.fromJSON=function(t,e){return new l(t,e[0],e[1]||t.one)},l.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},l.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),n=t.redSub(e),i=t.redMul(e),r=n.redMul(e.redAdd(this.curve.a24.redMul(n)));return this.curve.point(i,r)},l.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},l.prototype.diffAdd=function(t,e){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),r=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(n),a=r.redMul(i),s=e.z.redMul(o.redAdd(a).redSqr()),c=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,c)},l.prototype.mul=function(t){for(var e=t.clone(),n=this,i=this.curve.point(null,null),r=[];0!==e.cmpn(0);e.iushrn(1))r.push(e.andln(1));for(var o=r.length-1;o>=0;o--)0===r[o]?(n=n.diffAdd(i,this),i=i.dbl()):(i=n.diffAdd(i,this),n=n.dbl());return i},l.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},l.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},l.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},l.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(t,e,n){"use strict";var i=n(57),r=n(20),o=n(11),a=n(4),s=i.base,c=r.utils.assert;function l(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new o(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new o(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new o(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),c(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function u(t,e,n,i,r){s.BasePoint.call(this,t,"projective"),null===e&&null===n&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new o(e,16),this.y=new o(n,16),this.z=i?new o(i,16):this.curve.one,this.t=r&&new o(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}a(l,s),t.exports=l,l.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},l.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},l.prototype.jpoint=function(t,e,n,i){return this.point(t,e,n,i)},l.prototype.pointFromX=function(t,e){(t=new o(t,16)).red||(t=t.toRed(this.red));var n=t.redSqr(),i=this.c2.redSub(this.a.redMul(n)),r=this.one.redSub(this.c2.redMul(this.d).redMul(n)),a=i.redMul(r.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var c=s.fromRed().isOdd();return(e&&!c||!e&&c)&&(s=s.redNeg()),this.point(t,s)},l.prototype.pointFromY=function(t,e){(t=new o(t,16)).red||(t=t.toRed(this.red));var n=t.redSqr(),i=n.redSub(this.c2),r=n.redMul(this.d).redMul(this.c2).redSub(this.a),a=i.redMul(r.redInvm());if(0===a.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==e&&(s=s.redNeg()),this.point(s,t)},l.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),n=t.y.redSqr(),i=e.redMul(this.a).redAdd(n),r=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(n)));return 0===i.cmp(r)},a(u,s.BasePoint),l.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},l.prototype.point=function(t,e,n,i){return new u(this,t,e,n,i)},u.fromJSON=function(t,e){return new u(t,e[0],e[1],e[2])},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(t),r=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=i.redAdd(e),a=o.redSub(n),s=i.redSub(e),c=r.redMul(a),l=o.redMul(s),u=r.redMul(s),h=a.redMul(o);return this.curve.point(c,l,h,u)},u.prototype._projDbl=function(){var t,e,n,i=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(l=this.curve._mulA(r)).redAdd(o);if(this.zOne)t=i.redSub(r).redSub(o).redMul(a.redSub(this.curve.two)),e=a.redMul(l.redSub(o)),n=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),c=a.redSub(s).redISub(s);t=i.redSub(r).redISub(o).redMul(c),e=a.redMul(l.redSub(o)),n=a.redMul(c)}}else{var l=r.redAdd(o);s=this.curve._mulC(this.z).redSqr(),c=l.redSub(s).redSub(s);t=this.curve._mulC(i.redISub(l)).redMul(c),e=this.curve._mulC(l).redMul(r.redISub(o)),n=l.redMul(c)}return this.curve.point(t,e,n)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),n=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),r=this.z.redMul(t.z.redAdd(t.z)),o=n.redSub(e),a=r.redSub(i),s=r.redAdd(i),c=n.redAdd(e),l=o.redMul(a),u=s.redMul(c),h=o.redMul(c),d=a.redMul(s);return this.curve.point(l,u,d,h)},u.prototype._projAdd=function(t){var e,n,i=this.z.redMul(t.z),r=i.redSqr(),o=this.x.redMul(t.x),a=this.y.redMul(t.y),s=this.curve.d.redMul(o).redMul(a),c=r.redSub(s),l=r.redAdd(s),u=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(a),h=i.redMul(c).redMul(u);return this.curve.twisted?(e=i.redMul(l).redMul(a.redSub(this.curve._mulA(o))),n=c.redMul(l)):(e=i.redMul(l).redMul(a.redSub(o)),n=this.curve._mulC(c).redMul(l)),this.curve.point(h,e,n)},u.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},u.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,n){return this.curve._wnafMulAdd(1,[this,e],[t,n],2,!1)},u.prototype.jmulAdd=function(t,e,n){return this.curve._wnafMulAdd(1,[this,e],[t,n],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},u.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(i),0===this.x.cmp(e))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},function(t,e,n){"use strict";var i,r=e,o=n(80),a=n(20),s=a.utils.assert;function c(t){"short"===t.type?this.curve=new a.curve.short(t):"edwards"===t.type?this.curve=new a.curve.edwards(t):this.curve=new a.curve.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function l(t,e){Object.defineProperty(r,t,{configurable:!0,enumerable:!0,get:function(){var n=new c(e);return Object.defineProperty(r,t,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=c,l("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),l("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),l("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),l("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),l("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),l("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),l("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=n(237)}catch(t){i=void 0}l("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},function(t,e,n){"use strict";e.sha1=n(232),e.sha224=n(233),e.sha256=n(119),e.sha384=n(234),e.sha512=n(120)},function(t,e,n){"use strict";var i=n(30),r=n(46),o=n(118),a=i.rotl32,s=i.sum32,c=i.sum32_5,l=o.ft_1,u=r.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i.inherits(d,u),t.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(t,e){for(var n=this.W,i=0;i<16;i++)n[i]=t[e+i];for(;i<n.length;i++)n[i]=a(n[i-3]^n[i-8]^n[i-14]^n[i-16],1);var r=this.h[0],o=this.h[1],u=this.h[2],d=this.h[3],f=this.h[4];for(i=0;i<n.length;i++){var p=~~(i/20),m=c(a(r,5),l(p,o,u,d),f,n[i],h[p]);f=d,d=u,u=a(o,30),o=r,r=m}this.h[0]=s(this.h[0],r),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],u),this.h[3]=s(this.h[3],d),this.h[4]=s(this.h[4],f)},d.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},function(t,e,n){"use strict";var i=n(30),r=n(119);function o(){if(!(this instanceof o))return new o;r.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i.inherits(o,r),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}},function(t,e,n){"use strict";var i=n(30),r=n(120);function o(){if(!(this instanceof o))return new o;r.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i.inherits(o,r),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}},function(t,e,n){"use strict";var i=n(30),r=n(46),o=i.rotl32,a=i.sum32,s=i.sum32_3,c=i.sum32_4,l=r.BlockHash;function u(){if(!(this instanceof u))return new u;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function h(t,e,n,i){return t<=15?e^n^i:t<=31?e&n|~e&i:t<=47?(e|~n)^i:t<=63?e&i|n&~i:e^(n|~i)}function d(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function f(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}i.inherits(u,l),e.ripemd160=u,u.blockSize=512,u.outSize=160,u.hmacStrength=192,u.padLength=64,u.prototype._update=function(t,e){for(var n=this.h[0],i=this.h[1],r=this.h[2],l=this.h[3],u=this.h[4],v=n,b=i,y=r,x=l,w=u,M=0;M<80;M++){var E=a(o(c(n,h(M,i,r,l),t[p[M]+e],d(M)),g[M]),u);n=u,u=l,l=o(r,10),r=i,i=E,E=a(o(c(v,h(79-M,b,y,x),t[m[M]+e],f(M)),_[M]),w),v=w,w=x,x=o(y,10),y=b,b=E}E=s(this.h[1],r,x),this.h[1]=s(this.h[2],l,w),this.h[2]=s(this.h[3],u,v),this.h[3]=s(this.h[4],n,b),this.h[4]=s(this.h[0],i,y),this.h[0]=E},u.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"little"):i.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],m=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],_=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},function(t,e,n){"use strict";var i=n(30),r=n(22);function o(t,e,n){if(!(this instanceof o))return new o(t,e,n);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(e,n))}t.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),r(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},function(t,e){t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(t,e,n){"use strict";var i=n(11),r=n(239),o=n(20),a=o.utils.assert,s=n(240),c=n(241);function l(t){if(!(this instanceof l))return new l(t);"string"==typeof t&&(a(o.curves.hasOwnProperty(t),"Unknown curve "+t),t=o.curves[t]),t instanceof o.curves.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=l,l.prototype.keyPair=function(t){return new s(this,t)},l.prototype.keyFromPrivate=function(t,e){return s.fromPrivate(this,t,e)},l.prototype.keyFromPublic=function(t,e){return s.fromPublic(this,t,e)},l.prototype.genKeyPair=function(t){t||(t={});for(var e=new r({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||o.rand(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),a=this.n.sub(new i(2));;){var s=new i(e.generate(n));if(!(s.cmp(a)>0))return s.iaddn(1),this.keyFromPrivate(s)}},l.prototype._truncateToN=function(t,e){var n=8*t.byteLength()-this.n.bitLength();return n>0&&(t=t.ushrn(n)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},l.prototype.sign=function(t,e,n,o){"object"==typeof n&&(o=n,n=null),o||(o={}),e=this.keyFromPrivate(e,n),t=this._truncateToN(new i(t,16));for(var a=this.n.byteLength(),s=e.getPrivate().toArray("be",a),l=t.toArray("be",a),u=new r({hash:this.hash,entropy:s,nonce:l,pers:o.pers,persEnc:o.persEnc||"utf8"}),h=this.n.sub(new i(1)),d=0;;d++){var f=o.k?o.k(d):new i(u.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(h)>=0)){var p=this.g.mul(f);if(!p.isInfinity()){var m=p.getX(),g=m.umod(this.n);if(0!==g.cmpn(0)){var _=f.invm(this.n).mul(g.mul(e.getPrivate()).iadd(t));if(0!==(_=_.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==m.cmp(g)?2:0);return o.canonical&&_.cmp(this.nh)>0&&(_=this.n.sub(_),v^=1),new c({r:g,s:_,recoveryParam:v})}}}}}},l.prototype.verify=function(t,e,n,r){t=this._truncateToN(new i(t,16)),n=this.keyFromPublic(n,r);var o=(e=new c(e,"hex")).r,a=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,l=a.invm(this.n),u=l.mul(t).umod(this.n),h=l.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,n.getPublic(),h)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(u,n.getPublic(),h)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},l.prototype.recoverPubKey=function(t,e,n,r){a((3&n)===n,"The recovery param is more than two bits"),e=new c(e,r);var o=this.n,s=new i(t),l=e.r,u=e.s,h=1&n,d=n>>1;if(l.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");l=d?this.curve.pointFromX(l.add(this.curve.n),h):this.curve.pointFromX(l,h);var f=e.r.invm(o),p=o.sub(s).mul(f).umod(o),m=u.mul(f).umod(o);return this.g.mulAdd(p,l,m)},l.prototype.getKeyRecoveryParam=function(t,e,n,i){if(null!==(e=new c(e,i)).recoveryParam)return e.recoveryParam;for(var r=0;r<4;r++){var o;try{o=this.recoverPubKey(t,e,r)}catch(t){continue}if(o.eq(n))return r}throw new Error("Unable to find valid recovery factor")}},function(t,e,n){"use strict";var i=n(80),r=n(117),o=n(22);function a(t){if(!(this instanceof a))return new a(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=r.toArray(t.entropy,t.entropyEnc||"hex"),n=r.toArray(t.nonce,t.nonceEnc||"hex"),i=r.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,n,i)}t.exports=a,a.prototype._init=function(t,e,n){var i=t.concat(e).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var r=0;r<this.V.length;r++)this.K[r]=0,this.V[r]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},a.prototype._hmac=function(){return new i.hmac(this.hash,this.K)},a.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},a.prototype.reseed=function(t,e,n,i){"string"!=typeof e&&(i=n,n=e,e=null),t=r.toArray(t,e),n=r.toArray(n,i),o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1},a.prototype.generate=function(t,e,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(i=n,n=e,e=null),n&&(n=r.toArray(n,i||"hex"),this._update(n));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,t);return this._update(n),this._reseed++,r.encode(a,e)}},function(t,e,n){"use strict";var i=n(11),r=n(20).utils.assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=o,o.fromPublic=function(t,e,n){return e instanceof o?e:new o(t,{pub:e,pubEnc:n})},o.fromPrivate=function(t,e,n){return e instanceof o?e:new o(t,{priv:e,privEnc:n})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new i(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?r(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||r(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.mul(this.priv).getX()},o.prototype.sign=function(t,e,n){return this.ec.sign(t,this,e,n)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},function(t,e,n){"use strict";var i=n(11),r=n(20).utils,o=r.assert;function a(t,e){if(t instanceof a)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new i(t.r,16),this.s=new i(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function s(){this.place=0}function c(t,e){var n=t[e.place++];if(!(128&n))return n;for(var i=15&n,r=0,o=0,a=e.place;o<i;o++,a++)r<<=8,r|=t[a];return e.place=a,r}function l(t){for(var e=0,n=t.length-1;!t[e]&&!(128&t[e+1])&&e<n;)e++;return 0===e?t:t.slice(e)}function u(t,e){if(e<128)t.push(e);else{var n=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|n);--n;)t.push(e>>>(n<<3)&255);t.push(e)}}t.exports=a,a.prototype._importDER=function(t,e){t=r.toArray(t,e);var n=new s;if(48!==t[n.place++])return!1;if(c(t,n)+n.place!==t.length)return!1;if(2!==t[n.place++])return!1;var o=c(t,n),a=t.slice(n.place,o+n.place);if(n.place+=o,2!==t[n.place++])return!1;var l=c(t,n);if(t.length!==l+n.place)return!1;var u=t.slice(n.place,l+n.place);return 0===a[0]&&128&a[1]&&(a=a.slice(1)),0===u[0]&&128&u[1]&&(u=u.slice(1)),this.r=new i(a),this.s=new i(u),this.recoveryParam=null,!0},a.prototype.toDER=function(t){var e=this.r.toArray(),n=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&n[0]&&(n=[0].concat(n)),e=l(e),n=l(n);!(n[0]||128&n[1]);)n=n.slice(1);var i=[2];u(i,e.length),(i=i.concat(e)).push(2),u(i,n.length);var o=i.concat(n),a=[48];return u(a,o.length),a=a.concat(o),r.encode(a,t)}},function(t,e,n){"use strict";var i=n(80),r=n(20),o=r.utils,a=o.assert,s=o.parseBytes,c=n(243),l=n(244);function u(t){if(a("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof u))return new u(t);t=r.curves[t].curve;this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=i.sha512}t.exports=u,u.prototype.sign=function(t,e){t=s(t);var n=this.keyFromSecret(e),i=this.hashInt(n.messagePrefix(),t),r=this.g.mul(i),o=this.encodePoint(r),a=this.hashInt(o,n.pubBytes(),t).mul(n.priv()),c=i.add(a).umod(this.curve.n);return this.makeSignature({R:r,S:c,Rencoded:o})},u.prototype.verify=function(t,e,n){t=s(t),e=this.makeSignature(e);var i=this.keyFromPublic(n),r=this.hashInt(e.Rencoded(),i.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(i.pub().mul(r)).eq(o)},u.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return o.intFromLE(t.digest()).umod(this.curve.n)},u.prototype.keyFromPublic=function(t){return c.fromPublic(this,t)},u.prototype.keyFromSecret=function(t){return c.fromSecret(this,t)},u.prototype.makeSignature=function(t){return t instanceof l?t:new l(this,t)},u.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},u.prototype.decodePoint=function(t){var e=(t=o.parseBytes(t)).length-1,n=t.slice(0,e).concat(-129&t[e]),i=0!=(128&t[e]),r=o.intFromLE(n);return this.curve.pointFromY(r,i)},u.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},u.prototype.decodeInt=function(t){return o.intFromLE(t)},u.prototype.isPoint=function(t){return t instanceof this.pointClass}},function(t,e,n){"use strict";var i=n(20).utils,r=i.assert,o=i.parseBytes,a=i.cachedProperty;function s(t,e){this.eddsa=t,this._secret=o(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=o(e.pub)}s.fromPublic=function(t,e){return e instanceof s?e:new s(t,{pub:e})},s.fromSecret=function(t,e){return e instanceof s?e:new s(t,{secret:e})},s.prototype.secret=function(){return this._secret},a(s,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),a(s,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),a(s,"privBytes",function(){var t=this.eddsa,e=this.hash(),n=t.encodingLength-1,i=e.slice(0,t.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i}),a(s,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),a(s,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),a(s,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),s.prototype.sign=function(t){return r(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},s.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},s.prototype.getSecret=function(t){return r(this._secret,"KeyPair is public only"),i.encode(this.secret(),t)},s.prototype.getPublic=function(t){return i.encode(this.pubBytes(),t)},t.exports=s},function(t,e,n){"use strict";var i=n(11),r=n(20).utils,o=r.assert,a=r.cachedProperty,s=r.parseBytes;function c(t,e){this.eddsa=t,"object"!=typeof e&&(e=s(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),o(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof i&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}a(c,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),a(c,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),a(c,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),a(c,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return r.encode(this.toBytes(),"hex").toUpperCase()},t.exports=c},function(t,e,n){"use strict";var i=n(47);e.certificate=n(255);var r=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});e.RSAPrivateKey=r;var o=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});e.RSAPublicKey=o;var a=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});e.PublicKey=a;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),c=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});e.PrivateKey=c;var l=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});e.EncryptedPrivateKey=l;var u=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});e.DSAPrivateKey=u,e.DSAparam=i.define("DSAparam",function(){this.int()});var h=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(d),this.key("publicKey").optional().explicit(1).bitstr())});e.ECPrivateKey=h;var d=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});e.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},function(t,e,n){var i=n(47),r=n(4);function o(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}e.define=function(t,e){return new o(t,e)},o.prototype._createNamed=function(t){var e;try{e=n(247).runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(t){e=function(t){this._initNamed(t)}}return r(e,t),e.prototype._initNamed=function(e){t.call(this,e)},new e(this)},o.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(i.decoders[t])),this.decoders[t]},o.prototype.decode=function(t,e,n){return this._getDecoder(e).decode(t,n)},o.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(i.encoders[t])),this.encoders[t]},o.prototype.encode=function(t,e,n){return this._getEncoder(e).encode(t,n)}},function(module,exports){var indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;n<t.length;n++)if(t[n]===e)return n;return-1},Object_keys=function(t){if(Object.keys)return Object.keys(t);var e=[];for(var n in t)e.push(n);return e},forEach=function(t,e){if(t.forEach)return t.forEach(e);for(var n=0;n<t.length;n++)e(t[n],n,t)},defineProp=function(){try{return Object.defineProperty({},"_",{}),function(t,e,n){Object.defineProperty(t,e,{writable:!0,enumerable:!1,configurable:!0,value:n})}}catch(t){return function(t,e,n){t[e]=n}}}(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports.Script=function(t){if(!(this instanceof Script))return new Script(t);this.code=t};Script.prototype.runInContext=function(t){if(!(t instanceof Context))throw new TypeError("needs a 'context' argument.");var e=document.createElement("iframe");e.style||(e.style={}),e.style.display="none",document.body.appendChild(e);var n=e.contentWindow,i=n.eval,r=n.execScript;!i&&r&&(r.call(n,"null"),i=n.eval),forEach(Object_keys(t),function(e){n[e]=t[e]}),forEach(globals,function(e){t[e]&&(n[e]=t[e])});var o=Object_keys(n),a=i.call(n,this.code);return forEach(Object_keys(n),function(e){(e in t||-1===indexOf(o,e))&&(t[e]=n[e])}),forEach(globals,function(e){e in t||defineProp(t,e,n[e])}),document.body.removeChild(e),a},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(t){var e=Script.createContext(t),n=this.runInContext(e);return t&&forEach(Object_keys(e),function(n){t[n]=e[n]}),n},forEach(Object_keys(Script.prototype),function(t){exports[t]=Script[t]=function(e){var n=Script(e);return n[t].apply(n,[].slice.call(arguments,1))}}),exports.isContext=function(t){return t instanceof Context},exports.createScript=function(t){return exports.Script(t)},exports.createContext=Script.createContext=function(t){var e=new Context;return"object"==typeof t&&forEach(Object_keys(t),function(n){e[n]=t[n]}),e}},function(t,e,n){var i=n(4);function r(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function o(t,e){this.path=t,this.rethrow(e)}e.Reporter=r,r.prototype.isError=function(t){return t instanceof o},r.prototype.save=function(){var t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},r.prototype.restore=function(t){var e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},r.prototype.enterKey=function(t){return this._reporterState.path.push(t)},r.prototype.exitKey=function(t){var e=this._reporterState;e.path=e.path.slice(0,t-1)},r.prototype.leaveKey=function(t,e,n){var i=this._reporterState;this.exitKey(t),null!==i.obj&&(i.obj[e]=n)},r.prototype.path=function(){return this._reporterState.path.join("/")},r.prototype.enterObject=function(){var t=this._reporterState,e=t.obj;return t.obj={},e},r.prototype.leaveObject=function(t){var e=this._reporterState,n=e.obj;return e.obj=t,n},r.prototype.error=function(t){var e,n=this._reporterState,i=t instanceof o;if(e=i?t:new o(n.path.map(function(t){return"["+JSON.stringify(t)+"]"}).join(""),t.message||t,t.stack),!n.options.partial)throw e;return i||n.errors.push(e),e},r.prototype.wrapResult=function(t){var e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},i(o,Error),o.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},function(t,e,n){var i=n(48).Reporter,r=n(48).EncoderBuffer,o=n(48).DecoderBuffer,a=n(22),s=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],c=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);function l(t,e){var n={};this._baseState=n,n.enc=t,n.parent=e||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}t.exports=l;var u=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];l.prototype.clone=function(){var t=this._baseState,e={};u.forEach(function(n){e[n]=t[n]});var n=new this.constructor(e.parent);return n._baseState=e,n},l.prototype._wrap=function(){var t=this._baseState;c.forEach(function(e){this[e]=function(){var n=new this.constructor(this);return t.children.push(n),n[e].apply(n,arguments)}},this)},l.prototype._init=function(t){var e=this._baseState;a(null===e.parent),t.call(this),e.children=e.children.filter(function(t){return t._baseState.parent===this},this),a.equal(e.children.length,1,"Root node can have only one child")},l.prototype._useArgs=function(t){var e=this._baseState,n=t.filter(function(t){return t instanceof this.constructor},this);t=t.filter(function(t){return!(t instanceof this.constructor)},this),0!==n.length&&(a(null===e.children),e.children=n,n.forEach(function(t){t._baseState.parent=this},this)),0!==t.length&&(a(null===e.args),e.args=t,e.reverseArgs=t.map(function(t){if("object"!=typeof t||t.constructor!==Object)return t;var e={};return Object.keys(t).forEach(function(n){n==(0|n)&&(n|=0);var i=t[n];e[i]=n}),e}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(t){l.prototype[t]=function(){var e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}}),s.forEach(function(t){l.prototype[t]=function(){var e=this._baseState,n=Array.prototype.slice.call(arguments);return a(null===e.tag),e.tag=t,this._useArgs(n),this}}),l.prototype.use=function(t){a(t);var e=this._baseState;return a(null===e.use),e.use=t,this},l.prototype.optional=function(){return this._baseState.optional=!0,this},l.prototype.def=function(t){var e=this._baseState;return a(null===e.default),e.default=t,e.optional=!0,this},l.prototype.explicit=function(t){var e=this._baseState;return a(null===e.explicit&&null===e.implicit),e.explicit=t,this},l.prototype.implicit=function(t){var e=this._baseState;return a(null===e.explicit&&null===e.implicit),e.implicit=t,this},l.prototype.obj=function(){var t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},l.prototype.key=function(t){var e=this._baseState;return a(null===e.key),e.key=t,this},l.prototype.any=function(){return this._baseState.any=!0,this},l.prototype.choice=function(t){var e=this._baseState;return a(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map(function(e){return t[e]})),this},l.prototype.contains=function(t){var e=this._baseState;return a(null===e.use),e.contains=t,this},l.prototype._decode=function(t,e){var n=this._baseState;if(null===n.parent)return t.wrapResult(n.children[0]._decode(t,e));var i,r=n.default,a=!0,s=null;if(null!==n.key&&(s=t.enterKey(n.key)),n.optional){var c=null;if(null!==n.explicit?c=n.explicit:null!==n.implicit?c=n.implicit:null!==n.tag&&(c=n.tag),null!==c||n.any){if(a=this._peekTag(t,c,n.any),t.isError(a))return a}else{var l=t.save();try{null===n.choice?this._decodeGeneric(n.tag,t,e):this._decodeChoice(t,e),a=!0}catch(t){a=!1}t.restore(l)}}if(n.obj&&a&&(i=t.enterObject()),a){if(null!==n.explicit){var u=this._decodeTag(t,n.explicit);if(t.isError(u))return u;t=u}var h=t.offset;if(null===n.use&&null===n.choice){if(n.any)l=t.save();var d=this._decodeTag(t,null!==n.implicit?n.implicit:n.tag,n.any);if(t.isError(d))return d;n.any?r=t.raw(l):t=d}if(e&&e.track&&null!==n.tag&&e.track(t.path(),h,t.length,"tagged"),e&&e.track&&null!==n.tag&&e.track(t.path(),t.offset,t.length,"content"),r=n.any?r:null===n.choice?this._decodeGeneric(n.tag,t,e):this._decodeChoice(t,e),t.isError(r))return r;if(n.any||null!==n.choice||null===n.children||n.children.forEach(function(n){n._decode(t,e)}),n.contains&&("octstr"===n.tag||"bitstr"===n.tag)){var f=new o(r);r=this._getUse(n.contains,t._reporterState.obj)._decode(f,e)}}return n.obj&&a&&(r=t.leaveObject(i)),null===n.key||null===r&&!0!==a?null!==s&&t.exitKey(s):t.leaveKey(s,n.key,r),r},l.prototype._decodeGeneric=function(t,e,n){var i=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,i.args[0],n):/str$/.test(t)?this._decodeStr(e,t,n):"objid"===t&&i.args?this._decodeObjid(e,i.args[0],i.args[1],n):"objid"===t?this._decodeObjid(e,null,null,n):"gentime"===t||"utctime"===t?this._decodeTime(e,t,n):"null_"===t?this._decodeNull(e,n):"bool"===t?this._decodeBool(e,n):"objDesc"===t?this._decodeStr(e,t,n):"int"===t||"enum"===t?this._decodeInt(e,i.args&&i.args[0],n):null!==i.use?this._getUse(i.use,e._reporterState.obj)._decode(e,n):e.error("unknown tag: "+t)},l.prototype._getUse=function(t,e){var n=this._baseState;return n.useDecoder=this._use(t,e),a(null===n.useDecoder._baseState.parent),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder},l.prototype._decodeChoice=function(t,e){var n=this._baseState,i=null,r=!1;return Object.keys(n.choice).some(function(o){var a=t.save(),s=n.choice[o];try{var c=s._decode(t,e);if(t.isError(c))return!1;i={type:o,value:c},r=!0}catch(e){return t.restore(a),!1}return!0},this),r?i:t.error("Choice not matched")},l.prototype._createEncoderBuffer=function(t){return new r(t,this.reporter)},l.prototype._encode=function(t,e,n){var i=this._baseState;if(null===i.default||i.default!==t){var r=this._encodeValue(t,e,n);if(void 0!==r&&!this._skipDefault(r,e,n))return r}},l.prototype._encodeValue=function(t,e,n){var r=this._baseState;if(null===r.parent)return r.children[0]._encode(t,e||new i);var o=null;if(this.reporter=e,r.optional&&void 0===t){if(null===r.default)return;t=r.default}var a=null,s=!1;if(r.any)o=this._createEncoderBuffer(t);else if(r.choice)o=this._encodeChoice(t,e);else if(r.contains)a=this._getUse(r.contains,n)._encode(t,e),s=!0;else if(r.children)a=r.children.map(function(n){if("null_"===n._baseState.tag)return n._encode(null,e,t);if(null===n._baseState.key)return e.error("Child should have a key");var i=e.enterKey(n._baseState.key);if("object"!=typeof t)return e.error("Child expected, but input is not object");var r=n._encode(t[n._baseState.key],e,t);return e.leaveKey(i),r},this).filter(function(t){return t}),a=this._createEncoderBuffer(a);else if("seqof"===r.tag||"setof"===r.tag){if(!r.args||1!==r.args.length)return e.error("Too many args for : "+r.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");var c=this.clone();c._baseState.implicit=null,a=this._createEncoderBuffer(t.map(function(n){var i=this._baseState;return this._getUse(i.args[0],t)._encode(n,e)},c))}else null!==r.use?o=this._getUse(r.use,n)._encode(t,e):(a=this._encodePrimitive(r.tag,t),s=!0);if(!r.any&&null===r.choice){var l=null!==r.implicit?r.implicit:r.tag,u=null===r.implicit?"universal":"context";null===l?null===r.use&&e.error("Tag could be omitted only for .use()"):null===r.use&&(o=this._encodeComposite(l,s,u,a))}return null!==r.explicit&&(o=this._encodeComposite(r.explicit,!1,"context",o)),o},l.prototype._encodeChoice=function(t,e){var n=this._baseState,i=n.choice[t.type];return i||a(!1,t.type+" not found in "+JSON.stringify(Object.keys(n.choice))),i._encode(t.value,e)},l.prototype._encodePrimitive=function(t,e){var n=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&n.args)return this._encodeObjid(e,n.reverseArgs[0],n.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,n.args&&n.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},l.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},l.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(t)}},function(t,e,n){var i=n(122);e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=i._reverse(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=i._reverse(e.tag)},function(t,e,n){var i=e;i.der=n(123),i.pem=n(252)},function(t,e,n){var i=n(4),r=n(15).Buffer,o=n(123);function a(t){o.call(this,t),this.enc="pem"}i(a,o),t.exports=a,a.prototype.decode=function(t,e){for(var n=t.toString().split(/[\r\n]+/g),i=e.label.toUpperCase(),a=/^-----(BEGIN|END) ([^-]+)-----$/,s=-1,c=-1,l=0;l<n.length;l++){var u=n[l].match(a);if(null!==u&&u[2]===i){if(-1!==s){if("END"!==u[1])break;c=l;break}if("BEGIN"!==u[1])break;s=l}}if(-1===s||-1===c)throw new Error("PEM section not found for: "+i);var h=n.slice(s+1,c).join("");h.replace(/[^a-z0-9\+\/=]+/gi,"");var d=new r(h,"base64");return o.prototype.decode.call(this,d,e)}},function(t,e,n){var i=e;i.der=n(124),i.pem=n(254)},function(t,e,n){var i=n(4),r=n(124);function o(t){r.call(this,t),this.enc="pem"}i(o,r),t.exports=o,o.prototype.encode=function(t,e){for(var n=r.prototype.encode.call(this,t).toString("base64"),i=["-----BEGIN "+e.label+"-----"],o=0;o<n.length;o+=64)i.push(n.slice(o,o+64));return i.push("-----END "+e.label+"-----"),i.join("\n")}},function(t,e,n){"use strict";var i=n(47),r=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),o=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),a=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}),c=i.define("RelativeDistinguishedName",function(){this.setof(o)}),l=i.define("RDNSequence",function(){this.seqof(c)}),u=i.define("Name",function(){this.choice({rdnSequence:this.use(l)})}),h=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(r),this.key("notAfter").use(r))}),d=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),f=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(u),this.key("validity").use(h),this.key("subject").use(u),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(d).optional())}),p=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(f),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())});t.exports=p},function(t){t.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')},function(t,e,n){var i=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,r=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,a=n(56),s=n(77),c=n(5).Buffer;t.exports=function(t,e){var n,l=t.toString(),u=l.match(i);if(u){var h="aes"+u[1],d=c.from(u[2],"hex"),f=c.from(u[3].replace(/[\r\n]/g,""),"base64"),p=a(e,d.slice(0,8),parseInt(u[1],10)).key,m=[],g=s.createDecipheriv(h,p,d);m.push(g.update(f)),m.push(g.final()),n=c.concat(m)}else{var _=l.match(o);n=new c(_[2].replace(/[\r\n]/g,""),"base64")}return{tag:l.match(r)[1],data:n}}},function(t,e,n){(function(e){var i=n(11),r=n(20).ec,o=n(58),a=n(125);function s(t,e){if(t.cmpn(0)<=0)throw new Error("invalid sig");if(t.cmp(e)>=e)throw new Error("invalid sig")}t.exports=function(t,n,c,l,u){var h=o(c);if("ec"===h.type){if("ecdsa"!==l&&"ecdsa/rsa"!==l)throw new Error("wrong public key type");return function(t,e,n){var i=a[n.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+n.data.algorithm.curve.join("."));var o=new r(i),s=n.data.subjectPrivateKey.data;return o.verify(e,t,s)}(t,n,h)}if("dsa"===h.type){if("dsa"!==l)throw new Error("wrong public key type");return function(t,e,n){var r=n.data.p,a=n.data.q,c=n.data.g,l=n.data.pub_key,u=o.signature.decode(t,"der"),h=u.s,d=u.r;s(h,a),s(d,a);var f=i.mont(r),p=h.invm(a);return 0===c.toRed(f).redPow(new i(e).mul(p).mod(a)).fromRed().mul(l.toRed(f).redPow(d.mul(p).mod(a)).fromRed()).mod(r).mod(a).cmp(d)}(t,n,h)}if("rsa"!==l&&"ecdsa/rsa"!==l)throw new Error("wrong public key type");n=e.concat([u,n]);for(var d=h.modulus.byteLength(),f=[1],p=0;n.length+f.length+2<d;)f.push(255),p++;f.push(0);for(var m=-1;++m<n.length;)f.push(n[m]);f=new e(f);var g=i.mont(h.modulus);t=(t=new i(t).toRed(g)).redPow(new i(h.publicExponent)),t=new e(t.fromRed().toArray());var _=p<8?1:0;for(d=Math.min(t.length,f.length),t.length!==f.length&&(_=1),m=-1;++m<d;)_|=t[m]^f[m];return 0===_}}).call(this,n(15).Buffer)},function(t,e,n){(function(e){var i=n(20),r=n(11);t.exports=function(t){return new a(t)};var o={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function a(t){this.curveType=o[t],this.curveType||(this.curveType={name:t}),this.curve=new i.ec(this.curveType.name),this.keys=void 0}function s(t,n,i){Array.isArray(t)||(t=t.toArray());var r=new e(t);if(i&&r.length<i){var o=new e(i-r.length);o.fill(0),r=e.concat([o,r])}return n?r.toString(n):r}o.p224=o.secp224r1,o.p256=o.secp256r1=o.prime256v1,o.p192=o.secp192r1=o.prime192v1,o.p384=o.secp384r1,o.p521=o.secp521r1,a.prototype.generateKeys=function(t,e){return this.keys=this.curve.genKeyPair(),this.getPublicKey(t,e)},a.prototype.computeSecret=function(t,n,i){return n=n||"utf8",e.isBuffer(t)||(t=new e(t,n)),s(this.curve.keyFromPublic(t).getPublic().mul(this.keys.getPrivate()).getX(),i,this.curveType.byteLength)},a.prototype.getPublicKey=function(t,e){var n=this.keys.getPublic("compressed"===e,!0);return"hybrid"===e&&(n[n.length-1]%2?n[0]=7:n[0]=6),s(n,t)},a.prototype.getPrivateKey=function(t){return s(this.keys.getPrivate(),t)},a.prototype.setPublicKey=function(t,n){return n=n||"utf8",e.isBuffer(t)||(t=new e(t,n)),this.keys._importPublic(t),this},a.prototype.setPrivateKey=function(t,n){n=n||"utf8",e.isBuffer(t)||(t=new e(t,n));var i=new r(t);return i=i.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(i),this}}).call(this,n(15).Buffer)},function(t,e,n){e.publicEncrypt=n(261),e.privateDecrypt=n(262),e.privateEncrypt=function(t,n){return e.publicEncrypt(t,n,!0)},e.publicDecrypt=function(t,n){return e.privateDecrypt(t,n,!0)}},function(t,e,n){var i=n(58),r=n(38),o=n(43),a=n(126),s=n(127),c=n(11),l=n(128),u=n(79),h=n(5).Buffer;t.exports=function(t,e,n){var d;d=t.padding?t.padding:n?1:4;var f,p=i(t);if(4===d)f=function(t,e){var n=t.modulus.byteLength(),i=e.length,l=o("sha1").update(h.alloc(0)).digest(),u=l.length,d=2*u;if(i>n-d-2)throw new Error("message too long");var f=h.alloc(n-i-d-2),p=n-u-1,m=r(u),g=s(h.concat([l,f,h.alloc(1,1),e],p),a(m,p)),_=s(m,a(g,u));return new c(h.concat([h.alloc(1),_,g],n))}(p,e);else if(1===d)f=function(t,e,n){var i,o=e.length,a=t.modulus.byteLength();if(o>a-11)throw new Error("message too long");i=n?h.alloc(a-o-3,255):function(t){var e,n=h.allocUnsafe(t),i=0,o=r(2*t),a=0;for(;i<t;)a===o.length&&(o=r(2*t),a=0),(e=o[a++])&&(n[i++]=e);return n}(a-o-3);return new c(h.concat([h.from([0,n?1:2]),i,h.alloc(1),e],a))}(p,e,n);else{if(3!==d)throw new Error("unknown padding");if((f=new c(e)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return n?u(f,p):l(f,p)}},function(t,e,n){var i=n(58),r=n(126),o=n(127),a=n(11),s=n(79),c=n(43),l=n(128),u=n(5).Buffer;t.exports=function(t,e,n){var h;h=t.padding?t.padding:n?1:4;var d,f=i(t),p=f.modulus.byteLength();if(e.length>p||new a(e).cmp(f.modulus)>=0)throw new Error("decryption error");d=n?l(new a(e),f):s(e,f);var m=u.alloc(p-d.length);if(d=u.concat([m,d],p),4===h)return function(t,e){var n=t.modulus.byteLength(),i=c("sha1").update(u.alloc(0)).digest(),a=i.length;if(0!==e[0])throw new Error("decryption error");var s=e.slice(1,a+1),l=e.slice(a+1),h=o(s,r(l,a)),d=o(l,r(h,n-a-1));if(function(t,e){t=u.from(t),e=u.from(e);var n=0,i=t.length;t.length!==e.length&&(n++,i=Math.min(t.length,e.length));var r=-1;for(;++r<i;)n+=t[r]^e[r];return n}(i,d.slice(0,a)))throw new Error("decryption error");var f=a;for(;0===d[f];)f++;if(1!==d[f++])throw new Error("decryption error");return d.slice(f)}(f,d);if(1===h)return function(t,e,n){var i=e.slice(0,2),r=2,o=0;for(;0!==e[r++];)if(r>=e.length){o++;break}var a=e.slice(2,r-1);("0002"!==i.toString("hex")&&!n||"0001"!==i.toString("hex")&&n)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return e.slice(r)}(0,d,n);if(3===h)return d;throw new Error("unknown padding")}},function(t,e,n){"use strict";(function(t,i){function r(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=n(5),a=n(38),s=o.Buffer,c=o.kMaxLength,l=t.crypto||t.msCrypto,u=Math.pow(2,32)-1;function h(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>u||t<0)throw new TypeError("offset must be a uint32");if(t>c||t>e)throw new RangeError("offset out of range")}function d(t,e,n){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>u||t<0)throw new TypeError("size must be a uint32");if(t+e>n||t>c)throw new RangeError("buffer too small")}function f(t,e,n,r){if(i.browser){var o=t.buffer,s=new Uint8Array(o,e,n);return l.getRandomValues(s),r?void i.nextTick(function(){r(null,t)}):t}if(!r)return a(n).copy(t,e),t;a(n,function(n,i){if(n)return r(n);i.copy(t,e),r(null,t)})}l&&l.getRandomValues||!i.browser?(e.randomFill=function(e,n,i,r){if(!(s.isBuffer(e)||e instanceof t.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof n)r=n,n=0,i=e.length;else if("function"==typeof i)r=i,i=e.length-n;else if("function"!=typeof r)throw new TypeError('"cb" argument must be a function');return h(n,e.length),d(i,n,e.length),f(e,n,i,r)},e.randomFillSync=function(e,n,i){void 0===n&&(n=0);if(!(s.isBuffer(e)||e instanceof t.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');h(n,e.length),void 0===i&&(i=e.length-n);return d(i,n,e.length),f(e,n,i)}):(e.randomFill=r,e.randomFillSync=r)}).call(this,n(25),n(33))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){this.name=t,this._tokenStructuralPropertyT=null};e.Token=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(93);!function(t){t.uuid4=function(){for(var t=new Uint8Array(16),e=new Array(256),n=0;n<16;++n)e[n]="0"+n.toString(16);for(n=16;n<256;++n)e[n]=n.toString(16);return function(){return i.Random.getRandomValues(t),t[6]=64|15&t[6],t[8]=128|63&t[8],e[t[0]]+e[t[1]]+e[t[2]]+e[t[3]]+"-"+e[t[4]]+e[t[5]]+"-"+e[t[6]]+e[t[7]]+"-"+e[t[8]]+e[t[9]]+"-"+e[t[10]]+e[t[11]]+e[t[12]]+e[t[13]]+e[t[14]]+e[t[15]]}}()}(e.UUID||(e.UUID={}))},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var r,o=n(9),a=n(81),s=n(16),c=n(130),l=function(){function t(t){this._idTick=0,this._items=[],this.menu=new c.Menu(t)}return t.prototype.addItem=function(t){var e=this,n=r.createItem(t,this._idTick++);return this._items.push(n),new a.DisposableDelegate(function(){o.ArrayExt.removeFirstOf(e._items,n)})},t.prototype.open=function(t){var e=this;if(this.menu.clearItems(),0===this._items.length)return!1;var n=r.matchItems(this._items,t);return!(!n||0===n.length)&&(o.each(n,function(t){e.menu.addItem(t)}),this.menu.open(t.clientX,t.clientY),!0)},t}();e.ContextMenu=l,function(t){function e(t,e){var n=s.Selector.calculateSpecificity(t.selector),i=s.Selector.calculateSpecificity(e.selector);if(n!==i)return i-n;var r=t.rank,o=e.rank;return r!==o?r<o?-1:1:t.id-e.id}t.createItem=function(t,e){var n=function(t){if(-1!==t.indexOf(","))throw new Error("Selector cannot contain commas: "+t);if(!s.Selector.isValid(t))throw new Error("Invalid selector: "+t);return t}(t.selector),r=void 0!==t.rank?t.rank:1/0;return i({},t,{selector:n,rank:r,id:e})},t.matchItems=function(t,n){var i=n.target;if(!i)return null;var r=n.currentTarget;if(!r)return null;if(!(r.contains(i)||(i=document.elementFromPoint(n.clientX,n.clientY))&&r.contains(i)))return null;for(var o=[],a=t.slice();null!==i;){for(var c=[],l=0,u=a.length;l<u;++l){var h=a[l];h&&s.Selector.matches(i,h.selector)&&(c.push(h),a[l]=null)}if(0!==c.length&&(c.sort(e),o.push.apply(o,c)),i===r)break;i=i.parentElement}return o}}(r||(r={}))},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o,a=n(9),s=n(53),c=n(16),l=n(60),u=n(14),h=n(37),d=n(21),f=n(131),p=n(83),m=n(13),g=function(t){function e(n){void 0===n&&(n={});var i=t.call(this)||this;i._drag=null,i._pressData=null,i._layoutModified=new d.Signal(i),i.addClass("p-DockPanel"),i._mode=n.mode||"multiple-document",i._renderer=n.renderer||e.defaultRenderer,i._edges=n.edges||o.DEFAULT_EDGES,i.dataset.mode=i._mode;var r={createTabBar:function(){return i._createTabBar()},createHandle:function(){return i._createHandle()}};return i.layout=new f.DockLayout({renderer:r,spacing:n.spacing}),i.overlay=n.overlay||new e.Overlay,i.node.appendChild(i.overlay.node),i}return r(e,t),e.prototype.dispose=function(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"layoutModified",{get:function(){return this._layoutModified},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(t){this.layout.spacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mode",{get:function(){return this._mode},set:function(t){if(this._mode!==t){this._mode=t,this.dataset.mode=t;var e=this.layout;switch(t){case"multiple-document":a.each(e.tabBars(),function(t){t.show()});break;case"single-document":e.restoreLayout(o.createSingleDocumentConfig(this));break;default:throw"unreachable"}u.MessageLoop.postMessage(this,o.LayoutModified)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.layout.isEmpty},enumerable:!0,configurable:!0}),e.prototype.widgets=function(){return this.layout.widgets()},e.prototype.selectedWidgets=function(){return this.layout.selectedWidgets()},e.prototype.tabBars=function(){return this.layout.tabBars()},e.prototype.handles=function(){return this.layout.handles()},e.prototype.selectWidget=function(t){var e=a.find(this.tabBars(),function(e){return-1!==e.titles.indexOf(t.title)});if(!e)throw new Error("Widget is not contained in the dock panel.");e.currentTitle=t.title},e.prototype.activateWidget=function(t){this.selectWidget(t),t.activate()},e.prototype.saveLayout=function(){return this.layout.saveLayout()},e.prototype.restoreLayout=function(t){this._mode="multiple-document",this.layout.restoreLayout(t),(c.Platform.IS_EDGE||c.Platform.IS_IE)&&u.MessageLoop.flush(),u.MessageLoop.postMessage(this,o.LayoutModified)},e.prototype.addWidget=function(t,e){void 0===e&&(e={}),"single-document"===this._mode?this.layout.addWidget(t):this.layout.addWidget(t,e),u.MessageLoop.postMessage(this,o.LayoutModified)},e.prototype.processMessage=function(e){"layout-modified"===e.type?this._layoutModified.emit(void 0):t.prototype.processMessage.call(this,e)},e.prototype.handleEvent=function(t){switch(t.type){case"p-dragenter":this._evtDragEnter(t);break;case"p-dragleave":this._evtDragLeave(t);break;case"p-dragover":this._evtDragOver(t);break;case"p-drop":this._evtDrop(t);break;case"mousedown":this._evtMouseDown(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseup":this._evtMouseUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("p-dragenter",this),this.node.addEventListener("p-dragleave",this),this.node.addEventListener("p-dragover",this),this.node.addEventListener("p-drop",this),this.node.addEventListener("mousedown",this)},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("p-dragenter",this),this.node.removeEventListener("p-dragleave",this),this.node.removeEventListener("p-dragover",this),this.node.removeEventListener("p-drop",this),this.node.removeEventListener("mousedown",this),this._releaseMouse()},e.prototype.onChildAdded=function(t){o.isGeneratedTabBarProperty.get(t.child)||t.child.addClass("p-DockPanel-widget")},e.prototype.onChildRemoved=function(t){o.isGeneratedTabBarProperty.get(t.child)||(t.child.removeClass("p-DockPanel-widget"),u.MessageLoop.postMessage(this,o.LayoutModified))},e.prototype._evtDragEnter=function(t){t.mimeData.hasData("application/vnd.phosphor.widget-factory")&&(t.preventDefault(),t.stopPropagation())},e.prototype._evtDragLeave=function(t){t.preventDefault(),t.stopPropagation();var e=t.relatedTarget;e&&this.node.contains(e)||this.overlay.hide(0)},e.prototype._evtDragOver=function(t){t.preventDefault(),t.stopPropagation(),"invalid"===this._showOverlay(t.clientX,t.clientY)?t.dropAction="none":t.dropAction=t.proposedAction},e.prototype._evtDrop=function(t){if(t.preventDefault(),t.stopPropagation(),this.overlay.hide(0),"none"!==t.proposedAction){var e=t.clientX,n=t.clientY,i=o.findDropTarget(this,e,n,this._edges),r=i.zone,a=i.target;if("invalid"!==r){var s=t.mimeData.getData("application/vnd.phosphor.widget-factory");if("function"==typeof s){var c=s();if(c instanceof m.Widget)if(c.contains(this))t.dropAction="none";else{var l=a?o.getDropRef(a.tabBar):null;switch(r){case"root-all":this.addWidget(c);break;case"root-top":this.addWidget(c,{mode:"split-top"});break;case"root-left":this.addWidget(c,{mode:"split-left"});break;case"root-right":this.addWidget(c,{mode:"split-right"});break;case"root-bottom":this.addWidget(c,{mode:"split-bottom"});break;case"widget-all":this.addWidget(c,{mode:"tab-after",ref:l});break;case"widget-top":this.addWidget(c,{mode:"split-top",ref:l});break;case"widget-left":this.addWidget(c,{mode:"split-left",ref:l});break;case"widget-right":this.addWidget(c,{mode:"split-right",ref:l});break;case"widget-bottom":this.addWidget(c,{mode:"split-bottom",ref:l});break;case"widget-tab":this.addWidget(c,{mode:"tab-after",ref:l});break;default:throw"unreachable"}t.dropAction=t.proposedAction,this.activateWidget(c)}else t.dropAction="none"}else t.dropAction="none"}else t.dropAction="none"}else t.dropAction="none"},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation(),27===t.keyCode&&(this._releaseMouse(),u.MessageLoop.postMessage(this,o.LayoutModified))},e.prototype._evtMouseDown=function(t){if(0===t.button){var e=this.layout,n=t.target,i=a.find(e.handles(),function(t){return t.contains(n)});if(i){t.preventDefault(),t.stopPropagation(),document.addEventListener("keydown",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("contextmenu",this,!0);var r=i.getBoundingClientRect(),o=t.clientX-r.left,s=t.clientY-r.top,c=window.getComputedStyle(i),u=l.Drag.overrideCursor(c.cursor);this._pressData={handle:i,deltaX:o,deltaY:s,override:u}}}},e.prototype._evtMouseMove=function(t){if(this._pressData){t.preventDefault(),t.stopPropagation();var e=this.node.getBoundingClientRect(),n=t.clientX-e.left-this._pressData.deltaX,i=t.clientY-e.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,n,i)}},e.prototype._evtMouseUp=function(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this._releaseMouse(),u.MessageLoop.postMessage(this,o.LayoutModified))},e.prototype._releaseMouse=function(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,document.removeEventListener("keydown",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("contextmenu",this,!0))},e.prototype._showOverlay=function(t,e){var n,i,r,a,s=o.findDropTarget(this,t,e,this._edges),l=s.zone,u=s.target;if("invalid"===l)return this.overlay.hide(100),l;var h=c.ElementExt.boxSizing(this.node),d=this.node.getBoundingClientRect();switch(l){case"root-all":n=h.paddingTop,i=h.paddingLeft,r=h.paddingRight,a=h.paddingBottom;break;case"root-top":n=h.paddingTop,i=h.paddingLeft,r=h.paddingRight,a=d.height*o.GOLDEN_RATIO;break;case"root-left":n=h.paddingTop,i=h.paddingLeft,r=d.width*o.GOLDEN_RATIO,a=h.paddingBottom;break;case"root-right":n=h.paddingTop,i=d.width*o.GOLDEN_RATIO,r=h.paddingRight,a=h.paddingBottom;break;case"root-bottom":n=d.height*o.GOLDEN_RATIO,i=h.paddingLeft,r=h.paddingRight,a=h.paddingBottom;break;case"widget-all":n=u.top,i=u.left,r=u.right,a=u.bottom;break;case"widget-top":n=u.top,i=u.left,r=u.right,a=u.bottom+u.height/2;break;case"widget-left":n=u.top,i=u.left,r=u.right+u.width/2,a=u.bottom;break;case"widget-right":n=u.top,i=u.left+u.width/2,r=u.right,a=u.bottom;break;case"widget-bottom":n=u.top+u.height/2,i=u.left,r=u.right,a=u.bottom;break;case"widget-tab":var f=u.tabBar.node.getBoundingClientRect().height;n=u.top,i=u.left,r=u.right,a=u.bottom+u.height-f;break;default:throw"unreachable"}return this.overlay.show({top:n,left:i,right:r,bottom:a}),l},e.prototype._createTabBar=function(){var t=this._renderer.createTabBar();return o.isGeneratedTabBarProperty.set(t,!0),"single-document"===this._mode&&t.hide(),t.tabsMovable=!0,t.allowDeselect=!1,t.removeBehavior="select-previous-tab",t.insertBehavior="select-tab-if-needed",t.tabMoved.connect(this._onTabMoved,this),t.currentChanged.connect(this._onCurrentChanged,this),t.tabCloseRequested.connect(this._onTabCloseRequested,this),t.tabDetachRequested.connect(this._onTabDetachRequested,this),t.tabActivateRequested.connect(this._onTabActivateRequested,this),t},e.prototype._createHandle=function(){return this._renderer.createHandle()},e.prototype._onTabMoved=function(){u.MessageLoop.postMessage(this,o.LayoutModified)},e.prototype._onCurrentChanged=function(t,e){var n=e.previousTitle,i=e.currentTitle;n&&n.owner.hide(),i&&i.owner.show(),(c.Platform.IS_EDGE||c.Platform.IS_IE)&&u.MessageLoop.flush(),u.MessageLoop.postMessage(this,o.LayoutModified)},e.prototype._onTabActivateRequested=function(t,e){e.title.owner.activate()},e.prototype._onTabCloseRequested=function(t,e){e.title.owner.close()},e.prototype._onTabDetachRequested=function(t,e){var n=this;if(!this._drag){t.releaseMouse();var i=e.title,r=e.tab,o=e.clientX,a=e.clientY,c=new s.MimeData;c.setData("application/vnd.phosphor.widget-factory",function(){return i.owner});var u=r.cloneNode(!0);this._drag=new l.Drag({mimeData:c,dragImage:u,proposedAction:"move",supportedActions:"move"}),r.classList.add("p-mod-hidden");this._drag.start(o,a).then(function(){n._drag=null,r.classList.remove("p-mod-hidden")})}},e}(m.Widget);e.DockPanel=g,function(t){var e=function(){function t(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("p-DockPanel-overlay"),this.node.classList.add("p-mod-hidden"),this.node.style.position="absolute"}return t.prototype.show=function(t){var e=this.node.style;e.top=t.top+"px",e.left=t.left+"px",e.right=t.right+"px",e.bottom=t.bottom+"px",clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("p-mod-hidden"))},t.prototype.hide=function(t){var e=this;if(!this._hidden)return t<=0?(clearTimeout(this._timer),this._timer=-1,this._hidden=!0,void this.node.classList.add("p-mod-hidden")):void(-1===this._timer&&(this._timer=window.setTimeout(function(){e._timer=-1,e._hidden=!0,e.node.classList.add("p-mod-hidden")},t)))},t}();t.Overlay=e;var n=function(){function t(){}return t.prototype.createTabBar=function(){var t=new p.TabBar;return t.addClass("p-DockPanel-tabBar"),t},t.prototype.createHandle=function(){var t=document.createElement("div");return t.className="p-DockPanel-handle",t},t}();t.Renderer=n,t.defaultRenderer=new n}(g=e.DockPanel||(e.DockPanel={})),e.DockPanel=g,function(t){t.GOLDEN_RATIO=.618,t.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},t.LayoutModified=new u.ConflatableMessage("layout-modified"),t.isGeneratedTabBarProperty=new h.AttachedProperty({name:"isGeneratedTabBar",create:function(){return!1}}),t.createSingleDocumentConfig=function(t){if(t.isEmpty)return{main:null};var e=a.toArray(t.widgets()),n=t.selectedWidgets().next(),i=n?e.indexOf(n):-1;return{main:{type:"tab-area",widgets:e,currentIndex:i}}},t.findDropTarget=function(t,e,n,i){if(!c.ElementExt.hitTest(t.node,e,n))return{zone:"invalid",target:null};var r=t.layout;if(r.isEmpty)return{zone:"root-all",target:null};if("multiple-document"===t.mode){var o=t.node.getBoundingClientRect(),a=e-o.left+1,s=n-o.top+1,l=o.right-e,u=o.bottom-n;switch(Math.min(s,l,u,a)){case s:if(s<i.top)return{zone:"root-top",target:null};break;case l:if(l<i.right)return{zone:"root-right",target:null};break;case u:if(u<i.bottom)return{zone:"root-bottom",target:null};break;case a:if(a<i.left)return{zone:"root-left",target:null};break;default:throw"unreachable"}}var h=r.hitTestTabAreas(e,n);if(!h)return{zone:"invalid",target:null};if("single-document"===t.mode)return{zone:"widget-all",target:h};var d=h.x-h.left+1,f=h.y-h.top+1,p=h.left+h.width-h.x,m=h.top+h.height-h.y;if(f<h.tabBar.node.getBoundingClientRect().height)return{zone:"widget-tab",target:h};var g,_=Math.round(h.width/3),v=Math.round(h.height/3);if(d>_&&p>_&&f>v&&m>v)return{zone:"widget-all",target:h};switch(d/=_,f/=v,p/=_,m/=v,Math.min(d,f,p,m)){case d:g="widget-left";break;case f:g="widget-top";break;case p:g="widget-right";break;case m:g="widget-bottom";break;default:throw"unreachable"}return{zone:g,target:h}},t.getDropRef=function(t){return 0===t.titles.length?null:t.currentTitle?t.currentTitle.owner:t.titles[t.titles.length-1].owner}}(o||(o={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9),r=n(21),o=function(){function t(){this._counter=0,this._widgets=[],this._activeWidget=null,this._currentWidget=null,this._numbers=new Map,this._nodes=new Map,this._activeChanged=new r.Signal(this),this._currentChanged=new r.Signal(this)}return t.prototype.dispose=function(){var t=this;this._counter<0||(this._counter=-1,r.Signal.clearData(this),i.each(this._widgets,function(e){e.node.removeEventListener("focus",t,!0),e.node.removeEventListener("blur",t,!0)}),this._activeWidget=null,this._currentWidget=null,this._nodes.clear(),this._numbers.clear(),this._widgets.length=0)},Object.defineProperty(t.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeChanged",{get:function(){return this._activeChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._counter<0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentWidget",{get:function(){return this._currentWidget},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeWidget",{get:function(){return this._activeWidget},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),t.prototype.focusNumber=function(t){var e=this._numbers.get(t);return void 0===e?-1:e},t.prototype.has=function(t){return this._numbers.has(t)},t.prototype.add=function(t){if(!this._numbers.has(t)){var e=t.node.contains(document.activeElement),n=e?this._counter++:-1;this._widgets.push(t),this._numbers.set(t,n),this._nodes.set(t.node,t),t.node.addEventListener("focus",this,!0),t.node.addEventListener("blur",this,!0),t.disposed.connect(this._onWidgetDisposed,this),e&&this._setWidgets(t,t)}},t.prototype.remove=function(t){var e=this;if(this._numbers.has(t)&&(t.disposed.disconnect(this._onWidgetDisposed,this),t.node.removeEventListener("focus",this,!0),t.node.removeEventListener("blur",this,!0),i.ArrayExt.removeFirstOf(this._widgets,t),this._nodes.delete(t.node),this._numbers.delete(t),this._currentWidget===t)){var n=i.filter(this._widgets,function(t){return-1!==e._numbers.get(t)}),r=i.max(n,function(t,n){return e._numbers.get(t)-e._numbers.get(n)})||null;this._setWidgets(r,null)}},t.prototype.handleEvent=function(t){switch(t.type){case"focus":this._evtFocus(t);break;case"blur":this._evtBlur(t)}},t.prototype._setWidgets=function(t,e){var n=this._currentWidget;this._currentWidget=t;var i=this._activeWidget;this._activeWidget=e,n!==t&&this._currentChanged.emit({oldValue:n,newValue:t}),i!==e&&this._activeChanged.emit({oldValue:i,newValue:e})},t.prototype._evtFocus=function(t){var e=this._nodes.get(t.currentTarget);e!==this._currentWidget&&this._numbers.set(e,this._counter++),this._setWidgets(e,e)},t.prototype._evtBlur=function(t){var e=this._nodes.get(t.currentTarget),n=t.relatedTarget;n&&(e.node.contains(n)||i.find(this._widgets,function(t){return t.node.contains(n)}))||this._setWidgets(this._currentWidget,null)},t.prototype._onWidgetDisposed=function(t){this.remove(t)},t}();e.FocusTracker=o},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o,a=n(9),s=n(16),c=n(14),l=n(37),u=n(41),h=n(34),d=n(13),f=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;return n._dirty=!1,n._rowSpacing=4,n._columnSpacing=4,n._items=[],n._rowStarts=[],n._columnStarts=[],n._rowSizers=[new u.BoxSizer],n._columnSizers=[new u.BoxSizer],n._box=null,void 0!==e.rowCount&&o.reallocSizers(n._rowSizers,e.rowCount),void 0!==e.columnCount&&o.reallocSizers(n._columnSizers,e.columnCount),void 0!==e.rowSpacing&&(n._rowSpacing=o.clampValue(e.rowSpacing)),void 0!==e.columnSpacing&&(n._columnSpacing=o.clampValue(e.columnSpacing)),n}return r(e,t),e.prototype.dispose=function(){a.each(this._items,function(t){var e=t.widget;t.dispose(),e.dispose()}),this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"rowCount",{get:function(){return this._rowSizers.length},set:function(t){t!==this.rowCount&&(o.reallocSizers(this._rowSizers,t),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnCount",{get:function(){return this._columnSizers.length},set:function(t){t!==this.columnCount&&(o.reallocSizers(this._columnSizers,t),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowSpacing",{get:function(){return this._rowSpacing},set:function(t){t=o.clampValue(t),this._rowSpacing!==t&&(this._rowSpacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnSpacing",{get:function(){return this._columnSpacing},set:function(t){t=o.clampValue(t),this._columnSpacing!==t&&(this._columnSpacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),e.prototype.rowStretch=function(t){var e=this._rowSizers[t];return e?e.stretch:-1},e.prototype.setRowStretch=function(t,e){var n=this._rowSizers[t];n&&(e=o.clampValue(e),n.stretch!==e&&(n.stretch=e,this.parent&&this.parent.update()))},e.prototype.columnStretch=function(t){var e=this._columnSizers[t];return e?e.stretch:-1},e.prototype.setColumnStretch=function(t,e){var n=this._columnSizers[t];n&&(e=o.clampValue(e),n.stretch!==e&&(n.stretch=e,this.parent&&this.parent.update()))},e.prototype.iter=function(){return a.map(this._items,function(t){return t.widget})},e.prototype.addWidget=function(t){-1===a.ArrayExt.findFirstIndex(this._items,function(e){return e.widget===t})&&(this._items.push(new h.LayoutItem(t)),this.parent&&this.attachWidget(t))},e.prototype.removeWidget=function(t){var e=a.ArrayExt.findFirstIndex(this._items,function(e){return e.widget===t});if(-1===e){var n=a.ArrayExt.removeAt(this._items,e);this.parent&&this.detachWidget(t),n.dispose()}},e.prototype.init=function(){var e=this;t.prototype.init.call(this),a.each(this,function(t){e.attachWidget(t)})},e.prototype.attachWidget=function(t){this.parent.isAttached&&c.MessageLoop.sendMessage(t,d.Widget.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&c.MessageLoop.sendMessage(t,d.Widget.Msg.AfterAttach),this.parent.fit()},e.prototype.detachWidget=function(t){this.parent.isAttached&&c.MessageLoop.sendMessage(t,d.Widget.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&c.MessageLoop.sendMessage(t,d.Widget.Msg.AfterDetach),this.parent.fit()},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var t=0,n=this.rowCount;t<n;++t)this._rowSizers[t].minSize=0;for(t=0,n=this.columnCount;t<n;++t)this._columnSizers[t].minSize=0;var i=this._items.filter(function(t){return!t.isHidden});for(t=0,n=i.length;t<n;++t)i[t].fit();var r=this.rowCount-1,a=this.columnCount-1;i.sort(o.rowSpanCmp);for(t=0,n=i.length;t<n;++t){var l=i[t],u=e.getCellConfig(l.widget),h=Math.min(u.row,r),f=Math.min(u.row+u.rowSpan-1,r);o.distributeMin(this._rowSizers,h,f,l.minHeight)}i.sort(o.columnSpanCmp);for(t=0,n=i.length;t<n;++t){l=i[t],u=e.getCellConfig(l.widget);var p=Math.min(u.column,a),m=Math.min(u.column+u.columnSpan-1,a);o.distributeMin(this._columnSizers,p,m,l.minWidth)}if("set-no-constraint"!==this.fitPolicy){var g=r*this._rowSpacing,_=a*this._columnSpacing;for(t=0,n=this.rowCount;t<n;++t)g+=this._rowSizers[t].minSize;for(t=0,n=this.columnCount;t<n;++t)_+=this._columnSizers[t].minSize;var v=this._box=s.ElementExt.boxSizing(this.parent.node);_+=v.horizontalSum,g+=v.verticalSum;var b=this.parent.node.style;b.minWidth=_+"px",b.minHeight=g+"px",this._dirty=!0,this.parent.parent&&c.MessageLoop.sendMessage(this.parent.parent,d.Widget.Msg.FitRequest),this._dirty&&c.MessageLoop.sendMessage(this.parent,d.Widget.Msg.UpdateRequest)}else c.MessageLoop.sendMessage(this.parent,d.Widget.Msg.UpdateRequest)},e.prototype._update=function(t,n){this._dirty=!1,t<0&&(t=this.parent.node.offsetWidth),n<0&&(n=this.parent.node.offsetHeight),this._box||(this._box=s.ElementExt.boxSizing(this.parent.node));var i=this._box.paddingTop,r=this._box.paddingLeft,o=t-this._box.horizontalSum,a=n-this._box.verticalSum,c=this.rowCount-1,l=this.columnCount-1,h=c*this._rowSpacing,d=l*this._columnSpacing;u.BoxEngine.calc(this._rowSizers,Math.max(0,a-h)),u.BoxEngine.calc(this._columnSizers,Math.max(0,o-d));for(var f=0,p=i,m=this.rowCount;f<m;++f)this._rowStarts[f]=p,p+=this._rowSizers[f].size+this._rowSpacing;for(f=0,p=r,m=this.columnCount;f<m;++f)this._columnStarts[f]=p,p+=this._columnSizers[f].size+this._columnSpacing;for(f=0,m=this._items.length;f<m;++f){var g=this._items[f];if(!g.isHidden){var _=e.getCellConfig(g.widget),v=Math.min(_.row,c),b=Math.min(_.column,l),y=Math.min(_.row+_.rowSpan-1,c),x=Math.min(_.column+_.columnSpan-1,l),w=this._columnStarts[b],M=this._rowStarts[v],E=this._columnStarts[x]+this._columnSizers[x].size-w,S=this._rowStarts[y]+this._rowSizers[y].size-M;g.update(w,M,E,S)}}},e}(h.Layout);e.GridLayout=f,function(t){t.getCellConfig=function(t){return o.cellConfigProperty.get(t)},t.setCellConfig=function(t,e){o.cellConfigProperty.set(t,o.normalizeConfig(e))}}(f=e.GridLayout||(e.GridLayout={})),e.GridLayout=f,function(t){t.cellConfigProperty=new l.AttachedProperty({name:"cellConfig",create:function(){return{row:0,column:0,rowSpan:1,columnSpan:1}},changed:function(t){t.parent&&t.parent.layout instanceof f&&t.parent.fit()}}),t.normalizeConfig=function(t){return{row:Math.max(0,Math.floor(t.row||0)),column:Math.max(0,Math.floor(t.column||0)),rowSpan:Math.max(1,Math.floor(t.rowSpan||0)),columnSpan:Math.max(1,Math.floor(t.columnSpan||0))}},t.clampValue=function(t){return Math.max(0,Math.floor(t))},t.rowSpanCmp=function(e,n){var i=t.cellConfigProperty.get(e.widget),r=t.cellConfigProperty.get(n.widget);return i.rowSpan-r.rowSpan},t.columnSpanCmp=function(e,n){var i=t.cellConfigProperty.get(e.widget),r=t.cellConfigProperty.get(n.widget);return i.columnSpan-r.columnSpan},t.reallocSizers=function(t,e){for(e=Math.max(1,Math.floor(e));t.length<e;)t.push(new u.BoxSizer);t.length<e&&(t.length=e)},t.distributeMin=function(t,e,n,i){if(!(n<e))if(e!==n){for(var r=0,o=e;o<=n;++o)r+=t[o].minSize;if(!(r>=i)){var a=(i-r)/(n-e+1);for(o=e;o<=n;++o)t[o].minSize+=a}}else{var s=t[e];s.minSize=Math.max(s.minSize,i)}}}(o||(o={}))},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o,a=n(9),s=n(16),c=n(82),l=n(14),u=n(59),h=n(13),d=function(t){function e(n){void 0===n&&(n={});var i=t.call(this,{node:o.createNode()})||this;return i._activeIndex=-1,i._menus=[],i._childMenu=null,i.addClass("p-MenuBar"),i.setFlag(h.Widget.Flag.DisallowLayout),i.renderer=n.renderer||e.defaultRenderer,i}return r(e,t),e.prototype.dispose=function(){this._closeChildMenu(),this._menus.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("p-MenuBar-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeMenu",{get:function(){return this._menus[this._activeIndex]||null},set:function(t){this.activeIndex=t?this._menus.indexOf(t):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(t){(t<0||t>=this._menus.length)&&(t=-1),this._activeIndex!==t&&(this._activeIndex=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"menus",{get:function(){return this._menus},enumerable:!0,configurable:!0}),e.prototype.openActiveMenu=function(){-1!==this._activeIndex&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))},e.prototype.addMenu=function(t){this.insertMenu(this._menus.length,t)},e.prototype.insertMenu=function(t,e){this._closeChildMenu();var n=this._menus.indexOf(e),i=Math.max(0,Math.min(t,this._menus.length));if(-1===n)return a.ArrayExt.insert(this._menus,i,e),e.addClass("p-MenuBar-menu"),e.aboutToClose.connect(this._onMenuAboutToClose,this),e.menuRequested.connect(this._onMenuMenuRequested,this),e.title.changed.connect(this._onTitleChanged,this),void this.update();i===this._menus.length&&i--,n!==i&&(a.ArrayExt.move(this._menus,n,i),this.update())},e.prototype.removeMenu=function(t){this.removeMenuAt(this._menus.indexOf(t))},e.prototype.removeMenuAt=function(t){this._closeChildMenu();var e=a.ArrayExt.removeAt(this._menus,t);e&&(e.aboutToClose.disconnect(this._onMenuAboutToClose,this),e.menuRequested.disconnect(this._onMenuMenuRequested,this),e.title.changed.disconnect(this._onTitleChanged,this),e.removeClass("p-MenuBar-menu"),this.update())},e.prototype.clearMenus=function(){if(0!==this._menus.length){this._closeChildMenu();for(var t=0,e=this._menus;t<e.length;t++){var n=e[t];n.aboutToClose.disconnect(this._onMenuAboutToClose,this),n.menuRequested.disconnect(this._onMenuMenuRequested,this),n.title.changed.disconnect(this._onTitleChanged,this),n.removeClass("p-MenuBar-menu")}this._menus.length=0,this.update()}},e.prototype.handleEvent=function(t){switch(t.type){case"keydown":this._evtKeyDown(t);break;case"mousedown":this._evtMouseDown(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseleave":this._evtMouseLeave(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("keydown",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this)},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()},e.prototype.onActivateRequest=function(t){this.isAttached&&this.node.focus()},e.prototype.onUpdateRequest=function(t){for(var e=this._menus,n=this.renderer,i=this._activeIndex,r=new Array(e.length),o=0,a=e.length;o<a;++o){var s=e[o].title,c=o===i;r[o]=n.renderItem({title:s,active:c})}u.VirtualDOM.render(r,this.contentNode)},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation();var e=t.keyCode;if(13!==e&&38!==e&&40!==e){if(27===e)return this._closeChildMenu(),this.activeIndex=-1,void this.node.blur();if(37!==e)if(39!==e){var n=c.getKeyboardLayout().keyForKeydownEvent(t);if(n){var i=this._activeIndex+1,r=o.findMnemonic(this._menus,n,i);-1===r.index||r.multiple?-1!==r.index?this.activeIndex=r.index:-1!==r.auto&&(this.activeIndex=r.auto):(this.activeIndex=r.index,this.openActiveMenu())}}else{a=this._activeIndex,s=this._menus.length;this.activeIndex=a===s-1?0:a+1}else{var a=this._activeIndex,s=this._menus.length;this.activeIndex=0===a?s-1:a-1}}else this.openActiveMenu()},e.prototype._evtMouseDown=function(t){if(s.ElementExt.hitTest(this.node,t.clientX,t.clientY)){t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation();var e=a.ArrayExt.findFirstIndex(this.contentNode.children,function(e){return s.ElementExt.hitTest(e,t.clientX,t.clientY)});-1!==e?0===t.button&&(this._childMenu?(this._closeChildMenu(),this.activeIndex=e):(this.activeIndex=e,this._openChildMenu())):this._closeChildMenu()}},e.prototype._evtMouseMove=function(t){var e=a.ArrayExt.findFirstIndex(this.contentNode.children,function(e){return s.ElementExt.hitTest(e,t.clientX,t.clientY)});e!==this._activeIndex&&(-1===e&&this._childMenu||(this.activeIndex=e,this._childMenu&&this._openChildMenu()))},e.prototype._evtMouseLeave=function(t){this._childMenu||(this.activeIndex=-1)},e.prototype._openChildMenu=function(){var t=this.activeMenu;if(t){var e=this._childMenu;if(e!==t){this._childMenu=t,e?e.close():(this.addClass("p-mod-active"),document.addEventListener("mousedown",this,!0)),l.MessageLoop.sendMessage(this,h.Widget.Msg.UpdateRequest);var n=this.contentNode.children[this._activeIndex].getBoundingClientRect(),i=n.left,r=n.bottom;t.open(i,r,{forceX:!0,forceY:!0})}}else this._closeChildMenu()},e.prototype._closeChildMenu=function(){if(this._childMenu){this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0);var t=this._childMenu;this._childMenu=null,t.close(),this.activeIndex=-1}},e.prototype._onMenuAboutToClose=function(t){t===this._childMenu&&(this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)},e.prototype._onMenuMenuRequested=function(t,e){if(t===this._childMenu){var n=this._activeIndex,i=this._menus.length;switch(e){case"next":this.activeIndex=n===i-1?0:n+1;break;case"previous":this.activeIndex=0===n?i-1:n-1}this.openActiveMenu()}},e.prototype._onTitleChanged=function(){this.update()},e}(h.Widget);e.MenuBar=d,function(t){var e=function(){function t(){}return t.prototype.renderItem=function(t){var e=this.createItemClass(t),n=this.createItemDataset(t);return u.h.li({className:e,dataset:n},this.renderIcon(t),this.renderLabel(t))},t.prototype.renderIcon=function(t){var e=this.createIconClass(t);return u.h.div({className:e},t.title.iconLabel)},t.prototype.renderLabel=function(t){var e=this.formatLabel(t);return u.h.div({className:"p-MenuBar-itemLabel"},e)},t.prototype.createItemClass=function(t){var e="p-MenuBar-item";return t.title.className&&(e+=" "+t.title.className),t.active&&(e+=" p-mod-active"),e},t.prototype.createItemDataset=function(t){return t.title.dataset},t.prototype.createIconClass=function(t){var e="p-MenuBar-itemIcon",n=t.title.iconClass;return n?e+" "+n:e},t.prototype.formatLabel=function(t){var e=t.title,n=e.label,i=e.mnemonic;if(i<0||i>=n.length)return n;var r=n.slice(0,i),o=n.slice(i+1),a=n[i];return[r,u.h.span({className:"p-MenuBar-itemMnemonic"},a),o]},t}();t.Renderer=e,t.defaultRenderer=new e}(d=e.MenuBar||(e.MenuBar={})),e.MenuBar=d,function(t){t.createNode=function(){var t=document.createElement("div"),e=document.createElement("ul");return e.className="p-MenuBar-content",t.appendChild(e),t.tabIndex=-1,t},t.findMnemonic=function(t,e,n){for(var i=-1,r=-1,o=!1,a=e.toUpperCase(),s=0,c=t.length;s<c;++s){var l=(s+n)%c,u=t[l].title;if(0!==u.label.length){var h=u.mnemonic;h>=0&&h<u.label.length?u.label[h].toUpperCase()===a&&(-1===i?i=l:o=!0):-1===r&&u.label[0].toUpperCase()===a&&(r=l)}}return{index:i,multiple:o,auto:r}}}(o||(o={}))},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o,a=n(16),s=n(60),c=n(21),l=n(13),u=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,{node:o.createNode()})||this;return n._onRepeat=function(){if(n._repeatTimer=-1,n._pressData){var t=n._pressData.part;if("thumb"!==t){n._repeatTimer=window.setTimeout(n._onRepeat,20);var e=n._pressData.mouseX,i=n._pressData.mouseY;if("decrement"!==t)if("increment"!==t){if("track"===t){if(!a.ElementExt.hitTest(n.trackNode,e,i))return;var r=n.thumbNode;if(a.ElementExt.hitTest(r,e,i))return;var o=r.getBoundingClientRect(),s=void 0;return s="horizontal"===n._orientation?e<o.left?"decrement":"increment":i<o.top?"decrement":"increment",void n._pageRequested.emit(s)}}else{if(!a.ElementExt.hitTest(n.incrementNode,e,i))return;n._stepRequested.emit("increment")}else{if(!a.ElementExt.hitTest(n.decrementNode,e,i))return;n._stepRequested.emit("decrement")}}}},n._value=0,n._page=10,n._maximum=100,n._repeatTimer=-1,n._pressData=null,n._thumbMoved=new c.Signal(n),n._stepRequested=new c.Signal(n),n._pageRequested=new c.Signal(n),n.addClass("p-ScrollBar"),n.setFlag(l.Widget.Flag.DisallowLayout),n._orientation=e.orientation||"vertical",n.dataset.orientation=n._orientation,void 0!==e.maximum&&(n._maximum=Math.max(0,e.maximum)),void 0!==e.page&&(n._page=Math.max(0,e.page)),void 0!==e.value&&(n._value=Math.max(0,Math.min(e.value,n._maximum))),n}return r(e,t),Object.defineProperty(e.prototype,"thumbMoved",{get:function(){return this._thumbMoved},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stepRequested",{get:function(){return this._stepRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageRequested",{get:function(){return this._pageRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(t){this._orientation!==t&&(this._releaseMouse(),this._orientation=t,this.dataset.orientation=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(t){t=Math.max(0,Math.min(t,this._maximum)),this._value!==t&&(this._value=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this._page},set:function(t){t=Math.max(0,t),this._page!==t&&(this._page=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(t){t=Math.max(0,t),this._maximum!==t&&(this._maximum=t,this._value=Math.min(this._value,t),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"decrementNode",{get:function(){return this.node.getElementsByClassName("p-ScrollBar-button")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"incrementNode",{get:function(){return this.node.getElementsByClassName("p-ScrollBar-button")[1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trackNode",{get:function(){return this.node.getElementsByClassName("p-ScrollBar-track")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"thumbNode",{get:function(){return this.node.getElementsByClassName("p-ScrollBar-thumb")[0]},enumerable:!0,configurable:!0}),e.prototype.handleEvent=function(t){switch(t.type){case"mousedown":this._evtMouseDown(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseup":this._evtMouseUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("mousedown",this),this.update()},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("mousedown",this),this._releaseMouse()},e.prototype.onUpdateRequest=function(t){var e=100*this._value/this._maximum,n=100*this._page/(this._page+this._maximum);e=Math.max(0,Math.min(e,100)),n=Math.max(0,Math.min(n,100));var i=this.thumbNode.style;"horizontal"===this._orientation?(i.top="",i.height="",i.left=e+"%",i.width=n+"%",i.transform="translate("+-e+"%, 0%)"):(i.left="",i.width="",i.top=e+"%",i.height=n+"%",i.transform="translate(0%, "+-e+"%)")},e.prototype._evtKeyDown=function(t){if(t.preventDefault(),t.stopPropagation(),27===t.keyCode){var e=this._pressData?this._pressData.value:-1;this._releaseMouse(),-1!==e&&this._moveThumb(e)}},e.prototype._evtMouseDown=function(t){if(0===t.button&&!this._pressData){var e=o.findPart(this,t.target);if(e){t.preventDefault(),t.stopPropagation();var n=s.Drag.overrideCursor("default");if(this._pressData={part:e,override:n,delta:-1,value:-1,mouseX:t.clientX,mouseY:t.clientY},document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0),"thumb"===e){var i=this.thumbNode,r=i.getBoundingClientRect();return"horizontal"===this._orientation?this._pressData.delta=t.clientX-r.left:this._pressData.delta=t.clientY-r.top,i.classList.add("p-mod-active"),void(this._pressData.value=this._value)}if("track"===e){r=this.thumbNode.getBoundingClientRect();var a=void 0;return a="horizontal"===this._orientation?t.clientX<r.left?"decrement":"increment":t.clientY<r.top?"decrement":"increment",this._repeatTimer=window.setTimeout(this._onRepeat,350),void this._pageRequested.emit(a)}return"decrement"===e?(this.decrementNode.classList.add("p-mod-active"),this._repeatTimer=window.setTimeout(this._onRepeat,350),void this._stepRequested.emit("decrement")):"increment"===e?(this.incrementNode.classList.add("p-mod-active"),this._repeatTimer=window.setTimeout(this._onRepeat,350),void this._stepRequested.emit("increment")):void 0}}},e.prototype._evtMouseMove=function(t){if(this._pressData&&(t.preventDefault(),t.stopPropagation(),this._pressData.mouseX=t.clientX,this._pressData.mouseY=t.clientY,"thumb"===this._pressData.part)){var e,n,i=this.thumbNode.getBoundingClientRect(),r=this.trackNode.getBoundingClientRect();"horizontal"===this._orientation?(e=t.clientX-r.left-this._pressData.delta,n=r.width-i.width):(e=t.clientY-r.top-this._pressData.delta,n=r.height-i.height);var o=0===n?0:e*this._maximum/n;this._moveThumb(o)}},e.prototype._evtMouseUp=function(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this._releaseMouse())},e.prototype._releaseMouse=function(){this._pressData&&(clearTimeout(this._repeatTimer),this._repeatTimer=-1,this._pressData.override.dispose(),this._pressData=null,document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("contextmenu",this,!0),this.thumbNode.classList.remove("p-mod-active"),this.decrementNode.classList.remove("p-mod-active"),this.incrementNode.classList.remove("p-mod-active"))},e.prototype._moveThumb=function(t){t=Math.max(0,Math.min(t,this._maximum)),this._value!==t&&(this._value=t,this.update(),this._thumbMoved.emit(t))},e}(l.Widget);e.ScrollBar=u,function(t){t.createNode=function(){var t=document.createElement("div"),e=document.createElement("div"),n=document.createElement("div"),i=document.createElement("div"),r=document.createElement("div");return e.className="p-ScrollBar-button",n.className="p-ScrollBar-button",e.dataset.action="decrement",n.dataset.action="increment",i.className="p-ScrollBar-track",r.className="p-ScrollBar-thumb",i.appendChild(r),t.appendChild(e),t.appendChild(i),t.appendChild(n),t},t.findPart=function(t,e){return t.thumbNode.contains(e)?"thumb":t.trackNode.contains(e)?"track":t.decrementNode.contains(e)?"decrement":t.incrementNode.contains(e)?"increment":null}}(o||(o={}))},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(9),a=n(14),s=n(34),c=n(13),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._widget=null,e}return r(e,t),e.prototype.dispose=function(){if(this._widget){var e=this._widget;this._widget=null,e.dispose()}t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"widget",{get:function(){return this._widget},set:function(t){this._widget!==t&&(this._widget&&this._widget.dispose(),this._widget=t,this.parent&&t&&this.attachWidget(t))},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return this._widget?o.once(this._widget):o.empty()},e.prototype.removeWidget=function(t){this._widget===t&&(this._widget=null,this.parent&&this.detachWidget(t))},e.prototype.init=function(){var e=this;t.prototype.init.call(this),o.each(this,function(t){e.attachWidget(t)})},e.prototype.attachWidget=function(t){this.parent.isAttached&&a.MessageLoop.sendMessage(t,c.Widget.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&a.MessageLoop.sendMessage(t,c.Widget.Msg.AfterAttach)},e.prototype.detachWidget=function(t){this.parent.isAttached&&a.MessageLoop.sendMessage(t,c.Widget.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&a.MessageLoop.sendMessage(t,c.Widget.Msg.AfterDetach)},e}(s.Layout);e.SingletonLayout=l},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o,a=n(9),s=n(60),c=n(52),l=n(132),u=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,{layout:o.createLayout(e)})||this;return n._pressData=null,n.addClass("p-SplitPanel"),n}return r(e,t),e.prototype.dispose=function(){this._releaseMouse(),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"orientation",{get:function(){return this.layout.orientation},set:function(t){this.layout.orientation=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(t){this.layout.alignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(t){this.layout.spacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handles",{get:function(){return this.layout.handles},enumerable:!0,configurable:!0}),e.prototype.relativeSizes=function(){return this.layout.relativeSizes()},e.prototype.setRelativeSizes=function(t){this.layout.setRelativeSizes(t)},e.prototype.handleEvent=function(t){switch(t.type){case"mousedown":this._evtMouseDown(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseup":this._evtMouseUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("mousedown",this)},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("mousedown",this),this._releaseMouse()},e.prototype.onChildAdded=function(t){t.child.addClass("p-SplitPanel-child"),this._releaseMouse()},e.prototype.onChildRemoved=function(t){t.child.removeClass("p-SplitPanel-child"),this._releaseMouse()},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation(),27===t.keyCode&&this._releaseMouse()},e.prototype._evtMouseDown=function(t){if(0===t.button){var e=this.layout,n=a.ArrayExt.findFirstIndex(e.handles,function(e){return e.contains(t.target)});if(-1!==n){var i;t.preventDefault(),t.stopPropagation(),document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);var r=e.handles[n],o=r.getBoundingClientRect();i="horizontal"===e.orientation?t.clientX-o.left:t.clientY-o.top;var c=window.getComputedStyle(r),l=s.Drag.overrideCursor(c.cursor);this._pressData={index:n,delta:i,override:l}}}},e.prototype._evtMouseMove=function(t){var e;t.preventDefault(),t.stopPropagation();var n=this.layout,i=this.node.getBoundingClientRect();e="horizontal"===n.orientation?t.clientX-i.left-this._pressData.delta:t.clientY-i.top-this._pressData.delta,n.moveHandle(this._pressData.index,e)},e.prototype._evtMouseUp=function(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this._releaseMouse())},e.prototype._releaseMouse=function(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,document.removeEventListener("mouseup",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("contextmenu",this,!0))},e}(c.Panel);e.SplitPanel=u,function(t){var e=function(){function t(){}return t.prototype.createHandle=function(){var t=document.createElement("div");return t.className="p-SplitPanel-handle",t},t}();t.Renderer=e,t.defaultRenderer=new e,t.getStretch=function(t){return l.SplitLayout.getStretch(t)},t.setStretch=function(t,e){l.SplitLayout.setStretch(t,e)}}(u=e.SplitPanel||(e.SplitPanel={})),e.SplitPanel=u,function(t){t.createLayout=function(t){return t.layout||new l.SplitLayout({renderer:t.renderer||u.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing})}}(o||(o={}))},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o,a=n(16),s=n(14),c=n(21),l=n(66),u=n(134),h=n(83),d=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;n._currentChanged=new c.Signal(n),n.addClass("p-TabPanel"),n.tabBar=new h.TabBar(e),n.tabBar.addClass("p-TabPanel-tabBar"),n.stackedPanel=new u.StackedPanel,n.stackedPanel.addClass("p-TabPanel-stackedPanel"),n.tabBar.tabMoved.connect(n._onTabMoved,n),n.tabBar.currentChanged.connect(n._onCurrentChanged,n),n.tabBar.tabCloseRequested.connect(n._onTabCloseRequested,n),n.tabBar.tabActivateRequested.connect(n._onTabActivateRequested,n),n.stackedPanel.widgetRemoved.connect(n._onWidgetRemoved,n),n._tabPlacement=e.tabPlacement||"top";var i=o.directionFromPlacement(n._tabPlacement),r=o.orientationFromPlacement(n._tabPlacement);n.tabBar.orientation=r,n.tabBar.dataset.placement=n._tabPlacement;var a=new l.BoxLayout({direction:i,spacing:0});return l.BoxLayout.setStretch(n.tabBar,0),l.BoxLayout.setStretch(n.stackedPanel,1),a.addWidget(n.tabBar),a.addWidget(n.stackedPanel),n.layout=a,n}return r(e,t),Object.defineProperty(e.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentIndex",{get:function(){return this.tabBar.currentIndex},set:function(t){this.tabBar.currentIndex=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentWidget",{get:function(){var t=this.tabBar.currentTitle;return t?t.owner:null},set:function(t){this.tabBar.currentTitle=t?t.title:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabsMovable",{get:function(){return this.tabBar.tabsMovable},set:function(t){this.tabBar.tabsMovable=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabPlacement",{get:function(){return this._tabPlacement},set:function(t){if(this._tabPlacement!==t){this._tabPlacement=t;var e=o.directionFromPlacement(t),n=o.orientationFromPlacement(t);this.tabBar.orientation=n,this.tabBar.dataset.placement=t,this.layout.direction=e}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widgets",{get:function(){return this.stackedPanel.widgets},enumerable:!0,configurable:!0}),e.prototype.addWidget=function(t){this.insertWidget(this.widgets.length,t)},e.prototype.insertWidget=function(t,e){e!==this.currentWidget&&e.hide(),this.stackedPanel.insertWidget(t,e),this.tabBar.insertTab(t,e.title)},e.prototype._onCurrentChanged=function(t,e){var n=e.previousIndex,i=e.previousTitle,r=e.currentIndex,o=e.currentTitle,c=i?i.owner:null,l=o?o.owner:null;c&&c.hide(),l&&l.show(),this._currentChanged.emit({previousIndex:n,previousWidget:c,currentIndex:r,currentWidget:l}),(a.Platform.IS_EDGE||a.Platform.IS_IE)&&s.MessageLoop.flush()},e.prototype._onTabActivateRequested=function(t,e){e.title.owner.activate()},e.prototype._onTabCloseRequested=function(t,e){e.title.owner.close()},e.prototype._onTabMoved=function(t,e){this.stackedPanel.insertWidget(e.toIndex,e.title.owner)},e.prototype._onWidgetRemoved=function(t,e){this.tabBar.removeTab(e.title)},e}(n(13).Widget);e.TabPanel=d,function(t){t.orientationFromPlacement=function(t){return e[t]},t.directionFromPlacement=function(t){return n[t]};var e={top:"horizontal",left:"vertical",right:"vertical",bottom:"horizontal"},n={top:"top-to-bottom",left:"left-to-right",right:"right-to-left",bottom:"bottom-to-top"}}(o||(o={}))},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(10)),o=i(n(12)),a=n(28);class s extends r.WidgetModel{defaults(){return Object.assign({},r.WidgetModel.prototype.defaults(),{_model_name:"AxisModel",_view_name:"Axis",_model_module:"bqplot",_view_module:"bqplot",_model_module_version:a.semver_range,_view_module_version:a.semver_range,orientation:"horizontal",side:null,label:"",grid_lines:"solid",tick_format:null,scale:void 0,num_ticks:null,tick_values:[],offset:{},label_location:"middle",label_color:null,grid_color:null,color:null,label_offset:null,visible:!0,tick_style:{},tick_rotate:0})}initialize(t,e){super.initialize(t,e),this.on("change:side",this.validate_orientation,this),this.on("change:orientation",this.validate_side,this),this.validate_orientation(),this.validate_side()}validate_side(){const t=this.get("orientation"),e=this.get("side");"vertical"===t?"left"!==e&&"right"!==e&&this.set("side","left"):"bottom"!==e&&"top"!==e&&this.set("side","bottom"),this.save_changes()}validate_orientation(){const t=this.get("side");t&&("left"===t||"right"===t?this.set("orientation","vertical"):this.set("orientation","horizontal"),this.save_changes())}}s.serializers=Object.assign({},r.WidgetModel.serializers,{scale:{deserialize:r.unpack_models},offset:{deserialize:r.unpack_models},tick_values:o.array_or_json}),e.AxisModel=s;e.ColorAxisModel=class extends s{defaults(){return Object.assign({},s.prototype.defaults(),{_model_name:"ColorAxisModel",_view_name:"ColorAxis"})}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=i(n(17)),a=n(61),s=n(17).convert_dates;e.HandDraw=class extends a.Interaction{render(){super.render(),this.d3el.style("cursor","crosshair"),this.active=!1,this.set_lines_view().then(()=>{this.d3el.on("mousedown",()=>this.mousedown()),this.set_limits()}),this.update_line_index(),this.listenTo(this.model,"change:line_index",this.update_line_index),this.model.on_some_change(["min_x","max_x"],this.set_limits,this)}set_lines_view(){const t=this.parent,e=this.model.get("lines");return Promise.all(t.mark_views.views).then(n=>{const i=t.mark_views._models.map(t=>t.model_id).indexOf(e.model_id);this.lines_view=n[i]})}mousedown(){this.active=!0,this.mouse_entry(!1),this.d3el.on("mousemove",()=>{this.mousemove()}),this.d3el.on("mouseleave",()=>{this.mouseup()}),this.d3el.on("mouseup",()=>{this.mouseup()})}mouseup(){if(this.active){this.mouse_entry(!0);const t=this.model.get("lines");t.set("y",s(o.deepCopy(t.y_data))),this.lines_view.touch(),this.active=!1,this.d3el.on("mousemove",null),this.d3el.on("mouseleave",null),this.d3el.on("mouseup",null)}}mousemove(){this.mouse_entry(!0)}mouse_entry(t){if(this.active){const e=this.model.get("lines"),n=Math.min(this.line_index,e.x_data.length-1),i=r.mouse(this.el);t&&"previous_pos"in this||(this.previous_pos=i);const o=this.lines_view.scales.x.scale,a=this.lines_view.scales.y.scale,s=o.invert(i[0]),c=a.invert(i[1]),l=o.invert(this.previous_pos[0]);a.invert(this.previous_pos[1]);const u=this.nns(e.x_data[n],l),h=this.nns(e.x_data[n],s),d=Math.min(u,h),f=Math.max(u,h);for(let t=d;t<=f;++t)(!this.valid_min||e.x_data[n][t]>=this.min_x)&&(!this.valid_max||e.x_data[n][t]<=this.max_x)&&(e.y_data[this.line_index][t]=c);const p=e.x_data[n].map((t,n)=>({x:t,y:e.y_data[this.line_index][n]}));this.lines_view.d3el.select("#curve"+(this.line_index+1)).attr("d",function(t){return this.lines_view.line(p)}.bind(this)),this.previous_pos=i}}capnfloor(t){return Math.max(Math.min(t,this.model.get("max_x")),this.model.get("min_x"))}set_limits(){"date"==this.lines_view.scales.x.model.type?(this.min_x=o.getDate(this.model.get("min_x")),this.valid_min=!(null===this.min_x||void 0===this.min_x||isNaN(this.min_x.getTime())),this.max_x=o.getDate(this.model.get("max_x")),this.valid_max=!(null===this.max_x||void 0===this.max_x||isNaN(this.max_x.getTime()))):(this.min_x=this.model.get("min_x"),this.max_x=this.model.get("max_x"),this.valid_min=!(null===this.min_x||void 0===this.min_x),this.valid_max=!(null===this.max_x||void 0===this.max_x))}nns(t,e){const n=this.lines_view.bisect(t,e);return e-t[n-1]>t[n]-e?n:n-1}update_line_index(){this.line_index=this.model.get("line_index")}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2));n(31);const o=function(){return n(0).event}.bind(this),a=i(n(6)),s=n(19);e.Bars=class extends s.Mark{render(){const t=super.render.apply(this);return this.set_internal_scales(),this.selected_indices=this.model.get("selected"),this.selected_style=this.model.get("selected_style"),this.unselected_style=this.model.get("unselected_style"),this.display_el_classes=["bar","legendtext"],this.displayed.then(()=>{this.parent.tooltip_div.node().appendChild(this.tooltip_div.node()),this.create_tooltip()}),t.then(()=>{this.event_listeners={},this.process_interactions(),this.create_listeners(),this.compute_view_padding(),this.draw()})}set_scale_orientation(){this.dom_scale=this.scales.x,this.range_scale=this.scales.y}set_ranges(){const t=this.model.get("orientation");this.set_scale_orientation();const e=this.dom_scale,n=this.range_scale,i="vertical"===t?"x":"y",r="vertical"===t?"y":"x";"ordinal"!==e.model.type?e.set_range(this.parent.padded_range(i,e.model)):e.set_range(this.parent.padded_range(i,e.model),this.model.get("padding")),n.set_range(this.parent.padded_range(r,n.model)),this.dom_offset=0,this.range_offset="vertical"===t?n.offset:-n.offset}set_positional_scales(){const t=this.scales.x,e=this.scales.y;this.listenTo(t,"domain_changed",function(){this.model.dirty||this.draw()}),this.listenTo(e,"domain_changed",function(){this.model.dirty||this.draw()})}set_internal_scales(){this.x=r.scaleBand(),this.x1=r.scaleBand()}adjust_offset(){"ordinal"!==this.dom_scale.model.type?"center"===this.model.get("align")?this.dom_offset=-(this.x.bandwidth()/2).toFixed(2):"left"===this.model.get("align")?this.dom_offset=-this.x.bandwidth().toFixed(2):this.dom_offset=0:"center"===this.model.get("align")?this.dom_offset=0:"left"===this.model.get("align")?this.dom_offset=-this.x.bandwidth()/2:this.dom_offset=this.x.bandwidth()/2}create_listeners(){super.create_listeners.apply(this),this.d3el.on("mouseover",a.bind(function(){this.event_dispatcher("mouse_over")},this)).on("mousemove",a.bind(function(){this.event_dispatcher("mouse_move")},this)).on("mouseout",a.bind(function(){this.event_dispatcher("mouse_out")},this)),this.listenTo(this.model,"data_updated",function(){this.draw(!0)}),this.listenTo(this.model,"change:colors",this.update_colors),this.listenTo(this.model,"colors_updated",this.update_colors),this.listenTo(this.model,"change:type",this.update_type),this.listenTo(this.model,"change:align",this.relayout),this.listenTo(this.model,"change:padding",this.relayout),this.listenTo(this.model,"change:orientation",this.relayout),this.listenTo(this.model,"change:tooltip",this.create_tooltip),this.model.on_some_change(["stroke","opacities","fill","stroke_width"],this.apply_styles,this),this.listenTo(this.model,"change:selected",this.update_selected),this.listenTo(this.model,"change:interactions",this.process_interactions),this.listenTo(this.parent,"bg_clicked",function(){this.event_dispatcher("parent_clicked")}),this.model.on_some_change(["label_display_format","label_font_style","label_display","label_display_vertical_offset","label_display_horizontal_offset"],this.draw,this)}process_click(t){super.process_click(t),"select"===t&&(this.event_listeners.parent_clicked=this.reset_selection,this.event_listeners.element_clicked=this.bar_click_handler)}draw_zero_line(){this.set_scale_orientation();const t=this.range_scale;"vertical"===this.model.get("orientation")?this.d3el.select(".zeroLine").attr("x1",0).attr("x2",this.parent.plotarea_width).attr("y1",t.scale(this.model.base_value)).attr("y2",t.scale(this.model.base_value)):this.d3el.select(".zeroLine").attr("x1",t.scale(this.model.base_value)).attr("x2",t.scale(this.model.base_value)).attr("y1",0).attr("y2",this.parent.plotarea_height)}relayout(){this.set_ranges(),this.compute_view_padding(),this.draw_zero_line(),this.x.rangeRound(this.set_x_range()),this.x.padding(this.model.get("padding")),this.adjust_offset(),this.x1.rangeRound([0,this.x.bandwidth().toFixed(2)]),this.draw_bars()}invert_point(t){if(void 0===t)return this.model.set("selected",null),void this.touch();const e=this.x_pixels.map(function(e){return Math.abs(e-t)});this.model.set("selected",new Uint32Array([e.indexOf(r.min(e))])),this.touch()}selector_changed(t,e){if(void 0===t)return this.model.set("selected",null),this.touch(),[];const n=this.pixel_coords,i=new Uint32Array(a.range(n.length)).filter(t=>{let i=n[t];for(let t=0;t<i.length;t++)if(e(i[t]))return!0;return!1});this.model.set("selected",i),this.touch()}update_selected(t,e){this.selected_indices=e,this.apply_styles()}draw(t){this.set_ranges();const e=this;let n=this.d3el.selectAll(".bargroup").data(this.model.mark_data,function(t){return t.key});const i=this.dom_scale;if("ordinal"!==i.model.type){const t=this.model.mark_data.map(function(t){return t.key});this.x.domain(t)}else this.x.domain(i.scale.domain());this.x.rangeRound(this.set_x_range()),this.x.padding(this.model.get("padding")),this.adjust_offset(),this.x1.rangeRound([0,this.x.bandwidth().toFixed(2)]),this.model.mark_data.length>0&&this.x1.domain(a.range(this.model.mark_data[0].values.length)).rangeRound([0,this.x.bandwidth().toFixed(2)]),n.exit().remove(),(n=n.enter().append("g").attr("class","bargroup").merge(n)).order(),n.on("click",function(t,n){return e.event_dispatcher("element_clicked",{data:t,index:n})});const r=n.selectAll(".bar").data(function(t){return t.values});if(r.enter().append("rect").attr("class","bar").attr("width",0).attr("height",0),r.exit().remove(),this.model.get("label_display")||n.selectAll("text").remove(),this.model.get("label_display")){const t=n.selectAll(".bar_label").data(function(t){return t.values});t.exit().remove(),t.enter().append("text").attr("class","bar_label").attr("width",0).attr("height",0)}this.draw_bars(t),this.apply_styles(),this.d3el.selectAll(".zeroLine").remove(),this.d3el.append("g").append("line").attr("class","zeroLine"),this.draw_zero_line()}draw_bars(t){const e=this.d3el.selectAll(".bargroup"),n=e.selectAll(".bar"),i=!0===t?this.parent.model.get("animation_duration"):0,o=!0===t?"update_bars":"draw_bars",a=this,s=this.model.get("orientation"),c=this.dom_scale,l=this.range_scale,u="vertical"===s?"x":"y",h="vertical"===s?"y":"x",d="vertical"===s?"width":"height",f="vertical"===s?"height":"width";if("ordinal"===c.model.type){const t=r.max(this.parent.range(u));e.attr("transform",function(e){return"vertical"===s?"translate("+((void 0!==c.scale(e.key)?c.scale(e.key):t)+a.dom_offset)+", 0)":"translate(0, "+((void 0!==c.scale(e.key)?c.scale(e.key):t)+a.dom_offset)+")"})}else e.attr("transform",function(t){return"vertical"===s?"translate("+(c.scale(t.key)+a.dom_offset)+", 0)":"translate(0, "+(c.scale(t.key)+a.dom_offset)+")"});const p="stacked"===this.model.get("type");let m=1;p?(m=Math.max(1,this.x.bandwidth()),n.transition(o).duration(i).attr(u,0).attr(d,m.toFixed(2)).attr(h,function(t){return"y"===h?l.scale(t.y1):l.scale(t.y0)}).attr(f,function(t){return Math.abs(l.scale(t.y1+t.y_ref)-l.scale(t.y1))})):(m=Math.max(1,this.x1.bandwidth()),n.transition(o).duration(i).attr(u,function(t,e){return a.x1(e)}).attr(d,m.toFixed(2)).attr(h,function(t){return r.min([l.scale(t.y),l.scale(a.model.base_value)])}).attr(f,function(t){return Math.abs(l.scale(a.model.base_value)-l.scale(t.y))})),this.manageBarLabels(e,m,u,h),this.pixel_coords=this.model.mark_data.map(function(t){const e=t.key,n=c.scale(e)+a.dom_offset;return t.values.map(function(t){const e={};return e[u]=p?n:n+a.x1(t.sub_index),e[h]=p?"y"===h?l.scale(t.y1):l.scale(t.y0):r.min([l.scale(t.y),l.scale(a.model.base_value)]),e[d]=m,e[f]=p?Math.abs(l.scale(t.y1+t.y_ref)-l.scale(t.y1)):Math.abs(l.scale(a.model.base_value)-l.scale(t.y_ref)),[[e.x,e.x+e.width],[e.y,e.y+e.height]]})}),this.x_pixels=this.model.mark_data.map(function(t){return c.scale(t.key)+c.offset})}get offsetVertical(){return this.model.get("label_display_vertical_offset")}get offsetHorizontal(){return this.model.get("label_display_horizontal_offset")}get baseLine(){return this.model.get("base")}get barOrientation(){return this.model.get("orientation")}manageBarLabels(t,e,n,i){this.model.get("label_display")&&("stacked"===this.model.get("type")?this.stackedBarLabels(t,e,n,i):this.groupedBarLabels(t,e),this.updateBarLabelsStyle())}stackedBarLabels(t,e,n,i){const r=this.baseLine,o=this.barOrientation;t.selectAll(".bar_label").attr(n,t=>0).attr(i,t=>t.y<=r?this.range_scale.scale(t.y0):this.range_scale.scale(t.y1)).style("font-weight","400").style("text-anchor",(t,e)=>this.styleBarLabelTextAnchor(t,o,r)).style("dominant-baseline",(t,e)=>this.styleBarLabelDominantBaseline(t,r,o)).attr("transform",(t,n)=>this.transformBarLabel(t,r,this.offsetHorizontal,this.offsetVertical,e,o))}groupedBarLabels(t,e){const n=this.baseLine,i=this.barOrientation;t.selectAll(".bar_label").attr("x",(t,e)=>"horizontal"===i?this.range_scale.scale(t.y):this.x1(e)).attr("y",(t,e)=>"horizontal"===i?this.x1(e):this.range_scale.scale(t.y)).style("font-weight","400").style("text-anchor",(t,e)=>this.styleBarLabelTextAnchor(t,i,n)).style("dominant-baseline",(t,e)=>this.styleBarLabelDominantBaseline(t,n,i)).attr("transform",(t,r)=>this.transformBarLabel(t,n,this.offsetHorizontal,this.offsetVertical,e,i))}transformBarLabel(t,e,n,i,r,o){return"horizontal"===o?t.y<=e?`translate(${t.y0<=e?0-i:0+i}, ${r/2+n})`:`translate(${t.y1<=e?0-i:0+i}, ${r/2+n})`:t.y<=e?`translate(${r/2+n},\n ${t.y0<=e?0-i:0+i})`:`translate(${r/2+n},\n ${t.y1<=e?0-i:0+i})`}styleBarLabelTextAnchor(t,e,n){return"horizontal"===e?t.y<=n?"start":"end":"middle"}styleBarLabelDominantBaseline(t,e,n){return"horizontal"===n?"central":t.y<=e?"text-after-edge":"text-before-edge"}updateBarLabelsStyle(){const t=this.model.get("label_display_format"),e=t?r.format(t):null;let n=this.d3el.selectAll(".bar_label").text((t,n)=>e?e(t.y):null);const i=this.model.get("label_font_style");for(const t in i)n=n.style(t,i[t])}update_type(t,e){this.model.update_domains(),this.draw()}update_colors(){const t=this,e=this.scales.color;this.model.mark_data.length>0&&(this.model.is_y_2d?this.d3el.selectAll(".bargroup").selectAll(".bar").style("fill",function(n,i){return void 0!==n.color&&void 0!==e?e.scale(n.color):t.get_colors(n.color_index)}):this.d3el.selectAll(".bar").style("fill",function(n,i){return void 0!==n.color&&void 0!==e?e.scale(n.color):t.get_colors(n.color_index)})),this.legend_el&&(this.legend_el.selectAll(".legendrect").style("fill",function(n,i){return n.color&&e?e.scale(n.color):t.get_colors(n.color_index)}),this.legend_el.selectAll(".legendtext").style("fill",function(n,i){return void 0!==n.color&&void 0!==e?e.scale(n.color):t.get_colors(n.color_index)}))}draw_legend(t,e,n,i,o){if(!this.model.is_y_2d&&1!==this.model.get("colors").length&&"element"!==this.model.get("color_mode"))return[0,0];const s=this.model.mark_data[0].values.map(function(t){return{index:t.sub_index,color:t.color,color_index:t.color_index}}),c=this.scales.color;this.legend_el=t.selectAll(".legend"+this.uuid).data(s);const l=this,u=.8*o,h=this.legend_el.enter().append("g").attr("class","legend"+this.uuid).attr("transform",function(t,e){return"translate(0, "+(e*o+n)+")"}).on("mouseover",a.bind(function(){this.event_dispatcher("legend_mouse_over")},this)).on("mouseout",a.bind(function(){this.event_dispatcher("legend_mouse_out")},this)).on("click",a.bind(function(){this.event_dispatcher("legend_clicked")},this));h.append("rect").classed("legendrect",!0).style("fill",function(t,e){return void 0!==t.color&&void 0!==c?c.scale(t.color):l.get_colors(t.color_index)}).attr("x",0).attr("y",0).attr("width",u).attr("height",u),h.append("text").attr("class","legendtext").attr("x",1.2*u).attr("y",u/2).attr("dy","0.35em").text(function(t,e){return l.model.get("labels")[e]}).style("fill",function(t,e){return void 0!==t.color&&void 0!==c?c.scale(t.color):l.get_colors(t.color_index)}),h.merge(this.legend_el);const d=r.max(this.model.get("labels"),function(t){return t.length});return this.legend_el.exit().remove(),[this.model.mark_data[0].values.length,d]}clear_style(t,e){if(!e||0===e.length)return;if(0===Object.keys(t).length)return;const n=this.d3el.selectAll(".bargroup").filter((t,n)=>-1!==e.indexOf(n)),i={};for(const e in t)i[e]=null;n.selectAll(".bar").styles(i)}set_style_on_elements(t,e){e&&0!==e.length&&0!==Object.keys(t).length&&this.d3el.selectAll(".bargroup").filter((t,n)=>-1!==e.indexOf(n)).selectAll(".bar").styles(t)}set_default_style(t){if(!t||0===t.length)return;const e=this.d3el.selectAll(".bargroup").filter((e,n)=>-1!==t.indexOf(n)),n=this.model.get("fill"),i=this.model.get("stroke"),r=this.model.get("stroke_width");e.selectAll(".bar").style("fill",n?this.get_mark_color.bind(this):"none").style("stroke",i||this.get_mark_color.bind(this)).style("opacity",this.get_mark_opacity.bind(this)).style("stroke-width",r)}set_x_range(){const t=this.dom_scale;return"ordinal"===t.model.type?t.scale.range():[t.scale(r.min(this.x.domain())),t.scale(r.max(this.x.domain()))]}bar_click_handler(t){const e=t.index,n=this,i=this.model.get("selected")||[];let s=Array.from(i);const c=s.indexOf(e),l=o().ctrlKey||o().metaKey;if(c>-1&&l)s.splice(c,1);else if(o().shiftKey){if(c>-1)return;const t=0!==s.length?r.min(s):-1,i=0!==s.length?r.max(s):n.model.mark_data.length;e>i?a.range(i+1,e+1).forEach(function(t){s.push(t)}):e<t&&a.range(e,t).forEach(function(t){s.push(t)})}else l?s.push(e):(s=[]).push(e);this.model.set("selected",0===s.length?null:new Uint32Array(s),{updated_view:this}),this.touch();const u=o();void 0!==u.cancelBubble&&(u.cancelBubble=!0),u.stopPropagation&&u.stopPropagation(),u.preventDefault()}reset_selection(){this.model.set("selected",null),this.selected_indices=null,this.touch()}compute_view_padding(){const t=this.dom_scale,e=this.model.get("orientation");let n=0;const i="vertical"===e?this.parent.plotarea_width:this.parent.plotarea_height;t&&null!==this.x&&void 0!==this.x&&0!==this.x.domain().length&&("ordinal"!==t.model.type?"center"===this.model.get("align")?n=i/(2*this.x.domain().length)+1:"left"!==this.model.get("align")&&"right"!==this.model.get("align")||(n=i/this.x.domain().length+1):"left"!==this.model.get("align")&&"right"!==this.model.get("align")||(n=parseFloat((this.x.bandwidth()/2).toFixed(2)))),"vertical"===e?n!==this.x_padding&&(this.x_padding=n,this.trigger("mark_padding_updated")):n!==this.y_padding&&(this.y_padding=n,this.trigger("mark_padding_updated"))}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(10)),o=n(28);class a extends r.WidgetModel{defaults(){return Object.assign({},r.WidgetModel.prototype.defaults(),{_model_name:"HandDrawModel",_view_name:"HandDraw",_model_module:"bqplot",_view_module:"bqplot",_model_module_version:o.semver_range,_view_module_version:o.semver_range,lines:null,line_index:0,min_x:null,max_x:null})}}a.serializers=Object.assign({},r.DOMWidgetModel.serializers,{lines:{deserialize:r.unpack_models}}),e.HandDrawModel=a},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=i(n(6)),a=n(19),s=function(){return n(0).event}.bind(this);e.OHLC=class extends a.Mark{render(){const t=super.render();this.selected_indices=this.model.get("selected"),this.selected_style=this.model.get("selected_style"),this.unselected_style=this.model.get("unselected_style"),this.display_el_classes=["stick_body","stick_tail","stick_head"];const e=this;return this.displayed.then(function(){e.parent.tooltip_div.node().appendChild(e.tooltip_div.node()),e.create_tooltip()}),t.then(function(){e.event_listeners={},e.process_interactions(),e.create_listeners(),e.draw()})}set_ranges(){const t=this.scales.x;t&&t.set_range(this.parent.padded_range("x",t.model));const e=this.scales.y;e&&e.set_range(this.parent.padded_range("y",e.model))}set_positional_scales(){const t=this.scales.x,e=this.scales.y;this.listenTo(t,"domain_changed",function(){this.model.dirty||this.draw()}),this.listenTo(e,"domain_changed",function(){this.model.dirty||this.draw()})}create_listeners(){super.create_listeners.apply(this),this.d3el.on("mouseover",o.bind(function(){this.event_dispatcher("mouse_over")},this)).on("mousemove",o.bind(function(){this.event_dispatcher("mouse_move")},this)).on("mouseout",o.bind(function(){this.event_dispatcher("mouse_out")},this)),this.listenTo(this.model,"change:tooltip",this.create_tooltip),this.listenTo(this.model,"change:interactions",this.process_interactions),this.listenTo(this.model,"change:selected",this.update_selected),this.listenTo(this.model,"change:stroke",this.update_stroke),this.listenTo(this.model,"change:stroke_width",this.update_stroke_width),this.listenTo(this.model,"change:colors",this.update_colors),this.listenTo(this.model,"change:opacities",this.update_opacities),this.listenTo(this.model,"change:marker",this.update_marker),this.listenTo(this.model,"format_updated",this.draw),this.listenTo(this.model,"data_updated",this.draw),this.listenTo(this.parent,"bg_clicked",function(){this.event_dispatcher("parent_clicked")})}process_click(t){super.process_click(t),"select"===t&&(this.event_listeners.parent_clicked=this.reset_selection,this.event_listeners.element_clicked=this.ohlc_click_handler)}reset_selection(){this.model.set("selected",null),this.selected_indices=null,this.touch()}update_selected(t,e){this.selected_indices=e,this.apply_styles()}ohlc_click_handler(t){const e=t.index,n=this,i=this.model.get("selected")||[];let a=Array.from(i);const c=a.indexOf(e),l=s().ctrlKey||s().metaKey;if(c>-1&&l)a.splice(c,1);else if(s().shiftKey){if(c>-1)return;const t=0!==a.length?r.min(a):-1,i=0!==a.length?r.max(a):n.model.mark_data.length;e>i?o.range(i+1,e+1).forEach(function(t){a.push(t)}):e<t&&o.range(e,t).forEach(function(t){a.push(t)})}else l?a.push(e):(a=[]).push(e);this.model.set("selected",0===a.length?null:a,{updated_view:this}),this.touch();const u=s();void 0!==u.cancelBubble&&(u.cancelBubble=!0),u.stopPropagation&&u.stopPropagation(),u.preventDefault()}update_stroke(){const t=this.model.get("stroke");this.d3el.selectAll(".stick").style("stroke",t),this.legend_el&&(this.legend_el.selectAll("path").style("stroke",t),this.legend_el.selectAll("text").style("fill",t))}update_stroke_width(){const t=this.model.get("stroke_width");this.d3el.selectAll(".stick").attr("stroke-width",t)}update_colors(){const t=this,e=this.model.get("colors"),n=e[0]?e[0]:"none",i=e[1]?e[1]:"none";this.d3el.selectAll(".stick").style("fill",function(e){return e.y[t.model.px.o]>e.y[t.model.px.c]?i:n}),this.legend_el&&this.legend_el.selectAll("path").style("fill",n)}update_opacities(){const t=this.model.get("opacities");this.d3el.selectAll(".stick").style("opacity",function(e,n){return t[n]}),this.legend_el&&this.legend_el.selectAll("path").attr("opacity",function(e,n){return t[n]})}update_marker(){const t=this.model.get("marker");this.legend_el&&this.rect_dim&&this.draw_legend_icon(this.rect_dim,this.legend_el),this.draw_mark_paths(t,this.d3el,this.model.mark_data.map(function(t,e){return t[1]}))}update_selected_colors(t,e){let n=o.range(t,e+1);n.length==this.model.mark_data.length&&(n=[]);const i=this,r=this.model.get("stroke"),a=this.model.get("colors"),s=a[0]?a[0]:r,c=a[1]?a[1]:r,l=this.model.px;o.range(0,this.model.mark_data.length).forEach(function(t){i.d3el.selectAll("#stick"+t).style("stroke",r)}),n.forEach(function(t){i.d3el.selectAll("#stick"+t).style("stroke",function(t){return t[l.o]>t[l.c]?c:s})})}invert_range(t,e){if(void 0===t||void 0===e||0===this.model.mark_data.length)return this.update_selected_colors(-1,-1),[];const n=new Uint32Array(o.range(this.model.mark_data.length)),i=this,r=n.filter(n=>{const r=i.x_pixels[n];return r>=t&&r<=e}),a=this.scales.x;let s=-1,c=-1;return r.length>0&&(t!==a.scale.range()[0]||e!==a.scale.range()[1])&&(s=r[0],c=r[r.length-1]),this.update_selected_colors(s,c),this.model.set("selected",r),this.touch(),super.invert_range(t,e)}invert_point(t){const e=this.x_pixels.map(function(e){return Math.abs(e-t)}),n=e.indexOf(r.min(e));this.update_selected_colors(n,n),this.model.set("selected",[n]),this.touch()}draw(){const t=this.scales.x,e=this.scales.y;this.set_ranges();const n=this.model.get("colors"),i=this.model.get("opacities"),o=n[0]?n[0]:"none",a=n[1]?n[1]:"none",s=this.model.px,c=this.d3el.selectAll(".stick").data(this.model.mark_data.map(function(t,e){return{x:t[0],y:t[1],index:e}})),l=c.enter().append("g").attr("class","stick").attr("id",function(t,e){return"stick"+e}).style("stroke",this.model.get("stroke")).style("opacity",function(t,e){return i[e]});l.append("path").attr("class","stick_head"),l.append("path").attr("class","stick_tail"),l.append("path").attr("class","stick_body"),c.exit().remove();const u=this;let h=s.h;if(-1===s.h&&(h=s.o),this.d3el.selectAll(".stick").style("fill",function(t,e){return t.y[s.o]>t.y[s.c]?a:o}).attr("stroke-width",this.model.get("stroke_width")),"ordinal"===t.model.type){const n=r.max(this.parent.range("x"));this.d3el.selectAll(".stick").attr("transform",function(i,r){return"translate("+((void 0!==t.scale(u.model.mark_data[r][0])?t.scale(u.model.mark_data[r][0]):n)+t.scale.bandwidth()/2)+","+(e.scale(i.y[h])+e.offset)+")"})}else this.d3el.selectAll(".stick").attr("transform",function(n,i){return"translate("+(t.scale(u.model.mark_data[i][0])+t.offset)+","+(e.scale(n.y[h])+e.offset)+")"});this.d3el.selectAll(".stick").on("click",(t,e)=>u.event_dispatcher("element_clicked",{data:t,index:e})),this.draw_mark_paths(this.model.get("marker"),this.d3el,this.model.mark_data.map(function(t){return t[1]})),this.x_pixels=this.model.mark_data.map(function(e){return t.scale(e[0])+t.offset})}draw_mark_paths(t,e,n){const i=this.model.px,r=this,o=[],a=[],s=[],c=[],l=[],u=[],h=[],d=[];let f=this.calculate_mark_width();const p=this.scales.x,m=this.scales.y;let g,_;for(var v=0;v<n.length;v++)-1===i.o?o[v]=void 0:o[v]=m.scale(n[v][i.o]),-1===i.c?c[v]=void 0:c[v]=m.scale(n[v][i.c]),-1!==i.o&&-1!==i.c&&(l[v]=n[v][i.o]>n[v][i.c]?o[v]:c[v],u[v]=n[v][i.o]<n[v][i.c]?o[v]:c[v]),-1===i.h||-1===i.l?(a[v]=o[v],s[v]=c[v]):(a[v]=m.scale(n[v][i.h]),s[v]=m.scale(n[v][i.l])),_=r.model.mark_data[v][0],f instanceof Date&&(f=f.getTime()),_ instanceof Date&&(_=_.getTime()),g=_+f,"ordinal"===p.model.type?d[v]=.75*p.scale.bandwidth():d[v]=.75*(p.scale(g)-p.scale(_)),h[v]=-1*d[v]/2;"candle"==t&&-1!==i.o&&-1!==i.c?(-1!==i.h||-1!==i.l?(e.selectAll(".stick_head").attr("d",function(t,e){return r.head_path_candle(l[e]-a[e])}),e.selectAll(".stick_tail").attr("d",function(t,e){return r.tail_path_candle(u[e]-a[e],s[e]-u[e])})):(e.selectAll(".stick_head").attr("d",""),e.selectAll(".stick_tail").attr("d","")),e.selectAll(".stick_body").attr("d",function(t,e){return r.body_path_candle(h[e],o[e]-a[e],d[e],c[e]-o[e])})):(-1!==i.o?e.selectAll(".stick_head").attr("d",function(t,e){return r.head_path_bar(h[e],o[e]-a[e],-1*h[e])}):e.selectAll(".stick_head").attr("d",""),-1!==i.c?e.selectAll(".stick_tail").attr("d",function(t,e){return r.tail_path_bar(c[e]-a[e],-1*h[e])}):e.selectAll(".stick_tail").attr("d",""),e.selectAll(".stick_body").attr("d",function(t,e){return r.body_path_bar(s[e]-a[e])}))}head_path_candle(t){return"m0,0 l0,"+t}tail_path_candle(t,e){return"m0,"+t+" l0,"+e}body_path_candle(t,e,n,i){return"m"+t+","+e+" l"+n+",0 l0,"+i+" l"+-1*n+",0 z"}head_path_bar(t,e,n){return"m"+t+","+e+" l"+n+",0"}tail_path_bar(t,e){return"m0,"+t+" l"+e+",0"}body_path_bar(t){return"m0,0 l0,"+t}calculate_mark_width(){const t=this;let e=Number.POSITIVE_INFINITY;const n=this.model.get("scales").x;for(var i=1;i<t.model.mark_data.length;i++){const n=t.model.mark_data[i][0]-t.model.mark_data[i-1][0];n<e&&(e=n)}return e===Number.POSITIVE_INFINITY&&(e=(n.domain[1]-n.domain[0])/2),e<0&&(e*=-1),e}relayout(){super.relayout(),this.set_ranges(),this.d3el.select(".intselmouse").attr("width",this.width).attr("height",this.height),this.draw()}draw_legend(t,e,n,i,a){const s=this.model.get("stroke"),c=this.model.get("colors"),l=c[0]?c[0]:"none";this.rect_dim=.8*a;const u=this;this.legend_el=t.selectAll("#legend"+this.uuid).data([this.model.mark_data]);const h=this.legend_el.enter().append("g").attr("transform",function(t,e){return"translate(0, "+(e*a+n)+")"}).attr("class","legend").attr("id","legend"+this.uuid).style("fill",l).on("mouseover",o.bind(this.highlight_axes,this)).on("mouseout",o.bind(this.unhighlight_axes,this));h.append("path").attr("class","stick_head stick"),h.append("path").attr("class","stick_tail stick"),h.append("path").attr("class","stick_body stick").style("fill",l),h.selectAll("path").style("stroke",s).attr("transform","translate("+u.rect_dim/2+",0)"),this.draw_legend_icon(u.rect_dim,h),this.legend_el.append("text").attr("class","legendtext sticktext").attr("x",1.2*u.rect_dim).attr("y",u.rect_dim/2).attr("dy","0.35em").text(function(t,e){return u.model.get("labels")[e]}).style("fill",s);const d=r.max(this.model.get("labels"),function(t){return Number(t.length)});return this.legend_el.exit().remove(),[1,d]}draw_legend_icon(t,e){const n=t,i=t/2,r=3*t/4,o=t/4;"candle"===this.model.get("marker")?(e.selectAll(".stick_head").attr("d",this.head_path_candle(i/2)),e.selectAll(".stick_tail").attr("d",this.tail_path_candle(r,i/2)),e.selectAll(".stick_body").attr("d",this.body_path_candle(-1*i/2,o,i,n/2))):(e.selectAll(".stick_head").attr("d",this.head_path_bar(-1*i/2,r,i/2)),e.selectAll(".stick_tail").attr("d",this.tail_path_bar(o,i/2)),e.selectAll(".stick_body").attr("d",this.body_path_bar(n)))}clear_style(){}compute_view_padding(){}set_default_style(){}set_style_on_elements(){}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=i(n(6)),a=i(n(18)),s=i(n(12));class c extends a.MarkModel{defaults(){return Object.assign({},a.MarkModel.prototype.defaults(),{_model_name:"BarsModel",_view_name:"Bars",x:[],y:[],color:null,scales_metadata:{x:{orientation:"horizontal",dimension:"x"},y:{orientation:"vertical",dimension:"y"},color:{dimension:"color"}},color_mode:"auto",type:"stacked",colors:["steelblue"],padding:.05,fill:!0,stroke:null,stroke_width:1,base:0,opacities:[],orientation:"vertical",align:"center",label_display:!1,label_display_format:".2f",label_display_font_style:{},label_display_horizontal_offset:0,label_display_vertical_offset:0})}initialize(t,e){super.initialize(t,e),this.is_y_2d=!1,this.on_some_change(["x","y","base"],this.update_data,this),this.on("change:color",function(){this.update_color(),this.trigger("colors_updated")},this),this.on_some_change(["preserve_domain"],this.update_domains,this),this.update_data(),this.update_color(),this.update_domains()}update_data(){let t=this.get("x"),e=this.get("y");e=0!==e.length&&o.isNumber(e[0])?[e]:e;const n=this;this.base_value=this.get("base"),void 0!==this.base_value&&null!==this.base_value||(this.base_value=0),0===t.length||0===e.length?(this.mark_data=[],this.is_y_2d=!1):(t=t.slice(0,r.min(e.map(function(t){return t.length}))),this.mark_data=Array.prototype.map.call(t,function(t,i){const r={};let o=n.base_value,a=n.base_value,s=n.base_value;return r.key=t,r.values=Array.prototype.map.call(e,function(e,r){const c=e[i]-n.base_value,l=c>=0;return{index:i,sub_index:r,x:t,y0:l?o:s+=c,y1:l?o+=c:(a+=c)-c,y_ref:c,y:e[i]}}),r.pos_max=o,r.neg_max=a,r}),this.is_y_2d=this.mark_data[0].values.length>1,this.update_color()),this.update_domains(),this.trigger("data_updated")}get_data_dict(t,e){return t}update_color(){if(!this.mark_data)return;const t=this.get("color")||[],e=this.get("scales").color,n=this.get("color_mode"),i="group"===n||"auto"===n&&!this.is_y_2d;this.mark_data.forEach(function(e,n){e.values.forEach(function(e,r){e.color_index=i?n:r,e.color=t[e.color_index]})}),e&&t.length>0&&(this.get("preserve_domain").color?e.del_domain([],this.model_id+"_color"):e.compute_and_set_domain(t,this.model_id+"_color"))}update_domains(){if(!this.mark_data)return;const t=this.get("scales"),e=t.x,n=t.y;if(this.get("preserve_domain").x?e.del_domain([],this.model_id+"_x"):e.compute_and_set_domain(this.mark_data.map(function(t){return t.key}),this.model_id+"_x"),this.get("preserve_domain").y)n.del_domain([],this.model_id+"_y");else if("stacked"===this.get("type"))n.compute_and_set_domain([r.min(this.mark_data,function(t){return t.neg_max}),r.max(this.mark_data,function(t){return t.pos_max}),this.base_value],this.model_id+"_y");else{const t=r.min(this.mark_data,function(t){return r.min(t.values,function(t){return t.y_ref})}),e=r.max(this.mark_data,function(t){return r.max(t.values,function(t){return t.y_ref})});n.compute_and_set_domain([t,e,this.base_value],this.model_id+"_y")}}}c.serializers=Object.assign({},a.MarkModel.serializers,{x:s.array_or_json,y:s.array_or_json,color:s.array_or_json}),e.BarsModel=c},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(6)),o=i(n(2)),a=function(){return n(0).event}.bind(this),s=i(n(17)),c=n(19);e.Hist=class extends c.Mark{render(){const t=super.render();this.selected_indices=this.calc_bar_indices_from_data_idx(this.model.get("selected")),this.selected_style=this.model.get("selected_style"),this.unselected_style=this.model.get("unselected_style"),this.display_el_classes=["rect","legendtext"];const e=this;return this.displayed.then(function(){e.parent.tooltip_div.node().appendChild(e.tooltip_div.node()),e.create_tooltip()}),t.then(function(){e.event_listeners={},e.process_interactions(),e.create_listeners(),e.draw(),e.update_selected(e.model,e.model.get("selected"))})}set_ranges(){const t=this.scales.sample;t&&t.set_range(this.parent.padded_range("x",t.model));const e=this.scales.count;e&&e.set_range(this.parent.padded_range("y",e.model))}set_positional_scales(){const t=this.scales.sample,e=this.scales.count;this.listenTo(t,"domain_changed",function(){this.model.dirty||this.model.update_data()}),this.listenTo(e,"domain_changed",function(){this.model.dirty||this.draw()})}create_listeners(){super.create_listeners(),this.d3el.on("mouseover",r.bind(function(){this.event_dispatcher("mouse_over")},this)).on("mousemove",r.bind(function(){this.event_dispatcher("mouse_move")},this)).on("mouseout",r.bind(function(){this.event_dispatcher("mouse_out")},this)),this.listenTo(this.model,"change:tooltip",this.create_tooltip),this.listenTo(this.model,"data_updated",this.draw),this.listenTo(this.model,"change:colors",this.update_colors),this.model.on_some_change(["stroke","opacities"],this.update_stroke_and_opacities,this),this.listenTo(this.model,"change:selected",this.update_selected),this.listenTo(this.model,"change:interactions",this.process_interactions),this.listenTo(this.parent,"bg_clicked",function(){this.event_dispatcher("parent_clicked")})}process_click(t){super.process_click(t),"select"===t&&(this.event_listeners.parent_clicked=this.reset_selection,this.event_listeners.element_clicked=this.bar_click_handler)}update_colors(){this.d3el.selectAll(".bargroup").selectAll("rect").style("fill",(t,e)=>this.get_colors(t.index)),this.model.get("labels")&&this.d3el.selectAll(".bargroup").selectAll("text").style("fill",(t,e)=>this.get_colors(e)),this.legend_el&&(this.legend_el.selectAll("rect").style("fill",(t,e)=>this.get_colors(e)),this.legend_el.selectAll("text").style("fill",(t,e)=>this.get_colors(e)))}update_stroke_and_opacities(){const t=this.model.get("stroke"),e=this.model.get("opacities");this.d3el.selectAll(".rect").style("stroke",t).style("opacity",function(t,n){return e[n]})}calculate_bar_width(){const t=this.scales.sample;let e=(t.scale(this.model.max_x)-t.scale(this.model.min_x))/this.model.num_bins;return e>=10&&(e-=2),e}relayout(){this.set_ranges();const t=this.scales.sample,e=this.scales.count;this.d3el.selectAll(".bargroup").attr("transform",function(n){return"translate("+t.scale(n.x0)+","+e.scale(n.y)+")"});const n=this.calculate_bar_width();this.d3el.selectAll(".bargroup").select("rect").transition("relayout").duration(this.parent.model.get("animation_duration")).attr("x",2).attr("width",n).attr("height",function(t){return e.scale(0)-e.scale(t.y)})}draw(){this.set_ranges();const t=[];this.model.mark_data.forEach(function(e,n){t.push(n)});const e=this.scales.sample,n=this.scales.count,i=this,r=this.calculate_bar_width();let o=this.d3el.selectAll(".bargroup").data(this.model.mark_data);o.exit().remove();const a=o.enter().append("g").attr("class","bargroup");a.append("rect").attr("class","rect").attr("x",2).attr("width",0).attr("height",0),(o=a.merge(o)).attr("transform",function(t){return"translate("+e.scale(t.x0)+","+n.scale(t.y)+")"}),o.select(".rect").style("fill",(t,e)=>this.get_colors(t.index)).on("click",function(t,e){return i.event_dispatcher("element_clicked",{data:t,index:e})}).attr("id",function(t,e){return"rect"+e}).transition("draw").duration(this.parent.model.get("animation_duration")).attr("width",r).attr("height",function(t){return n.scale(0)-n.scale(t.y)}),this.bin_pixels=this.model.x_bins.map(function(t){return e.scale(t)+e.offset}),this.pixel_coords=this.model.mark_data.map(function(t){const i=e.scale(t.x0);return[[i,i+r],[0,t.y].map(n.scale)]}),this.update_stroke_and_opacities()}bar_click_handler(t){const e=t.index,n=this,i=this.selected_indices;let c=i?s.deepCopy(i):[];const l=c.indexOf(e),u=a().ctrlKey||a().metaKey;if(l>-1&&u)c.splice(l,1);else if(a().shiftKey){if(l>-1)return;const t=0!==c.length?o.min(c):-1,i=0!==c.length?o.max(c):n.model.mark_data.length;e>i?r.range(i+1,e+1).forEach(function(t){c.push(t)}):e<t&&r.range(e,t).forEach(function(t){c.push(t)})}else u?c.push(e):(c=[]).push(e);this.selected_indices=c,this.model.set("selected",0===c.length?null:this.calc_data_indices(c),{updated_view:this}),this.touch();let h=a();void 0!==h.cancelBubble&&(h.cancelBubble=!0),h.stopPropagation&&h.stopPropagation(),h.preventDefault()}draw_legend(t,e,n,i,a){this.legend_el=t.selectAll(".legend"+this.uuid).data([this.model.mark_data[0]]);const s=this,c=.8*a,l=this.legend_el.enter().append("g").attr("class","legend"+this.uuid).attr("transform",function(t,e){return"translate(0, "+(e*a+n)+")"}).on("mouseover",r.bind(function(){this.event_dispatcher("legend_mouse_over")},this)).on("mouseout",r.bind(function(){this.event_dispatcher("legend_mouse_out")},this)).on("click",r.bind(function(){this.event_dispatcher("legend_clicked")},this));l.append("rect").style("fill",function(t,e){return s.get_colors(e)}).attr("x",0).attr("y",0).attr("width",c).attr("height",c),l.append("text").attr("class","legendtext").attr("x",1.2*c).attr("y",c/2).attr("dy","0.35em").text(function(t,e){return s.model.get("labels")[e]}).style("fill",function(t,e){return s.get_colors(e)}),l.merge(this.legend_el);const u=o.max(this.model.get("labels"),function(t){return t.length});return this.legend_el.exit().remove(),[1,u]}update_selected(t,e){this.selected_indices=this.calc_bar_indices_from_data_idx(e),this.apply_styles()}clear_style(t,e){let n=this.d3el.selectAll(".bargroup");e&&(n=n.filter(function(t,n){return-1!==e.indexOf(n)}));const i={};for(const e in t)i[e]=null;n.selectAll(".bar").styles(i)}set_default_style(t,e){this.update_colors(),this.update_stroke_and_opacities()}set_style_on_elements(t,e){if(null==e||0===e.length)return;if(0===Object.keys(t).length)return;let n=this.d3el.selectAll(".bargroup");(n=n.filter(function(t,n){return-1!==e.indexOf(n)})).selectAll(".rect").styles(t)}invert_point(t){if(void 0===t)return this.model.set("selected",null),void this.touch();const e=this.calculate_bar_width(),n=this.bin_pixels.map(function(n){return Math.abs(n+e/2-t)}),i=n.indexOf(o.min(n));this.model.set("selected",this.calc_data_indices([i])),this.touch()}selector_changed(t,e){if(void 0===t)return this.model.set("selected",null),this.touch(),[];const n=this.pixel_coords,i=new Uint32Array(r.range(n.length)).filter(t=>e(n[t]));this.model.set("selected",this.calc_data_indices(i)),this.touch()}calc_data_indices(t){const e=this.reduce_intervals(t);if(0===e.length)return[];const n=this.model.get("sample"),i=e.length;return new Uint32Array(r.range(n.length)).filter(t=>{const r=n[t];for(let t=0;t<i;t++)if(r<=e[t][1]&&r>=e[t][0])return!0;return!1})}reduce_intervals(t){const e=[];if(0!==t.length){t.sort();let n=t[0],i=t[0];for(let r=1;r<t.length;r++)t[r]===i+1?i++:(e.push([this.model.x_bins[n],this.model.x_bins[i+1]]),n=i=t[r]);e.push([this.model.x_bins[n],this.model.x_bins[i+1]])}return e}calc_data_indices_from_data_range(t,e){const n=o.max([0,o.bisectLeft(this.bin_pixels,t)-1]),i=o.min([this.model.num_bins,o.bisectRight(this.bin_pixels,e)]),a=this.model.get("sample"),s=this;return r.filter(r.range(a.length),function(t){return a[t]>=s.model.x_bins[n]&&a[t]<=s.model.x_bins[i]})}calc_bar_indices_from_data_idx(t){if(null===t)return null;const e=this.model.get("sample"),n=Array.from(t).map(function(t){return e[t]});let i=[];for(let t=0;t<n.length;t++){let e=Math.min(r.indexOf(this.model.x_bins,n[t],!0),this.model.x_bins.length-2);-1===e&&(e=r.sortedIndex(this.model.x_bins,n[t])-1),i.push(e)}return i.sort(),i=r.uniq(i,!0)}reset_selection(){this.selected_indices=[],this.model.set("selected",null),this.touch()}compute_view_padding(){}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=i(n(6)),a=n(18),s=i(n(12));class c extends a.MarkModel{defaults(){return Object.assign({},a.MarkModel.prototype.defaults(),{_model_name:"OHLCModel",_view_name:"OHLC",x:[],y:[],scales_metadata:{x:{orientation:"horizontal",dimension:"x"},y:{orientation:"vertical",dimension:"y"}},marker:"candle",stroke:null,stroke_width:1,colors:["green","red"],opacities:[],format:"ohlc"})}initialize(t,e){super.initialize(t,e),this.on_some_change(["x","y"],this.update_data,this),this.on_some_change(["preserve_domain"],this.update_domains,this),this.on("change:format",this.update_format,this),this.px={o:-1,h:-1,l:-1,c:-1},this.mark_data=[],this.display_el_classes=["stick_body"],this.update_data(),this.update_domains(),this.update_format()}update_format(){this.update_data(),this.trigger("format_updated")}update_data(){let t=this.get("x"),e=this.get("y");const n=this.get("format");function i(t){console&&console.error("Invalid OHLC format: '"+t+"'")}if(this.px=n.toLowerCase().split("").reduce(function(r,o,a){return-1!==r[o]&&(i(n),t=[],e=[]),r[o]=a,r},{o:-1,h:-1,l:-1,c:-1}),-1!==this.px.h&&-1===this.px.l||-1===this.px.h&&-1!==this.px.l||n.length<2||n.length>4)i(n),t=[],e=[];else{const i=this.px;(-1===this.px.h||e.every(function(t){return t[i.h]===r.max(t)&&t[i.l]===r.min(t)}))&&e.every(function(t){return t.length===n.length})||(t=[],e=[],console&&console.error("Invalid OHLC data"))}t.length>e.length?t=t.slice(0,e.length):t.length<e.length&&(e=e.slice(0,t.length)),this.mark_data=o.zip(t,e),this.mark_data.forEach(function(t,e){t.index=e}),this.update_domains(),this.trigger("data_updated")}update_domains(){if(!this.mark_data)return;const t=this.get("scales"),e=t.x,n=t.y;let i,o,a=Number.POSITIVE_INFINITY,s=0,c=0,l=0;for(let t=0;t<this.mark_data.length;t++)t>0&&(c=this.mark_data[t][0]-this.mark_data[t-1][0])<a&&(a=c),(l=this.mark_data[t][this.px.h]-this.mark_data[t][this.px.l])>s&&(s=l);if(this.mark_data.length<2&&(a=0),this.get("preserve_domain").x||0===this.mark_data.length?e.del_domain([],this.model_id+"_x"):"ordinal"===e.type?e.compute_and_set_domain(this.mark_data.map(function(t){return t[0]})):(i=r.min(this.mark_data.map(function(t){return t[0]})),(o=r.max(this.mark_data.map(function(t){return t[0]})))instanceof Date&&(o=o.getTime()),e.set_domain([i-a/2,o+a/2],this.model_id+"_x")),this.get("preserve_domain").y||0===this.mark_data.length)n.del_domain([],this.model_id+"_y");else{let t=this.px.h,e=this.px.l;-1!==t&&-1!==e||(t=this.px.o,e=this.px.c),i=r.min(this.mark_data.map(function(n){return n[1][e]<n[1][t]?n[1][e]:n[1][t]})),(o=r.max(this.mark_data.map(function(n){return n[1][t]>n[1][e]?n[1][t]:n[1][e]})))instanceof Date&&(o=o.getTime()),n.set_domain([i-s,o+s],this.model_id+"_y")}}get_data_dict(t,e){const n=this,i={index:e,x:t.x};return["open","low","high","close"].forEach(function(e){i[e]=t.y[n.px[e.substr(0,1)]]}),i}}c.serializers=Object.assign({},a.MarkModel.serializers,{x:s.array_or_json,y:s.array_or_json}),e.OHLCModel=c},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=n(18),a=i(n(12));class s extends o.MarkModel{defaults(){return Object.assign({},o.MarkModel.prototype.defaults(),{_model_name:"HistModel",_view_name:"Hist",sample:[],count:[],scales_metadata:{sample:{orientation:"horizontal",dimension:"x"},count:{orientation:"vertical",dimension:"y"}},bins:10,midpoints:[],colors:["steelblue"],stroke:null,opacities:[],normalized:!1})}initialize(t,e){super.initialize(t,e),this.mark_data=[],this.on_some_change(["bins","sample","preserve_domain"],this.update_data,this),this.update_data(),this.on("change:normalized",function(){this.normalize_data(!0)},this),this.normalize_data(!0)}update_data(){let t=this.get("sample");const e=this.get("scales").sample;if(this.num_bins=this.get("bins"),0==t.length)this.mark_data=[],this.x_mid=[],this.count=[],this.x_bins=[];else{this.get("preserve_domain").sample?e.del_domain([],this.model_id+"_sample"):e.compute_and_set_domain(t,this.model_id+"_sample"),this.min_x=e.domain[0],this.max_x=e.domain[1];const n=this;t=t.filter(function(t){return t<=n.max_x&&t>=n.min_x});const i=Array.prototype.map.call(t,function(t,e){return{index:e,value:t}});this.x_bins=this.create_uniform_bins(this.min_x,this.max_x,this.num_bins),this.x_mid=this.x_bins.map(function(t,e){return.5*(t+n.x_bins[e-1])}).slice(1),this.mark_data=r.histogram().thresholds(this.x_bins).value(function(t){return t.value})(i),this.mark_data.forEach(function(t,e){t.index=e})}this.normalize_data(!1),this.set("midpoints",this.x_mid),this.set("count",new Float64Array(this.count)),this.update_domains(),this.save_changes(),this.trigger("data_updated")}normalize_data(t){if(this.count=this.mark_data.map(function(t){return t.length}),this.get("normalized")){let t=1;this.mark_data.length>0&&(t=this.mark_data[0].x1-this.mark_data[0].x0);const e=this.count.reduce(function(t,e){return t+e},0);0!=e&&(this.count=this.count.map(function(n){return n/(e*t)}))}const e=this;this.mark_data.forEach(function(t,n){t.y=e.count[n]}),t&&(this.set("count",new Float64Array(this.count)),this.update_domains(),this.save_changes(),this.trigger("data_updated"))}get_data_dict(t,e){const n={};return n.midpoint=this.x_mid[e],n.bin_start=this.x_bins[e],n.bin_end=this.x_bins[e+1],n.index=e,n.count=this.count[e],n}update_domains(){if(!this.mark_data)return;const t=this.get("scales").count;this.get("preserve_domain").count||t.set_domain([0,1.05*r.max(this.mark_data,function(t){return t.y})],this.model_id+"_count")}create_uniform_bins(t,e,n){const i=(e-t)/n,r=[];for(let e=0;e<n;e++)r[e]=t+e*i;return r[n]=e,r}}s.serializers=Object.assign({},o.MarkModel.serializers,{sample:a.array_or_json,count:a.array_or_json}),e.HistModel=s},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=n(10),o=n(28),a=i(n(12));class s extends r.WidgetModel{defaults(){return Object.assign({},r.WidgetModel.prototype.defaults(),{_model_name:"SelectorModel",_model_module:"bqplot",_view_module:"bqplot",_model_module_version:o.semver_range,_view_module_version:o.semver_range,marks:[]})}}s.serializers=Object.assign({},r.WidgetModel.serializers,{marks:{deserialize:r.unpack_models}}),e.SelectorModel=s;class c extends s{defaults(){return Object.assign({},s.prototype.defaults(),{_model_name:"OneDSelectorModel",scale:null})}}c.serializers=Object.assign({},s.serializers,{scale:{deserialize:r.unpack_models}}),e.OneDSelectorModel=c;class l extends s{defaults(){return Object.assign({},s.prototype.defaults(),{_model_name:"TwoDSelectorModel",x_scale:null,y_scale:null})}}l.serializers=Object.assign({},s.serializers,{x_scale:{deserialize:r.unpack_models},y_scale:{deserialize:r.unpack_models}}),e.TwoDSelectorModel=l;class u extends c{defaults(){return Object.assign({},c.prototype.defaults(),{_model_name:"FastIntervalSelectorModel",_view_name:"FastIntervalSelector",selected:null,color:null,size:null})}}u.serializers=Object.assign({},c.serializers,{selected:a.array_or_json}),e.FastIntervalSelectorModel=u;class h extends c{defaults(){return Object.assign({},c.prototype.defaults(),{_model_name:"IndexSelectorModel",_view_name:"IndexSelector",selected:null,line_width:2,color:null})}}h.serializers=Object.assign({},c.serializers,{selected:a.array_or_json}),e.IndexSelectorModel=h;class d extends c{defaults(){return Object.assign({},c.prototype.defaults(),{_model_name:"BrushIntervalSelectorModel",_view_name:"BrushIntervalSelector",brushing:!1,selected:null,color:null,orientation:"horizontal"})}}d.serializers=Object.assign({},c.serializers,{selected:a.array_or_json}),e.BrushIntervalSelectorModel=d;class f extends l{defaults(){return Object.assign({},l.prototype.defaults(),{_model_name:"BrushSelectorModel",_view_name:"BrushSelector",clear:!1,brushing:!1,selected_x:null,selected_y:null,color:null})}}f.serializers=Object.assign({},l.serializers,{selected_x:a.array_or_json,selected_y:a.array_or_json}),e.BrushSelectorModel=f;e.MultiSelectorModel=class extends c{defaults(){return Object.assign({},c.prototype.defaults(),{_model_name:"MultiSelectorModel",_view_name:"MultiSelector",names:[],brushing:!1,selected:{},_selected:{},show_names:!0})}};e.LassoSelectorModel=class extends l{defaults(){return Object.assign({},l.prototype.defaults(),{_model_name:"LassoSelectorModel",_view_name:"LassoSelector",color:null})}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2));n(31);const o=function(){return n(0).event}.bind(this),a=i(n(6)),s=n(19);e.Boxplot=class extends s.Mark{render(){const t=super.render.apply(this),e=this;return this.selected_style=this.model.get("selected_style"),this.unselected_style=this.model.get("unselected_style"),t.then(function(){e.event_listeners={},e.create_listeners(),e.process_interactions(),e.draw()},null)}set_ranges(){const t=this.scales.x;t&&t.set_range(this.parent.padded_range("x",t.model));const e=this.scales.y;e&&e.set_range(this.parent.padded_range("y",e.model))}set_positional_scales(){const t=this.scales.x;this.listenTo(t,"domain_changed",function(){this.model.dirty||this.draw()});const e=this.scales.y;this.listenTo(e,"domain_changed",function(){this.model.dirty||this.draw()})}create_listeners(){super.create_listeners.apply(this),this.listenTo(this.model,"change:stroke",this.update_stroke),this.listenTo(this.model,"change:opacities",this.update_opacities),this.listenTo(this.model,"change:marker",this.update_marker),this.listenTo(this.model,"change:outlier_fill_color",this.update_outlier_fill_color),this.listenTo(this.model,"change:box_fill_color",this.update_box_fill_color),this.listenTo(this.model,"data_updated",this.draw),this.listenTo(this.model,"change:box_width",this.update_box_width),this.listenTo(this.model,"change:selected",this.update_selected),this.listenTo(this.model,"change:interactions",this.process_interactions),this.listenTo(this.parent,"bg_clicked",function(){this.event_dispatcher("parent_clicked")})}update_stroke(){const t=this.model.get("stroke");this.d3el.selectAll(".boxplot").selectAll("path, rect").style("stroke",t),this.d3el.selectAll(".outlier").style("stroke",t),this.legend_el&&(this.legend_el.selectAll("path").attr("stroke",t),this.legend_el.selectAll("text").style("fill",t))}update_outlier_fill_color(){this.d3el.selectAll(".outlier").style("fill",this.model.get("outlier_fill_color"))}update_box_fill_color(){this.d3el.selectAll(".box").style("fill",this.model.get("box_fill_color"))}update_opacities(){const t=this.model.get("opacities");this.d3el.selectAll(".boxplot").style("opacity",function(e,n){return t[n]}),this.legend_el&&this.legend_el.selectAll("path").attr("opacity",function(e,n){return t[n]})}update_marker(){const t=this.model.get("marker");this.legend_el&&this.rect_dim&&this.draw_mark_paths(t,this.rect_dim/2),this.draw_mark_paths(t,this.calculate_mark_max_width())}get_box_width(){let t=this.model.get("box_width");if(!t){const e=this.parent.plotarea_width,n=e/10;t=e/(this.model.mark_data.length+1)/1.5,t=Math.min(t,n)}return t}compute_view_padding(){const t=this.get_box_width()/2+1;t!==this.x_padding&&(this.x_padding=t,this.trigger("mark_padding_updated"))}update_box_width(){this.compute_view_padding(),this.draw()}update_idx_selected(t,e){this.selected_indices=e,this.apply_styles(e)}set_style_on_elements(t,e){if(void 0===e||0===e.length)return;let n=this.d3el.selectAll(".box");(n=n.filter(function(t,n){return-1!=e.indexOf(n)})).styles(t)}set_default_style(t){this.update_outlier_fill_color(),this.update_box_fill_color(),this.update_stroke(),this.update_opacities()}clear_style(t,e){let n=this.d3el.selectAll(".boxplot");void 0!==e&&(n=n.filter(function(t,n){return-1!=e.indexOf(n)}));const i={};for(let e in t)i[e]=null;n.styles(i)}style_updated(t,e){this.set_default_style(e),this.set_style_on_elements(t,e)}selected_style_updated(t,e){this.selected_style=e,this.style_updated(e,this.selected_indices)}unselected_style_updated(t,e){this.unselected_style=e;const n=this.selected_indices,i=n?a.range(this.model.mark_data.length).filter(function(t){return-1==n.indexOf(t)}):[];this.style_updated(e,i)}update_selected_colors(t){const e=this.model.get("stroke"),n=e;this.d3el.selectAll(".boxplot").style("stroke",function(i,r){return t.indexOf(r)>-1?n:e})}selector_changed(t,e){if(void 0===t)return this.model.set("selected",null),this.touch(),this.update_selected_colors([]),[];const n=this.pixel_coords,i=new Uint32Array(a.range(n.length)).filter(t=>e(n[t]));this.update_selected_colors(i),this.model.set("selected",i),this.touch()}invert_point(t){if(void 0===t)return this.update_selected_colors([]),this.model.set("selected",null),void this.touch();const e=this.x_pixels.map(function(e){return Math.abs(e-t)}),n=e.indexOf(r.min(e));return this.model.set("selected",new Uint32Array([n])),this.update_selected_colors([n]),this.touch(),n}prepareBoxPlots(){const t=!1!==this.model.get("auto_detect_outliers"),e=this.scales.x,n=this.scales.y;this.plotData=[],this.outlierData=[];for(let i=0;i<this.model.mark_data.length;++i){const o=this.model.mark_data[i],a={};a.x=e.scale(o[0]),a.boxUpper=n.scale(r.quantile(o[1],.75)),a.boxLower=n.scale(r.quantile(o[1],.25)),a.boxMedian=n.scale(r.quantile(o[1],.5));const s=a.boxLower-a.boxUpper,c=a.boxLower+1.5*s,l=a.boxUpper-1.5*s;a.whiskerMax=Number.MAX_VALUE,a.whiskerMin=Number.MIN_VALUE;for(let i=0;i<o[1].length;++i){const r=n.scale(o[1][i]);t&&(r>c||r<l)?this.outlierData.push({x:e.scale(o[0]),y:r}):(r>a.whiskerMin&&(a.whiskerMin=r),r<a.whiskerMax&&(a.whiskerMax=r))}this.plotData.push(a)}}process_click(t){super.process_click(t),"select"===t&&(this.event_listeners.parent_clicked=this.reset_selection,this.event_listeners.element_clicked=this.box_click_handler)}box_click_handler(t){const e=t.index,n=this,i=this.model.get("selected")||[];let s=Array.from(i);const c=s.indexOf(e),l=o().ctrlKey||o().metaKey;if(c>-1&&l)s.splice(c,1);else if(o().shiftKey){if(c>-1)return;const t=0!==s.length?r.min(s):-1,i=0!==s.length?r.max(s):n.model.mark_data.length;e>i?a.range(i+1,e+1).forEach(function(t){s.push(t)}):e<t&&a.range(e,t).forEach(function(t){s.push(t)})}else l?s.push(e):(s=[]).push(e);this.model.set("selected",0===s.length?null:new Uint32Array(s),{updated_view:this}),this.touch();const u=o();void 0!==u.cancelBubble&&(u.cancelBubble=!0),u.stopPropagation&&u.stopPropagation(),u.preventDefault()}reset_selection(){this.model.set("selected",null),this.selected_indices=null,this.touch()}update_selected(t,e){this.selected_indices=e,this.apply_styles()}draw(){this.set_ranges();const t=this.scales.x;this.prepareBoxPlots(),this.draw_mark_paths(".boxplot",this.d3el),this.x_pixels=this.model.mark_data.map(function(e){return t.scale(e[0])+t.offset});const e=this.get_box_width()/2;this.pixel_coords=this.plotData.map(function(t){return[[t.x-e,t.x+e],[t.boxLower,t.boxUpper]]})}draw_mark_paths(t,e){const n=this,i=this.plotData,r=this.outlierData,o=this.model.get("color"),a=this.d3el.selectAll(t).data(i),s=this.model.get("box_fill_color"),c=a.enter().append("g").attr("class","boxplot").attr("id",function(t,e){return"boxplot"+e});c.append("path").attr("class","whisker_max"),c.append("path").attr("class","whisker_max_end"),c.append("path").attr("class","whisker_min"),c.append("path").attr("class","whisker_min_end"),c.append("rect").attr("class","box"),c.append("path").attr("class","median_line"),c.append("g").attr("class","outliers");const l=this.scales.x,u="ordinal"===l.model.type?l.scale.bandwidth()/2:0;e.selectAll(".boxplot").data(i).style("stroke",this.model.get("stroke")).style("opacity",o).attr("transform",function(t,e){return"translate("+(t.x+u)+", 0)"});const h=this.get_box_width();e.selectAll(".box").data(i).style("fill",s).attr("x",-h/2).attr("width",h).attr("y",function(t,e){return t.boxUpper}).attr("height",function(t,e){return t.boxLower-t.boxUpper}).on("click",function(t,e){return n.event_dispatcher("element_clicked",{data:t,index:e})}),e.selectAll(".median_line").data(i).style("stroke-width",2).attr("d",function(t,e){const n=t.boxMedian;return"M"+(0-h/2)+","+n+" L"+(0+h/2)+","+n}),e.selectAll(".whisker_max").data(i).attr("d",function(t,e){return"M0,"+t.whiskerMax+" L0,"+t.boxUpper}).attr("stroke-dasharray",function(t,e){return"5,5"}),e.selectAll(".whisker_max_end").data(i).attr("d",function(t,e){const n=t.whiskerMax;return"M"+(0-h/2)+","+n+" L"+(0+h/2)+","+n}),e.selectAll(".whisker_min").data(i).attr("d",function(t,e){return"M0,"+t.whiskerMin+" L0,"+t.boxLower}).attr("stroke-dasharray",function(t,e){return"5,5"}),e.selectAll(".whisker_min_end").data(i).attr("d",function(t,e){const n=t.whiskerMin;return"M"+(0-h/2)+","+n+" L"+(0+h/2)+","+n}),a.exit().remove();const d=e.selectAll(".outlier").data(r);d.enter().append("circle").attr("class","outlier"),d.exit().remove(),e.selectAll(".outlier").data(r).style("fill",this.model.get("outlier_fill_color")).attr("cx",function(t){return t.x+u}).attr("r",3).attr("cy",function(t){return t.y}),this.apply_styles(this.selected_indices)}calculate_mark_max_width(){const t=this,e=this.scales.x;let n=1/0;for(let i=1;i<t.model.mark_data.length;i++){let r=e.scale(t.model.mark_data[i][0])-e.scale(t.model.mark_data[i-1][0]);(r=r<0?-1*r:r)<n&&(n=r)}let i=0;return i=n==1/0?(e.scale(this.model.max_x)-e.scale(this.model.min_x))/2:n}relayout(){super.relayout.apply(this),this.set_ranges(),this.compute_view_padding(),this.d3el.select(".intselmouse").attr("width",this.width).attr("height",this.height),this.draw()}draw_legend(t,e,n,i,o){const s=this.model.get("stroke");this.rect_dim=.8*o;const c=this;this.legend_el=t.selectAll(".legend"+this.uuid).data([this.model.mark_data]),this.legend_el.enter().append("g").attr("transform",function(t,e){return"translate(0, "+(e*o+n)+")"}).attr("class","legend"+this.uuid).on("mouseover",a.bind(this.highlight_axes,this)).on("mouseout",a.bind(this.unhighlight_axes,this)).selectAll("path").attr("stroke",s).attr("transform","translate("+c.rect_dim/2+",0)"),this.legend_el.append("text").attr("class","legendtext").attr("x",1.2*c.rect_dim).attr("y",c.rect_dim/2).attr("dy","0.35em").text(function(t,e){return c.model.get("labels")[e]}).style("fill",s);const l=r.max(this.model.get("labels"),function(t){return t.length});return this.legend_el.exit().remove(),[1,l]}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=i(n(6)),a=n(49);e.IndexSelector=class extends a.BaseXSelector{render(){super.render(),this.active=!1,this.dirty=!1;const t=this,e=this.create_scales();Promise.all([this.mark_views_promise,e]).then(function(){t.line=t.d3el.append("line").attr("class","selector indsel").attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",t.height).attr("stroke-width",t.model.get("line_width")).attr("pointer-events","none").attr("visibility","hidden"),t.color_change(),t.background=t.d3el.append("rect").attr("x",0).attr("y",0).attr("width",t.width).attr("height",t.height).attr("class","selector selectormouse").attr("pointer-events","all").attr("visibility","hidden"),t.background.on("mousemove",o.bind(t.mousemove,t)).on("click",o.bind(t.initial_click,t)),t.create_listeners(),t.selected_changed()})}create_listeners(){super.create_listeners(),this.listenTo(this.model,"change:color",this.color_change)}color_change(){null!==this.model.get("color")&&this.line.style("stroke",this.model.get("color"))}initial_click(){this.line.attr("visibility","visible"),this.click(),this.background.on("click",o.bind(this.click,this))}click(){this.active=!this.active}mousemove(){if(!this.active)return;this.dirty=!0;const t=r.mouse(this.background.node())[0];this.line.attr("x1",t).attr("x2",t),this.set_selected("selected",[this.invert_pixel(t)]),o.each(this.mark_views,function(e){e.invert_point(t)}),this.touch(),this.dirty=!1}invert_pixel(t){return this.scale.invert(t)}reset(){this.active=!1,void 0!==this.line&&null!==this.line&&this.line.attr("x1",0).attr("x2",0).attr("visibility","hidden"),void 0!==this.background&&null!==this.background&&this.background.on("click",o.bind(this.initial_click,this)),this.model.set("selected",null),o.each(this.mark_views,function(t){t.invert_point()}),this.touch()}update_scale_domain(t){super.update_scale_domain(),!0!==t&&this.selected_changed()}selected_changed(){if(this.dirty)return;const t=this.model.get("selected")||[];if(0===t.length)this.reset();else{if(1!=t.length)return;{const e=this.scale.scale(t[0]);void 0!==this.line&&null!==this.line&&this.line.attr("x1",0).attr("x2",0).attr("visibility","visible"),this.background.on("click",o.bind(this.click,this)),o.each(this.mark_views,function(t){t.invert_point(e)})}}}relayout(){super.relayout(),this.line.attr("y1",0).attr("y2",this.height),this.background.attr("width",this.width).attr("height",this.height),this.set_range([this.scale])}set_range(t){for(let e=0;e<t.length;e++)t[e].set_range([0,this.width])}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=n(50),a=i(n(84));e.OrdinalColorScale=class extends o.Scale{render(){this.scale=r.scaleOrdinal(),this.scale.domain(this.model.domain),this.create_event_listeners(),this.listenTo(this.model,"domain_changed",this.model_domain_changed),this.model.on_some_change(["colors","scheme"],this.colors_changed,this),this.set_range()}set_range(){this.model.get("colors").length>0?this.scale.range(a.cycle_colors(this.model.get("colors"),this.scale.domain().length)):this.scale.range(a.get_ordinal_scale_range(this.model.get("scheme"),this.scale.domain().length)),this.trigger("color_scale_range_changed")}model_domain_changed(){super.model_domain_changed(),this.set_range()}colors_changed(){this.set_range()}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=i(n(6)),a=n(18),s=i(n(12));class c extends a.MarkModel{defaults(){return Object.assign({},a.MarkModel.prototype.defaults(),{_model_name:"BoxplotModel",_view_name:"Boxplot",x:[],y:[],scales_metadata:{x:{orientation:"horizontal",dimension:"x"},y:{orientation:"vertical",dimension:"y"}},stroke:null,box_fill_color:"dodgerblue",outlier_fill_color:"gray",opacities:[],box_width:null,auto_detect_outliers:!0})}initialize(){super.initialize.apply(this,arguments),this.on_some_change(["x","y"],this.update_data,this),this.on_some_change(["preserve_domain"],this.update_domains,this),this.update_data(),this.update_domains()}update_data(){let t=this.get("x"),e=this.get("y");e.forEach(function(t){t.sort(function(t,e){return t-e})}),t.length>e.length?t=t.slice(0,e.length):t.length<e.length&&(e=e.slice(0,t.length)),this.mark_data=o.zip(t,e),this.update_domains(),this.trigger("data_updated")}update_domains(){const t=this.get("scales"),e=t.x,n=t.y;if(!this.get("preserve_domain").x&&this.mark_data?e.compute_and_set_domain(this.mark_data.map(function(t){return t[0]}),this.model_id+"_x"):e.del_domain([],this.model_id+"_x"),!this.get("preserve_domain").y&&this.mark_data){const t=r.min(this.mark_data.map(function(t){return t[1][0]})),e=r.max(this.mark_data.map(function(t){const e=t[1];return e[e.length-1]}));n.set_domain([t,e],this.model_id+"_y")}else n.del_domain([],this.model_id+"_y")}}c.serializers=Object.assign({},a.MarkModel.serializers,{x:s.array_or_json,y:s.array_or_json}),e.BoxplotModel=c},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=n(50),a=i(n(6));e.OrdinalScale=class extends o.Scale{render(){this.scale=r.scaleBand(),this.scale.domain(this.model.domain),this.offset=0,this.create_event_listeners()}set_range(t,e){e=void 0===e?0:e,this.scale.range(t),this.scale.paddingInner(e),this.scale.paddingOuter(e/2),this.offset=0===this.scale.domain().length?0:this.scale.bandwidth()/2}expand_domain(t,e){const n=this.scale.copy();n.range(t).paddingInner(0).paddingOuter(0);const i=n.range().length>0?Math.abs((e[1]-t[1])/n.bandwidth()):0;this.scale.range(e),this.scale.paddingInner(0),this.scale.paddingOuter(i)}invert(t){const e=this,n=this.scale.domain(),i=n.map(function(t){return e.scale(t)+e.scale.bandwidth()/2}).map(function(e){return Math.abs(t-e)});return n[i.indexOf(r.min(i))]}invert_range(t){const e=this,n=this.scale.domain(),i=n.map(function(t){return e.scale(t)+e.scale.bandwidth()/2});return a.range(i.length).filter(function(e){return i[e]>=t[0]&&i[e]<=t[1]}).map(function(t){return n[t]})}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=n(136);e.Label=class extends o.ScatterBase{create_listeners(){super.create_listeners(),this.model.on_some_change(["font_weight","default_size","colors","align","font_unit"],this.update_style,this),this.model.on_some_change(["x","y","x_offset","y_offset","rotate_angle"],this.update_position,this)}update_default_opacities(t){if(!this.model.dirty){const e=!0===t?this.parent.model.get("animation_duration"):0,n=this;this.d3el.selectAll(".label").transition("update_default_opacities").duration(e).style("opacity",function(t,e){return n.get_element_opacity(t,e)})}}update_default_size(t){if(this.compute_view_padding(),!this.model.dirty){const e=!0===t?this.parent.model.get("animation_duration"):0,n=this;this.d3el.selectAll(".label").transition("update_default_size").duration(e).style("font-size",function(t,e){return n.get_element_size(t)})}}relayout(){this.set_ranges(),this.update_position()}draw_elements(t,e){e.append("text").classed("label element",!0),this.update_text(),this.update_style(),this.update_default_opacities(!0)}update_text(){this.d3el.selectAll(".object_grp").select(".label").text(function(t){return t.text})}get_element_size(t){const e=this.scales.size,n=this.model.get("font_unit");return e&&void 0!==t.size?e.scale(t.size)+n:this.model.get("default_size")+n}get_element_rotation(t){const e=this.scales.rotation;return e&&t.rotation?"rotate("+e.scale(t.rotation)+")":"rotate("+this.model.get("rotate_angle")+")"}update_position(){const t=this,e=this.x_scale,n=this.y_scale,i=this.model.get("x_offset"),r=this.model.get("y_offset");this.d3el.selectAll(".object_grp").attr("transform",function(o){return"translate("+(e.scale(o.x)+e.offset+i)+","+(n.scale(o.y)+n.offset+r)+")"+t.get_element_rotation(o)})}update_style(){const t=this;this.d3el.selectAll(".object_grp").select("text").attr("dominant-baseline","central").style("font-size",function(e,n){return t.get_element_size(e)}).style("font-weight",this.model.get("font_weight")).style("text-anchor",this.model.get("align")),this.d3el.selectAll(".label").style("fill",function(e,n){return t.get_element_color(e,n)})}color_scale_updated(t){const e=this,n=!0===t?this.parent.model.get("animation_duration"):0;this.d3el.selectAll(".object_grp").select("text").transition("color_scale_updated").duration(n).style("fill",function(t,n){return e.get_element_color(t,n)})}set_default_style(t){if(!t||0===t.length)return;const e=this.d3el.selectAll(".element").filter(function(e,n){return-1!==t.indexOf(n)}),n=this;e.style("font-size",function(t,e){return n.get_element_size(t)}).style("font-weight",this.model.get("font_weight")).style("text-anchor",this.model.get("align")).style("fill",function(t,e){return n.get_element_color(t,e)})}set_drag_style(t,e,n){const i=this.model.get("drag_size")*this.model.get("default_size")+this.model.get("font_unit");r.select(n).select("text").classed("drag_label",!0).transition("set_drag_style").style("font-size",i)}reset_drag_style(t,e,n){r.select(n).select("text").classed("drag_label",!1).transition("reset_drag_style").style("font-size",this.get_element_size(t))}update_default_skew(){}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=n(137),a=i(n(12));class s extends o.ScatterBaseModel{defaults(){return Object.assign({},o.ScatterBaseModel.prototype.defaults(),{_model_name:"LabelModel",_view_name:"Label",x_offset:0,y_offset:0,colors:r.scaleOrdinal(r.schemeCategory10).range(),rotate_angle:0,text:null,default_size:16,drag_size:1,font_unit:"px",font_weight:"bold",align:"start"})}initialize(t,e){super.initialize(t,e),this.on("change:text",this.update_data,this)}update_mark_data(){super.update_mark_data();const t=this.get("text");this.mark_data.forEach(function(e,n){e.text=t[n]})}update_unique_ids(){this.mark_data.forEach(function(t,e){t.unique_id="Label"+e})}}s.serializers=Object.assign({},o.ScatterBaseModel.serializers,{text:a.array_or_json}),e.LabelModel=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(138);e.OrdinalColorScaleModel=class extends i.OrdinalScaleModel{defaults(){return Object.assign({},i.OrdinalScaleModel.prototype.defaults(),{_model_name:"OrdinalColorScaleModel",_view_name:"OrdinalColorScale",domain:[]})}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=function(){return n(0).event}.bind(this),a=i(n(6)),s=i(n(49)),c=i(n(17)),l=i(n(85));class u extends s.BaseXYSelector{brush_render(){this.brushing=!1}color_change(){null!==this.model.get("color")&&this.brushsel.select(".selection").style("fill",this.model.get("color"))}brush_start(){this.model.set("brushing",!0),this.touch(),this.brushing=!0}brush_move(){this.convert_and_save()}brush_end(){this.model.set("brushing",!1),this.convert_and_save(),this.brushing=!1}adjust_rectangle(){"vertical"==this.model.get("orientation")?this.d3el.selectAll("rect").attr("x",0).attr("width",this.width):this.d3el.selectAll("rect").attr("y",0).attr("height",this.height)}update_mark_selected(t,e){if(void 0===t||0===t.length)return void a.each(this.mark_views,function(t){return t.selector_changed()});let n,i;if(void 0===e){const e=this.model.get("orientation");n="vertical"==e?[]:t,i="vertical"==e?t:[]}else n=t,i=e;const r=function(t){return l.point_in_rectangle(t,n,i)},o=function(t){return l.rect_inter_rect(t[0],t[1],n,i)};a.each(this.mark_views,function(t){t.selector_changed(r,o)},this)}}class h extends s.BaseXSelector{brush_render(){this.brushing=!1}color_change(){null!==this.model.get("color")&&this.brushsel.select(".selection").style("fill",this.model.get("color"))}brush_start(){this.model.set("brushing",!0),this.touch(),this.brushing=!0}brush_move(){this.convert_and_save()}brush_end(){this.model.set("brushing",!1),this.convert_and_save(),this.brushing=!1}adjust_rectangle(){"vertical"==this.model.get("orientation")?this.d3el.selectAll("rect").attr("x",0).attr("width",this.width):this.d3el.selectAll("rect").attr("y",0).attr("height",this.height)}update_mark_selected(t,e){if(void 0===t||0===t.length)return void a.each(this.mark_views,function(t){return t.selector_changed()});let n,i;if(void 0===e){const e=this.model.get("orientation");n="vertical"==e?[]:t,i="vertical"==e?t:[]}else n=t,i=e;n.length&&n.sort(function(t,e){return t-e}),i.length&&i.sort(function(t,e){return t-e});const r=function(t,e){if(void 0===e){const e=t;return l.point_in_rectangle(e,n,i)}const r=Math.min(t.length,e.length),o=new Uint8Array(r);if(n.length&&i.length){for(let a=0;a<r;a++)o[a]=n[0]<=t[a]&&t[a]<=n[1]&&i[0]<=e[a]&&e[a]<=i[1]?1:0;return o}if(n.length)for(let e=0;e<r;e++)o[e]=n[0]<=t[e]&&t[e]<=n[1]?1:0;else for(let t=0;t<r;t++)o[t]=i[0]<=e[t]&&e[t]<=i[1]?1:0;return o},o=function(t){return l.rect_inter_rect(t[0],t[1],n,i)};a.each(this.mark_views,function(t){t.selector_changed(r,o)},this)}}e.BrushSelector=class extends u{render(){super.render.apply(this),this.brush_render();const t=this,e=this.create_scales();Promise.all([this.mark_views_promise,e]).then(function(){t.brush=r.brush().on("start",a.bind(t.brush_start,t)).on("brush",a.bind(t.brush_move,t)).on("end",a.bind(t.brush_end,t)),t.brush.extent([[0,0],[t.width,t.height]]),t.d3el.attr("class","selector brushintsel"),t.brushsel=t.d3el.call(t.brush),t.adjust_rectangle(),t.color_change(),t.create_listeners(),t.selected_changed()})}create_listeners(){super.create_listeners(),this.listenTo(this.model,"change:color",this.color_change),this.listenTo(this.model,"change:selected_x",this.selected_changed),this.listenTo(this.model,"change:selected_y",this.selected_changed)}empty_selection(){this.update_mark_selected(),this.model.set("selected_x",null),this.model.set("selected_y",null),this.touch()}convert_and_save(){const t=o();if(t.sourceEvent)if(t.selection){const r=t.selection;var e=[r[0][0],r[1][0]],n=[r[1][1],r[0][1]],i=(t,e)=>t-e;e.sort(i),n.sort(i);const o=e.map(this.x_scale.invert.bind(this.x_scale)).sort((t,e)=>t-e),a=n.map(this.y_scale.invert.bind(this.y_scale)).sort((t,e)=>t-e);this.update_mark_selected(e,n),this.set_selected("selected_x",o),this.set_selected("selected_y",a),this.touch()}else this.empty_selection()}selected_changed(){if(this.brushing)return;const t=this.model.get("selected_x")||[],e=this.model.get("selected_y")||[];if(0===t.length||0===e.length)this.update_mark_selected();else{if(2!=t.length||2!=e.length)return;{const n=[[t[0],e[0]],[t[1],e[1]]];this.brush.extent(n);const i=t.map(this.x_scale.scale).sort(function(t,e){return t-e}),r=e.map(this.y_scale.scale).sort(function(t,e){return t-e});this.update_mark_selected(i,r)}}}relayout(){if(super.relayout(),this.d3el.select(".background").attr("width",this.width).attr("height",this.height),this.set_x_range([this.x_scale]),this.set_y_range([this.y_scale]),this.brush.extent([[0,0],[this.width,this.height]]),this.model.get("selected_x")&&this.model.get("selected_y")){const t=this.model.get("selected_x").map(this.x_scale.scale).sort(function(t,e){return t-e}),e=this.model.get("selected_y").map(this.y_scale.scale).sort(function(t,e){return t-e});this.brush.move(this.d3el,[[t[0],e[0]],[t[1],e[1]]]),this.brushsel=this.d3el.call(this.brush)}}adjust_rectangle(){}reset(){}};function d(t,e,n){n&&n.forEach(function(e){t.classed(e,!1)}),e&&e.forEach(function(e){t.classed(e,!0)})}e.BrushIntervalSelector=class extends h{render(){super.render(),this.brush_render();const t=this,e=this.create_scales();Promise.all([this.mark_views_promise,e]).then(function(){t.brush=("vertical"==t.model.get("orientation")?r.brushY():r.brushX()).on("start",a.bind(t.brush_start,t)).on("brush",a.bind(t.brush_move,t)).on("end",a.bind(t.brush_end,t)),t.brush.extent([[0,0],[t.width,t.height]]),t.d3el.attr("class","selector brushintsel"),t.brushsel=t.d3el.call(t.brush),t.adjust_rectangle(),t.color_change(),t.create_listeners(),t.selected_changed()})}create_listeners(){super.create_listeners(),this.listenTo(this.model,"change:color",this.color_change)}empty_selection(){this.update_mark_selected(),this.model.set("selected",new Uint32Array([])),this.touch()}convert_and_save(){const t=o();if(t.sourceEvent)if(t.selection){const e=t.selection,n=e.map(this.scale.invert.bind(this.scale)).sort((t,e)=>t-e);this.update_mark_selected(e),this.set_selected("selected",n),this.touch()}else this.empty_selection()}update_scale_domain(t){super.update_scale_domain(),!0!==t&&this.selected_changed()}selected_changed(){if(this.brushing)return;const t=this.model.get("selected")||[];if(0===t.length)this.update_mark_selected();else{if(2!=t.length)return;{const e=[t[0],t[1]];this.brush.extent(e);const n=e.map(this.scale.scale).sort((t,e)=>t-e);this.update_mark_selected(n)}}}relayout(){if(super.relayout(),this.adjust_rectangle(),this.d3el.select(".background").attr("width",this.width).attr("height",this.height),this.set_range([this.scale]),this.brush.extent([[0,0],[this.width,this.height]]),this.model.get("selected")){const t=this.model.get("selected").map(this.scale.scale).sort(function(t,e){return t-e});this.brush.move(this.d3el,t),this.brushsel=this.d3el.call(this.brush)}}reset(){}};e.MultiSelector=class extends h{render(){super.render.apply(this);const t=this;this.names=this.model.get("names"),this.curr_index=0;const e=this.create_scales();Promise.all([this.mark_views_promise,e]).then(function(){t.d3el.attr("class","multiselector"),t.d3el.attr("width",t.width),t.d3el.attr("height",t.height),t.create_brush(),t.selecting_brush=!1,t.create_listeners()})}create_listeners(){super.create_listeners(),this.listenTo(this.model,"change:names",this.labels_change),this.listenTo(this.model,"change:color",this.color_change)}labels_change(t,e){const n=t.previous("names");this.names=e;const i=a.range(this.curr_index+1),r=this,o=c.deepCopy(this.model.get("selected"));i.forEach(function(t){const e=r.get_label(t),i=r.get_label(t,n);i!==e&&(r.d3el.select(".brush_text_"+t).text(e),o[e]=o[i],delete o[i])}),this.set_selected("_selected",o),this.touch()}create_brush(){const t=this,e=this.curr_index,n=("vertical"==this.model.get("orientation")?r.brushY():r.brushX()).on("start",()=>{this.brush_start()}).on("brush",()=>{this.brush_move(e,this)}).on("end",()=>{this.brush_end(e,this)});n.extent([[0,0],[this.width,this.height]]);const i=this.d3el.append("g").attr("class","selector brushintsel active");i.append("text").text(this.get_label(this.curr_index)).attr("class","brush_text_"+this.curr_index).style("text-anchor","middle").style("stroke","yellow").style("font-size","16px").style("display","none"),"vertical"==this.model.get("orientation")?i.select("text").attr("x",30):i.select("text").attr("y",30),i.call(n),this.color_change(),this.adjust_rectangle();const a=i.on("mousedown.brush");i.on("mousedown.brush",function(){const e=o().ctrlKey||o().metaKey;o().shiftKey&&e?t.reset():e?(d(r.select(this),["inactive"],["active"]),t.create_brush()):o().shiftKey&&!1===t.selecting_brush?(d(t.d3el.selectAll(".selector"),["visible"],["active","inactive"]),t.selecting_brush=!0):(d(t.d3el.selectAll(".selector"),["inactive"],["visible"]),d(r.select(this),["active"],["inactive"]),a.call(this),t.selecting_brush=!1)}),this.curr_index=this.curr_index+1}get_label(t,e){return null==e&&(e=this.names),e.length>t?e[t]:t}brush_start(){this.model.set("brushing",!0),this.touch()}brush_move(t,e){const n=o().selection,i=!this.model.get("show_names");r.select(e).select("text").style("display",!n||i?"none":"inline"),this.set_text_location(e,n),this.convert_and_save(n,t)}brush_end(t,e){const n=o().selection;this.model.set("brushing",!1),this.convert_and_save(n,t)}set_text_location(t,e){const n="vertical"==this.model.get("orientation")?"y":"x",i=(e[0]+e[1])/2;r.select(t).select("text").attr(n,i)}reset(){this.d3el.selectAll(".selector").remove(),this.model.set("_selected",{}),this.curr_index=0,this.touch(),this.create_brush()}convert_and_save(t,e){if(t){const n=c.deepCopy(this.model.get("_selected"));n[this.get_label(e)]=t.map(this.scale.invert.bind(this.scale)),this.update_mark_selected(t),this.model.set("_selected",n),this.touch()}else this.update_mark_selected(),this.model.set("_selected",{}),this.touch()}selected_changed(){}color_change(){null!==this.model.get("color")&&this.d3el.selectAll(".selector").style("fill",this.model.get("color"))}relayout(){super.relayout(),this.adjust_rectangle(),this.d3el.select(".background").attr("width",this.width).attr("height",this.height),this.set_range([this.scale])}remove(){this.model.off("change:names",null,this),super.remove()}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=function(){return n(0).event}.bind(this),a=i(n(6)),s=n(49),c=i(n(85));e.LassoSelector=class extends s.BaseXYSelector{render(){super.render();const t=this.create_scales();this.line=r.line(),this.all_vertices={},this.lasso_counter=0;const e=this;Promise.all([this.mark_views_promise,t]).then(()=>{const t=r.drag().on("start",function(){e.drag_start()}).on("drag",function(){e.drag_move()}).on("end",function(){e.drag_end()});r.select(window).on("keydown",()=>{this.keydown()}),e.d3el.attr("class","lassoselector"),e.background=e.d3el.append("rect").attr("x",0).attr("y",0).attr("width",e.width).attr("height",e.height).attr("visibility","hidden").attr("pointer-events","all").style("cursor","crosshair").call(t),e.create_listeners()})}create_listeners(){super.create_listeners(),this.listenTo(this.model,"change:color",this.change_color)}change_color(t,e){e&&this.d3el.selectAll("path").style("stroke",e)}create_new_lasso(){const t=this.d3el.append("path").attr("id","l"+ ++this.lasso_counter).on("click",function(){const t=r.select(this);t.classed("selected",!t.classed("selected"))}),e=this.model.get("color");e&&t.style("stroke",e)}drag_start(){this.current_vertices=[],this.create_new_lasso()}drag_move(){this.current_vertices.push(r.mouse(this.background.node())),this.d3el.select("#l"+this.lasso_counter).attr("d",this.line(this.current_vertices))}drag_end(){const t="l"+this.lasso_counter;this.d3el.select("#"+t).attr("d",this.line(this.current_vertices)+"Z"),this.all_vertices[t]=this.current_vertices,this.update_mark_selected(this.all_vertices)}update_mark_selected(t){void 0!==t&&0!==t.length||a.each(this.mark_views,function(t){return t.selector_changed()});const e=function(e){for(let n in t)if(c.point_in_lasso(e,t[n]))return!0;return!1},n=function(e){for(let n in t)if(c.lasso_inter_rect(e[0],e[1],t[n]))return!0;return!1};a.each(this.mark_views,function(t){t.selector_changed(e,n)},this)}relayout(){super.relayout(),this.background.attr("width",this.width).attr("height",this.height)}keydown(){if(46===o().keyCode){const t=this.d3el.selectAll(".selected"),e=this.all_vertices;t.each(function(){const t=r.select(this).attr("id");delete e[t]}),t.remove(),this.update_mark_selected(this.all_vertices)}}reset(){this.lasso_counter=0,this.all_vertices={},this.d3el.selectAll("path").remove(),this.update_mark_selected()}selected_changed(){}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(10)),o=i(n(2)),a=function(){return n(0).event}.bind(this),s=i(n(61)),c=i(n(6));e.PanZoom=class extends s.Interaction{render(){super.render();const t=this;this.d3el.style("cursor","move").on("mousedown",function(){t.mousedown()}).on("mousemove",function(){t.mousemove()}).on("mouseup",function(){t.mouseup()}).on("mousewheel",function(){t.mousewheel()}).on("DOMMouseScroll.zoom",function(){t.mousewheel()}).on("mousewheel.zoom",null).on("wheel.zoom",null),this.active=!1,this.update_scales(),this.listenTo(this.model,"change:scales",this.update_scales),this.set_ranges(),this.listenTo(this.parent,"margin_updated",this.set_ranges)}update_scales(){const t=this.model.get("scales"),e=this;this.scale_promises=r.resolvePromisesDict({x:Promise.all((t.x||[]).map(function(t){return e.create_child_view(t)})),y:Promise.all((t.y||[]).map(function(t){return e.create_child_view(t)}))}),r.resolvePromisesDict(this.scale_promises).then(c.bind(this.set_ranges,this))}set_ranges(){const t=this;let e;this.scale_promises.then(function(n){const i=n.x;for(e=0;e<i.length;e++)i[e].set_range(t.parent.padded_range("x",i[e].model));const r=n.y;for(e=0;e<r.length;e++)r[e].set_range(t.parent.padded_range("y",r[e].model))})}mousedown(){this._mousedown(o.mouse(this.el))}_mousedown(t){const e=this.model.get("scales");this.active=!0,this.d3el.style("cursor","move"),this.previous_pos=t.slice(),this.domains_in_order={x:(e.x||[]).map(function(t){return t.get_domain_slice_in_order()}),y:(e.y||[]).map(function(t){return t.get_domain_slice_in_order()})}}mouseup(){this.active=!1}mousemove(){this._mousemove(o.mouse(this.el))}_mousemove(t){if(this.active&&this.model.get("allow_pan")){void 0===this.previous_pos&&(this.previous_pos=t);const e={x:t[0]-this.previous_pos[0],y:t[1]-this.previous_pos[1]};return this.scale_promises.then(t=>{["x","y"].forEach(n=>{t[n].forEach((t,i)=>{if(t.scale.invert){const r=t.scale.copy().domain(this.domains_in_order[n][i]),o=r(this.domains_in_order[n][i][0]),a=r(this.domains_in_order[n][i][1]),s=r.invert(o-e[n]),c=r.invert(a-e[n]);this.set_scale_attribute(t.model,"min",s),this.set_scale_attribute(t.model,"max",c),t.touch()}})})})}}mousewheel(){if(this.model.get("allow_zoom")){a().preventDefault();const t=a().wheelDelta||-40*a().detail,e=o.mouse(this.el);this._zoom(e,t)}}_zoom(t,e){if(e){e>0?this.d3el.style("cursor","zoom-in"):this.d3el.style("cursor","zoom-out");const n={x:t[0],y:t[1]},i=Math.exp(.001*-e);return this.scale_promises.then(t=>{["x","y"].forEach(e=>{t[e].forEach((t,r)=>{if(t.scale.invert){const r=t.scale;let[o,a]=t.model.get_domain_slice_in_order();const s=r(o),c=r(a);o=r.invert((1-i)*n[e]+i*s),a=r.invert((1-i)*n[e]+i*c),this.set_scale_attribute(t.model,"min",o),this.set_scale_attribute(t.model,"max",a),t.touch()}})})})}}set_scale_attribute(t,e,n){"date"==t.type?(n=n instanceof Date?n:new Date(n),t.set_date_elem(e,n)):t.set(e,n)}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=n(88);e.ColorAxis=class extends o.Axis{render(){this.parent=this.options.parent,this.vertical="vertical"===this.model.get("orientation");const t=this.set_scale(this.model.get("scale"));this.side=this.model.get("side"),this.x_offset=100,this.y_offset=40,this.bar_height=20,this.d3el.attr("class","ColorBar").attr("display",this.model.get("visible")?"inline":"none").attr("transform",this.get_topg_transform()),this.ordinal=!1,this.num_ticks=this.model.get("num_ticks");const e=this;return t.then(function(){e.create_listeners(),e.tick_format=e.generate_tick_formatter(),e.set_scales_range(),e.append_axis()})}create_listeners(){this.listenTo(this.model,"change:scale",function(t,e){this.update_scale(t.previous("scale"),e),this.axis.scale(this.axis_scale.scale),this.rescale_axis()}),this.listenTo(this.model,"change:tick_format",this.tickformat_changed),this.axis_scale.on("domain_changed",this.redraw_axisline,this),this.axis_scale.on("color_scale_range_changed",this.redraw_axis,this),this.axis_scale.on("highlight_axis",this.highlight,this),this.axis_scale.on("unhighlight_axis",this.unhighlight,this),this.parent.on("margin_updated",this.parent_margin_updated,this),this.listenTo(this.model,"change:visible",this.update_visibility),this.listenTo(this.model,"change:label",this.update_label),this.model.on_some_change(["side","orientation"],this.update_display,this)}update_display(){this.side=this.model.get("side"),this.vertical="vertical"===this.model.get("orientation"),this.vertical?this.axis="right"===this.side?r.axisRight(this.axis_scale.scale):r.axisLeft(this.axis_scale.scale):this.axis="top"===this.side?r.axisTop(this.axis_scale.scale):r.axisBottom(this.axis_scale.scale),this.g_axisline.remove(),this.g_axisline=this.d3el.select("#colorBarG"+this.cid).append("g").attr("class","axis"),this.rescale_axis(),this.d3el.select("#colorBarG"+this.cid).attr("transform",this.get_colorbar_transform()),this.d3el.select("#colorBarG"+this.cid).select(".g-rect").attr("transform",this.vertical?"rotate(-90)":""),this.redraw_axisline()}set_scale(t){const e=this;return this.axis_scale&&this.axis_scale.remove(),this.create_child_view(t).then(function(t){e.displayed.then(function(){t.trigger("displayed")}),e.axis_scale=t,"date_color_linear"===e.axis_scale.model.type?e.axis_line_scale=r.scaleTime().nice():"ordinal"===e.axis_scale.model.type?(e.axis_line_scale=r.scaleBand(),e.ordinal=!0):e.axis_line_scale=r.scaleLinear()})}append_axis(){void 0!==this.model.get("label")&&null!==this.model.get("label")&&this.d3el.append("g").attr("transform",this.get_label_transform()).attr("class","axis label_g").append("text").append("tspan").attr("id","text_elem").attr("dy","0.5ex").attr("class","axislabel").style("text-anchor",this.vertical?"middle":"end").text(this.model.get("label"));const t=this.d3el.append("g").attr("id","colorBarG"+this.cid);this.draw_color_bar(),this.set_axisline_domain(),this.g_axisline=t.append("g").attr("class","axis"),this.vertical?this.axis="right"===this.side?r.axisRight(this.axis_scale.scale):r.axisLeft(this.axis_scale.scale):this.axis="top"===this.side?r.axisTop(this.axis_scale.scale):r.axisBottom(this.axis_scale.scale),this.axis=this.axis.tickFormat(this.tick_format),this.redraw_axisline()}draw_color_bar(){const t=this.d3el.select("#colorBarG"+this.cid);t.attr("transform",this.get_colorbar_transform());const e=this;t.selectAll(".g-rect").remove(),t.selectAll(".g-defs").remove(),this.colors=this.axis_scale.scale.range();const n=100/(this.colors.length-1);if(this.ordinal){const n=this.get_color_bar_width()/this.colors.length;let i=t.append("g").attr("class","g-rect axis").selectAll("rect").data(this.colors);i=i.enter().append("rect").attr("y",0).attr("height",this.bar_height).attr("width",n).style("fill",function(t){return t}).merge(i),this.vertical?i.attr("x",function(t,i){return i*n-(e.height-2*e.x_offset)}):i.attr("x",function(t,e){return e*n})}else t.append("g").attr("class","g-defs").append("defs").append("linearGradient").attrs({id:"colorBarGradient"+this.cid,x1:"0%",y1:"0%",x2:"100%",y2:"0%"}).selectAll("stop").data(this.colors).enter().append("stop").attrs({offset:function(t,e){return n*e+"%"},"stop-color":function(t,n){return e.colors[n]},"stop-opacity":1}),t.append("g").attr("class","g-rect axis").append("rect").attrs({width:this.get_color_bar_width(),height:this.bar_height,x:this.vertical?-(this.height-2*this.x_offset):0,y:0,"stroke-width":1}).style("fill","url(#colorBarGradient"+this.cid+")");this.vertical&&t.select(".g-rect").attr("transform","rotate(-90)")}get_topg_transform(){return this.vertical?"right"===this.side?"translate("+String(this.get_basic_transform()+this.margin.right/2-this.bar_height)+", 0)":"translate("+String(this.get_basic_transform()-this.margin.left/2+this.bar_height)+", 0)":"top"===this.side?"translate(0, "+String(this.get_basic_transform()-this.margin.top+this.bar_height+24)+")":"translate(0, "+String(this.get_basic_transform()+this.margin.bottom-this.bar_height-24)+")"}get_label_transform(){return this.vertical?"translate("+("right"===this.side?this.bar_height/2:-this.bar_height/2)+", "+(this.x_offset-15)+")":"translate("+(this.x_offset-5)+", "+this.bar_height/2+")"}get_colorbar_transform(){return this.vertical?"translate(0, "+String(this.x_offset)+")":"translate("+String(this.x_offset)+", 0)"}set_axisline_scale_range(){const t=this.vertical?[this.height-2*this.x_offset,0]:[0,this.width-2*this.x_offset];if(this.ordinal)this.axis_line_scale.rangeRound(t).padding(.05);else{const e=this.axis_scale.model.mid;null==e?this.axis_line_scale.range(t):this.axis_line_scale.range([t[0],.5*(t[0]+t[1]),t[1]])}}set_scales_range(){this.axis_scale.set_range(),this.set_axisline_scale_range()}get_color_bar_width(){return this.vertical?this.height-2*this.x_offset:this.width-2*this.x_offset}update_label(){this.d3el.select("#text_elem").text(this.model.get("label"))}rescale_axis(){this.set_axisline_scale_range(),this.d3el.attr("transform",this.get_topg_transform());const t=this,e=this.get_color_bar_width()/this.colors.length;if(this.ordinal){const n=this.d3el.select("#colorBarG"+this.cid).select(".g-rect").selectAll("rect").attr("width",e);this.vertical?n.attr("x",function(n,i){return i*e-(t.height-2*t.x_offset)}):n.attr("x",function(t,n){return n*e})}else this.d3el.select("#colorBarG"+this.cid).select(".g-rect").selectAll("rect").attr("width",this.get_color_bar_width()).attr("x",this.vertical?-(this.height-2*this.x_offset):0);void 0!==this.model.get("label")&&null!==this.model.get("label")&&this.d3el.select(".label_g").attr("transform",this.get_label_transform()).select("#text_elem").style("text-anchor",this.vertical?"middle":"end"),this.g_axisline.call(this.axis)}redraw_axisline(){if(this.axis){let t;this.set_axisline_domain(),this.set_axisline_scale_range(),this.axis.scale(this.axis_line_scale),this.set_tick_values(),t=this.vertical?"translate("+("right"===this.side?this.bar_height:0)+", 0)":"translate(0, "+("top"===this.side?0:this.bar_height)+")",this.g_axisline.attr("transform",t).call(this.axis)}}set_axisline_domain(){const t=this.axis_scale.scale.domain();if(this.ordinal)this.axis_line_scale.domain(t);else{const e=this.axis_scale.model.mid;null==e?this.axis_line_scale.domain([t[0],t[t.length-1]]):this.axis_line_scale.domain([t[0],e,t[t.length-1]])}}redraw_axis(){this.draw_color_bar(),this.redraw_axisline()}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(10)),o=n(28),a=i(n(6));class s extends r.WidgetModel{defaults(){return Object.assign({},r.WidgetModel.prototype.defaults(),{_model_name:"PanZoomModel",_view_name:"PanZoom",_model_module:"bqplot",_view_module:"bqplot",_model_module_version:o.semver_range,_view_module_version:o.semver_range,scales:{},allow_pan:!0,allow_zoom:!0})}initialize(t,e){super.initialize(t,e),this.on("change:scales",this.snapshot_scales,this),this.snapshot_scales()}reset_scales(){r.resolvePromisesDict(this.get("scales")).then(t=>{a.each(Object.keys(t),e=>{a.each(t[e],(t,n)=>{t.set_state(this.scales_states[e][n])},this)},this)})}snapshot_scales(){r.resolvePromisesDict(this.get("scales")).then(t=>{this.scales_states=Object.keys(t).reduce((e,n)=>(e[n]=t[n].map(t=>t.get_state()),e),{})})}}s.serializers=Object.assign({},r.WidgetModel.serializers,{scales:{deserialize:r.unpack_models}}),e.PanZoomModel=s},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2));n(31);const o=function(){return n(0).event}.bind(this),a=i(n(6)),s=n(19),c=n(17);e.Pie=class extends s.Mark{render(){const t=super.render();this.selected_indices=this.model.get("selected"),this.selected_style=this.model.get("selected_style"),this.unselected_style=this.model.get("unselected_style"),this.display_el_classes=["slice","text"],this.pie_g=this.d3el.append("g").attr("class","pie"),this.pie_g.append("g").attr("class","slices"),this.pie_g.append("g").attr("class","labels"),this.pie_g.append("g").attr("class","lines");const e=this.model.get("radius"),n=this.model.get("inner_radius");return"outside"===this.model.get("display_labels")?(this.arc=r.arc().outerRadius(.8*e).innerRadius(.8*n),this.outer_arc=r.arc().innerRadius(.9*e).outerRadius(.9*e)):this.arc=r.arc().outerRadius(e).innerRadius(n),this.displayed.then(()=>{this.parent.tooltip_div.node().appendChild(this.tooltip_div.node()),this.create_tooltip()}),t.then(()=>{this.event_listeners={},this.process_interactions(),this.create_listeners(),this.compute_view_padding(),this.draw()},null)}set_ranges(){const t=this.scales.x;t&&(t.set_range(this.parent.padded_range("x",t.model)),this.x_offset=t.offset);const e=this.scales.y;e&&(e.set_range(this.parent.padded_range("y",e.model)),this.y_offset=e.offset)}set_positional_scales(){const t=this.scales.x?this.scales.x:this.parent.scale_x,e=this.scales.y?this.scales.y:this.parent.scale_y,n=this;this.listenTo(t,"domain_changed",function(){n.model.dirty||n.draw()}),this.listenTo(e,"domain_changed",function(){n.model.dirty||n.draw()})}create_listeners(){super.create_listeners(),this.d3el.on("mouseover",a.bind(function(){this.event_dispatcher("mouse_over")},this)).on("mousemove",a.bind(function(){this.event_dispatcher("mouse_move")},this)).on("mouseout",a.bind(function(){this.event_dispatcher("mouse_out")},this)),this.listenTo(this.model,"data_updated",function(){this.draw(!0)}),this.listenTo(this.model,"colors_updated",this.updateSlices),this.model.on_some_change(["inner_radius","radius"],function(){this.compute_view_padding(),this.update_radius(!0)},this),this.model.on_some_change(["colors","stroke","opacities"],this.updateSlices,this),this.model.on_some_change(["x","y"],function(){this.position_center(!0)},this),this.model.on_some_change(["display_labels","label_color","font_size","font_weight","display_values","values_format"],function(){this.updateLabels(!0)},this),this.model.on_some_change(["start_angle","end_angle","sort"],function(){this.draw(!0)},this),this.listenTo(this.model,"labels_updated",function(){this.updateLabels(!0),this.updatePolylines(!0)}),this.listenTo(this.model,"change:selected",function(){this.selected_indices=this.model.get("selected"),this.apply_styles()}),this.listenTo(this.model,"change:interactions",this.process_interactions),this.listenTo(this.parent,"bg_clicked",function(){this.event_dispatcher("parent_clicked")})}process_click(t){super.process_click(t),"select"===t&&(this.event_listeners.parent_clicked=this.reset_selection,this.event_listeners.element_clicked=this.click_handler)}relayout(){this.set_ranges(),this.position_center(),this.update_radius()}position_center(t){const e=!0===t?this.parent.model.get("animation_duration"):0,n=this.scales.x?this.scales.x:this.parent.scale_x,i=this.scales.y?this.scales.y:this.parent.scale_y,r="date"===n.model.type?c.getDate(this.model.get("x")):this.model.get("x"),o="date"===i.model.type?c.getDate(this.model.get("y")):this.model.get("y"),a="translate("+(n.scale(r)+n.offset)+", "+(i.scale(o)+i.offset)+")";this.pie_g.transition("position_center").duration(e).attr("transform",a)}update_radius(t){const e=!0===t?this.parent.model.get("animation_duration"):0,n=this.model.get("radius"),i=this.model.get("inner_radius"),r=this.model.get("display_labels");"inside"===r?this.arc.outerRadius(n).innerRadius(i):"outside"===r&&(this.arc.outerRadius(.8*n).innerRadius(.8*i),this.outer_arc.innerRadius(.9*n).outerRadius(.9*n));const o=this.pie_g.select(".slices"),a=this.pie_g.select(".labels"),s=this.pie_g.select(".lines"),c=this;o.selectAll(".slice").transition("update_radius").duration(e).attr("d",this.arc),"inside"===r?a.selectAll("text").transition("update_radius").duration(e).attr("transform",function(t){return"translate("+c.arc.centroid(t)+")"}):"outside"===r&&(a.selectAll("text").transition("update_radius").duration(e).attr("transform",function(t){const e=c.outer_arc.centroid(t);return e[0]=n*("left"===c.mid_angle_location(t)?-1:1),"translate("+e+")"}),s.selectAll("polyline").transition("update_radius").duration(e).attr("points",function(t){const e=c.outer_arc.centroid(t);return e[0]=.95*n*("left"===c.mid_angle_location(t)?-1:1),[c.arc.centroid(t),c.outer_arc.centroid(t),e]}))}mid_angle_location(t){const e=(t.startAngle+t.endAngle)/2;return e>Math.PI||e<0&&e>-Math.PI?"left":"right"}draw(t){this.set_ranges(),this.position_center(t),this.d3Pie=r.pie().startAngle(2*this.model.get("start_angle")*Math.PI/360).endAngle(2*this.model.get("end_angle")*Math.PI/360).value(function(t){return t.size}),this.model.get("sort")||this.d3Pie.sort(null),this.updateSlices(t),this.updateLabels(t),this.updatePolylines(t)}updateSlices(t){const e=this,n=!0===t?this.parent.model.get("animation_duration"):0,i=this.pie_g.select(".slices").selectAll(".slice").data(this.d3Pie(this.model.mark_data)),o=this.model.get("stroke"),a=this.model.get("opacities"),s=this.scales.color;i.enter().append("path").attr("class","slice").each(function(t){this._current=t}).on("click",function(t,n){return e.event_dispatcher("element_clicked",{data:t,index:n})}).merge(i).transition("draw").duration(n).style("fill",function(t,n){return void 0!==t.data.color&&void 0!==s?s.scale(t.data.color):e.get_colors(t.data.index)}).style("stroke",o).style("opacity",(t,e)=>a[e]).attrTween("d",function(t){const n=r.interpolate(this._current,t);return this._current=t,function(t){return e.arc(n(t))}}),i.exit().transition("remove").duration(n).style("opacity",0).remove(),this.apply_styles()}updateLabels(t){const e=this,n=!0===t?this.parent.model.get("animation_duration"):0,i=this.model.get("display_labels"),o=this.model.get("display_values"),a=r.format(this.model.get("values_format")),s=this.pie_g.select(".labels").selectAll("text").data(this.d3Pie(this.model.mark_data)),c=s.enter().append("text").attr("dy",".35em").style("opacity",0).each(function(t){this._current=t}).merge(s).transition("draw").duration(n).text(t=>""===t.data.label?"":o?t.data.label+": "+a(t.data.size):t.data.label).style("font-weight",this.model.get("font_weight")).style("font-size",this.model.get("font_size")).style("opacity",t=>"none"===i||0==t.value?0:1),l=this.model.get("label_color");void 0!==l&&c.style("fill",l),"inside"===i?c.attr("transform",t=>"translate("+this.arc.centroid(t)+")").style("text-anchor","middle"):"outside"===i&&c.attrTween("transform",function(t){const n=r.interpolate(this._current,t),i=this;return function(r){const o=n(r);i._current=o;const a=e.outer_arc.centroid(o);return a[0]=e.model.get("radius")*("left"===e.mid_angle_location(t)?-1:1),"translate("+a+")"}}).styleTween("text-anchor",function(t){const n=r.interpolate(this._current,t);return function(t){const i=n(t);return"left"===e.mid_angle_location(i)?"end":"start"}}),s.exit().remove()}updatePolylines(t){const e=this,n=!0===t?this.parent.model.get("animation_duration"):0,i=this.model.get("display_labels"),o=this.pie_g.select(".lines").selectAll("polyline").data(this.d3Pie(this.model.mark_data)),a=o.enter().append("polyline").each(function(t){this._current=t}).merge(o).transition("draw").duration(n).style("opacity",t=>"outside"!==i||0==t.value||""===t.data.label?0:1);"outside"===i&&a.attrTween("points",function(t){this._current=this._current;const n=r.interpolate(this._current,t),i=this;return function(t){const r=n(t);i._current=r;const o=e.outer_arc.centroid(r);return o[0]=.95*e.model.get("radius")*("left"===e.mid_angle_location(r)?-1:1),[e.arc.centroid(r),e.outer_arc.centroid(r),o]}}),o.exit().remove()}clear_style(t,e){let n=this.pie_g.selectAll(".slice");e&&(n=n.filter(function(t,n){return-1!==e.indexOf(n)}));const i={};for(let e in t)i[e]=null;n.styles(i)}set_style_on_elements(t,e){if(null==e||0===e.length)return;let n=this.pie_g.selectAll(".slice");(n=n.filter(function(t,n){return-1!==e.indexOf(n)})).styles(t)}set_default_style(t){const e=this,n=this.model.get("stroke"),i=this.model.get("opacities"),r=this.scales.color;this.pie_g.select(".slices").selectAll(".slice").style("fill",function(t,n){return void 0!==t.data.color&&void 0!==r?r.scale(t.data.color):e.get_colors(t.data.index)}).style("stroke",n).style("opacity",(t,e)=>i[e])}click_handler(t){const e=t.index,n=this,i=this.model.get("selected")||[];let s=Array.from(i);const c=s.indexOf(e),l=o().ctrlKey||o().metaKey;if(c>-1&&l)s.splice(c,1);else{if(o().shiftKey){if(c>-1)return;const t=0!==s.length?r.min(s):-1,i=0!==s.length?r.max(s):n.model.mark_data.length;e>i?a.range(i+1,e).forEach(function(t){s.push(t)}):e<t&&a.range(e+1,t).forEach(function(t){s.push(t)})}else l||(s=[]);s.push(e)}this.model.set("selected",0===s.length?null:new Uint32Array(s),{updated_view:this}),this.touch();const u=o();void 0!==u.cancelBubble&&(u.cancelBubble=!0),u.stopPropagation&&u.stopPropagation(),u.preventDefault(),this.selected_indices=s,this.apply_styles()}reset_selection(){this.model.set("selected",null),this.touch(),this.selected_indices=null,this.clear_style(this.selected_style),this.clear_style(this.unselected_style),this.set_default_style()}compute_view_padding(){const t=this.model.get("scales"),e=r.max([this.model.get("radius"),this.model.get("inner_radius")]),n=t.x?e+1:0,i=t.y?e+1:0;n===this.x_padding&&i===this.y_padding||(this.x_padding=n,this.y_padding=i,this.trigger("mark_padding_updated"))}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=n(18),a=n(17),s=i(n(12));class c extends o.MarkModel{defaults(){return Object.assign({},o.MarkModel.prototype.defaults(),{_model_name:"PieModel",_view_name:"Pie",sizes:[],labels:[],color:null,x:.5,y:.5,scales_metadata:{color:{dimension:"color"}},sort:!1,colors:r.scaleOrdinal(r.schemeCategory10).range(),stroke:null,opacities:[],radius:180,inner_radius:.1,start_angle:0,end_angle:360,display_labels:"inside",display_values:!1,values_format:".1f",label_color:null,font_size:"12px",font_weight:"normal"})}initialize(t,e){super.initialize(t,e),this.on("change:sizes",this.update_data,this),this.on("change:color",function(){this.update_color(),this.trigger("colors_updated")},this),this.on("change:labels",this.update_labels,this),this.on_some_change(["preserve_domain"],this.update_domains,this),this.update_data(),this.update_color(),this.update_labels(),this.update_domains()}update_data(){const t=this.get("sizes"),e=this.get("color")||[],n=this.get("labels");this.mark_data=Array.prototype.map.call(t,function(t,i){return{size:t,color:e[i],label:null==n[i]?"":n[i],index:i}}),this.update_color(),this.update_domains(),this.trigger("data_updated")}update_labels(){if(!this.mark_data)return;const t=this.get("labels");this.mark_data.forEach(function(e,n){e.label=null==t[n]?"":t[n]}),this.trigger("labels_updated")}update_color(){if(!this.mark_data)return;const t=this.get("color"),e=this.get("scales").color;e&&(this.get("preserve_domain").color?e.del_domain([],this.model_id+"_color"):e.compute_and_set_domain(t,this.model_id+"_color"))}update_domains(){if(!this.mark_data)return;const t=this.get("scales"),e=t.x,n=t.y;if(e){const t="date"===e.type?a.getDate(this.get("x")):this.get("x");this.get("preserve_domain").x?e.del_domain([],this.model_id+"_x"):e.compute_and_set_domain([t],this.model_id+"_x")}n&&(this.get("preserve_domain").y?n.del_domain([],this.model_id+"_y"):n.compute_and_set_domain([this.get("y")],this.model_id+"_y"))}get_data_dict(t,e){return t.data}}c.serializers=Object.assign({},o.MarkModel.serializers,{sizes:s.array_or_json,color:s.array_or_json}),e.PieModel=c},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=n(140);e.DateColorScale=class extends o.ColorScale{create_d3_scale(){this.scale=r.scaleTime()}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(141),r=n(17);e.DateColorScaleModel=class extends i.ColorScaleModel{defaults(){return Object.assign({},i.ColorScaleModel.prototype.defaults(),{_model_name:"DateColorScaleModel",_view_name:"DateColorScale",min:null,max:null,mid:null})}set_init_state(){this.type="date_color_linear",this.color_range=[],this.mid=null,this.global_min=(new Date).setTime(0),this.global_max=new Date}min_max_changed(){this.min=r.getDate(this.get("min")),this.max=r.getDate(this.get("max")),this.min_from_data=null===this.min,this.max_from_data=null===this.max,this.update_domain()}toDomainType(t){return new Date(t)}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=n(86);e.DateScale=class extends o.LinearScale{render(){this.scale=r.scaleTime(),this.model.domain.length>0&&this.scale.domain(this.model.domain),this.offset=0,this.create_event_listeners()}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=n(136),o=i(n(64)),a=i(n(2)),s=o.symbol;e.Scatter=class extends r.ScatterBase{render(){return this.dot=s().type(this.model.get("marker")).size(this.model.get("default_size")).skew(this.model.get("default_skew")),super.render()}create_listeners(){super.create_listeners(),this.listenTo(this.model,"change:colors",this.update_colors),this.listenTo(this.model,"change:stroke",this.update_stroke),this.listenTo(this.model,"change:stroke_width",this.update_stroke_width),this.listenTo(this.model,"change:default_opacities",this.update_default_opacities),this.listenTo(this.model,"change:default_skew",this.update_default_skew),this.listenTo(this.model,"change:marker",this.update_marker),this.listenTo(this.model,"change:default_size",this.update_default_size),this.listenTo(this.model,"change:fill",this.update_fill),this.listenTo(this.model,"change:display_names",this.update_names)}update_colors(t,e){if(!this.model.dirty){const t=this,n=this.model.get("stroke"),i=e.length;this.d3el.selectAll(".dot").style("fill",this.model.get("fill")?function(e,n){return t.get_element_color(e,n)}:"none").style("stroke",n||function(e,n){return t.get_element_color(e,n)}),this.legend_el&&(this.legend_el.select("path").style("fill",function(t,n){return e[n%i]}).style("stroke",n||function(t,n){return e[n%i]}),this.legend_el.select("text").style("fill",this.model.get("fill")?function(t,n){return e[n%i]}:"none"))}this.apply_styles()}update_fill(t,e){const n=this,i=this.model.get("colors"),r=i.length;this.d3el.selectAll(".dot").style("fill",e?function(t,e){return n.get_element_color(t,e)}:"none"),this.legend_el&&this.legend_el.selectAll("path").style("fill",e?function(t,e){return i[e%r]}:"none")}update_stroke_width(){const t=this.model.get("stroke_width");this.d3el.selectAll(".dot").style("stroke-width",t),this.legend_el&&this.legend_el.selectAll("path").style("stroke-width",t)}update_stroke(t,e){const n=this,i=this.model.get("stroke");this.d3el.selectAll(".dot").style("stroke",i||function(t,e){return n.get_element_color(t,e)}),this.legend_el&&this.legend_el.selectAll("path").style("stroke",i)}update_default_opacities(t){if(!this.model.dirty){const e=this.model.get("default_opacities"),n=this.model.get("colors"),i=n.length,r=e.length,o=!0===t?this.parent.model.get("animation_duration"):0,a=this;this.d3el.selectAll(".dot").transition("update_default_opacities").duration(o).style("opacity",function(t,e){return a.get_element_opacity(t,e)}),this.legend_el&&this.legend_el.select("path").style("opacity",function(t,n){return e[n%r]}).style("fill",function(t,e){return n[e%i]})}}update_marker(t,e){this.model.dirty||(this.d3el.selectAll(".dot").transition("update_marker").duration(this.parent.model.get("animation_duration")).attr("d",this.dot.type(e)),this.legend_el&&this.legend_el.select("path").attr("d",this.dot.type(e)))}update_default_skew(t){if(!this.model.dirty){const e=!0===t?this.parent.model.get("animation_duration"):0,n=this;this.d3el.selectAll(".dot").transition("update_default_skew").duration(e).attr("d",this.dot.skew(function(t){return n.get_element_skew(t)}))}}update_default_size(t){if(this.compute_view_padding(),!this.model.dirty){const e=!0===t?this.parent.model.get("animation_duration"):0,n=this;this.d3el.selectAll(".dot").transition("update_default_size").duration(e).attr("d",this.dot.size(function(t){return n.get_element_size(t)})),this.update_names(t)}}update_names(t){const e=this,n=this.model.get("names")||[],i=this.model.get("display_names")&&0!==n.length,r=t?this.parent.model.get("animation_duration"):0;this.d3el.selectAll(".object_grp").select("text").text(function(t){return t.name}).transition("update_names").duration(r).attr("transform",function(t){const n=Math.sqrt(e.get_element_size(t))/2;return"translate("+n+","+-n+")"}).attr("display",function(t){return i?"inline":"none"})}color_scale_updated(t){const e=this,n=this.model.get("fill"),i=this.model.get("stroke"),r=!0===t?this.parent.model.get("animation_duration"):0;this.d3el.selectAll(".object_grp").select("path").transition("color_scale_updated").duration(r).style("fill",n?function(t,n){return e.get_element_color(t,n)}:"none").style("stroke",i||function(t,n){return e.get_element_color(t,n)})}draw_elements(t,e){const n=this,i=!0===t?this.parent.model.get("animation_duration"):0,r=this.d3el.selectAll(".object_grp");e.append("path").attr("class","dot element"),e.append("text").attr("class","dot_text"),r.select("path").transition("draw_elements").duration(i).attr("d",this.dot.size(function(t){return n.get_element_size(t)}).skew(function(t){return n.get_element_skew(t)})),this.update_names(t),this.apply_styles()}draw_legend_elements(t,e){const n=this.model.get("colors"),i=n.length,r=this.model.get("stroke");t.append("path").attr("transform",function(t,n){return"translate( "+e/2+", "+e/2+")"}).attr("d",this.dot.size(64)).style("fill",this.model.get("fill")?function(t,e){return n[e%i]}:"none").style("stroke",r||function(t,e){return n[e%i]})}set_default_style(t){if(!t||0===t.length)return;const e=this.d3el.selectAll(".element").filter(function(e,n){return-1!==t.indexOf(n)}),n=this.model.get("fill"),i=this.model.get("stroke"),r=this.model.get("stroke_width"),o=this;e.style("fill",n?function(t,e){return o.get_element_color(t,e)}:"none").style("stroke",i||function(t,e){return o.get_element_color(t,e)}).style("opacity",function(t,e){return o.get_element_opacity(t,e)}).style("stroke-width",r)}set_drag_style(t,e,n){a.select(n).select("path").classed("drag_scatter",!0).transition("set_drag_style").attr("d",this.dot.size(5*this.model.get("default_size")));const i=this.model.get("drag_color");i&&a.select(n).select("path").style("fill",i).style("stroke",i)}reset_drag_style(t,e,n){const i=this.model.get("stroke"),r=this.get_element_color(t,e);a.select(n).select("path").classed("drag_scatter",!1).transition("reset_drag_style").attr("d",this.dot.size(this.get_element_size(t))),this.model.get("drag_color")&&a.select(n).select("path").style("fill",r).style("stroke",i||r)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(63),r=n(17);e.DateScaleModel=class extends i.LinearScaleModel{defaults(){return Object.assign({},i.LinearScaleModel.prototype.defaults(),{_model_name:"DateScaleModel",_view_name:"DateScale",min:null,max:null})}set_init_state(){this.type="date",this.global_min=(new Date).setTime(0),this.global_max=new Date}min_max_changed(){this.min=r.getDate(this.get("min")),this.max=r.getDate(this.get("max")),this.min_from_data=null===this.min,this.max_from_data=null===this.max,this.update_domain()}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=i(n(6)),a=n(18),s=i(n(12)),c=i(n(17));class l extends a.MarkModel{defaults(){return Object.assign({},a.MarkModel.prototype.defaults(),{_model_name:"LinesModel",_view_name:"Lines",x:[],y:[],color:null,scales_metadata:{x:{orientation:"horizontal",dimension:"x"},y:{orientation:"vertical",dimension:"y"},color:{dimension:"color"}},colors:r.scaleOrdinal(r.schemeCategory10).range(),fill_colors:r.scaleOrdinal(r.schemeCategory10).range(),stroke_width:2,labels_visibility:"none",curves_subset:[],line_style:"solid",interpolation:"linear",close_path:!1,fill:"none",marker:null,marker_size:64,opacities:[],fill_opacities:[]})}initialize(t,e){super.initialize(t,e),this.on_some_change(["x","y","color"],this.update_data,this),this.on("change:labels",this.update_labels,this),this.on_some_change(["preserve_domain"],this.update_domains,this),this.update_data(),this.update_domains()}update_data(){this.dirty=!0;const t=this;this.x_data=this.get("x"),this.y_data=this.get("y"),this.color_data=this.get("color")||[];let e=this.get("labels");if(0===this.x_data.length||0===this.y_data.length)this.mark_data=[];else{this.x_data=c.is_array(this.x_data[0])?this.x_data:[this.x_data],this.y_data=c.is_array(this.y_data[0])?this.y_data:[this.y_data],e=this.get_labels();const n=this.y_data.length;1==this.x_data.length&&n>1?this.mark_data=e.map(function(e,i){return{name:e,values:Array.prototype.map.call(t.y_data[i],function(e,r){return{x:t.x_data[0][r],y:e,y0:t.y_data[Math.min(i+1,n-1)][r],sub_index:r}}),color:t.color_data[i],index:i}}):this.mark_data=e.map(function(e,i){return{name:e,values:r.zip(t.x_data[i],t.y_data[i]).map(function(e,r){return{x:e[0],y:e[1],y0:t.y_data[Math.min(i+1,n-1)][r],sub_index:r}}),color:t.color_data[i],index:i}})}this.update_domains(),this.dirty=!1,this.trigger("data_updated")}update_labels(){const t=this.get_labels();this.mark_data.forEach(function(e,n){e.name=t[n]}),this.trigger("labels_updated")}get_labels(){let t=this.get("labels");const e=1==this.x_data.length?this.y_data.length:Math.min(this.x_data.length,this.y_data.length);return t.length>e?t=t.slice(0,e):t.length<e&&o.range(t.length,e).forEach(function(e){t[e]="C"+(e+1)}),t}update_domains(){if(!this.mark_data)return;const t=this.get("scales"),e=t.x,n=t.y,i=t.color;this.get("preserve_domain").x?e.del_domain([],this.model_id+"_x"):e.compute_and_set_domain(this.mark_data.map(function(t){return t.values.map(function(t){return t.x})}),this.model_id+"_x"),this.get("preserve_domain").y?n.del_domain([],this.model_id+"_y"):n.compute_and_set_domain(this.mark_data.map(function(t){return t.values.map(function(t){return t.y})}),this.model_id+"_y"),null!=i&&(this.get("preserve_domain").color?i.del_domain([],this.model_id+"_color"):i.compute_and_set_domain(this.mark_data.map(function(t){return t.color}),this.model_id+"_color"))}get_data_dict(t,e){return t}}l.serializers=Object.assign({},a.MarkModel.serializers,{x:s.array_or_json,y:s.array_or_json,color:s.array_or_json}),e.LinesModel=l;e.FlexLineModel=class extends l{defaults(){return Object.assign({},l.prototype.defaults(),{_model_name:"FlexLineModel",_view_name:"FlexLine",x:[],y:[],color:null,scales_metadata:{x:{orientation:"horizontal",dimension:"x"},y:{orientation:"vertical",dimension:"y"},color:{dimension:"color"}},colors:r.scaleOrdinal(r.schemeCategory10).range(),fill_colors:r.scaleOrdinal(r.schemeCategory10).range(),stroke_width:2,labels_visibility:"none",curves_subset:[],line_style:"solid",interpolation:"linear",close_path:!1,fill:"none",marker:null,marker_size:64,opacities:[],fill_opacities:[]})}update_data(){this.dirty=!0;const t=this;this.x_data=this.get("x"),this.y_data=this.get("y");let e=this.get("labels");if(0===this.x_data.length||0===this.y_data.length)this.mark_data=[],this.data_len=0;else{this.x_data=o.isNumber(this.x_data[0])?[this.x_data]:this.x_data,this.y_data=o.isNumber(this.y_data[0])?[this.y_data]:this.y_data,e=this.get_labels();const n=this.get("color")||[],i=this.get("width")||[];this.data_len=Math.min(this.x_data[0].length,this.y_data[0].length),this.mark_data=[{name:e[0],values:o.range(this.data_len-1).map(function(e,r){return{x1:t.x_data[0][r],y1:t.y_data[0][r],x2:t.x_data[0][r+1],y2:t.y_data[0][r+1],color:n[r],size:i[r]}})}]}this.update_domains(),this.dirty=!1,this.trigger("data_updated")}update_domains(){if(!this.mark_data)return;const t=this.get("scales"),e=t.x,n=t.y,i=t.color,r=t.width;this.get("preserve_domain").x?e.del_domain([],this.model_id+"_x"):e.compute_and_set_domain(this.x_data[0].slice(0,this.data_len),this.model_id+"_x"),this.get("preserve_domain").y?n.del_domain([],this.model_id+"_y"):n.compute_and_set_domain(this.y_data[0].slice(0,this.data_len),this.model_id+"_y"),null!=i&&(this.get("preserve_domain").color?i.del_domain([],this.model_id+"_color"):i.compute_and_set_domain(this.mark_data.map(function(t){return t.values.map(function(t){return t.color})}),this.model_id+"_color")),null!=r&&(this.get("preserve_domain").width?r.del_domain([],this.model_id+"_width"):r.compute_and_set_domain(this.mark_data.map(function(t){return t.values.map(function(t){return t.size})}),this.model_id+"_width"))}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=n(137),o=i(n(12)),a=i(n(6));class s extends r.ScatterBaseModel{defaults(){return Object.assign({},r.ScatterBaseModel.prototype.defaults(),{_model_name:"ScatterModel",_view_name:"Scatter",skew:null,marker:"circle",stroke:null,stroke_width:1.5,default_skew:.5,default_size:64,names:[],display_names:!0,fill:!0,drag_color:null,drag_size:5,names_unique:!0})}initialize(t,e){super.initialize(t,e),this.on("change:skew",this.update_data,this),this.on_some_change(["names","names_unique"],function(){this.update_unique_ids(),this.trigger("data_updated")},this)}update_mark_data(){super.update_mark_data();const t=this.get("skew")||[];this.mark_data.forEach(function(e,n){e.skew=t[n]})}update_unique_ids(){let t=this.get("names");const e=null!=t&&0!==t.length;t=e?t:this.mark_data.map(function(t,e){return"Dot"+e});let n=[];n=this.get("names_unique")?t.slice(0):a.range(this.mark_data.length),this.mark_data.forEach(function(e,i){e.name=t[i],e.unique_id=n[i]})}}s.serializers=Object.assign({},r.ScatterBaseModel.serializers,{skew:o.array_or_json,names:o.array_or_json}),e.ScatterModel=s},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(6)),o=i(n(2)),a=n(49),s=i(n(85));e.FastIntervalSelector=class extends a.BaseXSelector{render(){super.render(),this.freeze_but_move=!0,this.freeze_dont_move=!1,this.active=!1,this.dirty=!1,this.size=this.model.get("size"),this.width=this.parent.width-this.parent.margin.left-this.parent.margin.right,this.height=this.parent.height-this.parent.margin.top-this.parent.margin.bottom;const t=this,e=this.create_scales();Promise.all([this.mark_views_promise,e]).then(function(){t.background=t.d3el.append("rect").attr("x",0).attr("y",0).attr("width",t.width).attr("height",t.height).attr("class","selector selectormouse").attr("pointer-events","all").attr("visibility","hidden"),t.background.on("mousemove",r.bind(t.mousemove,t)).on("click",r.bind(t.click,t)).on("dblclick",r.bind(t.dblclick,t)),t.rect=t.d3el.append("rect").attr("class","selector intsel").attr("x",0).attr("y",0).attr("width",t.size).attr("height",t.height).attr("pointer-events","none").attr("display","none"),t.color_change(),t.selected_changed(),t.create_listeners()})}create_listeners(){super.create_listeners(),this.listenTo(this.model,"change:color",this.color_change)}color_change(){null!==this.model.get("color")&&this.rect.style("fill",this.model.get("color"))}click(){this.active=!0,this.rect.style("display","inline"),this.freeze_but_move=!!this.model.get("size")||!this.freeze_but_move}dblclick(){this.freeze_dont_move=!this.freeze_dont_move}mousemove(){if(this.freeze_dont_move||!this.active)return;this.dirty=!0;const t=o.mouse(this.background.node()),e=this.size>0?this.size:parseInt(this.rect.attr("width")),n=(this.height-t[1])/this.height,i=this.freeze_but_move?e:Math.round(n*this.width);let r;r=t[0]-i/2<0?0:t[0]+i/2>this.width?this.width-i:t[0]-i/2,this.rect.attr("x",r),this.rect.attr("width",i);const a=[r,r+i];this.set_selected("selected",this.scale.invert_range(a)),this.update_mark_selected(a,void 0),this.touch(),this.dirty=!1}update_mark_selected(t,e){let n,i;if(void 0!==t&&0!==t.length||r.each(this.mark_views,function(t){return t.selector_changed()}),void 0===e){const e=this.model.get("orientation");n="vertical"==e?[]:t,i="vertical"==e?t:[]}else n=t,i=e;const o=function(t){return s.point_in_rectangle(t,n,i)},a=function(t){return s.rect_inter_rect(t[0],t[1],n,i)};r.each(this.mark_views,function(t){t.selector_changed(o,a)},this)}relayout(){super.relayout(),this.adjust_rectangle(),this.background.attr("width",this.width).attr("height",this.height),this.set_range([this.scale])}reset(){this.rect.attr("x",0).attr("width",0),this.model.set("selected",null),this.update_mark_selected(void 0,void 0),this.touch()}update_scale_domain(t){super.update_scale_domain(),!0!==t&&this.selected_changed()}selected_changed(){if(this.dirty)return;const t=this.model.get("selected")||[];if(0===t.length)this.reset();else{if(2!=t.length)return;{let e=t.map(this.scale.scale);e=e.sort(function(t,e){return t-e}),this.rect.attrs({x:e[0],width:e[1]-e[0]}).style("display","inline"),this.active=!0,this.update_mark_selected(e,void 0)}}}adjust_rectangle(){"vertical"==this.model.get("orientation")?this.d3el.selectAll("rect").attr("x",0).attr("width",this.width):this.d3el.selectAll("rect").attr("y",0).attr("height",this.height)}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=n(86);e.LogScale=class extends o.LinearScale{render(){this.scale=r.scaleLog(),this.model.domain.length>0&&this.scale.domain(this.model.domain),this.offset=0,this.create_event_listeners()}}},function(t,e,n){"use strict";n.r(e),e.default="float scale_transform_linear(float domain_value, vec2 range, vec2 domain) {\n float normalized = (domain_value - domain[0]) / (domain[1] - domain[0]);\n float range_value = normalized * (range[1] - range[0]) + range[0];\n return range_value;\n}\n\nfloat scale_transform_linear_inverse(float range_value, vec2 range, vec2 domain) {\n float normalized = (range_value - range[0]) / (range[1] - range[0]);\n float domain_value = normalized * (domain[1] - domain[0]) + domain[0];\n return domain_value;\n}\n\nfloat scale_transform_log(float domain_value, vec2 range, vec2 domain) {\n float normalized = (log(domain_value) - log(domain[0])) / (log(domain[1]) - log(domain[0]));\n float range_value = normalized * (range[1] - range[0]) + range[0];\n return range_value;\n}\n\nfloat scale_transform_log_inverse(float range_value, vec2 range, vec2 domain) {\n float normalized = (range_value - range[0]) / (range[1] - range[0]);\n float domain_value = exp(normalized * (log(domain[1]) - log(domain[0])) + log(domain[0]));\n return domain_value;\n}"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(63);e.LogScaleModel=class extends i.LinearScaleModel{defaults(){return Object.assign({},i.LinearScaleModel.prototype.defaults(),{_model_name:"LogScaleModel",_view_name:"LogScale",domain:[]})}set_init_state(){this.type="log",this.global_min=Number.MIN_VALUE,this.global_max=Number.POSITIVE_INFINITY}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(10)),o=n(28);class a extends r.DOMWidgetModel{defaults(){return Object.assign({},r.DOMWidgetModel.prototype.defaults(),{_model_name:"FigureModel",_view_name:"Figure",_model_module:"bqplot",_view_module:"bqplot",_model_module_version:o.semver_range,_view_module_version:o.semver_range,title:"",axes:[],marks:[],interaction:null,scale_x:void 0,scale_y:void 0,title_style:{},background_style:{},legend_style:{},legend_text:{},theme:"classic",min_aspect_ratio:.01,max_aspect_ratio:100,pixel_ratio:null,fig_margin:{top:60,bottom:60,left:60,right:60},padding_x:0,padding_y:.025,legend_location:"top-right",animation_duration:0})}initialize(t,e){super.initialize(t,e),this.on("msg:custom",this.handle_custom_messages,this)}handle_custom_messages(t){"save_png"===t.type?this.trigger("save_png",t.filename,t.scale):"save_svg"===t.type&&this.trigger("save_svg",t.filename)}save_png(){this.trigger("save_png")}}a.serializers=Object.assign({},r.DOMWidgetModel.serializers,{marks:{deserialize:r.unpack_models},axes:{deserialize:r.unpack_models},interaction:{deserialize:r.unpack_models},scale_x:{deserialize:r.unpack_models},scale_y:{deserialize:r.unpack_models},layout:{deserialize:r.unpack_models}}),e.FigureModel=a},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(10)),o=i(n(2)),a=()=>n(0).event,s=n(19);e.Map=class extends s.Mark{render(){const t=super.render();return this.map=this.d3el.append("svg").attr("viewBox","0 0 1200 980"),this.width=this.parent.plotarea_width,this.height=this.parent.plotarea_height,this.map_id=r.uuid(),this.enable_hover=this.model.get("enable_hover"),this.display_el_classes=["event_layer"],this.displayed.then(()=>{this.parent.tooltip_div.node().appendChild(this.tooltip_div.node()),this.create_tooltip()}),t.then(()=>{this.event_listeners={},this.process_interactions(),this.create_listeners(),this.draw()})}set_ranges(){}set_positional_scales(){const t=this.scales.projection;this.listenTo(t,"domain_changed",()=>{this.model.dirty||this.draw()})}initialize_additional_scales(){const t=this.scales.color;t&&(this.listenTo(t,"domain_changed",()=>{this.update_style()}),t.on("color_scale_range_changed",this.update_style,this))}remove_map(){o.selectAll(".world_map.map"+this.map_id).remove()}draw(){this.set_ranges(),this.remove_map(),this.transformed_g=this.map.append("g").attr("class","world_map map"+this.map_id),this.fill_g=this.transformed_g.append("g"),this.highlight_g=this.transformed_g.append("g"),this.stroke_g=this.transformed_g.append("g");const t=this.scales.projection;this.fill_g.selectAll("path").data(this.model.geodata).enter().append("path").attr("d",t.path).style("fill",(t,e)=>this.fill_g_colorfill(t,e)),this.stroke_g.selectAll("path").data(this.model.geodata).enter().append("path").attr("class","event_layer").attr("d",t.path).style("fill-opacity",0).on("click",(t,e)=>this.event_dispatcher("element_clicked",{data:t,index:e})),this.validate_color(this.model.get("stroke_color"))&&this.stroke_g.selectAll("path").style("stroke",this.model.get("stroke_color")),this.zoom=o.zoom().scaleExtent([1,8]).on("zoom",()=>{this.zoomed(this)}),this.parent.bg_events.call(this.zoom),this.parent.bg_events.on("dblclick.zoom",null),this.parent.bg_events.on("dblclick",()=>{this.reset_zoom(this)})}validate_color(t){return""!==t}mouseover_handler(){if(!this.model.get("hover_highlight"))return;const t=o.select(a().target);if(this.is_hover_element(t)){const e=t.data()[0],n=this.model.get("selected")||[],i=Array.from(n),r=this.highlight_g.append(()=>t.node().cloneNode(!0));r.classed("hovered",!0),r.classed("event_layer",!1),this.validate_color(this.model.get("hovered_styles").hovered_stroke)&&-1===i.indexOf(e.id)&&r.style("stroke",this.model.get("hovered_styles").hovered_stroke).style("stroke-width",this.model.get("hovered_styles").hovered_stroke_width),this.validate_color(this.model.get("hovered_styles").hovered_fill)&&-1===i.indexOf(e.id)&&r.style("fill-opacity",1).style("fill",()=>this.model.get("hovered_styles").hovered_fill)}}mouseout_handler(){if(!this.model.get("hover_highlight"))return;const t=o.select(a().target);this.is_hover_element(t)&&(t.transition("mouseout_handler").style("fill",(t,e)=>this.fill_g_colorfill(t,e)).style("stroke",(t,e)=>this.hoverfill(t,e)),this.highlight_g.selectAll(".hovered").remove())}click_handler(){const t=o.select(a().target);if(this.is_hover_element(t)){const e=t.data()[0],n=this.model.get("selected")||[],i=Array.from(n),r=i.indexOf(e.id);if(r>-1){i.splice(r,1),t.transition("click_handler").style("fill-opacity",0),this.highlight_g.selectAll(".hovered").remove();const n="#c".concat(e.id.toString());o.select(n).remove()}else this.highlight_g.selectAll(".hovered").remove(),this.highlight_g.append(()=>t.node().cloneNode(!0)).attr("id","c"+e.id).classed("selected",!0).classed("event_layer",!1),this.validate_color(this.model.get("selected_styles").selected_fill)&&this.highlight_g.selectAll(".selected").style("fill-opacity",1).style("fill",this.model.get("selected_styles").selected_fill),this.validate_color(this.model.get("selected_styles").selected_stroke)&&this.highlight_g.selectAll(".selected").style("stroke",this.model.get("selected_styles").selected_stroke).style("stroke-width",this.model.get("selected_styles").selected_stroke_width),i.push(e.id),this.model.set("selected",i),this.touch();this.model.set("selected",0===i.length?null:i,{updated_view:this}),this.touch()}}reset_zoom(t){t.zoom.transform(t.parent.bg,o.zoomIdentity)}zoomed(t){const e=a().transform,n=t.height/3,i=2*t.width;e.x=Math.min(t.width/2*(e.k-1),Math.max(i/2*(1-e.k),e.x)),e.y=Math.min(t.height/2*(e.k-1)+this.height*e.k,Math.max(n/2*(1-e.k)-t.width*e.k,e.y)),t.transformed_g.style("stroke-width",1/e.k).attr("transform",e)}create_listeners(){this.d3el.on("mouseover",()=>{this.event_dispatcher("mouse_over")}).on("mousemove",()=>{this.event_dispatcher("mouse_move")}).on("mouseout",()=>{this.event_dispatcher("mouse_out")}),this.listenTo(this.model,"data_updated",this.draw),this.listenTo(this.model,"change:color",this.update_style),this.listenTo(this.model,"change:stroke_color",this.change_stroke_color),this.listenTo(this.model,"change:colors",this.change_map_color),this.listenTo(this.model,"change:selected",this.change_selected),this.listenTo(this.model,"change:selected_styles",()=>{this.change_selected_fill(),this.change_selected_stroke()}),this.listenTo(this.model,"change:interactions",this.process_interactions),this.listenTo(this.parent,"bg_clicked",()=>{this.event_dispatcher("parent_clicked")})}process_click(t){super.process_click(t),"select"===t&&(this.event_listeners.parent_clicked=this.reset_selection,this.event_listeners.element_clicked=this.click_handler)}process_hover(t){super.process_hover(t),"tooltip"===t&&(this.event_listeners.mouse_over=()=>(this.mouseover_handler(),this.refresh_tooltip()),this.event_listeners.mouse_move=this.move_tooltip,this.event_listeners.mouse_out=()=>(this.mouseout_handler(),this.hide_tooltip()))}change_selected_fill(){this.validate_color(this.model.get("selected_styles").selected_fill)?this.highlight_g.selectAll(".selected").style("fill-opacity",1).style("fill",this.model.get("selected_styles").selected_fill):this.highlight_g.selectAll(".selected").style("fill-opacity",0)}change_selected_stroke(){this.validate_color(this.model.get("selected_styles").selected_stroke)?this.highlight_g.selectAll(".selected").style("stroke-width",this.model.get("selected_styles").selected_stroke_width).style("stroke",this.model.get("selected_styles").selected_stroke):this.highlight_g.selectAll(".selected").style("stroke-width",0)}change_selected(){this.highlight_g.selectAll("path").remove();const t=this.model.get("selected"),e=t||[],n=this.stroke_g.selectAll("path").data();this.stroke_g.selectAll("path").style("stroke",(t,e)=>this.hoverfill(t,e));const i=this.stroke_g.selectAll("path");for(let t=0;t<n.length;t++)e.indexOf(n[t].id)>-1&&this.highlight_g.append(()=>i.nodes()[t].cloneNode(!0)).attr("id",n[t].id).style("fill-opacity",()=>this.validate_color(this.model.get("selected_styles").selected_fill)?1:0).style("fill",this.model.get("selected_styles").selected_fill).style("stroke-opacity",()=>this.validate_color(this.model.get("selected_styles").selected_stroke)?1:0).style("stroke",this.model.get("selected_styles").selected_stroke).style("stroke-width",this.model.get("selected_styles").selected_stroke_width).classed("selected",!0)}reset_selection(){this.model.set("selected",[]),this.touch(),this.highlight_g.selectAll(".selected").remove(),o.select(this.d3el.parentNode).selectAll("path").classed("selected",!1),o.select(this.d3el.parentNode).selectAll("path").classed("hovered",!1),this.stroke_g.selectAll("path").style("stroke",(t,e)=>this.hoverfill(t,e)),this.fill_g.selectAll("path").classed("selected",!1).style("fill",(t,e)=>this.fill_g_colorfill(t,e))}change_stroke_color(){this.stroke_g.selectAll("path").style("stroke",this.model.get("stroke_color"))}change_map_color(){this.is_object_empty(this.model.get("color"))&&this.fill_g.selectAll("path").style("fill",(t,e)=>this.fill_g_colorfill(t,e))}update_style(){const t=this.model.get("color");this.is_object_empty(t)||this.fill_g.selectAll("path").style("fill",(t,e)=>this.fill_g_colorfill(t,e))}is_object_empty(t){return 0===Object.keys(t).length&&t.constructor===Object}hoverfill(t,e){const n=this.model.get("selected");return(n||[]).indexOf(t.id)>-1&&this.validate_color(this.model.get("selected_styles").selected_stroke)?this.model.get("selected_styles").selected_stroke:this.model.get("stroke_color")}fill_g_colorfill(t,e){const n=this.scales.color,i=this.model.get("selected"),r=i||[],o=this.model.get("color"),a=this.model.get("colors");return r.indexOf(t.id)>-1?this.model.get("selected_styles").selected_fill:this.is_object_empty(o)?a[t.id]||a.default_color:void 0===o[t.id]||null===o[t.id]||"nan"===o[t.id]||void 0===n?a.default_color:n.scale(o[t.id])}clear_style(){}compute_view_padding(){}set_default_style(){}set_style_on_elements(){}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=n(10),o=i(n(2)),a=i(n(17)),s=i(n(6));e.Tooltip=class extends r.DOMWidgetView{initialize(){this.d3el=o.select(this.el),super.initialize.apply(this,arguments)}render(){this.parent=this.options.parent,this.update_formats(),this.create_listeners(),this.create_table()}create_listeners(){this.listenTo(this.parent,"update_tooltip",this.update_tooltip),this.model.on_some_change(["fields","show_labels","labels"],this.create_table,this),this.listenTo(this.model,"change:formats",this.update_formats)}update_formats(){const t=this.model.get("fields"),e=this.model.get("formats");this.tooltip_formats=t.map(function(t,n){const i=e[n];return void 0===i||""===i?function(t){return t}:a.is_valid_time_format(i)?o.timeFormat(i):o.format(i)})}update_tooltip(t){const e=this;this.d3el.select("table").selectAll("tr").select(".datavalue").text((n,i)=>e.tooltip_formats[i](t[n]))}create_table(){const t=this.model.get("fields"),e=s.clone(this.model.get("labels"));for(let n=e.length;n<t.length;n++)e[n]=t[n];this.d3el.select("table").remove();const n=this.d3el.append("table").selectAll("tr").data(t);n.exit().remove();const i=n.enter().append("tr").attr("class","datarow");this.model.get("show_labels")&&i.append("td").text((t,n)=>e[n]).attr("class","tooltiptext datafield"),i.append("td").attr("class","tooltiptext datavalue"),this.update_formats()}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(10),r=n(28);e.TooltipModel=class extends i.DOMWidgetModel{defaults(){return Object.assign({},i.DOMWidgetModel.prototype.defaults(),{_model_name:"TooltipModel",_view_name:"Tooltip",_model_module:"bqplot",_view_module:"bqplot",_model_module_version:r.semver_range,_view_module_version:r.semver_range,fields:[],formats:[],show_labels:!0,labels:[]})}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=n(142);e.FlexLine=class extends o.Lines{render(){const t=super.render.apply(this),e=this;return t.then(function(){e.create_listeners(),e.draw()})}set_ranges(){super.set_ranges();const t=this.scales.width;t&&t.set_range([.5,this.model.get("stroke_width")])}create_listeners(){super.create_listeners(),this.listenTo(this.model,"change:labels_visibility",this.update_legend_labels)}draw_legend(t,e,n,i,o){const a=t.selectAll(".legend"+this.uuid).data(this.model.mark_data,function(t,e){return t.name}),s=this,c=.8*o;a.enter().append("g").attr("class","legend"+this.uuid).attr("transform",function(t,e){return"translate(0, "+(e*o+n)+")"}).append("line").style("stroke",function(t,e){return s.get_colors(e)}).attr("x1",0).attr("x2",c).attr("y1",c/2).attr("y2",c/2),a.append("text").attr("class","legendtext").attr("x",1.2*c).attr("y",c/2).attr("dy","0.35em").text(function(t,e){return s.model.get("labels")[e]}).style("fill",function(t,e){return s.get_colors(e)});const l=r.max(this.model.get("labels"),function(t){return t.length});return a.exit().remove(),[this.model.mark_data.length,l]}set_positional_scales(){const t=this.scales.x,e=this.scales.y;this.listenTo(t,"domain_changed",function(){this.model.dirty||this.draw()}),this.listenTo(e,"domain_changed",function(){this.model.dirty||this.draw()})}initialize_additional_scales(){const t=this.scales.color;t&&(this.listenTo(t,"domain_changed",function(){this.draw()}),t.on("color_scale_range_changed",this.draw,this))}draw(){this.set_ranges();let t=this.d3el.selectAll(".curve").data(this.model.mark_data,function(t,e){return t.name});t.exit().transition("draw").duration(this.parent.model.get("animation_duration")).remove(),t=t.enter().append("g").attr("class","curve").merge(t);const e=this.scales.x,n=this.scales.y,i=this;t.nodes().forEach(function(t,o){let a=r.select(t).selectAll("line").data(i.model.mark_data[o].values);(a=a.enter().append("line").merge(a)).attr("class","line-elem").attr("x1",function(t){return e.scale(t.x1)}).attr("x2",function(t){return e.scale(t.x2)}).attr("y1",function(t){return n.scale(t.y1)}).attr("y2",function(t){return n.scale(t.y2)}).attr("stroke",function(t){return i.get_element_color(t)}).attr("stroke-width",function(t){return i.get_element_width(t)})})}get_element_color(t){const e=this.scales.color;return void 0!==e&&void 0!==t.color?e.scale(t.color):this.model.get("colors")[0]}get_element_width(t){const e=this.scales.width;return void 0!==e&&void 0!==t.size?e.scale(t.size):this.model.get("stroke_width")}relayout(){super.relayout(),this.set_ranges();const t=this.scales.x,e=this.scales.y;this.d3el.selectAll(".curve").selectAll(".line-elem").transition("relayout").duration(this.parent.model.get("animation_duration")).attr("x1",function(e){return t.scale(e.x1)}).attr("x2",function(e){return t.scale(e.x2)}).attr("y1",function(t){return e.scale(t.y1)}).attr("y2",function(t){return e.scale(t.y2)})}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=n(18),o=i(n(317));e.MapModel=class extends r.MarkModel{defaults(){return Object.assign({},r.MarkModel.prototype.defaults(),{_model_name:"MapModel",_view_name:"Map",color:{},hover_highlight:!0,hovered_styles:{hovered_fill:"Orange",hovered_stroke:null,hovered_stroke_width:2},stroke_color:null,default_color:null,scales_metadata:{color:{dimension:"color"},projection:{dimension:"geo"}},selected_styles:{selected_fill:"Red",selected_stroke:null,selected_stroke_width:2},map_data:void 0})}initialize(t,e){super.initialize(t,e),this.on("change:map_data",this.update_data,this),this.on("change:color",this.color_data_updated,this),this.update_data(),this.update_domains()}update_data(){this.dirty=!0;const t=this.get("map_data");"Topology"==t.type?this.geodata=o.feature(t,t.objects.subunits).features:this.geodata=t.features,this.color_data_updated(),this.dirty=!1,this.trigger("data_updated")}update_properties(t){t.properties?t.properties.color=this.color_data[t.id]:t.properties={color:this.color_data[t.id]}}color_data_updated(){this.update_domains(),this.geodata.map(t=>this.update_properties(t))}update_domains(){const t=this.get("scales").color;this.color_data=this.get("color"),null!=t&&(this.get("preserve_domain").color?t.del_domain([],this.model_id+"_color"):t.compute_and_set_domain(Object.keys(this.color_data).map(t=>this.color_data[t]),this.model_id+"_color"))}get_data_dict(t,e){return Object.assign({},t.properties,{id:t.id})}}},function(t,e,n){!function(t){"use strict";function e(){}function n(t){if(!t)return e;var n,i,r=t.scale[0],o=t.scale[1],a=t.translate[0],s=t.translate[1];return function(t,e){e||(n=i=0),t[0]=(n+=t[0])*r+a,t[1]=(i+=t[1])*o+s}}function i(t,e){for(var n=0,i=t.length;n<i;){var r=n+i>>>1;t[r]<e?n=r+1:i=r}return n}function r(t,e){var n={type:"Feature",id:e.id,properties:e.properties||{},geometry:o(t,e)};return null==e.id&&delete n.id,n}function o(t,e){var i=n(t.transform),r=t.arcs;function o(t,e){e.length&&e.pop();for(var n,o=r[t<0?~t:t],a=0,s=o.length;a<s;++a)e.push(n=o[a].slice()),i(n,a);t<0&&function(t,e){for(var n,i=t.length,r=i-e;r<--i;)n=t[r],t[r++]=t[i],t[i]=n}(e,s)}function a(t){return t=t.slice(),i(t,0),t}function s(t){for(var e=[],n=0,i=t.length;n<i;++n)o(t[n],e);return e.length<2&&e.push(e[0].slice()),e}function c(t){for(var e=s(t);e.length<4;)e.push(e[0].slice());return e}function l(t){return t.map(c)}var u={Point:function(t){return a(t.coordinates)},MultiPoint:function(t){return t.coordinates.map(a)},LineString:function(t){return s(t.arcs)},MultiLineString:function(t){return t.arcs.map(s)},Polygon:function(t){return l(t.arcs)},MultiPolygon:function(t){return t.arcs.map(l)}};return function t(e){var n=e.type;return"GeometryCollection"===n?{type:n,geometries:e.geometries.map(t)}:n in u?{type:n,coordinates:u[n](e)}:null}(e)}function a(t,e){var n={},i={},r={},o=[],a=-1;function s(t,e){for(var i in t){var r=t[i];delete e[r.start],delete r.start,delete r.end,r.forEach(function(t){n[t<0?~t:t]=1}),o.push(r)}}return e.forEach(function(n,i){var r,o=t.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(r=e[++a],e[a]=n,e[i]=r)}),e.forEach(function(e){var n,o,a=function(e){var n,i=t.arcs[e<0?~e:e],r=i[0];return t.transform?(n=[0,0],i.forEach(function(t){n[0]+=t[0],n[1]+=t[1]})):n=i[i.length-1],e<0?[n,r]:[r,n]}(e),s=a[0],c=a[1];if(n=r[s])if(delete r[n.end],n.push(e),n.end=c,o=i[c]){delete i[o.start];var l=o===n?n:n.concat(o);i[l.start=n.start]=r[l.end=o.end]=l}else i[n.start]=r[n.end]=n;else if(n=i[c])if(delete i[n.start],n.unshift(e),n.start=s,o=r[s]){delete r[o.end];var u=o===n?n:o.concat(n);i[u.start=o.start]=r[u.end=n.end]=u}else i[n.start]=r[n.end]=n;else i[(n=[e]).start=s]=r[n.end=c]=n}),s(r,i),s(i,r),e.forEach(function(t){n[t<0?~t:t]||o.push([t])}),o}function s(t,e,n){var i=[];function r(t){var e=t<0?~t:t;(l[e]||(l[e]=[])).push({i:t,g:c})}function o(t){t.forEach(r)}function s(t){t.forEach(o)}if(arguments.length>1){var c,l=[],u={LineString:o,MultiLineString:s,Polygon:s,MultiPolygon:function(t){t.forEach(s)}};!function t(e){"GeometryCollection"===e.type?e.geometries.forEach(t):e.type in u&&(c=e,u[e.type](e.arcs))}(e),l.forEach(arguments.length<3?function(t){i.push(t[0].i)}:function(t){n(t[0].g,t[t.length-1].g)&&i.push(t[0].i)})}else for(var h=0,d=t.arcs.length;h<d;++h)i.push(h);return{type:"MultiLineString",arcs:a(t,i)}}function c(t){var e=t[0],n=t[1],i=t[2];return Math.abs((e[0]-i[0])*(n[1]-e[1])-(e[0]-n[0])*(i[1]-e[1]))}function l(t,e){var n={},i=[],r=[];function s(t){t.forEach(function(e){e.forEach(function(e){(n[e=e<0?~e:e]||(n[e]=[])).push(t)})}),i.push(t)}function c(e){return Math.abs(function(t){for(var e,n=-1,i=t.length,r=t[i-1],o=0;++n<i;)e=r,r=t[n],o+=e[0]*r[1]-e[1]*r[0];return o/2}(o(t,{type:"Polygon",arcs:[e]}).coordinates[0]))}return e.forEach(function(t){"Polygon"===t.type?s(t.arcs):"MultiPolygon"===t.type&&t.arcs.forEach(s)}),i.forEach(function(t){if(!t._){var e=[],i=[t];for(t._=1,r.push(e);t=i.pop();)e.push(t),t.forEach(function(t){t.forEach(function(t){n[t<0?~t:t].forEach(function(t){t._||(t._=1,i.push(t))})})})}}),i.forEach(function(t){delete t._}),{type:"MultiPolygon",arcs:r.map(function(e){var i,r=[];if(e.forEach(function(t){t.forEach(function(t){t.forEach(function(t){n[t<0?~t:t].length<2&&r.push(t)})})}),r=a(t,r),(i=r.length)>1)for(var o,s,l=1,u=c(r[0]);l<i;++l)(o=c(r[l]))>u&&(s=r[0],r[0]=r[l],r[l]=s,u=o);return r})}}function u(t,e){return t[1][2]-e[1][2]}t.version="1.6.27",t.mesh=function(t){return o(t,s.apply(this,arguments))},t.meshArcs=s,t.merge=function(t){return o(t,l.apply(this,arguments))},t.mergeArcs=l,t.feature=function(t,e){return"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map(function(e){return r(t,e)})}:r(t,e)},t.neighbors=function(t){var e={},n=t.map(function(){return[]});function r(t,n){t.forEach(function(t){t<0&&(t=~t);var i=e[t];i?i.push(n):e[t]=[n]})}function o(t,e){t.forEach(function(t){r(t,e)})}var a={LineString:r,MultiLineString:o,Polygon:o,MultiPolygon:function(t,e){t.forEach(function(t){o(t,e)})}};for(var s in t.forEach(function t(e,n){"GeometryCollection"===e.type?e.geometries.forEach(function(e){t(e,n)}):e.type in a&&a[e.type](e.arcs,n)}),e)for(var c=e[s],l=c.length,u=0;u<l;++u)for(var h=u+1;h<l;++h){var d,f=c[u],p=c[h];(d=n[f])[s=i(d,p)]!==p&&d.splice(s,0,p),(d=n[p])[s=i(d,f)]!==f&&d.splice(s,0,f)}return n},t.presimplify=function(t,i){var r=n(t.transform),o=function(t){if(!t)return e;var n,i,r=t.scale[0],o=t.scale[1],a=t.translate[0],s=t.translate[1];return function(t,e){e||(n=i=0);var c=Math.round((t[0]-a)/r),l=Math.round((t[1]-s)/o);t[0]=c-n,t[1]=l-i,n=c,i=l}}(t.transform),a=function(){var t={},e=[],n=0;function i(t,n){for(;n>0;){var i=(n+1>>1)-1,r=e[i];if(u(t,r)>=0)break;e[r._=n]=r,e[t._=n=i]=t}}function r(t,i){for(;;){var r=i+1<<1,o=r-1,a=i,s=e[a];if(o<n&&u(e[o],s)<0&&(s=e[a=o]),r<n&&u(e[r],s)<0&&(s=e[a=r]),a===i)break;e[s._=i]=s,e[t._=i=a]=t}}return t.push=function(t){return i(e[t._=n]=t,n++),n},t.pop=function(){if(!(n<=0)){var t,i=e[0];return--n>0&&(t=e[n],r(e[t._=0]=t,0)),i}},t.remove=function(t){var o,a=t._;if(e[a]===t)return a!==--n&&(u(o=e[n],t)<0?i:r)(e[o._=a]=o,a),a},t}();function s(t){a.remove(t),t[1][2]=i(t),a.push(t)}return i||(i=c),t.arcs.forEach(function(t){var e,n,c,l,u=[],h=0;for(n=0,c=t.length;n<c;++n)l=t[n],r(t[n]=[l[0],l[1],1/0],n);for(n=1,c=t.length-1;n<c;++n)(e=t.slice(n-1,n+2))[1][2]=i(e),u.push(e),a.push(e);for(n=0,c=u.length;n<c;++n)(e=u[n]).previous=u[n-1],e.next=u[n+1];for(;e=a.pop();){var d=e.previous,f=e.next;e[1][2]<h?e[1][2]=h:h=e[1][2],d&&(d.next=f,d[2]=e[2],s(d)),f&&(f.previous=d,f[0]=e[0],s(f))}t.forEach(o)}),t},Object.defineProperty(t,"__esModule",{value:!0})}(e)},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=i(n(10));class a extends o.WidgetView{render(){this.set_projection(),this.listenTo(this.model,"attribute_changed",this.reset_scale)}set_projection(){this.path=r.geoPath().projection(this.model.projection),this.scale=this.model.projection}reset_scale(){this.set_projection(),this.trigger("domain_changed",null)}}e.GeoScale=a;e.Mercator=class extends a{};e.Albers=class extends a{};e.AlbersUSA=class extends a{};e.EquiRectangular=class extends a{};e.Orthographic=class extends a{};e.Gnomonic=class extends a{};e.Stereographic=class extends a{}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=n(62);class a extends o.ScaleModel{defaults(){return Object.assign({},o.ScaleModel.prototype.defaults(),{_model_name:"GeoScaleModel",_view_name:"GeoScale"})}compute_and_set_domain(t,e){}update_domain(){}}e.GeoScaleModel=a;e.MercatorModel=class extends a{defaults(){return Object.assign({},a.prototype.defaults(),{_model_name:"MercatorModel",_view_name:"Mercator",scale_factor:190,center:[0,60],rotate:[0,0]})}initialize(t,e){super.initialize(t,e),this.on_some_change(["scale_factor","center","rotate"],this.create_projection,this),this.create_projection()}create_projection(){this.projection=r.geoMercator().center(this.get("center")).scale(this.get("scale_factor")).rotate(this.get("rotate")),this.attribute_changed()}attribute_changed(){this.trigger("attribute_changed")}};e.AlbersModel=class extends a{defaults(){return Object.assign({},a.prototype.defaults(),{_model_name:"AlbersModel",_view_name:"Albers",scale_factor:250,center:[0,60],parallels:[29.5,45.5],precision:.1})}initialize(t,e){super.initialize(t,e),this.on_some_change(["rotate","center","parallels","scale_factor","precision"],this.create_projection,this),this.create_projection()}create_projection(){this.projection=r.geoAlbers().rotate(this.get("rotate")).center(this.get("center")).parallels(this.get("parallels")).scale(this.get("scale_factor")).precision(this.get("precision")),this.attribute_changed()}attribute_changed(){this.trigger("attribute_changed")}};e.AlbersUSAModel=class extends a{defaults(){return Object.assign({},a.prototype.defaults(),{_model_name:"AlbersUSAModel",_view_name:"AlbersUSA",scale_factor:1200,translate:[600,490]})}initialize(t,e){super.initialize(t,e),this.on_some_change(["scale_factor","translate"],this.create_projection,this),this.create_projection()}create_projection(){this.projection=r.geoAlbersUsa().scale(this.get("scale_factor")).translate(this.get("translate")),this.attribute_changed()}attribute_changed(){this.trigger("attribute_changed")}};e.EquiRectangularModel=class extends a{defaults(){return Object.assign({},a.prototype.defaults(),{_model_name:"EquiRectangularModel",_view_name:"EquiRectangular",scale_factor:145})}initialize(t,e){super.initialize(t,e),this.on_some_change(["scale_factor","center"],this.create_projection,this),this.create_projection()}create_projection(){this.projection=r.geoEquirectangular().center(this.get("center")).scale(this.get("scale_factor")),this.attribute_changed()}attribute_changed(){this.trigger("attribute_changed")}};e.OrthographicModel=class extends a{defaults(){return Object.assign({},a.prototype.defaults(),{_model_name:"OrthographicModel",_view_name:"Orthographic",scale_factor:145,center:[0,60],rotate:[0,0],clip_angle:90,precision:.1})}initialize(t,e){super.initialize(t,e),this.on_some_change(["scale_factor","center","clip_angle","rotate","precision"],this.create_projection,this),this.create_projection()}create_projection(){this.projection=r.geoOrthographic().center(this.get("center")).scale(this.get("scale_factor")).clipAngle(this.get("clip_angle")).rotate(this.get("rotate")).precision(this.get("precision")),this.attribute_changed()}attribute_changed(){this.trigger("attribute_changed")}};e.GnomonicModel=class extends a{defaults(){return Object.assign({},a.prototype.defaults(),{_model_name:"GnomonicModel",_view_name:"Gnomonic",scale_factor:145,center:[0,60],precision:.1,clip_angle:89.999})}initialize(t,e){super.initialize(t,e),this.on_some_change(["scale_factor","precision","clip_angle"],this.create_projection,this),this.create_projection()}create_projection(){this.projection=r.geoGnomonic().clipAngle(this.get("clip_angle")).scale(this.get("scale_factor")).precision(this.get("precision")),this.attribute_changed()}attribute_changed(){this.trigger("attribute_changed")}};e.StereographicModel=class extends a{defaults(){return Object.assign({},a.prototype.defaults(),{_model_name:"StereographicModel",_view_name:"StereographicModel",scale_factor:245,center:[0,60],precision:.1,rotate:[96,0],clip_angle:179.9999})}initialize(t,e){super.initialize(t,e),this.on_some_change(["scale_factor","center","clip_angle","rotate","precision"],this.create_projection,this),this.create_projection()}create_projection(){this.projection=r.geoStereographic().scale(this.get("scale_factor")).rotate(this.get("rotate")).clipAngle(this.get("clip_angle")).center(this.get("center")).precision(this.get("precision")),this.attribute_changed()}attribute_changed(){this.trigger("attribute_changed")}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(10)),a=i(n(6)),s=n(14),c=n(92),l=i(n(2));n(31);const u=n(143),h=i(n(144)),d=r(n(145));e.MarketMap=class extends u.Figure{render(t){this.id=o.uuid();const e=this.getFigureSize();this.width=e.width,this.height=e.height,this.scales={},this.set_top_el_style();const n=this;this.margin=this.model.get("map_margin"),this.num_rows=this.model.get("rows"),this.num_cols=this.model.get("cols"),this.row_groups=this.model.get("row_groups"),this.enable_select=this.model.get("enable_select"),this.update_data(),this.set_area_dimensions(this.data.length),this.model.get("theme")&&this.svg.classed(this.model.get("theme"),!0),this.fig=this.svg.append("g").attr("transform","translate("+this.margin.left+","+this.margin.top+")"),this.fig_map=this.fig.append("g"),this.fig_axes=this.fig.append("g"),this.fig_click=this.fig.append("g"),this.fig_hover=this.fig.append("g"),this.fig_names=this.fig.append("g").style("display",this.model.get("show_groups")?"inline":"none"),this.fig_map.classed("g-map",!0),this.fig_axes.classed("g-axes",!0),this.fig_click.classed("g-click",!0),this.fig_hover.classed("g-hover",!0),this.fig_names.classed("g-names",!0),this.axis=[],this.tooltip_div=l.select(document.createElement("div")).attr("class","mark_tooltip"),this.tooltip_div.styles({opacity:0,"pointer-events":"none"});const i=this.model.get("freeze_tooltip_location");this.popper_reference=i?new h.ElementReference(this.svg.node()):new h.PositionReference({x:0,y:0,width:20,height:20}),this.popper=new d.default(this.popper_reference,this.tooltip_div.node(),{placement:"auto"}),this.update_default_tooltip(),this.selected_stroke=this.model.get("selected_stroke"),this.hovered_stroke=this.model.get("hovered_stroke"),this.update_plotarea_dimensions(),this.title=this.fig.append("text").attr("class","mainheading").attrs({x:.5*this.plotarea_width,y:-this.margin.top/2,dy:"1em"}).text(this.model.get("title")),this.title.styles(this.model.get("title_style"));const r=this.create_scale_views();return r.then(function(){n.create_listeners(),n.axis_views=new o.ViewList(n.add_axis,null,n),n.axis_views.update(n.model.get("axes")),n.model.on("change:axes",function(t,e,i){n.axis_views.update(e)})}),this.displayed.then(function(){document.body.appendChild(n.tooltip_div.node()),n.relayout(),n.draw_group_names(),n.create_tooltip_widget()}),r}set_top_el_style(){this.el.style["user-select"]="none",this.el.style["ms-user-select"]="none",this.el.style["moz-user-select"]="none",this.el.style["khtml-user-select"]="none",this.el.style["webkit-user-select"]="none"}update_plotarea_dimensions(){this.plotarea_width=this.width-this.margin.left-this.margin.right,this.plotarea_height=this.height-this.margin.top-this.margin.bottom,this.column_width=parseFloat((this.plotarea_width/this.num_cols).toFixed(2)),this.row_height=parseFloat((this.plotarea_height/this.num_rows).toFixed(2))}reset_drawing_controls(){this.prev_x=0,this.prev_y=-1,this.y_direction=1,this.x_direction=1,this.group_iter=1}create_listeners(){this.listenTo(this.model,"change:scales",this.create_scale_views),this.listenTo(this.model,"change:color",this.recolor_chart),this.listenTo(this.model,"change:colors",this.colors_updated),this.listenTo(this.model,"change:show_groups",this.show_groups),this.listenTo(this.model,"change:selected_stroke",this.update_selected_stroke),this.listenTo(this.model,"change:hovered_stroke",this.update_hovered_stroke),this.listenTo(this.model,"change:font_style",this.update_font_style),this.model.on_some_change(["title","title_style"],this.update_title,this),this.listenTo(this.model,"change:selected",function(){this.clear_selected(),this.apply_selected()}),this.model.on_some_change(["names","groups","ref_data"],function(){this.update_data(),this.compute_dimensions_and_draw()},this),this.listenTo(this.model,"change:rows",function(t,e){this.num_rows=e,this.compute_dimensions_and_draw()}),this.listenTo(this.model,"change:cols",function(t,e){this.num_cols=e,this.compute_dimensions_and_draw()}),this.listenTo(this.model,"change:row_groups",function(t,e){this.row_groups=e,this.compute_dimensions_and_draw()}),this.listenTo(this.model,"change:tooltip_widget",this.create_tooltip_widget),this.listenTo(this.model,"change:tooltip_fields",this.update_default_tooltip),this.listenTo(this.model,"change:tooltip_formats",this.update_default_tooltip)}update_title(t,e){this.title.text(this.model.get("title")).styles(this.model.get("title_style"))}relayout(){const t=this,e=this.getFigureSize();this.width=e.width,this.height=e.height,window.requestAnimationFrame(function(){t.margin=t.model.get("map_margin"),t.update_plotarea_dimensions(),t.fig.attr("transform","translate("+t.margin.left+","+t.margin.top+")"),t.title.attrs({x:.5*t.plotarea_width,y:-t.margin.top/2,dy:"1em"}),t.draw_map(),t.clear_selected(),t.apply_selected(),t.fig_hover.selectAll("rect").remove(),t.hide_tooltip(),t.trigger("margin_updated")})}update_data(){const t=this;this.data=this.model.get("names")||[],this.ref_data=this.model.get("ref_data"),this.group_data=this.model.get("groups"),this.groups=a.uniq(this.group_data,!0);let e=this.model.get("display_text");e=null===e||0===e.length?this.data:e,this.colors=this.model.get("colors");const n=this.colors.length;this.colors_map=function(e){return t.get_color(e,n)};const i=this.model.get("color"),r=a.map(this.data,(t,n)=>({display:e[n],name:t,color:Number.isNaN(i[n])?void 0:i[n],group:this.group_data[n],ref_data:null===this.ref_data||void 0===this.ref_data?null:this.ref_data[n]}));this.update_domains(),this.grouped_data=a.groupBy(r,function(e,n){return t.group_data[n]}),this.groups=[],this.running_sums=[],this.running_sums[0]=0;let o=0;for(let t in this.grouped_data)this.groups.push(t),o+=this.grouped_data[t].length,this.running_sums.push(o);this.running_sums.pop()}update_domains(){const t=this.model.get("scales").color,e=this.model.get("color");t&&e.length>0&&t.compute_and_set_domain(e,this.model.model_id)}set_area_dimensions(t){this.num_rows=this.model.get("rows"),this.num_cols=this.model.get("cols"),this.row_groups=this.model.get("row_groups"),void 0!==this.num_cols&&null!==this.num_cols&&0!==this.num_cols?(this.row_groups>1&&this.num_cols%2==0&&this.num_cols++,this.num_rows=Math.floor(t/this.num_cols),this.num_rows=t%this.num_cols==0?this.num_rows:this.num_rows+1):void 0!==this.num_rows&&null!==this.num_rows&&0!==this.num_rows?(this.num_cols=Math.floor(t/this.num_rows),this.num_cols=t%this.num_rows==0?this.num_cols:this.num_cols+1,this.row_groups>1&&this.num_cols%2==0&&this.num_cols++):(this.num_cols=Math.floor(Math.sqrt(t)),this.row_groups>1&&this.num_cols%2==0&&this.num_cols++,this.num_rows=Math.floor(t/this.num_cols),this.num_rows=t%this.num_cols==0?this.num_rows:this.num_rows+1),this.row_groups=Math.min(this.row_groups,this.num_rows),1==this.row_groups&&(this.num_cols=Math.floor(t/this.num_rows),this.num_cols=t%this.num_rows==0?this.num_cols:this.num_cols+1),this.set_row_limits()}compute_dimensions_and_draw(){this.set_area_dimensions(this.data.length),this.update_plotarea_dimensions(),this.draw_map(),this.clear_selected(),this.apply_selected(),this.fig_hover.selectAll("rect").remove(),this.hide_tooltip()}update_default_tooltip(){this.tooltip_fields=this.model.get("tooltip_fields");const t=this.model.get("tooltip_formats");this.tooltip_formats=this.tooltip_fields.map(function(e,n){const i=t[n];return void 0===i||""===i?function(t){return t}:l.format(i)})}create_scale_views(){for(let t in this.scales)this.stopListening(this.scales[t]);const t=this.model.get("scales"),e=this,n={};return a.each(t,function(t,i){n[i]=e.create_child_view(t)}),o.resolvePromisesDict(n).then(function(t){e.scales=t,e.set_scales()})}set_scales(){const t=this,e=this.scales.color;e&&(e.set_range(),e.on("color_scale_range_changed",t.update_map_colors,t),this.update_domains(),this.listenTo(e,"domain_changed",function(){t.update_map_colors()}),this.update_map_colors())}show_groups(t,e){this.fig_names.style("display",e?"inline":"none"),this.fig_map.selectAll(".market_map_text").style("opacity",e?.2:1),this.fig_map.selectAll(".market_map_rect").style("stroke-opacity",e?.2:1)}draw_map(){this.reset_drawing_controls(),this.fig_map.selectAll(".element_group").remove(),this.fig_names.selectAll(".names_object").remove(),this.rect_groups=this.fig_map.selectAll(".element_group").data(this.groups);const t=this.scales.color,e=this;this.rect_groups=this.rect_groups.enter().append("g").attr("class","element_group").attr("transform",function(t,n){return e.get_group_transform(n)}).merge(this.rect_groups),this.rect_groups.exit().remove(),this.end_points=[],this.rect_groups.nodes().forEach(function(n,i){const r=e.grouped_data[e.groups[i]],o=e.get_new_cords(),a=e.get_end_points(o[2],r.length,o[0],o[1],o[3],o[4]);a.forEach(function(t){e.end_points.push(t)});const s=e.running_sums[i];let c=l.select(n).selectAll(".rect_element").data(r);const u=c.enter().append("g").classed("rect_element",!0);u.append("rect").attr("x",0).attr("y",0).classed("market_map_rect",!0),u.append("text").classed("market_map_text",!0).style("text-anchor","middle").style("pointer-events","none").style("dominant-baseline","central"),(c=u.merge(c)).attr("transform",function(t,n){return e.get_cell_transform(n)}).on("click",function(t,n){e.cell_click_handler(t,s+n,this)}).on("mouseover",function(t,n){e.mouseover_handler(t,s+n,this)}).on("mousemove",function(t){e.mousemove_handler()}).on("mouseout",function(t,n){e.mouseout_handler(t,s+n,this)}).attr("class",function(t,e){return l.select(this).attr("class")+" rect_"+(s+e)}),c.selectAll(".market_map_rect").attr("width",e.column_width).attr("height",e.row_height).style("stroke-opacity",e.model.get("show_groups")?.2:1).style("stroke",e.model.get("stroke")).style("fill",function(n,r){return t&&void 0!==n.color&&null!==n.color?t.scale(n.color):e.colors_map(i)}),c.selectAll(".market_map_text").attr("x",e.column_width/2).attr("y",e.row_height/2).text(function(t,e){return t.display}).style("opacity",e.model.get("show_groups")?.2:1),c.exit().remove(),e.create_bounding_path(n,a);const h=l.min(a,function(t){return t.x}),d=l.min(a,function(t){return t.y});e.fig_names.append("foreignObject").attr("class","names_object").attr("x",h).attr("y",d).append("xhtml:div").attr("class","names_div").styles({display:"flex","flex-direction":"row","align-content":"center","align-items":"center",width:"100%",height:"100%","justify-content":"center","word-wrap":"break-word",font:"24px sans-serif",color:"black"}).text(e.groups[i])}),this.update_font_style(),this.draw_group_names()}draw_group_names(){const t=this.svg.selectAll(".bounding_path").nodes().map(function(t){return t.getBoundingClientRect()});this.fig_names.selectAll(".names_object").data(t).attr("width",function(t){return t.width}).attr("height",function(t){return t.height})}recolor_chart(){const t=this;this.update_data(),this.rect_groups=this.fig.selectAll(".element_group").data(this.groups);const e=this.scales.color;this.rect_groups.nodes().forEach(function(n,i){const r=t.grouped_data[t.groups[i]];l.select(n).selectAll(".rect_element").data(r).select("rect").style("stroke",t.model.get("stroke")).style("fill",function(n,r){return e&&void 0!==n.color&&null!==n.color?e.scale(n.color):t.colors_map(i)})})}update_font_style(){this.svg.selectAll(".market_map_text").styles(this.model.get("font_style"))}update_map_colors(){void 0!==this.rect_groups&&null!==this.rect_groups&&this.recolor_chart()}cell_click_handler(t,e,n){if(this.model.get("enable_select")){const e=this.model.get("selected").slice(),n=e.indexOf(t.name);-1==n?e.push(t.name):e.splice(n,1),this.model.set("selected",e),this.touch()}}apply_selected(){const t=this.model.get("selected"),e=this;null==t||0===t.length?this.clear_selected():t.forEach(function(t){const n=e.fig_map.selectAll(".rect_element").filter(function(e,n){return e.name===t});e.fig_click.append("rect").data(n.data()).attr("transform",n.attr("transform")).attr("x",0).attr("y",0).attr("width",e.column_width).attr("height",e.row_height).styles({stroke:e.selected_stroke,"stroke-width":"3px",fill:"none"})})}clear_selected(){this.fig_click.selectAll("rect").remove()}mouseover_handler(t,e,n){const i=l.select(n).attr("transform");this.model.get("enable_hover")&&(this.fig_hover.append("rect").attr("class","hover_"+e).attr("transform",i).attr("x",0).attr("y",0).attr("width",this.column_width).attr("height",this.row_height).styles({stroke:this.hovered_stroke,"stroke-width":"3px",fill:"none","pointer-events":"none"}),this.show_tooltip(l.event,t),this.send({event:"hover",data:t.name,ref_data:t.ref_data}))}update_selected_stroke(t,e){this.selected_stroke=e,this.fig_click.selectAll("rect").style("stroke",e)}update_hovered_stroke(t,e){this.hovered_stroke=e}mouseout_handler(t,e,n){this.fig_hover.select(".hover_"+e).remove(),this.hide_tooltip()}show_tooltip(t,e){const n=this;if(this.tooltip_view||this.tooltip_fields&&0!=this.tooltip_fields.length){const t=this.tooltip_div;t.transition().styles({opacity:.9,display:null}),this.move_tooltip(),t.select("table").remove();const i=e.ref_data;if(!this.tooltip_view){const e=t.append("table").selectAll("tr").data(this.tooltip_fields);e.exit().remove();const r=e.enter().append("tr");r.append("td").attr("class","tooltiptext").text(function(t){return t}),r.append("td").attr("class","tooltiptext").text(function(t,e){return null==i?null:n.tooltip_formats[e](i[t])})}this.popper.enableEventListeners(),this.move_tooltip()}}mousemove_handler(){this.move_tooltip()}move_tooltip(){this.popper_reference.x=l.event.clientX,this.popper_reference.y=l.event.clientY,this.popper.scheduleUpdate()}hide_tooltip(){this.tooltip_div.style("pointer-events","none"),this.tooltip_div.transition().styles({opacity:0,display:"none"}),this.popper.disableEventListeners()}create_tooltip_widget(){const t=this.model.get("tooltip_widget");null!==this.tooltip_view&&void 0!==this.tooltip_view&&(this.tooltip_view.remove(),this.tooltip_view=null);const e=this;t&&this.create_child_view(t).then(function(t){e.tooltip_view=t,s.MessageLoop.sendMessage(t.pWidget,c.Widget.Msg.BeforeAttach),e.tooltip_div.node().appendChild(t.el),s.MessageLoop.sendMessage(t.pWidget,c.Widget.Msg.AfterAttach)})}get_group_transform(t){return"translate(0, 0)"}get_cell_transform(t){return this.past_border_y()?this.prev_y+=this.y_direction:this.past_border_x()?(this.y_direction=-1*this.y_direction,this.prev_x+=this.x_direction):(this.x_direction=-1*this.x_direction,this.prev_y+=this.y_direction,this.group_iter+=1),"translate("+this.prev_x*this.column_width+", "+this.prev_y*this.row_height+")"}get_new_cords(){let t=this.prev_x,e=this.prev_y,n=this.y_direction,i=this.x_direction,r=this.group_iter;return this.past_border_y()?e+=this.y_direction:this.past_border_x()?(n=-1*this.y_direction,t+=this.x_direction):(i=-1*this.x_direction,e+=this.y_direction,r+=1),[t,e,r,i,n,t*this.column_width,e*this.row_height]}past_border_y(){return 1==this.y_direction?this.prev_y+1<this.row_limits[this.group_iter]:this.prev_y-1>this.row_limits[this.group_iter-1]-1}past_border_x(){return 1==this.x_direction?this.prev_x+1<this.num_cols:this.prev_x-1>-1}colors_updated(){this.colors=this.model.get("colors"),this.recolor_chart()}get_color(t,e){return this.colors[t%e]}set_row_limits(){const t=Math.floor(this.num_rows/this.row_groups);this.row_limits=[];for(let e=this.row_groups-1;e>-1;e--)this.row_limits.unshift(e*t);this.row_limits[this.row_groups]=this.num_rows}get_end_points(t,e,n,i,r,o){let a=this.row_limits[t-1],s=this.row_limits[t],c=!1,l=r,u=o;const h=[];let d,f=1==u?s-i:i-a+1,p=1==l?this.num_cols-1-n:n,m=e,g=s-a;if(0!==m){this.calc_end_point_source(n,i,l,u).forEach(function(t){h.push(t)});const t=Math.min(f,m);if(t===m)return this.calc_end_point_source(n,i,-1*l,u).forEach(function(t){h.push(t)}),d=i+(m-1)*u,this.calc_end_point_dest(n,d,-1*l,u).forEach(function(t){h.push(t)}),this.calc_end_point_dest(n,d,l,u).forEach(function(t){h.push(t)}),h;if(m-=t,0===p?this.calc_end_point_source(n,i,-1*l,u).forEach(function(t){h.push(t)}):f!==s-a?(this.calc_end_point_source(n,i,-1*l,u).forEach(function(t){h.push(t)}),m>g&&this.calc_end_point_dest(n+l,1==u?a:s-1,-1*l,-1*u).forEach(function(t){h.push(t)})):m<g&&this.calc_end_point_source(n,i,-1*l,u).forEach(function(t){h.push(t)}),i+=u*(t-1),this.calc_end_point_dest(n,i,-1*l,u).forEach(function(t){h.push(t)}),0===m)return this.calc_end_point_dest(n,i,l,u).forEach(function(t){h.push(t)}),h;0!==p&&m>g&&(n+=l)}for(;m>g;){let e;if(g*p<m){const n=m-(e=p)*g;e+=Math.floor(n/(this.row_limits[t+1]-this.row_limits[t]))}else e=Math.floor(m/g);e>p?(n=1===l?this.num_cols-1:0,0!==p&&this.calc_end_point_dest(n,a,l,-1).forEach(function(t){h.push(t)}),e=p,p=this.num_cols,t+=1,a=s,s=this.row_limits[t],i=a,l*=-1,u=Math.pow(-1,e)*u*-1,this.calc_end_point_dest(n,s-1,-1*l,1).forEach(function(t){h.push(t)})):e===p?(n=1===l?this.num_cols-1:0,0!==p&&this.calc_end_point_dest(n,a,l,-1).forEach(function(t){h.push(t)}),e=p,p=this.num_cols,(t+=1)<this.row_limits.length?(a=s,s=this.row_limits[t],i=a,l*=-1,u=Math.pow(-1,e)*u*-1,c=!0):(u=1,l=1)):(i=1==(u=Math.pow(-1,e)*u)?a:s-1,n+=l*(e-1),this.calc_end_point_source(n,i,-1*l,u).forEach(function(t){h.push(t)})),m-=e*g,g=s-a}return 0===m?(i=1===u?s-1:a,l=c?-1*l:l,this.calc_end_point_dest(n,i,l,u).forEach(function(t){h.push(t)})):(i=1==(u*=-1)?a:s-1,n=c?n:n+l,this.calc_end_point_source(n,i,-1*l,u).forEach(function(t){h.push(t)}),d=i+(m-1)*u,this.calc_end_point_dest(n,d,l,u).forEach(function(t){h.push(t)}),this.calc_end_point_dest(n,d,-1*l,u).forEach(function(t){h.push(t)})),h}create_bounding_path(t,e){const n=[],i=e.slice();n.push(e[0]),i.splice(0,1);const r=["x","y"];let o=0,a=r[o%2],s=r[(o+1)%2];const c=n[0];let u=c[a],h=c[s],d=2*i.length,f=0;for(;i.length>1&&d>0;){const t=i.filter(function(t){return t[a]==u});if(t.length>0){o++;const e=l.min(t,function(t){return t[s]}),r=l.max(t,function(t){return t[s]});if(e<h&&r>h)if("y"==a)f=1==this.x_direction?r:e;else{const n=t.filter(function(t){return t[s]<h}),i=t.filter(function(t){return t[s]>h});f=1==n.length?e:1==i.length?r:l.max(n,function(t){return t[s]})}else f=e>h?e:r;i.filter(function(t){return t[a]==u&&t[s]==f}).forEach(function(t){i.splice(i.indexOf(t),1)});const c={};c[a]=u,c[s]=f,n.push(c)}else f=h;const e=a;a=s,s=e,h=u,u=f,d--}i.length>0&&n.push(i[0]),n.push(e[0]);const p=l.line().curve(l.curveLinear).x(function(t){return t.x}).y(function(t){return t.y});return l.select(t).append("path").attr("class","bounding_path").attr("d",function(){return p(n)}).attr("fill","none").style("stroke",this.model.get("group_stroke")).style("stroke-width",3)}calc_end_point_source(t,e,n,i){return e=1==i?e:e+1,[{x:(t=1==n?t:t+1)*this.column_width,y:e*this.row_height}]}calc_end_point_dest(t,e,n,i){return e=-1==i?e:e+1,[{x:(t=-1==n?t:t+1)*this.column_width,y:e*this.row_height}]}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2));n(31);const o=function(){return n(0).event}.bind(this),a=i(n(6)),s=n(19);e.GridHeatMap=class extends s.Mark{render(){const t=super.render(),e=this;return this.displayed.then(function(){e.parent.tooltip_div.node().appendChild(e.tooltip_div.node()),e.create_tooltip()}),this.selected_indices=this.model.get("selected"),this.selected_style=this.model.get("selected_style"),this.unselected_style=this.model.get("unselected_style"),this.anchor_style=this.model.get("anchor_style"),this.display_el_classes=["heatmapcell"],t.then(function(){e.event_listeners={},e.process_interactions(),e.create_listeners(),e.compute_view_padding(),e.draw()})}initialize_additional_scales(){const t=this.scales.color;t&&(this.listenTo(t,"domain_changed",function(){this.apply_styles()}),t.on("color_scale_range_changed",this.apply_styles,this))}set_ranges(){const t=this.scales.row;if(t){const e=this.parent.padded_range("y",t.model);t.set_range(e)}const e=this.scales.column;e&&e.set_range(this.parent.padded_range("x",e.model))}set_positional_scales(){const t=this.scales.column,e=this.scales.row;this.listenTo(t,"domain_changed",function(){this.model.dirty||this.draw()}),this.listenTo(e,"domain_changed",function(){this.model.dirty||this.draw()})}expand_scale_domain(t,e,n,i){let o,a;if("expand_one"===n){const n=(o=e.map(function(e){return t.scale(e)})).slice(1).map(function(t,e){return t-o[e]});if(a=0,n[0]<0?(i=!i,a=r.max(n)):a=r.min(n),i){const n=o[o.length-1]+a;return[e[0],t.invert(n)]}{const n=o[0]-a;return[t.invert(n),e[o.length-1]]}}if("expand_two"===n){o=e.map(function(e){return t.scale(e)}),a=r.min(o.slice(1).map(function(t,e){return t-o[e]}));const n=o[o.length-1]+a,i=o[0]-a;return[t.invert(i),t.invert(n)]}}create_listeners(){super.create_listeners(),this.listenTo(this.model,"change:stroke",this.update_stroke),this.listenTo(this.model,"change:opacity",this.update_opacity),this.d3el.on("mouseover",a.bind(function(){this.event_dispatcher("mouse_over")},this)).on("mousemove",a.bind(function(){this.event_dispatcher("mouse_move")},this)).on("mouseout",a.bind(function(){this.event_dispatcher("mouse_out")},this)),this.listenTo(this.model,"data_updated",this.draw),this.listenTo(this.model,"change:tooltip",this.create_tooltip),this.listenTo(this.parent,"bg_clicked",function(){this.event_dispatcher("parent_clicked")}),this.model.on_some_change(["display_format","font_style"],this.update_labels,this),this.listenTo(this.model,"change:selected",this.update_selected),this.listenTo(this.model,"change:interactions",this.process_interactions)}click_handler(t){const e=this.model.colors[0].length,n=t.row_num*e+t.column_num,i=t.row_num,r=t.column_num,s=this;let c=Array.from(this.model.get("selected")||[]),l=this._cell_nums_from_indices(c);const u=l.indexOf(n),h=o().ctrlKey||o().metaKey;if(u>-1&&h)c.splice(u,1);else if(h||(l=[],c=[]),c.push([i,r]),l.push(s._cell_nums_from_indices([[i,r]])[0]),o().shiftKey){if(u>-1)return;const t=0!==l.length?s.anchor_cell_index[0]:i,e=0!==l.length?s.anchor_cell_index[1]:r;a.range(Math.min(i,t),Math.max(i,t)+1).forEach(function(t){a.range(Math.min(r,e),Math.max(r,e)+1).forEach(function(e){const n=s._cell_nums_from_indices([[t,e]])[0];-1===l.indexOf(n)&&(l.push(n),c.push([t,e]))})})}else this.anchor_cell_index=[i,r];this.model.set("selected",0===c.length?null:c,{updated_view:this}),this.touch();let d=o();d||(d=window.event),void 0!==d.cancelBubble&&(d.cancelBubble=!0),d.stopPropagation&&d.stopPropagation(),d.preventDefault(),this.selected_indices=c,this.apply_styles()}update_selected(t,e){this.selected_indices=e,this.apply_styles()}set_style_on_elements(t,e,n){e&&(0!==e.length||n&&0!==n.length)&&0!==Object.keys(t).length&&(n=n&&0!==n.length?n:this._filter_cells_by_cell_num(this._cell_nums_from_indices(e))).styles(t)}set_default_style(t,e){if(!t||0===t.length&&(!e||0===e.length))return;e=e&&0!==e.length?e:this._filter_cells_by_cell_num(this._cell_nums_from_indices(t));const n=this.model.get("stroke"),i=this.model.get("opacity"),r=this;e.style("fill",function(t){return r.get_element_fill(t)}).style("opacity",i).style("stroke",n)}clear_style(t,e,n){if(0===Object.keys(t).length)return;n&&0!==n.length||(n=e?this._filter_cells_by_cell_num(this._cell_nums_from_indices(e)):this.display_cells);const i={};for(let e in t)i[e]=null;n.styles(i)}_filter_cells_by_cell_num(t){return null==t?[]:this.display_cells.filter(function(e){return-1!==t.indexOf(e._cell_num)})}selected_style_updated(t,e){this.selected_style=e,this.clear_style(t.previous("selected_style"),this.selected_indices,this.selected_elements),this.style_updated(e,this.selected_indices,this.selected_elements)}unselected_style_updated(t,e){this.unselected_style=e,this.clear_style(t.previous("unselected_style"),[],this.unselected_elements),this.style_updated(e,[],this.unselected_elements)}apply_styles(){const t=this.model.colors.length,e=this.model.colors[0].length;this.clear_style(this.selected_style),this.clear_style(this.unselected_style),this.clear_style(this.anchor_style),this.set_default_style([],this.display_cells);const n=this._cell_nums_from_indices(this.selected_indices),i=null===n||0===n.length?[]:a.difference(a.range(t*e),n);if(this.selected_elements=this._filter_cells_by_cell_num(n),this.set_style_on_elements(this.selected_style,this.selected_indices,this.selected_elements),this.unselected_elements=this._filter_cells_by_cell_num(i),this.set_style_on_elements(this.unselected_style,[],this.unselected_elements),null!==this.anchor_cell_index&&void 0!==this.anchor_cell_index){const t=this._cell_nums_from_indices([this.anchor_cell_index]);this.anchor_element=this._filter_cells_by_cell_num(t),this.set_style_on_elements(this.anchor_style,[],this.anchor_element)}}style_updated(t,e,n){this.set_default_style(e,n),this.set_style_on_elements(t,e,n)}reset_selection(){this.model.set("selected",null),this.touch(),this.selected_indices=null,this.clear_style(this.selected_style),this.clear_style(this.unselected_style),this.clear_style(this.anchor_style),this.set_default_style([],this.display_cells)}relayout(){this.set_ranges(),this.compute_view_padding(),this.draw()}_cell_nums_from_indices(t){if(null==t)return null;const e=this.model.colors[0].length;return t.map(function(t){return t[0]*e+t[1]})}invert_point(t){}selector_changed(t,e){if(void 0===t)return this.model.set("selected",null),this.touch(),[];const n=a.range(this.model.colors[0].length),i=a.range(this.model.colors.length),r=this,o=a.filter(n,function(t){return e([r.column_pixels[t],[]])}),s=a.filter(i,function(t){return e([[],r.row_pixels[t]])});let c=o.map(function(t){return s.map(function(e){return[e,t]})});c=a.flatten(c,!0),this.model.set("selected",c),this.touch()}draw(){this.set_ranges();const t=this,e=this.model.colors.length,n=this.model.colors[0].length,i=this.scales.row,o=this.scales.column,s="start"===this.model.get("row_align"),c="start"===this.model.get("column_align");let l;"middle"!==this.model.modes.row&&"boundaries"!==this.model.modes.row&&(l=this.expand_scale_domain(i,this.model.rows,this.model.modes.row,s),(r.min(l)<r.min(i.model.domain)||r.max(l)>r.max(i.model.domain))&&i.model.compute_and_set_domain(l,i.model.model_id)),"middle"!==this.model.modes.column&&"boundaries"!==this.model.modes.column&&(l=this.expand_scale_domain(o,this.model.columns,this.model.modes.column,c),(r.min(l)<r.min(o.model.domain)||r.max(l)>r.max(o.model.domain))&&o.model.compute_and_set_domain(l,o.model.model_id));const u=this.get_tile_plotting_data(i,this.model.rows,this.model.modes.row,s),h=this.get_tile_plotting_data(o,this.model.columns,this.model.modes.column,c);this.row_pixels=u.start.map(function(t,e){return[t,t+u.widths[e]]}),this.column_pixels=h.start.map(function(t,e){return[t,t+h.widths[e]]}),this.display_rows=this.d3el.selectAll(".heatmaprow").data(a.range(e)).join("g").attr("class","heatmaprow").attr("transform",function(t){return"translate(0, "+u.start[t]+")"});const d=a.range(n),f=a.range(e).map(function(e){return d.map(function(i){return t.model.mark_data[e*n+i]})});this.display_cells=this.display_rows.selectAll(".heatmapcell").data(function(t,e){return f[e]}).join("rect").attr("class","heatmapcell").on("click",a.bind(function(){this.event_dispatcher("element_clicked")},this)),this.display_cells.attr("x",function(t,e){return h.start[e]}).attr("y",0).attr("width",function(t,e){return h.widths[e]}).attr("height",function(t){return u.widths[t.row_num]}),this.display_cell_labels=this.display_rows.selectAll(".heatmapcell_label").data(function(t,e){return f[e]}).join("text").attr("class","heatmapcell_label").attr("x",function(t,e){return h.start[e]+h.widths[e]/2}).attr("y",function(t){return u.widths[t.row_num]/2}).style("text-anchor","middle").style("fill","black").style("pointer-events","none").style("dominant-baseline","central"),this.apply_styles(),this.update_labels(),this.display_cells.on("click",function(e,n){return t.event_dispatcher("element_clicked",{data:e.color,index:n,row_num:e.row_num,column_num:e.column_num})})}update_stroke(t,e){this.display_cells.style("stroke",e)}update_opacity(t,e){this.display_cells.style("opacity",e)}update_labels(){const t=this.model.get("display_format"),e=t?r.format(t):null;let n=this.d3el.selectAll(".heatmapcell_label").text(function(t,n){return e?e(t.color):null});const i=this.model.get("font_style");for(const t in i)n=n.style(t,i[t])}get_tile_plotting_data(t,e,n,i){let o=[],a=[];if(e=Array.from(e),"middle"===n)return o=e.map(function(e){return t.scale(e)}),a=e.map(function(e){return t.scale.bandwidth()}),{start:o,widths:a};if("boundaries"===n){const n=e.map(function(e){return t.scale(e)});a=[];for(let t=1;t<n.length;++t)a[t-1]=Math.abs(n[t]-n[t-1]);return{start:o=n[1]>n[0]?n.slice(0,-1):n.slice(1),widths:a}}if("expand_one"===n){let n;return i?(a=(o=e.map(function(e){return t.scale(e)})).slice(1).map(function(t,e){return Math.abs(t-o[e])}),n=r.max(t.scale.range()),a=o[0]<o[1]?Array.prototype.concat(a,[Math.abs(n-r.max(o))]):Array.prototype.concat([Math.abs(n-r.max(o))],a)):(a=(o=e.map(function(e){return t.scale(e)})).slice(1).map(function(t,e){return Math.abs(t-o[e])}),n=r.min(t.scale.range()),n=r.min(t.scale.range()),o[1]>o[0]?(o.unshift(Math.abs(n)),a.splice(0,0,o[1]-o[0]),o.pop()):(a=Array.prototype.concat(a,[Math.abs(n-o.slice(-1)[0])]),(o=Array.prototype.concat(o,n)).splice(0,1))),{widths:a,start:o}}if("expand_two"===n){const n=(o=e.map(function(e){return t.scale(e)}))[1]-o[0]>0;let i=n?r.min(t.scale.range()):r.max(t.scale.range());return o.splice(0,0,i),a=o.slice(1).map(function(t,e){return Math.abs(t-o[e])}),i=n?r.max(t.scale.range()):r.min(t.scale.range()),a[a.length]=Math.abs(i-o.slice(-1)[0]),{start:o,widths:a}}}get_element_fill(t){return null===t.color?this.model.get("null_color"):this.scales.color.scale(t.color)}process_click(t){super.process_click(t),"select"===t&&(this.event_listeners.parent_clicked=this.reset_selection,this.event_listeners.element_clicked=this.click_handler)}compute_view_padding(){}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(10)),o=i(n(2)),a=i(n(12)),s=n(28);class c extends r.WidgetModel{defaults(){return Object.assign({},r.WidgetModel.prototype.defaults(),{_model_name:"MarketMapModel",_view_name:"MarketMap",_model_module:"bqplot",_view_module:"bqplot",_model_module_version:s.semver_range,_view_module_version:s.semver_range,map_width:1080,map_height:800,names:[],groups:[],display_text:[],ref_data:void 0,title:"",tooltip_fields:[],tooltip_formats:[],show_groups:!1,cols:0,rows:0,row_groups:1,colors:o.scaleOrdinal(o.schemeCategory10).range(),scales:{},axes:[],color:[],map_margin:{top:50,right:50,left:50,bottom:50},preserve_aspect:!1,stroke:"white",group_stroke:"black",selected_stroke:"dodgerblue",hovered_stroke:"orangered",font_style:{},title_style:{},selected:[],enable_hover:!0,enable_select:!0,tooltip_widget:null})}}c.serializers=Object.assign({},r.WidgetModel.serializers,{scales:{deserialize:r.unpack_models},axes:{deserialize:r.unpack_models},tooltip_widget:{deserialize:r.unpack_models},style:{deserialize:r.unpack_models},layout:{deserialize:r.unpack_models},names:a.array_or_json,groups:a.array_or_json,display_text:a.array_or_json,color:a.array_or_json}),e.MarketMapModel=c},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=i(n(6)),a=n(19);e.HeatMap=class extends a.Mark{render(){const t=super.render(),e=this;return this.displayed.then(function(){e.parent.tooltip_div.node().appendChild(e.tooltip_div.node()),e.create_tooltip()}),this.image=r.select(this.el).append("image").classed("heatmap",!0).attr("width",this.parent.width).attr("height",this.parent.height),this.canvas=document.createElement("canvas"),t.then(function(){e.event_listeners={},e.process_interactions(),e.create_listeners(),e.compute_view_padding(),e.draw()})}set_ranges(){const t=this.scales.x;if(t){const e=this.parent.padded_range("x",t.model);t.set_range(e)}const e=this.scales.y;e&&e.set_range(this.parent.padded_range("y",e.model))}set_positional_scales(){const t=this.scales.x,e=this.scales.y;this.listenTo(t,"domain_changed",function(){this.model.dirty||this.draw()}),this.listenTo(e,"domain_changed",function(){this.model.dirty||this.draw()})}initialize_additional_scales(){const t=this.scales.color;t&&(this.listenTo(t,"domain_changed",function(){this.draw()}),t.on("color_scale_range_changed",this.draw,this))}create_listeners(){super.create_listeners(),this.d3el.on("mouseover",o.bind(function(){this.event_dispatcher("mouse_over")},this)).on("mousemove",o.bind(function(){this.event_dispatcher("mouse_move")},this)).on("mouseout",o.bind(function(){this.event_dispatcher("mouse_out")},this)),this.listenTo(this.model,"data_updated",this.draw),this.listenTo(this.model,"change:tooltip",this.create_tooltip),this.listenTo(this.parent,"bg_clicked",function(){this.event_dispatcher("parent_clicked")}),this.listenTo(this.model,"change:interactions",this.process_interactions)}click_handler(t){}relayout(){this.set_ranges(),this.compute_view_padding(),this.draw()}drawCanvas(){this.image.attr("href",this.canvas.toDataURL("image/png"))}draw(){this.set_ranges();const t=this.getPlottingData();this.canvas.setAttribute("width",t.totalWidth),this.canvas.setAttribute("height",t.totalHeight);const e=this.canvas.getContext("2d");this.model.mark_data.color.forEach((n,i)=>{const r=t.heights[i],o=t.yOrigin+t.yStartPoints[i];n.forEach((n,i)=>{const a=t.widths[i],s=t.xOrigin+t.xStartPoints[i];e.fillStyle=this.getElementFill(n),e.fillRect(s,o,this.expandRect(a),this.expandRect(r))})}),this.image.attr("width",t.totalWidth).attr("height",t.totalHeight).attr("x",t.x0).attr("y",t.y0),this.drawCanvas()}expandRect(t){return t>0?t+.5:t-.5}getPlottingData(){const t=Array.from(this.model.mark_data.x).map(this.scales.x.scale),e=Array.from(this.model.mark_data.y).map(this.scales.y.scale),n=this.scales.x.model.get("reverse"),i=this.scales.y.model.get("reverse"),r=this.getPadding(t,e),o=this.computeRectSizes(t,r.left,r.right),a=this.computeRectSizes(e,r.bottom,r.top,!0),s=Math.abs(t[t.length-1]-t[0]+r.left+r.right),c=Math.abs(e[0]-e[e.length-1]+r.top+r.bottom),l=t[0]-r.left,u=e[e.length-1]-r.top;return{widths:o,heights:a,totalWidth:s,totalHeight:c,xOrigin:n?s:0,yOrigin:i?c:0,xStartPoints:t.map((e,n)=>0==n?0:.5*(e+t[n-1])-l),yStartPoints:e.map((t,n)=>n==e.length-1?0:.5*(t+e[n+1])-u),x0:n?l-s:l,y0:i?u-c:u}}getPadding(t,e){const n=t.length,i=e.length;return{left:.5*(t[1]-t[0]),right:.5*(t[n-1]-t[n-2]),bottom:.5*-(e[1]-e[0]),top:.5*-(e[i-1]-e[i-2])}}computeRectSizes(t,e,n,i=!1){const r=i?-1:1;return t.map((i,o)=>0==o?r*(t[1]-i)*.5+e:o==t.length-1?r*(i-t[o-1])*.5+n:r*(t[o+1]-t[o-1])*.5)}getElementFill(t){return null===t?this.model.get("null_color"):this.scales.color.scale(t)}clear_style(t,e,n){}compute_view_padding(){}set_default_style(t,e){}set_style_on_elements(t,e,n){}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=n(18),o=i(n(12));class a extends r.MarkModel{defaults(){return Object.assign({},r.MarkModel.prototype.defaults(),{_model_name:"HeatMapModel",_view_name:"HeatMap",x:[],y:[],color:null,scales_metadata:{x:{orientation:"horizontal",dimension:"x"},y:{orientation:"vertical",dimension:"y"},color:{dimension:"color"}},null_color:"black"})}initialize(t,e){super.initialize(t,e),this.on_some_change(["x","y","color"],this.update_data,this),this.on_some_change(["preserve_domain"],this.update_domains,this),this.update_data(),this.update_domains()}update_data(){this.dirty=!0,this.mark_data={x:this.get("x"),y:this.get("y"),color:this.get("color")},this.update_domains(),this.dirty=!1,this.trigger("data_updated")}update_domains(){if(!this.mark_data)return;const t=this.get("scales"),e=t.x,n=t.y,i=t.color,r=[].concat.apply([],this.mark_data.color.map(t=>Array.prototype.slice.call(t,0)));this.get("preserve_domain").x?e.del_domain([],this.model_id+"_x"):e.compute_and_set_domain(this.mark_data.x,this.model_id+"_x"),this.get("preserve_domain").y?n.del_domain([],this.model_id+"_y"):n.compute_and_set_domain(this.mark_data.y,this.model_id+"_y"),null!=i&&(this.get("preserve_domain").color?i.del_domain([],this.model_id+"_color"):i.compute_and_set_domain(r,this.model_id+"_color"))}get_data_dict(t,e){return t}}a.serializers=Object.assign({},r.MarkModel.serializers,{x:o.array_or_json,y:o.array_or_json,color:o.array_or_json}),e.HeatMapModel=a},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(10)),o=n(28),a=i(n(6));class s extends r.DOMWidgetModel{defaults(){return Object.assign({},r.DOMWidgetModel.prototype.defaults(),{_model_name:"ToolbarModel",_view_name:"Toolbar",_model_module:"bqplot",_view_module:"bqplot",_model_module_version:o.semver_range,_view_module_version:o.semver_range,figure:void 0,_panning:!1,_panzoom:null})}panzoom(){const t=this.get("figure");if(this.get("_panning"))t&&(t.set("interaction",this.cached_interaction),t.save_changes()),this.set("_panning",!1),this.save_changes();else{if(t){this.cached_interaction=t.get("interaction");const e=this.get("_panzoom");e?(t.set("interaction",e),t.save_changes()):this._create_panzoom_model(t).then(e=>{this.set("_panzoom",e),this.save_changes(),t.set("interaction",e),t.save_changes()})}this.set("_panning",!0),this.save_changes()}}reset(){const t=this.get("figure");if(t){t.set("interaction",this.cached_interaction),t.save_changes();const e=this.get("_panzoom");e.reset_scales(),e.close(),this.set("_panzoom",null),this.set("_panning",!1),this.save_changes()}}save_png(){const t=this.get("figure");t&&t.save_png()}_create_panzoom_model(t){return this.widget_manager.new_widget({model_name:"PanZoomModel",model_module:"bqplot",model_module_version:t.get("_model_module_version"),view_name:"PanZoom",view_module:"bqplot",view_module_version:t.get("_view_module_version")}).then(function(e){return Promise.all(t.get("marks")).then(function(t){const n=[],i=[];for(let e=0;e<t.length;++e){const r=t[e].get("preserve_domain"),o=t[e].get("scales");a.each(o,function(a,s){const c=t[e].get("scales_metadata")[s].dimension;"x"!==c||r[s]||n.push(o[s]),"y"!==c||r[s]||i.push(o[s])})}return e.set("scales",{x:n,y:i}),e.save_changes(),e})})}}s.serializers=Object.assign({},r.DOMWidgetModel.serializers,{figure:{deserialize:r.unpack_models},_panzoom:{deserialize:r.unpack_models}}),e.ToolbarModel=s;e.Toolbar=class extends r.DOMWidgetView{render(){this.el.classList.add("jupyter-widget"),this.el.classList.add("widget-hbox");const t=document.createElement("button");t.classList.add("jupyter-widgets"),t.classList.add("jupyter-button"),t.classList.add("widget-toggle-button"),t.setAttribute("data-toggle","tooltip"),t.setAttribute("title","PanZoom"),t.onclick=t=>{t.preventDefault(),this.model.panzoom()};const e=document.createElement("i");e.className="fa fa-arrows",t.appendChild(e);const n=document.createElement("button");n.classList.add("jupyter-widgets"),n.classList.add("jupyter-button"),n.classList.add("widget-button"),n.setAttribute("data-toggle","tooltip"),n.setAttribute("title","Reset"),n.onclick=t=>{t.preventDefault(),this.model.reset()};const i=document.createElement("i");i.className="fa fa-refresh",n.appendChild(i);const r=document.createElement("button");r.classList.add("jupyter-widgets"),r.classList.add("jupyter-button"),r.classList.add("widget-button"),r.setAttribute("data-toggle","tooltip"),r.setAttribute("title","Save"),r.onclick=t=>{t.preventDefault(),this.model.save_png()};const o=document.createElement("i");o.className="fa fa-save",r.appendChild(o),this.el.appendChild(t),this.el.appendChild(n),this.el.appendChild(r),this._panzoom=t,this.update()}update(){this.model.get("_panning")?this._panzoom.classList.add("mod-active"):this._panzoom.classList.remove("mod-active")}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=n(18),o=i(n(12));class a extends r.MarkModel{defaults(){return Object.assign({},r.MarkModel.prototype.defaults(),{_model_name:"GraphModel",_view_name:"Graph",x:[],y:[],color:null,hovered_point:null,scales_metadata:{x:{orientation:"horizontal",dimension:"x"},y:{orientation:"vertical",dimension:"y"},color:{dimension:"color"}},colors:[]})}initialize(t,e){super.initialize(t,e),this.on_some_change(["x","y","color","link_color","node_data","link_data","link_color"],this.update_data,this),this.on_some_change(["preserve_domain"],this.update_domains,this),this.update_data()}update_node_data(){let t=this.get("node_data");const e=this.get("x"),n=this.get("y"),i=this.get("color")||[],r=this.get("scales").color;t.length>0&&"string"==typeof t[0]&&(t=t.map(function(t){return{label:t}})),this.mark_data=[];const o=this;t.forEach(function(t,e){t.label=t.label||"N"+e,t.label_display=t.label_display||"center",t.shape=t.shape||"circle",t.shape_attrs=function(t,e){const n={};switch(t){case"circle":n.r=e.r||15;break;case"rect":n.width=e.width||25,n.height=e.height||.8*n.width,n.rx=e.rx||0,n.ry=e.ry||0;break;case"ellipse":n.rx=e.rx||20,n.ry=e.ry||.6*n.rx;break;default:console.log("Invalid shape passed - ",t)}return n}(t.shape,t.shape_attrs||{}),t.value=t.value||null,o.mark_data.push(t)}),0!==e.length&&0!==n.length&&(r&&(this.get("preserve_domain").color?r.del_domain([],this.model_id+"_color"):r.compute_and_set_domain(i,this.model_id+"_color")),this.mark_data.forEach(function(t,r){t.xval=e[r],t.yval=n[r],t.color=i[r]}))}update_link_data(){const t=this.get("scales").link_color;this.link_data=this.get("link_data");let e=this.get("link_matrix");const n=this.get("link_color"),i=this;void 0!==t&&n.length>0&&(e=n),0===this.link_data.length&&e.length>0&&e.forEach(function(t,e){t.forEach(function(t,n){null!==t&&i.link_data.push({source:e,target:n,value:t})})})}update_data(){this.dirty=!0,this.update_node_data(),this.update_link_data(),this.update_unique_ids(),this.update_domains(),this.dirty=!1,this.trigger("data_updated")}update_unique_ids(){}get_data_dict(t,e){return t}update_domains(){const t={x:"xval",y:"yval"};if(!this.mark_data)return;const e=this.get("scales");for(let n in e)if(e.hasOwnProperty(n)){const i=e[n];this.get("preserve_domain")[n]?i.del_domain([],this.model_id+n):i.compute_and_set_domain(this.mark_data.map(function(e){return e[n]||e[t[n]]}),this.model_id+n)}}}a.serializers=Object.assign({},r.MarkModel.serializers,{x:o.array_or_json,y:o.array_or_json,color:o.array_or_json,link_color:o.array_or_json,link_matrix:o.array_or_json}),e.GraphModel=a},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2));n(31);const o=function(){return n(0).event}.bind(this),a=i(n(6)),s=n(19);e.Graph=class extends s.Mark{render(){let t=super.render();const e=this;return this.selected_style=this.model.get("selected_style"),this.unselected_style=this.model.get("unselected_style"),this.selected_indices=this.model.get("selected"),this.hovered_style=this.model.get("hovered_style"),this.unhovered_style=this.model.get("unhovered_style"),this.hovered_index=this.model.get("hovered_point")?[this.model.get("hovered_point")]:null,this.display_el_classes=["element"],this.event_metadata={mouse_over:{msg_name:"hover",lookup_data:!1,hit_test:!0},element_clicked:{msg_name:"element_click",lookup_data:!1,hit_test:!0},parent_clicked:{msg_name:"background_click",hit_test:!1}},this.displayed.then(function(){e.parent.tooltip_div.node().appendChild(e.tooltip_div.node()),e.create_tooltip()}),this.d3el.attr("class","network"),this.arrow=this.parent.svg.append("defs").append("marker").attr("id","arrow").attr("refX",0).attr("refY",3).attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("path").attr("class","linkarrow").attr("d","M0,0 L0,6 L9,3 z"),t.then(function(){e.event_listeners={},e.process_interactions(),e.create_listeners(),e.compute_view_padding(),e.draw()})}set_ranges(){const t=this.scales.x,e=this.scales.y;t&&t.set_range(this.parent.padded_range("x",t.model)),e&&e.set_range(this.parent.padded_range("y",e.model))}set_positional_scales(){this.x_scale=this.scales.x,this.y_scale=this.scales.y,this.x_scale||(this.x_scale=this.parent.scale_x),this.y_scale||(this.y_scale=this.parent.scale_y),this.listenTo(this.x_scale,"domain_changed",function(){this.model.dirty||this.update_position()}),this.listenTo(this.y_scale,"domain_changed",function(){this.model.dirty||this.update_position()})}relayout(){this.set_ranges(),this.update_position()}update_position(){const t=this.scales.x,e=this.scales.y;this.set_ranges(),t&&e&&(this.model.mark_data.forEach(function(n){n.x=t.scale(n.xval)+t.offset,n.y=e.scale(n.yval)+e.offset}),this.force_layout&&(this.force_layout.nodes(this.model.mark_data).force("link",r.forceLink(this.model.link_data).distance(this.model.get("link_distance"))),this.links&&this.links.data(this.model.link_data),this.nodes&&this.nodes.data(this.force_layout.nodes()),this.nodes&&this.links&&this.tick()))}initialize_additional_scales(){const t=this.scales.color;t&&(this.listenTo(t,"domain_changed",function(){this.color_scale_updated()}),t.on("color_scale_range_changed",this.color_scale_updated,this));const e=this.scales.link_color;e&&this.listenTo(e,"domain_changed",function(){this.link_color_scale_updated()})}create_listeners(){super.create_listeners(),this.d3el.on("mouseover",a.bind(function(){this.event_dispatcher("mouse_over")},this)).on("mousemove",a.bind(function(){this.event_dispatcher("mouse_move")},this)).on("mouseout",a.bind(function(){this.event_dispatcher("mouse_out")},this)),this.listenTo(this.model,"change:charge",this.update_charge),this.listenTo(this.model,"change:link_distance",this.update_link_distance),this.listenTo(this.model,"data_updated",this.data_updated),this.listenTo(this.model,"change:tooltip",this.create_tooltip),this.listenTo(this.model,"change:enable_hover",function(){this.hide_tooltip()}),this.listenTo(this.model,"change:interactions",this.process_interactions),this.listenTo(this.model,"change:selected",this.update_selected),this.listenTo(this.model,"change:hovered_point",this.update_hovered),this.listenTo(this.model,"change:hovered_style",this.hovered_style_updated),this.listenTo(this.model,"change:unhovered_style",this.unhovered_style_updated),this.listenTo(this.parent,"bg_clicked",function(){this.event_dispatcher("parent_clicked")})}data_updated(){this.draw(),this.relayout()}get_node_color(t,e){const n=this.scales.color,i=this.model.get("colors"),r=i.length;return n&&void 0!==t.color?n.scale(t.color):i[e%r]}draw(){this.set_ranges();const t=this.scales.x,e=this.scales.y,n=this.scales.link_color;this.d3el.selectAll(".node").remove(),this.d3el.selectAll(".link").remove(),t&&e&&this.model.mark_data.forEach(function(n){n.x=t.scale(n.xval)+t.offset,n.y=e.scale(n.yval)+e.offset});const i=this.parent.fig.node().getBBox(),o=i.width,s=i.height;this.force_layout=r.forceSimulation().force("center",r.forceCenter(o/2,s/2)).force("forceX",r.forceX().strength(.1).x(o/2)).force("forceY",r.forceY().strength(.1).y(s/2)),t||e||this.force_layout.force("charge",r.forceManyBody().strength(this.model.get("charge"))).on("tick",a.bind(this.tick,this));const c=this.model.get("directed");this.links=this.d3el.selectAll(".link").data(this.model.link_data).enter().append("path").attr("class","link").style("stroke",function(t){return n?n.scale(t.value):null}).style("stroke-width",function(t){return t.link_width}).attr("marker-mid",c?"url(#arrow)":null),this.force_layout.nodes(this.model.mark_data).force("link",r.forceLink(this.model.link_data).distance(this.model.get("link_distance")));const l=this;this.nodes=this.d3el.selectAll(".node").data(this.force_layout.nodes()).enter().append("g").attr("class","node").call(r.drag().on("start",a.bind(l.dragstarted,l)).on("drag",a.bind(l.dragged,l)).on("end",a.bind(l.dragended,l))),this.nodes.append(function(t){return document.createElementNS(r.namespaces.svg,t.shape)}).attr("class","element").each(function(t){const e=r.select(this);for(let n in t.shape_attrs)e.attr(n,t.shape_attrs[n])}).style("fill",function(t,e){return l.get_node_color(t,e)}),this.nodes.append("text").attr("class","label").attr("text-anchor",function(t){return"center"===t.label_display?"middle":"start"}).attr("x",function(t){let e=0;if("outside"===t.label_display)switch(t.shape){case"rect":e=t.shape_attrs.width/2+5;break;case"circle":e=t.shape_attrs.r+5;break;case"ellipse":e=t.shape_attrs.rx+5;break;default:e=0}return e}).attr("y",".31em").text(function(t){return t.label}).style("display",function(t){return"none"===t.label_display?"none":"inline"}),this.nodes.on("click",a.bind(function(t,e){this.event_dispatcher("element_clicked",{data:t,index:e})},this)),this.nodes.on("mouseover",a.bind(function(t,e){this.hover_handler({data:t,index:e})},this)),this.nodes.on("mouseout",a.bind(function(){this.reset_hover_points()},this))}dragstarted(t){o().active||this.force_layout.alphaTarget(.4).restart(),t.fx=t.x,t.fy=t.y}dragged(t){t.fx=o().x,t.fy=o().y}dragended(t){o().active||this.force_layout.alphaTarget(.4),t.fx=null,t.fy=null}color_scale_updated(){const t=this;this.nodes.selectAll(".element").style("fill",function(e,n){return t.get_node_color(e,n)})}link_color_scale_updated(){const t=this.scales.link_color;this.links.style("stroke",function(e){return t?t.scale(e.value):null})}process_click(t){super.process_click(t),"select"===t&&(this.event_listeners.parent_clicked=this.reset_selection,this.event_listeners.element_clicked=this.click_handler)}reset_hover_points(){this.links.style("opacity",1),this.model.set("hovered_point",null),this.hovered_index=null,this.touch()}hover_handler(t){const e=t.data,n=t.index;this.model.get("highlight_links")?this.links.style("opacity",function(t){return t.source.label===e.label||t.target.label===e.label?1:.1}):this.links.style("opacity",1),this.model.set("hovered_point",n,{updated_view:this}),this.touch()}reset_selection(){this.model.set("selected",null),this.selected_indices=null,this.touch()}click_handler(t){const e=t.index,n=this.model.get("selected")||[];let i=Array.from(n);const r=i.indexOf(e),a=o().ctrlKey||o().metaKey;r>-1&&a?i.splice(r,1):a?i.push(e):(i=[]).push(e),this.model.set("selected",0===i.length?null:i,{updated_view:this}),this.touch();let s=o();s||(s=window.event),void 0!==s.cancelBubble&&(s.cancelBubble=!0),s.stopPropagation&&s.stopPropagation(),s.preventDefault()}hovered_style_updated(t,e){this.hovered_style=e,this.clear_style(t.previous("hovered_style"),this.hovered_index),this.style_updated(e,this.hovered_index)}unhovered_style_updated(t,e){this.unhovered_style=e;const n=this.hovered_index,i=n?a.range(this.model.mark_data.length).filter(function(t){return-1===n.indexOf(t)}):[];this.clear_style(t.previous("unhovered_style"),i),this.style_updated(e,i)}update_selected(t,e){this.selected_indices=e,this.apply_styles()}update_hovered(t,e){this.hovered_index=null===e?e:[e],this.apply_styles()}apply_styles(t){null==t&&(t=[this.selected_style,this.unselected_style,this.hovered_style,this.unhovered_style]),super.apply_styles(t);const e=a.range(this.model.mark_data.length);this.set_style_on_elements(this.hovered_style,this.hovered_index);const n=this.hovered_index?a.difference(e,this.hovered_index):[];this.set_style_on_elements(this.unhovered_style,n)}clear_style(t,e){let n=this.d3el.selectAll(".element");e&&(n=n.filter(function(t,n){return-1!==e.indexOf(n)}));const i={};for(let e in t)i[e]=null;n.styles(i)}set_style_on_elements(t,e){if(!e||0===e.length)return;if(void 0!==t&&0===Object.keys(t).length)return;let n=this.d3el.selectAll(".element");(n=n.filter(function(t,n){return-1!==e.indexOf(n)})).styles(t)}compute_view_padding(){const t=r.max(this.model.mark_data.map(function(t){return(t.shape_attrs.r||t.shape_attrs.width/2||t.shape_attrs.rx)+1})),e=r.max(this.model.mark_data.map(function(t){return(t.shape_attrs.r||t.shape_attrs.height/2||t.shape_attrs.ry)+1}));t===this.x_padding&&e===this.y_padding||(this.x_padding=t,this.y_padding=t,this.trigger("mark_padding_updated"))}selected_deleter(){o().stopPropagation()}update_link_distance(){const t=this.scales.x,e=this.scales.y,n=this.model.get("link_distance");t||e||this.force_layout.linkDistance(n).start()}update_charge(){const t=this.scales.x,e=this.scales.y,n=this.model.get("charge");t||e||this.force_layout.charge(n).start()}link_arc(t){const e=t.target.x-t.source.x,n=t.target.y-t.source.y,i=Math.sqrt(e*e+n*n);return"M"+t.source.x+","+t.source.y+"A"+i+","+i+" 0 0,1 "+t.target.x+","+t.target.y}link_line(t){const e=(t.source.x+t.target.x)/2,n=(t.source.y+t.target.y)/2;return"M"+t.source.x+","+t.source.y+"L"+e+","+n+"L"+t.target.x+","+t.target.y}link_slant_line(t){const e=(t.source.x+t.target.x)/2;return"M"+t.source.x+","+t.source.y+"L"+e+","+t.target.y+"L"+t.target.x+","+t.target.y}tick(){const t=this.model.get("link_type");this.nodes.attr("transform",function(t){return"translate("+t.x+","+t.y+")"}),this.nodes.select("rect").attr("transform",function(t){return"translate("+-t.shape_attrs.width/2+","+-t.shape_attrs.height/2+")"});let e=this.link_arc;switch(t){case"arc":e=this.link_arc;break;case"line":e=this.link_line;break;case"slant_line":e=this.link_slant_line;break;default:e=this.link_arc}this.links.attr("d",function(t){return e(t)})}set_default_style(t){}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(2)),o=n(19),a=i(n(6));e.Image=class extends o.Mark{render(){const t=super.render(),e=this.d3el||this.el;this.im=e.append("image").attr("x",0).attr("y",0).attr("width",1).attr("height",1).attr("preserveAspectRatio","none"),this.update_image(),this.event_metadata={mouse_over:{msg_name:"hover",lookup_data:!1,hit_test:!0},legend_clicked:{msg_name:"legend_click",hit_test:!0},element_clicked:{msg_name:"element_click",lookup_data:!1,hit_test:!1},parent_clicked:{msg_name:"background_click",hit_test:!1}};const n=this;return t.then(function(){n.event_listeners={},n.reset_click(),n.create_listeners(),n.listenTo(n.parent,"margin_updated",function(){n.draw(!1)})})}set_positional_scales(){const t=this.scales.x,e=this.scales.y;this.listenTo(t,"domain_changed",function(){this.model.dirty||this.draw()}),this.listenTo(e,"domain_changed",function(){this.model.dirty||this.draw()})}set_ranges(){const t=this.scales.x,e=this.scales.y;t&&t.set_range(this.parent.padded_range("x",t.model)),e&&e.set_range(this.parent.padded_range("y",e.model))}create_listeners(){super.create_listeners(),this.listenTo(this.model,"change:image",this.update_image),this.listenTo(this.model,"data_updated",function(){this.draw(!0)})}update_image(){this.im.attr("href")&&URL.revokeObjectURL(this.im.attr("href"));const t=this.model.get("image"),e=new Blob([t.get("value")],{type:"image/"+t.get("format")}),n=URL.createObjectURL(e);this.im.attr("href",n)}remove(){URL.revokeObjectURL(this.im.attr("href")),super.remove()}relayout(){this.draw(!0)}img_send_message(t,e){const n=this.event_metadata[t],i={click_x:this.scales.x.invert(r.mouse(this.el)[0]),click_y:this.scales.y.invert(r.mouse(this.el)[1])};this.send({event:n.msg_name,data:i})}draw(t){this.set_ranges();const e=this.scales.x?this.scales.x:this.parent.scale_x,n=this.scales.y?this.scales.y:this.parent.scale_y,i=t?this.parent.model.get("animation_duration"):0,o=this.d3el||this.el,s=this.model.mark_data.x.map(e.scale),c=this.model.mark_data.y.map(n.scale);o.selectAll("image").transition().duration(i).attr("transform",function(t){return"translate("+(s[0]+e.offset)+","+(c[1]+n.offset)+") scale("+(s[1]-s[0])+", "+(c[0]-c[1])+")"}),o.on("click",a.bind(function(t,e){this.img_send_message("element_clicked",{data:r.event,index:e})},this))}clear_style(t,e,n){}compute_view_padding(){}set_default_style(t,e){}set_style_on_elements(t,e,n){}}},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(10)),o=n(18),a=i(n(12));class s extends o.MarkModel{defaults(){return Object.assign({},o.MarkModel.prototype.defaults(),{_model_name:"ImageModel",_view_name:"Image",x:[0,1],y:[0,1],scales_metadata:{x:{orientation:"horizontal",dimension:"x"},y:{orientation:"vertical",dimension:"y"}}})}initialize(t,e){super.initialize(t,e),this.on_some_change(["x","y"],this.update_data,this),this.on_some_change(["preserve_domain"],this.update_domains,this),this.update_data()}update_data(){this.mark_data={x:this.get("x"),y:this.get("y")},this.update_domains(),this.trigger("data_updated")}update_domains(){if(!this.mark_data)return;const t=this.get("scales"),e=t.x,n=t.y;e&&(this.get("preserve_domain").x?e.del_domain([],this.model_id+"_x"):e.compute_and_set_domain(this.mark_data.x,this.model_id+"_x")),n&&(this.get("preserve_domain").y?n.del_domain([],this.model_id+"_y"):n.compute_and_set_domain(this.mark_data.y,this.model_id+"_y"))}}s.serializers=Object.assign({},o.MarkModel.serializers,{image:{deserialize:r.unpack_models},x:a.array_or_json,y:a.array_or_json}),e.ImageModel=s},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=n(19),o=i(n(2)),a=i(n(64)),s=i(n(6)),c=n(17),l=i(n(146)),u=a.symbol,h=function(t){if(t instanceof Float32Array)return t;if("function"==typeof t[Symbol.iterator]){const e=t.length;let n=new Float32Array(e);for(let i=0;i<e;i++)n[i]=t[i];return n}return new Float32Array(t)},d=function(t,e){const n=t||e||[0,0,0,0];if("none"==n)return[0,0,0,0];{const t=new l.Color(n);return[t.r,t.g,t.b,1]}},f=function(t){const e=t?t.model.color_range:["#ff0000","#ff0000"],n=o.scaleLinear().range(e).domain(s.range(e.length).map(t=>t/(e.length-1))),i=[];s.map(s.range(256),t=>{const e=t/255,r=o.color(String(n(e))).hex(),a=String(r),s=[parseInt("0x"+a.substring(1,3)),parseInt("0x"+a.substring(3,5)),parseInt("0x"+a.substring(5,7))];i.push(s[0],s[1],s[2])});const r=new Uint8Array(i),a=new l.DataTexture(r,256,1,l.RGBFormat,l.UnsignedByteType);return a.needsUpdate=!0,a};class p{constructor(t,e=1,n=1,i=!1){this.array=t,this.item_size=e,this.mesh_per_attribute=n,this.normalized=i}}class m extends p{constructor(t,e=1,n=1,i=!1,r=!0){super(t,e,n,i),this.use_colormap=r}}class g extends p{constructor(t,e=1,n=1,i=!1,r=!0){super(t,e,n,i),this.use_selection=r}}e.ScatterGL=class extends r.Mark{render(){const t=super.render();this.transitions=[],this.invalidated_pixel_position=!0,this.dot=u().type(this.model.get("marker")),this.instanced_geometry=new l.InstancedBufferGeometry;const e=new Float32Array([-.5,.5,0,.5,.5,0,-.5,-.5,0,.5,-.5,0]);this.instanced_geometry.addAttribute("position",new l.Float32BufferAttribute(e,3));const i=new Float32Array([0,1,1,1,0,0,1,0]);this.instanced_geometry.addAttribute("uv",new l.Float32BufferAttribute(i,2));const r=new Uint16Array([0,2,1,2,3,1]);return this.instanced_geometry.index=new l.Uint16BufferAttribute(r,1),this.scatter_material=new l.RawShaderMaterial({uniforms:{domain_x:{type:"2f",value:[0,10]},domain_y:{type:"2f",value:[-12,12]},domain_z:{type:"2f",value:[0,1]},domain_size:{type:"2f",value:[0,1]},domain_color:{type:"2f",value:[0,1]},domain_rotation:{type:"2f",value:[0,180]},domain_opacity:{type:"2f",value:[0,1]},range_x:{type:"2f",value:[0,1]},range_y:{type:"2f",value:[0,1]},range_z:{type:"2f",value:[0,1]},range_size:{type:"2f",value:[0,1]},range_rotation:{type:"2f",value:[0,Math.PI]},range_opacity:{type:"2f",value:[0,1]},animation_time_x:{type:"f",value:1},animation_time_y:{type:"f",value:1},animation_time_z:{type:"f",value:1},animation_time_size:{type:"f",value:1},animation_time_color:{type:"f",value:1},animation_time_rotation:{type:"f",value:1},animation_time_opacity:{type:"f",value:1},has_selection:{type:"b",value:!1},has_hover:{type:"b",value:!1},has_selected_fill:{type:"b",value:!1},has_selected_stroke:{type:"b",value:!1},has_selected_opacity:{type:"b",value:!1},has_unselected_fill:{type:"b",value:!1},has_unselected_stroke:{type:"b",value:!1},has_unselected_opacity:{type:"b",value:!1},has_hovered_fill:{type:"b",value:!1},has_hovered_stroke:{type:"b",value:!1},has_hovered_opacity:{type:"b",value:!1},has_unhovered_fill:{type:"b",value:!1},has_unhovered_stroke:{type:"b",value:!1},has_unhovered_opacity:{type:"b",value:!1},selected_fill:{type:"4f",value:[1,0,0,1]},selected_stroke:{type:"4f",value:[1,0,0,1]},selected_opacity:{value:1},unselected_fill:{type:"4f",value:[1,0,0,1]},unselected_stroke:{type:"4f",value:[1,0,0,1]},unselected_opacity:{value:1},hovered_fill:{type:"4f",value:[0,1,0,1]},hovered_opacity:{value:1},hovered_stroke:{type:"4f",value:[0,1,0,1]},unhovered_fill:{type:"4f",value:[0,1,0,1]},unhovered_stroke:{type:"4f",value:[0,1,0,1]},unhovered_opacity:{value:1},default_stroke_color:{type:"4f",value:[0,0,0,0]},colormap:{type:"t",value:null},fill:{type:"b",value:!0},stroke_width:{type:"f",value:1.5},marker_scale:{type:"f",value:1}},vertexShader:n(331).default,fragmentShader:n(332).default,transparent:!0,depthTest:!1,depthWrite:!1,blending:l.CustomBlending,blendEquation:l.AddEquation,blendSrc:l.OneFactor,blendDst:l.OneMinusSrcAlphaFactor,blendEquationAlpha:l.AddEquation,blendSrcAlpha:l.OneFactor,blendDstAlpha:l.OneMinusSrcAlphaFactor}),this.mesh=new l.Mesh(this.instanced_geometry,this.scatter_material),t.then(()=>{this.camera=new l.OrthographicCamera(-.5,.5,.5,-.5,-1e4,1e4),this.camera.position.z=10,this.scene=new l.Scene;const t=new p(h(this.model.get("x")));this.x=this.initialize_attribute("x",t),this.x_previous=this.initialize_attribute("x_previous",t);const e=new p(h(this.model.get("y")));this.y=this.initialize_attribute("y",e),this.y_previous=this.initialize_attribute("y_previous",e),this.markers_number=Math.min(this.x.array.length,this.y.array.length),this.instanced_geometry.maxInstancedCount=this.markers_number;const n=this.get_color_attribute_parameters();this.color=this.initialize_attribute("color",n),this.scatter_material.defines.USE_COLORMAP=n.use_colormap;const i=this.get_opacity_attribute_parameters();this.opacity=this.initialize_attribute("opacity",i),this.opacity_previous=this.initialize_attribute("opacity_previous",i);const r=this.get_size_attribute_parameters();this.size=this.initialize_attribute("size",r),this.size_previous=this.initialize_attribute("size_previous",r);const o=this.get_rotation_attribute_parameters();this.rotation=this.initialize_attribute("rotation",o),this.rotation_previous=this.initialize_attribute("rotation_previous",o);const a=this.get_selected_attribute_parameters();this.selected=this.initialize_attribute("selected",a),this.scatter_material.uniforms.has_selection.value=a.use_selection,this.scatter_material.needsUpdate=!0,this.scene.add(this.mesh),this.create_listeners(),this.compute_view_padding(),this.update_scene(),this.listenTo(this.parent,"margin_updated",()=>{this.update_scene()})})}initialize_attribute(t,e){const n=new l.InstancedBufferAttribute(e.array,e.item_size,e.mesh_per_attribute);return n.normalized=e.normalized,n.dynamic=!0,this.instanced_geometry.addAttribute(t,n),n}get_color_attribute_parameters(){if(this.model.get("color")){const t=this.model.get("color");let e;return t.length<this.markers_number?(e=h(this.markers_number)).set(t):e=h(t),new m(e,1,1,!0,!0)}{let t,e,n=this.model.get("colors");if(!n){const t=(this.model.get("unselected_style")||{}).fill||"orange";n=[t]}if(1==n.length){const i=new l.Color(n[0]);t=h([i.r,i.g,i.b]),e=this.markers_number}else t=h(3*this.markers_number),s.each(s.range(this.markers_number),e=>{const i=new l.Color(n[e%n.length]);t[3*e+0]=i.r,t[3*e+1]=i.g,t[3*e+2]=i.b}),e=1;return new m(t,3,e,!1,!1)}}get_opacity_attribute_parameters(){let t=this.model.get("default_opacities")||[1];if(0==t.length&&(t=[1]),this.model.get("opacity")){const e=this.model.get("opacity");let n;return e.length<this.markers_number?((n=h(this.markers_number)).set(e),s.each(s.range(this.markers_number-e.length),i=>{i+=e.length,n[i]=t[i%t.length]})):n=h(e),new p(n,1,1)}{let e,n;return 1==t.length?(e=h(t),n=this.markers_number):(e=h(this.markers_number),n=1,s.each(s.range(this.markers_number),n=>{e[n]=t[n%t.length]})),new p(e,1,n)}}get_size_attribute_parameters(){if(this.model.get("size")){const t=this.model.get("size");let e;return t.length<this.markers_number?((e=h(this.markers_number)).fill(this.model.get("default_size")),e.set(t)):e=h(t),new p(e,1,1)}return new p(h([this.model.get("default_size")]),1,this.markers_number)}get_rotation_attribute_parameters(){if(this.model.get("rotation")){const t=this.model.get("rotation");let e;return t.length<this.markers_number?(e=h(this.markers_number)).set(t):e=h(t),new p(e,1,1)}return new p(h(1),1,this.markers_number)}get_selected_attribute_parameters(){if(this.model.get("selected")){const t=this.model.get("selected"),e=h(this.markers_number);for(let n=0;n<t.length;n++)t[n]<e.length&&(e[t[n]]=1);return new g(e,1,1,!1,!0)}return new g(h(1),1,this.markers_number,!1,!1)}update_scene(){this.parent.update_gl()}render_gl(){this.set_ranges();const t=this.parent,e=this.scales.x?this.scales.x:this.parent.scale_x,n=this.scales.y?this.scales.y:this.parent.scale_y,i=this.parent.padded_range("x",e.model),r=this.parent.padded_range("y",n.model);if(s.each(["selected","hovered"],t=>{s.each(["stroke","fill","opacity"],e=>{this.scatter_material.uniforms[`has_${t}_${e}`].value=Boolean(this.model.get(`${t}_style`)[e]),this.scatter_material.uniforms[`has_un${t}_${e}`].value=Boolean(this.model.get(`un${t}_style`)[e]),s.contains(["opacity"],e)?(this.scatter_material.uniforms[`${t}_${e}`].value=this.model.get(`${t}_style`)[e],this.scatter_material.uniforms[`un${t}_${e}`].value=this.model.get(`un${t}_style`)[e]):(this.scatter_material.uniforms[`${t}_${e}`].value=d(this.model.get(`${t}_style`)[e],"green"),this.scatter_material.uniforms[`un${t}_${e}`].value=d(this.model.get(`un${t}_style`)[e],"green"))})}),this.camera.left=0,this.camera.right=t.plotarea_width,this.camera.bottom=0,this.camera.top=t.plotarea_height,this.camera.updateProjectionMatrix(),this.scatter_material.uniforms.range_x.value=i,this.scatter_material.uniforms.range_y.value=[r[1],r[0]],this.scatter_material.uniforms.domain_x.value=e.scale.domain(),this.scatter_material.uniforms.domain_y.value=n.scale.domain(),this.scales.size)this.scatter_material.uniforms.range_size.value=this.scales.size.scale.range(),this.scatter_material.uniforms.domain_size.value=this.scales.size.scale.domain();else{const t=this.model.get("default_size");this.scatter_material.uniforms.range_size.value=[0,t],this.scatter_material.uniforms.domain_size.value=[0,t]}this.scales.rotation&&(this.scatter_material.uniforms.range_rotation.value=this.scales.rotation.scale.range(),this.scatter_material.uniforms.domain_rotation.value=this.scales.rotation.scale.domain()),this.scales.opacity&&(this.scatter_material.uniforms.range_opacity.value=this.scales.opacity.scale.range(),this.scatter_material.uniforms.domain_opacity.value=this.scales.opacity.scale.domain()),t.renderer.render(this.scene,this.camera);const o=[];for(let t=0;t<this.transitions.length;t++){const e=this.transitions[t];e.is_done()||o.push(e),e.update()}this.transitions=o,this.transitions.length>0&&this.update_scene()}create_listeners(){super.create_listeners(),this.listenTo(this.model,"change:x",this.update_x),this.listenTo(this.model,"change:y",this.update_y),this.listenTo(this.model,"change:color change:colors change:unselected_style",this.update_color),this.listenTo(this.model,"change:opacity change:default_opacities",this.update_opacity),this.listenTo(this.model,"change:size change:default_size",this.update_size),this.listenTo(this.model,"change:rotation",this.update_rotation),this.listenTo(this.model,"change:selected",this.update_selected),this.listenTo(this.model,"change:marker",this.update_marker),this.update_marker(),this.listenTo(this.model,"change:stroke",this.update_stroke),this.update_stroke(),this.listenTo(this.model,"change:stroke_width",this.update_stroke_width),this.update_stroke_width();const t=()=>{this.mesh.visible=this.model.get("visible"),this.update_scene()};this.listenTo(this.model,"change:visible",t),t();const e=()=>{this.scatter_material.defines.FILL=this.model.get("fill")?1:0,this.scatter_material.needsUpdate=!0,this.update_scene()};this.listenTo(this.model,"change:fill",e),e(),this.listenTo(this.model,"change",this.update_legend)}update_attribute(t,e,n){return e.meshPerAttribute!=n.mesh_per_attribute?e=this.initialize_attribute(t,n):e.array.length<n.array.length?e=this.initialize_attribute(t,n):(e.itemSize=n.item_size,e.setArray(n.array)),e.needsUpdate=!0,e}update_attributes(t,e,n,i,r=!0,o=(()=>{})){if(r){if(e.array.length<i.array.length&&e.meshPerAttribute==i.mesh_per_attribute){const r=c.deepCopy(i.array);r.set(e.array),n=this.update_attribute(t+"_previous",n,new p(r,e.itemSize,e.meshPerAttribute,e.normalized))}else n=e.array.length==i.array.length&&e.meshPerAttribute!=i.mesh_per_attribute?this.update_attribute(t+"_previous",n,new p(e.array,e.itemSize,i.mesh_per_attribute,e.normalized)):this.update_attribute(t+"_previous",n,new p(e.array,e.itemSize,e.meshPerAttribute,e.normalized));e=this.update_attribute(t,e,i),this.animate_attribute(t,o)}else n=this.update_attribute(t+"_previous",n,i),e=this.update_attribute(t,e,i);return[e,n]}animate_attribute(t,e=(()=>{})){this.scatter_material.uniforms["animation_time_"+t].value=0,this.transition(e=>{this.scatter_material.uniforms["animation_time_"+t].value=e},e,this)}update_x(t=!0){const e=h(this.model.get("x")),n=Math.min(e.length,this.y.array.length);this.markers_number!=n&&this.update_markers_number(n),[this.x,this.x_previous]=this.update_attributes("x",this.x,this.x_previous,new p(e,1,1)),t&&this.update_scene()}update_y(t=!0){const e=h(this.model.get("y")),n=Math.min(this.x.array.length,e.length);this.markers_number!=n&&this.update_markers_number(n),[this.y,this.y_previous]=this.update_attributes("y",this.y,this.y_previous,new p(e,1,1)),t&&this.update_scene()}update_markers_number(t){const e=this.markers_number;this.markers_number=t,this.instanced_geometry.maxInstancedCount=t,this.markers_number>e&&(this.update_color(!1),this.update_opacity(!1),this.update_size(!1),this.update_rotation(!1),this.update_selected(!1))}update_color(t=!0){const e=this.get_color_attribute_parameters();this.color=this.update_attribute("color",this.color,e),this.color.normalized=e.normalized,this.scatter_material.defines.USE_COLORMAP=e.use_colormap,this.scatter_material.needsUpdate=!0,t&&this.update_scene()}update_opacity(t=!0){const e=this.get_opacity_attribute_parameters();[this.opacity,this.opacity_previous]=this.update_attributes("opacity",this.opacity,this.opacity_previous,e),t&&this.update_scene()}update_size(t=!0){const e=this.get_size_attribute_parameters();[this.size,this.size_previous]=this.update_attributes("size",this.size,this.size_previous,e),t&&this.update_scene()}update_rotation(t=!0){const e=this.get_rotation_attribute_parameters();[this.rotation,this.rotation_previous]=this.update_attributes("rotation",this.rotation,this.rotation_previous,e),t&&this.update_scene()}update_selected(t=!0){const e=this.get_selected_attribute_parameters();this.selected=this.update_attribute("selected",this.selected,e),this.scatter_material.uniforms.has_selection.value=e.use_selection,t&&this.update_scene()}update_marker(){const t=this.model.get("marker");this.dot.type(t),"circle"===t&&(this.scatter_material.uniforms.marker_scale.value=1/Math.sqrt(Math.PI),this.scatter_material.defines.FAST_DRAW=1),"square"===t&&(this.scatter_material.uniforms.marker_scale.value=.5,this.scatter_material.defines.FAST_DRAW=2),"arrow"===t&&(this.scatter_material.uniforms.marker_scale.value=2,this.scatter_material.defines.FAST_DRAW=3),"cross"===t&&(this.scatter_material.uniforms.marker_scale.value=3/(2*Math.sqrt(5)),this.scatter_material.defines.FAST_DRAW=4),"triangle-up"===t&&(this.scatter_material.uniforms.marker_scale.value=2,this.scatter_material.defines.FAST_DRAW=5),"triangle-down"===t&&(this.scatter_material.uniforms.marker_scale.value=2,this.scatter_material.defines.FAST_DRAW=6),this.scatter_material.needsUpdate=!0,this.update_scene()}update_stroke(){const t=this.model.get("stroke");t?(this.scatter_material.uniforms.default_stroke_color.value=d(t),this.scatter_material.defines.HAS_DEFAULT_STROKE_COLOR=!0):this.scatter_material.defines.HAS_DEFAULT_STROKE_COLOR=!1,this.scatter_material.needsUpdate=!0,this.update_scene()}update_stroke_width(){this.scatter_material.uniforms.stroke_width.value=this.model.get("stroke_width"),this.update_scene()}update_color_map(){if(this.scatter_material.uniforms.colormap.value=f(this.scales.color),this.scales.color){const t=this.model.get("color");if(t){let e,n;e=null!==this.scales.color.model.min?this.scales.color.model.min:Math.min(...t),n=null!==this.scales.color.model.max?this.scales.color.model.max:Math.max(...t),this.scatter_material.uniforms.domain_color.value=[e,n]}else null!==this.scales.color.model.min&&null!==this.scales.color.model.max?this.scatter_material.uniforms.domain_color.value=[this.scales.color.model.min,this.scales.color.model.max]:console.warn("no color set, and color scale does not have a min or max")}this.update_scene()}update_position(t){this.update_scene(),this.invalidate_pixel_position()}invalidate_pixel_position(){this.invalidated_pixel_position=!0}ensure_pixel_position(){this.invalidated_pixel_position&&this.update_pixel_position()}update_pixel_position(t){const e=this.scales.x,n=this.scales.y,i=this.model.get("x"),r=this.model.get("y"),o=Math.min(i.length,r.length);this.pixel_x=new Float64Array(o),this.pixel_y=new Float64Array(o);for(let t=0;t<o;t++)this.pixel_x[t]=e.scale(i[t])+e.offset,this.pixel_y[t]=n.scale(r[t])+n.offset;this.invalidated_pixel_position=!1}selector_changed(t,e){this.trottled_selector_changed||(this.trottled_selector_changed=s.throttle(this._real_selector_changed,50,{leading:!1})),this.trottled_selector_changed(t,e)}_real_selector_changed(t,e){if(this.ensure_pixel_position(),void 0===t)return this.model.set("selected",null),this.touch(),[];const n=t(this.pixel_x,this.pixel_y);let i=new Uint32Array(n.length),r=0;const o=n.length;for(let t=0;t<o;t++)n[t]&&(i[r++]=t);i=i.slice(0,r),this.model.set("selected",i),this.touch()}set_positional_scales(){this.x_scale=this.scales.x,this.y_scale=this.scales.y,this.x_scale||(this.x_scale=this.parent.scale_x),this.y_scale||(this.y_scale=this.parent.scale_y),this.listenTo(this.x_scale,"domain_changed",function(){if(!this.model.dirty){const t=!0;this.update_position(t)}}),this.listenTo(this.y_scale,"domain_changed",function(){if(!this.model.dirty){const t=!0;this.update_position(t)}})}initialize_additional_scales(){const t=this.scales.color,e=this.scales.size,n=this.scales.opacity,i=this.scales.rotation;t&&(this.listenTo(t,"all",this.update_color_map),this.listenTo(this.model,"change:color",this.update_color_map),this.update_color_map()),e&&this.listenTo(e,"domain_changed",()=>{this.update_scene()}),n&&this.listenTo(n,"domain_changed",()=>{this.update_scene()}),i&&this.listenTo(i,"domain_changed",()=>{this.update_scene()})}set_ranges(){const t=this.scales.x,e=this.scales.y,n=this.scales.size,i=this.scales.opacity,r=this.scales.skew,o=this.scales.rotation;t&&t.set_range(this.parent.padded_range("x",t.model)),e&&e.set_range(this.parent.padded_range("y",e.model)),n&&n.set_range([0,this.model.get("default_size")]),i&&i.set_range([.2,1]),r&&r.set_range([0,1]),o&&o.set_range([0,Math.PI])}transition(t,e,n){const i=this;return new function(){this.time_start=(new Date).getTime(),this.duration=i.parent.model.get("animation_duration"),this.cancelled=!1,this.called_on_done=!1,this.set=function(t){this.objects.push(t)},this.is_done=function(){return(new Date).getTime()-this.time_start>=this.duration||this.cancelled},this.cancel=function(){this.cancelled=!0},this.update=function(){if(this.cancelled)return;const r=((new Date).getTime()-this.time_start)/this.duration,o=Math.min(1,r);t.apply(n,[o]),r>=1&&!this.called_on_done&&(this.called_on_done=!0,e.apply(n)),i.update_scene()},this.duration?i.transitions.push(this):(t.apply(n,[1]),e.apply(n),i.update_scene())}}draw_legend(t,e,n,i,r){this.legend_el=t.selectAll(".legend"+this.uuid).data([{}]);const a=this.model.get("colors"),s=a.length,c=this,l=.8*r,u=this.legend_el.enter().append("g").attr("class","legend"+this.uuid).attr("transform",function(t,e){return"translate(0, "+(e*r+n)+")"});this.draw_legend_elements(u,l),this.legend_el.append("text").attr("class","legendtext").attr("x",1.2*l).attr("y",l/2).attr("dy","0.35em").text(function(t,e){return c.model.get("labels")[e]}).style("fill",function(t,e){return a[e%s]});const h=o.max(this.model.get("labels"),function(t){return t.length});return this.legend_el.exit().remove(),[1,h]}draw_legend_elements(t,e){const n=this.model.get("colors"),i=this.model.get("stroke"),r=this.model.get("fill");t.append("path").attr("transform",function(t,n){return"translate( "+e/2+", "+e/2+")"}).attr("d",this.dot.size(64)).style("fill",r?n[0]:"none").style("stroke",i||n[0])}update_legend(){if(this.legend_el){const t=this.model.get("colors"),e=this.model.get("stroke"),n=this.model.get("fill");this.legend_el.select("path").style("fill",n?t[0]:"none").style("stroke",e||t[0]),this.legend_el.select("text").style("fill",n?t[0]:"none"),this.legend_el&&this.legend_el.select("path").attr("d",this.dot.type(this.model.get("marker")))}}relayout(){this.set_ranges(),this.update_position()}compute_view_padding(){const t=Math.sqrt(this.model.get("default_size"))/2+1;t===this.x_padding&&t===this.y_padding||(this.x_padding=t,this.y_padding=t,this.trigger("mark_padding_updated"))}draw(t){}clear_style(t,e,n){}set_default_style(t,e){}set_style_on_elements(t,e,n){}}},function(t,e,n){"use strict";n.r(e),e.default='#include <fog_pars_vertex>\n#include <scales>\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\n\n // for animation, all between 0 and 1\nuniform float animation_time_x;\nuniform float animation_time_y;\nuniform float animation_time_z;\nuniform float animation_time_size;\nuniform float animation_time_rotation;\nuniform float animation_time_opacity;\n\n#ifdef HAS_DEFAULT_STROKE_COLOR\nuniform vec4 default_stroke_color;\n#endif\n\nuniform bool has_selection;\nuniform bool has_hover;\n\n// maybe faster to use #IFDEFS\nuniform bool has_selected_fill;\nuniform vec4 selected_fill;\nuniform bool has_selected_stroke;\nuniform vec4 selected_stroke;\nuniform bool has_selected_opacity;\nuniform float selected_opacity;\n\nuniform bool has_unselected_fill;\nuniform vec4 unselected_fill;\nuniform bool has_unselected_stroke;\nuniform vec4 unselected_stroke;\nuniform bool has_unselected_opacity;\nuniform float unselected_opacity;\n\n\nuniform bool has_hovered_fill;\nuniform vec4 hovered_fill;\nuniform bool has_hovered_stroke;\nuniform vec4 hovered_stroke;\nuniform bool has_hovered_opacity;\nuniform float hovered_opacity;\n\nuniform bool has_unhovered_fill;\nuniform vec4 unhovered_fill;\nuniform bool has_unhovered_stroke;\nuniform vec4 unhovered_stroke;\nuniform bool has_unhovered_opacity;\nuniform float unhovered_opacity;\n\nuniform vec2 domain_x;\nuniform vec2 domain_y;\nuniform vec2 domain_z;\nuniform vec2 domain_size;\nuniform vec2 domain_rotation;\nuniform vec2 domain_opacity;\n\nuniform vec2 range_x;\nuniform vec2 range_y;\nuniform vec2 range_z;\nuniform vec2 range_size;\nuniform vec2 range_rotation;\nuniform vec2 range_opacity;\n\nuniform bool fill;\nuniform float stroke_width;\nuniform float marker_scale;\n\nvarying vec4 v_fill_color;\nvarying vec4 v_stroke_color;\nvarying float v_inner_size;\nvarying float v_outer_size;\nvarying vec2 v_pixel;\n\nattribute vec3 position;\nattribute vec2 uv;\n\nattribute float x;\nattribute float x_previous;\nattribute float y;\nattribute float y_previous;\n\nattribute float size;\nattribute float size_previous;\n\nattribute float rotation;\nattribute float rotation_previous;\n\nattribute float opacity;\nattribute float opacity_previous;\n\n// Boolean or int not supported for attributes, using a float instead\nattribute float selected;\n\nuniform sampler2D colormap;\nuniform vec2 domain_color;\n\n#ifdef USE_COLORMAP\nattribute float color;\n#else\nattribute vec3 color;\n#endif\n\n\n#define SCALE_X(x) scale_transform_linear(x, range_x, domain_x)\n#define SCALE_Y(x) scale_transform_linear(x, range_y, domain_y)\n#define SCALE_SIZE(x) scale_transform_linear(x, range_size, domain_size)\n#define SCALE_ROTATION(x) scale_transform_linear(x, range_rotation, domain_rotation)\n#define SCALE_OPACITY(x) scale_transform_linear(x, range_opacity, domain_opacity)\n\nvec3 rotate_xy(vec3 x, float angle) {\n float sina = sin(angle);\n float cosa = cos(angle);\n mat2 m = mat2(cosa, -sina, sina, cosa);\n return vec3(m * x.xy, x.z);\n}\n\nvoid main(void) {\n\n vec3 animation_time = vec3(animation_time_x, animation_time_y, animation_time_z);\n\n\n vec3 domain_offset = vec3(domain_x.x, domain_y.x, domain_z.x);\n vec3 domain_scale = vec3(domain_x.y, domain_y.y, domain_z.y) - domain_offset;\n vec3 range_offset = vec3(range_x.x, range_y.x, range_z.x);\n vec3 range_scale = vec3(range_x.y, range_y.y, range_z.y) - range_offset;\n\n vec3 center = mix(vec3(x_previous, y_previous, 0), vec3(x, y, 0), animation_time);\n\n // vec3 center_normalized = (center - domain_offset) / domain_scale;\n // vec3 center_pixels = ((center_normalized*2.)-0.) * range_scale + range_offset;\n // times 2 because the normalized coordinates go from [-1, 1]\n vec3 center_pixels = vec3(SCALE_X(center.x), SCALE_Y(center.y), 0) * 2.;\n\n\n // times 4 because of the normalized coordinates, and radius vs diameter use\n float marker_size = sqrt(mix(SCALE_SIZE(size_previous), SCALE_SIZE(size), animation_time_size)) * marker_scale * 4.;\n // we draw larger than the size for the stroke_width (on both side)\n\n // `v_inner_size` is the marker "radius" without the stroke, `v_outer_size` is the marker "radius" with the stroke\n v_inner_size = marker_size * 0.5 - stroke_width;\n v_outer_size = marker_size * 0.5 + stroke_width;\n\n // `full_size` is the marker "diameter" with the stroke\n float full_size = marker_size + 2.0 * stroke_width;\n\n // `v_pixel` is the pixel position relatively to the marker,\n // e.g. vec2(0.) would be the center of the square marker\n // e.g. vec2(0.5 * full_size) would be the top-right pixel of the square marker\n v_pixel = (uv - 0.5) * (full_size);\n\n float angle = SCALE_ROTATION(mix(rotation_previous, rotation, animation_time_rotation));\n vec3 model_pos = rotate_xy(position, 1.) * full_size + center_pixels;\n\n#ifdef USE_COLORMAP\n float color_index = (color - domain_color.x) / (domain_color.y - domain_color.x);\n vec4 color_rgba = texture2D(colormap, vec2(color_index, 0));\n#else\n vec4 color_rgba = vec4(color, 1.0);\n#endif\n\n v_fill_color = color_rgba;\n v_stroke_color = color_rgba;\n\n#ifdef HAS_DEFAULT_STROKE_COLOR\n v_stroke_color = default_stroke_color;\n#endif\n\n float opacity_value = SCALE_OPACITY(mix(opacity_previous, opacity, animation_time_opacity));\n v_fill_color.a *= opacity_value;\n v_stroke_color.a *= opacity_value;\n\n if(has_selection) {\n if(has_selected_fill && selected > 0.5 )\n v_fill_color = selected_fill;\n if(has_unselected_fill && selected < 0.5 )\n v_fill_color = unselected_fill;\n if(has_selected_stroke && selected > 0.5 )\n v_stroke_color = selected_stroke;\n if(has_unselected_stroke && selected < 0.5 )\n v_stroke_color = unselected_stroke;\n if(has_selected_opacity && selected > 0.5 ) {\n v_stroke_color.a *= selected_opacity;\n v_fill_color.a *= selected_opacity;\n }\n if(has_unselected_opacity && selected < 0.5 ) {\n v_stroke_color.a *= unselected_opacity;\n v_fill_color.a *= unselected_opacity;\n }\n }\n\n v_fill_color.rgb *= v_fill_color.a;\n v_stroke_color.rgb *= v_stroke_color.a;\n\n // color_rgba = has_selection && has_selected_color ? (selected > 0.5 ? selected_color : unselected_color) : color_rgba;\n gl_Position = projectionMatrix * vec4(rotate_xy(position, angle) * full_size, 1.0) +\n projectionMatrix * modelViewMatrix * vec4(center_pixels + vec3(0., 0., 0.), 1.0);\n}\n'},function(t,e,n){"use strict";n.r(e),e.default="#include <fog_pars_fragment>\n#include <alphamap_pars_fragment>\n\nprecision highp float;\nprecision highp int;\n\n#define FAST_CIRCLE 1\n#define FAST_SQUARE 2\n#define FAST_ARROW 3\n#define FAST_CROSS 4\n#define FAST_TRIANGLE_UP 5\n#define FAST_TRIANGLE_DOWN 6\n\n// This parameter is used for reducing aliasing\n#define SMOOTH_PIXELS 1.0\n\n// ANGLE_X = X * PI / 180.\n#define ANGLE_20 0.3490658503988659\n#define ANGLE_60 1.0471975511965976\n\nvarying vec4 v_fill_color;\nvarying vec4 v_stroke_color;\nvarying float v_inner_size;\nvarying float v_outer_size;\nvarying vec2 v_pixel;\n\nuniform float stroke_width;\n\n\n/*\n * Rotate a point in the 2-D plane, given an angle in radians\n */\nvec2 rotate_xy(vec2 x, float angle) {\n float sina = sin(angle);\n float cosa = cos(angle);\n mat2 m = mat2(cosa, -sina, sina, cosa);\n return m * x.xy;\n}\n\n/*\n * Returns 1.0 if pixel inside of a circle (0.0 otherwise) given the circle radius and the\n * pixel position.\n */\nfloat smooth_circle(in float radius, in vec2 pixel_position) {\n // This function does not use the ellipse function for optimization purpose\n // Circle equation: x^2 + y^2 = radius^2\n float d = dot(pixel_position, pixel_position);\n float r1 = pow(radius - SMOOTH_PIXELS, 2.0);\n float r2 = pow(radius + SMOOTH_PIXELS, 2.0);\n return 1.0 - smoothstep(r1, r2, d);\n}\n\n/*\n * Returns 1.0 if pixel inside of an ellipse (0.0 otherwise) given the ellipse radius and the\n * pixel position.\n */\nfloat smooth_ellipse(in float a, in float b, in vec2 pixel_position) {\n // Ellipse equation: b^2 * x^2 + a^2 * y^2 = a^2 * b^2\n float r_x = pow(a, 2.0);\n float r_y = pow(b, 2.0);\n float d = r_y * pow(pixel_position.x, 2.0) + r_x * pow(pixel_position.y, 2.0);\n float r1 = pow(a - SMOOTH_PIXELS, 2.0) * pow(b - SMOOTH_PIXELS, 2.0);\n float r2 = pow(a + SMOOTH_PIXELS, 2.0) * pow(b + SMOOTH_PIXELS, 2.0);\n return 1.0 - smoothstep(r1, r2, d);\n}\n\n/*\n * Returns 1.0 if pixel inside of a rectangle (0.0 otherwise) given the rectangle half-size\n * on the x and y axes and the pixel position.\n */\nfloat smooth_rectangle(in vec2 size, in vec2 pixel_position) {\n vec2 rec = smoothstep(vec2(-SMOOTH_PIXELS), vec2(SMOOTH_PIXELS), size - abs(pixel_position));\n return rec.x * rec.y;\n}\n\n/*\n * Returns 1.0 if pixel inside of a rectangle (0.0 otherwise) given the rectangle half-size\n * on the x and y axes and the pixel position.\n */\nfloat rectangle(in vec2 size, in vec2 pixel_position) {\n vec2 rec = step(0.0, size - abs(pixel_position));\n return rec.x * rec.y;\n}\n\n/*\n * Returns 1.0 if pixel inside of a square (0.0 otherwise) given the square half-size\n * and the pixel position.\n */\nfloat smooth_square(in float size, in vec2 pixel_position) {\n return smooth_rectangle(vec2(size), pixel_position);\n}\n\nfloat smooth_isosceles_triangle(in float angle, in float height, in vec2 pixel_position) {\n float half_angle = angle / 2.0;\n\n // The triangle center is on vec2(0.0, -height/3.0)\n vec2 translated_pixel = vec2(pixel_position.x, pixel_position.y - height / 3.0);\n\n vec2 pixel_left = rotate_xy(translated_pixel, -half_angle);\n vec2 pixel_right = rotate_xy(translated_pixel, half_angle);\n\n float half_height = height * 0.5;\n\n float half_bottom = half_height * tan(half_angle);\n\n return smoothstep(-SMOOTH_PIXELS, SMOOTH_PIXELS, half_bottom + pixel_left.x) *\n smoothstep(-SMOOTH_PIXELS, SMOOTH_PIXELS, half_bottom - pixel_right.x) *\n smoothstep(-SMOOTH_PIXELS, SMOOTH_PIXELS, translated_pixel.y + half_height);\n}\n\n\n/*\n * Returns 1.0 if pixel inside of a cross shape (0.0 otherwise) given the cross half-size\n * on the x and y axes and the pixel position.\n */\nfloat cross(in vec2 size, in vec2 pixel_position) {\n float cross_shape = rectangle(size.xy, pixel_position) +\n rectangle(size.yx, pixel_position);\n return clamp(cross_shape, 0.0, 1.0);\n}\n\n\nvoid main(void) {\n // fill_weight and stroke_weight are color factors\n // e.g. if fill_weight == 1.0 then the pixel color will be v_fill_color\n // e.g. if stroke_weight == 1.0 then the pixel color will be v_stroke_color\n float fill_weight = 0.0;\n float stroke_weight = 0.0;\n\n // Note for the reader: In the following code,\n // - `1.0` -> True\n // - `0.0` -> False\n // - `1.0 - A` -> NOT A\n // - `A + B` -> A OR B\n // - `A * B` -> A AND B\n\n float inner_shape = 0.0;\n float outer_shape = 0.0;\n\n#if FAST_DRAW == FAST_CIRCLE\n\n inner_shape = smooth_circle(v_inner_size, v_pixel);\n outer_shape = smooth_circle(v_outer_size, v_pixel);\n\n#elif FAST_DRAW == FAST_SQUARE\n\n inner_shape = smooth_square(v_inner_size, v_pixel);\n outer_shape = 1.0; // Always in the outer_shape\n\n#elif FAST_DRAW == FAST_CROSS\n\n float r = v_outer_size / 3.0;\n\n inner_shape = cross(vec2(v_inner_size, r - 2.0 * stroke_width), v_pixel);\n outer_shape = cross(vec2(r, v_outer_size), v_pixel);\n\n#elif FAST_DRAW == FAST_ARROW\n\n inner_shape = smooth_isosceles_triangle(ANGLE_20, v_inner_size, v_pixel);\n outer_shape = smooth_isosceles_triangle(ANGLE_20, v_outer_size, v_pixel);\n\n#elif FAST_DRAW == FAST_TRIANGLE_UP\n\n inner_shape = smooth_isosceles_triangle(ANGLE_60, v_inner_size, v_pixel);\n outer_shape = smooth_isosceles_triangle(ANGLE_60, v_outer_size, v_pixel);\n\n#elif FAST_DRAW == FAST_TRIANGLE_DOWN\n\n vec2 reversed_pixel = vec2(v_pixel.x, -v_pixel.y);\n\n inner_shape = smooth_isosceles_triangle(ANGLE_60, v_inner_size, reversed_pixel);\n outer_shape = smooth_isosceles_triangle(ANGLE_60, v_outer_size, reversed_pixel);\n\n#endif\n\n // `inner_shape` is the shape without the stroke, `outer_shape` is the shape with the stroke\n // note that the stroke is always drawn, only that it has the `v_fill_color` if stroke is None\n fill_weight = inner_shape;\n stroke_weight = (1.0 - inner_shape) * outer_shape;\n\n#if !FILL\n fill_weight = 0.0;\n#endif\n\n gl_FragColor = v_fill_color * fill_weight + v_stroke_color * stroke_weight;\n}\n"},function(t,e,n){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const r=n(18),o=i(n(12));class a extends r.MarkModel{defaults(){return Object.assign({},r.MarkModel.prototype.defaults(),{_model_name:"ScatterGLModel",_view_name:"ScatterGL",x:[],y:[],color:null,skew:null,marker:"circle",stroke:null,stroke_width:1.5,default_skew:.5,default_size:64,names:[],display_names:!0,fill:!0,drag_color:null,drag_size:5,names_unique:!0})}initialize(t,e){super.initialize(t,e),this.update_domains()}update_domains(){var t=this.get("scales");for(var e in t)if(t.hasOwnProperty(e)&&"color"!=e){var n=t[e];this.get("preserve_domain")[e]?n.del_domain([],this.model_id+e):n.compute_and_set_domain(this.get(e),this.model_id+e)}}}a.serializers=Object.assign({},r.MarkModel.serializers,{x:o.array_or_json,y:o.array_or_json,color:o.array_or_json,size:o.array_or_json,rotation:o.array_or_json,opacity:o.array_or_json,default_opacities:o.array_or_json}),e.ScatterGLModel=a}])});
//# sourceMappingURL=index.js.map