diff --git a/.babelrc b/.babelrc index ac53728ba..433bae612 100644 --- a/.babelrc +++ b/.babelrc @@ -1,3 +1,9 @@ { - "presets": ["@babel/env", "@babel/react"] -} + "presets": [ + "@babel/env", + "@babel/react" + ], + "plugins": [ + "@babel/plugin-syntax-dynamic-import" + ] +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 09a301c97..70e14ed85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [0.4.0] - 2019-11-05 +### Added +* [#430](https://github.com/plotly/dash-bio/pull/430) Async AlignmentChart, Circos, Ideogram, Molecule2dViewer, Molecule3dViewer, NeedlePlot, OncoPrint, SequenceViewwer and Speck components + ## [0.3.0] - 2019-10-22 ### Added diff --git a/dash_bio/__init__.py b/dash_bio/__init__.py index b966ef955..963f745c7 100644 --- a/dash_bio/__init__.py +++ b/dash_bio/__init__.py @@ -32,17 +32,50 @@ _this_module = _sys.modules[__name__] +async_resources = [ + 'alignment', + 'circos', + 'ideogram', + 'moleculeviewer2', + 'moleculeviewer3', + 'needle', + 'onco', + 'sequence', + 'speck' +] + +_js_dist = [] + +_js_dist.extend([{ + 'relative_package_path': 'async~{}.js'.format(async_resource), + 'external_url': ( + 'https://unpkg.com/dash-bio@{}' + '/dash_bio/async~{}.js' + ).format(__version__, async_resource), + 'namespace': 'dash_bio', + 'async': True + } for async_resource in async_resources]) -_js_dist = [ +_js_dist.extend([{ + 'relative_package_path': 'async~{}.js.map'.format(async_resource), + 'external_url': ( + 'https://unpkg.com/dash-bio@{}' + '/dash_bio/async~{}.js.map' + ).format(__version__, async_resource), + 'namespace': 'dash_bio', + 'dynamic': True + } for async_resource in async_resources]) + +_js_dist.extend([ { 'relative_package_path': 'bundle.js', 'external_url': ( - 'https://unpkg.com/dash-bio' + 'https://unpkg.com/dash-bio{}' '/' + package_name + '/bundle.js' ).format(__version__), 'namespace': package_name } -] +]) _css_dist = [] diff --git a/dash_bio/async~alignment.js b/dash_bio/async~alignment.js new file mode 100644 index 000000000..79c8c8dd7 --- /dev/null +++ b/dash_bio/async~alignment.js @@ -0,0 +1,63 @@ +(window.webpackJsonpdash_bio=window.webpackJsonpdash_bio||[]).push([[0],Array(34).concat([function(t,e,r){"use strict";r.r(e),r.d(e,"default",function(){return d});var n=r(1),i=r.n(n),a=r(181),o=r(10),s=r(85);function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(){return(u=Object.assign||function(t){for(var e=1;e + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */(function(){var a,o=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",u="__lodash_hash_undefined__",c=500,f="__lodash_placeholder__",h=1,p=2,d=4,v=1,g=2,m=1,y=2,x=4,b=8,_=16,w=32,k=64,A=128,T=256,M=512,E=30,S="...",C=800,L=16,O=1,I=2,P=1/0,D=9007199254740991,z=1.7976931348623157e308,R=NaN,F=4294967295,B=F-1,N=F>>>1,j=[["ary",A],["bind",m],["bindKey",y],["curry",b],["curryRight",_],["flip",M],["partial",w],["partialRight",k],["rearg",T]],V="[object Arguments]",U="[object Array]",H="[object AsyncFunction]",q="[object Boolean]",G="[object Date]",W="[object DOMException]",Y="[object Error]",X="[object Function]",Z="[object GeneratorFunction]",$="[object Map]",J="[object Number]",K="[object Null]",Q="[object Object]",tt="[object Proxy]",et="[object RegExp]",rt="[object Set]",nt="[object String]",it="[object Symbol]",at="[object Undefined]",ot="[object WeakMap]",st="[object WeakSet]",lt="[object ArrayBuffer]",ut="[object DataView]",ct="[object Float32Array]",ft="[object Float64Array]",ht="[object Int8Array]",pt="[object Int16Array]",dt="[object Int32Array]",vt="[object Uint8Array]",gt="[object Uint8ClampedArray]",mt="[object Uint16Array]",yt="[object Uint32Array]",xt=/\b__p \+= '';/g,bt=/\b(__p \+=) '' \+/g,_t=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wt=/&(?:amp|lt|gt|quot|#39);/g,kt=/[&<>"']/g,At=RegExp(wt.source),Tt=RegExp(kt.source),Mt=/<%-([\s\S]+?)%>/g,Et=/<%([\s\S]+?)%>/g,St=/<%=([\s\S]+?)%>/g,Ct=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Lt=/^\w*$/,Ot=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,It=/[\\^$.*+?()[\]{}|]/g,Pt=RegExp(It.source),Dt=/^\s+|\s+$/g,zt=/^\s+/,Rt=/\s+$/,Ft=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Bt=/\{\n\/\* \[wrapped with (.+)\] \*/,Nt=/,? & /,jt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Vt=/\\(\\)?/g,Ut=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ht=/\w*$/,qt=/^[-+]0x[0-9a-f]+$/i,Gt=/^0b[01]+$/i,Wt=/^\[object .+?Constructor\]$/,Yt=/^0o[0-7]+$/i,Xt=/^(?:0|[1-9]\d*)$/,Zt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,$t=/($^)/,Jt=/['\n\r\u2028\u2029\\]/g,Kt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Qt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",te="[\\ud800-\\udfff]",ee="["+Qt+"]",re="["+Kt+"]",ne="\\d+",ie="[\\u2700-\\u27bf]",ae="[a-z\\xdf-\\xf6\\xf8-\\xff]",oe="[^\\ud800-\\udfff"+Qt+ne+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",se="\\ud83c[\\udffb-\\udfff]",le="[^\\ud800-\\udfff]",ue="(?:\\ud83c[\\udde6-\\uddff]){2}",ce="[\\ud800-\\udbff][\\udc00-\\udfff]",fe="[A-Z\\xc0-\\xd6\\xd8-\\xde]",he="(?:"+ae+"|"+oe+")",pe="(?:"+fe+"|"+oe+")",de="(?:"+re+"|"+se+")"+"?",ve="[\\ufe0e\\ufe0f]?"+de+("(?:\\u200d(?:"+[le,ue,ce].join("|")+")[\\ufe0e\\ufe0f]?"+de+")*"),ge="(?:"+[ie,ue,ce].join("|")+")"+ve,me="(?:"+[le+re+"?",re,ue,ce,te].join("|")+")",ye=RegExp("['’]","g"),xe=RegExp(re,"g"),be=RegExp(se+"(?="+se+")|"+me+ve,"g"),_e=RegExp([fe+"?"+ae+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ee,fe,"$"].join("|")+")",pe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ee,fe+he,"$"].join("|")+")",fe+"?"+he+"+(?:['’](?:d|ll|m|re|s|t|ve))?",fe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ne,ge].join("|"),"g"),we=RegExp("[\\u200d\\ud800-\\udfff"+Kt+"\\ufe0e\\ufe0f]"),ke=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ae=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Te=-1,Me={};Me[ct]=Me[ft]=Me[ht]=Me[pt]=Me[dt]=Me[vt]=Me[gt]=Me[mt]=Me[yt]=!0,Me[V]=Me[U]=Me[lt]=Me[q]=Me[ut]=Me[G]=Me[Y]=Me[X]=Me[$]=Me[J]=Me[Q]=Me[et]=Me[rt]=Me[nt]=Me[ot]=!1;var Ee={};Ee[V]=Ee[U]=Ee[lt]=Ee[ut]=Ee[q]=Ee[G]=Ee[ct]=Ee[ft]=Ee[ht]=Ee[pt]=Ee[dt]=Ee[$]=Ee[J]=Ee[Q]=Ee[et]=Ee[rt]=Ee[nt]=Ee[it]=Ee[vt]=Ee[gt]=Ee[mt]=Ee[yt]=!0,Ee[Y]=Ee[X]=Ee[ot]=!1;var Se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ce=parseFloat,Le=parseInt,Oe="object"==typeof t&&t&&t.Object===Object&&t,Ie="object"==typeof self&&self&&self.Object===Object&&self,Pe=Oe||Ie||Function("return this")(),De=e&&!e.nodeType&&e,ze=De&&"object"==typeof n&&n&&!n.nodeType&&n,Re=ze&&ze.exports===De,Fe=Re&&Oe.process,Be=function(){try{var t=ze&&ze.require&&ze.require("util").types;return t||Fe&&Fe.binding&&Fe.binding("util")}catch(t){}}(),Ne=Be&&Be.isArrayBuffer,je=Be&&Be.isDate,Ve=Be&&Be.isMap,Ue=Be&&Be.isRegExp,He=Be&&Be.isSet,qe=Be&&Be.isTypedArray;function Ge(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function We(t,e,r,n){for(var i=-1,a=null==t?0:t.length;++i-1}function Ke(t,e,r){for(var n=-1,i=null==t?0:t.length;++n-1;);return r}function br(t,e){for(var r=t.length;r--&&sr(e,t[r],0)>-1;);return r}var _r=hr({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),wr=hr({"&":"&","<":"<",">":">",'"':""","'":"'"});function kr(t){return"\\"+Se[t]}function Ar(t){return we.test(t)}function Tr(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}function Mr(t,e){return function(r){return t(e(r))}}function Er(t,e){for(var r=-1,n=t.length,i=0,a=[];++r",""":'"',"'":"'"});var Pr=function t(e){var r,n=(e=null==e?Pe:Pr.defaults(Pe.Object(),e,Pr.pick(Pe,Ae))).Array,i=e.Date,Kt=e.Error,Qt=e.Function,te=e.Math,ee=e.Object,re=e.RegExp,ne=e.String,ie=e.TypeError,ae=n.prototype,oe=Qt.prototype,se=ee.prototype,le=e["__core-js_shared__"],ue=oe.toString,ce=se.hasOwnProperty,fe=0,he=(r=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",pe=se.toString,de=ue.call(ee),ve=Pe._,ge=re("^"+ue.call(ce).replace(It,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),me=Re?e.Buffer:a,be=e.Symbol,we=e.Uint8Array,Se=me?me.allocUnsafe:a,Oe=Mr(ee.getPrototypeOf,ee),Ie=ee.create,De=se.propertyIsEnumerable,ze=ae.splice,Fe=be?be.isConcatSpreadable:a,Be=be?be.iterator:a,ir=be?be.toStringTag:a,hr=function(){try{var t=Ba(ee,"defineProperty");return t({},"",{}),t}catch(t){}}(),Dr=e.clearTimeout!==Pe.clearTimeout&&e.clearTimeout,zr=i&&i.now!==Pe.Date.now&&i.now,Rr=e.setTimeout!==Pe.setTimeout&&e.setTimeout,Fr=te.ceil,Br=te.floor,Nr=ee.getOwnPropertySymbols,jr=me?me.isBuffer:a,Vr=e.isFinite,Ur=ae.join,Hr=Mr(ee.keys,ee),qr=te.max,Gr=te.min,Wr=i.now,Yr=e.parseInt,Xr=te.random,Zr=ae.reverse,$r=Ba(e,"DataView"),Jr=Ba(e,"Map"),Kr=Ba(e,"Promise"),Qr=Ba(e,"Set"),tn=Ba(e,"WeakMap"),en=Ba(ee,"create"),rn=tn&&new tn,nn={},an=co($r),on=co(Jr),sn=co(Kr),ln=co(Qr),un=co(tn),cn=be?be.prototype:a,fn=cn?cn.valueOf:a,hn=cn?cn.toString:a;function pn(t){if(Ss(t)&&!ms(t)&&!(t instanceof mn)){if(t instanceof gn)return t;if(ce.call(t,"__wrapped__"))return fo(t)}return new gn(t)}var dn=function(){function t(){}return function(e){if(!Es(e))return{};if(Ie)return Ie(e);t.prototype=e;var r=new t;return t.prototype=a,r}}();function vn(){}function gn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=a}function mn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=F,this.__views__=[]}function yn(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function zn(t,e,r,n,i,o){var s,l=e&h,u=e&p,c=e&d;if(r&&(s=i?r(t,n,i,o):r(t)),s!==a)return s;if(!Es(t))return t;var f=ms(t);if(f){if(s=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&ce.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!l)return ra(t,s)}else{var v=Va(t),g=v==X||v==Z;if(_s(t))return $i(t,l);if(v==Q||v==V||g&&!i){if(s=u||g?{}:Ha(t),!l)return u?function(t,e){return na(t,ja(t),e)}(t,function(t,e){return t&&na(e,al(e),t)}(s,t)):function(t,e){return na(t,Na(t),e)}(t,On(s,t))}else{if(!Ee[v])return i?t:{};s=function(t,e,r){var n,i,a,o=t.constructor;switch(e){case lt:return Ji(t);case q:case G:return new o(+t);case ut:return function(t,e){var r=e?Ji(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case ct:case ft:case ht:case pt:case dt:case vt:case gt:case mt:case yt:return Ki(t,r);case $:return new o;case J:case nt:return new o(t);case et:return(a=new(i=t).constructor(i.source,Ht.exec(i))).lastIndex=i.lastIndex,a;case rt:return new o;case it:return n=t,fn?ee(fn.call(n)):{}}}(t,v,l)}}o||(o=new wn);var m=o.get(t);if(m)return m;o.set(t,s),Ps(t)?t.forEach(function(n){s.add(zn(n,e,r,n,t,o))}):Cs(t)&&t.forEach(function(n,i){s.set(i,zn(n,e,r,i,t,o))});var y=f?a:(c?u?Oa:La:u?al:il)(t);return Ye(y||t,function(n,i){y&&(n=t[i=n]),Sn(s,i,zn(n,e,r,i,t,o))}),s}function Rn(t,e,r){var n=r.length;if(null==t)return!n;for(t=ee(t);n--;){var i=r[n],o=e[i],s=t[i];if(s===a&&!(i in t)||!o(s))return!1}return!0}function Fn(t,e,r){if("function"!=typeof t)throw new ie(l);return no(function(){t.apply(a,r)},e)}function Bn(t,e,r,n){var i=-1,a=Je,s=!0,l=t.length,u=[],c=e.length;if(!l)return u;r&&(e=Qe(e,gr(r))),n?(a=Ke,s=!1):e.length>=o&&(a=yr,s=!1,e=new _n(e));t:for(;++i-1},xn.prototype.set=function(t,e){var r=this.__data__,n=Cn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},bn.prototype.clear=function(){this.size=0,this.__data__={hash:new yn,map:new(Jr||xn),string:new yn}},bn.prototype.delete=function(t){var e=Ra(this,t).delete(t);return this.size-=e?1:0,e},bn.prototype.get=function(t){return Ra(this,t).get(t)},bn.prototype.has=function(t){return Ra(this,t).has(t)},bn.prototype.set=function(t,e){var r=Ra(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},_n.prototype.add=_n.prototype.push=function(t){return this.__data__.set(t,u),this},_n.prototype.has=function(t){return this.__data__.has(t)},wn.prototype.clear=function(){this.__data__=new xn,this.size=0},wn.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},wn.prototype.get=function(t){return this.__data__.get(t)},wn.prototype.has=function(t){return this.__data__.has(t)},wn.prototype.set=function(t,e){var r=this.__data__;if(r instanceof xn){var n=r.__data__;if(!Jr||n.length0&&r(s)?e>1?qn(s,e-1,r,n,i):tr(i,s):n||(i[i.length]=s)}return i}var Gn=sa(),Wn=sa(!0);function Yn(t,e){return t&&Gn(t,e,il)}function Xn(t,e){return t&&Wn(t,e,il)}function Zn(t,e){return $e(e,function(e){return As(t[e])})}function $n(t,e){for(var r=0,n=(e=Wi(e,t)).length;null!=t&&re}function ti(t,e){return null!=t&&ce.call(t,e)}function ei(t,e){return null!=t&&e in ee(t)}function ri(t,e,r){for(var i=r?Ke:Je,o=t[0].length,s=t.length,l=s,u=n(s),c=1/0,f=[];l--;){var h=t[l];l&&e&&(h=Qe(h,gr(e))),c=Gr(h.length,c),u[l]=!r&&(e||o>=120&&h.length>=120)?new _n(l&&h):a}h=t[0];var p=-1,d=u[0];t:for(;++p=s)return l;var u=r[n];return l*("desc"==u?-1:1)}}return t.index-e.index}(t,e,r)})}function yi(t,e,r){for(var n=-1,i=e.length,a={};++n-1;)s!==t&&ze.call(s,l,1),ze.call(t,l,1);return t}function bi(t,e){for(var r=t?e.length:0,n=r-1;r--;){var i=e[r];if(r==n||i!==a){var a=i;Ga(i)?ze.call(t,i,1):Bi(t,i)}}return t}function _i(t,e){return t+Br(Xr()*(e-t+1))}function wi(t,e){var r="";if(!t||e<1||e>D)return r;do{e%2&&(r+=t),(e=Br(e/2))&&(t+=t)}while(e);return r}function ki(t,e){return io(Qa(t,e,Ll),t+"")}function Ai(t){return An(pl(t))}function Ti(t,e){var r=pl(t);return so(r,Dn(e,0,r.length))}function Mi(t,e,r,n){if(!Es(t))return t;for(var i=-1,o=(e=Wi(e,t)).length,s=o-1,l=t;null!=l&&++ia?0:a+e),(r=r>a?a:r)<0&&(r+=a),a=e>r?0:r-e>>>0,e>>>=0;for(var o=n(a);++i>>1,o=t[a];null!==o&&!zs(o)&&(r?o<=e:o=o){var c=e?null:wa(t);if(c)return Sr(c);s=!1,i=yr,u=new _n}else u=e?[]:l;t:for(;++n=n?t:Li(t,e,r)}var Zi=Dr||function(t){return Pe.clearTimeout(t)};function $i(t,e){if(e)return t.slice();var r=t.length,n=Se?Se(r):new t.constructor(r);return t.copy(n),n}function Ji(t){var e=new t.constructor(t.byteLength);return new we(e).set(new we(t)),e}function Ki(t,e){var r=e?Ji(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Qi(t,e){if(t!==e){var r=t!==a,n=null===t,i=t==t,o=zs(t),s=e!==a,l=null===e,u=e==e,c=zs(e);if(!l&&!c&&!o&&t>e||o&&s&&u&&!l&&!c||n&&s&&u||!r&&u||!i)return 1;if(!n&&!o&&!c&&t1?r[i-1]:a,s=i>2?r[2]:a;for(o=t.length>3&&"function"==typeof o?(i--,o):a,s&&Wa(r[0],r[1],s)&&(o=i<3?a:o,i=1),e=ee(e);++n-1?i[o?e[s]:s]:a}}function ha(t){return Ca(function(e){var r=e.length,n=r,i=gn.prototype.thru;for(t&&e.reverse();n--;){var o=e[n];if("function"!=typeof o)throw new ie(l);if(i&&!s&&"wrapper"==Pa(o))var s=new gn([],!0)}for(n=s?n:r;++n1&&b.reverse(),h&&cl))return!1;var c=o.get(t);if(c&&o.get(e))return c==e;var f=-1,h=!0,p=r&g?new _n:a;for(o.set(t,e),o.set(e,t);++f-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(Ft,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return Ye(j,function(r){var n="_."+r[0];e&r[1]&&!Je(t,n)&&t.push(n)}),t.sort()}(function(t){var e=t.match(Bt);return e?e[1].split(Nt):[]}(n),r)))}function oo(t){var e=0,r=0;return function(){var n=Wr(),i=L-(n-r);if(r=n,i>0){if(++e>=C)return arguments[0]}else e=0;return t.apply(a,arguments)}}function so(t,e){var r=-1,n=t.length,i=n-1;for(e=e===a?n:e;++r1?t[e-1]:a;return r="function"==typeof r?(t.pop(),r):a,Io(t,r)});function No(t){var e=pn(t);return e.__chain__=!0,e}function jo(t,e){return e(t)}var Vo=Ca(function(t){var e=t.length,r=e?t[0]:0,n=this.__wrapped__,i=function(e){return Pn(e,t)};return!(e>1||this.__actions__.length)&&n instanceof mn&&Ga(r)?((n=n.slice(r,+r+(e?1:0))).__actions__.push({func:jo,args:[i],thisArg:a}),new gn(n,this.__chain__).thru(function(t){return e&&!t.length&&t.push(a),t})):this.thru(i)});var Uo=ia(function(t,e,r){ce.call(t,r)?++t[r]:In(t,r,1)});var Ho=fa(go),qo=fa(mo);function Go(t,e){return(ms(t)?Ye:Nn)(t,za(e,3))}function Wo(t,e){return(ms(t)?Xe:jn)(t,za(e,3))}var Yo=ia(function(t,e,r){ce.call(t,r)?t[r].push(e):In(t,r,[e])});var Xo=ki(function(t,e,r){var i=-1,a="function"==typeof e,o=xs(t)?n(t.length):[];return Nn(t,function(t){o[++i]=a?Ge(e,t,r):ni(t,e,r)}),o}),Zo=ia(function(t,e,r){In(t,r,e)});function $o(t,e){return(ms(t)?Qe:hi)(t,za(e,3))}var Jo=ia(function(t,e,r){t[r?0:1].push(e)},function(){return[[],[]]});var Ko=ki(function(t,e){if(null==t)return[];var r=e.length;return r>1&&Wa(t,e[0],e[1])?e=[]:r>2&&Wa(e[0],e[1],e[2])&&(e=[e[0]]),mi(t,qn(e,1),[])}),Qo=zr||function(){return Pe.Date.now()};function ts(t,e,r){return e=r?a:e,e=t&&null==e?t.length:e,Aa(t,A,a,a,a,a,e)}function es(t,e){var r;if("function"!=typeof e)throw new ie(l);return t=Vs(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=a),r}}var rs=ki(function(t,e,r){var n=m;if(r.length){var i=Er(r,Da(rs));n|=w}return Aa(t,n,e,r,i)}),ns=ki(function(t,e,r){var n=m|y;if(r.length){var i=Er(r,Da(ns));n|=w}return Aa(e,n,t,r,i)});function is(t,e,r){var n,i,o,s,u,c,f=0,h=!1,p=!1,d=!0;if("function"!=typeof t)throw new ie(l);function v(e){var r=n,o=i;return n=i=a,f=e,s=t.apply(o,r)}function g(t){var r=t-c;return c===a||r>=e||r<0||p&&t-f>=o}function m(){var t=Qo();if(g(t))return y(t);u=no(m,function(t){var r=e-(t-c);return p?Gr(r,o-(t-f)):r}(t))}function y(t){return u=a,d&&n?v(t):(n=i=a,s)}function x(){var t=Qo(),r=g(t);if(n=arguments,i=this,c=t,r){if(u===a)return function(t){return f=t,u=no(m,e),h?v(t):s}(c);if(p)return Zi(u),u=no(m,e),v(c)}return u===a&&(u=no(m,e)),s}return e=Hs(e)||0,Es(r)&&(h=!!r.leading,o=(p="maxWait"in r)?qr(Hs(r.maxWait)||0,e):o,d="trailing"in r?!!r.trailing:d),x.cancel=function(){u!==a&&Zi(u),f=0,n=c=i=u=a},x.flush=function(){return u===a?s:y(Qo())},x}var as=ki(function(t,e){return Fn(t,1,e)}),os=ki(function(t,e,r){return Fn(t,Hs(e)||0,r)});function ss(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new ie(l);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=t.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(ss.Cache||bn),r}function ls(t){if("function"!=typeof t)throw new ie(l);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}ss.Cache=bn;var us=Yi(function(t,e){var r=(e=1==e.length&&ms(e[0])?Qe(e[0],gr(za())):Qe(qn(e,1),gr(za()))).length;return ki(function(n){for(var i=-1,a=Gr(n.length,r);++i=e}),gs=ii(function(){return arguments}())?ii:function(t){return Ss(t)&&ce.call(t,"callee")&&!De.call(t,"callee")},ms=n.isArray,ys=Ne?gr(Ne):function(t){return Ss(t)&&Kn(t)==lt};function xs(t){return null!=t&&Ms(t.length)&&!As(t)}function bs(t){return Ss(t)&&xs(t)}var _s=jr||Hl,ws=je?gr(je):function(t){return Ss(t)&&Kn(t)==G};function ks(t){if(!Ss(t))return!1;var e=Kn(t);return e==Y||e==W||"string"==typeof t.message&&"string"==typeof t.name&&!Os(t)}function As(t){if(!Es(t))return!1;var e=Kn(t);return e==X||e==Z||e==H||e==tt}function Ts(t){return"number"==typeof t&&t==Vs(t)}function Ms(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=D}function Es(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ss(t){return null!=t&&"object"==typeof t}var Cs=Ve?gr(Ve):function(t){return Ss(t)&&Va(t)==$};function Ls(t){return"number"==typeof t||Ss(t)&&Kn(t)==J}function Os(t){if(!Ss(t)||Kn(t)!=Q)return!1;var e=Oe(t);if(null===e)return!0;var r=ce.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&ue.call(r)==de}var Is=Ue?gr(Ue):function(t){return Ss(t)&&Kn(t)==et};var Ps=He?gr(He):function(t){return Ss(t)&&Va(t)==rt};function Ds(t){return"string"==typeof t||!ms(t)&&Ss(t)&&Kn(t)==nt}function zs(t){return"symbol"==typeof t||Ss(t)&&Kn(t)==it}var Rs=qe?gr(qe):function(t){return Ss(t)&&Ms(t.length)&&!!Me[Kn(t)]};var Fs=xa(fi),Bs=xa(function(t,e){return t<=e});function Ns(t){if(!t)return[];if(xs(t))return Ds(t)?Or(t):ra(t);if(Be&&t[Be])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[Be]());var e=Va(t);return(e==$?Tr:e==rt?Sr:pl)(t)}function js(t){return t?(t=Hs(t))===P||t===-P?(t<0?-1:1)*z:t==t?t:0:0===t?t:0}function Vs(t){var e=js(t),r=e%1;return e==e?r?e-r:e:0}function Us(t){return t?Dn(Vs(t),0,F):0}function Hs(t){if("number"==typeof t)return t;if(zs(t))return R;if(Es(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Es(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Dt,"");var r=Gt.test(t);return r||Yt.test(t)?Le(t.slice(2),r?2:8):qt.test(t)?R:+t}function qs(t){return na(t,al(t))}function Gs(t){return null==t?"":Ri(t)}var Ws=aa(function(t,e){if($a(e)||xs(e))na(e,il(e),t);else for(var r in e)ce.call(e,r)&&Sn(t,r,e[r])}),Ys=aa(function(t,e){na(e,al(e),t)}),Xs=aa(function(t,e,r,n){na(e,al(e),t,n)}),Zs=aa(function(t,e,r,n){na(e,il(e),t,n)}),$s=Ca(Pn);var Js=ki(function(t,e){t=ee(t);var r=-1,n=e.length,i=n>2?e[2]:a;for(i&&Wa(e[0],e[1],i)&&(n=1);++r1),e}),na(t,Oa(t),r),n&&(r=zn(r,h|p|d,Ea));for(var i=e.length;i--;)Bi(r,e[i]);return r});var ul=Ca(function(t,e){return null==t?{}:function(t,e){return yi(t,e,function(e,r){return tl(t,r)})}(t,e)});function cl(t,e){if(null==t)return{};var r=Qe(Oa(t),function(t){return[t]});return e=za(e),yi(t,r,function(t,r){return e(t,r[0])})}var fl=ka(il),hl=ka(al);function pl(t){return null==t?[]:mr(t,il(t))}var dl=ua(function(t,e,r){return e=e.toLowerCase(),t+(r?vl(e):e)});function vl(t){return kl(Gs(t).toLowerCase())}function gl(t){return(t=Gs(t))&&t.replace(Zt,_r).replace(xe,"")}var ml=ua(function(t,e,r){return t+(r?"-":"")+e.toLowerCase()}),yl=ua(function(t,e,r){return t+(r?" ":"")+e.toLowerCase()}),xl=la("toLowerCase");var bl=ua(function(t,e,r){return t+(r?"_":"")+e.toLowerCase()});var _l=ua(function(t,e,r){return t+(r?" ":"")+kl(e)});var wl=ua(function(t,e,r){return t+(r?" ":"")+e.toUpperCase()}),kl=la("toUpperCase");function Al(t,e,r){return t=Gs(t),(e=r?a:e)===a?function(t){return ke.test(t)}(t)?function(t){return t.match(_e)||[]}(t):function(t){return t.match(jt)||[]}(t):t.match(e)||[]}var Tl=ki(function(t,e){try{return Ge(t,a,e)}catch(t){return ks(t)?t:new Kt(t)}}),Ml=Ca(function(t,e){return Ye(e,function(e){e=uo(e),In(t,e,rs(t[e],t))}),t});function El(t){return function(){return t}}var Sl=ha(),Cl=ha(!0);function Ll(t){return t}function Ol(t){return li("function"==typeof t?t:zn(t,h))}var Il=ki(function(t,e){return function(r){return ni(r,t,e)}}),Pl=ki(function(t,e){return function(r){return ni(t,r,e)}});function Dl(t,e,r){var n=il(e),i=Zn(e,n);null!=r||Es(e)&&(i.length||!n.length)||(r=e,e=t,t=this,i=Zn(e,il(e)));var a=!(Es(r)&&"chain"in r&&!r.chain),o=As(t);return Ye(i,function(r){var n=e[r];t[r]=n,o&&(t.prototype[r]=function(){var e=this.__chain__;if(a||e){var r=t(this.__wrapped__);return(r.__actions__=ra(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,tr([this.value()],arguments))})}),t}function zl(){}var Rl=ga(Qe),Fl=ga(Ze),Bl=ga(nr);function Nl(t){return Ya(t)?fr(uo(t)):function(t){return function(e){return $n(e,t)}}(t)}var jl=ya(),Vl=ya(!0);function Ul(){return[]}function Hl(){return!1}var ql=va(function(t,e){return t+e},0),Gl=_a("ceil"),Wl=va(function(t,e){return t/e},1),Yl=_a("floor");var Xl,Zl=va(function(t,e){return t*e},1),$l=_a("round"),Jl=va(function(t,e){return t-e},0);return pn.after=function(t,e){if("function"!=typeof e)throw new ie(l);return t=Vs(t),function(){if(--t<1)return e.apply(this,arguments)}},pn.ary=ts,pn.assign=Ws,pn.assignIn=Ys,pn.assignInWith=Xs,pn.assignWith=Zs,pn.at=$s,pn.before=es,pn.bind=rs,pn.bindAll=Ml,pn.bindKey=ns,pn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return ms(t)?t:[t]},pn.chain=No,pn.chunk=function(t,e,r){e=(r?Wa(t,e,r):e===a)?1:qr(Vs(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,s=0,l=n(Fr(i/e));oi?0:i+r),(n=n===a||n>i?i:Vs(n))<0&&(n+=i),n=r>n?0:Us(n);r>>0)?(t=Gs(t))&&("string"==typeof e||null!=e&&!Is(e))&&!(e=Ri(e))&&Ar(t)?Xi(Or(t),0,r):t.split(e,r):[]},pn.spread=function(t,e){if("function"!=typeof t)throw new ie(l);return e=null==e?0:qr(Vs(e),0),ki(function(r){var n=r[e],i=Xi(r,0,e);return n&&tr(i,n),Ge(t,this,i)})},pn.tail=function(t){var e=null==t?0:t.length;return e?Li(t,1,e):[]},pn.take=function(t,e,r){return t&&t.length?Li(t,0,(e=r||e===a?1:Vs(e))<0?0:e):[]},pn.takeRight=function(t,e,r){var n=null==t?0:t.length;return n?Li(t,(e=n-(e=r||e===a?1:Vs(e)))<0?0:e,n):[]},pn.takeRightWhile=function(t,e){return t&&t.length?ji(t,za(e,3),!1,!0):[]},pn.takeWhile=function(t,e){return t&&t.length?ji(t,za(e,3)):[]},pn.tap=function(t,e){return e(t),t},pn.throttle=function(t,e,r){var n=!0,i=!0;if("function"!=typeof t)throw new ie(l);return Es(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),is(t,e,{leading:n,maxWait:e,trailing:i})},pn.thru=jo,pn.toArray=Ns,pn.toPairs=fl,pn.toPairsIn=hl,pn.toPath=function(t){return ms(t)?Qe(t,uo):zs(t)?[t]:ra(lo(Gs(t)))},pn.toPlainObject=qs,pn.transform=function(t,e,r){var n=ms(t),i=n||_s(t)||Rs(t);if(e=za(e,4),null==r){var a=t&&t.constructor;r=i?n?new a:[]:Es(t)&&As(a)?dn(Oe(t)):{}}return(i?Ye:Yn)(t,function(t,n,i){return e(r,t,n,i)}),r},pn.unary=function(t){return ts(t,1)},pn.union=So,pn.unionBy=Co,pn.unionWith=Lo,pn.uniq=function(t){return t&&t.length?Fi(t):[]},pn.uniqBy=function(t,e){return t&&t.length?Fi(t,za(e,2)):[]},pn.uniqWith=function(t,e){return e="function"==typeof e?e:a,t&&t.length?Fi(t,a,e):[]},pn.unset=function(t,e){return null==t||Bi(t,e)},pn.unzip=Oo,pn.unzipWith=Io,pn.update=function(t,e,r){return null==t?t:Ni(t,e,Gi(r))},pn.updateWith=function(t,e,r,n){return n="function"==typeof n?n:a,null==t?t:Ni(t,e,Gi(r),n)},pn.values=pl,pn.valuesIn=function(t){return null==t?[]:mr(t,al(t))},pn.without=Po,pn.words=Al,pn.wrap=function(t,e){return cs(Gi(e),t)},pn.xor=Do,pn.xorBy=zo,pn.xorWith=Ro,pn.zip=Fo,pn.zipObject=function(t,e){return Hi(t||[],e||[],Sn)},pn.zipObjectDeep=function(t,e){return Hi(t||[],e||[],Mi)},pn.zipWith=Bo,pn.entries=fl,pn.entriesIn=hl,pn.extend=Ys,pn.extendWith=Xs,Dl(pn,pn),pn.add=ql,pn.attempt=Tl,pn.camelCase=dl,pn.capitalize=vl,pn.ceil=Gl,pn.clamp=function(t,e,r){return r===a&&(r=e,e=a),r!==a&&(r=(r=Hs(r))==r?r:0),e!==a&&(e=(e=Hs(e))==e?e:0),Dn(Hs(t),e,r)},pn.clone=function(t){return zn(t,d)},pn.cloneDeep=function(t){return zn(t,h|d)},pn.cloneDeepWith=function(t,e){return zn(t,h|d,e="function"==typeof e?e:a)},pn.cloneWith=function(t,e){return zn(t,d,e="function"==typeof e?e:a)},pn.conformsTo=function(t,e){return null==e||Rn(t,e,il(e))},pn.deburr=gl,pn.defaultTo=function(t,e){return null==t||t!=t?e:t},pn.divide=Wl,pn.endsWith=function(t,e,r){t=Gs(t),e=Ri(e);var n=t.length,i=r=r===a?n:Dn(Vs(r),0,n);return(r-=e.length)>=0&&t.slice(r,i)==e},pn.eq=ps,pn.escape=function(t){return(t=Gs(t))&&Tt.test(t)?t.replace(kt,wr):t},pn.escapeRegExp=function(t){return(t=Gs(t))&&Pt.test(t)?t.replace(It,"\\$&"):t},pn.every=function(t,e,r){var n=ms(t)?Ze:Vn;return r&&Wa(t,e,r)&&(e=a),n(t,za(e,3))},pn.find=Ho,pn.findIndex=go,pn.findKey=function(t,e){return ar(t,za(e,3),Yn)},pn.findLast=qo,pn.findLastIndex=mo,pn.findLastKey=function(t,e){return ar(t,za(e,3),Xn)},pn.floor=Yl,pn.forEach=Go,pn.forEachRight=Wo,pn.forIn=function(t,e){return null==t?t:Gn(t,za(e,3),al)},pn.forInRight=function(t,e){return null==t?t:Wn(t,za(e,3),al)},pn.forOwn=function(t,e){return t&&Yn(t,za(e,3))},pn.forOwnRight=function(t,e){return t&&Xn(t,za(e,3))},pn.get=Qs,pn.gt=ds,pn.gte=vs,pn.has=function(t,e){return null!=t&&Ua(t,e,ti)},pn.hasIn=tl,pn.head=xo,pn.identity=Ll,pn.includes=function(t,e,r,n){t=xs(t)?t:pl(t),r=r&&!n?Vs(r):0;var i=t.length;return r<0&&(r=qr(i+r,0)),Ds(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&sr(t,e,r)>-1},pn.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:Vs(r);return i<0&&(i=qr(n+i,0)),sr(t,e,i)},pn.inRange=function(t,e,r){return e=js(e),r===a?(r=e,e=0):r=js(r),function(t,e,r){return t>=Gr(e,r)&&t=-D&&t<=D},pn.isSet=Ps,pn.isString=Ds,pn.isSymbol=zs,pn.isTypedArray=Rs,pn.isUndefined=function(t){return t===a},pn.isWeakMap=function(t){return Ss(t)&&Va(t)==ot},pn.isWeakSet=function(t){return Ss(t)&&Kn(t)==st},pn.join=function(t,e){return null==t?"":Ur.call(t,e)},pn.kebabCase=ml,pn.last=ko,pn.lastIndexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=n;return r!==a&&(i=(i=Vs(r))<0?qr(n+i,0):Gr(i,n-1)),e==e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,i):or(t,ur,i,!0)},pn.lowerCase=yl,pn.lowerFirst=xl,pn.lt=Fs,pn.lte=Bs,pn.max=function(t){return t&&t.length?Un(t,Ll,Qn):a},pn.maxBy=function(t,e){return t&&t.length?Un(t,za(e,2),Qn):a},pn.mean=function(t){return cr(t,Ll)},pn.meanBy=function(t,e){return cr(t,za(e,2))},pn.min=function(t){return t&&t.length?Un(t,Ll,fi):a},pn.minBy=function(t,e){return t&&t.length?Un(t,za(e,2),fi):a},pn.stubArray=Ul,pn.stubFalse=Hl,pn.stubObject=function(){return{}},pn.stubString=function(){return""},pn.stubTrue=function(){return!0},pn.multiply=Zl,pn.nth=function(t,e){return t&&t.length?gi(t,Vs(e)):a},pn.noConflict=function(){return Pe._===this&&(Pe._=ve),this},pn.noop=zl,pn.now=Qo,pn.pad=function(t,e,r){t=Gs(t);var n=(e=Vs(e))?Lr(t):0;if(!e||n>=e)return t;var i=(e-n)/2;return ma(Br(i),r)+t+ma(Fr(i),r)},pn.padEnd=function(t,e,r){t=Gs(t);var n=(e=Vs(e))?Lr(t):0;return e&&ne){var n=t;t=e,e=n}if(r||t%1||e%1){var i=Xr();return Gr(t+i*(e-t+Ce("1e-"+((i+"").length-1))),e)}return _i(t,e)},pn.reduce=function(t,e,r){var n=ms(t)?er:pr,i=arguments.length<3;return n(t,za(e,4),r,i,Nn)},pn.reduceRight=function(t,e,r){var n=ms(t)?rr:pr,i=arguments.length<3;return n(t,za(e,4),r,i,jn)},pn.repeat=function(t,e,r){return e=(r?Wa(t,e,r):e===a)?1:Vs(e),wi(Gs(t),e)},pn.replace=function(){var t=arguments,e=Gs(t[0]);return t.length<3?e:e.replace(t[1],t[2])},pn.result=function(t,e,r){var n=-1,i=(e=Wi(e,t)).length;for(i||(i=1,t=a);++nD)return[];var r=F,n=Gr(t,F);e=za(e),t-=F;for(var i=vr(n,e);++r=o)return t;var l=r-Lr(n);if(l<1)return n;var u=s?Xi(s,0,l).join(""):t.slice(0,l);if(i===a)return u+n;if(s&&(l+=u.length-l),Is(i)){if(t.slice(l).search(i)){var c,f=u;for(i.global||(i=re(i.source,Gs(Ht.exec(i))+"g")),i.lastIndex=0;c=i.exec(f);)var h=c.index;u=u.slice(0,h===a?l:h)}}else if(t.indexOf(Ri(i),l)!=l){var p=u.lastIndexOf(i);p>-1&&(u=u.slice(0,p))}return u+n},pn.unescape=function(t){return(t=Gs(t))&&At.test(t)?t.replace(wt,Ir):t},pn.uniqueId=function(t){var e=++fe;return Gs(t)+e},pn.upperCase=wl,pn.upperFirst=kl,pn.each=Go,pn.eachRight=Wo,pn.first=xo,Dl(pn,(Xl={},Yn(pn,function(t,e){ce.call(pn.prototype,e)||(Xl[e]=t)}),Xl),{chain:!1}),pn.VERSION="4.17.15",Ye(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){pn[t].placeholder=pn}),Ye(["drop","take"],function(t,e){mn.prototype[t]=function(r){r=r===a?1:qr(Vs(r),0);var n=this.__filtered__&&!e?new mn(this):this.clone();return n.__filtered__?n.__takeCount__=Gr(r,n.__takeCount__):n.__views__.push({size:Gr(r,F),type:t+(n.__dir__<0?"Right":"")}),n},mn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),Ye(["filter","map","takeWhile"],function(t,e){var r=e+1,n=r==O||3==r;mn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:za(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}}),Ye(["head","last"],function(t,e){var r="take"+(e?"Right":"");mn.prototype[t]=function(){return this[r](1).value()[0]}}),Ye(["initial","tail"],function(t,e){var r="drop"+(e?"":"Right");mn.prototype[t]=function(){return this.__filtered__?new mn(this):this[r](1)}}),mn.prototype.compact=function(){return this.filter(Ll)},mn.prototype.find=function(t){return this.filter(t).head()},mn.prototype.findLast=function(t){return this.reverse().find(t)},mn.prototype.invokeMap=ki(function(t,e){return"function"==typeof t?new mn(this):this.map(function(r){return ni(r,t,e)})}),mn.prototype.reject=function(t){return this.filter(ls(za(t)))},mn.prototype.slice=function(t,e){t=Vs(t);var r=this;return r.__filtered__&&(t>0||e<0)?new mn(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==a&&(r=(e=Vs(e))<0?r.dropRight(-e):r.take(e-t)),r)},mn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},mn.prototype.toArray=function(){return this.take(F)},Yn(mn.prototype,function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),i=pn[n?"take"+("last"==e?"Right":""):e],o=n||/^find/.test(e);i&&(pn.prototype[e]=function(){var e=this.__wrapped__,s=n?[1]:arguments,l=e instanceof mn,u=s[0],c=l||ms(e),f=function(t){var e=i.apply(pn,tr([t],s));return n&&h?e[0]:e};c&&r&&"function"==typeof u&&1!=u.length&&(l=c=!1);var h=this.__chain__,p=!!this.__actions__.length,d=o&&!h,v=l&&!p;if(!o&&c){e=v?e:new mn(this);var g=t.apply(e,s);return g.__actions__.push({func:jo,args:[f],thisArg:a}),new gn(g,h)}return d&&v?t.apply(this,s):(g=this.thru(f),d?n?g.value()[0]:g.value():g)})}),Ye(["pop","push","shift","sort","splice","unshift"],function(t){var e=ae[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);pn.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(ms(i)?i:[],t)}return this[r](function(r){return e.apply(ms(r)?r:[],t)})}}),Yn(mn.prototype,function(t,e){var r=pn[e];if(r){var n=r.name+"";ce.call(nn,n)||(nn[n]=[]),nn[n].push({name:e,func:r})}}),nn[pa(a,y).name]=[{name:"wrapper",func:a}],mn.prototype.clone=function(){var t=new mn(this.__wrapped__);return t.__actions__=ra(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=ra(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=ra(this.__views__),t},mn.prototype.reverse=function(){if(this.__filtered__){var t=new mn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},mn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=ms(t),n=e<0,i=r?t.length:0,a=function(t,e,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:t,value:t?a:this.__values__[this.__index__++]}},pn.prototype.plant=function(t){for(var e,r=this;r instanceof vn;){var n=fo(r);n.__index__=0,n.__values__=a,e?i.__wrapped__=n:e=n;var i=n;r=r.__wrapped__}return i.__wrapped__=t,e},pn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof mn){var e=t;return this.__actions__.length&&(e=new mn(this)),(e=e.reverse()).__actions__.push({func:jo,args:[Eo],thisArg:a}),new gn(e,this.__chain__)}return this.thru(Eo)},pn.prototype.toJSON=pn.prototype.valueOf=pn.prototype.value=function(){return Vi(this.__wrapped__,this.__actions__)},pn.prototype.first=pn.prototype.head,Be&&(pn.prototype[Be]=function(){return this}),pn}();Pe._=Pr,(i=function(){return Pr}.call(e,r,e,n))===a||(n.exports=i)}).call(this)}).call(this,r(51),r(87)(t))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},,,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},i=r(70),a={};e.default=a,a.read=function(t,e){var r,n=(r=this,function(t,n,i){return a._onRetrieval(t,i,e,r)});return void 0===e?new Promise(function(r,a){e=function(t,e){t?a(t):r(e)},i(t,n)}):i(t,n)},a._onRetrieval=function(t,e,r,n){var i=void 0;return void 0!==t&&(i=n.parse(e)),r.call(n,t,i)},a.extend=function(t,e){return extend(a,t,e)},a.mixin=function(t){return"object"!==(void 0===t?"undefined":n(t))&&(t=t.prototype),["read"].forEach(function(e){t[e]=a[e]},this),t}},,,,,,,,,,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(r(88)),i=a(r(89));function a(t){return t&&t.__esModule?t:{default:t}}var o=(0,n.default)(i.default);e.default=o,t.exports=e.default},function(t,e,r){"use strict";var n=r(97);t.exports=Function.prototype.bind||n},function(t,e,r){"use strict";var n=Function.prototype.toString,i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},o=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;if(s)return function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}}(t);if(a(t))return!1;var e=o.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={};e.default=n,n.getMeta=function(t){var e,r,n=!1,i=!1,a={},o={},s=t.split(" ");if(s.length>=1?(n=s.shift(),i=s.join(" ")):n=t,n){var l=n.split("|");for(e=l.pop(),o.en=e;0!=l.length;){var u=l.shift(),c=l.shift();a[u]=c}}else e=n;if(i){var f=i.split("=");if(f.length>1){var h,p;f.length;f.forEach(function(t){var e,n=(t=t.trim()).split(" ");if(n.length>1?(p=n.pop(),e=n.join(" ")):e=t,h){var i=h.toLowerCase();o[i]=e}else r=e;h=p})}else r=f.shift()}var d={name:e,ids:a,details:o};return r&&(d.desc=r),d};var i={sp:{link:"http://www.uniprot.org/%s",name:"Uniprot"},tr:{link:"http://www.uniprot.org/%s",name:"Trembl"},gb:{link:"http://www.ncbi.nlm.nih.gov/nuccore/%s",name:"Genbank"},pdb:{link:"http://www.rcsb.org/pdb/explore/explore.do?structureId=%s",name:"PDB"}};n.buildLinks=function(t){var e={};return t=t||{},Object.keys(t).forEach(function(r){if(r in i){var n=i[r],a=n.link.replace("%s",t[r]);e[n.name]=a}}),e},n.contains=function(t,e){return-1!=="".indexOf.call(t,e,0)},n.splitNChars=function(t,e){var r,n;e=e||80;var i=[];for(r=0,n=t.length-1;r<=n;r+=e)i.push(t.substr(r,e));return i},n.reverse=function(t){return t.split("").reverse().join("")},n.complement=function(t){var e=t+"",r=[[/g/g,"0"],[/c/g,"1"],[/0/g,"c"],[/1/g,"g"],[/G/g,"0"],[/C/g,"1"],[/0/g,"C"],[/1/g,"G"],[/a/g,"0"],[/t/g,"1"],[/0/g,"t"],[/1/g,"a"],[/A/g,"0"],[/T/g,"1"],[/0/g,"T"],[/1/g,"A"]];for(var n in r)e=e.replace(r[n][0],r[n][1]);return e},n.reverseComplement=function(t){return n.reverse(n.complement(t))},n.model=function(t,e,r){this.seq=t,this.name=e,this.id=r,this.ids={}}},,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,r):{};n.get||n.set?Object.defineProperty(e,r,n):e[r]=t[r]}return e.default=t,e}(r(1)),i=f(r(0)),a=f(r(50)),o=f(r(64)),s=r(90),l=r(75),u=r(76),c=r(120);function f(t){return t&&t.__esModule?t:{default:t}}function h(t){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(){return(p=Object.assign||function(t){for(var e=1;eJ&&(J=e):e=(0,l.getConservation)(t),e}),Z="entropy"===x?Z.map(function(t){return 1-t/J}):Z.map(function(t){return t/P})),_&&($=I.map(function(t){return a.default.countBy(t)["-"]/P})),b)for(var K=0;KBar weights",titlefont:{size:12},showgrid:!1,zeroline:!1,domain:[.75,1]}):3===h?(S.yaxis.domain=[0,.64],S.yaxis2={title:"Conservation",titlefont:{size:12},showgrid:!1,zeroline:!1,domain:[.65,.89]},S.yaxis3={title:"Gap",titlefont:{size:12},showgrid:!1,zeroline:!1,domain:[.9,1]}):S.yaxis.domain=[0,1],"heatmap"===m?(S.xaxis.rangeslider={autorange:!0},S.xaxis.tick0=x,S.xaxis.dtick=b,S.margin={t:20,r:20,b:20}):"slider"===m?S.sliders=[{currentvalue:{prefix:"Position ",suffix:""},steps:o}]:(S.xaxis.tick0=x,S.xaxis.dtick=b,S.margin={t:20,r:20,b:20}),{layout:S,width:e,height:n}}},{key:"componentDidMount",value:function(){var t=this.resetWindowing(this.props),e=t.xStart,r=t.xEnd;this.setState({xStart:e,xEnd:r})}},{key:"componentDidUpdate",value:function(t,e){if(this.props.data!==t.data){var r=this.resetWindowing(this.props),n=r.xStart,i=r.xEnd;this.setState({xStart:n,xEnd:i})}}},{key:"render",value:function(){var t=this.getData(),e=t.data,r=t.length,i=t.count,a=t.labels,s=t.tick,l=t.plotCount,u=this.getLayout({length:r,count:i,labels:a,tick:s,plotCount:l}),c=u.layout,f={style:{width:u.width,height:u.height},useResizeHandler:!0};return n.default.createElement("div",null,n.default.createElement(o.default,p({data:e,layout:c,onClick:this.handleChange,onHover:this.handleChange,onRelayout:this.handleChange},f)))}}])&&v(r.prototype,i),f&&v(r,f),e}();e.default=x,x.propTypes={data:i.default.string,extension:i.default.string,colorscale:i.default.oneOfType([i.default.string,i.default.object]),opacity:i.default.oneOfType([i.default.number,i.default.string]),textcolor:i.default.string,textsize:i.default.oneOfType([i.default.number,i.default.string]),showlabel:i.default.bool,showid:i.default.bool,showconservation:i.default.bool,conservationcolor:i.default.string,conservationcolorscale:i.default.oneOfType([i.default.string,i.default.array]),conservationopacity:i.default.oneOfType([i.default.number,i.default.string]),conservationmethod:i.default.oneOf(["conservation","entropy"]),correctgap:i.default.bool,showgap:i.default.bool,gapcolor:i.default.string,gapcolorscale:i.default.oneOfType([i.default.string,i.default.array]),gapopacity:i.default.oneOfType([i.default.number,i.default.string]),groupbars:i.default.bool,showconsensus:i.default.bool,tilewidth:i.default.number,tileheight:i.default.number,overview:i.default.oneOf(["heatmap","slider","none"]),numtiles:i.default.number,scrollskip:i.default.number,tickstart:i.default.oneOfType([i.default.number,i.default.string]),ticksteps:i.default.oneOfType([i.default.number,i.default.string]),width:i.default.oneOfType([i.default.number,i.default.string]),height:i.default.oneOfType([i.default.number,i.default.string])},x.defaultProps={extension:"fasta",colorscale:"clustal2",opacity:null,textcolor:null,textsize:10,showlabel:!0,showid:!0,showconservation:!0,conservationcolor:null,conservationcolorscale:"Viridis",conservationopacity:null,conservationmethod:"entropy",correctgap:!0,showgap:!0,gapcolor:"grey",gapcolorscale:null,gapopacity:null,groupbars:!1,showconsensus:!0,tilewidth:16,tileheight:16,numtiles:null,overview:"heatmap",scrollskip:10,tickstart:null,ticksteps:null,width:null,height:900}},function(t,e,r){"use strict";var n=r(93),i=r(94),a=r(95),o=r(111);function s(t,e,r){var n=t;return i(e)?(r=e,"string"==typeof t&&(n={uri:t})):n=o(e,{uri:t}),n.callback=r,n}function l(t,e,r){return u(e=s(t,e,r))}function u(t){if(void 0===t.callback)throw new Error("callback argument missing");var e=!1,r=function(r,n,i){e||(e=!0,t.callback(r,n,i))};function n(t){return clearTimeout(c),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,r(t,m)}function i(){if(!s){var e;clearTimeout(c),e=t.useXDR&&void 0===u.status?200:1223===u.status?204:u.status;var n=m,i=null;return 0!==e?(n={body:function(){var t=void 0;if(t=u.response?u.response:u.responseText||function(t){try{if("document"===t.responseType)return t.responseXML;var e=t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;if(""===t.responseType&&!e)return t.responseXML}catch(t){}return null}(u),g)try{t=JSON.parse(t)}catch(t){}return t}(),statusCode:e,method:h,headers:{},url:f,rawRequest:u},u.getAllResponseHeaders&&(n.headers=a(u.getAllResponseHeaders()))):i=new Error("Internal XMLHttpRequest Error"),r(i,n,n.body)}}var o,s,u=t.xhr||null;u||(u=t.cors||t.useXDR?new l.XDomainRequest:new l.XMLHttpRequest);var c,f=u.url=t.uri||t.url,h=u.method=t.method||"GET",p=t.body||t.data,d=u.headers=t.headers||{},v=!!t.sync,g=!1,m={body:void 0,headers:{},statusCode:0,method:h,url:f,rawRequest:u};if("json"in t&&!1!==t.json&&(g=!0,d.accept||d.Accept||(d.Accept="application/json"),"GET"!==h&&"HEAD"!==h&&(d["content-type"]||d["Content-Type"]||(d["Content-Type"]="application/json"),p=JSON.stringify(!0===t.json?p:t.json))),u.onreadystatechange=function(){4===u.readyState&&setTimeout(i,0)},u.onload=i,u.onerror=n,u.onprogress=function(){},u.onabort=function(){s=!0},u.ontimeout=n,u.open(h,f,!v,t.username,t.password),v||(u.withCredentials=!!t.withCredentials),!v&&t.timeout>0&&(c=setTimeout(function(){if(!s){s=!0,u.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",n(t)}},t.timeout)),u.setRequestHeader)for(o in d)d.hasOwnProperty(o)&&u.setRequestHeader(o,d[o]);else if(t.headers&&!function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(u.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(u),u.send(p||null),u}t.exports=l,t.exports.default=l,l.XMLHttpRequest=n.XMLHttpRequest||function(){},l.XDomainRequest="withCredentials"in new l.XMLHttpRequest?l.XMLHttpRequest:n.XDomainRequest,function(t,e){for(var r=0;r2?arguments[2]:{},a=n(e);i&&(a=o.call(a,Object.getOwnPropertySymbols(e)));for(var s=0;s0&&(n=(r=t.split(" "))[0],i=r[1].replace(/"/g,""),e[n]=i)}),e}function i(t){var e=t.toString(16);return 1===e.length?"0"+e:e}function a(t,e,r){return 3===t.length?a(t[0],t[1],t[2]):"#"+i(t)+i(e)+i(r)}Object.defineProperty(e,"__esModule",{value:!0}),e.extractKeys=n,e.rgbToHex=a,e.default={extractKeys:n,rgbToHex:a}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getConsensus=e.getConservation=e.getEntropy=void 0;var n,i=(n=r(50))&&n.__esModule?n:{default:n};e.getEntropy=function(t){var e;e=i.default.isString(t)?t.split(""):t;var r={};return e.forEach(function(t){return r[t]?r[t]++:r[t]=1}),Object.keys(r).reduce(function(t,n){var i=r[n]/e.length;return t-i*Math.log(i)},0)};e.getConservation=function(t){var e;return e=i.default.isString(t)?t.split(""):t,(0,i.default)(e).countBy().entries().maxBy("[1]")[1]};e.getConsensus=function(t){return t.map(function(t){return(0,i.default)(t).countBy().entries().maxBy("[1]")[0]})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getVisualizations=e.getTicks=e.getHovertext=e.getWidth=e.SUBPLOT_RATIOS=void 0;var n,i=(n=r(50))&&n.__esModule?n:{default:n};e.SUBPLOT_RATIOS={1:1,2:.75,3:.65};e.getWidth=function(t){return i.default.isNumber(t)?t:t.includes("%")?parseFloat(t)/100*window.innerWidth:parseFloat(t)};e.getHovertext=function(t,e){for(var r=[],n=function(n){var i=[],a=0;t[n].forEach(function(t){a+=1;var r=["Name: ".concat(e[n].name),"Organism: ".concat(e[n].os?e[n].os:"N/A"),"ID: ".concat(e[n].id,"
"),"Position: (".concat(a,", ").concat(n,")"),"Letter: ".concat(t)].join("
");i.push(r)}),r.push(i)},a=0;a=0||(i[r]=t[r]);return i}(e,["children"]);if(delete n.in,delete n.mountOnEnter,delete n.unmountOnExit,delete n.appear,delete n.enter,delete n.exit,delete n.timeout,delete n.addEndListener,delete n.onEnter,delete n.onEntering,delete n.onEntered,delete n.onExit,delete n.onExiting,delete n.onExited,"function"==typeof r)return r(t,n);var a=i.default.Children.only(r);return i.default.cloneElement(a,n)},n}(i.default.Component);function p(){}h.contextTypes={transitionGroup:n.object},h.childContextTypes={transitionGroup:function(){}},h.propTypes={},h.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:p,onEntering:p,onEntered:p,onExit:p,onExiting:p,onExited:p},h.UNMOUNTED=0,h.EXITED=1,h.ENTERING=2,h.ENTERED=3,h.EXITING=4;var d=(0,o.polyfill)(h);e.default=d},function(t,e,r){"use strict";function n(){var t=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=t&&this.setState(t)}function i(t){this.setState(function(e){var r=this.constructor.getDerivedStateFromProps(t,e);return null!=r?r:null}.bind(this))}function a(t,e){try{var r=this.props,n=this.state;this.props=t,this.state=e,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(r,n)}finally{this.props=r,this.state=n}}function o(t){var e=t.prototype;if(!e||!e.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof t.getDerivedStateFromProps&&"function"!=typeof e.getSnapshotBeforeUpdate)return t;var r=null,o=null,s=null;if("function"==typeof e.componentWillMount?r="componentWillMount":"function"==typeof e.UNSAFE_componentWillMount&&(r="UNSAFE_componentWillMount"),"function"==typeof e.componentWillReceiveProps?o="componentWillReceiveProps":"function"==typeof e.UNSAFE_componentWillReceiveProps&&(o="UNSAFE_componentWillReceiveProps"),"function"==typeof e.componentWillUpdate?s="componentWillUpdate":"function"==typeof e.UNSAFE_componentWillUpdate&&(s="UNSAFE_componentWillUpdate"),null!==r||null!==o||null!==s){var l=t.displayName||t.name,u="function"==typeof t.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+l+" uses "+u+" but also contains the following legacy lifecycles:"+(null!==r?"\n "+r:"")+(null!==o?"\n "+o:"")+(null!==s?"\n "+s:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof t.getDerivedStateFromProps&&(e.componentWillMount=n,e.componentWillReceiveProps=i),"function"==typeof e.getSnapshotBeforeUpdate){if("function"!=typeof e.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");e.componentWillUpdate=a;var c=e.componentDidUpdate;e.componentDidUpdate=function(t,e,r){var n=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:r;c.call(this,t,e,n)}}return t}r.r(e),r.d(e,"polyfill",function(){return o}),n.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0,a.__suppressDeprecationWarning=!0},function(t,e,r){"use strict";e.__esModule=!0,e.classNamesShape=e.timeoutsShape=void 0;var n;(n=r(0))&&n.__esModule;e.timeoutsShape=null;e.classNamesShape=null},function(t,e,r){"use strict";e.__esModule=!0,e.default=void 0;var n=s(r(0)),i=s(r(1)),a=r(78),o=r(149);function s(t){return t&&t.__esModule?t:{default:t}}function l(){return(l=Object.assign||function(t){for(var e=1;e=0||(i[r]=t[r]);return i}(t,["component","childFactory"]),a=c(this.state.children).map(r);return delete n.appear,delete n.enter,delete n.exit,null===e?a:i.default.createElement(e,n,a)},n}(i.default.Component);f.childContextTypes={transitionGroup:n.default.object.isRequired},f.propTypes={},f.defaultProps={component:"div",childFactory:function(t){return t}};var h=(0,a.polyfill)(f);e.default=h,t.exports=e.default},,,,,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"AlignmentViewer",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"AlignmentChart",{enumerable:!0,get:function(){return i.default}});var n=a(r(86)),i=a(r(69));function a(t){return t&&t.__esModule?t:{default:t}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,r):{};n.get||n.set?Object.defineProperty(e,r,n):e[r]=t[r]}return e.default=t,e}(r(1)),i=u(r(0)),a=u(r(69)),o=r(135),s=r(76),l=r(150);function u(t){return t&&t.__esModule?t:{default:t}}function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(){return(f=Object.assign||function(t){for(var e=1;e=0||(i[r]=t[r]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function p(t,e){for(var r=0;r:not(.watermark)":"opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":"content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;","X [data-title]:after":"content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:white;","X .select-outline-2":"stroke:black;stroke-dasharray:2px 2px;",Y:"font-family:'Open Sans';position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;","Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var a in i){var o=a.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,i[a])}},{"../src/lib":703}],2:[function(t,e,r){"use strict";e.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},newplotlylogo:{name:"newplotlylogo",svg:"plotly-logomark"}}},{}],3:[function(t,e,r){"use strict";e.exports=t("../src/transforms/aggregate")},{"../src/transforms/aggregate":1210}],4:[function(t,e,r){"use strict";e.exports=t("../src/traces/bar")},{"../src/traces/bar":848}],5:[function(t,e,r){"use strict";e.exports=t("../src/traces/barpolar")},{"../src/traces/barpolar":860}],6:[function(t,e,r){"use strict";e.exports=t("../src/traces/box")},{"../src/traces/box":870}],7:[function(t,e,r){"use strict";e.exports=t("../src/components/calendars")},{"../src/components/calendars":578}],8:[function(t,e,r){"use strict";e.exports=t("../src/traces/candlestick")},{"../src/traces/candlestick":879}],9:[function(t,e,r){"use strict";e.exports=t("../src/traces/carpet")},{"../src/traces/carpet":898}],10:[function(t,e,r){"use strict";e.exports=t("../src/traces/choropleth")},{"../src/traces/choropleth":912}],11:[function(t,e,r){"use strict";e.exports=t("../src/traces/cone")},{"../src/traces/cone":920}],12:[function(t,e,r){"use strict";e.exports=t("../src/traces/contour")},{"../src/traces/contour":935}],13:[function(t,e,r){"use strict";e.exports=t("../src/traces/contourcarpet")},{"../src/traces/contourcarpet":946}],14:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":682}],15:[function(t,e,r){"use strict";e.exports=t("../src/transforms/filter")},{"../src/transforms/filter":1211}],16:[function(t,e,r){"use strict";e.exports=t("../src/traces/funnel")},{"../src/traces/funnel":958}],17:[function(t,e,r){"use strict";e.exports=t("../src/traces/funnelarea")},{"../src/traces/funnelarea":967}],18:[function(t,e,r){"use strict";e.exports=t("../src/transforms/groupby")},{"../src/transforms/groupby":1212}],19:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmap")},{"../src/traces/heatmap":980}],20:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmapgl")},{"../src/traces/heatmapgl":989}],21:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram")},{"../src/traces/histogram":1001}],22:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2d")},{"../src/traces/histogram2d":1007}],23:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2dcontour")},{"../src/traces/histogram2dcontour":1011}],24:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./bar"),t("./box"),t("./heatmap"),t("./histogram"),t("./histogram2d"),t("./histogram2dcontour"),t("./contour"),t("./scatterternary"),t("./violin"),t("./funnel"),t("./waterfall"),t("./pie"),t("./sunburst"),t("./funnelarea"),t("./scatter3d"),t("./surface"),t("./isosurface"),t("./volume"),t("./mesh3d"),t("./cone"),t("./streamtube"),t("./scattergeo"),t("./choropleth"),t("./scattergl"),t("./splom"),t("./pointcloud"),t("./heatmapgl"),t("./parcoords"),t("./parcats"),t("./scattermapbox"),t("./sankey"),t("./table"),t("./carpet"),t("./scattercarpet"),t("./contourcarpet"),t("./ohlc"),t("./candlestick"),t("./scatterpolar"),t("./scatterpolargl"),t("./barpolar")]),n.register([t("./aggregate"),t("./filter"),t("./groupby"),t("./sort")]),n.register([t("./calendars")]),e.exports=n},{"./aggregate":3,"./bar":4,"./barpolar":5,"./box":6,"./calendars":7,"./candlestick":8,"./carpet":9,"./choropleth":10,"./cone":11,"./contour":12,"./contourcarpet":13,"./core":14,"./filter":15,"./funnel":16,"./funnelarea":17,"./groupby":18,"./heatmap":19,"./heatmapgl":20,"./histogram":21,"./histogram2d":22,"./histogram2dcontour":23,"./isosurface":25,"./mesh3d":26,"./ohlc":27,"./parcats":28,"./parcoords":29,"./pie":30,"./pointcloud":31,"./sankey":32,"./scatter3d":33,"./scattercarpet":34,"./scattergeo":35,"./scattergl":36,"./scattermapbox":37,"./scatterpolar":38,"./scatterpolargl":39,"./scatterternary":40,"./sort":41,"./splom":42,"./streamtube":43,"./sunburst":44,"./surface":45,"./table":46,"./violin":47,"./volume":48,"./waterfall":49}],25:[function(t,e,r){"use strict";e.exports=t("../src/traces/isosurface")},{"../src/traces/isosurface":1016}],26:[function(t,e,r){"use strict";e.exports=t("../src/traces/mesh3d")},{"../src/traces/mesh3d":1021}],27:[function(t,e,r){"use strict";e.exports=t("../src/traces/ohlc")},{"../src/traces/ohlc":1026}],28:[function(t,e,r){"use strict";e.exports=t("../src/traces/parcats")},{"../src/traces/parcats":1035}],29:[function(t,e,r){"use strict";e.exports=t("../src/traces/parcoords")},{"../src/traces/parcoords":1044}],30:[function(t,e,r){"use strict";e.exports=t("../src/traces/pie")},{"../src/traces/pie":1055}],31:[function(t,e,r){"use strict";e.exports=t("../src/traces/pointcloud")},{"../src/traces/pointcloud":1064}],32:[function(t,e,r){"use strict";e.exports=t("../src/traces/sankey")},{"../src/traces/sankey":1070}],33:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatter3d")},{"../src/traces/scatter3d":1106}],34:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattercarpet")},{"../src/traces/scattercarpet":1112}],35:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergeo")},{"../src/traces/scattergeo":1119}],36:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergl")},{"../src/traces/scattergl":1127}],37:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattermapbox")},{"../src/traces/scattermapbox":1133}],38:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterpolar")},{"../src/traces/scatterpolar":1140}],39:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterpolargl")},{"../src/traces/scatterpolargl":1144}],40:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterternary")},{"../src/traces/scatterternary":1150}],41:[function(t,e,r){"use strict";e.exports=t("../src/transforms/sort")},{"../src/transforms/sort":1214}],42:[function(t,e,r){"use strict";e.exports=t("../src/traces/splom")},{"../src/traces/splom":1155}],43:[function(t,e,r){"use strict";e.exports=t("../src/traces/streamtube")},{"../src/traces/streamtube":1160}],44:[function(t,e,r){"use strict";e.exports=t("../src/traces/sunburst")},{"../src/traces/sunburst":1166}],45:[function(t,e,r){"use strict";e.exports=t("../src/traces/surface")},{"../src/traces/surface":1175}],46:[function(t,e,r){"use strict";e.exports=t("../src/traces/table")},{"../src/traces/table":1183}],47:[function(t,e,r){"use strict";e.exports=t("../src/traces/violin")},{"../src/traces/violin":1191}],48:[function(t,e,r){"use strict";e.exports=t("../src/traces/volume")},{"../src/traces/volume":1199}],49:[function(t,e,r){"use strict";e.exports=t("../src/traces/waterfall")},{"../src/traces/waterfall":1205}],50:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],u=t.mode||"turntable",c=n(),f=i(),h=a();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,e,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),new o({turntable:c,orbit:f,matrix:h},u)};var n=t("turntable-camera-controller"),i=t("orbit-camera-controller"),a=t("matrix-camera-controller");function o(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map(function(e){return t[e]}),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=o.prototype;[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]].forEach(function(t){for(var e=t[0],r=[],n=0;na&&(b=a);var o=e.min(i,function(t){return(y-n-(t.length-1)*b)/e.sum(t,c)});i.forEach(function(t){t.forEach(function(t,e){t.y1=(t.y0=e)+t.value*o})}),t.links.forEach(function(t){t.width=t.value*o})})(),d();for(var a=1,o=T;o>0;--o)l(a*=.99),d(),s(a),d();function s(t){i.forEach(function(r){r.forEach(function(r){if(r.targetLinks.length){var n=(e.sum(r.targetLinks,h)/e.sum(r.targetLinks,c)-f(r))*t;r.y0+=n,r.y1+=n}})})}function l(t){i.slice().reverse().forEach(function(r){r.forEach(function(r){if(r.sourceLinks.length){var n=(e.sum(r.sourceLinks,p)/e.sum(r.sourceLinks,c)-f(r))*t;r.y0+=n,r.y1+=n}})})}function d(){i.forEach(function(t){var e,r,i,a=n,o=t.length;for(t.sort(u),i=0;i0&&(e.y0+=r,e.y1+=r),a=e.y1+b;if((r=a-b-y)>0)for(a=e.y0-=r,e.y1-=r,i=o-2;i>=0;--i)e=t[i],(r=e.y1+b-a)>0&&(e.y0-=r,e.y1-=r),a=e.y0})}}(a),S(a),a}function S(t){t.nodes.forEach(function(t){t.sourceLinks.sort(l),t.targetLinks.sort(s)}),t.nodes.forEach(function(t){var e=t.y0,r=e;t.sourceLinks.forEach(function(t){t.y0=e+t.width/2,e+=t.width}),t.targetLinks.forEach(function(t){t.y1=r+t.width/2,r+=t.width})})}return E.update=function(t){return S(t),t},E.nodeId=function(t){return arguments.length?(_="function"==typeof t?t:o(t),E):_},E.nodeAlign=function(t){return arguments.length?(w="function"==typeof t?t:o(t),E):w},E.nodeWidth=function(t){return arguments.length?(x=+t,E):x},E.nodePadding=function(t){return arguments.length?(b=+t,E):b},E.nodes=function(t){return arguments.length?(k="function"==typeof t?t:o(t),E):k},E.links=function(t){return arguments.length?(A="function"==typeof t?t:o(t),E):A},E.size=function(e){return arguments.length?(t=n=0,i=+e[0],y=+e[1],E):[i-t,y-n]},E.extent=function(e){return arguments.length?(t=+e[0][0],i=+e[1][0],n=+e[0][1],y=+e[1][1],E):[[t,n],[i,y]]},E.iterations=function(t){return arguments.length?(T=+t,E):T},E},t.sankeyCenter=function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?e.min(t.sourceLinks,i)-1:0},t.sankeyLeft=function(t){return t.depth},t.sankeyRight=function(t,e){return e-1-t.height},t.sankeyJustify=a,t.sankeyLinkHorizontal=function(){return n.linkHorizontal().source(y).target(x)},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof r&&void 0!==e?i(r,t("d3-array"),t("d3-collection"),t("d3-shape")):i(n.d3=n.d3||{},n.d3,n.d3,n.d3)},{"d3-array":145,"d3-collection":146,"d3-shape":155}],52:[function(t,e,r){"use strict";var n="undefined"==typeof WeakMap?t("weak-map"):WeakMap,i=t("gl-buffer"),a=t("gl-vao"),o=new n;e.exports=function(t){var e=o.get(t),r=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!r||!t.isBuffer(r)){var n=i(t,new Float32Array([-1,-1,-1,4,4,-1]));(e=a(t,[{buffer:n,type:t.FLOAT,size:2}]))._triangleBuffer=n,o.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}},{"gl-buffer":240,"gl-vao":322,"weak-map":539}],53:[function(t,e,r){e.exports=function(t){var e=0,r=0,n=0,i=0;return t.map(function(t){var a=(t=t.slice())[0],o=a.toUpperCase();if(a!=o)switch(t[0]=o,a){case"a":t[6]+=n,t[7]+=i;break;case"v":t[1]+=i;break;case"h":t[1]+=n;break;default:for(var s=1;si&&(i=t[o]),t[o] + * @license MIT + */function n(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i=0;u--)if(c[u]!==f[u])return!1;for(u=c.length-1;u>=0;u--)if(l=c[u],!y(t[l],e[l],r,n))return!1;return!0}(t,e,r,o))}return r?t===e:t==e}function x(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function b(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function _(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&g(i,r,"Missing expected exception"+n);var o="string"==typeof n,s=!t&&a.isError(i),l=!t&&i&&!r;if((s&&o&&b(i,r)||l)&&g(i,r,"Got unwanted exception"+n),t&&i&&r&&!b(i,r)||!t&&i)throw i}f.AssertionError=function(t){var e;this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=d(v((e=this).actual),128)+" "+e.operator+" "+d(v(e.expected),128),this.generatedMessage=!0);var r=t.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var i=n.stack,a=p(r),o=i.indexOf("\n"+a);if(o>=0){var s=i.indexOf("\n",o+1);i=i.substring(s+1)}this.stack=i}}},a.inherits(f.AssertionError,Error),f.fail=g,f.ok=m,f.equal=function(t,e,r){t!=e&&g(t,e,r,"==",f.equal)},f.notEqual=function(t,e,r){t==e&&g(t,e,r,"!=",f.notEqual)},f.deepEqual=function(t,e,r){y(t,e,!1)||g(t,e,r,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(t,e,r){y(t,e,!0)||g(t,e,r,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(t,e,r){y(t,e,!1)&&g(t,e,r,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function t(e,r,n){y(e,r,!0)&&g(e,r,n,"notDeepStrictEqual",t)},f.strictEqual=function(t,e,r){t!==e&&g(t,e,r,"===",f.strictEqual)},f.notStrictEqual=function(t,e,r){t===e&&g(t,e,r,"!==",f.notStrictEqual)},f.throws=function(t,e,r){_(!0,t,e,r)},f.doesNotThrow=function(t,e,r){_(!1,t,e,r)},f.ifError=function(t){if(t)throw t};var w=Object.keys||function(t){var e=[];for(var r in t)o.call(t,r)&&e.push(r);return e}}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":64}],62:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],63:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],64:[function(t,r,n){(function(e,r){var i=/%[sdj%]/g;n.format=function(t){if(!m(t)){for(var e=[],r=0;r=a)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),l=n[r];r=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),d(e)?r.showHidden=e:e&&n._extend(r,e),y(r.showHidden)&&(r.showHidden=!1),y(r.depth)&&(r.depth=2),y(r.colors)&&(r.colors=!1),y(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=l),c(r,t,r.depth)}function l(t,e){var r=s.styles[e];return r?"["+s.colors[r][0]+"m"+t+"["+s.colors[r][1]+"m":t}function u(t,e){return t}function c(t,e,r){if(t.customInspect&&e&&k(e.inspect)&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(r,t);return m(i)||(i=c(t,i,r)),i}var a=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(m(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return g(e)?t.stylize(""+e,"number"):d(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}(t,e);if(a)return a;var o=Object.keys(e),s=function(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),w(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return f(e);if(0===o.length){if(k(e)){var l=e.name?": "+e.name:"";return t.stylize("[Function"+l+"]","special")}if(x(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(_(e))return t.stylize(Date.prototype.toString.call(e),"date");if(w(e))return f(e)}var u,b="",A=!1,T=["{","}"];if(p(e)&&(A=!0,T=["[","]"]),k(e)){var M=e.name?": "+e.name:"";b=" [Function"+M+"]"}return x(e)&&(b=" "+RegExp.prototype.toString.call(e)),_(e)&&(b=" "+Date.prototype.toUTCString.call(e)),w(e)&&(b=" "+f(e)),0!==o.length||A&&0!=e.length?r<0?x(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),u=A?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(u,b,T)):T[0]+b+T[1]}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),E(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=v(r)?c(t,l.value,null):c(t,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n")):s=t.stylize("[Circular]","special")),y(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function p(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function v(t){return null===t}function g(t){return"number"==typeof t}function m(t){return"string"==typeof t}function y(t){return void 0===t}function x(t){return b(t)&&"[object RegExp]"===A(t)}function b(t){return"object"==typeof t&&null!==t}function _(t){return b(t)&&"[object Date]"===A(t)}function w(t){return b(t)&&("[object Error]"===A(t)||t instanceof Error)}function k(t){return"function"==typeof t}function A(t){return Object.prototype.toString.call(t)}function T(t){return t<10?"0"+t.toString(10):t.toString(10)}n.debuglog=function(t){if(y(a)&&(a=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!o[t])if(new RegExp("\\b"+t+"\\b","i").test(a)){var r=e.pid;o[t]=function(){var e=n.format.apply(n,arguments);console.error("%s %d: %s",t,r,e)}}else o[t]=function(){};return o[t]},n.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=p,n.isBoolean=d,n.isNull=v,n.isNullOrUndefined=function(t){return null==t},n.isNumber=g,n.isString=m,n.isSymbol=function(t){return"symbol"==typeof t},n.isUndefined=y,n.isRegExp=x,n.isObject=b,n.isDate=_,n.isError=w,n.isFunction=k,n.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},n.isBuffer=t("./support/isBuffer");var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(t,e){return Object.prototype.hasOwnProperty.call(t,e)}n.log=function(){var t,e;console.log("%s - %s",(t=new Date,e=[T(t.getHours()),T(t.getMinutes()),T(t.getSeconds())].join(":"),[t.getDate(),M[t.getMonth()],e].join(" ")),n.format.apply(n,arguments))},n.inherits=t("inherits"),n._extend=function(t,e){if(!e||!b(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this,t("_process"),void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":63,_process:477,inherits:62}],65:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],66:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=e.length,a=new Array(r+1),o=0;o0?n-4:n,f=0;f>16&255,s[l++]=e>>8&255,s[l++]=255&e;return 2===o&&(e=i[t.charCodeAt(f)]<<2|i[t.charCodeAt(f+1)]>>4,s[l++]=255&e),1===o&&(e=i[t.charCodeAt(f)]<<10|i[t.charCodeAt(f+1)]<<4|i[t.charCodeAt(f+2)]>>2,s[l++]=e>>8&255,s[l++]=255&e),s},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,a=[],o=0,s=r-i;os?s:o+16383));return 1===i?(e=t[r-1],a.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],a.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function c(t,e,r){for(var i,a,o=[],s=e;s>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],68:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},{"./lib/rationalize":78}],69:[function(t,e,r){"use strict";e.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},{}],70:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},{"./lib/rationalize":78}],71:[function(t,e,r){"use strict";var n=t("./is-rat"),i=t("./lib/is-bn"),a=t("./lib/num-to-bn"),o=t("./lib/str-to-bn"),s=t("./lib/rationalize"),l=t("./div");e.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var u,c,f=0;if(i(e))u=e.clone();else if("string"==typeof e)u=o(e);else{if(0===e)return[a(0),a(1)];if(e===Math.floor(e))u=a(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),f-=256;u=a(e)}}if(n(r))u.mul(r[1]),c=r[0].clone();else if(i(r))c=r.clone();else if("string"==typeof r)c=o(r);else if(r)if(r===Math.floor(r))c=a(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),f+=256;c=a(r)}else c=a(1);return f>0?u=u.ushln(f):f<0&&(c=c.ushln(-f)),s(u,c)}},{"./div":70,"./is-rat":72,"./lib/is-bn":76,"./lib/num-to-bn":77,"./lib/rationalize":78,"./lib/str-to-bn":79}],72:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":76}],73:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":87}],74:[function(t,e,r){"use strict";var n=t("./bn-sign");e.exports=function(t){var e=t.length,r=t.words,i=0;if(1===e)i=r[0];else if(2===e)i=r[0]+67108864*r[1];else for(var a=0;a20?52:r+32}},{"bit-twiddle":85,"double-bits":161}],76:[function(t,e,r){"use strict";t("bn.js"),e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":87}],77:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("double-bits");e.exports=function(t){var e=i.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},{"bn.js":87,"double-bits":161}],78:[function(t,e,r){"use strict";var n=t("./num-to-bn"),i=t("./bn-sign");e.exports=function(t,e){var r=i(t),a=i(e);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);return o.cmpn(1)?[t.div(o),e.div(o)]:[t,e]}},{"./bn-sign":73,"./num-to-bn":77}],79:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":87}],80:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":78}],81:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":73}],82:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":78}],83:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),i=t("./lib/ctz");e.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var a=e.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,u=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return u*s;if(s){var c=i(s)+4,f=n(l.ushln(c).divRound(r));return u*(s+f*Math.pow(2,-c))}var h=r.bitLength()-l.bitLength()+53,f=n(l.ushln(h).divRound(r));return h<1023?u*f*Math.pow(2,-h):(f*=Math.pow(2,-1023),u*f*Math.pow(2,1023-h))}},{"./lib/bn-to-num":74,"./lib/ctz":75}],84:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return a?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),a?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){var a=new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""));return a()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],85:[function(t,e,r){"use strict";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],86:[function(t,e,r){"use strict";var n=t("clamp");e.exports=function(t,e){e||(e={});var r,o,s,l,u,c,f,h,p,d,v,g=null==e.cutoff?.25:e.cutoff,m=null==e.radius?8:e.radius,y=e.channel||0;if(ArrayBuffer.isView(t)||Array.isArray(t)){if(!e.width||!e.height)throw Error("For raw data width and height should be provided by options");r=e.width,o=e.height,l=t,c=e.stride?e.stride:Math.floor(t.length/r/o)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(f=(h=t).getContext("2d"),r=h.width,o=h.height,p=f.getImageData(0,0,r,o),l=p.data,c=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(h=t.canvas,f=t,r=h.width,o=h.height,p=f.getImageData(0,0,r,o),l=p.data,c=4):window.ImageData&&t instanceof window.ImageData&&(p=t,r=t.width,o=t.height,l=p.data,c=4);if(s=Math.max(r,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(u=l,l=Array(r*o),d=0,v=u.length;d=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function l(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36),t=t.toString().replace(/\s+/g,"");var i=0;"-"===t[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){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):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n("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 i=0;i=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-a&4194303),this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,s=Math.min(a,a-o)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var u=["","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"],c=[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],f=[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 h(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,f=67108863&l,h=Math.min(u,e.length-1),p=Math.max(0,u-t.length+1);p<=h;p++){var d=u-p|0;i=0|t.words[d],a=0|e.words[p],c+=(o=i*a+f)/67108864|0,f=67108863&o}r.words[u]=0|f,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r.strip()}a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?u[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=c[t],p=f[t];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var v=d.modn(p).toString(t);d=d.idivn(p),r=d.isZero()?v+r:u[h-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,u=new t(a),c=this.clone();if(l){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},a.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 r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==a&&o>26,this.words[o]=67108863&e;if(0===a&&o>>13,p=0|o[1],d=8191&p,v=p>>>13,g=0|o[2],m=8191&g,y=g>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],k=8191&w,A=w>>>13,T=0|o[5],M=8191&T,E=T>>>13,S=0|o[6],C=8191&S,L=S>>>13,O=0|o[7],I=8191&O,P=O>>>13,D=0|o[8],z=8191&D,R=D>>>13,F=0|o[9],B=8191&F,N=F>>>13,j=0|s[0],V=8191&j,U=j>>>13,H=0|s[1],q=8191&H,G=H>>>13,W=0|s[2],Y=8191&W,X=W>>>13,Z=0|s[3],$=8191&Z,J=Z>>>13,K=0|s[4],Q=8191&K,tt=K>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ut=st>>>13,ct=0|s[8],ft=8191&ct,ht=ct>>>13,pt=0|s[9],dt=8191&pt,vt=pt>>>13;r.negative=t.negative^e.negative,r.length=19,n=Math.imul(f,V),i=(i=Math.imul(f,U))+Math.imul(h,V)|0,a=Math.imul(h,U);var gt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(d,V),i=(i=Math.imul(d,U))+Math.imul(v,V)|0,a=Math.imul(v,U),n=n+Math.imul(f,q)|0,i=(i=i+Math.imul(f,G)|0)+Math.imul(h,q)|0,a=a+Math.imul(h,G)|0;var mt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,V),i=(i=Math.imul(m,U))+Math.imul(y,V)|0,a=Math.imul(y,U),n=n+Math.imul(d,q)|0,i=(i=i+Math.imul(d,G)|0)+Math.imul(v,q)|0,a=a+Math.imul(v,G)|0,n=n+Math.imul(f,Y)|0,i=(i=i+Math.imul(f,X)|0)+Math.imul(h,Y)|0,a=a+Math.imul(h,X)|0;var yt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,V),i=(i=Math.imul(b,U))+Math.imul(_,V)|0,a=Math.imul(_,U),n=n+Math.imul(m,q)|0,i=(i=i+Math.imul(m,G)|0)+Math.imul(y,q)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(d,Y)|0,i=(i=i+Math.imul(d,X)|0)+Math.imul(v,Y)|0,a=a+Math.imul(v,X)|0,n=n+Math.imul(f,$)|0,i=(i=i+Math.imul(f,J)|0)+Math.imul(h,$)|0,a=a+Math.imul(h,J)|0;var xt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(k,V),i=(i=Math.imul(k,U))+Math.imul(A,V)|0,a=Math.imul(A,U),n=n+Math.imul(b,q)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(_,q)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(m,Y)|0,i=(i=i+Math.imul(m,X)|0)+Math.imul(y,Y)|0,a=a+Math.imul(y,X)|0,n=n+Math.imul(d,$)|0,i=(i=i+Math.imul(d,J)|0)+Math.imul(v,$)|0,a=a+Math.imul(v,J)|0,n=n+Math.imul(f,Q)|0,i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,Q)|0,a=a+Math.imul(h,tt)|0;var bt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,V),i=(i=Math.imul(M,U))+Math.imul(E,V)|0,a=Math.imul(E,U),n=n+Math.imul(k,q)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(A,q)|0,a=a+Math.imul(A,G)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(_,Y)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,J)|0)+Math.imul(y,$)|0,a=a+Math.imul(y,J)|0,n=n+Math.imul(d,Q)|0,i=(i=i+Math.imul(d,tt)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,tt)|0,n=n+Math.imul(f,rt)|0,i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0,a=a+Math.imul(h,nt)|0;var _t=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(C,V),i=(i=Math.imul(C,U))+Math.imul(L,V)|0,a=Math.imul(L,U),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(E,q)|0,a=a+Math.imul(E,G)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,X)|0)+Math.imul(A,Y)|0,a=a+Math.imul(A,X)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,J)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,J)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(y,Q)|0,a=a+Math.imul(y,tt)|0,n=n+Math.imul(d,rt)|0,i=(i=i+Math.imul(d,nt)|0)+Math.imul(v,rt)|0,a=a+Math.imul(v,nt)|0,n=n+Math.imul(f,at)|0,i=(i=i+Math.imul(f,ot)|0)+Math.imul(h,at)|0,a=a+Math.imul(h,ot)|0;var wt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(I,V),i=(i=Math.imul(I,U))+Math.imul(P,V)|0,a=Math.imul(P,U),n=n+Math.imul(C,q)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(L,q)|0,a=a+Math.imul(L,G)|0,n=n+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(E,Y)|0,a=a+Math.imul(E,X)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,J)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,Q)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(y,rt)|0,a=a+Math.imul(y,nt)|0,n=n+Math.imul(d,at)|0,i=(i=i+Math.imul(d,ot)|0)+Math.imul(v,at)|0,a=a+Math.imul(v,ot)|0,n=n+Math.imul(f,lt)|0,i=(i=i+Math.imul(f,ut)|0)+Math.imul(h,lt)|0,a=a+Math.imul(h,ut)|0;var kt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(z,V),i=(i=Math.imul(z,U))+Math.imul(R,V)|0,a=Math.imul(R,U),n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(P,q)|0,a=a+Math.imul(P,G)|0,n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(L,Y)|0,a=a+Math.imul(L,X)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(E,$)|0,a=a+Math.imul(E,J)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(m,at)|0,i=(i=i+Math.imul(m,ot)|0)+Math.imul(y,at)|0,a=a+Math.imul(y,ot)|0,n=n+Math.imul(d,lt)|0,i=(i=i+Math.imul(d,ut)|0)+Math.imul(v,lt)|0,a=a+Math.imul(v,ut)|0,n=n+Math.imul(f,ft)|0,i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0,a=a+Math.imul(h,ht)|0;var At=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,V),i=(i=Math.imul(B,U))+Math.imul(N,V)|0,a=Math.imul(N,U),n=n+Math.imul(z,q)|0,i=(i=i+Math.imul(z,G)|0)+Math.imul(R,q)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(P,Y)|0,a=a+Math.imul(P,X)|0,n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(L,$)|0,a=a+Math.imul(L,J)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(E,Q)|0,a=a+Math.imul(E,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(A,rt)|0,a=a+Math.imul(A,nt)|0,n=n+Math.imul(b,at)|0,i=(i=i+Math.imul(b,ot)|0)+Math.imul(_,at)|0,a=a+Math.imul(_,ot)|0,n=n+Math.imul(m,lt)|0,i=(i=i+Math.imul(m,ut)|0)+Math.imul(y,lt)|0,a=a+Math.imul(y,ut)|0,n=n+Math.imul(d,ft)|0,i=(i=i+Math.imul(d,ht)|0)+Math.imul(v,ft)|0,a=a+Math.imul(v,ht)|0,n=n+Math.imul(f,dt)|0,i=(i=i+Math.imul(f,vt)|0)+Math.imul(h,dt)|0,a=a+Math.imul(h,vt)|0;var Tt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,G))+Math.imul(N,q)|0,a=Math.imul(N,G),n=n+Math.imul(z,Y)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(R,Y)|0,a=a+Math.imul(R,X)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(P,$)|0,a=a+Math.imul(P,J)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(L,Q)|0,a=a+Math.imul(L,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(E,rt)|0,a=a+Math.imul(E,nt)|0,n=n+Math.imul(k,at)|0,i=(i=i+Math.imul(k,ot)|0)+Math.imul(A,at)|0,a=a+Math.imul(A,ot)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ut)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ut)|0,n=n+Math.imul(m,ft)|0,i=(i=i+Math.imul(m,ht)|0)+Math.imul(y,ft)|0,a=a+Math.imul(y,ht)|0,n=n+Math.imul(d,dt)|0,i=(i=i+Math.imul(d,vt)|0)+Math.imul(v,dt)|0,a=a+Math.imul(v,vt)|0;var Mt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,Y),i=(i=Math.imul(B,X))+Math.imul(N,Y)|0,a=Math.imul(N,X),n=n+Math.imul(z,$)|0,i=(i=i+Math.imul(z,J)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,J)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(P,Q)|0,a=a+Math.imul(P,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(L,rt)|0,a=a+Math.imul(L,nt)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(E,at)|0,a=a+Math.imul(E,ot)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ut)|0)+Math.imul(A,lt)|0,a=a+Math.imul(A,ut)|0,n=n+Math.imul(b,ft)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(_,ft)|0,a=a+Math.imul(_,ht)|0,n=n+Math.imul(m,dt)|0,i=(i=i+Math.imul(m,vt)|0)+Math.imul(y,dt)|0,a=a+Math.imul(y,vt)|0;var Et=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(B,$),i=(i=Math.imul(B,J))+Math.imul(N,$)|0,a=Math.imul(N,J),n=n+Math.imul(z,Q)|0,i=(i=i+Math.imul(z,tt)|0)+Math.imul(R,Q)|0,a=a+Math.imul(R,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(P,rt)|0,a=a+Math.imul(P,nt)|0,n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ot)|0)+Math.imul(L,at)|0,a=a+Math.imul(L,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ut)|0)+Math.imul(E,lt)|0,a=a+Math.imul(E,ut)|0,n=n+Math.imul(k,ft)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(A,ft)|0,a=a+Math.imul(A,ht)|0,n=n+Math.imul(b,dt)|0,i=(i=i+Math.imul(b,vt)|0)+Math.imul(_,dt)|0,a=a+Math.imul(_,vt)|0;var St=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(B,Q),i=(i=Math.imul(B,tt))+Math.imul(N,Q)|0,a=Math.imul(N,tt),n=n+Math.imul(z,rt)|0,i=(i=i+Math.imul(z,nt)|0)+Math.imul(R,rt)|0,a=a+Math.imul(R,nt)|0,n=n+Math.imul(I,at)|0,i=(i=i+Math.imul(I,ot)|0)+Math.imul(P,at)|0,a=a+Math.imul(P,ot)|0,n=n+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,ut)|0)+Math.imul(L,lt)|0,a=a+Math.imul(L,ut)|0,n=n+Math.imul(M,ft)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(E,ft)|0,a=a+Math.imul(E,ht)|0,n=n+Math.imul(k,dt)|0,i=(i=i+Math.imul(k,vt)|0)+Math.imul(A,dt)|0,a=a+Math.imul(A,vt)|0;var Ct=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(B,rt),i=(i=Math.imul(B,nt))+Math.imul(N,rt)|0,a=Math.imul(N,nt),n=n+Math.imul(z,at)|0,i=(i=i+Math.imul(z,ot)|0)+Math.imul(R,at)|0,a=a+Math.imul(R,ot)|0,n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ut)|0)+Math.imul(P,lt)|0,a=a+Math.imul(P,ut)|0,n=n+Math.imul(C,ft)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(L,ft)|0,a=a+Math.imul(L,ht)|0,n=n+Math.imul(M,dt)|0,i=(i=i+Math.imul(M,vt)|0)+Math.imul(E,dt)|0,a=a+Math.imul(E,vt)|0;var Lt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(B,at),i=(i=Math.imul(B,ot))+Math.imul(N,at)|0,a=Math.imul(N,ot),n=n+Math.imul(z,lt)|0,i=(i=i+Math.imul(z,ut)|0)+Math.imul(R,lt)|0,a=a+Math.imul(R,ut)|0,n=n+Math.imul(I,ft)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(P,ft)|0,a=a+Math.imul(P,ht)|0,n=n+Math.imul(C,dt)|0,i=(i=i+Math.imul(C,vt)|0)+Math.imul(L,dt)|0,a=a+Math.imul(L,vt)|0;var Ot=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(B,lt),i=(i=Math.imul(B,ut))+Math.imul(N,lt)|0,a=Math.imul(N,ut),n=n+Math.imul(z,ft)|0,i=(i=i+Math.imul(z,ht)|0)+Math.imul(R,ft)|0,a=a+Math.imul(R,ht)|0,n=n+Math.imul(I,dt)|0,i=(i=i+Math.imul(I,vt)|0)+Math.imul(P,dt)|0,a=a+Math.imul(P,vt)|0;var It=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(B,ft),i=(i=Math.imul(B,ht))+Math.imul(N,ft)|0,a=Math.imul(N,ht),n=n+Math.imul(z,dt)|0,i=(i=i+Math.imul(z,vt)|0)+Math.imul(R,dt)|0,a=a+Math.imul(R,vt)|0;var Pt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(B,dt),i=(i=Math.imul(B,vt))+Math.imul(N,dt)|0,a=Math.imul(N,vt);var Dt=(u+n|0)+((8191&i)<<13)|0;return u=(a+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,l[0]=gt,l[1]=mt,l[2]=yt,l[3]=xt,l[4]=bt,l[5]=_t,l[6]=wt,l[7]=kt,l[8]=At,l[9]=Tt,l[10]=Mt,l[11]=Et,l[12]=St,l[13]=Ct,l[14]=Lt,l[15]=Ot,l[16]=It,l[17]=Pt,l[18]=Dt,0!==u&&(l[19]=u,r.length++),r};function d(t,e,r){var n=new v;return n.mulp(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(p=h),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):r<63?h(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):d(this,t,e)},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},v.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,u=0;u=0&&(0!==c||u>=i);u--){var f=0|this.words[u];this.words[u]=c<<26-a|f>>>a,c=f&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>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},a.prototype.isubn=function(t){if(n("number"==typeof t),n(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>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=this.length-t.length,n=this.clone(),i=t,o=0|i.words[i.length-1],s=this._countBits(o);0!=(r=26-s)&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var l,u=n.length-i.length;if("mod"!==e){(l=new a(null)).length=u+1,l.words=new Array(l.length);for(var c=0;c=0;h--){var p=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(p=Math.min(p/o|0,67108863),n._ishlnsubmul(i,p,h);0!==n.negative;)p--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);l&&(l.words[h]=p)}return l&&l.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:l||null,mod:n}},a.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,s},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var h=0,p=1;0==(e.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var d=0,v=1;0==(r.words[0]&v)&&d<26;++d,v<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(c),l.isub(f)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(u)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;0==(e.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(i=0===e.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(t),i},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new w(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(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 m(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}m.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),r=(r=this.imulK(r)).iadd(this.tmp),e=r.bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},i(y,m),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new x;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[t]=e,e},w.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},w.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(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 r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},w.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},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(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var f=this.pow(c,i),h=this.pow(t,i.addn(1).iushrn(1)),p=this.pow(t,i),d=o;0!==p.cmp(s);){for(var v=p,g=0;0!==v.cmp(s);g++)v=v.redSqr();n(g=0;n--){for(var u=e.words[n],c=l-1;c>=0;c--){var f=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4==++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},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},a.mont=function(t){return new k(t)},i(k,w),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.invm=function(t){var e=this.imod(t._invmp(this.m).mul(this.r2));return e._forceRed(this)}}(void 0===e||e,this)},{buffer:96}],88:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(c<=0)){var f,h=i.mallocDouble(2*c*s),p=i.mallocInt32(s);if((s=l(t,c,h,p))>0){if(1===c&&n)a.init(s),f=a.sweepComplete(c,r,0,s,h,p,0,s,h,p);else{var d=i.mallocDouble(2*c*u),v=i.mallocInt32(u);(u=l(e,c,d,v))>0&&(a.init(s+u),f=1===c?a.sweepBipartite(c,r,0,s,h,p,0,u,d,v):o(c,r,n,s,h,p,u,d,v),i.free(d),i.free(v))}i.free(h),i.free(p)}return f}}}function c(t,e){n.push([t,e])}},{"./lib/intersect":91,"./lib/sweep":95,"typedarray-pool":532}],90:[function(t,e,r){"use strict";var n="d",i="ax",a="vv",o="fp",s="es",l="rs",u="re",c="rb",f="ri",h="rp",p="bs",d="be",v="bb",g="bi",m="bp",y="rv",x="Q",b=[n,i,a,l,u,c,f,p,d,v,g];function _(t){var e="bruteForce"+(t?"Full":"Partial"),r=[],_=b.slice();t||_.splice(3,0,o);var w=["function "+e+"("+_.join()+"){"];function k(e,o){var _=function(t,e,r){var o="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),_=["function ",o,"(",b.join(),"){","var ",s,"=2*",n,";"],w="for(var i="+l+","+h+"="+s+"*"+l+";i<"+u+";++i,"+h+"+="+s+"){var x0="+c+"["+i+"+"+h+"],x1="+c+"["+i+"+"+h+"+"+n+"],xi="+f+"[i];",k="for(var j="+p+","+m+"="+s+"*"+p+";j<"+d+";++j,"+m+"+="+s+"){var y0="+v+"["+i+"+"+m+"],"+(r?"y1="+v+"["+i+"+"+m+"+"+n+"],":"")+"yi="+g+"[j];";return t?_.push(w,x,":",k):_.push(k,x,":",w),r?_.push("if(y1"+d+"-"+p+"){"),t?(k(!0,!1),w.push("}else{"),k(!1,!1)):(w.push("if("+o+"){"),k(!0,!0),w.push("}else{"),k(!0,!1),w.push("}}else{if("+o+"){"),k(!1,!0),w.push("}else{"),k(!1,!1),w.push("}")),w.push("}}return "+e);var A=r.join("")+w.join(""),T=new Function(A);return T()}r.partial=_(!1),r.full=_(!0)},{}],91:[function(t,e,r){"use strict";e.exports=function(t,e,r,a,c,E,S,C,L){!function(t,e){var r=8*i.log2(e+1)*(t+1)|0,a=i.nextPow2(b*r);w.length0;){var D=(I-=1)*b,z=w[D],R=w[D+1],F=w[D+2],B=w[D+3],N=w[D+4],j=w[D+5],V=I*_,U=k[V],H=k[V+1],q=1&j,G=!!(16&j),W=c,Y=E,X=C,Z=L;if(q&&(W=C,Y=L,X=c,Z=E),!(2&j&&(F=g(t,z,R,F,W,Y,H),R>=F)||4&j&&(R=m(t,z,R,F,W,Y,U))>=F)){var $=F-R,J=N-B;if(G){if(t*$*($+J)=p0)&&!(p1>=hi)",["p0","p1"]),v=c("lo===p0",["p0"]),g=c("lo>>1,h=2*t,p=f,d=s[h*f+e];u=x?(p=y,d=x):m>=_?(p=g,d=m):(p=b,d=_):x>=_?(p=y,d=x):_>=m?(p=g,d=m):(p=b,d=_);for(var w=h*(c-1),k=h*p,A=0;Ar&&i[f+e]>u;--c,f-=o){for(var h=f,p=f+o,d=0;d=0&&i.push("lo=e[k+n]"),t.indexOf("hi")>=0&&i.push("hi=e[k+o]"),r.push(n.replace("_",i.join()).replace("$",t)),Function.apply(void 0,r)};var n="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],94:[function(t,e,r){"use strict";e.exports=function(t,e){e<=4*n?i(0,e-1,t):function t(e,r,f){var h=(r-e+1)/6|0,p=e+h,d=r-h,v=e+r>>1,g=v-h,m=v+h,y=p,x=g,b=v,_=m,w=d,k=e+1,A=r-1,T=0;u(y,x,f)&&(T=y,y=x,x=T),u(_,w,f)&&(T=_,_=w,w=T),u(y,b,f)&&(T=y,y=b,b=T),u(x,b,f)&&(T=x,x=b,b=T),u(y,_,f)&&(T=y,y=_,_=T),u(b,_,f)&&(T=b,b=_,_=T),u(x,w,f)&&(T=x,x=w,w=T),u(x,b,f)&&(T=x,x=b,b=T),u(_,w,f)&&(T=_,_=w,w=T);for(var M=f[2*x],E=f[2*x+1],S=f[2*_],C=f[2*_+1],L=2*y,O=2*b,I=2*w,P=2*p,D=2*v,z=2*d,R=0;R<2;++R){var F=f[L+R],B=f[O+R],N=f[I+R];f[P+R]=F,f[D+R]=B,f[z+R]=N}o(g,e,f),o(m,r,f);for(var j=k;j<=A;++j)if(c(j,M,E,f))j!==k&&a(j,k,f),++k;else if(!c(j,S,C,f))for(;;){if(c(A,S,C,f)){c(A,M,E,f)?(s(j,k,A,f),++k,--A):(a(j,A,f),--A);break}if(--At;){var u=r[l-2],c=r[l-1];if(ur[e+1])}function c(t,e,r,n){var i=n[t*=2];return i>>1;a(p,E);for(var S=0,C=0,k=0;k=o)d(u,c,C--,L=L-o|0);else if(L>=0)d(s,l,S--,L);else if(L<=-o){L=-L-o|0;for(var O=0;O>>1;a(p,S);for(var C=0,L=0,O=0,A=0;A>1==p[2*A+3]>>1&&(P=2,A+=1),I<0){for(var D=-(I>>1)-1,z=0;z>1)-1;0===P?d(s,l,C--,D):1===P?d(u,c,L--,D):2===P&&d(f,h,O--,D)}}},scanBipartite:function(t,e,r,n,i,u,c,f,h,g,m,y){var x=0,b=2*t,_=e,w=e+t,k=1,A=1;n?A=o:k=o;for(var T=i;T>>1;a(p,C);for(var L=0,T=0;T=o?(I=!n,M-=o):(I=!!n,M-=1),I)v(s,l,L++,M);else{var P=y[M],D=b*M,z=m[D+e+1],R=m[D+e+1+t];t:for(var F=0;F>>1;a(p,k);for(var A=0,x=0;x=o)s[A++]=b-o;else{var M=d[b-=1],E=g*b,S=h[E+e+1],C=h[E+e+1+t];t:for(var L=0;L=0;--L)if(s[L]===b){for(var D=L+1;D0&&s.length>a){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",l.name,l.message)}}else s=o[e]=r,++t._eventsCount;return t}function h(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e1&&(e=arguments[1]),e instanceof Error)throw e;var l=new Error('Unhandled "error" event. ('+e+")");throw l.context=e,l}if(!(r=o[t]))return!1;var u="function"==typeof r;switch(n=arguments.length){case 1:!function(t,e,r){if(e)t.call(r);else for(var n=t.length,i=g(t,n),a=0;a=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,a=o;break}if(a<0)return this;0===a?r.shift():function(t,e){for(var r=e,n=r+1,i=t.length;n=0;a--)this.removeListener(t,e[a]);return this},o.prototype.listeners=function(t){return d(this,t,!0)},o.prototype.rawListeners=function(t){return d(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):v.call(t,e)},o.prototype.listenerCount=v,o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],98:[function(t,e,r){ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +"use strict";var n=t("base64-js"),i=t("ieee754");r.Buffer=s,r.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},r.INSPECT_MAX_BYTES=50;var a=2147483647;function o(t){if(t>a)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=s.prototype,e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return l(t,e,r)}function l(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|p(t,e),n=o(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return f(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(N(t,ArrayBuffer)||t&&N(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength=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(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||N(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return R(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(i)return n?-1:R(t).length;e=(""+e).toLowerCase(),i=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function v(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),j(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:g(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):g(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(t,e,r,n,i){var a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var c=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var f=!0,h=0;hi&&(n=i):n=i;var a=e.length;n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function k(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:u>223?3:u>191?2:1;if(i+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(a=t[i+1]))&&(l=(31&u)<<6|63&a)>127&&(c=l);break;case 3:a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&(l=(15&u)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=f}return function(t){var e=t.length;if(e<=T)return String.fromCharCode.apply(String,t);for(var r="",n=0;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return M(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return k(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),""},s.prototype.compare=function(t,e,r,n,i){if(N(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var a=i-n,o=r-e,l=Math.min(a,o),u=this.slice(n,i),c=t.slice(e,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return y(this,t,e,r);case"ascii":return x(this,t,e,r);case"latin1":case"binary":return b(this,t,e,r);case"base64":return _(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function M(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;ii)&&(r=i);for(var a="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,r,n,i,a){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function I(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(t,e,r,n,a){return e=+e,r>>>=0,a||I(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,a){return e=+e,r>>>=0,a||I(t,0,r,8),i.write(t,e,r,n,52,8),r+8}s.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||L(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||L(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);for(var n=this[t],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},s.prototype.readInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||L(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||L(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||L(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||L(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||L(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||L(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;O(this,t,e,r,i,0)}var a=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;O(this,t,e,r,i,0)}var a=r-1,o=1;for(this[e+a]=255&t;--a>=0&&(o*=256);)this[e+a]=t/o&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a>0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return P(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--a)t[a+e]=this[a+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=e;a55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function F(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function B(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function N(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function j(t){return t!=t}},{"base64-js":67,ieee754:407}],99:[function(t,e,r){"use strict";var n=t("./lib/monotone"),i=t("./lib/triangulation"),a=t("./lib/delaunay"),o=t("./lib/filter");function s(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function l(t,e){return t[0]-e[0]||t[1]-e[1]}function u(t,e,r){return e in t?t[e]:r}e.exports=function(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var c=!!u(r,"delaunay",!0),f=!!u(r,"interior",!0),h=!!u(r,"exterior",!0),p=!!u(r,"infinity",!1);if(!f&&!h||0===t.length)return[];var d=n(t,e);if(c||f!==h||p){for(var v=i(t.length,function(t){return t.map(s).sort(l)}(e)),g=0;g0;){for(var c=r.pop(),s=r.pop(),f=-1,h=-1,l=o[s],d=1;d=0||(e.flip(s,c),i(t,e,r,f,s,h),i(t,e,r,s,h,f),i(t,e,r,h,c,f),i(t,e,r,c,f,h))}}},{"binary-search-bounds":104,"robust-in-sphere":495}],101:[function(t,e,r){"use strict";var n=t("binary-search-bounds");function i(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}e.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,a=0;a0||l.length>0;){for(;o.length>0;){var p=o.pop();if(u[p]!==-a){u[p]=a,c[p];for(var d=0;d<3;++d){var v=h[3*p+d];v>=0&&0===u[v]&&(f[3*p+d]?l.push(v):(o.push(v),u[v]=a))}}}var g=l;l=o,o=g,l.length=0,a=-a}var m=function(t,e,r){for(var n=0,i=0;i1&&i(r[h[p-2]],r[h[p-1]],a)>0;)t.push([h[p-1],h[p-2],o]),p-=1;h.length=p,h.push(o);for(var d=c.upperIds,p=d.length;p>1&&i(r[d[p-2]],r[d[p-1]],a)<0;)t.push([d[p-2],d[p-1],o]),p-=1;d.length=p,d.push(o)}}function p(t,e){var r;return(r=t.a[0]m[0]&&i.push(new u(m,g,s,f),new u(g,m,o,f))}i.sort(c);for(var y=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),x=[new l([y,1],[y,0],-1,[],[],[],[])],b=[],f=0,_=i.length;f<_;++f){var w=i[f],k=w.type;k===a?h(b,x,t,w.a,w.idx):k===s?d(x,0,w):v(x,0,w)}return b}},{"binary-search-bounds":104,"robust-orientation":497}],103:[function(t,e,r){"use strict";var n=t("binary-search-bounds");function i(t,e){this.stars=t,this.edges=e}e.exports=function(t,e){for(var r=new Array(t),n=0;n=0}}(),a.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},a.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},a.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;n>>1,x=a[m]"];return i?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),r?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),i?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,r,i){var a=new Function([n("A","x"+t+"y",e,["y"],i),n("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""));return a()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],105:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1,r=1;rr?r:t:te?e:t}},{}],109:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n;if(r){n=e;for(var i=new Array(e.length),a=0;ae[2]?1:0)}function m(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--a){var x=n[a];c=x[0];var b=e[c],_=b[0],w=b[1],k=t[_],A=t[w];if((k[0]-A[0]||k[1]-A[1])<0){var T=_;_=w,w=T}b[0]=_;var M,E=b[1]=x[1];for(i&&(M=b[2]);a>0&&n[a-1][0]===c;){var x=n[--a],S=x[1];i?e.push([E,S,M]):e.push([E,S]),E=S}i?e.push([E,w,M]):e.push([E,w])}return h}(t,e,h,g,r),x=d(t,y);return m(e,x,r),!!x||h.length>0||g.length>0}},{"./lib/rat-seg-intersect":110,"big-rat":71,"big-rat/cmp":69,"big-rat/to-float":83,"box-intersect":89,nextafter:446,"rat-vec":481,"robust-segment-intersect":500,"union-find":533}],110:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a=s(e,t),f=s(n,r),h=c(a,f);if(0===o(h))return null;var p=s(t,r),d=c(f,p),v=i(d,h),g=u(a,v);return l(t,g)};var n=t("big-rat/mul"),i=t("big-rat/div"),a=t("big-rat/sub"),o=t("big-rat/sign"),s=t("rat-vec/sub"),l=t("rat-vec/add"),u=t("rat-vec/muls");function c(t,e){return a(n(t[0],e[1]),n(t[1],e[0]))}},{"big-rat/div":70,"big-rat/mul":80,"big-rat/sign":81,"big-rat/sub":82,"rat-vec/add":480,"rat-vec/muls":482,"rat-vec/sub":483}],111:[function(t,e,r){"use strict";var n=t("clamp");function i(t,e){null==e&&(e=!0);var r=t[0],i=t[1],a=t[2],o=t[3];null==o&&(o=e?1:255),e&&(r*=255,i*=255,a*=255,o*=255),r=255&n(r,0,255),i=255&n(i,0,255),a=255&n(a,0,255),o=255&n(o,0,255);var s=16777216*r+(i<<16)+(a<<8)+o;return s}e.exports=i,e.exports.to=i,e.exports.from=function(t,e){var r=(t=+t)>>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}},{clamp:108}],112:[function(t,e,r){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],113:[function(t,e,r){"use strict";var n=t("color-rgba"),i=t("clamp"),a=t("dtype");e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=a(e),o=new r(4),s="uint8"!==e&&"uint8_clamped"!==e;return t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),function(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||!!(Array.isArray(t)&&(t[0]>1||0===t[0])&&(t[1]>1||0===t[1])&&(t[2]>1||0===t[2])&&(!t[3]||t[3]>1))}(t)?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:255,s&&(o[0]/=255,o[1]/=255,o[2]/=255,o[3]/=255),o):(s?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:1):(o[0]=i(Math.floor(255*t[0]),0,255),o[1]=i(Math.floor(255*t[1]),0,255),o[2]=i(Math.floor(255*t[2]),0,255),o[3]=null==t[3]?255:i(Math.floor(255*t[3]),0,255)),o)}},{clamp:108,"color-rgba":115,dtype:163}],114:[function(t,r,n){(function(e){"use strict";var n=t("color-name"),i=t("is-plain-obj"),a=t("defined");r.exports=function(t){var r,s,l=[],u=1;if("string"==typeof t)if(n[t])l=n[t].slice(),s="rgb";else if("transparent"===t)u=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var c=t.slice(1),f=c.length,h=f<=4;u=1,h?(l=[parseInt(c[0]+c[0],16),parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16)],4===f&&(u=parseInt(c[3]+c[3],16)/255)):(l=[parseInt(c[0]+c[1],16),parseInt(c[2]+c[3],16),parseInt(c[4]+c[5],16)],8===f&&(u=parseInt(c[6]+c[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(r=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var p=r[1],c=p.replace(/a$/,"");s=c;var f="cmyk"===c?4:"gray"===c?1:3;l=r[2].trim().split(/\s*,\s*/).map(function(t,e){if(/%$/.test(t))return e===f?parseFloat(t)/100:"rgb"===c?255*parseFloat(t)/100:parseFloat(t);if("h"===c[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)}),p===c&&l.push(1),u=void 0===l[f]?1:l[f],l=l.slice(0,f)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),s=t.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(t))if(i(t)){var d=a(t.r,t.red,t.R,null);null!==d?(s="rgb",l=[d,a(t.g,t.green,t.G),a(t.b,t.blue,t.B)]):(s="hsl",l=[a(t.h,t.hue,t.H),a(t.s,t.saturation,t.S),a(t.l,t.lightness,t.L,t.b,t.brightness)]),u=a(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(u/=100)}else(Array.isArray(t)||e.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s="rgb",u=4===t.length?t[3]:1);else s="rgb",l=[t>>>16,(65280&t)>>>8,255&t];return{space:s,values:l,alpha:u}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":112,defined:158,"is-plain-obj":417}],115:[function(t,e,r){"use strict";var n=t("color-parse"),i=t("color-space/hsl"),a=t("clamp");e.exports=function(t){var e,r=n(t);return r.space?((e=Array(3))[0]=a(r.values[0],0,255),e[1]=a(r.values[1],0,255),e[2]=a(r.values[2],0,255),"h"===r.space[0]&&(e=i.rgb(e)),e.push(a(r.alpha,0,1)),e):[]}},{clamp:108,"color-parse":114,"color-space/hsl":116}],116:[function(t,e,r){"use strict";var n=t("./rgb");e.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[a=255*l,a,a];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var u=0;u<3;u++)(n=o+1/3*-(u-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[u]=255*a;return i}},n.hsl=function(t){var e,r,n=t[0]/255,i=t[1]/255,a=t[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?e=0:n===s?e=(i-a)/l:i===s?e=2+(a-n)/l:a===s&&(e=4+(n-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},{"./rgb":117}],117:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],118:[function(t,e,r){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},{}],119:[function(t,e,r){"use strict";var n=t("./colorScale"),i=t("lerp");function a(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r="#",n=0;n<3;++n)e=(e=t[n]).toString(16),r+=("00"+e).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}e.exports=function(t){var e,r,l,u,c,f,h,p,d,v;if(t||(t={}),p=(t.nshades||72)-1,h=t.format||"hex",(f=t.colormap)||(f="jet"),"string"==typeof f){if(f=f.toLowerCase(),!n[f])throw Error(f+" not a supported colorscale");c=n[f]}else{if(!Array.isArray(f))throw Error("unsupported colormap option",f);c=f.slice()}if(c.length>p+1)throw new Error(f+" map requires nshades to be at least size "+c.length);d=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=c.map(function(t){return Math.round(t.index*p)}),d[0]=Math.min(Math.max(d[0],0),1),d[1]=Math.min(Math.max(d[1],0),1);var g=c.map(function(t,e){var r=c[e].index,n=c[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1?n:(n[3]=d[0]+(d[1]-d[0])*r,n)}),m=[];for(v=0;v0?-1:l(t,e,a)?-1:1:0===s?u>0?1:l(t,e,r)?1:-1:i(u-s)}var h=n(t,e,r);if(h>0)return o>0&&n(t,e,a)>0?1:-1;if(h<0)return o>0||n(t,e,a)>0?1:-1;var p=n(t,e,a);return p>0?1:l(t,e,r)?1:-1};var n=t("robust-orientation"),i=t("signum"),a=t("two-sum"),o=t("robust-product"),s=t("robust-sum");function l(t,e,r){var n=a(t[0],-e[0]),i=a(t[1],-e[1]),l=a(r[0],-e[0]),u=a(r[1],-e[1]),c=s(o(n,l),o(i,u));return c[c.length-1]>=0}},{"robust-orientation":497,"robust-product":498,"robust-sum":502,signum:503,"two-sum":531}],121:[function(t,e,r){e.exports=function(t,e){var r=t.length,a=t.length-e.length;if(a)return a;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||n(t[0],t[1])-n(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(a=o+t[2]-(s+e[2]))return a;var l=n(t[0],t[1]),u=n(e[0],e[1]);return n(l,t[2])-n(u,e[2])||n(l+t[2],o)-n(u+e[2],s);case 4:var c=t[0],f=t[1],h=t[2],p=t[3],d=e[0],v=e[1],g=e[2],m=e[3];return c+f+h+p-(d+v+g+m)||n(c,f,h,p)-n(d,v,g,m,d)||n(c+f,c+h,c+p,f+h,f+p,h+p)-n(d+v,d+g,d+m,v+g,v+m,g+m)||n(c+f+h,c+f+p,c+h+p,f+h+p)-n(d+v+g,d+v+m,d+g+m,v+g+m);default:for(var y=t.slice().sort(i),x=e.slice().sort(i),b=0;bt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},{}],125:[function(t,e,r){"use strict";e.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var i=new Array(r),a=e[r-1],o=0;o=e[l]&&(s+=1);a[o]=s}}return t}(o,r)}};var n=t("incremental-convex-hull"),i=t("affine-hull")},{"affine-hull":55,"incremental-convex-hull":408}],127:[function(t,e,r){e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|ç)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|é)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|é)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|ã)o.?tom(e|é)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},{}],128:[function(t,e,r){e.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]},{}],129:[function(t,e,r){e.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]},{}],130:[function(t,e,r){e.exports=["normal","italic","oblique"]},{}],131:[function(t,e,r){e.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]},{}],132:[function(t,e,r){"use strict";e.exports={parse:t("./parse"),stringify:t("./stringify")}},{"./parse":134,"./stringify":135}],133:[function(t,e,r){"use strict";var n=t("css-font-size-keywords");e.exports={isSize:function(t){return/^[\d\.]/.test(t)||-1!==t.indexOf("/")||-1!==n.indexOf(t)}}},{"css-font-size-keywords":128}],134:[function(t,e,r){"use strict";var n=t("unquote"),i=t("css-global-keywords"),a=t("css-system-font-keywords"),o=t("css-font-weight-keywords"),s=t("css-font-style-keywords"),l=t("css-font-stretch-keywords"),u=t("string-split-by"),c=t("./lib/util").isSize;e.exports=h;var f=h.cache={};function h(t){if("string"!=typeof t)throw new Error("Font argument must be a string.");if(f[t])return f[t];if(""===t)throw new Error("Cannot parse an empty string.");if(-1!==a.indexOf(t))return f[t]={system:t};for(var e,r={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},h=u(t,/\s+/);e=h.shift();){if(-1!==i.indexOf(e))return["style","variant","weight","stretch"].forEach(function(t){r[t]=e}),f[t]=r;if(-1===s.indexOf(e))if("normal"!==e&&"small-caps"!==e)if(-1===l.indexOf(e)){if(-1===o.indexOf(e)){if(c(e)){var d=u(e,"/");if(r.size=d[0],null!=d[1]?r.lineHeight=p(d[1]):"/"===h[0]&&(h.shift(),r.lineHeight=p(h.shift())),!h.length)throw new Error("Missing required font-family.");return r.family=u(h.join(" "),/\s*,\s*/).map(n),f[t]=r}throw new Error("Unknown or unsupported font token: "+e)}r.weight=e}else r.stretch=e;else r.variant=e;else r.style=e}throw new Error("Missing required font-size.")}function p(t){var e=parseFloat(t);return e.toString()===t?e:t}},{"./lib/util":133,"css-font-stretch-keywords":129,"css-font-style-keywords":130,"css-font-weight-keywords":131,"css-global-keywords":136,"css-system-font-keywords":137,"string-split-by":516,unquote:535}],135:[function(t,e,r){"use strict";var n=t("pick-by-alias"),i=t("./lib/util").isSize,a=d(t("css-global-keywords")),o=d(t("css-system-font-keywords")),s=d(t("css-font-weight-keywords")),l=d(t("css-font-style-keywords")),u=d(t("css-font-stretch-keywords")),c={normal:1,"small-caps":1},f={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},h={style:"normal",variant:"normal",weight:"normal",stretch:"normal",size:"1rem",lineHeight:"normal",family:"serif"};function p(t,e){if(t&&!e[t]&&!a[t])throw Error("Unknown keyword `"+t+"`");return t}function d(t){for(var e={},r=0;r=0;--p)a[p]=u*t[p]+c*e[p]+f*r[p]+h*n[p];return a}return u*t+c*e+f*r+h*n},e.exports.derivative=function(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,u=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var c=t.length-1;c>=0;--c)a[c]=o*t[c]+s*e[c]+l*r[c]+u*n[c];return a}return o*t+s*e+l*r[c]+u*n}},{}],139:[function(t,e,r){"use strict";var n=t("./lib/thunk.js");function i(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}e.exports=function(t){var e=new i;e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var a=0;a0)throw new Error("cwise: pre() block may not reference array args");if(a0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===o)e.scalarArgs.push(a),e.shimArgs.push("scalar"+a);else if("index"===o){if(e.indexArgs.push(a),a0)throw new Error("cwise: pre() block may not reference array index");if(a0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===o){if(e.shapeArgs.push(a),ar.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,n(e)}},{"./lib/thunk.js":141}],140:[function(t,e,r){"use strict";var n=t("uniq");function i(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],u=[],c=0,f=0;for(n=0;n0&&l.push("var "+u.join(",")),n=a-1;n>=0;--n)c=t[n],l.push(["for(i",n,"=0;i",n,"0&&l.push(["index[",f,"]-=s",f].join("")),l.push(["++index[",c,"]"].join(""))),l.push("}")}return l.join("\n")}function a(t,e,r){for(var n=t.body,i=[],a=[],o=0;o0&&y.push("shape=SS.slice(0)"),t.indexArgs.length>0){for(var x=new Array(r),l=0;l0&&m.push("var "+y.join(","));for(var l=0;l3&&m.push(a(t.pre,t,s));var k=a(t.body,t,s),A=function(t){for(var e=0,r=t[0].length;e0,u=[],c=0;c0;){"].join("")),u.push(["if(j",c,"<",s,"){"].join("")),u.push(["s",e[c],"=j",c].join("")),u.push(["j",c,"=0"].join("")),u.push(["}else{s",e[c],"=",s].join("")),u.push(["j",c,"-=",s,"}"].join("")),l&&u.push(["index[",e[c],"]=j",c].join(""));for(var c=0;c3&&m.push(a(t.post,t,s)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+m.join("\n")+"\n----------");var T=[t.funcName||"unnamed","_cwise_loop_",o[0].join("s"),"m",A,function(t){for(var e=new Array(t.length),r=!0,n=0;n0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}(s)].join("");return new Function(["function ",T,"(",g.join(","),"){",m.join("\n"),"} return ",T].join(""))()}},{uniq:534}],141:[function(t,e,r){"use strict";var n=t("./compile.js");e.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",t.shimArgs.join(","),"){"].join(""));for(var a=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],u=[],c=0;c0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[c]))),u.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[c])+"]"))}t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}"));for(var c=0;ce?1:t>=e?0:NaN}function r(t){var r;return 1===t.length&&(r=t,t=function(t,n){return e(r(t),n)}),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}var n=r(e),i=n.right,a=n.left;function o(t,e){return[t,e]}function s(t){return null===t?NaN:+t}function l(t,e){var r,n,i=t.length,a=0,o=-1,l=0,u=0;if(null==e)for(;++o1)return u/(a-1)}function u(t,e){var r=l(t,e);return r?Math.sqrt(r):r}function c(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o=r)for(n=i=r;++or&&(n=r),i=r)for(n=i=r;++or&&(n=r),i=0?(a>=m?10:a>=y?5:a>=x?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=m?10:a>=y?5:a>=x?2:1)}function _(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=m?i*=10:a>=y?i*=5:a>=x&&(i*=2),e=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t),l=+r(t[a+1],a+1,t);return o+(l-o)*(i-a)}}function A(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n}function T(t){if(!(i=t.length))return[];for(var e=-1,r=A(t,M),n=new Array(r);++et?1:e>=t?0:NaN},t.deviation=u,t.extent=c,t.histogram=function(){var t=v,e=c,r=w;function n(n){var a,o,s=n.length,l=new Array(s);for(a=0;af;)h.pop(),--p;var d,v=new Array(p+1);for(a=0;a<=p;++a)(d=v[a]=[]).x0=a>0?h[a-1]:c,d.x1=a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a=0;)for(n=t[i],e=n.length;--e>=0;)r[--o]=n[e];return r},t.min=A,t.pairs=function(t,e){null==e&&(e=o);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r0)return[t];if((n=e0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++s=l.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var s,u,f,h=-1,p=n.length,d=l[i++],v=r(),g=a();++hl.length)return r;var i,a=u[n-1];return null!=e&&n>=l.length?i=r.entries():(i=[],r.each(function(e,r){i.push({key:r,values:t(e,n)})})),null!=a?i.sort(function(t,e){return a(t.key,e.key)}):i}(c(t,0,a,o),0)},key:function(t){return l.push(t),s},sortKeys:function(t){return u[l.length-1]=t,s},sortValues:function(e){return t=e,s},rollup:function(t){return e=t,s}}},t.set=u,t.map=r,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],147:[function(t,e,r){var n;n=this,function(t){"use strict";function e(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function r(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function n(){}var i=1/.7,a="\\s*([+-]?\\d+)\\s*",o="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",s="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",l=/^#([0-9a-f]{3})$/,u=/^#([0-9a-f]{6})$/,c=new RegExp("^rgb\\("+[a,a,a]+"\\)$"),f=new RegExp("^rgb\\("+[s,s,s]+"\\)$"),h=new RegExp("^rgba\\("+[a,a,a,o]+"\\)$"),p=new RegExp("^rgba\\("+[s,s,s,o]+"\\)$"),d=new RegExp("^hsl\\("+[o,s,s]+"\\)$"),v=new RegExp("^hsla\\("+[o,s,s,o]+"\\)$"),g={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 m(t){var e;return t=(t+"").trim().toLowerCase(),(e=l.exec(t))?new w((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))?y(parseInt(e[1],16)):(e=c.exec(t))?new w(e[1],e[2],e[3],1):(e=f.exec(t))?new w(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=h.exec(t))?x(e[1],e[2],e[3],e[4]):(e=p.exec(t))?x(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=d.exec(t))?A(e[1],e[2]/100,e[3]/100,1):(e=v.exec(t))?A(e[1],e[2]/100,e[3]/100,e[4]):g.hasOwnProperty(t)?y(g[t]):"transparent"===t?new w(NaN,NaN,NaN,0):null}function y(t){return new w(t>>16&255,t>>8&255,255&t,1)}function x(t,e,r,n){return n<=0&&(t=e=r=NaN),new w(t,e,r,n)}function b(t){return t instanceof n||(t=m(t)),t?new w((t=t.rgb()).r,t.g,t.b,t.opacity):new w}function _(t,e,r,n){return 1===arguments.length?b(t):new w(t,e,r,null==n?1:n)}function w(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function k(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function A(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new M(t,e,r,n)}function T(t,e,r,i){return 1===arguments.length?function(t){if(t instanceof M)return new M(t.h,t.s,t.l,t.opacity);if(t instanceof n||(t=m(t)),!t)return new M;if(t instanceof M)return t;var e=(t=t.rgb()).r/255,r=t.g/255,i=t.b/255,a=Math.min(e,r,i),o=Math.max(e,r,i),s=NaN,l=o-a,u=(o+a)/2;return l?(s=e===o?(r-i)/l+6*(r0&&u<1?0:s,new M(s,l,u,t.opacity)}(t):new M(t,e,r,null==i?1:i)}function M(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function E(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}e(n,m,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),e(w,_,r(n,{brighter:function(t){return t=null==t?i:Math.pow(i,t),new w(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new w(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"#"+k(this.r)+k(this.g)+k(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+")")}})),e(M,T,r(n,{brighter:function(t){return t=null==t?i:Math.pow(i,t),new M(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new M(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,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new w(E(t>=240?t-240:t+120,i,n),E(t,i,n),E(t<120?t+240:t-120,i,n),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 S=Math.PI/180,C=180/Math.PI,L=.96422,O=1,I=.82521,P=4/29,D=6/29,z=3*D*D,R=D*D*D;function F(t){if(t instanceof N)return new N(t.l,t.a,t.b,t.opacity);if(t instanceof W){if(isNaN(t.h))return new N(t.l,0,0,t.opacity);var e=t.h*S;return new N(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof w||(t=b(t));var r,n,i=H(t.r),a=H(t.g),o=H(t.b),s=j((.2225045*i+.7168786*a+.0606169*o)/O);return i===a&&a===o?r=n=s:(r=j((.4360747*i+.3850649*a+.1430804*o)/L),n=j((.0139322*i+.0971045*a+.7141733*o)/I)),new N(116*s-16,500*(r-s),200*(s-n),t.opacity)}function B(t,e,r,n){return 1===arguments.length?F(t):new N(t,e,r,null==n?1:n)}function N(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function j(t){return t>R?Math.pow(t,1/3):t/z+P}function V(t){return t>D?t*t*t:z*(t-P)}function U(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function H(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function q(t){if(t instanceof W)return new W(t.h,t.c,t.l,t.opacity);if(t instanceof N||(t=F(t)),0===t.a&&0===t.b)return new W(NaN,0,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*C;return new W(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function G(t,e,r,n){return 1===arguments.length?q(t):new W(t,e,r,null==n?1:n)}function W(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}e(N,B,r(n,{brighter:function(t){return new N(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new N(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,r=isNaN(this.b)?t:t-this.b/200;return e=L*V(e),t=O*V(t),r=I*V(r),new w(U(3.1338561*e-1.6168667*t-.4906146*r),U(-.9787684*e+1.9161415*t+.033454*r),U(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}})),e(W,G,r(n,{brighter:function(t){return new W(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new W(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return F(this).rgb()}}));var Y=-.14861,X=1.78277,Z=-.29227,$=-.90649,J=1.97294,K=J*$,Q=J*X,tt=X*Z-$*Y;function et(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof rt)return new rt(t.h,t.s,t.l,t.opacity);t instanceof w||(t=b(t));var e=t.r/255,r=t.g/255,n=t.b/255,i=(tt*n+K*e-Q*r)/(tt+K-Q),a=n-i,o=(J*(r-i)-Z*a)/$,s=Math.sqrt(o*o+a*a)/(J*i*(1-i)),l=s?Math.atan2(o,a)*C-120:NaN;return new rt(l<0?l+360:l,s,i,t.opacity)}(t):new rt(t,e,r,null==n?1:n)}function rt(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}e(rt,et,r(n,{brighter:function(t){return t=null==t?i:Math.pow(i,t),new rt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new rt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*S,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),i=Math.sin(t);return new w(255*(e+r*(Y*n+X*i)),255*(e+r*(Z*n+$*i)),255*(e+r*(J*n)),this.opacity)}})),t.color=m,t.rgb=_,t.hsl=T,t.lab=B,t.hcl=G,t.lch=function(t,e,r,n){return 1===arguments.length?q(t):new W(r,e,t,null==n?1:n)},t.gray=function(t,e){return new N(t,0,0,null==e?1:e)},t.cubehelix=et,Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],148:[function(t,e,r){var n;n=this,function(t){"use strict";var e={value:function(){}};function r(){for(var t,e=0,r=arguments.length,i={};e=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),l=-1,u=s.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++l0)for(var r,n,i=new Array(r),a=0;ah+u||np+u||ac.index){var f=h-s.x-s.vx,g=p-s.y-s.vy,m=f*f+g*g;mt.r&&(t.r=t[e].r)}function h(){if(r){var e,i,a=r.length;for(n=new Array(a),e=0;e=u)){(t.data!==r||t.next)&&(0===f&&(f=o(),d+=f*f),0===h&&(h=o(),d+=h*h),d1?(null==r?c.remove(t):c.set(t,y(r)),e):c.get(t)},find:function(e,r,n){var i,a,o,s,l,u=0,c=t.length;for(null==n?n=1/0:n*=n,u=0;u1?(h.on(t,r),e):h.on(t)}}},t.forceX=function(t){var e,r,n,i=a(.1);function o(t){for(var i,a=0,o=e.length;a=0;)e+=r[n].value;else e=1;t.value=e}function a(t,e){var r,n,i,a,s,c=new u(t),f=+t.value&&(c.value=t.value),h=[c];for(null==e&&(e=o);r=h.pop();)if(f&&(r.value=+r.data.value),(i=e(r.data))&&(s=i.length))for(r.children=new Array(s),a=s-1;a>=0;--a)h.push(n=r.children[a]=new u(i[a])),n.parent=r,n.depth=r.depth+1;return c.eachBefore(l)}function o(t){return t.children}function s(t){t.data=t.data.data}function l(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function u(t){this.data=t,this.depth=this.height=0,this.parent=null}u.prototype=a.prototype={constructor:u,count:function(){return this.eachAfter(i)},each:function(t){var e,r,n,i,a=this,o=[a];do{for(e=o.reverse(),o=[];a=e.pop();)if(t(a),r=a.children)for(n=0,i=r.length;n=0;--r)i.push(e[r]);return this},sum:function(t){return this.eachAfter(function(e){for(var r=+t(e.data)||0,n=e.children,i=n&&n.length;--i>=0;)r+=n[i].value;e.value=r})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,r=function(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n},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(r){r!==t&&e.push({source:r.parent,target:r})}),e},copy:function(){return a(this).eachBefore(s)}};var c=Array.prototype.slice;function f(t){for(var e,r,n=0,i=(t=function(t){for(var e,r,n=t.length;n;)r=Math.random()*n--|0,e=t[n],t[n]=t[r],t[r]=e;return t}(c.call(t))).length,a=[];n0&&r*r>n*n+i*i}function v(t,e){for(var r=0;r(o*=o)?(n=(u+o-i)/(2*u),a=Math.sqrt(Math.max(0,o/u-n*n)),r.x=t.x-n*s-a*l,r.y=t.y-n*l+a*s):(n=(u+i-o)/(2*u),a=Math.sqrt(Math.max(0,i/u-n*n)),r.x=e.x+n*s-a*l,r.y=e.y+n*l+a*s)):(r.x=e.x+r.r,r.y=e.y)}function b(t,e){var r=t.r+e.r-1e-6,n=e.x-t.x,i=e.y-t.y;return r>0&&r*r>n*n+i*i}function _(t){var e=t._,r=t.next._,n=e.r+r.r,i=(e.x*r.r+r.x*e.r)/n,a=(e.y*r.r+r.y*e.r)/n;return i*i+a*a}function w(t){this._=t,this.next=null,this.previous=null}function k(t){if(!(i=t.length))return 0;var e,r,n,i,a,o,s,l,u,c,h;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(r=t[1],e.x=-r.r,r.x=e.r,r.y=0,!(i>2))return e.r+r.r;x(r,e,n=t[2]),e=new w(e),r=new w(r),n=new w(n),e.next=n.previous=r,r.next=e.previous=n,n.next=r.previous=e;t:for(s=3;sh&&(h=s),g=c*c*v,(p=Math.max(h/g,g/f))>d){c-=s;break}d=p}m.push(o={value:c,dice:l1?e:1)},r}(G),X=function t(e){function r(t,r,n,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,s,l,u,c,f=-1,h=o.length,p=t.value;++f1?e:1)},r}(G);t.cluster=function(){var t=e,i=1,a=1,o=!1;function s(e){var s,l=0;e.eachAfter(function(e){var i=e.children;i?(e.x=function(t){return t.reduce(r,0)/t.length}(i),e.y=function(t){return 1+t.reduce(n,0)}(i)):(e.x=s?l+=t(e,s):0,e.y=0,s=e)});var u=function(t){for(var e;e=t.children;)t=e[0];return t}(e),c=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),f=u.x-t(u,c)/2,h=c.x+t(c,u)/2;return e.eachAfter(o?function(t){t.x=(t.x-e.x)*i,t.y=(e.y-t.y)*a}:function(t){t.x=(t.x-f)/(h-f)*i,t.y=(1-(e.y?t.y/e.y:1))*a})}return s.separation=function(e){return arguments.length?(t=e,s):t},s.size=function(t){return arguments.length?(o=!1,i=+t[0],a=+t[1],s):o?null:[i,a]},s.nodeSize=function(t){return arguments.length?(o=!0,i=+t[0],a=+t[1],s):o?[i,a]:null},s},t.hierarchy=a,t.pack=function(){var t=null,e=1,r=1,n=T;function i(i){return i.x=e/2,i.y=r/2,t?i.eachBefore(S(t)).eachAfter(C(n,.5)).eachBefore(L(1)):i.eachBefore(S(E)).eachAfter(C(T,1)).eachAfter(C(n,i.r/Math.min(e,r))).eachBefore(L(Math.min(e,r)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=null==(r=e)?null:A(r),i):t;var r},i.size=function(t){return arguments.length?(e=+t[0],r=+t[1],i):[e,r]},i.padding=function(t){return arguments.length?(n="function"==typeof t?t:M(+t),i):n},i},t.packSiblings=function(t){return k(t),t},t.packEnclose=f,t.partition=function(){var t=1,e=1,r=0,n=!1;function i(i){var a=i.height+1;return i.x0=i.y0=r,i.x1=t,i.y1=e/a,i.eachBefore(function(t,e){return function(n){n.children&&I(n,n.x0,t*(n.depth+1)/e,n.x1,t*(n.depth+2)/e);var i=n.x0,a=n.y0,o=n.x1-r,s=n.y1-r;o0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=A(e),r):t},r.parentId=function(t){return arguments.length?(e=A(t),r):e},r},t.tree=function(){var t=B,e=1,r=1,n=null;function i(i){var l=function(t){for(var e,r,n,i,a,o=new H(t,0),s=[o];e=s.pop();)if(n=e._.children)for(e.children=new Array(a=n.length),i=a-1;i>=0;--i)s.push(r=e.children[i]=new H(n[i],i)),r.parent=e;return(o.parent=new H(null,0)).children=[o],o}(i);if(l.eachAfter(a),l.parent.m=-l.z,l.eachBefore(o),n)i.eachBefore(s);else{var u=i,c=i,f=i;i.eachBefore(function(t){t.xc.x&&(c=t),t.depth>f.depth&&(f=t)});var h=u===c?1:t(u,c)/2,p=h-u.x,d=e/(c.x+h+p),v=r/(f.depth||1);i.eachBefore(function(t){t.x=(t.x+p)*d,t.y=t.depth*v})}return i}function a(e){var r=e.children,n=e.parent.children,i=e.i?n[e.i-1]:null;if(r){!function(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(e);var a=(r[0].z+r[r.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,r,n){if(r){for(var i,a=e,o=e,s=r,l=a.parent.children[0],u=a.m,c=o.m,f=s.m,h=l.m;s=j(s),a=N(a),s&&a;)l=N(l),(o=j(o)).a=e,(i=s.z+f-a.z-u+t(s._,a._))>0&&(V(U(s,e,n),e,i),u+=i,c+=i),f+=s.m,u+=a.m,h+=l.m,c+=o.m;s&&!j(o)&&(o.t=s,o.m+=f-c),a&&!N(l)&&(l.t=a,l.m+=u-h,n=e)}return n}(e,i,e.parent.A||n[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*r}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(n=!1,e=+t[0],r=+t[1],i):n?null:[e,r]},i.nodeSize=function(t){return arguments.length?(n=!0,e=+t[0],r=+t[1],i):n?[e,r]:null},i},t.treemap=function(){var t=Y,e=!1,r=1,n=1,i=[0],a=T,o=T,s=T,l=T,u=T;function c(t){return t.x0=t.y0=0,t.x1=r,t.y1=n,t.eachBefore(f),i=[0],e&&t.eachBefore(O),t}function f(e){var r=i[e.depth],n=e.x0+r,c=e.y0+r,f=e.x1-r,h=e.y1-r;f=r-1){var c=s[e];return c.x0=i,c.y0=a,c.x1=o,void(c.y1=l)}for(var f=u[e],h=n/2+f,p=e+1,d=r-1;p>>1;u[v]l-a){var y=(i*m+o*g)/n;t(e,p,g,i,a,y,l),t(p,r,m,y,a,o,l)}else{var x=(a*m+l*g)/n;t(e,p,g,i,a,o,x),t(p,r,m,i,x,o,l)}}(0,l,t.value,e,r,n,i)},t.treemapDice=I,t.treemapSlice=q,t.treemapSliceDice=function(t,e,r,n,i){(1&t.depth?q:I)(t,e,r,n,i)},t.treemapSquarify=Y,t.treemapResquarify=X,Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],151:[function(t,e,r){var n,i;n=this,i=function(t,e){"use strict";function r(t,e,r,n,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*r+(1+3*t+3*a-3*o)*n+o*i)/6}function n(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),a=t[i],o=t[i+1],s=i>0?t[i-1]:2*a-o,l=i180||r<-180?r-360*Math.round(r/360):r):a(isNaN(t)?e:t)}function l(t){return 1==(t=+t)?u:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):a(isNaN(e)?r:e)}}function u(t,e){var r=e-t;return r?o(t,r):a(isNaN(t)?e:t)}var c=function t(r){var n=l(r);function i(t,r){var i=n((t=e.rgb(t)).r,(r=e.rgb(r)).r),a=n(t.g,r.g),o=n(t.b,r.b),s=u(t.opacity,r.opacity);return function(e){return t.r=i(e),t.g=a(e),t.b=o(e),t.opacity=s(e),t+""}}return i.gamma=t,i}(1);function f(t){return function(r){var n,i,a=r.length,o=new Array(a),s=new Array(a),l=new Array(a);for(n=0;na&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:g(r,n)})),a=x.lastIndex;return a180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:g(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}(a.rotate,o.rotate,s,l),function(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:g(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}(a.skewX,o.skewX,s,l),function(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:g(t,r)},{i:s-2,x:g(e,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,r=-1,n=l.length;++r1e-6)if(Math.abs(f*l-u*c)>1e-6&&a){var p=n-o,d=i-s,v=l*l+u*u,g=p*p+d*d,m=Math.sqrt(v),y=Math.sqrt(h),x=a*Math.tan((e-Math.acos((v+h-g)/(2*m*y)))/2),b=x/y,_=x/m;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*c)+","+(r+b*f)),this._+="A"+a+","+a+",0,0,"+ +(f*p>c*d)+","+(this._x1=t+_*l)+","+(this._y1=r+_*u)}else this._+="L"+(this._x1=t)+","+(this._y1=r)},arc:function(t,i,a,o,s,l){t=+t,i=+i;var u=(a=+a)*Math.cos(o),c=a*Math.sin(o),f=t+u,h=i+c,p=1^l,d=l?o-s:s-o;if(a<0)throw new Error("negative radius: "+a);null===this._x1?this._+="M"+f+","+h:(Math.abs(this._x1-f)>1e-6||Math.abs(this._y1-h)>1e-6)&&(this._+="L"+f+","+h),a&&(d<0&&(d=d%r+r),d>n?this._+="A"+a+","+a+",0,1,"+p+","+(t-u)+","+(i-c)+"A"+a+","+a+",0,1,"+p+","+(this._x1=f)+","+(this._y1=h):d>1e-6&&(this._+="A"+a+","+a+",0,"+ +(d>=e)+","+p+","+(this._x1=t+a*Math.cos(s))+","+(this._y1=i+a*Math.sin(s))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}},t.path=a,Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],153:[function(t,e,r){var n;n=this,function(t){"use strict";function e(t,e,r,n){if(isNaN(e)||isNaN(r))return t;var i,a,o,s,l,u,c,f,h,p=t._root,d={data:n},v=t._x0,g=t._y0,m=t._x1,y=t._y1;if(!p)return t._root=d,t;for(;p.length;)if((u=e>=(a=(v+m)/2))?v=a:m=a,(c=r>=(o=(g+y)/2))?g=o:y=o,i=p,!(p=p[f=c<<1|u]))return i[f]=d,t;if(s=+t._x.call(null,p.data),l=+t._y.call(null,p.data),e===s&&r===l)return d.next=p,i?i[f]=d:t._root=d,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(u=e>=(a=(v+m)/2))?v=a:m=a,(c=r>=(o=(g+y)/2))?g=o:y=o}while((f=c<<1|u)==(h=(l>=o)<<1|s>=a));return i[h]=p,i[f]=d,t}var r=function(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i};function n(t){return t[0]}function i(t){return t[1]}function a(t,e,r){var a=new o(null==e?n:e,null==r?i:r,NaN,NaN,NaN,NaN);return null==t?a:a.addAll(t)}function o(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function s(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var l=a.prototype=o.prototype;l.copy=function(){var t,e,r=new o(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=s(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=s(e));return r},l.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},l.addAll=function(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),u=1/0,c=1/0,f=-1/0,h=-1/0;for(n=0;nf&&(f=i),ah&&(h=a));for(ft||t>i||n>e||e>a))return this;var o,s,l=i-r,u=this._root;switch(s=(e<(n+a)/2)<<1|t<(r+i)/2){case 0:do{(o=new Array(4))[s]=u,u=o}while(a=n+(l*=2),t>(i=r+l)||e>a);break;case 1:do{(o=new Array(4))[s]=u,u=o}while(a=n+(l*=2),(r=i-l)>t||e>a);break;case 2:do{(o=new Array(4))[s]=u,u=o}while(n=a-(l*=2),t>(i=r+l)||n>e);break;case 3:do{(o=new Array(4))[s]=u,u=o}while(n=a-(l*=2),(r=i-l)>t||n>e)}this._root&&this._root.length&&(this._root=u)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this},l.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},l.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]]},l.find=function(t,e,n){var i,a,o,s,l,u,c,f=this._x0,h=this._y0,p=this._x1,d=this._y1,v=[],g=this._root;for(g&&v.push(new r(g,f,h,p,d)),null==n?n=1/0:(f=t-n,h=e-n,p=t+n,d=e+n,n*=n);u=v.pop();)if(!(!(g=u.node)||(a=u.x0)>p||(o=u.y0)>d||(s=u.x1)=y)<<1|t>=m)&&(u=v[v.length-1],v[v.length-1]=v[v.length-1-c],v[v.length-1-c]=u)}else{var x=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),_=x*x+b*b;if(_=(s=(d+g)/2))?d=s:g=s,(c=o>=(l=(v+m)/2))?v=l:m=l,e=p,!(p=p[f=c<<1|u]))return this;if(!p.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(r=e,h=f)}for(;p.data!==t;)if(n=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,n?(i?n.next=i:delete n.next,this):e?(i?e[f]=i:delete e[f],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(r?r[h]=p:this._root=p),this):(this._root=i,this)},l.removeAll=function(t){for(var e=0,r=t.length;e1||i>1)}function S(t,e,r){return t.sort(L),t.forEach(function(n,i){var a,o,s=0;if(G(n,r)&&E(n))n.circularPathData.verticalBuffer=s+n.width/2;else{for(var l=0;lo.source.column)){var u=t[l].circularPathData.verticalBuffer+t[l].width/2+e;s=u>s?u:s}n.circularPathData.verticalBuffer=s+n.width/2}}),t}function C(t,r,i,a){var o=e.min(t.links,function(t){return t.source.y0});t.links.forEach(function(t){t.circular&&(t.circularPathData={})});var s=t.links.filter(function(t){return"top"==t.circularLinkType});S(s,r,a);var l=t.links.filter(function(t){return"bottom"==t.circularLinkType});S(l,r,a),t.links.forEach(function(e){if(e.circular){if(e.circularPathData.arcRadius=e.width+w,e.circularPathData.leftNodeBuffer=5,e.circularPathData.rightNodeBuffer=5,e.circularPathData.sourceWidth=e.source.x1-e.source.x0,e.circularPathData.sourceX=e.source.x0+e.circularPathData.sourceWidth,e.circularPathData.targetX=e.target.x0,e.circularPathData.sourceY=e.y0,e.circularPathData.targetY=e.y1,G(e,a)&&E(e))e.circularPathData.leftSmallArcRadius=w+e.width/2,e.circularPathData.leftLargeArcRadius=w+e.width/2,e.circularPathData.rightSmallArcRadius=w+e.width/2,e.circularPathData.rightLargeArcRadius=w+e.width/2,"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=e.source.y1+_+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=e.source.y0-_-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius);else{var s=e.source.column,l=e.circularLinkType,u=t.links.filter(function(t){return t.source.column==s&&t.circularLinkType==l});"bottom"==e.circularLinkType?u.sort(I):u.sort(O);var c=0;u.forEach(function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.leftSmallArcRadius=w+e.width/2+c,e.circularPathData.leftLargeArcRadius=w+e.width/2+n*r+c),c+=t.width}),s=e.target.column,u=t.links.filter(function(t){return t.target.column==s&&t.circularLinkType==l}),"bottom"==e.circularLinkType?u.sort(D):u.sort(P),c=0,u.forEach(function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.rightSmallArcRadius=w+e.width/2+c,e.circularPathData.rightLargeArcRadius=w+e.width/2+n*r+c),c+=t.width}),"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=Math.max(i,e.source.y1,e.target.y1)+_+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=o-_-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius)}e.circularPathData.leftInnerExtent=e.circularPathData.sourceX+e.circularPathData.leftNodeBuffer,e.circularPathData.rightInnerExtent=e.circularPathData.targetX-e.circularPathData.rightNodeBuffer,e.circularPathData.leftFullExtent=e.circularPathData.sourceX+e.circularPathData.leftLargeArcRadius+e.circularPathData.leftNodeBuffer,e.circularPathData.rightFullExtent=e.circularPathData.targetX-e.circularPathData.rightLargeArcRadius-e.circularPathData.rightNodeBuffer}if(e.circular)e.path=function(t){return"top"==t.circularLinkType?"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 0 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY-t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 0 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 0 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY-t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 0 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY:"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 1 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY+t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 1 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 1 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY+t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 1 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY}(e);else{var f=n.linkHorizontal().source(function(t){var e=t.source.x0+(t.source.x1-t.source.x0),r=t.y0;return[e,r]}).target(function(t){var e=t.target.x0,r=t.y1;return[e,r]});e.path=f(e)}})}function L(t,e){return z(t)==z(e)?"bottom"==t.circularLinkType?I(t,e):O(t,e):z(e)-z(t)}function O(t,e){return t.y0-e.y0}function I(t,e){return e.y0-t.y0}function P(t,e){return t.y1-e.y1}function D(t,e){return e.y1-t.y1}function z(t){return t.target.column-t.source.column}function R(t){return t.target.x0-t.source.x1}function F(t,e){var r=T(t),n=R(e)/Math.tan(r),i="up"==q(t)?t.y1+n:t.y1-n;return i}function B(t,e){var r=T(t),n=R(e)/Math.tan(r),i="up"==q(t)?t.y1-n:t.y1+n;return i}function N(t,e,r,n){t.links.forEach(function(i){if(!i.circular&&i.target.column-i.source.column>1){var a=i.source.column+1,o=i.target.column-1,s=1,l=o-a+1;for(s=1;a<=o;a++,s++)t.nodes.forEach(function(o){if(o.column==a){var u,c=s/(l+1),f=Math.pow(1-c,3),h=3*c*Math.pow(1-c,2),p=3*Math.pow(c,2)*(1-c),d=Math.pow(c,3),v=f*i.y0+h*i.y0+p*i.y1+d*i.y1,g=v-i.width/2,m=v+i.width/2;g>o.y0&&ga.y0&&i.y0a.y0&&i.y1a.y1)&&j(t,u,e,r)})):m>o.y0&&mo.y1&&j(t,u,e,r)})):go.y1&&(u=m-o.y0+10,o=j(o,u,e,r),t.nodes.forEach(function(t){b(t,n)!=b(o,n)&&t.column==o.column&&t.y0o.y1&&j(t,u,e,r)}))}})}})}function j(t,e,r,n){return t.y0+e>=r&&t.y1+e<=n&&(t.y0=t.y0+e,t.y1=t.y1+e,t.targetLinks.forEach(function(t){t.y1=t.y1+e}),t.sourceLinks.forEach(function(t){t.y0=t.y0+e})),t}function V(t,e,r,n){t.nodes.forEach(function(i){n&&i.y+(i.y1-i.y0)>e&&(i.y=i.y-(i.y+(i.y1-i.y0)-e));var a=t.links.filter(function(t){return b(t.source,r)==b(i,r)}),o=a.length;o>1&&a.sort(function(t,e){if(!t.circular&&!e.circular){if(t.target.column==e.target.column)return t.y1-e.y1;if(!H(t,e))return t.y1-e.y1;if(t.target.column>e.target.column){var r=B(e,t);return t.y1-r}if(e.target.column>t.target.column){var n=B(t,e);return n-e.y1}}return t.circular&&!e.circular?"top"==t.circularLinkType?-1:1:e.circular&&!t.circular?"top"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&"top"==t.circularLinkType?t.target.column===e.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:t.circularLinkType===e.circularLinkType&&"bottom"==t.circularLinkType?t.target.column===e.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:"top"==t.circularLinkType?-1:1:void 0});var s=i.y0;a.forEach(function(t){t.y0=s+t.width/2,s+=t.width}),a.forEach(function(t,e){if("bottom"==t.circularLinkType){for(var r=e+1,n=0;r1&&n.sort(function(t,e){if(!t.circular&&!e.circular){if(t.source.column==e.source.column)return t.y0-e.y0;if(!H(t,e))return t.y0-e.y0;if(e.source.column0?"up":"down"}function G(t,e){return b(t.source,e)==b(t.target,e)}t.sankeyCircular=function(){var t,n,a=0,b=0,T=1,E=1,S=24,L=g,O=o,I=m,P=y,D=32,z=2,R=null;function F(){var t={nodes:I.apply(null,arguments),links:P.apply(null,arguments)};!function(t){t.nodes.forEach(function(t,e){t.index=e,t.sourceLinks=[],t.targetLinks=[]});var e=r.map(t.nodes,L);t.links.forEach(function(t,r){t.index=r;var n=t.source,i=t.target;"object"!==(void 0===n?"undefined":l(n))&&(n=t.source=x(e,n)),"object"!==(void 0===i?"undefined":l(i))&&(i=t.target=x(e,i)),n.sourceLinks.push(t),i.targetLinks.push(t)})}(t),function(t,e,r){var n=0;if(null===r){for(var a=[],o=0;o0?r+_+w:r,bottom:n=n>0?n+_+w:n,left:a=a>0?a+_+w:a,right:i=i>0?i+_+w:i}}(i),c=function(t,r){var n=e.max(t.nodes,function(t){return t.column}),i=T-a,o=E-b,s=i+r.right+r.left,l=o+r.top+r.bottom,u=i/s,c=o/l;return a=a*u+r.left,T=0==r.right?T:T*u,b=b*c+r.top,E*=c,t.nodes.forEach(function(t){t.x0=a+t.column*((T-a-S)/n),t.x1=t.x0+S}),c}(i,u);s*=c,i.links.forEach(function(t){t.width=t.value*s}),l.forEach(function(t){var e=t.length;t.forEach(function(t,n){t.depth==l.length-1&&1==e?(t.y0=E/2-t.value*s,t.y1=t.y0+t.value*s):0==t.depth&&1==e?(t.y0=E/2-t.value*s,t.y1=t.y0+t.value*s):t.partOfCycle?0==M(t,r)?(t.y0=E/2+n,t.y1=t.y0+t.value*s):"top"==t.circularLinkType?(t.y0=b+n,t.y1=t.y0+t.value*s):(t.y0=E-t.value*s-n,t.y1=t.y0+t.value*s):0==u.top||0==u.bottom?(t.y0=(E-b)/e*n,t.y1=t.y0+t.value*s):(t.y0=(E-b)/2-e/2+n,t.y1=t.y0+t.value*s)})})})(s),m();for(var u=1,c=o;c>0;--c)g(u*=.99,s),m();function g(t,r){var n=l.length;l.forEach(function(i){var a=i.length,o=i[0].depth;i.forEach(function(i){var s;if(i.sourceLinks.length||i.targetLinks.length)if(i.partOfCycle&&M(i,r)>0);else if(0==o&&1==a)s=i.y1-i.y0,i.y0=E/2-s/2,i.y1=E/2+s/2;else if(o==n-1&&1==a)s=i.y1-i.y0,i.y0=E/2-s/2,i.y1=E/2+s/2;else{var l=e.mean(i.sourceLinks,v),u=e.mean(i.targetLinks,d),c=((l&&u?(l+u)/2:l||u)-p(i))*t;i.y0+=c,i.y1+=c}})})}function m(){l.forEach(function(e){var r,n,i,a=b,o=e.length;for(e.sort(f),i=0;i0&&(r.y0+=n,r.y1+=n),a=r.y1+t;if((n=a-t-E)>0)for(a=r.y0-=n,r.y1-=n,i=o-2;i>=0;--i)r=e[i],(n=r.y1+t-a)>0&&(r.y0-=n,r.y1-=n),a=r.y0})}}function j(t){t.nodes.forEach(function(t){t.sourceLinks.sort(c),t.targetLinks.sort(u)}),t.nodes.forEach(function(t){var e=t.y0,r=e,n=t.y1,i=n;t.sourceLinks.forEach(function(t){t.circular?(t.y0=n-t.width/2,n-=t.width):(t.y0=e+t.width/2,e+=t.width)}),t.targetLinks.forEach(function(t){t.circular?(t.y1=i-t.width/2,i-=t.width):(t.y1=r+t.width/2,r+=t.width)})})}return F.nodeId=function(t){return arguments.length?(L="function"==typeof t?t:s(t),F):L},F.nodeAlign=function(t){return arguments.length?(O="function"==typeof t?t:s(t),F):O},F.nodeWidth=function(t){return arguments.length?(S=+t,F):S},F.nodePadding=function(e){return arguments.length?(t=+e,F):t},F.nodes=function(t){return arguments.length?(I="function"==typeof t?t:s(t),F):I},F.links=function(t){return arguments.length?(P="function"==typeof t?t:s(t),F):P},F.size=function(t){return arguments.length?(a=b=0,T=+t[0],E=+t[1],F):[T-a,E-b]},F.extent=function(t){return arguments.length?(a=+t[0][0],T=+t[1][0],b=+t[0][1],E=+t[1][1],F):[[a,b],[T,E]]},F.iterations=function(t){return arguments.length?(D=+t,F):D},F.circularLinkGap=function(t){return arguments.length?(z=+t,F):z},F.nodePaddingRatio=function(t){return arguments.length?(n=+t,F):n},F.sortNodes=function(t){return arguments.length?(R=t,F):R},F.update=function(t){return A(t,L),j(t),t.links.forEach(function(t){t.circular&&(t.circularLinkType=t.y0+t.y1=1?h:t<=-1?-h:Math.asin(t)}function v(t){return t.innerRadius}function g(t){return t.outerRadius}function m(t){return t.startAngle}function y(t){return t.endAngle}function x(t){return t&&t.padAngle}function b(t,e,r,n,i,a,s){var l=t-r,c=e-n,f=(s?a:-a)/u(l*l+c*c),h=f*c,p=-f*l,d=t+h,v=e+p,g=r+h,m=n+p,y=(d+g)/2,x=(v+m)/2,b=g-d,_=m-v,w=b*b+_*_,k=i-a,A=d*m-g*v,T=(_<0?-1:1)*u(o(0,k*k*w-A*A)),M=(A*_-b*T)/w,E=(-A*b-_*T)/w,S=(A*_+b*T)/w,C=(-A*b+_*T)/w,L=M-y,O=E-x,I=S-y,P=C-x;return L*L+O*O>I*I+P*P&&(M=S,E=C),{cx:M,cy:E,x01:-h,y01:-p,x11:M*(i/k-1),y11:E*(i/k-1)}}function _(t){this._context=t}function w(t){return new _(t)}function k(t){return t[0]}function A(t){return t[1]}function T(){var t=k,n=A,i=r(!0),a=null,o=w,s=null;function l(r){var l,u,c,f=r.length,h=!1;for(null==a&&(s=o(c=e.path())),l=0;l<=f;++l)!(l=f;--h)u.point(m[h],y[h]);u.lineEnd(),u.areaEnd()}g&&(m[c]=+t(p,c,r),y[c]=+i(p,c,r),u.point(n?+n(p,c,r):m[c],a?+a(p,c,r):y[c]))}if(d)return u=null,d+""||null}function f(){return T().defined(o).curve(l).context(s)}return c.x=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),n=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),c):t},c.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:r(+t),c):n},c.y=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),a=null,c):i},c.y0=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),c):i},c.y1=function(t){return arguments.length?(a=null==t?null:"function"==typeof t?t:r(+t),c):a},c.lineX0=c.lineY0=function(){return f().x(t).y(i)},c.lineY1=function(){return f().x(t).y(a)},c.lineX1=function(){return f().x(n).y(i)},c.defined=function(t){return arguments.length?(o="function"==typeof t?t:r(!!t),c):o},c.curve=function(t){return arguments.length?(l=t,null!=s&&(u=l(s)),c):l},c.context=function(t){return arguments.length?(null==t?s=u=null:u=l(s=t),c):s},c}function E(t,e){return et?1:e>=t?0:NaN}function S(t){return t}_.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 C=O(w);function L(t){this._curve=t}function O(t){function e(e){return new L(t(e))}return e._curve=t,e}function I(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(O(t)):e()._curve},t}function P(){return I(T().curve(C))}function D(){var t=M().curve(C),e=t.curve,r=t.lineX0,n=t.lineX1,i=t.lineY0,a=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 I(r())},delete t.lineX0,t.lineEndAngle=function(){return I(n())},delete t.lineX1,t.lineInnerRadius=function(){return I(i())},delete t.lineY0,t.lineOuterRadius=function(){return I(a())},delete t.lineY1,t.curve=function(t){return arguments.length?e(O(t)):e()._curve},t}function z(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}L.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 R=Array.prototype.slice;function F(t){return t.source}function B(t){return t.target}function N(t){var n=F,i=B,a=k,o=A,s=null;function l(){var r,l=R.call(arguments),u=n.apply(this,l),c=i.apply(this,l);if(s||(s=r=e.path()),t(s,+a.apply(this,(l[0]=u,l)),+o.apply(this,l),+a.apply(this,(l[0]=c,l)),+o.apply(this,l)),r)return s=null,r+""||null}return l.source=function(t){return arguments.length?(n=t,l):n},l.target=function(t){return arguments.length?(i=t,l):i},l.x=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),l):a},l.y=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),l):o},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function j(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function V(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e,r=(r+i)/2,n,r,n,i)}function U(t,e,r,n,i){var a=z(e,r),o=z(e,r=(r+i)/2),s=z(n,r),l=z(n,i);t.moveTo(a[0],a[1]),t.bezierCurveTo(o[0],o[1],s[0],s[1],l[0],l[1])}var H={draw:function(t,e){var r=Math.sqrt(e/f);t.moveTo(r,0),t.arc(0,0,r,0,p)}},q={draw:function(t,e){var r=Math.sqrt(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},G=Math.sqrt(1/3),W=2*G,Y={draw:function(t,e){var r=Math.sqrt(e/W),n=r*G;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},X=Math.sin(f/10)/Math.sin(7*f/10),Z=Math.sin(p/10)*X,$=-Math.cos(p/10)*X,J={draw:function(t,e){var r=Math.sqrt(.8908130915292852*e),n=Z*r,i=$*r;t.moveTo(0,-r),t.lineTo(n,i);for(var a=1;a<5;++a){var o=p*a/5,s=Math.cos(o),l=Math.sin(o);t.lineTo(l*r,-s*r),t.lineTo(s*n-l*i,l*n+s*i)}t.closePath()}},K={draw:function(t,e){var r=Math.sqrt(e),n=-r/2;t.rect(n,n,r,r)}},Q=Math.sqrt(3),tt={draw:function(t,e){var r=-Math.sqrt(e/(3*Q));t.moveTo(0,2*r),t.lineTo(-Q*r,-r),t.lineTo(Q*r,-r),t.closePath()}},et=-.5,rt=Math.sqrt(3)/2,nt=1/Math.sqrt(12),it=3*(nt/2+1),at={draw:function(t,e){var r=Math.sqrt(e/it),n=r/2,i=r*nt,a=n,o=r*nt+r,s=-a,l=o;t.moveTo(n,i),t.lineTo(a,o),t.lineTo(s,l),t.lineTo(et*n-rt*i,rt*n+et*i),t.lineTo(et*a-rt*o,rt*a+et*o),t.lineTo(et*s-rt*l,rt*s+et*l),t.lineTo(et*n+rt*i,et*i-rt*n),t.lineTo(et*a+rt*o,et*o-rt*a),t.lineTo(et*s+rt*l,et*l-rt*s),t.closePath()}},ot=[H,q,Y,K,J,tt,at];function st(){}function lt(t,e,r){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+r)/6)}function ut(t){this._context=t}function ct(t){this._context=t}function ft(t){this._context=t}function ht(t,e){this._basis=new ut(t),this._beta=e}ut.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:lt(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:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ct.prototype={areaStart:st,areaEnd:st,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:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ft.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 r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ht.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n,i=t[0],a=e[0],o=t[r]-i,s=e[r]-a,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(i+n*o),this._beta*e[l]+(1-this._beta)*(a+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var pt=function t(e){function r(t){return 1===e?new ut(t):new ht(t,e)}return r.beta=function(e){return t(+e)},r}(.85);function dt(t,e,r){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-r),t._x2,t._y2)}function vt(t,e){this._context=t,this._k=(1-e)/6}vt.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:dt(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:dt(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 gt=function t(e){function r(t){return new vt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function mt(t,e){this._context=t,this._k=(1-e)/6}mt.prototype={areaStart:st,areaEnd:st,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:dt(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 yt=function t(e){function r(t){return new mt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function xt(t,e){this._context=t,this._k=(1-e)/6}xt.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:dt(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 bt=function t(e){function r(t){return new xt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function _t(t,e,r){var n=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>c){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>c){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,f=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*u+t._x1*t._l23_2a-e*t._l12_2a)/f,o=(o*u+t._y1*t._l23_2a-r*t._l12_2a)/f}t._context.bezierCurveTo(n,i,a,o,t._x2,t._y2)}function wt(t,e){this._context=t,this._alpha=e}wt.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 r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:_t(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 kt=function t(e){function r(t){return e?new wt(t,e):new vt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function At(t,e){this._context=t,this._alpha=e}At.prototype={areaStart:st,areaEnd:st,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 r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:_t(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 Tt=function t(e){function r(t){return e?new At(t,e):new mt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Mt(t,e){this._context=t,this._alpha=e}Mt.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 r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:_t(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 Et=function t(e){function r(t){return e?new Mt(t,e):new xt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function St(t){this._context=t}function Ct(t){return t<0?-1:1}function Lt(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),o=(r-t._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(Ct(a)+Ct(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Ot(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function It(t,e,r){var n=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-n)/3;t._context.bezierCurveTo(n+s,i+s*e,a-s,o-s*r,a,o)}function Pt(t){this._context=t}function Dt(t){this._context=new zt(t)}function zt(t){this._context=t}function Rt(t){this._context=t}function Ft(t){var e,r,n=t.length-1,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[n-1]=(t[n]+i[n-1])/2,e=0;e1)for(var r,n,i,a=1,o=t[e[0]],s=o.length;a=0;)r[e]=e;return r}function Vt(t,e){return t[e]}function Ut(t){var e=t.map(Ht);return jt(t).sort(function(t,r){return e[t]-e[r]})}function Ht(t){for(var e,r=-1,n=0,i=t.length,a=-1/0;++ra&&(a=e,n=r);return n}function qt(t){var e=t.map(Gt);return jt(t).sort(function(t,r){return e[t]-e[r]})}function Gt(t){for(var e,r=0,n=-1,i=t.length;++n=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 r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}}this._x=t,this._y=e}},t.arc=function(){var t=v,o=g,_=r(0),w=null,k=m,A=y,T=x,M=null;function E(){var r,v,g,m=+t.apply(this,arguments),y=+o.apply(this,arguments),x=k.apply(this,arguments)-h,E=A.apply(this,arguments)-h,S=n(E-x),C=E>x;if(M||(M=r=e.path()),yc)if(S>p-c)M.moveTo(y*a(x),y*l(x)),M.arc(0,0,y,x,E,!C),m>c&&(M.moveTo(m*a(E),m*l(E)),M.arc(0,0,m,E,x,C));else{var L,O,I=x,P=E,D=x,z=E,R=S,F=S,B=T.apply(this,arguments)/2,N=B>c&&(w?+w.apply(this,arguments):u(m*m+y*y)),j=s(n(y-m)/2,+_.apply(this,arguments)),V=j,U=j;if(N>c){var H=d(N/m*l(B)),q=d(N/y*l(B));(R-=2*H)>c?(D+=H*=C?1:-1,z-=H):(R=0,D=z=(x+E)/2),(F-=2*q)>c?(I+=q*=C?1:-1,P-=q):(F=0,I=P=(x+E)/2)}var G=y*a(I),W=y*l(I),Y=m*a(z),X=m*l(z);if(j>c){var Z,$=y*a(P),J=y*l(P),K=m*a(D),Q=m*l(D);if(S1?0:g<-1?f:Math.acos(g))/2),at=u(Z[0]*Z[0]+Z[1]*Z[1]);V=s(j,(m-at)/(it-1)),U=s(j,(y-at)/(it+1))}}F>c?U>c?(L=b(K,Q,G,W,y,U,C),O=b($,J,Y,X,y,U,C),M.moveTo(L.cx+L.x01,L.cy+L.y01),Uc&&R>c?V>c?(L=b(Y,X,$,J,m,-V,C),O=b(G,W,K,Q,m,-V,C),M.lineTo(L.cx+L.x01,L.cy+L.y01),V0&&(d+=f);for(null!=e?v.sort(function(t,r){return e(g[t],g[r])}):null!=n&&v.sort(function(t,e){return n(r[t],r[e])}),s=0,u=d?(y-h*b)/d:0;s0?f*u:0)+b,g[l]={data:r[l],index:s,value:f,startAngle:m,endAngle:c,padAngle:x};return g}return s.value=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,n=null,s):e},s.sort=function(t){return arguments.length?(n=t,e=null,s):n},s.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),s):i},s.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),s):a},s.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),s):o},s},t.areaRadial=D,t.radialArea=D,t.lineRadial=P,t.radialLine=P,t.pointRadial=z,t.linkHorizontal=function(){return N(j)},t.linkVertical=function(){return N(V)},t.linkRadial=function(){var t=N(U);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.symbol=function(){var t=r(H),n=r(64),i=null;function a(){var r;if(i||(i=r=e.path()),t.apply(this,arguments).draw(i,+n.apply(this,arguments)),r)return i=null,r+""||null}return a.type=function(e){return arguments.length?(t="function"==typeof e?e:r(e),a):t},a.size=function(t){return arguments.length?(n="function"==typeof t?t:r(+t),a):n},a.context=function(t){return arguments.length?(i=null==t?null:t,a):i},a},t.symbols=ot,t.symbolCircle=H,t.symbolCross=q,t.symbolDiamond=Y,t.symbolSquare=K,t.symbolStar=J,t.symbolTriangle=tt,t.symbolWye=at,t.curveBasisClosed=function(t){return new ct(t)},t.curveBasisOpen=function(t){return new ft(t)},t.curveBasis=function(t){return new ut(t)},t.curveBundle=pt,t.curveCardinalClosed=yt,t.curveCardinalOpen=bt,t.curveCardinal=gt,t.curveCatmullRomClosed=Tt,t.curveCatmullRomOpen=Et,t.curveCatmullRom=kt,t.curveLinearClosed=function(t){return new St(t)},t.curveLinear=w,t.curveMonotoneX=function(t){return new Pt(t)},t.curveMonotoneY=function(t){return new Dt(t)},t.curveNatural=function(t){return new Rt(t)},t.curveStep=function(t){return new Bt(t,.5)},t.curveStepAfter=function(t){return new Bt(t,1)},t.curveStepBefore=function(t){return new Bt(t,0)},t.stack=function(){var t=r([]),e=jt,n=Nt,i=Vt;function a(r){var a,o,s=t.apply(this,arguments),l=r.length,u=s.length,c=new Array(u);for(a=0;a0){for(var r,n,i,a=0,o=t[0].length;a1)for(var r,n,i,a,o,s,l=0,u=t[e[0]].length;l=0?(n[0]=a,n[1]=a+=i):i<0?(n[1]=o,n[0]=o+=i):n[0]=a},t.stackOffsetNone=Nt,t.stackOffsetSilhouette=function(t,e){if((r=t.length)>0){for(var r,n=0,i=t[e[0]],a=i.length;n0&&(n=(r=t[e[0]]).length)>0){for(var r,n,i,a=0,o=1;o=0&&r._call.call(null,t),r=r._next;--n}function m(){l=(s=c.now())+u,n=i=0;try{g()}finally{n=0,function(){for(var t,n,i=e,a=1/0;i;)i._call?(a>i._time&&(a=i._time),t=i,i=i._next):(n=i._next,i._next=null,i=t?t._next=n:e=n);r=t,x(a)}(),l=0}}function y(){var t=c.now(),e=t-s;e>o&&(u-=e,s=t)}function x(t){if(!n){i&&(i=clearTimeout(i));var e=t-l;e>24?(t<1/0&&(i=setTimeout(m,t-c.now()-u)),a&&(a=clearInterval(a))):(a||(s=c.now(),a=setInterval(y,o)),n=1,f(m))}}d.prototype=v.prototype={constructor:d,restart:function(t,n,i){if("function"!=typeof t)throw new TypeError("callback is not a function");i=(null==i?h():+i)+(null==n?0:+n),this._next||r===this||(r?r._next=this:e=this,r=this),this._call=t,this._time=i,x()},stop:function(){this._call&&(this._call=null,this._time=1/0,x())}},t.now=h,t.timer=v,t.timerFlush=g,t.timeout=function(t,e,r){var n=new d;return e=null==e?0:+e,n.restart(function(r){n.stop(),t(r+e)},e,r),n},t.interval=function(t,e,r){var n=new d,i=e;return null==e?(n.restart(t,e,r),n):(e=+e,r=null==r?h():+r,n.restart(function a(o){o+=i,n.restart(a,i+=e,r),t(o)},e,r),n)},Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],157:[function(t,e,r){!function(){var t={version:"3.5.17"},r=[].slice,n=function(t){return r.call(t)},i=this.document;function a(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(i)try{n(i.documentElement.childNodes)[0].nodeType}catch(t){n=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),i)try{i.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var s=this.Element.prototype,l=s.setAttribute,u=s.setAttributeNS,c=this.CSSStyleDeclaration.prototype,f=c.setProperty;s.setAttribute=function(t,e){l.call(this,t,e+"")},s.setAttributeNS=function(t,e,r){u.call(this,t,e,r+"")},c.setProperty=function(t,e,r){f.call(this,t,e+"",r)}}function h(t,e){return te?1:t>=e?0:NaN}function p(t){return null===t?NaN:+t}function d(t){return!isNaN(t)}function v(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}t.ascending=h,t.descending=function(t,e){return et?1:e>=t?0:NaN},t.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++in&&(r=n)}else{for(;++i=n){r=n;break}for(;++in&&(r=n)}return r},t.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++ir&&(r=n)}else{for(;++i=n){r=n;break}for(;++ir&&(r=n)}return r},t.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a=n){r=i=n;break}for(;++an&&(r=n),i=n){r=i=n;break}for(;++an&&(r=n),i1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var g=v(h);function m(t){return t.length}t.bisectLeft=g.left,t.bisect=t.bisectRight=g.right,t.bisector=function(t){return v(1===t.length?function(e,r){return h(t(e),r)}:t)},t.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,a<2&&(e=0));for(var n,i,a=r-e;a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e=0;)for(n=t[i],e=n.length;--e>=0;)r[--o]=n[e];return r};var y=Math.abs;function x(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function b(){this._=Object.create(null)}t.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r==1/0)throw new Error("infinite range");var n,i=[],a=function(t){for(var e=1;t*e%1;)e*=10;return e}(y(r)),o=-1;if(t*=a,e*=a,(r*=a)<0)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)=i.length)return r?r.call(n,a):e?a.sort(e):a;for(var l,u,c,f,h=-1,p=a.length,d=i[s++],v=new b;++h=i.length)return e;var n=[],o=a[r++];return e.forEach(function(e,i){n.push({key:e,values:t(i,r)})}),o?n.sort(function(t,e){return o(t.key,e.key)}):n}(o(t.map,e,0),0)},n.key=function(t){return i.push(t),n},n.sortKeys=function(t){return a[i.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new L;if(t)for(var r=0,n=t.length;r=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},t.event=null,t.requote=function(t){return t.replace(V,"\\$&")};var V=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,U={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function H(t){return U(t,Y),t}var q=function(t,e){return e.querySelector(t)},G=function(t,e){return e.querySelectorAll(t)},W=function(t,e){var r=t.matches||t[P(t,"matchesSelector")];return(W=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(q=function(t,e){return Sizzle(t,e)[0]||null},G=Sizzle,W=Sizzle.matchesSelector),t.selection=function(){return t.select(i.documentElement)};var Y=t.selection.prototype=[];function X(t){return"function"==typeof t?t:function(){return q(t,this)}}function Z(t){return"function"==typeof t?t:function(){return G(t,this)}}Y.select=function(t){var e,r,n,i,a=[];t=X(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),J.hasOwnProperty(r)?{space:J[r],local:t}:t}},Y.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(K(r,e[r]));return this}return this.each(K(e,r))},Y.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=et(t)).length,i=-1;if(e=r.classList){for(;++i=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},Y.sort=function(t){t=function(t){return arguments.length||(t=h),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}.apply(this,arguments);for(var e=-1,r=this.length;++e0&&(e=e.slice(0,o));var l=dt.get(e);function u(){var t=this[a];t&&(this.removeEventListener(e,t,t.$),delete this[a])}return l&&(e=l,s=gt),o?r?function(){var t=s(r,n(arguments));u.call(this),this.addEventListener(e,this[a]=t,t.$=i),t._=r}:u:r?z:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var i in this)if(r=i.match(n)){var a=this[i];this.removeEventListener(r[1],a,a.$),delete this[i]}}}t.selection.enter=ft,t.selection.enter.prototype=ht,ht.append=Y.append,ht.empty=Y.empty,ht.node=Y.node,ht.call=Y.call,ht.size=Y.size,ht.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++s=n&&(n=e+1);!(o=s[n])&&++n0?1:t<0?-1:0}function It(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function Pt(t){return t>1?0:t<-1?Tt:Math.acos(t)}function Dt(t){return t>1?St:t<-1?-St:Math.asin(t)}function zt(t){return((t=Math.exp(t))+1/t)/2}function Rt(t){return(t=Math.sin(t/2))*t}var Ft=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],u=e[2],c=s-i,f=l-a,h=c*c+f*f;if(h0&&(e=e.transition().duration(v)),e.call(w.event)}function E(){u&&u.domain(l.range().map(function(t){return(t-h.x)/h.k}).map(l.invert)),f&&f.domain(c.range().map(function(t){return(t-h.y)/h.k}).map(c.invert))}function S(t){g++||t({type:"zoomstart"})}function C(t){E(),t({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function L(t){--g||(t({type:"zoomend"}),r=null)}function O(){var e=this,r=_.of(e,arguments),n=0,i=t.select(o(e)).on(y,function(){n=1,T(t.mouse(e),a),C(r)}).on(x,function(){i.on(y,null).on(x,null),s(n),L(r)}),a=k(t.mouse(e)),s=xt(e);fs.call(e),S(r)}function I(){var e,r=this,n=_.of(r,arguments),i={},a=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,u="touchend"+o,c=[],f=t.select(r),p=xt(r);function d(){var n=t.touches(r);return e=h.k,n.forEach(function(t){t.identifier in i&&(i[t.identifier]=k(t))}),n}function v(){var e=t.event.target;t.select(e).on(l,g).on(u,y),c.push(e);for(var n=t.event.changedTouches,o=0,f=n.length;o1){var m=p[0],x=p[1],b=m[0]-x[0],_=m[1]-x[1];a=b*b+_*_}}function g(){var o,l,u,c,f=t.touches(r);fs.call(r);for(var h=0,p=f.length;h360?t-=360:t<0&&(t+=360),t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+e):r+e-r*e),new ae(a(t+120),a(t),a(t-120))}function Gt(e,r,n){return this instanceof Gt?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Gt?new Gt(e.h,e.c,e.l):ee(e instanceof Xt?e.l:(e=he((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Gt(e,r,n)}Ht.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ut(this.h,this.s,this.l/t)},Ht.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ut(this.h,this.s,t*this.l)},Ht.rgb=function(){return qt(this.h,this.s,this.l)},t.hcl=Gt;var Wt=Gt.prototype=new Vt;function Yt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Xt(r,Math.cos(t*=Ct)*e,Math.sin(t)*e)}function Xt(t,e,r){return this instanceof Xt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Xt?new Xt(t.l,t.a,t.b):t instanceof Gt?Yt(t.h,t.c,t.l):he((t=ae(t)).r,t.g,t.b):new Xt(t,e,r)}Wt.brighter=function(t){return new Gt(this.h,this.c,Math.min(100,this.l+Zt*(arguments.length?t:1)))},Wt.darker=function(t){return new Gt(this.h,this.c,Math.max(0,this.l-Zt*(arguments.length?t:1)))},Wt.rgb=function(){return Yt(this.h,this.c,this.l).rgb()},t.lab=Xt;var Zt=18,$t=.95047,Jt=1,Kt=1.08883,Qt=Xt.prototype=new Vt;function te(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return i=re(i)*$t,n=re(n)*Jt,a=re(a)*Kt,new ae(ie(3.2404542*i-1.5371385*n-.4985314*a),ie(-.969266*i+1.8760108*n+.041556*a),ie(.0556434*i-.2040259*n+1.0572252*a))}function ee(t,e,r){return t>0?new Gt(Math.atan2(r,e)*Lt,Math.sqrt(e*e+r*r),t):new Gt(NaN,NaN,t)}function re(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ne(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ie(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ae(t,e,r){return this instanceof ae?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ae?new ae(t.r,t.g,t.b):ce(""+t,ae,qt):new ae(t,e,r)}function oe(t){return new ae(t>>16,t>>8&255,255&t)}function se(t){return oe(t)+""}Qt.brighter=function(t){return new Xt(Math.min(100,this.l+Zt*(arguments.length?t:1)),this.a,this.b)},Qt.darker=function(t){return new Xt(Math.max(0,this.l-Zt*(arguments.length?t:1)),this.a,this.b)},Qt.rgb=function(){return te(this.l,this.a,this.b)},t.rgb=ae;var le=ae.prototype=new Vt;function ue(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ce(t,e,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(de(i[0]),de(i[1]),de(i[2]))}return(a=ve.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function fe(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(e0&&l<1?0:n),new Ut(n,i,l)}function he(t,e,r){t=pe(t),e=pe(e),r=pe(r);var n=ne((.4124564*t+.3575761*e+.1804375*r)/$t),i=ne((.2126729*t+.7151522*e+.072175*r)/Jt),a=ne((.0193339*t+.119192*e+.9503041*r)/Kt);return Xt(116*i-16,500*(n-i),200*(i-a))}function pe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function de(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}le.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,i=30;return e||r||n?(e&&e=200&&e<300||304===e){try{t=i.call(o,u)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,u)}return!this.XDomainRequest||"withCredentials"in u||!/^(http(s)?:)?\/\//.test(e)||(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=f:u.onreadystatechange=function(){u.readyState>3&&f()},u.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,u)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(c=t,o):c},o.response=function(t){return i=t,o},["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}}),o.send=function(t,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),u.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),u.setRequestHeader)for(var a in l)u.setRequestHeader(a,l[a]);return null!=r&&u.overrideMimeType&&u.overrideMimeType(r),null!=c&&(u.responseType=c),null!=i&&o.on("error",i).on("load",function(t){i(null,t)}),s.beforesend.call(o,u),u.send(null==n?null:n),o},o.abort=function(){return u.abort(),o},t.rebind(o,s,"on"),null==a?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(a))}ve.forEach(function(t,e){ve.set(t,oe(e))}),t.functor=ge,t.xhr=me(O),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function i(t,r,n){arguments.length<3&&(n=r,r=null);var i=ye(t,e,null==r?a:o(r),n);return i.row=function(t){return arguments.length?i.response(null==(r=t)?a:o(t)):r},i}function a(t){return i.parse(t.responseText)}function o(t){return function(e){return i.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return i.parse=function(t,e){var r;return i.parseRows(t,function(t,n){if(r)return r(t,n-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");r=e?function(t,r){return e(i(t),r)}:i})},i.parseRows=function(t,e){var r,i,a={},o={},s=[],l=t.length,u=0,c=0;function f(){if(u>=l)return o;if(i)return i=!1,a;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(we),we=setTimeout(Te,e)),_e=0):(_e=1,ke(Te))}function Me(){for(var t=Date.now(),e=xe;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Ee(){for(var t,e=xe,r=1/0;e;)e.c?(e.t8?function(t){return t/r}:function(t){return t*r},symbol:t}});t.formatPrefix=function(e,r){var n=0;return(e=+e)&&(e<0&&(e*=-1),r&&(e=t.round(e,Se(e,r))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Ce[8+n/3]};var Le=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Oe=t.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(e,r){return(e=t.round(e,Se(e,r))).toFixed(Math.max(0,Math.min(20,Se(e*(1+1e-15),r))))}});function Ie(t){return t+""}var Pe=t.time={},De=Date;function ze(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}ze.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Re.setUTCDate.apply(this._,arguments)},setDay:function(){Re.setUTCDay.apply(this._,arguments)},setFullYear:function(){Re.setUTCFullYear.apply(this._,arguments)},setHours:function(){Re.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Re.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Re.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Re.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Re.setUTCSeconds.apply(this._,arguments)},setTime:function(){Re.setTime.apply(this._,arguments)}};var Re=Date.prototype;function Fe(t,e,r){function n(e){var r=t(e),n=a(r,1);return e-r1)for(;o68?1900:2e3),r+i[0].length):-1}function $e(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Je(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Ke(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Qe(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function tr(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function er(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function rr(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function nr(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function ir(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=y(e)/60|0,i=y(e)%60;return r+Ue(n,"0",2)+Ue(i,"0",2)}function ar(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function or(t){for(var e=t.length,r=-1;++r0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(r-=s,r+s)),!((l+=s+1)>e));)s=i[o=(o+1)%i.length];return a.reverse().join(n)}:O;return function(e){var n=Le.exec(e),i=n[1]||" ",s=n[2]||">",l=n[3]||"-",u=n[4]||"",c=n[5],f=+n[6],h=n[7],p=n[8],d=n[9],v=1,g="",m="",y=!1,x=!0;switch(p&&(p=+p.substring(1)),(c||"0"===i&&"="===s)&&(c=i="0",s="="),d){case"n":h=!0,d="g";break;case"%":v=100,m="%",d="f";break;case"p":v=100,m="%",d="r";break;case"b":case"o":case"x":case"X":"#"===u&&(g="0"+d.toLowerCase());case"c":x=!1;case"d":y=!0,p=0;break;case"s":v=-1,d="r"}"$"===u&&(g=a[0],m=a[1]),"r"!=d||p||(d="g"),null!=p&&("g"==d?p=Math.max(1,Math.min(21,p)):"e"!=d&&"f"!=d||(p=Math.max(0,Math.min(20,p)))),d=Oe.get(d)||Ie;var b=c&&h;return function(e){var n=m;if(y&&e%1)return"";var a=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===l?"":l;if(v<0){var u=t.formatPrefix(e,p);e=u.scale(e),n=u.symbol+m}else e*=v;var _,w,k=(e=d(e,p)).lastIndexOf(".");if(k<0){var A=x?e.lastIndexOf("e"):-1;A<0?(_=e,w=""):(_=e.substring(0,A),w=e.substring(A))}else _=e.substring(0,k),w=r+e.substring(k+1);!c&&h&&(_=o(_,1/0));var T=g.length+_.length+w.length+(b?0:a.length),M=T"===s?M+a+e:"^"===s?M.substring(0,T>>=1)+a+e+M.substring(T):a+(b?e:M+e))+n}}}(e),timeFormat:function(e){var r=e.dateTime,n=e.date,i=e.time,a=e.periods,o=e.days,s=e.shortDays,l=e.months,u=e.shortMonths;function c(t){var e=t.length;function r(r){for(var n,i,a,o=[],s=-1,l=0;++s=u)return-1;if(37===(i=e.charCodeAt(s++))){if(o=e.charAt(s++),!(a=w[o in Ne?e.charAt(s++):o])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}c.utc=function(t){var e=c(t);function r(t){try{var r=new(De=ze);return r._=t,e(r)}finally{De=Date}}return r.parse=function(t){try{De=ze;var r=e.parse(t);return r&&r._}finally{De=Date}},r.toString=e.toString,r},c.multi=c.utc.multi=or;var h=t.map(),p=He(o),d=qe(o),v=He(s),g=qe(s),m=He(l),y=qe(l),x=He(u),b=qe(u);a.forEach(function(t,e){h.set(t.toLowerCase(),e)});var _={a:function(t){return s[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return l[t.getMonth()]},c:c(r),d:function(t,e){return Ue(t.getDate(),e,2)},e:function(t,e){return Ue(t.getDate(),e,2)},H:function(t,e){return Ue(t.getHours(),e,2)},I:function(t,e){return Ue(t.getHours()%12||12,e,2)},j:function(t,e){return Ue(1+Pe.dayOfYear(t),e,3)},L:function(t,e){return Ue(t.getMilliseconds(),e,3)},m:function(t,e){return Ue(t.getMonth()+1,e,2)},M:function(t,e){return Ue(t.getMinutes(),e,2)},p:function(t){return a[+(t.getHours()>=12)]},S:function(t,e){return Ue(t.getSeconds(),e,2)},U:function(t,e){return Ue(Pe.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ue(Pe.mondayOfYear(t),e,2)},x:c(n),X:c(i),y:function(t,e){return Ue(t.getFullYear()%100,e,2)},Y:function(t,e){return Ue(t.getFullYear()%1e4,e,4)},Z:ir,"%":function(){return"%"}},w={a:function(t,e,r){v.lastIndex=0;var n=v.exec(e.slice(r));return n?(t.w=g.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){p.lastIndex=0;var n=p.exec(e.slice(r));return n?(t.w=d.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){x.lastIndex=0;var n=x.exec(e.slice(r));return n?(t.m=b.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){m.lastIndex=0;var n=m.exec(e.slice(r));return n?(t.m=y.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,r){return f(t,_.c.toString(),e,r)},d:Ke,e:Ke,H:tr,I:tr,j:Qe,L:nr,m:Je,M:er,p:function(t,e,r){var n=h.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:rr,U:We,w:Ge,W:Ye,x:function(t,e,r){return f(t,_.x.toString(),e,r)},X:function(t,e,r){return f(t,_.X.toString(),e,r)},y:Ze,Y:Xe,Z:$e,"%":ar};return c}(e)}};var sr=t.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",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"]});function lr(){}t.format=sr.numberFormat,t.geo={},lr.prototype={s:0,t:0,add:function(t){cr(t,this.t,ur),cr(ur.s,this.s,this),this.s?this.t+=ur.t:this.s=ur.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ur=new lr;function cr(t,e,r){var n=r.s=t+e,i=n-t,a=n-i;r.t=t-a+(e-i)}function fr(t,e){t&&pr.hasOwnProperty(t.type)&&pr[t.type](t,e)}t.geo.stream=function(t,e){t&&hr.hasOwnProperty(t.type)?hr[t.type](t,e):fr(t,e)};var hr={Feature:function(t,e){fr(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n=0?1:-1,s=o*a,l=Math.cos(e),u=Math.sin(e),c=i*u,f=n*l+c*Math.cos(s),h=c*o*Math.sin(s);Sr.add(Math.atan2(h,f)),r=t,n=l,i=u}Cr.point=function(o,s){Cr.point=a,r=(t=o)*Ct,n=Math.cos(s=(e=s)*Ct/2+Tt/4),i=Math.sin(s)},Cr.lineEnd=function(){a(t,e)}}function Or(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function Ir(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Pr(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 Dr(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function zr(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Rr(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Fr(t){return[Math.atan2(t[1],t[0]),Dt(t[2])]}function Br(t,e){return y(t[0]-e[0])kt?i=90:u<-kt&&(r=-90),f[0]=e,f[1]=n}};function p(t,a){c.push(f=[e=t,n=t]),ai&&(i=a)}function d(t,o){var s=Or([t*Ct,o*Ct]);if(l){var u=Pr(l,s),c=[u[1],-u[0],0],f=Pr(c,u);Rr(f),f=Fr(f);var h=t-a,d=h>0?1:-1,v=f[0]*Lt*d,g=y(h)>180;if(g^(d*ai&&(i=m)}else if(g^(d*a<(v=(v+360)%360-180)&&vi&&(i=o);g?t_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t):n>=e?(tn&&(n=t)):t>a?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t)}else p(t,o);l=s,a=t}function v(){h.point=d}function g(){f[0]=e,f[1]=n,h.point=p,l=null}function m(t,e){if(l){var r=t-a;u+=y(r)>180?r+(r>0?360:-360):r}else o=t,s=e;Cr.point(t,e),d(t,e)}function x(){Cr.lineStart()}function b(){m(o,s),Cr.lineEnd(),y(u)>kt&&(e=-(n=180)),f[0]=e,f[1]=n,l=null}function _(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function k(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t_(l[0],l[1])&&(l[1]=d[1]),_(d[0],l[1])>_(l[0],l[1])&&(l[0]=d[0])):u.push(l=d);for(var p,d,v=-1/0,o=u.length-1,s=0,l=u[o];s<=o;l=d,++s)d=u[s],(p=_(l[1],d[0]))>v&&(v=p,e=d[0],n=l[1])}return c=f=null,e===1/0||r===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,r],[n,i]]}}(),t.geo.centroid=function(e){mr=yr=xr=br=_r=wr=kr=Ar=Tr=Mr=Er=0,t.geo.stream(e,Nr);var r=Tr,n=Mr,i=Er,a=r*r+n*n+i*i;return a=0;--s)i.point((f=c[s])[0],f[1]);else n(p.x,p.p.x,-1,i);p=p.p}p=p.o,c=p.z,d=!d}while(!p.v);i.lineEnd()}}}function Xr(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n=0?1:-1,k=w*_,A=k>Tt,T=d*x;if(Sr.add(Math.atan2(T*w*Math.sin(k),v*b+T*Math.cos(k))),a+=A?_+w*Mt:_,A^h>=r^m>=r){var M=Pr(Or(f),Or(t));Rr(M);var E=Pr(i,M);Rr(E);var S=(A^_>=0?-1:1)*Dt(E[2]);(n>S||n===S&&(M[0]||M[1]))&&(o+=A^_>=0?1:-1)}if(!g++)break;h=m,d=x,v=b,f=t}}return(a<-kt||a0){for(x||(o.polygonStart(),x=!0),o.lineStart();++a1&&2&e&&r.push(r.pop().concat(r.shift())),s.push(r.filter(Jr))}return c}}function Jr(t){return t.length>1}function Kr(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:z,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Qr(t,e){return((t=t.x)[0]<0?t[1]-St-kt:St-t[1])-((e=e.x)[0]<0?e[1]-St-kt:St-e[1])}var tn=$r(Wr,function(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?Tt:-Tt,l=y(a-r);y(l-Tt)0?St:-St),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=Tt&&(y(r-i)kt?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}(r,n,a,o),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=a,n=o),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}},function(t,e,r,n){var i;if(null==t)i=r*St,n.point(-Tt,i),n.point(0,i),n.point(Tt,i),n.point(Tt,0),n.point(Tt,-i),n.point(0,-i),n.point(-Tt,-i),n.point(-Tt,0),n.point(-Tt,i);else if(y(t[0]-e[0])>kt){var a=t[0]0)){if(a/=d,d<0){if(a0){if(a>p)return;a>h&&(h=a)}if(a=r-l,d||!(a<0)){if(a/=d,d<0){if(a>p)return;a>h&&(h=a)}else if(d>0){if(a0)){if(a/=v,v<0){if(a0){if(a>p)return;a>h&&(h=a)}if(a=n-u,v||!(a<0)){if(a/=v,v<0){if(a>p)return;a>h&&(h=a)}else if(v>0){if(a0&&(i.a={x:l+h*d,y:u+h*v}),p<1&&(i.b={x:l+p*d,y:u+p*v}),i}}}}}}var rn=1e9;function nn(e,r,n,i){return function(l){var u,c,f,h,p,d,v,g,m,y,x,b=l,_=Kr(),w=en(e,r,n,i),k={point:M,lineStart:function(){k.point=E,c&&c.push(f=[]),y=!0,m=!1,v=g=NaN},lineEnd:function(){u&&(E(h,p),d&&m&&_.rejoin(),u.push(_.buffer())),k.point=M,m&&l.lineEnd()},polygonStart:function(){l=_,u=[],c=[],x=!0},polygonEnd:function(){l=b,u=t.merge(u);var r=function(t){for(var e=0,r=c.length,n=t[1],i=0;in&&It(u,a,t)>0&&++e:a[1]<=n&&It(u,a,t)<0&&--e,u=a;return 0!==e}([e,i]),n=x&&r,a=u.length;(n||a)&&(l.polygonStart(),n&&(l.lineStart(),A(null,null,1,l),l.lineEnd()),a&&Yr(u,o,r,A,l),l.polygonEnd()),u=c=f=null}};function A(t,o,l,u){var c=0,f=0;if(null==t||(c=a(t,l))!==(f=a(o,l))||s(t,o)<0^l>0)do{u.point(0===c||3===c?e:n,c>1?i:r)}while((c=(c+l+4)%4)!==f);else u.point(o[0],o[1])}function T(t,a){return e<=t&&t<=n&&r<=a&&a<=i}function M(t,e){T(t,e)&&l.point(t,e)}function E(t,e){t=Math.max(-rn,Math.min(rn,t)),e=Math.max(-rn,Math.min(rn,e));var r=T(t,e);if(c&&f.push([t,e]),y)h=t,p=e,d=r,y=!1,r&&(l.lineStart(),l.point(t,e));else if(r&&m)l.point(t,e);else{var n={a:{x:v,y:g},b:{x:t,y:e}};w(n)?(m||(l.lineStart(),l.point(n.a.x,n.a.y)),l.point(n.b.x,n.b.y),r||l.lineEnd(),x=!1):r&&(l.lineStart(),l.point(t,e),x=!1)}v=t,g=e,m=r}return k};function a(t,i){return y(t[0]-e)0?0:3:y(t[0]-n)0?2:1:y(t[1]-r)0?1:0:i>0?3:2}function o(t,e){return s(t.x,e.x)}function s(t,e){var r=a(t,1),n=a(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}}function an(t){var e=0,r=Tt/3,n=Cn(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*Tt/180,r=t[1]*Tt/180):[e/Tt*180,r/Tt*180]},i}function on(t,e){var r=Math.sin(t),n=(r+Math.sin(e))/2,i=1+r*(2*n-r),a=Math.sqrt(i)/n;function o(t,e){var r=Math.sqrt(i-2*n*Math.sin(e))/n;return[r*Math.sin(t*=n),a-r*Math.cos(t)]}return o.invert=function(t,e){var r=a-e;return[Math.atan2(t,r)/n,Dt((i-(t*t+r*r)*n*n)/(2*n))]},o}t.geo.clipExtent=function(){var t,e,r,n,i,a,o={stream:function(t){return i&&(i.valid=!1),(i=a(t)).valid=!0,i},extent:function(s){return arguments.length?(a=nn(t=+s[0][0],e=+s[0][1],r=+s[1][0],n=+s[1][1]),i&&(i.valid=!1,i=null),o):[[t,e],[r,n]]}};return o.extent([[0,0],[960,500]])},(t.geo.conicEqualArea=function(){return an(on)}).raw=on,t.geo.albers=function(){return t.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},t.geo.albersUsa=function(){var e,r,n,i,a=t.geo.albers(),o=t.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=t.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,r){e=[t,r]}};function u(t){var a=t[0],o=t[1];return e=null,r(a,o),e||(n(a,o),e)||i(a,o),e}return u.invert=function(t){var e=a.scale(),r=a.translate(),n=(t[0]-r[0])/e,i=(t[1]-r[1])/e;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?o:i>=.166&&i<.234&&n>=-.214&&n<-.115?s:a).invert(t)},u.stream=function(t){var e=a.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,i){e.point(t,i),r.point(t,i),n.point(t,i)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},u.precision=function(t){return arguments.length?(a.precision(t),o.precision(t),s.precision(t),u):a.precision()},u.scale=function(t){return arguments.length?(a.scale(t),o.scale(.35*t),s.scale(t),u.translate(a.translate())):a.scale()},u.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),c=+t[0],f=+t[1];return r=a.translate(t).clipExtent([[c-.455*e,f-.238*e],[c+.455*e,f+.238*e]]).stream(l).point,n=o.translate([c-.307*e,f+.201*e]).clipExtent([[c-.425*e+kt,f+.12*e+kt],[c-.214*e-kt,f+.234*e-kt]]).stream(l).point,i=s.translate([c-.205*e,f+.212*e]).clipExtent([[c-.214*e+kt,f+.166*e+kt],[c-.115*e-kt,f+.234*e-kt]]).stream(l).point,u},u.scale(1070)};var sn,ln,un,cn,fn,hn,pn={point:z,lineStart:z,lineEnd:z,polygonStart:function(){ln=0,pn.lineStart=dn},polygonEnd:function(){pn.lineStart=pn.lineEnd=pn.point=z,sn+=y(ln/2)}};function dn(){var t,e,r,n;function i(t,e){ln+=n*t-r*e,r=t,n=e}pn.point=function(a,o){pn.point=i,t=r=a,e=n=o},pn.lineEnd=function(){i(t,e)}}var vn={point:function(t,e){tfn&&(fn=t),ehn&&(hn=e)},lineStart:z,lineEnd:z,polygonStart:z,polygonEnd:z};function gn(){var t=mn(4.5),e=[],r={point:n,lineStart:function(){r.point=i},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(e){return t=mn(e),r},result:function(){if(e.length){var t=e.join("");return e=[],t}}};function n(r,n){e.push("M",r,",",n,t)}function i(t,n){e.push("M",t,",",n),r.point=a}function a(t,r){e.push("L",t,",",r)}function o(){r.point=n}function s(){e.push("Z")}return r}function mn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}var yn,xn={point:bn,lineStart:_n,lineEnd:wn,polygonStart:function(){xn.lineStart=kn},polygonEnd:function(){xn.point=bn,xn.lineStart=_n,xn.lineEnd=wn}};function bn(t,e){xr+=t,br+=e,++_r}function _n(){var t,e;function r(r,n){var i=r-t,a=n-e,o=Math.sqrt(i*i+a*a);wr+=o*(t+r)/2,kr+=o*(e+n)/2,Ar+=o,bn(t=r,e=n)}xn.point=function(n,i){xn.point=r,bn(t=n,e=i)}}function wn(){xn.point=bn}function kn(){var t,e,r,n;function i(t,e){var i=t-r,a=e-n,o=Math.sqrt(i*i+a*a);wr+=o*(r+t)/2,kr+=o*(n+e)/2,Ar+=o,Tr+=(o=n*t-r*e)*(r+t),Mr+=o*(n+e),Er+=3*o,bn(r=t,n=e)}xn.point=function(a,o){xn.point=i,bn(t=r=a,e=n=o)},xn.lineEnd=function(){i(t,e)}}function An(t){var e=4.5,r={point:n,lineStart:function(){r.point=i},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(t){return e=t,r},result:z};function n(r,n){t.moveTo(r+e,n),t.arc(r,n,e,0,Mt)}function i(e,n){t.moveTo(e,n),r.point=a}function a(e,r){t.lineTo(e,r)}function o(){r.point=n}function s(){t.closePath()}return r}function Tn(t){var e=.5,r=Math.cos(30*Ct),n=16;function i(e){return(n?function(e){var r,i,o,s,l,u,c,f,h,p,d,v,g={point:m,lineStart:y,lineEnd:b,polygonStart:function(){e.polygonStart(),g.lineStart=_},polygonEnd:function(){e.polygonEnd(),g.lineStart=y}};function m(r,n){r=t(r,n),e.point(r[0],r[1])}function y(){f=NaN,g.point=x,e.lineStart()}function x(r,i){var o=Or([r,i]),s=t(r,i);a(f,h,c,p,d,v,f=s[0],h=s[1],c=r,p=o[0],d=o[1],v=o[2],n,e),e.point(f,h)}function b(){g.point=m,e.lineEnd()}function _(){y(),g.point=w,g.lineEnd=k}function w(t,e){x(r=t,e),i=f,o=h,s=p,l=d,u=v,g.point=x}function k(){a(f,h,c,p,d,v,i,o,r,s,l,u,n,e),g.lineEnd=b,b()}return g}:function(e){return En(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})})(e)}function a(n,i,o,s,l,u,c,f,h,p,d,v,g,m){var x=c-n,b=f-i,_=x*x+b*b;if(_>4*e&&g--){var w=s+p,k=l+d,A=u+v,T=Math.sqrt(w*w+k*k+A*A),M=Math.asin(A/=T),E=y(y(A)-1)e||y((x*O+b*I)/_-.5)>.3||s*p+l*d+u*v0&&16,i):Math.sqrt(e)},i}function Mn(t){this.stream=t}function En(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Sn(t){return Cn(function(){return t})()}function Cn(e){var r,n,i,a,o,s,l=Tn(function(t,e){return[(t=r(t,e))[0]*u+a,o-t[1]*u]}),u=150,c=480,f=250,h=0,p=0,d=0,v=0,g=0,m=tn,x=O,b=null,_=null;function w(t){return[(t=i(t[0]*Ct,t[1]*Ct))[0]*u+a,o-t[1]*u]}function k(t){return(t=i.invert((t[0]-a)/u,(o-t[1])/u))&&[t[0]*Lt,t[1]*Lt]}function A(){i=Gr(n=Pn(d,v,g),r);var t=r(h,p);return a=c-t[0]*u,o=f+t[1]*u,T()}function T(){return s&&(s.valid=!1,s=null),w}return w.stream=function(t){return s&&(s.valid=!1),(s=Ln(m(n,l(x(t))))).valid=!0,s},w.clipAngle=function(t){return arguments.length?(m=null==t?(b=t,tn):function(t){var e=Math.cos(t),r=e>0,n=y(e)>kt;return $r(i,function(t){var e,s,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(f,h){var p,d=[f,h],v=i(f,h),g=r?v?0:o(f,h):v?o(f+(f<0?Tt:-Tt),h):0;if(!e&&(u=l=v)&&t.lineStart(),v!==l&&(p=a(e,d),(Br(e,p)||Br(d,p))&&(d[0]+=kt,d[1]+=kt,v=i(d[0],d[1]))),v!==l)c=0,v?(t.lineStart(),p=a(d,e),t.point(p[0],p[1])):(p=a(e,d),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(n&&e&&r^v){var m;g&s||!(m=a(d,e,!0))||(c=0,r?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!v||e&&Br(e,d)||t.point(d[0],d[1]),e=d,l=v,s=g},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return c|(u&&l)<<1}}},Fn(t,6*Ct),r?[0,-t]:[-Tt,t-Tt]);function i(t,r){return Math.cos(t)*Math.cos(r)>e}function a(t,r,n){var i=Or(t),a=Or(r),o=[1,0,0],s=Pr(i,a),l=Ir(s,s),u=s[0],c=l-u*u;if(!c)return!n&&t;var f=e*l/c,h=-e*u/c,p=Pr(o,s),d=zr(o,f),v=zr(s,h);Dr(d,v);var g=p,m=Ir(d,g),x=Ir(g,g),b=m*m-x*(Ir(d,d)-1);if(!(b<0)){var _=Math.sqrt(b),w=zr(g,(-m-_)/x);if(Dr(w,d),w=Fr(w),!n)return w;var k,A=t[0],T=r[0],M=t[1],E=r[1];T0^w[1]<(y(w[0]-A)Tt^(A<=w[0]&&w[0]<=T)){var O=zr(g,(-m+_)/x);return Dr(O,d),[w,Fr(O)]}}}function o(e,n){var i=r?t:Tt-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}}((b=+t)*Ct),T()):b},w.clipExtent=function(t){return arguments.length?(_=t,x=t?nn(t[0][0],t[0][1],t[1][0],t[1][1]):O,T()):_},w.scale=function(t){return arguments.length?(u=+t,A()):u},w.translate=function(t){return arguments.length?(c=+t[0],f=+t[1],A()):[c,f]},w.center=function(t){return arguments.length?(h=t[0]%360*Ct,p=t[1]%360*Ct,A()):[h*Lt,p*Lt]},w.rotate=function(t){return arguments.length?(d=t[0]%360*Ct,v=t[1]%360*Ct,g=t.length>2?t[2]%360*Ct:0,A()):[d*Lt,v*Lt,g*Lt]},t.rebind(w,l,"precision"),function(){return r=e.apply(this,arguments),w.invert=r.invert&&k,A()}}function Ln(t){return En(t,function(e,r){t.point(e*Ct,r*Ct)})}function On(t,e){return[t,e]}function In(t,e){return[t>Tt?t-Mt:t<-Tt?t+Mt:t,e]}function Pn(t,e,r){return t?e||r?Gr(zn(t),Rn(e,r)):zn(t):e||r?Rn(e,r):In}function Dn(t){return function(e,r){return[(e+=t)>Tt?e-Mt:e<-Tt?e+Mt:e,r]}}function zn(t){var e=Dn(t);return e.invert=Dn(-t),e}function Rn(t,e){var r=Math.cos(t),n=Math.sin(t),i=Math.cos(e),a=Math.sin(e);function o(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,u=Math.sin(e),c=u*r+s*n;return[Math.atan2(l*i-c*a,s*r-u*n),Dt(c*i+l*a)]}return o.invert=function(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,u=Math.sin(e),c=u*i-l*a;return[Math.atan2(l*i+u*a,s*r+c*n),Dt(c*r-s*n)]},o}function Fn(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=Bn(r,i),a=Bn(r,a),(o>0?ia)&&(i+=o*Mt)):(i=t+o*Mt,a=t-.5*l);for(var u,c=i;o>0?c>a:c2?t[2]*Ct:0),e.invert=function(e){return(e=t.invert(e[0]*Ct,e[1]*Ct))[0]*=Lt,e[1]*=Lt,e},e},In.invert=On,t.geo.circle=function(){var t,e,r=[0,0],n=6;function i(){var t="function"==typeof r?r.apply(this,arguments):r,n=Pn(-t[0]*Ct,-t[1]*Ct,0).invert,i=[];return e(null,null,1,{point:function(t,e){i.push(t=n(t,e)),t[0]*=Lt,t[1]*=Lt}}),{type:"Polygon",coordinates:[i]}}return i.origin=function(t){return arguments.length?(r=t,i):r},i.angle=function(r){return arguments.length?(e=Fn((t=+r)*Ct,n*Ct),i):t},i.precision=function(r){return arguments.length?(e=Fn(t*Ct,(n=+r)*Ct),i):n},i.angle(90)},t.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Ct,i=t[1]*Ct,a=e[1]*Ct,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),u=Math.cos(i),c=Math.sin(a),f=Math.cos(a);return Math.atan2(Math.sqrt((r=f*o)*r+(r=u*c-l*f*s)*r),l*c+u*f*s)},t.geo.graticule=function(){var e,r,n,i,a,o,s,l,u,c,f,h,p=10,d=p,v=90,g=360,m=2.5;function x(){return{type:"MultiLineString",coordinates:b()}}function b(){return t.range(Math.ceil(i/v)*v,n,v).map(f).concat(t.range(Math.ceil(l/g)*g,s,g).map(h)).concat(t.range(Math.ceil(r/p)*p,e,p).filter(function(t){return y(t%v)>kt}).map(u)).concat(t.range(Math.ceil(o/d)*d,a,d).filter(function(t){return y(t%g)>kt}).map(c))}return x.lines=function(){return b().map(function(t){return{type:"LineString",coordinates:t}})},x.outline=function(){return{type:"Polygon",coordinates:[f(i).concat(h(s).slice(1),f(n).reverse().slice(1),h(l).reverse().slice(1))]}},x.extent=function(t){return arguments.length?x.majorExtent(t).minorExtent(t):x.minorExtent()},x.majorExtent=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],l=+t[0][1],s=+t[1][1],i>n&&(t=i,i=n,n=t),l>s&&(t=l,l=s,s=t),x.precision(m)):[[i,l],[n,s]]},x.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),o>a&&(t=o,o=a,a=t),x.precision(m)):[[r,o],[e,a]]},x.step=function(t){return arguments.length?x.majorStep(t).minorStep(t):x.minorStep()},x.majorStep=function(t){return arguments.length?(v=+t[0],g=+t[1],x):[v,g]},x.minorStep=function(t){return arguments.length?(p=+t[0],d=+t[1],x):[p,d]},x.precision=function(t){return arguments.length?(m=+t,u=Nn(o,a,90),c=jn(r,e,m),f=Nn(l,s,90),h=jn(i,n,m),x):m},x.majorExtent([[-180,-90+kt],[180,90-kt]]).minorExtent([[-180,-80-kt],[180,80+kt]])},t.geo.greatArc=function(){var e,r,n=Vn,i=Un;function a(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}return a.distance=function(){return t.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},a.source=function(t){return arguments.length?(n=t,e="function"==typeof t?null:t,a):n},a.target=function(t){return arguments.length?(i=t,r="function"==typeof t?null:t,a):i},a.precision=function(){return arguments.length?a:0},a},t.geo.interpolate=function(t,e){return r=t[0]*Ct,n=t[1]*Ct,i=e[0]*Ct,a=e[1]*Ct,o=Math.cos(n),s=Math.sin(n),l=Math.cos(a),u=Math.sin(a),c=o*Math.cos(r),f=o*Math.sin(r),h=l*Math.cos(i),p=l*Math.sin(i),d=2*Math.asin(Math.sqrt(Rt(a-n)+o*l*Rt(i-r))),v=1/Math.sin(d),(g=d?function(t){var e=Math.sin(t*=d)*v,r=Math.sin(d-t)*v,n=r*c+e*h,i=r*f+e*p,a=r*s+e*u;return[Math.atan2(i,n)*Lt,Math.atan2(a,Math.sqrt(n*n+i*i))*Lt]}:function(){return[r*Lt,n*Lt]}).distance=d,g;var r,n,i,a,o,s,l,u,c,f,h,p,d,v,g},t.geo.length=function(e){return yn=0,t.geo.stream(e,Hn),yn};var Hn={sphere:z,point:z,lineStart:function(){var t,e,r;function n(n,i){var a=Math.sin(i*=Ct),o=Math.cos(i),s=y((n*=Ct)-t),l=Math.cos(s);yn+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=r*a-e*o*l)*s),e*a+r*o*l),t=n,e=a,r=o}Hn.point=function(i,a){t=i*Ct,e=Math.sin(a*=Ct),r=Math.cos(a),Hn.point=n},Hn.lineEnd=function(){Hn.point=Hn.lineEnd=z}},lineEnd:z,polygonStart:z,polygonEnd:z};function qn(t,e){function r(e,r){var n=Math.cos(e),i=Math.cos(r),a=t(n*i);return[a*i*Math.sin(e),a*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),i=e(n),a=Math.sin(i),o=Math.cos(i);return[Math.atan2(t*a,n*o),Math.asin(n&&r*a/n)]},r}var Gn=qn(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(t.geo.azimuthalEqualArea=function(){return Sn(Gn)}).raw=Gn;var Wn=qn(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},O);function Yn(t,e){var r=Math.cos(t),n=function(t){return Math.tan(Tt/4+t/2)},i=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(n(e)/n(t)),a=r*Math.pow(n(t),i)/i;if(!i)return $n;function o(t,e){a>0?e<-St+kt&&(e=-St+kt):e>St-kt&&(e=St-kt);var r=a/Math.pow(n(e),i);return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}return o.invert=function(t,e){var r=a-e,n=Ot(i)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/i,2*Math.atan(Math.pow(a/n,1/i))-St]},o}function Xn(t,e){var r=Math.cos(t),n=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),i=r/n+t;if(y(n)1&&It(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function ii(t,e){return t[0]-e[0]||t[1]-e[1]}(t.geo.stereographic=function(){return Sn(Qn)}).raw=Qn,ti.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-St]},(t.geo.transverseMercator=function(){var t=Jn(ti),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90])}).raw=ti,t.geom={},t.geom.hull=function(t){var e=ei,r=ri;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=ge(e),a=ge(r),o=t.length,s=[],l=[];for(n=0;n=0;--n)p.push(t[s[u[n]][2]]);for(n=+f;nkt)s=s.L;else{if(!((i=a-wi(s,o))>kt)){n>-kt?(e=s.P,r=s):i>-kt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=mi(t);if(fi.insert(e,l),e||r){if(e===r)return Ei(e),r=mi(e.site),fi.insert(l,r),l.edge=r.edge=Li(e.site,l.site),Mi(e),void Mi(r);if(r){Ei(e),Ei(r);var u=e.site,c=u.x,f=u.y,h=t.x-c,p=t.y-f,d=r.site,v=d.x-c,g=d.y-f,m=2*(h*g-p*v),y=h*h+p*p,x=v*v+g*g,b={x:(g*y-p*x)/m+c,y:(h*x-v*y)/m+f};Oi(r.edge,u,d,b),l.edge=Li(u,t,null,b),r.edge=Li(t,d,null,b),Mi(e),Mi(r)}else l.edge=Li(e.site,l.site)}}function _i(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,u=l-e;if(!u)return s;var c=s-n,f=1/a-1/u,h=c/u;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*u)-l+u/2+i-a/2)))/f+n:(n+s)/2}function wi(t,e){var r=t.N;if(r)return _i(r,e);var n=t.site;return n.y===e?n.x:1/0}function ki(t){this.site=t,this.edges=[]}function Ai(t,e){return e.angle-t.angle}function Ti(){Di(this),this.x=this.y=this.arc=this.site=this.cy=null}function Mi(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,i=t.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,u=n.y-s,c=a.x-o,f=a.y-s,h=2*(l*f-u*c);if(!(h>=-At)){var p=l*l+u*u,d=c*c+f*f,v=(f*p-u*d)/h,g=(l*d-c*p)/h,f=g+s,m=vi.pop()||new Ti;m.arc=t,m.site=i,m.x=v+o,m.y=f+Math.sqrt(v*v+g*g),m.cy=f,t.circle=m;for(var y=null,x=pi._;x;)if(m.y=s)return;if(h>d){if(a){if(a.y>=u)return}else a={x:g,y:l};r={x:g,y:u}}else{if(a){if(a.y1)if(h>d){if(a){if(a.y>=u)return}else a={x:(l-i)/n,y:l};r={x:(u-i)/n,y:u}}else{if(a){if(a.y=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.xkt||y(i-r)>kt)&&(s.splice(o,0,new Ii((m=a.site,x=c,b=y(n-f)kt?{x:f,y:y(e-f)kt?{x:y(r-d)kt?{x:h,y:y(e-h)kt?{x:y(r-p)=r&&u.x<=i&&u.y>=n&&u.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[];c.point=t[s]}),e}function s(t){return t.map(function(t,e){return{x:Math.round(n(t,e)/kt)*kt,y:Math.round(i(t,e)/kt)*kt,i:e}})}return o.links=function(t){return Bi(s(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},o.triangles=function(t){var e=[];return Bi(s(t)).cells.forEach(function(r,n){for(var i,a,o,s,l=r.site,u=r.edges.sort(Ai),c=-1,f=u.length,h=u[f-1].edge,p=h.l===l?h.r:h.l;++ca&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:Gi(r,n)})),a=Xi.lastIndex;return av&&(v=l.x),l.y>g&&(g=l.y),u.push(l.x),c.push(l.y);else for(f=0;fv&&(v=b),_>g&&(g=_),u.push(b),c.push(_)}var w=v-p,k=g-d;function A(t,e,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,u=t.y;if(null!=l)if(y(l-r)+y(u-n)<.01)T(t,e,r,n,i,a,o,s);else{var c=t.point;t.x=t.y=t.point=null,T(t,c,l,u,i,a,o,s),T(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else T(t,e,r,n,i,a,o,s)}function T(t,e,r,n,i,a,o,s){var l=.5*(i+o),u=.5*(a+s),c=r>=l,f=n>=u,h=f<<1|c;t.leaf=!1,t=t.nodes[h]||(t.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null}),c?i=l:o=l,f?a=u:s=u,A(t,e,r,n,i,a,o,s)}w>k?g=d+w:v=p+k;var M={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){A(M,t,+m(t,++f),+x(t,f),p,d,v,g)},visit:function(t){!function t(e,r,n,i,a,o){if(!e(r,n,i,a,o)){var s=.5*(n+a),l=.5*(i+o),u=r.nodes;u[0]&&t(e,u[0],n,i,s,l),u[1]&&t(e,u[1],s,i,a,l),u[2]&&t(e,u[2],n,l,s,o),u[3]&&t(e,u[3],s,l,a,o)}}(t,M,p,d,v,g)},find:function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(u,c,f,h,p){if(!(c>a||f>o||h=_)<<1|e>=b,k=w+4;w=0&&!(n=t.interpolators[i](e,r)););return n}function $i(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function aa(t){return 1-Math.cos(t*St)}function oa(t){return Math.pow(2,10*(t-1))}function sa(t){return 1-Math.sqrt(1-t*t)}function la(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function ua(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function ca(t){var e,r,n,i=[t.a,t.b],a=[t.c,t.d],o=ha(i),s=fa(i,a),l=ha(((e=a)[0]+=(n=-s)*(r=i)[0],e[1]+=n*r[1],e))||0;i[0]*a[1]=0?t.slice(0,n):t,a=n>=0?t.slice(n+1):"in";return i=Ki.get(i)||Ji,a=Qi.get(a)||O,e=a(i.apply(null,r.call(arguments,1))),function(t){return t<=0?0:t>=1?1:e(t)}},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,i=e.c,a=e.l,o=r.h-n,s=r.c-i,l=r.l-a;return isNaN(s)&&(s=0,i=isNaN(i)?r.c:i),isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360),function(t){return Yt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,i=e.s,a=e.l,o=r.h-n,s=r.s-i,l=r.l-a;return isNaN(s)&&(s=0,i=isNaN(i)?r.s:i),isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360),function(t){return qt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,i=e.a,a=e.b,o=r.l-n,s=r.a-i,l=r.b-a;return function(t){return te(n+o*t,i+s*t,a+l*t)+""}},t.interpolateRound=ua,t.transform=function(e){var r=i.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new ca(e?e.matrix:pa)})(e)},ca.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var pa={a:1,b:0,c:0,d:1,e:0,f:0};function da(t){return t.length?t.pop()+",":""}function va(e,r){var n=[],i=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:Gi(t[0],e[0])},{i:i-2,x:Gi(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,i),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(da(r)+"rotate(",null,")")-2,x:Gi(t,e)})):e&&r.push(da(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,i),function(t,e,r,n){t!==e?n.push({i:r.push(da(r)+"skewX(",null,")")-2,x:Gi(t,e)}):e&&r.push(da(r)+"skewX("+e+")")}(e.skew,r.skew,n,i),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(da(r)+"scale(",null,",",null,")");n.push({i:i-4,x:Gi(t[0],e[0])},{i:i-2,x:Gi(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(da(r)+"scale("+e+")")}(e.scale,r.scale,n,i),e=r=null,function(t){for(var e,r=-1,a=i.length;++r0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=Ae(s.tick)),s):n},s.start=function(){var t,e,r,n=m.length,l=y.length,c=u[0],d=u[1];for(t=0;t=0;)r.push(i[n])}function Ca(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++o=0;)o.push(c=u[l]),c.parent=a,c.depth=a.depth+1;r&&(a.value=0),a.children=u}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return Ca(i,function(e){var n,i;t&&(n=e.children)&&n.sort(t),r&&(i=e.parent)&&(i.value+=e.value)}),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Sa(t,function(t){t.children&&(t.value=0)}),Ca(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var i=e.call(this,t,n);return function t(e,r,n,i){var a=e.children;if(e.x=r,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,u=-1;for(n=e.value?n/e.value:0;++us&&(s=n),o.push(n)}for(r=0;ri&&(n=r,i=e);return n}function Ha(t){return t.reduce(qa,0)}function qa(t,e){return t+e[1]}function Ga(t,e){return Wa(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Wa(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,a=[];++r<=e;)a[r]=i*r+n;return a}function Ya(e){return[t.min(e),t.max(e)]}function Xa(t,e){return t.value-e.value}function Za(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function $a(t,e){t._pack_next=e,e._pack_prev=t}function Ja(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function Ka(t){if((e=t.children)&&(l=e.length)){var e,r,n,i,a,o,s,l,u=1/0,c=-1/0,f=1/0,h=-1/0;if(e.forEach(Qa),(r=e[0]).x=-r.r,r.y=0,x(r),l>1&&((n=e[1]).x=n.r,n.y=0,x(n),l>2))for(i=e[2],eo(r,n,i),x(i),Za(r,i),r._pack_prev=i,Za(i,n),n=r._pack_next,a=3;a0)for(o=-1;++o=f[0]&&l<=f[1]&&((s=u[t.bisect(h,l,1,d)-1]).y+=v,s.push(a[o]));return u}return a.value=function(t){return arguments.length?(r=t,a):r},a.range=function(t){return arguments.length?(n=ge(t),a):n},a.bins=function(t){return arguments.length?(i="number"==typeof t?function(e){return Wa(e,t)}:ge(t),a):i},a.frequency=function(t){return arguments.length?(e=!!t,a):e},a},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(Xa),n=0,i=[1,1];function a(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],u=i[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,Ca(s,function(t){t.r=+c(t.value)}),Ca(s,Ka),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;Ca(s,function(t){t.r+=f}),Ca(s,Ka),Ca(s,function(t){t.r-=f})}return function t(e,r,n,i){var a=e.children;if(e.x=r+=i*e.x,e.y=n+=i*e.y,e.r*=i,a)for(var o=-1,s=a.length;++op.x&&(p=t),t.depth>d.depth&&(d=t)});var v=r(h,p)/2-h.x,g=n[0]/(p.x+r(p,h)/2+v),m=n[1]/(d.depth||1);Sa(c,function(t){t.x=(t.x+v)*g,t.y=t.depth*m})}return u}function o(t){var e=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(e.length){!function(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var a=(e[0].z+e[e.length-1].z)/2;i?(t.z=i.z+r(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+r(t._,i._));t.parent.A=function(t,e,n){if(e){for(var i,a=t,o=t,s=e,l=a.parent.children[0],u=a.m,c=o.m,f=s.m,h=l.m;s=io(s),a=no(a),s&&a;)l=no(l),(o=io(o)).a=t,(i=s.z+f-a.z-u+r(s._,a._))>0&&(ao(oo(s,t,n),t,i),u+=i,c+=i),f+=s.m,u+=a.m,h+=l.m,c+=o.m;s&&!io(o)&&(o.t=s,o.m+=f-c),a&&!no(l)&&(l.t=a,l.m+=u-h,n=t)}return n}(t,i,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t)?l:null,a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null==(n=t)?null:l,a):i?n:null},Ea(a,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=ro,n=[1,1],i=!1;function a(a,o){var s,l=e.call(this,a,o),u=l[0],c=0;Ca(u,function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}(n),e.y=function(e){return 1+t.max(e,function(t){return t.y})}(n)):(e.x=s?c+=r(e,s):0,e.y=0,s=e)});var f=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(u),h=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(u),p=f.x-r(f,h)/2,d=h.x+r(h,f)/2;return Ca(u,i?function(t){t.x=(t.x-u.x)*n[0],t.y=(u.y-t.y)*n[1]}:function(t){t.x=(t.x-p)/(d-p)*n[0],t.y=(1-(u.y?t.y/u.y:1))*n[1]}),l}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t),a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null!=(n=t),a):i?n:null},Ea(a,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,i=[1,1],a=null,o=so,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(t,e){for(var r,n,i=-1,a=t.length;++i0;)s.push(r=u[i-1]),s.area+=r.area,"squarify"!==l||(n=p(s,v))<=h?(u.pop(),h=n):(s.area-=s.pop().area,d(s,v,a,!1),v=Math.min(a.dx,a.dy),s.length=s.area=0,h=1/0);s.length&&(d(s,v,a,!0),s.length=s.area=0),e.forEach(f)}}function h(t){var e=t.children;if(e&&e.length){var r,n=o(t),i=e.slice(),a=[];for(c(i,n.dx*n.dy/t.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(d(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);e.forEach(h)}}function p(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++oi&&(i=r));return e*=e,(n*=n)?Math.max(e*i*u/n,n/(e*a*u)):1/0}function d(t,e,r,i){var a,o=-1,s=t.length,l=r.x,u=r.y,c=e?n(t.area/e):0;if(e==r.dx){for((i||c>r.dy)&&(c=r.dy);++or.dx)&&(c=r.dx);++o1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r2?go:fo,s=i?ma:ga;return a=t(e,r,s,n),o=t(r,e,s,Zi),l}function l(t){return a(t)}return l.invert=function(t){return o(t)},l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e},l.range=function(t){return arguments.length?(r=t,s()):r},l.rangeRound=function(t){return l.range(t).interpolate(ua)},l.clamp=function(t){return arguments.length?(i=t,s()):i},l.interpolate=function(t){return arguments.length?(n=t,s()):n},l.ticks=function(t){return bo(e,t)},l.tickFormat=function(t,r){return _o(e,t,r)},l.nice=function(t){return yo(e,t),s()},l.copy=function(){return t(e,r,n,i)},s()}([0,1],[0,1],Zi,!1)};var wo={s:1,g:1,p:1,r:1,e:1};function ko(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}t.scale.log=function(){return function e(r,n,i,a){function o(t){return(i?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function s(t){return i?Math.pow(n,t):-Math.pow(n,-t)}function l(t){return r(o(t))}return l.invert=function(t){return s(r.invert(t))},l.domain=function(t){return arguments.length?(i=t[0]>=0,r.domain((a=t.map(Number)).map(o)),l):a},l.base=function(t){return arguments.length?(n=+t,r.domain(a.map(o)),l):n},l.nice=function(){var t=ho(a.map(o),i?Math:To);return r.domain(t),a=t.map(s),l},l.ticks=function(){var t=uo(a),e=[],r=t[0],l=t[1],u=Math.floor(o(r)),c=Math.ceil(o(l)),f=n%1?2:n;if(isFinite(c-u)){if(i){for(;u0;h--)e.push(s(u)*h);for(u=0;e[u]l;c--);e=e.slice(u,c)}return e},l.tickFormat=function(e,r){if(!arguments.length)return Ao;arguments.length<2?r=Ao:"function"!=typeof r&&(r=t.format(r));var i=Math.max(1,n*e/l.ticks().length);return function(t){var e=t/s(Math.round(o(t)));return e*n0?i[t-1]:r[0],tf?0:1;if(u=Et)return l(u,p)+(s?l(s,1-p):"")+"Z";var d,v,g,m,y,x,b,_,w,k,A,T,M=0,E=0,S=[];if((m=(+o.apply(this,arguments)||0)/2)&&(g=n===Io?Math.sqrt(s*s+u*u):+n.apply(this,arguments),p||(E*=-1),u&&(E=Dt(g/u*Math.sin(m))),s&&(M=Dt(g/s*Math.sin(m)))),u){y=u*Math.cos(c+E),x=u*Math.sin(c+E),b=u*Math.cos(f-E),_=u*Math.sin(f-E);var C=Math.abs(f-c-2*E)<=Tt?0:1;if(E&&Bo(y,x,b,_)===p^C){var L=(c+f)/2;y=u*Math.cos(L),x=u*Math.sin(L),b=_=null}}else y=x=0;if(s){w=s*Math.cos(f-M),k=s*Math.sin(f-M),A=s*Math.cos(c+M),T=s*Math.sin(c+M);var O=Math.abs(c-f+2*M)<=Tt?0:1;if(M&&Bo(w,k,A,T)===1-p^O){var I=(c+f)/2;w=s*Math.cos(I),k=s*Math.sin(I),A=T=null}}else w=k=0;if(h>kt&&(d=Math.min(Math.abs(u-s)/2,+r.apply(this,arguments)))>.001){v=s0?0:1}function No(t,e,r,n,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,u=-s*a,c=t[0]+l,f=t[1]+u,h=e[0]+l,p=e[1]+u,d=(c+h)/2,v=(f+p)/2,g=h-c,m=p-f,y=g*g+m*m,x=r-n,b=c*p-h*f,_=(m<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*m-g*_)/y,k=(-b*g-m*_)/y,A=(b*m+g*_)/y,T=(-b*g+m*_)/y,M=w-d,E=k-v,S=A-d,C=T-v;return M*M+E*E>S*S+C*C&&(w=A,k=T),[[w-l,k-u],[w*r/x,k*r/x]]}function jo(t){var e=ei,r=ri,n=Wr,i=Uo,a=i.key,o=.7;function s(a){var s,l=[],u=[],c=-1,f=a.length,h=ge(e),p=ge(r);function d(){l.push("M",i(t(u),o))}for(;++c1&&i.push("H",n[0]),i.join("")},"step-before":qo,"step-after":Go,basis:Xo,"basis-open":function(t){if(t.length<4)return Uo(t);for(var e,r=[],n=-1,i=t.length,a=[0],o=[0];++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);for(r.push(Zo(Ko,a)+","+Zo(Ko,o)),--n;++n9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n));for(s=-1;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(t))}});function Uo(t){return t.length>1?t.join("L"):t+"Z"}function Ho(t){return t.join("L")+"Z"}function qo(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e1){s=e[1],a=t[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var u=2;uTt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return a.radius=function(t){return arguments.length?(r=ge(t),a):r},a.source=function(e){return arguments.length?(t=ge(e),a):t},a.target=function(t){return arguments.length?(e=ge(t),a):e},a.startAngle=function(t){return arguments.length?(n=ge(t),a):n},a.endAngle=function(t){return arguments.length?(i=ge(t),a):i},a},t.svg.diagonal=function(){var t=Vn,e=Un,r=is;function n(n,i){var a=t.call(this,n,i),o=e.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=ge(e),n):t},n.target=function(t){return arguments.length?(e=ge(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=is,n=e.projection;return e.projection=function(t){return arguments.length?n(function(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-St;return[r*Math.cos(n),r*Math.sin(n)]}}(r=t)):r},e},t.svg.symbol=function(){var t=os,e=as;function r(r,n){return(ls.get(t.call(this,r,n))||ss)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ge(e),r):t},r.size=function(t){return arguments.length?(e=ge(t),r):e},r};var ls=t.map({circle:ss,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*cs)),r=e*cs;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/us),r=e*us/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/us),r=e*us/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=ls.keys();var us=Math.sqrt(3),cs=Math.tan(30*Ct);Y.transition=function(t){for(var e,r,n=ds||++ms,i=bs(t),a=[],o=vs||{time:Date.now(),ease:ia,delay:0,duration:250},s=-1,l=this.length;++s0;)u[--h].call(t,o);if(a>=1)return f.event&&f.event.end.call(t,t.__data__,e),--c.count?delete c[n]:delete t[r],1}f||(a=i.time,o=Ae(function(t){var e=f.delay;if(o.t=e+a,e<=t)return h(t-e);o.c=h},0,a),f=c[n]={tween:new b,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++c.count)}gs.call=Y.call,gs.empty=Y.empty,gs.node=Y.node,gs.size=Y.size,t.transition=function(e,r){return e&&e.transition?ds?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=gs,gs.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=X(t);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",s[1]-s[0])}function v(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function g(){var f,g,m=this,y=t.select(t.event.target),x=n.of(m,arguments),b=t.select(m),_=y.datum(),w=!/^(n|s)$/.test(_)&&i,k=!/^(e|w)$/.test(_)&&a,A=y.classed("extent"),T=xt(m),M=t.mouse(m),E=t.select(o(m)).on("keydown.brush",function(){32==t.event.keyCode&&(A||(f=null,M[0]-=s[1],M[1]-=l[1],A=2),B())}).on("keyup.brush",function(){32==t.event.keyCode&&2==A&&(M[0]+=s[1],M[1]+=l[1],A=0,B())});if(t.event.changedTouches?E.on("touchmove.brush",L).on("touchend.brush",I):E.on("mousemove.brush",L).on("mouseup.brush",I),b.interrupt().selectAll("*").interrupt(),A)M[0]=s[0]-M[0],M[1]=l[0]-M[1];else if(_){var S=+/w$/.test(_),C=+/^n/.test(_);g=[s[1-S]-M[0],l[1-C]-M[1]],M[0]=s[S],M[1]=l[C]}else t.event.altKey&&(f=M.slice());function L(){var e=t.mouse(m),r=!1;g&&(e[0]+=g[0],e[1]+=g[1]),A||(t.event.altKey?(f||(f=[(s[0]+s[1])/2,(l[0]+l[1])/2]),M[0]=s[+(e[0]1?{floor:function(e){for(;s(e=t.floor(e));)e=Ps(e-1);return e},ceil:function(e){for(;s(e=t.ceil(e));)e=Ps(+e+1);return e}}:t))},i.ticks=function(t,e){var r=uo(i.domain()),n=null==t?a(r,10):"number"==typeof t?a(r,t):!t.range&&[{range:t},e];return n&&(t=n[0],e=n[1]),t.range(r[0],Ps(+r[1]+1),e<1?1:e)},i.tickFormat=function(){return n},i.copy=function(){return Is(e.copy(),r,n)},mo(i,e)}function Ps(t){return new Date(t)}Ss.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Os:Ls,Os.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Os.toString=Ls.toString,Pe.second=Fe(function(t){return new De(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),Pe.seconds=Pe.second.range,Pe.seconds.utc=Pe.second.utc.range,Pe.minute=Fe(function(t){return new De(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),Pe.minutes=Pe.minute.range,Pe.minutes.utc=Pe.minute.utc.range,Pe.hour=Fe(function(t){var e=t.getTimezoneOffset()/60;return new De(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),Pe.hours=Pe.hour.range,Pe.hours.utc=Pe.hour.utc.range,Pe.month=Fe(function(t){return(t=Pe.day(t)).setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),Pe.months=Pe.month.range,Pe.months.utc=Pe.month.utc.range;var Ds=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],zs=[[Pe.second,1],[Pe.second,5],[Pe.second,15],[Pe.second,30],[Pe.minute,1],[Pe.minute,5],[Pe.minute,15],[Pe.minute,30],[Pe.hour,1],[Pe.hour,3],[Pe.hour,6],[Pe.hour,12],[Pe.day,1],[Pe.day,2],[Pe.week,1],[Pe.month,1],[Pe.month,3],[Pe.year,1]],Rs=Ss.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Wr]]),Fs={range:function(e,r,n){return t.range(Math.ceil(e/n)*n,+r,n).map(Ps)},floor:O,ceil:O};zs.year=Pe.year,Pe.scale=function(){return Is(t.scale.linear(),zs,Rs)};var Bs=zs.map(function(t){return[t[0].utc,t[1]]}),Ns=Cs.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Wr]]);function js(t){return JSON.parse(t.responseText)}function Vs(t){var e=i.createRange();return e.selectNode(i.body),e.createContextualFragment(t.responseText)}Bs.year=Pe.year.utc,Pe.scale.utc=function(){return Is(t.scale.linear(),Bs,Ns)},t.text=me(function(t){return t.responseText}),t.json=function(t,e){return ye(t,"application/json",js,e)},t.html=function(t,e){return ye(t,"text/html",Vs,e)},t.xml=me(function(t){return t.responseXML}),"object"==typeof e&&e.exports?e.exports=t:this.d3=t}()},{}],158:[function(t,e,r){e.exports=function(){for(var t=0;t=2)return!1;t[r]=n}return!0}):_.filter(function(t){for(var e=0;e<=s;++e){var r=m[t[e]];if(r<0)return!1;t[e]=r}return!0}),1&s)for(var c=0;c<_.length;++c){var b=_[c],h=b[0];b[0]=b[1],b[1]=h}return _}},{"incremental-convex-hull":408,uniq:534}],160:[function(t,e,r){"use strict";e.exports=o;var n=o.canvas=document.createElement("canvas"),i=n.getContext("2d"),a=s([32,126]);function o(t,e){Array.isArray(t)&&(t=t.join(", "));var r,n={},o=16,l=.05;e&&(2===e.length&&"number"==typeof e[0]?r=s(e):Array.isArray(e)?r=e:(e.o?r=s(e.o):e.pairs&&(r=e.pairs),e.fontSize&&(o=e.fontSize),null!=e.threshold&&(l=e.threshold))),r||(r=a),i.font=o+"px "+t;for(var u=0;uo*l){var p=(h-f)/o;n[c]=1e3*p}}return n}function s(t){for(var e=[],r=t[0];r<=t[1];r++)for(var n=String.fromCharCode(r),i=t[0];i>>31},e.exports.exponent=function(t){var r=e.exports.hi(t);return(r<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){var r=e.exports.hi(t);return!(2146435072&r)}}).call(this,t("buffer").Buffer)},{buffer:98}],162:[function(t,e,r){var n=t("abs-svg-path"),i=t("normalize-svg-path"),a={M:"moveTo",C:"bezierCurveTo"};e.exports=function(t,e){t.beginPath(),i(n(e)).forEach(function(e){var r=e[0],n=e.slice(1);t[a[r]].apply(t,n)}),t.closePath()}},{"abs-svg-path":53,"normalize-svg-path":447}],163:[function(t,e,r){e.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},{}],164:[function(t,e,r){"use strict";e.exports=function(t,e){switch(void 0===e&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n80*r){n=l=t[0],s=u=t[1];for(var b=r;bl&&(l=c),p>u&&(u=p);v=0!==(v=Math.max(l-n,u-s))?1/v:0}return o(y,x,r,n,s,v),x}function i(t,e,r,n,i){var a,o;if(i===T(t,e,r,n)>0)for(a=e;a=e;a-=n)o=w(a,t[a],t[a+1],o);return o&&y(o,o.next)&&(k(o),o=o.next),o}function a(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!y(n,n.next)&&0!==m(n.prev,n,n.next))n=n.next;else{if(k(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,i,f,h){if(t){!h&&f&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=p(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,u=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,u*=2}while(o>1)}(i)}(t,n,i,f);for(var d,v,g=t;t.prev!==t.next;)if(d=t.prev,v=t.next,f?l(t,n,i,f):s(t))e.push(d.i/r),e.push(t.i/r),e.push(v.i/r),k(t),t=v.next,g=v.next;else if((t=v)===g){h?1===h?o(t=u(t,e,r),e,r,n,i,f,2):2===h&&c(t,e,r,n,i,f):o(a(t),e,r,n,i,f,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(m(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(v(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&m(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function l(t,e,r,n){var i=t.prev,a=t,o=t.next;if(m(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=p(s,l,e,r,n),h=p(u,c,e,r,n),d=t.prevZ,g=t.nextZ;d&&d.z>=f&&g&&g.z<=h;){if(d!==t.prev&&d!==t.next&&v(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&m(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,g!==t.prev&&g!==t.next&&v(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&m(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(;d&&d.z>=f;){if(d!==t.prev&&d!==t.next&&v(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&m(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;g&&g.z<=h;){if(g!==t.prev&&g!==t.next&&v(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&m(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function u(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!y(i,a)&&x(i,n,n.next,a)&&b(i,a)&&b(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),k(n),k(n.next),n=t=a),n=n.next}while(n!==t);return n}function c(t,e,r,n,i,s){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&g(l,u)){var c=_(l,u);return l=a(l,l.next),c=a(c,c.next),o(l,e,r,n,i,s),void o(c,e,r,n,i,s)}u=u.next}l=l.next}while(l!==t)}function f(t,e){return t.x-e.x}function h(t,e){if(e=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&i!==n.x&&v(ar.x)&&b(n,t)&&(r=n,h=l),n=n.next;return r}(t,e)){var r=_(e,t);a(r,r.next)}}function p(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function d(t){var e=t,r=t;do{e.x=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function g(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&x(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&b(t,e)&&b(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)}function m(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,r,n){return!!(y(t,e)&&y(r,n)||y(t,n)&&y(r,e))||m(t,e,r)>0!=m(t,e,n)>0&&m(r,n,t)>0!=m(r,n,e)>0}function b(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function _(t,e){var r=new A(t.i,t.x,t.y),n=new A(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function w(t,e,r,n){var i=new A(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function k(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 A(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function T(t,e,r,n){for(var i=0,a=e,o=r-n;a0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],166:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var i=0;i=e})}(e);for(var r,i=t,a=n(i),o=a.components.filter(function(t){return t.length>1}),s=1/0,l=0;l=55296&&y<=56319&&(w+=t[++r]),w=k?h.call(k,A,w,v):w,e?(p.value=w,d(g,v,p)):g[v]=w,++v;m=v}if(void 0===m)for(m=o(t.length),e&&(g=new e(m)),r=0;r0?1:-1}},{}],178:[function(t,e,r){"use strict";var n=t("../math/sign"),i=Math.abs,a=Math.floor;e.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?n(t)*a(i(t)):t}},{"../math/sign":175}],179:[function(t,e,r){"use strict";var n=t("./to-integer"),i=Math.max;e.exports=function(t){return i(0,n(t))}},{"./to-integer":178}],180:[function(t,e,r){"use strict";var n=t("./valid-callable"),i=t("./valid-value"),a=Function.prototype.bind,o=Function.prototype.call,s=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(t,e){return function(r,u){var c,f=arguments[2],h=arguments[3];return r=Object(i(r)),n(u),c=s(r),h&&c.sort("function"==typeof h?a.call(h,r):void 0),"function"!=typeof t&&(t=c[t]),o.call(t,c,function(t,n){return l.call(r,t)?o.call(u,f,r[t],t,r,n):e})}}},{"./valid-callable":198,"./valid-value":200}],181:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?Object.assign:t("./shim")},{"./is-implemented":182,"./shim":183}],182:[function(t,e,r){"use strict";e.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},{}],183:[function(t,e,r){"use strict";var n=t("../keys"),i=t("../valid-value"),a=Math.max;e.exports=function(t,e){var r,o,s,l=a(arguments.length,2);for(t=Object(i(t)),s=function(n){try{t[n]=e[n]}catch(t){r||(r=t)}},o=1;o-1}},{}],204:[function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call("");e.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||n.call(t)===i)||!1}},{}],205:[function(t,e,r){"use strict";var n=Object.create(null),i=Math.random;e.exports=function(){var t;do{t=i().toString(36).slice(2)}while(n[t]);return t}},{}],206:[function(t,e,r){"use strict";var n,i=t("es5-ext/object/set-prototype-of"),a=t("es5-ext/string/#/contains"),o=t("d"),s=t("es6-symbol"),l=t("./"),u=Object.defineProperty;n=e.exports=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");l.call(this,t),e=e?a.call(e,"key+value")?"key+value":a.call(e,"key")?"key":"value":"value",u(this,"__kind__",o("",e))},i&&i(n,l),delete n.prototype.constructor,n.prototype=Object.create(l.prototype,{_resolve:o(function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t})}),u(n.prototype,s.toStringTag,o("c","Array Iterator"))},{"./":209,d:144,"es5-ext/object/set-prototype-of":195,"es5-ext/string/#/contains":201,"es6-symbol":214}],207:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),i=t("es5-ext/object/valid-callable"),a=t("es5-ext/string/is-string"),o=t("./get"),s=Array.isArray,l=Function.prototype.call,u=Array.prototype.some;e.exports=function(t,e){var r,c,f,h,p,d,v,g,m=arguments[2];if(s(t)||n(t)?r="array":a(t)?r="string":t=o(t),i(e),f=function(){h=!0},"array"!==r)if("string"!==r)for(c=t.next();!c.done;){if(l.call(e,m,c.value,f),h)return;c=t.next()}else for(d=t.length,p=0;p=55296&&g<=56319&&(v+=t[++p]),l.call(e,m,v,f),!h);++p);else u.call(t,function(t){return l.call(e,m,t,f),h})}},{"./get":208,"es5-ext/function/is-arguments":172,"es5-ext/object/valid-callable":198,"es5-ext/string/is-string":204}],208:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),i=t("es5-ext/string/is-string"),a=t("./array"),o=t("./string"),s=t("./valid-iterable"),l=t("es6-symbol").iterator;e.exports=function(t){return"function"==typeof s(t)[l]?t[l]():n(t)?new a(t):i(t)?new o(t):new a(t)}},{"./array":206,"./string":211,"./valid-iterable":212,"es5-ext/function/is-arguments":172,"es5-ext/string/is-string":204,"es6-symbol":214}],209:[function(t,e,r){"use strict";var n,i=t("es5-ext/array/#/clear"),a=t("es5-ext/object/assign"),o=t("es5-ext/object/valid-callable"),s=t("es5-ext/object/valid-value"),l=t("d"),u=t("d/auto-bind"),c=t("es6-symbol"),f=Object.defineProperty,h=Object.defineProperties;e.exports=n=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");h(this,{__list__:l("w",s(t)),__context__:l("w",e),__nextIndex__:l("w",0)}),e&&(o(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete n.prototype.constructor,h(n.prototype,a({_next:l(function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach(function(e,r){e>=t&&(this.__redo__[r]=++e)},this),this.__redo__.push(t)):f(this,"__redo__",l("c",[t])))}),_onDelete:l(function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach(function(e,r){e>t&&(this.__redo__[r]=--e)},this)))}),_onClear:l(function(){this.__redo__&&i.call(this.__redo__),this.__nextIndex__=0})}))),f(n.prototype,c.iterator,l(function(){return this}))},{d:144,"d/auto-bind":143,"es5-ext/array/#/clear":168,"es5-ext/object/assign":181,"es5-ext/object/valid-callable":198,"es5-ext/object/valid-value":200,"es6-symbol":214}],210:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),i=t("es5-ext/object/is-value"),a=t("es5-ext/string/is-string"),o=t("es6-symbol").iterator,s=Array.isArray;e.exports=function(t){return!(!i(t)||!s(t)&&!a(t)&&!n(t)&&"function"!=typeof t[o])}},{"es5-ext/function/is-arguments":172,"es5-ext/object/is-value":189,"es5-ext/string/is-string":204,"es6-symbol":214}],211:[function(t,e,r){"use strict";var n,i=t("es5-ext/object/set-prototype-of"),a=t("d"),o=t("es6-symbol"),s=t("./"),l=Object.defineProperty;n=e.exports=function(t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");t=String(t),s.call(this,t),l(this,"__length__",a("",t.length))},i&&i(n,s),delete n.prototype.constructor,n.prototype=Object.create(s.prototype,{_next:a(function(){if(this.__list__)return this.__nextIndex__=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r})}),l(n.prototype,o.toStringTag,a("c","String Iterator"))},{"./":209,d:144,"es5-ext/object/set-prototype-of":195,"es6-symbol":214}],212:[function(t,e,r){"use strict";var n=t("./is-iterable");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not iterable");return t}},{"./is-iterable":210}],213:[function(t,r,n){(function(e,i){ +/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE + * @version 3.3.1 + */ +!function(t,e){"object"==typeof n&&void 0!==r?r.exports=e():t.ES6Promise=e()}(this,function(){"use strict";function r(t){return"function"==typeof t}var n=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},a=0,o=void 0,s=void 0,l=function(t,e){v[a]=t,v[a+1]=e,2===(a+=2)&&(s?s(g):_())},u="undefined"!=typeof window?window:void 0,c=u||{},f=c.MutationObserver||c.WebKitMutationObserver,h="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),p="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function d(){var t=setTimeout;return function(){return t(g,1)}}var v=new Array(1e3);function g(){for(var t=0;t=r-1)for(var h=l.length-1,d=t-e[r-1],p=0;p=r-1)for(var c=s.length-1,f=(e[r-1],0);f=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--f)n.push(a(l[f-1],u[f-1],arguments[f])),i.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var h=r;h>0;--h){var p=a(u[h-1],c[h-1],arguments[h]);n.push(p),i.push((p-n[o++])*f)}}},s.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],u=s[1],c=t-e,f=c>1e-6?1/c:0;this._time.push(t);for(var h=r;h>0;--h){var p=arguments[h];n.push(a(l[h-1],u[h-1],n[o++]+p)),i.push(p*f)}}},s.idle=function(t){var e=this.lastT();if(!(t=0;--f)n.push(a(l[f],u[f],n[o]+c*i[o])),i.push(0),o+=1}}},{"binary-search-bounds":84,"cubic-hermite":138}],226:[function(t,e,r){var n=t("dtype");e.exports=function(t,e,r){if(!t)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(t)&&t[0]&&"number"==typeof t[0][0]){var i,a,o,s,l=t[0].length,u=t.length*l;e&&"string"!=typeof e||(e=new(n(e||"float32"))(u+r));var c=e.length-r;if(u!==c)throw new Error("source length "+u+" ("+l+"x"+t.length+") does not match destination length "+c);for(i=0,o=r;ie[0]-o[0]/2&&(h=o[0]/2,p+=o[1]);return r}},{"css-font/stringify":135}],228:[function(t,e,r){"use strict";function n(t,e){e||(e={}),("string"==typeof t||Array.isArray(t))&&(e.family=t);var r=Array.isArray(e.family)?e.family.join(", "):e.family;if(!r)throw Error("`family` must be defined");var s=e.size||e.fontSize||e.em||48,l=e.weight||e.fontWeight||"",u=e.style||e.fontStyle||"",t=[u,l,s].join(" ")+"px "+r,c=e.origin||"top";if(n.cache[r]&&s<=n.cache[r].em)return i(n.cache[r],c);var f=e.canvas||n.canvas,h=f.getContext("2d"),p={upper:void 0!==e.upper?e.upper:"H",lower:void 0!==e.lower?e.lower:"x",descent:void 0!==e.descent?e.descent:"p",ascent:void 0!==e.ascent?e.ascent:"h",tittle:void 0!==e.tittle?e.tittle:"i",overshoot:void 0!==e.overshoot?e.overshoot:"O"},d=Math.ceil(1.5*s);f.height=d,f.width=.5*d,h.font=t;var v={top:0};h.clearRect(0,0,d,d),h.textBaseline="top",h.fillStyle="black",h.fillText("H",0,0);var g=a(h.getImageData(0,0,d,d));h.clearRect(0,0,d,d),h.textBaseline="bottom",h.fillText("H",0,d);var m=a(h.getImageData(0,0,d,d));v.lineHeight=v.bottom=d-m+g,h.clearRect(0,0,d,d),h.textBaseline="alphabetic",h.fillText("H",0,d);var y=a(h.getImageData(0,0,d,d)),x=d-y-1+g;v.baseline=v.alphabetic=x,h.clearRect(0,0,d,d),h.textBaseline="middle",h.fillText("H",0,.5*d);var b=a(h.getImageData(0,0,d,d));v.median=v.middle=d-b-1+g-.5*d,h.clearRect(0,0,d,d),h.textBaseline="hanging",h.fillText("H",0,.5*d);var _=a(h.getImageData(0,0,d,d));v.hanging=d-_-1+g-.5*d,h.clearRect(0,0,d,d),h.textBaseline="ideographic",h.fillText("H",0,d);var w=a(h.getImageData(0,0,d,d));if(v.ideographic=d-w-1+g,p.upper&&(h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(p.upper,0,0),v.upper=a(h.getImageData(0,0,d,d)),v.capHeight=v.baseline-v.upper),p.lower&&(h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(p.lower,0,0),v.lower=a(h.getImageData(0,0,d,d)),v.xHeight=v.baseline-v.lower),p.tittle&&(h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(p.tittle,0,0),v.tittle=a(h.getImageData(0,0,d,d))),p.ascent&&(h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(p.ascent,0,0),v.ascent=a(h.getImageData(0,0,d,d))),p.descent&&(h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(p.descent,0,0),v.descent=o(h.getImageData(0,0,d,d))),p.overshoot){h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(p.overshoot,0,0);var k=o(h.getImageData(0,0,d,d));v.overshoot=k-x}for(var A in v)v[A]/=s;return v.em=s,n.cache[r]=v,i(v,c)}function i(t,e){var r={};for(var n in"string"==typeof e&&(e=t[e]),t)"em"!==n&&(r[n]=t[n]-e);return r}function a(t){for(var e=t.height,r=t.data,n=3;n0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}e.exports=n,n.canvas=document.createElement("canvas"),n.cache={}},{}],229:[function(t,e,r){"use strict";e.exports=function(t){return new u(t||d,null)};var n=0,i=1;function a(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function o(t){return new a(t._color,t.key,t.value,t.left,t.right,t._count)}function s(t,e){return new a(t,e.key,e.value,e.left,e.right,e._count)}function l(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function u(t,e){this._compare=t,this.root=e}var c=u.prototype;function f(t,e){this.tree=t,this._stack=e}Object.defineProperty(c,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(c,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(c,"length",{get:function(){return this.root?this.root._count:0}}),c.insert=function(t,e){for(var r=this._compare,o=this.root,c=[],f=[];o;){var h=r(t,o.key);c.push(o),f.push(h),o=h<=0?o.left:o.right}c.push(new a(n,t,e,null,null,1));for(var p=c.length-2;p>=0;--p){var o=c[p];f[p]<=0?c[p]=new a(o._color,o.key,o.value,c[p+1],o.right,o._count+1):c[p]=new a(o._color,o.key,o.value,o.left,c[p+1],o._count+1)}for(var p=c.length-1;p>1;--p){var d=c[p-1],o=c[p];if(d._color===i||o._color===i)break;var v=c[p-2];if(v.left===d)if(d.left===o){var g=v.right;if(!g||g._color!==n){if(v._color=n,v.left=d.right,d._color=i,d.right=v,c[p-2]=d,c[p-1]=o,l(v),l(d),p>=3){var m=c[p-3];m.left===v?m.left=d:m.right=d}break}d._color=i,v.right=s(i,g),v._color=n,p-=1}else{var g=v.right;if(!g||g._color!==n){if(d.right=o.left,v._color=n,v.left=o.right,o._color=i,o.left=d,o.right=v,c[p-2]=o,c[p-1]=d,l(v),l(d),l(o),p>=3){var m=c[p-3];m.left===v?m.left=o:m.right=o}break}d._color=i,v.right=s(i,g),v._color=n,p-=1}else if(d.right===o){var g=v.left;if(!g||g._color!==n){if(v._color=n,v.right=d.left,d._color=i,d.left=v,c[p-2]=d,c[p-1]=o,l(v),l(d),p>=3){var m=c[p-3];m.right===v?m.right=d:m.left=d}break}d._color=i,v.left=s(i,g),v._color=n,p-=1}else{var g=v.left;if(!g||g._color!==n){if(d.left=o.right,v._color=n,v.right=o.left,o._color=i,o.right=d,o.left=v,c[p-2]=o,c[p-1]=d,l(v),l(d),l(o),p>=3){var m=c[p-3];m.right===v?m.right=o:m.left=o}break}d._color=i,v.left=s(i,g),v._color=n,p-=1}}return c[0]._color=i,new u(r,c[0])},c.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return function t(e,r){if(r.left){var n=t(e,r.left);if(n)return n}var n=e(r.key,r.value);return n||(r.right?t(e,r.right):void 0)}(t,this.root);case 2:return function t(e,r,n,i){var a=r(e,i.key);if(a<=0){if(i.left){var o=t(e,r,n,i.left);if(o)return o}var o=n(i.key,i.value);if(o)return o}if(i.right)return t(e,r,n,i.right)}(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return function t(e,r,n,i,a){var o,s=n(e,a.key),l=n(r,a.key);if(s<=0){if(a.left&&(o=t(e,r,n,i,a.left)))return o;if(l>0&&(o=i(a.key,a.value)))return o}if(l>0&&a.right)return t(e,r,n,i,a.right)}(e,r,this._compare,t,this.root)}},Object.defineProperty(c,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new f(this,t)}}),Object.defineProperty(c,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new f(this,t)}}),c.at=function(t){if(t<0)return new f(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new f(this,[])},c.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new f(this,n)},c.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new f(this,n)},c.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new f(this,n)},c.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new f(this,n)},c.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new f(this,n);r=i<=0?r.left:r.right}return new f(this,[])},c.remove=function(t){var e=this.find(t);return e?e.remove():this},c.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var h=f.prototype;function p(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function d(t,e){return te?1:0}Object.defineProperty(h,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(h,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),h.clone=function(){return new f(this.tree,this._stack.slice())},h.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new a(r._color,r.key,r.value,r.left,r.right,r._count);for(var c=t.length-2;c>=0;--c){var r=t[c];r.left===t[c+1]?e[c]=new a(r._color,r.key,r.value,e[c+1],r.right,r._count):e[c]=new a(r._color,r.key,r.value,r.left,e[c+1],r._count)}if((r=e[e.length-1]).left&&r.right){var f=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var h=e[f-1];e.push(new a(r._color,h.key,h.value,r.left,r.right,r._count)),e[f-1].key=r.key,e[f-1].value=r.value;for(var c=e.length-2;c>=f;--c)r=e[c],e[c]=new a(r._color,r.key,r.value,r.left,e[c+1],r._count);e[f-1].left=e[f]}if((r=e[e.length-1])._color===n){var d=e[e.length-2];d.left===r?d.left=null:d.right===r&&(d.right=null),e.pop();for(var c=0;c=0;--c){if(e=t[c],0===c)return void(e._color=i);if((r=t[c-1]).left===e){if((a=r.right).right&&a.right._color===n){if(a=r.right=o(a),u=a.right=o(a.right),r.right=a.left,a.left=r,a.right=u,a._color=r._color,e._color=i,r._color=i,u._color=i,l(r),l(a),c>1){var f=t[c-2];f.left===r?f.left=a:f.right=a}return void(t[c-1]=a)}if(a.left&&a.left._color===n){if(a=r.right=o(a),u=a.left=o(a.left),r.right=u.left,a.left=u.right,u.left=r,u.right=a,u._color=r._color,r._color=i,a._color=i,e._color=i,l(r),l(a),l(u),c>1){var f=t[c-2];f.left===r?f.left=u:f.right=u}return void(t[c-1]=u)}if(a._color===i){if(r._color===n)return r._color=i,void(r.right=s(n,a));r.right=s(n,a);continue}if(a=o(a),r.right=a.left,a.left=r,a._color=r._color,r._color=n,l(r),l(a),c>1){var f=t[c-2];f.left===r?f.left=a:f.right=a}t[c-1]=a,t[c]=r,c+11){var f=t[c-2];f.right===r?f.right=a:f.left=a}return void(t[c-1]=a)}if(a.right&&a.right._color===n){if(a=r.left=o(a),u=a.right=o(a.right),r.left=u.right,a.right=u.left,u.right=r,u.left=a,u._color=r._color,r._color=i,a._color=i,e._color=i,l(r),l(a),l(u),c>1){var f=t[c-2];f.right===r?f.right=u:f.left=u}return void(t[c-1]=u)}if(a._color===i){if(r._color===n)return r._color=i,void(r.left=s(n,a));r.left=s(n,a);continue}if(a=o(a),r.left=a.right,a.right=r,a._color=r._color,r._color=n,l(r),l(a),c>1){var f=t[c-2];f.right===r?f.right=a:f.left=a}t[c-1]=a,t[c]=r,c+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(h,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(h,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),h.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),h.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),n=e[e.length-1];r[r.length-1]=new a(n._color,n.key,t,n.left,n.right,n._count);for(var i=e.length-2;i>=0;--i)(n=e[i]).left===e[i+1]?r[i]=new a(n._color,n.key,n.value,r[i+1],n.right,n._count):r[i]=new a(n._color,n.key,n.value,n.left,r[i+1],n._count);return new u(this.tree._compare,r[0])},h.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},{}],230:[function(t,e,r){var n=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],i=607/128,a=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];function o(t){if(t<0)return Number("0/0");for(var e=a[0],r=a.length-1;r>0;--r)e+=a[r]/(t+r);var n=t+i+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(o(e));e-=1;for(var r=n[0],i=1;i<9;i++)r+=n[i]/(e+i);var a=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(a,e+.5)*Math.exp(-a)*r},e.exports.log=o},{}],231:[function(t,e,r){e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("must specify type string");if(e=e||{},"undefined"==typeof document&&!e.canvas)return null;var r=e.canvas||document.createElement("canvas");"number"==typeof e.width&&(r.width=e.width),"number"==typeof e.height&&(r.height=e.height);var n,i=e;try{var a=[t];0===t.indexOf("webgl")&&a.push("experimental-"+t);for(var o=0;o0?(p[c]=-1,d[c]=0):(p[c]=0,d[c]=1)}}var v=[0,0,0],g={model:l,view:l,projection:l,_ortho:!1};f.isOpaque=function(){return!0},f.isTransparent=function(){return!1},f.drawTransparent=function(t){};var m=[0,0,0],y=[0,0,0],x=[0,0,0];f.draw=function(t){t=t||g;for(var e=this.gl,r=t.model||l,n=t.view||l,i=t.projection||l,a=this.bounds,s=t._ortho||!1,c=o(r,n,i,a,s),f=c.cubeEdges,h=c.axis,b=n[12],_=n[13],w=n[14],k=n[15],A=s?2:1,T=A*this.pixelRatio*(i[3]*b+i[7]*_+i[11]*w+i[15]*k)/e.drawingBufferHeight,M=0;M<3;++M)this.lastCubeProps.cubeEdges[M]=f[M],this.lastCubeProps.axis[M]=h[M];for(var E=p,M=0;M<3;++M)d(p[M],M,this.bounds,f,h);for(var S,e=this.gl,C=v,M=0;M<3;++M)this.backgroundEnable[M]?C[M]=h[M]:C[M]=0;this._background.draw(r,n,i,a,C,this.backgroundColor),this._lines.bind(r,n,i,this);for(var M=0;M<3;++M){var L=[0,0,0];h[M]>0?L[M]=a[1][M]:L[M]=a[0][M];for(var O=0;O<2;++O){var I=(M+1+O)%3,P=(M+1+(1^O))%3;this.gridEnable[I]&&this._lines.drawGrid(I,P,this.bounds,L,this.gridColor[I],this.gridWidth[I]*this.pixelRatio)}for(var O=0;O<2;++O){var I=(M+1+O)%3,P=(M+1+(1^O))%3;this.zeroEnable[P]&&Math.min(a[0][P],a[1][P])<=0&&Math.max(a[0][P],a[1][P])>=0&&this._lines.drawZero(I,P,this.bounds,L,this.zeroLineColor[P],this.zeroLineWidth[P]*this.pixelRatio)}}for(var M=0;M<3;++M){this.lineEnable[M]&&this._lines.drawAxisLine(M,this.bounds,E[M].primalOffset,this.lineColor[M],this.lineWidth[M]*this.pixelRatio),this.lineMirror[M]&&this._lines.drawAxisLine(M,this.bounds,E[M].mirrorOffset,this.lineColor[M],this.lineWidth[M]*this.pixelRatio);for(var D=u(m,E[M].primalMinor),z=u(y,E[M].mirrorMinor),R=this.lineTickLength,O=0;O<3;++O){var F=T/r[5*O];D[O]*=R[O]*F,z[O]*=R[O]*F}this.lineTickEnable[M]&&this._lines.drawAxisTicks(M,E[M].primalOffset,D,this.lineTickColor[M],this.lineTickWidth[M]*this.pixelRatio),this.lineTickMirror[M]&&this._lines.drawAxisTicks(M,E[M].mirrorOffset,z,this.lineTickColor[M],this.lineTickWidth[M]*this.pixelRatio)}var B,N;function j(t){(N=[0,0,0])[t]=1}function V(t,e,r){var n=(t+1)%3,i=(t+2)%3,a=e[n],o=e[i],s=r[n],l=r[i];a>0&&l>0?j(n):a>0&&l<0?j(n):a<0&&l>0?j(n):a<0&&l<0?j(n):o>0&&s>0?j(i):o>0&&s<0?j(i):o<0&&s>0?j(i):o<0&&s<0&&j(i)}this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio);for(var M=0;M<3;++M){for(var U=E[M].primalMinor,H=E[M].mirrorMinor,q=u(x,E[M].primalOffset),O=0;O<3;++O)this.lineTickEnable[M]&&(q[O]+=T*U[O]*Math.max(this.lineTickLength[O],0)/r[5*O]);var G=[0,0,0];if(G[M]=1,this.tickEnable[M]){-3600===this.tickAngle[M]?(this.tickAngle[M]=0,this.tickAlign[M]="auto"):this.tickAlign[M]=-1,B=1,"auto"===(S=[this.tickAlign[M],.5,B])[0]?S[0]=0:S[0]=parseInt(""+S[0]),N=[0,0,0],V(M,U,H);for(var O=0;O<3;++O)q[O]+=T*U[O]*this.tickPad[O]/r[5*O];this._text.drawTicks(M,this.tickSize[M],this.tickAngle[M],q,this.tickColor[M],G,N,S)}if(this.labelEnable[M]){B=0,N=[0,0,0],this.labels[M].length>4&&(j(M),B=1),"auto"===(S=[this.labelAlign[M],.5,B])[0]?S[0]=0:S[0]=parseInt(""+S[0]);for(var O=0;O<3;++O)q[O]+=T*U[O]*this.labelPad[O]/r[5*O];q[M]+=.5*(a[0][M]+a[1][M]),this._text.drawLabel(M,this.labelSize[M],this.labelAngle[M],q,this.labelColor[M],[0,0,0],N,S)}}this._text.unbind()},f.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":233,"./lib/cube.js":234,"./lib/lines.js":235,"./lib/text.js":237,"./lib/ticks.js":238}],233:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var u=(l+1)%3,c=(l+2)%3,f=[0,0,0],h=[0,0,0],p=-1;p<=1;p+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),f[l]=p,h[l]=p;for(var d=-1;d<=1;d+=2){f[u]=d;for(var v=-1;v<=1;v+=2)f[c]=v,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),s+=1}var g=u;u=c,c=g}var m=n(t,new Float32Array(e)),y=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=i(t,[{buffer:m,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:m,type:t.FLOAT,size:3,offset:12,stride:24}],y),b=a(t);return b.attributes.position.location=0,b.attributes.normal.location=1,new o(t,m,x,b)};var n=t("gl-buffer"),i=t("gl-vao"),a=t("./shaders").bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":236,"gl-buffer":240,"gl-vao":322}],234:[function(t,e,r){"use strict";e.exports=function(t,e,r,a,p){i(s,e,t),i(s,r,s);for(var y=0,x=0;x<2;++x){c[2]=a[x][2];for(var b=0;b<2;++b){c[1]=a[b][1];for(var _=0;_<2;++_)c[0]=a[_][0],h(l[y],c,s),y+=1}}for(var w=-1,x=0;x<8;++x){for(var k=l[x][3],A=0;A<3;++A)u[x][A]=l[x][A]/k;p&&(u[x][2]*=-1),k<0&&(w<0?w=x:u[x][2]S&&(w|=1<S&&(w|=1<u[x][1]&&(R=x));for(var F=-1,x=0;x<3;++x){var B=R^1<u[N][0]&&(N=B)}}var j=v;j[0]=j[1]=j[2]=0,j[n.log2(F^R)]=R&F,j[n.log2(R^N)]=R&N;var V=7^N;V===w||V===z?(V=7^F,j[n.log2(N^V)]=V&N):j[n.log2(F^V)]=V&F;for(var U=g,H=w,T=0;T<3;++T)U[T]=H&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);r.text=function(t){return i(t,s,l,null,[{name:"position",type:"vec3"}])};var u=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0));\n gl_Position = projection * view * model * vec4(nPosition, 1.0);\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n\n colorChannel = abs(realNormal);\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] +\n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}"]);r.bg=function(t){return i(t,u,c,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":300,glslify:404}],237:[function(t,e,r){(function(r){"use strict";e.exports=function(t,e,r,a,s,l){var c=n(t),f=i(t,[{buffer:c,size:3}]),h=o(t);h.attributes.position.location=0;var p=new u(t,h,c,f);return p.update(e,r,a,s,l),p};var n=t("gl-buffer"),i=t("gl-vao"),a=t("vectorize-text"),o=t("./shaders").text,s=window||r.global||{},l=s.__TEXT_CACHE||{};function u(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}s.__TEXT_CACHE={};var c=u.prototype,f=[0,0];c.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},c.unbind=function(){this.vao.unbind()},c.update=function(t,e,r,n,i){var o=[];function s(t,e,r,n,i,s){var u=l[r];u||(u=l[r]={});var c=u[e];c||(c=u[e]=function(t,e){try{return a(t,e)}catch(e){return console.warn('error vectorizing text:"'+t+'" error:',e),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle",lineSpacing:i,styletags:s}));for(var f=(n||12)/12,h=c.positions,p=c.cells,d=0,v=p.length;d=0;--m){var y=h[g[m]];o.push(f*y[0],-f*y[1],t)}}for(var u=[0,0,0],c=[0,0,0],f=[0,0,0],h=[0,0,0],p={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},d=0;d<3;++d){f[d]=o.length/3|0,s(.5*(t[0][d]+t[1][d]),e[d],r[d],12,1.25,p),h[d]=(o.length/3|0)-f[d],u[d]=o.length/3|0;for(var v=0;v=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,u=o%a;o<0?(l=0|-Math.ceil(l),u=0|-u):(l=0|Math.floor(l),u|=0);var c=""+l;if(o<0&&(c="-"+c),i){for(var f=""+u;f.length=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r},r.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function c(t,e){for(var r=n.malloc(t.length,e),i=t.length,a=0;a=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=u(this.gl,this.type,this.length,this.usage,t.data,e):this.length=u(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var l=n.malloc(t.size,r),f=a(l,t.shape);i.assign(f,t),this.length=u(this.gl,this.type,this.length,this.usage,e<0?l:l.subarray(0,t.size),e),n.free(l)}}else if(Array.isArray(t)){var h;h=this.type===this.gl.ELEMENT_ARRAY_BUFFER?c(t,"uint16"):c(t,"float32"),this.length=u(this.gl,this.type,this.length,this.usage,e<0?h:h.subarray(0,t.length),e),n.free(h)}else if("object"==typeof t&&"number"==typeof t.length)this.length=u(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var i=t.createBuffer(),a=new s(t,r,i,0,n);return a.update(e),a}},{ndarray:445,"ndarray-ops":439,"typedarray-pool":532}],241:[function(t,e,r){"use strict";var n=t("gl-vec3"),i=function(t,e){for(var r=0;r=e)return r-1;return r},a=n.create(),o=n.create(),s=function(t,e,r){return tr?r:t},l=function(t,e,r,l){var u=t[0],c=t[1],f=t[2],h=r[0].length,p=r[1].length,d=r[2].length,v=i(r[0],u),g=i(r[1],c),m=i(r[2],f),y=v+1,x=g+1,b=m+1;if(l&&(v=s(v,0,h-1),y=s(y,0,h-1),g=s(g,0,p-1),x=s(x,0,p-1),m=s(m,0,d-1),b=s(b,0,d-1)),v<0||g<0||m<0||y>=h||x>=p||b>=d)return n.create();var _=(u-r[0][v])/(r[0][y]-r[0][v]),w=(c-r[1][g])/(r[1][x]-r[1][g]),k=(f-r[2][m])/(r[2][b]-r[2][m]);(_<0||_>1||isNaN(_))&&(_=0),(w<0||w>1||isNaN(w))&&(w=0),(k<0||k>1||isNaN(k))&&(k=0);var A=m*h*p,T=b*h*p,M=g*h,E=x*h,S=v,C=y,L=e[M+A+S],O=e[M+A+C],I=e[E+A+S],P=e[E+A+C],D=e[M+T+S],z=e[M+T+C],R=e[E+T+S],F=e[E+T+C],B=n.create();return n.lerp(B,L,O,_),n.lerp(a,I,P,_),n.lerp(B,B,a,w),n.lerp(a,D,z,_),n.lerp(o,R,F,_),n.lerp(a,a,o,w),n.lerp(B,B,a,k),B};e.exports=function(t,e){var r;r=t.positions?t.positions:function(t){for(var e=t[0],r=t[1],n=t[2],i=[],a=0;as&&(s=n.length(b)),x&&(y=Math.min(y,2*n.distance(v,_)/(n.length(g)+n.length(b)))),v=_,g=b,m.push(b)}var w=[u,f,p],k=[c,h,d];e&&(e[0]=w,e[1]=k),0===s&&(s=1);var A=1/s;isFinite(y)&&!isNaN(y)||(y=1),o.vectorScale=y;var T=function(t,e,r){var i=n.create();return void 0!==t&&n.set(i,t,e,r),i}(0,1,0),M=t.coneSize||.5;t.absoluteConeSize&&(M=t.absoluteConeSize*A),o.coneScale=M;for(var x=0,E=0;x=1},x.isTransparent=function(){return this.opacity<1},x.pickSlots=1,x.setPickBase=function(t){this.pickId=t},x.highlight=function(t){if(t&&this.contourEnable){for(var e=h(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0){var d=this.triShader;d.bind(),d.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},x.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||m,n=t.view||m,i=t.projection||m,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind())},x.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3);return{index:Math.floor(r[1]/48),position:n,dataCoordinate:n}},x.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose()},e.exports=function(t,e){1===arguments.length&&(t=(e=t).gl);var r=e.triShader||function(t){var e=n(t,v.vertex,v.fragment,null,v.attributes);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.vector.location=5,e}(t),s=b(t),l=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));l.generateMipmap(),l.minFilter=t.LINEAR_MIPMAP_LINEAR,l.magFilter=t.LINEAR;var u=i(t),f=i(t),h=i(t),p=i(t),d=i(t),g=i(t),m=a(t,[{buffer:u,type:t.FLOAT,size:4},{buffer:g,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:h,type:t.FLOAT,size:4},{buffer:p,type:t.FLOAT,size:2},{buffer:d,type:t.FLOAT,size:3},{buffer:f,type:t.FLOAT,size:3}]),x=i(t),_=i(t),w=i(t),k=i(t),A=a(t,[{buffer:x,type:t.FLOAT,size:3},{buffer:k,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:_,type:t.FLOAT,size:4},{buffer:w,type:t.FLOAT,size:2}]),T=i(t),M=i(t),E=i(t),S=i(t),C=i(t),L=a(t,[{buffer:T,type:t.FLOAT,size:3},{buffer:C,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:M,type:t.FLOAT,size:4},{buffer:E,type:t.FLOAT,size:2},{buffer:S,type:t.FLOAT,size:1}]),O=i(t),I=a(t,[{buffer:O,type:t.FLOAT,size:3}]),P=new y(t,l,r,s,u,f,g,h,p,d,m,x,k,_,w,A,T,C,M,E,S,L,O,I);return P.update(e),P}},{"./shaders":243,colormap:119,"gl-buffer":240,"gl-mat4/invert":264,"gl-mat4/multiply":266,"gl-shader":300,"gl-texture2d":317,"gl-vao":322,ndarray:445,normals:448,"simplicial-complex-contour":505,"typedarray-pool":532}],243:[function(t,e,r){var n=t("glslify"),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\nuniform float vectorScale;\nuniform float coneScale;\n\nuniform float coneOffset;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data\n , f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal,0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular\n , opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data\n , f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nuniform float vectorScale;\nuniform float coneScale;\nuniform float coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * view * conePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},{glslify:404}],244:[function(t,e,r){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34000:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},{}],245:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":244}],246:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e),o=i(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),l=a(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var u=new s(e,r,o,l);return u.update(t),u};var n=t("gl-buffer"),i=t("gl-vao"),a=t("./shaders/index"),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var l=s.prototype;function u(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,i=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],u=n[15],c=t._ortho||!1,f=c?2:1,h=f*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*u)/e.drawingBufferHeight;this.vao.bind();for(var p=0;p<3;++p)e.lineWidth(this.lineWidth[p]*this.pixelRatio),r.capSize=this.capSize[p]*h,this.lineCount[p]&&e.drawArrays(e.LINES,this.lineOffset[p],this.lineCount[p]);this.vao.unbind()};var c=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=(n+e)%3,o=[0,0,0];o[a]=i,r.push(o)}t[e]=r}return t}();function f(t,e,r,n){for(var i=c[n],a=0;a0){var v=c.slice();v[s]+=p[1][s],i.push(c[0],c[1],c[2],d[0],d[1],d[2],d[3],0,0,0,v[0],v[1],v[2],d[0],d[1],d[2],d[3],0,0,0),u(this.bounds,v),o+=2+f(i,v,d,s)}}}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":247,"gl-buffer":240,"gl-vao":322}],247:[function(t,e,r){"use strict";var n=t("glslify"),i=t("gl-shader"),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * view * worldPosition;\n fragColor = color;\n fragPosition = position;\n}"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);e.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},{"gl-shader":300,glslify:404}],248:[function(t,e,r){"use strict";var n=t("gl-texture2d");e.exports=function(t,e,r,n){i||(i=t.FRAMEBUFFER_UNSUPPORTED,a=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var u=t.getExtension("WEBGL_draw_buffers");if(!l&&u&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;ac||r<0||r>c)throw new Error("gl-fbo: Parameters are too large for FBO");var f=1;if("color"in(n=n||{})){if((f=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(f>1){if(!u)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(f>t.getParameter(u.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+f+" draw buffers")}}var h=t.UNSIGNED_BYTE,p=t.getExtension("OES_texture_float");if(n.float&&f>0){if(!p)throw new Error("gl-fbo: Context does not support floating point textures");h=t.FLOAT}else n.preferFloat&&f>0&&p&&(h=t.FLOAT);var v=!0;"depth"in n&&(v=!!n.depth);var g=!1;return"stencil"in n&&(g=!!n.stencil),new d(t,e,r,h,f,v,g,u)};var i,a,o,s,l=null;function u(t){var e=t.getParameter(t.FRAMEBUFFER_BINDING),r=t.getParameter(t.RENDERBUFFER_BINDING),n=t.getParameter(t.TEXTURE_BINDING_2D);return[e,r,n]}function c(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function f(t){switch(t){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function h(t,e,r,i,a,o){if(!i)return null;var s=n(t,e,r,a,i);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function p(t,e,r,n,i){var a=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,a),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,i,t.RENDERBUFFER,a),a}function d(t,e,r,n,i,a,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var d=0;d1&&s.drawBuffersWEBGL(l[o]);var y=r.getExtension("WEBGL_depth_texture");y?d?t.depth=h(r,i,a,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):v&&(t.depth=h(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):v&&d?t._depth_rb=p(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):v?t._depth_rb=p(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=p(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==r.FRAMEBUFFER_COMPLETE){t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null);for(var m=0;mi||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var a=u(n),o=0;o>8*p&255;this.pickOffset=r,i.bind();var d=i.uniforms;d.viewTransform=t,d.pickOffset=e,d.shape=this.shape;var v=i.attributes;return this.positionBuffer.bind(),v.position.pointer(),this.weightBuffer.bind(),v.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),v.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),f.pick=function(t,e,r){var n=this.pickOffset,i=this.shape[0]*this.shape[1];if(r=n+i)return null;var a=r-n,o=this.xData,s=this.yData;return{object:this,pointId:a,dataCoord:[o[a%this.shape[0]],s[a/this.shape[0]|0]]}},f.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||i(e[0]),o=t.y||i(e[1]),s=t.z||new Float32Array(e[0]*e[1]);this.xData=r,this.yData=o;var l=t.colorLevels||[0],u=t.colorValues||[0,0,0,1],c=l.length,f=this.bounds,p=f[0]=r[0],d=f[1]=o[0],v=f[2]=r[r.length-1],g=f[3]=o[o.length-1],m=1/(v-p),y=1/(g-d),x=e[0],b=e[1];this.shape=[x,b];var _=(x-1)*(b-1)*(h.length>>>1);this.numVertices=_;for(var w=a.mallocUint8(4*_),k=a.mallocFloat32(2*_),A=a.mallocUint8(2*_),T=a.mallocUint32(_),M=0,E=0;E max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\nlowp vec4 encode_float_1540259130(highp float v) {\n highp float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp float m = av * pow(2.0, -e) - 1.0;\n \n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n \n //Unpack exponent\n highp float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0; \n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, encode_float_1540259130(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];r.createShader=function(t){return i(t,a,o,null,l)},r.createPickShader=function(t){return i(t,a,s,null,l)}},{"gl-shader":300,glslify:404}],254:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=c(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=f(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),u=i(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),h=l(new Array(1024),[256,1,4]),p=0;p<1024;++p)h.data[p]=255;var d=a(e,h);d.wrap=e.REPEAT;var v=new g(e,r,o,s,u,d);return v.update(t),v};var n=t("gl-buffer"),i=t("gl-vao"),a=t("gl-texture2d"),o=t("glsl-read-float"),s=t("binary-search-bounds"),l=t("ndarray"),u=t("./lib/shaders"),c=u.createShader,f=u.createPickShader,h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function p(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function d(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function v(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function g(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var m=g.prototype;m.isTransparent=function(){return this.hasAlpha},m.isOpaque=function(){return!this.hasAlpha},m.pickSlots=1,m.setPickBase=function(t){this.pickId=t},m.drawTransparent=m.draw=function(t){if(this.vertexCount){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||h,view:t.view||h,projection:t.projection||h,clipBounds:d(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},m.drawPick=function(t){if(this.vertexCount){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||h,view:t.view||h,projection:t.projection||h,pickId:this.pickId,clipBounds:d(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},m.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],a=[],o=[],u=0,c=0,f=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],h=t.position||t.positions;if(h){var d=t.color||t.colors||[0,0,0,1],v=t.lineWidth||1,g=!1;t:for(e=1;e0){for(var w=0;w<24;++w)i.push(i[i.length-12]);c+=2,g=!0}continue t}f[0][r]=Math.min(f[0][r],b[r],_[r]),f[1][r]=Math.max(f[1][r],b[r],_[r])}Array.isArray(d[0])?(m=d.length>e-1?d[e-1]:d.length>0?d[d.length-1]:[0,0,0,1],y=d.length>e?d[e]:d.length>0?d[d.length-1]:[0,0,0,1]):m=y=d,3===m.length&&(m=[m[0],m[1],m[2],1]),3===y.length&&(y=[y[0],y[1],y[2],1]),!this.hasAlpha&&m[3]<1&&(this.hasAlpha=!0),x=Array.isArray(v)?v.length>e-1?v[e-1]:v.length>0?v[v.length-1]:[0,0,0,1]:v;var k=u;if(u+=p(b,_),g){for(r=0;r<2;++r)i.push(b[0],b[1],b[2],_[0],_[1],_[2],k,x,m[0],m[1],m[2],m[3]);c+=2,g=!1}i.push(b[0],b[1],b[2],_[0],_[1],_[2],k,x,m[0],m[1],m[2],m[3],b[0],b[1],b[2],_[0],_[1],_[2],k,-x,m[0],m[1],m[2],m[3],_[0],_[1],_[2],b[0],b[1],b[2],u,-x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],u,x,y[0],y[1],y[2],y[3]),c+=4}}if(this.buffer.update(i),a.push(u),o.push(h[h.length-1].slice()),this.bounds=f,this.vertexCount=c,this.points=o,this.arcLength=a,"dashes"in t){var A=t.dashes,T=A.slice();for(T.unshift(0),e=1;e1.0001)return null;g+=v[c]}return Math.abs(g-1)>.001?null:[f,function(t,e){for(var r=[0,0,0],n=0;n max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * f_color.a;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_color = color;\n f_data = position;\n f_uv = uv;\n}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_id = id;\n f_position = position;\n}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 0.0, 0.0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}"]),p=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n}"]),d=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:l,fragment:u,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:c,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:h,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:p,fragment:d,attributes:[{name:"position",type:"vec3"}]}},{glslify:404}],279:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("normals"),l=t("gl-mat4/multiply"),u=t("gl-mat4/invert"),c=t("ndarray"),f=t("colormap"),h=t("simplicial-complex-contour"),p=t("typedarray-pool"),d=t("./lib/shaders"),v=t("./lib/closest-point"),g=d.meshShader,m=d.wireShader,y=d.pointShader,x=d.pickShader,b=d.pointPickShader,_=d.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function k(t,e,r,n,i,a,o,s,l,u,c,f,h,p,d,v,g,m,y,x,b,_,k,A,T,M,E){this.gl=t,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=u,this.triangleVAO=p,this.triangleCount=0,this.lineWidth=1,this.edgePositions=d,this.edgeColors=g,this.edgeUVs=m,this.edgeIds=v,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=k,this.pointSizes=A,this.pointIds=b,this.pointVAO=T,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=M,this.contourVAO=E,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var A=k.prototype;function T(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}function M(t){var e=n(t,y.vertex,y.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function E(t){var e=n(t,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}function S(t){var e=n(t,b.vertex,b.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function C(t){var e=n(t,_.vertex,_.fragment);return e.attributes.position.location=0,e}A.isOpaque=function(){return!this.hasAlpha},A.isTransparent=function(){return this.hasAlpha},A.pickSlots=1,A.setPickBase=function(t){this.pickId=t},A.highlight=function(t){if(t&&this.contourEnable){for(var e=h(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0){var d=this.triShader;d.bind(),d.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var d=this.lineShader;d.bind(),d.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()}if(this.pointCount>0){var d=this.pointShader;d.bind(),d.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var d=this.contourShader;d.bind(),d.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind()}},A.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255},l=this.pickShader;if(l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0){var l=this.pointPickShader;l.bind(),l.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}},A.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;ai[A]&&(r.uniforms.dataAxis=u,r.uniforms.screenOffset=c,r.uniforms.color=g[t],r.uniforms.angle=m[t],a.drawArrays(a.TRIANGLES,i[A],i[T]-i[A]))),y[t]&&k&&(c[1^t]-=M*p*x[t],r.uniforms.dataAxis=f,r.uniforms.screenOffset=c,r.uniforms.color=b[t],r.uniforms.angle=_[t],a.drawArrays(a.TRIANGLES,w,k)),c[1^t]=M*s[2+(1^t)]-1,d[t+2]&&(c[1^t]+=M*p*v[t+2],Ai[A]&&(r.uniforms.dataAxis=u,r.uniforms.screenOffset=c,r.uniforms.color=g[t+2],r.uniforms.angle=m[t+2],a.drawArrays(a.TRIANGLES,i[A],i[T]-i[A]))),y[t+2]&&k&&(c[1^t]+=M*p*x[t+2],r.uniforms.dataAxis=f,r.uniforms.screenOffset=c,r.uniforms.color=b[t+2],r.uniforms.angle=_[t+2],a.drawArrays(a.TRIANGLES,w,k))}),v.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,u=r.pixelRatio;if(this.titleCount){for(var c=0;c<2;++c)e[c]=2*(o[c]*u-a[c])/(a[2+c]-a[c])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}}(),v.bind=(h=[0,0],p=[0,0],d=[0,0],function(){var t=this.plot,e=this.shader,r=t._tickBounds,n=t.dataBox,i=t.screenBox,a=t.viewBox;e.bind();for(var o=0;o<2;++o){var s=r[o],l=r[o+2],u=l-s,c=.5*(n[o+2]+n[o]),f=n[o+2]-n[o],v=a[o],g=a[o+2],m=g-v,y=i[o],x=i[o+2],b=x-y;p[o]=2*u/f*m/b,h[o]=2*(s-c)/f*m/b}d[1]=2*t.pixelRatio/(i[3]-i[1]),d[0]=d[1]*(i[3]-i[1])/(i[2]-i[0]),e.uniforms.dataScale=p,e.uniforms.dataShift=h,e.uniforms.textScale=d,this.vbo.bind(),e.attributes.textCoordinate.pointer()}),v.update=function(t){var e,r,n,i,o,s=[],l=t.ticks,u=t.bounds;for(o=0;o<2;++o){var c=[Math.floor(s.length/3)],f=[-1/0],h=l[o];for(e=0;e=0){var v=e[d]-n[d]*(e[d+2]-e[d])/(n[d+2]-n[d]);0===d?o.drawLine(v,e[1],v,e[3],p[d],h[d]):o.drawLine(e[0],v,e[2],v,p[d],h[d])}}for(var d=0;d=0;--t)this.objects[t].dispose();this.objects.length=0;for(var t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},u.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},u.removeObject=function(t){for(var e=this.objects,r=0;rMath.abs(e))u.rotate(a,0,0,-t*r*Math.PI*d.rotateSpeed/window.innerWidth);else if(!d._ortho){var o=-d.zoomSpeed*i*e/window.innerHeight*(a-u.lastT())/20;u.pan(a,0,0,f*(Math.exp(o)-1))}}},!0)},d.enableMouseListeners(),d};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset"),l=t("has-passive-events")},{"3d-view":50,"has-passive-events":406,"mouse-change":430,"mouse-event-offset":431,"mouse-wheel":433,"right-now":491}],288:[function(t,e,r){var n=t("glslify"),i=t("gl-shader"),a=n(["precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);e.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec2"}])}},{"gl-shader":300,glslify:404}],289:[function(t,e,r){"use strict";var n=t("./camera.js"),i=t("gl-axes3d"),a=t("gl-axes3d/properties"),o=t("gl-spikes3d"),s=t("gl-select-static"),l=t("gl-fbo"),u=t("a-big-triangle"),c=t("mouse-change"),f=t("mouse-wheel"),h=t("gl-mat4/perspective"),p=t("gl-mat4/ortho"),d=t("./lib/shader"),v=t("is-mobile")({tablet:!0});function g(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function m(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(e<0){var r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}if(e>0){var r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function y(t){return"boolean"!=typeof t||t}e.exports={createScene:function(t){(t=t||{}).camera=t.camera||{};var e=t.canvas;if(!e)if(e=document.createElement("canvas"),t.container){var r=t.container;r.appendChild(e)}else document.body.appendChild(e);var x=t.gl;if(x||(x=function(t,e){var r=null;try{(r=t.getContext("webgl",e))||(r=t.getContext("experimental-webgl",e))}catch(t){return null}return r}(e,t.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:v})),!x)throw new Error("webgl not supported");var b=t.bounds||[[-10,-10,-10],[10,10,10]],_=new g,w=l(x,[x.drawingBufferWidth,x.drawingBufferHeight],{preferFloat:!v}),k=d(x),A=t.cameraObject&&!0===t.cameraObject._ortho||t.camera.projection&&"orthographic"===t.camera.projection.type||!1,T={eye:t.camera.eye||[2,0,0],center:t.camera.center||[0,0,0],up:t.camera.up||[0,1,0],zoomMin:t.camera.zoomMax||.1,zoomMax:t.camera.zoomMin||100,mode:t.camera.mode||"turntable",_ortho:A},M=t.axes||{},E=i(x,M);E.enable=!M.disable;var S=t.spikes||{},C=o(x,S),L=[],O=[],I=[],P=[],D=!0,z=!0,R=new Array(16),F=new Array(16),B={view:null,projection:R,model:F,_ortho:!1},z=!0,N=[x.drawingBufferWidth,x.drawingBufferHeight],j=t.cameraObject||n(e,T),V={gl:x,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:_,camera:j,axes:E,axesPixels:null,spikes:C,bounds:b,objects:L,shape:N,aspect:t.aspectRatio||[1,1,1],pickRadius:t.pickRadius||10,zNear:t.zNear||.01,zFar:t.zFar||1e3,fovy:t.fovy||Math.PI/4,clearColor:t.clearColor||[0,0,0,0],autoResize:y(t.autoResize),autoBounds:y(t.autoBounds),autoScale:!!t.autoScale,autoCenter:y(t.autoCenter),clipToBounds:y(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:B,oncontextloss:null,mouseListener:null,_stopped:!1},U=[x.drawingBufferWidth/V.pixelRatio|0,x.drawingBufferHeight/V.pixelRatio|0];function H(){if(!V._stopped&&V.autoResize){var t=e.parentNode,r=1,n=1;t&&t!==document.body?(r=t.clientWidth,n=t.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*V.pixelRatio),a=0|Math.ceil(n*V.pixelRatio);if(i!==e.width||a!==e.height){e.width=i,e.height=a;var o=e.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",D=!0}}}function q(){for(var t=L.length,e=P.length,r=0;r0&&0===I[e-1];)I.pop(),P.pop().dispose()}function G(){if(V.contextLost)return!0;x.isContextLost()&&(V.contextLost=!0,V.mouseListener.enabled=!1,V.selection.object=null,V.oncontextloss&&V.oncontextloss())}V.autoResize&&H(),window.addEventListener("resize",H),V.update=function(t){V._stopped||(t=t||{},D=!0,z=!0)},V.add=function(t){V._stopped||(t.axes=E,L.push(t),O.push(-1),D=!0,z=!0,q())},V.remove=function(t){if(!V._stopped){var e=L.indexOf(t);e<0||(L.splice(e,1),O.pop(),D=!0,z=!0,q())}},V.dispose=function(){if(!V._stopped&&(V._stopped=!0,window.removeEventListener("resize",H),e.removeEventListener("webglcontextlost",G),V.mouseListener.enabled=!1,!V.contextLost)){E.dispose(),C.dispose();for(var t=0;te?1.1:1/1.1;V.aspect[0]*=r,V.aspect[1]*=r,V.aspect[2]*=r,V.redraw()}},!0),V._mouseRotating=!1,V._prevButtons=0,V.enableMouseListeners=function(){V.mouseListener=c(e,function(t,e,r){if(!V._stopped){var n=P.length,i=L.length,a=_.object;_.distance=1/0,_.mouse[0]=e,_.mouse[1]=r,_.object=null,_.screen=null,_.dataCoordinate=_.dataPosition=null;var o=!1;if(t&&V._prevButtons)V._mouseRotating=!0;else{V._mouseRotating&&(z=!0),V._mouseRotating=!1;for(var s=0;s_.distance)continue;for(var u=0;u 1.0) {\n discard;\n }\n baseColor = mix(borderColor, color, step(radius, centerFraction));\n gl_FragColor = vec4(baseColor.rgb * baseColor.a, baseColor.a);\n }\n}\n"]),r.pickVertex=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 pickId;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform vec4 pickOffset;\n\nvarying vec4 fragId;\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n gl_PointSize = pointSize;\n\n vec4 id = pickId + pickOffset;\n id.y += floor(id.x / 256.0);\n id.x -= floor(id.x / 256.0) * 256.0;\n\n id.z += floor(id.y / 256.0);\n id.y -= floor(id.y / 256.0) * 256.0;\n\n id.w += floor(id.z / 256.0);\n id.z -= floor(id.z / 256.0) * 256.0;\n\n fragId = id;\n}\n"]),r.pickFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\n\nvoid main() {\n float radius = length(2.0 * gl_PointCoord.xy - 1.0);\n if(radius > 1.0) {\n discard;\n }\n gl_FragColor = fragId / 255.0;\n}\n"])},{glslify:404}],291:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("typedarray-pool"),o=t("./lib/shader");function s(t,e,r,n,i){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.shader=n,this.pickShader=i,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}e.exports=function(t,e){var r=t.gl,a=i(r),l=i(r),u=n(r,o.pointVertex,o.pointFragment),c=n(r,o.pickVertex,o.pickFragment),f=new s(t,a,l,u,c);return f.update(e),t.addObject(f),f};var l,u,c=s.prototype;c.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},c.update=function(t){var e;function r(e,r){return e in t?t[e]:r}t=t||{},this.sizeMin=r("sizeMin",.5),this.sizeMax=r("sizeMax",20),this.color=r("color",[1,0,0,1]).slice(),this.areaRatio=r("areaRatio",1),this.borderColor=r("borderColor",[0,0,0,1]).slice(),this.blend=r("blend",!1);var n=t.positions.length>>>1,i=t.positions instanceof Float32Array,o=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=i?s:a.mallocFloat32(s.length),u=o?t.idToIndex:a.mallocInt32(n);if(i||l.set(s),!o)for(l.set(s),e=0;e>>1;for(r=0;r=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,i),c=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(s,.33333)));l[0]=2/a,l[4]=2/o,l[6]=-2*i[0]/a-1,l[7]=-2*i[1]/o-1,this.offsetBuffer.bind(),r.bind(),r.attributes.position.pointer(),r.uniforms.matrix=l,r.uniforms.color=this.color,r.uniforms.borderColor=this.borderColor,r.uniforms.pointCloud=c<5,r.uniforms.pointSize=c,r.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),e&&(u[0]=255&t,u[1]=t>>8&255,u[2]=t>>16&255,u[3]=t>>24&255,this.pickBuffer.bind(),r.attributes.pickId.pointer(n.UNSIGNED_BYTE),r.uniforms.pickOffset=u,this.pickOffset=t);var f=n.getParameter(n.BLEND),h=n.getParameter(n.DITHER);return f&&!this.blend&&n.disable(n.BLEND),h&&n.disable(n.DITHER),n.drawArrays(n.POINTS,0,this.pointCount),f&&!this.blend&&n.enable(n.BLEND),h&&n.enable(n.DITHER),t+this.pointCount}),c.draw=c.unifiedDraw,c.drawPick=c.unifiedDraw,c.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(r=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}}},{"./lib/shader":290,"gl-buffer":240,"gl-shader":300,"typedarray-pool":532}],292:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,u=e[0],c=e[1],f=e[2],h=e[3],p=r[0],d=r[1],v=r[2],g=r[3];return(a=u*p+c*d+f*v+h*g)<0&&(a=-a,p=-p,d=-d,v=-v,g=-g),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*u+l*p,t[1]=s*c+l*d,t[2]=s*f+l*v,t[3]=s*h+l*g,t}},{}],293:[function(t,e,r){"use strict";e.exports=function(t){return t||0===t?t.toString():""}},{}],294:[function(t,e,r){"use strict";var n=t("vectorize-text");e.exports=function(t,e,r){var a=i[e];if(a||(a=i[e]={}),t in a)return a[t];var o={textAlign:"center",textBaseline:"middle",lineHeight:1,font:e,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},s=n(t,o);o.triangles=!1;var l,u,c=n(t,o);if(r&&1!==r){for(l=0;l max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n\n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * view * model * vec4(position, 1);\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * view * model * vec4(dataPosition, 1);\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),u=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),c=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],f={vertex:a,fragment:l,attributes:c},h={vertex:o,fragment:l,attributes:c},p={vertex:s,fragment:l,attributes:c},d={vertex:a,fragment:u,attributes:c},v={vertex:o,fragment:u,attributes:c},g={vertex:s,fragment:u,attributes:c};function m(t,e){var r=n(t,e),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}r.createPerspective=function(t){return m(t,f)},r.createOrtho=function(t){return m(t,h)},r.createProject=function(t){return m(t,p)},r.createPickPerspective=function(t){return m(t,d)},r.createPickOrtho=function(t){return m(t,v)},r.createPickProject=function(t){return m(t,g)}},{"gl-shader":300,glslify:404}],296:[function(t,e,r){"use strict";var n=t("is-string-blank"),i=t("gl-buffer"),a=t("gl-vao"),o=t("typedarray-pool"),s=t("gl-mat4/multiply"),l=t("./lib/shaders"),u=t("./lib/glyphs"),c=t("./lib/get-simple-string"),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*i+e[12]*a,t[1]=e[1]*r+e[5]*n+e[9]*i+e[13]*a,t[2]=e[2]*r+e[6]*n+e[10]*i+e[14]*a,t[3]=e[3]*r+e[7]*n+e[11]*i+e[15]*a,t}function p(t,e,r,n){return h(n,n),h(n,n),h(n,n)}function d(t,e){this.index=t,this.dataCoordinate=this.position=e}function v(t){return!0===t?1:t>1?1:t}function g(t,e,r,n,i,a,o,s,l,u,c,f){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=u,this.pickOrthoShader=c,this.pickProjectShader=f,this.points=[],this._selectResult=new d(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}e.exports=function(t){var e=t.gl,r=l.createPerspective(e),n=l.createOrtho(e),o=l.createProject(e),s=l.createPickPerspective(e),u=l.createPickOrtho(e),c=l.createPickProject(e),f=i(e),h=i(e),p=i(e),d=i(e),v=a(e,[{buffer:f,size:3,type:e.FLOAT},{buffer:h,size:4,type:e.FLOAT},{buffer:p,size:2,type:e.FLOAT},{buffer:d,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),m=new g(e,r,n,o,f,h,p,d,v,s,u,c);return m.update(t),m};var m=g.prototype;m.pickSlots=1,m.setPickBase=function(t){this.pickId=t},m.isTransparent=function(){if(this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectHasAlpha)return!0;return!1},m.isOpaque=function(){if(!this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&!this.projectHasAlpha)return!0;return!1};var y=[0,0],x=[0,0,0],b=[0,0,0],_=[0,0,0,1],w=[0,0,0,1],k=f.slice(),A=[0,0,0],T=[[0,0,0],[0,0,0]];function M(t){return t[0]=t[1]=t[2]=0,t}function E(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function S(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function C(t,e,r,n){var i,a=e.axesProject,o=e.gl,l=t.uniforms,u=r.model||f,c=r.view||f,h=r.projection||f,d=e.axesBounds,v=function(t){for(var e=T,r=0;r<2;++r)for(var n=0;n<3;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}(e.clipBounds);i=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],y[0]=2/o.drawingBufferWidth,y[1]=2/o.drawingBufferHeight,t.bind(),l.view=c,l.projection=h,l.screenSize=y,l.highlightId=e.highlightId,l.highlightScale=e.highlightScale,l.clipBounds=v,l.pickGroup=e.pickId/255,l.pixelRatio=n;for(var g=0;g<3;++g)if(a[g]){l.scale=e.projectScale[g],l.opacity=e.projectOpacity[g];for(var m=k,C=0;C<16;++C)m[C]=0;for(var C=0;C<4;++C)m[5*C]=1;m[5*g]=0,i[g]<0?m[12+g]=d[0][g]:m[12+g]=d[1][g],s(m,u,m),l.model=m;var L=(g+1)%3,O=(g+2)%3,I=M(x),P=M(b);I[L]=1,P[O]=1;var D=p(0,0,0,E(_,I)),z=p(0,0,0,E(w,P));if(Math.abs(D[1])>Math.abs(z[1])){var R=D;D=z,z=R,R=I,I=P,P=R;var F=L;L=O,O=F}D[0]<0&&(I[L]=-1),z[1]>0&&(P[O]=-1);for(var B=0,N=0,C=0;C<4;++C)B+=Math.pow(u[4*L+C],2),N+=Math.pow(u[4*O+C],2);I[L]/=Math.sqrt(B),P[O]/=Math.sqrt(N),l.axes[0]=I,l.axes[1]=P,l.fragClipBounds[0]=S(A,v[0],g,-1e8),l.fragClipBounds[1]=S(A,v[1],g,1e8),e.vao.bind(),e.vao.draw(o.TRIANGLES,e.vertexCount),e.lineWidth>0&&(o.lineWidth(e.lineWidth*n),e.vao.draw(o.LINES,e.lineVertexCount,e.vertexCount)),e.vao.unbind()}}var L=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function O(t,e,r,n,i,a,o){var s=r.gl;if((a===r.projectHasAlpha||o)&&C(e,r,n,i),a===r.hasAlpha||o){t.bind();var l=t.uniforms;l.model=n.model||f,l.view=n.view||f,l.projection=n.projection||f,y[0]=2/s.drawingBufferWidth,y[1]=2/s.drawingBufferHeight,l.screenSize=y,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=L,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=i,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*i),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function I(t,e,r,i){var a;a=Array.isArray(t)?e=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},m.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},m.update=function(t){if("perspective"in(t=t||{})&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,"projectOpacity"in t){if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{var r=+t.projectOpacity;this.projectOpacity=[r,r,r]}for(var n=0;n<3;++n)this.projectOpacity[n]=v(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in t&&(this.opacity=v(t.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=t.position,l=t.font||"normal",u=t.alignment||[0,0];if(2===u.length)i=u[0],a=u[1];else{i=[],a=[];for(var n=0;n0){var D=0,z=x,R=[0,0,0,1],F=[0,0,0,1],B=Array.isArray(p)&&Array.isArray(p[0]),N=Array.isArray(m)&&Array.isArray(m[0]);t:for(var n=0;n<_;++n){y+=1;for(var w=s[n],k=0;k<3;++k){if(isNaN(w[k])||!isFinite(w[k]))continue t;f[k]=Math.max(f[k],w[k]),c[k]=Math.min(c[k],w[k])}var A=I(h,n,l,this.pixelRatio),T=A.mesh,M=A.lines,E=A.bounds,j=A.visible;if(j)if(Array.isArray(p)){if(3===(V=B?n0?1-E[0][0]:W<0?1+E[1][0]:1,Y*=Y>0?1-E[0][1]:Y<0?1+E[1][1]:1;for(var X=[W,Y],Z=T.cells||[],$=T.positions||[],k=0;k0){var m=r*c;o.drawBox(f-m,h-m,p+m,h+m,a),o.drawBox(f-m,d-m,p+m,d+m,a),o.drawBox(f-m,h-m,f+m,d+m,a),o.drawBox(p-m,h-m,p+m,d+m,a)}}}},s.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":297,"gl-buffer":240,"gl-shader":300}],299:[function(t,e,r){"use strict";e.exports=function(t,e){var r=n(t,e),a=i.mallocUint8(e[0]*e[1]*4);return new u(t,r,a)};var n=t("gl-fbo"),i=t("typedarray-pool"),a=t("ndarray"),o=t("bit-twiddle").nextPow2,s=t("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(_inline_16_arg0_<255||_inline_16_arg1_<255||_inline_16_arg2_<255||_inline_16_arg3_<255){var _inline_16_l=_inline_16_arg4_-_inline_16_arg6_[0],_inline_16_a=_inline_16_arg5_-_inline_16_arg6_[1],_inline_16_f=_inline_16_l*_inline_16_l+_inline_16_a*_inline_16_a;_inline_16_fthis.buffer.length){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*e*4)),a=0;ar)for(t=r;te)for(t=e;t=0){for(var k=0|w.type.charAt(w.type.length-1),A=new Array(k),T=0;T=0;)M+=1;_[y]=M}var E=new Array(r.length);function S(){h.program=o.program(p,h._vref,h._fref,b,_);for(var t=0;t=0){var d=h.charCodeAt(h.length-1)-48;if(d<2||d>4)throw new n("","Invalid data type for attribute "+f+": "+h);o(t,e,p[0],i,d,a,f)}else{if(!(h.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+f+": "+h);var d=h.charCodeAt(h.length-1)-48;if(d<2||d>4)throw new n("","Invalid data type for attribute "+f+": "+h);s(t,e,p,i,d,a,f)}}}return a};var n=t("./GLError");function i(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;function o(t,e,r,n,a,o,s){for(var l=["gl","v"],u=[],c=0;c4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+a+"fv(locations["+e+"],false,obj"+t+")"}throw new i("","Unknown uniform data type for "+name+": "+r)}var a=r.charCodeAt(r.length-1)-48;if(a<2||a>4)throw new i("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+a+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+a+"fv(locations["+e+"],obj"+t+")";default:throw new i("","Unrecognized data type for vector "+name+": "+r)}}}function u(e){for(var n=["return function updateProperty(obj){"],i=function t(e,r){if("object"!=typeof r)return[[e,r]];var n=[];for(var i in r){var a=r[i],o=e;parseInt(i)+""===i?o+="["+i+"]":o+="."+i,"object"==typeof a?n.push.apply(n,t(o,a)):n.push([o,a])}return n}("",e),a=0;a4)throw new i("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r=t.charCodeAt(t.length-1)-48;if(r<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+t)}}(r[c].type);var p}function f(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){l[0]in o||(o[l[0]]=[]),o=o[l[0]];for(var u=1;u1)for(var l=0;l 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\nuniform float vectorScale;\nuniform float tubeScale;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data\n , f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal,0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular\n , opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data\n , f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * view * tubePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},{glslify:404}],311:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("normals"),l=t("gl-mat4/multiply"),u=t("gl-mat4/invert"),c=t("ndarray"),f=t("colormap"),h=t("simplicial-complex-contour"),p=t("typedarray-pool"),d=t("./shaders"),v=d.meshShader,g=d.pickShader,m=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function y(t,e,r,n,i,a,o,s,l,u,c,f,h,p,d,v,g,y,x,b,_,w,k,A){this.gl=t,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.pickShader=n,this.trianglePositions=i,this.triangleVectors=a,this.triangleColors=s,this.triangleNormals=u,this.triangleUVs=l,this.triangleIds=o,this.triangleVAO=c,this.triangleCount=0,this.lineWidth=1,this.edgePositions=f,this.edgeColors=p,this.edgeUVs=d,this.edgeIds=h,this.edgeVAO=v,this.edgeCount=0,this.pointPositions=g,this.pointColors=x,this.pointUVs=b,this.pointSizes=_,this.pointIds=y,this.pointVAO=w,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=k,this.contourVAO=A,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!1,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.tubeScale=1,this._model=m,this._view=m,this._projection=m,this._resolution=[1,1],this.pixelRatio=1}var x=y.prototype;function b(t){var e=n(t,g.vertex,g.fragment,null,g.attributes);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.vector.location=5,e}x.isOpaque=function(){return this.opacity>=1},x.isTransparent=function(){return this.opacity<1},x.pickSlots=1,x.setPickBase=function(t){this.pickId=t},x.highlight=function(t){if(t&&this.contourEnable){for(var e=h(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0){var d=this.triShader;d.bind(),d.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},x.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||m,n=t.view||m,i=t.projection||m,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,tubeScale:this.tubeScale,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind())},x.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3),i=this.intensity[r[1]],a=this.vectors[r[1]].slice(0,3),o=this.vectors[r[1]][3];return{index:e,position:n,intensity:i,velocity:a,divergence:o,dataCoordinate:n}},x.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose()},e.exports=function(t,e){1===arguments.length&&(t=(e=t).gl);var r=e.triShader||function(t){var e=n(t,v.vertex,v.fragment,null,v.attributes);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.vector.location=5,e}(t),s=b(t),l=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));l.generateMipmap(),l.minFilter=t.LINEAR_MIPMAP_LINEAR,l.magFilter=t.LINEAR;var u=i(t),f=i(t),h=i(t),p=i(t),d=i(t),g=i(t),m=a(t,[{buffer:u,type:t.FLOAT,size:4},{buffer:g,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:h,type:t.FLOAT,size:4},{buffer:p,type:t.FLOAT,size:2},{buffer:d,type:t.FLOAT,size:3},{buffer:f,type:t.FLOAT,size:4}]),x=i(t),_=i(t),w=i(t),k=i(t),A=a(t,[{buffer:x,type:t.FLOAT,size:3},{buffer:k,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:_,type:t.FLOAT,size:4},{buffer:w,type:t.FLOAT,size:2}]),T=i(t),M=i(t),E=i(t),S=i(t),C=i(t),L=a(t,[{buffer:T,type:t.FLOAT,size:3},{buffer:C,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:M,type:t.FLOAT,size:4},{buffer:E,type:t.FLOAT,size:2},{buffer:S,type:t.FLOAT,size:1}]),O=i(t),I=a(t,[{buffer:O,type:t.FLOAT,size:3}]),P=new y(t,l,r,s,u,f,g,h,p,d,m,x,k,_,w,A,T,C,M,E,S,L,O,I);return P.update(e),P}},{"./shaders":310,colormap:119,"gl-buffer":240,"gl-mat4/invert":264,"gl-mat4/multiply":266,"gl-shader":300,"gl-texture2d":317,"gl-vao":322,ndarray:445,normals:448,"simplicial-complex-contour":505,"typedarray-pool":532}],312:[function(t,e,r){"use strict";var n=t("gl-vec3"),i=t("gl-vec4"),a=function(t,e,r,a){for(var o=0,s=0;so&&(o=c)}for(var f=t.map(function(t){return function(t,e,r,a){var o,s,l,u=t.points,c=t.velocities,f=t.divergences;n.set(n.create(),0,1,0),n.create(),n.create(),n.create();for(var h=[],p=[],d=[],v=[],g=[],m=[],y=0,x=0,b=i.create(),_=i.create(),w=0;w0)for(var k=0;k<8;k++){var A=(k+1)%8;h.push(v[k],g[k],g[A],g[A],v[A],v[k]),d.push(_,b,b,b,_,_),m.push(y,x,x,x,y,y),p.push([h.length-6,h.length-5,h.length-4],[h.length-3,h.length-2,h.length-1])}var T=v;v=g,g=T,T=_,_=b,b=T,T=y,y=x,x=T}return{positions:h,cells:p,vectors:d,vertexIntensity:m}}(t,r,a,o)}),h=[],p=[],d=[],v=[],s=0;se)return r-1}return r},u=n.create(),c=n.create(),f=function(t,e,r){return tr?r:t},h=function(t,e,r,i){var a=t[0],o=t[1],s=t[2],h=r[0].length,p=r[1].length,d=r[2].length,v=l(r[0],a),g=l(r[1],o),m=l(r[2],s),y=v+1,x=g+1,b=m+1;if(r[0][v]===a&&(y=v),r[1][g]===o&&(x=g),r[2][m]===s&&(b=m),i&&(v=f(v,0,h-1),y=f(y,0,h-1),g=f(g,0,p-1),x=f(x,0,p-1),m=f(m,0,d-1),b=f(b,0,d-1)),v<0||g<0||m<0||y>=h||x>=p||b>=d)return n.create();var _=(a-r[0][v])/(r[0][y]-r[0][v]),w=(o-r[1][g])/(r[1][x]-r[1][g]),k=(s-r[2][m])/(r[2][b]-r[2][m]);(_<0||_>1||isNaN(_))&&(_=0),(w<0||w>1||isNaN(w))&&(w=0),(k<0||k>1||isNaN(k))&&(k=0);var A=m*h*p,T=b*h*p,M=g*h,E=x*h,S=v,C=y,L=e[M+A+S],O=e[M+A+C],I=e[E+A+S],P=e[E+A+C],D=e[M+T+S],z=e[M+T+C],R=e[E+T+S],F=e[E+T+C],B=n.create();return n.lerp(B,L,O,_),n.lerp(u,I,P,_),n.lerp(B,B,u,w),n.lerp(u,D,z,_),n.lerp(c,R,F,_),n.lerp(u,u,c,w),n.lerp(B,B,u,k),B},p=function(t){var e=1/0;t.sort(function(t,e){return t-e});for(var r=1;r=f&&r<=v&&n>=h&&n<=g&&i>=d&&i<=m},x=n.distance(e[0],e[1]),b=10*x/i,_=b*b,w=1,k=0;n.create(),r.length>=2&&(w=function(t){for(var e=[],r=[],n=[],i={},a={},o={},s=0;sk&&!isNaN(I)&&isFinite(I)&&(k=I),L.push(I),c.push({points:M,velocities:E,divergences:L});for(var P=0;P<100*i&&M.length_&&n.scale(D,D,b/Math.sqrt(z)),n.add(D,D,T),S=t.getVelocity(D),n.squaredDistance(C,D)-_>-1e-4*_){M.push(D),C=D,E.push(S);var O=t.getDivergence(D,S),I=n.length(O);I>k&&!isNaN(I)&&isFinite(I)&&(k=I),L.push(I)}T=D}}for(var A=0;A max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if ((kill > 0.0) ||\n (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color — in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n worldCoordinate = objectOffset + dataCoordinate;\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if ((kill > 0.0) ||\n (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;\n\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n"]);r.createShader=function(t){var e=n(t,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createPickShader=function(t){var e=n(t,a,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createContourShader=function(t){var e=n(t,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":300,glslify:404}],314:[function(t,e,r){arguments[4][104][0].apply(r,arguments)},{dup:104}],315:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=y(e),n=b(e),s=x(e),l=_(e),u=i(e),c=a(e,[{buffer:u,size:4,stride:w,offset:0},{buffer:u,size:3,stride:w,offset:16},{buffer:u,size:3,stride:w,offset:28}]),f=i(e),h=a(e,[{buffer:f,size:4,stride:20,offset:0},{buffer:f,size:1,stride:20,offset:16}]),p=i(e),d=a(e,[{buffer:p,size:2,type:e.FLOAT}]),v=o(e,1,E,e.RGBA,e.UNSIGNED_BYTE);v.minFilter=e.LINEAR,v.magFilter=e.LINEAR;var g=new S(e,[0,0],[[0,0,0],[0,0,0]],r,n,u,c,v,s,l,f,h,p,d,[0,0,0]),m={levels:[[],[],[]]};for(var k in t)m[k]=t[k];return m.colormap=m.colormap||"jet",g.update(m),g};var n=t("bit-twiddle"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("typedarray-pool"),l=t("colormap"),u=t("ndarray-ops"),c=t("ndarray-pack"),f=t("ndarray"),h=t("surface-nets"),p=t("gl-mat4/multiply"),d=t("gl-mat4/invert"),v=t("binary-search-bounds"),g=t("ndarray-gradient"),m=t("./lib/shaders"),y=m.createShader,x=m.createContourShader,b=m.createPickShader,_=m.createPickContourShader,w=40,k=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],A=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],T=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];function M(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var t=0;t<3;++t){var e=T[t],r=(t+1)%3,n=(t+2)%3;e[r+0]=1,e[n+3]=1,e[t+6]=1}}();var E=256;function S(t,e,r,n,i,a,o,l,u,c,h,p,d,v,g){this.gl=t,this.shape=e,this.bounds=r,this.objectOffset=g,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=u,this._contourPickShader=c,this._contourBuffer=h,this._contourVAO=p,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new M([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=v,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var C=S.prototype;C.isTransparent=function(){return this.opacity<1},C.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},C.pickSlots=1,C.setPickBase=function(t){this.pickId=t};var L=[0,0,0],O={showSurface:!1,showContour:!1,projections:[k.slice(),k.slice(),k.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function I(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||L,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=O.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],p(l,t.model,l);var u=O.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)u[i][n]=t.clipBounds[i][n];u[0][r]=-1e8,u[1][r]=1e8}return O.showSurface=o,O.showContour=s,O}var P={model:k,view:k,projection:k,inverseModel:k.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},D=k.slice(),z=[1,0,0,0,1,0,0,0,1];function R(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=P;n.model=t.model||k,n.view=t.view||k,n.projection=t.projection||k,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=d(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=z,n.vertexColor=this.vertexColor;var s=D;for(p(s,n.view,n.model),p(s,n.projection,s),d(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var u=s[12+i];for(o=0;o<3;++o)u+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=u/l}var c=I(n,this);if(c.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=c.projections[i],this._shader.uniforms.clipBounds=c.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(c.showContour&&!e){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var h=this._contourVAO;for(h.bind(),i=0;i<3;++i)for(f.uniforms.permutation=T[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var u=r.position;u[0]=u[1]=u[2]=0;for(var c=0;c<2;++c)for(var f=c?a:1-a,h=0;h<2;++h)for(var p=h?l:1-l,d=i+c,g=s+h,m=f*p,y=0;y<3;++y)u[y]+=this._field[y].get(d,g)*m;for(var x=this._pickResult.level,b=0;b<3;++b)if(x[b]=v.le(this.contourLevels[b],u[b]),x[b]<0)this.contourLevels[b].length>0&&(x[b]=0);else if(x[b]Math.abs(w-u[b])&&(x[b]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],y=0;y<3;++y)r.dataCoordinate[y]=this._field[y].get(r.index[0],r.index[1]);return r},C.padField=function(t,e){var r=e.shape.slice(),n=t.shape.slice();u.assign(t.lo(1,1).hi(r[0],r[1]),e),u.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),u.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),u.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),u.assign(t.lo(n[0]-1,1).hi(1,r[1]),e.lo(r[0]-1)),t.set(0,0,e.get(0,0)),t.set(0,n[1]-1,e.get(0,r[1]-1)),t.set(n[0]-1,0,e.get(r[0]-1,0)),t.set(n[0]-1,n[1]-1,e.get(r[0]-1,r[1]-1))},C.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in t&&(this.contourWidth=B(t.contourWidth,Number)),"showContour"in t&&(this.showContour=B(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=B(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=j(t.contourColor)),"contourProject"in t&&(this.contourProject=B(t.contourProject,function(t){return B(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=j(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=B(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=B(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0);var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var i=(e.shape[0]+2)*(e.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=f(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),this.padField(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var p=t.coords;if(!Array.isArray(p)||3!==p.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var d=p[o];for(b=0;b<2;++b)if(d.shape[b]!==a[b])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],d)}}else if(t.ticks){var v=t.ticks;if(!Array.isArray(v)||2!==v.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var m=v[o];if((Array.isArray(m)||m.length)&&(m=f(m)),m.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var y=f(m.data,a);y.stride[o]=m.stride[0],y.stride[1^o]=0,this.padField(this._field[o],y)}}else{for(o=0;o<2;++o){var x=[0,0];x[o]=1,this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2],x,0)}this._field[0].set(0,0,0);for(var b=0;b0){for(var kt=0;kt<5;++kt)rt.pop();G-=1}continue t}rt.push(st[0],st[1],ct[0],ct[1],st[2]),G+=1}}ot.push(G)}this._contourOffsets[nt]=at,this._contourCounts[nt]=ot}var At=s.mallocFloat(rt.length);for(o=0;o halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:t,draw:e,atlas:{}}},A.prototype.update=function(t){var e=this;if("string"==typeof t)t={text:t};else if(!t)return;null!=(t=i(t,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(t.opacity)?this.opacity=t.opacity.map(function(t){return parseFloat(t)}):this.opacity=parseFloat(t.opacity)),null!=t.viewport&&(this.viewport=f(t.viewport),A.normalViewport&&(this.viewport.y=this.canvas.height-this.viewport.y-this.viewport.height),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=t.kerning&&(this.kerning=t.kerning),null!=t.offset&&("number"==typeof t.offset&&(t.offset=[t.offset,0]),this.positionOffset=y(t.offset)),t.direction&&(this.direction=t.direction),t.range&&(this.range=t.range,this.scale=[1/(t.range[2]-t.range[0]),1/(t.range[3]-t.range[1])],this.translate=[-t.range[0],-t.range[1]]),t.scale&&(this.scale=t.scale),t.translate&&(this.translate=t.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||t.font||(t.font=A.baseFontSize+"px sans-serif");var r,a=!1,o=!1;if(t.font&&(Array.isArray(t.font)?t.font:[t.font]).forEach(function(t,r){if("string"==typeof t)try{t=n.parse(t)}catch(e){t=n.parse(A.baseFontSize+"px "+t)}else t=n.parse(n.stringify(t));var i=n.stringify({size:A.baseFontSize,family:t.family,stretch:w?t.stretch:void 0,variant:t.variant,weight:t.weight,style:t.style}),s=p(t.size),l=Math.round(s[0]*d(s[1]));if(l!==e.fontSize[r]&&(o=!0,e.fontSize[r]=l),!(e.font[r]&&i==e.font[r].baseString||(a=!0,e.font[r]=A.fonts[i],e.font[r]))){var u=t.family.join(", "),c=[t.style];t.style!=t.variant&&c.push(t.variant),t.variant!=t.weight&&c.push(t.weight),w&&t.weight!=t.stretch&&c.push(t.stretch),e.font[r]={baseString:i,family:u,weight:t.weight,stretch:t.stretch,style:t.style,variant:t.variant,width:{},kerning:{},metrics:m(u,{origin:"top",fontSize:A.baseFontSize,fontStyle:c.join(" ")})},A.fonts[i]=e.font[r]}}),(a||o)&&this.font.forEach(function(r,i){var a=n.stringify({size:e.fontSize[i],family:r.family,stretch:w?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(e.fontAtlas[i]=e.shader.atlas[a],!e.fontAtlas[i]){var o=r.metrics;e.shader.atlas[a]=e.fontAtlas[i]={fontString:a,step:2*Math.ceil(e.fontSize[i]*o.bottom*.5),em:e.fontSize[i],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:e.regl.texture()}}null==t.text&&(t.text=e.text)}),"string"==typeof t.text&&t.position&&t.position.length>2){for(var s=Array(.5*t.position.length),h=0;h2){for(var _=!t.position[0].length,k=c.mallocFloat(2*this.count),T=0,M=0;T1?e.align[r]:e.align[0]:e.align;if("number"==typeof n)return n;switch(n){case"right":case"end":return-t;case"center":case"centre":case"middle":return.5*-t}return 0})),null==this.baseline&&null==t.baseline&&(t.baseline=0),null!=t.baseline&&(this.baseline=t.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(t,r){var n=(e.font[r]||e.font[0]).metrics,i=0;return i+=.5*n.bottom,i+="number"==typeof t?t-n.baseline:-n[t],A.normalViewport||(i*=-1),i})),null!=t.color)if(t.color||(t.color="transparent"),"string"!=typeof t.color&&isNaN(t.color)){var G;if("number"==typeof t.color[0]&&t.color.length>this.counts.length){var W=t.color.length;G=c.mallocUint8(W);for(var Y=(t.color.subarray||t.color.slice).bind(t.color),X=0;X4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(J){var K=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array(K);for(var Q=0;Q1?e.counts[Q]:e.counts[0],offset:e.textOffsets.length>1?e.textOffsets[Q]:e.textOffsets[0],color:e.color?e.color.length<=4?e.color:e.color.subarray(4*Q,4*Q+4):[0,0,0,255],opacity:Array.isArray(e.opacity)?e.opacity[Q]:e.opacity,baseline:null!=e.baselineOffset[Q]?e.baselineOffset[Q]:e.baselineOffset[0],align:e.align?null!=e.alignOffset[Q]?e.alignOffset[Q]:e.alignOffset[0]:0,atlas:e.fontAtlas[Q]||e.fontAtlas[0],positionOffset:e.positionOffset.length>2?e.positionOffset.subarray(2*Q,2*Q+2):e.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]}},A.prototype.destroy=function(){},A.prototype.kerning=!0,A.prototype.position={constant:new Float32Array(2)},A.prototype.translate=null,A.prototype.scale=null,A.prototype.font=null,A.prototype.text="",A.prototype.positionOffset=[0,0],A.prototype.opacity=1,A.prototype.color=new Uint8Array([0,0,0,255]),A.prototype.alignOffset=[0,0],A.normalViewport=!1,A.maxAtlasSize=1024,A.atlasCanvas=document.createElement("canvas"),A.atlasContext=A.atlasCanvas.getContext("2d",{alpha:!1}),A.baseFontSize=64,A.fonts={},e.exports=A},{"bit-twiddle":85,"color-normalize":113,"css-font":132,"detect-kerning":160,"es6-weak-map":219,"flatten-vertex-data":226,"font-atlas":227,"font-measure":228,"gl-util/context":318,"is-plain-obj":417,"object-assign":449,"parse-rect":454,"parse-unit":456,"pick-by-alias":460,regl:489,"to-px":526,"typedarray-pool":532}],317:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("ndarray-ops"),a=t("typedarray-pool");e.exports=function(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(o||function(t){o=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],s=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],l=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}(t),"number"==typeof arguments[1])return g(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return g(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],r=u(e)?e:e.raw;if(r)return function(t,e,r,n,i,a){var o=v(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,a,e),new h(t,o,r,n,i,a)}(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return function(t,e){var r=e.dtype,o=e.shape.slice(),s=t.getParameter(t.MAX_TEXTURE_SIZE);if(o[0]<0||o[0]>s||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=d(o,e.stride.slice()),u=0;"float32"===r?u=t.FLOAT:"float64"===r?(u=t.FLOAT,l=!1,r="float32"):"uint8"===r?u=t.UNSIGNED_BYTE:(u=t.UNSIGNED_BYTE,l=!1,r="uint8");var f,p,g=0;if(2===o.length)g=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])g=t.ALPHA;else if(2===o[2])g=t.LUMINANCE_ALPHA;else if(3===o[2])g=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}}u!==t.FLOAT||t.getExtension("OES_texture_float")||(u=t.UNSIGNED_BYTE,l=!1);var m=e.size;if(l)f=0===e.offset&&e.data.length===m?e.data:e.data.subarray(e.offset,e.offset+m);else{var y=[o[2],o[2]*o[0],1];p=a.malloc(m,r);var x=n(p,o,y,0);"float32"!==r&&"float64"!==r||u!==t.UNSIGNED_BYTE?i.assign(x,e):c(x,e),f=p.subarray(0,m)}var b=v(t);return t.texImage2D(t.TEXTURE_2D,0,g,o[0],o[1],0,g,u,f),l||a.free(p),new h(t,b,o[0],o[1],g,u)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function u(t){return"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&t instanceof ImageData}var c=function(t,e){i.muls(t,e,255)};function f(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function h(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}var p=h.prototype;function d(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function v(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function g(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=v(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new h(t,o,e,r,n,i)}Object.defineProperties(p,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(l.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return f(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return f(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,f(this,this._shape[0],t),t}}}),p.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},p.dispose=function(){this.gl.deleteTexture(this.handle)},p.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},p.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=u(t)?t:t.raw;if(l){var f=this._mipLevels.indexOf(o)<0;f?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l)}else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,u,f){var h=f.dtype,p=f.shape.slice();if(p.length<2||p.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var v=0,g=0,m=d(p,f.stride.slice());if("float32"===h?v=t.FLOAT:"float64"===h?(v=t.FLOAT,m=!1,h="float32"):"uint8"===h?v=t.UNSIGNED_BYTE:(v=t.UNSIGNED_BYTE,m=!1,h="uint8"),2===p.length)g=t.LUMINANCE,p=[p[0],p[1],1],f=n(f.data,p,[f.stride[0],f.stride[1],1],f.offset);else{if(3!==p.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===p[2])g=t.ALPHA;else if(2===p[2])g=t.LUMINANCE_ALPHA;else if(3===p[2])g=t.RGB;else{if(4!==p[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}p[2]}if(g!==t.LUMINANCE&&g!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(g=s),g!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=f.size,x=u.indexOf(o)<0;if(x&&u.push(o),v===l&&m)0===f.offset&&f.data.length===y?x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,f.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,f.data):x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,f.data.subarray(f.offset,f.offset+y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,f.data.subarray(f.offset,f.offset+y));else{var b;b=l===t.FLOAT?a.mallocFloat32(y):a.mallocUint8(y);var _=n(b,p,[p[2],p[2]*p[0],1]);v===t.FLOAT&&l===t.UNSIGNED_BYTE?c(_,f):i.assign(_,f),x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,b.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,b.subarray(0,y)),l===t.FLOAT?a.freeFloat32(b):a.freeUint8(b)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},{ndarray:445,"ndarray-ops":439,"typedarray-pool":532}],318:[function(t,e,r){"use strict";var n=t("pick-by-alias");function i(t){if(t.container)if(t.container==document.body)document.body.style.width||(t.canvas.width=t.width||t.pixelRatio*window.innerWidth),document.body.style.height||(t.canvas.height=t.height||t.pixelRatio*window.innerHeight);else{var e=t.container.getBoundingClientRect();t.canvas.width=t.width||e.right-e.left,t.canvas.height=t.height||e.bottom-e.top}}function a(t){return"function"==typeof t.getContext&&"width"in t&&"height"in t}e.exports=function(t){var e;if(t?"string"==typeof t&&(t={container:t}):t={},(t=a(t)?{container:t}:"string"==typeof(e=t).nodeName&&"function"==typeof e.appendChild&&"function"==typeof e.getBoundingClientRect?{container:t}:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(t)?{gl:t}:n(t,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio"},!0)).pixelRatio||(t.pixelRatio=window.pixelRatio||1),t.gl)return t.gl;if(t.canvas&&(t.container=t.canvas.parentNode),t.container){if("string"==typeof t.container){var r=document.querySelector(t.container);if(!r)throw Error("Element "+t.container+" is not found");t.container=r}a(t.container)?(t.canvas=t.container,t.container=t.canvas.parentNode):t.canvas||(t.canvas=document.createElement("canvas"),t.container.appendChild(t.canvas),i(t))}else t.canvas||(t.container=document.body||document.documentElement,t.canvas=document.createElement("canvas"),t.canvas.style.position="absolute",t.canvas.style.top=0,t.canvas.style.left=0,t.container.appendChild(t.canvas),i(t));if(!t.gl)try{t.gl=t.canvas.getContext("webgl",t.attrs)}catch(e){try{t.gl=t.canvas.getContext("experimental-webgl",t.attrs)}catch(e){t.gl=t.canvas.getContext("webgl-experimental",t.attrs)}}return t.gl}},{"pick-by-alias":460}],319:[function(t,e,r){"use strict";e.exports=function(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i1?0:Math.acos(s)};var n=t("./fromValues"),i=t("./normalize"),a=t("./dot")},{"./dot":334,"./fromValues":340,"./normalize":351}],325:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}},{}],326:[function(t,e,r){e.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},{}],327:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},{}],328:[function(t,e,r){e.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},{}],329:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}},{}],330:[function(t,e,r){e.exports=t("./distance")},{"./distance":331}],331:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)}},{}],332:[function(t,e,r){e.exports=t("./divide")},{"./divide":333}],333:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}},{}],334:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},{}],335:[function(t,e,r){e.exports=1e-6},{}],336:[function(t,e,r){e.exports=function(t,e){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))};var n=t("./epsilon")},{"./epsilon":335}],337:[function(t,e,r){e.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},{}],338:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}},{}],339:[function(t,e,r){e.exports=function(t,e,r,i,a,o){var s,l;for(e||(e=3),r||(r=0),l=i?Math.min(i*e+r,t.length):t.length,s=r;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}},{}],352:[function(t,e,r){e.exports=function(t,e){e=e||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}},{}],353:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[1],a=r[2],o=e[1]-i,s=e[2]-a,l=Math.sin(n),u=Math.cos(n);return t[0]=e[0],t[1]=i+o*u-s*l,t[2]=a+o*l+s*u,t}},{}],354:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[0],a=r[2],o=e[0]-i,s=e[2]-a,l=Math.sin(n),u=Math.cos(n);return t[0]=i+s*l+o*u,t[1]=e[1],t[2]=a+s*u-o*l,t}},{}],355:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[0],a=r[1],o=e[0]-i,s=e[1]-a,l=Math.sin(n),u=Math.cos(n);return t[0]=i+o*u-s*l,t[1]=a+o*l+s*u,t[2]=e[2],t}},{}],356:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}},{}],357:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}},{}],358:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}},{}],359:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},{}],360:[function(t,e,r){e.exports=t("./squaredDistance")},{"./squaredDistance":362}],361:[function(t,e,r){e.exports=t("./squaredLength")},{"./squaredLength":363}],362:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}},{}],363:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}},{}],364:[function(t,e,r){e.exports=t("./subtract")},{"./subtract":365}],365:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}},{}],366:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t}},{}],367:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t}},{}],368:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,f=u*i+l*n-o*a,h=u*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=c*u+p*-o+f*-l-h*-s,t[1]=f*u+p*-s+h*-o-c*-l,t[2]=h*u+p*-l+c*-s-f*-o,t}},{}],369:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}},{}],370:[function(t,e,r){e.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},{}],371:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},{}],372:[function(t,e,r){e.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},{}],373:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+a*a)}},{}],374:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}},{}],375:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},{}],376:[function(t,e,r){e.exports=function(t,e,r,n){var i=new Float32Array(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}},{}],377:[function(t,e,r){e.exports={create:t("./create"),clone:t("./clone"),fromValues:t("./fromValues"),copy:t("./copy"),set:t("./set"),add:t("./add"),subtract:t("./subtract"),multiply:t("./multiply"),divide:t("./divide"),min:t("./min"),max:t("./max"),scale:t("./scale"),scaleAndAdd:t("./scaleAndAdd"),distance:t("./distance"),squaredDistance:t("./squaredDistance"),length:t("./length"),squaredLength:t("./squaredLength"),negate:t("./negate"),inverse:t("./inverse"),normalize:t("./normalize"),dot:t("./dot"),lerp:t("./lerp"),random:t("./random"),transformMat4:t("./transformMat4"),transformQuat:t("./transformQuat")}},{"./add":369,"./clone":370,"./copy":371,"./create":372,"./distance":373,"./divide":374,"./dot":375,"./fromValues":376,"./inverse":378,"./length":379,"./lerp":380,"./max":381,"./min":382,"./multiply":383,"./negate":384,"./normalize":385,"./random":386,"./scale":387,"./scaleAndAdd":388,"./set":389,"./squaredDistance":390,"./squaredLength":391,"./subtract":392,"./transformMat4":393,"./transformQuat":394}],378:[function(t,e,r){e.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}},{}],379:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}},{}],380:[function(t,e,r){e.exports=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t}},{}],381:[function(t,e,r){e.exports=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}},{}],382:[function(t,e,r){e.exports=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}},{}],383:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}},{}],384:[function(t,e,r){e.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},{}],385:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o),t}},{}],386:[function(t,e,r){var n=t("./normalize"),i=t("./scale");e.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),i(t,t,e),t}},{"./normalize":385,"./scale":387}],387:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}},{}],388:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}},{}],389:[function(t,e,r){e.exports=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}},{}],390:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return r*r+n*n+i*i+a*a}},{}],391:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}},{}],392:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}},{}],393:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}},{}],394:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,f=u*i+l*n-o*a,h=u*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=c*u+p*-o+f*-l-h*-s,t[1]=f*u+p*-s+h*-o-c*-l,t[2]=h*u+p*-l+c*-s-f*-o,t[3]=e[3],t}},{}],395:[function(t,e,r){e.exports=function(t,e,r,a){return n[0]=a,n[1]=r,n[2]=e,n[3]=t,i[0]};var n=new Uint8Array(4),i=new Float32Array(n.buffer)},{}],396:[function(t,e,r){var n=t("glsl-tokenizer"),i=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r0)continue;r=t.slice(0,1).join("")}return F(r),O+=r.length,(E=E.slice(r.length)).length}}function q(){return/[^a-fA-F0-9]/.test(e)?(F(E.join("")),M=l,A):(E.push(e),r=e,A+1)}function G(){return"."===e?(E.push(e),M=v,r=e,A+1):/[eE]/.test(e)?(E.push(e),M=v,r=e,A+1):"x"===e&&1===E.length&&"0"===E[0]?(M=_,E.push(e),r=e,A+1):/[^\d]/.test(e)?(F(E.join("")),M=l,A):(E.push(e),r=e,A+1)}function W(){return"f"===e&&(E.push(e),r=e,A+=1),/[eE]/.test(e)?(E.push(e),r=e,A+1):"-"===e&&/[eE]/.test(r)?(E.push(e),r=e,A+1):/[^\d]/.test(e)?(F(E.join("")),M=l,A):(E.push(e),r=e,A+1)}function Y(){if(/[^\d\w_]/.test(e)){var t=E.join("");return M=R.indexOf(t)>-1?y:z.indexOf(t)>-1?m:g,F(E.join("")),M=l,A}return E.push(e),r=e,A+1}};var n=t("./lib/literals"),i=t("./lib/operators"),a=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=999,u=9999,c=0,f=1,h=2,p=3,d=4,v=5,g=6,m=7,y=8,x=9,b=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":399,"./lib/builtins-300es":398,"./lib/literals":401,"./lib/literals-300es":400,"./lib/operators":402}],398:[function(t,e,r){var n=t("./builtins");n=n.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),e.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},{"./builtins":399}],399:[function(t,e,r){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},{}],400:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{"./literals":401}],401:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],402:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],403:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),i=[];return i=(i=i.concat(r(t))).concat(r(null))}},{"./index":397}],404:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n>1,c=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+t[e+f],f+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+f],f+=h,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=u}return(p?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,u-=8);t[r+p-d]|=128*v}},{}],408:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var i=t[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var o=t.slice(0,i+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(i+1),c=0;c<=i;++c)l[c]=c;s<0&&(l[0]=1,l[1]=0);for(var f=new a(l,new Array(i+1),!1),h=f.adjacent,p=new Array(i+2),c=0;c<=i;++c){for(var d=l.slice(),v=0;v<=i;++v)v===c&&(d[v]=-1);var g=d[0];d[0]=d[1],d[1]=g;var m=new a(d,new Array(i+1),!0);h[c]=m,p[c]=m}p[i+1]=f;for(var c=0;c<=i;++c)for(var d=h[c].vertices,y=h[c].adjacent,v=0;v<=i;++v){var x=d[v];if(x<0)y[v]=f;else for(var b=0;b<=i;++b)h[b].vertices.indexOf(x)<0&&(y[v]=h[b])}for(var _=new u(i,o,p),w=!!e,c=i+1;c0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var i=new Function("test",e.join("")),a=n[t+1];return a||(a=n),i(a)}(t)),this.orient=a}var c=u.prototype;c.handleBoundaryDegeneracy=function(t,e){var r=this.dimension,n=this.vertices.length-1,i=this.tuple,a=this.vertices,o=[t];for(t.lastVisited=-n;o.length>0;){(t=o.pop()).vertices;for(var s=t.adjacent,l=0;l<=r;++l){var u=s[l];if(u.boundary&&!(u.lastVisited<=-n)){for(var c=u.vertices,f=0;f<=r;++f){var h=c[f];i[f]=h<0?e:a[h]}var p=this.orient();if(p>0)return u;u.lastVisited=-n,0===p&&o.push(u)}}}return null},c.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,u=s.adjacent,c=0;c<=n;++c)a[c]=i[l[c]];s.lastVisited=r;for(var c=0;c<=n;++c){var f=u[c];if(!(f.lastVisited>=r)){var h=a[c];a[c]=t;var p=this.orient();if(a[c]=h,p<0){s=f;continue t}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},c.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,u=this.interior,c=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,u.push(e);for(var h=[];f.length>0;){var e=f.pop(),p=e.vertices,d=e.adjacent,v=p.indexOf(r);if(!(v<0))for(var g=0;g<=n;++g)if(g!==v){var m=d[g];if(m.boundary&&!(m.lastVisited>=r)){var y=m.vertices;if(m.lastVisited!==-r){for(var x=0,b=0;b<=n;++b)y[b]<0?(x=b,l[b]=t):l[b]=i[y[b]];var _=this.orient();if(_>0){y[x]=r,m.boundary=!1,u.push(m),f.push(m),m.lastVisited=r;continue}m.lastVisited=-r}var w=m.adjacent,k=p.slice(),A=d.slice(),T=new a(k,A,!0);c.push(T);var M=w.indexOf(e);if(!(M<0)){w[M]=T,A[v]=m,k[g]=-1,A[g]=e,d[g]=T,T.flip();for(var b=0;b<=n;++b){var E=k[b];if(!(E<0||E===r)){for(var S=new Array(n-1),C=0,L=0;L<=n;++L){var O=k[L];O<0||L===b||(S[C++]=O)}h.push(new o(S,T,b))}}}}}}h.sort(s);for(var g=0;g+1=0?o[l++]=s[c]:u=1&c;if(u===(1&t)){var f=o[0];o[0]=o[1],o[1]=f}e.push(o)}}return e}},{"robust-orientation":497,"simplicial-complex":507}],409:[function(t,e,r){"use strict";var n=t("binary-search-bounds"),i=0,a=1;function o(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}e.exports=function(t){return t&&0!==t.length?new x(y(t)):new x(null)};var s=o.prototype;function l(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function u(t,e){var r=y(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function c(t,e){var r=t.intervals([]);r.push(e),u(t,r)}function f(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?i:(r.splice(n,1),u(t,r),a)}function h(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function d(t,e){for(var r=0;r>1],i=[],a=[],s=[],r=0;r3*(e+1)?c(this,t):this.left.insert(t):this.left=y([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?c(this,t):this.right.insert(t):this.right=y([t]);else{var r=n.ge(this.leftPoints,t,g),i=n.ge(this.rightPoints,t,m);this.leftPoints.splice(r,0,t),this.rightPoints.splice(i,0,t)}},s.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1))return f(this,t);var o=this.left.remove(t);return 2===o?(this.left=null,this.count-=1,a):(o===a&&(this.count-=1),o)}if(t[0]>this.mid){if(!this.right)return i;var s=this.left?this.left.count:0;if(4*s>3*(e-1))return f(this,t);var o=this.right.remove(t);return 2===o?(this.right=null,this.count-=1,a):(o===a&&(this.count-=1),o)}if(1===this.count)return this.leftPoints[0]===t?2:i;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var u=this,c=this.left;c.right;)u=c,c=c.right;if(u===this)c.right=this.right;else{var h=this.left,o=this.right;u.count-=c.count,u.right=c.left,c.left=h,c.right=o}l(this,c),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?l(this,this.left):l(this,this.right);return a}for(var h=n.ge(this.leftPoints,t,g);hthis.mid){if(this.right){var r=this.right.queryPoint(t,e);if(r)return r}return p(this.rightPoints,t,e)}return d(this.leftPoints,e)},s.queryInterval=function(t,e,r){if(tthis.mid&&this.right){var n=this.right.queryInterval(t,e,r);if(n)return n}return ethis.mid?p(this.rightPoints,t,r):d(this.leftPoints,r)};var b=x.prototype;b.insert=function(t){this.root?this.root.insert(t):this.root=new o(t[0],null,null,[t],[t])},b.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==i}return!1},b.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},b.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(b,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(b,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":84}],410:[function(t,e,r){"use strict";e.exports=function(t,e){e=e||new Array(t.length);for(var r=0;r + * @license MIT + */ +e.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},{}],414:[function(t,e,r){"use strict";e.exports="undefined"!=typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))},{}],415:[function(t,e,r){"use strict";e.exports=a,e.exports.isMobile=a;var n=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,i=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i;function a(t){t||(t={});var e=t.ua;return e||"undefined"==typeof navigator||(e=navigator.userAgent),e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),"string"==typeof e&&(t.tablet?i.test(e):n.test(e))}},{}],416:[function(t,e,r){"use strict";e.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}},{}],417:[function(t,e,r){"use strict";var n=Object.prototype.toString;e.exports=function(t){var e;return"[object Object]"===n.call(t)&&(null===(e=Object.getPrototypeOf(t))||e===Object.getPrototypeOf({}))}},{}],418:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=0;n13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},{}],419:[function(t,e,r){"use strict";e.exports=function(t){return"string"==typeof t&&(t=t.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4))}},{}],420:[function(t,e,r){e.exports=function(t,e,r){return t*(1-r)+e*r}},{}],421:[function(t,r,n){(function(t){!function(t,e){"object"==typeof n&&void 0!==r?r.exports=e():t.mapboxgl=e()}(this,function(){"use strict";var e,r,n;function i(t,i){if(e)if(r){var a="var sharedChunk = {}; ("+e+")(sharedChunk); ("+r+")(sharedChunk);",o={};e(o),(n=i(o)).workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"}))}else r=i;else e=i}return i(0,function(e){var r="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{};function n(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function i(t,e){return t(e={exports:{}},e.exports),e.exports}var a=o;function o(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}o.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},o.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},o.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},o.prototype.solveCurveX=function(t,e){var r,n,i,a,o;for(void 0===e&&(e=1e-6),i=t,o=0;o<8;o++){if(a=this.sampleCurveX(i)-t,Math.abs(a)(n=1))return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},o.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var s=function(t,e,r){this.column=t,this.row=e,this.zoom=r};s.prototype.clone=function(){return new s(this.column,this.row,this.zoom)},s.prototype.zoomTo=function(t){return this.clone()._zoomTo(t)},s.prototype.sub=function(t){return this.clone()._sub(t)},s.prototype._zoomTo=function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},s.prototype._sub=function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this};var l=u;function u(t,e){this.x=t,this.y=e}function c(t,e,r,n){var i=new a(t,e,r,n);return function(t){return i.solve(t)}}u.prototype={clone:function(){return new u(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),a=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},u.convert=function(t){return t instanceof u?t:Array.isArray(t)?new u(t[0],t[1]):t};var f=c(.25,.1,.25,1);function h(t,e,r){return Math.min(r,Math.max(e,t))}function p(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n(e.y-t.y)*(r.x-t.x)}function k(t){for(var e=0,r=0,n=t.length,i=n-1,a=void 0,o=void 0;r=200&&r.status<300&&r.response?e(null,{data:n,cacheControl:r.getResponseHeader("Cache-Control"),expires:r.getResponseHeader("Expires")}):e(new T(r.statusText,r.status,t.url))},r.send(),r};function S(t,e,r){r[t]=r[t]||[],r[t].push(e)}function C(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}var L=function(t,e){void 0===e&&(e={}),p(this,e),this.type=t},O=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",p({error:e},r))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(L),I=function(){};I.prototype.on=function(t,e){return this._listeners=this._listeners||{},S(t,e,this._listeners),this},I.prototype.off=function(t,e){return C(t,e,this._listeners),C(t,e,this._oneTimeListeners),this},I.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},S(t,e,this._oneTimeListeners),this},I.prototype.fire=function(t){"string"==typeof t&&(t=new L(t,arguments[1]||{}));var e=t.type;if(this.listens(e)){t.target=this;for(var r=0,n=this._listeners&&this._listeners[e]?this._listeners[e].slice():[];r0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},I.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var P={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.0511,180,85.0511]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.0511,180,85.0511]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.0511,180,85.0511]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},lineMetrics:{type:"boolean",default:!1}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_fill:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_circle:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{butt:{},round:{},square:{}},default:"butt"},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{bevel:{},round:{},miter:{}},default:"miter"},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,requires:[{"line-join":"round"}]},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_symbol:{"symbol-placement":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{point:{},line:{}},default:"point"},"symbol-spacing":{type:"number",default:250,minimum:1,function:"interpolated","zoom-function":!0,units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1},"icon-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["icon-image"]},"icon-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"]},"icon-size":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,units:"factor of the original icon size",requires:["icon-image"]},"icon-text-fit":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"]},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",function:"interpolated","zoom-function":!0,requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}]},"icon-image":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,tokens:!0},"icon-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,"property-function":!0,units:"degrees",requires:["icon-image"]},"icon-padding":{type:"number",default:2,minimum:0,function:"interpolated","zoom-function":!0,units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"icon-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"]},"icon-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"]},"text-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"]},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"]},"text-field":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:"",tokens:!0},"text-font":{type:"array",value:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"]},"text-size":{type:"number",default:16,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-line-height":{type:"number",default:1.2,units:"ems",function:"interpolated","zoom-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number",default:0,units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-justify":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{left:{},center:{},right:{}},default:"center",requires:["text-field"]},"text-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field"]},"text-max-angle":{type:"number",default:45,units:"degrees",function:"interpolated","zoom-function":!0,requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number",default:0,period:360,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,requires:["text-field"]},"text-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,length:2,default:[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["text-field"]},"text-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["text-field"]},"text-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["text-field","icon-image"]},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Heatmap"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},transition:!1,"zoom-function":!0,"property-function":!1,function:"piecewise-constant"},position:{type:"array",default:[1.15,210,30],length:3,value:"number",transition:!0,function:"interpolated","zoom-function":!0,"property-function":!1},color:{type:"color",default:"#ffffff",function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0},intensity:{type:"number",default:.5,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!0},"fill-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"fill-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["fill-translate"]},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0}},paint_line:{"line-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["line-translate"]},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-gap-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-offset":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-dasharray":{type:"array",value:"number",function:"piecewise-constant","zoom-function":!0,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"line-gradient":{type:"color",function:"interpolated","zoom-function":!1,"property-function":!1,transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}]}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-blur":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map"},"circle-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"viewport"},"circle-stroke-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-stroke-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"heatmap-weight":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!1},"heatmap-intensity":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],function:"interpolated","zoom-function":!1,"property-function":!1,transition:!1},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-hue-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,transition:!0,units:"degrees"},"raster-brightness-min":{type:"number",function:"interpolated","zoom-function":!0,default:0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number",function:"interpolated","zoom-function":!0,default:1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-fade-duration":{type:"number",default:300,minimum:0,function:"interpolated","zoom-function":!0,transition:!1,units:"milliseconds"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,function:"interpolated","zoom-function":!0,transition:!1},"hillshade-illumination-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"viewport"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"hillshade-shadow-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",function:"interpolated","zoom-function":!0,transition:!0},"hillshade-accent-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0}},paint_background:{"background-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!1,default:1,minimum:0,maximum:1,transition:!0},"fill-extrusion-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-extrusion-pattern"}]},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"fill-extrusion-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"]},"fill-extrusion-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"fill-extrusion-height":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",transition:!0},"fill-extrusion-base":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"]}}},D=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function z(t){var e=t.key,r=t.value;return r?[new D(e,r,"constants have been deprecated as of v8")]:[]}function R(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var J=[V,U,H,q,G,W,Z(Y)];function K(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&!K(t.itemType,e.itemType)&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=J;r255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function o(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=i.indexOf("("),u=i.indexOf(")");if(-1!==l&&u+1===i.length){var c=i.substr(0,l),f=i.substr(l+1,u-(l+1)).split(","),h=1;switch(c){case"rgba":if(4!==f.length)return null;h=o(f.pop());case"rgb":return 3!==f.length?null:[a(f[0]),a(f[1]),a(f[2]),h];case"hsla":if(4!==f.length)return null;h=o(f.pop());case"hsl":if(3!==f.length)return null;var p=(parseFloat(f[0])%360+360)%360/360,d=o(f[1]),v=o(f[2]),g=v<=.5?v*(d+1):v+d-v*d,m=2*v-g;return[n(255*s(m,g,p+1/3)),n(255*s(m,g,p)),n(255*s(m,g,p-1/3)),h];default:return null}}return null}}catch(t){}}).parseCSSColor,tt=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};tt.parse=function(t){if(t){if(t instanceof tt)return t;if("string"==typeof t){var e=Q(t);if(e)return new tt(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},tt.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],i=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+i+")"},tt.prototype.toArray=function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*r/n,n]},tt.black=new tt(0,0,0,1),tt.white=new tt(1,1,1,1),tt.transparent=new tt(0,0,0,0);var et=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};et.prototype.compare=function(t,e){return this.collator.compare(t,e)},et.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var rt=function(t,e,r){this.type=X,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};function nt(t,e,r,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function it(t){if(null===t)return V;if("string"==typeof t)return H;if("boolean"==typeof t)return q;if("number"==typeof t)return U;if(t instanceof tt)return G;if(t instanceof et)return X;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n4)return e.error("Expected 1, 2, or 3 arguments, but found "+(t.length-1)+" instead.");var r,n;if(t.length>2){var i=t[1];if("string"!=typeof i||!(i in ut))return e.error('The item type argument of "array" must be one of string, number, boolean',1);r=ut[i]}else r=Y;if(t.length>3){if("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2]))return e.error('The length argument to "array" must be a positive integer literal',2);n=t[2]}var a=Z(r,n),o=e.parse(t[t.length-1],t.length-1,Y);return o?new ct(a,o):null},ct.prototype.evaluate=function(t){var e=this.input.evaluate(t);if(K(this.type,it(e)))throw new ot("Expected value to be of type "+$(this.type)+", but found "+$(it(e))+" instead.");return e},ct.prototype.eachChild=function(t){t(this.input)},ct.prototype.possibleOutputs=function(){return this.input.possibleOutputs()},ct.prototype.serialize=function(){var t=["array"],e=this.type.itemType;if("string"===e.kind||"number"===e.kind||"boolean"===e.kind){t.push(e.kind);var r=this.type.N;"number"==typeof r&&t.push(r)}return t.push(this.input.serialize()),t};var ft={"to-number":U,"to-color":G},ht=function(t,e){this.type=t,this.args=e};ht.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");for(var r=t[0],n=ft[r],i=[],a=1;a4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":nt(e[0],e[1],e[2],e[3])))return new tt(e[0]/255,e[1]/255,e[2]/255,e[3]);throw new ot(r||"Could not parse color from value '"+("string"==typeof e?e:JSON.stringify(e))+"'")}for(var o=null,s=0,l=this.args;s=0)return!1;var r=!0;return t.eachChild(function(t){r&&!mt(t,e)&&(r=!1)}),r}vt.prototype.evaluate=function(t){return this._evaluate(t,this.args)},vt.prototype.eachChild=function(t){this.args.forEach(t)},vt.prototype.possibleOutputs=function(){return[void 0]},vt.prototype.serialize=function(){return[this.name].concat(this.args.map(function(t){return t.serialize()}))},vt.parse=function(t,e){var r=t[0],n=vt.definitions[r];if(!n)return e.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0);for(var i=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=a.filter(function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1}),s=[],l=1;lr&&ee))throw new ot("Input is not a number.");a=o-1}}return Math.max(o-1,0)}xt.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},xt.prototype._parse=function(t,e){if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var r=t[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found "+typeof r+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[r];if(n){var i=n.parse(t,this);if(!i)return null;if(this.expectedType){var a=this.expectedType,o=i.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind||"value"!==o.kind)if("array"===a.kind&&"value"===o.kind)e.omitTypeAnnotations||(i=new ct(a,i));else if("color"!==a.kind||"value"!==o.kind&&"string"!==o.kind){if(this.checkSubtype(this.expectedType,i.type))return null}else e.omitTypeAnnotations||(i=new ht(a,[i]));else e.omitTypeAnnotations||(i=new lt(a,[i]))}if(!(i instanceof at)&&function t(e){if(e instanceof yt)return t(e.boundExpression);if(e instanceof vt&&"error"===e.name)return!1;if(e instanceof rt)return!1;var r=e instanceof ht||e instanceof lt||e instanceof ct,n=!0;return e.eachChild(function(e){n=r?n&&t(e):n&&e instanceof at}),!!n&>(e)&&mt(e,["zoom","heatmap-density","line-progress","is-supported-script"])}(i)){var s=new dt;try{i=new at(i.type,i.evaluate(s))}catch(t){return this.error(t.message),null}}return i}return this.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},xt.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new xt(this.registry,n,e||null,i,this.errors)},xt.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map(function(t){return"["+t+"]"}).join("");this.errors.push(new N(n,t))},xt.prototype.checkSubtype=function(t,e){var r=K(t,e);return r&&this.error(r),r};var _t=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var f=e.parse(l,c,a);if(!f)return null;a=a||f.type,i.push([s,f])}return new _t(a,r,i)},_t.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[bt(e,n)].evaluate(t)},_t.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var kt=Object.freeze({number:wt,color:function(t,e,r){return new tt(wt(t.r,e.r,r),wt(t.g,e.g,r),wt(t.b,e.b,r),wt(t.a,e.a,r))},array:function(t,e,r){return t.map(function(t,n){return wt(t,e[n],r)})}}),At=function(t,e,r,n){this.type=t,this.interpolation=e,this.input=r,this.labels=[],this.outputs=[];for(var i=0,a=n;i1}))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:o}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(n=e.parse(n,2,U)))return null;var s=[],l=null;e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var u=0;u=c)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',h);var d=e.parse(f,p,l);if(!d)return null;l=l||d.type,s.push([c,d])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new At(l,r,n,s):e.error("Type "+$(l)+" is not interpolatable.")},At.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var a=bt(e,n),o=e[a],s=e[a+1],l=At.interpolationFactor(this.interpolation,n,o,s),u=r[a].evaluate(t),c=r[a+1].evaluate(t);return kt[this.type.kind.toLowerCase()](u,c,l)},At.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new ot("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ot("Array index must be an integer, but found "+e+" instead.");return r[e]},St.prototype.eachChild=function(t){t(this.index),t(this.input)},St.prototype.possibleOutputs=function(){return[void 0]},St.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Ct=function(t,e,r,n,i,a){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a};Ct.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},a=[],o=2;oNumber.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,it(h)))return null}else r=it(h);if(void 0!==i[String(h)])return u.error("Branch labels must be unique.");i[String(h)]=a.length}var p=e.parse(l,o,n);if(!p)return null;n=n||p.type,a.push(p)}var d=e.parse(t[1],1,r);if(!d)return null;var v=e.parse(t[t.length-1],t.length-1,n);return v?new Ct(r,n,d,i,a,v):null},Ct.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Ct.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Ct.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()})).concat(this.otherwise.possibleOutputs());var t},Ct.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();in.evaluate(t)}function Ut(t,e){var r=e[0],n=e[1];return r.evaluate(t)<=n.evaluate(t)}function Ht(t,e){var r=e[0],n=e[1];return r.evaluate(t)>=n.evaluate(t)}function qt(t){return{type:t}}function Gt(t){return{result:"success",value:t}}function Wt(t){return{result:"error",value:t}}vt.register(Rt,{error:[{kind:"error"},[H],function(t,e){var r=e[0];throw new ot(r.evaluate(t))}],typeof:[H,[Y],function(t,e){return $(it(e[0].evaluate(t)))}],"to-string":[H,[Y],function(t,e){var r=e[0],n=typeof(r=r.evaluate(t));return null===r?"":"string"===n||"number"===n||"boolean"===n?String(r):r instanceof tt?r.toString():JSON.stringify(r)}],"to-boolean":[q,[Y],function(t,e){var r=e[0];return Boolean(r.evaluate(t))}],"to-rgba":[Z(U,4),[G],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[G,[U,U,U],Ft],rgba:[G,[U,U,U,U],Ft],has:{type:q,overloads:[[[H],function(t,e){return Bt(e[0].evaluate(t),t.properties())}],[[H,W],function(t,e){var r=e[0],n=e[1];return Bt(r.evaluate(t),n.evaluate(t))}]]},get:{type:Y,overloads:[[[H],function(t,e){return Nt(e[0].evaluate(t),t.properties())}],[[H,W],function(t,e){var r=e[0],n=e[1];return Nt(r.evaluate(t),n.evaluate(t))}]]},properties:[W,[],function(t){return t.properties()}],"geometry-type":[H,[],function(t){return t.geometryType()}],id:[Y,[],function(t){return t.id()}],zoom:[U,[],function(t){return t.globals.zoom}],"heatmap-density":[U,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[U,[],function(t){return t.globals.lineProgress||0}],"+":[U,qt(U),function(t,e){for(var r=0,n=0,i=e;n":[q,[H,Y],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>a}],"filter-id->":[q,[Y],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[q,[H,Y],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[q,[Y],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[q,[H,Y],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[q,[Y],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[q,[Y],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[q,[],function(t){return null!==t.id()}],"filter-type-in":[q,[Z(H)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[q,[Z(Y)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[q,[H,Z(Y)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[q,[H,Z(Y)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],">":{type:q,overloads:[[[U,U],Vt],[[H,H],Vt],[[H,H,X],function(t,e){var r=e[0],n=e[1];return e[2].evaluate(t).compare(r.evaluate(t),n.evaluate(t))>0}]]},"<":{type:q,overloads:[[[U,U],jt],[[H,H],jt],[[H,H,X],function(t,e){var r=e[0],n=e[1];return e[2].evaluate(t).compare(r.evaluate(t),n.evaluate(t))<0}]]},">=":{type:q,overloads:[[[U,U],Ht],[[H,H],Ht],[[H,H,X],function(t,e){var r=e[0],n=e[1];return e[2].evaluate(t).compare(r.evaluate(t),n.evaluate(t))>=0}]]},"<=":{type:q,overloads:[[[U,U],Ut],[[H,H],Ut],[[H,H,X],function(t,e){var r=e[0],n=e[1];return e[2].evaluate(t).compare(r.evaluate(t),n.evaluate(t))<=0}]]},all:{type:q,overloads:[[[q,q],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[qt(q),function(t,e){for(var r=0,n=e;rQt?Math.pow(t,1/3):t/Kt+$t}function ne(t){return t>Jt?t*t*t:Kt*(t-$t)}function ie(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ae(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function oe(t){var e=ae(t.r),r=ae(t.g),n=ae(t.b),i=re((.4124564*e+.3575761*r+.1804375*n)/Yt),a=re((.2126729*e+.7151522*r+.072175*n)/Xt);return{l:116*a-16,a:500*(i-a),b:200*(a-re((.0193339*e+.119192*r+.9503041*n)/Zt)),alpha:t.a}}function se(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=Xt*ne(e),r=Yt*ne(r),n=Zt*ne(n),new tt(ie(3.2404542*r-1.5371385*e-.4985314*n),ie(-.969266*r+1.8760108*e+.041556*n),ie(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}var le={forward:oe,reverse:se,interpolate:function(t,e,r){return{l:wt(t.l,e.l,r),a:wt(t.a,e.a,r),b:wt(t.b,e.b,r),alpha:wt(t.alpha,e.alpha,r)}}},ue={forward:function(t){var e=oe(t),r=e.l,n=e.a,i=e.b,a=Math.atan2(i,n)*ee;return{h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*te,r=t.c;return se({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:function(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}(t.h,e.h,r),c:wt(t.c,e.c,r),l:wt(t.l,e.l,r),alpha:wt(t.alpha,e.alpha,r)}}},ce=Object.freeze({lab:le,hcl:ue});function fe(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function he(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function pe(t){return t}function de(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function ve(t,e,r,n,i){return de(typeof r===i?n[r]:void 0,t.default,e.default)}function ge(t,e,r){if("number"!==fe(r))return de(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=xe(t.stops,r);return t.stops[i][1]}function me(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==fe(r))return de(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var a=xe(t.stops,r),o=function(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],l=t.stops[a+1][1],u=kt[e.type]||pe;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=ce[t.colorSpace];u=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return u(r,n,o)}}:u(s,l,o)}function ye(t,e,r){return"color"===e.type?r=tt.parse(r):fe(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),de(r,t.default,e.default)}function xe(t,e){for(var r,n,i=0,a=t.length-1,o=0;i<=a;){if(r=t[o=Math.floor((i+a)/2)][0],n=t[o+1][0],e===r||e>r&&ee&&(a=o-1)}return Math.max(o-1,0)}var be=function(t,e){var r;this.expression=t,this._warningHistory={},this._defaultValue="color"===(r=e).type&&he(r.default)?new tt(0,0,0,0):"color"===r.type?tt.parse(r.default)||null:void 0===r.default?null:r.default,"enum"===e.type&&(this._enumValues=e.values)};function _e(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Rt}function we(t,e){var r=new xt(Rt,[],function(t){var e={color:G,string:H,number:U,enum:H,boolean:q};return"array"===t.type?Z(e[t.value]||Y,t.length):e[t.type]||null}(e)),n=r.parse(t);return n?Gt(new be(n,e)):Wt(r.errors)}be.prototype.evaluateWithoutErrorHandling=function(t,e){return this._evaluator||(this._evaluator=new dt),this._evaluator.globals=t,this._evaluator.feature=e,this.expression.evaluate(this._evaluator)},be.prototype.evaluate=function(t,e){this._evaluator||(this._evaluator=new dt),this._evaluator.globals=t,this._evaluator.feature=e;try{var r=this.expression.evaluate(this._evaluator);if(null==r)return this._defaultValue;if(this._enumValues&&!(r in this._enumValues))throw new ot("Expected value to be one of "+Object.keys(this._enumValues).map(function(t){return JSON.stringify(t)}).join(", ")+", but found "+JSON.stringify(r)+" instead.");return r}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var ke=function(t,e){this.kind=t,this._styleExpression=e};ke.prototype.evaluateWithoutErrorHandling=function(t,e){return this._styleExpression.evaluateWithoutErrorHandling(t,e)},ke.prototype.evaluate=function(t,e){return this._styleExpression.evaluate(t,e)};var Ae=function(t,e,r){this.kind=t,this.zoomStops=r.labels,this._styleExpression=e,r instanceof At&&(this._interpolationType=r.interpolation)};function Te(t,e){if("error"===(t=we(t,e)).result)return t;var r=t.value.expression,n=gt(r);if(!n&&!e["property-function"])return Wt([new N("","property expressions not supported")]);var i=mt(r,["zoom"]);if(!i&&!1===e["zoom-function"])return Wt([new N("","zoom expressions not supported")]);var a=function t(e){var r=null;if(e instanceof Et)r=t(e.result);else if(e instanceof Mt)for(var n=0,i=e.args;nn.maximum?[new D(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function Oe(t){var e,r,n,i=t.valueSpec,a=F(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,l=!s,u="array"===fe(t.value.stops)&&"array"===fe(t.value.stops[0])&&"object"===fe(t.value.stops[0][0]),c=Se({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===a)return[new D(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(Ce({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:f})),"array"===fe(r)&&0===r.length&&e.push(new D(t.key,r,"array must have at least one stop")),e},default:function(t){return Ke({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===a&&s&&c.push(new D(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||c.push(new D(t.key,t.value,'missing required property "stops"')),"exponential"===a&&"piecewise-constant"===t.valueSpec.function&&c.push(new D(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!t.valueSpec["property-function"]?c.push(new D(t.key,t.value,"property functions not supported")):s&&!t.valueSpec["zoom-function"]&&"heatmap-color"!==t.objectKey&&"line-gradient"!==t.objectKey&&c.push(new D(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!u||void 0!==t.value.property||c.push(new D(t.key,t.value,'"property" property is required')),c;function f(t){var e=[],a=t.value,s=t.key;if("array"!==fe(a))return[new D(s,a,"array expected, "+fe(a)+" found")];if(2!==a.length)return[new D(s,a,"array length 2 expected, length "+a.length+" found")];if(u){if("object"!==fe(a[0]))return[new D(s,a,"object expected, "+fe(a[0])+" found")];if(void 0===a[0].zoom)return[new D(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new D(s,a,"object stop key must have value")];if(n&&n>F(a[0].zoom))return[new D(s,a[0].zoom,"stop zoom values must appear in ascending order")];F(a[0].zoom)!==n&&(n=F(a[0].zoom),r=void 0,o={}),e=e.concat(Se({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Le,value:h}}))}else e=e.concat(h({key:s+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return e.concat(Ke({key:s+"[1]",value:a[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=fe(t.value),l=F(t.value),u=null!==t.value?t.value:n;if(e){if(s!==e)return[new D(t.key,u,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new D(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var c="number expected, "+s+" found";return i["property-function"]&&void 0===a&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new D(t.key,u,c)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3===t.length&&(Array.isArray(t[1])||Array.isArray(t[2]));case"any":case"all":for(var e=0,r=t.slice(1);ee?1:0}function Be(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?Ne(t[1],t[2],"=="):"!="===r?Ue(Ne(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?Ne(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(Be))):"all"===r?["all"].concat(t.slice(1).map(Be)):"none"===r?["all"].concat(t.slice(1).map(Be).map(Ue)):"in"===r?je(t[1],t.slice(2)):"!in"===r?Ue(je(t[1],t.slice(2))):"has"===r?Ve(t[1]):"!has"!==r||Ue(Ve(t[1]))}function Ne(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function je(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(function(t){return typeof t!=typeof e[0]})?["filter-in-large",t,["literal",e.sort(Fe)]]:["filter-in-small",t,["literal",e]]}}function Ve(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Ue(t){return["!",t]}function He(t){return De(B(t.value))?Ie(R({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==fe(r))return[new D(n,r,"array expected, "+fe(r)+" found")];var i,a=e.styleSpec,o=[];if(r.length<1)return[new D(n,r,"filter array must have at least 1 element")];switch(o=o.concat(Pe({key:n+"[0]",value:r[0],valueSpec:a.filter_operator,style:e.style,styleSpec:e.styleSpec})),F(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===F(r[1])&&o.push(new D(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&o.push(new D(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=fe(r[1]))&&o.push(new D(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s=u[h+0]&&n>=u[h+1]?(o[f]=!0,a.push(l[f])):o[f]=!1}}},cr.prototype._forEachCell=function(t,e,r,n,i,a,o){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),u=this._convertToCellCoord(r),c=this._convertToCellCoord(n),f=s;f<=u;f++)for(var h=l;h<=c;h++){var p=this.d*h+f;if(i.call(this,t,e,r,n,p,a,o))return}},cr.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},cr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=ur+this.cells.length+1+1,r=0,n=0;n=0)){var f=t[c];u[c]=hr[l].shallow.indexOf(c)>=0?f:vr(f,e)}t instanceof Error&&(u.message=t.message)}return{name:l,properties:u}}throw new Error("can't serialize object of type "+typeof t)}function gr(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof ArrayBuffer||ArrayBuffer.isView(t)||t instanceof fr)return t;if(Array.isArray(t))return t.map(function(t){return gr(t)});if("object"==typeof t){var e=t,r=e.name,n=e.properties;if(!r)throw new Error("can't deserialize object of anonymous class");var i=hr[r].klass;if(!i)throw new Error("can't deserialize unregistered class "+r);if(i.deserialize)return i.deserialize(n._serialized);for(var a=Object.create(i.prototype),o=0,s=Object.keys(n);o=0?n[l]:gr(n[l])}return a}throw new Error("can't deserialize object of type "+typeof t)}var mr=function(){this.first=!0};mr.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function xr(t){for(var e=0,r=t;e=65097&&t<=65103)||yr["CJK Compatibility Ideographs"](t)||yr["CJK Compatibility"](t)||yr["CJK Radicals Supplement"](t)||yr["CJK Strokes"](t)||!(!yr["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||yr["CJK Unified Ideographs Extension A"](t)||yr["CJK Unified Ideographs"](t)||yr["Enclosed CJK Letters and Months"](t)||yr["Hangul Compatibility Jamo"](t)||yr["Hangul Jamo Extended-A"](t)||yr["Hangul Jamo Extended-B"](t)||yr["Hangul Jamo"](t)||yr["Hangul Syllables"](t)||yr.Hiragana(t)||yr["Ideographic Description Characters"](t)||yr.Kanbun(t)||yr["Kangxi Radicals"](t)||yr["Katakana Phonetic Extensions"](t)||yr.Katakana(t)&&12540!==t||!(!yr["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!yr["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||yr["Unified Canadian Aboriginal Syllabics"](t)||yr["Unified Canadian Aboriginal Syllabics Extended"](t)||yr["Vertical Forms"](t)||yr["Yijing Hexagram Symbols"](t)||yr["Yi Syllables"](t)||yr["Yi Radicals"](t))))}function wr(t){return!(_r(t)||function(t){return!!(yr["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||yr["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||yr["Letterlike Symbols"](t)||yr["Number Forms"](t)||yr["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||yr["Control Pictures"](t)&&9251!==t||yr["Optical Character Recognition"](t)||yr["Enclosed Alphanumerics"](t)||yr["Geometric Shapes"](t)||yr["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||yr["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||yr["CJK Symbols and Punctuation"](t)||yr.Katakana(t)||yr["Private Use Area"](t)||yr["CJK Compatibility Forms"](t)||yr["Small Form Variants"](t)||yr["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function kr(t,e){return!(!e&&(t>=1424&&t<=2303||yr["Arabic Presentation Forms-A"](t)||yr["Arabic Presentation Forms-B"](t))||t>=2304&&t<=3583||t>=3840&&t<=4255||yr.Khmer(t))}var Ar,Tr=!1,Mr=null,Er=!1,Sr=new I,Cr={applyArabicShaping:null,processBidirectionalText:null,isLoaded:function(){return Er||null!=Cr.applyArabicShaping}},Lr=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new mr,this.transition={})};Lr.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;rthis.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(en.zoomHistory.lastIntegerZoom?{from:t,to:e,fromScale:2,toScale:1,t:a+(1-a)*o}:{from:r,to:e,fromScale:.5,toScale:1,t:1-(1-o)*a}},Vr.prototype.interpolate=function(t){return t};var Ur=function(t){this.specification=t};Ur.prototype.possiblyEvaluate=function(t,e){return!!t.expression.evaluate(e)},Ur.prototype.interpolate=function(){return!1};var Hr=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},t){var r=t[e],n=this.defaultPropertyValues[e]=new Or(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new Ir(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};pr("DataDrivenProperty",jr),pr("DataConstantProperty",Nr),pr("CrossFadedProperty",Vr),pr("ColorRampProperty",Ur);var qr=function(t){function e(e,r){for(var n in t.call(this),this.id=e.id,this.metadata=e.metadata,this.type=e.type,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,this.visibility="visible","background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),this._featureFilter=function(){return!0},r.layout&&(this._unevaluatedLayout=new Rr(r.layout)),this._transitionablePaint=new Pr(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(or,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility="none"===e?e:"visible"},e.prototype.getPaintProperty=function(t){return g(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(ar,n,t,e,r))return}g(t,"-transition")?this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0):this._transitionablePaint.setValue(t,e)},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t)),this.paint=this._transitioningPaint.possiblyEvaluate(t)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return"none"===this.visibility&&(t.layout=t.layout||{},t.layout.visibility="none"),y(t,function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)})},e.prototype._validate=function(t,e,r,n,i){return(!i||!1!==i.validate)&&sr(this,t.call(nr,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:P,style:{glyphs:!0,sprite:!0}}))},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e}(I),Gr={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Wr=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Yr=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Xr(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map(function(t){var i,a=(i=t.type,Gr[i].BYTES_PER_ELEMENT),o=r=Zr(r,Math.max(e,a)),s=t.components||1;return n=Math.max(n,a),r+=a*s,{name:t.name,type:t.type,components:s,offset:o}}),size:Zr(r,Math.max(n,e)),alignment:e}}function Zr(t,e){return Math.ceil(t/e)*e}Yr.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Yr.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Yr.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Yr.prototype.clear=function(){this.length=0},Yr.prototype.resize=function(t){this.reserve(t),this.length=t},Yr.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},Yr.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var $r=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;this.resize(r+1);var n=2*r;return this.int16[n+0]=t,this.int16[n+1]=e,r},e}(Yr);$r.prototype.bytesPerElement=4,pr("StructArrayLayout2i4",$r);var Jr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;this.resize(i+1);var a=4*i;return this.int16[a+0]=t,this.int16[a+1]=e,this.int16[a+2]=r,this.int16[a+3]=n,i},e}(Yr);Jr.prototype.bytesPerElement=8,pr("StructArrayLayout4i8",Jr);var Kr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;this.resize(o+1);var s=6*o;return this.int16[s+0]=t,this.int16[s+1]=e,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=i,this.int16[s+5]=a,o},e}(Yr);Kr.prototype.bytesPerElement=12,pr("StructArrayLayout2i4i12",Kr);var Qr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s){var l=this.length;this.resize(l+1);var u=6*l,c=12*l;return this.int16[u+0]=t,this.int16[u+1]=e,this.int16[u+2]=r,this.int16[u+3]=n,this.uint8[c+8]=i,this.uint8[c+9]=a,this.uint8[c+10]=o,this.uint8[c+11]=s,l},e}(Yr);Qr.prototype.bytesPerElement=12,pr("StructArrayLayout4i4ub12",Qr);var tn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s){var l=this.length;this.resize(l+1);var u=8*l;return this.int16[u+0]=t,this.int16[u+1]=e,this.int16[u+2]=r,this.int16[u+3]=n,this.uint16[u+4]=i,this.uint16[u+5]=a,this.uint16[u+6]=o,this.uint16[u+7]=s,l},e}(Yr);tn.prototype.bytesPerElement=16,pr("StructArrayLayout4i4ui16",tn);var en=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;this.resize(n+1);var i=3*n;return this.float32[i+0]=t,this.float32[i+1]=e,this.float32[i+2]=r,n},e}(Yr);en.prototype.bytesPerElement=12,pr("StructArrayLayout3f12",en);var rn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;this.resize(e+1);var r=1*e;return this.uint32[r+0]=t,e},e}(Yr);rn.prototype.bytesPerElement=4,pr("StructArrayLayout1ul4",rn);var nn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,u,c){var f=this.length;this.resize(f+1);var h=12*f,p=6*f;return this.int16[h+0]=t,this.int16[h+1]=e,this.int16[h+2]=r,this.int16[h+3]=n,this.int16[h+4]=i,this.int16[h+5]=a,this.uint32[p+3]=o,this.uint16[h+8]=s,this.uint16[h+9]=l,this.int16[h+10]=u,this.int16[h+11]=c,f},e}(Yr);nn.prototype.bytesPerElement=24,pr("StructArrayLayout6i1ul2ui2i24",nn);var an=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;this.resize(o+1);var s=6*o;return this.int16[s+0]=t,this.int16[s+1]=e,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=i,this.int16[s+5]=a,o},e}(Yr);an.prototype.bytesPerElement=12,pr("StructArrayLayout2i2i2i12",an);var on=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;this.resize(r+1);var n=4*r;return this.uint8[n+0]=t,this.uint8[n+1]=e,r},e}(Yr);on.prototype.bytesPerElement=4,pr("StructArrayLayout2ub4",on);var sn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,u,c,f,h,p){var d=this.length;this.resize(d+1);var v=20*d,g=10*d,m=40*d;return this.int16[v+0]=t,this.int16[v+1]=e,this.uint16[v+2]=r,this.uint16[v+3]=n,this.uint32[g+2]=i,this.uint32[g+3]=a,this.uint32[g+4]=o,this.uint16[v+10]=s,this.uint16[v+11]=l,this.uint16[v+12]=u,this.float32[g+7]=c,this.float32[g+8]=f,this.uint8[m+36]=h,this.uint8[m+37]=p,d},e}(Yr);sn.prototype.bytesPerElement=40,pr("StructArrayLayout2i2ui3ul3ui2f2ub40",sn);var ln=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;this.resize(e+1);var r=1*e;return this.float32[r+0]=t,e},e}(Yr);ln.prototype.bytesPerElement=4,pr("StructArrayLayout1f4",ln);var un=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;this.resize(n+1);var i=3*n;return this.int16[i+0]=t,this.int16[i+1]=e,this.int16[i+2]=r,n},e}(Yr);un.prototype.bytesPerElement=6,pr("StructArrayLayout3i6",un);var cn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;this.resize(n+1);var i=2*n,a=4*n;return this.uint32[i+0]=t,this.uint16[a+2]=e,this.uint16[a+3]=r,n},e}(Yr);cn.prototype.bytesPerElement=8,pr("StructArrayLayout1ul2ui8",cn);var fn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;this.resize(n+1);var i=3*n;return this.uint16[i+0]=t,this.uint16[i+1]=e,this.uint16[i+2]=r,n},e}(Yr);fn.prototype.bytesPerElement=6,pr("StructArrayLayout3ui6",fn);var hn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;this.resize(r+1);var n=2*r;return this.uint16[n+0]=t,this.uint16[n+1]=e,r},e}(Yr);hn.prototype.bytesPerElement=4,pr("StructArrayLayout2ui4",hn);var pn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;this.resize(r+1);var n=2*r;return this.float32[n+0]=t,this.float32[n+1]=e,r},e}(Yr);pn.prototype.bytesPerElement=8,pr("StructArrayLayout2f8",pn);var dn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;this.resize(i+1);var a=4*i;return this.float32[a+0]=t,this.float32[a+1]=e,this.float32[a+2]=r,this.float32[a+3]=n,i},e}(Yr);dn.prototype.bytesPerElement=16,pr("StructArrayLayout4f16",dn);var vn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorPointY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.x1.set=function(t){this._structArray.int16[this._pos2+2]=t},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.y1.set=function(t){this._structArray.int16[this._pos2+3]=t},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.x2.set=function(t){this._structArray.int16[this._pos2+4]=t},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.y2.set=function(t){this._structArray.int16[this._pos2+5]=t},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.featureIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},r.radius.get=function(){return this._structArray.int16[this._pos2+10]},r.radius.set=function(t){this._structArray.int16[this._pos2+10]=t},r.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},r.signedDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+11]=t},r.anchorPoint.get=function(){return new l(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Wr);vn.prototype.size=24;var gn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new vn(this,t)},e}(nn);pr("CollisionBoxArray",gn);var mn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},hidden:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.glyphStartIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.numGlyphs.set=function(t){this._structArray.uint16[this._pos2+3]=t},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.vertexStartIndex.set=function(t){this._structArray.uint32[this._pos4+2]=t},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineStartIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.lineLength.set=function(t){this._structArray.uint32[this._pos4+4]=t},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.segment.set=function(t){this._structArray.uint16[this._pos2+10]=t},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.lowerSize.set=function(t){this._structArray.uint16[this._pos2+11]=t},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.upperSize.set=function(t){this._structArray.uint16[this._pos2+12]=t},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetX.set=function(t){this._structArray.float32[this._pos4+7]=t},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.lineOffsetY.set=function(t){this._structArray.float32[this._pos4+8]=t},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.writingMode.set=function(t){this._structArray.uint8[this._pos1+36]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+37]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+37]=t},Object.defineProperties(e.prototype,r),e}(Wr);mn.prototype.size=40;var yn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new mn(this,t)},e}(sn);pr("PlacedSymbolArray",yn);var xn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={offsetX:{configurable:!0}};return r.offsetX.get=function(){return this._structArray.float32[this._pos4+0]},r.offsetX.set=function(t){this._structArray.float32[this._pos4+0]=t},Object.defineProperties(e.prototype,r),e}(Wr);xn.prototype.size=4;var bn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e.prototype.get=function(t){return new xn(this,t)},e}(ln);pr("GlyphOffsetArray",bn);var _n=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={x:{configurable:!0},y:{configurable:!0},tileUnitDistanceFromAnchor:{configurable:!0}};return r.x.get=function(){return this._structArray.int16[this._pos2+0]},r.x.set=function(t){this._structArray.int16[this._pos2+0]=t},r.y.get=function(){return this._structArray.int16[this._pos2+1]},r.y.set=function(t){this._structArray.int16[this._pos2+1]=t},r.tileUnitDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+2]},r.tileUnitDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+2]=t},Object.defineProperties(e.prototype,r),e}(Wr);_n.prototype.size=6;var wn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e.prototype.get=function(t){return new _n(this,t)},e}(un);pr("SymbolLineVertexArray",wn);var kn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.featureIndex.set=function(t){this._structArray.uint32[this._pos4+0]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+3]=t},Object.defineProperties(e.prototype,r),e}(Wr);kn.prototype.size=8;var An=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new kn(this,t)},e}(cn);pr("FeatureIndexArray",An);var Tn=Xr([{name:"a_pos",components:2,type:"Int16"}],4).members,Mn=function(t){void 0===t&&(t=[]),this.segments=t};Mn.prototype.prepareSegment=function(t,e,r){var n=this.segments[this.segments.length-1];return t>Mn.MAX_VERTEX_ARRAY_LENGTH&&_("Max vertices per segment is "+Mn.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!n||n.vertexLength+t>Mn.MAX_VERTEX_ARRAY_LENGTH)&&(n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},this.segments.push(n)),n},Mn.prototype.get=function(){return this.segments},Mn.prototype.destroy=function(){for(var t=0,e=this.segments;tRn.max||o.yRn.max)&&_("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Bn(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var Nn=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.layoutVertexArray=new $r,this.indexArray=new fn,this.segments=new Mn,this.programConfigurations=new Pn(Tn,t.layers,t.zoom)};function jn(t,e,r){for(var n=0;n=3)for(var s=0;s1){if(qn(t,e))return!0;for(var n=0;n1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function Xn(t,e){for(var r,n,i,a=!1,o=0;oe.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function Zn(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function $n(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).binders[t].statistics.max}function Jn(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Kn(t,e,r,n,i){if(!e[0]&&!e[1])return t;var a=l.convert(e);"viewport"===r&&a._rotate(-n);for(var o=[],s=0;s=zn||l<0||l>=zn)){var u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),c=u.vertexLength;Bn(this.layoutVertexArray,s,l,-1,-1),Bn(this.layoutVertexArray,s,l,1,-1),Bn(this.layoutVertexArray,s,l,1,1),Bn(this.layoutVertexArray,s,l,-1,1),this.indexArray.emplaceBack(c,c+1,c+2),this.indexArray.emplaceBack(c,c+3,c+2),u.vertexLength+=4,u.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t)},pr("CircleBucket",Nn,{omit:["layers"]});var Qn={paint:new Hr({"circle-radius":new jr(P.paint_circle["circle-radius"]),"circle-color":new jr(P.paint_circle["circle-color"]),"circle-blur":new jr(P.paint_circle["circle-blur"]),"circle-opacity":new jr(P.paint_circle["circle-opacity"]),"circle-translate":new Nr(P.paint_circle["circle-translate"]),"circle-translate-anchor":new Nr(P.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Nr(P.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Nr(P.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new jr(P.paint_circle["circle-stroke-width"]),"circle-stroke-color":new jr(P.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new jr(P.paint_circle["circle-stroke-opacity"])})},ti=i(function(t,e){var r;t.exports=((r=new Float32Array(3))[0]=0,r[1]=0,r[2]=0,function(){var t=new Float32Array(4);t[0]=0,t[1]=0,t[2]=0,t[3]=0}(),{vec3:{transformMat3:function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t}},vec4:{transformMat4:function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}},mat2:{create:function(){var t=new Float32Array(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},rotate:function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+a*s,t[1]=i*l+o*s,t[2]=n*-s+a*l,t[3]=i*-s+o*l,t},scale:function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1];return t[0]=n*s,t[1]=i*s,t[2]=a*l,t[3]=o*l,t}},mat3:{create:function(){var t=new Float32Array(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromRotation:function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}},mat4:{create:function(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},translate:function(t,e,r){var n,i,a,o,s,l,u,c,f,h,p,d,v=r[0],g=r[1],m=r[2];return e===t?(t[12]=e[0]*v+e[4]*g+e[8]*m+e[12],t[13]=e[1]*v+e[5]*g+e[9]*m+e[13],t[14]=e[2]*v+e[6]*g+e[10]*m+e[14],t[15]=e[3]*v+e[7]*g+e[11]*m+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],f=e[8],h=e[9],p=e[10],d=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=f,t[9]=h,t[10]=p,t[11]=d,t[12]=n*v+s*g+f*m+e[12],t[13]=i*v+l*g+h*m+e[13],t[14]=a*v+u*g+p*m+e[14],t[15]=o*v+c*g+d*m+e[15]),t},scale:function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},multiply:function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],f=e[8],h=e[9],p=e[10],d=e[11],v=e[12],g=e[13],m=e[14],y=e[15],x=r[0],b=r[1],_=r[2],w=r[3];return t[0]=x*n+b*s+_*f+w*v,t[1]=x*i+b*l+_*h+w*g,t[2]=x*a+b*u+_*p+w*m,t[3]=x*o+b*c+_*d+w*y,x=r[4],b=r[5],_=r[6],w=r[7],t[4]=x*n+b*s+_*f+w*v,t[5]=x*i+b*l+_*h+w*g,t[6]=x*a+b*u+_*p+w*m,t[7]=x*o+b*c+_*d+w*y,x=r[8],b=r[9],_=r[10],w=r[11],t[8]=x*n+b*s+_*f+w*v,t[9]=x*i+b*l+_*h+w*g,t[10]=x*a+b*u+_*p+w*m,t[11]=x*o+b*c+_*d+w*y,x=r[12],b=r[13],_=r[14],w=r[15],t[12]=x*n+b*s+_*f+w*v,t[13]=x*i+b*l+_*h+w*g,t[14]=x*a+b*u+_*p+w*m,t[15]=x*o+b*c+_*d+w*y,t},perspective:function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t},rotateX:function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],f=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+u*n,t[5]=o*i+c*n,t[6]=s*i+f*n,t[7]=l*i+h*n,t[8]=u*i-a*n,t[9]=c*i-o*n,t[10]=f*i-s*n,t[11]=h*i-l*n,t},rotateZ:function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],f=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+u*n,t[1]=o*i+c*n,t[2]=s*i+f*n,t[3]=l*i+h*n,t[4]=u*i-a*n,t[5]=c*i-o*n,t[6]=f*i-s*n,t[7]=h*i-l*n,t},invert:function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],f=e[9],h=e[10],p=e[11],d=e[12],v=e[13],g=e[14],m=e[15],y=r*s-n*o,x=r*l-i*o,b=r*u-a*o,_=n*l-i*s,w=n*u-a*s,k=i*u-a*l,A=c*v-f*d,T=c*g-h*d,M=c*m-p*d,E=f*g-h*v,S=f*m-p*v,C=h*m-p*g,L=y*C-x*S+b*E+_*M-w*T+k*A;return L?(L=1/L,t[0]=(s*C-l*S+u*E)*L,t[1]=(i*S-n*C-a*E)*L,t[2]=(v*k-g*w+m*_)*L,t[3]=(h*w-f*k-p*_)*L,t[4]=(l*M-o*C-u*T)*L,t[5]=(r*C-i*M+a*T)*L,t[6]=(g*b-d*k-m*x)*L,t[7]=(c*k-h*b+p*x)*L,t[8]=(o*S-s*M+u*A)*L,t[9]=(n*M-r*S-a*A)*L,t[10]=(d*w-v*b+m*y)*L,t[11]=(f*b-c*w-p*y)*L,t[12]=(s*T-o*E-l*A)*L,t[13]=(r*E-n*T+i*A)*L,t[14]=(v*x-d*_-g*y)*L,t[15]=(c*_-f*x+h*y)*L,t):null},ortho:function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*u,t[15]=1,t}}})}),ei=(ti.vec3,ti.vec4),ri=(ti.mat2,ti.mat3,ti.mat4),ni=function(t){function e(e){t.call(this,e,Qn)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Nn(t)},e.prototype.queryRadius=function(t){var e=t;return $n("circle-radius",this,e)+$n("circle-stroke-width",this,e)+Jn(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o){for(var s=Kn(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),i.angle,a),l=this.paint.get("circle-radius").evaluate(e)+this.paint.get("circle-stroke-width").evaluate(e),u="map"===this.paint.get("circle-pitch-alignment"),c=u?s:function(t,e,r){return t.map(function(t){return t.map(function(t){return ii(t,e,r)})})}(s,o,i),f=u?l*a:l,h=0,p=r;ht.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,l=0;l80*r){n=a=t[0],i=o=t[1];for(var d=r;da&&(a=s),l>o&&(o=l);u=0!==(u=Math.max(a-n,o-i))?1/u:0}return wi(h,p,r,n,i,u),p}function bi(t,e,r,n,i){var a,o;if(i===Vi(t,e,r,n)>0)for(a=e;a=e;a-=n)o=Bi(a,t[a],t[a+1],o);return o&&Di(o,o.next)&&(Ni(o),o=o.next),o}function _i(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Di(n,n.next)&&0!==Pi(n.prev,n,n.next))n=n.next;else{if(Ni(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function wi(t,e,r,n,i,a,o){if(t){!o&&a&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=Ci(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,u=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,u*=2}while(o>1)}(i)}(t,n,i,a);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,a?Ai(t,n,i,a):ki(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),Ni(t),t=l.next,u=l.next;else if((t=l)===u){o?1===o?wi(t=Ti(t,e,r),e,r,n,i,a,2):2===o&&Mi(t,e,r,n,i,a):wi(_i(t),e,r,n,i,a,1);break}}}function ki(t){var e=t.prev,r=t,n=t.next;if(Pi(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Oi(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Pi(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Ai(t,e,r,n){var i=t.prev,a=t,o=t.next;if(Pi(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=Ci(s,l,e,r,n),h=Ci(u,c,e,r,n),p=t.prevZ,d=t.nextZ;p&&p.z>=f&&d&&d.z<=h;){if(p!==t.prev&&p!==t.next&&Oi(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Pi(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,d!==t.prev&&d!==t.next&&Oi(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Pi(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;p&&p.z>=f;){if(p!==t.prev&&p!==t.next&&Oi(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Pi(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=h;){if(d!==t.prev&&d!==t.next&&Oi(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Pi(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function Ti(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!Di(i,a)&&zi(i,n,n.next,a)&&Ri(i,a)&&Ri(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),Ni(n),Ni(n.next),n=t=a),n=n.next}while(n!==t);return n}function Mi(t,e,r,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Ii(o,s)){var l=Fi(o,s);return o=_i(o,o.next),l=_i(l,l.next),wi(o,e,r,n,i,a),void wi(l,e,r,n,i,a)}s=s.next}o=o.next}while(o!==t)}function Ei(t,e){return t.x-e.x}function Si(t,e){if(e=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&i!==n.x&&Oi(ar.x)&&Ri(n,t)&&(r=n,h=l),n=n.next;return r}(t,e)){var r=Fi(e,t);_i(r,r.next)}}function Ci(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Li(t){var e=t,r=t;do{e.x=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function Ii(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&zi(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&Ri(t,e)&&Ri(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)}function Pi(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Di(t,e){return t.x===e.x&&t.y===e.y}function zi(t,e,r,n){return!!(Di(t,e)&&Di(r,n)||Di(t,n)&&Di(r,e))||Pi(t,e,r)>0!=Pi(t,e,n)>0&&Pi(r,n,t)>0!=Pi(r,n,e)>0}function Ri(t,e){return Pi(t.prev,t,t.next)<0?Pi(t,e,t.next)>=0&&Pi(t,t.prev,e)>=0:Pi(t,e,t.prev)<0||Pi(t,t.next,e)<0}function Fi(t,e){var r=new ji(t.i,t.x,t.y),n=new ji(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Bi(t,e,r,n){var i=new ji(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ni(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 ji(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Vi(t,e,r,n){for(var i=0,a=e,o=r-n;a0&&(n+=t[i-1].length,r.holes.push(n))}return r},mi.default=yi;var Ui=qi,Hi=qi;function qi(t,e,r,n,i){!function t(e,r,n,i,a){for(;i>n;){if(i-n>600){var o=i-n+1,s=r-n+1,l=Math.log(o),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(o-u)/o)*(s-o/2<0?-1:1),f=Math.max(n,Math.floor(r-s*u/o+c)),h=Math.min(i,Math.floor(r+(o-s)*u/o+c));t(e,r,f,h,a)}var p=e[r],d=n,v=i;for(Gi(e,n,r),a(e[i],p)>0&&Gi(e,n,i);d0;)v--}0===a(e[n],p)?Gi(e,n,v):Gi(e,++v,i),v<=r&&(n=v+1),r<=v&&(i=v-1)}}(t,e,r||0,n||t.length-1,i||Wi)}function Gi(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Wi(t,e){return te?1:0}function Yi(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,a=[],o=0;o1)for(var l=0;lzn)||t.y===e.y&&(t.y<0||t.y>zn)}function na(t){return t.every(function(t){return t.x<0})||t.every(function(t){return t.x>zn})||t.every(function(t){return t.y<0})||t.every(function(t){return t.y>zn})}ea.prototype.populate=function(t,e){for(var r=0,n=t;r=1){var v=f[p-1];if(!ra(d,v)){l.vertexLength+4>Mn.MAX_VERTEX_ARRAY_LENGTH&&(l=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var g=d.sub(v)._perp()._unit(),m=v.dist(d);h+m>32768&&(h=0),ta(this.layoutVertexArray,d.x,d.y,g.x,g.y,0,0,h),ta(this.layoutVertexArray,d.x,d.y,g.x,g.y,0,1,h),h+=m,ta(this.layoutVertexArray,v.x,v.y,g.x,g.y,0,0,h),ta(this.layoutVertexArray,v.x,v.y,g.x,g.y,0,1,h);var y=l.vertexLength;this.indexArray.emplaceBack(y,y+1,y+2),this.indexArray.emplaceBack(y+1,y+2,y+3),l.vertexLength+=4,l.primitiveLength+=2}}}}l.vertexLength+a>Mn.MAX_VERTEX_ARRAY_LENGTH&&(l=this.segments.prepareSegment(a,this.layoutVertexArray,this.indexArray));for(var x=[],b=[],_=l.vertexLength,w=0,k=i;w>3}if(i--,1===n||2===n)a+=t.readSVarint(),o+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new l(a,o));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},la.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,u=-1/0;t.pos>3}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(a+=t.readSVarint())u&&(u=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,u]},la.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),u=la.types[this.type];function c(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function da(t,e,r){if(3===t){var n=new fa(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}ha.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new sa(this._pbf,e,this.extent,this._keys,this._values)};var va={VectorTile:function(t,e){this.layers=t.readFields(da,{},e)},VectorTileFeature:sa,VectorTileLayer:fa},ga=va.VectorTileFeature.types,ma=63,ya=Math.cos(Math.PI/180*37.5),xa=.5,ba=Math.pow(2,14)/xa;function _a(t,e,r,n,i,a,o){t.emplaceBack(e.x,e.y,n?1:0,i?1:-1,Math.round(ma*r.x)+128,Math.round(ma*r.y)+128,1+(0===a?0:a<0?-1:1)|(o*xa&63)<<2,o*xa>>6)}var wa=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.layoutVertexArray=new Qr,this.indexArray=new fn,this.programConfigurations=new Pn(oa,t.layers,t.zoom),this.segments=new Mn};function ka(t,e){return(t/e.tileTotal*(e.end-e.start)+e.start)*(ba-1)}wa.prototype.populate=function(t,e){for(var r=0,n=t;r=2&&t[l-1].equals(t[l-2]);)l--;for(var u=0;uu){var S=p.dist(x);if(S>2*c){var C=p.sub(p.sub(x)._mult(c/S)._round());this.distance+=C.dist(x),this.addCurrentVertex(C,this.distance,_.mult(1),0,0,!1,h,o),x=C}}var L=x&&b,O=L?r:b?g:m;if(L&&"round"===O&&(Mi&&(O="bevel"),"bevel"===O&&(M>2&&(O="flipbevel"),M100)A=w.clone().mult(-1);else{var I=_.x*w.y-_.y*w.x>0?-1:1,P=M*_.add(w).mag()/_.sub(w).mag();A._perp()._mult(P*I)}this.addCurrentVertex(p,this.distance,A,0,0,!1,h,o),this.addCurrentVertex(p,this.distance,A.mult(-1),0,0,!1,h,o)}else if("bevel"===O||"fakeround"===O){var D=_.x*w.y-_.y*w.x>0,z=-Math.sqrt(M*M-1);if(D?(v=0,d=z):(d=0,v=z),y||this.addCurrentVertex(p,this.distance,_,d,v,!1,h,o),"fakeround"===O){for(var R=Math.floor(8*(.5-(T-.5))),F=void 0,B=0;B=0;N--)F=_.mult((N+1)/(R+1))._add(w)._unit(),this.addPieSliceVertex(p,this.distance,F,D,h,o)}b&&this.addCurrentVertex(p,this.distance,w,-d,-v,!1,h,o)}else"butt"===O?(y||this.addCurrentVertex(p,this.distance,_,0,0,!1,h,o),b&&this.addCurrentVertex(p,this.distance,w,0,0,!1,h,o)):"square"===O?(y||(this.addCurrentVertex(p,this.distance,_,1,1,!1,h,o),this.e1=this.e2=-1),b&&this.addCurrentVertex(p,this.distance,w,-1,-1,!1,h,o)):"round"===O&&(y||(this.addCurrentVertex(p,this.distance,_,0,0,!1,h,o),this.addCurrentVertex(p,this.distance,_,1,1,!0,h,o),this.e1=this.e2=-1),b&&(this.addCurrentVertex(p,this.distance,w,-1,-1,!0,h,o),this.addCurrentVertex(p,this.distance,w,0,0,!1,h,o)));if(E&&k2*c){var V=p.add(b.sub(p)._mult(c/j)._round());this.distance+=V.dist(p),this.addCurrentVertex(V,this.distance,w.mult(1),0,0,!1,h,o),p=V}}y=!1}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e)}},wa.prototype.addCurrentVertex=function(t,e,r,n,i,a,o,s){var l,u=this.layoutVertexArray,c=this.indexArray;s&&(e=ka(e,s)),l=r.clone(),n&&l._sub(r.perp()._mult(n)),_a(u,t,l,a,!1,n,e),this.e3=o.vertexLength++,this.e1>=0&&this.e2>=0&&(c.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++),this.e1=this.e2,this.e2=this.e3,l=r.mult(-1),i&&l._sub(r.perp()._mult(i)),_a(u,t,l,a,!0,-i,e),this.e3=o.vertexLength++,this.e1>=0&&this.e2>=0&&(c.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++),this.e1=this.e2,this.e2=this.e3,e>ba/2&&!s&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,i,a,o))},wa.prototype.addPieSliceVertex=function(t,e,r,n,i,a){r=r.mult(n?-1:1);var o=this.layoutVertexArray,s=this.indexArray;a&&(e=ka(e,a)),_a(o,t,r,!1,n,0,e),this.e3=i.vertexLength++,this.e1>=0&&this.e2>=0&&(s.emplaceBack(this.e1,this.e2,this.e3),i.primitiveLength++),n?this.e2=this.e3:this.e1=this.e3},pr("LineBucket",wa,{omit:["layers"]});var Aa=new Hr({"line-cap":new Nr(P.layout_line["line-cap"]),"line-join":new jr(P.layout_line["line-join"]),"line-miter-limit":new Nr(P.layout_line["line-miter-limit"]),"line-round-limit":new Nr(P.layout_line["line-round-limit"])}),Ta={paint:new Hr({"line-opacity":new jr(P.paint_line["line-opacity"]),"line-color":new jr(P.paint_line["line-color"]),"line-translate":new Nr(P.paint_line["line-translate"]),"line-translate-anchor":new Nr(P.paint_line["line-translate-anchor"]),"line-width":new jr(P.paint_line["line-width"]),"line-gap-width":new jr(P.paint_line["line-gap-width"]),"line-offset":new jr(P.paint_line["line-offset"]),"line-blur":new jr(P.paint_line["line-blur"]),"line-dasharray":new Vr(P.paint_line["line-dasharray"]),"line-pattern":new Vr(P.paint_line["line-pattern"]),"line-gradient":new Ur(P.paint_line["line-gradient"])}),layout:Aa},Ma=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new Lr(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n){return r=p({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n)},e}(jr))(Ta.paint.properties["line-width"].specification);Ma.useIntegerZoom=!0;var Ea=function(t){function e(e){t.call(this,e,Ta)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setPaintProperty=function(e,r,n){t.prototype.setPaintProperty.call(this,e,r,n),"line-gradient"===e&&this._updateGradient()},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=hi(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),this.paint._values["line-floorwidth"]=Ma.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new wa(t)},e.prototype.queryRadius=function(t){var e=t,r=Sa($n("line-width",this,e),$n("line-gap-width",this,e)),n=$n("line-offset",this,e);return r/2+Math.abs(n)+Jn(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a){var o=Kn(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),i.angle,a),s=a/2*Sa(this.paint.get("line-width").evaluate(e),this.paint.get("line-gap-width").evaluate(e)),u=this.paint.get("line-offset").evaluate(e);return u&&(r=function(t,e){for(var r=[],n=new l(0,0),i=0;i0?e+2*t:t}var Ca=Xr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),La=Xr([{name:"a_projected_pos",components:3,type:"Float32"}],4),Oa=(Xr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Xr([{name:"a_placed",components:2,type:"Uint8"}],4)),Ia=(Xr([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),Xr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Pa=Xr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);function Da(t,e,r){var n=e.layout.get("text-transform").evaluate(r);return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),Cr.applyArabicShaping&&(t=Cr.applyArabicShaping(t)),t}Xr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"hidden"}]),Xr([{type:"Float32",name:"offsetX"}]),Xr([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var za={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Ra=function(t){function e(e,r,n,i){t.call(this,e,r),this.angle=n,void 0!==i&&(this.segment=i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(l);function Fa(t,e){var r=e.expression;if("constant"===r.kind)return{functionType:"constant",layoutSize:r.evaluate(new Lr(t+1))};if("source"===r.kind)return{functionType:"source"};for(var n=r.zoomStops,i=0;i0)&&("constant"!==i.value.kind||i.value.value.length>0),l="constant"!==o.value.kind||o.value.value&&o.value.value.length>0;if(this.features=[],s||l){for(var u=e.iconDependencies,c=e.glyphDependencies,f=new Lr(this.zoom),h=0,p=t;h=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var l=0;l0;this.addCollisionDebugVertices(s,l,u,c,f?this.collisionCircle:this.collisionBox,o.anchorPoint,r,f)}}}},qa.prototype.deserializeCollisionBoxes=function(t,e,r,n,i){for(var a={},o=e;o0},qa.prototype.hasIconData=function(){return this.icon.segments.get().length>0},qa.prototype.hasCollisionBoxData=function(){return this.collisionBox.segments.get().length>0},qa.prototype.hasCollisionCircleData=function(){return this.collisionCircle.segments.get().length>0},qa.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&(this.sortedAngle=t,!(this.text.segments.get().length>1||this.icon.segments.get().length>1))){for(var r=[],n=0;ni.maxh||t>i.maxw||r<=i.maxh&&t<=i.maxw&&(o=i.maxw*i.maxh-t*r)a.free)){if(r===a.h)return this.allocShelf(s,t,r,n);r>a.h||rc)&&(f=2*Math.max(t,c)),(ll)&&(u=2*Math.max(r,l)),this.resize(f,u),this.packOne(t,r,n)):null},t.prototype.allocFreebin=function(t,e,r,n){var i=this.freebins.splice(t,1)[0];return i.id=n,i.w=e,i.h=r,i.refcount=0,this.bins[n]=i,this.ref(i),i},t.prototype.allocShelf=function(t,e,r,n){var i=this.shelves[t].alloc(e,r,n);return this.bins[n]=i,this.ref(i),i},t.prototype.shrink=function(){if(this.shelves.length>0){for(var t=0,e=0,r=0;rthis.free||e>this.h)return null;var n=this.x;return this.x+=t,this.free-=t,new function(t,e,r,n,i,a,o){this.id=t,this.x=e,this.y=r,this.w=n,this.h=i,this.maxw=a||n,this.maxh=o||i,this.refcount=0}(r,n,this.y,t,e,t,this.h)},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t}()}),Qa=function(t,e){var r=e.pixelRatio;this.paddedRect=t,this.pixelRatio=r},to={tl:{configurable:!0},br:{configurable:!0},displaySize:{configurable:!0}};to.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},to.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},to.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Qa.prototype,to);var eo=function(t){var e=new ci({width:0,height:0}),r={},n=new Ka(0,0,{autoResize:!0});for(var i in t){var a=t[i],o=n.packOne(a.data.width+2,a.data.height+2);e.resize({width:n.w,height:n.h}),ci.copy(a.data,e,{x:0,y:0},{x:o.x+1,y:o.y+1},a.data),r[i]=new Qa(o,a)}n.shrink(),e.resize({width:n.w,height:n.h}),this.image=e,this.positions=r};pr("ImagePosition",Qa),pr("ImageAtlas",eo);var ro=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,c=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+t[e+f],f+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+f],f+=h,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=u}return(p?-1:1)*o*Math.pow(2,a-n)},no=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,u-=8);t[r+p-d]|=128*v},io=ao;function ao(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}function oo(t){return t.type===ao.Bytes?t.readVarint()+t.pos:t.pos+1}function so(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function lo(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function uo(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function _o(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}ao.Varint=0,ao.Fixed64=1,ao.Bytes=2,ao.Fixed32=5,ao.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,a=this.pos;this.type=7&n,t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=xo(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=_o(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=xo(this.buf,this.pos)+4294967296*xo(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=xo(this.buf,this.pos)+4294967296*_o(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=ro(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=ro(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,a=r.buf;if(i=a[r.pos++],n=(112&i)>>4,i<128)return so(t,n,e);if(i=a[r.pos++],n|=(127&i)<<3,i<128)return so(t,n,e);if(i=a[r.pos++],n|=(127&i)<<10,i<128)return so(t,n,e);if(i=a[r.pos++],n|=(127&i)<<17,i<128)return so(t,n,e);if(i=a[r.pos++],n|=(127&i)<<24,i<128)return so(t,n,e);if(i=a[r.pos++],n|=(1&i)<<31,i<128)return so(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=function(t,e,r){for(var n="",i=e;i239?4:l>223?3:l>191?2:1;if(i+c>r)break;1===c?l<128&&(u=l):2===c?128==(192&(a=t[i+1]))&&(u=(31&l)<<6|63&a)<=127&&(u=null):3===c?(a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&((u=(15&l)<<12|(63&a)<<6|63&o)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((u=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),i+=c}return n}(this.buf,this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){var r=oo(this);for(t=t||[];this.pos127;);else if(e===ao.Bytes)this.pos=this.readVarint()+this.pos;else if(e===ao.Fixed32)this.pos+=4;else{if(e!==ao.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a55295&&n<57344){if(!i){n>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&lo(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),no(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),no(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&lo(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,ao.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,uo,e)},writePackedSVarint:function(t,e){this.writeMessage(t,co,e)},writePackedBoolean:function(t,e){this.writeMessage(t,po,e)},writePackedFloat:function(t,e){this.writeMessage(t,fo,e)},writePackedDouble:function(t,e){this.writeMessage(t,ho,e)},writePackedFixed32:function(t,e){this.writeMessage(t,vo,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,go,e)},writePackedFixed64:function(t,e){this.writeMessage(t,mo,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,yo,e)},writeBytesField:function(t,e){this.writeTag(t,ao.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,ao.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,ao.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,ao.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,ao.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,ao.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,ao.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,ao.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,ao.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,ao.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var wo=3;function ko(t,e,r){1===t&&r.readMessage(Ao,e)}function Ao(t,e,r){if(3===t){var n=r.readMessage(To,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,l=n.left,u=n.top,c=n.advance;e.push({id:i,bitmap:new ui({width:o+2*wo,height:s+2*wo},a),metrics:{width:o,height:s,left:l,top:u,advance:c}})}}function To(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}var Mo=wo,Eo=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.callbackID=0,v(["receive"],this),this.target.addEventListener("message",this.receive,!1)};Eo.prototype.send=function(t,e,r,n){var i=r?this.mapId+":"+this.callbackID++:null;r&&(this.callbacks[i]=r);var a=[];this.target.postMessage({targetMapId:n,sourceMapId:this.mapId,type:t,id:String(i),data:vr(e,a)},a)},Eo.prototype.receive=function(t){var e,r=this,n=t.data,i=n.id;if(!n.targetMapId||this.mapId===n.targetMapId){var a=function(t,e){var n=[];r.target.postMessage({sourceMapId:r.mapId,type:"",id:String(i),error:t?vr(t):null,data:vr(e,n)},n)};if(""===n.type)e=this.callbacks[n.id],delete this.callbacks[n.id],e&&n.error?e(gr(n.error)):e&&e(null,gr(n.data));else if(void 0!==n.id&&this.parent[n.type])this.parent[n.type](n.sourceMapId,gr(n.data),a);else if(void 0!==n.id&&this.parent.getWorkerSource){var o=n.type.split(".");this.parent.getWorkerSource(n.sourceMapId,o[0],o[1])[o[2]](gr(n.data),a)}else this.parent[n.type](gr(n.data))}},Eo.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)};var So=n(i(function(t,e){!function(t){function e(t,e,n){e=Math.pow(2,n)-e-1;var i=r(256*t,256*e,n),a=r(256*(t+1),256*(e+1),n);return i[0]+","+i[1]+","+a[0]+","+a[1]}function r(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r),i=t*n-2*Math.PI*6378137/2,a=e*n-2*Math.PI*6378137/2;return[i,a]}t.getURL=function(t,r,n,i,a,o){return o=o||{},t+"?"+["bbox="+e(n,i,a),"format="+(o.format||"image/png"),"service="+(o.service||"WMS"),"version="+(o.version||"1.1.1"),"request="+(o.request||"GetMap"),"srs="+(o.srs||"EPSG:3857"),"width="+(o.width||256),"height="+(o.height||256),"layers="+r].join("&")},t.getTileBBox=e,t.getMercCoords=r,Object.defineProperty(t,"__esModule",{value:!0})}(e)})),Co=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Io(0,t,e,r)};Co.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Co.prototype.url=function(t,e){var r=So.getTileBBox(this.x,this.y,this.z),n=function(t,e,r){for(var n,i="",a=t;a>0;a--)i+=(e&(n=1<this.canonical.z?new Oo(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Oo(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Oo.prototype.isChildOf=function(t){var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},Oo.prototype.children=function(t){if(this.overscaledZ>=t)return[new Oo(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Oo(e,this.wrap,e,r,n),new Oo(e,this.wrap,e,r+1,n),new Oo(e,this.wrap,e,r,n+1),new Oo(e,this.wrap,e,r+1,n+1)]},Oo.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=this.dim+this.border||e<-this.border||e>=this.dim+this.border)throw new RangeError("out of range source coordinates for DEM data");return(e+this.border)*this.stride+(t+this.border)},pr("Level",Po);var Do=function(t,e,r){this.uid=t,this.scale=e||1,this.level=r||new Po(256,512),this.loaded=!!r};Do.prototype.loadFromImage=function(t,e){if(t.height!==t.width)throw new RangeError("DEM tiles must be square");if(e&&"mapbox"!==e&&"terrarium"!==e)return _('"'+e+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');var r=this.level=new Po(t.width,t.width/2),n=t.data;this._unpackData(r,n,e||"mapbox");for(var i=0;i=0&&l[3]>=0&&this.grid.insert(a,l[0],l[1],l[2],l[3])}},Bo.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new va.VectorTile(new io(this.rawTileData)).layers,this.sourceLayerCoder=new zo(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Bo.prototype.query=function(t,e){var r=this;this.loadVTLayers();for(var n=t.params||{},i=zn/t.tileSize/t.scale,a=Re(n.filter),o=t.queryGeometry,s=t.queryPadding*i,l=1/0,u=1/0,c=-1/0,f=-1/0,h=0;h=0)return!0;return!1}(a,l)){var u=this.sourceLayerCoder.decode(r),c=this.vtLayers[u].feature(n);if(i(new Lr(this.tileID.overscaledZ),c))for(var f=0;f=200&&r.status<300&&r.response){var n;try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n)}else 401===r.status&&t.url.match(/mapbox.com/)?e(new T(r.statusText+": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens",r.status,t.url)):e(new T(r.statusText,r.status,t.url))},r.send(),r},e.getImage=function(t,e){return E(t,function(t,r){if(t)e(t);else if(r){var n=new self.Image,i=self.URL||self.webkitURL;n.onload=function(){e(null,n),i.revokeObjectURL(n.src)};var a=new self.Blob([new Uint8Array(r.data)],{type:"image/png"});n.cacheControl=r.cacheControl,n.expires=r.expires,n.src=r.data.byteLength?i.createObjectURL(a):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}})},e.ResourceType=A,e.RGBAImage=ci,e.default$2=Ka,e.ImagePosition=Qa,e.getArrayBuffer=E,e.default$3=function(t){return new io(t).readFields(ko,[])},e.default$4=yr,e.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),a=null;t.forEach(function(t,o){e(t,function(t,e){t&&(a=t),i[o]=e,0==--n&&r(a,i)})})},e.AlphaImage=ui,e.default$5=P,e.endsWith=g,e.extend=p,e.sphericalToCartesian=function(t){var e=t[0],r=t[1],n=t[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:e*Math.cos(r)*Math.sin(n),y:e*Math.sin(r)*Math.sin(n),z:e*Math.cos(n)}},e.Evented=I,e.validateStyle=nr,e.validateLight=ir,e.emitValidationErrors=sr,e.default$6=tt,e.number=wt,e.Properties=Hr,e.Transitionable=Pr,e.Transitioning=zr,e.PossiblyEvaluated=Br,e.DataConstantProperty=Nr,e.warnOnce=_,e.uniqueId=function(){return d++},e.default$7=Eo,e.pick=function(t,e){for(var r={},n=0;n@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(t,r,n,i){var a=n||i;return e[r]=!a||a.toLowerCase(),""}),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e},e.default$11=Bo,e.default$12=Ro,e.default$13=Re,e.default$14=qa,e.CollisionBoxArray=gn,e.default$15=Mn,e.TriangleIndexArray=fn,e.default$16=Lr,e.default$17=s,e.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},e.default$18=["type","source","source-layer","minzoom","maxzoom","filter","layout"],e.mat4=ri,e.vec4=ei,e.getSizeData=Fa,e.evaluateSizeForFeature=function(t,e,r){var n=e;return"source"===t.functionType?r.lowerSize/10:"composite"===t.functionType?wt(r.lowerSize/10,r.upperSize/10,n.uSizeT):n.uSize},e.evaluateSizeForZoom=function(t,e,r){if("constant"===t.functionType)return{uSizeT:0,uSize:t.layoutSize};if("source"===t.functionType)return{uSizeT:0,uSize:0};if("camera"===t.functionType){var n=t.propertyValue,i=t.zoomRange,a=t.sizeRange,o=h(Ee(n,r.specification).interpolationFactor(e,i.min,i.max),0,1);return{uSizeT:0,uSize:a.min+o*(a.max-a.min)}}var s=t.propertyValue,l=t.zoomRange;return{uSizeT:h(Ee(s,r.specification).interpolationFactor(e,l.min,l.max),0,1),uSize:0}},e.addDynamicAttributes=Va,e.default$19=Wa,e.WritingMode=jo,e.multiPolygonIntersectsBufferedPoint=jn,e.multiPolygonIntersectsMultiPolygon=Vn,e.multiPolygonIntersectsBufferedMultiLine=Un,e.polygonIntersectsPolygon=function(t,e){for(var r=0;r-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],u=0;sn;)u-=l.shift().angleDelta;if(u>i)return!1;o++,s+=f.dist(h)}return!0}function a(e,r,n,a,o,s,l,u,c){var f=a?.6*s*l:0,h=Math.max(a?a.right-a.left:0,o?o.right-o.left:0),p=0===e[0].x||e[0].x===c||0===e[0].y||e[0].y===c;return r-h*l=0&&A=0&&T=0&&g+h<=p){var M=new t.default$25(A,T,w,y);M._round(),o&&!i(r,M,l,o,s)||m.push(M)}}v+=_}return c||m.length||u||(m=e(r,v/2,a,o,s,l,u,!0,f)),m}(e,p?r/2*u%r:(h/2+2*s)*l*u%r,r,f,n,h*l,p,!1,c)}n.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},n.prototype.update=function(e,n){for(var i=this,a=0,o=e;a0&&(v=Math.max(10*s,v),this._addLineCollisionCircles(t,e,r,r.segment,g,v,n,i,a,c))}else t.emplaceBack(r.x,r.y,p,f,d,h,n,i,a,0,0);this.boxEndIndex=t.length};s.prototype._addLineCollisionCircles=function(t,e,r,n,i,a,o,s,l,u){var c=a/2,f=Math.floor(i/c),h=1+.4*Math.log(u)/Math.LN2,p=Math.floor(f*h/2),d=-a/2,v=r,g=n+1,m=d,y=-i/2,x=y-i/4;do{if(--g<0){if(m>y)return;g=0;break}m-=e[g].dist(v),v=e[g]}while(m>x);for(var b=e[g].dist(e[g+1]),_=-p;_i&&(k+=w-i),!(k=e.length)return;b=e[g].dist(e[g+1])}var A=k-m,T=e[g],M=e[g+1].sub(T)._unit()._mult(A)._add(T)._round(),E=Math.abs(k-d)0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)}function f(t,e){return te?1:0}function h(e,r,n){void 0===r&&(r=1),void 0===n&&(n=!1);for(var i=1/0,a=1/0,o=-1/0,s=-1/0,u=e[0],c=0;co)&&(o=f.x),(!c||f.y>s)&&(s=f.y)}var h=o-i,v=s-a,g=Math.min(h,v),m=g/2,y=new l(null,p);if(0===g)return new t.default$1(i,a);for(var x=i;x_.d||!_.d)&&(_=k,n&&console.log("found best %d after %d probes",Math.round(1e4*k.d)/1e4,w)),k.max-_.d<=r||(m=k.h/2,y.push(new d(k.p.x-m,k.p.y-m,m,e)),y.push(new d(k.p.x+m,k.p.y-m,m,e)),y.push(new d(k.p.x-m,k.p.y+m,m,e)),y.push(new d(k.p.x+m,k.p.y+m,m,e)),w+=4)}return n&&(console.log("num probes: "+w),console.log("best distance: "+_.d)),_.p}function p(t,e){return e.max-t.max}function d(e,r,n,i){this.p=new t.default$1(e,r),this.h=n,this.d=function(e,r){for(var n=!1,i=1/0,a=0;ae.y!=f.y>e.y&&e.x<(f.x-c.x)*(e.y-c.y)/(f.y-c.y)+c.x&&(n=!n),i=Math.min(i,t.distToSegmentSquared(e,c,f))}return(n?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}function v(e,r,n,i,a,o){e.createArrays(),e.symbolInstances=[];var s=512*e.overscaling;e.tilePixelRatio=t.default$8/s,e.compareText={},e.iconsNeedLinear=!1;var l=e.layers[0].layout,u=e.layers[0]._unevaluatedLayout._values,c={};if("composite"===e.textSizeData.functionType){var f=e.textSizeData.zoomRange,h=f.min,p=f.max;c.compositeTextSizes=[u["text-size"].possiblyEvaluate(new t.default$16(h)),u["text-size"].possiblyEvaluate(new t.default$16(p))]}if("composite"===e.iconSizeData.functionType){var d=e.iconSizeData.zoomRange,v=d.min,m=d.max;c.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new t.default$16(v)),u["icon-size"].possiblyEvaluate(new t.default$16(m))]}c.layoutTextSize=u["text-size"].possiblyEvaluate(new t.default$16(e.zoom+1)),c.layoutIconSize=u["icon-size"].possiblyEvaluate(new t.default$16(e.zoom+1)),c.textMaxSize=u["text-size"].possiblyEvaluate(new t.default$16(18));for(var y=24*l.get("text-line-height"),x="map"===l.get("text-rotation-alignment")&&"line"===l.get("symbol-placement"),b=l.get("text-keep-upright"),_=0,w=e.features;_=t.default$8||c.y<0||c.y>=t.default$8||e.symbolInstances.push(function(e,r,n,i,a,l,u,c,f,h,p,d,v,g,y,x,b,_,w,k,A){var T,M,E=e.addToLineVertexArray(r,n),S=0,C=0,L=0,O=i.horizontal?i.horizontal.text:"",I=[];i.horizontal&&(T=new s(u,n,r,c,f,h,i.horizontal,p,d,v,e.overscaling),C+=m(e,r,i.horizontal,l,v,w,g,E,i.vertical?t.WritingMode.horizontal:t.WritingMode.horizontalOnly,I,k,A),i.vertical&&(L+=m(e,r,i.vertical,l,v,w,g,E,t.WritingMode.vertical,I,k,A)));var P=T?T.boxStartIndex:e.collisionBoxArray.length,D=T?T.boxEndIndex:e.collisionBoxArray.length;if(a){var z=function(e,r,n,i,a,o){var s,l,u,c,f=r.image,h=n.layout,p=r.top-1/f.pixelRatio,d=r.left-1/f.pixelRatio,v=r.bottom+1/f.pixelRatio,g=r.right+1/f.pixelRatio;if("none"!==h.get("icon-text-fit")&&a){var m=g-d,y=v-p,x=h.get("text-size").evaluate(o)/24,b=a.left*x,_=a.right*x,w=a.top*x,k=_-b,A=a.bottom*x-w,T=h.get("icon-text-fit-padding")[0],M=h.get("icon-text-fit-padding")[1],E=h.get("icon-text-fit-padding")[2],S=h.get("icon-text-fit-padding")[3],C="width"===h.get("icon-text-fit")?.5*(A-y):0,L="height"===h.get("icon-text-fit")?.5*(k-m):0,O="width"===h.get("icon-text-fit")||"both"===h.get("icon-text-fit")?k:m,I="height"===h.get("icon-text-fit")||"both"===h.get("icon-text-fit")?A:y;s=new t.default$1(b+L-S,w+C-T),l=new t.default$1(b+L+M+O,w+C-T),u=new t.default$1(b+L+M+O,w+C+E+I),c=new t.default$1(b+L-S,w+C+E+I)}else s=new t.default$1(d,p),l=new t.default$1(g,p),u=new t.default$1(g,v),c=new t.default$1(d,v);var P=n.layout.get("icon-rotate").evaluate(o)*Math.PI/180;if(P){var D=Math.sin(P),z=Math.cos(P),R=[z,-D,D,z];s._matMult(R),l._matMult(R),c._matMult(R),u._matMult(R)}return[{tl:s,tr:l,bl:c,br:u,tex:f.paddedRect,writingMode:void 0,glyphOffset:[0,0]}]}(0,a,l,0,i.horizontal,w);M=new s(u,n,r,c,f,h,a,y,x,!1,e.overscaling),S=4*z.length;var R=e.iconSizeData,F=null;"source"===R.functionType?F=[10*l.layout.get("icon-size").evaluate(w)]:"composite"===R.functionType&&(F=[10*A.compositeIconSizes[0].evaluate(w),10*A.compositeIconSizes[1].evaluate(w)]),e.addSymbols(e.icon,z,F,_,b,w,!1,r,E.lineStartIndex,E.lineLength)}var B=M?M.boxStartIndex:e.collisionBoxArray.length,N=M?M.boxEndIndex:e.collisionBoxArray.length;e.glyphOffsetArray.length>=t.default$14.MAX_GLYPHS&&t.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");var j=new o,V=new o;return{key:O,textBoxStartIndex:P,textBoxEndIndex:D,iconBoxStartIndex:B,iconBoxEndIndex:N,textOffset:g,iconOffset:_,anchor:r,line:n,featureIndex:c,feature:w,numGlyphVertices:C,numVerticalGlyphVertices:L,numIconVertices:S,textOpacityState:j,iconOpacityState:V,isDuplicate:!1,placedTextSymbolIndices:I,crossTileID:0}}(e,c,a,n,i,e.layers[0],e.collisionBoxArray,r.index,r.sourceLayerIndex,e.index,b,A,E,v,w,T,S,g,r,l,u))};if("line"===d.get("symbol-placement"))for(var O=0,I=function(e,r,n,i,a){for(var o=[],s=0;s=i&&h.x>=i||(f.x>=i?f=new t.default$1(i,f.y+(h.y-f.y)*((i-f.x)/(h.x-f.x)))._round():h.x>=i&&(h=new t.default$1(i,f.y+(h.y-f.y)*((i-f.x)/(h.x-f.x)))._round()),f.y>=a&&h.y>=a||(f.y>=a?f=new t.default$1(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round():h.y>=a&&(h=new t.default$1(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round()),u&&f.equals(u[u.length-1])||(u=[f],o.push(u)),u.push(h)))))}return o}(r.geometry,0,0,t.default$8,t.default$8);O=0;o--)if(n.dist(a[o])0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n},_down:function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=s,t=a}e[t]=i}},l.default=u;var x=function(e){var r=new t.AlphaImage({width:0,height:0}),n={},i=new t.default$2(0,0,{autoResize:!0});for(var a in e){var o=e[a],s=n[a]={};for(var l in o){var u=o[+l];if(u&&0!==u.bitmap.width&&0!==u.bitmap.height){var c=i.packOne(u.bitmap.width+2,u.bitmap.height+2);r.resize({width:i.w,height:i.h}),t.AlphaImage.copy(u.bitmap,r,{x:0,y:0},{x:c.x+1,y:c.y+1},u.bitmap),s[l]={rect:c,metrics:u.metrics}}}}i.shrink(),r.resize({width:i.w,height:i.h}),this.image=r,this.positions=n};t.register("GlyphAtlas",x);var b=function(e){this.tileID=new t.OverscaledTileID(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming};function _(e,r){for(var n=new t.default$16(r),i=0,a=e;i=M.maxzoom||"none"!==M.visibility&&(_(T,a.zoom),(f[M.id]=M.createBucket({index:s.bucketLayerIDs.length,layers:T,zoom:a.zoom,pixelRatio:a.pixelRatio,overscaling:a.overscaling,collisionBoxArray:a.collisionBoxArray,sourceLayerIndex:m})).populate(y,h),s.bucketLayerIDs.push(T.map(function(t){return t.id})))}}}var E=t.mapObject(h.glyphDependencies,function(t){return Object.keys(t).map(Number)});Object.keys(E).length?n.send("getGlyphs",{uid:this.uid,stacks:E},function(t,e){l||(l=t,u=e,C.call(a))}):u={};var S=Object.keys(h.iconDependencies);function C(){if(l)return i(l);if(u&&c){var e=new x(u),r=new t.default$28(c);for(var n in f){var a=f[n];a instanceof t.default$14&&(_(a.layers,this.zoom),v(a,u,e.positions,c,r.positions,this.showCollisionBoxes))}this.status="done",i(null,{buckets:t.values(f).filter(function(t){return!t.isEmpty()}),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,iconAtlasImage:r.image})}}S.length?n.send("getImages",{icons:S},function(t,e){l||(l=t,c=e,C.call(a))}):c={},C.call(this)};var w=function(t){return!(!performance||!performance.getEntriesByName)&&performance.getEntriesByName(t)};function k(e,r){var n=t.getArrayBuffer(e.request,function(e,n){e?r(e):n&&r(null,{vectorTile:new t.default$29.VectorTile(new t.default$30(n.data)),rawData:n.data,cacheControl:n.cacheControl,expires:n.expires})});return function(){n.abort(),r()}}var A=function(t,e,r){this.actor=t,this.layerIndex=e,this.loadVectorData=r||k,this.loading={},this.loaded={}};A.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var a=this.loading[i]=new b(e);a.abort=this.loadVectorData(e,function(o,s){if(delete n.loading[i],o||!s)return r(o);var l=s.rawData,u={};s.expires&&(u.expires=s.expires),s.cacheControl&&(u.cacheControl=s.cacheControl);var c={};if(e.request&&e.request.collectResourceTiming){var f=w(e.request.url);f&&(c.resourceTiming=JSON.parse(JSON.stringify(f)))}a.vectorTile=s.vectorTile,a.parse(s.vectorTile,n.layerIndex,n.actor,function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:l.slice(0)},n,u,c))}),n.loaded=n.loaded||{},n.loaded[i]=a})},A.prototype.reloadTile=function(t,e){var r=this.loaded,n=t.uid,i=this;if(r&&r[n]){var a=r[n];a.showCollisionBoxes=t.showCollisionBoxes;var o=function(t,r){var n=a.reloadCallback;n&&(delete a.reloadCallback,a.parse(a.vectorTile,i.layerIndex,i.actor,n)),e(t,r)};"parsing"===a.status?a.reloadCallback=o:"done"===a.status&&a.parse(a.vectorTile,this.layerIndex,this.actor,o)}},A.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},A.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var T=function(){this.loading={},this.loaded={}};T.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,a=new t.default$31(n);this.loading[n]=a,a.loadFromImage(e.rawImageData,i),delete this.loading[n],this.loaded=this.loaded||{},this.loaded[n]=a,r(null,a)},T.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var M={RADIUS:6378137,FLATTENING:1/298.257223563,POLAR_RADIUS:6356752.3142};function E(t){var e=0;if(t&&t.length>0){e+=Math.abs(S(t[0]));for(var r=1;r2){for(o=0;o=0}(t)===e?t:t.reverse()}var D=t.default$29.VectorTileFeature.prototype.toGeoJSON,z=function(e){this._feature=e,this.extent=t.default$8,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};z.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r>31}function $(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,a=0,o=r.length,s=0;si;){if(a-i>600){var s=a-i+1,l=n-i+1,u=Math.log(s),c=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1),h=Math.max(i,Math.floor(n-l*c/s+f)),p=Math.min(a,Math.floor(n+(s-l)*c/s+f));t(e,r,n,h,p,o)}var d=r[2*n+o],v=i,g=a;for(Q(e,r,i,n),r[2*a+o]>d&&Q(e,r,i,a);vd;)g--}r[2*i+o]===d?Q(e,r,i,g):Q(e,r,++g,a),g<=n&&(i=g+1),n<=g&&(a=g-1)}}(e,r,s,i,a,o%2),t(e,r,n,i,s-1,o+1),t(e,r,n,s+1,a,o+1)}};function Q(t,e,r,n){tt(t,r,n),tt(e,2*r,2*n),tt(e,2*r+1,2*n+1)}function tt(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function et(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}var rt=function(t,e,r,n,i){return new nt(t,e,r,n,i)};function nt(t,e,r,n,i){e=e||it,r=r||at,i=i||Array,this.nodeSize=n||64,this.points=t,this.ids=new i(t.length),this.coords=new i(2*t.length);for(var a=0;a=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return pt(pt({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function ft(t){return t/360+.5}function ht(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function pt(t,e){for(var r in e)t[r]=e[r];return t}function dt(t){return t.x}function vt(t){return t.y}function gt(t,e,r,n,i,a){var o=i-r,s=a-n;if(0!==o||0!==s){var l=((t-r)*o+(e-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return(o=t-r)*o+(s=e-n)*s}function mt(t,e,r,n){var i={id:t||null,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)yt(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(o+=n?(i*u-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(u-a,2))),i=l,a=u}var c=e.length-3;e[2]=1,function t(e,r,n,i){for(var a,o=i,s=e[r],l=e[r+1],u=e[n],c=e[n+1],f=r+3;fo&&(a=f,o=h)}o>i&&(a-r>3&&t(e,r,a,i),e[a+2]=o,n-a>3&&t(e,a,n,i))}(e,0,c,r),e[c+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function wt(t,e,r,n){for(var i=0;i1?1:r}function Tt(t,e,r,n,i,a,o,s){if(n/=e,a>=(r/=e)&&o<=n)return t;if(a>n||o=r&&d<=n)l.push(c);else if(!(p>n||d=r&&o<=n&&(e.push(t[a]),e.push(t[a+1]),e.push(t[a+2]))}}function Et(t,e,r,n,i,a,o){for(var s,l,u=St(t),c=0===i?Ot:It,f=t.start,h=0;h=r&&(l=c(u,p,d,g,m,r),o&&(u.start=f+s*l)):y>n?x<=n&&(l=c(u,p,d,g,m,n),o&&(u.start=f+s*l)):Lt(u,p,d,v),x=r&&(l=c(u,p,d,g,m,r),b=!0),x>n&&y<=n&&(l=c(u,p,d,g,m,n),b=!0),!a&&b&&(o&&(u.end=f+s*l),e.push(u),u=St(t)),o&&(f+=s)}var _=t.length-3;p=t[_],d=t[_+1],v=t[_+2],(y=0===i?p:d)>=r&&y<=n&&Lt(u,p,d,v),_=u.length-3,a&&_>=3&&(u[_]!==u[0]||u[_+1]!==u[1])&&Lt(u,u[0],u[1],u[2]),u.length&&e.push(u)}function St(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function Ct(t,e,r,n,i,a){for(var o=0;oo.maxX&&(o.maxX=c),f>o.maxY&&(o.maxY=f)}return o}function Bt(t,e,r,n){var i=e.geometry,a=e.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s0&&e.size<(i?o:n))r.numPoints+=e.length/3;else{for(var s=[],l=0;lo)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,a=i-2;n0===e)for(n=0,i=t.length;n24)throw new Error("maxZoom should be in the 0-24 range");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n=r&&s<=i&&l>=n&&l<=a&&c.push(t[d]);else{var v=Math.floor((p+h)/2);s=e[2*v],l=e[2*v+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(t[v]);var g=(f+1)%2;(0===f?r<=s:n<=l)&&(u.push(p),u.push(v-1),u.push(g)),(0===f?i>=s:a>=l)&&(u.push(v+1),u.push(h),u.push(g))}}return c}(this.ids,this.coords,t,e,r,n,this.nodeSize)},within:function(t,e,r){return function(t,e,r,n,i,a){for(var o=[0,t.length-1,0],s=[],l=i*i;o.length;){var u=o.pop(),c=o.pop(),f=o.pop();if(c-f<=a)for(var h=f;h<=c;h++)et(e[2*h],e[2*h+1],r,n)<=l&&s.push(t[h]);else{var p=Math.floor((f+c)/2),d=e[2*p],v=e[2*p+1];et(d,v,r,n)<=l&&s.push(t[p]);var g=(u+1)%2;(0===u?r-i<=d:n-i<=v)&&(o.push(f),o.push(p-1),o.push(g)),(0===u?r+i>=d:n+i>=v)&&(o.push(p+1),o.push(c),o.push(g))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)}},ot.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time("total time");var r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var n=t.map(lt);e&&console.timeEnd(r);for(var i=this.options.maxZoom;i>=this.options.minZoom;i--){var a=+Date.now();this.trees[i+1]=rt(n,dt,vt,this.options.nodeSize,Float32Array),n=this._cluster(n,i),e&&console.log("z%d: %d clusters in %dms",i,n.length,+Date.now()-a)}return this.trees[this.options.minZoom]=rt(n,dt,vt,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],n=r.range(ft(t[0]),ht(t[3]),ft(t[2]),ht(t[1])),i=[],a=0;a1&&console.time("creation"),h=this.tiles[f]=Ft(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,h.numFeatures,h.numPoints,h.numSimplified),console.timeEnd("creation"));var p="z"+e;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(h.source=t,i){if(e===l.maxZoom||e===i)continue;var d=1<1&&console.time("clipping");var v,g,m,y,x,b,_=.5*l.buffer/l.extent,w=.5-_,k=.5+_,A=1+_;v=g=m=y=null,x=Tt(t,c,r-_,r+k,0,h.minX,h.maxX,l),b=Tt(t,c,r+w,r+A,0,h.minX,h.maxX,l),t=null,x&&(v=Tt(x,c,n-_,n+k,1,h.minY,h.maxY,l),g=Tt(x,c,n+w,n+A,1,h.minY,h.maxY,l),x=null),b&&(m=Tt(b,c,n-_,n+k,1,h.minY,h.maxY,l),y=Tt(b,c,n+w,n+A,1,h.minY,h.maxY,l),b=null),u>1&&console.timeEnd("clipping"),s.push(v||[],e+1,2*r,2*n),s.push(g||[],e+1,2*r,2*n+1),s.push(m||[],e+1,2*r+1,2*n),s.push(y||[],e+1,2*r+1,2*n+1)}}},jt.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,a=n.debug;if(t<0||t>24)return null;var o=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,u=t,c=e,f=r;!l&&u>0;)u--,c=Math.floor(c/2),f=Math.floor(f/2),l=this.tiles[Vt(u,c,f)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",u,c,f),a>1&&console.time("drilling down"),this.splitTile(l.source,u,c,f,t,e,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?zt(this.tiles[s],i):null):null};var Ht=function(e){function r(t,r,n){e.call(this,t,r,Ut),n&&(this.loadGeoJSON=n)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var t=this;if(this._pendingCallback&&this._pendingLoadDataParams){var e=this._pendingCallback,r=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams,this.loadGeoJSON(r,function(n,i){if(n||!i)return e(n);if("object"!=typeof i)return e(new Error("Input data is not a valid GeoJSON object."));!function t(e,r){switch(e&&e.type||null){case"FeatureCollection":return e.features=e.features.map(O(t,r)),e;case"Feature":return e.geometry=t(e.geometry,r),e;case"Polygon":case"MultiPolygon":return function(t,e){return"Polygon"===t.type?t.coordinates=I(t.coordinates,e):"MultiPolygon"===t.type&&(t.coordinates=t.coordinates.map(O(I,e))),t}(e,r);default:return e}}(i,!0);try{t._geoJSONIndex=r.cluster?function(t){return new ot(t)}(r.superclusterOptions).load(i.features):function(t,e){return new jt(t,e)}(i,r.geojsonVtOptions)}catch(n){return e(n)}t.loaded={};var a={};if(r.request&&r.request.collectResourceTiming){var o=w(r.request.url);o&&(a.resourceTiming={},a.resourceTiming[r.source]=JSON.parse(JSON.stringify(o)))}e(null,a)})}},r.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},r.prototype.reloadTile=function(t,r){var n=this.loaded,i=t.uid;return n&&n[i]?e.prototype.reloadTile.call(this,t,r):this.loadTile(t,r)},r.prototype.loadGeoJSON=function(e,r){if(e.request)t.getJSON(e.request,r);else{if("string"!=typeof e.data)return r(new Error("Input data is not a valid GeoJSON object."));try{return r(null,JSON.parse(e.data))}catch(t){return r(new Error("Input data is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},r}(A),qt=function(e){var r=this;this.self=e,this.actor=new t.default$7(e,this),this.layerIndexes={},this.workerSourceTypes={vector:A,geojson:Ht},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(r.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');r.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=function(e){if(t.plugin.isLoaded())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText}};return qt.prototype.setLayers=function(t,e,r){this.getLayerIndex(t).replace(e),r()},qt.prototype.updateLayers=function(t,e,r){this.getLayerIndex(t).update(e.layers,e.removedIds),r()},qt.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).loadTile(e,r)},qt.prototype.loadDEMTile=function(t,e,r){this.getDEMWorkerSource(t,e.source).loadTile(e,r)},qt.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).reloadTile(e,r)},qt.prototype.abortTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).abortTile(e,r)},qt.prototype.removeTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).removeTile(e,r)},qt.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},qt.prototype.removeSource=function(t,e,r){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var n=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==n.removeSource?n.removeSource(e,r):r()}},qt.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t.toString())}},qt.prototype.loadRTLTextPlugin=function(e,r,n){try{t.plugin.isLoaded()||(this.self.importScripts(r),n(t.plugin.isLoaded()?null:new Error("RTL Text Plugin failed to import scripts from "+r)))}catch(t){n(t.toString())}},qt.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new n),e},qt.prototype.getWorkerSource=function(t,e,r){var n=this;if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][r]){var i={send:function(e,r,i){n.actor.send(e,r,i,t)}};this.workerSources[t][e][r]=new this.workerSourceTypes[e](i,this.getLayerIndex(t))}return this.workerSources[t][e][r]},qt.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new T),this.demWorkerSources[t][e]},"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&new qt(self),qt}),i(0,function(t){var e=t.createCommonjsModule(function(t){function e(t){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,r=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(r);try{e=new Worker(n),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(n),t}()&&"Uint8ClampedArray"in window&&function(t){return void 0===r[t]&&(r[t]=function(t){var r=document.createElement("canvas"),n=Object.create(e.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=t,r.probablySupportsContext?r.probablySupportsContext("webgl",n)||r.probablySupportsContext("experimental-webgl",n):r.supportsContext?r.supportsContext("webgl",n)||r.supportsContext("experimental-webgl",n):r.getContext("webgl",n)||r.getContext("experimental-webgl",n)}(t)),r[t]}(t&&t.failIfMajorPerformanceCaveat))}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e);var r={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}}),r=t.default.performance&&t.default.performance.now?t.default.performance.now.bind(t.default.performance):Date.now.bind(Date),n=t.default.requestAnimationFrame||t.default.mozRequestAnimationFrame||t.default.webkitRequestAnimationFrame||t.default.msRequestAnimationFrame,i=t.default.cancelAnimationFrame||t.default.mozCancelAnimationFrame||t.default.webkitCancelAnimationFrame||t.default.msCancelAnimationFrame,a={now:r,frame:function(t){return n(t)},cancelFrame:function(t){return i(t)},getImageData:function(e){var r=t.default.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,n.drawImage(e,0,0,e.width,e.height),n.getImageData(0,0,e.width,e.height)},hardwareConcurrency:t.default.navigator.hardwareConcurrency||4,get devicePixelRatio(){return t.default.devicePixelRatio},supportsWebp:!1};if(t.default.document){var o=t.default.document.createElement("img");o.onload=function(){a.supportsWebp=!0},o.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="}var s={create:function(e,r,n){var i=t.default.document.createElement(e);return r&&(i.className=r),n&&n.appendChild(i),i},createNS:function(e,r){return t.default.document.createElementNS(e,r)}},l=t.default.document?t.default.document.documentElement.style:null;function u(t){if(!l)return null;for(var e=0;e=0?0:e.button},s.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var g={API_URL:"https://api.mapbox.com",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null},m="See https://www.mapbox.com/api-documentation/#access-tokens";function y(t,e){var r=T(g.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,"/"!==r.path&&(t.path=""+r.path+t.path),!g.REQUIRE_ACCESS_TOKEN)return M(t);if(!(e=e||g.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+m);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+m);return t.params.push("access_token="+e),M(t)}function x(t){return 0===t.indexOf("mapbox:")}var b=function(t,e){if(!x(t))return t;var r=T(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),y(r,e)},_=function(t,e,r,n){var i=T(t);return x(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,y(i,n)):(i.path+=""+e+r,M(i))},w=/(\.(png|jpg)\d*)(?=$)/,k=function(t,e,r){if(!e||!x(e))return t;var n=T(t),i=a.devicePixelRatio>=2||512===r?"@2x":"",o=a.supportsWebp?".webp":"$1";return n.path=n.path.replace(w,""+i+o),function(t){for(var e=0;e=0?1.2:1))}function R(t,e,r,n,i,a,o){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else{var l=a.requests[s];l||(l=a.requests[s]=[],B.loadGlyphRange(r,s,n.url,n.requestTransform,function(t,e){if(e)for(var r in e)a.glyphs[+r]=e[+r];for(var n=0,i=l;nthis.height)return t.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};G.prototype.wrap=function(){return new G(t.wrap(this.lng,-180,180),this.lat)},G.prototype.toArray=function(){return[this.lng,this.lat]},G.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},G.prototype.toBounds=function(t){var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new W(new G(this.lng-r,this.lat-e),new G(this.lng+r,this.lat+e))},G.convert=function(t){if(t instanceof G)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new G(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new G(Number(t.lng),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, or an array of [, ]")};var W=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};W.prototype.setNorthEast=function(t){return this._ne=t instanceof G?new G(t.lng,t.lat):G.convert(t),this},W.prototype.setSouthWest=function(t){return this._sw=t instanceof G?new G(t.lng,t.lat):G.convert(t),this},W.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof G)e=t,r=t;else{if(!(t instanceof W))return Array.isArray(t)?t.every(Array.isArray)?this.extend(W.convert(t)):this.extend(G.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new G(e.lng,e.lat),this._ne=new G(r.lng,r.lat)),this},W.prototype.getCenter=function(){return new G((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},W.prototype.getSouthWest=function(){return this._sw},W.prototype.getNorthEast=function(){return this._ne},W.prototype.getNorthWest=function(){return new G(this.getWest(),this.getNorth())},W.prototype.getSouthEast=function(){return new G(this.getEast(),this.getSouth())},W.prototype.getWest=function(){return this._sw.lng},W.prototype.getSouth=function(){return this._sw.lat},W.prototype.getEast=function(){return this._ne.lng},W.prototype.getNorth=function(){return this._ne.lat},W.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},W.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},W.prototype.isEmpty=function(){return!(this._sw&&this._ne)},W.convert=function(t){return!t||t instanceof W?t:new W(t)};var Y=function(t,e,r){this.bounds=W.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=r||24};Y.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},Y.prototype.contains=function(t){var e=Math.floor(this.lngX(this.bounds.getWest(),t.z)),r=Math.floor(this.latY(this.bounds.getNorth(),t.z)),n=Math.ceil(this.lngX(this.bounds.getEast(),t.z)),i=Math.ceil(this.latY(this.bounds.getSouth(),t.z));return t.x>=e&&t.x=r&&t.y0&&(l[new t.OverscaledTileID(e.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}})},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(e){if(e)return r.fire(new t.ErrorEvent(e));var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}),this},r.prototype._updateWorkerData=function(e){var r,n,i=this,a=t.extend({},this.workerOptions),o=this._data;"string"==typeof o?(a.request=this.map._transformRequest((r=o,(n=t.default.document.createElement("a")).href=r,n.href),t.ResourceType.Source),a.request.collectResourceTiming=this._collectResourceTiming):a.data=JSON.stringify(o),this.workerID=this.dispatcher.send(this.type+"."+a.source+".loadData",a,function(t,r){i._removed||r&&r.abandoned||(i._loaded=!0,r&&r.resourceTiming&&r.resourceTiming[i.id]&&(i._resourceTiming=r.resourceTiming[i.id].slice(0)),i.dispatcher.send(i.type+"."+a.source+".coalesce",null,null,i.workerID),e(t))},this.workerID)},r.prototype.loadTile=function(t,e){var r=this,n=void 0===t.workerID?"loadTile":"reloadTile",i={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:a.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send(n,i,function(i,a){return t.unloadVectorData(),t.aborted?e(null):i?e(i):(t.loadVectorData(a,r.map.painter,"reloadTile"===n),e(null))},this.workerID)},r.prototype.abortTile=function(t){t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},null,t.workerID)},r.prototype.onRemove=function(){this._removed=!0,this.dispatcher.send("removeSource",{type:this.type,source:this.id},null,this.workerID)},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),K=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Q=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};Q.prototype.bind=function(t,e,r,n,i,a,o,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==n.length,u=0;!l&&u>s.z,u=new t.default$1(s.x*l,s.y*l),c=new t.default$1(u.x+l,u.y+l),f=this.segments.prepareSegment(4,n,i);n.emplaceBack(u.x,u.y,u.x,u.y),n.emplaceBack(c.x,u.y,c.x,u.y),n.emplaceBack(u.x,c.y,u.x,c.y),n.emplaceBack(c.x,c.y,c.x,c.y);var h=f.vertexLength;i.emplaceBack(h,h+1,h+2),i.emplaceBack(h+1,h+2,h+3),f.vertexLength+=4,f.primitiveLength+=2}this.maskedBoundsBuffer=r.createVertexBuffer(n,K.members),this.maskedIndexBuffer=r.createIndexBuffer(i)}},st.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},st.prototype.setExpiryData=function(e){var r=this.expirationTime;if(e.cacheControl){var n=t.parseCacheControl(e.cacheControl);n["max-age"]&&(this.expirationTime=Date.now()+1e3*n["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){var i=Date.now(),a=!1;if(this.expirationTime>i)a=!1;else if(r)if(this.expirationTimethis.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},lt.prototype.has=function(t){return t.wrapped().key in this.data},lt.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},lt.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},lt.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},lt.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},lt.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this};var ut=function(t,e,r){this.context=t;var n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(r),this.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};ut.prototype.unbindVAO=function(){this.context.extVertexArrayObject&&this.context.bindVertexArrayOES.set(null)},ut.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},ut.prototype.updateData=function(t){var e=this.context.gl;this.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},ut.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var ct={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},ft=function(t,e,r,n){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;var i=t.gl;this.buffer=i.createBuffer(),t.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};ft.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},ft.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},ft.prototype.enableAttributes=function(t,e){for(var r=0;r1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[a]&&(t.neighboringTiles[a].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype.getZoom=function(t){return t.zoom+t.scaleZoom(t.tileSize/this._source.tileSize)},r.prototype._findLoadedChildren=function(t,e,r){var n=!1;for(var i in this._tiles){var a=this._tiles[i];if(!(r[i]||!a.hasData()||a.tileID.overscaledZ<=t.overscaledZ||a.tileID.overscaledZ>e)){var o=Math.pow(2,a.tileID.canonical.z-t.canonical.z);if(Math.floor(a.tileID.canonical.x/o)===t.canonical.x&&Math.floor(a.tileID.canonical.y/o)===t.canonical.y)for(r[i]=a.tileID,n=!0;a&&a.tileID.overscaledZ-1>t.overscaledZ;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);if(!s)break;(a=this._tiles[s.key])&&a.hasData()&&(delete r[i],r[s.key]=s)}}}return n},r.prototype.findLoadedParent=function(t,e,r){for(var n=t.overscaledZ-1;n>=e;n--){var i=t.scaledTo(n);if(!i)return;var a=String(i.key),o=this._tiles[a];if(o&&o.hasData())return r[a]=i,o;if(this._cache.has(i))return r[a]=i,this._cache.get(i)}},r.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),r=Math.floor(5*e),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},r.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,r=Math.round(e);if(this._prevLng=t,r){var n={};for(var i in this._tiles){var a=this._tiles[i];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+r),n[a.tileID.key]=a}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)}):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter(function(t){return n._source.hasTile(t)}))):i=[];var o,s=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(e)),l=Math.max(s-r.maxOverzooming,this._source.minzoom),u=Math.max(s+r.maxUnderzooming,this._source.minzoom),c=this._updateRetainedTiles(i,s),f={};if(Zt(this._source.type))for(var h=Object.keys(c),p=0;p=a.now())){n._findLoadedChildren(v,u,c)&&(c[d]=v);var m=n.findLoadedParent(v,l,f);m&&n._addTile(m.tileID)}}for(o in f)c[o]||(n._coveredTiles[o]=!0);for(o in f)c[o]=f[o];for(var y=t.keysDifference(this._tiles,c),x=0;xthis._source.maxzoom){var h=l.children(this._source.maxzoom)[0],p=this.getTile(h);p&&p.hasData()?n[h.key]=h:f=!1}else{this._findLoadedChildren(l,o,n);for(var d=l.children(this._source.maxzoom),v=0;v=a;--g){var m=l.scaledTo(g);if(i[m.key])break;if(i[m.key]=!0,!(u=this.getTile(m))&&c&&(u=this._addTile(m)),u&&(n[m.key]=m,c=u.wasRequested(),u.hasData()))break}}}return n},r.prototype._addTile=function(e){var r=this._tiles[e.key];if(r)return r;(r=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,r),r.tileID=e);var n=Boolean(r);return n||(r=new st(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,this._tileLoaded.bind(this,r,e.key,r.state))),r?(r.uses++,this._tiles[e.key]=r,n||this._source.fire(new t.Event("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r):null},r.prototype._setTileReloadTimer=function(t,e){var r=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var n=e.getExpiryTimeout();n&&(this._timers[t]=setTimeout(function(){r._reloadTile(t,"expired"),delete r._timers[t]},n))},r.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r){for(var n=[],i=this.getIds(),a=1/0,o=1/0,s=-1/0,l=-1/0,u=e[0].zoom,c=0;c=0&&m[1].y+g>=0){for(var y=[],x=0;x=a.now())return!0}return!1},r}(t.Evented);function Xt(e,r){var n=r.zoomTo(e.canonical.z);return new t.default$1((n.column-(e.canonical.x+e.wrap*Math.pow(2,e.canonical.z)))*t.default$8,(n.row-e.canonical.y)*t.default$8)}function Zt(t){return"raster"===t||"image"===t||"video"===t}function $t(){return new t.default.Worker(Sn.workerUrl)}Yt.maxOverzooming=10,Yt.maxUnderzooming=3;var Jt,Kt=function(){this.active={}};function Qt(e,r){var n={};for(var i in e)"ref"!==i&&(n[i]=e[i]);return t.default$18.forEach(function(t){t in r&&(n[t]=r[t])}),n}function te(t){t=t.slice();for(var e=Object.create(null),r=0;rthis.width||n<0||e>this.height)return!i&&[];var a=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var o=0;o0:a},ue.prototype._queryCircle=function(t,e,r,n){var i=t-r,a=t+r,o=e-r,s=e+r;if(a<0||i>this.width||s<0||o>this.height)return!n&&[];var l=[],u={hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(i,o,a,s,this._queryCellCircle,l,u),n?l.length>0:l},ue.prototype.query=function(t,e,r,n){return this._query(t,e,r,n,!1)},ue.prototype.hitTest=function(t,e,r,n){return this._query(t,e,r,n,!0)},ue.prototype.hitTestCircle=function(t,e,r){return this._queryCircle(t,e,r,!0)},ue.prototype._queryCell=function(t,e,r,n,i,a,o){var s=o.seenUids,l=this.boxCells[i];if(null!==l)for(var u=this.bboxes,c=0,f=l;c=u[p+0]&&n>=u[p+1]){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[h],x1:u[p],y1:u[p+1],x2:u[p+2],y2:u[p+3]})}}}var d=this.circleCells[i];if(null!==d)for(var v=this.circles,g=0,m=d;go*o+s*s},ue.prototype._circleAndRectCollide=function(t,e,r,n,i,a,o){var s=(a-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;var u=(o-i)/2,c=Math.abs(e-(i+u));if(c>u+r)return!1;if(l<=s||c<=u)return!0;var f=l-s,h=c-u;return f*f+h*h<=r*r};var ce=t.default$19.layout;function fe(e,r,n,i,a){var o=t.mat4.identity(new Float32Array(16));return r?(t.mat4.identity(o),t.mat4.scale(o,o,[1/a,1/a,1]),n||t.mat4.rotateZ(o,o,i.angle)):(t.mat4.scale(o,o,[i.width/2,-i.height/2,1]),t.mat4.translate(o,o,[1,-1,0]),t.mat4.multiply(o,o,e)),o}function he(e,r,n,i,a){var o=t.mat4.identity(new Float32Array(16));return r?(t.mat4.multiply(o,o,e),t.mat4.scale(o,o,[a,a,1]),n||t.mat4.rotateZ(o,o,-i.angle)):(t.mat4.scale(o,o,[1,-1,1]),t.mat4.translate(o,o,[-1,-1,0]),t.mat4.scale(o,o,[2/i.width,2/i.height,1])),o}function pe(e,r){var n=[e.x,e.y,0,1];ke(n,n,r);var i=n[3];return{point:new t.default$1(n[0]/i,n[1]/i),signedDistanceFromCamera:i}}function de(t,e){var r=t[0]/t[3],n=t[1]/t[3];return r>=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function ve(e,r,n,i,a,o,s,l){var u=i?e.textSizeData:e.iconSizeData,c=t.evaluateSizeForZoom(u,n.transform.zoom,ce.properties[i?"text-size":"icon-size"]),f=[256/n.width*2+1,256/n.height*2+1],h=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;h.clear();for(var p=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,v=n.transform.width/n.transform.height,g=!1,m=0;mMath.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function ye(e,r,n,i,a,o,s,l,u,c,f,h,p,d){var v,g=r/24,m=e.lineOffsetX*r,y=e.lineOffsetY*r;if(e.numGlyphs>1){var x=e.glyphStartIndex+e.numGlyphs,b=e.lineStartIndex,_=e.lineStartIndex+e.lineLength,w=ge(g,l,m,y,n,f,h,e,u,o,p,!1);if(!w)return{notEnoughRoom:!0};var k=pe(w.first.point,s).point,A=pe(w.last.point,s).point;if(i&&!n){var T=me(e.writingMode,k,A,d);if(T)return T}v=[w.first];for(var M=e.glyphStartIndex+1;M0?L.point:xe(h,C,E,1,a),I=me(e.writingMode,E,O,d);if(I)return I}var P=be(g*l.getoffsetX(e.glyphStartIndex),m,y,n,f,h,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,u,o,p,!1);if(!P)return{notEnoughRoom:!0};v=[P]}for(var D=0,z=v;D0?1:-1,g=0;i&&(v*=-1,g=Math.PI),v<0&&(g+=Math.PI);for(var m=v>0?l+s:l+s+1,y=m,x=a,b=a,_=0,w=0,k=Math.abs(d);_+w<=k;){if((m+=v)=u)return null;if(b=x,void 0===(x=h[m])){var A=new t.default$1(c.getx(m),c.gety(m)),T=pe(A,f);if(T.signedDistanceFromCamera>0)x=h[m]=T.point;else{var M=m-v;x=xe(0===_?o:new t.default$1(c.getx(M),c.gety(M)),A,b,k-_+1,f)}}_+=w,w=b.dist(x)}var E=(k-_)/w,S=x.sub(b),C=S.mult(E)._add(b);return C._add(S._unit()._perp()._mult(n*v)),{point:C,angle:g+Math.atan2(x.y-b.y,x.x-b.x),tileDistance:p?{prevTileDistance:m-v===y?0:c.gettileUnitDistanceFromAnchor(m-v),lastSegmentViewportDistance:k-_}:null}}var _e=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function we(t,e){for(var r=0;rM)Te(e,E,!1);else{var I=this.projectPoint(c,S,C),P=L*k;if(d.length>0){var D=I.x-d[d.length-4],z=I.y-d[d.length-3];if(P*P*2>D*D+z*z&&E+8-T&&R=this.screenRightBoundary||n<100||e>this.screenBottomBoundary};var Ee=t.default$19.layout,Se=function(t,e,r,n){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):n&&r?1:0,this.placed=r};Se.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var Ce=function(t,e,r,n,i){this.text=new Se(t?t.text:null,e,r,i),this.icon=new Se(t?t.icon:null,e,n,i)};Ce.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var Le=function(t,e,r){this.text=t,this.icon=e,this.skipFade=r},Oe=function(t,e){this.transform=t.clone(),this.collisionIndex=new Ae(this.transform),this.placements={},this.opacities={},this.stale=!1,this.fadeDuration=e,this.retainedQueryData={}};function Ie(t,e,r){t.emplaceBack(e?1:0,r?1:0),t.emplaceBack(e?1:0,r?1:0),t.emplaceBack(e?1:0,r?1:0),t.emplaceBack(e?1:0,r?1:0)}Oe.prototype.placeLayerTile=function(e,r,n,i){var a=r.getBucket(e),o=r.latestFeatureIndex;if(a&&o&&e.id===a.layerIds[0]){var s=r.collisionBoxArray,l=a.layers[0].layout,u=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),c=r.tileSize/t.default$8,f=this.transform.calculatePosMatrix(r.tileID.toUnwrapped()),h=fe(f,"map"===l.get("text-pitch-alignment"),"map"===l.get("text-rotation-alignment"),this.transform,Me(r,1,this.transform.zoom)),p=fe(f,"map"===l.get("icon-pitch-alignment"),"map"===l.get("icon-rotation-alignment"),this.transform,Me(r,1,this.transform.zoom));this.retainedQueryData[a.bucketInstanceId]=new function(t,e,r,n,i){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i}(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,r.tileID),this.placeLayerBucket(a,f,h,p,u,c,n,i,s)}},Oe.prototype.placeLayerBucket=function(e,r,n,i,a,o,s,l,u){for(var c=e.layers[0].layout,f=t.evaluateSizeForZoom(e.textSizeData,this.transform.zoom,Ee.properties["text-size"]),h=!e.hasTextData()||c.get("text-optional"),p=!e.hasIconData()||c.get("icon-optional"),d=0,v=e.symbolInstances;d0,x=x&&b.offscreen);var T=g.collisionArrays.textCircles;if(T){var M=e.text.placedSymbolArray.get(g.placedTextSymbolIndices[0]),E=t.evaluateSizeForFeature(e.textSizeData,f,M);_=this.collisionIndex.placeCollisionCircles(T,c.get("text-allow-overlap"),a,o,g.key,M,e.lineVertexArray,e.glyphOffsetArray,E,r,n,s,"map"===c.get("text-pitch-alignment")),m=c.get("text-allow-overlap")||_.circles.length>0,x=x&&_.offscreen}g.collisionArrays.iconFeatureIndex&&(A=g.collisionArrays.iconFeatureIndex),g.collisionArrays.iconBox&&(y=(w=this.collisionIndex.placeCollisionBox(g.collisionArrays.iconBox,c.get("icon-allow-overlap"),o,r)).box.length>0,x=x&&w.offscreen),h||p?p?h||(y=y&&m):m=y&&m:y=m=y&&m,m&&b&&this.collisionIndex.insertCollisionBox(b.box,c.get("text-ignore-placement"),e.bucketInstanceId,k),y&&w&&this.collisionIndex.insertCollisionBox(w.box,c.get("icon-ignore-placement"),e.bucketInstanceId,A),m&&_&&this.collisionIndex.insertCollisionCircles(_.circles,c.get("text-ignore-placement"),e.bucketInstanceId,k),this.placements[g.crossTileID]=new Le(m,y,x||e.justReloaded),l[g.crossTileID]=!0}}e.justReloaded=!1},Oe.prototype.commit=function(t,e){this.commitTime=e;var r=!1,n=t&&0!==this.fadeDuration?(this.commitTime-t.commitTime)/this.fadeDuration:1,i=t?t.opacities:{};for(var a in this.placements){var o=this.placements[a],s=i[a];s?(this.opacities[a]=new Ce(s,n,o.text,o.icon),r=r||o.text!==s.text.placed||o.icon!==s.icon.placed):(this.opacities[a]=new Ce(null,n,o.text,o.icon,o.skipFade),r=r||o.text||o.icon)}for(var l in i){var u=i[l];if(!this.opacities[l]){var c=new Ce(u,n,!1,!1);c.isHidden()||(this.opacities[l]=c,r=r||u.text.placed||u.icon.placed)}}r?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)},Oe.prototype.updateLayerOpacities=function(t,e){for(var r={},n=0,i=e;n0||s.numVerticalGlyphVertices>0,f=s.numIconVertices>0;if(c){for(var h=je(u.text),p=(s.numGlyphVertices+s.numVerticalGlyphVertices)/4,d=0;dt},Oe.prototype.setStale=function(){this.stale=!0};var Pe=Math.pow(2,25),De=Math.pow(2,24),ze=Math.pow(2,17),Re=Math.pow(2,16),Fe=Math.pow(2,9),Be=Math.pow(2,8),Ne=Math.pow(2,1);function je(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*Pe+e*De+r*ze+e*Re+r*Fe+e*Be+r*Ne+e}var Ve=function(){this._currentTileIndex=0,this._seenCrossTileIDs={}};Ve.prototype.continuePlacement=function(t,e,r,n,i){for(;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=e[t[n._currentPlacementIndex]],l=n.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(n._inProgressLayer||(n._inProgressLayer=new Ve),n._inProgressLayer.continuePlacement(r[s.source],n.placement,n._showCollisionBoxes,s,o))return;delete n._inProgressLayer}n._currentPlacementIndex--}this._done=!0},Ue.prototype.commit=function(t,e){return this.placement.commit(t,e),this.placement};var He=512/t.default$8/2,qe=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0,i=e;nt.overscaledZ)for(var l in s){var u=s[l];u.tileID.isChildOf(t)&&u.findMatches(e.symbolInstances,t,a)}else{var c=s[t.scaledTo(Number(o)).key];c&&c.findMatches(e.symbolInstances,t,a)}}for(var f=0,h=e.symbolInstances;f1?"@2x":"";function u(){if(s)n(s);else if(i&&o){var e=a.getImageData(o),r={};for(var l in i){var u=i[l],c=u.width,f=u.height,h=u.x,p=u.y,d=u.sdf,v=u.pixelRatio,g=new t.RGBAImage({width:c,height:f});t.RGBAImage.copy(e,g,{x:h,y:p},{x:0,y:0},{width:c,height:f}),r[l]={data:g,pixelRatio:v,sdf:d}}n(null,r)}}t.getJSON(r(_(e,l,".json"),t.ResourceType.SpriteJSON),function(t,e){s||(s=t,i=e,u())}),t.getImage(r(_(e,l,".png"),t.ResourceType.SpriteImage),function(t,e){s||(s=t,o=e,u())})}(e.sprite,this.map._transformRequest,function(e,r){if(e)n.fire(new t.ErrorEvent(e));else if(r)for(var i in r)n.imageManager.addImage(i,r[i]);n.imageManager.setLoaded(!0),n.fire(new t.Event("data",{dataType:"style"}))}):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var o=te(this.stylesheet.layers);this._order=o.map(function(t){return t.id}),this._layers={};for(var s=0,l=o;s0)throw new Error("Unimplemented: "+i.map(function(t){return t.command}).join(", ")+".");return n.forEach(function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)}),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.addSource=function(e,r,n){var i=this;if(this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,r,null,n))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var a=this.sourceCaches[e]=new Yt(e,r,this.dispatcher);a.style=this,a.setEventedParent(this,function(){return{isSourceLoaded:i.loaded(),source:a.serialize(),sourceId:e}}),a.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone(e),e=t.extend(e,{source:i})),!this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},n)){var a=t.default$22(e);this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}});var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e]}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r){this._checkLoaded();var n=this.getLayer(e);if(n){if(!t.default$10(n.filter,r))return null==r?(n.filter=void 0,void this._updateLayer(n)):void(this._validate(t.validateStyle.filter,"layers."+n.id+".filter",r)||(n.filter=t.clone(r),this._updateLayer(n)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?t.default$10(i.getLayoutProperty(r),n)||(i.setLayoutProperty(r,n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(t,e){return this.getLayer(t).getLayoutProperty(e)},r.prototype.setPaintProperty=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.default$10(i.getPaintProperty(r),n)){var a=i._transitionablePaint._values[r].value.isDataDriven();i.setPaintProperty(r,n),(i._transitionablePaint._values[r].value.isDataDriven()||a)&&this._updateLayer(i),this._changed=!0,this._updatedPaintProps[e]=!0}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){var e=this;return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,function(t){return t.serialize()}),layers:this._order.map(function(t){return e._layers[t].serialize()})},function(t){return void 0!==t})},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenRenderedFeatures=function(t){for(var e=[],r=this._order.length-1;r>=0;r--)for(var n=this._order[r],i=0,a=t;i 0.5) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 0.5) * alpha;\n }\n\n if (v_notUsed > 0.5) {\n // This box not used, fade it out\n gl_FragColor *= .1;\n }\n}",vertexSource:"attribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_placed;\n\nuniform mat4 u_matrix;\nuniform vec2 u_extrude_scale;\nuniform float u_camera_to_center_distance;\n\nvarying float v_placed;\nvarying float v_notUsed;\n\nvoid main() {\n vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n highp float collision_perspective_ratio = clamp(\n 0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance),\n 0.0, // Prevents oversized near-field boxes in pitched/overzoomed tiles\n 4.0);\n\n gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);\n gl_Position.xy += a_extrude * u_extrude_scale * gl_Position.w * collision_perspective_ratio;\n\n v_placed = a_placed.x;\n v_notUsed = a_placed.y;\n}\n"},collisionCircle:{fragmentSource:"uniform float u_overscale_factor;\n\nvarying float v_placed;\nvarying float v_notUsed;\nvarying float v_radius;\nvarying vec2 v_extrude;\nvarying vec2 v_extrude_scale;\n\nvoid main() {\n float alpha = 0.5;\n\n // Red = collision, hide label\n vec4 color = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n\n // Blue = no collision, label is showing\n if (v_placed > 0.5) {\n color = vec4(0.0, 0.0, 1.0, 0.5) * alpha;\n }\n\n if (v_notUsed > 0.5) {\n // This box not used, fade it out\n color *= .2;\n }\n\n float extrude_scale_length = length(v_extrude_scale);\n float extrude_length = length(v_extrude) * extrude_scale_length;\n float stroke_width = 15.0 * extrude_scale_length / u_overscale_factor;\n float radius = v_radius * extrude_scale_length;\n\n float distance_to_edge = abs(extrude_length - radius);\n float opacity_t = smoothstep(-stroke_width, 0.0, -distance_to_edge);\n\n gl_FragColor = opacity_t * color;\n}\n",vertexSource:"attribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_placed;\n\nuniform mat4 u_matrix;\nuniform vec2 u_extrude_scale;\nuniform float u_camera_to_center_distance;\n\nvarying float v_placed;\nvarying float v_notUsed;\nvarying float v_radius;\n\nvarying vec2 v_extrude;\nvarying vec2 v_extrude_scale;\n\nvoid main() {\n vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n highp float collision_perspective_ratio = clamp(\n 0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance),\n 0.0, // Prevents oversized near-field circles in pitched/overzoomed tiles\n 4.0);\n\n gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);\n\n highp float padding_factor = 1.2; // Pad the vertices slightly to make room for anti-alias blur\n gl_Position.xy += a_extrude * u_extrude_scale * padding_factor * gl_Position.w * collision_perspective_ratio;\n\n v_placed = a_placed.x;\n v_notUsed = a_placed.y;\n v_radius = abs(a_extrude.y); // We don't pitch the circles, so both units of the extrusion vector are equal in magnitude to the radius\n\n v_extrude = a_extrude * padding_factor;\n v_extrude_scale = u_extrude_scale * u_camera_to_center_distance * collision_perspective_ratio;\n}\n"},debug:{fragmentSource:"uniform highp vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fill:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_FragColor = color * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fillOutline:{fragmentSource:"#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillOutlinePattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n\n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n}\n"},fillExtrusion:{fragmentSource:"varying vec4 v_color;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize highp vec4 color\n\n gl_FragColor = v_color;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec4 a_normal_ed;\n\nvarying vec4 v_color;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize highp vec4 color\n\n vec3 normal = a_normal_ed.xyz;\n\n base = max(0.0, base);\n height = max(0.0, height);\n\n float t = mod(normal.x, 2.0);\n\n gl_Position = u_matrix * vec4(a_pos, t > 0.0 ? height : base, 1);\n\n // Relative luminance (how dark/bright is the surface color?)\n float colorvalue = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722;\n\n v_color = vec4(0.0, 0.0, 0.0, 1.0);\n\n // Add slight ambient lighting so no extrusions are totally black\n vec4 ambientlight = vec4(0.03, 0.03, 0.03, 1.0);\n color += ambientlight;\n\n // Calculate cos(theta), where theta is the angle between surface normal and diffuse light ray\n float directional = clamp(dot(normal / 16384.0, u_lightpos), 0.0, 1.0);\n\n // Adjust directional so that\n // the range of values for highlight/shading is narrower\n // with lower light intensity\n // and with lighter/brighter surface colors\n directional = mix((1.0 - u_lightintensity), max((1.0 - colorvalue + u_lightintensity), 1.0), directional);\n\n // Add gradient along z axis of side surfaces\n if (normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n // Assign final color based on surface + ambient light color, diffuse light directional, and light color\n // with lower bounds adjusted to hue of light\n // so that shading is tinted with the complementary (opposite) color to the light color\n v_color.r += clamp(color.r * directional * u_lightcolor.r, mix(0.0, 0.3, 1.0 - u_lightcolor.r), 1.0);\n v_color.g += clamp(color.g * directional * u_lightcolor.g, mix(0.0, 0.3, 1.0 - u_lightcolor.g), 1.0);\n v_color.b += clamp(color.b * directional * u_lightcolor.b, mix(0.0, 0.3, 1.0 - u_lightcolor.b), 1.0);\n}\n"},fillExtrusionPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n vec4 mixedColor = mix(color1, color2, u_mix);\n\n gl_FragColor = mixedColor * v_lighting;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\nuniform float u_height_factor;\n\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec4 a_normal_ed;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\nvarying float v_directional;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n vec3 normal = a_normal_ed.xyz;\n float edgedistance = a_normal_ed.w;\n\n base = max(0.0, base);\n height = max(0.0, height);\n\n float t = mod(normal.x, 2.0);\n float z = t > 0.0 ? height : base;\n\n gl_Position = u_matrix * vec4(a_pos, z, 1);\n\n vec2 pos = normal.x == 1.0 && normal.y == 0.0 && normal.z == 16384.0\n ? a_pos // extrusion top\n : vec2(edgedistance, z * u_height_factor); // extrusion side\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, pos);\n\n v_lighting = vec4(0.0, 0.0, 0.0, 1.0);\n float directional = clamp(dot(normal / 16383.0, u_lightpos), 0.0, 1.0);\n directional = mix((1.0 - u_lightintensity), max((0.5 + u_lightintensity), 1.0), directional);\n\n if (normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n v_lighting.rgb += clamp(directional * u_lightcolor, mix(vec3(0.0), vec3(0.3), 1.0 - u_lightcolor), vec3(1.0));\n}\n"},extrusionTexture:{fragmentSource:"uniform sampler2D u_image;\nuniform float u_opacity;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_FragColor = texture2D(u_image, v_pos) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(0.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);\n\n v_pos.x = a_pos.x;\n v_pos.y = 1.0 - a_pos.y;\n}\n"},hillshadePrepare:{fragmentSource:"#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D u_image;\nvarying vec2 v_pos;\nuniform vec2 u_dimension;\nuniform float u_zoom;\nuniform float u_maxzoom;\n\nfloat getElevation(vec2 coord, float bias) {\n // Convert encoded elevation value to meters\n vec4 data = texture2D(u_image, coord) * 255.0;\n return (data.r + data.g * 256.0 + data.b * 256.0 * 256.0) / 4.0;\n}\n\nvoid main() {\n vec2 epsilon = 1.0 / u_dimension;\n\n // queried pixels:\n // +-----------+\n // | | | |\n // | a | b | c |\n // | | | |\n // +-----------+\n // | | | |\n // | d | e | f |\n // | | | |\n // +-----------+\n // | | | |\n // | g | h | i |\n // | | | |\n // +-----------+\n\n float a = getElevation(v_pos + vec2(-epsilon.x, -epsilon.y), 0.0);\n float b = getElevation(v_pos + vec2(0, -epsilon.y), 0.0);\n float c = getElevation(v_pos + vec2(epsilon.x, -epsilon.y), 0.0);\n float d = getElevation(v_pos + vec2(-epsilon.x, 0), 0.0);\n float e = getElevation(v_pos, 0.0);\n float f = getElevation(v_pos + vec2(epsilon.x, 0), 0.0);\n float g = getElevation(v_pos + vec2(-epsilon.x, epsilon.y), 0.0);\n float h = getElevation(v_pos + vec2(0, epsilon.y), 0.0);\n float i = getElevation(v_pos + vec2(epsilon.x, epsilon.y), 0.0);\n\n // here we divide the x and y slopes by 8 * pixel size\n // where pixel size (aka meters/pixel) is:\n // circumference of the world / (pixels per tile * number of tiles)\n // which is equivalent to: 8 * 40075016.6855785 / (512 * pow(2, u_zoom))\n // which can be reduced to: pow(2, 19.25619978527 - u_zoom)\n // we want to vertically exaggerate the hillshading though, because otherwise\n // it is barely noticeable at low zooms. to do this, we multiply this by some\n // scale factor pow(2, (u_zoom - u_maxzoom) * a) where a is an arbitrary value\n // Here we use a=0.3 which works out to the expression below. see \n // nickidlugash's awesome breakdown for more info\n // https://github.com/mapbox/mapbox-gl-js/pull/5286#discussion_r148419556\n float exaggeration = u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;\n\n vec2 deriv = vec2(\n (c + f + f + i) - (a + d + d + g),\n (g + h + h + i) - (a + b + b + c)\n ) / pow(2.0, (u_zoom - u_maxzoom) * exaggeration + 19.2562 - u_zoom);\n\n gl_FragColor = clamp(vec4(\n deriv.x / 2.0 + 0.5,\n deriv.y / 2.0 + 0.5,\n 1.0,\n 1.0), 0.0, 1.0);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (a_texture_pos / 8192.0) / 2.0 + 0.25;\n}\n"},hillshade:{fragmentSource:"uniform sampler2D u_image;\nvarying vec2 v_pos;\n\nuniform vec2 u_latrange;\nuniform vec2 u_light;\nuniform vec4 u_shadow;\nuniform vec4 u_highlight;\nuniform vec4 u_accent;\n\n#define PI 3.141592653589793\n\nvoid main() {\n vec4 pixel = texture2D(u_image, v_pos);\n\n vec2 deriv = ((pixel.rg * 2.0) - 1.0);\n\n // We divide the slope by a scale factor based on the cosin of the pixel's approximate latitude\n // to account for mercator projection distortion. see #4807 for details\n float scaleFactor = cos(radians((u_latrange[0] - u_latrange[1]) * (1.0 - v_pos.y) + u_latrange[1]));\n // We also multiply the slope by an arbitrary z-factor of 1.25\n float slope = atan(1.25 * length(deriv) / scaleFactor);\n float aspect = deriv.x != 0.0 ? atan(deriv.y, -deriv.x) : PI / 2.0 * (deriv.y > 0.0 ? 1.0 : -1.0);\n\n float intensity = u_light.x;\n // We add PI to make this property match the global light object, which adds PI/2 to the light's azimuthal\n // position property to account for 0deg corresponding to north/the top of the viewport in the style spec\n // and the original shader was written to accept (-illuminationDirection - 90) as the azimuthal.\n float azimuth = u_light.y + PI;\n\n // We scale the slope exponentially based on intensity, using a calculation similar to\n // the exponential interpolation function in the style spec:\n // https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/expression/definitions/interpolate.js#L217-L228\n // so that higher intensity values create more opaque hillshading.\n float base = 1.875 - intensity * 1.75;\n float maxValue = 0.5 * PI;\n float scaledSlope = intensity != 0.5 ? ((pow(base, slope) - 1.0) / (pow(base, maxValue) - 1.0)) * maxValue : slope;\n\n // The accent color is calculated with the cosine of the slope while the shade color is calculated with the sine\n // so that the accent color's rate of change eases in while the shade color's eases out.\n float accent = cos(scaledSlope);\n // We multiply both the accent and shade color by a clamped intensity value\n // so that intensities >= 0.5 do not additionally affect the color values\n // while intensity values < 0.5 make the overall color more transparent.\n vec4 accent_color = (1.0 - accent) * u_accent * clamp(intensity * 2.0, 0.0, 1.0);\n float shade = abs(mod((aspect + azimuth) / PI + 0.5, 2.0) - 1.0);\n vec4 shade_color = mix(u_shadow, u_highlight, shade) * sin(scaledSlope) * clamp(intensity * 2.0, 0.0, 1.0);\n gl_FragColor = accent_color * (1.0 - shade_color.a) + shade_color;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = a_texture_pos / 8192.0;\n}\n"},line:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\nvarying highp float v_linesofar;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float width\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n v_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * 2.0;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n}\n"},lineGradient:{fragmentSource:"\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nuniform sampler2D u_image;\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\nvarying highp float v_lineprogress;\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n // For gradient lines, v_lineprogress is the ratio along the entire line,\n // scaled to [0, 2^15), and the gradient ramp is stored in a texture.\n vec4 color = texture2D(u_image, vec2(v_lineprogress, 0.5));\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n// the attribute conveying progress along a line is scaled to [0, 2^15)\n#define MAX_LINE_DISTANCE 32767.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\nvarying highp float v_lineprogress;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float width\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n v_lineprogress = (floor(a_data.z / 4.0) + a_data.w * 64.0) * 2.0 / MAX_LINE_DISTANCE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n}\n"},linePattern:{fragmentSource:"uniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_fade;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n\n // v_normal.y is 0 at the midpoint of the line, -1 at the lower edge, 1 at the upper edge\n // we clamp the line width outset to be between 0 and half the pattern height plus padding (2.0)\n // to ensure we don't sample outside the designated symbol on the sprite sheet.\n // 0.5 is added to shift the component to be bounded between 0 and 1 for interpolation of\n // the texture coordinate\n float y_a = 0.5 + (v_normal.y * clamp(v_width2.s, 0.0, (u_pattern_size_a.y + 2.0) / 2.0) / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * clamp(v_width2.s, 0.0, (u_pattern_size_b.y + 2.0) / 2.0) / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n gl_FragColor = color * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize mediump float width\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_linesofar = a_linesofar;\n v_width2 = vec2(outset, inset);\n}\n"},lineSDF:{fragmentSource:"\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float width\n #pragma mapbox: initialize lowp float floorwidth\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma / floorwidth, 0.5 + u_sdfgamma / floorwidth, sdfdist);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float width\n #pragma mapbox: initialize lowp float floorwidth\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist =outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x / floorwidth, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x / floorwidth, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n v_width2 = vec2(outset, inset);\n}\n"},raster:{fragmentSource:"uniform float u_fade_t;\nuniform float u_opacity;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n if (color0.a > 0.0) {\n color0.rgb = color0.rgb / color0.a;\n }\n if (color1.a > 0.0) {\n color1.rgb = color1.rgb / color1.a;\n }\n vec4 color = mix(color0, color1, u_fade_t);\n color.a *= u_opacity;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb) * color.a, color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n // We are using Int16 for texture position coordinates to give us enough precision for\n // fractional coordinates. We use 8192 to scale the texture coordinates in the buffer\n // as an arbitrarily high number to preserve adequate precision when rendering.\n // This is also the same value as the EXTENT we are using for our tile buffer pos coordinates,\n // so math for modifying either is consistent.\n v_pos0 = (((a_texture_pos / 8192.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},symbolIcon:{fragmentSource:"uniform sampler2D u_texture;\n\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_tex;\nvarying float v_fade_opacity;\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n lowp float alpha = opacity * v_fade_opacity;\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\nattribute float a_fade_opacity;\n\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\nuniform highp float u_camera_to_center_distance;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform float u_fade_change;\n\n#pragma mapbox: define lowp float opacity\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying float v_fade_opacity;\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 a_pos = a_pos_offset.xy;\n vec2 a_offset = a_pos_offset.zw;\n\n vec2 a_tex = a_data.xy;\n vec2 a_size = a_data.zw;\n\n highp float segment_angle = -a_projected_pos[2];\n\n float size;\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size[0], a_size[1], u_size_t) / 10.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size[0] / 10.0;\n } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n size = u_size;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // See comments in symbol_sdf.vertex\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = clamp(\n 0.5 + 0.5 * distance_ratio,\n 0.0, // Prevents oversized near-field symbols in pitched/overzoomed tiles\n 4.0);\n\n size *= perspective_ratio;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // See comments in symbol_sdf.vertex\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * fontScale), 0.0, 1.0);\n\n v_tex = a_tex / u_texsize;\n vec2 fade_opacity = unpack_opacity(a_fade_opacity);\n float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change;\n v_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change));\n}\n"},symbolSDF:{fragmentSource:"#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105/DEVICE_PIXEL_RATIO\n\nuniform bool u_is_halo;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n\nuniform sampler2D u_texture;\nuniform highp float u_gamma_scale;\nuniform bool u_is_text;\n\nvarying vec2 v_data0;\nvarying vec3 v_data1;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 fill_color\n #pragma mapbox: initialize highp vec4 halo_color\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float halo_width\n #pragma mapbox: initialize lowp float halo_blur\n\n vec2 tex = v_data0.xy;\n float gamma_scale = v_data1.x;\n float size = v_data1.y;\n float fade_opacity = v_data1[2];\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n lowp vec4 color = fill_color;\n highp float gamma = EDGE_GAMMA / (fontScale * u_gamma_scale);\n lowp float buff = (256.0 - 64.0) / 256.0;\n if (u_is_halo) {\n color = halo_color;\n gamma = (halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (fontScale * u_gamma_scale);\n buff = (6.0 - halo_width / fontScale) / SDF_PX;\n }\n\n lowp float dist = texture2D(u_texture, tex).a;\n highp float gamma_scaled = gamma * gamma_scale;\n highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);\n\n gl_FragColor = color * (alpha * opacity * fade_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\nattribute float a_fade_opacity;\n\n// contents of a_size vary based on the type of property value\n// used for {text,icon}-size.\n// For constants, a_size is disabled.\n// For source functions, we bind only one value per vertex: the value of {text,icon}-size evaluated for the current feature.\n// For composite functions:\n// [ text-size(lowerZoomStop, feature),\n// text-size(upperZoomStop, feature) ]\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\n\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform highp float u_camera_to_center_distance;\nuniform float u_fade_change;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_data0;\nvarying vec3 v_data1;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 fill_color\n #pragma mapbox: initialize highp vec4 halo_color\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float halo_width\n #pragma mapbox: initialize lowp float halo_blur\n\n vec2 a_pos = a_pos_offset.xy;\n vec2 a_offset = a_pos_offset.zw;\n\n vec2 a_tex = a_data.xy;\n vec2 a_size = a_data.zw;\n\n highp float segment_angle = -a_projected_pos[2];\n float size;\n\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size[0], a_size[1], u_size_t) / 10.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size[0] / 10.0;\n } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n size = u_size;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // If the label is pitched with the map, layout is done in pitched space,\n // which makes labels in the distance smaller relative to viewport space.\n // We counteract part of that effect by multiplying by the perspective ratio.\n // If the label isn't pitched with the map, we do layout in viewport space,\n // which makes labels in the distance larger relative to the features around\n // them. We counteract part of that effect by dividing by the perspective ratio.\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = clamp(\n 0.5 + 0.5 * distance_ratio,\n 0.0, // Prevents oversized near-field symbols in pitched/overzoomed tiles\n 4.0);\n\n size *= perspective_ratio;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // Point labels with 'rotation-alignment: map' are horizontal with respect to tile units\n // To figure out that angle in projected space, we draw a short horizontal line in tile\n // space, project it, and measure its angle in projected space.\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * fontScale), 0.0, 1.0);\n float gamma_scale = gl_Position.w;\n\n vec2 tex = a_tex / u_texsize;\n vec2 fade_opacity = unpack_opacity(a_fade_opacity);\n float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change;\n float interpolated_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change));\n\n v_data0 = vec2(tex.x, tex.y);\n v_data1 = vec3(gamma_scale, size, interpolated_fade_opacity);\n}\n"}},tr=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,er=function(t){var e=Qe[t],r={};e.fragmentSource=e.fragmentSource.replace(tr,function(t,e,n,i,a){return r[a]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nvarying "+n+" "+i+" "+a+";\n#else\nuniform "+n+" "+i+" u_"+a+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+a+"\n "+n+" "+i+" "+a+" = u_"+a+";\n#endif\n"}),e.vertexSource=e.vertexSource.replace(tr,function(t,e,n,i,a){var o="float"===i?"vec2":"vec4";return r[a]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float a_"+a+"_t;\nattribute "+n+" "+o+" a_"+a+";\nvarying "+n+" "+i+" "+a+";\n#else\nuniform "+n+" "+i+" u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+a+" = unpack_mix_"+o+"(a_"+a+", a_"+a+"_t);\n#else\n "+n+" "+i+" "+a+" = u_"+a+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float a_"+a+"_t;\nattribute "+n+" "+o+" a_"+a+";\n#else\nuniform "+n+" "+i+" u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+n+" "+i+" "+a+" = unpack_mix_"+o+"(a_"+a+", a_"+a+"_t);\n#else\n "+n+" "+i+" "+a+" = u_"+a+";\n#endif\n"})};for(var rr in Qe)er(rr);var nr=Qe,ir=function(t,e,r,n){var i=t.gl;this.program=i.createProgram();var o=r.defines().concat("#define DEVICE_PIXEL_RATIO "+a.devicePixelRatio.toFixed(1));n&&o.push("#define OVERDRAW_INSPECTOR;");var s=o.concat(nr.prelude.fragmentSource,e.fragmentSource).join("\n"),l=o.concat(nr.prelude.vertexSource,e.vertexSource).join("\n"),u=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(u,s),i.compileShader(u),i.attachShader(this.program,u);var c=i.createShader(i.VERTEX_SHADER);i.shaderSource(c,l),i.compileShader(c),i.attachShader(this.program,c);for(var f=r.layoutAttributes||[],h=0;h>16,s>>16),n.uniform2f(r.uniforms.u_pixel_coord_lower,65535&o,65535&s)};function mr(t,e,r,n,i){if(!dr(r.paint.get("fill-pattern"),t))for(var a=!0,o=0,s=n;o0){var l=a.now(),u=(l-e.timeAdded)/s,c=r?(l-r.timeAdded)/s:-1,f=n.getSource(),h=o.coveringZoomLevel({tileSize:f.tileSize,roundZoom:f.roundZoom}),p=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),d=p&&e.refreshedUponExpiration?1:t.clamp(p?u:1-c,0,1);return e.refreshedUponExpiration&&u>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return{opacity:1,mix:0}}function Sr(e,r,n){var i=e.context,o=i.gl;i.lineWidth.set(1*a.devicePixelRatio);var s=n.posMatrix,l=e.useProgram("debug");i.setDepthMode(Ht.disabled),i.setStencilMode(qt.disabled),i.setColorMode(e.colorModeForRenderPass()),o.uniformMatrix4fv(l.uniforms.u_matrix,!1,s),o.uniform4f(l.uniforms.u_color,1,0,0,1),e.debugVAO.bind(i,l,e.debugBuffer,[]),o.drawArrays(o.LINE_STRIP,0,e.debugBuffer.length);for(var u=function(t,e,r,n){n=n||1;var i,a,o,s,l,u,c,f,h=[];for(i=0,a=t.length;i":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]},Lr={symbol:function(t,e,r,n){if("translucent"===t.renderPass){var i=t.context;i.setStencilMode(qt.disabled),i.setColorMode(t.colorModeForRenderPass()),0!==r.paint.get("icon-opacity").constantOr(1)&&ur(t,e,r,n,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright")),0!==r.paint.get("text-opacity").constantOr(1)&&ur(t,e,r,n,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright")),e.map.showCollisionBoxes&&function(t,e,r,n){or(t,e,r,n,!1),or(t,e,r,n,!0)}(t,e,r,n)}},circle:function(t,e,r,n){if("translucent"===t.renderPass){var i=r.paint.get("circle-opacity"),a=r.paint.get("circle-stroke-width"),o=r.paint.get("circle-stroke-opacity");if(0!==i.constantOr(1)||0!==a.constantOr(1)&&0!==o.constantOr(1)){var s=t.context,l=s.gl;s.setDepthMode(t.depthModeForSublayer(0,Ht.ReadOnly)),s.setStencilMode(qt.disabled),s.setColorMode(t.colorModeForRenderPass());for(var u=!0,c=0;c0?1-1/(1.001-i):-i),s.uniform1f(u.uniforms.u_contrast_factor,(a=r.paint.get("raster-contrast"))>0?1/(1-a):1+a),s.uniform3fv(u.uniforms.u_spin_weights,function(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}(r.paint.get("raster-hue-rotate"))),s.uniform1f(u.uniforms.u_buffer_scale,1),s.uniform1i(u.uniforms.u_image0,0),s.uniform1i(u.uniforms.u_image1,1);for(var c=n.length&&n[0].overscaledZ,f=0,h=n;fe.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function Pr(t,e,r,n,i){var a=Math.max(r,Math.floor(e.y0)),o=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,f=e.dx<0,h=a;hl.dy&&(o=s,s=l,l=o),s.dy>u.dy&&(o=s,s=u,u=o),l.dy>u.dy&&(o=l,l=u,u=o),s.dy&&Pr(u,s,n,i,a),l.dy&&Pr(u,l,n,i,a)}Or.prototype.resize=function(t,e){var r=this.context.gl;if(this.width=t*a.devicePixelRatio,this.height=e*a.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,i=this.style._order;n=0;this.currentLayer--){var m=n.style._layers[s[n.currentLayer]];m.source!==(v&&v.id)&&(g=[],(v=n.style.sourceCaches[m.source])&&(n.clearStencil(),g=v.getVisibleCoordinates(),v.getSource().isTileClipped&&n._renderTileClippingMasks(g))),n.renderLayer(n,v,m,g)}this.renderPass="translucent";var y,x=[];for(this.currentLayer=0,this.currentLayer;this.currentLayer0?e.pop():null},Or.prototype._createProgramCached=function(t,e){this.cache=this.cache||{};var r=""+t+(e.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new ir(this.context,nr[t],e,this._showOverdrawInspector)),this.cache[r]},Or.prototype.useProgram=function(t,e){var r=this._createProgramCached(t,e||this.emptyProgramConfiguration);return this.context.program.set(r.program),r};var zr=t.default$20.vec4,Rr=t.default$20.mat4,Fr=t.default$20.mat2,Br=function(t,e,r){this.tileSize=512,this._renderWorldCopies=void 0===r||r,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new G(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._posMatrixCache={},this._alignedPosMatrixCache={}},Nr={minZoom:{configurable:!0},maxZoom:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerPoint:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},unmodified:{configurable:!0},x:{configurable:!0},y:{configurable:!0},point:{configurable:!0}};Br.prototype.clone=function(){var t=new Br(this._minZoom,this._maxZoom,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._calcMatrices(),t},Nr.minZoom.get=function(){return this._minZoom},Nr.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},Nr.maxZoom.get=function(){return this._maxZoom},Nr.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},Nr.renderWorldCopies.get=function(){return this._renderWorldCopies},Nr.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},Nr.worldSize.get=function(){return this.tileSize*this.scale},Nr.centerPoint.get=function(){return this.size._div(2)},Nr.size.get=function(){return new t.default$1(this.width,this.height)},Nr.bearing.get=function(){return-this.angle/Math.PI*180},Nr.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=Fr.create(),Fr.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Nr.pitch.get=function(){return this._pitch/Math.PI*180},Nr.pitch.set=function(e){var r=t.clamp(e,0,60)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},Nr.fov.get=function(){return this._fov/Math.PI*180},Nr.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},Nr.zoom.get=function(){return this._zoom},Nr.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},Nr.center.get=function(){return this._center},Nr.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},Br.prototype.coveringZoomLevel=function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},Br.prototype.getVisibleUnwrappedCoordinates=function(e){var r=this.pointCoordinate(new t.default$1(0,0),0),n=this.pointCoordinate(new t.default$1(this.width,0),0),i=Math.floor(r.column),a=Math.floor(n.column),o=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var s=i;s<=a;s++)0!==s&&o.push(new t.UnwrappedTileID(s,e));return o},Br.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&re.maxzoom&&(r=e.maxzoom);var i=this.pointCoordinate(this.centerPoint,r),a=new t.default$1(i.column-.5,i.row-.5);return function(e,r,n,i){void 0===i&&(i=!0);var a=1<=0&&l<=a)for(u=r;uo&&(i=o-v)}if(this.lngRange){var g=this.x,m=u.x/2;g-ml&&(n=l-m)}void 0===n&&void 0===i||(this.center=this.unproject(new t.default$1(void 0!==n?n:this.x,void 0!==i?i:this.y))),this._unmodified=c,this._constraining=!1}},Br.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var t=this._fov/2,e=Math.PI/2+this._pitch,r=Math.sin(t)*this.cameraToCenterDistance/Math.sin(Math.PI-e-t),n=this.x,i=this.y,a=1.01*(Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance),o=new Float64Array(16);Rr.perspective(o,this._fov,this.width/this.height,1,a),Rr.scale(o,o,[1,-1,1]),Rr.translate(o,o,[0,0,-this.cameraToCenterDistance]),Rr.rotateX(o,o,this._pitch),Rr.rotateZ(o,o,this.angle),Rr.translate(o,o,[-n,-i,0]);var s=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));Rr.scale(o,o,[1,1,s,1]),this.projMatrix=o;var l=this.width%2/2,u=this.height%2/2,c=Math.cos(this.angle),f=Math.sin(this.angle),h=n-Math.round(n)+c*l+f*u,p=i-Math.round(i)+c*u+f*l,d=new Float64Array(o);if(Rr.translate(d,d,[h>.5?h-1:h,p>.5?p-1:p,0]),this.alignedProjMatrix=d,o=Rr.create(),Rr.scale(o,o,[this.width/2,-this.height/2,1]),Rr.translate(o,o,[1,-1,0]),this.pixelMatrix=Rr.multiply(new Float64Array(16),o,this.projMatrix),!(o=Rr.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=o,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Br.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.default$1(0,0)).zoomTo(this.zoom),r=[e.column*this.tileSize,e.row*this.tileSize,0,1];return zr.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},Object.defineProperties(Br.prototype,Nr);var jr=function(){var e,r,n,i;t.bindAll(["_onHashChange","_updateHash"],this),this._updateHash=(e=this._updateHashUnthrottled.bind(this),r=!1,n=0,i=function(){n=0,r&&(e(),n=setTimeout(i,300),r=!1)},function(){return r=!0,n||i(),n})};jr.prototype.addTo=function(e){return this._map=e,t.default.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},jr.prototype.remove=function(){return t.default.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},jr.prototype.getHashString=function(t){var e=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,n=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=Math.pow(10,n),a=Math.round(e.lng*i)/i,o=Math.round(e.lat*i)/i,s=this._map.getBearing(),l=this._map.getPitch(),u="";return u+=t?"#/"+a+"/"+o+"/"+r:"#"+r+"/"+o+"/"+a,(s||l)&&(u+="/"+Math.round(10*s)/10),l&&(u+="/"+Math.round(l)),u},jr.prototype._onHashChange=function(){var e=t.default.location.hash.replace("#","").split("/");return e.length>=3&&(this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:+(e[3]||0),pitch:+(e[4]||0)}),!0)},jr.prototype._updateHashUnthrottled=function(){var e=this.getHashString();t.default.history.replaceState(t.default.history.state,"",e)};var Vr=function(e){function r(r,n,i,a){void 0===a&&(a={});var o=s.mousePos(n.getCanvasContainer(),i),l=n.unproject(o);e.call(this,r,t.extend({point:o,lngLat:l,originalEvent:i},a)),this._defaultPrevented=!1,this.target=n}e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r;var n={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,n),r}(t.Event),Ur=function(e){function r(r,n,i){var a=s.touchPos(n.getCanvasContainer(),i),o=a.map(function(t){return n.unproject(t)}),l=a.reduce(function(t,e,r,n){return t.add(e.div(n.length))},new t.default$1(0,0)),u=n.unproject(l);e.call(this,r,{points:a,point:l,lngLats:o,lngLat:u,originalEvent:i}),this._defaultPrevented=!1}e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r;var n={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,n),r}(t.Event),Hr=function(t){function e(e,r,n){t.call(this,e,{originalEvent:n}),this._defaultPrevented=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(t.Event),qr=function(e){this._map=e,this._el=e.getCanvasContainer(),this._delta=0,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};qr.prototype.isEnabled=function(){return!!this._enabled},qr.prototype.isActive=function(){return!!this._active},qr.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},qr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},qr.prototype.onWheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.default.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=a.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this.isActive()||this._start(e)),e.preventDefault()}},qr.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(t)},qr.prototype._start=function(e){if(this._delta){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),this._active=!0,this._map.fire(new t.Event("movestart",{originalEvent:e})),this._map.fire(new t.Event("zoomstart",{originalEvent:e})),this._finishTimeout&&clearTimeout(this._finishTimeout);var r=s.mousePos(this._el,e);this._around=G.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(r)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame))}},qr.prototype._onScrollFrame=function(){var e=this;if(this._frameId=null,this.isActive()){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?1/450:.01,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var o="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(o*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var s=!1;if("wheel"===this._type){var l=Math.min((a.now()-this._lastWheelEventTime)/200,1),u=this._easing(l);r.zoom=t.number(this._startZoom,this._targetZoom,u),l<1?this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame)):s=!0}else r.zoom=this._targetZoom,s=!0;r.setLocationAtPoint(this._around,this._aroundPoint),this._map.fire(new t.Event("move",{originalEvent:this._lastWheelEvent})),this._map.fire(new t.Event("zoom",{originalEvent:this._lastWheelEvent})),s&&(this._active=!1,this._finishTimeout=setTimeout(function(){e._map.fire(new t.Event("zoomend",{originalEvent:e._lastWheelEvent})),e._map.fire(new t.Event("moveend",{originalEvent:e._lastWheelEvent})),delete e._targetZoom},200))}},qr.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(a.now()-n.start)/n.duration,o=n.easing(i+.01)-n.easing(i),s=.27/Math.sqrt(o*o+1e-4)*.01,l=Math.sqrt(.0729-s*s);r=t.bezier(s,l,.25,1)}return this._prevEase={start:a.now(),duration:e,easing:r},r};var Gr=function(e){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),t.bindAll(["_onMouseMove","_onMouseUp","_onKeyDown"],this)};Gr.prototype.isEnabled=function(){return!!this._enabled},Gr.prototype.isActive=function(){return!!this._active},Gr.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Gr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Gr.prototype.onMouseDown=function(e){this.isEnabled()&&e.shiftKey&&0===e.button&&(t.default.document.addEventListener("mousemove",this._onMouseMove,!1),t.default.document.addEventListener("keydown",this._onKeyDown,!1),t.default.document.addEventListener("mouseup",this._onMouseUp,!1),s.disableDrag(),this._startPos=s.mousePos(this._el,e),this._active=!0)},Gr.prototype._onMouseMove=function(t){var e=this._startPos,r=s.mousePos(this._el,t);this._box||(this._box=s.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(e.x,r.x),i=Math.max(e.x,r.x),a=Math.min(e.y,r.y),o=Math.max(e.y,r.y);s.setTransform(this._box,"translate("+n+"px,"+a+"px)"),this._box.style.width=i-n+"px",this._box.style.height=o-a+"px"},Gr.prototype._onMouseUp=function(e){if(0===e.button){var r=this._startPos,n=s.mousePos(this._el,e),i=(new W).extend(this._map.unproject(r)).extend(this._map.unproject(n));this._finish(),s.suppressClick(),r.x===n.x&&r.y===n.y?this._fireEvent("boxzoomcancel",e):this._map.fitBounds(i,{linear:!0}).fire(new t.Event("boxzoomend",{originalEvent:e,boxZoomBounds:i}))}},Gr.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},Gr.prototype._finish=function(){this._active=!1,t.default.document.removeEventListener("mousemove",this._onMouseMove,!1),t.default.document.removeEventListener("keydown",this._onKeyDown,!1),t.default.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(s.remove(this._box),this._box=null),s.enableDrag()},Gr.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,{originalEvent:r}))};var Wr=t.bezier(0,0,.25,1),Yr=function(e,r){this._map=e,this._el=r.element||e.getCanvasContainer(),this._state="disabled",this._button=r.button||"right",this._bearingSnap=r.bearingSnap||0,this._pitchWithRotate=!1!==r.pitchWithRotate,t.bindAll(["_onMouseMove","_onMouseUp","_onBlur","_onDragFrame"],this)};Yr.prototype.isEnabled=function(){return"disabled"!==this._state},Yr.prototype.isActive=function(){return"active"===this._state},Yr.prototype.enable=function(){this.isEnabled()||(this._state="enabled")},Yr.prototype.disable=function(){if(this.isEnabled())switch(this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend"),this._pitchWithRotate&&this._fireEvent("pitchend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},Yr.prototype.onMouseDown=function(e){if("enabled"===this._state){if("right"===this._button){if(this._eventButton=s.mouseButton(e),this._eventButton!==(e.ctrlKey?0:2))return}else{if(e.ctrlKey||0!==s.mouseButton(e))return;this._eventButton=0}s.disableDrag(),t.default.document.addEventListener("mousemove",this._onMouseMove,{capture:!0}),t.default.document.addEventListener("mouseup",this._onMouseUp),t.default.addEventListener("blur",this._onBlur),this._state="pending",this._inertia=[[a.now(),this._map.getBearing()]],this._previousPos=s.mousePos(this._el,e),this._center=this._map.transform.centerPoint,e.preventDefault()}},Yr.prototype._onMouseMove=function(t){this._lastMoveEvent=t,this._pos=s.mousePos(this._el,t),"pending"===this._state&&(this._state="active",this._fireEvent("rotatestart",t),this._fireEvent("movestart",t),this._pitchWithRotate&&this._fireEvent("pitchstart",t)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame))},Yr.prototype._onDragFrame=function(){this._frameId=null;var t=this._lastMoveEvent;if(t){var e=this._map.transform,r=this._previousPos,n=this._pos,i=.8*(r.x-n.x),o=-.5*(r.y-n.y),s=e.bearing-i,l=e.pitch-o,u=this._inertia,c=u[u.length-1];this._drainInertiaBuffer(),u.push([a.now(),this._map._normalizeBearing(s,c[1])]),e.bearing=s,this._pitchWithRotate&&(this._fireEvent("pitch",t),e.pitch=l),this._fireEvent("rotate",t),this._fireEvent("move",t),delete this._lastMoveEvent,this._previousPos=this._pos}},Yr.prototype._onMouseUp=function(t){if(s.mouseButton(t)===this._eventButton)switch(this._state){case"active":this._state="enabled",s.suppressClick(),this._unbind(),this._deactivate(),this._inertialRotate(t);break;case"pending":this._state="enabled",this._unbind()}},Yr.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend",t),this._pitchWithRotate&&this._fireEvent("pitchend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind()}},Yr.prototype._unbind=function(){t.default.document.removeEventListener("mousemove",this._onMouseMove,{capture:!0}),t.default.document.removeEventListener("mouseup",this._onMouseUp),t.default.removeEventListener("blur",this._onBlur),s.enableDrag()},Yr.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._previousPos},Yr.prototype._inertialRotate=function(t){var e=this;this._fireEvent("rotateend",t),this._drainInertiaBuffer();var r=this._map,n=r.getBearing(),i=this._inertia,a=function(){Math.abs(n)180&&(p=180);var d=p/180;u+=f*p*(d/2),Math.abs(r._normalizeBearing(u,0))0&&e-t[0][0]>160;)t.shift()};var Xr=t.bezier(0,0,.3,1),Zr=function(e){this._map=e,this._el=e.getCanvasContainer(),this._state="disabled",t.bindAll(["_onMove","_onMouseUp","_onTouchEnd","_onBlur","_onDragFrame"],this)};Zr.prototype.isEnabled=function(){return"disabled"!==this._state},Zr.prototype.isActive=function(){return"active"===this._state},Zr.prototype.enable=function(){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._state="enabled")},Zr.prototype.disable=function(){if(this.isEnabled())switch(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("dragend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},Zr.prototype.onMouseDown=function(e){"enabled"===this._state&&(e.ctrlKey||0!==s.mouseButton(e)||(s.addEventListener(t.default.document,"mousemove",this._onMove,{capture:!0}),s.addEventListener(t.default.document,"mouseup",this._onMouseUp),this._start(e)))},Zr.prototype.onTouchStart=function(e){"enabled"===this._state&&(e.touches.length>1||(s.addEventListener(t.default.document,"touchmove",this._onMove,{capture:!0,passive:!1}),s.addEventListener(t.default.document,"touchend",this._onTouchEnd),this._start(e)))},Zr.prototype._start=function(e){t.default.addEventListener("blur",this._onBlur),this._state="pending",this._previousPos=s.mousePos(this._el,e),this._inertia=[[a.now(),this._previousPos]]},Zr.prototype._onMove=function(t){this._lastMoveEvent=t,t.preventDefault(),this._pos=s.mousePos(this._el,t),this._drainInertiaBuffer(),this._inertia.push([a.now(),this._pos]),"pending"===this._state&&(this._state="active",this._fireEvent("dragstart",t),this._fireEvent("movestart",t)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame))},Zr.prototype._onDragFrame=function(){this._frameId=null;var t=this._lastMoveEvent;if(t){var e=this._map.transform;e.setLocationAtPoint(e.pointLocation(this._previousPos),this._pos),this._fireEvent("drag",t),this._fireEvent("move",t),this._previousPos=this._pos,delete this._lastMoveEvent}},Zr.prototype._onMouseUp=function(t){if(0===s.mouseButton(t))switch(this._state){case"active":this._state="enabled",s.suppressClick(),this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind()}},Zr.prototype._onTouchEnd=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind()}},Zr.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("dragend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind()}},Zr.prototype._unbind=function(){s.removeEventListener(t.default.document,"touchmove",this._onMove,{capture:!0,passive:!1}),s.removeEventListener(t.default.document,"touchend",this._onTouchEnd),s.removeEventListener(t.default.document,"mousemove",this._onMove,{capture:!0}),s.removeEventListener(t.default.document,"mouseup",this._onMouseUp),s.removeEventListener(t.default,"blur",this._onBlur)},Zr.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._previousPos,delete this._pos},Zr.prototype._inertialPan=function(t){this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=this._inertia;if(e.length<2)this._fireEvent("moveend",t);else{var r=e[e.length-1],n=e[0],i=r[1].sub(n[1]),a=(r[0]-n[0])/1e3;if(0===a||r[1].equals(n[1]))this._fireEvent("moveend",t);else{var o=i.mult(.3/a),s=o.mag();s>1400&&(s=1400,o._unit()._mult(s));var l=s/750,u=o.mult(-l/2);this._map.panBy(u,{duration:1e3*l,easing:Xr,noMoveStart:!0},{originalEvent:t})}}},Zr.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,r?{originalEvent:r}:{}))},Zr.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=a.now();t.length>0&&e-t[0][0]>160;)t.shift()};var $r=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onKeyDown"],this)};function Jr(t){return t*(2-t)}$r.prototype.isEnabled=function(){return!!this._enabled},$r.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},$r.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},$r.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,r=0,n=0,i=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),i=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),i=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?n=-1:(a=1,t.preventDefault());break;default:return}var o=this._map,s=o.getZoom(),l={duration:300,delayEndEvents:500,easing:Jr,zoom:e?Math.round(s)+e*(t.shiftKey?2:1):s,bearing:o.getBearing()+15*r,pitch:o.getPitch()+10*n,offset:[100*-i,100*-a],center:o.getCenter()};o.easeTo(l,{originalEvent:t})}};var Kr=function(e){this._map=e,t.bindAll(["_onDblClick","_onZoomEnd"],this)};Kr.prototype.isEnabled=function(){return!!this._enabled},Kr.prototype.isActive=function(){return!!this._active},Kr.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Kr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Kr.prototype.onTouchStart=function(t){var e=this;this.isEnabled()&&(t.points.length>1||(this._tapped?(clearTimeout(this._tapped),this._tapped=null,this._zoom(t)):this._tapped=setTimeout(function(){e._tapped=null},300)))},Kr.prototype.onDblClick=function(t){this.isEnabled()&&(t.originalEvent.preventDefault(),this._zoom(t))},Kr.prototype._zoom=function(t){this._active=!0,this._map.on("zoomend",this._onZoomEnd),this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)},Kr.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd)};var Qr=t.bezier(0,0,.15,1),tn=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onMove","_onEnd","_onTouchFrame"],this)};tn.prototype.isEnabled=function(){return!!this._enabled},tn.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)},tn.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._enabled=!1)},tn.prototype.disableRotation=function(){this._rotationDisabled=!0},tn.prototype.enableRotation=function(){this._rotationDisabled=!1},tn.prototype.onStart=function(e){if(this.isEnabled()&&2===e.touches.length){var r=s.mousePos(this._el,e.touches[0]),n=s.mousePos(this._el,e.touches[1]);this._startVec=r.sub(n),this._gestureIntent=void 0,this._inertia=[],s.addEventListener(t.default.document,"touchmove",this._onMove,{passive:!1}),s.addEventListener(t.default.document,"touchend",this._onEnd)}},tn.prototype._getTouchEventData=function(t){var e=s.mousePos(this._el,t.touches[0]),r=s.mousePos(this._el,t.touches[1]),n=e.sub(r);return{vec:n,center:e.add(r).div(2),scale:n.mag()/this._startVec.mag(),bearing:this._rotationDisabled?0:180*n.angleWith(this._startVec)/Math.PI}},tn.prototype._onMove=function(e){if(2===e.touches.length){var r=this._getTouchEventData(e),n=r.vec,i=r.scale,a=r.bearing;if(!this._gestureIntent){var o=Math.abs(1-i)>.15;Math.abs(a)>10?this._gestureIntent="rotate":o&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._map.fire(new t.Event(this._gestureIntent+"start",{originalEvent:e})),this._map.fire(new t.Event("movestart",{originalEvent:e})),this._startVec=n)}this._lastTouchEvent=e,this._frameId||(this._frameId=this._map._requestRenderFrame(this._onTouchFrame)),e.preventDefault()}},tn.prototype._onTouchFrame=function(){this._frameId=null;var e=this._gestureIntent;if(e){var r=this._map.transform;this._startScale||(this._startScale=r.scale,this._startBearing=r.bearing);var n=this._getTouchEventData(this._lastTouchEvent),i=n.center,o=n.bearing,s=n.scale,l=r.pointLocation(i),u=r.locationPoint(l);"rotate"===e&&(r.bearing=this._startBearing+o),r.zoom=r.scaleZoom(this._startScale*s),r.setLocationAtPoint(l,u),this._map.fire(new t.Event(e,{originalEvent:this._lastTouchEvent})),this._map.fire(new t.Event("move",{originalEvent:this._lastTouchEvent})),this._drainInertiaBuffer(),this._inertia.push([a.now(),s,i])}},tn.prototype._onEnd=function(e){s.removeEventListener(t.default.document,"touchmove",this._onMove,{passive:!1}),s.removeEventListener(t.default.document,"touchend",this._onEnd);var r=this._gestureIntent,n=this._startScale;if(this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._gestureIntent,delete this._startScale,delete this._startBearing,delete this._lastTouchEvent,r){this._map.fire(new t.Event(r+"end",{originalEvent:e})),this._drainInertiaBuffer();var i=this._inertia,a=this._map;if(i.length<2)a.snapToNorth({},{originalEvent:e});else{var o=i[i.length-1],l=i[0],u=a.transform.scaleZoom(n*o[1]),c=a.transform.scaleZoom(n*l[1]),f=u-c,h=(o[0]-l[0])/1e3,p=o[2];if(0!==h&&u!==c){var d=.15*f/h;Math.abs(d)>2.5&&(d=d>0?2.5:-2.5);var v=1e3*Math.abs(d/(12*.15)),g=u+d*v/2e3;g<0&&(g=0),a.easeTo({zoom:g,duration:v,easing:Qr,around:this._aroundCenter?a.getCenter():a.unproject(p),noMoveStart:!0},{originalEvent:e})}else a.snapToNorth({},{originalEvent:e})}}},tn.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=a.now();t.length>2&&e-t[0][0]>160;)t.shift()};var en={scrollZoom:qr,boxZoom:Gr,dragRotate:Yr,dragPan:Zr,keyboard:$r,doubleClickZoom:Kr,touchZoomRotate:tn},rn=function(e){function r(r,n){e.call(this),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=n.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getCenter=function(){return this.transform.center},r.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},r.prototype.panBy=function(e,r,n){return e=t.default$1.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},r),n)},r.prototype.panTo=function(e,r,n){return this.easeTo(t.extend({center:e},r),n)},r.prototype.getZoom=function(){return this.transform.zoom},r.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},r.prototype.zoomTo=function(e,r,n){return this.easeTo(t.extend({zoom:e},r),n)},r.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},r.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},r.prototype.getBearing=function(){return this.transform.bearing},r.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},r.prototype.rotateTo=function(e,r,n){return this.easeTo(t.extend({bearing:e},r),n)},r.prototype.resetNorth=function(e,r){return this.rotateTo(0,t.extend({duration:1e3},e),r),this},r.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())e?1:0}),["bottom","left","right","top"]))return t.warnOnce("options.padding must be a positive number, or an Object with keys 'bottom', 'left', 'right', 'top'"),this;e=W.convert(e);var a=[(r.padding.left-r.padding.right)/2,(r.padding.top-r.padding.bottom)/2],o=Math.min(r.padding.right,r.padding.left),s=Math.min(r.padding.top,r.padding.bottom);r.offset=[r.offset[0]+a[0],r.offset[1]+a[1]];var l=t.default$1.convert(r.offset),u=this.transform,c=u.project(e.getNorthWest()),f=u.project(e.getSouthEast()),h=f.sub(c),p=(u.width-2*o-2*Math.abs(l.x))/h.x,d=(u.height-2*s-2*Math.abs(l.y))/h.y;return d<0||p<0?(t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset."),this):(r.center=u.unproject(c.add(f).div(2)),r.zoom=Math.min(u.scaleZoom(u.scale*Math.min(p,d)),r.maxZoom),r.bearing=0,r.linear?this.easeTo(r,n):this.flyTo(r,n))},r.prototype.jumpTo=function(e,r){this.stop();var n=this.transform,i=!1,a=!1,o=!1;return"zoom"in e&&n.zoom!==+e.zoom&&(i=!0,n.zoom=+e.zoom),void 0!==e.center&&(n.center=G.convert(e.center)),"bearing"in e&&n.bearing!==+e.bearing&&(a=!0,n.bearing=+e.bearing),"pitch"in e&&n.pitch!==+e.pitch&&(o=!0,n.pitch=+e.pitch),this.fire(new t.Event("movestart",r)).fire(new t.Event("move",r)),i&&this.fire(new t.Event("zoomstart",r)).fire(new t.Event("zoom",r)).fire(new t.Event("zoomend",r)),a&&this.fire(new t.Event("rotatestart",r)).fire(new t.Event("rotate",r)).fire(new t.Event("rotateend",r)),o&&this.fire(new t.Event("pitchstart",r)).fire(new t.Event("pitch",r)).fire(new t.Event("pitchend",r)),this.fire(new t.Event("moveend",r))},r.prototype.easeTo=function(e,r){var n=this;this.stop(),!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate&&(e.duration=0);var i=this.transform,a=this.getZoom(),o=this.getBearing(),s=this.getPitch(),l="zoom"in e?+e.zoom:a,u="bearing"in e?this._normalizeBearing(e.bearing,o):o,c="pitch"in e?+e.pitch:s,f=i.centerPoint.add(t.default$1.convert(e.offset)),h=i.pointLocation(f),p=G.convert(e.center||h);this._normalizeCenter(p);var d,v,g=i.project(h),m=i.project(p).sub(g),y=i.zoomScale(l-a);return e.around&&(d=G.convert(e.around),v=i.locationPoint(d)),this._zooming=l!==a,this._rotating=o!==u,this._pitching=c!==s,this._prepareEase(r,e.noMoveStart),clearTimeout(this._easeEndTimeoutID),this._ease(function(e){if(n._zooming&&(i.zoom=t.number(a,l,e)),n._rotating&&(i.bearing=t.number(o,u,e)),n._pitching&&(i.pitch=t.number(s,c,e)),d)i.setLocationAtPoint(d,v);else{var h=i.zoomScale(i.zoom-a),p=l>a?Math.min(2,y):Math.max(.5,y),x=Math.pow(p,1-e),b=i.unproject(g.add(m.mult(e*x)).mult(h));i.setLocationAtPoint(i.renderWorldCopies?b.wrap():b,f)}n._fireMoveEvents(r)},function(){e.delayEndEvents?n._easeEndTimeoutID=setTimeout(function(){return n._afterEase(r)},e.delayEndEvents):n._afterEase(r)},e),this},r.prototype._prepareEase=function(e,r){this._moving=!0,r||this.fire(new t.Event("movestart",e)),this._zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e){var r=this._zooming,n=this._rotating,i=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,r&&this.fire(new t.Event("zoomend",e)),n&&this.fire(new t.Event("rotateend",e)),i&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))},r.prototype.flyTo=function(e,r){var n=this;this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var i=this.transform,a=this.getZoom(),o=this.getBearing(),s=this.getPitch(),l="zoom"in e?t.clamp(+e.zoom,i.minZoom,i.maxZoom):a,u="bearing"in e?this._normalizeBearing(e.bearing,o):o,c="pitch"in e?+e.pitch:s,f=i.zoomScale(l-a),h=i.centerPoint.add(t.default$1.convert(e.offset)),p=i.pointLocation(h),d=G.convert(e.center||p);this._normalizeCenter(d);var v=i.project(p),g=i.project(d).sub(v),m=e.curve,y=Math.max(i.width,i.height),x=y/f,b=g.mag();if("minZoom"in e){var _=t.clamp(Math.min(e.minZoom,a,l),i.minZoom,i.maxZoom),w=y/i.zoomScale(_-a);m=Math.sqrt(w/b*2)}var k=m*m;function A(t){var e=(x*x-y*y+(t?-1:1)*k*k*b*b)/(2*(t?x:y)*k*b);return Math.log(Math.sqrt(e*e+1)-e)}function T(t){return(Math.exp(t)-Math.exp(-t))/2}function M(t){return(Math.exp(t)+Math.exp(-t))/2}var E=A(0),S=function(t){return M(E)/M(E+m*t)},C=function(t){return y*((M(E)*(T(e=E+m*t)/M(e))-T(E))/k)/b;var e},L=(A(1)-E)/m;if(Math.abs(b)<1e-6||!isFinite(L)){if(Math.abs(y-x)<1e-6)return this.easeTo(e,r);var O=xe.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=o!==u,this._pitching=c!==s,this._prepareEase(r,!1),this._ease(function(e){var l=e*L,f=1/S(l);i.zoom=a+i.scaleZoom(f),n._rotating&&(i.bearing=t.number(o,u,e)),n._pitching&&(i.pitch=t.number(s,c,e));var p=i.unproject(v.add(g.mult(C(l))).mult(f));i.setLocationAtPoint(i.renderWorldCopies?p.wrap():p,h),n._fireMoveEvents(r)},function(){return n._afterEase(r)},e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var t=this._onEaseEnd;delete this._onEaseEnd,t.call(this)}return this},r.prototype._ease=function(t,e,r){!1===r.animate||0===r.duration?(t(1),e()):(this._easeStart=a.now(),this._easeOptions=r,this._onEaseFrame=t,this._onEaseEnd=e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var t=Math.min((a.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)180?-360:r<-180?360:0}},r}(t.Evented),nn=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};nn.prototype.getDefaultPosition=function(){return"bottom-right"},nn.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=s.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},nn.prototype.onRemove=function(){s.remove(this._container),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0},nn.prototype._updateEditLink=function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var e=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:g.ACCESS_TOKEN}];if(t){var r=e.reduce(function(t,r,n){return r.value&&(t+=r.key+"="+r.value+(n=0)return!1;return!0})).length?(this._container.innerHTML=t.join(" | "),this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null}},nn.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var an=function(){t.bindAll(["_updateLogo"],this)};an.prototype.onAdd=function(t){this._map=t,this._container=s.create("div","mapboxgl-ctrl");var e=s.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.href="https://www.mapbox.com/",e.setAttribute("aria-label","Mapbox logo"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._container},an.prototype.onRemove=function(){s.remove(this._container),this._map.off("sourcedata",this._updateLogo)},an.prototype.getDefaultPosition=function(){return"bottom-left"},an.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},an.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}};var on=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};on.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},on.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;re.maxZoom)throw new Error("maxZoom must be greater than minZoom");var n=new Br(e.minZoom,e.maxZoom,e.renderWorldCopies);r.call(this,n,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new on;var i=e.transformRequest;if(this._transformRequest=i?function(t,e){return i(t,e)||{url:t}}:function(t){return{url:t}},"string"==typeof e.container){var a=t.default.document.getElementById(e.container);if(!a)throw new Error("Container '"+e.container+"' not found.");this._container=a}else{if(!(e.container instanceof ln))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored","_update","_render","_onData","_onDataLoading"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),void 0!==t.default&&(t.default.addEventListener("online",this._onWindowOnline,!1),t.default.addEventListener("resize",this._onWindowResize,!1)),function(t,e){var r=t.getCanvasContainer(),n=null,i=!1;for(var a in en)t[a]=new en[a](t,e),e.interactive&&e[a]&&t[a].enable(e[a]);s.addEventListener(r,"mouseout",function(e){t.fire(new Vr("mouseout",t,e))}),s.addEventListener(r,"mousedown",function(r){i=!0;var n=new Vr("mousedown",t,r);t.fire(n),n.defaultPrevented||(e.interactive&&!t.doubleClickZoom.isActive()&&t.stop(),t.boxZoom.onMouseDown(r),t.boxZoom.isActive()||t.dragPan.isActive()||t.dragRotate.onMouseDown(r),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onMouseDown(r))}),s.addEventListener(r,"mouseup",function(e){var r=t.dragRotate.isActive();n&&!r&&t.fire(new Vr("contextmenu",t,n)),n=null,i=!1,t.fire(new Vr("mouseup",t,e))}),s.addEventListener(r,"mousemove",function(e){if(!t.dragPan.isActive()&&!t.dragRotate.isActive()){for(var n=e.toElement||e.target;n&&n!==r;)n=n.parentNode;n===r&&t.fire(new Vr("mousemove",t,e))}}),s.addEventListener(r,"mouseover",function(e){for(var n=e.toElement||e.target;n&&n!==r;)n=n.parentNode;n===r&&t.fire(new Vr("mouseover",t,e))}),s.addEventListener(r,"touchstart",function(r){var n=new Ur("touchstart",t,r);t.fire(n),n.defaultPrevented||(e.interactive&&t.stop(),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onTouchStart(r),t.touchZoomRotate.onStart(r),t.doubleClickZoom.onTouchStart(n))},{passive:!1}),s.addEventListener(r,"touchmove",function(e){t.fire(new Ur("touchmove",t,e))},{passive:!1}),s.addEventListener(r,"touchend",function(e){t.fire(new Ur("touchend",t,e))}),s.addEventListener(r,"touchcancel",function(e){t.fire(new Ur("touchcancel",t,e))}),s.addEventListener(r,"click",function(e){t.fire(new Vr("click",t,e))}),s.addEventListener(r,"dblclick",function(e){var r=new Vr("dblclick",t,e);t.fire(r),r.defaultPrevented||t.doubleClickZoom.onDblClick(r)}),s.addEventListener(r,"contextmenu",function(e){var r=t.dragRotate.isActive();i||r?i&&(n=e):t.fire(new Vr("contextmenu",t,e)),e.preventDefault()}),s.addEventListener(r,"wheel",function(e){var r=new Hr("wheel",t,e);t.fire(r),r.defaultPrevented||t.scrollZoom.onWheel(e)},{passive:!1})}(this,e),this._hash=e.hash&&(new jr).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),this.resize(),e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new nn),this.addControl(new an,e.logoPosition),this.on("style.load",function(){this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",this._onData),this.on("dataloading",this._onDataLoading)}r&&(n.__proto__=r),n.prototype=Object.create(r&&r.prototype),n.prototype.constructor=n;var i={showTileBoundaries:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0}};return n.prototype.addControl=function(t,e){void 0===e&&t.getDefaultPosition&&(e=t.getDefaultPosition()),void 0===e&&(e="top-right");var r=t.onAdd(this),n=this._controlPositions[e];return-1!==e.indexOf("bottom")?n.insertBefore(r,n.firstChild):n.appendChild(r),this},n.prototype.removeControl=function(t){return t.onRemove(this),this},n.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];return this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e)).fire(new t.Event("resize",e)).fire(new t.Event("moveend",e))},n.prototype.getBounds=function(){var e=new W(this.transform.pointLocation(new t.default$1(0,this.transform.height)),this.transform.pointLocation(new t.default$1(this.transform.width,0)));return(this.transform.angle||this.transform.pitch)&&(e.extend(this.transform.pointLocation(new t.default$1(this.transform.size.x,0))),e.extend(this.transform.pointLocation(new t.default$1(0,this.transform.size.y)))),e},n.prototype.getMaxBounds=function(){return this.transform.latRange&&2===this.transform.latRange.length&&this.transform.lngRange&&2===this.transform.lngRange.length?new W([this.transform.lngRange[0],this.transform.latRange[0]],[this.transform.lngRange[1],this.transform.latRange[1]]):null},n.prototype.setMaxBounds=function(t){if(t){var e=W.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null==t&&(this.transform.lngRange=null,this.transform.latRange=null,this._update());return this},n.prototype.setMinZoom=function(t){if((t=null==t?0:t)>=0&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},n.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},n.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update(),this},n.prototype.getMaxZoom=function(){return this.transform.maxZoom},n.prototype.project=function(t){return this.transform.locationPoint(G.convert(t))},n.prototype.unproject=function(e){return this.transform.pointLocation(t.default$1.convert(e))},n.prototype.isMoving=function(){return this._moving||this.dragPan.isActive()||this.dragRotate.isActive()||this.scrollZoom.isActive()},n.prototype.isZooming=function(){return this._zooming||this.scrollZoom.isActive()},n.prototype.isRotating=function(){return this._rotating||this.dragRotate.isActive()},n.prototype.on=function(t,e,n){var i,a=this;if(void 0===n)return r.prototype.on.call(this,t,e);var o=function(){if("mouseenter"===t||"mouseover"===t){var r=!1;return{layer:e,listener:n,delegates:{mousemove:function(i){var o=a.getLayer(e)?a.queryRenderedFeatures(i.point,{layers:[e]}):[];o.length?r||(r=!0,n.call(a,new Vr(t,a,i.originalEvent,{features:o}))):r=!1},mouseout:function(){r=!1}}}}if("mouseleave"===t||"mouseout"===t){var o=!1;return{layer:e,listener:n,delegates:{mousemove:function(r){(a.getLayer(e)?a.queryRenderedFeatures(r.point,{layers:[e]}):[]).length?o=!0:o&&(o=!1,n.call(a,new Vr(t,a,r.originalEvent)))},mouseout:function(e){o&&(o=!1,n.call(a,new Vr(t,a,e.originalEvent)))}}}}return{layer:e,listener:n,delegates:(i={},i[t]=function(t){var r=a.getLayer(e)?a.queryRenderedFeatures(t.point,{layers:[e]}):[];r.length&&(t.features=r,n.call(a,t),delete t.features)},i)}}();for(var s in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(o),o.delegates)a.on(s,o.delegates[s]);return this},n.prototype.off=function(t,e,n){if(void 0===n)return r.prototype.off.call(this,t,e);if(this._delegatedListeners&&this._delegatedListeners[t])for(var i=this._delegatedListeners[t],a=0;a180;){var o=r.locationPoint(t);if(o.x>=0&&o.y>=0&&o.x<=r.width&&o.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t}pn.prototype._rotateCompassArrow=function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t},pn.prototype.onAdd=function(t){return this._map=t,this.options.showCompass&&(this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Yr(t,{button:"left",element:this._compass}),this._handler.enable()),this._container},pn.prototype.onRemove=function(){s.remove(this._container),this.options.showCompass&&(this._map.off("rotate",this._rotateCompassArrow),this._handler.disable(),delete this._handler),delete this._map},pn.prototype._createButton=function(t,e,r){var n=s.create("button",t,this._container);return n.type="button",n.setAttribute("aria-label",e),n.addEventListener("click",r),n};var vn={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function gn(t,e,r){var n=t.classList;for(var i in vn)n.remove("mapboxgl-"+r+"-anchor-"+i);n.add("mapboxgl-"+r+"-anchor-"+e)}var mn=function(e){if((arguments[0]instanceof t.default.HTMLElement||2===arguments.length)&&(e=t.extend({element:e},arguments[1])),t.bindAll(["_update","_onMapClick"],this),this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",e&&e.element)this._element=e.element,this._offset=t.default$1.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=s.create("div");var r=s.createNS("http://www.w3.org/2000/svg","svg");r.setAttributeNS(null,"height","41px"),r.setAttributeNS(null,"width","27px"),r.setAttributeNS(null,"viewBox","0 0 27 41");var n=s.createNS("http://www.w3.org/2000/svg","g");n.setAttributeNS(null,"stroke","none"),n.setAttributeNS(null,"stroke-width","1"),n.setAttributeNS(null,"fill","none"),n.setAttributeNS(null,"fill-rule","evenodd");var i=s.createNS("http://www.w3.org/2000/svg","g");i.setAttributeNS(null,"fill-rule","nonzero");var a=s.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"transform","translate(3.0, 29.0)"),a.setAttributeNS(null,"fill","#000000");for(var o=0,l=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];o5280?An(e,u,h/5280,"mi"):An(e,u,h,"ft")}else r&&"nautical"===r.unit?An(e,u,f/1852,"nm"):An(e,u,f,"m")}function An(t,e,r,n){var i,a,o,s=(i=r,(a=Math.pow(10,(""+Math.floor(i)).length-1))*(o=(o=i/a)>=10?10:o>=5?5:o>=3?3:o>=2?2:1)),l=s/r;"m"===n&&s>=1e3&&(s/=1e3,n="km"),t.style.width=e*l+"px",t.innerHTML=s+n}wn.prototype.getDefaultPosition=function(){return"bottom-left"},wn.prototype._onMove=function(){kn(this._map,this._container,this.options)},wn.prototype.onAdd=function(t){return this._map=t,this._container=s.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},wn.prototype.onRemove=function(){s.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},wn.prototype.setUnit=function(t){this.options.unit=t,kn(this._map,this._container,this.options)};var Tn=function(){this._fullscreen=!1,t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.default.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.default.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.default.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.default.document&&(this._fullscreenchange="MSFullscreenChange"),this._className="mapboxgl-ctrl"};Tn.prototype.onAdd=function(e){return this._map=e,this._mapContainer=this._map.getContainer(),this._container=s.create("div",this._className+" mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._container.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._container},Tn.prototype.onRemove=function(){s.remove(this._container),this._map=null,t.default.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Tn.prototype._checkFullscreenSupport=function(){return!!(t.default.document.fullscreenEnabled||t.default.document.mozFullScreenEnabled||t.default.document.msFullscreenEnabled||t.default.document.webkitFullscreenEnabled)},Tn.prototype._setupUI=function(){var e=this._fullscreenButton=s.create("button",this._className+"-icon "+this._className+"-fullscreen",this._container);e.setAttribute("aria-label","Toggle fullscreen"),e.type="button",this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.default.document.addEventListener(this._fullscreenchange,this._changeIcon)},Tn.prototype._isFullscreen=function(){return this._fullscreen},Tn.prototype._changeIcon=function(){(t.default.document.fullscreenElement||t.default.document.mozFullScreenElement||t.default.document.webkitFullscreenElement||t.default.document.msFullscreenElement)===this._mapContainer!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle(this._className+"-shrink"),this._fullscreenButton.classList.toggle(this._className+"-fullscreen"))},Tn.prototype._onClickFullscreen=function(){this._isFullscreen()?t.default.document.exitFullscreen?t.default.document.exitFullscreen():t.default.document.mozCancelFullScreen?t.default.document.mozCancelFullScreen():t.default.document.msExitFullscreen?t.default.document.msExitFullscreen():t.default.document.webkitCancelFullScreen&&t.default.document.webkitCancelFullScreen():this._mapContainer.requestFullscreen?this._mapContainer.requestFullscreen():this._mapContainer.mozRequestFullScreen?this._mapContainer.mozRequestFullScreen():this._mapContainer.msRequestFullscreen?this._mapContainer.msRequestFullscreen():this._mapContainer.webkitRequestFullscreen&&this._mapContainer.webkitRequestFullscreen()};var Mn={closeButton:!0,closeOnClick:!0},En=function(e){function r(r){e.call(this),this.options=t.extend(Object.create(Mn),r),t.bindAll(["_update","_onClickClose"],this)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.addTo=function(e){return this._map=e,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this.fire(new t.Event("open")),this},r.prototype.isOpen=function(){return!!this._map},r.prototype.remove=function(){return this._content&&s.remove(this._content),this._container&&(s.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire(new t.Event("close")),this},r.prototype.getLngLat=function(){return this._lngLat},r.prototype.setLngLat=function(t){return this._lngLat=G.convert(t),this._pos=null,this._update(),this},r.prototype.setText=function(e){return this.setDOMContent(t.default.document.createTextNode(e))},r.prototype.setHTML=function(e){var r,n=t.default.document.createDocumentFragment(),i=t.default.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},r.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},r.prototype._createContent=function(){this._content&&s.remove(this._content),this._content=s.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=s.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},r.prototype._update=function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=s.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=s.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content)),this._map.transform.renderWorldCopies&&(this._lngLat=dn(this._lngLat,this._pos,this._map.transform));var e=this._pos=this._map.project(this._lngLat),r=this.options.anchor,n=function e(r){if(r){if("number"==typeof r){var n=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.default$1(0,0),top:new t.default$1(0,r),"top-left":new t.default$1(n,n),"top-right":new t.default$1(-n,n),bottom:new t.default$1(0,-r),"bottom-left":new t.default$1(n,-n),"bottom-right":new t.default$1(-n,-n),left:new t.default$1(r,0),right:new t.default$1(-r,0)}}if(r instanceof t.default$1||Array.isArray(r)){var i=t.default$1.convert(r);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.default$1.convert(r.center||[0,0]),top:t.default$1.convert(r.top||[0,0]),"top-left":t.default$1.convert(r["top-left"]||[0,0]),"top-right":t.default$1.convert(r["top-right"]||[0,0]),bottom:t.default$1.convert(r.bottom||[0,0]),"bottom-left":t.default$1.convert(r["bottom-left"]||[0,0]),"bottom-right":t.default$1.convert(r["bottom-right"]||[0,0]),left:t.default$1.convert(r.left||[0,0]),right:t.default$1.convert(r.right||[0,0])}}return e(new t.default$1(0,0))}(this.options.offset);if(!r){var i,a=this._container.offsetWidth,o=this._container.offsetHeight;i=e.y+n.bottom.ythis._map.transform.height-o?["bottom"]:[],e.xthis._map.transform.width-a/2&&i.push("right"),r=0===i.length?"bottom":i.join("-")}var l=e.add(n[r]).round();s.setTransform(this._container,vn[r]+" translate("+l.x+"px,"+l.y+"px)"),gn(this._container,r,"popup")}},r.prototype._onClickClose=function(){this.remove()},r}(t.Evented),Sn={version:"0.45.0",supported:e,workerCount:Math.max(Math.floor(a.hardwareConcurrency/2),1),setRTLTextPlugin:t.setRTLTextPlugin,Map:cn,NavigationControl:pn,GeolocateControl:bn,AttributionControl:nn,ScaleControl:wn,FullscreenControl:Tn,Popup:En,Marker:mn,Style:Je,LngLat:G,LngLatBounds:W,Point:t.default$1,Evented:t.Evented,config:g,get accessToken(){return g.ACCESS_TOKEN},set accessToken(t){g.ACCESS_TOKEN=t},workerUrl:""};return Sn}),n})}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],422:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1<p[1][2]&&(m[0]=-m[0]),p[0][2]>p[2][0]&&(m[1]=-m[1]),p[1][0]>p[0][1]&&(m[2]=-m[2]),!0}},{"./normalize":424,"gl-mat4/clone":258,"gl-mat4/create":259,"gl-mat4/determinant":260,"gl-mat4/invert":264,"gl-mat4/transpose":275,"gl-vec3/cross":329,"gl-vec3/dot":334,"gl-vec3/length":344,"gl-vec3/normalize":351}],424:[function(t,e,r){e.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)t[i]=e[i]*n;return!0}},{}],425:[function(t,e,r){var n=t("gl-vec3/lerp"),i=t("mat4-recompose"),a=t("mat4-decompose"),o=t("gl-mat4/determinant"),s=t("quat-slerp"),l=f(),u=f(),c=f();function f(){return{translate:h(),scale:h(1),skew:h(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function h(t){return[t||0,t||0,t||0]}e.exports=function(t,e,r,f){if(0===o(e)||0===o(r))return!1;var h=a(e,l.translate,l.scale,l.skew,l.perspective,l.quaternion),p=a(r,u.translate,u.scale,u.skew,u.perspective,u.quaternion);return!(!h||!p||(n(c.translate,l.translate,u.translate,f),n(c.skew,l.skew,u.skew,f),n(c.scale,l.scale,u.scale,f),n(c.perspective,l.perspective,u.perspective,f),s(c.quaternion,l.quaternion,u.quaternion,f),i(t,c.translate,c.scale,c.skew,c.perspective,c.quaternion),0))}},{"gl-mat4/determinant":260,"gl-vec3/lerp":345,"mat4-decompose":423,"mat4-recompose":426,"quat-slerp":478}],426:[function(t,e,r){var n={identity:t("gl-mat4/identity"),translate:t("gl-mat4/translate"),multiply:t("gl-mat4/multiply"),create:t("gl-mat4/create"),scale:t("gl-mat4/scale"),fromRotationTranslation:t("gl-mat4/fromRotationTranslation")},i=(n.create(),n.create());e.exports=function(t,e,r,a,o,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=o[0],t[7]=o[1],t[11]=o[2],t[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(t,t,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(t,t,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},{"gl-mat4/create":259,"gl-mat4/fromRotationTranslation":262,"gl-mat4/identity":263,"gl-mat4/multiply":266,"gl-mat4/scale":273,"gl-mat4/translate":274}],427:[function(t,e,r){"use strict";e.exports=Math.log2||function(t){return Math.log(t)*Math.LOG2E}},{}],428:[function(t,e,r){"use strict";var n=t("binary-search-bounds"),i=t("mat4-interpolate"),a=t("gl-mat4/invert"),o=t("gl-mat4/rotateX"),s=t("gl-mat4/rotateY"),l=t("gl-mat4/rotateZ"),u=t("gl-mat4/lookAt"),c=t("gl-mat4/translate"),f=(t("gl-mat4/scale"),t("gl-vec3/normalize")),h=[0,0,0];function p(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}e.exports=function(t){return new p((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var d=p.prototype;d.recalcMatrix=function(t){var e=this._time,r=n.le(e,t),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,u=0;u<16;++u)o[u]=s[l++];else{for(var c=e[r+1]-e[r],l=16*r,h=this.prevMatrix,p=!0,u=0;u<16;++u)h[u]=s[l++];for(var d=this.nextMatrix,u=0;u<16;++u)d[u]=s[l++],p=p&&h[u]===d[u];if(c<1e-6||p)for(var u=0;u<16;++u)o[u]=h[u];else i(o,h,d,(t-e[r])/c)}var v=this.computedUp;v[0]=o[1],v[1]=o[5],v[2]=o[9],f(v,v);var g=this.computedInverse;a(g,o);var m=this.computedEye,y=g[15];m[0]=g[12]/y,m[1]=g[13]/y,m[2]=g[14]/y;for(var x=this.computedCenter,b=Math.exp(this.computedRadius[0]),u=0;u<3;++u)x[u]=m[u]-o[2+4*u]*b}},d.idle=function(t){if(!(t1&&n(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&n(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}for(var r=new Array(s.length+o.length-2),f=0,i=0,h=o.length;i0;--p)r[f++]=s[p];return r};var n=t("robust-orientation")[3]},{"robust-orientation":497}],430:[function(t,e,r){"use strict";e.exports=function(t,e){e||(e=t,t=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==o.alt,o.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==o.shift,o.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==o.control,o.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==o.meta,o.meta=!!t.metaKey),e}function u(t,s){var u=n.x(s),c=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||u!==i||c!==a||l(s))&&(r=0|t,i=u||0,a=c||0,e&&e(r,i,a,o))}function c(t){u(0,t)}function f(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,e&&e(0,0,0,o))}function h(t){l(t)&&e&&e(r,i,a,o)}function p(t){0===n.buttons(t)?u(0,t):u(r,t)}function d(t){u(r|n.buttons(t),t)}function v(t){u(r&~n.buttons(t),t)}function g(){s||(s=!0,t.addEventListener("mousemove",p),t.addEventListener("mousedown",d),t.addEventListener("mouseup",v),t.addEventListener("mouseleave",c),t.addEventListener("mouseenter",c),t.addEventListener("mouseout",c),t.addEventListener("mouseover",c),t.addEventListener("blur",f),t.addEventListener("keyup",h),t.addEventListener("keydown",h),t.addEventListener("keypress",h),t!==window&&(window.addEventListener("blur",f),window.addEventListener("keyup",h),window.addEventListener("keydown",h),window.addEventListener("keypress",h)))}g();var m={element:t};return Object.defineProperties(m,{enabled:{get:function(){return s},set:function(e){e?g():s&&(s=!1,t.removeEventListener("mousemove",p),t.removeEventListener("mousedown",d),t.removeEventListener("mouseup",v),t.removeEventListener("mouseleave",c),t.removeEventListener("mouseenter",c),t.removeEventListener("mouseout",c),t.removeEventListener("mouseover",c),t.removeEventListener("blur",f),t.removeEventListener("keyup",h),t.removeEventListener("keydown",h),t.removeEventListener("keypress",h),t!==window&&(window.removeEventListener("blur",f),window.removeEventListener("keyup",h),window.removeEventListener("keydown",h),window.removeEventListener("keypress",h)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),m};var n=t("mouse-event")},{"mouse-event":432}],431:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var i,a=t.clientX||0,o=t.clientY||0,s=(i=e)===window||i===document||i===document.body?n:i.getBoundingClientRect();return r[0]=a-s.left,r[1]=o-s.top,r}},{}],432:[function(t,e,r){"use strict";function n(t){return t.target||t.srcElement||window}r.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){var e=t.which;if(2===e)return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1< 0"),"function"!=typeof t.vertex&&e("Must specify vertex creation function"),"function"!=typeof t.cell&&e("Must specify cell creation function"),"function"!=typeof t.phase&&e("Must specify phase function");for(var S=t.getters||[],C=new Array(M),L=0;L=0?C[L]=!0:C[L]=!1;return function(t,e,r,M,E,S){var C=S.length,L=E.length;if(L<2)throw new Error("ndarray-extract-contour: Dimension must be at least 2");for(var O="extractContour"+E.join("_"),I=[],P=[],D=[],z=0;z0&&N.push(l(z,E[R-1])+"*"+s(E[R-1])),P.push(d(z,E[R])+"=("+N.join("-")+")|0")}for(var z=0;z=0;--z)j.push(s(E[z]));P.push(w+"=("+j.join("*")+")|0",b+"=mallocUint32("+w+")",x+"=mallocUint32("+w+")",k+"=0"),P.push(v(0)+"=0");for(var R=1;R<1<0;A=A-1&d)w.push(x+"["+k+"+"+m(A)+"]");w.push(y(0));for(var A=0;A=0;--e)G(e,0);for(var r=[],e=0;e0){",p(E[e]),"=1;"),t(e-1,r|1<=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),a.push("1"),o.push("s["+l+"]-2"));var u=".lo("+a.join()+").hi("+o.join()+")";if(0===a.length&&(u=""),i>0){n.push("if(1");for(var l=0;l=0||e.indexOf(-(l+1))>=0||n.push("&&s[",l,"]>2");n.push("){grad",i,"(src.pick(",s.join(),")",u);for(var l=0;l=0||e.indexOf(-(l+1))>=0||n.push(",dst.pick(",s.join(),",",l,")",u);n.push(");")}for(var l=0;l1){dst.set(",s.join(),",",c,",0.5*(src.get(",h.join(),")-src.get(",p.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):n.push("if(s[",c,"]>1){diff(",f,",src.pick(",h.join(),")",u,",src.pick(",p.join(),")",u,");}else{zero(",f,");};");break;case"mirror":0===i?n.push("dst.set(",s.join(),",",c,",0);"):n.push("zero(",f,");");break;case"wrap":var d=s.slice(),v=s.slice();e[l]<0?(d[c]="s["+c+"]-2",v[c]="0"):(d[c]="s["+c+"]-1",v[c]="1"),0===i?n.push("if(s[",c,"]>2){dst.set(",s.join(),",",c,",0.5*(src.get(",d.join(),")-src.get(",v.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):n.push("if(s[",c,"]>2){diff(",f,",src.pick(",d.join(),")",u,",src.pick(",v.join(),")",u,");}else{zero(",f,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}i>0&&n.push("};")}for(var s=0;s<1<>",rrshift:">>>"};!function(){for(var t in s){var e=s[t];r[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var l={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in l){var e=l[t];r[t]=o({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=o({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var u={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in u){var e=u[t];r[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var c=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=n({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=n({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=n({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=o({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=o({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=o({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=n({args:["array","array"],pre:i,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":139}],440:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],a=t,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),i(e,t),e)}},{"./doConvert.js":441,ndarray:445}],441:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":139}],442:[function(t,e,r){"use strict";var n=t("typedarray-pool"),i=32;function a(t){switch(t){case"uint8":return[n.mallocUint8,n.freeUint8];case"uint16":return[n.mallocUint16,n.freeUint16];case"uint32":return[n.mallocUint32,n.freeUint32];case"int8":return[n.mallocInt8,n.freeInt8];case"int16":return[n.mallocInt16,n.freeInt16];case"int32":return[n.mallocInt32,n.freeInt32];case"float32":return[n.mallocFloat,n.freeFloat];case"float64":return[n.mallocDouble,n.freeDouble];default:return null}}function o(t){for(var e=[],r=0;r0?s.push(["d",d,"=s",d,"-d",h,"*n",h].join("")):s.push(["d",d,"=s",d].join("")),h=d);var f=t.length-1-l;0!==f&&(p>0?s.push(["e",f,"=s",f,"-e",p,"*n",p,",f",f,"=",u[f],"-f",p,"*n",p].join("")):s.push(["e",f,"=s",f,",f",f,"=",u[f]].join("")),p=f)}r.push("var "+s.join(","));var v=["0","n0-1","data","offset"].concat(o(t.length));r.push(["if(n0<=",i,"){","insertionSort(",v.join(","),")}else{","quickSort(",v.join(","),")}"].join("")),r.push("}return "+n);var g=new Function("insertionSort","quickSort",r.join("\n")),m=function(t,e){var r=["'use strict'"],n=["ndarrayInsertionSort",t.join("d"),e].join(""),i=["left","right","data","offset"].concat(o(t.length)),s=a(e),l=["i,j,cptr,ptr=left*s0+offset"];if(t.length>1){for(var u=[],c=1;c1){r.push("dptr=0;sptr=ptr");for(var c=t.length-1;c>=0;--c){var p=t[c];0!==p&&r.push(["for(i",p,"=0;i",p,"b){break __l}"].join(""));for(var c=t.length-1;c>=1;--c)r.push("sptr+=e"+c,"dptr+=f"+c,"}");r.push("dptr=cptr;sptr=cptr-s0");for(var c=t.length-1;c>=0;--c){var p=t[c];0!==p&&r.push(["for(i",p,"=0;i",p,"=0;--c){var p=t[c];0!==p&&r.push(["for(i",p,"=0;i",p,"scratch)){",h("cptr",f("cptr-s0")),"cptr-=s0","}",h("cptr","scratch"));if(r.push("}"),t.length>1&&s&&r.push("free(scratch)"),r.push("} return "+n),s){var d=new Function("malloc","free",r.join("\n"));return d(s[0],s[1])}var d=new Function(r.join("\n"));return d()}(t,e),y=function(t,e,r){var n=["'use strict'"],s=["ndarrayQuickSort",t.join("d"),e].join(""),l=["left","right","data","offset"].concat(o(t.length)),u=a(e),c=0;n.push(["function ",s,"(",l.join(","),"){"].join(""));var f=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(t.length>1){for(var h=[],p=1;p=0;--a){var o=t[a];0!==o&&n.push(["for(i",o,"=0;i",o,"1)for(var a=0;a1?n.push("ptr_shift+=d"+o):n.push("ptr0+=d"+o),n.push("}"))}}function y(e,r,i,a){if(1===r.length)n.push("ptr0="+d(r[0]));else{for(var o=0;o1)for(var o=0;o=1;--o)i&&n.push("pivot_ptr+=f"+o),r.length>1?n.push("ptr_shift+=e"+o):n.push("ptr0+=e"+o),n.push("}")}function x(){t.length>1&&u&&n.push("free(pivot1)","free(pivot2)")}function b(e,r){var i="el"+e,a="el"+r;if(t.length>1){var o="__l"+ ++c;y(o,[i,a],!1,["comp=",v("ptr0"),"-",v("ptr1"),"\n","if(comp>0){tmp0=",i,";",i,"=",a,";",a,"=tmp0;break ",o,"}\n","if(comp<0){break ",o,"}"].join(""))}else n.push(["if(",v(d(i)),">",v(d(a)),"){tmp0=",i,";",i,"=",a,";",a,"=tmp0}"].join(""))}function _(e,r){t.length>1?m([e,r],!1,g("ptr0",v("ptr1"))):n.push(g(d(e),v(d(r))))}function w(e,r,i){if(t.length>1){var a="__l"+ ++c;y(a,[r],!0,[e,"=",v("ptr0"),"-pivot",i,"[pivot_ptr]\n","if(",e,"!==0){break ",a,"}"].join(""))}else n.push([e,"=",v(d(r)),"-pivot",i].join(""))}function k(e,r){t.length>1?m([e,r],!1,["tmp=",v("ptr0"),"\n",g("ptr0",v("ptr1")),"\n",g("ptr1","tmp")].join("")):n.push(["ptr0=",d(e),"\n","ptr1=",d(r),"\n","tmp=",v("ptr0"),"\n",g("ptr0",v("ptr1")),"\n",g("ptr1","tmp")].join(""))}function A(e,r,i){t.length>1?(m([e,r,i],!1,["tmp=",v("ptr0"),"\n",g("ptr0",v("ptr1")),"\n",g("ptr1",v("ptr2")),"\n",g("ptr2","tmp")].join("")),n.push("++"+r,"--"+i)):n.push(["ptr0=",d(e),"\n","ptr1=",d(r),"\n","ptr2=",d(i),"\n","++",r,"\n","--",i,"\n","tmp=",v("ptr0"),"\n",g("ptr0",v("ptr1")),"\n",g("ptr1",v("ptr2")),"\n",g("ptr2","tmp")].join(""))}function T(t,e){k(t,e),n.push("--"+e)}function M(e,r,i){t.length>1?m([e,r],!0,[g("ptr0",v("ptr1")),"\n",g("ptr1",["pivot",i,"[pivot_ptr]"].join(""))].join("")):n.push(g(d(e),v(d(r))),g(d(r),"pivot"+i))}function E(e,r){n.push(["if((",r,"-",e,")<=",i,"){\n","insertionSort(",e,",",r,",data,offset,",o(t.length).join(","),")\n","}else{\n",s,"(",e,",",r,",data,offset,",o(t.length).join(","),")\n","}"].join(""))}function S(e,r,i){t.length>1?(n.push(["__l",++c,":while(true){"].join("")),m([e],!0,["if(",v("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",c,"}"].join("")),n.push(i,"}")):n.push(["while(",v(d(e)),"===pivot",r,"){",i,"}"].join(""))}if(n.push("var "+f.join(",")),b(1,2),b(4,5),b(1,3),b(2,3),b(1,4),b(3,4),b(2,5),b(2,3),b(4,5),t.length>1?m(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",v("ptr1"),"\n","pivot2[pivot_ptr]=",v("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",v("ptr0"),"\n","y=",v("ptr2"),"\n","z=",v("ptr4"),"\n",g("ptr5","x"),"\n",g("ptr6","y"),"\n",g("ptr7","z")].join("")):n.push(["pivot1=",v(d("el2")),"\n","pivot2=",v(d("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",v(d("el1")),"\n","y=",v(d("el3")),"\n","z=",v(d("el5")),"\n",g(d("index1"),"x"),"\n",g(d("index3"),"y"),"\n",g(d("index5"),"z")].join("")),_("index2","left"),_("index4","right"),n.push("if(pivots_are_equal){"),n.push("for(k=less;k<=great;++k){"),w("comp","k",1),n.push("if(comp===0){continue}"),n.push("if(comp<0){"),n.push("if(k!==less){"),k("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),n.push("while(true){"),w("comp","great",1),n.push("if(comp>0){"),n.push("great--"),n.push("}else if(comp<0){"),A("k","less","great"),n.push("break"),n.push("}else{"),T("k","great"),n.push("break"),n.push("}"),n.push("}"),n.push("}"),n.push("}"),n.push("}else{"),n.push("for(k=less;k<=great;++k){"),w("comp_pivot1","k",1),n.push("if(comp_pivot1<0){"),n.push("if(k!==less){"),k("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),w("comp_pivot2","k",2),n.push("if(comp_pivot2>0){"),n.push("while(true){"),w("comp","great",2),n.push("if(comp>0){"),n.push("if(--greatindex5){"),S("less",1,"++less"),S("great",2,"--great"),n.push("for(k=less;k<=great;++k){"),w("comp_pivot1","k",1),n.push("if(comp_pivot1===0){"),n.push("if(k!==less){"),k("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),w("comp_pivot2","k",2),n.push("if(comp_pivot2===0){"),n.push("while(true){"),w("comp","great",2),n.push("if(comp===0){"),n.push("if(--great1&&u){var C=new Function("insertionSort","malloc","free",n.join("\n"));return C(r,u[0],u[1])}return(C=new Function("insertionSort",n.join("\n")))(r)}(t,e,m);return g(m,y)}},{"typedarray-pool":532}],443:[function(t,e,r){"use strict";var n=t("./lib/compile_sort.js"),i={};e.exports=function(t){var e=t.order,r=t.dtype,a=[e,r].join(":"),o=i[a];return o||(i[a]=o=n(e,r)),o(t),t}},{"./lib/compile_sort.js":442}],444:[function(t,e,r){"use strict";var n=t("ndarray-linear-interpolate"),i=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_3_arg4_)}",args:[{name:"_inline_3_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_4_arg2_(this_warped,_inline_4_arg0_),_inline_4_arg1_=_inline_4_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_4_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_4_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_4_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_4_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_4_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),a=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_7_arg2_(this_warped,_inline_7_arg0_),_inline_7_arg1_=_inline_7_arg3_(_inline_7_arg4_,this_warped[0])}",args:[{name:"_inline_7_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_7_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),o=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_10_arg2_(this_warped,_inline_10_arg0_),_inline_10_arg1_=_inline_10_arg3_(_inline_10_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_10_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_10_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),s=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_13_arg2_(this_warped,_inline_13_arg0_),_inline_13_arg1_=_inline_13_arg3_(_inline_13_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_13_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_13_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});e.exports=function(t,e,r){switch(e.shape.length){case 1:a(t,r,n.d1,e);break;case 2:o(t,r,n.d2,e);break;case 3:s(t,r,n.d3,e);break;default:i(t,r,n.bind(void 0,e),e.shape.length)}return t}},{"cwise/lib/wrapper":142,"ndarray-linear-interpolate":438}],445:[function(t,e,r){var n=t("iota-array"),i=t("is-buffer"),a="undefined"!=typeof Float64Array;function o(t,e){return t[0]-e[0]}function s(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&a.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):a.push("ORDER})")),a.push("proto.set=function "+r+"_set("+c.join(",")+",v){"),i?a.push("return this.data.set("+f+",v)}"):a.push("return this.data["+f+"]=v}"),a.push("proto.get=function "+r+"_get("+c.join(",")+"){"),i?a.push("return this.data.get("+f+")}"):a.push("return this.data["+f+"]}"),a.push("proto.index=function "+r+"_index(",c.join(),"){return "+f+"}"),a.push("proto.hi=function "+r+"_hi("+c.join(",")+"){return new "+r+"(this.data,"+l.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+l.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var d=l.map(function(t){return"a"+t+"=this.shape["+t+"]"}),v=l.map(function(t){return"c"+t+"=this.stride["+t+"]"});a.push("proto.lo=function "+r+"_lo("+c.join(",")+"){var b=this.offset,d=0,"+d.join(",")+","+v.join(","));for(var g=0;g=0){d=i"+g+"|0;b+=c"+g+"*d;a"+g+"-=d}");a.push("return new "+r+"(this.data,"+l.map(function(t){return"a"+t}).join(",")+","+l.map(function(t){return"c"+t}).join(",")+",b)}"),a.push("proto.step=function "+r+"_step("+c.join(",")+"){var "+l.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+l.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var g=0;g=0){c=(c+this.stride["+g+"]*i"+g+")|0}else{a.push(this.shape["+g+"]);b.push(this.stride["+g+"])}");a.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),a.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+l.map(function(t){return"shape["+t+"]"}).join(",")+","+l.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");var o=new Function("CTOR_LIST","ORDER",a.join("\n"));return o(u[t],s)}var u={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=function(t,e,r,n){if(void 0===t){var o=u.array[0];return o([])}"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var s=e.length;if(void 0===r){r=new Array(s);for(var c=s-1,f=1;c>=0;--c)r[c]=f,f*=e[c]}if(void 0===n){n=0;for(var c=0;c>>0;e.exports=function(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-i:i;var r=n.hi(t),o=n.lo(t);return e>t==t>0?o===a?(r+=1,o=0):o+=1:0===o?(o=a,r-=1):o-=1,n.pack(o,r)}},{"double-bits":161}],447:[function(t,e,r){var n=Math.PI,i=u(120);function a(t,e,r,n){return["C",t,e,r,n,r,n]}function o(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}function s(t,e,r,a,o,u,c,f,h,p){if(p)k=p[0],A=p[1],_=p[2],w=p[3];else{var d=l(t,e,-o);t=d.x,e=d.y,d=l(f,h,-o),f=d.x,h=d.y;var v=(t-f)/2,g=(e-h)/2,m=v*v/(r*r)+g*g/(a*a);m>1&&(m=Math.sqrt(m),r*=m,a*=m);var y=r*r,x=a*a,b=(u==c?-1:1)*Math.sqrt(Math.abs((y*x-y*g*g-x*v*v)/(y*g*g+x*v*v)));b==1/0&&(b=1);var _=b*r*g/a+(t+f)/2,w=b*-a*v/r+(e+h)/2,k=Math.asin(((e-w)/a).toFixed(9)),A=Math.asin(((h-w)/a).toFixed(9));(k=t<_?n-k:k)<0&&(k=2*n+k),(A=f<_?n-A:A)<0&&(A=2*n+A),c&&k>A&&(k-=2*n),!c&&A>k&&(A-=2*n)}if(Math.abs(A-k)>i){var T=A,M=f,E=h;A=k+i*(c&&A>k?1:-1),f=_+r*Math.cos(A),h=w+a*Math.sin(A);var S=s(f,h,r,a,o,0,c,M,E,[A,T,_,w])}var C=Math.tan((A-k)/4),L=4/3*r*C,O=4/3*a*C,I=[2*t-(t+L*Math.sin(k)),2*e-(e-O*Math.cos(k)),f+L*Math.sin(A),h-O*Math.cos(A),f,h];if(p)return I;S&&(I=I.concat(S));for(var P=0;P7&&(r.push(m.splice(0,7)),m.unshift("C"));break;case"S":var x=p,b=d;"C"!=e&&"S"!=e||(x+=x-n,b+=b-i),m=["C",x,b,m[1],m[2],m[3],m[4]];break;case"T":"Q"==e||"T"==e?(f=2*p-f,h=2*d-h):(f=p,h=d),m=o(p,d,f,h,m[1],m[2]);break;case"Q":f=m[1],h=m[2],m=o(p,d,m[1],m[2],m[3],m[4]);break;case"L":m=a(p,d,m[1],m[2]);break;case"H":m=a(p,d,m[1],d);break;case"V":m=a(p,d,p,m[1]);break;case"Z":m=a(p,d,l,c)}e=y,p=m[m.length-2],d=m[m.length-1],m.length>4?(n=m[m.length-4],i=m[m.length-3]):(n=p,i=d),r.push(m)}return r}},{}],448:[function(t,e,r){r.vertexNormals=function(t,e,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa)for(var b=i[u],_=1/Math.sqrt(g*y),x=0;x<3;++x){var w=(x+1)%3,k=(x+2)%3;b[x]+=_*(m[w]*v[k]-m[k]*v[w])}}for(var o=0;oa)for(var _=1/Math.sqrt(A),x=0;x<3;++x)b[x]*=_;else for(var x=0;x<3;++x)b[x]=0}return i},r.faceNormals=function(t,e,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa?1/Math.sqrt(p):0;for(var u=0;u<3;++u)h[u]*=p;i[o]=h}return i}},{}],449:[function(t,e,r){ +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ +"use strict";var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==n.join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(t){i[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,o,s=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),l=1;l0){var f=Math.sqrt(c+1);t[0]=.5*(o-l)/f,t[1]=.5*(s-n)/f,t[2]=.5*(r-a)/f,t[3]=.5*f}else{var h=Math.max(e,a,u),f=Math.sqrt(2*h-c+1);e>=h?(t[0]=.5*f,t[1]=.5*(i+r)/f,t[2]=.5*(s+n)/f,t[3]=.5*(o-l)/f):a>=h?(t[0]=.5*(r+i)/f,t[1]=.5*f,t[2]=.5*(l+o)/f,t[3]=.5*(s-n)/f):(t[0]=.5*(n+s)/f,t[1]=.5*(o+l)/f,t[2]=.5*f,t[3]=.5*(r-i)/f)}return t}},{}],451:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),c(r=[].slice.call(r,0,4),r);var i=new f(r,e,Math.log(n));return i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up),i};var n=t("filtered-vector"),i=t("gl-mat4/lookAt"),a=t("gl-mat4/fromQuat"),o=t("gl-mat4/invert"),s=t("./lib/quatFromFrame");function l(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function u(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function c(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=u(r,n,i,a);o>1e-6?(t[0]=r/o,t[1]=n/o,t[2]=i/o,t[3]=a/o):(t[0]=t[1]=t[2]=0,t[3]=1)}function f(t,e,r){this.radius=n([r]),this.center=n(e),this.rotation=n(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var h=f.prototype;h.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},h.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;c(e,e);var r=this.computedMatrix;a(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var u=0,f=0;f<3;++f)u+=r[l+4*f]*i[f];r[12+l]=-u}},h.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r},h.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},h.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},h.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],u=l(a,o,s);a/=u,o/=u,s/=u;var c=i[0],f=i[4],h=i[8],p=c*a+f*o+h*s,d=l(c-=a*p,f-=o*p,h-=s*p);c/=d,f/=d,h/=d;var v=i[2],g=i[6],m=i[10],y=v*a+g*o+m*s,x=v*c+g*f+m*h,b=l(v-=y*a+x*c,g-=y*o+x*f,m-=y*s+x*h);v/=b,g/=b,m/=b;var _=c*e+a*r,w=f*e+o*r,k=h*e+s*r;this.center.move(t,_,w,k);var A=Math.exp(this.computedRadius[0]);A=Math.max(1e-4,A+n),this.radius.set(t,Math.log(A))},h.rotate=function(t,e,r,n){this.recalcMatrix(t),e=e||0,r=r||0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],c=i[1],f=i[5],h=i[9],p=i[2],d=i[6],v=i[10],g=e*a+r*c,m=e*o+r*f,y=e*s+r*h,x=-(d*y-v*m),b=-(v*g-p*y),_=-(p*m-d*g),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),k=u(x,b,_,w);k>1e-6?(x/=k,b/=k,_/=k,w/=k):(x=b=_=0,w=1);var A=this.computedRotation,T=A[0],M=A[1],E=A[2],S=A[3],C=T*w+S*x+M*_-E*b,L=M*w+S*b+E*x-T*_,O=E*w+S*_+T*b-M*x,I=S*w-T*x-M*b-E*_;if(n){x=p,b=d,_=v;var P=Math.sin(n)/l(x,b,_);x*=P,b*=P,_*=P,w=Math.cos(e),I=I*w-(C=C*w+I*x+L*_-O*b)*x-(L=L*w+I*b+O*x-C*_)*b-(O=O*w+I*_+C*b-L*x)*_}var D=u(C,L,O,I);D>1e-6?(C/=D,L/=D,O/=D,I/=D):(C=L=O=0,I=1),this.rotation.set(t,C,L,O,I)},h.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var a=this.computedMatrix;i(a,e,r,n);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),c(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var l=0,u=0;u<3;++u)l+=Math.pow(r[u]-e[u],2);this.radius.set(t,.5*Math.log(Math.max(l,1e-6))),this.center.set(t,r[0],r[1],r[2])},h.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},h.setMatrix=function(t,e){var r=this.computedRotation;s(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),c(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,e);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,u=n[14]/i;this.recalcMatrix(t);var f=Math.exp(this.computedRadius[0]);this.center.set(t,a-n[2]*f,l-n[6]*f,u-n[10]*f),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},h.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},h.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},h.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},h.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},h.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},{"./lib/quatFromFrame":450,"filtered-vector":225,"gl-mat4/fromQuat":261,"gl-mat4/invert":264,"gl-mat4/lookAt":265}],452:[function(t,e,r){ +/*! + * pad-left + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT license. + */ +"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return n(r=void 0!==r?r+"":" ",e)+t}},{"repeat-string":490}],453:[function(t,e,r){"use strict";function n(t,e){if("string"!=typeof t)return[t];var r=[t];"string"==typeof e||Array.isArray(e)?e={brackets:e}:e||(e={});var n=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],i=e.escape||"___",a=!!e.flat;n.forEach(function(t){var e=new RegExp(["\\",t[0],"[^\\",t[0],"\\",t[1],"]*\\",t[1]].join("")),n=[];function a(e,a,o){var s=r.push(e.slice(t[0].length,-t[1].length))-1;return n.push(s),i+s}r.forEach(function(t,n){for(var i,o=0;t!=i;)if(i=t,t=t.replace(e,a),o++>1e4)throw Error("References have circular dependency. Please, check them.");r[n]=t}),n=n.reverse(),r=r.map(function(e){return n.forEach(function(r){e=e.replace(new RegExp("(\\"+i+r+"(?![0-9]))","g"),t[0]+"$1"+t[1])}),e})});var o=new RegExp("\\"+i+"([0-9]+)");return a?r:function t(e,r,n){for(var i,a=[],s=0;i=o.exec(e);){if(s++>1e4)throw Error("Circular references in parenthesis");a.push(e.slice(0,i.index)),a.push(t(r[i[1]],r)),e=e.slice(i.index+i[0].length)}return a.push(e),a}(r[0],r)}function i(t,e){if(e&&e.flat){var r,n=e&&e.escape||"___",i=t[0];if(!i)return"";for(var a=new RegExp("\\"+n+"([0-9]+)"),o=0;i!=r;){if(o++>1e4)throw Error("Circular references in "+t);r=i,i=i.replace(a,s)}return i}return t.reduce(function t(e,r){return Array.isArray(r)&&(r=r.reduce(t,"")),e+r},"");function s(e,r){if(null==t[r])throw Error("Reference "+r+"is undefined");return t[r]}}function a(t,e){return Array.isArray(t)?i(t,e):n(t,e)}a.parse=n,a.stringify=i,e.exports=a},{}],454:[function(t,e,r){"use strict";var n=t("pick-by-alias");e.exports=function(t){var e;return arguments.length>1&&(t=arguments),"string"==typeof t?t=t.split(/\s/).map(parseFloat):"number"==typeof t&&(t=[t]),t.length&&"number"==typeof t[0]?e=1===t.length?{width:t[0],height:t[0],x:0,y:0}:2===t.length?{width:t[0],height:t[1],x:0,y:0}:{x:t[0],y:t[1],width:t[2]-t[0]||0,height:t[3]-t[1]||0}:t&&(t=n(t,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"}),e={x:t.left||0,y:t.top||0},null==t.width?t.right?e.width=t.right-e.x:e.width=0:e.width=t.width,null==t.height?t.bottom?e.height=t.bottom-e.y:e.height=0:e.height=t.height),e}},{"pick-by-alias":460}],455:[function(t,e,r){e.exports=function(t){var e=[];return t.replace(i,function(t,r,i){var o=r.toLowerCase();for(i=function(t){var e=t.match(a);return e?e.map(Number):[]}(i),"m"==o&&i.length>2&&(e.push([r].concat(i.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(i.length==n[o])return i.unshift(r),e.push(i);if(i.length0;--o)a=l[o],r=s[o],s[o]=s[a],s[a]=r,l[o]=l[r],l[r]=a,u=(u+r)*o;return n.freeUint32(l),n.freeUint32(s),u},r.unrank=function(t,e,r){switch(t){case 0:return r||[];case 1:return r?(r[0]=0,r):[0];case 2:return r?(e?(r[0]=0,r[1]=1):(r[0]=1,r[1]=0),r):e?[0,1]:[1,0]}r=r||new Array(t);var n,i,a,o=1;for(r[0]=0,a=1;a0;--a)e=e-(n=e/o|0)*o|0,o=o/a|0,i=0|r[a],r[a]=0|r[n],r[n]=0|i;return r}},{"invert-permutation":410,"typedarray-pool":532}],460:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n,a,o={};if("string"==typeof e&&(e=i(e)),Array.isArray(e)){var s={};for(a=0;a0){o=a[c][r][0],l=c;break}s=o[1^l];for(var f=0;f<2;++f)for(var h=a[f][r],p=0;p0&&(o=d,s=v,l=f)}return i?s:(o&&u(o,l),s)}function f(t,r){var i=a[r][t][0],o=[t];u(i,r);for(var s=i[1^r];;){for(;s!==t;)o.push(s),s=c(o[o.length-2],s,!1);if(a[0][t].length+a[1][t].length===0)break;var l=o[o.length-1],f=t,h=o[1],p=c(l,f,!0);if(n(e[l],e[f],e[h],e[p])<0)break;o.push(t),s=c(l,f)}return o}function h(t,e){return e[1]===e[e.length-1]}for(var o=0;o0;){a[0][o].length;var v=f(o,p);h(d,v)?d.push.apply(d,v):(d.length>0&&l.push(d),d=v)}d.length>0&&l.push(d)}return l};var n=t("compare-angle")},{"compare-angle":120}],462:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=n(t,e.length),i=new Array(e.length),a=new Array(e.length),o=[],s=0;s0;){var u=o.pop();i[u]=!1;for(var c=r[u],s=0;s0})).length,g=new Array(v),m=new Array(v),p=0;p0;){var N=F.pop(),j=C[N];l(j,function(t,e){return t-e});var V,U=j.length,H=B[N];if(0===H){var k=d[N];V=[k]}for(var p=0;p=0)&&(B[q]=1^H,F.push(q),0===H)){var k=d[q];R(k)||(k.reverse(),V.push(k))}}0===H&&r.push(V)}return r};var n=t("edges-to-adjacency-list"),i=t("planar-dual"),a=t("point-in-big-polygon"),o=t("two-product"),s=t("robust-sum"),l=t("uniq"),u=t("./lib/trim-leaves");function c(t,e){for(var r=new Array(t),n=0;n>>1;e.dtype||(e.dtype="array"),"string"==typeof e.dtype?d=new(f(e.dtype))(g):e.dtype&&(d=e.dtype,Array.isArray(d)&&(d.length=g));for(var m=0;mr){for(var h=0;hl||M>u||E=L||o===s)){var c=y[a];void 0===s&&(s=c.length);for(var f=o;f=g&&p<=w&&d>=m&&d<=k&&O.push(h)}var v=x[a],b=v[4*o+0],_=v[4*o+1],A=v[4*o+2],S=v[4*o+3],I=function(t,e){for(var r=null,n=0;null===r;)if(r=t[4*e+n],++n>t.length)return null;return r}(v,o+1),P=.5*i,D=a+1;e(r,n,P,D,b,_||A||S||I),e(r,n+P,P,D,_,A||S||I),e(r+P,n,P,D,A,S||I),e(r+P,n+P,P,D,S,I)}}}(0,0,1,0,0,1),O},d;function S(t,e,r){for(var n=1,i=.5,a=.5,o=.5,s=0;s0&&e[i]===r[0]))return 1;a=t[i-1]}for(var s=1;a;){var l=a.key,u=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,a=a.right}else if(u>0)a=a.left;else{if(!(u<0))return 0;s=1,a=a.right}}return s}}(m.slabs,m.coordinates);return 0===a.length?y:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(l(a),y)};var n=t("robust-orientation")[3],i=t("slab-decomposition"),a=t("interval-tree-1d"),o=t("binary-search-bounds");function s(){return!0}function l(t){for(var e={},r=0;r=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;if(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-u)*(i-c)/(o-c)+u-n>t&&(s=!s),a=u,o=c}return s}};return e}},{}],471:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),i=1;i0})}function c(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,u=a.start,c=a.end;r&&r.checkIntersection(i,a);var f=e.linesIntersect(o,s,u,c);if(!1===f){if(!e.pointsCollinear(o,s,u))return!1;if(e.pointsSame(o,c)||e.pointsSame(s,u))return!1;var h=e.pointsSame(o,u),p=e.pointsSame(s,c);if(h&&p)return n;var d=!h&&e.pointBetween(o,u,c),v=!p&&e.pointBetween(s,u,c);if(h)return v?l(n,s):l(t,c),n;d&&(p||(v?l(n,s):l(t,c)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,u):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,c)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[];!a.isEmpty();){var h=a.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var p=u(h),d=p.before?p.before.ev:null,v=p.after?p.after.ev:null;function g(){if(d){var t=c(h,d);if(t)return t}return!!v&&c(h,v)}r&&r.tempStatus(h.seg,!!d&&d.seg,!!v&&v.seg);var m,y,x=g();if(x&&(t?(y=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(x.seg.myFill.above=!x.seg.myFill.above):x.seg.otherFill=h.seg.myFill,r&&r.segmentUpdate(x.seg),h.other.remove(),h.remove()),a.getHead()!==h){r&&r.rewind(h.seg);continue}t?(y=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=v?v.seg.myFill.above:i,h.seg.myFill.above=y?!h.seg.myFill.below:h.seg.myFill.below):null===h.seg.otherFill&&(m=v?h.primary===v.primary?v.seg.otherFill.above:v.seg.myFill.above:h.primary?o:i,h.seg.otherFill={above:m,below:m}),r&&r.status(h.seg,!!d&&d.seg,!!v&&v.seg),h.other.status=p.insert(n.node({ev:h}))}else{var b=h.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(b.prev)&&s.exists(b.next)&&c(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!h.primary){var _=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=_}f.push(h.seg)}a.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,i,a,o=t[t.length-1],l=0;l=u?(A=1,y=u+2*h+d):y=h*(A=-h/u)+d):(A=0,p>=0?(T=0,y=d):-p>=f?(T=1,y=f+2*p+d):y=p*(T=-p/f)+d);else if(T<0)T=0,h>=0?(A=0,y=d):-h>=u?(A=1,y=u+2*h+d):y=h*(A=-h/u)+d;else{var M=1/k;y=(A*=M)*(u*A+c*(T*=M)+2*h)+T*(c*A+f*T+2*p)+d}else A<0?(b=f+p)>(x=c+h)?(_=b-x)>=(w=u-2*c+f)?(A=1,T=0,y=u+2*h+d):y=(A=_/w)*(u*A+c*(T=1-A)+2*h)+T*(c*A+f*T+2*p)+d:(A=0,b<=0?(T=1,y=f+2*p+d):p>=0?(T=0,y=d):y=p*(T=-p/f)+d):T<0?(b=u+h)>(x=c+p)?(_=b-x)>=(w=u-2*c+f)?(T=1,A=0,y=f+2*p+d):y=(A=1-(T=_/w))*(u*A+c*T+2*h)+T*(c*A+f*T+2*p)+d:(T=0,b<=0?(A=1,y=u+2*h+d):h>=0?(A=0,y=d):y=h*(A=-h/u)+d):(_=f+p-c-h)<=0?(A=0,T=1,y=f+2*p+d):_>=(w=u-2*c+f)?(A=1,T=0,y=u+2*h+d):y=(A=_/w)*(u*A+c*(T=1-A)+2*h)+T*(c*A+f*T+2*p)+d;for(var E=1-A-T,l=0;l1)for(var r=1;r0){var u=t[r-1];if(0===n(s,u)&&a(u)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},{"cell-orientation":105,"compare-cell":121,"compare-oriented-cell":122}],485:[function(t,e,r){"use strict";var n=t("array-bounds"),i=t("color-normalize"),a=t("update-diff"),o=t("pick-by-alias"),s=t("object-assign"),l=t("flatten-vertex-data"),u=t("to-float32"),c=u.float32,f=u.fract32;e.exports=function(t,e){if("function"==typeof t?(e||(e={}),e.regl=t):e=t,e.length&&(e.positions=e),!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");var r,u,p,d,v,g,m=t._gl,y={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},x=[];return d=t.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),u=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),p=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),v=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=t.buffer({usage:"static",type:"float",data:h}),k(e),r=t({vert:"\n\t\tprecision highp float;\n\n\t\tattribute vec2 position, positionFract;\n\t\tattribute vec4 error;\n\t\tattribute vec4 color;\n\n\t\tattribute vec2 direction, lineOffset, capOffset;\n\n\t\tuniform vec4 viewport;\n\t\tuniform float lineWidth, capSize;\n\t\tuniform vec2 scale, scaleFract, translate, translateFract;\n\n\t\tvarying vec4 fragColor;\n\n\t\tvoid main() {\n\t\t\tfragColor = color / 255.;\n\n\t\t\tvec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset;\n\n\t\t\tvec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw;\n\n\t\t\tvec2 position = position + dxy;\n\n\t\t\tvec2 pos = (position + translate) * scale\n\t\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t\t+ (position + translate) * scaleFract\n\t\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n\t\t\tpos += pixelOffset / viewport.zw;\n\n\t\t\tgl_Position = vec4(pos * 2. - 1., 0, 1);\n\t\t}\n\t\t",frag:"\n\t\tprecision highp float;\n\n\t\tvarying vec4 fragColor;\n\n\t\tuniform float opacity;\n\n\t\tvoid main() {\n\t\t\tgl_FragColor = fragColor;\n\t\t\tgl_FragColor.a *= opacity;\n\t\t}\n\t\t",uniforms:{range:t.prop("range"),lineWidth:t.prop("lineWidth"),capSize:t.prop("capSize"),opacity:t.prop("opacity"),scale:t.prop("scale"),translate:t.prop("translate"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{color:{buffer:d,offset:function(t,e){return 4*e.offset},divisor:1},position:{buffer:u,offset:function(t,e){return 8*e.offset},divisor:1},positionFract:{buffer:p,offset:function(t,e){return 8*e.offset},divisor:1},error:{buffer:v,offset:function(t,e){return 16*e.offset},divisor:1},direction:{buffer:g,stride:24,offset:0},lineOffset:{buffer:g,stride:24,offset:8},capOffset:{buffer:g,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport"),stencil:!1,instances:t.prop("count"),count:h.length}),s(b,{update:k,draw:_,destroy:A,regl:t,gl:m,canvas:m.canvas,groups:x}),b;function b(t){t?k(t):null===t&&A(),_()}function _(e){if("number"==typeof e)return w(e);e&&!Array.isArray(e)&&(e=[e]),t._refresh(),x.forEach(function(t,r){t&&(e&&(e[r]?t.draw=!0:t.draw=!1),t.draw?w(r):t.draw=!0)})}function w(t){"number"==typeof t&&(t=x[t]),null!=t&&t&&t.count&&t.color&&t.opacity&&t.positions&&t.positions.length>1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],r(t),t.after&&t.after(t))}function k(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0,r=0;if(b.groups=x=t.map(function(t,u){var c=x[u];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=o(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),c||(x[u]=c={id:u,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},y,t)),a(c,t,[{lineWidth:function(t){return.5*+t},capSize:function(t){return.5*+t},opacity:parseFloat,errors:function(t){return t=l(t),r+=t.length,t},positions:function(t,r){return t=l(t,"float64"),r.count=Math.floor(t.length/2),r.bounds=n(t,2),r.offset=e,e+=r.count,t}},{color:function(t,e){var r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){var n=t;t=Array(r);for(var a=0;a 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D dashPattern;\nuniform float dashSize, pixelRatio, thickness, opacity, id, miterMode;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashSize) * .5 + .25;\n\tfloat dash = texture2D(dashPattern, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:t.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(t){e=i}var s=t({primitive:"triangle",elements:function(t,e){return e.triangles},offset:0,vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n"]),uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{position:{buffer:t.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport});return{fill:s,rect:i,miter:e}},g.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},g.prototype.render=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];e.length&&(t=this).update.apply(t,e),this.draw()},g.prototype.draw=function(){for(var t=this,e=[],r=arguments.length;r--;)e[r]=arguments[r];return(e.length?e:this.passes).forEach(function(e,r){var n;if(e&&Array.isArray(e))return(n=t).draw.apply(n,e);"number"==typeof e&&(e=t.passes[e]),e&&e.count>1&&e.opacity&&(t.regl._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&t.shaders.fill(e),e.thickness&&(e.scale[0]*e.viewport.width>g.precisionThreshold||e.scale[1]*e.viewport.height>g.precisionThreshold?t.shaders.rect(e):"rect"===e.join||!e.join&&(e.thickness<=2||e.count>=g.maxPoints)?t.shaders.rect(e):t.shaders.miter(e)))}),this},g.prototype.update=function(t){var e=this;if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var r=this.regl,o=this.gl;if(t.forEach(function(t,f){var d=e.passes[f];if(void 0!==t)if(null!==t){if("number"==typeof t[0]&&(t={positions:t}),t=s(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow"}),d||(e.passes[f]=d={id:f,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:r.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:r.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},t=a({},g.defaults,t)),null!=t.thickness&&(d.thickness=parseFloat(t.thickness)),null!=t.opacity&&(d.opacity=parseFloat(t.opacity)),null!=t.miterLimit&&(d.miterLimit=parseFloat(t.miterLimit)),null!=t.overlay&&(d.overlay=!!t.overlay,f 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),l.vert=c(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform sampler2D palette;\nuniform vec2 paletteSize;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(palette,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0, 1);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),d&&(l.frag=l.frag.replace("smoothstep","smoothStep"),s.frag=s.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(l)}y.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},y.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},y.prototype.draw=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;nn)?e.tree=l(t,{bounds:f}):n&&n.length&&(e.tree=n),e.tree){var h={primitive:"points",usage:"static",data:e.tree,type:"uint32"};e.elements?e.elements(h):e.elements=s.elements(h)}return i({data:v.float(t),usage:"dynamic"}),a({data:v.fract(t),usage:"dynamic"}),u({data:new Uint8Array(c),type:"uint8",usage:"stream"}),t}},{marker:function(e,r,n){var i=r.activation;if(i.forEach(function(t){return t&&t.destroy&&t.destroy()}),i.length=0,e&&"number"!=typeof e[0]){for(var a=[],o=0,l=Math.min(e.length,r.count);o=0)return a;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)e=t;else{e=new Uint8Array(t.length);for(var o=0,s=t.length;o4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},y.prototype.updatePalette=function(t){if(!this.tooManyColors){var e=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*t.length/e);if(n>1)for(var i=.25*(t=t.slice()).length%e;i2?(s[0],s[2],n=s[1],i=s[3]):s.length?(n=s[0],i=s[1]):(s.x,n=s.y,s.x,s.width,i=s.y+s.height),l.length>2?(a=l[0],o=l[2],l[1],l[3]):l.length?(a=l[0],o=l[1]):(a=l.x,l.y,o=l.x+l.width,l.y,l.height),[a,n,o,i]}function p(t){if("number"==typeof t)return[t,t,t,t];if(2===t.length)return[t[0],t[1],t[0],t[1]];var e=l(t);return[e.x,e.y,e.x+e.width,e.y+e.height]}e.exports=c,c.prototype.render=function(){for(var t,e=this,r=[],n=arguments.length;n--;)r[n]=arguments[n];return r.length&&(t=this).update.apply(t,r),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=o(function(){e.draw(),e.dirty=!0,e.planned=null})):(this.draw(),this.dirty=!0,o(function(){e.dirty=!1})),this)},c.prototype.update=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e.length){for(var n=0;nA))&&(s.lower||!(k>>=e))<<3,(e|=r=(15<(t>>>=r))<<2)|(r=(3<(t>>>=r))<<1)|t>>>r>>1}function s(){function t(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=r[o(t)>>2]).length?e.pop():new ArrayBuffer(t)}function e(t){r[o(t.byteLength)>>2].push(t)}var r=a(8,function(){return[]});return{alloc:t,free:e,allocType:function(e,r){var n=null;switch(e){case 5120:n=new Int8Array(t(r),0,r);break;case 5121:n=new Uint8Array(t(r),0,r);break;case 5122:n=new Int16Array(t(2*r),0,r);break;case 5123:n=new Uint16Array(t(2*r),0,r);break;case 5124:n=new Int32Array(t(4*r),0,r);break;case 5125:n=new Uint32Array(t(4*r),0,r);break;case 5126:n=new Float32Array(t(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){e(t.buffer)}}}function l(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||Y(t.data))}function u(t,e,r,n,i,a){for(var o=0;o(i=s)&&(i=n.buffer.byteLength,5123===f?i>>=1:5125===f&&(i>>=2)),n.vertCount=i,i=o,0>o&&(i=4,1===(o=n.buffer.dimension)&&(i=0),2===o&&(i=1),3===o&&(i=4)),n.primType=i}function o(t){n.elementsCount--,delete s[t.id],t.buffer.destroy(),t.buffer=null}var s={},u=0,c={uint8:5121,uint16:5123};e.oes_element_index_uint&&(c.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var f=[];return{create:function(t,e){function s(t){if(t)if("number"==typeof t)u(t),f.primType=4,f.vertCount=0|t,f.type=5121;else{var e=null,r=35044,n=-1,i=-1,o=0,h=0;Array.isArray(t)||Y(t)||l(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=K[t.usage]),"primitive"in t&&(n=rt[t.primitive]),"count"in t&&(i=0|t.count),"type"in t&&(h=c[t.type]),"length"in t?o=0|t.length:(o=i,5123===h||5122===h?o*=2:5125!==h&&5124!==h||(o*=4))),a(f,e,r,n,i,o,h)}else u(),f.primType=4,f.vertCount=0,f.type=5121;return s}var u=r.create(null,34963,!0),f=new i(u._buffer);return n.elementsCount++,s(t),s._reglType="elements",s._elements=f,s.subdata=function(t,e){return u.subdata(t,e),s},s.destroy=function(){o(f)},s},createStream:function(t){var e=f.pop();return e||(e=new i(r.create(null,34963,!0,!1)._buffer)),a(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){f.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){X(s).forEach(o)}}}function v(t){for(var e=G.allocType(5123,t.length),r=0;r>>31<<15,a=(n<<1>>>24)-127,n=n>>13&1023;e[r]=-24>a?i:-14>a?i+(n+1024>>-14-a):15>=i,r.height>>=i,p(r,n[i]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function L(t){for(var e=t.images,r=0;re){for(var r=0;r=--this.refCount&&F(this)}}),o.profile&&(a.getTotalTextureSize=function(){var t=0;return Object.keys(mt).forEach(function(e){t+=mt[e].stats.size}),t}),{create2D:function(e,r){function n(t,e){var r=i.texInfo;O.call(r);var a=C();return"number"==typeof t?M(a,0|t,"number"==typeof e?0|e:0|t):t?(I(r,t),E(a,t)):M(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,u(i,a),i.internalformat=a.internalformat,n.width=a.width,n.height=a.height,z(i),S(a,3553),P(r,3553),R(),L(a),o.profile&&(i.stats.size=k(i.internalformat,i.type,a.width,a.height,r.genMipmaps,!1)),n.format=tt[i.internalformat],n.type=et[i.type],n.mag=rt[r.magFilter],n.min=nt[r.minFilter],n.wrapS=it[r.wrapS],n.wrapT=it[r.wrapT],n}var i=new D(3553);return mt[i.id]=i,a.textureCount++,n(e,r),n.subimage=function(t,e,r,a){e|=0,r|=0,a|=0;var o=m();return u(o,i),o.width=0,o.height=0,p(o,t),o.width=o.width||(i.width>>a)-e,o.height=o.height||(i.height>>a)-r,z(i),d(o,3553,e,r,a),R(),A(o),n},n.resize=function(e,r){var a=0|e,s=0|r||a;if(a===i.width&&s===i.height)return n;n.width=i.width=a,n.height=i.height=s,z(i);for(var l,u=i.channels,c=i.type,f=0;i.mipmask>>f;++f){var h=a>>f,p=s>>f;if(!h||!p)break;l=G.zero.allocType(c,h*p*u),t.texImage2D(3553,f,i.format,h,p,0,i.format,i.type,l),l&&G.zero.freeType(l)}return R(),o.profile&&(i.stats.size=k(i.internalformat,i.type,a,s,!1,!1)),n},n._reglType="texture2d",n._texture=i,o.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(e,r,n,i,s,l){function f(t,e,r,n,i,a){var s,l=h.texInfo;for(O.call(l),s=0;6>s;++s)v[s]=C();if("number"!=typeof t&&t){if("object"==typeof t)if(e)E(v[0],t),E(v[1],e),E(v[2],r),E(v[3],n),E(v[4],i),E(v[5],a);else if(I(l,t),c(h,t),"faces"in t)for(t=t.faces,s=0;6>s;++s)u(v[s],h),E(v[s],t[s]);else for(s=0;6>s;++s)E(v[s],t)}else for(t=0|t||1,s=0;6>s;++s)M(v[s],t,t);for(u(h,v[0]),h.mipmask=l.genMipmaps?(v[0].width<<1)-1:v[0].mipmask,h.internalformat=v[0].internalformat,f.width=v[0].width,f.height=v[0].height,z(h),s=0;6>s;++s)S(v[s],34069+s);for(P(l,34067),R(),o.profile&&(h.stats.size=k(h.internalformat,h.type,f.width,f.height,l.genMipmaps,!0)),f.format=tt[h.internalformat],f.type=et[h.type],f.mag=rt[l.magFilter],f.min=nt[l.minFilter],f.wrapS=it[l.wrapS],f.wrapT=it[l.wrapT],s=0;6>s;++s)L(v[s]);return f}var h=new D(34067);mt[h.id]=h,a.cubeCount++;var v=Array(6);return f(e,r,n,i,s,l),f.subimage=function(t,e,r,n,i){r|=0,n|=0,i|=0;var a=m();return u(a,h),a.width=0,a.height=0,p(a,e),a.width=a.width||(h.width>>i)-r,a.height=a.height||(h.height>>i)-n,z(h),d(a,34069+t,r,n,i),R(),A(a),f},f.resize=function(e){if((e|=0)!==h.width){f.width=h.width=e,f.height=h.height=e,z(h);for(var r=0;6>r;++r)for(var n=0;h.mipmask>>n;++n)t.texImage2D(34069+r,n,h.format,e>>n,e>>n,0,h.format,h.type,null);return R(),o.profile&&(h.stats.size=k(h.internalformat,h.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=h,o.profile&&(f.stats=h.stats),f.destroy=function(){h.decRef()},f},clear:function(){for(var e=0;er;++r)if(0!=(e.mipmask&1<>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;6>n;++n)t.texImage2D(34069+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);P(e.texInfo,e.target)})}}}function T(t,e,r,n,i,a){function o(t,e,r){this.target=t,this.texture=e,this.renderbuffer=r;var n=t=0;e?(t=e.width,n=e.height):r&&(t=r.width,n=r.height),this.width=t,this.height=n}function s(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function l(t,e,r){t&&(t.texture?t.texture._texture.refCount+=1:t.renderbuffer._renderbuffer.refCount+=1)}function u(e,r){r&&(r.texture?t.framebufferTexture2D(36160,e,r.target,r.texture._texture.texture,0):t.framebufferRenderbuffer(36160,e,36161,r.renderbuffer._renderbuffer.renderbuffer))}function c(t){var e=3553,r=null,n=null,i=t;return"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target)),"texture2d"===(t=i._reglType)?r=i:"textureCube"===t?r=i:"renderbuffer"===t&&(n=i,e=36161),new o(e,r,n)}function f(t,e,r,a,s){return r?((t=n.create2D({width:t,height:e,format:a,type:s}))._texture.refCount=0,new o(3553,t,null)):((t=i.create({width:t,height:e,format:a}))._renderbuffer.refCount=0,new o(36161,null,t))}function h(t){return t&&(t.texture||t.renderbuffer)}function p(t,e,r){t&&(t.texture?t.texture.resize(e,r):t.renderbuffer&&t.renderbuffer.resize(e,r),t.width=e,t.height=r)}function d(){this.id=k++,A[this.id]=this,this.framebuffer=t.createFramebuffer(),this.height=this.width=0,this.colorAttachments=[],this.depthStencilAttachment=this.stencilAttachment=this.depthAttachment=null}function v(t){t.colorAttachments.forEach(s),s(t.depthAttachment),s(t.stencilAttachment),s(t.depthStencilAttachment)}function g(e){t.deleteFramebuffer(e.framebuffer),e.framebuffer=null,a.framebufferCount--,delete A[e.id]}function m(e){var n;t.bindFramebuffer(36160,e.framebuffer);var i=e.colorAttachments;for(n=0;ni;++i){for(u=0;ut;++t)r[t].resize(n);return e.width=e.height=n,e},_reglType:"framebufferCube",destroy:function(){r.forEach(function(t){t.destroy()})}})},clear:function(){X(A).forEach(g)},restore:function(){x.cur=null,x.next=null,x.dirty=!0,X(A).forEach(function(e){e.framebuffer=t.createFramebuffer(),m(e)})}})}function M(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function E(t,e,r,n){function i(t,e,r,n){this.name=t,this.id=e,this.location=r,this.info=n}function a(t,e){for(var r=0;rt&&(t=e.stats.uniformsCount)}),t},r.getMaxAttributesCount=function(){var t=0;return h.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);X(u).forEach(e),u={},X(c).forEach(e),c={},h.forEach(function(e){t.deleteProgram(e.program)}),h.length=0,f={},r.shaderCount=0},program:function(t,e,n){var i=f[e];i||(i=f[e]={});var a=i[t];return a||(a=new s(e,t),r.shaderCount++,l(a),i[t]=a,h.push(a)),a},restore:function(){u={},c={};for(var t=0;t"+e+"?"+i+".constant["+e+"]:0;"}).join(""),"}}else{","if(",o,"(",i,".buffer)){",c,"=",s,".createStream(",34962,",",i,".buffer);","}else{",c,"=",s,".getBuffer(",i,".buffer);","}",f,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",c,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",c,");","}"),l})}),o}function T(t,e,r,n,i){var o=_(t),s=function(t,e,r){function n(t){if(t in i){var r=i[t];t=!0;var n,o,s=0|r.x,l=0|r.y;return"width"in r?n=0|r.width:t=!1,"height"in r?o=0|r.height:t=!1,new D(!t&&e&&e.thisDep,!t&&e&&e.contextDep,!t&&e&&e.propDep,function(t,e){var i=t.shared.context,a=n;"width"in r||(a=e.def(i,".","framebufferWidth","-",s));var u=o;return"height"in r||(u=e.def(i,".","framebufferHeight","-",l)),[s,l,a,u]})}if(t in a){var u=a[t];return t=F(u,function(t,e){var r=t.invoke(e,u),n=t.shared.context,i=e.def(r,".x|0"),a=e.def(r,".y|0"),o=e.def('"width" in ',r,"?",r,".width|0:","(",n,".","framebufferWidth","-",i,")"),r=e.def('"height" in ',r,"?",r,".height|0:","(",n,".","framebufferHeight","-",a,")");return[i,a,o,r]}),e&&(t.thisDep=t.thisDep||e.thisDep,t.contextDep=t.contextDep||e.contextDep,t.propDep=t.propDep||e.propDep),t}return e?new D(e.thisDep,e.contextDep,e.propDep,function(t,e){var r=t.shared.context;return[0,0,e.def(r,".","framebufferWidth"),e.def(r,".","framebufferHeight")]}):null}var i=t.static,a=t.dynamic;if(t=n("viewport")){var o=t;t=new D(t.thisDep,t.contextDep,t.propDep,function(t,e){var r=o.append(t,e),n=t.shared.context;return e.set(n,".viewportWidth",r[2]),e.set(n,".viewportHeight",r[3]),r})}return{viewport:t,scissor_box:n("scissor.box")}}(t,o),l=k(t),u=function(t,e){var r=t.static,n=t.dynamic,i={};return nt.forEach(function(t){function e(e,a){if(t in r){var s=e(r[t]);i[o]=R(function(){return s})}else if(t in n){var l=n[t];i[o]=F(l,function(t,e){return a(t,e,t.invoke(e,l))})}}var o=m(t);switch(t){case"cull.enable":case"blend.enable":case"dither":case"stencil.enable":case"depth.enable":case"scissor.enable":case"polygonOffset.enable":case"sample.alpha":case"sample.enable":case"depth.mask":return e(function(t){return t},function(t,e,r){return r});case"depth.func":return e(function(t){return kt[t]},function(t,e,r){return e.def(t.constants.compareFuncs,"[",r,"]")});case"depth.range":return e(function(t){return t},function(t,e,r){return[e.def("+",r,"[0]"),e=e.def("+",r,"[1]")]});case"blend.func":return e(function(t){return[wt["srcRGB"in t?t.srcRGB:t.src],wt["dstRGB"in t?t.dstRGB:t.dst],wt["srcAlpha"in t?t.srcAlpha:t.src],wt["dstAlpha"in t?t.dstAlpha:t.dst]]},function(t,e,r){function n(t,n){return e.def('"',t,n,'" in ',r,"?",r,".",t,n,":",r,".",t)}t=t.constants.blendFuncs;var i=n("src","RGB"),a=n("dst","RGB"),o=(i=e.def(t,"[",i,"]"),e.def(t,"[",n("src","Alpha"),"]"));return[i,a=e.def(t,"[",a,"]"),o,t=e.def(t,"[",n("dst","Alpha"),"]")]});case"blend.equation":return e(function(t){return"string"==typeof t?[$[t],$[t]]:"object"==typeof t?[$[t.rgb],$[t.alpha]]:void 0},function(t,e,r){var n=t.constants.blendEquations,i=e.def(),a=e.def();return(t=t.cond("typeof ",r,'==="string"')).then(i,"=",a,"=",n,"[",r,"];"),t.else(i,"=",n,"[",r,".rgb];",a,"=",n,"[",r,".alpha];"),e(t),[i,a]});case"blend.color":return e(function(t){return a(4,function(e){return+t[e]})},function(t,e,r){return a(4,function(t){return e.def("+",r,"[",t,"]")})});case"stencil.mask":return e(function(t){return 0|t},function(t,e,r){return e.def(r,"|0")});case"stencil.func":return e(function(t){return[kt[t.cmp||"keep"],t.ref||0,"mask"in t?t.mask:-1]},function(t,e,r){return[t=e.def('"cmp" in ',r,"?",t.constants.compareFuncs,"[",r,".cmp]",":",7680),e.def(r,".ref|0"),e=e.def('"mask" in ',r,"?",r,".mask|0:-1")]});case"stencil.opFront":case"stencil.opBack":return e(function(e){return["stencil.opBack"===t?1029:1028,At[e.fail||"keep"],At[e.zfail||"keep"],At[e.zpass||"keep"]]},function(e,r,n){function i(t){return r.def('"',t,'" in ',n,"?",a,"[",n,".",t,"]:",7680)}var a=e.constants.stencilOps;return["stencil.opBack"===t?1029:1028,i("fail"),i("zfail"),i("zpass")]});case"polygonOffset.offset":return e(function(t){return[0|t.factor,0|t.units]},function(t,e,r){return[e.def(r,".factor|0"),e=e.def(r,".units|0")]});case"cull.face":return e(function(t){var e=0;return"front"===t?e=1028:"back"===t&&(e=1029),e},function(t,e,r){return e.def(r,'==="front"?',1028,":",1029)});case"lineWidth":return e(function(t){return t},function(t,e,r){return r});case"frontFace":return e(function(t){return Tt[t]},function(t,e,r){return e.def(r+'==="cw"?2304:2305')});case"colorMask":return e(function(t){return t.map(function(t){return!!t})},function(t,e,r){return a(4,function(t){return"!!"+r+"["+t+"]"})});case"sample.coverage":return e(function(t){return["value"in t?t.value:1,!!t.invert]},function(t,e,r){return[e.def('"value" in ',r,"?+",r,".value:1"),e=e.def("!!",r,".invert")]})}}),i}(t),c=w(t),f=s.viewport;return f&&(u.viewport=f),f=m("scissor.box"),(s=s[f])&&(u[f]=s),s=0>1)",s],");")}function e(){r(l,".drawArraysInstancedANGLE(",[d,v,g,s],");")}p?y?t():(r("if(",p,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(c+".drawElements("+[d,g,m,v+"<<(("+m+"-5121)>>1)"]+");")}function e(){r(c+".drawArrays("+[d,v,g]+");")}p?y?t():(r("if(",p,"){"),t(),r("}else{"),e(),r("}")):e()}var s,l,u=t.shared,c=u.gl,f=u.draw,h=n.draw,p=function(){var i=h.elements,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(f,".","elements"),i&&a("if("+i+")"+c+".bindBuffer(34963,"+i+".buffer.buffer);"),i}(),d=i("primitive"),v=i("offset"),g=function(){var i=h.count,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(f,".","count"),i}();if("number"==typeof g){if(0===g)return}else r("if(",g,"){"),r.exit("}");K&&(s=i("instances"),l=t.instancing);var m=p+".type",y=h.elements&&z(h.elements);K&&("number"!=typeof s||0<=s)?"string"==typeof s?(r("if(",s,">0){"),a(),r("}else if(",s,"<0){"),o(),r("}")):a():o()}function H(t,e,r,n,i){return e=b(),i=e.proc("body",i),K&&(e.instancing=i.def(e.shared.extensions,".angle_instanced_arrays")),t(e,i,r,n),e.compile().body}function q(t,e,r,n){L(t,e),N(t,e,r,n.attributes,function(){return!0}),j(t,e,r,n.uniforms,function(){return!0}),V(t,e,e,r)}function G(t,e,r,n){function i(){return!0}t.batchId="a1",L(t,e),N(t,e,r,n.attributes,i),j(t,e,r,n.uniforms,i),V(t,e,e,r)}function W(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}L(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var u=t.scope(),c=t.scope();e(u.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",c,"}",u.exit),r.needsContext&&M(t,c,r.context),r.needsFramebuffer&&E(t,c,r.framebuffer),C(t,c,r.state,i),r.profile&&i(r.profile)&&B(t,c,r,!1,!0),n?(N(t,u,r,n.attributes,a),N(t,c,r,n.attributes,i),j(t,u,r,n.uniforms,a),j(t,c,r,n.uniforms,i),V(t,u,c,r)):(e=t.global.def("{}"),n=r.shader.progVar.append(t,c),l=c.def(n,".id"),u=c.def(e,"[",l,"]"),c(t.shared.gl,".useProgram(",n,".program);","if(!",u,"){",u,"=",e,"[",l,"]=",t.link(function(e){return H(G,t,r,e,2)}),"(",n,");}",u,".call(this,a0[",s,"],",s,");"))}function Y(t,r){function n(e){var n=r.shader[e];n&&i.set(a.shader,"."+e,n.append(t,i))}var i=t.proc("scope",3);t.batchId="a2";var a=t.shared,o=a.current;M(t,i,r.context),r.framebuffer&&r.framebuffer.append(t,i),P(Object.keys(r.state)).forEach(function(e){var n=r.state[e].append(t,i);g(n)?n.forEach(function(r,n){i.set(t.next[e],"["+n+"]",r)}):i.set(a.next,"."+e,n)}),B(t,i,r,!0,!0),["elements","offset","count","instances","primitive"].forEach(function(e){var n=r.draw[e];n&&i.set(a.draw,"."+e,""+n.append(t,i))}),Object.keys(r.uniforms).forEach(function(n){i.set(a.uniforms,"["+e.id(n)+"]",r.uniforms[n].append(t,i))}),Object.keys(r.attributes).forEach(function(e){var n=r.attributes[e].append(t,i),a=t.scopeAttrib(e);Object.keys(new Z).forEach(function(t){i.set(a,"."+t,n[t])})}),n("vert"),n("frag"),0=--this.refCount&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(c).forEach(function(e){t+=c[e].stats.size}),t}),{create:function(e,r){function o(e,r){var n=0,a=0,c=32854;if("object"==typeof e&&e?("shape"in e?(a=e.shape,n=0|a[0],a=0|a[1]):("radius"in e&&(n=a=0|e.radius),"width"in e&&(n=0|e.width),"height"in e&&(a=0|e.height)),"format"in e&&(c=s[e.format])):"number"==typeof e?(n=0|e,a="number"==typeof r?0|r:n):e||(n=a=1),n!==u.width||a!==u.height||c!==u.format)return o.width=u.width=n,o.height=u.height=a,u.format=c,t.bindRenderbuffer(36161,u.renderbuffer),t.renderbufferStorage(36161,c,n,a),i.profile&&(u.stats.size=gt[u.format]*u.width*u.height),o.format=l[u.format],o}var u=new a(t.createRenderbuffer());return c[u.id]=u,n.renderbufferCount++,o(e,r),o.resize=function(e,r){var n=0|e,a=0|r||n;return n===u.width&&a===u.height?o:(o.width=u.width=n,o.height=u.height=a,t.bindRenderbuffer(36161,u.renderbuffer),t.renderbufferStorage(36161,u.format,n,a),i.profile&&(u.stats.size=gt[u.format]*u.width*u.height),o)},o._reglType="renderbuffer",o._renderbuffer=u,i.profile&&(o.stats=u.stats),o.destroy=function(){u.decRef()},o},clear:function(){X(c).forEach(o)},restore:function(){X(c).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)}),t.bindRenderbuffer(36161,null)}}},yt=[];yt[6408]=4,yt[6407]=3;var xt=[];xt[5121]=1,xt[5126]=4,xt[36193]=2;var bt=["x","y","z","w"],_t="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),wt={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},kt={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},At={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Tt={cw:2304,ccw:2305},Mt=new D(!1,!1,!1,function(){});return function(t){function e(){if(0===Z.length)w&&w.update(),Q=null;else{Q=H.next(e),f();for(var t=Z.length-1;0<=t;--t){var r=Z[t];r&&r(O,null,0)}g.flush(),w&&w.update()}}function r(){!Q&&0=Z.length&&n()}}}}function c(){var t=Y.viewport,e=Y.scissor_box;t[0]=t[1]=e[0]=e[1]=0,O.viewportWidth=O.framebufferWidth=O.drawingBufferWidth=t[2]=e[2]=g.drawingBufferWidth,O.viewportHeight=O.framebufferHeight=O.drawingBufferHeight=t[3]=e[3]=g.drawingBufferHeight}function f(){O.tick+=1,O.time=v(),c(),G.procs.poll()}function h(){c(),G.procs.refresh(),w&&w.update()}function v(){return(q()-k)/1e3}if(!(t=i(t)))return null;var g=t.gl,m=g.getContextAttributes();g.isContextLost();var y=function(t,e){function r(e){var r;e=e.toLowerCase();try{r=n[e]=t.getExtension(e)}catch(t){}return!!r}for(var n={},i=0;ie;++e)tt(j({framebuffer:t.framebuffer.faces[e]},t),l);else tt(t,l);else l(0,t)},prop:U.define.bind(null,1),context:U.define.bind(null,2),this:U.define.bind(null,3),draw:s({}),buffer:function(t){return P.create(t,34962,!1,!1)},elements:function(t){return D.create(t,!1)},texture:R.create2D,cube:R.createCube,renderbuffer:F.create,framebuffer:V.create,framebufferCube:V.createCube,attributes:m,frame:u,on:function(t,e){var r;switch(t){case"frame":return u(e);case"lost":r=$;break;case"restore":r=J;break;case"destroy":r=K}return r.push(e),{cancel:function(){for(var t=0;t + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ +"use strict";var n,i="";e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("expected a string");if(1===e)return t;if(2===e)return t+t;var r=t.length*e;if(n!==t||void 0===n)n=t,i="";else if(i.length>=r)return i.substr(0,r);for(;r>i.length&&e>1;)1&e&&(i+=t),e>>=1,t+=t;return i=(i+=t).substr(0,r)}},{}],491:[function(t,r,n){(function(t){r.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],492:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var a=r,o=t[i],s=(r=a+o)-a,l=o-s;l&&(t[--n]=r,r=l)}for(var u=0,i=n;i>1;return["sum(",t(e.slice(0,r)),",",t(e.slice(r)),")"].join("")}(e)}function c(t){var e=new Function("sum","scale","prod","compress",["function robustDeterminant",t,"(m){return compress(",u(function(t){for(var e=new Array(t),r=0;r>1;return["sum(",u(t.slice(0,e)),",",u(t.slice(e)),")"].join("")}function c(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var r=t.split("[");return["w",e.substr(1),"m",r[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return c(e,t)}function f(t){if(2===t.length)return[["diff(",c(t[0][0],t[1][1]),",",c(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r0&&r.push(","),r.push("[");for(var o=0;o0&&r.push(","),o===i?r.push("+b[",a,"]"):r.push("+A[",a,"][",o,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var s=new Function("det",r.join(""));return s(t<6?n[t]:n)}var o=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;o.length>1;return["sum(",u(t.slice(0,e)),",",u(t.slice(e)),")"].join("")}function c(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=3.3306690738754716e-16*n;return o>=s||o<=-s?o:h(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],u=r[1]-n[1],c=t[2]-n[2],f=e[2]-n[2],h=r[2]-n[2],d=a*u,v=o*l,g=o*s,m=i*u,y=i*l,x=a*s,b=c*(d-v)+f*(g-m)+h*(y-x),_=(Math.abs(d)+Math.abs(v))*Math.abs(c)+(Math.abs(g)+Math.abs(m))*Math.abs(f)+(Math.abs(y)+Math.abs(x))*Math.abs(h),w=7.771561172376103e-16*_;return b>w||-b>w?b:p(t,e,r,n)}];!function(){for(;d.length<=s;)d.push(f(d.length));for(var t=[],r=["slow"],n=0;n<=s;++n)t.push("a"+n),r.push("o"+n);for(var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"],n=2;n<=s;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i0&&o>0||a<0&&o<0)return!1;var s=n(r,t,e),l=n(i,t,e);return!(s>0&&l>0||s<0&&l<0)&&(0!==a||0!==o||0!==s||0!==l||function(t,e,r,n){for(var i=0;i<2;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),u=r[i],c=n[i],f=Math.min(u,c),h=Math.max(u,c);if(h=n?(i=f,(l+=1)=n?(i=f,(l+=1)0?1:0}},{}],504:[function(t,e,r){"use strict";e.exports=function(t){return i(n(t))};var n=t("boundary-cells"),i=t("reduce-simplicial-complex")},{"boundary-cells":88,"reduce-simplicial-complex":484}],505:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){if(r=r||0,void 0===s&&(s=function(t){for(var e=t.length,r=0,n=0;n>1,v=E[2*m+1];","if(v===b){return m}","if(b0&&l.push(","),l.push("[");for(var n=0;n0&&l.push(","),l.push("B(C,E,c[",i[0],"],c[",i[1],"])")}l.push("]")}l.push(");")}}for(var a=t+1;a>1;--a){a>1,s=a(t[o],e);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function c(t,e){for(var r=new Array(t.length),i=0,o=r.length;i=t.length||0!==a(t[g],s)););}return r}function f(t,e){if(e<0)return[];for(var r=[],i=(1<>>c&1&&u.push(i[c]);e.push(u)}return s(e)},r.skeleton=f,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function x(t){for(var e=m(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=y(t);if(r>=0){var n=m(r);if(e0){var t=A[0];return g(0,E-1),E-=1,x(0),t}return-1}function w(t,e){var r=A[t];return u[r]===e?t:(u[r]=-1/0,b(t),_(),u[r]=e,b((E+=1)-1))}function k(t){if(!c[t]){c[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),T[e]>=0&&w(T[e],v(e)),T[r]>=0&&w(T[r],v(r))}}for(var A=[],T=new Array(a),f=0;f>1;f>=0;--f)x(f);for(;;){var S=_();if(S<0||u[S]>r)break;k(S)}for(var C=[],f=0;f=0&&r>=0&&e!==r){var n=T[e],i=T[r];n!==i&&O.push([n,i])}}),i.unique(i.normalize(O)),{positions:C,edges:O}};var n=t("robust-orientation"),i=t("simplicial-complex")},{"robust-orientation":497,"simplicial-complex":509}],512:[function(t,e,r){"use strict";e.exports=function(t,e){var r,a,o,s;if(e[0][0]e[1][0]))return i(e,t);r=e[1],a=e[0]}if(t[0][0]t[1][0]))return-i(t,e);o=t[1],s=t[0]}var l=n(r,a,s),u=n(r,a,o);if(l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=n(s,o,a),u=n(s,o,r),l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return a[0]-s[0]};var n=t("robust-orientation");function i(t,e){var r,i,a,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),u=Math.min(e[0][1],e[1][1]),c=Math.max(e[0][1],e[1][1]);return lc?s-c:l-c}r=e[1],i=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{var l=c(t.right,e);if(l)return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l=c(t.right,e);if(l)return l;t=t.left}}return r}function f(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function h(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}l.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=c(this.slabs[e],t),i=-1;if(r&&(i=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var l=c(this.slabs[e-1],t);l&&(s?o(l.key,s)>0&&(s=l.key,i=l.value):(i=l.value,s=l.key))}var f=this.horizontal[e];if(f.length>0){var h=n.ge(f,t[1],u);if(h=f.length)return i;p=f[h]}}if(p.start)if(s){var d=a(s[0],s[1],[t[0],p.y]);s[0][0]>s[1][0]&&(d=-d),d>0&&(i=p.index)}else i=p.index;else p.y!==t[1]&&(i=p.index)}}}return i}},{"./lib/order-segments":512,"binary-search-bounds":84,"functional-red-black-tree":229,"robust-orientation":497}],514:[function(t,e,r){"use strict";var n=t("robust-dot-product"),i=t("robust-sum");function a(t,e){var r=i(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var i=n-e,a=-e/i;a<0?a=0:a>1&&(a=1);for(var o=1-a,s=t.length,l=new Array(s),u=0;u0||i>0&&c<0){var f=o(s,c,l,i);r.push(f),n.push(f.slice())}c<0?n.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=c}return{positive:r,negative:n}},e.exports.positive=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&u<0)&&r.push(o(i,u,s,n)),u>=0&&r.push(s.slice()),n=u}return r},e.exports.negative=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&u<0)&&r.push(o(i,u,s,n)),u<=0&&r.push(s.slice()),n=u}return r}},{"robust-dot-product":494,"robust-sum":502}],515:[function(t,e,r){!function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(r){return function(r,n){var i,a,o,s,l,u,c,f,h,p=1,d=r.length,v="";for(a=0;a=0),s.type){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,s.width?parseInt(s.width):0);break;case"e":i=s.precision?parseFloat(i).toExponential(s.precision):parseFloat(i).toExponential();break;case"f":i=s.precision?parseFloat(i).toFixed(s.precision):parseFloat(i);break;case"g":i=s.precision?String(Number(i.toPrecision(s.precision))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=s.precision?i.substring(0,s.precision):i;break;case"t":i=String(!!i),i=s.precision?i.substring(0,s.precision):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=s.precision?i.substring(0,s.precision):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=s.precision?i.substring(0,s.precision):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}t.json.test(s.type)?v+=i:(!t.number.test(s.type)||f&&!s.sign?h="":(h=f?"+":"-",i=i.toString().replace(t.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(h+i).length,l=s.width&&c>0?u.repeat(c):"",v+=s.align?h+i+l:"0"===u?h+l+i:l+h+i)}return v}(function(e){if(i[e])return i[e];for(var r,n=e,a=[],o=0;n;){if(null!==(r=t.text.exec(n)))a.push(r[0]);else if(null!==(r=t.modulo.exec(n)))a.push("%");else{if(null===(r=t.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){o|=1;var s=[],l=r[2],u=[];if(null===(u=t.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=t.key_access.exec(l)))s.push(u[1]);else{if(null===(u=t.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(u[1])}r[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}n=n.substring(r[0].length)}return i[e]=a}(r),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}var i=Object.create(null);void 0!==r&&(r.sprintf=e,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],516:[function(t,e,r){"use strict";var n=t("parenthesis");e.exports=function(t,e,r){if(null==t)throw Error("First argument should be a string");if(null==e)throw Error("Separator should be a string or a RegExp");r?("string"==typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:("string"==typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map(function(t){return 1===t.length&&(t+=t),t}));var i=n.parse(t,{flat:!0,brackets:r.ignore}),a=i[0],o=a.split(e);if(r.escape){for(var s=[],l=0;l0;){e=u[u.length-1];var p=t[e];if(a[e]=0&&s[e].push(o[v])}a[e]=d}else{if(n[e]===r[e]){for(var g=[],m=[],y=0,d=l.length-1;d>=0;--d){var x=l[d];if(i[x]=!1,g.push(x),m.push(s[x]),y+=s[x].length,o[x]=f.length,x===e){l.length=d;break}}f.push(g);for(var b=new Array(y),d=0;d c)|0 },"),"generic"===e&&a.push("getters:[0],");for(var s=[],l=[],u=0;u>>7){");for(var u=0;u<1<<(1<128&&u%128==0){f.length>0&&h.push("}}");var p="vExtra"+f.length;a.push("case ",u>>>7,":",p,"(m&0x7f,",l.join(),");break;"),h=["function ",p,"(m,",l.join(),"){switch(m){"],f.push(h)}h.push("case ",127&u,":");for(var d=new Array(r),v=new Array(r),g=new Array(r),m=new Array(r),y=0,x=0;xx)&&!(u&1<<_)!=!(u&1<0&&(T="+"+g[b]+"*c");var M=d[b].length/y*.5,E=.5+m[b]/y*.5;A.push("d"+b+"-"+E+"-"+M+"*("+d[b].join("+")+T+")/("+v[b].join("+")+")")}h.push("a.push([",A.join(),"]);","break;")}a.push("}},"),f.length>0&&h.push("}}");for(var S=[],u=0;u<1<1&&(l=1),l<-1&&(l=-1),i*Math.acos(l)};r.default=function(t){var e=t.px,r=t.py,l=t.cx,u=t.cy,c=t.rx,f=t.ry,h=t.xAxisRotation,p=void 0===h?0:h,d=t.largeArcFlag,v=void 0===d?0:d,g=t.sweepFlag,m=void 0===g?0:g,y=[];if(0===c||0===f)return[];var x=Math.sin(p*i/360),b=Math.cos(p*i/360),_=b*(e-l)/2+x*(r-u)/2,w=-x*(e-l)/2+b*(r-u)/2;if(0===_&&0===w)return[];c=Math.abs(c),f=Math.abs(f);var k=Math.pow(_,2)/Math.pow(c,2)+Math.pow(w,2)/Math.pow(f,2);k>1&&(c*=Math.sqrt(k),f*=Math.sqrt(k));var A=function(t,e,r,n,a,o,l,u,c,f,h,p){var d=Math.pow(a,2),v=Math.pow(o,2),g=Math.pow(h,2),m=Math.pow(p,2),y=d*v-d*m-v*g;y<0&&(y=0),y/=d*m+v*g;var x=(y=Math.sqrt(y)*(l===u?-1:1))*a/o*p,b=y*-o/a*h,_=f*x-c*b+(t+r)/2,w=c*x+f*b+(e+n)/2,k=(h-x)/a,A=(p-b)/o,T=(-h-x)/a,M=(-p-b)/o,E=s(1,0,k,A),S=s(k,A,T,M);return 0===u&&S>0&&(S-=i),1===u&&S<0&&(S+=i),[_,w,E,S]}(e,r,l,u,c,f,v,m,x,b,_,w),T=n(A,4),M=T[0],E=T[1],S=T[2],C=T[3],L=Math.abs(C)/(i/4);Math.abs(1-L)<1e-7&&(L=1);var O=Math.max(Math.ceil(L),1);C/=O;for(var I=0;Ie[2]&&(e[2]=u[c+0]),u[c+1]>e[3]&&(e[3]=u[c+1]);return e}},{"abs-svg-path":53,assert:61,"is-svg-path":419,"normalize-svg-path":521,"parse-svg-path":455}],521:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,u=0,c=null,f=null,h=0,p=0,d=0,v=t.length;d4?(o=g[g.length-4],s=g[g.length-3]):(o=h,s=p),r.push(g)}return r};var n=t("svg-arc-to-cubic-bezier");function i(t,e,r,n){return["C",t,e,r,n,r,n]}function a(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}},{"svg-arc-to-cubic-bezier":519}],522:[function(t,e,r){"use strict";var n,i=t("svg-path-bounds"),a=t("parse-svg-path"),o=t("draw-svg-path"),s=t("is-svg-path"),l=t("bitmap-sdf"),u=document.createElement("canvas"),c=u.getContext("2d");e.exports=function(t,e){if(!s(t))throw Error("Argument should be valid svg path string");var r,f;e||(e={}),e.shape?(r=e.shape[0],f=e.shape[1]):(r=u.width=e.w||e.width||200,f=u.height=e.h||e.height||200);var h=Math.min(r,f),p=e.stroke||0,d=e.viewbox||e.viewBox||i(t),v=[r/(d[2]-d[0]),f/(d[3]-d[1])],g=Math.min(v[0]||0,v[1]||0)/2;if(c.fillStyle="black",c.fillRect(0,0,r,f),c.fillStyle="white",p&&("number"!=typeof p&&(p=1),c.strokeStyle=p>0?"white":"black",c.lineWidth=Math.abs(p)),c.translate(.5*r,.5*f),c.scale(g,g),function(){if(null!=n)return n;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return n=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var r=t.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var m=new Path2D(t);c.fill(m),p&&c.stroke(m)}else{var y=a(t);o(c,y),c.fill(),p&&c.stroke()}return c.setTransform(1,0,0,1,0,0),l(c,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*h})}},{"bitmap-sdf":86,"draw-svg-path":162,"is-svg-path":419,"parse-svg-path":455,"svg-path-bounds":520}],523:[function(t,e,r){(function(r){"use strict";e.exports=function t(e,r,i){var i=i||{},o=a[e];o||(o=a[e]={" ":{data:new Float32Array(0),shape:.2}});var s=o[r];if(!s)if(r.length<=1||!/\d/.test(r))s=o[r]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,a=0,o=0;o0&&(f+=.02);for(var p=new Float32Array(c),d=0,v=-.5*f,h=0;h1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=L(t,360),e=L(e,100),r=L(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,f,p),d=!0,v="hsl"),e.hasOwnProperty("a")&&(c=e.a)),c=C(c),{ok:d,format:e.format||v,r:o(255,s(u.r,0)),g:o(255,s(u.g,0)),b:o(255,s(u.b,0)),a:c}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=a(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=c.ok,this._tc_id=i++}function c(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),u=(a+l)/2;if(a==l)n=i=0;else{var c=a-l;switch(i=u>.5?c/(2-a-l):c/(a+l),a){case t:n=(e-r)/c+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(u(n));return a}function M(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:i,v:a})),a=(a+s)%1;return o}u.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,i,a,o,s=this.toRgb();return e=s.r/255,r=s.g/255,n=s.b/255,i=e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4),a=r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4),o=n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4),.2126*i+.7152*a+.0722*o},setAlpha:function(t){return this._a=C(t),this._roundA=a(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[P(a(t).toString(16)),P(a(e).toString(16)),P(a(r).toString(16)),P(z(n))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*L(this._r,255))+"%",g:a(100*L(this._g,255))+"%",b:a(100*L(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*L(this._r,255))+"%, "+a(100*L(this._g,255))+"%, "+a(100*L(this._b,255))+"%)":"rgba("+a(100*L(this._r,255))+"%, "+a(100*L(this._g,255))+"%, "+a(100*L(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+p(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=u(t);r="#"+p(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0,i=!e&&n&&("hex"===t||"hex6"===t||"hex3"===t||"hex4"===t||"hex8"===t||"name"===t);return i?"name"===t&&0===this._a?this.toName():this.toRgbString():("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return u(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(v,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(A,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:D(t[n]));t=r}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,r){r=0===r?0:r||50;var n=u(t).toRgb(),i=u(e).toRgb(),a=r/100,o={r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a};return u(o)},u.readability=function(e,r){var n=u(e),i=u(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,i,a,o,s,l=u.readability(t,e);switch(i=!1,(a=r,o=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase(),s=(a.size||"small").toLowerCase(),"AA"!==o&&"AAA"!==o&&(o="AA"),"small"!==s&&"large"!==s&&(s="small"),n={level:o,size:s}).level+n.size){case"AAsmall":case"AAAlarge":i=l>=4.5;break;case"AAlarge":i=l>=3;break;case"AAAsmall":i=l>=7}return i},u.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var c=0;cl&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],r))};var E=u.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(E);function C(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function L(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function O(t){return o(1,s(0,t))}function I(t){return parseInt(t,16)}function P(t){return 1==t.length?"0"+t:""+t}function D(t){return t<=1&&(t=100*t+"%"),t}function z(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return I(t)/255}var F,B,N,j=(B="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",N="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+N),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+N),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+N),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function V(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=u:window.tinycolor=u}(Math)},{}],525:[function(t,e,r){"use strict";e.exports=i,e.exports.float32=e.exports.float=i,e.exports.fract32=e.exports.fract=function(t){if(t.length){for(var e=i(t),r=0,n=e.length;rf&&(f=l[0]),l[1]h&&(h=l[1])}function i(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(i);break;case"Point":n(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(n)}}if(!e){var a,o,s=r(t),l=new Array(2),u=1/0,c=u,f=-u,h=-u;for(o in t.arcs.forEach(function(t){for(var e=-1,r=t.length;++ef&&(f=l[0]),l[1]h&&(h=l[1])}),t.objects)i(t.objects[o]);e=t.bbox=[u,c,f,h]}return e},i=function(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r};function a(t,e){var r=e.id,n=e.bbox,i=null==e.properties?{}:e.properties,a=o(t,e);return null==r&&null==n?{type:"Feature",properties:i,geometry:a}:null==n?{type:"Feature",id:r,properties:i,geometry:a}:{type:"Feature",id:r,bbox:n,properties:i,geometry:a}}function o(t,e){var n=r(t),a=t.arcs;function o(t,e){e.length&&e.pop();for(var r=a[t<0?~t:t],o=0,s=r.length;o1)n=function(t,e,r){var n,i=[],a=[];function o(t){var e=t<0?~t:t;(a[e]||(a[e]=[])).push({i:t,g:n})}function s(t){t.forEach(o)}function l(t){t.forEach(s)}return function t(e){switch(n=e,e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"LineString":s(e.arcs);break;case"MultiLineString":case"Polygon":l(e.arcs);break;case"MultiPolygon":e.arcs.forEach(l)}}(e),a.forEach(null==r?function(t){i.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&i.push(t[0].i)}),i}(0,e,r);else for(i=0,n=new Array(a=t.arcs.length);i1)for(var a,o,u=1,c=l(i[0]);uc&&(o=i[0],i[0]=i[u],i[u]=o,c=a);return i})}}var c=function(t,e){for(var r=0,n=t.length;r>>1;t[i]=2))throw new Error("n must be ≥2");if(t.transform)throw new Error("already quantized");var r,i=n(t),a=i[0],o=(i[2]-a)/(e-1)||1,s=i[1],l=(i[3]-s)/(e-1)||1;function u(t){t[0]=Math.round((t[0]-a)/o),t[1]=Math.round((t[1]-s)/l)}function c(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(c);break;case"Point":u(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(u)}}for(r in t.arcs.forEach(function(t){for(var e,r,n,i=1,u=1,c=t.length,f=t[0],h=f[0]=Math.round((f[0]-a)/o),p=f[1]=Math.round((f[1]-s)/l);iMath.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=t[l]*t[l],o+=i[l]*t[l];for(var l=0;l<3;++l)i[l]-=o/a*t[l];return s(i,i),i}function h(t,e,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var u=0;u<16;++u)this.computedMatrix[u]=.5;this.recalcMatrix(0)}var p=h.prototype;p.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},p.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},p.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,n=0,i=0,a=0;a<3;++a)i+=e[a]*r[a],n+=e[a]*e[a];for(var l=Math.sqrt(n),c=0,a=0;a<3;++a)r[a]-=e[a]*i/n,c+=r[a]*r[a],e[a]/=l;for(var f=Math.sqrt(c),a=0;a<3;++a)r[a]/=f;var h=this.computedToward;o(h,e,r),s(h,h);for(var p=Math.exp(this.computedRadius[0]),d=this.computedAngle[0],v=this.computedAngle[1],g=Math.cos(d),m=Math.sin(d),y=Math.cos(v),x=Math.sin(v),b=this.computedCenter,_=g*y,w=m*y,k=x,A=-g*x,T=-m*x,M=y,E=this.computedEye,S=this.computedMatrix,a=0;a<3;++a){var C=_*r[a]+w*h[a]+k*e[a];S[4*a+1]=A*r[a]+T*h[a]+M*e[a],S[4*a+2]=C,S[4*a+3]=0}var L=S[1],O=S[5],I=S[9],P=S[2],D=S[6],z=S[10],R=O*z-I*D,F=I*P-L*z,B=L*D-O*P,N=u(R,F,B);R/=N,F/=N,B/=N,S[0]=R,S[4]=F,S[8]=B;for(var a=0;a<3;++a)E[a]=b[a]+S[2+4*a]*p;for(var a=0;a<3;++a){for(var c=0,j=0;j<3;++j)c+=S[a+4*j]*E[j];S[12+a]=-c}S[15]=1},p.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var d=[0,0,0];p.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;d[0]=i[2],d[1]=i[6],d[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,u=0;u<3;++u)i[4*u]=o[u],i[4*u+1]=s[u],i[4*u+2]=l[u];a(i,i,n,d);for(var u=0;u<3;++u)o[u]=i[4*u],s[u]=i[4*u+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},p.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=u(a,o,s);a/=l,o/=l,s/=l;var c=i[0],f=i[4],h=i[8],p=c*a+f*o+h*s,d=u(c-=a*p,f-=o*p,h-=s*p),v=(c/=d)*e+a*r,g=(f/=d)*e+o*r,m=(h/=d)*e+s*r;this.center.move(t,v,g,m);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+n),this.radius.set(t,Math.log(y))},p.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},p.setMatrix=function(t,e,r,n){var a=1;"number"==typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[a],l=e[a+4],f=e[a+8];if(n){var h=Math.abs(s),p=Math.abs(l),d=Math.abs(f),v=Math.max(h,p,d);h===v?(s=s<0?-1:1,l=f=0):d===v?(f=f<0?-1:1,s=l=0):(l=l<0?-1:1,s=f=0)}else{var g=u(s,l,f);s/=g,l/=g,f/=g}var m,y,x=e[o],b=e[o+4],_=e[o+8],w=x*s+b*l+_*f,k=u(x-=s*w,b-=l*w,_-=f*w),A=l*(_/=k)-f*(b/=k),T=f*(x/=k)-s*_,M=s*b-l*x,E=u(A,T,M);if(A/=E,T/=E,M/=E,this.center.jump(t,q,G,W),this.radius.idle(t),this.up.jump(t,s,l,f),this.right.jump(t,x,b,_),2===a){var S=e[1],C=e[5],L=e[9],O=S*x+C*b+L*_,I=S*A+C*T+L*M;m=R<0?-Math.PI/2:Math.PI/2,y=Math.atan2(I,O)}else{var P=e[2],D=e[6],z=e[10],R=P*s+D*l+z*f,F=P*x+D*b+z*_,B=P*A+D*T+z*M;m=Math.asin(c(R)),y=Math.atan2(B,F)}this.angle.jump(t,y,m),this.recalcMatrix(t);var N=e[2],j=e[6],V=e[10],U=this.computedMatrix;i(U,e);var H=U[15],q=U[12]/H,G=U[13]/H,W=U[14]/H,Y=Math.exp(this.computedRadius[0]);this.center.jump(t,q-N*Y,G-j*Y,W-V*Y)},p.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},p.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},p.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},p.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},p.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=u(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=e[0]-r[0],f=e[1]-r[1],h=e[2]-r[2],p=u(l,f,h);if(!(p<1e-6)){l/=p,f/=p,h/=p;var d=this.computedRight,v=d[0],g=d[1],m=d[2],y=i*v+a*g+o*m,x=u(v-=y*i,g-=y*a,m-=y*o);if(!(x<.01&&(x=u(v=a*h-o*f,g=o*l-i*h,m=i*f-a*l))<1e-6)){v/=x,g/=x,m/=x,this.up.set(t,i,a,o),this.right.set(t,v,g,m),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(p));var b=a*m-o*g,_=o*v-i*m,w=i*g-a*v,k=u(b,_,w),A=i*l+a*f+o*h,T=v*l+g*f+m*h,M=(b/=k)*l+(_/=k)*f+(w/=k)*h,E=Math.asin(c(A)),S=Math.atan2(M,T),C=this.angle._state,L=C[C.length-1],O=C[C.length-2];L%=2*Math.PI;var I=Math.abs(L+2*Math.PI-S),P=Math.abs(L-S),D=Math.abs(L-2*Math.PI-S);I0?r.pop():new ArrayBuffer(t)}function h(t){return new Uint8Array(f(t),0,t)}function p(t){return new Uint16Array(f(2*t),0,t)}function d(t){return new Uint32Array(f(4*t),0,t)}function v(t){return new Int8Array(f(t),0,t)}function g(t){return new Int16Array(f(2*t),0,t)}function m(t){return new Int32Array(f(4*t),0,t)}function y(t){return new Float32Array(f(4*t),0,t)}function x(t){return new Float64Array(f(8*t),0,t)}function b(t){return o?new Uint8ClampedArray(f(t),0,t):h(t)}function _(t){return new DataView(f(t),0,t)}function w(t){t=i.nextPow2(t);var e=i.log2(t),n=u[e];return n.length>0?n.pop():new r(t)}n.free=function(t){if(r.isBuffer(t))u[i.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,n=0|i.log2(e);l[n].push(t)}},n.freeUint8=n.freeUint16=n.freeUint32=n.freeInt8=n.freeInt16=n.freeInt32=n.freeFloat32=n.freeFloat=n.freeFloat64=n.freeDouble=n.freeUint8Clamped=n.freeDataView=function(t){c(t.buffer)},n.freeArrayBuffer=c,n.freeBuffer=function(t){u[i.log2(t.length)].push(t)},n.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return f(t);switch(e){case"uint8":return h(t);case"uint16":return p(t);case"uint32":return d(t);case"int8":return v(t);case"int16":return g(t);case"int32":return m(t);case"float":case"float32":return y(t);case"double":case"float64":return x(t);case"uint8_clamped":return b(t);case"buffer":return w(t);case"data":case"dataview":return _(t);default:return null}return null},n.mallocArrayBuffer=f,n.mallocUint8=h,n.mallocUint16=p,n.mallocUint32=d,n.mallocInt8=v,n.mallocInt16=g,n.mallocInt32=m,n.mallocFloat32=n.mallocFloat=y,n.mallocFloat64=n.mallocDouble=x,n.mallocUint8Clamped=b,n.mallocDataView=_,n.mallocBuffer=w,n.clearCache=function(){for(var t=0;t<32;++t)s.UINT8[t].length=0,s.UINT16[t].length=0,s.UINT32[t].length=0,s.INT8[t].length=0,s.INT16[t].length=0,s.INT32[t].length=0,s.FLOAT[t].length=0,s.DOUBLE[t].length=0,s.UINT8C[t].length=0,l[t].length=0,u[t].length=0}}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":85,buffer:98,dup:164}],533:[function(t,e,r){"use strict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(a=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts)),r.font=[n.fontStyle,n.fontVariant,n.fontWeight,a+"px",n.font].filter(function(t){return t}).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",w(function(t,e,r,n,a,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(k=0;k-1?parseInt(t[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(F(),"?px "),M*=Math.pow(.75,l-s),n=n.replace("?px ",F())),T+=.25*C*(l-s)}if(!0===o.superscripts){var u=t.indexOf(d),f=r.indexOf(d),p=u>-1?parseInt(t[1+u]):0,v=f>-1?parseInt(r[1+f]):0;p!==v&&(n=n.replace(F(),"?px "),M*=Math.pow(.75,v-p),n=n.replace("?px ",F())),T-=.25*C*(v-p)}if(!0===o.bolds){var g=t.indexOf(c)>-1,y=r.indexOf(c)>-1;!g&&y&&(n=x?n.replace("italic ","italic bold "):"bold "+n),g&&!y&&(n=n.replace("bold ",""))}if(!0===o.italics){var x=t.indexOf(h)>-1,b=r.indexOf(h)>-1;!x&&b&&(n="italic "+n),x&&!b&&(n=n.replace("italic ",""))}e.font=n}for(w=0;w",a="",o=i.length,s=a.length,l=e[0]===d||e[0]===m,u=0,c=-s;u>-1&&-1!==(u=r.indexOf(i,u))&&-1!==(c=r.indexOf(a,u+o))&&!(c<=u);){for(var f=u;f=c)n[f]=null,r=r.substr(0,f)+" "+r.substr(f+1);else if(null!==n[f]){var h=n[f].indexOf(e[0]);-1===h?n[f]+=e:l&&(n[f]=n[f].substr(0,h+1)+(1+parseInt(n[f][h+1]))+n[f].substr(h+2))}var p=u+o,v=r.substr(p,c-p),g=v.indexOf(i);u=-1!==g?g:c+s}return n}function b(t,e){var r=n(t,128);return e?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function _(t,e,r,n){var i=b(t,n),a=function(t,e,r){for(var n=e.textAlign||"start",i=e.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l=0?e[a]:i})},has___:{value:x(function(e){var n=y(e);return n?r in n:t.indexOf(e)>=0})},set___:{value:x(function(n,i){var a,o=y(n);return o?o[r]=i:(a=t.indexOf(n))>=0?e[a]=i:(a=t.length,e[a]=i,t[a]=n),this})},delete___:{value:x(function(n){var i,a,o=y(n);return o?r in o&&delete o[r]:!((i=t.indexOf(n))<0||(a=t.length-1,t[i]=void 0,e[i]=e[a],t[i]=t[a],t.length=a,e.length=a,0))})}})};v.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof r?function(){function n(){this instanceof v||b();var e,n=new r,i=void 0,a=!1;return e=t?function(t,e){return n.set(t,e),n.has(t)||(i||(i=new v),i.set(t,e)),this}:function(t,e){if(a)try{n.set(t,e)}catch(r){i||(i=new v),i.set___(t,e)}else n.set(t,e);return this},Object.create(v.prototype,{get___:{value:x(function(t,e){return i?n.has(t)?n.get(t):i.get___(t,e):n.get(t,e)})},has___:{value:x(function(t){return n.has(t)||!!i&&i.has___(t)})},set___:{value:x(e)},delete___:{value:x(function(t){var e=!!n.delete(t);return i&&i.delete___(t)||e})},permitHostObjects___:{value:x(function(t){if(t!==g)throw new Error("bogus call to permitHostObjects___");a=!0})}})}t&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=v.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=v)}function g(t){t.permitHostObjects___&&t.permitHostObjects___(g)}function m(t){return!(t.substr(0,l.length)==l&&"___"===t.substr(t.length-3))}function y(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[u];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,u,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function x(t){return t.prototype=null,Object.freeze(t)}function b(){p||"undefined"==typeof console||(p=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},{}],540:[function(t,e,r){var n=t("./hidden-store.js");e.exports=function(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:n(e,t)}}},{"./hidden-store.js":541}],541:[function(t,e,r){e.exports=function(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}},{}],542:[function(t,e,r){var n=t("./create-store.js");e.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},{"./create-store.js":540}],543:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":231}],544:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(t,e){if("string"==typeof t){var r=t.match(l);return r?r[0]:""}var n=this._validateYear(t),i=t.month(),a=""+this.toChineseMonth(n,i);return e&&a.length<2&&(a="0"+a),this.isIntercalaryMonth(n,i)&&(a+="i"),a},monthNames:function(t){if("string"==typeof t){var e=t.match(u);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=this.toChineseMonth(r,n),a=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][i-1];return this.isIntercalaryMonth(r,n)&&(a="闰"+a),a},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(c);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=this.toChineseMonth(r,n),a=["一","二","三","四","五","六","七","八","九","十","十一","十二"][i-1];return this.isIntercalaryMonth(r,n)&&(a="闰"+a),a},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"闰"===e[0]&&(r=!0,e=e.substring(1)),"月"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(e);else{var i=e[e.length-1];r="i"===i||"I"===i}var a=this.toMonthIndex(t,n,r);return a},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var i=this.intercalaryMonth(t),a=r&&e!==i;if(a||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!r&&e<=i?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(t=t.year(),e=t.month());var r=this.intercalaryMonth(t),i=r?12:11;if(e<0||e>i)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13;return r},isIntercalaryMonth:function(t,e){t.year&&(t=t.year(),e=t.month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var i,o=this._validateYear(t,n.local.invalidyear),s=h[o-h[0]],l=s>>9&4095,u=s>>5&15,c=31&s;(i=a.newDate(l,u,c)).add(4-(i.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-i.toJD();return 1+Math.floor(f/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=f[t-f[0]],i=r>>13,a=i?12:11;if(e>a)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);var o=r&1<<12-e?30:29;return o},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(i.year()),e=i.month(),r=i.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,i){var a,o,s;if("object"==typeof t)o=t,a=e||{};else{var l="number"==typeof t&&t>=1888&&t<=2111;if(!l)throw new Error("Lunar year outside range 1888-2111");var u="number"==typeof e&&e>=1&&e<=12;if(!u)throw new Error("Lunar month outside range 1 - 12");var c,p="number"==typeof r&&r>=1&&r<=30;if(!p)throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(c=!1,a=n):(c=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:c}}s=o.day-1;var d,v=f[o.year-f[0]],g=v>>13;d=g?o.month>g?o.month:o.isIntercalary?o.month:o.month-1:o.month-1;for(var m=0;m>9&4095,(x>>5&15)-1,(31&x)+s);return a.year=b.getFullYear(),a.month=1+b.getMonth(),a.day=b.getDate(),a}(t,s,r,o);return a.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=a.fromJD(t),r=function(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{var o="number"==typeof t&&t>=1888&&t<=2111;if(!o)throw new Error("Solar year outside range 1888-2111");var s="number"==typeof e&&e>=1&&e<=12;if(!s)throw new Error("Solar month outside range 1 - 12");var l="number"==typeof r&&r>=1&&r<=31;if(!l)throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var u=h[i.year-h[0]],c=i.year<<9|i.month<<5|i.day;a.year=c>=u?i.year:i.year-1,u=h[a.year-h[0]];var p,d=new Date(u>>9&4095,(u>>5&15)-1,31&u),v=new Date(i.year,i.month-1,i.day);p=Math.round((v-d)/864e5);var g,m=f[a.year-f[0]];for(g=0;g<13;g++){var y=m&1<<12-g?30:29;if(p>13;return!x||g=2&&n<=6},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((i.year()-1)/100)+1]||""}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year()+(i.year()<0?1:0),e=i.month(),(r=i.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=a},{"../main":558,"object-assign":449}],547:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),t=e.year()+(e.year()<0?1:0);return t%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return(t=i.year())<0&&t++,i.day()+30*(i.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),n.calendars.ethiopian=a},{"../main":558,"object-assign":449}],548:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return t=e.year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),12===e&&this.leapYear(t)?30:8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t<=0?t+1:t,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(var s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=a},{"../main":558,"object-assign":449}],549:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(11*e.year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),r=i.day(),t=t<=0?t+1:t,r+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.islamic=a},{"../main":558,"object-assign":449}],550:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),t=e.year()<0?e.year()+1:e.year();return t%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),r=i.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5),r=e+1524,n=Math.floor((r-122.1)/365.25),i=Math.floor(365.25*n),a=Math.floor((r-i)/30.6001),o=a-Math.floor(a<14?1:13),s=n-Math.floor(o>2?4716:4715),l=r-i-Math.floor(30.6001*a);return s<=0&&s--,this.newDate(s,o,l)}}),n.calendars.julian=a},{"../main":558,"object-assign":449}],551:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=e.year();var r=Math.floor(t/400);t%=400,t+=t<0?400:0;var i=Math.floor(t/20);return r+"."+i+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return i.day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate),a=i.toJD(),o=this._toHaab(a),s=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[o[0]-1],haabMonth:o[0],haabDay:o[1],tzolkinDayName:this.local.tzolkinMonths[s[0]-1],tzolkinDay:s[0],tzolkinTrecena:s[1]}},_toHaab:function(t){var e=o(8+(t-=this.jdEpoch)+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s(20+(t-=this.jdEpoch),20),s(t+4,13)]},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),n.calendars.mayan=a},{"../main":558,"object-assign":449}],552:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar;var o=n.instance("gregorian");i(a.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidMonth),t=i.year();t<0&&t++;for(var a=i.day(),s=1;s=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),n.calendars.nanakshahi=a},{"../main":558,"object-assign":449}],553:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);if(t=e.year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var r=0,i=this.minMonth;i<=12;i++)r+=this.NEPALI_CALENDAR_DATA[t][i];return r},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=n.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var u=t-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(u)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(u,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance(),r=e.fromJD(t),i=r.year(),a=r.dayOfYear(),o=i+56;this._createMissingCalendarData(o);for(var s=9,l=this.NEPALI_CALENDAR_DATA[o][0],u=this.NEPALI_CALENDAR_DATA[o][s]-l+1;a>u;)++s>12&&(s=1,o++),u+=this.NEPALI_CALENDAR_DATA[o][s];var c=this.NEPALI_CALENDAR_DATA[o][s]-(u-a);return this.newDate(o,s,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t-(t>=0?474:473),s=474+o(a,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(a/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),i=2820;if(1029982!==n){var a=Math.floor(n/366),s=o(n,366);i=Math.floor((2134*a+2816*s+2815)/1028522)+a+1}var l=i+2820*r+474;l=l<=0?l-1:l;var u=t-this.toJD(l,1,1)+1,c=u<=186?Math.ceil(u/31):Math.ceil((u-6)/30),f=t-this.toJD(l,c,1)+1;return this.newDate(l,c,f)}}),n.calendars.persian=a,n.calendars.jalali=a},{"../main":558,"object-assign":449}],555:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate),t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":558,"object-assign":449}],556:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate),t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),n.calendars.thai=o},{"../main":558,"object-assign":449}],557:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,n.local.invalidMonth),i=r.toJD()-24e5+.5,a=0,s=0;si)return o[a]-o[a-1];a++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate),a=12*(i.year()-1)+i.month()-15292,s=i.day()+o[a-1]-1;return s+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,u=e-o[r-1]+1;return this.newDate(s,l,u)},isValid:function(t,e,r){var i=n.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(t=null!=t.year?t.year:t,i=t>=1276&&t<=1500),i},_validate:function(t,e,r,i){var a=n.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),n.calendars.ummalqura=a;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":558,"object-assign":449}],558:[function(t,e,r){var n=t("object-assign");function i(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function a(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(i.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,i){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,i):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,function(e){return t[e]})}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(a.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(u.local.differentCalendars||u.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new a(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return e.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+o(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0),i=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(function(t){for(;oe-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),u=i-(l>2.5?4716:4715);return u<=0&&u--,this.newDate(u,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var u=e.exports=new i;u.cdate=a,u.baseCalendar=s,u.calendars.gregorian=l},{"object-assign":449}],559:[function(t,e,r){var n=t("object-assign"),i=t("./main");n(i.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),i.local=i.regionalOptions[""],n(i.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,r){if("string"!=typeof t&&(r=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw i.local.invalidFormat||i.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,a,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,u=r.dayNames||this.local.dayNames,c=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,h=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),d=function(t,e,r,n){var i=""+e;if(p(t,n))for(;i.length1},x=function(t,r){var n=y(t,r),a=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=e.substring(T).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,T);return T+=s[0].length,parseInt(s[0],10)},b=this,_=function(){if("function"==typeof l){y("m");var t=l.call(b,e.substring(T));return T+=t.length,t}return x("m")},w=function(t,r,n,a){for(var o=y(t,a)?n:r,s=0;s-1){p=1,d=v;for(var S=this.daysInMonth(h,p);d>S;S=this.daysInMonth(h,p))p++,d-=S}return f>-1?this.fromJD(f):this.newDate(h,p,d)},determineDate:function(t,e,r,n,i){r&&"object"!=typeof r&&(i=n,n=r,r=null),"string"!=typeof n&&(i=n,n="");var a=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":558,"object-assign":449}],560:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":139}],561:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":560}],562:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],563:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:i({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../plot_api/plot_template":741,"../../plots/cartesian/constants":757,"../../plots/font_attributes":777,"./arrow_paths":562}],564:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach(function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref);e._extremes={},r&&s(e,r),n&&s(e,n)})}function s(t,e){var r,n=e._id,a=n.charAt(0),o=t[a],s=t["a"+a],l=t[a+"ref"],u=t["a"+a+"ref"],c=t["_"+a+"padplus"],f=t["_"+a+"padminus"],h={x:1,y:-1}[a]*t[a+"shift"],p=3*t.arrowsize*t.arrowwidth||0,d=p+h,v=p-h,g=3*t.startarrowsize*t.arrowwidth||0,m=g+h,y=g-h;if(u===l){var x=i.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:v}),b=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,m),ppadminus:Math.max(f,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else m=s?m+s:m,y=s?y-s:y,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,d,m),ppadminus:Math.max(f,v,y)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.annotations);if(r.length&&t._fullData.length)return n.syncOrAsync([a,o],t)}},{"../../lib":703,"../../plots/cartesian/axes":751,"./draw":569}],565:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,i,a,o,l,u,c=t._fullLayout.annotations,f=[],h=[],p=[],d=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),f={},h=t._fullLayout.annotations;if(u.length||c.length){for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var q=!1,G=["x","y"],W=0;W1)&&(tt===Q?((ut=et.r2fraction(e["a"+K]))<0||ut>1)&&(q=!0):q=!0),Y=et._offset+et.r2p(e[K]),$=.5}else"x"===K?(Z=e[K],Y=b.l+b.w*Z):(Z=1-e[K],Y=b.t+b.h*Z),$=e.showarrow?.5:Z;if(e.showarrow){lt.head=Y;var ct=e["a"+K];J=nt*H(.5,e.xanchor)-it*H(.5,e.yanchor),tt===Q?(lt.tail=et._offset+et.r2p(ct),X=J):(lt.tail=Y+ct,X=J+ct),lt.text=lt.tail+J;var ft=x["x"===K?"width":"height"];if("paper"===Q&&(lt.head=o.constrain(lt.head,1,ft-1)),"pixel"===tt){var ht=-Math.max(lt.tail-3,lt.text),pt=Math.min(lt.tail+3,lt.text)-ft;ht>0?(lt.tail+=ht,lt.text+=ht):pt>0&&(lt.tail-=pt,lt.text-=pt)}lt.tail+=st,lt.head+=st}else J=at*H($,ot),X=J,lt.text=Y+J;lt.text+=st,J+=st,X+=st,e["_"+K+"padplus"]=at/2+X,e["_"+K+"padminus"]=at/2-X,e["_"+K+"size"]=at,e["_"+K+"shift"]=J}if(t._dragging||!q){var dt=0,vt=0;if("left"!==e.align&&(dt=(I-y)*("center"===e.align?.5:1)),"top"!==e.valign&&(vt=(z-w)*("middle"===e.valign?.5:1)),d)c.select("svg").attr({x:R+dt-1,y:R+vt}).call(u.setClipUrl,B?M:null,t);else{var gt=R+vt-m.top,mt=R+dt-m.left;U.call(f.positionText,mt,gt).call(u.setClipUrl,B?M:null,t)}N.select("rect").call(u.setRect,R,R,I,z),F.call(u.setRect,D/2,D/2,j-D,V-D),P.call(u.setTranslate,Math.round(E.x.text-j/2),Math.round(E.y.text-V/2)),L.attr({transform:"rotate("+S+","+E.x.text+","+E.y.text+")"});var yt,xt=function(r,n){C.selectAll(".annotation-arrow-g").remove();var c=E.x.head,f=E.y.head,h=E.x.tail+r,d=E.y.tail+n,m=E.x.text+r,y=E.y.text+n,x=o.rotationXYMatrix(S,m,y),w=o.apply2DTransform(x),M=o.apply2DTransform2(x),O=+F.attr("width"),I=+F.attr("height"),D=m-.5*O,z=D+O,R=y-.5*I,B=R+I,N=[[D,R,D,B],[D,B,z,B],[z,B,z,R],[z,R,D,R]].map(M);if(!N.reduce(function(t,e){return t^!!o.segmentsIntersect(c,f,c+1e6,f+1e6,e[0],e[1],e[2],e[3])},!1)){N.forEach(function(t){var e=o.segmentsIntersect(h,d,c,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,d=e.y)});var j=e.arrowwidth,V=e.arrowcolor,U=e.arrowside,H=C.append("g").style({opacity:l.opacity(V)}).classed("annotation-arrow-g",!0),q=H.append("path").attr("d","M"+h+","+d+"L"+c+","+f).style("stroke-width",j+"px").call(l.stroke,l.rgb(V));if(v(q,U,e),_.annotationPosition&&q.node().parentNode&&!a){var G=c,W=f;if(e.standoff){var Y=Math.sqrt(Math.pow(c-h,2)+Math.pow(f-d,2));G+=e.standoff*(h-c)/Y,W+=e.standoff*(d-f)/Y}var X,Z,$=H.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-G)+","+(d-W),transform:"translate("+G+","+W+")"}).style("stroke-width",j+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");p.init({element:$.node(),gd:t,prepFn:function(){var t=u.getTranslate(P);X=t.x,Z=t.y,s&&s.autorange&&k(s._name+".autorange",!0),g&&g.autorange&&k(g._name+".autorange",!0)},moveFn:function(t,r){var n=w(X,Z),i=n[0]+t,a=n[1]+r;P.call(u.setTranslate,i,a),A("x",s?s.p2r(s.r2p(e.x)+t):e.x+t/b.w),A("y",g?g.p2r(g.r2p(e.y)+r):e.y-r/b.h),e.axref===e.xref&&A("ax",s.p2r(s.r2p(e.ax)+t)),e.ayref===e.yref&&A("ay",g.p2r(g.r2p(e.ay)+r)),H.attr("transform","translate("+t+","+r+")"),L.attr({transform:"rotate("+S+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",t,T());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};e.showarrow&&xt(0,0),O&&p.init({element:P.node(),gd:t,prepFn:function(){yt=L.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?A("ax",s.p2r(s.r2p(e.ax)+t)):A("ax",e.ax+t),e.ayref===e.yref?A("ay",g.p2r(g.r2p(e.ay)+r)):A("ay",e.ay+r),xt(t,r);else{if(a)return;var i,o;if(s)i=s.p2r(s.r2p(e.x)+t);else{var l=e._xsize/b.w,u=e.x+(e._xshift-e.xshift)/b.w-l/2;i=p.align(u+t/b.w,l,0,1,e.xanchor)}if(g)o=g.p2r(g.r2p(e.y)+r);else{var c=e._ysize/b.h,f=e.y-(e._yshift+e.yshift)/b.h-c/2;o=p.align(f-r/b.h,c,0,1,e.yanchor)}A("x",i),A("y",o),s&&g||(n=p.getCursor(s?.5:i,g?.5:o,e.xanchor,e.yanchor))}L.attr({transform:"translate("+t+","+r+")"+yt}),h(P,n)},doneFn:function(){h(P),i.call("_guiRelayout",t,T());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}else P.remove()}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,g=e.indexOf("end")>=0,m=f.backoff*p+r.standoff,y=h.backoff*d+r.startstandoff;if("line"===c.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},s={x:+t.attr("x2"),y:+t.attr("y2")};var x=o.x-s.x,b=o.y-s.y;if(l=Math.atan2(b,x),u=l+Math.PI,m&&y&&m+y>Math.sqrt(x*x+b*b))return void I();if(m){if(m*m>x*x+b*b)return void I();var _=m*Math.cos(l),w=m*Math.sin(l);s.x+=_,s.y+=w,t.attr({x2:s.x,y2:s.y})}if(y){if(y*y>x*x+b*b)return void I();var k=y*Math.cos(l),A=y*Math.sin(l);o.x-=k,o.y-=A,t.attr({x1:o.x,y1:o.y})}}else if("path"===c.nodeName){var T=c.getTotalLength(),M="";if(T1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":800,"../annotations/draw":569}],576:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(r)for(var a=r.attrRegex,o=Object.keys(t),s=0;s=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}a.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},a.rgb=function(t){return a.tinyRGB(n(t))},a.opacity=function(t){return t?n(t).getAlpha():0},a.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},a.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||l).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},a.contrast=function(t,e,r){var i=n(t);1!==i.getAlpha()&&(i=n(a.combine(t,l)));var o=i.isDark()?e?i.lighten(e):l:r?i.darken(r):s;return o.toString()},a.stroke=function(t,e){var r=n(e);t.style({stroke:a.tinyRGB(r),"stroke-opacity":r.getAlpha()})},a.fill=function(t,e){var r=n(e);t.style({fill:a.tinyRGB(r),"fill-opacity":r.getAlpha()})},a.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,o=Object.keys(t);for(e=0;e0?n>=l:n<=l));i++)n>c&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var Z=Math.pow(10,Math.floor(Math.log(X)/Math.LN10));W*=Z*u.roundUp(X/Z,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=W}G.domain=[U+N,U+R-N],G.setScale(),t.attr("transform","translate("+Math.round(l.l)+","+Math.round(l.t)+")");var $,J=t.select("."+A.cbtitleunshift).attr("transform","translate(-"+Math.round(l.l)+",-"+Math.round(l.t)+")"),K=t.select("."+A.cbaxis),Q=0;function tt(n,i){var a={propContainer:G,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+A.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),d.draw(r,n,c(a,i||{}))}return u.syncOrAsync([a.previousPromises,function(){if(-1!==["top","bottom"].indexOf(T)){var t,r=l.l+(e.x+F)*l.w,n=G.title.font.size;t="top"===T?(1-(U+R-N))*l.h+l.t+3+.75*n:(1-(U+N))*l.h+l.t-3-.25*n,tt(G._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(T)){var a=t.select("."+A.cbtitle),o=a.select("text"),c=[-e.outlinewidth/2,e.outlinewidth/2],f=a.select(".h"+G._id+"title-math-group").node(),p=15.6;if(o.node()&&(p=parseInt(o.node().style.fontSize,10)*_),f?(Q=h.bBox(f).height)>p&&(c[1]-=(Q-p)/2):o.node()&&!o.classed(A.jsPlaceholder)&&(Q=h.bBox(o.node()).height),Q){if(Q+=5,"top"===T)G.domain[1]-=Q/l.h,c[1]*=-1;else{G.domain[0]+=Q/l.h;var d=v.lineCount(o);c[1]+=(1-d)*p}a.attr("transform","translate("+c+")"),G.setScale()}}t.selectAll("."+A.cbfills+",."+A.cblines).attr("transform","translate(0,"+Math.round(l.h*(1-G.domain[1]))+")"),K.attr("transform","translate(0,"+Math.round(-l.t)+")");var m=t.select("."+A.cbfills).selectAll("rect."+A.cbfill).data(O);m.enter().append("rect").classed(A.cbfill,!0).style("stroke","none"),m.exit().remove();var y=M.map(G.c2p).map(Math.round).sort(function(t,e){return t-e});m.each(function(t,a){var o=[0===a?M[0]:(O[a]+O[a-1])/2,a===O.length-1?M[1]:(O[a]+O[a+1])/2].map(G.c2p).map(Math.round);o[1]=u.constrain(o[1]+(o[1]>o[0])?1:-1,y[0],y[1]);var s=n.select(this).attr({x:j,width:Math.max(P,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)h.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=S(t).replace("e-","");s.attr("fill",i(l).toHexString())}});var x=t.select("."+A.cblines).selectAll("path."+A.cbline).data(g.color&&g.width?I:[]);x.enter().append("path").classed(A.cbline,!0),x.exit().remove(),x.each(function(t){n.select(this).attr("d","M"+j+","+(Math.round(G.c2p(t))+g.width/2%1)+"h"+P).call(h.lineGroupStyle,g.width,E(t),g.dash)}),K.selectAll("g."+G._id+"tick,path").remove();var b=j+P+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),w=s.calcTicks(G),k=s.makeTransFn(G),C=s.getTickSigns(G)[2];return s.drawTicks(r,G,{vals:"inside"===G.ticks?s.clipEnds(G,w):w,layer:K,path:s.makeTickPath(G,b,C),transFn:k}),s.drawLabels(r,G,{vals:w,layer:K,transFn:k,labelFns:s.makeLabelFns(G,b)})},function(){if(-1===["top","bottom"].indexOf(T)){var t=G.title.font.size,e=G._offset+G._length/2,i=l.l+(G.position||0)*l.w+("right"===G.side?10+t*(G.showticklabels?1:.5):-10-t*(G.showticklabels?.5:0));tt("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:T,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:i,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},a.previousPromises,function(){var n=P+e.outlinewidth/2+h.bBox(K.node()).width;if(($=J.select("text")).node()&&!$.classed(A.jsPlaceholder)){var i,o=J.select(".h"+G._id+"title-math-group").node();i=o&&-1!==["top","bottom"].indexOf(T)?h.bBox(o).width:h.bBox(J.node()).right-j-l.l,n=Math.max(n,i)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,u=H-q;t.select("."+A.cbbg).attr({x:j-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:q-B,width:Math.max(s,2),height:Math.max(u+2*B,2)}).call(p.fill,e.bgcolor).call(p.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+A.cboutline).attr({x:j,y:q+e.ypad+("top"===T?Q:0),width:Math.max(P,2),height:Math.max(u-2*e.ypad-Q,2)}).call(p.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var c=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform","translate("+(l.l-c)+","+l.t+")");var f={},d=w[e.yanchor],v=k[e.yanchor];"pixels"===e.lenmode?(f.y=e.y,f.t=u*d,f.b=u*v):(f.t=f.b=0,f.yt=e.y+e.len*d,f.yb=e.y-e.len*v);var g=w[e.xanchor],m=k[e.xanchor];if("pixels"===e.thicknessmode)f.x=e.x,f.l=s*g,f.r=s*m;else{var y=s-P;f.l=y*g,f.r=y*m,f.xl=e.x-e.thickness*g,f.xr=e.x+e.thickness*m}a.autoMargin(r,e._id,f)}],r)}e.exports={draw:function(t){var e=t._fullLayout._infolayer.selectAll("g."+A.colorbar).data(function(t){var e,r,n,i,a=t._fullLayout,o=t.calcdata,s=[];function l(t){return c(t,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function u(){"function"==typeof i.calc?i.calc(t,n,e):(e._fillgradient=r.reversescale?g(r.colorscale):r.colorscale,e._zrange=[r[i.min],r[i.max]])}for(var f=0;fv-p?p=v-(d-v):d-v=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":703,"./helpers":591,"fast-isnumeric":224}],589:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./helpers").hasColorscale,a=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,i){var o=i.container?n.nestedProperty(t,i.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=a(o),l=s.auto;(l||void 0===s.min)&&r(o,i.min),(l||void 0===s.max)&&r(o,i.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function d(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,u=new Array(l),c=0;c4/3-s?o:s}},{}],597:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":703}],598:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),i=t("has-hover"),a=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=t("../../constants/interactions"),u=e.exports={};u.align=t("./align"),u.getCursor=t("./cursor");var c=t("./unhover");function f(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function h(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}u.unhover=c.wrapped,u.unhoverRaw=c.raw,u.init=function(t){var e,r,n,c,p,d,v,g,m=t.gd,y=1,x=l.DBLCLICKDELAY,b=t.element;m._mouseDownTime||(m._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=w,a?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=w,b.addEventListener("touchstart",w,{passive:!1})):b.ontouchstart=w;var _=t.clampFn||function(t,e,r){return Math.abs(t)x&&(y=Math.max(y-1,1)),m._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(y,d),!g){var r;try{r=new MouseEvent("click",e)}catch(t){var n=h(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}v.dispatchEvent(r)}m._dragging=!1,m._dragged=!1}else m._dragged=!1}},u.coverSlip=f},{"../../constants/interactions":679,"../../lib":703,"../../plots/cartesian/constants":757,"./align":596,"./cursor":597,"./unhover":599,"has-hover":405,"has-passive-events":406,"mouse-event-offset":431}],599:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/get_graph_div"),o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/events":692,"../../lib/get_graph_div":699,"../../lib/throttle":728,"../fx/constants":613}],600:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],601:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../../registry"),s=t("../color"),l=t("../colorscale"),u=t("../../lib"),c=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),h=t("../../constants/alignment"),p=h.LINE_SPACING,d=t("../../constants/interactions").DESELECTDIM,v=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),m=e.exports={};m.font=function(t,e,r,n){u.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(s.fill,n)},m.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},m.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},m.setRect=function(t,e,r,n,i){t.call(m.setPosition,e,r).call(m.setSize,n,i)},m.translatePoint=function(t,e,r,n){var a=r.c2p(t.x),o=n.c2p(t.y);return!!(i(a)&&i(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",o):e.attr("transform","translate("+a+","+o+")"),!0)},m.translatePoints=function(t,e,r){t.each(function(t){var i=n.select(this);m.translatePoint(t,i,e,r)})},m.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},m.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each(function(e){var a=e[0].trace,s=a.xcalendar,l=a.ycalendar,u=o.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(u).each(function(t){m.hideOutsideRangePoint(t,n.select(this),r,i,s,l)})})}},m.crispRound=function(t,e,r){return e&&i(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},m.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,l=i||a.dash||"";s.stroke(e,n||a.color),m.dashLine(e,l,o)},m.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each(function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,l=i||a.dash||"";n.select(this).call(s.stroke,r||a.color).call(m.dashLine,l,o)})},m.dashLine=function(t,e,r){r=+r||0,e=m.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},m.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},m.singleFillStyle=function(t){var e=n.select(t.node()),r=e.data(),i=(((r[0]||[])[0]||{}).trace||{}).fillcolor;i&&t.call(s.fill,i)},m.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(t){var e=n.select(this);t[0].trace&&e.call(s.fill,t[0].trace.fillcolor)})};var y=t("./symbol_defs");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolNoFill={},m.symbolList=[],Object.keys(y).forEach(function(t){var e=y[t];m.symbolList=m.symbolList.concat([e.n,t,e.n+100,t+"-open"]),m.symbolNames[e.n]=t,m.symbolFuncs[e.n]=e.f,e.needLine&&(m.symbolNeedLines[e.n]=!0),e.noDot?m.symbolNoDot[e.n]=!0:m.symbolList=m.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"]),e.noFill&&(m.symbolNoFill[e.n]=!0)});var x=m.symbolNames.length,b="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";function _(t,e){var r=t%100;return m.symbolFuncs[r](e)+(t>=200?b:"")}m.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=m.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=x||t>=400?0:Math.floor(Math.max(t,0))};var w={x1:1,x2:0,y1:0,y2:0},k={x1:0,x2:0,y1:1,y2:0},A=n.format("~.1f"),T={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:w},horizontalreversed:{node:"linearGradient",attrs:w,reversed:!0},vertical:{node:"linearGradient",attrs:k},verticalreversed:{node:"linearGradient",attrs:k,reversed:!0}};m.gradient=function(t,e,r,i,o,l){for(var c=o.length,f=T[i],h=new Array(c),p=0;p=100,e.attr("d",_(c,l))}var f,h,p,d=!1;if(t.so)p=o.outlierwidth,h=o.outliercolor,f=a.outliercolor;else{var v=(o||{}).width;p=(t.mlw+1||v+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in t?t.mlcc=n.lineScale(t.mlc):u.isArrayOrTypedArray(o.color)?s.defaultLine:o.color,u.isArrayOrTypedArray(a.color)&&(f=s.defaultLine,d=!0),f="mc"in t?t.mcc=n.markerScale(t.mc):a.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(t))}if(t.om)e.call(s.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",p+"px");var g=a.gradient,y=t.mgt;if(y?d=!0:y=g&&g.type,Array.isArray(y)&&(y=y[0],T[y]||(y=0)),y&&"none"!==y){var x=t.mgc;x?d=!0:x=g.color;var b=r.uid;d&&(b+="-"+t.i),m.gradient(e,i,b,y,[[0,x],[1,f]],"fill")}else s.fill(e,f);p&&s.stroke(e,h)}},m.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=m.tryColorscale(r,""),e.lineScale=m.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=v.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&u.extendFlat(e,m.makeSelectedPointStyleFns(t)),e},m.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.marker||{},a=r.marker||{},s=n.marker||{},l=i.opacity,c=a.opacity,f=s.opacity,h=void 0!==c,p=void 0!==f;(u.isArrayOrTypedArray(l)||h||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?i.opacity:t.mo;return t.selected?h?c:e:p?f:d*e});var v=i.color,g=a.color,m=s.color;(g||m)&&(e.selectedColorFn=function(t){var e=t.mcc||v;return t.selected?g||e:m||e});var y=i.size,x=a.size,b=s.size,_=void 0!==x,w=void 0!==b;return o.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?x/2:e:w?b/2:e}),e},m.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},l=i.color,u=a.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||l;return t.selected?u||e:c||(u?e:s.addOpacity(e,d))},e},m.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=m.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push(function(t,e){t.style("opacity",r.selectedOpacityFn(e))}),r.selectedColorFn&&a.push(function(t,e){s.fill(t,r.selectedColorFn(e))}),r.selectedSizeFn&&a.push(function(t,e){var n=e.mx||i.symbol||0,a=r.selectedSizeFn(e);t.attr("d",_(m.symbolNumber(n),a)),e.mrc2=a}),a.length&&t.each(function(t){for(var e=n.select(this),r=0;r0?r:0}m.textPointStyle=function(t,e,r){if(t.size()){var i;if(e.selectedpoints){var a=m.makeSelectedTextStyleFns(e);i=a.selectedTextColorFn}t.each(function(t){var a=n.select(this),o=u.extractOption(t,e,"tx","text");if(o||0===o){var s=t.tp||e.textposition,l=S(t,e),f=i?i(t):t.tc||e.textfont.color;a.call(m.font,t.tf||e.textfont.family,l,f).text(o).call(c.convertToTspans,r).call(E,s,l,t.mrc)}else a.remove()})}},m.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=m.makeSelectedTextStyleFns(e);t.each(function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,l=S(t,e);s.fill(i,a),E(i,o,l,t.mrc2||t.mrc)})}};var C=.5;function L(t,e,r,i){var a=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],u=Math.pow(a*a+o*o,C/2),c=Math.pow(s*s+l*l,C/2),f=(c*c*a-u*u*s)*i,h=(c*c*o-u*u*l)*i,p=3*c*(u+c),d=3*u*(u+c);return[[n.round(e[0]+(p&&f/p),2),n.round(e[1]+(p&&h/p),2)],[n.round(e[0]-(d&&f/d),2),n.round(e[1]-(d&&h/d),2)]]}m.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=1e4&&(m.savedBBoxes={},P=0),r&&(m.savedBBoxes[r]=g),P++,u.extendFlat({},g)},m.setClipUrl=function(t,e,r){t.attr("clip-path",z(e,r))},m.getTranslate=function(t){var e=t.attr?"attr":"getAttribute",r=t[e]("transform")||"",n=r.replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+n[0]||0,y:+n[1]||0}},m.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=" translate("+e+", "+r+")").trim(),t[i]("transform",a),a},m.getScale=function(t){var e=t.attr?"attr":"getAttribute",r=t[e]("transform")||"",n=r.replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+n[0]||1,y:+n[1]||1}},m.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+=" scale("+e+", "+r+")").trim(),t[i]("transform",a),a};var R=/\s*sc.*/;m.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":" scale("+e+","+r+")";t.each(function(){var t=(this.getAttribute("transform")||"").replace(R,"");t=(t+=n).trim(),this.setAttribute("transform",t)})}};var F=/translate\([^)]*\)\s*$/;m.setTextPointsScale=function(t,e,r){t&&t.each(function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(F);t=1===e&&1===r?[]:["translate("+o+","+s+")","scale("+e+","+r+")","translate("+-o+","+-s+")"],l&&t.push(l),i.attr("transform",t.join(" "))}})}},{"../../constants/alignment":675,"../../constants/interactions":679,"../../constants/xmlns_namespaces":681,"../../lib":703,"../../lib/svg_text_utils":727,"../../registry":831,"../../traces/scatter/make_bubble_size_func":1091,"../../traces/scatter/subtypes":1098,"../color":580,"../colorscale":592,"./symbol_defs":602,d3:157,"fast-isnumeric":224,tinycolor2:524}],602:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+e+","+r+"H"+e+"L0,-"+i+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+e+",-"+r+"H"+e+"L0,"+i+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M"+r+",-"+e+"V"+e+"L-"+i+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+r+",-"+e+"V"+e+"L"+i+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(-.309*t,2),o=n.round(.809*t,2);return"M"+e+","+a+"L"+r+","+o+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),u=n.round(.118*e,2),c=n.round(.809*e,2),f=n.round(.382*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+u+"L"+o+","+c+"L0,"+f+"L-"+o+","+c+"L-"+a+","+u+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0,noFill:!0}}},{d3:157}],603:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],604:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../registry"),a=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,i){var l=e["error_"+i]||{},u=l.visible&&-1!==["linear","log"].indexOf(r.type),c=[];if(u){for(var f=s(l),h=0;h0;e.each(function(e){var f,h=e[0].trace,p=h.error_x||{},d=h.error_y||{};h.ids&&(f=function(t){return t.id});var v=o.hasMarkers(h)&&h.marker.maxdisplayed>0;d.visible||p.visible||(e=[]);var g=n.select(this).selectAll("g.errorbar").data(e,f);if(g.exit().remove(),e.length){p.visible||g.selectAll("path.xerror").remove(),d.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var m=g.enter().append("g").classed("errorbar",!0);c&&m.style("opacity",0).transition().duration(s.duration).style("opacity",1),a.setClipUrl(g,r.layerClipId,t),g.each(function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0))),void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0))),n}(t,l,u);if(!v||t.vis){var a,o=e.select("path.yerror");if(d.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var f=d.width;a="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(a+="m-"+f+",0h"+2*f),o.size()?c&&(o=o.transition().duration(s.duration).ease(s.easing)):o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0),o.attr("d",a)}else o.remove();var h=e.select("path.xerror");if(p.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var g=(p.copy_ystyle?d:p).width;a="M"+r.xh+","+(r.y-g)+"v"+2*g+"m0,-"+g+"H"+r.xs,r.noXS||(a+="m0,-"+g+"v"+2*g),h.size()?c&&(h=h.transition().duration(s.duration).ease(s.easing)):h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0),h.attr("d",a)}else h.remove()}})}})}},{"../../traces/scatter/subtypes":1098,"../drawing":601,d3:157,"fast-isnumeric":224}],609:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)})}},{"../color":580,d3:157}],610:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("./layout_attributes").hoverlabel,a=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:a({},i.bgcolor,{arrayOk:!0}),bordercolor:a({},i.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:a({},i.align,{arrayOk:!0}),namelength:a({},i.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":693,"../../plots/font_attributes":777,"./layout_attributes":620}],611:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.indexw[0]._length||et<0||et>k[0]._length)return h.unhoverRaw(t,e)}if(e.pointerX=tt+w[0]._offset,e.pointerY=et+k[0]._offset,z="xval"in e?v.flat(l,e.xval):v.p2c(w,tt),R="yval"in e?v.flat(l,e.yval):v.p2c(k,et),!i(z[0])||!i(R[0]))return o.warn("Fx.hover failed",e,t),h.unhoverRaw(t,e)}var it=1/0;for(B=0;BY&&($.splice(0,Y),it=$[0].distance),y&&0!==Z&&0===$.length){W.distance=Z,W.index=!1;var ut=j._module.hoverPoints(W,q,G,"closest",c._hoverlayer);if(ut&&(ut=ut.filter(function(t){return t.spikeDistance<=Z})),ut&&ut.length){var ct,ft=ut.filter(function(t){return t.xa.showspikes});if(ft.length){var ht=ft[0];i(ht.x0)&&i(ht.y0)&&(ct=gt(ht),(!K.vLinePoint||K.vLinePoint.spikeDistance>ct.spikeDistance)&&(K.vLinePoint=ct))}var pt=ut.filter(function(t){return t.ya.showspikes});if(pt.length){var dt=pt[0];i(dt.x0)&&i(dt.y0)&&(ct=gt(dt),(!K.hLinePoint||K.hLinePoint.spikeDistance>ct.spikeDistance)&&(K.hLinePoint=ct))}}}}function vt(t,e){for(var r,n=null,i=1/0,a=0;a1||$.length>1)||"closest"===D&&Q&&$.length>1,Ot=f.combine(c.plot_bgcolor||f.background,c.paper_bgcolor),It={hovermode:D,rotateLabels:Lt,bgColor:Ot,container:c._hoverlayer,outerContainer:c._paperdiv,commonLabelOpts:c.hoverlabel,hoverdistance:c.hoverdistance},Pt=T($,It,t);if(function(t,e,r){var n,i,a,o,s,l,u,c=0,f=1,h=t.size(),p=new Array(h);function d(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}for(t.each(function(t,n){var i=t[e],a="x"===i._id.charAt(0),o=i.range;!n&&o&&o[0]>o[1]!==a&&(f=-1),p[n]=[{datum:t,i:n,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?x:1)/2,pmin:0,pmax:a?r.width:r.height}]}),p.sort(function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)});!n&&c<=h;){for(c++,n=!0,o=0;o.01&&m.pmin===y.pmin&&m.pmax===y.pmax){for(s=g.length-1;s>=0;s--)g[s].dp+=i;for(v.push.apply(v,g),p.splice(o+1,1),u=0,s=v.length-1;s>=0;s--)u+=v[s].dp;for(a=u/v.length,s=v.length-1;s>=0;s--)v[s].dp-=a;n=!1}else o++}p.forEach(d)}for(o=p.length-1;o>=0;o--){var b=p[o];for(s=b.length-1;s>=0;s--){var _=b[s],w=_.datum;w.offset=_.dp,w.del=_.del}}}(Pt,Lt?"xa":"ya",c),M(Pt,Lt),e.target&&e.target.tagName){var Dt=d.getComponentMethod("annotations","hasClickToShow")(t,Mt);u(n.select(e.target),Dt?"pointer":"")}e.target&&!a&&function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,Tt)&&(Tt&&t.emit("plotly_unhover",{event:e,points:Tt}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:w,yaxes:k,xvals:z,yvals:R}))}(t,e,r,a)})},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=t.map(function(t){return{color:t.color||f.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,eventData:t.eventData||!1,hovertemplateLabels:t.hovertemplateLabels||!1}}),a=n.select(e.container),o=e.outerContainer?n.select(e.outerContainer):a,s={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||f.background,container:a,outerContainer:o},l=T(i,s,e.gd),u=0,c=0;return l.sort(function(t,e){return t.y0-e.y0}).each(function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function T(t,e,r){var i=r._fullLayout,a=e.hovermode,s=e.rotateLabels,u=e.bgColor,h=e.container,p=e.outerContainer,d=e.commonLabelOpts||{},v=e.fontFamily||g.HOVERFONT,y=e.fontSize||g.HOVERFONTSIZE,x=t[0],b=x.xa,_=x.ya,T="y"===a?"yLabel":"xLabel",M=x[T],E=(String(M)||"").split(" ")[0],S=p.node().getBoundingClientRect(),C=S.top,O=S.width,I=S.height,P=void 0!==M&&x.distance<=e.hoverdistance&&("x"===a||"y"===a);if(P){var D,z,R=!0;for(D=0;D"),void 0!==t.yLabel&&(p+="y: "+t.yLabel+"
"),p+=(p?"z: ":"")+t.zLabel):P&&t[a+"Label"]===M?p=t[("x"===a?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(p=t.yLabel):p=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(p+=(p?"
":"")+t.text),void 0!==t.extraText&&(p+=(p?"
":"")+t.extraText),""!==p||t.hovertemplate||(""===h&&e.remove(),p=h);var _=i._d3locale,T=t.hovertemplate||!1,E=t.hovertemplateLabels||t,S=t.eventData[0]||{};T&&(p=(p=o.hovertemplateString(T,E,_,S,t.trace._meta)).replace(A,function(e,r){return h=L(r,t.nameLength),""}));var D=e.select("text.nums").call(c.font,t.fontFamily||v,t.fontSize||y,t.fontColor||b).text(p).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r),z=e.select("text.name"),R=0,F=0;if(h&&h!==p){z.call(c.font,t.fontFamily||v,t.fontSize||y,x).text(h).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r);var B=z.node().getBoundingClientRect();R=B.width+2*k,F=B.height+2*k}else z.remove(),e.select("rect").remove();e.select("path").style({fill:g,stroke:b});var N,j,V=D.node().getBoundingClientRect(),U=t.xa._offset+(t.x0+t.x1)/2,H=t.ya._offset+(t.y0+t.y1)/2,q=Math.abs(t.x1-t.x0),G=Math.abs(t.y1-t.y0),W=V.width+w+k+R;if(t.ty0=C-V.top,t.bx=V.width+2*k,t.by=Math.max(V.height+2*k,F),t.anchor="start",t.txwidth=V.width,t.tx2width=R,t.offset=0,s)t.pos=U,N=H+G/2+W<=I,j=H-G/2-W>=0,"top"!==t.idealAlign&&N||!j?N?(H+=G/2,t.anchor="start"):t.anchor="middle":(H-=G/2,t.anchor="end");else if(t.pos=H,N=U+q/2+W<=O,j=U-q/2-W>=0,"left"!==t.idealAlign&&N||!j)if(N)U+=q/2,t.anchor="start";else{t.anchor="middle";var Y=W/2,X=U+Y-O,Z=U-Y;X>0&&(U-=X),Z<0&&(U+=-Z)}else U-=q/2,t.anchor="end";D.attr("text-anchor",t.anchor),R&&z.attr("text-anchor",t.anchor),e.attr("transform","translate("+U+","+H+")"+(s?"rotate("+m+")":""))}),N}function M(t,e){t.each(function(t){var r=n.select(this);if(t.del)return r.remove();var i=r.select("text.nums"),a=t.anchor,o="end"===a?-1:1,s={start:1,end:-1,middle:0}[a],u=s*(w+k),f=u+s*(t.txwidth+k),h=0,p=t.offset;"middle"===a&&(u-=t.tx2width/2,f+=t.txwidth/2+k),e&&(p*=-_,h=t.offset*b),r.select("path").attr("d","middle"===a?"M-"+(t.bx/2+t.tx2width/2)+","+(p-t.by/2)+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(o*w+h)+","+(w+p)+"v"+(t.by/2-w)+"h"+o*t.bx+"v-"+t.by+"H"+(o*w+h)+"V"+(p-w)+"Z");var d=u+h,v=p+t.ty0-t.by/2+k,g=t.textAlign||"auto";"auto"!==g&&("left"===g&&"start"!==a?(i.attr("text-anchor","start"),d="middle"===a?-t.bx/2-t.tx2width/2+k:-t.bx-k):"right"===g&&"end"!==a&&(i.attr("text-anchor","end"),d="middle"===a?t.bx/2-t.tx2width/2-k:t.bx+k)),i.call(l.positionText,d,v),t.tx2width&&(r.select("text.name").call(l.positionText,f+s*k+h,p+t.ty0-t.by/2+k),r.select("rect").call(c.setRect,f+(s-1)*t.tx2width/2+h,p-t.by/2-1,t.tx2width,t.by+2))})}function E(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],s=t.cd[r]||{};function l(t){return t||i(t)&&0===t}var u=Array.isArray(r)?function(t,e){var i=o.castOption(a,r,t);return l(i)?i:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function c(e,r,n){var i=u(r,n);l(i)&&(t[e]=i)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:p.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:p.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var f=p.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+p.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" ± "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=p.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+p.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" ± "+h,"y"===e&&(t.distance+=1)}var d=t.hoverinfo||t.trace.hoverinfo;return d&&"all"!==d&&(-1===(d=Array.isArray(d)?d:d.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===d.indexOf("y")&&(t.yLabel=void 0),-1===d.indexOf("z")&&(t.zLabel=void 0),-1===d.indexOf("text")&&(t.text=void 0),-1===d.indexOf("name")&&(t.name=void 0)),t}function S(t,e){var r,n,i=e.container,o=e.fullLayout,s=e.event,l=!!t.hLinePoint,u=!!t.vLinePoint;if(i.selectAll(".spikeline").remove(),u||l){var h=f.combine(o.plot_bgcolor,o.paper_bgcolor);if(l){var p,d,v=t.hLinePoint;r=v&&v.xa;var g=(n=v&&v.ya).spikesnap;"cursor"===g?(p=s.pointerX,d=s.pointerY):(p=r._offset+v.x,d=n._offset+v.y);var m,y,x=a.readability(v.color,h)<1.5?f.contrast(h):v.color,b=n.spikemode,_=n.spikethickness,w=n.spikecolor||x,k=n._boundingBox,A=(k.left+k.right)/20){for(var n=[],i=0;i-1?o="closest":(e._isHoriz=function(t,e){for(var r=e._scatterStackOpts||{},n=0;n1){if(!h&&!p&&!d){var x="independent"===T("pattern");x&&(h=!0)}g._hasSubplotGrid=h;var b,_,w="top to bottom"===T("roworder"),k=h?.2:.1,A=h?.3:.1;v&&e._splomGridDflt&&(b=e._splomGridDflt.xside,_=e._splomGridDflt.yside),g._domains={x:c("x",T,k,b,y),y:c("y",T,A,_,m,w)}}else delete e.grid}function T(t,e){return n.coerce(r,g,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,c,h=t.grid||{},p=e._subplots,d=r._hasSubplotGrid,v=r.rows,g=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(d){var x=h.subplots||[];l=r.subplots=new Array(v);var b=1;for(n=0;n1);if(!1!==x||p.uirevision){var b=a.newContainer(e,"legend");if(w("uirevision",e.uirevision),!1!==x){if(w("bgcolor",e.paper_bgcolor),w("bordercolor"),w("borderwidth"),i.coerceFont(w,"font",e.font),w("orientation"),"h"===b.orientation){var _=t.xaxis;n.getComponentMethod("rangeslider","isVisible")(_)?(u=0,f="left",c=1.1,h="bottom"):(u=0,f="left",c=-.1,h="top")}w("traceorder",g),l.isGrouped(e.legend)&&w("tracegroupgap"),w("itemsizing"),w("itemclick"),w("itemdoubleclick"),w("x",u),w("xanchor",f),w("y",c),w("yanchor",h),w("valign"),i.noneOrAll(p,b,["x","y"])}}function w(t,e){return i.coerce(p,b,o,t,e)}}},{"../../lib":703,"../../plot_api/plot_template":741,"../../plots/layout_attributes":803,"../../registry":831,"./attributes":629,"./helpers":635}],632:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),u=t("../drawing"),c=t("../color"),f=t("../../lib/svg_text_utils"),h=t("./handle_click"),p=t("./constants"),d=t("../../constants/interactions"),v=t("../../constants/alignment"),g=v.LINE_SPACING,m=v.FROM_TL,y=v.FROM_BR,x=t("./get_legend_data"),b=t("./style"),_=t("./helpers"),w=d.DBLCLICKDELAY;function k(t,e,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label);var u=s.triggerHandler(t,"plotly_legendclick",l);if(!1!==u)if(1===n)e._clickTimeout=setTimeout(function(){h(r,t,n)},w);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0;var c=s.triggerHandler(t,"plotly_legenddoubleclick",l);!1!==c&&h(r,t,n)}}function A(t,e,r){var n=t.data()[0][0],a=e._fullLayout,s=n.trace,l=o.traceIs(s,"pie-like"),c=s.index,h=e._context.edits.legendText&&!l,d=l?n.label:s.name;s._meta&&(d=i.templateString(d,s._meta));var v=i.ensureSingle(t,"text","legendtext");function m(r){f.convertToTspans(r,e,function(){!function(t,e){var r=t.data()[0][0];if(r.trace.showlegend){var n,i,a=t.select("g[class*=math-group]"),o=a.node(),s=e._fullLayout.legend.font.size*g;if(o){var l=u.bBox(o);n=l.height,i=l.width,u.setTranslate(a,0,n/4)}else{var c=t.select(".legendtext"),h=f.lineCount(c),d=c.node();n=s*h,i=d?u.bBox(d).width:0;var v=s*(.3+(1-h)/2);f.positionText(c,p.textOffsetX,v)}r.lineHeight=s,r.height=Math.max(n,16)+3,r.width=i}else t.remove()}(t,e)})}v.attr("text-anchor","start").classed("user-select-none",!0).call(u.font,a.legend.font).text(h?T(d,r):d),f.positionText(v,p.textOffsetX,0),h?v.call(f.makeEditable,{gd:e,text:d}).call(m).on("edit",function(t){this.text(T(t,r)).call(m);var a=n.trace._fullInput||{},s={};if(o.hasTransform(a,"groupby")){var l=o.getTransformIndices(a,"groupby"),u=l[l.length-1],f=i.keyedContainer(a,"transforms["+u+"].styles","target","value.name");f.set(n.trace._group,t),s=f.constructUpdate()}else s.name=t;return o.call("_guiRestyle",e,s,c)}):m(v)}function T(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function M(t,e){var r,a=1,o=i.ensureSingle(t,"rect","legendtoggle",function(t){t.style("cursor","pointer").attr("pointer-events","all").call(c.fill,"rgba(0,0,0,0)")});o.on("mousedown",function(){(r=(new Date).getTime())-e._legendMouseDownTimew&&(a=Math.max(a-1,1)),k(e,r,t,a,n.event)}})}function E(t,e,r){var a=t._fullLayout,o=a.legend,s=o.borderwidth,l=_.isGrouped(o),c=0;if(o._width=0,o._height=0,_.isVertical(o))l&&e.each(function(t,e){u.setTranslate(this,0,e*o.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;u.setTranslate(this,s,5+s+o._height+r/2),o._height+=r,o._width=Math.max(o._width,n)}),o._width+=45+2*s,o._height+=10+2*s,l&&(o._height+=(o._lgroupsLength-1)*o.tracegroupgap),c=40;else if(l){var f,h=0,p=0,d=e.data(),v=0;for(f=0;f0?o.tracegroupgap:0,w.push(A),b.push(o._width)}e.each(function(t,e){u.setTranslate(this,b[e],w[e])}),e.each(function(){var t=n.select(this),e=t.selectAll("g.traces"),r=0;e.each(function(t){var e=t[0],n=e.height;u.setTranslate(this,0,5+s+r+n/2),r+=n})});var T=w[w.length-1]+h;o._height=10+2*s+T;var M=Math.max.apply(null,b);o._width=M+p+40,o._width+=2*s}else{var E=0,S=0,C=0,L=0,O=0;r.each(function(t){C=Math.max(40+t[0].width,C),O+=40+t[0].width+5});var I=a._size.w>s+O-5;r.each(function(t){var e=t[0],r=I?40+t[0].width:C;s+L+5+r>a._size.w&&(L=0,E+=S,o._height+=S,S=0),u.setTranslate(this,s+L,5+s+e.height/2+E),o._width+=5+r,L+=5+r,S=Math.max(e.height,S)}),I?o._height=S:o._height+=S,o._width+=2*s,o._height+=10+2*s}o._width=Math.ceil(o._width),o._height=Math.ceil(o._height);var P=t._context.edits.legendText||t._context.edits.legendPosition;r.each(function(t){var e=t[0],r=n.select(this).select(".legendtoggle");u.setRect(r,0,-e.height/2,(P?0:o._width)+c,e.height)})}function S(t){var e=t._fullLayout,r=e.legend,n="left";i.isRightAnchor(r)?n="right":i.isCenterAnchor(r)&&(n="center");var o="top";i.isBottomAnchor(r)?o="bottom":i.isMiddleAnchor(r)&&(o="middle"),a.autoMargin(t,"legend",{x:r.x,y:r.y,l:r._width*m[n],r:r._width*y[n],b:r._height*y[o],t:r._height*m[o]})}e.exports=function(t){var e=t._fullLayout,r="legend"+e._uid;if(e._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var s=e.legend,f=e.showlegend&&x(t.calcdata,s),h=e.hiddenlabels||[];if(!e.showlegend||!f.length)return e._infolayer.selectAll(".legend").remove(),e._topdefs.select("#"+r).remove(),void a.autoMargin(t,"legend");for(var d=0,v=0;vf?function(t){var e=t._fullLayout.legend,r="left";i.isRightAnchor(e)?r="right":i.isCenterAnchor(e)&&(r="center"),a.autoMargin(t,"legend",{x:e.x,y:.5,l:e._width*m[r],r:e._width*y[r],b:0,t:0})}(t):S(t);var h=e._size,d=h.l+h.w*s.x,v=h.t+h.h*(1-s.y);i.isRightAnchor(s)?d-=s._width:i.isCenterAnchor(s)&&(d-=s._width/2),i.isBottomAnchor(s)?v-=s._height:i.isMiddleAnchor(s)&&(v-=s._height/2);var g=s._width,x=h.w;g>x?(d=h.l,g=x):(d+g>c&&(d=c-g),d<0&&(d=0),g=Math.min(c-d,s._width));var b,_,w,A,T=s._height,M=h.h;if(T>M?(v=h.t,T=M):(v+T>f&&(v=f-T),v<0&&(v=0),T=Math.min(f-v,s._height)),u.setTranslate(O,d,v),z.on(".drag",null),O.on("wheel",null),s._height<=T||t._context.staticPlot)P.attr({width:g-s.borderwidth,height:T-s.borderwidth,x:s.borderwidth/2,y:s.borderwidth/2}),u.setTranslate(D,0,0),I.select("rect").attr({width:g-2*s.borderwidth,height:T-2*s.borderwidth,x:s.borderwidth,y:s.borderwidth}),u.setClipUrl(D,r,t),u.setRect(z,0,0,0,0),delete s._scrollY;else{var C,B,N=Math.max(p.scrollBarMinHeight,T*T/s._height),j=T-N-2*p.scrollBarMargin,V=s._height-T,U=j/V,H=Math.min(s._scrollY||0,V);P.attr({width:g-2*s.borderwidth+p.scrollBarWidth+p.scrollBarMargin,height:T-s.borderwidth,x:s.borderwidth/2,y:s.borderwidth/2}),I.select("rect").attr({width:g-2*s.borderwidth+p.scrollBarWidth+p.scrollBarMargin,height:T-2*s.borderwidth,x:s.borderwidth,y:s.borderwidth+H}),u.setClipUrl(D,r,t),G(H,N,U),O.on("wheel",function(){G(H=i.constrain(s._scrollY+n.event.deltaY/j*V,0,V),N,U),0!==H&&H!==V&&n.event.preventDefault()});var q=n.behavior.drag().on("dragstart",function(){C=n.event.sourceEvent.clientY,B=H}).on("drag",function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||G(H=i.constrain((t.clientY-C)/U+B,0,V),N,U)});z.call(q)}function G(e,r,n){s._scrollY=t._fullLayout.legend._scrollY=e,u.setTranslate(D,0,-e),u.setRect(z,g,p.scrollBarMargin+e*n,p.scrollBarWidth,r),I.select("rect").attr({y:s.borderwidth+e})}t._context.edits.legendPosition&&(O.classed("cursor-move",!0),l.init({element:O.node(),gd:t,prepFn:function(){var t=u.getTranslate(O);w=t.x,A=t.y},moveFn:function(t,e){var r=w+t,n=A+e;u.setTranslate(O,r,n),b=l.align(r,0,h.l,h.l+h.w,s.xanchor),_=l.align(n,0,h.t+h.h,h.t,s.yanchor)},doneFn:function(){void 0!==b&&void 0!==_&&o.call("_guiRelayout",t,{"legend.x":b,"legend.y":_})},clickFn:function(r,n){var i=e._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom});i.size()>0&&k(t,O,i,r,n)}}))}],t)}}},{"../../constants/alignment":675,"../../constants/interactions":679,"../../lib":703,"../../lib/events":692,"../../lib/svg_text_utils":727,"../../plots/plots":812,"../../registry":831,"../color":580,"../dragelement":598,"../drawing":601,"./constants":630,"./get_legend_data":633,"./handle_click":634,"./helpers":635,"./style":637,d3:157}],633:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o={},s=[],l=!1,u={},c=0;function f(t,r){if(""!==t&&i.isGrouped(e))-1===s.indexOf(t)?(s.push(t),l=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+c;s.push(n),o[n]=[[r]],c++}}for(r=0;r0))return 0;i=e.width}return m?n:Math.min(i,r)}function x(t,e,r){var a=t[0].trace,o=a.marker||{},l=o.line||{},u=r?a.type===r&&a.visible:i.traceIs(a,"bar"),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(u?[t]:[]);c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.each(function(t){var e=n.select(this),r=t[0],i=y(r.mlw,o.line,v,p);e.style("stroke-width",i+"px").call(s.fill,r.mc||o.color),i&&s.stroke(e,r.mlc||l.color)})}function b(t,e,r){var o=t[0],s=o.trace,l=r?s.type===r&&s.visible:i.traceIs(s,r),f=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(f.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),f.exit().remove(),f.size()){var h=(s.marker||{}).line,d=y(c(h.width,o.pts),h,v,p),g=a.minExtend(s,{marker:{line:{width:d}}});g.marker.line.color=h.color;var m=a.minExtend(o,{trace:g});u(f,m,g)}}t.each(function(t){var e=n.select(this),r=a.ensureSingle(e,"g","layers");r.style("opacity",t[0].trace.opacity);var i=g.valign,o=t[0].lineHeight,s=t[0].height;if("middle"!==i&&o&&s){var l={top:1,bottom:-1}[i],u=l*(.5*(o-s+3));r.attr("transform","translate(0,"+u+")")}else r.attr("transform",null);var c=r.selectAll("g.legendfill").data([t]);c.enter().append("g").classed("legendfill",!0);var f=r.selectAll("g.legendlines").data([t]);f.enter().append("g").classed("legendlines",!0);var h=r.selectAll("g.legendsymbols").data([t]);h.enter().append("g").classed("legendsymbols",!0),h.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(function(t){var e=t[0].trace,r=[];"waterfall"===e.type&&e.visible&&(r=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var i=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(r);i.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),i.exit().remove(),i.each(function(t){var r=n.select(this),i=e[t[0]].marker,a=y(void 0,i.line,v,p);r.attr("d",t[1]).style("stroke-width",a+"px").call(s.fill,i.color),a&&r.call(s.stroke,i.line.color)})}).each(function(t){x(t,this,"funnel")}).each(function(t){x(t,this)}).each(function(t){var r=t[0].trace,l=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(i.traceIs(r,"box-violin")&&r.visible?[t]:[]);l.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),l.exit().remove(),l.each(function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var i=y(void 0,r.line,v,p);t.style("stroke-width",i+"px").call(s.fill,r.fillcolor),i&&s.stroke(t,r.line.color)}else{var u=a.minExtend(r,{marker:{size:m?f:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,u,e)}})}).each(function(t){b(t,this,"funnelarea")}).each(function(t){b(t,this,"pie")}).each(function(t){var r,i,s=t[0],u=s.trace,c=u.visible&&u.fill&&"none"!==u.fill,f=l.hasLines(u),p=u.contours,v=!1,g=!1;if(p){var m=p.coloring;"lines"===m?v=!0:f="none"===m||"heatmap"===m||p.showlines,"constraint"===p.type?c="="!==p._operation:"fill"!==m&&"heatmap"!==m||(g=!0)}var x=l.hasMarkers(u)||l.hasText(u),b=c||g,_=f||v,w=x||!b?"M5,0":_?"M5,-2":"M5,-3",k=n.select(this),A=k.select(".legendfill").selectAll("path").data(c||g?[t]:[]);if(A.enter().append("path").classed("js-fill",!0),A.exit().remove(),A.attr("d",w+"h30v6h-30z").call(c?o.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+u.uid;o.gradient(t,e,r,"horizontalreversed",u.colorscale,"fill")}}),f||v){var T=y(void 0,u.line,d,h);i=a.minExtend(u,{line:{width:T}}),r=[a.minExtend(s,{trace:i})]}var M=k.select(".legendlines").selectAll("path").data(f||v?[r]:[]);M.enter().append("path").classed("js-line",!0),M.exit().remove(),M.attr("d",w+(v?"l30,0.0001":"h30")).call(f?o.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+u.uid;o.lineGroupStyle(t),o.gradient(t,e,r,"horizontalreversed",u.colorscale,"stroke")}})}).each(function(t){var r,i,s=t[0],u=s.trace,c=l.hasMarkers(u),d=l.hasText(u),v=l.hasLines(u);function g(t,e,r,n){var i=a.nestedProperty(u,t).get(),o=a.isArrayOrTypedArray(i)&&e?e(i):i;if(m&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function y(t){return t[0]}if(c||d||v){var x={},b={};if(c){x.mc=g("marker.color",y),x.mx=g("marker.symbol",y),x.mo=g("marker.opacity",a.mean,[.2,1]),x.mlc=g("marker.line.color",y),x.mlw=g("marker.line.width",a.mean,[0,5],p),b.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var _=g("marker.size",a.mean,[2,16],f);x.ms=_,b.marker.size=_}v&&(b.line={width:g("line.width",y,[0,10],h)}),d&&(x.tx="Aa",x.tp=g("textposition",y),x.ts=10,x.tc=g("textfont.color",y),x.tf=g("textfont.family",y)),r=[a.minExtend(s,x)],(i=a.minExtend(u,b)).selectedpoints=null}var w=n.select(this).select("g.legendpoints"),k=w.selectAll("path.scatterpts").data(c?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),k.exit().remove(),k.call(o.pointStyle,i,e),c&&(r[0].mrc=3);var A=w.selectAll("g.pointtext").data(d?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),A.exit().remove(),A.selectAll("text").call(o.textPointStyle,i,e)}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data("candlestick"===e.type&&e.visible?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=y(void 0,a.line,v,p);i.style("stroke-width",o+"px").call(s.fill,a.fillcolor),o&&s.stroke(i,a.line.color)})}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data("ohlc"===e.type&&e.visible?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],l=y(void 0,a.line,v,p);i.style("fill","none").call(o.dashLine,a.line.dash,l),l&&s.stroke(i,a.line.color)})})}},{"../../lib":703,"../../registry":831,"../../traces/pie/helpers":1054,"../../traces/pie/style_one":1060,"../../traces/scatter/subtypes":1098,"../color":580,"../drawing":601,d3:157}],638:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../lib"),s=t("../../../build/ploticon"),l=o._,u=e.exports={};function c(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},f=a.list(t,null,!0),h="on";if("zoom"===s){var p,d="in"===l?.5:2,v=(1+d)/2,g=(1-d)/2;for(i=0;i1?(T=["toggleHover"],M=["resetViews"]):h?(A=["zoomInGeo","zoomOutGeo"],T=["hoverClosestGeo"],M=["resetGeo"]):f?(T=["hoverClosest3d"],M=["resetCameraDefault3d","resetCameraLastSave3d"]):m?(T=["toggleHover"],M=["resetViewMapbox"]):v?T=["hoverClosestGl2d"]:p?T=["hoverClosestPie"]:x?(T=["hoverClosestCartesian","hoverCompareCartesian"],M=["resetViewSankey"]):T=["toggleHover"],c&&(T=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]),!c&&!v||b||(A=["zoomIn2d","zoomOut2d","autoScale2d"],"resetViews"!==M[0]&&(M=["resetScale2d"])),f?E=["zoom3d","pan3d","orbitRotation","tableRotation"]:(c||v)&&!b||g?E=["zoom2d","pan2d"]:m||h?E=["pan2d"]:y&&(E=["zoom2d"]),function(t){for(var e=!1,r=0;r0);if(g){var m=function(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),i=0,a=0;a0?h+u:u;return{ppad:u,ppadplus:c?d:v,ppadminus:c?v:d}}return{ppad:u}}function c(t,e,r,n,i){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,u,c,f,h,p=1/0,d=-1/0,v=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;ld&&(d=h)));return d>=p?[p,d]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;o10?t/2:10;return n.append("circle").attr({"data-line-point":"start-point",cx:z?H(r.xanchor)+r.x0:H(r.x0),cy:R?q(r.yanchor)-r.y0:q(r.y0),r:a}).style(i).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:z?H(r.xanchor)+r.x1:H(r.x1),cy:R?q(r.yanchor)-r.y1:q(r.y1),r:a}).style(i).classed("cursor-grab",!0),n}():e,X={element:Y.node(),gd:t,prepFn:function(n){z&&(_=H(r.xanchor)),R&&(w=q(r.yanchor)),"path"===r.type?O=r.path:(m=z?r.x0:H(r.x0),y=R?r.y0:q(r.y0),x=z?r.x1:H(r.x1),b=R?r.y1:q(r.y1)),mb?(k=y,E="y0",A=b,S="y1"):(k=b,E="y1",A=y,S="y0"),Z(n),K(p,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),l=a.getFromId(r,i),u="";"paper"===n||o.autorange||(u+=n),"paper"===i||l.autorange||(u+=i),s.setClipUrl(t,u?"clip"+r._fullLayout._uid+u:null,r)}(e,r,t),X.moveFn="move"===I?$:J},doneFn:function(){c(e),Q(p),d(e,t,r),n.call("_guiRelayout",t,N.getUpdateObj())},clickFn:function(){Q(p)}};function Z(t){if(F)I="path"===t.target.tagName?"move":"start-point"===t.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var r=X.element.getBoundingClientRect(),n=r.right-r.left,i=r.bottom-r.top,a=t.clientX-r.left,o=t.clientY-r.top,s=!B&&n>P&&i>D&&!t.shiftKey?u.getCursor(a/n,1-o/i):"move";c(e,s),I=s.split("-")[0]}}function $(n,i){if("path"===r.type){var a=function(t){return t},o=a,s=a;z?j("xanchor",r.xanchor=G(_+n)):(o=function(t){return G(H(t)+n)},V&&"date"===V.type&&(o=h.encodeDate(o))),R?j("yanchor",r.yanchor=W(w+i)):(s=function(t){return W(q(t)+i)},U&&"date"===U.type&&(s=h.encodeDate(s))),j("path",r.path=g(O,o,s))}else z?j("xanchor",r.xanchor=G(_+n)):(j("x0",r.x0=G(m+n)),j("x1",r.x1=G(x+n))),R?j("yanchor",r.yanchor=W(w+i)):(j("y0",r.y0=W(y+i)),j("y1",r.y1=W(b+i)));e.attr("d",v(t,r)),K(p,r)}function J(n,i){if(B){var a=function(t){return t},o=a,s=a;z?j("xanchor",r.xanchor=G(_+n)):(o=function(t){return G(H(t)+n)},V&&"date"===V.type&&(o=h.encodeDate(o))),R?j("yanchor",r.yanchor=W(w+i)):(s=function(t){return W(q(t)+i)},U&&"date"===U.type&&(s=h.encodeDate(s))),j("path",r.path=g(O,o,s))}else if(F){if("resize-over-start-point"===I){var l=m+n,u=R?y-i:y+i;j("x0",r.x0=z?l:G(l)),j("y0",r.y0=R?u:W(u))}else if("resize-over-end-point"===I){var c=x+n,f=R?b-i:b+i;j("x1",r.x1=z?c:G(c)),j("y1",r.y1=R?f:W(f))}}else{var d=~I.indexOf("n")?k+i:k,N=~I.indexOf("s")?A+i:A,Y=~I.indexOf("w")?T+n:T,X=~I.indexOf("e")?M+n:M;~I.indexOf("n")&&R&&(d=k-i),~I.indexOf("s")&&R&&(N=A-i),(!R&&N-d>D||R&&d-N>D)&&(j(E,r[E]=R?d:W(d)),j(S,r[S]=R?N:W(N))),X-Y>P&&(j(C,r[C]=z?Y:G(Y)),j(L,r[L]=z?X:G(X)))}e.attr("d",v(t,r)),K(p,r)}function K(t,e){(z||R)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var a=H(z?e.xanchor:i.midRange(r?[e.x0,e.x1]:h.extractPathCoords(e.path,f.paramIsX))),o=q(R?e.yanchor:i.midRange(r?[e.y0,e.y1]:h.extractPathCoords(e.path,f.paramIsY)));if(a=h.roundPositionForSharpStrokeRendering(a,1),o=h.roundPositionForSharpStrokeRendering(o,1),z&&R){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(z){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function Q(t){t.selectAll(".visual-cue").remove()}u.init(X),Y.node().onmousemove=Z}(t,x,r,e,p)}}function d(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"");s.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function v(t,e){var r,n,o,s,l,u,c,p,d=e.type,v=a.getFromId(t,e.xref),g=a.getFromId(t,e.yref),m=t._fullLayout._size;if(v?(r=h.shapePositionToRange(v),n=function(t){return v._offset+v.r2p(r(t,!0))}):n=function(t){return m.l+m.w*t},g?(o=h.shapePositionToRange(g),s=function(t){return g._offset+g.r2p(o(t,!0))}):s=function(t){return m.t+m.h*(1-t)},"path"===d)return v&&"date"===v.type&&(n=h.decodeDate(n)),g&&"date"===g.type&&(s=h.decodeDate(s)),function(t,e,r){var n=t.path,a=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(f.segmentRE,function(t){var n=0,u=t.charAt(0),c=f.paramIsX[u],h=f.paramIsY[u],p=f.numParams[u],d=t.substr(1).replace(f.paramRE,function(t){return c[n]?t="pixel"===a?e(s)+Number(t):e(t):h[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>p&&(t="X"),t});return n>p&&(d=d.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),u+d})}(e,n,s);if("pixel"===e.xsizemode){var y=n(e.xanchor);l=y+e.x0,u=y+e.x1}else l=n(e.x0),u=n(e.x1);if("pixel"===e.ysizemode){var x=s(e.yanchor);c=x-e.y0,p=x-e.y1}else c=s(e.y0),p=s(e.y1);if("line"===d)return"M"+l+","+c+"L"+u+","+p;if("rect"===d)return"M"+l+","+c+"H"+u+"V"+p+"H"+l+"Z";var b=(l+u)/2,_=(c+p)/2,w=Math.abs(b-l),k=Math.abs(_-c),A="A"+w+","+k,T=b+w+","+_,M=b+","+(_-k);return"M"+T+A+" 0 1,1 "+M+A+" 0 0,1 "+T+"Z"}function g(t,e,r){return t.replace(f.segmentRE,function(t){var n=0,i=t.charAt(0),a=f.paramIsX[i],o=f.paramIsY[i],s=f.numParams[i],l=t.substr(1).replace(f.paramRE,function(t){return n>=s?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)});return i+l})}e.exports={draw:function(t){var e=t._fullLayout;for(var r in e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._plots){var n=e._plots[r].shapelayer;n&&n.selectAll("path").remove()}for(var i=0;i0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform","translate("+(o-.5*c.gripWidth)+","+e._dims.currentValueTotalHeight+")")}}function E(t,e){var r=t._dims;return r.inputAreaStart+c.stepInset+(r.inputAreaLength-2*c.stepInset)*Math.min(1,Math.max(0,e))}function S(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-c.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*c.stepInset-2*r.inputAreaStart)))}function C(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",c.railTouchRectClass,function(n){n.call(A,e,t,r).style("pointer-events","all")});i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,c.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function L(t,e){var r=e._dims,n=r.inputAreaLength-2*c.railInset,i=s.ensureSingle(t,"rect",c.railRectClass);i.attr({width:n,height:c.railWidth,rx:c.railRadius,ry:c.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,c.railInset,.5*(r.inputAreaWidth-c.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[c.name],n=[],i=0;i0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,v(e))}if(a.enter().append("g").classed(c.containerClassName,!0).style("cursor","ew-resize"),a.exit().each(function(){n.select(this).selectAll("g."+c.groupClassName).each(s)}).remove(),0!==r.length){var l=a.selectAll("g."+c.groupClassName).data(r,g);l.enter().append("g").classed(c.groupClassName,!0),l.exit().each(s).remove();for(var u=0;u0||h<0){var v={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[y.side];e.attr("transform","translate("+v+")")}}}return P.call(D),O&&(M?P.on(".opacity",null):(k=0,A=!0,P.text(g).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})),P.call(c.makeEditable,{gd:t}).on("edit",function(e){void 0!==m?o.call("_guiRestyle",t,v,e,m):o.call("_guiRelayout",t,v,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(D)}).on("input",function(t){this.text(t||" ").call(c.positionText,x.x,x.y)})),P.classed("js-placeholder",A),_}};var h=/ [XY][0-9]* /},{"../../constants/interactions":679,"../../lib":703,"../../lib/svg_text_utils":727,"../../plots/plots":812,"../../registry":831,"../color":580,"../drawing":601,d3:157,"fast-isnumeric":224}],669:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:u,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:a(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":693,"../../plot_api/edit_types":734,"../../plot_api/plot_template":741,"../../plots/font_attributes":777,"../../plots/pad_attributes":811,"../color/attributes":579}],670:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"◄",right:"►",up:"▲",down:"▼"}}},{}],671:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants"),s=o.name,l=a.buttons;function u(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}var s=i(t,e,{name:"buttons",handleItemDefaults:c}),l=o("visible",s.length>0);l&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(t,e){function r(r,i){return n.coerce(t,e,l,r,i)}var i=r("visible","skip"===t.method||Array.isArray(t.args));i&&(r("method"),r("args"),r("label"),r("execute"))}e.exports=function(t,e){var r={name:s,handleItemDefaults:u};i(t,e,r)}},{"../../lib":703,"../../plots/array_container_defaults":747,"./attributes":669,"./constants":670}],672:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,c=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),h=t("./scrollbox");function p(t){return t._index}function d(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function v(t,e,r,n,i,a,o,s){e.active=o,u(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?m(t,n,null,null,e):"dropdown"===e.type&&(i.attr(f.menuIndexAttrName,"-1"),g(t,n,i,a,e),s||m(t,n,i,a,e))}function g(t,e,r,n,i){var a=s.ensureSingle(e,"g",f.headerClassName,function(t){t.style("pointer-events","all")}),l=i._dims,u=i.active,c=i.buttons[u]||f.blankHeaderOpts,h={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},p={width:l.headerWidth,height:l.headerHeight};a.call(y,i,c,t).call(M,i,h,p);var v=s.ensureSingle(e,"text",f.headerArrowClassName,function(t){t.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,i.font).text(f.arrowSymbol[i.direction])});v.attr({x:l.headerWidth-f.arrowOffsetX+i.pad.l,y:l.headerHeight/2+f.textOffsetY+i.pad.t}),a.on("click",function(){r.call(E,String(d(r,i)?-1:i._index)),m(t,e,r,n,i)}),a.on("mouseover",function(){a.call(w)}),a.on("mouseout",function(){a.call(k,i)}),o.setTranslate(e,l.lx,l.ly)}function m(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,u="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,c=r.selectAll("g."+u).data(s.filterVisible(l)),h=c.enter().append("g").classed(u,!0),p=c.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var d=0,g=0,m=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?g=m.headerHeight+f.gapButtonHeader:d=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(g=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-f.gapButtonHeader+f.gapButton-m.openWidth);var b={x:m.lx+d+o.pad.l,y:m.ly+g+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},A={l:b.x+o.borderwidth,t:b.y+o.borderwidth};c.each(function(s,l){var u=n.select(this);u.call(y,o,s,t).call(M,o,b),u.on("click",function(){n.event.defaultPrevented||(v(t,o,0,e,r,a,l),s.execute&&i.executeAPICommand(t,s.method,s.args),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))}),u.on("mouseover",function(){u.call(w)}),u.on("mouseout",function(){u.call(k,o),c.call(_,o)})}),c.call(_,o),x?(A.w=Math.max(m.openWidth,m.headerWidth),A.h=b.y-A.t):(A.w=b.x-A.l,A.h=Math.max(m.openHeight,m.headerHeight)),A.direction=o.direction,a&&(c.size()?function(t,e,r,n,i,a){var o,s,l,u=i.direction,c="up"===u||"down"===u,h=i._dims,p=i.active;if(c)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each(function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(a)}).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,p);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,function(t){t.style("pointer-events","all")}),c=0;ck,E=s.barLength+2*s.barPad,S=s.barWidth+2*s.barPad,C=d,L=g+m;L+S>u&&(L=u-S);var O=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),M?(this.hbar=O.attr({rx:s.barRadius,ry:s.barRadius,x:C,y:L,width:E,height:S}),this._hbarXMin=C+E/2,this._hbarTranslateMax=k-E):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var I=m>A,P=s.barWidth+2*s.barPad,D=s.barLength+2*s.barPad,z=d+v,R=g;z+P>l&&(z=l-P);var F=this.container.selectAll("rect.scrollbar-vertical").data(I?[0]:[]);F.exit().on(".drag",null).remove(),F.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),I?(this.vbar=F.attr({rx:s.barRadius,ry:s.barRadius,x:z,y:R,width:P,height:D}),this._vbarYMin=R+D/2,this._vbarTranslateMax=A-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var B=this.id,N=c-.5,j=I?f+P+.5:f+.5,V=h-.5,U=M?p+S+.5:p+.5,H=o._topdefs.selectAll("#"+B).data(M||I?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",B).append("rect"),M||I?(this._clipRect=H.select("rect").attr({x:Math.floor(N),y:Math.floor(V),width:Math.ceil(j)-Math.floor(N),height:Math.ceil(U)-Math.floor(V)}),this.container.call(a.setClipUrl,B,this.gd),this.bg.attr({x:d,y:g,width:v,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),M||I){var q=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(q);var G=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(G),I&&this.vbar.on(".drag",null).call(G)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax,a=o.constrain(n.event.x,r,i),s=(a-r)/(i-r),l=this.position.w-this._box.w;t=s*l}if(this.vbar){var u=e+this._vbarYMin,c=u+this._vbarTranslateMax,f=o.constrain(n.event.y,u,c),h=(f-u)/(c-u),p=this.position.h-this._box.h;e=h*p}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":703,"../color":580,"../drawing":601,d3:157}],675:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],676:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],677:[function(t,e,r){"use strict";e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],678:[function(t,e,r){"use strict";e.exports={circle:"●","circle-open":"○",square:"■","square-open":"□",diamond:"◆","diamond-open":"◇",cross:"+",x:"❌"}},{}],679:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],680:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"−"}},{}],681:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],682:[function(t,e,r){"use strict";r.version="1.48.3",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config")();for(var n=t("./registry"),i=r.register=n.register,a=t("./plot_api"),o=Object.keys(a),s=0;s1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],685:[function(t,e,r){"use strict";var n=t("./mod"),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,e){return a(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0]n&&(n+=s);var a=i(t,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function f(t,e,r,n,i,a,u){i=i||0,a=a||0;var c,f,h,p,d,v=l([r,n]);function g(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}v?(c=0,f=o,h=s):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return f(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return f(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return f(t,e,r,n,i,a,1)}}},{"./mod":710}],686:[function(t,e,r){"use strict";var n=Array.isArray,i="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},a="undefined"==typeof DataView?function(){}:DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;ii.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every(function(t){return i(t).isValid()})?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(c(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||u(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var i=t.split("+"),a=0;a=n&&t<=i?t:c}if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var u=_(e),m=t.charAt(0);!u||"G"!==m&&"g"!==m||(t=t.substr(1),e="");var w=u&&"chinese"===e.substr(0,7),k=t.match(w?x:y);if(!k)return c;var A=k[1],T=k[3]||"1",M=Number(k[5]||1),E=Number(k[7]||0),S=Number(k[9]||0),C=Number(k[11]||0);if(u){if(2===A.length)return c;var L;A=Number(A);try{var O=g.getComponentMethod("calendars","getCal")(e);if(w){var I="i"===T.charAt(T.length-1);T=parseInt(T,10),L=O.newDate(A,O.toMonthIndex(A,T,I),M)}else L=O.newDate(A,Number(T),M)}catch(t){return c}return L?(L.toJD()-v)*f+E*h+S*p+C*d:c}A=2===A.length?(Number(A)+2e3-b)%100+b:Number(A),T-=1;var P=new Date(Date.UTC(2e3,T,M,E,S));return P.setUTCFullYear(A),P.getUTCMonth()!==T?c:P.getUTCDate()!==M?c:P.getTime()+C*d},n=r.MIN_MS=r.dateTime2ms("-9999"),i=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==c};var k=90*f,A=3*h,T=5*p;function M(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return c;e||(e=0);var a,o,s,u,y,x,b=Math.floor(10*l(t+.05,1)),w=Math.round(t-b/10);if(_(r)){var E=Math.floor(w/f)+v,S=Math.floor(l(t,f));try{a=g.getComponentMethod("calendars","getCal")(r).fromJD(E).formatDate("yyyy-mm-dd")}catch(t){a=m("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=n+f&&t<=i-f))return c;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10)),o=a.time.format("%Y-%m-%d")(r),s=r.getHours(),u=r.getMinutes(),h=r.getSeconds(),p=10*r.getUTCMilliseconds()+e;return M(o,s,u,h,p)},r.cleanDate=function(t,e,n){if(t===c)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var E=/%\d?f/g;function S(t,e,r,n){t=t.replace(E,function(t){var r=Math.min(+t.charAt(1)||6,6),n=(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0";return n});var i=new Date(Math.floor(e+.05));if(_(n))try{t=g.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,i,a){if(i=_(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/p),60),2);if("M"!==e){o(e)||(e=0);var i=Math.min(l(t/d,60),C[e]),a=(100+i).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+S(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return S(e,t,n,i)};var L=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var i=Math.round(t/f)+v,a=g.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-v)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+L);return u.setUTCMonth(u.getUTCMonth()+e)+n-L},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,u=_(e)&&g.getComponentMethod("calendars","getCal")(e),c=0;c0&&(i.push(a),a=[])}return a.length>0&&i.push(a),i},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||v<0||v>1?null:{x:t+l*v,y:e+f*v}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,i,a,o,u){if(s(t,e,r,n,i,a,o,u))return 0;var c=r-t,f=n-e,h=o-i,p=u-a,d=c*c+f*f,v=h*h+p*p,g=Math.min(l(c,f,d,i-t,a-e),l(c,f,d,o-t,u-e),l(h,p,v,t-i,e-a),l(h,p,v,r-i,n-a));return Math.sqrt(g)},r.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),f=t.getPointAtLength(o(r,e)),h=(4*f.x+l.x+u.x)/6,p=(4*f.y+l.y+u.y)/6,d={x:h,y:p,theta:c};return n[r]=d,d},r.clearLocationCache=function(){i=null},r.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),f=c;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(i=r);var u=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(u*u+f*f)}for(var p=h(u);p;){if((u+=p+r)>f)return;p=h(u)}for(p=h(f);p;){if(u>(f-=p+r))return;p=h(f)}return{min:u,max:f,len:f-u,total:c,isClosed:0===u&&f===c&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,p=s;f0?p=i:h=i,f++}return a}},{"./mod":710}],699:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null==t)throw new Error("DOM element provided is null or undefined");return t}},{}],700:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,u=a(s),c=1;function f(t,e){var r=t;return r[3]*=e,r}function h(t){if(n(t))return u;var e=a(t);return e.length?e:u}function p(t){return n(t)?t:c}e.exports={formatColor:function(t,e,r){var n,i,s,d,v,g=t.color,m=l(g),y=l(e),x=o.extractOpts(t),b=[];if(n=void 0!==x.colorscale?o.makeColorScaleFuncFromTrace(t):h,i=m?function(t,e){return void 0===t[e]?u:a(n(t[e]))}:h,s=y?function(t,e){return void 0===t[e]?c:p(t[e])}:p,m||y)for(var _=0;_o?s:i(t)?Number(t):s:s},l.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&i(t)&&t>=0&&t%1==0},l.noop=t("./noop"),l.identity=t("./identity"),l.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},l.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o=Math.pow(2,r)?i>10?(l.warn("randstr failed uniqueness"),c):t(e,r,n,(i||0)+1):c},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},l.syncOrAsync=function(t,e,r){var n,i;function a(){return l.syncOrAsync(t,e,r)}for(;t.length;)if(i=t.splice(0,1)[0],(n=i(e))&&n.then)return n.then(a).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},l.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)(:[^}]*)?}/g;var M=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(l.TEMPLATE_STRING_REGEX,function(t,n){return M.test(n)?e[n]||"":(r[n]=r[n]||l.nestedProperty(e,n).get,r[n]()||"")})};var E=/^:/,S=0;l.hovertemplateString=function(t,e,r){var i=arguments,a={};return t.replace(l.TEMPLATE_STRING_REGEX,function(t,o,s){var u,c,f,h;for(f=3;f=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(i=10*i+s-48),!l||!u){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var C=2e9;l.seedPseudoRandom=function(){C=2e9},l.pseudoRandom=function(){var t=C;return C=(69069*C+1)%4294967296,Math.abs(C-t)<429496729?l.pseudoRandom():C/4294967296},l.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=l.extractOption(t,e,"htx","hovertext");if(l.isValidTextValue(i))return n(i);var a=l.extractOption(t,e,"tx","text");return l.isValidTextValue(a)?n(a):void 0},l.isValidTextValue=function(t){return t||0===t},l.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n2)return u[e]=2|u[e],h.set(t,null);if(f){for(o=e;o1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;ee/2?t-Math.round(t/e)*e:t}}},{}],711:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./array").isArrayOrTypedArray;e.exports=function(t,e){if(n(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,a,o,l=0,u=e.split(".");l/g),o=0;oa||u===i||us||e&&l(t))}:function(t,e){var l=t[0],u=t[1];if(l===i||la||u===i||us)return!1;var c,f,h,p,d,v=r.length,g=r[0][0],m=r[0][1],y=0;for(c=1;cMath.max(f,g)||u>Math.max(h,m)))if(uc||Math.abs(n(o,h))>i)return!0;return!1},a.filter=function(t,e){var r=[t[0]],n=0,i=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(i+1);for(var u=l+1;u1){var s=t.pop();o(s)}return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":680,"./matrix":709}],716:[function(t,r,n){(function(e){"use strict";var n=t("./show_no_webgl_msg"),i=t("regl");r.exports=function(t,r){var a=t._fullLayout,o=!0;return a._glcanvas.each(function(n){if(!n.regl&&(!n.pick||a._has("parcoords"))){try{n.regl=i({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||e.devicePixelRatio,extensions:r||[]})}catch(t){o=!1}o&&this.addEventListener("webglcontextlost",function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:n.key})},!1)}}),o||n({container:a._glcontainer.node()}),o}}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./show_no_webgl_msg":724,regl:489}],717:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;ni.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function u(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var a,c,f=0,h=e.length,p=0,d=h>1?(e[h-1]-e[0])/(h-1):1;for(c=d>=0?r?o:s:r?u:l,t+=1e-9*d*(r?-1:1)*(d>=0?1:-1);f90&&i.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;se[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;ia.length)&&(o=a.length),n(e)||(e=!1),i(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":686,"fast-isnumeric":224}],726:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":113}],727:[function(t,e,r){"use strict";var n=t("d3"),i=t("../lib"),a=t("../constants/xmlns_namespaces"),o=t("../constants/alignment").LINE_SPACING;function s(t,e){return t.node().getBoundingClientRect()[e]}var l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,M){var E=t.text(),C=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&E.match(l),L=n.select(t.node().parentNode);if(!L.empty()){var O=t.attr("class")?t.attr("class").split(" ")[0]:"text";return O+="-math",L.selectAll("svg."+O).remove(),L.selectAll("g."+O+"-group").remove(),t.style("display",null).attr({"data-unformatted":E,"data-math":"N"}),C?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),a={fontSize:r};!function(t,e,r){var a,o,s,l;MathJax.Hub.Queue(function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})},function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")},function(){var r="math-output-"+i.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(u,"\\lt ").replace(c,"\\gt ")),MathJax.Hub.Typeset(l.node())},function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())i.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==a)return MathJax.Hub.setRenderer(a)},function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)})}(C[2],a,function(n,i,a){L.selectAll("svg."+O).remove(),L.selectAll("g."+O+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return I(),void e();var l=L.append("g").classed(O+"-group",!0).attr({"pointer-events":"none","data-unformatted":E,"data-math":"Y"});l.node().appendChild(o.node()),i&&i.node()&&o.node().insertBefore(i.node().cloneNode(!0),o.node().firstChild),o.attr({class:O,height:a.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=t.node().style.fill||"black",c=o.select("g");c.attr({fill:u,stroke:u});var f=s(c,"width"),h=s(c,"height"),p=+t.attr("x")-f*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],d=r||s(t,"height"),v=-d/4;"y"===O[0]?(l.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-f/2,v-h/2]+")"}),o.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===O[0]?o.attr({x:t.attr("x"),y:v-h/2}):"a"===O[0]&&0!==O.indexOf("atitle")?o.attr({x:0,y:v}):o.attr({x:p,y:+t.attr("y")+v-h/2}),M&&M.call(t,l),e(l)})})):I(),t}function I(){L.empty()||(O=t.attr("class")+"-math",L.select("svg."+O).remove()),t.text("").style("white-space","pre");var e=function(t,e){e=e.replace(g," ");var r,s=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(a.svg,"tspan");n.select(e).attr({class:"line",dy:u*o+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var s=1;s doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag .",e)}x.test(e)?c():(r=t,l=[{node:t}]);for(var L=e.split(m),O=0;O|>|>)/g,f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},h={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},d="​",v=["http:","https:","mailto:","",void 0,":"],g=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i,b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,k=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function A(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&S(n)}var T=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i="...".length,a=t.split(m),o=[],s="",l=0,u=0;ui?o.push(c.substr(0,d-i)+"..."):o.push(c.substr(0,d));break}s=""}}return o.join("")};var M={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},E=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(t){return t.replace(E,function(t,e){return("#"===e.charAt(0)?function(t){if(!(t>1114111)){var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):M[e])||t})}function C(t,e,r){var n,i,a,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},a="right"===o?function(){return l.right-n.width}:"center"===o?function(){return l.left+(l.width-n.width)/2}:function(){return l.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:i()-u.top+"px",left:a()-u.left+"px","z-index":1e3}),this}}r.convertEntities=S,r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){var t=n.select(this);function i(e,r){return void 0===r?null===(r=t.attr(e))&&(t.attr(e,0),r=0):t.attr(e,r),r}var a=i("x",e),o=i("y",r);"text"===this.nodeName&&t.selectAll("tspan.line").attr({x:a,y:o})})},r.makeEditable=function(t,e){var r=e.gd,i=e.delegate,a=n.dispatch("edit","input","cancel"),o=i||t;if(t.style({"pointer-events":i?"none":"all"}),1!==t.size())throw new Error("boo");function s(){var i,s,u,c,f;i=n.select(r).select(".svg-container"),s=i.append("div"),u=t.node().style,c=parseFloat(u.fontSize||12),void 0===(f=e.text)&&(f=t.attr("data-unformatted")),s.classed("plugin-editable editable",!0).style({position:"absolute","font-family":u.fontFamily||"Arial","font-size":c,color:e.fill||u.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-c/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(f).call(C(t,i,e)).on("blur",function(){r._editing=!1,t.text(this.textContent).style({opacity:1});var e,i=n.select(this).attr("class");(e=i?"."+i.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(e).style({opacity:0});var o=this.textContent;n.select(this).transition().duration(0).remove(),n.select(document).on("mouseup",null),a.edit.call(t,o)}).on("focus",function(){var t=this;r._editing=!0,n.select(document).on("mouseup",function(){if(n.event.target===t)return!1;document.activeElement===s.node()&&s.node().blur()})}).on("keyup",function(){27===n.event.which?(r._editing=!1,t.style({opacity:1}),n.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),a.cancel.call(t,this.textContent)):(a.input.call(t,this.textContent),n.select(this).call(C(t,i,e)))}).on("keydown",function(){13===n.event.which&&this.blur()}).call(l),t.style({opacity:0});var h,p=o.attr("class");(h=p?"."+p.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(h).style({opacity:0})}function l(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}return e.immediate?s():o.on("click",s),n.rebind(t,a,"on")}},{"../constants/alignment":675,"../constants/xmlns_namespaces":681,"../lib":703,d3:157}],728:[function(t,e,r){"use strict";var n={};function i(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}r.throttle=function(t,e,r){var a=n[t],o=Date.now();if(!a){for(var s in n)n[s].tsa.ts+e?l():a.timer=setTimeout(function(){l(),a.timer=null},e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)i(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],729:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":224}],730:[function(t,e,r){"use strict";var n=e.exports={},i=t("../plots/geo/constants").locationmodeToLayer,a=t("topojson-client").feature;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},{"../plots/geo/constants":779,"topojson-client":527}],731:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],732:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],733:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,v=Object.keys(t);for(e=0;e3?(I.x=1.02,I.xanchor="left"):I.x<-2&&(I.x=-.02,I.xanchor="right"),I.y>3?(I.y=1.02,I.yanchor="bottom"):I.y<-2&&(I.y=-.02,I.yanchor="top")),d(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),u.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=b(e);r;){if(r in t)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&a.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(u(y))e.set(null);else{if(!Array.isArray(y))return a.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!v&&(h(g,m),p(t),!0)}var x,b,_,w,k,A,T,M,E=Object.keys(r).map(Number).sort(o),S=e.get(),C=S||[],L=c(m,f).get(),O=[],I=-1,P=C.length;for(x=0;xC.length-(T?0:1))a.warn("index out of range",f,_);else if(void 0!==A)k.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(A)?O.push(_):T?("add"===A&&(A={}),C.splice(_,0,A),L&&L.splice(_,0,{})):a.warn("Unrecognized full object edit value",f,_,A),-1===I&&(I=_);else for(b=0;b=0;x--)C.splice(O[x],1),L&&L.splice(O[x],1);if(C.length?S||e.set(C):e.set(null),v)return!1;if(h(g,m),d!==i){var D;if(-1===I)D=E;else{for(P=Math.max(C.length,P),D=[],x=0;x=I);x++)D.push(_);for(x=I;x=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function z(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),D(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&D(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function R(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var a in D(t,r,"indices"),e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var a,l,u,c,f,h=o.isPlainObject(n),p=[];for(var d in Array.isArray(r)||(r=[r]),r=P(r,t.data.length-1),e)for(var v=0;v-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function q(t,e,r){if(t=o.getGraphDiv(t),k.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var i=$(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[h.previousPromises];a.layoutReplot?s.push(A.layoutReplot):Object.keys(n).length&&(G(t,a,i)||h.supplyDefaults(t),a.legend&&s.push(A.doLegend),a.layoutstyle&&s.push(A.layoutStyles),a.axrange&&W(s,i.rangesAltered),a.ticks&&s.push(A.doTicksRelayout),a.modebar&&s.push(A.doModeBar),a.camera&&s.push(A.doCamera),a.colorbars&&s.push(A.doColorBars),s.push(C)),s.push(h.rehover,h.redrag),u.add(t,q,[t,i.undoit],q,[t,i.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then(function(){return t.emit("plotly_relayout",i.eventData),t})}function G(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var i in e)if("axrange"!==i&&e[i])return!1;for(var a in r.rangesAltered){var o=d.id2name(a),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,l.range=s.range.slice(),l.cleanRange(),l._matchGroup)for(var u in l._matchGroup)if(u!==a){var c=n[d.id2name(u)];c.autorange=l.autorange,c.range=l.range.slice(),c._input.range=l.range.slice()}}return!0}function W(t,e){var r=e?function(t){var r=[],n=!0;for(var i in e){var a=d.getFromId(t,i);if(r.push(i),a._matchGroup)for(var o in a._matchGroup)e[o]||r.push(o);a.automargin&&(n=!1)}return d.draw(t,r,{skipTitle:n})}:function(t){return d.draw(t,"redraw")};t.push(b,A.doAutoRangeAndConstraints,r,A.drawData,A.finalDraw)}var Y=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,X=/^[xyz]axis[0-9]*\.autorange$/,Z=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function $(t,e){var r,n,i,a=t.layout,l=t._fullLayout,u=l._guiEditing,h=j(l._preGUI,u),p=Object.keys(e),v=d.list(t),g=o.extendDeepAll({},e),m={};for(H(e),p=Object.keys(e),n=0;n0&&"string"!=typeof P.parts[R];)R--;var F=P.parts[R],B=P.parts[R-1]+"."+F,V=P.parts.slice(0,R).join("."),U=s(t.layout,V).get(),q=s(l,V).get(),G=P.get();if(void 0!==D){A[I]=D,E[I]="reverse"===F?D:N(G);var W=f.getLayoutValObject(l,P.parts);if(W&&W.impliedEdits&&null!==D)for(var $ in W.impliedEdits)S(o.relativeAttr(I,$),W.impliedEdits[$]);if(-1!==["width","height"].indexOf(I))if(D){S("autosize",null);var K="height"===I?"width":"height";S(K,l[K])}else l[I]=t._initialAutoSize[I];else if("autosize"===I)S("width",D?null:l.width),S("height",D?null:l.height);else if(B.match(Y))O(B),s(l,V+"._inputRange").set(null);else if(B.match(X)){O(B),s(l,V+"._inputRange").set(null);var Q=s(l,V).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else B.match(Z)&&s(l,V+"._inputDomain").set(null);if("type"===F){var tt=U,et="linear"===q.type&&"log"===D,rt="log"===q.type&&"linear"===D;if(et||rt){if(tt&&tt.range)if(q.autorange)et&&(tt.range=tt.range[1]>tt.range[0]?[1,2]:[2,1]);else{var nt=tt.range[0],it=tt.range[1];et?(nt<=0&&it<=0&&S(V+".autorange",!0),nt<=0?nt=it/1e6:it<=0&&(it=nt/1e6),S(V+".range[0]",Math.log(nt)/Math.LN10),S(V+".range[1]",Math.log(it)/Math.LN10)):(S(V+".range[0]",Math.pow(10,nt)),S(V+".range[1]",Math.pow(10,it)))}else S(V+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[P.parts[0]]&&"radialaxis"===P.parts[1]&&delete l[P.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,q,D,S),c.getComponentMethod("images","convertCoords")(t,q,D,S)}else S(V+".autorange",!0),S(V+".range",null);s(l,V+"._inputRange").set(null)}else if(F.match(M)){var at=s(l,I).get(),ot=(D||{}).type;ot&&"-"!==ot||(ot="linear"),c.getComponentMethod("annotations","convertCoords")(t,at,ot,S),c.getComponentMethod("images","convertCoords")(t,at,ot,S)}var st=w.containerArrayMatch(I);if(st){r=st.array,n=st.index;var lt=st.property,ut=W||{editType:"calc"};""!==n&&""===lt&&(w.isAddVal(D)?E[I]=null:w.isRemoveVal(D)?E[I]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",e)),T.update(_,ut),m[r]||(m[r]={});var ct=m[r][n];ct||(ct=m[r][n]={}),ct[lt]=D,delete e[I]}else"reverse"===F?(U.range?U.range.reverse():(S(V+".autorange",!0),U.range=[1,0]),q.autorange?_.calc=!0:_.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===I&&("lasso"===D||"select"===D)&&"lasso"!==G&&"select"!==G?_.plot=!0:l._has("gl2d")?_.plot=!0:W?T.update(_,W):_.calc=!0,P.set(D))}}for(r in m){var ft=w.applyContainerArrayChanges(t,h(a,r),m[r],_,h);ft||(_.plot=!0)}var ht=l._axisConstraintGroups||[];for(C in L)for(n=0;n1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function it(t,e){for(var r=0;r=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise(function(a,c){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,h.transition(t,e.frame.data,e.frame.layout,k.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&f()};e()}var d,v,g=0;function m(t){return Array.isArray(i)?g>=i.length?t.transitionOpts=i[g]:t.transitionOpts=i[0]:t.transitionOpts=i,g++,t}var y=[],x=null==e,b=Array.isArray(e),_=!x&&!b&&o.isPlainObject(e);if(_)y.push({type:"object",data:m(o.extendFlat({},e))});else if(x||-1!==["string","number"].indexOf(typeof e))for(d=0;d0&&TT)&&M.push(v);y=M}}y.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var v=e[n].name,g=(c[v]||d[v]||{}).name,m=e[n].name,y=c[g]||d[g];g&&m&&"number"==typeof m&&y&&Ee.index?-1:t.index=0;n--){if("number"==typeof(i=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;c[i.name="frame "+t._transitionData._counter++];);if(c[i.name]){for(a=0;a=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=h.modifyFrames,c=h.modifyFrames,f=[t,s],p=[t,a];return u&&u.add(t,l,f,c,p),h.modifyFrames(t,a)},r.addTraces=function t(e,n,i){e=o.getGraphDiv(e);var a,s,l=[],c=r.deleteTraces,f=t,h=[e,l],p=[e,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!k(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function k(t){return t===Math.round(t)&&t>=0}function A(t){return function(t){r.crawl(t,function(t,e,n){r.isValObject(t)?"data_array"===t.valType?(t.role="data",n[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(n[e+"src"]={valType:"string",editType:"none"}):v(t)&&(t.role="object")})}(t),function(t){r.crawl(t,function(t,e,r){if(t){var n=t[b];n&&(delete t[b],r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}})}(t),function(t){!function t(e){for(var r in e)if(v(e[r]))t(e[r]);else if(Array.isArray(e[r]))for(var n=0;n=l.length)return!1;r=(n.transformsRegistry[l[u].type]||{}).attributes,i=r&&r[e[2]],s=3}else if("area"===t.type)i=c[o];else{var f=t._module;if(f||(f=(n.modules[t.type||a.type.dflt]||{})._module),!f)return!1;if(r=f.attributes,!(i=r&&r[o])){var h=f.basePlotModule;h&&h.attributes&&(i=h.attributes[o])}i||(i=a[o])}return w(i,e,s)},r.getLayoutValObject=function(t,e){var r=function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var u;for(r=0;r=i&&(r._input||{})._templateitemname;s&&(o=i);var l,u=e+"["+o+"]";function c(){l={},s&&(l[u]={},l[u][a]=s)}function f(t,e){s?n.nestedProperty(l[u],t).set(e):l[u+"."+t]=e}function h(){var t=l;return c(),t}return c(),{modifyBase:function(t,e){l[t]=e},modifyItem:f,getUpdateObj:h,applyUpdate:function(e,r){e&&f(e,r);var i=h();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},{"../lib":703,"../plots/attributes":748}],742:[function(t,e,r){"use strict";var n=t("d3"),i=t("../registry"),a=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),u=t("../components/drawing"),c=t("../components/titles"),f=t("../components/modebar"),h=t("../plots/cartesian/axes"),p=t("../constants/alignment"),d=t("../plots/cartesian/constraints"),v=d.enforce,g=d.clean,m=t("../plots/cartesian/autorange").doAutoRange,y="start",x="middle",b="end";function _(t,e,r){for(var n=0;n=t[1]||i[1]<=t[0])&&a[0]e[0])return!0}return!1}function w(t){var e,i,a,s,c,d,v=t._fullLayout,g=v._size,m=g.p,y=h.list(t,"",!0);if(v._paperdiv.style({width:t._context.responsive&&v.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":v.width+"px",height:t._context.responsive&&v.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(u.setSize,v.width,v.height),t._context.setBackground(t,v.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!v._has("cartesian"))return t._promises.length&&Promise.all(t._promises);function x(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-m-n:e._offset+e._length+m+n:g.t+g.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+m+n:e._offset-m-n:g.l+g.w*(t.position||0)+n%1}for(e=0;ek?c.push({code:"unused",traceType:y,templateCount:w,dataCount:k}):k>w&&c.push({code:"reused",traceType:y,templateCount:w,dataCount:k})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var a=e[n],o=p(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&c.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&d(a)&&t(a,o)}}({data:g,layout:h},""),c.length)return c.map(v)}},{"../lib":703,"../plots/attributes":748,"../plots/plots":812,"./plot_config":739,"./plot_schema":740,"./plot_template":741}],744:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./plot_api"),a=t("../lib"),o=t("../snapshot/helpers"),s=t("../snapshot/tosvg"),l=t("../snapshot/svgtoimg"),u={format:{valType:"enumerated",values:["png","jpeg","webp","svg"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}},c=/^data:image\/\w+;base64,/;e.exports=function(t,e){var r,f,h,p;function d(t){return!(t in e)||a.validate(e[t],u[t])}if(e=e||{},a.isPlainObject(t)?(r=t.data||[],f=t.layout||{},h=t.config||{},p={}):(t=a.getGraphDiv(t),r=a.extendDeep([],t.data),f=a.extendDeep({},t.layout),h=t._context,p=t._fullLayout||{}),!d("width")&&null!==e.width||!d("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!d("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var v={};function g(t,r){return a.coerce(e,v,u,t,r)}var m=g("format"),y=g("width"),x=g("height"),b=g("scale"),_=g("setBackground"),w=g("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var A=a.extendFlat({},f);y?A.width=y:null===e.width&&n(p.width)&&(A.width=p.width),x?A.height=x:null===e.height&&n(p.height)&&(A.height=p.height);var T=a.extendFlat({},h,{_exportedPlot:!0,staticPlot:!0,setBackground:_}),M=o.getRedrawFunc(k);function E(){return new Promise(function(t){setTimeout(t,o.getDelay(k._fullLayout))})}function S(){return new Promise(function(t,e){var r=s(k,m,b),n=k._fullLayout.width,o=k._fullLayout.height;if(i.purge(k),document.body.removeChild(k),"svg"===m)return t(w?r:"data:image/svg+xml,"+encodeURIComponent(r));var u=document.createElement("canvas");u.id=a.randstr(),l({format:m,width:n,height:o,scale:b,canvas:u,svg:r,promise:!0}).then(t).catch(e)})}return new Promise(function(t,e){i.plot(k,r,A,T).then(M).then(E).then(S).then(function(e){t(function(t){return w?t.replace(c,""):t}(e))}).catch(function(t){e(t)})})}},{"../lib":703,"../snapshot/helpers":835,"../snapshot/svgtoimg":837,"../snapshot/tosvg":839,"./plot_api":738,"fast-isnumeric":224}],745:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/plots"),a=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(t,e,r,i,a,o){o=o||[];for(var f=Object.keys(t),h=0;hx.length&&i.push(p("unused",a,m.concat(x.length)));var A,T,M,E,S,C=x.length,L=Array.isArray(k);if(L&&(C=Math.min(C,k.length)),2===b.dimensions)for(T=0;Tx[T].length&&i.push(p("unused",a,m.concat(T,x[T].length)));var O=x[T].length;for(A=0;A<(L?Math.min(O,k[T].length):O);A++)M=L?k[T][A]:k,E=y[T][A],S=x[T][A],n.validate(E,M)?S!==E&&S!==+E&&i.push(p("dynamic",a,m.concat(T,A),E,S)):i.push(p("value",a,m.concat(T,A),E))}else i.push(p("array",a,m.concat(T),y[T]));else for(T=0;T1&&h.push(p("object","layout"))),i.supplyDefaults(d);for(var v=d._fullData,g=r.length,m=0;m0&&((b=T-o(g)-o(m))>M?_/b>E&&(y=g,x=m,E=_/b):_/T>E&&(y={val:g.val,pad:0},x={val:m.val,pad:0},E=_/T));if(h===p){var S=h-1,C=h+1;if(k)if(0===h)a=[0,1];else{var L=(h>0?f:c).reduce(function(t,e){return Math.max(t,o(e))},0),O=h/(1-Math.min(.5,L/T));a=h>0?[0,O]:[O,0]}else a=A?[Math.max(0,S),Math.max(1,C)]:[S,C]}else k?(y.val>=0&&(y={val:0,pad:0}),x.val<=0&&(x={val:0,pad:0})):A&&(y.val-E*o(y)<0&&(y={val:0,pad:0}),x.val<=0&&(x={val:1,pad:0})),E=(x.val-y.val)/(T-o(y)-o(x)),a=[y.val-E*o(y),x.val+E*o(x)];return d&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function l(t){var e=t._length/20;return"domain"===t.constrain&&t._inputDomain&&(e*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(t){return t.pad+(t.extrapad?e:0)}}function u(t,e){var r,n,i,a=e._id,o=t._fullData,s=t._fullLayout,l=[],u=[];function h(t,e){for(r=0;r=r&&(u.extrapad||!o)){s=!1;break}i(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=a&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function p(t){return n(t)&&Math.abs(t)=e}e.exports={getAutoRange:s,makePadFn:l,doAutoRange:function(t,e){if(e.setScale(),e.autorange){e.range=s(t,e),e._r=e.range.slice(),e._rl=i.simpleMap(e._r,e.r2l);var r=e._input,n={};n[e._attr+".range"]=e.range,n[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,n),r.range=e.range.slice(),r.autorange=e.autorange}var a=e._anchorAxis;if(a&&a.rangeslider){var l=a.rangeslider[e._name];l&&"auto"===l.rangemode&&(l.range=s(t,e)),a._input.rangeslider[e._name]=i.extendFlat({},l)}},findExtremes:function(t,e,r){r||(r={}),t._m||t.setScale();var i,o,s,l,u,h,d,v,g,m=[],y=[],x=e.length,b=r.padded||!1,_=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,k=!1;function A(t){if(Array.isArray(t))return k=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var T=A((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),M=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),E=A(r.vpadplus||r.vpad),S=A(r.vpadminus||r.vpad);if(!k){if(v=1/0,g=-1/0,w)for(i=0;i0&&(v=o),o>g&&o-a&&(v=o),o>g&&o=O;i--)L(i);return{min:m,max:y,opts:r}},concatExtremes:u}},{"../../constants/numerical":680,"../../lib":703,"../../registry":831,"fast-isnumeric":224}],751:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../components/titles"),c=t("../../components/color"),f=t("../../components/drawing"),h=t("./layout_attributes"),p=t("./clean_ticks"),d=t("../../constants/numerical"),v=d.ONEAVGYEAR,g=d.ONEAVGMONTH,m=d.ONEDAY,y=d.ONEHOUR,x=d.ONEMIN,b=d.ONESEC,_=d.MINUS_SIGN,w=d.BADNUM,k=t("../../constants/alignment").MID_SHIFT,A=t("../../constants/alignment").LINE_SPACING,T=e.exports={};T.setConvert=t("./set_convert");var M=t("./axis_autotype"),E=t("./axis_ids");T.id2name=E.id2name,T.name2id=E.name2id,T.cleanId=E.cleanId,T.list=E.list,T.listIds=E.listIds,T.getFromId=E.getFromId,T.getFromTrace=E.getFromTrace;var S=t("./autorange");T.getAutoRange=S.getAutoRange,T.findExtremes=S.findExtremes,T.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return i||(i=l[0]||a),a||(a=i),c[u]={valType:"enumerated",values:l.concat(a?[a]:[]),dflt:i},s.coerce(t,e,c,u)},T.coercePosition=function(t,e,r,n,i,a){var o,l;if("paper"===n||"pixel"===n)o=s.ensureNumber,l=r(i,a);else{var u=T.getFromId(e,n);a=u.fraction2r(a),l=r(i,a),o=u.cleanPos}t[i]=o(l)},T.cleanPosition=function(t,e,r){var n="paper"===r||"pixel"===r?s.ensureNumber:T.getFromId(e,r).cleanPos;return n(t)},T.redrawComponents=function(t,e){e=e||T.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),u={},c=0;c2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},T.saveRangeInitial=function(t,e){for(var r=T.list(t,"",!0),n=!1,i=0;i.3*h||c(n)||c(a))){var p=r.dtick/2;t+=t+p.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=T.tickIncrement(t,"M6","reverse")+1.5*m:a.exactMonths>.8?t=T.tickIncrement(t,"M1","reverse")+15.5*m:t-=m/2;var l=T.tickIncrement(t,r);if(l<=n)return l}return t}(b,t,x,u,a)),g=b,y=0;g<=c;)g=T.tickIncrement(g,x,!1,a),y++;return{start:e.c2r(b,0,a),end:e.c2r(g,0,a),size:x,_dataSpan:c-u}},T.prepTicks=function(t){var e=s.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type||"multicategory"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=s.constrain(t._length/r,4,9)+1),"radialaxis"===t._name&&(n*=2)),"array"===t.tickmode&&(n*=100),T.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),"date"===t.type&&t.dtick<.1&&(t.dtick=.1),j(t)},T.calcTicks=function(t){T.prepTicks(t);var e=s.simpleMap(t.range,t.r2l);if("array"===t.tickmode)return function(t){var e=t.tickvals,r=t.ticktext,n=new Array(e.length),i=s.simpleMap(t.range,t.r2l),a=1.0001*i[0]-1e-4*i[1],o=1.0001*i[1]-1e-4*i[0],l=Math.min(a,o),u=Math.max(a,o),c=0;Array.isArray(r)||(r=[]);var f="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var h=0;hl&&p=n:u<=n)&&!(a.length>l||u===o);u=T.tickIncrement(u,t.dtick,i,t.calendar))o=u,a.push(u);rt(t)&&360===Math.abs(e[1]-e[0])&&a.pop(),t._tmax=a[a.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var c=new Array(a.length),f=0;f10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=m&&a<=10||e>=15*m)t._tickround="d";else if(e>=x&&a<=16||e>=y)t._tickround="M";else if(e>=b&&a<=19||e>=x)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(u)>3&&(H(t.exponentformat)&&!q(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function V(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}T.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar);var a=2*e;a>v?(e/=v,r=n(10),t.dtick="M"+12*N(e,r,I)):a>g?(e/=g,t.dtick="M"+N(e,1,P)):a>m?(t.dtick=N(e,m,z),t.tick0=s.dateTick0(t.calendar,!0)):a>y?t.dtick=N(e,y,P):a>x?t.dtick=N(e,x,D):a>b?t.dtick=N(e,b,D):(r=n(10),t.dtick=N(e,r,I))}else if("log"===t.type){t.tick0=0;var o=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var l=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/l,r=n(10),t.dtick="L"+N(e,r,I)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):rt(t)?(t.tick0=0,r=1,t.dtick=N(e,r,B)):(t.tick0=0,r=n(10),t.dtick=N(e,r,I));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var u=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(u)}},T.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return t+o*e;var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,a);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?F:R,f=t+.01*o,h=s.roundUp(s.mod(f,1),c,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},T.tickFirst=function(t){var e=t.r2l||Number,r=s.simpleMap(t.range,e),a=r[1]"+l,t._prevDateHead=l)),e.text=u}(t,a,r,l):"log"===u?function(t,e,r,n,a){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);if("never"===a&&(a=""),n&&"L"!==c&&(o="L3",c="L"),u||"L"===c)e.text=G(Math.pow(10,l),t,a,n);else if(i(o)||"D"===c&&s.mod(l+.01,1)<.1){var f=Math.round(l),h=Math.abs(f),p=t.exponentformat;"power"===p||H(p)&&q(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":_)+h+"",e.fontSize*=1.25):("e"===p||"E"===p)&&h>2?e.text="1"+p+(f>0?"+":_)+h:(e.text=G(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);"0"!==d&&"1"!==d||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,a,0,l,d):"category"===u?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}(t,a):"multicategory"===u?function(t,e,r){var n=Math.round(e.x),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,a,r):rt(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=G(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=G(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="π":e.text=o[0]+"π":e.text=["",o[0],"","⁄","",o[1],"","π"].join(""),l&&(e.text=_+e.text)}}}}(t,a,r,l,d):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=G(e.x,t,i,n)}(t,a,0,l,d),t.tickprefix&&!p(t.showtickprefix)&&(a.text=t.tickprefix+a.text),t.ticksuffix&&!p(t.showticksuffix)&&(a.text+=t.ticksuffix),"boundaries"===t.tickson||t.showdividers){var v=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};a.xbnd=[v(a.x-.5),v(a.x+t.dtick-.5)]}return a},T.hoverLabelText=function(t,e,r){if(r!==w&&r!==e)return T.hoverLabelText(t,e)+" - "+T.hoverLabelText(t,r);var n="log"===t.type&&e<=0,i=T.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":_+i:i};var U=["f","p","n","μ","m","","k","M","G","T"];function H(t){return"SI"===t||"B"===t}function q(t){return t>14||t<-15}function G(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=T.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};j(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,_);var p,d=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))"+p+"":"B"===l&&9===u?t+="B":H(l)&&(t+=U[u/3+5])),a?_+t:t}function W(t,e){var r=t._id.charAt(0),n=t._tickAngles[e]||0,i=s.deg2rad(n),a=Math.sin(i),o=Math.cos(i),l=0,u=0;return t._selections[e].each(function(){var t=$(this),e=f.bBox(t.node()),r=e.width,n=e.height;l=Math.max(l,o*r,a*n),u=Math.max(u,a*r,o*n)}),{x:u,y:l}[r]}function Y(t){return[t.text,t.x,t.axInfo,t.font,t.fontSize,t.fontColor].join("_")}function X(t,e){var r,n=t._fullLayout._size,i=e._id.charAt(0),a=e.side;return"free"!==e.anchor?r=E.getFromId(t,e.anchor):"x"===i?r={_offset:n.t+(1-(e.position||0))*n.h,_length:0}:"y"===i&&(r={_offset:n.l+(e.position||0)*n.w,_length:0}),"top"===a||"left"===a?r._offset:"bottom"===a||"right"===a?r._offset+r._length:void 0}function Z(t,e){var r=t.l2p(e);return r>1&&r=0,a=c(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(i)))){r=n;break}break;case"log":for(e=0;e0&&(r[i]+=l),e.title.text!==h._dfltTitle[d]&&(r[i]+=e.title.font.size),"x"===d&&u.width>0){var f=u.right-(e._offset+e._length);f>0&&(r.x=1,r.r=f);var p=e._offset-u.left;p>0&&(r.x=0,r.l=p)}else if("y"===d&&u.height>0){var g=u.bottom-(e._offset+e._length);g>0&&(r.y=0,r.b=g);var m=e._offset-u.top;m>0&&(r.y=1,r.t=m)}}a.autoMargin(t,J(e),r)}),r.skipTitle||et&&e._boundingBox&&"bottom"===e.side||Z.push(function(){return function(t,e){var r,n=t._fullLayout,i=e._id,a=i.charAt(0),o=e.title.font.size;r="multicategory"===e.type?e._labelLength:10+1.5*o+(e.linewidth?e.linewidth-1:0);var s,l,c,h,p=X(t,e);if("x"===a?(l=e._offset+e._length/2,c="top"===e.side?-r-o*(e.showticklabels?1:0):r+o*(e.showticklabels?1.5:.5),c+=p):(c=e._offset+e._length/2,l="right"===e.side?r+o*(e.showticklabels?1:.5):-r-o*(e.showticklabels?.5:0),l+=p,s={rotate:"-90",offset:0}),"multicategory"!==e.type){var d=e._selections[e._id+"tick"];if(h={selection:d,side:e.side},d&&d.node()&&d.node().parentNode){var v=f.getTranslate(d.node().parentNode);h.offsetLeft=v.x,h.offsetTop=v.y}}return u.draw(t,i+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[a],avoid:h,transform:s,attributes:{x:l,y:c,"text-anchor":"middle"}})}(t,e)}),s.syncOrAsync(Z)}function rt(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.max(t[1],e[1])}},T.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,i=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(i=i.map(function(t){return-t})),i},T.makeTransFn=function(t){var e=t._id.charAt(0),r=t._offset;return"x"===e?function(e){return"translate("+(r+t.l2p(e.x))+",0)"}:function(e){return"translate(0,"+(r+t.l2p(e.x))+")"}},T.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var i=t._id.charAt(0),a=(t.linewidth||1)/2;return"x"===i?"M0,"+(e+a*r)+"v"+n*r:"M"+(e+a*r)+",0h"+n*r},T.makeLabelFns=function(t,e,r){var n=t._id.charAt(0),a="boundaries"!==t.tickson&&"outside"===t.ticks,o=0,l=0;if(a&&(o+=t.ticklen),r&&"outside"===t.ticks){var u=s.deg2rad(r);o=t.ticklen*Math.cos(u)+1,l=t.ticklen*Math.sin(u)}t.showticklabels&&(a||t.showline)&&(o+=.2*t.tickfont.size);var c,f,h,p,d={labelStandoff:o+=(t.linewidth||1)/2,labelShift:l};return"x"===n?(p="bottom"===t.side?1:-1,c=l*p,f=e+o*p,h="bottom"===t.side?1:-.2,d.xFn=function(t){return t.dx+c},d.yFn=function(t){return t.dy+f+t.fontSize*h},d.anchorFn=function(t,e){return i(e)&&0!==e&&180!==e?e*p<0?"end":"start":"middle"},d.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side?-n:0}):"y"===n&&(p="right"===t.side?1:-1,c=o,f=-l*p,h=90===Math.abs(t.tickangle)?.5:0,d.xFn=function(t){return t.dx+e+(c+t.fontSize*h)*p},d.yFn=function(t){return t.dy+f+t.fontSize*k},d.anchorFn=function(e,r){return i(r)&&90===Math.abs(r)?"middle":"right"===t.side?"start":"end"},d.heightFn=function(e,r,n){return(r*="left"===t.side?1:-1)<-30?-n:r<30?-.5*n:0}),d},T.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",i=r.layer.selectAll("path."+n).data(e.ticks?r.vals:[],Y);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(c.stroke,e.tickcolor).style("stroke-width",f.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path),i.attr("transform",r.transFn)},T.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",i=r.vals,a=r.counterAxis;if(!1===e.showgrid)i=[];else if(a&&T.shouldShowZeroLine(t,e,a))for(var o="array"===e.tickmode,s=0;s1)for(n=1;n2*o}(t,e)?"date":function(t){for(var e=Math.max(1,(t.length-1)/1e3),r=0,n=0,o={},s=0;s2*r}(t)?"category":function(t){if(!t)return!1;for(var e=0;en?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.getAxisGroup=function(t,e){for(var r=t._axisMatchGroups,n=0;n0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nl*x)||k)for(r=0;rP&&RO&&(O=R);var U=(O-L)/(2*I);p/=U,L=u.l2r(L),O=u.l2r(O),u.range=u._input.range=E=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function D(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",i+"Z")}function z(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function R(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),F(t,e,i,a)}function F(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function B(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function N(t){E&&t.data&&t._context.showTips&&(s.notifier(s._(t,"Double-click to zoom back out"),"long"),E=!1)}function j(t){return"lasso"===t||"select"===t}function V(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,M)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function U(t,e,r,n){for(var i,a,o,l,u=!1,c={},f={},h=0;h-1&&w(i,t,X,Z,e.id,Et),a.indexOf("event")>-1&&f.click(t,i,e.id);else if(1===r&&pt){var s=E?G:F,u="s"===E||"w"===S?0:1,c=s._name+".range["+u+"]",h=function(t,e){var r,i=t.range[e],a=Math.abs(i-t.range[1-e]);return"date"===t.type?i:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,i))):(r=Math.floor(Math.log(Math.abs(i))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,n.format("."+String(r)+"g")(i))}(s,u),p="left",d="middle";if(s.fixedrange)return;E?(d="n"===E?"top":"bottom","right"===s.side&&(p="right")):"e"===S&&(p="right"),t._context.showAxisRangeEntryBoxes&&n.select(gt).call(l.makeEditable,{gd:t,immediate:!0,background:t._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:p,verticalAlign:d}).on("edit",function(e){var r=s.d2r(e);void 0!==r&&o.call("_guiRelayout",t,c,r)})}}function Lt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(K,e+mt)),i=Math.max(0,Math.min(Q,r+yt)),a=Math.abs(n-mt),o=Math.abs(i-yt);function s(){kt="",xt.r=xt.l,xt.t=xt.b,Tt.attr("d","M0,0Z")}if(xt.l=Math.min(mt,n),xt.r=Math.max(mt,n),xt.t=Math.min(yt,i),xt.b=Math.max(yt,i),tt.isSubplotConstrained)a>M||o>M?(kt="xy",a/K>o/Q?(o=a*Q/K,yt>i?xt.t=yt-o:xt.b=yt+o):(a=o*K/Q,mt>n?xt.l=mt-a:xt.r=mt+a),Tt.attr("d",V(xt))):s();else if(et.isSubplotConstrained)if(a>M||o>M){kt="xy";var l=Math.min(xt.l/K,(Q-xt.b)/Q),u=Math.max(xt.r/K,(Q-xt.t)/Q);xt.l=l*K,xt.r=u*K,xt.b=(1-l)*Q,xt.t=(1-u)*Q,Tt.attr("d",V(xt))}else s();else!nt||og[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":703,"fast-isnumeric":224}],767:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)]}},{"../../constants/alignment":675}],768:[function(t,e,r){"use strict";var n=t("polybooljs"),i=t("../../registry"),a=t("../../components/color"),o=t("../../components/fx"),s=t("../../lib"),l=t("../../lib/polygon"),u=t("../../lib/throttle"),c=t("../../components/fx/helpers").makeEventData,f=t("./axis_ids").getFromId,h=t("../../lib/clear_gl_canvases"),p=t("../../plot_api/subroutines").redrawReglTraces,d=t("./constants"),v=d.MINSELECT,g=l.filter,m=l.tester;function y(t){return t._id}function x(t,e,r,n,i,a,o){var s,l,u,c,f,h,p,d,v,g,m=e._hoverdata,y=e._fullLayout.clickmode,x=y.indexOf("event")>-1,b=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(m)){k(t,e,a),s=T(e,r,n,i);var _=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0;if(L?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((i+=r.selectedpoints.length)>1)return!1}return 1===i}(s)&&(p=E(_))){for(o&&o.remove(),g=0;g0?"M"+i.join("M")+"Z":"M0,0Z",e.attr("d",n)}function E(t){var e=t.searchInfo.cd[0].trace,r=t.pointNumber,n=t.pointNumbers,i=n.length>0,a=i?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(a)>-1}function S(t,e,r){var n,a,o,s;for(n=0;n-1&&x(e,E,i.xaxes,i.yaxes,i.subplot,i,G),"event"===r&&E.emit("plotly_selected",void 0);o.click(E,e)}).catch(s.error)},i.doneFn=function(){Y.remove(),u.done(X).then(function(){u.clear(X),i.gd.emit("plotly_selected",_),p&&i.selectionDefs&&(p.subtract=q,i.selectionDefs.push(p),i.mergedPolygons.length=0,[].push.apply(i.mergedPolygons,h)),i.doneFnCompleted&&i.doneFnCompleted(Z)}).catch(s.error)}},clearSelect:L,selectOnClick:x}},{"../../components/color":580,"../../components/fx":619,"../../components/fx/helpers":615,"../../lib":703,"../../lib/clear_gl_canvases":688,"../../lib/polygon":715,"../../lib/throttle":728,"../../plot_api/subroutines":742,"../../registry":831,"./axis_ids":754,"./constants":757,polybooljs:468}],769:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=a.cleanNumber,s=a.ms2DateTime,l=a.dateTime2ms,u=a.ensureNumber,c=a.isArrayOrTypedArray,f=t("../../constants/numerical"),h=f.FP_SAFE,p=f.BADNUM,d=f.LOG_CLIP,v=t("./constants"),g=t("./axis_ids");function m(t){return Math.pow(10,t)}function y(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",f=r.charAt(0);function x(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*d*Math.abs(n-i))}return p}function b(e,r,n){var o=l(e,n||t.calendar);if(o===p){if(!i(e))return p;e=+e;var s=Math.floor(10*a.mod(e+.05,1)),u=Math.round(e-s/10);o=l(new Date(u))+s/10}return o}function _(e,r,n){return s(e,r,n||t.calendar)}function w(e){return t._categories[Math.round(e)]}function k(e){if(y(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return p}function A(e){if(t._categoriesMap)return t._categoriesMap[e]}function T(t){var e=A(t);return void 0!==e?e:i(t)?+t:void 0}function M(e){return i(e)?n.round(t._b+t._m*e,2):p}function E(e){return(e-t._b)/t._m}t.c2l="log"===t.type?x:u,t.l2c="log"===t.type?m:u,t.l2p=M,t.p2l=E,t.c2p="log"===t.type?function(t,e){return M(x(t,e))}:M,t.p2c="log"===t.type?function(t){return m(E(t))}:E,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=o,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(o(e))},t.p2d=t.p2r=E,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return x(o(t),e)},t.r2d=t.r2c=function(t){return m(o(t))},t.d2c=t.r2l=o,t.c2d=t.l2r=u,t.c2r=x,t.l2d=m,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return m(E(t))},t.r2p=function(e){return t.l2p(o(e))},t.p2r=E,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=b,t.c2d=t.c2r=t.l2d=t.l2r=_,t.d2p=t.r2p=function(e,r,n){return t.l2p(b(e,0,n))},t.p2d=t.p2r=function(t,e,r){return _(E(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,p,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=k,t.r2d=t.c2d=t.l2d=w,t.d2r=t.d2l_noadd=T,t.r2c=function(e){var r=T(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=T,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return w(E(t))},t.r2p=t.d2p,t.p2r=E,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=w,t.d2r=t.d2l_noadd=T,t.r2c=function(e){var r=T(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=A,t.l2r=t.c2r=u,t.r2l=T,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return w(E(t))},t.r2p=t.d2p,t.p2r=E,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:u(t)},t.setupMultiCategory=function(n){var i,o,s=t._traceIndices,l=e._axisMatchGroups;if(l&&l.length&&0===t._categories.length)for(i=0;ih&&(s[n]=h),s[0]===s[1]){var u=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=u,s[1]+=u}}else a.nestedProperty(t,e).set(o)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=g.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s=t.r2l(t[a][0],o),l=t.r2l(t[a][1],o);if("y"===f?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-l),t._b=-t._m*l):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(l-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b)||t._length<0)throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.makeCalcdata=function(e,r){var n,i,o,s,l=t.type,u="date"===l&&e[r+"calendar"];if(r in e){if(n=e[r],s=e._length||a.minRowLength(n),a.isTypedArray(n)&&("linear"===l||"log"===l)){if(s===n.length)return n;if(n.subarray)return n.subarray(0,s)}if("multicategory"===l)return function(t,e){for(var r=new Array(e),n=0;nr.duration?(function(){for(var r={},n=0;n rect").call(a.setTranslate,0,0).call(a.setScale,1,1),t.plot.call(a.setTranslate,e._offset,r._offset).call(a.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(a.setPointGroupScale,1,1),n.selectAll(".textpoint").call(a.setTextPointsScale,1,1),n.call(a.hideOutsideRangePoints,t)}function v(e,r){var n=e.plotinfo,i=n.xaxis,s=n.yaxis,l=e.xr0,u=e.xr1,c=i._length,f=e.yr0,h=e.yr1,p=s._length,d=!!u,v=!!h,g=[];if(d){var m=l[1]-l[0],y=u[1]-u[0];g[0]=(l[0]*(1-r)+r*u[0]-l[0])/(l[1]-l[0])*c,g[2]=c*(1-r+r*y/m),i.range[0]=l[0]*(1-r)+r*u[0],i.range[1]=l[1]*(1-r)+r*u[1]}else g[0]=0,g[2]=c;if(v){var x=f[1]-f[0],b=h[1]-h[0];g[1]=(f[1]*(1-r)+r*h[1]-f[1])/(f[0]-f[1])*p,g[3]=p*(1-r+r*b/x),s.range[0]=f[0]*(1-r)+r*h[0],s.range[1]=f[1]*(1-r)+r*h[1]}else g[1]=0,g[3]=p;o.drawOne(t,i,{skipTitle:!0}),o.drawOne(t,s,{skipTitle:!0}),o.redrawComponents(t,[i._id,s._id]);var _=d?c/g[2]:1,w=v?p/g[3]:1,k=d?g[0]:0,A=v?g[1]:0,T=d?g[0]/g[2]*c:0,M=v?g[1]/g[3]*p:0,E=i._offset-T,S=s._offset-M;n.clipRect.call(a.setTranslate,k,A).call(a.setScale,1/_,1/w),n.plot.call(a.setTranslate,E,S).call(a.setScale,_,w),a.setPointGroupScale(n.zoomScalePts,1/_,1/w),a.setTextPointsScale(n.zoomScaleTxt,1/_,1/w)}o.redrawComponents(t)}},{"../../components/drawing":601,"../../registry":831,"./axes":751,d3:157}],774:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,i=t("./axis_autotype");function a(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=a(t),i=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return i&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){var l=r("type",(s.splomStash||{}).type);"-"===l&&(function(t,e){if("-"===t.type){var r=t._id,s=r.charAt(0);-1!==r.indexOf("scene")&&(r=s);var l=function(t,e,r){for(var n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,r,s);if(l)if("histogram"!==l.type||s!=={v:"y",h:"x"}[l.orientation||"v"]){var u,c=s+"calendar",f=l[c],h={noMultiCategory:!n(l,"cartesian")||n(l,"noMultiCategory")};if(o(l,s)){var p=a(l),d=[];for(u=0;u0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}})}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(u)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(u){a(t,u,s.cache),s.check=function(){if(l){var e=a(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;fi*Math.PI/180}return!1},r.getPath=function(){return n.geo.path().projection(r)},r.getBounds=function(t){return r.getPath().bounds(t)},r.fitExtent=function(t,e){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),a&&r.clipExtent(null);var o=r.getBounds(e),s=Math.min(n/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),l=+t[0][0]+(n-s*(o[1][0]+o[0][0]))/2,u=+t[0][1]+(i-s*(o[1][1]+o[0][1]))/2;return a&&r.clipExtent(a),r.scale(150*s).translate([l,u])},r.precision(v.precision),i&&r.clipAngle(i-v.clipPad),r}(e);c.center([u.lon-l.lon,u.lat-l.lat]).rotate([-l.lon,-l.lat,l.roll]).parallels(s.parallels);var f=[[r.l+r.w*o.x[0],r.t+r.h*(1-o.y[1])],[r.l+r.w*o.x[1],r.t+r.h*(1-o.y[0])]],h=e.lonaxis,p=e.lataxis,d=function(t,e){var r=v.clipPad,n=t[0]+r,i=t[1]-r,a=e[0]+r,o=e[1]-r;n>0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}(h.range,p.range);c.fitExtent(f,d);var g=this.bounds=c.getBounds(d),m=this.fitScale=c.scale(),y=c.translate();if(!isFinite(g[0][0])||!isFinite(g[0][1])||!isFinite(g[1][0])||!isFinite(g[1][1])||isNaN(y[0])||isNaN(y[0])){for(var x=this.graphDiv,b=["projection.rotation","center","lonaxis.range","lataxis.range"],_="Invalid geo settings, relayout'ing to default view.",w={},k=0;k-1&&p(n.event,a,[r.xaxis],[r.yaxis],r.id,v),u.indexOf("event")>-1&&l.click(a,n.event))})}function g(t){return r.projection.invert([t[0]+r.xaxis._offset,t[1]+r.yaxis._offset])}},x.makeFramework=function(){var t=this,e=t.graphDiv,r=e._fullLayout,i="clip"+r._uid+t.id;t.clipDef=r._clips.append("clipPath").attr("id",i),t.clipRect=t.clipDef.append("rect"),t.framework=n.select(t.container).append("g").attr("class","geo "+t.id).call(s.setClipUrl,i,e),t.project=function(e){var r=t.projection(e);return r?[r[0]-t.xaxis._offset,r[1]-t.yaxis._offset]:[null,null]},t.xaxis={_id:"x",c2p:function(e){return t.project(e)[0]}},t.yaxis={_id:"y",c2p:function(e){return t.project(e)[1]}},t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},c.setConvert(t.mockAxis,r)},x.saveViewInitial=function(t){var e=t.center||{},r=t.projection,n=r.rotation||{};t._isScoped?this.viewInitial={"center.lon":e.lon,"center.lat":e.lat,"projection.scale":r.scale}:t._isClipped?this.viewInitial={"projection.scale":r.scale,"projection.rotation.lon":n.lon,"projection.rotation.lat":n.lat}:this.viewInitial={"center.lon":e.lon,"center.lat":e.lat,"projection.scale":r.scale,"projection.rotation.lon":n.lon}},x.render=function(){var t,e=this.projection,r=e.getPath();function n(t){var r=e(t.lonlat);return r?"translate("+r[0]+","+r[1]+")":null}function i(t){return e.isLonLatOverEdges(t.lonlat)?"none":null}for(t in this.basePaths)this.basePaths[t].attr("d",r);for(t in this.dataPaths)this.dataPaths[t].attr("d",function(t){return r(t.geojson)});for(t in this.dataPoints)this.dataPoints[t].attr("display",i).attr("transform",n)}},{"../../components/color":580,"../../components/dragelement":598,"../../components/drawing":601,"../../components/fx":619,"../../lib":703,"../../lib/topojson_utils":730,"../../registry":831,"../cartesian/axes":751,"../cartesian/select":768,"../plots":812,"./constants":779,"./projections":784,"./zoom":785,d3:157,"topojson-client":527}],781:[function(t,e,r){"use strict";var n=t("../../plots/get_data").getSubplotCalcData,i=t("../../lib").counterRegex,a=t("./geo"),o="geo",s=i(o),l={};l[o]={valType:"subplotid",dflt:o,editType:"calc"},e.exports={attr:o,name:o,idRoot:o,idRegex:s,attrRegex:s,attributes:l,layoutAttributes:t("./layout_attributes"),supplyLayoutDefaults:t("./layout_defaults"),plot:function(t){var e=t._fullLayout,r=t.calcdata,i=e._subplots[o];void 0===window.PlotlyGeoAssets&&(window.PlotlyGeoAssets={topojson:{}});for(var s=0;s0&&w<0&&(w+=360);var k,A,T,M=(_+w)/2;if(!u){var E=c?s.projRotate:[M,0,0];k=r("projection.rotation.lon",E[0]),r("projection.rotation.lat",E[1]),r("projection.rotation.roll",E[2]),r("showcoastlines",!c)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean")&&r("oceancolor")}if(u?(A=-96.6,T=38.7):(A=c?M:k,T=(b[0]+b[1])/2),r("center.lon",A),r("center.lat",T),f){var S=s.projParallels||[0,60];r("projection.parallels",S)}r("projection.scale"),r("showland")&&r("landcolor"),r("showlakes")&&r("lakecolor"),r("showrivers")&&(r("rivercolor"),r("riverwidth")),r("showcountries",c&&"usa"!==a)&&(r("countrycolor"),r("countrywidth")),("usa"===a||"north america"===a&&50===n)&&(r("showsubunits",!0),r("subunitcolor"),r("subunitwidth")),c||r("showframe",!0)&&(r("framecolor"),r("framewidth")),r("bgcolor")}e.exports=function(t,e,r){n(t,e,r,{type:"geo",attributes:a,handleDefaults:s,partition:"y"})}},{"../subplot_defaults":826,"./constants":779,"./layout_attributes":782}],784:[function(t,e,r){"use strict";e.exports=function(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:r(t.geometry,e)}}function r(e,n){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return r(t,n)})};if(!u.hasOwnProperty(e.type))return null;var i=u[e.type];return t.geo.stream(e,n(i)),i.result()}t.geo.project=function(t,e){var i=e.stream;if(!i)throw new Error("not yet supported");return(t&&n.hasOwnProperty(t.type)?n[t.type]:r)(t,i)};var n={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,r)})}}},i=[],a=[],o={point:function(t,e){i.push([t,e])},result:function(){var t=i.length?i.length<2?{type:"Point",coordinates:i[0]}:{type:"MultiPoint",coordinates:i}:null;return i=[],t}},s={lineStart:c,point:function(t,e){i.push([t,e])},lineEnd:function(){i.length&&(a.push(i),i=[])},result:function(){var t=a.length?a.length<2?{type:"LineString",coordinates:a[0]}:{type:"MultiLineString",coordinates:a}:null;return a=[],t}},l={polygonStart:c,lineStart:c,point:function(t,e){i.push([t,e])},lineEnd:function(){var t=i.length;if(t){do{i.push(i[0].slice())}while(++t<4);a.push(i),i=[]}},polygonEnd:c,result:function(){if(!a.length)return null;var t=[],e=[];return a.forEach(function(r){!function(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++rn^p>n&&r<(h-u)*(n-c)/(p-c)+u&&(i=!i)}return i}(t[0],r))return t.push(e),!0})||t.push([e])}),a=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},u={Point:o,MultiPoint:o,LineString:s,MultiLineString:s,Polygon:l,MultiPolygon:l,Sphere:l};function c(){}var f=1e-6,h=f*f,p=Math.PI,d=p/2,v=(Math.sqrt(p),p/180),g=180/p;function m(t){return t>1?d:t<-1?-d:Math.asin(t)}function y(t){return t>1?0:t<-1?p:Math.acos(t)}var x=t.geo.projection,b=t.geo.projectionMutator;function _(t,e){var r=(2+d)*Math.sin(e);e/=2;for(var n=0,i=1/0;n<10&&Math.abs(i)>f;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}return[2/Math.sqrt(p*(4+p))*t*(1+Math.cos(e)),2*Math.sqrt(p/(4+p))*Math.sin(e)]}t.geo.interrupt=function(e){var r,n=[[[[-p,0],[0,d],[p,0]]],[[[-p,0],[0,-d],[p,0]]]];function i(t,r){for(var i=r<0?-1:1,a=n[+(r<0)],o=0,s=a.length-1;oa[o][2][0];++o);var l=e(t-a[o][1][0],r);return l[0]+=e(a[o][1][0],i*r>i*a[o][0][1]?a[o][0][1]:r)[0],l}e.invert&&(i.invert=function(t,a){for(var o=r[+(a<0)],s=n[+(a<0)],u=0,c=o.length;u=0;--i){var o=n[1][i],l=180*o[0][0]/p,u=180*o[0][1]/p,c=180*o[1][1]/p,f=180*o[2][0]/p,h=180*o[2][1]/p;r.push(s([[f-e,h-e],[f-e,c+e],[l+e,c+e],[l+e,u-e]],30))}return{type:"Polygon",coordinates:[t.merge(r)]}}(),l)},i},a.lobes=function(t){return arguments.length?(n=t.map(function(t){return t.map(function(t){return[[t[0][0]*p/180,t[0][1]*p/180],[t[1][0]*p/180,t[1][1]*p/180],[t[2][0]*p/180,t[2][1]*p/180]]})}),r=n.map(function(t){return t.map(function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})}),a):n.map(function(t){return t.map(function(t){return[[180*t[0][0]/p,180*t[0][1]/p],[180*t[1][0]/p,180*t[1][1]/p],[180*t[2][0]/p,180*t[2][1]/p]]})})},a},_.invert=function(t,e){var r=.5*e*Math.sqrt((4+p)/p),n=m(r),i=Math.cos(n);return[t/(2/Math.sqrt(p*(4+p))*(1+i)),m((n+r*(i+2))/(2+d))]},(t.geo.eckert4=function(){return x(_)}).raw=_;var w=t.geo.azimuthalEqualArea.raw;function k(t,e){if(arguments.length<2&&(e=t),1===e)return w;if(e===1/0)return A;function r(r,n){var i=w(r/e,n);return i[0]*=t,i}return r.invert=function(r,n){var i=w.invert(r/t,n);return i[0]*=e,i},r}function A(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function T(t,e){return[3*t/(2*p)*Math.sqrt(p*p/3-e*e),e]}function M(t,e){return[t,1.25*Math.log(Math.tan(p/4+.4*e))]}function E(t){return function(e){var r,n=t*Math.sin(e),i=30;do{e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e))}while(Math.abs(r)>f&&--i>0);return e/2}}A.invert=function(t,e){var r=2*m(e/2);return[t*Math.cos(r/2)/Math.cos(r),r]},(t.geo.hammer=function(){var t=2,e=b(k),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}).raw=k,T.invert=function(t,e){return[2/3*p*t/Math.sqrt(p*p/3-e*e),e]},(t.geo.kavrayskiy7=function(){return x(T)}).raw=T,M.invert=function(t,e){return[t,2.5*Math.atan(Math.exp(.8*e))-.625*p]},(t.geo.miller=function(){return x(M)}).raw=M,E(p);var S=function(t,e,r){var n=E(r);function i(r,i){return[t*r*Math.cos(i=n(i)),e*Math.sin(i)]}return i.invert=function(n,i){var a=m(i/e);return[n/(t*Math.cos(a)),m((2*a+Math.sin(2*a))/r)]},i}(Math.SQRT2/d,Math.SQRT2,p);function C(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}(t.geo.mollweide=function(){return x(S)}).raw=S,C.invert=function(t,e){var r,n=e,i=25;do{var a=n*n,o=a*a;n-=r=(n*(1.007226+a*(.015085+o*(.028874*a-.044475-.005916*o)))-e)/(1.007226+a*(.045255+o*(.259866*a-.311325-.005916*11*o)))}while(Math.abs(r)>f&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},(t.geo.naturalEarth=function(){return x(C)}).raw=C;var L=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];function O(t,e){var r,n=Math.min(18,36*Math.abs(e)/p),i=Math.floor(n),a=n-i,o=(r=L[i])[0],s=r[1],l=(r=L[++i])[0],u=r[1],c=(r=L[Math.min(19,++i)])[0],f=r[1];return[t*(l+a*(c-o)/2+a*a*(c-2*l+o)/2),(e>0?d:-d)*(u+a*(f-s)/2+a*a*(f-2*u+s)/2)]}function I(t,e){return[t*Math.cos(e),e]}function P(t,e){var r,n=Math.cos(e),i=(r=y(n*Math.cos(t/=2)))?r/Math.sin(r):1;return[2*n*Math.sin(t)*i,Math.sin(e)*i]}function D(t,e){var r=P(t,e);return[(r[0]+t/d)/2,(r[1]+e)/2]}L.forEach(function(t){t[1]*=1.0144}),O.invert=function(t,e){var r=e/d,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=L[a][1],s=L[a+1][1],l=L[Math.min(19,a+2)][1],u=l-o,c=l-2*s+o,f=2*(Math.abs(r)-s)/u,p=c/u,m=f*(1-p*f*(1-2*p*f));if(m>=0||1===a){n=(e>=0?5:-5)*(m+i);var y,x=50;do{i=Math.min(18,Math.abs(n)/5),a=Math.floor(i),m=i-a,o=L[a][1],s=L[a+1][1],l=L[Math.min(19,a+2)][1],n-=(y=(e>=0?d:-d)*(s+m*(l-o)/2+m*m*(l-2*s+o)/2)-e)*g}while(Math.abs(y)>h&&--x>0);break}}while(--a>=0);var b=L[a][0],_=L[a+1][0],w=L[Math.min(19,a+2)][0];return[t/(_+m*(w-b)/2+m*m*(w-2*_+b)/2),n*v]},(t.geo.robinson=function(){return x(O)}).raw=O,I.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return x(I)}).raw=I,P.invert=function(t,e){if(!(t*t+4*e*e>p*p+f)){var r=t,n=e,i=25;do{var a,o=Math.sin(r),s=Math.sin(r/2),l=Math.cos(r/2),u=Math.sin(n),c=Math.cos(n),h=Math.sin(2*n),d=u*u,v=c*c,g=s*s,m=1-v*l*l,x=m?y(c*l)*Math.sqrt(a=1/m):a=0,b=2*x*c*s-t,_=x*u-e,w=a*(v*g+x*c*l*d),k=a*(.5*o*h-2*x*u*s),A=.25*a*(h*s-x*u*v*o),T=a*(d*l+x*g*c),M=k*A-T*w;if(!M)break;var E=(_*k-b*T)/M,S=(b*A-_*w)/M;r-=E,n-=S}while((Math.abs(E)>f||Math.abs(S)>f)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return x(P)}).raw=P,D.invert=function(t,e){var r=t,n=e,i=25;do{var a,o=Math.cos(n),s=Math.sin(n),l=Math.sin(2*n),u=s*s,c=o*o,h=Math.sin(r),p=Math.cos(r/2),v=Math.sin(r/2),g=v*v,m=1-c*p*p,x=m?y(o*p)*Math.sqrt(a=1/m):a=0,b=.5*(2*x*o*v+r/d)-t,_=.5*(x*s+n)-e,w=.5*a*(c*g+x*o*p*u)+.5/d,k=a*(h*l/4-x*s*v),A=.125*a*(l*v-x*s*c*h),T=.5*a*(u*p+x*g*o)+.5,M=k*A-T*w,E=(_*k-b*T)/M,S=(b*A-_*w)/M;r-=E,n-=S}while((Math.abs(E)>f||Math.abs(S)>f)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return x(D)}).raw=D}},{}],785:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../registry"),o=Math.PI/180,s=180/Math.PI,l={cursor:"pointer"},u={cursor:"auto"};function c(t,e){return n.behavior.zoom().translate(e.translate()).scale(e.scale())}function f(t,e,r){var n=t.id,o=t.graphDiv,s=o.layout,l=s[n],u=o._fullLayout,c=u[n],f={},h={};function p(t,e){f[n+"."+t]=i.nestedProperty(l,t).get(),a.call("_storeDirectGUIEdit",s,u._preGUI,f);var r=i.nestedProperty(c,t);r.get()!==e&&(r.set(e),i.nestedProperty(l,t).set(e),h[n+"."+t]=e)}r(p),p("projection.scale",e.scale()/t.fitScale),o.emit("plotly_relayout",h)}function h(t,e){var r=c(0,e);function i(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",function(){n.select(this).style(l)}).on("zoom",function(){e.scale(n.event.scale).translate(n.event.translate),t.render();var r=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})}).on("zoomend",function(){n.select(this).style(u),f(t,e,i)}),r}function p(t,e){var r,i,a,o,s,h,p,d,v,g=c(0,e),m=2;function y(t){return e.invert(t)}function x(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}return g.on("zoomstart",function(){n.select(this).style(l),r=n.mouse(this),i=e.rotate(),a=e.translate(),o=i,s=y(r)}).on("zoom",function(){if(h=n.mouse(this),function(t){var r=y(t);if(!r)return!0;var n=e(r);return Math.abs(n[0]-t[0])>m||Math.abs(n[1]-t[1])>m}(r))return g.scale(e.scale()),void g.translate(e.translate());e.scale(n.event.scale),e.translate([a[0],n.event.translate[1]]),s?y(h)&&(d=y(h),p=[o[0]+(d[0]-s[0]),i[1],i[2]],e.rotate(p),o=p):s=y(r=h),v=!0,t.render();var l=e.rotate(),u=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":u[0],"geo.center.lat":u[1],"geo.projection.rotation.lon":-l[0]})}).on("zoomend",function(){n.select(this).style(u),v&&f(t,e,x)}),g}function d(t,e){var r,i={r:e.rotate(),k:e.scale()},a=c(0,e),h=function(t){for(var e=0,r=arguments.length,i=[];++ed?(a=(f>0?90:-90)-p,i=0):(a=Math.asin(f/d)*s-p,i=Math.sqrt(d*d-f*f));var v=180-a-2*p,m=(Math.atan2(h,c)-Math.atan2(u,i))*s,x=(Math.atan2(h,c)-Math.atan2(u,-i))*s,b=g(r[0],r[1],a,m),_=g(r[0],r[1],v,x);return b<=_?[a,m,r[2]]:[v,x,r[2]]}(k,r,S);isFinite(A[0])&&isFinite(A[1])&&isFinite(A[2])||(A=S),e.rotate(A),S=A}}else r=v(e,M=b);h.of(this,arguments)({type:"zoom"})}),T=h.of(this,arguments),p++||T({type:"zoomstart"})}).on("zoomend",function(){var r;n.select(this).style(u),d.call(a,"zoom",null),r=h.of(this,arguments),--p||r({type:"zoomend"}),f(t,e,m)}).on("zoom.redraw",function(){t.render();var r=e.rotate();t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.projection.rotation.lon":-r[0],"geo.projection.rotation.lat":-r[1]})}),n.rebind(a,h,"on")}function v(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&function(t){var e=t[0]*o,r=t[1]*o,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}(r)}function g(t,e,r,n){var i=m(r-t),a=m(n-e);return Math.sqrt(i*i+a*a)}function m(t){return(t%360+540)%360-180}function y(t,e,r){var n=r*o,i=t.slice(),a=0===e?1:0,s=2===e?1:2,l=Math.cos(n),u=Math.sin(n);return i[a]=t[a]*l-t[s]*u,i[s]=t[s]*l+t[a]*u,i}function x(t,e){for(var r=0,n=0,i=t.length;nMath.abs(s)?(u.boxEnd[1]=u.boxStart[1]+Math.abs(a)*_*(s>=0?1:-1),u.boxEnd[1]l[3]&&(u.boxEnd[1]=l[3],u.boxEnd[0]=u.boxStart[0]+(l[3]-u.boxStart[1])/Math.abs(_))):(u.boxEnd[0]=u.boxStart[0]+Math.abs(s)/_*(a>=0?1:-1),u.boxEnd[0]l[2]&&(u.boxEnd[0]=l[2],u.boxEnd[1]=u.boxStart[1]+(l[2]-u.boxStart[0])*Math.abs(_)))}}else u.boxEnabled?(a=u.boxStart[0]!==u.boxEnd[0],s=u.boxStart[1]!==u.boxEnd[1],a||s?(a&&(g(0,u.boxStart[0],u.boxEnd[0]),t.xaxis.autorange=!1),s&&(g(1,u.boxStart[1],u.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),u.boxEnabled=!1,u.boxInited=!1):u.boxInited&&(u.boxInited=!1);break;case"pan":u.boxEnabled=!1,u.boxInited=!1,e?(u.panning||(u.dragStart[0]=n,u.dragStart[1]=i),Math.abs(u.dragStart[0]-n).999&&(m="turntable"):m="turntable")}else m="turntable";r("dragmode",m),r("hovermode",n.getDfltFromLayout("hovermode"))}e.exports=function(t,e,r){var i=e._basePlotModules.length>1;o(t,e,r,{type:c,attributes:l,handleDefaults:f,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!i)return n.validate(t[e],l[e])?t[e]:void 0},paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":580,"../../../lib":703,"../../../registry":831,"../../get_data":786,"../../subplot_defaults":826,"./axis_defaults":794,"./layout_attributes":797}],797:[function(t,e,r){"use strict";var n=t("./axis_attributes"),i=t("../../domain").attributes,a=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(s(0,0,1),{}),center:a(s(0,0,0),{}),eye:a(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":703,"../../../lib/extend":693,"../../domain":776,"./axis_attributes":793}],798:[function(t,e,r){"use strict";var n=t("../../../lib/str2rgbarray"),i=["xaxis","yaxis","zaxis"];function a(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}var o=a.prototype;o.merge=function(t){for(var e=0;e<3;++e){var r=t[i[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new a;return e.merge(t),e}},{"../../../lib/str2rgbarray":726}],799:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],u=0;u<3;++u){var c=s[a[u]];if(c._length=(r[u].hi-r[u].lo)*r[u].pixelsPerDataUnit/t.dataScale[u],Math.abs(c._length)===1/0||isNaN(c._length))l[u]=[];else{c._input_range=c.range.slice(),c.range[0]=r[u].lo/t.dataScale[u],c.range[1]=r[u].hi/t.dataScale[u],c._m=1/(t.dataScale[u]*r[u].pixelsPerDataUnit),c.range[0]===c.range[1]&&(c.range[0]-=1,c.range[1]+=1);var f=c.tickmode;if("auto"===c.tickmode){c.tickmode="linear";var h=c.nticks||i.constrain(c._length/40,4,9);n.autoTicks(c,Math.abs(c.range[1]-c.range[0])/h)}for(var p=n.calcTicks(c),d=0;d/g," "));l[u]=p,c.tickmode=f}}e.ticks=l;for(var u=0;u<3;++u){o[u]=.5*(t.glplot.bounds[0][u]+t.glplot.bounds[1][u]);for(var d=0;d<2;++d)e.bounds[d][u]=t.glplot.bounds[d][u]}t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;a")):"isosurface"===e.type||"volume"===e.type?(w.valueLabel=f.tickText(t.mockAxis,t.mockAxis.d2l(p.traceCoordinate[3]),"hover").text,M.push("value: "+w.valueLabel),p.textLabel&&M.push(p.textLabel),x=M.join("
")):x=p.textLabel;var E={x:p.traceCoordinate[0],y:p.traceCoordinate[1],z:p.traceCoordinate[2],data:b._input,fullData:b,curveNumber:b.index,pointNumber:_};h.appendArrayPointValue(E,b,_),e._module.eventData&&(E=b._module.eventData(E,p,b,{},_));var S={points:[E]};t.fullSceneLayout.hovermode&&h.loneHover({trace:b,x:(.5+.5*m[0]/m[3])*a,y:(.5-.5*m[1]/m[3])*o,xLabel:w.xLabel,yLabel:w.yLabel,zLabel:w.zLabel,text:x,name:u.name,color:h.castHoverOption(b,_,"bgcolor")||u.color,borderColor:h.castHoverOption(b,_,"bordercolor"),fontFamily:h.castHoverOption(b,_,"font.family"),fontSize:h.castHoverOption(b,_,"font.size"),fontColor:h.castHoverOption(b,_,"font.color"),nameLength:h.castHoverOption(b,_,"namelength"),textAlign:h.castHoverOption(b,_,"align"),hovertemplate:c.castOption(b,_,"hovertemplate"),hovertemplateLabels:c.extendFlat({},E,w),eventData:[E]},{container:n,gd:r}),p.buttons&&p.distance<5?r.emit("plotly_click",S):r.emit("plotly_hover",S),s=S}else h.loneUnhover(n),r.emit("plotly_unhover",s);t.drawAnnotations(t)}.bind(null,t),t.traces={},t.make4thDimension(),!0}function b(t,e){var r=document.createElement("div"),n=t.container;this.graphDiv=t.graphDiv;var i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.style.position="absolute",i.style.top=i.style.left="0px",i.style.width=i.style.height="100%",i.style["z-index"]=20,i.style["pointer-events"]="none",r.appendChild(i),this.svgContainer=i,r.id=t.id,r.style.position="absolute",r.style.top=r.style.left="0px",r.style.width=r.style.height="100%",n.appendChild(r),this.fullLayout=e,this.id=t.id||"scene",this.fullSceneLayout=e[this.id],this.plotArgs=[[],{},{}],this.axesOptions=g(e,e[this.id]),this.spikeOptions=m(e[this.id]),this.container=r,this.staticMode=!!t.staticPlot,this.pixelRatio=this.pixelRatio||t.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=u.getComponentMethod("annotations3d","convert"),this.drawAnnotations=u.getComponentMethod("annotations3d","draw"),x(this,this.pixelRatio)}var _=b.prototype;_.initializeGLCamera=function(){var t=this.fullSceneLayout.camera,e="orthographic"===t.projection.type;this.camera=a(this.container,{center:[t.center.x,t.center.y,t.center.z],eye:[t.eye.x,t.eye.y,t.eye.z],up:[t.up.x,t.up.y,t.up.z],_ortho:e,zoomMin:.01,zoomMax:100,mode:"orbit"})},_.recoverContext=function(){var t=this,e=this.glplot.gl,r=this.glplot.canvas,n=this.glplot.camera,i=this.glplot.pixelRatio;this.glplot.dispose(),requestAnimationFrame(function a(){e.isContextLost()?requestAnimationFrame(a):x(t,n,i,r)?t.plot.apply(t,t.plotArgs):c.error("Catastrophic and unrecoverable WebGL error. Context lost.")})};var w=["xaxis","yaxis","zaxis"];function k(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=w[i],o=a.charAt(0),s=n[a],l=e[o],u=e[o+"calendar"],f=e["_"+o+"length"];if(c.isArrayOrTypedArray(l))for(var h,p=0;p<(f||l.length);p++)if(c.isArrayOrTypedArray(l[p]))for(var d=0;dv[1][a])v[0][a]=-1,v[1][a]=1;else{var S=v[1][a]-v[0][a];v[0][a]-=S/32,v[1][a]+=S/32}if("reversed"===s.autorange){var C=v[0][a];v[0][a]=v[1][a],v[1][a]=C}}else{var L=s.range;v[0][a]=s.r2l(L[0]),v[1][a]=s.r2l(L[1])}v[0][a]===v[1][a]&&(v[0][a]-=1,v[1][a]+=1),g[a]=v[1][a]-v[0][a],this.glplot.bounds[0][a]=v[0][a]*h[a],this.glplot.bounds[1][a]=v[1][a]*h[a]}var O,I=[1,1,1];for(a=0;a<3;++a){s=u[w[a]],l=s.type;var P=m[l];I[a]=Math.pow(P.acc,1/P.count)/h[a]}if("auto"===u.aspectmode)O=Math.max.apply(null,I)/Math.min.apply(null,I)<=4?I:[1,1,1];else if("cube"===u.aspectmode)O=[1,1,1];else if("data"===u.aspectmode)O=I;else{if("manual"!==u.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var D=u.aspectratio;O=[D.x,D.y,D.z]}u.aspectratio.x=c.aspectratio.x=O[0],u.aspectratio.y=c.aspectratio.y=O[1],u.aspectratio.z=c.aspectratio.z=O[2],this.glplot.aspect=O;var z=u.domain||null,R=e._size||null;if(z&&R){var F=this.container.style;F.position="absolute",F.left=R.l+z.x[0]*R.w+"px",F.top=R.t+(1-z.y[1])*R.h+"px",F.width=R.w*(z.x[1]-z.x[0])+"px",F.height=R.h*(z.y[1]-z.y[0])+"px"}this.glplot.redraw()}},_.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=this.glplot.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},_.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),A(this.glplot.camera)},_.setCamera=function(t){var e;this.glplot.camera.lookAt.apply(this,[[(e=t).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]);var r="orthographic"===t.projection.type,n=this.glplot.camera._ortho;if(r!==n){this.glplot.redraw();var i=this.glplot.pixelRatio,a=this.glplot.clearColor;this.glplot.gl.clearColor(a[0],a[1],a[2],a[3]),this.glplot.gl.clear(this.glplot.gl.DEPTH_BUFFER_BIT|this.glplot.gl.COLOR_BUFFER_BIT),this.glplot.dispose(),x(this,i),this.glplot.camera._ortho=r}},_.saveCamera=function(t){var e=this.fullLayout,r=this.getCamera(),n=c.nestedProperty(t,this.id+".camera"),i=n.get(),a=!1;function o(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}if(void 0===i)a=!0;else{for(var s=0;s<3;s++)for(var l=0;l<3;l++)if(!o(r,i,s,l)){a=!0;break}(!i.projection||r.projection&&r.projection.type!==i.projection.type)&&(a=!0)}if(a){var f={};f[this.id+".camera"]=i,u.call("_storeDirectGUIEdit",t,e._preGUI,f),n.set(r);var h=c.nestedProperty(e,this.id+".camera");h.set(r)}return a},_.updateFx=function(t,e){var r=this.camera;if(r)if("orbit"===t)r.mode="orbit",r.keyBindingMode="rotate";else if("turntable"===t){r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate";var n=this.graphDiv,i=n._fullLayout,a=this.fullSceneLayout.camera,o=a.up.x,s=a.up.y,l=a.up.z;if(l/Math.sqrt(o*o+s*s+l*l)<.999){var f=this.id+".camera.up",h={x:0,y:0,z:1},p={};p[f]=h;var d=n.layout;u.call("_storeDirectGUIEdit",d,i._preGUI,p),a.up=h,c.nestedProperty(d,f).set(h)}}else r.keyBindingMode=t;this.fullSceneLayout.hovermode=e},_.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(n),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,i=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var a=new Uint8Array(r*i*4);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,a);for(var o=0,s=i-1;o0)}function l(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var a=t.symbol,o=i(a.textposition,a.iconsize);n.extendFlat(e,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),n.extendFlat(r,{"icon-color":t.color,"text-color":a.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:r}}o.update=function(t){this.visible?this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=s(t)},o.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},o.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},o.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,s(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,i={type:r};return"geojson"===r?e="data":"vector"===r&&(e="string"==typeof n?"url":"tiles"),i[e]=n,i}(t);e.addSource(this.idSource,r)}},o.updateLayer=function(t){var e=this.map,r=l(t);this.removeLayer(),this.layerType=t.type,s(t)&&e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type,minzoom:t.minzoom,maxzoom:t.maxzoom,layout:r.layout,paint:r.paint},t.below)},o.updateStyle=function(t){if(s(t)){var e=l(t);this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint)}},o.removeLayer=function(){var t=this.map;t.getLayer(this.idLayer)&&t.removeLayer(this.idLayer)},o.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,r){var n=new a(t,e);return n.update(r),n}},{"../../lib":703,"./convert_text_opts":805}],808:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").defaultLine,a=t("../domain").attributes,o=t("../font_attributes"),s=t("../../traces/scatter/attributes").textposition,l=t("../../plot_api/edit_types").overrideAll,u=t("../../plot_api/plot_template").templatedArray,c=o({});c.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var f=e.exports=l({_arrayAttrRegexps:[n.counterRegex("mapbox",".layers",!0)],domain:a({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic"},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:u("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},type:{valType:"enumerated",values:["circle","line","fill","symbol"],dflt:"circle"},below:{valType:"string",dflt:""},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:c,textposition:n.extendFlat({},s,{arrayOk:!1})}})},"plot","from-root");f.uirevision={valType:"any",editType:"none"}},{"../../components/color":580,"../../lib":703,"../../plot_api/edit_types":734,"../../plot_api/plot_template":741,"../../traces/scatter/attributes":1075,"../domain":776,"../font_attributes":777}],809:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../subplot_defaults"),a=t("../array_container_defaults"),o=t("./layout_attributes");function s(t,e,r,n){r("accesstoken",n.accessToken),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),a(t,e,{name:"layers",handleItemDefaults:l}),e._input=t}function l(t,e){function r(r,i){return n.coerce(t,e,o.layers,r,i)}var i=r("visible");if(i){var a=r("sourcetype");r("source"),"vector"===a&&r("sourcelayer");var s=r("type");r("below"),r("color"),r("opacity"),r("minzoom"),r("maxzoom"),"circle"===s&&r("circle.radius"),"line"===s&&(r("line.width"),r("line.dash")),"fill"===s&&r("fill.outlinecolor"),"symbol"===s&&(r("symbol.icon"),r("symbol.iconsize"),r("symbol.text"),n.coerceFont(r,"symbol.textfont"),r("symbol.textposition"),r("symbol.placement"))}}e.exports=function(t,e,r){i(t,e,r,{type:"mapbox",attributes:o,handleDefaults:s,partition:"y",accessToken:e._mapboxAccessToken})}},{"../../lib":703,"../array_container_defaults":747,"../subplot_defaults":826,"./layout_attributes":808}],810:[function(t,e,r){"use strict";var n=t("mapbox-gl"),i=t("../../components/fx"),a=t("../../lib"),o=t("../../registry"),s=t("../../components/dragelement"),l=t("../cartesian/select").prepSelect,u=t("../cartesian/select").selectOnClick,c=t("./constants"),f=t("./layout_attributes"),h=t("./layers");function p(t){this.id=t.id,this.gd=t.gd,this.container=t.container,this.isStatic=t.staticPlot;var e=t.fullLayout;this.uid=e._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(e),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[]}var d=p.prototype;function v(t){var e=f.style.values,r=f.style.dflt,n={};return a.isPlainObject(t)?(n.id=t.id,n.style=t):"string"==typeof t?(n.id=t,n.style=-1!==e.indexOf(t)?g(t):t):(n.id=r,n.style=g(r)),n.transition={duration:0,delay:0},n}function g(t){return c.styleUrlPrefix+t+"-"+c.styleUrlSuffix}function m(t){return[t.lon,t.lat]}e.exports=function(t){return new p(t)},d.plot=function(t,e,r){var n,i=this,a=e[i.id];i.map&&a.accesstoken!==i.accessToken&&(i.map.remove(),i.map=null,i.styleObj=null,i.traceHash=[],i.layerList={}),n=i.map?new Promise(function(r,n){i.updateMap(t,e,r,n)}):new Promise(function(r,n){i.createMap(t,e,r,n)}),r.push(n)},d.createMap=function(t,e,r,a){var s=this,l=s.gd,f=e[s.id],h=s.styleObj=v(f.style);s.accessToken=f.accesstoken;var p=s.map=new n.Map({container:s.div,style:h.style,center:m(f.center),zoom:f.zoom,bearing:f.bearing,pitch:f.pitch,interactive:!s.isStatic,preserveDrawingBuffer:s.isStatic,doubleClickZoom:!1,boxZoom:!1}),d=c.controlContainerClassName,g=s.div.getElementsByClassName(d)[0];if(s.div.removeChild(g),p._canvas.style.left="0px",p._canvas.style.top="0px",s.rejectOnError(a),p.once("load",function(){s.updateData(t),s.updateLayout(e),s.resolveOnRender(r)}),!s.isStatic){var y=!1;p.on("moveend",function(t){if(s.map){if(t.originalEvent||y){var e=l._fullLayout[s.id];o.call("_storeDirectGUIEdit",l.layout,l._fullLayout._preGUI,s.getViewEdits(e));var r=s.getView();e._input.center=e.center=r.center,e._input.zoom=e.zoom=r.zoom,e._input.bearing=e.bearing=r.bearing,e._input.pitch=e.pitch=r.pitch,l.emit("plotly_relayout",s.getViewEdits(r))}y=!1}}),p.on("wheel",function(){y=!0}),p.on("mousemove",function(t){var e=s.div.getBoundingClientRect();t.clientX=t.point.x+e.left,t.clientY=t.point.y+e.top,t.target.getBoundingClientRect=function(){return e},s.xaxis.p2c=function(){return t.lngLat.lng},s.yaxis.p2c=function(){return t.lngLat.lat},i.hover(l,t,s.id)}),p.on("dragstart",x),p.on("zoomstart",x),p.on("drag",b),p.on("zoom",b),p.on("dblclick",function(){var t=l._fullLayout[s.id];o.call("_storeDirectGUIEdit",l.layout,l._fullLayout._preGUI,s.getViewEdits(t));var e=s.viewInitial;p.setCenter(m(e.center)),p.setZoom(e.zoom),p.setBearing(e.bearing),p.setPitch(e.pitch);var r=s.getView();t._input.center=t.center=r.center,t._input.zoom=t.zoom=r.zoom,t._input.bearing=t.bearing=r.bearing,t._input.pitch=t.pitch=r.pitch,l.emit("plotly_doubleclick",null),l.emit("plotly_relayout",s.getViewEdits(r))}),s.clearSelect=function(){l._fullLayout._zoomlayer.selectAll(".select-outline").remove()},s.onClickInPanFn=function(t){return function(e){var r=l._fullLayout.clickmode;r.indexOf("select")>-1&&u(e.originalEvent,l,[s.xaxis],[s.yaxis],s.id,t),r.indexOf("event")>-1&&i.click(l,e.originalEvent)}}}function x(){i.loneUnhover(e._toppaper)}function b(){var t=s.getView();l.emit("plotly_relayouting",s.getViewEdits(t))}},d.updateMap=function(t,e,r,n){var i=this,a=i.map,o=e[this.id];i.rejectOnError(n);var s=v(o.style);i.styleObj.id!==s.id?(i.styleObj=s,a.setStyle(s.style),a.once("styledata",function(){i.traceHash={},i.updateData(t),i.updateLayout(e),i.resolveOnRender(r)})):(i.updateData(t),i.updateLayout(e),i.resolveOnRender(r))},d.updateData=function(t){var e,r,n,i,a=this.traceHash;for(n=0;n=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),c=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",function(){g.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),s.text(o.text()&&c.text()?" - ":"")}},g.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL,r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"}),a=i.append("input").attr({type:"text",name:"data"});return a.node().value=g.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1};var x=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],b=["year","month","dayMonth","dayMonthYear"];function _(t,e){var r=t._context.locale,n=!1,i={};function o(t){for(var r=!0,a=0;a1&&P.length>1){for(a.getComponentMethod("grid","sizeDefaults")(u,s),o=0;o15&&P.length>15&&0===s.shapes.length&&0===s.images.length,s._hasCartesian=s._has("cartesian"),s._hasGeo=s._has("geo"),s._hasGL3D=s._has("gl3d"),s._hasGL2D=s._has("gl2d"),s._hasTernary=s._has("ternary"),s._hasPie=s._has("pie"),g.linkSubplots(f,s,c,i),g.cleanPlot(f,s,c,i),i._zoomlayer&&!t._dragging&&i._zoomlayer.selectAll(".select-outline").remove(),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i0){var f=1-2*s;n=Math.round(f*n),a=Math.round(f*a)}}var h=g.layoutAttributes.width.min,p=g.layoutAttributes.height.min;n1,v=!e.height&&Math.abs(r.height-a)>1;(v||d)&&(d&&(r.width=n),v&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),g.sanitizeMargins(r)},g.supplyLayoutModuleDefaults=function(t,e,r,n){var i,o,s,u=a.componentsRegistry,c=e._basePlotModules,f=a.subplotsRegistry.cartesian;for(i in u)(s=u[i]).includeBasePlot&&s.includeBasePlot(t,e);for(var h in c.length||c.push(f),e._has("cartesian")&&(a.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(l.subplotSort);for(o=0;o.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0);var l=void 0!==r.xl?r.xl:r.x,u=void 0!==r.xr?r.xr:r.x,c=void 0!==r.yt?r.yt:r.y,f=void 0!==r.yb?r.yb:r.y;i[e]={l:{val:l,size:r.l+o},r:{val:u,size:r.r+o},b:{val:f,size:r.b+o},t:{val:c,size:r.t+o}},a[e]=1}else delete i[e],delete a[e];n._replotting||g.doAutoMargin(t)}},g.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),T(e);var r=e._size,n=e.margin,o=l.extendFlat({},r),s=n.l,u=n.r,c=n.t,f=n.b,h=e.width,p=e.height,d=e._pushmargin,v=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var m in d)v[m]||delete d[m];for(var y in d.base={l:{val:0,size:s},r:{val:1,size:u},t:{val:1,size:c},b:{val:0,size:f}},d){var x=d[y].l||{},b=d[y].b||{},_=x.val,w=x.size,k=b.val,A=b.size;for(var M in d){if(i(w)&&d[M].r){var E=d[M].r.val,S=d[M].r.size;if(E>_){var C=(w*E+(S-h)*_)/(E-_),L=(S*(1-_)+(w-h)*(1-E))/(E-_);C>=0&&L>=0&&h-(C+L)>0&&C+L>s+u&&(s=C,u=L)}}if(i(A)&&d[M].t){var O=d[M].t.val,I=d[M].t.size;if(O>k){var P=(A*O+(I-p)*k)/(O-k),D=(I*(1-k)+(A-p)*(1-O))/(O-k);P>=0&&D>=0&&p-(D+P)>0&&P+D>f+c&&(f=P,c=D)}}}}}if(r.l=Math.round(s),r.r=Math.round(u),r.t=Math.round(c),r.b=Math.round(f),r.p=Math.round(n.pad),r.w=Math.round(h)-r.l-r.r,r.h=Math.round(p)-r.t-r.b,!e._replotting&&g.didMarginChange(o,r))return"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1,a.call("plot",t)};var M=["l","r","t","b","p","w","h"];function E(t,e,r){var n=!1,i=[g.previousPromises,function(){if(t._transitionData)return t._transitioning=!1,function(t){var e=Promise.resolve();if(!t)return e;for(;t.length;)e=e.then(t.shift());return e}(t._transitionData._interruptCallbacks)},r.prepareFn,g.rehover,function(){return t.emit("plotly_transitioning",[]),new Promise(function(i){t._transitioning=!0,e.duration>0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){n=!0}),r.redraw&&t._transitionData._interruptCallbacks.push(function(){return a.call("redraw",t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o=0,s=0;function l(){return o++,function(){var e;s++,n||s!==o||(e=i,t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(r.redraw)return a.call("redraw",t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(e)))}}r.runFn(l),setTimeout(l())})}],o=l.syncOrAsync(i,t);return o&&o.then||(o=Promise.resolve()),o.then(function(){return t})}g.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},g.graphJson=function(t,e,r,n,i){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&g.supplyDefaults(t);var a=i?t._fullData:t.data,o=i?t._fullLayout:t.layout,s=(t._transitionData||{})._frames;function u(t){if("function"==typeof t)return null;if(l.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!l.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;i[e]=u(t[e])}return i}return Array.isArray(t)?t.map(u):l.isTypedArray(t)?l.simpleMap(t,l.identity):l.isJSDate(t)?l.ms2DateTimeLocal(+t):t}var c={data:(a||[]).map(function(t){var r=u(t);return e&&delete r.fit,r})};return e||(c.layout=u(o)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),s&&(c.frames=u(s)),"object"===n?c:JSON.stringify(c)},g.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;s--)if(o[s].enabled){r._indexToPoints=o[s]._indexToPoints;break}n&&n.calc&&(a=n.calc(t,r))}Array.isArray(a)&&a[0]||(a=[{x:c,y:c}]),a[0].t||(a[0].t={}),a[0].trace=r,d[e]=a}}for(C(u,h),i=0;i1e-10?t:0}function h(t,e,r){e=e||0,r=r||0;for(var n=t.length,i=new Array(n),a=0;a0?r:1/0}),i=n.mod(r+1,e.length);return[e[r],e[i]]},findIntersectionXY:u,findXYatLength:function(t,e,r,n){var i=-e*r,a=e*e+1,o=2*(e*i-r),s=i*i+r*r-t*t,l=Math.sqrt(o*o-4*a*s),u=(-o+l)/(2*a),c=(-o-l)/(2*a);return[[u,e*u+i+n],[c,e*c+i+n]]},clampTiny:f,pathPolygon:function(t,e,r,n,i,a){return"M"+h(c(t,e,r,n),i,a).join("L")},pathPolygonAnnulus:function(t,e,r,n,i,a,o){var s,l;t=0?h.angularAxis.domain:n.extent(k),S=Math.abs(k[1]-k[0]);T&&!A&&(S=0);var C=E.slice();M&&A&&(C[1]+=S);var L=h.angularAxis.ticksCount||4;L>8&&(L=L/(L/8)+L%8),h.angularAxis.ticksStep&&(L=(C[1]-C[0])/L);var O=h.angularAxis.ticksStep||(C[1]-C[0])/(L*(h.minorTicks+1));w&&(O=Math.max(Math.round(O),1)),C[2]||(C[2]=O);var I=n.range.apply(this,C);if(I=I.map(function(t,e){return parseFloat(t.toPrecision(12))}),i=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=i.domain(),c.layout.angularAxis.endPadding=M?S:0,void 0===(t=n.select(this).select("svg.chart-root"))||t.empty()){var P=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),D=this.appendChild(this.ownerDocument.importNode(P.documentElement,!0));t=n.select(D)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var z,R=t.select(".chart-group"),F={fill:"none",stroke:h.tickColor},B={"font-size":h.font.size,"font-family":h.font.family,fill:h.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+h.font.outlineColor}).join(",")};if(h.showLegend){z=t.select(".legend-group").attr({transform:"translate("+[x,h.margin.top]+")"}).style({display:"block"});var N=p.map(function(t,e){var r=s.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});s.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:a({},s.Legend.defaultConfig().legendConfig,{container:z,elements:N,reverseOrder:h.legend.reverseOrder})})();var j=z.node().getBBox();x=Math.min(h.width-j.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,x=Math.max(10,x),_=[h.margin.left+x,h.margin.top+x],r.range([0,x]),c.layout.radialAxis.domain=r.domain(),z.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else z=t.select(".legend-group").style({display:"none"});t.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),R.attr("transform","translate("+_+")").style({cursor:"crosshair"});var V=[(h.width-(h.margin.left+h.margin.right+2*x+(j?j.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*x))/2];if(V[0]=Math.max(0,V[0]),V[1]=Math.max(0,V[1]),t.select(".outer-group").attr("transform","translate("+V+")"),h.title&&h.title.text){var U=t.select("g.title-group text").style(B).text(h.title.text),H=U.node().getBBox();U.attr({x:_[0]-H.width/2,y:_[1]-x-20})}var q=t.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var G=q.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(F),G.attr("r",r),G.exit().remove()}q.select("circle.outside-circle").attr({r:x}).style(F);var W=t.select("circle.background-circle").attr({r:x}).style({fill:h.backgroundColor,stroke:h.stroke});function Y(t,e){return i(t)%360+h.orientation}if(h.radialAxis.visible){var X=n.svg.axis().scale(r).ticks(5).tickSize(5);q.call(X).attr({transform:"rotate("+h.radialAxis.orientation+")"}),q.selectAll(".domain").style(F),q.selectAll("g>text").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===h.radialAxis.tickOrientation?"rotate("+-h.radialAxis.orientation+") translate("+[0,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),q.selectAll("g>line").style({stroke:"black"})}var Z=t.select(".angular.axis-group").selectAll("g.angular-tick").data(I),$=Z.enter().append("g").classed("angular-tick",!0);Z.attr({transform:function(t,e){return"rotate("+Y(t)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),Z.exit().remove(),$.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(h.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(h.minorTicks+1)==0)}).style(F),$.selectAll(".minor").style({stroke:h.minorTickColor}),Z.select("line.grid-line").attr({x1:h.tickLength?x-h.tickLength:0,x2:x}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),$.append("text").classed("axis-text",!0).style(B);var J=Z.select("text.axis-text").attr({x:x+h.labelOffset,dy:o+"em",transform:function(t,e){var r=Y(t),n=x+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:h.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(h.minorTicks+1)!=0?"":w?w[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix}).style(B);h.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)});var K=n.max(R.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));z.attr({transform:"translate("+[x+K,h.margin.top]+")"});var Q=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(p);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),p[0]||Q){var et=[];p.forEach(function(t,e){var n={};n.radialScale=r,n.angularScale=i,n.container=tt.filter(function(t,r){return r==e}),n.geometry=t.geometry,n.orientation=h.orientation,n.direction=h.direction,n.index=e,et.push({data:t,geometryConfig:n})});var rt=n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(et),nt=[];rt.forEach(function(t,e){"unstacked"===t.key?nt=nt.concat(t.values.map(function(t,e){return[t]})):nt.push(t.values)}),nt.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return a(s[r].defaultConfig(),t)});s[r]().config(n)()})}var it,at,ot=t.select(".guides-group"),st=t.select(".tooltips-group"),lt=s.tooltipPanel().config({container:st,fontSize:8})(),ut=s.tooltipPanel().config({container:st,fontSize:8})(),ct=s.tooltipPanel().config({container:st,hasTick:!0})();if(!A){var ft=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});R.on("mousemove.angular-guide",function(t,e){var r=s.util.getMousePos(W).angle;ft.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;it=i.invert(n);var a=s.util.convertToCartesian(x+12,r+180);lt.text(s.util.round(it)).move([a[0]+_[0],a[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){ot.select("line").style({opacity:0})})}var ht=ot.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",function(t,e){var n=s.util.getMousePos(W).radius;ht.attr({r:n}).style({opacity:.5}),at=r.invert(s.util.getMousePos(W).radius);var i=s.util.convertToCartesian(n,h.radialAxis.orientation);ut.text(s.util.round(at)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){ht.style({opacity:0}),ct.hide(),lt.hide(),ut.hide()}),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(e,r){var i=n.select(this),a=this.style.fill,o="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),o=n.hsl(a).darker().toString(),i.style({fill:o,opacity:1});var u={t:s.util.round(e[0]),r:s.util.round(e[1])};A&&(u.t=w[e[0]]);var c="t: "+u.t+", r: "+u.r,f=this.getBoundingClientRect(),h=t.node().getBoundingClientRect(),p=[f.left+f.width/2-V[0]-h.left,f.top+f.height/2-V[1]-h.top];ct.config({color:o}).text(c),ct.move(p)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),o=n.hsl(a).darker().toString(),i.style({stroke:o,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ct.show()}).on("mouseout.tooltip",function(t,e){ct.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})})}(u),this},config:function(t){if(!arguments.length)return l;var e=s.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),a(l.data[e],s.Axis.defaultConfig().data[0]),a(l.data[e],t)}),a(l.layout,s.Axis.defaultConfig().layout),a(l.layout,e.layout),this},getLiveConfig:function(){return c},getinputConfig:function(){return u},radialScale:function(t){return r},angularScale:function(t){return i},svg:function(){return t}};return n.rebind(h,f,"on"),h},s.Axis.defaultConfig=function(t,e){var r={data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}};return r},s.util={},s.DATAEXTENT="dataExtent",s.AREA="AreaChart",s.LINE="LinePlot",s.DOT="DotPlot",s.BAR="BarChart",s.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},s.util._extend=function(t,e){for(var r in t)e[r]=t[r]},s.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},s.util.dataFromEquation2=function(t,e){var r=e||6,i=n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180,i=t(n);return[e,i]});return i},s.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},s.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},s.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=s.util.ensureArray(t[e],r)}),t},s.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},s.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},s.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},s.util.arrayLast=function(t){return t[t.length-1]},s.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},s.util.flattenArray=function(t){for(var e=[];!s.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},s.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},s.util.convertToCartesian=function(t,e){var r=e*Math.PI/180,n=t*Math.cos(r),i=t*Math.sin(r);return[n,i]},s.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},s.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},s.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:c(s),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return d.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return d.stroke(r,i,a)},"stroke-width":function(t,e){return d["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return d["stroke-dasharray"](r,i,a)},opacity:function(t,e){return d.opacity(r,i,a)},display:function(t,e){return d.display(r,i,a)}})}};var f=e.angularScale.range(),h=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,p=n.svg.arc().startAngle(function(t){return-h/2}).endAngle(function(t){return h/2}).innerRadius(function(t){return e.radialScale(l+(t[2]||0))}).outerRadius(function(t){return e.radialScale(l+(t[2]||0))+e.radialScale(t[1])});u.arc=function(t,r,i){n.select(this).attr({class:"mark arc",d:p,transform:function(t,r){return"rotate("+(e.orientation+s(t[0])+90)+")"}})};var d={fill:function(e,r,n){return t[n].data.color},stroke:function(e,r,n){return t[n].data.strokeColor},"stroke-width":function(e,r,n){return t[n].data.strokeSize+"px"},"stroke-dasharray":function(e,n,i){return r[t[i].data.strokeDash]},opacity:function(e,r,n){return t[n].data.opacity},display:function(e,r,n){return void 0===t[n].data.visible||t[n].data.visible?"block":"none"}},v=n.select(this).selectAll("g.layer").data(o);v.enter().append("g").attr({class:"layer"});var g=v.selectAll("path.mark").data(function(t,e){return t});g.enter().append("path").attr({class:"mark"}),g.style(d).each(u[e.geometryType]),g.exit().remove(),v.exit().remove()})}return i.config=function(e){return arguments.length?(e.forEach(function(e,r){t[r]||(t[r]={}),a(t[r],s.PolyChart.defaultConfig()),a(t[r],e)}),this):t},i.getColorScale=function(){},n.rebind(i,e,"on"),i},s.PolyChart.defaultConfig=function(){var t={data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}};return t},s.BarChart=function(){return s.PolyChart()},s.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},s.AreaChart=function(){return s.PolyChart()},s.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},s.DotPlot=function(){return s.PolyChart()},s.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},s.LinePlot=function(){return s.PolyChart()},s.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},s.Legend=function(){var t=s.Legend.defaultConfig(),e=n.dispatch("hover");function r(){var e=t.legendConfig,i=t.data.map(function(t,r){return[].concat(t).map(function(t,n){var i=a({},e.elements[r]);return i.name=t,i.color=[].concat(e.elements[r].color)[n],i})}),o=n.merge(i);o=o.filter(function(t,r){return e.elements[r]&&(e.elements[r].visibleInLegend||void 0===e.elements[r].visibleInLegend)}),e.reverseOrder&&(o=o.reverse());var s=e.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),u=e.fontSize,c=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,f=c?e.height:u*o.length,h=s.classed("legend-group",!0),p=h.selectAll("svg").data([0]),d=p.enter().append("svg").attr({width:300,height:f+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});d.append("g").classed("legend-axis",!0),d.append("g").classed("legend-marks",!0);var v=n.range(o.length),g=n.scale[c?"linear":"ordinal"]().domain(v).range(l),m=n.scale[c?"linear":"ordinal"]().domain(v)[c?"range":"rangePoints"]([0,f]);if(c){var y=p.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);y.enter().append("stop"),y.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),p.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var x=p.select(".legend-marks").selectAll("path.legend-mark").data(o);x.enter().append("path").classed("legend-mark",!0),x.attr({transform:function(t,e){return"translate("+[u/2,m(e)+u/2]+")"},d:function(t,e){var r,i,a,o=t.symbol;return a=3*(i=u),"line"===(r=o)?"M"+[[-i/2,-i/12],[i/2,-i/12],[i/2,i/12],[-i/2,i/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(a)():n.svg.symbol().type("square").size(a)()},fill:function(t,e){return g(e)}}),x.exit().remove()}var b=n.svg.axis().scale(m).orient("right"),_=p.select("g.legend-axis").attr({transform:"translate("+[c?e.colorBandWidth:u,u/2]+")"}).call(b);return _.selectAll(".domain").style({fill:"none",stroke:"none"}),_.selectAll("line").style({fill:"none",stroke:c?e.textColor:"none"}),_.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text(function(t,e){return o[e].name}),r}return r.config=function(e){return arguments.length?(a(t,e),this):t},n.rebind(r,e,"on"),r},s.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},s.tooltipPanel=function(){var t,e,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},o="tooltip-"+s.tooltipPanel.uid++,l=10,u=function(){var n=(t=i.container.selectAll("g."+o).data([0])).enter().append("g").classed(o,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:i.padding+l,dy:.3*+i.fontSize}),u};return u.text=function(a){var o=n.hsl(i.color).l,s=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",f=a||"";e.style({fill:c,"font-size":i.fontSize+"px"}).text(f);var h=i.padding,p=e.node().getBBox(),d={fill:i.color,stroke:s,"stroke-width":"2px"},v=p.width+2*h+l,g=p.height+2*h;return r.attr({d:"M"+[[l,-g/2],[l,-g/4],[i.hasTick?0:l,0],[l,g/4],[l,g/2],[v,g/2],[v,-g/2]].join("L")+"Z"}).style(d),t.attr({transform:"translate("+[l,-g/2+2*h]+")"}),t.style({display:"block"}),u},u.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u},u.hide=function(){if(t)return t.style({display:"none"}),u},u.show=function(){if(t)return t.style({display:"block"}),u},u.config=function(t){return a(i,t),u},u},s.tooltipPanel.uid=1,s.adapter={},s.adapter.plotly=function(){var t={convert:function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=a({},t),i=[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]];return i.forEach(function(t,r){s.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var i=s.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=i.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var o=a({},t.layout),l=[[o,["plot_bgcolor"],["backgroundColor"]],[o,["showlegend"],["showLegend"]],[o,["radialaxis"],["radialAxis"]],[o,["angularaxis"],["angularAxis"]],[o.angularaxis,["showline"],["gridLinesVisible"]],[o.angularaxis,["showticklabels"],["labelsVisible"]],[o.angularaxis,["nticks"],["ticksCount"]],[o.angularaxis,["tickorientation"],["tickOrientation"]],[o.angularaxis,["ticksuffix"],["ticksSuffix"]],[o.angularaxis,["range"],["domain"]],[o.angularaxis,["endpadding"],["endPadding"]],[o.radialaxis,["showline"],["gridLinesVisible"]],[o.radialaxis,["tickorientation"],["tickOrientation"]],[o.radialaxis,["ticksuffix"],["ticksSuffix"]],[o.radialaxis,["range"],["domain"]],[o.angularAxis,["showline"],["gridLinesVisible"]],[o.angularAxis,["showticklabels"],["labelsVisible"]],[o.angularAxis,["nticks"],["ticksCount"]],[o.angularAxis,["tickorientation"],["tickOrientation"]],[o.angularAxis,["ticksuffix"],["ticksSuffix"]],[o.angularAxis,["range"],["domain"]],[o.angularAxis,["endpadding"],["endPadding"]],[o.radialAxis,["showline"],["gridLinesVisible"]],[o.radialAxis,["tickorientation"],["tickOrientation"]],[o.radialAxis,["ticksuffix"],["ticksSuffix"]],[o.radialAxis,["range"],["domain"]],[o.font,["outlinecolor"],["outlineColor"]],[o.legend,["traceorder"],["reverseOrder"]],[o,["labeloffset"],["labelOffset"]],[o,["defaultcolorrange"],["defaultColorRange"]]];if(l.forEach(function(t,r){s.util.translator.apply(null,t.concat(e))}),e?(void 0!==o.tickLength&&(o.angularaxis.ticklen=o.tickLength,delete o.tickLength),o.tickColor&&(o.angularaxis.tickcolor=o.tickColor,delete o.tickColor)):(o.angularAxis&&void 0!==o.angularAxis.ticklen&&(o.tickLength=o.angularAxis.ticklen),o.angularAxis&&void 0!==o.angularAxis.tickcolor&&(o.tickColor=o.angularAxis.tickcolor)),o.legend&&"boolean"!=typeof o.legend.reverseOrder&&(o.legend.reverseOrder="normal"!=o.legend.reverseOrder),o.legend&&"boolean"==typeof o.legend.traceorder&&(o.legend.traceorder=o.legend.traceorder?"reversed":"normal",delete o.legend.reverseOrder),o.margin&&void 0!==o.margin.t){var u=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],f={};n.entries(o.margin).forEach(function(t,e){f[c[u.indexOf(t.key)]]=t.value}),o.margin=f}e&&(delete o.needsEndSpacing,delete o.minorTickColor,delete o.minorTicks,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksStep,delete o.angularaxis.rewriteTicks,delete o.angularaxis.nticks,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksStep,delete o.radialaxis.rewriteTicks,delete o.radialaxis.nticks),r.layout=o}return r}};return t}},{"../../../constants/alignment":675,"../../../lib":703,d3:157}],822:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../../lib"),a=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,u=e.exports={};u.framework=function(t){var e,r,i,a,c,f=new s;function h(r,s){return s&&(c=s),n.select(n.select(c).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?l(e,r):r,i||(i=o.Axis()),a=o.adapter.plotly().convert(e),i.config(a).render(c),t.data=e.data,t.layout=e.layout,u.fillLayout(t),e}return h.isPolar=!0,h.svg=function(){return i.svg()},h.getConfig=function(){return e},h.getLiveConfig=function(){return o.adapter.plotly().convert(i.getLiveConfig(),!0)},h.getLiveScales=function(){return{t:i.angularScale(),r:i.radialScale()}},h.setUndoPoint=function(){var t,n,i=this,a=o.util.cloneJson(e);t=a,n=r,f.add({undo:function(){n&&i(n)},redo:function(){i(t)}}),r=o.util.cloneJson(a)},h.undo=function(){f.undo()},h.redo=function(){f.redo()},h},u.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../../components/color":580,"../../../lib":703,"./micropolar":821,"./undo_manager":823,d3:157}],823:[function(t,e,r){"use strict";e.exports=function(){var t,e=[],r=-1,n=!1;function i(t,e){return t?(n=!0,t[e](),n=!1,this):this}return{add:function(t){return n?this:(e.splice(r+1,e.length-r),e.push(t),r=e.length-1,this)},setCallback:function(e){t=e},undo:function(){var n=e[r];return n?(i(n,"undo"),r-=1,t&&t(n.undo),this):this},redo:function(){var n=e[r+1];return n?(i(n,"redo"),r+=1,t&&t(n.redo),this):this},clear:function(){e=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r=90||s>90&&l>=450?1:c<=0&&h<=0?0:Math.max(c,h),e=s<=180&&l>=180||s>180&&l>=540?-1:u>=0&&f>=0?0:Math.min(u,f),r=s<=270&&l>=270||s>270&&l>=630?-1:c>=0&&h>=0?0:Math.min(c,h),n=l>=360?1:u<=0&&f<=0?0:Math.max(u,f),[e,r,n,i]}(h),x=y[2]-y[0],b=y[3]-y[1],_=f/c,w=Math.abs(b/x);_>w?(p=c,m=(f-(d=c*w))/n.h/2,v=[o[0],o[1]],g=[u[0]+m,u[1]-m]):(d=f,m=(c-(p=f/w))/n.w/2,v=[o[0]+m,o[1]-m],g=[u[0],u[1]]),this.xLength2=p,this.yLength2=d,this.xDomain2=v,this.yDomain2=g;var k=this.xOffset2=n.l+n.w*v[0],A=this.yOffset2=n.t+n.h*(1-g[1]),T=this.radius=p/x,M=this.innerRadius=e.hole*T,E=this.cx=k-T*y[0],L=this.cy=A+T*y[3],O=this.cxx=E-k,I=this.cyy=L-A;this.radialAxis=this.mockAxis(t,e,i,{_id:"x",side:{counterclockwise:"top",clockwise:"bottom"}[i.side],domain:[M/n.w,T/n.w]}),this.angularAxis=this.mockAxis(t,e,a,{side:"right",domain:[0,Math.PI],autorange:!1}),this.doAutoRange(t,e),this.updateAngularAxis(t,e),this.updateRadialAxis(t,e),this.updateRadialAxisTitle(t,e),this.xaxis=this.mockCartesianAxis(t,e,{_id:"x",domain:v}),this.yaxis=this.mockCartesianAxis(t,e,{_id:"y",domain:g});var P=this.pathSubplot();this.clipPaths.forTraces.select("path").attr("d",P).attr("transform",R(O,I)),r.frontplot.attr("transform",R(k,A)).call(l.setClipUrl,this._hasClipOnAxisFalse?null:this.clipIds.forTraces,this.gd),r.bg.attr("d",P).attr("transform",R(E,L)).call(s.fill,e.bgcolor)},I.mockAxis=function(t,e,r,n){var i=o.extendFlat({anchor:"free",position:0},r,n);return h(i,e,t),i},I.mockCartesianAxis=function(t,e,r){var n=this,i=r._id,a=o.extendFlat({type:"linear"},r);f(a,t);var s={x:[0,2],y:[1,3]};return a.setRange=function(){var t=n.sectorBBox,r=s[i],o=n.radialAxis._rl,l=(o[1]-o[0])/(1-e.hole);a.range=[t[r[0]]*l,t[r[1]]*l]},a.isPtWithinRange="x"===i?function(t){return n.isPtInside(t)}:function(){return!0},a.setRange(),a.setScale(),a},I.doAutoRange=function(t,e){var r=this.gd,n=this.radialAxis,i=e.radialaxis;n.setScale(),p(r,n);var a=n.range;i.range=a.slice(),i._input.range=a.slice(),n._rl=[n.r2l(a[0],null,"gregorian"),n.r2l(a[1],null,"gregorian")]},I.updateRadialAxis=function(t,e){var r=this,n=r.gd,i=r.layers,a=r.radius,l=r.innerRadius,u=r.cx,f=r.cy,h=e.radialaxis,p=S(e.sector[0],360),d=r.radialAxis,v=l90&&p<=270&&(d.tickangle=180);var g=function(t){return"translate("+(d.l2p(t.x)+l)+",0)"},m=P(h);if(r.radialTickLayout!==m&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=m),v){d.setScale();var y=c.calcTicks(d),x=c.clipEnds(d,y),b=c.getTickSigns(d)[2];c.drawTicks(n,d,{vals:y,layer:i["radial-axis"],path:c.makeTickPath(d,0,b),transFn:g,crisp:!1}),c.drawGrid(n,d,{vals:x,layer:i["radial-grid"],path:function(t){return r.pathArc(d.r2p(t.x)+l)},transFn:o.noop,crisp:!1}),c.drawLabels(n,d,{vals:y,layer:i["radial-axis"],transFn:g,labelFns:c.makeLabelFns(d,0)})}var _=r.radialAxisAngle=r.vangles?L(D(C(h.angle),r.vangles)):h.angle,w=R(u,f),k=w+F(-_);z(i["radial-axis"],v&&(h.showticklabels||h.ticks),{transform:k}),z(i["radial-grid"],v&&h.showgrid,{transform:w}),z(i["radial-line"].select("line"),v&&h.showline,{x1:l,y1:0,x2:a,y2:0,transform:k}).attr("stroke-width",h.linewidth).call(s.stroke,h.linecolor)},I.updateRadialAxisTitle=function(t,e,r){var n=this.gd,i=this.radius,a=this.cx,o=this.cy,s=e.radialaxis,u=this.id+"title",c=void 0!==r?r:this.radialAxisAngle,f=C(c),h=Math.cos(f),p=Math.sin(f),d=0;if(s.title){var v=l.bBox(this.layers["radial-axis"].node()).height,g=s.title.font.size;d="counterclockwise"===s.side?-v-.4*g:v+.8*g}this.layers["radial-axis-title"]=m.draw(n,u,{propContainer:s,propName:this.id+".radialaxis.title",placeholder:E(n,"Click to enter radial axis title"),attributes:{x:a+i/2*h+d*p,y:o-i/2*p+d*h,"text-anchor":"middle"},transform:{rotate:-c}})},I.updateAngularAxis=function(t,e){var r=this,n=r.gd,i=r.layers,a=r.radius,l=r.innerRadius,u=r.cx,f=r.cy,h=e.angularaxis,p=r.angularAxis;r.fillViewInitialKey("angularaxis.rotation",h.rotation),p.setGeometry(),p.setScale();var d=function(t){return p.t2g(t.x)};"linear"===p.type&&"radians"===p.thetaunit&&(p.tick0=L(p.tick0),p.dtick=L(p.dtick));var v=function(t){return R(u+a*Math.cos(t),f-a*Math.sin(t))},g=c.makeLabelFns(p,0),m=g.labelStandoff,y={xFn:function(t){var e=d(t);return Math.cos(e)*m},yFn:function(t){var e=d(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(m+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*A)},anchorFn:function(t){var e=d(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(t,e,r){var n=d(t);return-.5*(1+Math.sin(n))*r}},x=P(h);r.angularTickLayout!==x&&(i["angular-axis"].selectAll("."+p._id+"tick").remove(),r.angularTickLayout=x);var b,_=c.calcTicks(p);if("linear"===e.gridshape?(b=_.map(d),o.angleDelta(b[0],b[1])<0&&(b=b.slice().reverse())):b=null,r.vangles=b,"category"===p.type&&(_=_.filter(function(t){return o.isAngleInsideSector(d(t),r.sectorInRad)})),p.visible){var w="inside"===p.ticks?-1:1,k=(p.linewidth||1)/2;c.drawTicks(n,p,{vals:_,layer:i["angular-axis"],path:"M"+w*k+",0h"+w*p.ticklen,transFn:function(t){var e=d(t);return v(e)+F(-L(e))},crisp:!1}),c.drawGrid(n,p,{vals:_,layer:i["angular-grid"],path:function(t){var e=d(t),r=Math.cos(e),n=Math.sin(e);return"M"+[u+l*r,f-l*n]+"L"+[u+a*r,f-a*n]},transFn:o.noop,crisp:!1}),c.drawLabels(n,p,{vals:_,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:function(t){return v(d(t))},labelFns:y})}z(i["angular-line"].select("path"),h.showline,{d:r.pathSubplot(),transform:R(u,f)}).attr("stroke-width",h.linewidth).call(s.stroke,h.linecolor)},I.updateFx=function(t,e){this.gd._context.staticPlot||(this.updateAngularDrag(t),this.updateRadialDrag(t,e,0),this.updateRadialDrag(t,e,1),this.updateMainDrag(t))},I.updateMainDrag=function(t){var e=this,r=e.gd,o=e.layers,s=t._zoomlayer,l=T.MINZOOM,u=T.OFFEDGE,c=e.radius,f=e.innerRadius,h=e.cx,p=e.cy,m=e.cxx,_=e.cyy,w=e.sectorInRad,k=e.vangles,A=e.radialAxis,E=M.clampTiny,S=M.findXYatLength,C=M.findEnclosingVertexAngles,L=T.cornerHalfWidth,O=T.cornerLen/2,I=d.makeDragger(o,"path","maindrag","crosshair");n.select(I).attr("d",e.pathSubplot()).attr("transform",R(h,p));var P,D,z,F,B,N,j,V,U,H={element:I,gd:r,subplot:e.id,plotinfo:{id:e.id,xaxis:e.xaxis,yaxis:e.yaxis},xaxes:[e.xaxis],yaxes:[e.yaxis]};function q(t,e){return Math.sqrt(t*t+e*e)}function G(t,e){return q(t-m,e-_)}function W(t,e){return Math.atan2(_-e,t-m)}function Y(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function X(t,r){if(0===t)return e.pathSector(2*L);var n=O/t,i=r-n,a=r+n,o=Math.max(0,Math.min(t,c)),s=o-L,l=o+L;return"M"+Y(s,i)+"A"+[s,s]+" 0,0,0 "+Y(s,a)+"L"+Y(l,a)+"A"+[l,l]+" 0,0,1 "+Y(l,i)+"Z"}function Z(t,r,n){if(0===t)return e.pathSector(2*L);var i,a,o=Y(t,r),s=Y(t,n),l=E((o[0]+s[0])/2),u=E((o[1]+s[1])/2);if(l&&u){var c=u/l,f=-1/c,h=S(L,c,l,u);i=S(O,f,h[0][0],h[0][1]),a=S(O,f,h[1][0],h[1][1])}else{var p,d;u?(p=O,d=L):(p=L,d=O),i=[[l-p,u-d],[l+p,u-d]],a=[[l-p,u+d],[l+p,u+d]]}return"M"+i.join("L")+"L"+a.reverse().join("L")+"Z"}function $(t,e){return e=Math.max(Math.min(e,c),f),tl?(t-1&&1===t&&x(n,r,[e.xaxis],[e.yaxis],e.id,H),i.indexOf("event")>-1&&g.click(r,n,e.id)}H.prepFn=function(t,n,a){var o=r._fullLayout.dragmode,l=I.getBoundingClientRect();if(P=n-l.left,D=a-l.top,k){var u=M.findPolygonOffset(c,w[0],w[1],k);P+=m+u[0],D+=_+u[1]}switch(o){case"zoom":H.moveFn=k?tt:K,H.clickFn=nt,H.doneFn=et,function(){z=null,F=null,B=e.pathSubplot(),N=!1;var t=r._fullLayout[e.id];j=i(t.bgcolor).getLuminance(),(V=d.makeZoombox(s,j,h,p,B)).attr("fill-rule","evenodd"),U=d.makeCorners(s,h,p),b(r)}();break;case"select":case"lasso":y(t,n,a,H,o)}},I.onmousemove=function(t){g.hover(r,t,e.id),r._fullLayout._lasthover=I,r._fullLayout._hoversubplot=e.id},I.onmouseout=function(t){r._dragging||v.unhover(r,t)},v.init(H)},I.updateRadialDrag=function(t,e,r){var i=this,s=i.gd,l=i.layers,u=i.radius,c=i.innerRadius,f=i.cx,h=i.cy,p=i.radialAxis,g=T.radialDragBoxSize,m=g/2;if(p.visible){var y,x,_,A=C(i.radialAxisAngle),M=p._rl,E=M[0],S=M[1],O=M[r],I=.75*(M[1]-M[0])/(1-e.hole)/u;r?(y=f+(u+m)*Math.cos(A),x=h-(u+m)*Math.sin(A),_="radialdrag"):(y=f+(c-m)*Math.cos(A),x=h-(c-m)*Math.sin(A),_="radialdrag-inner");var P,B,N,j=d.makeRectDragger(l,_,"crosshair",-m,-m,g,g),V={element:j,gd:s};z(n.select(j),p.visible&&c0==(r?N>E:Nn?function(t){return t<=0}:function(t){return t>=0};t.c2g=function(r){var n=t.c2l(r)-e;return(s(n)?n:0)+o},t.g2c=function(r){return t.l2c(r+e-o)},t.g2p=function(t){return t*a},t.c2p=function(e){return t.g2p(t.c2g(e))}}}(t,e);break;case"angularaxis":!function(t,e){var r=t.type;if("linear"===r){var i=t.d2c,s=t.c2d;t.d2c=function(t,e){return function(t,e){return"degrees"===e?a(t):t}(i(t),e)},t.c2d=function(t,e){return s(function(t,e){return"degrees"===e?o(t):t}(t,e))}}t.makeCalcdata=function(e,i){var a,o,s=e[i],l=e._length,u=function(r){return t.d2c(r,e.thetaunit)};if(s){if(n.isTypedArray(s)&&"linear"===r){if(l===s.length)return s;if(s.subarray)return s.subarray(0,l)}for(a=new Array(l),o=0;o=c&&(p.min=0,v.min=0,g.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}function d(t,e,r,n){var i=f[e._name];function o(r,n){return a.coerce(t,e,i,r,n)}o("uirevision",n.uirevision),e.type="linear";var h=o("color"),p=h!==i.color.dflt?h:r.font.color,d=e._name,v=d.charAt(0).toUpperCase(),g="Component "+v,m=o("title.text",g);e._hovertitle=m===g?m:v,a.coerceFont(o,"title.font",{family:r.font.family,size:Math.round(1.2*r.font.size),color:p}),o("min"),u(t,e,o,"linear"),s(t,e,o,"linear",{}),l(t,e,o,{outerTicks:!0});var y=o("showticklabels");y&&(a.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:p}),o("tickangle"),o("tickformat")),c(t,e,o,{dfltColor:h,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:i}),o("hoverformat"),o("layer")}e.exports=function(t,e,r){o(t,e,r,{type:"ternary",attributes:f,handleDefaults:p,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../components/color":580,"../../lib":703,"../../plot_api/plot_template":741,"../cartesian/line_grid_defaults":765,"../cartesian/tick_label_defaults":770,"../cartesian/tick_mark_defaults":771,"../cartesian/tick_value_defaults":772,"../subplot_defaults":826,"./layout_attributes":828}],830:[function(t,e,r){"use strict";var n=t("d3"),i=t("tinycolor2"),a=t("../../registry"),o=t("../../lib"),s=o._,l=t("../../components/color"),u=t("../../components/drawing"),c=t("../cartesian/set_convert"),f=t("../../lib/extend").extendFlat,h=t("../plots"),p=t("../cartesian/axes"),d=t("../../components/dragelement"),v=t("../../components/fx"),g=t("../../components/titles"),m=t("../cartesian/select").prepSelect,y=t("../cartesian/select").selectOnClick,x=t("../cartesian/select").clearSelect,b=t("../cartesian/constants");function _(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}e.exports=_;var w=_.prototype;w.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},w.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var i=0;ik*x?i=(a=x)*k:a=(i=y)/k,o=g*i/y,s=m*a/x,r=e.l+e.w*d-i/2,n=e.t+e.h*(1-v)-a/2,h.x0=r,h.y0=n,h.w=i,h.h=a,h.sum=b,h.xaxis={type:"linear",range:[_+2*A-b,b-_-2*w],domain:[d-o/2,d+o/2],_id:"x"},c(h.xaxis,h.graphDiv._fullLayout),h.xaxis.setScale(),h.xaxis.isPtWithinRange=function(t){return t.a>=h.aaxis.range[0]&&t.a<=h.aaxis.range[1]&&t.b>=h.baxis.range[1]&&t.b<=h.baxis.range[0]&&t.c>=h.caxis.range[1]&&t.c<=h.caxis.range[0]},h.yaxis={type:"linear",range:[_,b-w-A],domain:[v-s/2,v+s/2],_id:"y"},c(h.yaxis,h.graphDiv._fullLayout),h.yaxis.setScale(),h.yaxis.isPtWithinRange=function(){return!0};var T=h.yaxis.domain[0],M=h.aaxis=f({},t.aaxis,{range:[_,b-w-A],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[T,T+s*k],anchor:"free",position:0,_id:"y",_length:i});c(M,h.graphDiv._fullLayout),M.setScale();var E=h.baxis=f({},t.baxis,{range:[b-_-A,w],side:"bottom",domain:h.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});c(E,h.graphDiv._fullLayout),E.setScale();var S=h.caxis=f({},t.caxis,{range:[b-_-w,A],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[T,T+s*k],anchor:"free",position:0,_id:"y",_length:i});c(S,h.graphDiv._fullLayout),S.setScale();var C="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";h.clipDef.select("path").attr("d",C),h.layers.plotbg.select("path").attr("d",C);var L="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";h.clipDefRelative.select("path").attr("d",L);var O="translate("+r+","+n+")";h.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",O),h.clipDefRelative.select("path").attr("transform",null);var I="translate("+(r-E._offset)+","+(n+a)+")";h.layers.baxis.attr("transform",I),h.layers.bgrid.attr("transform",I);var P="translate("+(r+i/2)+","+n+")rotate(30)translate(0,"+-M._offset+")";h.layers.aaxis.attr("transform",P),h.layers.agrid.attr("transform",P);var D="translate("+(r+i/2)+","+n+")rotate(-30)translate(0,"+-S._offset+")";h.layers.caxis.attr("transform",D),h.layers.cgrid.attr("transform",D),h.drawAxes(!0),h.layers.aline.select("path").attr("d",M.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(l.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),h.layers.bline.select("path").attr("d",E.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(l.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),h.layers.cline.select("path").attr("d",S.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(l.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),h.graphDiv._context.staticPlot||h.initInteractions(),u.setClipUrl(h.layers.frontplot,h._hasClipOnAxisFalse?null:h.clipId,h.graphDiv)},w.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.layers,i=this.aaxis,a=this.baxis,o=this.caxis;if(this.drawAx(i),this.drawAx(a),this.drawAx(o),t){var l=Math.max(i.showticklabels?i.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0)),u=(a.showticklabels?a.tickfont.size:0)+("outside"===a.ticks?a.ticklen:0)+3;n["a-title"]=g.draw(e,"a"+r,{propContainer:i,propName:this.id+".aaxis.title",placeholder:s(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-i.title.font.size/3-l,"text-anchor":"middle"}}),n["b-title"]=g.draw(e,"b"+r,{propContainer:a,propName:this.id+".baxis.title",placeholder:s(e,"Click to enter Component B title"),attributes:{x:this.x0-u,y:this.y0+this.h+.83*a.title.font.size+u,"text-anchor":"middle"}}),n["c-title"]=g.draw(e,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:s(e,"Click to enter Component C title"),attributes:{x:this.x0+this.w+u,y:this.y0+this.h+.83*o.title.font.size+u,"text-anchor":"middle"}})}},w.drawAx=function(t){var e,r=this.graphDiv,n=t._name,i=n.charAt(0),a=t._id,s=this.layers[n],l=i+"tickLayout",u=(e=t).ticks+String(e.ticklen)+String(e.showticklabels);this[l]!==u&&(s.selectAll("."+a+"tick").remove(),this[l]=u),t.setScale();var c=p.calcTicks(t),f=p.clipEnds(t,c),h=p.makeTransFn(t),d=p.getTickSigns(t)[2],v=o.deg2rad(30),g=d*(t.linewidth||1)/2,m=d*t.ticklen,y=this.w,x=this.h,b="b"===i?"M0,"+g+"l"+Math.sin(v)*m+","+Math.cos(v)*m:"M"+g+",0l"+Math.cos(v)*m+","+-Math.sin(v)*m,_={a:"M0,0l"+x+",-"+y/2,b:"M0,0l-"+y/2+",-"+x,c:"M0,0l-"+x+","+y/2}[i];p.drawTicks(r,t,{vals:"inside"===t.ticks?f:c,layer:s,path:b,transFn:h,crisp:!1}),p.drawGrid(r,t,{vals:f,layer:this.layers[i+"grid"],path:_,transFn:h,crisp:!1}),p.drawLabels(r,t,{vals:c,layer:s,transFn:h,labelFns:p.makeLabelFns(t,0,30)})};var A=b.MINZOOM/2+.87,T="m-0.87,.5h"+A+"v3h-"+(A+5.2)+"l"+(A/2+2.6)+",-"+(.87*A+4.5)+"l2.6,1.5l-"+A/2+","+.87*A+"Z",M="m0.87,.5h-"+A+"v3h"+(A+5.2)+"l-"+(A/2+2.6)+",-"+(.87*A+4.5)+"l-2.6,1.5l"+A/2+","+.87*A+"Z",E="m0,1l"+A/2+","+.87*A+"l2.6,-1.5l-"+(A/2+2.6)+",-"+(.87*A+4.5)+"l-"+(A/2+2.6)+","+(.87*A+4.5)+"l2.6,1.5l"+A/2+",-"+.87*A+"Z",S="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",C=!0;function L(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}w.initInteractions=function(){var t,e,r,n,c,f,h,p,g,_,w=this,A=w.layers.plotbg.select("path").node(),O=w.graphDiv,I=O._fullLayout._zoomlayer,P={element:A,gd:O,plotinfo:{id:w.id,xaxis:w.xaxis,yaxis:w.yaxis},subplot:w.id,prepFn:function(a,o,s){P.xaxes=[w.xaxis],P.yaxes=[w.yaxis];var u=O._fullLayout.dragmode;P.minDrag="lasso"===u?1:void 0,"zoom"===u?(P.moveFn=N,P.clickFn=z,P.doneFn=j,function(a,o,s){var u=A.getBoundingClientRect();t=o-u.left,e=s-u.top,r={a:w.aaxis.range[0],b:w.baxis.range[1],c:w.caxis.range[1]},c=r,n=w.aaxis.range[1]-r.a,f=i(w.graphDiv._fullLayout[w.id].bgcolor).getLuminance(),h="M0,"+w.h+"L"+w.w/2+", 0L"+w.w+","+w.h+"Z",p=!1,g=I.append("path").attr("class","zoombox").attr("transform","translate("+w.x0+", "+w.y0+")").style({fill:f>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",h),_=I.append("path").attr("class","zoombox-corners").attr("transform","translate("+w.x0+", "+w.y0+")").style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),x(O)}(0,o,s)):"pan"===u?(P.moveFn=V,P.clickFn=z,P.doneFn=U,r={a:w.aaxis.range[0],b:w.baxis.range[1],c:w.caxis.range[1]},c=r,x(O)):"select"!==u&&"lasso"!==u||m(a,o,s,P,u)}};function D(t){var e={};return e[w.id+".aaxis.min"]=t.a,e[w.id+".baxis.min"]=t.b,e[w.id+".caxis.min"]=t.c,e}function z(t,e){var r=O._fullLayout.clickmode;L(O),2===t&&(O.emit("plotly_doubleclick",null),a.call("_guiRelayout",O,D({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&y(e,O,[w.xaxis],[w.yaxis],w.id,P),r.indexOf("event")>-1&&v.click(O,e,w.id)}function R(t,e){return 1-e/w.h}function F(t,e){return 1-(t+(w.h-e)/Math.sqrt(3))/w.w}function B(t,e){return(t-(w.h-e)/Math.sqrt(3))/w.w}function N(i,a){var o=t+i,s=e+a,l=Math.max(0,Math.min(1,R(0,e),R(0,s))),u=Math.max(0,Math.min(1,F(t,e),F(o,s))),d=Math.max(0,Math.min(1,B(t,e),B(o,s))),v=(l/2+d)*w.w,m=(1-l/2-u)*w.w,y=(v+m)/2,x=m-v,A=(1-l)*w.h,C=A-x/k;x.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),_.transition().style("opacity",1).duration(200),p=!0),O.emit("plotly_relayouting",D(c))}function j(){L(O),c!==r&&(a.call("_guiRelayout",O,D(c)),C&&O.data&&O._context.showTips&&(o.notifier(s(O,"Double-click to zoom back out"),"long"),C=!1))}function V(t,e){var n=t/w.xaxis._m,i=e/w.yaxis._m,a=[(c={a:r.a-i,b:r.b+(n+i)/2,c:r.c-(n-i)/2}).a,c.b,c.c].sort(),o={a:a.indexOf(c.a),b:a.indexOf(c.b),c:a.indexOf(c.c)};a[0]<0&&(a[1]+a[0]/2<0?(a[2]+=a[0]+a[1],a[0]=a[1]=0):(a[2]+=a[0]/2,a[1]+=a[0]/2,a[0]=0),c={a:a[o.a],b:a[o.b],c:a[o.c]},e=(r.a-c.a)*w.yaxis._m,t=(r.c-c.c-r.b+c.b)*w.xaxis._m);var s="translate("+(w.x0+t)+","+(w.y0+e)+")";w.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",s);var l="translate("+-t+","+-e+")";w.clipDefRelative.select("path").attr("transform",l),w.aaxis.range=[c.a,w.sum-c.b-c.c],w.baxis.range=[w.sum-c.a-c.c,c.b],w.caxis.range=[w.sum-c.a-c.b,c.c],w.drawAxes(!1),w._hasClipOnAxisFalse&&w.plotContainer.select(".scatterlayer").selectAll(".trace").call(u.hideOutsideRangePoints,w),O.emit("plotly_relayouting",D(c))}function U(){a.call("_guiRelayout",O,D(c))}A.onmousemove=function(t){v.hover(O,t,w.id),O._fullLayout._lasthover=A,O._fullLayout._hoversubplot=w.id},A.onmouseout=function(t){O._dragging||d.unhover(O,t)},d.init(P)}},{"../../components/color":580,"../../components/dragelement":598,"../../components/drawing":601,"../../components/fx":619,"../../components/titles":668,"../../lib":703,"../../lib/extend":693,"../../registry":831,"../cartesian/axes":751,"../cartesian/constants":757,"../cartesian/select":768,"../cartesian/set_convert":769,"../plots":812,d3:157,tinycolor2:524}],831:[function(t,e,r){"use strict";var n=t("./lib/loggers"),i=t("./lib/noop"),a=t("./lib/push_unique"),o=t("./lib/is_plain_object"),s=t("./lib/extend"),l=t("./plots/attributes"),u=t("./plots/layout_attributes"),c=s.extendFlat,f=s.extendDeepAll;function h(t){var e=t.name,i=t.categories,a=t.meta;if(r.modules[e])n.log("Type "+e+" already registered");else{r.subplotsRegistry[t.basePlotModule.name]||function(t){var e=t.name;if(r.subplotsRegistry[e])n.log("Plot type "+e+" already registered.");else for(var i in g(t),r.subplotsRegistry[e]=t,r.componentsRegistry)x(i,t.name)}(t.basePlotModule);for(var o={},s=0;s-1&&(f[p[r]].title={text:""});for(r=0;rpath, .legendlines>path, .cbfill").each(function(){var t=n.select(this),e=this.style.fill;e&&-1!==e.indexOf("url(")&&t.style("fill",e.replace(l,"TOBESTRIPPED"));var r=this.style.stroke;r&&-1!==r.indexOf("url(")&&t.style("stroke",r.replace(l,"TOBESTRIPPED"))}),"pdf"!==e&&"eps"!==e||h.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),h.node().setAttributeNS(s.xmlns,"xmlns",s.svg),h.node().setAttributeNS(s.xmlns,"xmlns:xlink",s.xlink),"svg"===e&&r&&(h.attr("width",r*d),h.attr("height",r*v),h.attr("viewBox","0 0 "+d+" "+v));var _=(new window.XMLSerializer).serializeToString(h.node());return _=(_=(_=function(t){var e=n.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"<"===t?"<":"&rt;"===t?">":-1!==t.indexOf("<")||-1!==t.indexOf(">")?"":e.html(t).text()});return e.remove(),r}(_)).replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(u,"'"),i.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":580,"../components/drawing":601,"../constants/xmlns_namespaces":681,"../lib":703,d3:157}],840:[function(t,e,r){"use strict";var n=t("../../lib").mergeArray;e.exports=function(t,e){for(var r=0;r0&&f.s>0||(u=!1)}o._extremes[t._id]=s.findExtremes(t,l,{tozero:!u,padded:!0})}}function m(t){for(var e=t.traces,r=0;rf+u||!n(c))}for(var p=0;p0&&_.s>0||(m=!1)}}v._extremes[t._id]=s.findExtremes(t,g,{tozero:!m,padded:y})}}function x(t){return t._id.charAt(0)}e.exports={crossTraceCalc:function(t,e){for(var r=e.xaxis,n=e.yaxis,i=t._fullLayout,a=t._fullData,s=t.calcdata,l=[],u=[],f=0;fa;if(!o)return e}return void 0!==r?r:t.dflt},r.coerceColor=function(t,e,r){return i(e).isValid()?e:void 0!==r?r:t.dflt},r.coerceEnumerated=function(t,e,r){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==r?r:t.dflt},r.getValue=function(t,e){var r;return Array.isArray(t)?e0&&N>0,G=B<=U&&N<=H,W=B<=H&&N<=U,Y=M?U>=B*(H/N):H>=N*(U/B);q&&(G||W||Y)?m="inside":(m="outside",R.remove(),R=null)}else m="inside";!R&&(R=A(r,E,"outside"===m?D:P),F=l.bBox(R.node()),B=F.width,N=F.height,B<=0||N<=0)?R.remove():("outside"===m?(V="both"===T.constraintext||"outside"===T.constraintext,j=_(s,u,c,p,F,{isHorizontal:M,constrained:V,angle:T.textangle})):(V="both"===T.constraintext||"inside"===T.constraintext,j=b(s,u,c,p,F,{isHorizontal:M,constrained:V,angle:T.textangle,anchor:T.insidetextanchor})),R.attr("transform",j))}else r.select("text").remove()}function x(t){return"auto"===t?0:t}function b(t,e,r,n,i,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,u=a.anchor||0,c=i.width,f=i.height,h=Math.abs(e-t),p=Math.abs(n-r),d=h>2*g&&p>2*g?g:0;h-=2*d,p-=2*d;var v="auto"===l,y=!1;if(!v||c<=h&&f<=p||!(c>h||f>p)||(c>p||f>h)&&c2*g?g:0:h>2*g?g:0;var d=1;l&&(d=s?Math.min(1,p/f):Math.min(1,h/c));var v=x(u),y=Math.abs(Math.sin(Math.PI/180*v)),b=Math.abs(Math.cos(Math.PI/180*v)),_=d*(s?f:c),k=d*(s?c:f);o+=.5*(_*y+k*b);var A=(t+e)/2,T=(r+n)/2;s?A=e-o*m(e,t):T=n+o*m(r,n);var M=(i.left+i.right)/2,E=(i.top+i.bottom)/2;return w(M,E,A,T,d,v)}function w(t,e,r,n,i,a){var o;i<1?o="scale("+i+") ":(i=1,o="");var s=r-i*t,l=n-i*e;return"translate("+s+" "+l+")"+o+(a?"rotate("+a+" "+t+" "+e+") ":"")}function k(t,e,r,n){var i,o=t[0].trace;return i=o.textinfo?function(t,e,r,n){var i=t[0].trace,o="h"===i.orientation,s="waterfall"===i.type,l="funnel"===i.type;function u(t){var e=o?r:n;return c(e,+t,!0).text}var f,h,p=i.textinfo,d=t[e],v=p.split("+"),g=[],m=function(t){return-1!==v.indexOf(t)};if(m("label")&&g.push((h=t[e].p,c(o?n:r,h,!0).text)),m("text")&&(0===(f=a.castOption(i,d.i,"text"))||f)&&g.push(f),s){var y=+d.rawS||d.s,x=d.v,b=x-y;m("initial")&&g.push(u(b)),m("delta")&&g.push(u(y)),m("final")&&g.push(u(x))}if(l){m("value")&&g.push(u(d.s));var _=0;m("percent initial")&&_++,m("percent previous")&&_++,m("percent total")&&_++;var w=_>1;m("percent initial")&&(f=a.formatPercent(d.begR),w&&(f+=" of initial"),g.push(f)),m("percent previous")&&(f=a.formatPercent(d.difR),w&&(f+=" of previous"),g.push(f)),m("percent total")&&(f=a.formatPercent(d.sumR),w&&(f+=" of total"),g.push(f))}return g.join("
")}(t,e,r,n):h.getValue(o.text,e),h.coerceString(d,i)}e.exports={plot:function(t,e,r,o,c){var f=e.xaxis,h=e.yaxis,p=t._fullLayout;c||(c={mode:p.barmode,norm:p.barmode,gap:p.bargap,groupgap:p.bargroupgap});var d=a.makeTraceGroups(o,r,"trace bars").each(function(r){var o=n.select(this),u=r[0].trace,p="waterfall"===u.type,d="funnel"===u.type,v="bar"===u.type,g=v||d,x=0;p&&u.connector.visible&&"between"===u.connector.mode&&(x=u.connector.line.width/2);var b="h"===u.orientation;e.isRangePlot||(r[0].node3=o);var _=a.ensureSingle(o,"g","points"),w=_.selectAll("g.point").data(a.identity);w.enter().append("g").classed("point",!0),w.exit().remove(),w.each(function(o,p){var d,v,_=n.select(this),w=function(t,e,r,n){var i=[],a=[],o=n?e:r,s=n?r:e;return i[0]=o.c2p(t.s0,!0),a[0]=s.c2p(t.p0,!0),i[1]=o.c2p(t.s1,!0),a[1]=s.c2p(t.p1,!0),n?[i,a]:[a,i]}(o,f,h,b),k=w[0][0],A=w[0][1],T=w[1][0],M=w[1][1],E=o.isBlank=!(i(k)&&i(A)&&i(T)&&i(M)&&(k!==A||g&&b)&&(T!==M||g&&!b));if(x&&(b?(k-=m(k,A)*x,A+=m(k,A)*x):(T-=m(T,M)*x,M+=m(T,M)*x)),"waterfall"===u.type){if(!E){var S=u[o.dir].marker;d=S.line.width,v=S.color}}else d=(o.mlw+1||u.marker.line.width+1||(o.trace?o.trace.marker.line.width:0)+1)-1,v=o.mc||u.marker.color;var C=n.round(d/2%1,2);function L(t){return 0===c.gap&&0===c.groupgap?n.round(Math.round(t)-C,2):t}if(!t._context.staticPlot){var O=s.opacity(v),I=O<1||d>.01?L:function(t,e){return Math.abs(t-e)>=2?L(t):t>e?Math.ceil(t):Math.floor(t)};k=I(k,A),A=I(A,k),T=I(T,M),M=I(M,T)}a.ensureSingle(_,"path").style("vector-effect","non-scaling-stroke").attr("d",E?"M0,0Z":"M"+k+","+T+"V"+M+"H"+A+"V"+T+"Z").call(l.setClipUrl,e.layerClipId,t),y(t,e,_,r,p,k,A,T,M,c),e.layerClipId&&l.hideOutsideRangePoint(o,_.select("text"),f,h,u.xcalendar,u.ycalendar)});var k=!1===u.cliponaxis;l.setClipUrl(o,k?null:e.layerClipId,t)});u.getComponentMethod("errorbars","plot")(t,d,e)},getTransformToMoveInsideBar:b,getTransformToMoveOutsideBar:_}},{"../../components/color":580,"../../components/drawing":601,"../../lib":703,"../../lib/svg_text_utils":727,"../../plots/cartesian/axes":751,"../../registry":831,"./attributes":841,"./helpers":846,"./style":854,d3:157,"fast-isnumeric":224}],852:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=e.c2p(n?t.s0:t.p0,!0),o=e.c2p(n?t.s1:t.p1,!0),s=r.c2p(n?t.p0:t.s0,!0),l=r.c2p(n?t.p1:t.s1,!0);return i?[(a+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(a+o)/2,l]}e.exports=function(t,e){var r,i=t.cd,a=t.xaxis,o=t.yaxis,s=i[0].trace,l="funnel"===s.type,u="h"===s.orientation,c=[];if(!1===e)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),r.selectAll("g.points").each(function(e){var r=n.select(this),i=e[0].trace;p(r,i,t)}),s.getComponentMethod("errorbars","style")(r)},styleTextPoints:d,styleOnSelect:function(t,e){var r=e[0].node3,n=e[0].trace;n.selectedpoints?v(r,n,t):(p(r,n,t),s.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_}},{"../../components/color":580,"../../components/drawing":601,"../../lib":703,"../../registry":831,"./attributes":841,"./helpers":846,d3:157}],855:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s){r("marker.color",o),i(t,"marker")&&a(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":580,"../../components/colorscale/defaults":590,"../../components/colorscale/helpers":591}],856:[function(t,e,r){"use strict";var n=t("../../components/fx/hovertemplate_attributes"),i=t("../../lib/extend").extendFlat,a=t("../scatterpolar/attributes"),o=t("../bar/attributes");e.exports={r:a.r,theta:a.theta,r0:a.r0,dr:a.dr,theta0:a.theta0,dtheta:a.dtheta,thetaunit:a.thetaunit,base:i({},o.base,{}),offset:i({},o.offset,{}),width:i({},o.width,{}),text:i({},o.text,{}),hovertext:i({},o.hovertext,{}),marker:o.marker,hoverinfo:a.hoverinfo,hovertemplate:n(),selected:o.selected,unselected:o.unselected}},{"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../bar/attributes":841,"../scatterpolar/attributes":1136}],857:[function(t,e,r){"use strict";var n=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/calc"),a=t("../bar/arrays_to_calcdata"),o=t("../bar/cross_trace_calc").setGroupPositions,s=t("../scatter/calc_selection"),l=t("../../registry").traceIs,u=t("../../lib").extendFlat;e.exports={calc:function(t,e){for(var r=t._fullLayout,o=e.subplot,l=r[o].radialaxis,u=r[o].angularaxis,c=l.makeCalcdata(e,"r"),f=u.makeCalcdata(e,"theta"),h=e._length,p=new Array(h),d=c,v=f,g=0;gh.range[1]&&(x+=Math.PI),n.getClosest(u,function(t){return v(y,x,[t.rp0,t.rp1],[t.thetag0,t.thetag1],d)?g+Math.min(1,Math.abs(t.thetag1-t.thetag0)/m)-1+(t.rp1-y)/(t.rp1-t.rp0)-1:1/0},t),!1!==t.index){var b=t.index,_=u[b];t.x0=t.x1=_.ct[0],t.y0=t.y1=_.ct[1];var w=i.extendFlat({},_,{r:_.s,theta:_.p});return o(_,c,t),s(w,c,f,t),t.hovertemplate=c.hovertemplate,t.color=a(c,_),t.xLabelVal=t.yLabelVal=void 0,_.s<0&&(t.idealAlign="left"),[t]}}},{"../../components/fx":619,"../../lib":703,"../../plots/polar/helpers":814,"../bar/hover":847,"../scatterpolar/hover":1139}],860:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"barpolar",basePlotModule:t("../../plots/polar"),categories:["polar","bar","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),colorbar:t("../scatter/marker_colorbar"),style:t("../bar/style").style,hoverPoints:t("./hover"),selectPoints:t("../bar/select"),meta:{}}},{"../../plots/polar":815,"../bar/select":852,"../bar/style":854,"../scatter/marker_colorbar":1092,"./attributes":856,"./calc":857,"./defaults":858,"./hover":859,"./layout_attributes":861,"./layout_defaults":862,"./plot":863}],861:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}},{}],862:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a,o={};function s(r,o){return n.coerce(t[a]||{},e[a],i,r,o)}for(var l=0;l0?(u=o,c=l):(u=l,c=o);var f=s.findEnclosingVertexAngles(u,t.vangles)[0],h=s.findEnclosingVertexAngles(c,t.vangles)[1],p=[f,(u+c)/2,h];return s.pathPolygonAnnulus(n,i,u,c,p,e,r)}:function(t,n,i,o){return a.pathAnnulus(t,n,i,o,e,r)}}(e),p=e.layers.frontplot.select("g.barlayer");a.makeTraceGroups(p,r,"trace bars").each(function(r){var s=r[0].node3=n.select(this),p=a.ensureSingle(s,"g","points"),d=p.selectAll("g.point").data(a.identity);d.enter().append("g").style("vector-effect","non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),d.exit().remove(),d.each(function(t){var e,r=n.select(this),o=t.rp0=c.c2p(t.s0),s=t.rp1=c.c2p(t.s1),p=t.thetag0=f.c2g(t.p0),d=t.thetag1=f.c2g(t.p1);if(i(o)&&i(s)&&i(p)&&i(d)&&o!==s&&p!==d){var v=c.c2g(t.s1),g=(p+d)/2;t.ct=[l.c2p(v*Math.cos(g)),u.c2p(v*Math.sin(g))],e=h(o,s,p,d)}else e="M0,0Z";a.ensureSingle(r,"path").attr("d",e)}),o.setClipUrl(s,e._hasClipOnAxisFalse?e.clipIds.forTraces:null,t)})}},{"../../components/drawing":601,"../../lib":703,"../../plots/polar/helpers":814,d3:157,"fast-isnumeric":224}],864:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../bar/attributes"),a=t("../../components/color/attributes"),o=t("../../components/fx/hovertemplate_attributes"),s=t("../../lib/extend").extendFlat,l=n.marker,u=l.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},name:{valType:"string",editType:"calc+clearAxisTypes"},text:s({},n.text,{}),hovertext:s({},n.hovertext,{}),hovertemplate:o({}),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calc"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:s({},l.symbol,{arrayOk:!1,editType:"plot"}),opacity:s({},l.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:s({},l.size,{arrayOk:!1,editType:"calc"}),color:s({},l.color,{arrayOk:!1,editType:"style"}),line:{color:s({},u.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:s({},u.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,offsetgroup:i.offsetgroup,alignmentgroup:i.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":579,"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../bar/attributes":841,"../scatter/attributes":1075}],865:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=i._,o=t("../../plots/cartesian/axes");function s(t,e,r){var n={text:"tx",hovertext:"htx"};for(var i in n)Array.isArray(e[i])&&(t[n[i]]=e[i][r])}function l(t,e){return t.v-e.v}function u(t){return t.v}e.exports=function(t,e){var r,c,f,h,p,d=t._fullLayout,v=o.getFromId(t,e.xaxis||"x"),g=o.getFromId(t,e.yaxis||"y"),m=[],y="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(c=v,f="x",h=g,p="y"):(c=g,f="y",h=v,p="x");var x,b=c.makeCalcdata(e,f),_=function(t,e,r,a,o){if(e in t)return r.makeCalcdata(t,e);var s;s=e+"0"in t?t[e+"0"]:"name"in t&&("category"===r.type||n(t.name)&&-1!==["linear","log"].indexOf(r.type)||i.isDateTime(t.name)&&"date"===r.type)?t.name:o;var l="multicategory"===r.type?r.r2c_just_indices(s):r.d2c(s,0,t[e+"calendar"]);return a.map(function(){return l})}(e,p,h,b,d[y]),w=i.distinctVals(_),k=w.vals,A=w.minDiff/2,T=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i=0&&Cx.uf};for(r=0;r0){var I=E[r].sort(l),P=I.map(u),D=P.length;(x={}).pos=k[r],x.pts=I,x[p]=x.pos,x[f]=x.pts.map(function(t){return t.v}),x.min=P[0],x.max=P[D-1],x.mean=i.mean(P,D),x.sd=i.stdev(P,D,x.mean),x.q1=i.interp(P,.25),x.med=i.interp(P,.5),x.q3=i.interp(P,.75),x.lf=Math.min(x.q1,P[Math.min(i.findBin(2.5*x.q1-1.5*x.q3,P,!0)+1,D-1)]),x.uf=Math.max(x.q3,P[Math.max(i.findBin(2.5*x.q3-1.5*x.q1,P),0)]),x.lo=4*x.q1-3*x.q3,x.uo=4*x.q3-3*x.q1;var z=x.q3-x.q1,R=1.57*z/Math.sqrt(D);x.ln=x.med-R,x.un=x.med+R,x.pts2=I.filter(O),m.push(x)}!function(t,e){if(i.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r0?(m[0].t={num:d[y],dPos:A,posLetter:p,valLetter:f,labels:{med:a(t,"median:"),min:a(t,"min:"),q1:a(t,"q1:"),q3:a(t,"q3:"),max:a(t,"max:"),mean:"sd"===e.boxmean?a(t,"mean ± σ:"):a(t,"mean:"),lf:a(t,"lower fence:"),uf:a(t,"upper fence:")}},d[y]++,m):[{t:{empty:!0}}]}},{"../../lib":703,"../../plots/cartesian/axes":751,"fast-isnumeric":224}],866:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib"),a=t("../../plots/cartesian/axis_ids").getAxisGroup,o=["v","h"];function s(t,e,r,o){var s,l,u,c=e.calcdata,f=e._fullLayout,h=o._id,p=h.charAt(0),d=[],v=0;for(s=0;s1,_=1-f[t+"gap"],w=1-f[t+"groupgap"];for(s=0;s0;if("positive"===I?(E=k*(O?1:.5),N=G,S=N=T):"negative"===I?(E=N=T,S=k*(O?1:.5),j=G):(E=S=k,N=j=G),Y){var X=C.pointpos,Z=C.jitter,$=C.marker.size/2,J=0;X+Z>=0&&((J=G*(X+Z))>E?(W=!0,H=$,V=J):J>N&&(H=$,V=E)),J<=E&&(V=E);var K=0;X-Z<=0&&((K=-G*(X-Z))>S?(W=!0,q=$,U=K):K>j&&(q=$,U=S)),K<=S&&(U=S)}else V=E,U=S;var Q=new Array(u.length);for(l=0;lt.lo&&(_.so=!0)}return a});d.enter().append("path").classed("point",!0),d.exit().remove(),d.call(a.translatePoints,l,u)}function c(t,e,r,a){var o,s,l=e.pos,u=e.val,c=a.bPos,f=a.bPosPxOffset||0,h=r.boxmean||(r.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var p=t.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?i.identity:[]);p.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),p.exit().remove(),p.each(function(t){var e=l.c2p(t.pos+c,!0)+f,i=l.c2p(t.pos+c-o,!0)+f,a=l.c2p(t.pos+c+s,!0)+f,p=u.c2p(t.mean,!0),d=u.c2p(t.mean-t.sd,!0),v=u.c2p(t.mean+t.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+p+","+i+"V"+a+("sd"===h?"m0,0L"+d+","+e+"L"+p+","+i+"L"+v+","+e+"Z":"")):n.select(this).attr("d","M"+i+","+p+"H"+a+("sd"===h?"m0,0L"+e+","+d+"L"+i+","+p+"L"+e+","+v+"Z":""))})}e.exports={plot:function(t,e,r,a){var o=e.xaxis,s=e.yaxis;i.makeTraceGroups(a,r,"trace boxes").each(function(t){var r,i,a=n.select(this),f=t[0],h=f.t,p=f.trace;e.isRangePlot||(f.node3=a),h.wdPos=h.bdPos*p.whiskerwidth,!0!==p.visible||h.empty?a.remove():("h"===p.orientation?(r=s,i=o):(r=o,i=s),l(a,{pos:r,val:i},p,h),u(a,{x:o,y:s},p,h),c(a,{pos:r,val:i},p,h))})},plotBoxAndWhiskers:l,plotPoints:u,plotBoxMean:c}},{"../../components/drawing":601,"../../lib":703,d3:157}],874:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i=t.cd,a=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r=10)return null;for(var i=1/0,a=-1/0,o=e.length,s=0;s0?Math.floor:Math.ceil,P=L>0?Math.ceil:Math.floor,D=L>0?Math.min:Math.max,z=L>0?Math.max:Math.min,R=I(S+O),F=P(C-O),B=[[f=E(S)]];for(a=R;a*L=0;i--)a[c-i]=t[f][i],o[c-i]=e[f][i];for(s.push({x:a,y:o,bicubic:l}),i=f,a=[],o=[];i>=0;i--)a[f-i]=t[i][0],o[f-i]=e[i][0];return s.push({x:a,y:o,bicubic:u}),s}},{}],888:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e,r){var a,o,s,l,u,c,f,h,p,d,v,g,m,y,x=t["_"+e],b=t[e+"axis"],_=b._gridlines=[],w=b._minorgridlines=[],k=b._boundarylines=[],A=t["_"+r],T=t[r+"axis"];"array"===b.tickmode&&(b.tickvals=x.slice());var M=t._xctrl,E=t._yctrl,S=M[0].length,C=M.length,L=t._a.length,O=t._b.length;n.prepTicks(b),"array"===b.tickmode&&delete b.tickvals;var I=b.smoothing?3:1;function P(n){var i,a,o,s,l,u,c,f,p,d,v,g,m=[],y=[],x={};if("b"===e)for(a=t.b2j(n),o=Math.floor(Math.max(0,Math.min(O-2,a))),s=a-o,x.length=O,x.crossLength=L,x.xy=function(e){return t.evalxy([],e,a)},x.dxy=function(e,r){return t.dxydi([],e,o,r,s)},i=0;i0&&(p=t.dxydi([],i-1,o,0,s),m.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),d=t.dxydi([],i-1,o,1,s),m.push(f[0]-d[0]/3),y.push(f[1]-d[1]/3)),m.push(f[0]),y.push(f[1]),l=f;else for(i=t.a2i(n),u=Math.floor(Math.max(0,Math.min(L-2,i))),c=i-u,x.length=L,x.crossLength=O,x.xy=function(e){return t.evalxy([],i,e)},x.dxy=function(e,r){return t.dxydj([],u,e,c,r)},a=0;a0&&(v=t.dxydj([],u,a-1,c,0),m.push(l[0]+v[0]/3),y.push(l[1]+v[1]/3),g=t.dxydj([],u,a-1,c,1),m.push(f[0]-g[0]/3),y.push(f[1]-g[1]/3)),m.push(f[0]),y.push(f[1]),l=f;return x.axisLetter=e,x.axis=b,x.crossAxis=T,x.value=n,x.constvar=r,x.index=h,x.x=m,x.y=y,x.smoothing=T.smoothing,x}function D(n){var i,a,o,s,l,u=[],c=[],f={};if(f.length=x.length,f.crossLength=A.length,"b"===e)for(o=Math.max(0,Math.min(O-2,n)),l=Math.min(1,Math.max(0,n-o)),f.xy=function(e){return t.evalxy([],e,n)},f.dxy=function(e,r){return t.dxydi([],e,o,r,l)},i=0;ix.length-1||_.push(i(D(o),{color:b.gridcolor,width:b.gridwidth}));for(h=c;hx.length-1||v<0||v>x.length-1))for(g=x[s],m=x[v],a=0;ax[x.length-1]||w.push(i(P(d),{color:b.minorgridcolor,width:b.minorgridwidth}));b.startline&&k.push(i(D(0),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&k.push(i(D(x.length-1),{color:b.endlinecolor,width:b.endlinewidth}))}else{for(l=5e-15,u=[Math.floor((x[x.length-1]-b.tick0)/b.dtick*(1+l)),Math.ceil((x[0]-b.tick0)/b.dtick/(1+l))].sort(function(t,e){return t-e}),c=u[0],f=u[1],h=c;h<=f;h++)p=b.tick0+b.dtick*h,_.push(i(P(p),{color:b.gridcolor,width:b.gridwidth}));for(h=c-1;hx[x.length-1]||w.push(i(P(d),{color:b.minorgridcolor,width:b.minorgridwidth}));b.startline&&k.push(i(P(x[0]),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&k.push(i(P(x[x.length-1]),{color:b.endlinecolor,width:b.endlinewidth}))}}},{"../../lib/extend":693,"../../plots/cartesian/axes":751}],889:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,a,o,s=e._labels=[],l=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],i=0;i90&&(p-=180,l=-l),{angle:p,flip:l,p:t.c2p(n,e,r),offsetMultplier:u}}},{}],903:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/drawing"),a=t("./map_1d_array"),o=t("./makepath"),s=t("./orient_text"),l=t("../../lib/svg_text_utils"),u=t("../../lib"),c=t("../../constants/alignment");function f(t,e,r,i,s,l){var u="const-"+s+"-lines",c=r.selectAll("."+u).data(l);c.enter().append("path").classed(u,!0).style("vector-effect","non-scaling-stroke"),c.each(function(r){var i=r,s=i.x,l=i.y,u=a([],s,t.c2p),c=a([],l,e.c2p),f="M"+o(u,c,i.smoothing),h=n.select(this);h.attr("d",f).style("stroke-width",i.width).style("stroke",i.color).style("fill","none")}),c.exit().remove()}function h(t,e,r,a,o,u,c,f){var h=u.selectAll("text."+f).data(c);h.enter().append("text").classed(f,!0);var p=0,d={};return h.each(function(o,u){var c;if("auto"===o.axis.tickangle)c=s(a,e,r,o.xy,o.dxy);else{var f=(o.axis.tickangle+180)*Math.PI/180;c=s(a,e,r,o.xy,[Math.cos(f),Math.sin(f)])}u||(d={angle:c.angle,flip:c.flip});var h=(o.endAnchor?-1:1)*c.flip,v=n.select(this).attr({"text-anchor":h>0?"start":"end","data-notex":1}).call(i.font,o.font).text(o.text).call(l.convertToTspans,t),g=i.bBox(this);v.attr("transform","translate("+c.p[0]+","+c.p[1]+") rotate("+c.angle+")translate("+o.axis.labelpadding*h+","+.3*g.height+")"),p=Math.max(p,g.width+o.axis.labelpadding)}),h.exit().remove(),d.maxExtent=p,d}e.exports=function(t,e,r,i){var l=e.xaxis,c=e.yaxis,p=t._fullLayout,d=p._clips;u.makeTraceGroups(i,r,"trace").each(function(e){var r=n.select(this),i=e[0],p=i.trace,g=p.aaxis,m=p.baxis,y=u.ensureSingle(r,"g","minorlayer"),x=u.ensureSingle(r,"g","majorlayer"),b=u.ensureSingle(r,"g","boundarylayer"),_=u.ensureSingle(r,"g","labellayer");r.style("opacity",p.opacity),f(l,c,x,0,"a",g._gridlines),f(l,c,x,0,"b",m._gridlines),f(l,c,y,0,"a",g._minorgridlines),f(l,c,y,0,"b",m._minorgridlines),f(l,c,b,0,"a-boundary",g._boundarylines),f(l,c,b,0,"b-boundary",m._boundarylines);var w=h(t,l,c,p,0,_,g._labels,"a-label"),k=h(t,l,c,p,0,_,m._labels,"b-label");!function(t,e,r,n,i,a,o,l){var c,f,h,p,d=u.aggNums(Math.min,null,r.a),g=u.aggNums(Math.max,null,r.a),m=u.aggNums(Math.min,null,r.b),y=u.aggNums(Math.max,null,r.b);c=.5*(d+g),f=m,h=r.ab2xy(c,f,!0),p=r.dxyda_rough(c,f),void 0===o.angle&&u.extendFlat(o,s(r,i,a,h,r.dxydb_rough(c,f))),v(t,e,r,0,h,p,r.aaxis,i,a,o,"a-title"),c=d,f=.5*(m+y),h=r.ab2xy(c,f,!0),p=r.dxydb_rough(c,f),void 0===l.angle&&u.extendFlat(l,s(r,i,a,h,r.dxyda_rough(c,f))),v(t,e,r,0,h,p,r.baxis,i,a,l,"b-title")}(t,_,p,0,l,c,w,k),function(t,e,r,n,i){var s,l,c,f,h=r.select("#"+t._clipPathId);h.size()||(h=r.append("clipPath").classed("carpetclip",!0));var p=u.ensureSingle(h,"path","carpetboundary"),d=e.clipsegments,v=[];for(f=0;f90&&m<270,b=n.select(this);b.text(c.title.text).call(l.convertToTspans,t),y&&(x=(-l.lineCount(b)+d)*p*a-x),b.attr("transform","translate("+e.p[0]+","+e.p[1]+") rotate("+e.angle+") translate(0,"+x+")").classed("user-select-none",!0).attr("text-anchor","middle").call(i.font,c.title.font)}),y.exit().remove()}},{"../../components/drawing":601,"../../constants/alignment":675,"../../lib":703,"../../lib/svg_text_utils":727,"./makepath":900,"./map_1d_array":901,"./orient_text":902,d3:157}],904:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib/search").findBin,a=t("./compute_control_points"),o=t("./create_spline_evaluator"),s=t("./create_i_derivative_evaluator"),l=t("./create_j_derivative_evaluator");e.exports=function(t){var e=t._a,r=t._b,u=e.length,c=r.length,f=t.aaxis,h=t.baxis,p=e[0],d=e[u-1],v=r[0],g=r[c-1],m=e[e.length-1]-e[0],y=r[r.length-1]-r[0],x=m*n.RELATIVE_CULL_TOLERANCE,b=y*n.RELATIVE_CULL_TOLERANCE;p-=x,d+=x,v-=b,g+=b,t.isVisible=function(t,e){return t>p&&tv&&ed||eg},t.setScale=function(){var e=t._x,r=t._y,n=a(t._xctrl,t._yctrl,e,r,f.smoothing,h.smoothing);t._xctrl=n[0],t._yctrl=n[1],t.evalxy=o([t._xctrl,t._yctrl],u,c,f.smoothing,h.smoothing),t.dxydi=s([t._xctrl,t._yctrl],f.smoothing,h.smoothing),t.dxydj=l([t._xctrl,t._yctrl],f.smoothing,h.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),u-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),u-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),u-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(u-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),c-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(c-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(ne[u-1]|ir[c-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var f,h,p,d,v=0,g=0,m=[];ne[u-1]?(f=u-2,h=1,v=(n-e[u-1])/(e[u-1]-e[u-2])):(f=Math.max(0,Math.min(u-2,Math.floor(o))),h=o-f),ir[c-1]?(p=c-2,d=1,g=(i-r[c-1])/(r[c-1]-r[c-2])):(p=Math.max(0,Math.min(c-2,Math.floor(s))),d=s-p),v&&(t.dxydi(m,f,p,h,d),l[0]+=m[0]*v,l[1]+=m[1]*v),g&&(t.dxydj(m,f,p,h,d),l[0]+=m[0]*g,l[1]+=m[1]*g)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=m*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":722,"./compute_control_points":892,"./constants":893,"./create_i_derivative_evaluator":894,"./create_j_derivative_evaluator":895,"./create_spline_evaluator":896}],905:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,a,o,s=[],l=[],u=t[0].length,c=t.length;function f(e,r){var n,i=0,a=0;return e>0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r0&&a0&&i1e-5);return n.log("Smoother converged to",A,"after",T,"iterations"),t}},{"../../lib":703}],906:[function(t,e,r){"use strict";var n=t("../../lib").isArray1D;e.exports=function(t,e,r){var i=r("x"),a=i&&i.length,o=r("y"),s=o&&o.length;if(!a&&!s)return!1;if(e._cheater=!i,a&&!n(i)||s&&!n(o))e._length=null;else{var l=a?i.length:1/0;s&&(l=Math.min(l,o.length)),e.a&&e.a.length&&(l=Math.min(l,e.a.length)),e.b&&e.b.length&&(l=Math.min(l,e.b.length)),e._length=l}return!0}},{"../../lib":703}],907:[function(t,e,r){"use strict";var n=t("../../components/fx/hovertemplate_attributes"),i=t("../scattergeo/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l=i.marker.line;e.exports=s({locations:{valType:"data_array",editType:"calc"},locationmode:i.locationmode,z:{valType:"data_array",editType:"calc"},text:s({},i.text,{}),hovertext:s({},i.hovertext,{}),marker:{line:{color:l.color,width:s({},l.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:i.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:i.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:s({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n()},a("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":587,"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../../plots/attributes":748,"../scattergeo/attributes":1114}],908:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");e.exports=function(t,e){for(var r=e._length,l=new Array(r),u=0;u")}}(t,f,o,h.mockAxis),[t]}},{"../../lib":703,"../../plots/cartesian/axes":751,"./attributes":907}],912:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),calc:t("./calc"),plot:t("./plot"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"choropleth",basePlotModule:t("../../plots/geo"),categories:["geo","noOpacity"],meta:{}}},{"../../plots/geo":781,"../heatmap/colorbar":975,"./attributes":907,"./calc":908,"./defaults":909,"./event_data":910,"./hover":911,"./plot":913,"./select":914,"./style":915}],913:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../lib/polygon"),o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../lib/geo_location_utils").locationToFeature,l=t("./style").style;function u(t,e){for(var r=t[0].trace,n=t.length,i=o(r,e),a=0;a0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===l||"FJI"===l?function(t){var e;if(null===c(t))e=t;else for(e=new Array(t.length),i=0;ie?r[n++]=[t[i][0]+360,t[i][1]]:i===e?(r[n++]=t[i],r[n++]=[t[i][0],-90]):r[n++]=t[i];var o=a.tester(r);o.pts.pop(),u.push(o)}:function(t){u.push(a.tester(t))},o.type){case"MultiPolygon":for(r=0;r":f.value>h&&(s.prefixBoundary=!0);break;case"<":f.valueh)&&(s.prefixBoundary=!0);break;case"][":a=Math.min.apply(null,f.value),o=Math.max.apply(null,f.value),ah&&(s.prefixBoundary=!0)}}},{}],924:[function(t,e,r){"use strict";var n=t("../../components/colorscale").extractOpts,i=t("./make_color_map"),a=t("./end_plus");e.exports={min:"zmin",max:"zmax",calc:function(t,e,r){var o=e.contours,s=e.line,l=o.size||1,u=o.coloring,c=i(e,{isColorbar:!0});if("heatmap"===u){var f=n(e);r._fillgradient=e.colorscale,r._zrange=[f.min,f.max]}else"fill"===u&&(r._fillcolor=c);r._line={color:"lines"===u?c:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},r._levels={start:o.start,end:a(o),size:l}}}},{"../../components/colorscale":592,"./end_plus":932,"./make_color_map":937}],925:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],926:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./label_defaults"),a=t("../../components/color"),o=a.addOpacity,s=a.opacity,l=t("../../constants/filter_ops"),u=l.CONSTRAINT_REDUCTION,c=l.COMPARISON_OPS2;e.exports=function(t,e,r,a,l,f){var h,p,d,v=e.contours,g=r("contours.operation");if(v._operation=u[g],function(t,e){var r;-1===c.indexOf(e.operation)?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:n(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),n(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0))}(r,v),"="===g?h=v.showlines=!0:(h=r("contours.showlines"),d=r("fillcolor",o((t.line||{}).color||l,.5))),h){var m=d&&s(d)?o(e.fillcolor,1):l;p=r("line.color",m),r("line.width",2),r("line.dash")}r("line.smoothing"),i(r,a,p,f)}},{"../../components/color":580,"../../constants/filter_ops":676,"./label_defaults":936,"fast-isnumeric":224}],927:[function(t,e,r){"use strict";var n=t("../../constants/filter_ops"),i=t("fast-isnumeric");function a(t,e){var r,a=Array.isArray(e);function o(t){return i(t)?+t:null}return-1!==n.COMPARISON_OPS2.indexOf(t)?r=o(a?e[0]:e):-1!==n.INTERVAL_OPS.indexOf(t)?r=a?[o(e[0]),o(e[1])]:[o(e),o(e)]:-1!==n.SET_OPS.indexOf(t)&&(r=a?e.map(o):[o(e)]),r}function o(t){return function(e){e=a(t,e);var r=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return{start:r,end:n,size:n-r}}}function s(t){return function(e){return{start:e=a(t,e),end:1/0,size:1/0}}}e.exports={"[]":o("[]"),"][":o("]["),">":s(">"),"<":s("<"),"=":s("=")}},{"../../constants/filter_ops":676,"fast-isnumeric":224}],928:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},{}],929:[function(t,e,r){"use strict";var n=t("../../lib");function i(t){return n.extendFlat({},t,{edgepaths:n.extendDeep([],t.edgepaths),paths:n.extendDeep([],t.paths)})}e.exports=function(t,e){var r,a,o,s=function(t){return t.reverse()},l=function(t){return t};switch(e){case"=":case"<":return t;case">":for(1!==t.length&&n.warn("Contour data invalid for the specified inequality operation."),a=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return l}},{"../../lib":703,"./constraint_mapping":927,"./end_plus":932}],932:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],933:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./constants");function a(t,e,r,n){return Math.abs(t[0]-e[0])20&&e?208===t||1114===t?n=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==i.BOTTOMSTART.indexOf(t)?a=1:-1!==i.LEFTSTART.indexOf(t)?n=1:-1!==i.TOPSTART.indexOf(t)?a=-1:n=-1,[n,a]}(h,r,e),d=[s(t,e,[-p[0],-p[1]])],v=p.join(","),g=t.z.length,m=t.z[0].length;for(u=0;u<1e4;u++){if(h>20?(h=i.CHOOSESADDLE[h][(p[0]||p[1])<0?0:1],t.crossings[f]=i.SADDLEREMAINDER[h]):delete t.crossings[f],!(p=i.NEWDELTA[h])){n.log("Found bad marching index:",h,e,t.level);break}d.push(s(t,e,p)),e[0]+=p[0],e[1]+=p[1],a(d[d.length-1],d[d.length-2],o,l)&&d.pop(),f=e.join(",");var y=p[0]&&(e[0]<0||e[0]>m-2)||p[1]&&(e[1]<0||e[1]>g-2),x=f===c&&p.join(",")===v;if(x||r&&y)break;h=t.crossings[f]}1e4===u&&n.log("Infinite loop in contour?");var b,_,w,k,A,T,M,E,S,C,L,O,I,P,D,z=a(d[0],d[d.length-1],o,l),R=0,F=.2*t.smoothing,B=[],N=0;for(u=1;u=N;u--)if((b=B[u])=N&&b+B[_]E&&S--,t.edgepaths[S]=L.concat(d,C));break}H||(t.edgepaths[E]=d.concat(C))}for(E=0;Et?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===r||10===r){var n=(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4;return t>n?5===r?713:1114:5===r?104:208}return 15===r?0:r}e.exports=function(t){var e,r,a,o,s,l,u,c,f,h=t[0].z,p=h.length,d=h[0].length,v=2===p||2===d;for(r=0;rt.level}return r?"M"+e.join("L")+"Z":""}(t,e),h=0,p=t.edgepaths.map(function(t,e){return e}),d=!0;function v(t){return Math.abs(t[1]-e[2][1])<.01}function g(t){return Math.abs(t[0]-e[0][0])<.01}function m(t){return Math.abs(t[0]-e[2][0])<.01}for(;p.length;){for(u=a.smoothopen(t.edgepaths[h],t.smoothing),f+=d?u:u.replace(/^M/,"L"),p.splice(p.indexOf(h),1),r=t.edgepaths[h][t.edgepaths[h].length-1],s=-1,o=0;o<4;o++){if(!r){i.log("Missing end?",h,t);break}for(c=r,Math.abs(c[1]-e[0][1])<.01&&!m(r)?n=e[1]:g(r)?n=e[0]:v(r)?n=e[3]:m(r)&&(n=e[2]),l=0;l=0&&(n=y,s=l):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-y[1])<.01&&(y[0]-r[0])*(n[0]-y[0])>=0&&(n=y,s=l):i.log("endpt to newendpt is not vert. or horz.",r,n,y)}if(r=n,s>=0)break;f+="L"+n}if(s===t.edgepaths.length){i.log("unclosed perimeter path");break}h=s,(d=-1===p.indexOf(h))&&(h=p[0],f+="Z")}for(h=0;hn.center?n.right-s:s-n.left)/(c+Math.abs(Math.sin(u)*o)),p=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(f)+Math.cos(u)*o);if(h<1||p<1)return 1/0;var d=g.EDGECOST*(1/(h-1)+1/(p-1));d+=g.ANGLECOST*u*u;for(var v=s-c,m=l-f,y=s+c,x=l+f,b=0;b2*g.MAXCOST)break;p&&(s/=2),l=(o=u-s/2)+1.5*s}if(h<=g.MAXCOST)return c},r.addLabelData=function(t,e,r,n){var i=e.width/2,a=e.height/2,o=t.x,s=t.y,l=t.theta,u=Math.sin(l),c=Math.cos(l),f=i*c,h=a*u,p=i*u,d=-a*c,v=[[o-f-h,s-p-d],[o+f-h,s+p-d],[o+f+h,s+p+d],[o-f+h,s-p+d]];r.push({text:e.text,x:o,y:s,dy:e.dy,theta:l,level:e.level,width:e.width,height:e.height}),n.push(v)},r.drawLabels=function(t,e,r,a,s){var l=t.selectAll("text").data(e,function(t){return t.text+","+t.x+","+t.y+","+t.theta});if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(t){var e=t.x+Math.sin(t.theta)*t.dy,i=t.y-Math.cos(t.theta)*t.dy;n.select(this).text(t.text).attr({x:e,y:i,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+i+")"}).call(o.convertToTspans,r)}),s){for(var u="",c=0;cr.end&&(r.start=r.end=(r.start+r.end)/2),t._input.contours||(t._input.contours={}),i.extendFlat(t._input.contours,{start:r.start,end:r.end,size:r.size}),t._input.autocontour=!0}else if("constraint"!==r.type){var u,c=r.start,f=r.end,h=t._input.contours;c>f&&(r.start=h.start=f,f=r.end=h.end=c,c=r.start),r.size>0||(u=c===f?1:a(c,f,t.ncontours).dtick,h.size=r.size=u)}}},{"../../lib":703,"../../plots/cartesian/axes":751}],941:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/drawing"),a=t("../heatmap/style"),o=t("./make_color_map");e.exports=function(t){var e=n.select(t).selectAll("g.contour");e.style("opacity",function(t){return t[0].trace.opacity}),e.each(function(t){var e=n.select(this),r=t[0].trace,a=r.contours,s=r.line,l=a.size||1,u=a.start,c="constraint"===a.type,f=!c&&"lines"===a.coloring,h=!c&&"fill"===a.coloring,p=f||h?o(r):null;e.selectAll("g.contourlevel").each(function(t){n.select(this).selectAll("path").call(i.lineGroupStyle,s.width,f?p(t.level):s.color,s.dash)});var d=a.labelfont;if(e.selectAll("g.contourlabels text").each(function(t){i.font(n.select(this),{family:d.family,size:d.size,color:d.color||(f?p(t.level):s.color)})}),c)e.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(h){var v;e.selectAll("g.contourfill path").style("fill",function(t){return void 0===v&&(v=t.level),p(t.level+.5*l)}),void 0===v&&(v=u),e.selectAll("g.contourbg path").style("fill",p(v-.5*l))}}),a(t)}},{"../../components/drawing":601,"../heatmap/style":984,"./make_color_map":937,d3:157}],942:[function(t,e,r){"use strict";var n=t("../../components/colorscale/defaults"),i=t("./label_defaults");e.exports=function(t,e,r,a,o){var s,l=r("contours.coloring"),u="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(u=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,n(t,e,a,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),i(r,a,u,o)}},{"../../components/colorscale/defaults":590,"./label_defaults":936}],943:[function(t,e,r){"use strict";var n=t("../heatmap/attributes"),i=t("../contour/attributes"),a=i.contours,o=t("../scatter/attributes"),s=t("../../components/colorscale/attributes"),l=t("../../lib/extend").extendFlat,u=o.line;e.exports=l({carpet:{valType:"string",editType:"calc"},z:n.z,a:n.x,a0:n.x0,da:n.dx,b:n.y,b0:n.y0,db:n.dy,text:n.text,hovertext:n.hovertext,transpose:n.transpose,atype:n.xtype,btype:n.ytype,fillcolor:i.fillcolor,autocontour:i.autocontour,ncontours:i.ncontours,contours:{type:a.type,start:a.start,end:a.end,size:a.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:a.showlines,showlabels:a.showlabels,labelfont:a.labelfont,labelformat:a.labelformat,operation:a.operation,value:a.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:l({},u.color,{}),width:u.width,dash:u.dash,smoothing:l({},u.smoothing,{}),editType:"plot"},transforms:void 0},s("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":587,"../../lib/extend":693,"../contour/attributes":921,"../heatmap/attributes":972,"../scatter/attributes":1075}],944:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),i=t("../../lib"),a=t("../heatmap/convert_column_xyz"),o=t("../heatmap/clean_2d_array"),s=t("../heatmap/interp2d"),l=t("../heatmap/find_empties"),u=t("../heatmap/make_bound_array"),c=t("./defaults"),f=t("../carpet/lookup_carpetid"),h=t("../contour/set_contours");e.exports=function(t,e){var r=e._carpetTrace=f(t,e);if(r&&r.visible&&"legendonly"!==r.visible){if(!e.a||!e.b){var p=t.data[r.index],d=t.data[e.index];d.a||(d.a=p.a),d.b||(d.b=p.b),c(d,e,e._defaultColor,t._fullLayout)}var v=function(t,e){var r,c,f,h,p,d,v,g=e._carpetTrace,m=g.aaxis,y=g.baxis;m._minDtick=0,y._minDtick=0,i.isArray1D(e.z)&&a(e,m,y,"a","b",["z"]),r=e._a=e._a||e.a,h=e._b=e._b||e.b,r=r?m.makeCalcdata(e,"_a"):[],h=h?y.makeCalcdata(e,"_b"):[],c=e.a0||0,f=e.da||1,p=e.b0||0,d=e.db||1,v=e._z=o(e._z||e.z,e.transpose),e._emptypoints=l(v),s(v,e._emptypoints);var x=i.maxRowLength(v),b="scaled"===e.xtype?"":r,_=u(e,b,c,f,x,m),w="scaled"===e.ytype?"":h,k=u(e,w,p,d,v.length,y),A={a:_,b:k,z:v};return"levels"===e.contours.type&&"none"!==e.contours.coloring&&n(t,e,{vals:v,containerStr:"",cLetter:"z"}),[A]}(t,e);return h(e,e._z),v}}},{"../../components/colorscale/calc":588,"../../lib":703,"../carpet/lookup_carpetid":899,"../contour/set_contours":940,"../heatmap/clean_2d_array":974,"../heatmap/convert_column_xyz":976,"../heatmap/find_empties":978,"../heatmap/interp2d":981,"../heatmap/make_bound_array":982,"./defaults":945}],945:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/xyz_defaults"),a=t("./attributes"),o=t("../contour/constraint_defaults"),s=t("../contour/contours_defaults"),l=t("../contour/style_defaults");e.exports=function(t,e,r,u){function c(r,i){return n.coerce(t,e,a,r,i)}if(c("carpet"),t.a&&t.b){var f=i(t,e,c,u,"a","b");if(!f)return void(e.visible=!1);c("text");var h="constraint"===c("contours.type");h?o(t,e,c,u,r,{hasHover:!1}):(s(t,e,c,function(r){return n.coerce2(t,e,a,r)}),l(t,e,c,u,{hasHover:!1}))}else e._defaultColor=r,e._length=null}},{"../../lib":703,"../contour/constraint_defaults":926,"../contour/contours_defaults":928,"../contour/style_defaults":942,"../heatmap/xyz_defaults":986,"./attributes":943}],946:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../contour/colorbar"),calc:t("./calc"),plot:t("./plot"),style:t("../contour/style"),moduleType:"trace",name:"contourcarpet",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent"],meta:{}}},{"../../plots/cartesian":762,"../contour/colorbar":924,"../contour/style":941,"./attributes":943,"./calc":944,"./defaults":945,"./plot":949}],947:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../carpet/axis_aligned_line"),a=t("../../lib");e.exports=function(t,e,r,o,s,l,u,c){var f,h,p,d,v,g,m,y="",x=e.edgepaths.map(function(t,e){return e}),b=!0,_=1e-4*Math.abs(r[0][0]-r[2][0]),w=1e-4*Math.abs(r[0][1]-r[2][1]);function k(t){return Math.abs(t[1]-r[0][1])=0&&(p=C,v=g):Math.abs(h[1]-p[1])=0&&(p=C,v=g):a.log("endpt to newendpt is not vert. or horz.",h,p,C)}if(v>=0)break;y+=E(h,p),h=p}if(v===e.edgepaths.length){a.log("unclosed perimeter path");break}f=v,(b=-1===x.indexOf(f))&&(f=x[0],y+=E(h,p)+"Z",h=null)}for(f=0;f=0;V--)B=E.clipsegments[V],N=i([],B.x,w.c2p),j=i([],B.y,k.c2p),N.reverse(),j.reverse(),H.push(a(N,j,B.bicubic));var q="M"+H.join("L")+"Z";!function(t,e,r,n,o,l){var u,c,f,h,p=s.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"!==l||o?[]:[0]);p.enter().append("path"),p.exit().remove();var d=[];for(h=0;hv&&(n.max=v),n.len=n.max-n.min}function g(t,e){var r,n=0;return(Math.abs(t[0]-l)<.1||Math.abs(t[0]-u)<.1)&&(r=x(i.dxydb_rough(t[0],t[1],.1)),n=Math.max(n,a*b(e,r)/2)),(Math.abs(t[1]-c)<.1||Math.abs(t[1]-f)<.1)&&(r=x(i.dxyda_rough(t[0],t[1],.1)),n=Math.max(n,a*b(e,r)/2)),n}}(this,r,t,n,u,e.height),!(n.len<(e.width+e.height)*f.LABELMIN)))for(var i=Math.min(Math.ceil(n.len/I),f.LABELMAX),a=0;a"),s.color=function(t,e){var r=t.marker,i=e.mc||r.color,a=e.mlc||r.line.color,o=e.mlw||r.line.width;return n(i)?i:n(a)&&o?a:void 0}(u,h),[s]}}},{"../../components/color":580,"../../lib":703,"../bar/hover":847}],958:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"funnel",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":762,"../bar/select":852,"./attributes":951,"./calc":952,"./cross_trace_calc":954,"./defaults":955,"./event_data":956,"./hover":957,"./layout_attributes":959,"./layout_defaults":960,"./plot":961,"./style":962}],959:[function(t,e,r){"use strict";e.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],960:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a=!1;function o(r,a){return n.coerce(t,e,i,r,a)}for(var s=0;s path").each(function(t){if(!t.isBlank){var e=s.marker;n.select(this).call(a.fill,t.mc||e.color).call(a.stroke,t.mlc||e.line.color).call(i.dashLine,e.line.dash,t.mlw||e.line.width).style("opacity",s.selectedpoints&&!t.selected?.3:1)}}),o(r,s,t),r.selectAll(".regions").each(function(){n.select(this).selectAll("path").style("stroke-width",0).call(a.fill,s.connector.fillcolor)}),r.selectAll(".lines").each(function(){var t=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)})})}}},{"../../components/color":580,"../../components/drawing":601,"../bar/style":854,d3:157}],963:[function(t,e,r){"use strict";var n=t("../pie/attributes"),i=t("../../plots/attributes"),a=t("../../plots/domain").attributes,o=t("../../components/fx/hovertemplate_attributes"),s=t("../../lib/extend").extendFlat;e.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:s({},n.marker.line.color,{dflt:null}),width:s({},n.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:s({},n.scalegroup,{}),textinfo:s({},n.textinfo,{flags:["label","text","value","percent"]}),hoverinfo:s({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","percent","text"]}),textposition:s({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:s({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:a({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},{"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../../plots/attributes":748,"../../plots/domain":776,"../pie/attributes":1049}],964:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/get_data").getModuleCalcData;r.name="funnelarea",r.plot=function(t){var e=n.getModule("funnelarea"),r=i(t.calcdata,e)[0];e.plot(t,r)},r.clean=function(t,e,r,n){var i=n._has&&n._has("funnelarea"),a=e._has&&e._has("funnelarea");i&&!a&&n._funnelarealayer.selectAll("g.trace").remove()}},{"../../plots/get_data":786,"../../registry":831}],965:[function(t,e,r){"use strict";var n=t("../pie/calc");e.exports={calc:function(t,e){return n.calc(t,e)},crossTraceCalc:function(t){n.crossTraceCalc(t,{type:"funnelarea"})}}},{"../pie/calc":1051}],966:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../plots/domain").defaults,o=t("../bar/defaults").handleText;e.exports=function(t,e,r,s){function l(r,a){return n.coerce(t,e,i,r,a)}var u,c=l("values"),f=n.isArrayOrTypedArray(c),h=l("labels");if(Array.isArray(h)?(u=h.length,f&&(u=Math.min(u,c.length))):f&&(u=c.length,l("label0"),l("dlabel")),u){e._length=u;var p=l("marker.line.width");p&&l("marker.line.color",s.paper_bgcolor),l("marker.colors"),l("scalegroup");var d=l("text"),v=l("textinfo",Array.isArray(d)?"text+percent":"percent");if(l("hovertext"),l("hovertemplate"),v&&"none"!==v){var g=l("textposition");o(t,e,s,l,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}a(e,s,l);var m=l("title.text");m&&(l("title.position"),n.coerceFont(l,"title.font",s.font)),l("aspectratio"),l("baseratio")}else e.visible=!1}},{"../../lib":703,"../../plots/domain":776,"../bar/defaults":845,"./attributes":963}],967:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"funnelarea",basePlotModule:t("./base_plot"),categories:["pie-like","funnelarea","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style"),styleOne:t("../pie/style_one"),meta:{}}},{"../pie/style_one":1060,"./attributes":963,"./base_plot":964,"./calc":965,"./defaults":966,"./layout_attributes":968,"./layout_defaults":969,"./plot":970,"./style":971}],968:[function(t,e,r){"use strict";var n=t("../pie/layout_attributes").hiddenlabels;e.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{"../pie/layout_attributes":1056}],969:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("hiddenlabels"),r("funnelareacolorway",e.colorway),r("extendfunnelareacolors")}},{"../../lib":703,"./layout_attributes":968}],970:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/drawing"),a=t("../../lib"),o=t("../../lib/svg_text_utils"),s=t("../bar/plot"),l=s.getTransformToMoveInsideBar,u=t("../pie/helpers"),c=t("../pie/plot"),f=c.attachFxHandlers,h=c.determineInsideTextFont,p=c.layoutAreas,d=c.prerenderTitles,v=c.positionTitleOutside;function g(t,e){var r=e[0]-t[0],n=e[1]-t[1];return"l"+r+","+n}e.exports=function(t,e){var r=t._fullLayout;d(e,t),p(e,r._size),a.makeTraceGroups(r._funnelarealayer,e,"trace").each(function(e){var s=n.select(this),c=e[0],p=c.trace;!function(t){if(t.length){var e=t[0],r=e.trace,n=r.aspectratio,i=r.baseratio;i>.999&&(i=.999);var a,o,s,l=Math.pow(i,2),u=e.vTotal,c=u,f=u*l/(1-l)/u,h=[];for(h.push(S()),o=t.length-1;o>-1;o--)if(!(s=t[o]).hidden){var p=s.v/c;f+=p,h.push(S())}var d=1/0,v=-1/0;for(o=0;o-1;o--)if(!(s=t[o]).hidden){var M=h[T+=1][0],E=h[T][1];s.TL=[-M,E],s.TR=[M,E],s.BL=k,s.BR=A,s.pxmid=(_=s.TR,w=s.BR,[.5*(_[0]+w[0]),.5*(_[1]+w[1])]),k=s.TL,A=s.TR}}function S(){var t,e={x:t=Math.sqrt(f),y:-t};return[e.x,e.y]}}(e),s.each(function(){var s=n.select(this).selectAll("g.slice").data(e);s.enter().append("g").classed("slice",!0),s.exit().remove(),s.each(function(r){if(r.hidden)n.select(this).selectAll("path,g").remove();else{r.pointNumber=r.i,r.curveNumber=p.index;var s=c.cx,d=c.cy,v=n.select(this),m=v.selectAll("path.surface").data([r]);m.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),v.call(f,t,e);var y="M"+(s+r.TR[0])+","+(d+r.TR[1])+g(r.TR,r.BR)+g(r.BR,r.BL)+g(r.BL,r.TL)+"Z";m.attr("d",y);var x=u.castOption(p.textposition,r.pts),b=v.selectAll("g.slicetext").data(r.text&&"none"!==x?[0]:[]);b.enter().append("g").classed("slicetext",!0),b.exit().remove(),b.each(function(){var e=a.ensureSingle(n.select(this),"text","",function(t){t.attr("data-notex",1)});e.text(r.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(i.font,h(p,r,t._fullLayout.font)).call(o.convertToTspans,t);var u,c,f,v=i.bBox(e.node()),g=Math.min(r.BL[1],r.BR[1]),m=Math.max(r.TL[1],r.TR[1]);c=Math.max(r.TL[0],r.BL[0]),f=Math.min(r.TR[0],r.BR[0]),u=l(c,f,g,m,v,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),e.attr("transform","translate("+s+","+d+")"+u)})}});var d=n.select(this).selectAll("g.titletext").data(p.title.text?[0]:[]);d.enter().append("g").classed("titletext",!0),d.exit().remove(),d.each(function(){var e=a.ensureSingle(n.select(this),"text","",function(t){t.attr("data-notex",1)}),s=p.title.text;p._meta&&(s=a.templateString(s,p._meta)),e.text(s).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(i.font,p.title.font).call(o.convertToTspans,t);var l=v(c,r._size);e.attr("transform","translate("+l.x+","+l.y+")"+(l.scale<1?"scale("+l.scale+")":"")+"translate("+l.tx+","+l.ty+")")})})})}},{"../../components/drawing":601,"../../lib":703,"../../lib/svg_text_utils":727,"../bar/plot":851,"../pie/helpers":1054,"../pie/plot":1058,d3:157}],971:[function(t,e,r){"use strict";var n=t("d3"),i=t("../pie/style_one");e.exports=function(t){t._fullLayout._funnelarealayer.selectAll(".trace").each(function(t){var e=t[0],r=e.trace,a=n.select(this);a.style({opacity:r.opacity}),a.selectAll("path.surface").each(function(t){n.select(this).call(i,t,r)})})}},{"../pie/style_one":1060,d3:157}],972:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/fx/hovertemplate_attributes"),a=t("../../components/colorscale/attributes"),o=t("../../lib/extend").extendFlat;e.exports=o({z:{valType:"data_array",editType:"calc"},x:o({},n.x,{impliedEdits:{xtype:"array"}}),x0:o({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:o({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:o({},n.y,{impliedEdits:{ytype:"array"}}),y0:o({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:o({},n.dy,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},zhoverformat:{valType:"string",dflt:"",editType:"none"},hovertemplate:i()},{transforms:void 0},a("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":587,"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../scatter/attributes":1075}],973:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../histogram2d/calc"),s=t("../../components/colorscale/calc"),l=t("./convert_column_xyz"),u=t("./clean_2d_array"),c=t("./interp2d"),f=t("./find_empties"),h=t("./make_bound_array");e.exports=function(t,e){var r,p,d,v,g,m,y,x,b,_=a.getFromId(t,e.xaxis||"x"),w=a.getFromId(t,e.yaxis||"y"),k=n.traceIs(e,"contour"),A=n.traceIs(e,"histogram"),T=n.traceIs(e,"gl2d"),M=k?"best":e.zsmooth;if(_._minDtick=0,w._minDtick=0,A)b=o(t,e),r=b.x,p=b.x0,d=b.dx,v=b.y,g=b.y0,m=b.dy,y=b.z;else{var E=e.z;i.isArray1D(E)?(l(e,_,w,"x","y",["z"]),r=e._x,v=e._y,E=e._z):(r=e._x=e.x?_.makeCalcdata(e,"x"):[],v=e._y=e.y?w.makeCalcdata(e,"y"):[]),p=e.x0,d=e.dx,g=e.y0,m=e.dy,y=u(E,e,_,w),(k||e.connectgaps)&&(e._emptypoints=f(y),c(y,e._emptypoints))}function S(t){M=e._input.zsmooth=e.zsmooth=!1,i.warn('cannot use zsmooth: "fast": '+t)}if("fast"===M)if("log"===_.type||"log"===w.type)S("log axis found");else if(!A){if(r.length){var C=(r[r.length-1]-r[0])/(r.length-1),L=Math.abs(C/100);for(x=0;xL){S("x scale is not linear");break}}if(v.length&&"fast"===M){var O=(v[v.length-1]-v[0])/(v.length-1),I=Math.abs(O/100);for(x=0;xI){S("y scale is not linear");break}}}var P=i.maxRowLength(y),D="scaled"===e.xtype?"":r,z=h(e,D,p,d,P,_),R="scaled"===e.ytype?"":v,F=h(e,R,g,m,y.length,w);T||(e._extremes[_._id]=a.findExtremes(_,z),e._extremes[w._id]=a.findExtremes(w,F));var B={x:z,y:F,z:y,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(D&&D.length===z.length-1&&(B.xCenter=D),R&&R.length===F.length-1&&(B.yCenter=R),A&&(B.xRanges=b.xRanges,B.yRanges=b.yRanges,B.pts=b.pts),k||s(t,e,{vals:y,cLetter:"z"}),k&&e.contours&&"heatmap"===e.contours.coloring){var N={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};B.xfill=h(N,D,p,d,P,_),B.yfill=h(N,R,g,m,y.length,w)}return[B]}},{"../../components/colorscale/calc":588,"../../lib":703,"../../plots/cartesian/axes":751,"../../registry":831,"../histogram2d/calc":1004,"./clean_2d_array":974,"./convert_column_xyz":976,"./find_empties":978,"./interp2d":981,"./make_bound_array":982}],974:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,o){var s,l,u,c,f,h;function p(t){if(n(t))return+t}if(e&&e.transpose){for(s=0,f=0;f=0;o--)a=h[o],r=a[0],i=a[1],(s=((f[[r-1,i]]||v)[2]+(f[[r+1,i]]||v)[2]+(f[[r,i-1]]||v)[2]+(f[[r,i+1]]||v)[2])/20)&&(l[a]=[r,i,s],h.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],c.push(l[a])}return c.sort(function(t,e){return e[2]-t[2]})}},{"../../lib":703}],979:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../../components/colorscale").extractOpts;e.exports=function(t,e,r,s,l,u){var c,f,h,p,d=t.cd[0],v=d.trace,g=t.xa,m=t.ya,y=d.x,x=d.y,b=d.z,_=d.xCenter,w=d.yCenter,k=d.zmask,A=v.zhoverformat,T=y,M=x;if(!1!==t.index){try{h=Math.round(t.index[1]),p=Math.round(t.index[0])}catch(e){return void i.error("Error hovering on heatmap, pointNumber must be [row,col], found:",t.index)}if(h<0||h>=b[0].length||p<0||p>b.length)return}else{if(n.inbox(e-y[0],e-y[y.length-1],0)>0||n.inbox(r-x[0],r-x[x.length-1],0)>0)return;if(u){var E;for(T=[2*y[0]-y[1]],E=1;Ev&&(m=Math.max(m,Math.abs(t[a][o]-d)/(g-v))))}return m}e.exports=function(t,e){var r,i=1;for(o(t,e),r=0;r.01;r++)i=o(t,e,a(i));return i>.01&&n.log("interp2d didn't converge quickly",i),t}},{"../../lib":703}],982:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,a,o,s){var l,u,c,f=[],h=n.traceIs(t,"contour"),p=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d"),v=i(e)&&e.length>1;if(v&&!p&&"category"!==s.type){var g=e.length;if(!(g<=o))return h?e.slice(0,o):e.slice(0,o+1);if(h||d)f=e.slice(0,o);else if(1===o)f=[e[0]-.5,e[0]+.5];else{for(f=[1.5*e[0]-.5*e[1]],c=1;c0;)h=p.c2p(k[y]),y--;for(h0;)m=d.c2p(A[y]),y--;if(m0&&(a=!0);for(var l=0;la){var o=a-r[t];return r[t]=a,o}}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]u?t>o?t>1.1*i?i:t>1.1*a?a:o:t>s?s:t>l?l:u:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function p(t,e,r,n,a,s){if(n&&t>o){var l=d(e,a,s),u=d(r,a,s),c=t===i?0:1;return l[c]!==u[c]}return Math.floor(r/t)-Math.floor(e/t)>.1}function d(t,e,r){var n=e.c2d(t,i,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,a){var s,l,u=-1.1*e,h=-.1*e,p=t-h,d=r[0],v=r[1],g=Math.min(f(d+h,d+p,n,a),f(v+h,v+p,n,a)),m=Math.min(f(d+u,d+h,n,a),f(v+u,v+h,n,a));if(g>m&&mo){var y=s===i?1:6,x=s===i?"M12":"M1";return function(e,r){var o=n.c2d(e,i,a),s=o.indexOf("-",y);s>0&&(o=o.substr(0,s));var u=n.d2c(o,0,a);if(ur.r2l(B)&&(j=o.tickIncrement(j,b.size,!0,p)),D.start=r.l2r(j),F||i.nestedProperty(e,m+".start").set(D.start)}var V=b.end,U=r.r2l(P.end),H=void 0!==U;if((b.endFound||H)&&U!==r.r2l(V)){var q=H?U:i.aggNums(Math.max,null,d);D.end=r.l2r(q),H||i.nestedProperty(e,m+".start").set(D.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[m]=i.extendFlat({},e[m]||{}),delete e._input[G],delete e[G]),[D,d]}e.exports={calc:function(t,e){var r,a,p,d,v=[],g=[],m=o.getFromId(t,"h"===e.orientation?e.yaxis:e.xaxis),y="h"===e.orientation?"y":"x",x={x:"y",y:"x"}[y],b=e[y+"calendar"],_=e.cumulative,w=h(t,e,m,y),k=w[0],A=w[1],T="string"==typeof k.size,M=[],E=T?M:k,S=[],C=[],L=[],O=0,I=e.histnorm,P=e.histfunc,D=-1!==I.indexOf("density");_.enabled&&D&&(I=I.replace(/ ?density$/,""),D=!1);var z,R="max"===P||"min"===P?null:0,F=l.count,B=u[I],N=!1,j=function(t){return m.r2c(t,0,b)};for(i.isArrayOrTypedArray(e[x])&&"count"!==P&&(z=e[x],N="avg"===P,F=l[P]),r=j(k.start),p=j(k.end)+(r-o.tickIncrement(r,k.size,!1,b))/1e6;r=0&&d=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(g,_.direction,_.currentbin);var X=Math.min(v.length,g.length),Z=[],$=0,J=X-1;for(r=0;r=$;r--)if(g[r]){J=r;break}for(r=$;r<=J;r++)if(n(v[r])&&n(g[r])){var K={p:v[r],s:g[r],b:0};_.enabled||(K.pts=L[r],H?K.ph0=K.ph1=L[r].length?A[L[r][0]]:v[r]:(K.ph0=V(M[r]),K.ph1=V(M[r+1],!0))),Z.push(K)}return 1===Z.length&&(Z[0].width1=o.tickIncrement(Z[0].p,k.size,!1,b)-Z[0].p),s(Z,e),i.isArrayOrTypedArray(e.selectedpoints)&&i.tagSelected(Z,e,W),Z},calcAllAutoBins:h}},{"../../lib":703,"../../plots/cartesian/axes":751,"../../registry":831,"../bar/arrays_to_calcdata":840,"./average":991,"./bin_functions":993,"./bin_label_vals":994,"./norm_functions":1002,"fast-isnumeric":224}],996:[function(t,e,r){"use strict";e.exports={eventDataKeys:["binNumber"]}},{}],997:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axis_ids"),a=t("../../registry").traceIs,o=t("../bar/defaults").handleGroupingDefaults,s=n.nestedProperty,l=i.getAxisGroup,u=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],c=["x","y"];e.exports=function(t,e){var r,f,h,p,d,v,g,m=e._histogramBinOpts={},y=[],x={},b=[];function _(t,e){return n.coerce(r._input,r,r._module.attributes,t,e)}function w(t){return"v"===t.orientation?"x":"y"}function k(t,r,a){var o=t.uid+"__"+a;r||(r=o);var s=function(t,r){return i.getFromTrace({_fullLayout:e},t,r).type}(t,a),l=t[a+"calendar"],u=m[r],c=!0;u&&(s===u.axType&&l===u.calendar?(c=!1,u.traces.push(t),u.dirs.push(a)):(r=o,s!==u.axType&&n.warn(["Attempted to group the bins of trace",t.index,"set on a","type:"+s,"axis","with bins on","type:"+u.axType,"axis."].join(" ")),l!==u.calendar&&n.warn(["Attempted to group the bins of trace",t.index,"set with a",l,"calendar","with bins",u.calendar?"on a "+u.calendar+" calendar":"w/o a set calendar"].join(" ")))),c&&(m[r]={traces:[t],dirs:[a],axType:s,calendar:t[a+"calendar"]||""}),t["_"+a+"bingroup"]=r}for(d=0;dE&&k.splice(E,k.length-E),M.length>E&&M.splice(E,M.length-E);var S=[],C=[],L=[],O="string"==typeof w.size,I="string"==typeof T.size,P=[],D=[],z=O?P:w,R=I?D:T,F=0,B=[],N=[],j=e.histnorm,V=e.histfunc,U=-1!==j.indexOf("density"),H="max"===V||"min"===V,q=H?null:0,G=a.count,W=o[j],Y=!1,X=[],Z=[],$="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";$&&"count"!==V&&(Y="avg"===V,G=a[V]);var J=w.size,K=x(w.start),Q=x(w.end)+(K-i.tickIncrement(K,J,!1,m))/1e6;for(r=K;r=0&&p=0&&d0;r--){var n=Math.min(e[r],e[r-1]),i=Math.max(e[r],e[r-1]);if(i>n&&n-1}function z(t,e){return null===t?e:t}function R(e,r,n){C();var i,a,o,s=[r],l=[n];if(k>=1)s=[r],l=[n];else if(k>0){var u=function(t,e){var r=t[0],n=t[1],i=t[2],a=function(t,e,r){for(var n=[],i=0;i-1?n[p]:S(d,v,g);h[p]=y>-1?y:O(d,v,g,z(e,m))}i=h[0],a=h[1],o=h[2],t._i.push(i),t._j.push(a),t._k.push(o),++f}}function F(t,e,r,n){var i=t[3];in&&(i=n);for(var a=(t[3]-i)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*t[s]+a*e[s];return o}function B(t,e,r){return t>=e&&t<=r}function N(t){var e=.001*(E-M);return t>=M-e&&t<=E+e}function j(e){for(var r=[],n=0;n<4;n++){var i=e[n];r.push([t.x[i],t.y[i],t.z[i],t.value[i]])}return r}var V=3;function U(t,e,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[B(e[0][3],n,i),B(e[1][3],n,i),B(e[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return N(e[0][3])&&N(e[1][3])&&N(e[2][3])?(R(t,e,r),!0):aC?[A,k]:[k,T];Q(e,I[0],I[1])}}var D=[[Math.min(M,T),Math.max(M,T)],[Math.min(A,E),Math.max(A,E)]];["x","y","z"].forEach(function(e){for(var r=[],n=0;n0&&(u.push(x.id),"x"===e?f.push([x.distRatio,0,0]):"y"===e?f.push([0,x.distRatio,0]):f.push([0,0,x.distRatio]))}else l=nt(1,"x"===e?v-1:"y"===e?g-1:m-1);u.length>0&&(r[i]="x"===e?tt(null,u,a,o,f,r[i]):"y"===e?et(null,u,a,o,f,r[i]):rt(null,u,a,o,f,r[i]),i++),l.length>0&&(r[i]="x"===e?Z(null,l,a,o,r[i]):"y"===e?$(null,l,a,o,r[i]):J(null,l,a,o,r[i]),i++)}var b=t.caps[e];b.show&&b.fill&&(P(b.fill),r[i]="x"===e?Z(null,[0,v-1],a,o,r[i]):"y"===e?$(null,[0,g-1],a,o,r[i]):J(null,[0,m-1],a,o,r[i]),i++)}}),0===f&&L(),t._x=x,t._y=b,t._z=_,t._intensity=w,t._Xs=h,t._Ys=p,t._Zs=d}(),t}h.handlePick=function(t){if(t.object===this.mesh){var e=t.data.index,r=this.data._x[e],n=this.data._y[e],i=this.data._z[e],a=this.data._Ys.length,o=this.data._Zs.length,s=c(r,this.data._Xs).id,l=c(n,this.data._Ys).id,u=c(i,this.data._Zs).id,f=t.index=u+o*l+o*a*s;t.traceCoordinate=[this.data._x[f],this.data._y[f],this.data._z[f],this.data.value[f]];var h=this.data.hovertext||this.data.text;return Array.isArray(h)&&void 0!==h[f]?t.textLabel=h[f]:h&&(t.textLabel=h),!0}},h.update=function(t){var e=this.scene,r=e.fullSceneLayout;function n(t,e,r,n){return e.map(function(e){return t.d2l(e,0,n)*r})}this.data=p(t);var i=l(n(r.xaxis,t._x,e.dataScale[0],t.xcalendar),n(r.yaxis,t._y,e.dataScale[1],t.ycalendar),n(r.zaxis,t._z,e.dataScale[2],t.zcalendar)),u=l(t._i,t._j,t._k),c={positions:i,cells:u,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:o(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading},f=s(t);c.vertexIntensity=t._intensity,c.vertexIntensityBounds=[f.min,f.max],c.colormap=a(t),this.mesh.update(c)},h.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports={findNearestOnAxis:c,generateIsoMeshes:p,createIsosurfaceTrace:function(t,e){var r=t.glplot.gl,i=n({gl:r}),a=new f(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}},{"../../components/colorscale":592,"../../lib":703,"../../lib/gl_format_color":700,"../../lib/str2rgbarray":726,"../../plots/gl3d/zip3":802,"gl-mesh3d":279}],1015:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("../../components/colorscale/defaults");function s(t,e,r,n,a){var s=a("isomin"),l=a("isomax");null!=l&&null!=s&&s>l&&(e.isomin=null,e.isomax=null);var u=a("x"),c=a("y"),f=a("z"),h=a("value");if(u&&u.length&&c&&c.length&&f&&f.length&&h&&h.length){var p=i.getComponentMethod("calendars","handleTraceDefaults");p(t,e,["x","y","z"],n),["x","y","z"].forEach(function(t){var e="caps."+t,r=a(e+".show");r&&a(e+".fill");var n="slices."+t,i=a(n+".show");i&&(a(n+".fill"),a(n+".locations"))});var d=a("spaceframe.show");d&&a("spaceframe.fill");var v=a("surface.show");v&&(a("surface.count"),a("surface.fill"),a("surface.pattern"));var g=a("contour.show");g&&(a("contour.color"),a("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach(function(t){a(t)}),o(t,e,n,a,{prefix:"",cLetter:"c"}),e._length=null}else e.visible=!1}e.exports={supplyDefaults:function(t,e,r,i){s(t,e,0,i,function(r,i){return n.coerce(t,e,a,r,i)})},supplyIsoDefaults:s}},{"../../components/colorscale/defaults":590,"../../lib":703,"../../registry":831,"./attributes":1012}],1016:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,calc:t("./calc"),colorbar:{min:"cmin",max:"cmax"},plot:t("./convert").createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:t("../../plots/gl3d"),categories:["gl3d"],meta:{}}},{"../../plots/gl3d":791,"./attributes":1012,"./calc":1013,"./convert":1014,"./defaults":1015}],1017:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../components/fx/hovertemplate_attributes"),a=t("../surface/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:i({editType:"calc"}),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:a.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:s({},a.contours.x.show,{}),color:a.contours.x.color,width:a.contours.x.width,editType:"calc"},lightposition:{x:s({},a.lightposition.x,{dflt:1e5}),y:s({},a.lightposition.y,{dflt:1e5}),z:s({},a.lightposition.z,{dflt:0}),editType:"calc"},lighting:s({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},a.lighting),hoverinfo:s({},o.hoverinfo,{editType:"calc"})})},{"../../components/colorscale/attributes":587,"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../../plots/attributes":748,"../surface/attributes":1171}],1018:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.intensity&&n(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":588}],1019:[function(t,e,r){"use strict";var n=t("gl-mesh3d"),i=t("delaunay-triangulate"),a=t("alpha-shape"),o=t("convex-hull"),s=t("../../lib/gl_format_color").parseColorScale,l=t("../../lib/str2rgbarray"),u=t("../../components/colorscale").extractOpts,c=t("../../plots/gl3d/zip3");function f(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var h=f.prototype;function p(t){for(var e=[],r=t.length,n=0;n=e-.5)return!1;return!0}h.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return Array.isArray(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},h.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var n,f=t.x.length,h=c(d(r.xaxis,t.x,e.dataScale[0],t.xcalendar),d(r.yaxis,t.y,e.dataScale[1],t.ycalendar),d(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!g(t.i,f)||!g(t.j,f)||!g(t.k,f))return;n=c(v(t.i),v(t.j),v(t.k))}else n=0===t.alphahull?o(h):t.alphahull>0?a(t.alphahull,h):function(t,e){for(var r=["x","y","z"].indexOf(t),n=[],a=e.length,o=0;og):v=k>b,g=k;var A=l(b,_,w,k);A.pos=x,A.yc=(b+k)/2,A.i=y,A.dir=v?"increasing":"decreasing",A.x=A.pos,A.y=[w,_],p&&(A.tx=e.text[y]),d&&(A.htx=e.hovertext[y]),m.push(A)}else m.push({pos:x,empty:!0})}return e._extremes[s._id]=a.findExtremes(s,n.concat(f,c),{padded:!0}),m.length&&(m[0].t={labels:{open:i(t,"open:")+" ",high:i(t,"high:")+" ",low:i(t,"low:")+" ",close:i(t,"close:")+" "}}),m}e.exports={calc:function(t,e){var r=a.getFromId(t,e.xaxis),i=a.getFromId(t,e.yaxis),o=function(t,e,r){var i=r._minDiff;if(!i){var a,o=t._fullData,s=[];for(i=1/0,a=0;a"+c.labels[k]+n.hoverLabelText(s,A):((w=i.extendFlat({},h)).y0=w.y1=T,w.yLabelVal=A,w.yLabel=c.labels[k]+n.hoverLabelText(s,A),w.name="",f.push(w),b[A]=w)}return f}function f(t,e,r,i){var a=t.cd,o=t.ya,c=a[0].trace,f=a[0].t,h=u(t,e,r,i);if(!h)return[];var p=h.index,d=a[p],v=h.index=d.i,g=d.dir;function m(t){return f.labels[t]+n.hoverLabelText(o,c[t][v])}var y=d.hi||c.hoverinfo,x=y.split("+"),b="all"===y,_=b||-1!==x.indexOf("y"),w=b||-1!==x.indexOf("text"),k=_?[m("open"),m("high"),m("low"),m("close")+" "+l[g]]:[];return w&&s(d,c,k),h.extraText=k.join("
"),h.y0=h.y1=o.c2p(d.yc,!0),[h]}e.exports={hoverPoints:function(t,e,r,n){return t.cd[0].trace.hoverlabel.split?c(t,e,r,n):f(t,e,r,n)},hoverSplit:c,hoverOnPoints:f}},{"../../components/color":580,"../../components/fx":619,"../../lib":703,"../../plots/cartesian/axes":751}],1026:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"ohlc",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","showLegend"],meta:{},attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc").calc,plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover").hoverPoints,selectPoints:t("./select")}},{"../../plots/cartesian":762,"./attributes":1022,"./calc":1023,"./defaults":1024,"./hover":1025,"./plot":1028,"./select":1029,"./style":1030}],1027:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports=function(t,e,r,a){var o=r("x"),s=r("open"),l=r("high"),u=r("low"),c=r("close");r("hoverlabel.split");var f=n.getComponentMethod("calendars","handleTraceDefaults");if(f(t,e,["x"],a),s&&l&&u&&c){var h=Math.min(s.length,l.length,u.length,c.length);return o&&(h=Math.min(h,i.minRowLength(o))),e._length=h,h}}},{"../../lib":703,"../../registry":831}],1028:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib");e.exports=function(t,e,r,a){var o=e.xaxis,s=e.yaxis;i.makeTraceGroups(a,r,"trace ohlc").each(function(t){var r=n.select(this),a=t[0],l=a.t,u=a.trace;if(e.isRangePlot||(a.node3=r),!0!==u.visible||l.empty)r.remove();else{var c=l.tickLen,f=r.selectAll("path").data(i.identity);f.enter().append("path"),f.exit().remove(),f.attr("d",function(t){if(t.empty)return"M0,0Z";var e=o.c2p(t.pos,!0),r=o.c2p(t.pos-c,!0),n=o.c2p(t.pos+c,!0),i=s.c2p(t.o,!0),a=s.c2p(t.h,!0),l=s.c2p(t.l,!0),u=s.c2p(t.c,!0);return"M"+r+","+i+"H"+e+"M"+e+","+a+"V"+l+"M"+n+","+u+"H"+e})}})}},{"../../lib":703,d3:157}],1029:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[],s=n[0].t.bPos||0;if(!1===e)for(r=0;r=t.length)return!1;if(void 0!==e[t[r]])return!1;e[t[r]]=!0}return!0}(t.map(function(t){return t.displayindex})))for(e=0;e0;u&&(o="array");var c=r("categoryorder",o);"array"===c?(r("categoryarray"),r("ticktext")):(delete t.categoryarray,delete t.ticktext),u||"array"!==c||(e.categoryorder="trace")}}e.exports=function(t,e,r,f){function h(r,i){return n.coerce(t,e,l,r,i)}var p=s(t,e,{name:"dimensions",handleItemDefaults:c}),d=function(t,e,r,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(i(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,f,h);o(e,f,h),Array.isArray(p)&&p.length||(e.visible=!1),u(e,p,"values",d),h("hoveron"),h("hovertemplate"),h("arrangement"),h("bundlecolors"),h("sortpaths"),h("counts");var v={family:f.font.family,size:Math.round(f.font.size),color:f.font.color};n.coerceFont(h,"labelfont",v);var g={family:f.font.family,size:Math.round(f.font.size/1.2),color:f.font.color};n.coerceFont(h,"tickfont",g)}},{"../../components/colorscale/defaults":590,"../../components/colorscale/helpers":591,"../../lib":703,"../../plots/array_container_defaults":747,"../../plots/domain":776,"../parcoords/merge_length":1046,"./attributes":1031}],1035:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:t("./base_plot"),categories:["noOpacity"],meta:{}}},{"./attributes":1031,"./base_plot":1032,"./calc":1033,"./defaults":1034,"./plot":1037}],1036:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plot_api/plot_api"),a=t("../../components/fx"),o=t("../../lib"),s=t("../../components/drawing"),l=t("tinycolor2"),u=t("../../lib/svg_text_utils");function c(t,e,r,i){var a=t.map(function(t,e,r){var n,i=r[0],a=e.margin||{l:80,r:80,t:100,b:80},o=i.trace,s=o.domain,l=e.width,u=e.height,c=Math.floor(l*(s.x[1]-s.x[0])),f=Math.floor(u*(s.y[1]-s.y[0])),h=s.x[0]*l+a.l,p=e.height-s.y[1]*e.height+a.t,d=o.line.shape;n="all"===o.hoverinfo?["count","probability"]:(o.hoverinfo||"").split("+");var v={trace:o,key:o.uid,model:i,x:h,y:p,width:c,height:f,hoveron:o.hoveron,hoverinfoItems:n,arrangement:o.arrangement,bundlecolors:o.bundlecolors,sortpaths:o.sortpaths,labelfont:o.labelfont,categorylabelfont:o.tickfont,pathShape:d,dragDimension:null,margin:a,paths:[],dimensions:[],graphDiv:t,traceSelection:null,pathSelection:null,dimensionSelection:null};return i.dimensions&&(R(v),z(v)),v}.bind(0,e,r)),l=i.selectAll("g.parcatslayer").data([null]);l.enter().append("g").attr("class","parcatslayer").style("pointer-events","all");var c=l.selectAll("g.trace.parcats").data(a,f),g=c.enter().append("g").attr("class","trace parcats");c.attr("transform",function(t){return"translate("+t.x+", "+t.y+")"}),g.append("g").attr("class","paths");var x=c.select("g.paths"),w=x.selectAll("path.path").data(function(t){return t.paths},f);w.attr("fill",function(t){return t.model.color});var k=w.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(t){return t.model.color}).attr("fill-opacity",0);y(k),w.attr("d",function(t){return t.svgD}),k.empty()||w.sort(p),w.exit().remove(),w.on("mouseover",d).on("mouseout",v).on("click",m),g.append("g").attr("class","dimensions");var A=c.select("g.dimensions"),T=A.selectAll("g.dimension").data(function(t){return t.dimensions},f);T.enter().append("g").attr("class","dimension"),T.attr("transform",function(t){return"translate("+t.x+", 0)"}),T.exit().remove();var O=T.selectAll("g.category").data(function(t){return t.categories},f),I=O.enter().append("g").attr("class","category");O.attr("transform",function(t){return"translate(0, "+t.y+")"}),I.append("rect").attr("class","catrect").attr("pointer-events","none"),O.select("rect.catrect").attr("fill","none").attr("width",function(t){return t.width}).attr("height",function(t){return t.height}),b(I);var P=O.selectAll("rect.bandrect").data(function(t){return t.bands},f);P.each(function(){o.raiseToTop(this)}),P.attr("fill",function(t){return t.color});var D=P.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(t){return t.color}).attr("fill-opacity",0);P.attr("fill",function(t){return t.color}).attr("width",function(t){return t.width}).attr("height",function(t){return t.height}).attr("y",function(t){return t.y}).attr("cursor",function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"perpendicular"===t.parcatsViewModel.arrangement?"ns-resize":"move"}),_(D),P.exit().remove(),I.append("text").attr("class","catlabel").attr("pointer-events","none");var F=e._fullLayout.paper_bgcolor;O.select("text.catlabel").attr("text-anchor",function(t){return h(t)?"start":"end"}).attr("alignment-baseline","middle").style("text-shadow",F+" -1px 1px 2px, "+F+" 1px 1px 2px, "+F+" 1px -1px 2px, "+F+" -1px -1px 2px").style("fill","rgb(0, 0, 0)").attr("x",function(t){return h(t)?t.width+5:-5}).attr("y",function(t){return t.height/2}).text(function(t){return t.model.categoryLabel}).each(function(t){s.font(n.select(this),t.parcatsViewModel.categorylabelfont),u.convertToTspans(n.select(this),e)}),I.append("text").attr("class","dimlabel"),O.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"ew-resize"}).attr("x",function(t){return t.width/2}).attr("y",-5).text(function(t,e){return 0===e?t.parcatsViewModel.model.dimensions[t.model.dimensionInd].dimensionLabel:null}).each(function(t){s.font(n.select(this),t.parcatsViewModel.labelfont)}),O.selectAll("rect.bandrect").on("mouseover",M).on("mouseout",E),O.exit().remove(),T.call(n.behavior.drag().origin(function(t){return{x:t.x,y:0}}).on("dragstart",S).on("drag",C).on("dragend",L)),c.each(function(t){t.traceSelection=n.select(this),t.pathSelection=n.select(this).selectAll("g.paths").selectAll("path.path"),t.dimensionSelection=n.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),c.exit().remove()}function f(t){return t.key}function h(t){var e=t.parcatsViewModel.dimensions.length,r=t.parcatsViewModel.dimensions[e-1].model.dimensionInd;return t.model.dimensionInd===r}function p(t,e){return t.model.rawColor>e.model.rawColor?1:t.model.rawColor"),E=n.mouse(c)[0];a.loneHover({trace:f,x:y-p.left+d.left,y:b-p.top+d.top,text:M,color:t.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:_,idealAlign:E1&&u.displayInd===l.dimensions.length-1?(r=o.left,i="left"):(r=o.left+o.width,i="right");var h=s.model.count,p=s.model.categoryLabel,d=h/s.parcatsViewModel.model.count,v={countLabel:h,categoryLabel:p,probabilityLabel:d.toFixed(3)},g=[];-1!==s.parcatsViewModel.hoverinfoItems.indexOf("count")&&g.push(["Count:",v.countLabel].join(" ")),-1!==s.parcatsViewModel.hoverinfoItems.indexOf("probability")&&g.push(["P("+v.categoryLabel+"):",v.probabilityLabel].join(" "));var m=g.join("
");return{trace:c,x:r-t.left,y:f-t.top,text:m,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:i,hovertemplate:c.hovertemplate,hovertemplateLabels:v,eventData:[{data:c._input,fullData:c,count:h,category:p,probability:d}]}}function M(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){var e=n.mouse(this)[1];if(e<-1)return;var r,i=t.parcatsViewModel.graphDiv,s=i._fullLayout,u=s._paperdiv.node().getBoundingClientRect(),c=t.parcatsViewModel.hoveron;"color"===c?(function(t){var e=n.select(t).datum(),r=w(e);x(r),r.each(function(){o.raiseToTop(this)}),n.select(t.parentNode).selectAll("rect.bandrect").filter(function(t){return t.color===e.color}).each(function(){o.raiseToTop(this),n.select(this).attr("stroke","black").attr("stroke-width",1.5)})}(this),A(this,"plotly_hover",n.event)):(function(t){n.select(t.parentNode).selectAll("rect.bandrect").each(function(t){var e=w(t);x(e),e.each(function(){o.raiseToTop(this)})}),n.select(t.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(this),k(this,"plotly_hover",n.event)),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none")&&("category"===c?r=T(u,this):"color"===c?r=function(t,e){var r,i,a=e.getBoundingClientRect(),o=n.select(e).datum(),s=o.categoryViewModel,u=s.parcatsViewModel,c=u.model.dimensions[s.model.dimensionInd],f=u.trace,h=a.y+a.height/2;u.dimensions.length>1&&c.displayInd===u.dimensions.length-1?(r=a.left,i="left"):(r=a.left+a.width,i="right");var p=s.model.categoryLabel,d=o.parcatsViewModel.model.count,v=0;o.categoryViewModel.bands.forEach(function(t){t.color===o.color&&(v+=t.count)});var g=s.model.count,m=0;u.pathSelection.each(function(t){t.model.color===o.color&&(m+=t.model.count)});var y=v/d,x=v/m,b=v/g,_={countLabel:d,categoryLabel:p,probabilityLabel:y.toFixed(3)},w=[];-1!==s.parcatsViewModel.hoverinfoItems.indexOf("count")&&w.push(["Count:",_.countLabel].join(" ")),-1!==s.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(w.push("P(color ∩ "+p+"): "+_.probabilityLabel),w.push("P("+p+" | color): "+x.toFixed(3)),w.push("P(color | "+p+"): "+b.toFixed(3)));var k=w.join("
"),A=l.mostReadable(o.color,["black","white"]);return{trace:f,x:r-t.left,y:h-t.top,text:k,color:o.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:A,fontSize:10,idealAlign:i,hovertemplate:f.hovertemplate,hovertemplateLabels:_,eventData:[{data:f._input,fullData:f,category:p,count:d,probability:y,categorycount:g,colorcount:m,bandcolorcount:v}]}}(u,this):"dimension"===c&&(r=function(t,e){var r=[];return n.select(e.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){r.push(T(t,this))}),r}(u,this)),r&&a.loneHover(r,{container:s._hoverlayer.node(),outerContainer:s._paper.node(),gd:i}))}}function E(t){var e=t.parcatsViewModel;if(!e.dragDimension&&(y(e.pathSelection),b(e.dimensionSelection.selectAll("g.category")),_(e.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),a.loneUnhover(e.graphDiv._fullLayout._hoverlayer.node()),e.pathSelection.sort(p),-1===e.hoverinfoItems.indexOf("skip"))){var r=t.parcatsViewModel.hoveron;"color"===r?A(this,"plotly_unhover",n.event):k(this,"plotly_unhover",n.event)}}function S(t){"fixed"!==t.parcatsViewModel.arrangement&&(t.dragDimensionDisplayInd=t.model.displayInd,t.initialDragDimensionDisplayInds=t.parcatsViewModel.model.dimensions.map(function(t){return t.displayInd}),t.dragHasMoved=!1,t.dragCategoryDisplayInd=null,n.select(this).selectAll("g.category").select("rect.catrect").each(function(e){var r=n.mouse(this)[0],i=n.mouse(this)[1];-2<=r&&r<=e.width+2&&-2<=i&&i<=e.height+2&&(t.dragCategoryDisplayInd=e.model.displayInd,t.initialDragCategoryDisplayInds=t.model.categories.map(function(t){return t.displayInd}),e.model.dragY=e.y,o.raiseToTop(this.parentNode),n.select(this.parentNode).selectAll("rect.bandrect").each(function(e){e.yf.y+f.height/2&&(o.model.displayInd=f.model.displayInd,f.model.displayInd=l),t.dragCategoryDisplayInd=o.model.displayInd}if(null===t.dragCategoryDisplayInd||"freeform"===t.parcatsViewModel.arrangement){a.model.dragX=n.event.x;var h=t.parcatsViewModel.dimensions[r],p=t.parcatsViewModel.dimensions[i];void 0!==h&&a.model.dragXp.x&&(a.model.displayInd=p.model.displayInd,p.model.displayInd=t.dragDimensionDisplayInd),t.dragDimensionDisplayInd=a.model.displayInd}R(t.parcatsViewModel),z(t.parcatsViewModel),P(t.parcatsViewModel),I(t.parcatsViewModel)}}function L(t){if("fixed"!==t.parcatsViewModel.arrangement&&null!==t.dragDimensionDisplayInd){n.select(this).selectAll("text").attr("font-weight","normal");var e={},r=O(t.parcatsViewModel),a=t.parcatsViewModel.model.dimensions.map(function(t){return t.displayInd}),o=t.initialDragDimensionDisplayInds.some(function(t,e){return t!==a[e]});o&&a.forEach(function(r,n){var i=t.parcatsViewModel.model.dimensions[n].containerInd;e["dimensions["+i+"].displayindex"]=r});var s=!1;if(null!==t.dragCategoryDisplayInd){var l=t.model.categories.map(function(t){return t.displayInd});if(s=t.initialDragCategoryDisplayInds.some(function(t,e){return t!==l[e]})){var u=t.model.categories.slice().sort(function(t,e){return t.displayInd-e.displayInd}),c=u.map(function(t){return t.categoryValue}),f=u.map(function(t){return t.categoryLabel});e["dimensions["+t.model.containerInd+"].categoryarray"]=[c],e["dimensions["+t.model.containerInd+"].ticktext"]=[f],e["dimensions["+t.model.containerInd+"].categoryorder"]="array"}}if(-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!t.dragHasMoved&&t.potentialClickBand&&("color"===t.parcatsViewModel.hoveron?A(t.potentialClickBand,"plotly_click",n.event.sourceEvent):k(t.potentialClickBand,"plotly_click",n.event.sourceEvent)),t.model.dragX=null,null!==t.dragCategoryDisplayInd){var h=t.parcatsViewModel.dimensions[t.dragDimensionDisplayInd].categories[t.dragCategoryDisplayInd];h.model.dragY=null,t.dragCategoryDisplayInd=null}t.dragDimensionDisplayInd=null,t.parcatsViewModel.dragDimension=null,t.dragHasMoved=null,t.potentialClickBand=null,R(t.parcatsViewModel),z(t.parcatsViewModel);var p=n.transition().duration(300).ease("cubic-in-out");p.each(function(){P(t.parcatsViewModel,!0),I(t.parcatsViewModel,!0)}).each("end",function(){(o||s)&&i.restyle(t.parcatsViewModel.graphDiv,e,[r])})}}function O(t){for(var e,r=t.graphDiv._fullData,n=0;n=0;s--)c+="C"+u[s]+","+(e[s+1]+i)+" "+l[s]+","+(e[s]+i)+" "+(t[s]+r[s])+","+(e[s]+i),c+="l-"+r[s]+",0 ";return c+="Z"}function z(t){var e=t.dimensions,r=t.model,n=e.map(function(t){return t.categories.map(function(t){return t.y})}),i=t.model.dimensions.map(function(t){return t.categories.map(function(t){return t.displayInd})}),a=t.model.dimensions.map(function(t){return t.displayInd}),o=t.dimensions.map(function(t){return t.model.dimensionInd}),s=e.map(function(t){return t.x}),l=e.map(function(t){return t.width}),u=[];for(var c in r.paths)r.paths.hasOwnProperty(c)&&u.push(r.paths[c]);function f(t){var e=t.categoryInds.map(function(t,e){return i[e][t]}),r=o.map(function(t){return e[t]});return r}u.sort(function(e,r){var n=f(e),i=f(r);return"backward"===t.sortpaths&&(n.reverse(),i.reverse()),n.push(e.valueInds[0]),i.push(r.valueInds[0]),t.bundlecolors&&(n.unshift(e.rawColor),i.unshift(r.rawColor)),ni?1:0});for(var h=new Array(u.length),p=e[0].model.count,d=e[0].categories.map(function(t){return t.height}).reduce(function(t,e){return t+e}),v=0;v0?d*(m.count/p):0;for(var y,x=new Array(n.length),b=0;b1?(t.width-80-16)/(i-1):0,n=40+r*a;var o,s,l,u,c,f=[],h=t.model.maxCats,p=e.categories.length,d=e.count,v=t.height-8*(h-1),g=8*(h-p)/2,m=e.categories.map(function(t){return{displayInd:t.displayInd,categoryInd:t.categoryInd}});for(m.sort(function(t,e){return t.displayInd-e.displayInd}),c=0;c0?s.count/d*v:0,l={key:s.valueInds[0],model:s,width:16,height:o,y:null!==s.dragY?s.dragY:g,bands:[],parcatsViewModel:t},g=g+o+8,f.push(l);return{key:e.dimensionInd,x:null!==e.dragX?e.dragX:n,y:0,width:16,model:e,categories:f,parcatsViewModel:t,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}e.exports=function(t,e,r,n){c(r,t,n,e)}},{"../../components/drawing":601,"../../components/fx":619,"../../lib":703,"../../lib/svg_text_utils":727,"../../plot_api/plot_api":738,d3:157,tinycolor2:524}],1037:[function(t,e,r){"use strict";var n=t("./parcats");e.exports=function(t,e,r,i){var a=t._fullLayout,o=a._paper,s=a._size;n(t,o,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},r,i)}},{"./parcats":1036}],1038:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/layout_attributes"),a=t("../../plots/font_attributes"),o=t("../../plots/domain").attributes,s=t("../../lib/extend").extendFlat,l=t("../../plot_api/plot_template").templatedArray;e.exports={domain:o({name:"parcoords",trace:!0,editType:"calc"}),labelfont:a({editType:"calc"}),tickfont:a({editType:"calc"}),rangefont:a({editType:"calc"}),dimensions:l("dimension",{label:{valType:"string",editType:"calc"},tickvals:s({},i.tickvals,{editType:"calc"}),ticktext:s({},i.ticktext,{editType:"calc"}),tickformat:{valType:"string",dflt:"3s",editType:"calc"},visible:{valType:"boolean",dflt:!0,editType:"calc"},range:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},multiselect:{valType:"boolean",dflt:!0,editType:"calc"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:s({editType:"calc"},n("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"}))}},{"../../components/colorscale/attributes":587,"../../lib/extend":693,"../../plot_api/plot_template":741,"../../plots/cartesian/layout_attributes":763,"../../plots/domain":776,"../../plots/font_attributes":777}],1039:[function(t,e,r){"use strict";var n=t("./constants"),i=t("d3"),a=t("../../lib/gup").keyFun,o=t("../../lib/gup").repeat,s=t("../../lib").sorterAsc,l=n.bar.snapRatio;function u(t,e){return t*(1-l)+e*l}var c=n.bar.snapClose;function f(t,e){return t*(1-c)+e*c}function h(t,e,r,n){if(function(t,e){for(var r=0;r=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var i=t?-1:1,a=0,o=e.length-1;if(i<0){var s=a;a=o,o=s}for(var l=e[a],c=l,h=a;i*he){p=r;break}}if(o=f,isNaN(o)&&(o=isNaN(h)||isNaN(p)?isNaN(h)?p:h:e-c[h][1]t[1]+r||e=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(v,e);m&&(s.interval=u[o],s.intervalPix=v,s.region=m)}}if(t.ordinal&&!s.region){var y=t.unitTickvals,x=t.unitToPaddedPx.invert(e);for(r=0;r=b[0]&&x<=b[1]){s.clickableOrdinalRange=b;break}}}return s}function _(t){t.on("mousemove",function(t){if(i.event.preventDefault(),!t.parent.inBrushDrag){var e=t.height-i.mouse(this)[1]-2*n.verticalPadding,r=b(t,e),a="crosshair";r.clickableOrdinalRange?a="pointer":r.region&&(a=r.region+"-resize"),i.select(document.body).style("cursor",a)}}).on("mouseleave",function(t){t.parent.inBrushDrag||m()}).call(i.behavior.drag().on("dragstart",function(t){i.event.sourceEvent.stopPropagation();var e=t.height-i.mouse(this)[1]-2*n.verticalPadding,r=t.unitToPaddedPx.invert(e),a=t.brush,o=b(t,e),s=o.interval,l=a.svgBrush;if(l.wasDragged=!1,l.grabbingBar="ns"===o.region,l.grabbingBar){var u=s.map(t.unitToPaddedPx);l.grabPoint=e-u[0]-n.verticalPadding,l.barLength=u[1]-u[0]}l.clickableOrdinalRange=o.clickableOrdinalRange,l.stayingIntervals=t.multiselect&&a.filterSpecified?a.filter.getConsolidated():[],s&&(l.stayingIntervals=l.stayingIntervals.filter(function(t){return t[0]!==s[0]&&t[1]!==s[1]})),l.startExtent=o.region?s["s"===o.region?1:0]:r,t.parent.inBrushDrag=!0,l.brushStartCallback()}).on("drag",function(t){i.event.sourceEvent.stopPropagation();var e=t.height-i.mouse(this)[1]-2*n.verticalPadding,r=t.brush.svgBrush;r.wasDragged=!0,r.grabbingBar?r.newExtent=[e-r.grabPoint,e+r.barLength-r.grabPoint].map(t.unitToPaddedPx.invert):r.newExtent=[r.startExtent,t.unitToPaddedPx.invert(e)].sort(s);var a=Math.max(0,-r.newExtent[0]),o=Math.max(0,r.newExtent[1]-1);r.newExtent[0]+=a,r.newExtent[1]-=o,r.grabbingBar&&(r.newExtent[1]+=a,r.newExtent[0]-=o),t.brush.filterSpecified=!0,r.extent=r.stayingIntervals.concat([r.newExtent]),r.brushCallback(t),x(this.parentNode)}).on("dragend",function(t){var e=i.event;e.sourceEvent.stopPropagation();var r=t.brush,n=r.filter,a=r.svgBrush,o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,t.parent.inBrushDrag=!1,m(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&t.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&k(r)):k(r),a.brushCallback(t),x(this.parentNode),void a.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(t.ordinal){var l=t.unitTickvals;l[l.length-1]a.newExtent[0];a.extent=a.stayingIntervals.concat(u?[a.newExtent]:[]),a.extent.length||k(r),a.brushCallback(t),u?x(this.parentNode,s):(s(),x(this.parentNode))}else s();a.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}))}function w(t,e){return t[0]-e[0]}function k(t){t.filterSpecified=!1,t.svgBrush.extent=[[0,1]]}function A(t){for(var e,r=t.slice(),n=[],i=r.shift();i;){for(e=i.slice();(i=r.shift())&&i[0]<=e[1];)e[1]=Math.max(e[1],i[1]);n.push(e)}return n}e.exports={makeBrush:function(t,e,r,n,i,a){var o,l=function(){var t,e,r=[];return{set:function(n){r=n.map(function(t){return t.slice().sort(s)}).sort(w),t=A(r),e=r.reduce(function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]},[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return l.set(r),{filter:l,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=i,function(t){var e=t.brush,r=function(t){return t.svgBrush.extent.map(function(t){return t.slice()})}(e),n=r.slice();e.filter.set(n),o()}),brushEndCallback:a}}},ensureAxisBrush:function(t){var e=t.selectAll("."+n.cn.axisBrush).data(o,a);e.enter().append("g").classed(n.cn.axisBrush,!0),function(t){var e=t.selectAll(".background").data(o);e.enter().append("rect").classed("background",!0).call(p).call(d).style("pointer-events","auto").attr("transform","translate(0 "+n.verticalPadding+")"),e.call(_).attr("height",function(t){return t.height-n.verticalPadding});var r=t.selectAll(".highlight-shadow").data(o);r.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",n.bar.strokeColor).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),r.attr("y1",function(t){return t.height}).call(y);var i=t.selectAll(".highlight").data(o);i.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),i.attr("y1",function(t){return t.height}).call(y)}(e)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map(function(t){return t.sort(s)}),t=e.multiselect?A(t.sort(w)):[t[0]]):t=[t.sort(s)],e.tickvals){var r=e.tickvals.slice().sort(s);if(!(t=t.map(function(t){var e=[h(0,r,t[0],[]),h(1,r,t[1],[])];if(e[1]>e[0])return e}).filter(function(t){return t})).length)return}return t.length>1?t:t[0]}}},{"../../lib":703,"../../lib/gup":701,"./constants":1042,d3:157}],1040:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../constants/xmlns_namespaces");r.name="parcoords",r.plot=function(t){var e=i(t.calcdata,"parcoords")[0];e.length&&a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("parcoords"),a=e._has&&e._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container"),i=r.filter(function(t,e){return e===r.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");i.each(function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:o.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.width,height:this.height})}),window.setTimeout(function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}},{"../../constants/xmlns_namespaces":681,"../../plots/get_data":786,"./plot":1048,d3:157}],1041:[function(t,e,r){"use strict";var n=t("../../components/colorscale"),i=t("../../lib"),a=t("../../lib/gup").wrap;function o(t){return i.isTypedArray(t)?Array.prototype.slice.call(t):t}e.exports=function(t,e){for(var r=0;rc&&(n.log("parcoords traces support up to "+c+" dimensions at the moment"),d.splice(c));var v=s(t,e,{name:"dimensions",handleItemDefaults:h}),g=function(t,e,r,o,s){var l=s("line.color",r);if(i(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,u,p);o(e,u,p),Array.isArray(v)&&v.length||(e.visible=!1),f(e,v,"values",g);var m={family:u.font.family,size:Math.round(u.font.size/1.2),color:u.font.color};n.coerceFont(p,"labelfont",m),n.coerceFont(p,"tickfont",m),n.coerceFont(p,"rangefont",m)}},{"../../components/colorscale/defaults":590,"../../components/colorscale/helpers":591,"../../lib":703,"../../plots/array_container_defaults":747,"../../plots/domain":776,"./attributes":1038,"./axisbrush":1039,"./constants":1042,"./merge_length":1046}],1044:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:t("./base_plot"),categories:["gl","regl","noOpacity","noHover"],meta:{}}},{"./attributes":1038,"./base_plot":1040,"./calc":1041,"./defaults":1043,"./plot":1048}],1045:[function(t,e,r){"use strict";var n=t("glslify"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\nuniform sampler2D mask;\nuniform float maskHeight;\n\nuniform vec2 colorClamp;\n\nvarying vec4 fragColor;\n\nvec4 unit_1 = vec4(1, 1, 1, 1);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit_1, unit_1);\n}\n\nfloat axisY(\n float x,\n mat4 d[4],\n mat4 dim1A, mat4 dim2A, mat4 dim1B, mat4 dim2B, mat4 dim1C, mat4 dim2C, mat4 dim1D, mat4 dim2D\n ) {\n\n float y1 = val(d[0], dim1A) + val(d[1], dim1B) + val(d[2], dim1C) + val(d[3], dim1D);\n float y2 = val(d[0], dim2A) + val(d[1], dim2B) + val(d[2], dim2C) + val(d[3], dim2D);\n return y1 * (1.0 - x) + y2 * x;\n}\n\nconst int bitsPerByte = 8;\n\nint mod2(int a) {\n return a - 2 * (a / 2);\n}\n\nint mod8(int a) {\n return a - 8 * (a / 8);\n}\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit_0 = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nbool withinBoundingBox(\n mat4 d[4],\n mat4 loA, mat4 hiA, mat4 loB, mat4 hiB, mat4 loC, mat4 hiC, mat4 loD, mat4 hiD\n ) {\n\n return mshow(d[0], loA, hiA) &&\n mshow(d[1], loB, hiB) &&\n mshow(d[2], loC, hiC) &&\n mshow(d[3], loD, hiD);\n}\n\nbool withinRasterMask(mat4 d[4], sampler2D mask, float height) {\n bool result = true;\n int bitInByteStepper;\n float valY, valueY, scaleX;\n int hit, bitmask, valX;\n for(int i = 0; i < 4; i++) {\n for(int j = 0; j < 4; j++) {\n for(int k = 0; k < 4; k++) {\n bitInByteStepper = mod8(j * 4 + k);\n valX = i * 2 + j / 2;\n valY = d[i][j][k];\n valueY = valY * (height - 1.0) + 0.5;\n scaleX = (float(valX) + 0.5) / 8.0;\n hit = int(texture2D(mask, vec2(scaleX, (valueY + 0.5) / height))[3] * 255.0) / int(pow(2.0, float(bitInByteStepper)));\n result = result && mod2(hit) == 1;\n }\n }\n }\n return result;\n}\n\nvec4 position(\n float depth,\n vec2 resolution, vec2 viewBoxPosition, vec2 viewBoxSize,\n mat4 dims[4],\n float signum,\n mat4 dim1A, mat4 dim2A, mat4 dim1B, mat4 dim2B, mat4 dim1C, mat4 dim2C, mat4 dim1D, mat4 dim2D,\n mat4 loA, mat4 hiA, mat4 loB, mat4 hiB, mat4 loC, mat4 hiC, mat4 loD, mat4 hiD,\n sampler2D mask, float maskHeight\n ) {\n\n float x = 0.5 * signum + 0.5;\n float y = axisY(x, dims, dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D);\n\n float show = float(\n withinBoundingBox(dims, loA, hiA, loB, hiB, loC, hiC, loD, hiD)\n && withinRasterMask(dims, mask, maskHeight)\n );\n\n vec2 viewBoxXY = viewBoxPosition + viewBoxSize * vec2(x, y);\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n return vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n}\n\nvoid main() {\n\n float prominence = abs(pf[3]);\n\n mat4 p[4];\n p[0] = mat4(p0, p1, p2, p3);\n p[1] = mat4(p4, p5, p6, p7);\n p[2] = mat4(p8, p9, pa, pb);\n p[3] = mat4(pc, pd, pe, abs(pf));\n\n gl_Position = position(\n 1.0 - prominence,\n resolution, viewBoxPosition, viewBoxSize,\n p,\n sign(pf[3]),\n dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD,\n mask, maskHeight\n );\n\n float clampedColorIndex = clamp((prominence - colorClamp[0]) / (colorClamp[1] - colorClamp[0]), 0.0, 1.0);\n fragColor = texture2D(palette, vec2((clampedColorIndex * 255.0 + 0.5) / 256.0, 0.5));\n}\n"]),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nvarying vec4 fragColor;\n\nvec2 xyProjection = vec2(1, 1);\n\nvec4 unit = vec4(1, 1, 1, 1);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nfloat axisY(\n float x,\n mat4 d[4],\n mat4 dim1A, mat4 dim2A, mat4 dim1B, mat4 dim2B, mat4 dim1C, mat4 dim2C, mat4 dim1D, mat4 dim2D\n ) {\n\n float y1 = val(d[0], dim1A) + val(d[1], dim1B) + val(d[2], dim1C) + val(d[3], dim1D);\n float y2 = val(d[0], dim2A) + val(d[1], dim2B) + val(d[2], dim2C) + val(d[3], dim2D);\n return y1 * (1.0 - x) + y2 * x;\n}\n\nvec4 position(\n float depth,\n vec2 resolution, vec2 viewBoxPosition, vec2 viewBoxSize,\n mat4 dims[4],\n float signum,\n mat4 dim1A, mat4 dim2A, mat4 dim1B, mat4 dim2B, mat4 dim1C, mat4 dim2C, mat4 dim1D, mat4 dim2D\n ) {\n\n float x = 0.5 * signum + 0.5;\n float y = axisY(x, dims, dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D);\n\n vec2 viewBoxXY = viewBoxPosition + viewBoxSize * vec2(x, y);\n\n return vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depth,\n 1.0\n );\n}\n\nvoid main() {\n\n float prominence = abs(pf[3]);\n\n mat4 p[4];\n p[0] = mat4(p0, p1, p2, p3);\n p[1] = mat4(p4, p5, p6, p7);\n p[2] = mat4(p8, p9, pa, pb);\n p[3] = mat4(pc, pd, pe, abs(pf));\n\n gl_Position = position(\n 1.0 - prominence,\n resolution, viewBoxPosition, viewBoxSize,\n p,\n sign(pf[3]),\n dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D\n );\n\n float clampedColorIndex = clamp((prominence - colorClamp[0]) / (colorClamp[1] - colorClamp[0]), 0.0, 1.0);\n fragColor = texture2D(palette, vec2((clampedColorIndex * 255.0 + 0.5) / 256.0, 0.5));\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D mask;\nuniform float maskHeight;\n\nuniform vec2 colorClamp;\n\nvarying vec4 fragColor;\n\nvec4 unit_1 = vec4(1, 1, 1, 1);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit_1, unit_1);\n}\n\nfloat axisY(\n float x,\n mat4 d[4],\n mat4 dim1A, mat4 dim2A, mat4 dim1B, mat4 dim2B, mat4 dim1C, mat4 dim2C, mat4 dim1D, mat4 dim2D\n ) {\n\n float y1 = val(d[0], dim1A) + val(d[1], dim1B) + val(d[2], dim1C) + val(d[3], dim1D);\n float y2 = val(d[0], dim2A) + val(d[1], dim2B) + val(d[2], dim2C) + val(d[3], dim2D);\n return y1 * (1.0 - x) + y2 * x;\n}\n\nconst int bitsPerByte = 8;\n\nint mod2(int a) {\n return a - 2 * (a / 2);\n}\n\nint mod8(int a) {\n return a - 8 * (a / 8);\n}\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit_0 = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nbool withinBoundingBox(\n mat4 d[4],\n mat4 loA, mat4 hiA, mat4 loB, mat4 hiB, mat4 loC, mat4 hiC, mat4 loD, mat4 hiD\n ) {\n\n return mshow(d[0], loA, hiA) &&\n mshow(d[1], loB, hiB) &&\n mshow(d[2], loC, hiC) &&\n mshow(d[3], loD, hiD);\n}\n\nbool withinRasterMask(mat4 d[4], sampler2D mask, float height) {\n bool result = true;\n int bitInByteStepper;\n float valY, valueY, scaleX;\n int hit, bitmask, valX;\n for(int i = 0; i < 4; i++) {\n for(int j = 0; j < 4; j++) {\n for(int k = 0; k < 4; k++) {\n bitInByteStepper = mod8(j * 4 + k);\n valX = i * 2 + j / 2;\n valY = d[i][j][k];\n valueY = valY * (height - 1.0) + 0.5;\n scaleX = (float(valX) + 0.5) / 8.0;\n hit = int(texture2D(mask, vec2(scaleX, (valueY + 0.5) / height))[3] * 255.0) / int(pow(2.0, float(bitInByteStepper)));\n result = result && mod2(hit) == 1;\n }\n }\n }\n return result;\n}\n\nvec4 position(\n float depth,\n vec2 resolution, vec2 viewBoxPosition, vec2 viewBoxSize,\n mat4 dims[4],\n float signum,\n mat4 dim1A, mat4 dim2A, mat4 dim1B, mat4 dim2B, mat4 dim1C, mat4 dim2C, mat4 dim1D, mat4 dim2D,\n mat4 loA, mat4 hiA, mat4 loB, mat4 hiB, mat4 loC, mat4 hiC, mat4 loD, mat4 hiD,\n sampler2D mask, float maskHeight\n ) {\n\n float x = 0.5 * signum + 0.5;\n float y = axisY(x, dims, dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D);\n\n float show = float(\n withinBoundingBox(dims, loA, hiA, loB, hiB, loC, hiC, loD, hiD)\n && withinRasterMask(dims, mask, maskHeight)\n );\n\n vec2 viewBoxXY = viewBoxPosition + viewBoxSize * vec2(x, y);\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n return vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n}\n\nvoid main() {\n\n float prominence = abs(pf[3]);\n\n mat4 p[4];\n p[0] = mat4(p0, p1, p2, p3);\n p[1] = mat4(p4, p5, p6, p7);\n p[2] = mat4(p8, p9, pa, pb);\n p[3] = mat4(pc, pd, pe, abs(pf));\n\n gl_Position = position(\n 1.0 - prominence,\n resolution, viewBoxPosition, viewBoxSize,\n p,\n sign(pf[3]),\n dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD,\n mask, maskHeight\n );\n\n fragColor = vec4(pf.rgb, 1.0);\n}\n"]),s=n(["precision lowp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),l=t("../../lib"),u=1e-6,c=1e-7,f=2048,h=64,p=2,d=4,v=8,g=h/v,m=[119,119,119],y=new Uint8Array(4),x=new Uint8Array(4),b={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function _(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function w(t,e,r,n,i,a){var o=a.key;r.drawCompleted||(function(t){t.read({x:0,y:0,width:1,height:1,data:y})}(t),r.drawCompleted=!0),function s(l){var u;u=Math.min(n,i-l*n),a.offset=p*l*n,a.count=p*u,0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],_(t,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),r.clearOnly||(e(a),l*n+u>>8*e)%256/255}function A(t,e,r){var n,i,a,o=[];for(i=0;i=h-4?k(a,h-2-o):.5);var s;return i}(d,p,i);!function(t,e,r){for(var n=0;n<16;n++)t["p"+n.toString(16)](A(e,r,n))}(C,d,o),L=E.texture(l.extendFlat({data:function(t,e,r){for(var n=[],i=0;i<256;i++){var a=t(i/255);n.push((e?m:a).concat(r))}return n}(r.unitToColor,T,Math.round(255*(T?a:1)))},b))}var P=[0,1],D=[];function z(t,e,n,i,a,o,s,u,c,f,h){var p,d,v,g,m=[t,e],y=[0,1].map(function(){return[0,1,2,3].map(function(){return new Float32Array(16)})});for(p=0;p<2;p++)for(g=m[p],d=0;d<4;d++)for(v=0;v<16;v++)y[p][d][v]=v+16*d===g?1:0;var x=r.lines.canvasOverdrag,b=r.domain,_=r.canvasWidth,w=r.canvasHeight,k=l.extendFlat({key:s,resolution:[_,w],viewBoxPosition:[n+x,i],viewBoxSize:[a,o],i:t,ii:e,dim1A:y[0][0],dim1B:y[0][1],dim1C:y[0][2],dim1D:y[0][3],dim2A:y[1][0],dim2B:y[1][1],dim2C:y[1][2],dim2D:y[1][3],colorClamp:P,scissorX:(u===c?0:n+x)+(r.pad.l-x)+r.layoutWidth*b.x[0],scissorWidth:(u===f?_-n+x:a+.5)+(u===c?n+x:0),scissorY:i+r.pad.b+r.layoutHeight*b.y[0],scissorHeight:o,viewportX:r.pad.l-x+r.layoutWidth*b.x[0],viewportY:r.pad.b+r.layoutHeight*b.y[0],viewportWidth:_,viewportHeight:w},h);return k}return{setColorDomain:function(t){P[0]=t[0],P[1]=t[1]},render:function(t,e,n){var i,a,o,s=t.length,l=1/0,u=-1/0;for(i=0;iu&&(u=t[i].dim2.canvasX,o=i),t[i].dim1.canvasXi._length&&(T=T.slice(0,i._length));var M,E=i.tickvals;function S(t,e){return{val:t,text:M[e]}}function C(t,e){return t.val-e.val}if(Array.isArray(E)&&E.length){M=i.ticktext,Array.isArray(M)&&M.length?M.length>E.length?M=M.slice(0,E.length):E.length>M.length&&(E=E.slice(0,M.length)):M=E.map(n.format(i.tickformat));for(var L=1;L=r||s>=i)return;var u=t.lineLayer.readPixel(o,i-1-s),c=0!==u[3],f=c?u[2]+256*(u[1]+256*u[0]):null,h={x:o,y:s,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:f};f!==A&&(c?l.hover(h):l.unhover&&l.unhover(h),A=f)}}),k.style("opacity",function(t){return t.pick?.01:1}),e.style("background","rgba(255, 255, 255, 0)");var M=e.selectAll("."+h.cn.parcoords).data(w,u);M.exit().remove(),M.enter().append("g").classed(h.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),M.attr("transform",function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"});var E=M.selectAll("."+h.cn.parcoordsControlView).data(c,u);E.enter().append("g").classed(h.cn.parcoordsControlView,!0),E.attr("transform",function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"});var S=E.selectAll("."+h.cn.yAxis).data(function(t){return t.dimensions},u);function C(t,e){for(var r=e.panels||(e.panels=[]),n=t.data(),i=n.length-1,a=0;aline").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),O.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var I=L.selectAll("."+h.cn.axisHeading).data(c,u);I.enter().append("g").classed(h.cn.axisHeading,!0);var P=I.selectAll("."+h.cn.axisTitle).data(c,u);P.enter().append("text").classed(h.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),P.attr("transform","translate(0,"+-h.axisTitleOffset+")").text(function(t){return t.label}).each(function(t){o.font(n.select(this),t.model.labelFont)});var D=L.selectAll("."+h.cn.axisExtent).data(c,u);D.enter().append("g").classed(h.cn.axisExtent,!0);var z=D.selectAll("."+h.cn.axisExtentTop).data(c,u);z.enter().append("g").classed(h.cn.axisExtentTop,!0),z.attr("transform","translate(0,"+-h.axisExtentOffset+")");var R=z.selectAll("."+h.cn.axisExtentTopText).data(c,u);function F(t,e){if(t.ordinal)return"";var r=t.domainScale.domain();return n.format(t.tickFormat)(r[e?r.length-1:0])}R.enter().append("text").classed(h.cn.axisExtentTopText,!0).call(_),R.text(function(t){return F(t,!0)}).each(function(t){o.font(n.select(this),t.model.rangeFont)});var B=D.selectAll("."+h.cn.axisExtentBottom).data(c,u);B.enter().append("g").classed(h.cn.axisExtentBottom,!0),B.attr("transform",function(t){return"translate(0,"+(t.model.height+h.axisExtentOffset)+")"});var N=B.selectAll("."+h.cn.axisExtentBottomText).data(c,u);N.enter().append("text").classed(h.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(_),N.text(function(t){return F(t)}).each(function(t){o.font(n.select(this),t.model.rangeFont)}),p.ensureAxisBrush(L)}},{"../../components/colorscale":592,"../../components/drawing":601,"../../lib":703,"../../lib/gup":701,"./axisbrush":1039,"./constants":1042,"./lines":1045,"color-rgba":115,d3:157}],1048:[function(t,e,r){"use strict";var n=t("./parcoords"),i=t("../../lib/prepare_regl");e.exports=function(t,e){var r=t._fullLayout,a=r._toppaper,o=r._paperdiv,s=r._glcontainer,l=i(t);if(l){var u={},c={},f={},h={},p=r._size;e.forEach(function(e,r){var n=e[0].trace;f[r]=n.index;var i=h[r]=n._fullInput.index;u[r]=t.data[i].dimensions,c[r]=t.data[i].dimensions.slice()}),n(o,a,s,e,{width:p.w,height:p.h,margin:{t:p.t,r:p.r,b:p.b,l:p.l}},{filterChanged:function(e,n,i){var a=c[e][n],o=i.map(function(t){return t.slice()}),s="dimensions["+n+"].constraintrange",l=r._tracePreGUI[t._fullData[f[e]]._fullInput.uid];if(void 0===l[s]){var u=a.constraintrange;l[s]=u||null}var p=t._fullData[f[e]].dimensions[n];o.length?(1===o.length&&(o=o[0]),a.constraintrange=o,p.constraintrange=o.slice(),o=[o]):(delete a.constraintrange,delete p.constraintrange,o=null);var d={};d[s]=o,t.emit("plotly_restyle",[d,[h[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){function n(t){return!("visible"in t)||t.visible}function i(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}var a=function(t){return function(e,n){var a=i(r,t,e),o=i(r,t,n);return a-o}}(c[e].filter(n));u[e].sort(a),c[e].filter(function(t){return!n(t)}).sort(function(t){return c[e].indexOf(t)}).forEach(function(t){u[e].splice(u[e].indexOf(t),1),u[e].splice(c[e].indexOf(t),0,t)}),t.emit("plotly_restyle",[{dimensions:[u[e]]},[h[e]]])}})}}},{"../../lib/prepare_regl":716,"./parcoords":1047}],1049:[function(t,e,r){"use strict";var n=t("../../plots/attributes"),i=t("../../plots/domain").attributes,a=t("../../plots/font_attributes"),o=t("../../components/color/attributes"),s=t("../../components/fx/hovertemplate_attributes"),l=t("../../lib/extend").extendFlat,u=a({editType:"plot",arrayOk:!0,colorEditType:"plot"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:o.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:l({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:s({},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:l({},u,{}),insidetextfont:l({},u,{}),outsidetextfont:l({},u,{}),title:{text:{valType:"string",dflt:"",editType:"plot"},font:l({},u,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:i({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"},_deprecated:{title:{valType:"string",dflt:"",editType:"calc"},titlefont:l({},u,{}),titleposition:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc"}}}},{"../../components/color/attributes":579,"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../../plots/attributes":748,"../../plots/domain":776,"../../plots/font_attributes":777}],1050:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/get_data").getModuleCalcData;r.name="pie",r.plot=function(t){var e=n.getModule("pie"),r=i(t.calcdata,e)[0];e.plot(t,r)},r.clean=function(t,e,r,n){var i=n._has&&n._has("pie"),a=e._has&&e._has("pie");i&&!a&&n._pielayer.selectAll("g.trace").remove()}},{"../../plots/get_data":786,"../../registry":831}],1051:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib").isArrayOrTypedArray,a=t("tinycolor2"),o=t("../../components/color"),s=t("./helpers"),l=t("../../lib").isValidTextValue,u={};function c(t){return function(e,r){return!!e&&!!(e=a(e)).isValid()&&(e=o.addOpacity(e,e.getAlpha()),t[r]||(t[r]=e),e)}}function f(t,e){var r,n=JSON.stringify(t),i=e[n];if(!i){for(i=t.slice(),r=0;r")}}return o},crossTraceCalc:function(t,e){var r=(e||{}).type;r||(r="pie");var n=t._fullLayout,i=t.calcdata,a=n[r+"colorway"],o=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(a=f(a,u));for(var s=0,l=0;l"),name:h.hovertemplate||-1!==p.indexOf("name")?h.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:u.castOption(b.bgcolor,t.pts)||t.color,borderColor:u.castOption(b.bordercolor,t.pts),fontFamily:u.castOption(_.family,t.pts),fontSize:u.castOption(_.size,t.pts),fontColor:u.castOption(_.color,t.pts),nameLength:u.castOption(b.namelength,t.pts),textAlign:u.castOption(b.align,t.pts),hovertemplate:u.castOption(h.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[c(t,h)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e}),o._hasHoverLabel=!0}o._hasHoverEvent=!0,e.emit("plotly_hover",{points:[c(t,h)],event:n.event})}}),t.on("mouseout",function(t){var r=e._fullLayout,a=e._fullData[o.index],s=n.select(this).datum();o._hasHoverEvent&&(t.originalEvent=n.event,e.emit("plotly_unhover",{points:[c(s,a)],event:n.event}),o._hasHoverEvent=!1),o._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),o._hasHoverLabel=!1)}),t.on("click",function(t){var r=e._fullLayout,a=e._fullData[o.index];e._dragging||!1===r.hovermode||(e._hoverdata=[c(t,a)],i.click(e,n.event))})}function h(t,e,r){var n=u.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=u.castOption(t._input.textfont.color,e.pts));var i=u.castOption(t.insidetextfont.family,e.pts)||u.castOption(t.textfont.family,e.pts)||r.family,o=u.castOption(t.insidetextfont.size,e.pts)||u.castOption(t.textfont.size,e.pts)||r.size;return{color:n||a.contrast(e.color),family:i,size:o}}function p(t,e){for(var r,n,i=0;i=1)return u;var c=i+1/(2*Math.tan(a)),f=l*Math.min(1/(Math.sqrt(c*c+.5)+c),o/(Math.sqrt(i*i+o/2)+i)),h={scale:2*f/t.height,rCenter:Math.cos(f/l)-f*i/l,rotate:(180/Math.PI*e.midangle+720)%180-90},p=1/i,d=p+1/(2*Math.tan(a)),v=l*Math.min(1/(Math.sqrt(d*d+.5)+d),o/(Math.sqrt(p*p+o/2)+p)),g={scale:2*v/t.width,rCenter:Math.cos(v/l)-v/i/l,rotate:(180/Math.PI*e.midangle+810)%180-90},m=g.scale>h.scale?g:h;return u.scale<1&&m.scale>u.scale?m:u}function v(t,e){return t.v!==e.vTotal||e.trace.hole?Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2):1}function g(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,a=t.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function m(t,e){var r,n=1,i=1,a=t.trace,o={x:t.cx,y:t.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,r=x(a),-1!==a.title.position.indexOf("top")?(o.y-=(1+r)*t.r,s.ty-=t.titleBox.height):-1!==a.title.position.indexOf("bottom")&&(o.y+=(1+r)*t.r);var l,u,c=(l=t.r,u=t.trace.aspectratio,l/(void 0===u?1:u)),f=e.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(f+=c,o.x-=(1+r)*c,s.tx+=t.titleBox.width/2):-1!==a.title.position.indexOf("center")?f*=2:-1!==a.title.position.indexOf("right")&&(f+=c,o.x+=(1+r)*c,s.tx-=t.titleBox.width/2),n=f/t.titleBox.width,i=y(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(n,i),tx:s.tx,ty:s.ty}}function y(t,e){var r=t.trace,n=e.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(t.titleBox.height,n/2)}function x(t){var e,r=t.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,e=0;er&&(r=t.pull[e]);return r}function b(t,e){for(var r=[],n=0;n1?(u=r.r,c=u/i.aspectratio):(c=r.r,u=c*i.aspectratio),u*=(1+i.baseratio)/2,l=u*c}o=Math.min(o,l/r.vTotal)}for(n=0;ni.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/i.vTotal,.5),r.ring=1-a.hole,r.rInscribed=v(r,i))}(e),i.attr("stroke-linejoin","round"),i.each(function(){var i=n.select(this).selectAll("g.slice").data(e);i.enter().append("g").classed("slice",!0),i.exit().remove();var v=[[[],[]],[[],[]]],y=!1;i.each(function(r){if(r.hidden)n.select(this).selectAll("path,g").remove();else{r.pointNumber=r.i,r.curveNumber=p.index,v[r.pxmid[1]<0?0:1][r.pxmid[0]<0?0:1].push(r);var i=c.cx,a=c.cy,m=n.select(this),x=m.selectAll("path.surface").data([r]);if(x.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),m.call(f,t,e),p.pull){var b=+u.castOption(p.pull,r.pts)||0;b>0&&(i+=b*r.pxmid[0],a+=b*r.pxmid[1])}r.cxFinal=i,r.cyFinal=a;var _=p.hole;if(r.v===c.vTotal){var w="M"+(i+r.px0[0])+","+(a+r.px0[1])+E(r.px0,r.pxmid,!0,1)+E(r.pxmid,r.px0,!0,1)+"Z";_?x.attr("d","M"+(i+_*r.px0[0])+","+(a+_*r.px0[1])+E(r.px0,r.pxmid,!1,_)+E(r.pxmid,r.px0,!1,_)+"Z"+w):x.attr("d",w)}else{var k=E(r.px0,r.px1,!0,1);if(_){var A=1-_;x.attr("d","M"+(i+_*r.px1[0])+","+(a+_*r.px1[1])+E(r.px1,r.px0,!1,_)+"l"+A*r.px0[0]+","+A*r.px0[1]+k+"Z")}else x.attr("d","M"+i+","+a+"l"+r.px0[0]+","+r.px0[1]+k+"Z")}var T=u.castOption(p.textposition,r.pts),M=m.selectAll("g.slicetext").data(r.text&&"none"!==T?[0]:[]);M.enter().append("g").classed("slicetext",!0),M.exit().remove(),M.each(function(){var e=s.ensureSingle(n.select(this),"text","",function(t){t.attr("data-notex",1)});e.text(r.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(o.font,"outside"===T?function(t,e,r){var n=u.castOption(t.outsidetextfont.color,e.pts)||u.castOption(t.textfont.color,e.pts)||r.color,i=u.castOption(t.outsidetextfont.family,e.pts)||u.castOption(t.textfont.family,e.pts)||r.family,a=u.castOption(t.outsidetextfont.size,e.pts)||u.castOption(t.textfont.size,e.pts)||r.size;return{color:n,family:i,size:a}}(p,r,t._fullLayout.font):h(p,r,t._fullLayout.font)).call(l.convertToTspans,t);var f,v=o.bBox(e.node());"outside"===T?f=g(v,r):(f=d(v,r,c),"auto"===T&&f.scale<1&&(e.call(o.font,p.outsidetextfont),p.outsidetextfont.family===p.insidetextfont.family&&p.outsidetextfont.size===p.insidetextfont.size||(v=o.bBox(e.node())),f=g(v,r)));var m=i+r.pxmid[0]*f.rCenter+(f.x||0),x=a+r.pxmid[1]*f.rCenter+(f.y||0);f.outside&&(r.yLabelMin=x-v.height/2,r.yLabelMid=x,r.yLabelMax=x+v.height/2,r.labelExtraX=0,r.labelExtraY=0,y=!0),e.attr("transform","translate("+m+","+x+")"+(f.scale<1?"scale("+f.scale+")":"")+(f.rotate?"rotate("+f.rotate+")":"")+"translate("+-(v.left+v.right)/2+","+-(v.top+v.bottom)/2+")")})}function E(t,e,n,i){var a=i*(e[0]-t[0]),o=i*(e[1]-t[1]);return"a"+i*c.r+","+i*c.r+" 0 "+r.largeArc+(n?" 1 ":" 0 ")+a+","+o}});var x=n.select(this).selectAll("g.titletext").data(p.title.text?[0]:[]);x.enter().append("g").classed("titletext",!0),x.exit().remove(),x.each(function(){var e,i=s.ensureSingle(n.select(this),"text","",function(t){t.attr("data-notex",1)}),a=p.title.text;p._meta&&(a=s.templateString(a,p._meta)),i.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(o.font,p.title.font).call(l.convertToTspans,t),e="middle center"===p.title.position?function(t){var e=Math.sqrt(t.titleBox.width*t.titleBox.width+t.titleBox.height*t.titleBox.height);return{x:t.cx,y:t.cy,scale:t.trace.hole*t.r*2/e,tx:0,ty:-t.titleBox.height/2+t.trace.title.font.size}}(c):m(c,r._size),i.attr("transform","translate("+e.x+","+e.y+")"+(e.scale<1?"scale("+e.scale+")":"")+"translate("+e.tx+","+e.ty+")")}),y&&function(t,e){var r,n,i,a,o,s,l,c,f,h,p,d,v;function g(t,e){return t.pxmid[1]-e.pxmid[1]}function m(t,e){return e.pxmid[1]-t.pxmid[1]}function y(t,r){r||(r={});var i,c,f,p,d,v,g=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),m=n?t.yLabelMin:t.yLabelMax,y=n?t.yLabelMax:t.yLabelMin,x=t.cyFinal+o(t.px0[1],t.px1[1]),b=g-m;if(b*l>0&&(t.labelExtraY=b),Array.isArray(e.pull))for(c=0;c=(u.castOption(e.pull,f.pts)||0)||((t.pxmid[1]-f.pxmid[1])*l>0?(p=f.cyFinal+o(f.px0[1],f.px1[1]),(b=p-m-t.labelExtraY)*l>0&&(t.labelExtraY+=b)):(y+t.labelExtraY-x)*l>0&&(i=3*s*Math.abs(c-h.indexOf(t)),d=f.cxFinal+a(f.px0[0],f.px1[0]),(v=d+i-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*s>0&&(t.labelExtraX+=v)))}for(n=0;n<2;n++)for(i=n?g:m,o=n?Math.max:Math.min,l=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,s=r?1:-1,(c=t[n][r]).sort(i),f=t[1-n][r],h=f.concat(c),d=[],p=0;pMath.abs(h)?u+="l"+h*t.pxmid[0]/t.pxmid[1]+","+h+"H"+(o+t.labelExtraX+c):u+="l"+t.labelExtraX+","+f+"v"+(h-f)+"h"+c}else u+="V"+(t.yLabelMid+t.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(a.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:u,fill:"none"})}else r.select("path.textline").remove()})}(i,p)})});setTimeout(function(){i.selectAll("tspan").each(function(){var t=n.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)},transformInsideText:d,determineInsideTextFont:h,positionTitleOutside:m,prerenderTitles:p,layoutAreas:b,attachFxHandlers:f}},{"../../components/color":580,"../../components/drawing":601,"../../components/fx":619,"../../lib":703,"../../lib/svg_text_utils":727,"./event_data":1053,"./helpers":1054,d3:157}],1059:[function(t,e,r){"use strict";var n=t("d3"),i=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0],r=e.trace,a=n.select(this);a.style({opacity:r.opacity}),a.selectAll("path.surface").each(function(t){n.select(this).call(i,t,r)})})}},{"./style_one":1060,d3:157}],1060:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./helpers").castOption;e.exports=function(t,e,r){var a=r.marker.line,o=i(a.color,e.pts)||n.defaultLine,s=i(a.width,e.pts)||0;t.style("stroke-width",s).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":580,"./helpers":1054}],1061:[function(t,e,r){"use strict";var n=t("../scatter/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"},transforms:void 0}},{"../scatter/attributes":1075}],1062:[function(t,e,r){"use strict";var n=t("gl-pointcloud2d"),i=t("../../lib/str2rgbarray"),a=t("../../plots/cartesian/autorange").findExtremes,o=t("../scatter/get_trace_color");function s(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=n(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var l=s.prototype;l.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},l.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=o(t,{})},l.updateFast=function(t){var e,r,n,o,s,l,u=this.xData=this.pickXData=t.x,c=this.yData=this.pickYData=t.y,f=this.pickXYData=t.xy,h=t.xbounds&&t.ybounds,p=t.indices,d=this.bounds;if(f){if(n=f,e=f.length>>>1,h)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(l=0;ld[2]&&(d[2]=o),sd[3]&&(d[3]=s);if(p)r=p;else for(r=new Int32Array(e),l=0;ld[2]&&(d[2]=o),sd[3]&&(d[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var v=i(t.marker.color),g=i(t.marker.border.color),m=t.opacity*t.marker.opacity;v[3]*=m,this.pointcloudOptions.color=v;var y=t.marker.blend;null===y&&(y=u.length<100||c.length<100),this.pointcloudOptions.blend=y,g[3]*=m,this.pointcloudOptions.borderColor=g;var x=t.marker.sizemin,b=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=x,this.pointcloudOptions.sizeMax=b,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var _=this.scene.xaxis,w=this.scene.yaxis,k=b/2||.5;t._extremes[_._id]=a(_,[d[0],d[2]],{ppad:k}),t._extremes[w._id]=a(w,[d[1],d[3]],{ppad:k})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new s(t,e.uid);return r.update(e),r}},{"../../lib/str2rgbarray":726,"../../plots/cartesian/autorange":750,"../scatter/get_trace_color":1084,"gl-pointcloud2d":291}],1063:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio"),e._length=null}},{"../../lib":703,"./attributes":1061}],1064:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("../scatter3d/calc"),plot:t("./convert"),moduleType:"trace",name:"pointcloud",basePlotModule:t("../../plots/gl2d"),categories:["gl","gl2d","showLegend"],meta:{}}},{"../../plots/gl2d":789,"../scatter3d/calc":1102,"./attributes":1061,"./convert":1062,"./defaults":1063}],1065:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/attributes"),a=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../plots/domain").attributes,l=t("../../components/fx/hovertemplate_attributes"),u=t("../../components/colorscale/attributes"),c=t("../../plot_api/plot_template").templatedArray,f=t("../../lib/extend").extendFlat,h=t("../../plot_api/edit_types").overrideAll,p=e.exports=h({hoverinfo:f({},i.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s"},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]})},link:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]}),colorscales:c("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:f(u().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested");p.transforms=void 0},{"../../components/color/attributes":579,"../../components/colorscale/attributes":587,"../../components/fx/attributes":610,"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../../plot_api/edit_types":734,"../../plot_api/plot_template":741,"../../plots/attributes":748,"../../plots/domain":776,"../../plots/font_attributes":777}],1066:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../components/fx/layout_attributes"),s=t("../../lib/setcursor"),l=t("../../components/dragelement"),u=t("../../plots/cartesian/select").prepSelect,c=t("../../lib"),f=t("../../registry");function h(t,e){var r=t._fullData[e],n=t._fullLayout,i=n.dragmode,a="pan"===n.dragmode?"move":"crosshair",o=r._bgRect;if("pan"!==i&&"zoom"!==i){s(o,a);var h={_id:"x",c2p:c.identity,_offset:r._sankey.translateX,_length:r._sankey.width},p={_id:"y",c2p:c.identity,_offset:r._sankey.translateY,_length:r._sankey.height},d={gd:t,element:o.node(),plotinfo:{id:e,xaxis:h,yaxis:p,fillRangeItems:c.noop},subplot:e,xaxes:[h],yaxes:[p],doneFnCompleted:function(r){var n,i=t._fullData[e],a=i.node.groups.slice(),o=[];function s(t){for(var e=i._sankey.graph.nodes,r=0;rm&&(m=a.source[e]),a.target[e]>m&&(m=a.target[e]);var y,x=m+1;t.node._count=x;var b=t.node.groups,_={};for(e=0;e0&&s(E,x)&&s(S,x)&&(!_.hasOwnProperty(E)||!_.hasOwnProperty(S)||_[E]!==_[S])){_.hasOwnProperty(S)&&(S=_[S]),_.hasOwnProperty(E)&&(E=_[E]),S=+S,f[E=+E]=f[S]=!0;var C="";a.label&&a.label[e]&&(C=a.label[e]);var L=null;C&&h.hasOwnProperty(C)&&(L=h[C]),u.push({pointNumber:e,label:C,color:c?a.color[e]:a.color,concentrationscale:L,source:E,target:S,value:+M}),T.source.push(E),T.target.push(S)}}var O=x+b.length,I=o(r.color),P=[];for(e=0;ex-1,childrenNodes:[],pointNumber:e,label:D,color:I?r.color[e]:r.color})}var z=!1;return function(t,e,r){for(var a=i.init2dArray(t,0),o=0;o1})}(O,T.source,T.target)&&(z=!0),{circular:z,links:u,nodes:P,groups:b,groupLookup:_}}e.exports=function(t,e){var r=u(e);return a({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}},{"../../components/colorscale":592,"../../lib":703,"../../lib/gup":701,"strongly-connected-components":517}],1068:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeCapture:"node-capture",nodeCentered:"node-entered",nodeLabelGuide:"node-label-guide",nodeLabel:"node-label",nodeLabelTextPath:"node-label-text-path"}}},{}],1069:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color"),o=t("tinycolor2"),s=t("../../plots/domain").defaults,l=t("../../components/fx/hoverlabel_defaults"),u=t("../../plot_api/plot_template"),c=t("../../plots/array_container_defaults");function f(t,e){function r(r,a){return n.coerce(t,e,i.link.colorscales,r,a)}r("label"),r("cmin"),r("cmax"),r("colorscale")}e.exports=function(t,e,r,h){function p(r,a){return n.coerce(t,e,i,r,a)}var d=n.extendDeep(h.hoverlabel,t.hoverlabel),v=t.node,g=u.newContainer(e,"node");function m(t,e){return n.coerce(v,g,i.node,t,e)}m("label"),m("groups"),m("x"),m("y"),m("pad"),m("thickness"),m("line.color"),m("line.width"),m("hoverinfo",t.hoverinfo),l(v,g,m,d),m("hovertemplate");var y=h.colorway;m("color",g.label.map(function(t,e){return a.addOpacity(function(t){return y[t%y.length]}(e),.8)}));var x=t.link||{},b=u.newContainer(e,"link");function _(t,e){return n.coerce(x,b,i.link,t,e)}_("label"),_("source"),_("target"),_("value"),_("line.color"),_("line.width"),_("hoverinfo",t.hoverinfo),l(x,b,_,d),_("hovertemplate");var w,k=o(h.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)";_("color",n.repeat(k,b.value.length)),c(x,b,{name:"colorscales",handleItemDefaults:f}),s(e,h,p),p("orientation"),p("valueformat"),p("valuesuffix"),g.x.length&&g.y.length&&(w="freeform"),p("arrangement",w),n.coerceFont(p,"textfont",n.extendFlat({},h.font)),e._length=null}},{"../../components/color":580,"../../components/fx/hoverlabel_defaults":617,"../../lib":703,"../../plot_api/plot_template":741,"../../plots/array_container_defaults":747,"../../plots/domain":776,"./attributes":1065,tinycolor2:524}],1070:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),moduleType:"trace",name:"sankey",basePlotModule:t("./base_plot"),selectPoints:t("./select.js"),categories:["noOpacity"],meta:{}}},{"./attributes":1065,"./base_plot":1066,"./calc":1067,"./defaults":1069,"./plot":1071,"./select.js":1073}],1071:[function(t,e,r){"use strict";var n=t("d3"),i=t("./render"),a=t("../../components/fx"),o=t("../../components/color"),s=t("../../lib"),l=t("./constants").cn,u=s._;function c(t){return""!==t}function f(t,e){return t.filter(function(t){return t.key===e.traceId})}function h(t,e){n.select(t).select("path").style("fill-opacity",e),n.select(t).select("rect").style("fill-opacity",e)}function p(t){n.select(t).select("text.name").style("fill","black")}function d(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function v(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function g(t,e,r){e&&r&&f(r,e).selectAll("."+l.sankeyLink).filter(d(e)).call(y.bind(0,e,r,!1))}function m(t,e,r){e&&r&&f(r,e).selectAll("."+l.sankeyLink).filter(d(e)).call(x.bind(0,e,r,!1))}function y(t,e,r,n){var i=n.datum().link.label;n.style("fill-opacity",function(t){if(!t.link.concentrationscale)return.4}),i&&f(e,t).selectAll("."+l.sankeyLink).filter(function(t){return t.link.label===i}).style("fill-opacity",function(t){if(!t.link.concentrationscale)return.4}),r&&f(e,t).selectAll("."+l.sankeyNode).filter(v(t)).call(g)}function x(t,e,r,n){var i=n.datum().link.label;n.style("fill-opacity",function(t){return t.tinyColorAlpha}),i&&f(e,t).selectAll("."+l.sankeyLink).filter(function(t){return t.link.label===i}).style("fill-opacity",function(t){return t.tinyColorAlpha}),r&&f(e,t).selectAll(l.sankeyNode).filter(v(t)).call(m)}function b(t,e){var r=t.hoverlabel||{},n=s.nestedProperty(r,e).get();return!Array.isArray(n)&&n}e.exports=function(t,e){for(var r=t._fullLayout,s=r._paper,f=r._size,d=0;d"),color:b(s,"bgcolor")||o.addOpacity(d.color,1),borderColor:b(s,"bordercolor"),fontFamily:b(s,"font.family"),fontSize:b(s,"font.size"),fontColor:b(s,"font.color"),nameLength:b(s,"namelength"),textAlign:b(s,"align"),idealAlign:n.event.x"),color:b(o,"bgcolor")||i.tinyColorHue,borderColor:b(o,"bordercolor"),fontFamily:b(o,"font.family"),fontSize:b(o,"font.size"),fontColor:b(o,"font.color"),nameLength:b(o,"namelength"),textAlign:b(o,"align"),idealAlign:"left",hovertemplate:o.hovertemplate,hovertemplateLabels:m,eventData:[i.node]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});h(y,.85),p(y)}}},unhover:function(e,i,o){!1!==t._fullLayout.hovermode&&(n.select(e).call(m,i,o),"skip"!==i.node.trace.node.hoverinfo&&(i.node.fullData=i.node.trace,t.emit("plotly_unhover",{event:n.event,points:[i.node]})),a.loneUnhover(r._hoverlayer.node()))},select:function(e,r,i){var o=r.node;o.originalEvent=n.event,t._hoverdata=[o],n.select(e).call(m,r,i),a.click(t,{target:!0})}}})}},{"../../components/color":580,"../../components/fx":619,"../../lib":703,"./constants":1068,"./render":1072,d3:157}],1072:[function(t,e,r){"use strict";var n=t("./constants"),i=t("d3"),a=t("tinycolor2"),o=t("../../components/color"),s=t("../../components/drawing"),l=t("@plotly/d3-sankey"),u=t("d3-sankey-circular"),c=t("d3-force"),f=t("../../lib"),h=t("../../lib/gup"),p=h.keyFun,d=h.repeat,v=h.unwrap,g=t("d3-interpolate").interpolateNumber,m=t("../../registry");function y(){var t=.5;return function(e){if(e.link.circular)return r=e.link,n=r.width/2,i=r.circularPathData,"top"===r.circularLinkType?"M "+i.targetX+" "+(i.targetY+n)+" L"+i.rightInnerExtent+" "+(i.targetY+n)+"A"+(i.rightLargeArcRadius+n)+" "+(i.rightSmallArcRadius+n)+" 0 0 1 "+(i.rightFullExtent-n)+" "+(i.targetY-i.rightSmallArcRadius)+"L"+(i.rightFullExtent-n)+" "+i.verticalRightInnerExtent+"A"+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 1 "+i.rightInnerExtent+" "+(i.verticalFullExtent-n)+"L"+i.leftInnerExtent+" "+(i.verticalFullExtent-n)+"A"+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent+"L"+(i.leftFullExtent+n)+" "+(i.sourceY-i.leftSmallArcRadius)+"A"+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 1 "+i.leftInnerExtent+" "+(i.sourceY+n)+"L"+i.sourceX+" "+(i.sourceY+n)+"L"+i.sourceX+" "+(i.sourceY-n)+"L"+i.leftInnerExtent+" "+(i.sourceY-n)+"A"+(i.leftLargeArcRadius-n)+" "+(i.leftSmallArcRadius-n)+" 0 0 0 "+(i.leftFullExtent-n)+" "+(i.sourceY-i.leftSmallArcRadius)+"L"+(i.leftFullExtent-n)+" "+i.verticalLeftInnerExtent+"A"+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 0 "+i.leftInnerExtent+" "+(i.verticalFullExtent+n)+"L"+i.rightInnerExtent+" "+(i.verticalFullExtent+n)+"A"+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 0 "+(i.rightFullExtent+n)+" "+i.verticalRightInnerExtent+"L"+(i.rightFullExtent+n)+" "+(i.targetY-i.rightSmallArcRadius)+"A"+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 0 "+i.rightInnerExtent+" "+(i.targetY-n)+"L"+i.targetX+" "+(i.targetY-n)+"Z":"M "+i.targetX+" "+(i.targetY-n)+" L"+i.rightInnerExtent+" "+(i.targetY-n)+"A"+(i.rightLargeArcRadius+n)+" "+(i.rightSmallArcRadius+n)+" 0 0 0 "+(i.rightFullExtent-n)+" "+(i.targetY+i.rightSmallArcRadius)+"L"+(i.rightFullExtent-n)+" "+i.verticalRightInnerExtent+"A"+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+i.rightInnerExtent+" "+(i.verticalFullExtent+n)+"L"+i.leftInnerExtent+" "+(i.verticalFullExtent+n)+"A"+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent+"L"+(i.leftFullExtent+n)+" "+(i.sourceY+i.leftSmallArcRadius)+"A"+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 0 "+i.leftInnerExtent+" "+(i.sourceY-n)+"L"+i.sourceX+" "+(i.sourceY-n)+"L"+i.sourceX+" "+(i.sourceY+n)+"L"+i.leftInnerExtent+" "+(i.sourceY+n)+"A"+(i.leftLargeArcRadius-n)+" "+(i.leftSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent-n)+" "+(i.sourceY+i.leftSmallArcRadius)+"L"+(i.leftFullExtent-n)+" "+i.verticalLeftInnerExtent+"A"+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 1 "+i.leftInnerExtent+" "+(i.verticalFullExtent-n)+"L"+i.rightInnerExtent+" "+(i.verticalFullExtent-n)+"A"+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 1 "+(i.rightFullExtent+n)+" "+i.verticalRightInnerExtent+"L"+(i.rightFullExtent+n)+" "+(i.targetY+i.rightSmallArcRadius)+"A"+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+i.rightInnerExtent+" "+(i.targetY+n)+"L"+i.targetX+" "+(i.targetY+n)+"Z";var r,n,i,a=e.link.source.x1,o=e.link.target.x0,s=g(a,o),l=s(t),u=s(1-t),c=e.link.y0-e.link.width/2,f=e.link.y0+e.link.width/2,h=e.link.y1-e.link.width/2,p=e.link.y1+e.link.width/2;return"M"+a+","+c+"C"+l+","+c+" "+u+","+h+" "+o+","+h+"L"+o+","+p+"C"+u+","+p+" "+l+","+f+" "+a+","+f+"Z"}}function x(t){t.attr("transform",function(t){return"translate("+t.node.x0.toFixed(3)+", "+t.node.y0.toFixed(3)+")"})}function b(t){t.call(x)}function _(t,e){t.call(b),e.attr("d",y())}function w(t){t.attr("width",function(t){return t.node.x1-t.node.x0}).attr("height",function(t){return t.visibleHeight})}function k(t){return t.link.width>1||t.linkLineWidth>0}function A(t){var e="translate("+t.translateX+","+t.translateY+")";return e+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function T(t){return"translate("+(t.horizontal?0:t.labelY)+" "+(t.horizontal?t.labelY:0)+")"}function M(t){return i.svg.line()([[t.horizontal?t.left?-t.sizeAcross:t.visibleWidth+n.nodeTextOffsetHorizontal:n.nodeTextOffsetHorizontal,0],[t.horizontal?t.left?-n.nodeTextOffsetHorizontal:t.sizeAcross:t.visibleHeight-n.nodeTextOffsetHorizontal,0]])}function E(t){return t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)"}function S(t){return t.horizontal?"scale(1 1)":"scale(-1 1)"}function C(t){return t.darkBackground&&!t.horizontal?"rgb(255,255,255)":"rgb(0,0,0)"}function L(t){return t.horizontal&&t.left?"100%":"0%"}function O(t,e,r){t.on(".basic",null).on("mouseover.basic",function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.hover(this,t,e),t.interactionState.hovered=[this,t])}).on("mousemove.basic",function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.follow(this,t),t.interactionState.hovered=[this,t])}).on("mouseout.basic",function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.unhover(this,t,e),t.interactionState.hovered=!1)}).on("click.basic",function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||t.partOfGroup||r.select(this,t,e)})}function I(t,e,r,a){var o=i.behavior.drag().origin(function(t){return{x:t.node.x0+t.visibleWidth/2,y:t.node.y0+t.visibleHeight/2}}).on("dragstart",function(i){if("fixed"!==i.arrangement&&(f.ensureSingle(a._fullLayout._infolayer,"g","dragcover",function(t){a._fullLayout._dragCover=t}),f.raiseToTop(this),i.interactionState.dragInProgress=i.node,D(i.node),i.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,i.interactionState.hovered),i.interactionState.hovered=!1),"snap"===i.arrangement)){var o=i.traceId+"|"+i.key;i.forceLayouts[o]?i.forceLayouts[o].alpha(1):function(t,e,r,i){!function(t){for(var e=0;e0&&i.forceLayouts[e].alpha(0)}}(0,e,a,r)).stop()}(0,o,i),function(t,e,r,i,a){window.requestAnimationFrame(function o(){var s;for(s=0;s0)window.requestAnimationFrame(o);else{var u=r.node.originalX;r.node.x0=u-r.visibleWidth/2,r.node.x1=u+r.visibleWidth/2,P(r,a)}})}(t,e,i,o,a)}}).on("drag",function(r){if("fixed"!==r.arrangement){var n=i.event.x,a=i.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),a=Math.max(0,Math.min(r.size-r.visibleHeight/2,a)),r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2),D(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),_(t.filter(z(r)),e))}}).on("dragend",function(t){if("fixed"!==t.arrangement){t.interactionState.dragInProgress=!1;for(var e=0;eo+d&&(a+=1,e=s.x0),o=s.x0,i[a]||(i[a]=[]),i[a].push(s),r=e-s.x0,s.x0+=r,s.x1+=r}return i}(y=A.nodes);!function(t){t.forEach(function(t){var e,r,n,i=0,a=t.length;for(t.sort(function(t,e){return t.y0-e.y0}),n=0;n=i||(r=i-e.y0)>1e-6&&(e.y0+=r,e.y1+=r),i=e.y1+p})}(O)}i.update(A)}return{circular:b,key:r,trace:s,guid:f.randstr(),horizontal:h,width:g,height:m,nodePad:s.node.pad,nodeLineColor:s.node.line.color,nodeLineWidth:s.node.line.width,linkLineColor:s.link.line.color,linkLineWidth:s.link.line.width,valueFormat:s.valueformat,valueSuffix:s.valuesuffix,textFont:s.textfont,translateX:c.x[0]*t.width+t.margin.l,translateY:t.height-c.y[1]*t.height+t.margin.t,dragParallel:h?m:g,dragPerpendicular:h?g:m,arrangement:s.arrangement,sankey:i,graph:A,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}.bind(null,c)),_=e.selectAll("."+n.cn.sankey).data(b,p);_.exit().remove(),_.enter().append("g").classed(n.cn.sankey,!0).style("box-sizing","content-box").style("position","absolute").style("left",0).style("shape-rendering","geometricPrecision").style("pointer-events","auto").attr("transform",A),_.each(function(e,r){t._fullData[r]._sankey=e;var n="bgsankey-"+e.trace.uid+"-"+r;f.ensureSingle(t._fullLayout._draggers,"rect",n),t._fullData[r]._bgRect=i.select("."+n),t._fullData[r]._bgRect.style("pointer-events","all").attr("width",e.width).attr("height",e.height).attr("x",e.translateX).attr("y",e.translateY).classed("bgsankey",!0).style({fill:"transparent","stroke-width":0})}),_.transition().ease(n.ease).duration(n.duration).attr("transform",A);var P=_.selectAll("."+n.cn.sankeyLinks).data(d,p);P.enter().append("g").classed(n.cn.sankeyLinks,!0).style("fill","none");var D=P.selectAll("."+n.cn.sankeyLink).data(function(t){var e=t.graph.links;return e.filter(function(t){return t.value}).map(function(t,e,r){var n=a(e.color),i=e.source.label+"|"+e.target.label+"__"+r;return e.trace=t.trace,e.curveNumber=t.trace.index,{circular:t.circular,key:i,traceId:t.key,pointNumber:e.pointNumber,link:e,tinyColorHue:o.tinyRGB(n),tinyColorAlpha:n.getAlpha(),linkPath:y,linkLineColor:t.linkLineColor,linkLineWidth:t.linkLineWidth,valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,parent:t,interactionState:t.interactionState,flow:e.flow}}.bind(null,t))},p);D.enter().append("path").classed(n.cn.sankeyLink,!0).call(O,_,h.linkEvents),D.style("stroke",function(t){return k(t)?o.tinyRGB(a(t.linkLineColor)):t.tinyColorHue}).style("stroke-opacity",function(t){return k(t)?o.opacity(t.linkLineColor):t.tinyColorAlpha}).style("fill",function(t){return t.tinyColorHue}).style("fill-opacity",function(t){return t.tinyColorAlpha}).style("stroke-width",function(t){return k(t)?t.linkLineWidth:1}).attr("d",y()),D.style("opacity",function(){return t._context.staticPlot||g||m?1:0}).transition().ease(n.ease).duration(n.duration).style("opacity",1),D.exit().transition().ease(n.ease).duration(n.duration).style("opacity",0).remove();var z=_.selectAll("."+n.cn.sankeyNodeSet).data(d,p);z.enter().append("g").classed(n.cn.sankeyNodeSet,!0),z.style("cursor",function(t){switch(t.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var R=z.selectAll("."+n.cn.sankeyNode).data(function(t){var e=t.graph.nodes;return function(t){var e,r=[];for(e=0;e5?t.node.label:""}).attr("text-anchor",function(t){return t.horizontal&&t.left?"end":"start"}),U.transition().ease(n.ease).duration(n.duration).attr("startOffset",L).style("fill",C)}},{"../../components/color":580,"../../components/drawing":601,"../../lib":703,"../../lib/gup":701,"../../registry":831,"./constants":1068,"@plotly/d3-sankey":51,d3:157,"d3-force":149,"d3-interpolate":151,"d3-sankey-circular":154,tinycolor2:524}],1073:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=t.cd,n=[],i=r[0].trace,a=i._sankey.graph.nodes,o=0;os&&T[g].gap;)g--;for(y=T[g].s,d=T.length-1;d>g;d--)T[d].s=y;for(;sM[c]&&c=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],1082:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),u=t("./stack_defaults"),c=t("./marker_defaults"),f=t("./line_defaults"),h=t("./line_shape_defaults"),p=t("./text_defaults"),d=t("./fillcolor_defaults");e.exports=function(t,e,r,v){function g(r,i){return n.coerce(t,e,a,r,i)}var m=l(t,e,v,g);if(m||(e.visible=!1),e.visible){var y=u(t,e,v,g),x=!y&&mG!=F>=G&&(D=I[L-1][0],z=I[L][0],F-R&&(P=D+(z-D)*(G-R)/(F-R),V=Math.min(V,P),U=Math.max(U,P)));V=Math.max(V,0),U=Math.min(U,h._length);var W=s.defaultLine;return s.opacity(f.fillcolor)?W=f.fillcolor:s.opacity((f.line||{}).color)&&(W=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:V,x1:U,y0:G,y1:G,color:W,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":580,"../../components/fx":619,"../../lib":703,"../../registry":831,"./get_trace_color":1084}],1086:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":762,"./arrays_to_calcdata":1074,"./attributes":1075,"./calc":1076,"./cross_trace_calc":1080,"./cross_trace_defaults":1081,"./defaults":1082,"./hover":1085,"./marker_colorbar":1092,"./plot":1094,"./select":1095,"./style":1097,"./subtypes":1098}],1087:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var u=(t.marker||{}).color;if(s("line.color",r),i(t,"line"))a(t,e,o,s,{prefix:"line.",cLetter:"c"});else{var c=!n(u)&&u||r;s("line.color",c)}s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":590,"../../components/colorscale/helpers":591,"../../lib":703}],1088:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),i=n.BADNUM,a=n.LOG_CLIP,o=a+.5,s=a-.5,l=t("../../lib"),u=l.segmentsIntersect,c=l.constrain,f=t("./constants");e.exports=function(t,e){var r,n,a,h,p,d,v,g,m,y,x,b,_,w,k,A,T,M,E=e.xaxis,S=e.yaxis,C="log"===E.type,L="log"===S.type,O=E._length,I=S._length,P=e.connectGaps,D=e.baseTolerance,z=e.shape,R="linear"===z,F=e.fill&&"none"!==e.fill,B=[],N=f.minTolerance,j=t.length,V=new Array(j),U=0;function H(e){var r=t[e];if(!r)return!1;var n=E.c2p(r.x),a=S.c2p(r.y);if(n===i){if(C&&(n=E.c2p(r.x,!0)),n===i)return!1;L&&a===i&&(n*=Math.abs(E._m*I*(E._m>0?o:s)/(S._m*O*(S._m>0?o:s)))),n*=1e3}if(a===i){if(L&&(a=S.c2p(r.y,!0)),a===i)return!1;a*=1e3}return[n,a]}function q(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,u=i*o+a*s;if(u>0&&urt||t[1]it)return[c(t[0],et,rt),c(t[1],nt,it)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||t[1]===e[1]&&(t[1]===nt||t[1]===it)||void 0}function lt(t,e,r){return function(n,i){var a=ot(n),o=ot(i),s=[];if(a&&o&&st(a,o))return s;a&&s.push(a),o&&s.push(o);var u=2*l.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);return u&&((a&&o?u>0==a[t]>o[t]?a:o:a||o)[t]+=u),s}}function ut(t){var e=t[0],r=t[1],n=e===V[U-1][0],i=r===V[U-1][1];if(!n||!i)if(U>1){var a=e===V[U-2][0],o=r===V[U-2][1];n&&(e===et||e===rt)&&a?o?U--:V[U-1]=t:i&&(r===nt||r===it)&&o?a?U--:V[U-1]=t:V[U++]=t}else V[U++]=t}function ct(t){V[U-1][0]!==t[0]&&V[U-1][1]!==t[1]&&ut([Z,$]),ut(t),J=null,Z=$=0}function ft(t){if(T=t[0]/O,M=t[1]/I,Y=t[0]rt?rt:0,X=t[1]it?it:0,Y||X){if(U)if(J){var e=Q(J,t);e.length>1&&(ct(e[0]),V[U++]=e[1])}else K=Q(V[U-1],t)[0],V[U++]=K;else V[U++]=[Y||t[0],X||t[1]];var r=V[U-1];Y&&X&&(r[0]!==Y||r[1]!==X)?(J&&(Z!==Y&&$!==X?ut(Z&&$?(n=J,a=(i=t)[0]-n[0],o=(i[1]-n[1])/a,(n[1]*i[0]-i[1]*n[0])/a>0?[o>0?et:rt,it]:[o>0?rt:et,nt]):[Z||Y,$||X]):Z&&$&&ut([Z,$])),ut([Y,X])):Z-Y&&$-X&&ut([Y||Z,X||$]),J=t,Z=Y,$=X}else J&&ct(Q(J,t)[0]),V[U++]=t;var n,i,a,o}for("linear"===z||"spline"===z?Q=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=at[i],o=u(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&W(o,t)G(d,ht))break;a=d,(_=m[0]*g[0]+m[1]*g[1])>x?(x=_,h=d,v=!1):_=t.length||!d)break;ft(d),n=d}}else ft(h)}J&&ut([Z||J[0],$||J[1]]),B.push(V.slice(0,U))}return B}},{"../../constants/numerical":680,"../../lib":703,"./constants":1079}],1089:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=r("line.shape");"spline"===n&&r("line.smoothing")}},{}],1090:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var i,a,o,s,l,u={},c=!1,f=-1,h=0,p=-1;for(a=0;a=0?l=p:(l=p=h,h++),l0?Math.max(e,i):0}}},{"fast-isnumeric":224}],1092:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],1093:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c,f=o.isBubble(t),h=(t.line||{}).color;if(u=u||{},h&&(r=h),l("marker.symbol"),l("marker.opacity",f?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(c=h&&!Array.isArray(h)&&e.marker.color!==h?h:f?n.background:n.defaultLine,l("marker.line.color",c),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",f?1:0)),f&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient){var p=l("marker.gradient.type");"none"!==p&&l("marker.gradient.color")}}},{"../../components/color":580,"../../components/colorscale/defaults":590,"../../components/colorscale/helpers":591,"./subtypes":1098}],1094:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../lib"),o=a.ensureSingle,s=a.identity,l=t("../../components/drawing"),u=t("./subtypes"),c=t("./line_points"),f=t("./link_traces"),h=t("../../lib/polygon").tester;function p(t,e,r,f,p,d,v){var g;!function(t,e,r,i,o){var s=r.xaxis,l=r.yaxis,c=n.extent(a.simpleMap(s.range,s.r2c)),f=n.extent(a.simpleMap(l.range,l.r2c)),h=i[0].trace;if(u.hasMarkers(h)){var p=h.marker.maxdisplayed;if(0!==p){var d=i.filter(function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]}),v=Math.ceil(d.length/p),g=0;o.forEach(function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return m?t.transition():t}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,k=n.select(d),A=o(k,"g","errorbars"),T=o(k,"g","lines"),M=o(k,"g","points"),E=o(k,"g","text");if(i.getComponentMethod("errorbars","plot")(t,A,r,v),!0===_.visible){var S,C;y(k).style("opacity",_.opacity);var L=_.fill.charAt(_.fill.length-1);"x"!==L&&"y"!==L&&(L=""),r.isRangePlot||(f[0].node3=k);var O,I,P="",D=[],z=_._prevtrace;z&&(P=z._prevRevpath||"",C=z._nextFill,D=z._polygons);var R,F,B,N,j,V,U,H="",q="",G=[],W=a.noop;if(S=_._ownFill,u.hasLines(_)||"none"!==_.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=l.steps(w.shape),F=l.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},B=function(t){return F(t.reverse())},G=c(f,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),U=_._polygons=new Array(G.length),g=0;g1){var r=n.select(this);if(r.datum(f),t)y(r.style("opacity",0).attr("d",O).call(l.lineGroupStyle)).style("opacity",1);else{var i=y(r);i.attr("d",O),l.singleLineStyle(f,i)}}}}}var Y=T.selectAll(".js-line").data(G);y(Y.exit()).style("opacity",0).remove(),Y.each(W(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(W(!0)),l.setClipUrl(Y,r.layerClipId,t),G.length?(S?(S.datum(f),N&&V&&(L?("y"===L?N[1]=V[1]=b.c2p(0,!0):"x"===L&&(N[0]=V[0]=x.c2p(0,!0)),y(S).attr("d","M"+V+"L"+N+"L"+H.substr(1)).call(l.singleFillStyle)):y(S).attr("d",H+"Z").call(l.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&H&&P?("tonext"===_.fill?y(C).attr("d",H+"Z"+P+"Z").call(l.singleFillStyle):y(C).attr("d",H+"L"+P.substr(1)+"Z").call(l.singleFillStyle),_._polygons=_._polygons.concat(D)):($(C),_._polygons=null)),_._prevRevpath=q,_._prevPolygons=U):(S?$(S):C&&$(C),_._polygons=_._prevRevpath=_._prevPolygons=null),M.datum(f),E.datum(f),function(e,i,a){var o,c,f=a[0].trace,h=u.hasMarkers(f),p=u.hasText(f),d=et(f),v=rt,g=rt;if(h||p){var _=s,w=f.stackgroup,k=w&&"infer zero"===t._fullLayout._scatterStackOpts[x._id+b._id][w].stackgaps;f.marker.maxdisplayed||f._needsCull?_=k?K:J:w&&!k&&(_=Q),h&&(v=_),p&&(g=_)}c=e.selectAll("path.point");var A,T=(o=c.data(v,d)).enter().append("path").classed("point",!0);m&&T.call(l.pointStyle,f,t).call(l.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),h&&(A=l.makePointStyleFns(f)),o.each(function(e){var i=n.select(this),a=y(i);l.translatePoint(e,a,x,b)?(l.singlePointStyle(e,a,f,A,t),r.layerClipId&&l.hideOutsideRangePoint(e,a,x,b,f.xcalendar,f.ycalendar),f.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),c=i.selectAll("g"),(o=c.data(g,d)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each(function(t){var e=n.select(this),i=y(e.select("text"));l.translatePoint(t,i,x,b)?r.layerClipId&&l.hideOutsideRangePoint(t,e,x,b,f.xcalendar,f.ycalendar):e.remove()}),o.selectAll("text").call(l.textPointStyle,f,t).each(function(t){var e=x.c2p(t.x),r=b.c2p(t.y);n.select(this).selectAll("tspan.line").each(function(){y(n.select(this)).attr({x:e,y:r})})}),o.exit().remove()}(M,E,f);var X=!1===_.cliponaxis,Z=X?null:r.layerClipId;l.setClipUrl(M,Z,t),l.setClipUrl(E,Z,t)}function $(t){y(t).attr("d","M0,0Z")}function J(t){return t.filter(function(t){return!t.gap&&t.vis})}function K(t){return t.filter(function(t){return t.vis})}function Q(t){return t.filter(function(t){return!t.gap})}function tt(t){return t.id}function et(t){if(t.ids)return tt}function rt(){return!1}}e.exports=function(t,e,r,i,a,u){var c,h,d=!a,v=!!a&&a.duration>0,g=f(t,e,r);if((c=i.selectAll("g.trace").data(g,function(t){return t[0].trace.uid})).enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),c.order(),function(t,e,r){e.each(function(e){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,t);var a=e[0].trace,u=[];a._ownfill&&u.push("_ownFill"),a._nexttrace&&u.push("_nextFill");var c=i.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each(function(t){a[t]=null}).remove(),c.order().each(function(t){a[t]=o(n.select(this),"path","js-fill")})})}(t,c,e),v){u&&(h=u());var m=n.transition().duration(a.duration).ease(a.easing).each("end",function(){h&&h()}).each("interrupt",function(){h&&h()});m.each(function(){i.selectAll("g.trace").each(function(r,n){p(t,n,e,r,g,this,a)})})}else c.each(function(r,n){p(t,n,e,r,g,this,a)});d&&c.exit().remove(),i.selectAll("path:not([d])").remove()}},{"../../components/drawing":601,"../../lib":703,"../../lib/polygon":715,"../../registry":831,"./line_points":1088,"./link_traces":1090,"./subtypes":1098,d3:157}],1095:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],f=s[0].trace,h=!n.hasMarkers(f)&&!n.hasText(f);if(h)return[];if(!1===e)for(r=0;r0){var h=i.c2l(c);i._lowerLogErrorBound||(i._lowerLogErrorBound=h),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,h)}}else o[s]=[-l[0]*r,l[1]*r]}return o}e.exports=function(t,e,r){var n=[i(t.x,t.error_x,e[0],r.xaxis),i(t.y,t.error_y,e[1],r.yaxis),i(t.z,t.error_z,e[2],r.zaxis)],a=function(t){for(var e=0;e-1?-1:t.indexOf("right")>-1?1:0}function y(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function x(t,e){return e(4*t)}function b(t){return p[t]}function _(t,e,r,n,i){var a=null;if(l.isArrayOrTypedArray(t)){a=[];for(var o=0;o=0){var v=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n=0&&f("surfacecolor",p||d);for(var v=["x","y","z"],g=0;g<3;++g){var m="projection."+v[g];f(m+".show")&&(f(m+".opacity"),f(m+".scale"))}var y=n.getComponentMethod("errorbars","supplyDefaults");y(t,e,p||d||r,{axis:"z"}),y(t,e,p||d||r,{axis:"y",inherit:"z"}),y(t,e,p||d||r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../lib":703,"../../registry":831,"../scatter/line_defaults":1087,"../scatter/marker_defaults":1093,"../scatter/subtypes":1098,"../scatter/text_defaults":1099,"./attributes":1101}],1106:[function(t,e,r){"use strict";e.exports={plot:t("./convert"),attributes:t("./attributes"),markerSymbols:t("../../constants/gl3d_markers"),supplyDefaults:t("./defaults"),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:t("./calc"),moduleType:"trace",name:"scatter3d",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","symbols","showLegend"],meta:{}}},{"../../constants/gl3d_markers":678,"../../plots/gl3d":791,"./attributes":1101,"./calc":1102,"./convert":1104,"./defaults":1105}],1107:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/fx/hovertemplate_attributes"),o=t("../../components/colorscale/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker,u=n.line,c=l.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:s({},n.mode,{dflt:"markers"}),text:s({},n.text,{}),hovertext:s({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,shape:s({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:n.fillcolor,marker:s({symbol:l.symbol,opacity:l.opacity,maxdisplayed:l.maxdisplayed,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,line:s({width:c.width,editType:"calc"},o("marker.line")),gradient:l.gradient,editType:"calc"},o("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:s({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:a()}},{"../../components/colorscale/attributes":587,"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../../plots/attributes":748,"../scatter/attributes":1075}],1108:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e._carpetTrace=l(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var u;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var c,f,h=e._length,p=new Array(h),d=!1;for(u=0;u")}return o}function A(t,e){var r;r=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,_.push(r+": "+e.toFixed(3)+t.labelsuffix)}}},{"../../lib":703,"../scatter/hover":1085}],1112:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../scatter/select"),eventData:t("./event_data"),moduleType:"trace",name:"scattercarpet",basePlotModule:t("../../plots/cartesian"),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}},{"../../plots/cartesian":762,"../scatter/marker_colorbar":1092,"../scatter/select":1095,"../scatter/style":1097,"./attributes":1107,"./calc":1108,"./defaults":1109,"./event_data":1110,"./hover":1111,"./plot":1113}],1113:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../plots/cartesian/axes"),a=t("../../components/drawing");e.exports=function(t,e,r,o){var s,l,u,c=r[0][0].carpet,f={xaxis:i.getFromId(t,c.xaxis||"x"),yaxis:i.getFromId(t,c.yaxis||"y"),plot:e.plot};for(n(t,f,r,o),s=0;s")}function d(t){return i.tickText(r,r.c2l(t),"hover").text+"°"}}(c,g,p.mockAxis,u[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}}},{"../../components/fx":619,"../../constants/numerical":680,"../../lib":703,"../../plots/cartesian/axes":751,"../scatter/get_trace_color":1084,"./attributes":1114}],1119:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),calc:t("./calc"),plot:t("./plot"),style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"scattergeo",basePlotModule:t("../../plots/geo"),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/geo":781,"../scatter/marker_colorbar":1092,"../scatter/style":1097,"./attributes":1114,"./calc":1115,"./defaults":1116,"./event_data":1117,"./hover":1118,"./plot":1120,"./select":1121,"./style":1122}],1120:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM,o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../lib/geo_location_utils").locationToFeature,l=t("../../lib/geojson_utils"),u=t("../scatter/subtypes"),c=t("./style");function f(t,e){var r=t[0].trace;if(Array.isArray(r.locations))for(var n=o(r,e),i=r.locationmode,l=0;lp.TOO_MANY_POINTS?"rect":f.hasMarkers(e)?"rect":"round";if(u&&e.connectgaps){var h=n[0],d=n[1];for(i=0;i1?l[i]:l[0]:l,d=Array.isArray(u)?u.length>1?u[i]:u[0]:u,g=v[p],m=v[d],y=c?c/.8+1:0,x=-m*y-.5*m;o.offset[i]=[g*y/h,x/h]}}return o}}},{"../../components/drawing":601,"../../constants/interactions":679,"../../lib":703,"../../lib/gl_format_color":700,"../../plots/cartesian/axis_ids":754,"../../registry":831,"../scatter/make_bubble_size_func":1091,"../scatter/subtypes":1098,"./constants":1124,"color-normalize":113,"fast-isnumeric":224,"svg-path-sdf":522}],1126:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("../scatter/constants"),s=t("../scatter/subtypes"),l=t("../scatter/xy_defaults"),u=t("../scatter/marker_defaults"),c=t("../scatter/line_defaults"),f=t("../scatter/fillcolor_defaults"),h=t("../scatter/text_defaults");e.exports=function(t,e,r,p){function d(r,i){return n.coerce(t,e,a,r,i)}var v=!!t.marker&&/-open/.test(t.marker.symbol),g=s.isBubble(t),m=l(t,e,p,d);if(m){var y=m=T,d=2*h,v={},b=s.makeCalcdata(e,"x"),_=l.makeCalcdata(e,"y"),w=new Array(d);for(r=0;r1&&u.extendFlat(o.line,k.linePositions(t,r,n)),o.errorX||o.errorY){var s=k.errorBarPositions(t,r,n,i,a);o.errorX&&u.extendFlat(o.errorX,s.x),o.errorY&&u.extendFlat(o.errorY,s.y)}return o.text&&(u.extendFlat(o.text,{positions:n},k.textPosition(t,r,o.text,o.marker)),u.extendFlat(o.textSel,{positions:n},k.textPosition(t,r,o.text,o.markerSel)),u.extendFlat(o.textUnsel,{positions:n},k.textPosition(t,r,o.text,o.markerUnsel))),o}(t,0,e,w,b,_),O=S(0,c);return y(a,e),p?L.marker&&(C=2*(L.marker.sizeAvg||Math.max(L.marker.size,3))):C=g(e,h),m(t,e,s,l,b,_,C),L.errorX&&E(e,s,L.errorX),L.errorY&&E(e,l,L.errorY),L.fill&&!O.fill2d&&(O.fill2d=!0),L.marker&&!O.scatter2d&&(O.scatter2d=!0),L.line&&!O.line2d&&(O.line2d=!0),!L.errorX&&!L.errorY||O.error2d||(O.error2d=!0),L.text&&!O.glText&&(O.glText=!0),L.marker&&(L.marker.snap=v.tree||T),O.lineOptions.push(L.line),O.errorXOptions.push(L.errorX),O.errorYOptions.push(L.errorY),O.fillOptions.push(L.fill),O.markerOptions.push(L.marker),O.markerSelectedOptions.push(L.markerSel),O.markerUnselectedOptions.push(L.markerUnsel),O.textOptions.push(L.text),O.textSelectedOptions.push(L.textSel),O.textUnselectedOptions.push(L.textUnsel),O.selectBatch.push([]),O.unselectBatch.push([]),v._scene=O,v.index=O.count,v.x=b,v.y=_,v.positions=w,O.count++,[{x:!1,y:!1,t:v,trace:e}]},plot:function(t,e,r){if(r.length){var o,l,f=t._fullLayout,h=e._scene,p=e.xaxis,v=e.yaxis;if(h)if(c(t,["ANGLE_instanced_arrays","OES_element_index_uint"])){var g=h.count,m=f._glcanvas.data()[0].regl;if(b(t,e,r),h.dirty){if(!0===h.error2d&&(h.error2d=a(m)),!0===h.line2d&&(h.line2d=i(m)),!0===h.scatter2d&&(h.scatter2d=n(m)),!0===h.fill2d&&(h.fill2d=i(m)),!0===h.glText)for(h.glText=new Array(g),o=0;oh.glText.length){var y=g-h.glText.length;for(o=0;or&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t}),h.line2d.update(h.lineOptions)),h.error2d){var w=(h.errorXOptions||[]).concat(h.errorYOptions||[]);h.error2d.update(w)}h.scatter2d&&h.scatter2d.update(h.markerOptions),h.fillOrder=u.repeat(null,g),h.fill2d&&(h.fillOptions=h.fillOptions.map(function(t,e){var n=r[e];if(t&&n&&n[0]&&n[0].trace){var i,a,o=n[0],s=o.trace,l=o.t,u=h.lineOptions[e],c=[];s._ownfill&&c.push(e),s._nexttrace&&c.push(e+1),c.length&&(h.fillOrder[e]=c);var f,p,d=[],v=u&&u.positions||l.positions;if("tozeroy"===s.fill){for(f=0;ff&&isNaN(v[p+1]);)p-=2;0!==v[f+1]&&(d=[v[f],0]),d=d.concat(v.slice(f,p+2)),0!==v[p+1]&&(d=d.concat([v[p],0]))}else if("tozerox"===s.fill){for(f=0;ff&&isNaN(v[p]);)p-=2;0!==v[f]&&(d=[0,v[f+1]]),d=d.concat(v.slice(f,p+2)),0!==v[p]&&(d=d.concat([0,v[p+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(d=[],i=0,a=0;a-1;for(o=0;o-1;l--)o=y[i[l]],s=x[i[l]],u=g.c2p(o)-b,c=m.c2p(s)-_,(f=Math.sqrt(u*u+c*c))=0?Math.floor((e+180)/360):Math.ceil((e-180)/360),d=360*p,v=e-d;if(n.getClosest(l,function(t){var e=t.lonlat;if(e[0]===s)return 1/0;var n=i.modHalf(e[0],360),a=e[1],o=h.project([n,a]),l=o.x-c.c2p([v,a]),u=o.y-f.c2p([n,r]),p=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+u*u)-p,1-3/p)},t),!1!==t.index){var g=l[t.index],m=g.lonlat,y=[i.modHalf(m[0],360)+d,m[1]],x=c.c2p(y),b=f.c2p(y),_=g.mrc||1;return t.x0=x-_,t.x1=x+_,t.y0=b-_,t.y1=b+_,t.color=a(u,g),t.extraText=function(t,e,r){if(!t.hovertemplate){var n=(e.hi||t.hoverinfo).split("+"),i=-1!==n.indexOf("all"),a=-1!==n.indexOf("lon"),s=-1!==n.indexOf("lat"),l=e.lonlat,u=[];return i||a&&s?u.push("("+c(l[0])+", "+c(l[1])+")"):a?u.push(r.lon+c(l[0])):s&&u.push(r.lat+c(l[1])),(i||-1!==n.indexOf("text"))&&o(e,t,u),u.join("
")}function c(t){return t+"°"}}(u,g,l[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}}},{"../../components/fx":619,"../../constants/numerical":680,"../../lib":703,"../scatter/get_trace_color":1084}],1133:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),calc:t("../scattergeo/calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),style:function(t,e){if(e){var r=e[0].trace;r._glTrace.update(e)}},moduleType:"trace",name:"scattermapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatterlike"],meta:{}}},{"../../plots/mapbox":806,"../scatter/marker_colorbar":1092,"../scattergeo/calc":1115,"./attributes":1128,"./defaults":1130,"./event_data":1131,"./hover":1132,"./plot":1134,"./select":1135}],1134:[function(t,e,r){"use strict";var n=t("./convert");function i(t,e){this.subplot=t,this.uid=e,this.sourceIds={fill:e+"-source-fill",line:e+"-source-line",circle:e+"-source-circle",symbol:e+"-source-symbol"},this.layerIds={fill:e+"-layer-fill",line:e+"-layer-line",circle:e+"-layer-circle",symbol:e+"-layer-symbol"},this.order=["fill","line","circle","symbol"]}var a=i.prototype;a.addSource=function(t,e){this.subplot.map.addSource(this.sourceIds[t],{type:"geojson",data:e.geojson})},a.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},a.addLayer=function(t,e){this.subplot.map.addLayer({type:t,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint})},a.update=function(t){for(var e=this.subplot,r=n(t),i=0;i")}}e.exports={hoverPoints:function(t,e,r,i){var a=n(t,e,r,i);if(a&&!1!==a[0].index){var s=a[0];if(void 0===s.index)return a;var l=t.subplot,u=s.cd[s.index],c=s.trace;if(l.isPtInside(u))return s.xLabelVal=void 0,s.yLabelVal=void 0,o(u,c,l,s),s.hovertemplate=c.hovertemplate,a}},makeHoverPointText:o}},{"../../lib":703,"../../plots/cartesian/axes":751,"../scatter/hover":1085}],1140:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:t("../../plots/polar"),categories:["polar","symbols","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,colorbar:t("../scatter/marker_colorbar"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,hoverPoints:t("./hover").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/polar":815,"../scatter/marker_colorbar":1092,"../scatter/select":1095,"../scatter/style":1097,"./attributes":1136,"./calc":1137,"./defaults":1138,"./hover":1139,"./plot":1141}],1141:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){for(var a=e.layers.frontplot.select("g.scatterlayer"),o={xaxis:e.xaxis,yaxis:e.yaxis,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},s=e.radialAxis,l=e.angularAxis,u=0;u=h&&(y.marker.cluster=d.tree),y.marker&&(y.markerSel.positions=y.markerUnsel.positions=y.marker.positions=_),y.line&&_.length>1&&u.extendFlat(y.line,l.linePositions(t,p,_)),y.text&&(u.extendFlat(y.text,{positions:_},l.textPosition(t,p,y.text,y.marker)),u.extendFlat(y.textSel,{positions:_},l.textPosition(t,p,y.text,y.markerSel)),u.extendFlat(y.textUnsel,{positions:_},l.textPosition(t,p,y.text,y.markerUnsel))),y.fill&&!c.fill2d&&(c.fill2d=!0),y.marker&&!c.scatter2d&&(c.scatter2d=!0),y.line&&!c.line2d&&(c.line2d=!0),y.text&&!c.glText&&(c.glText=!0),c.lineOptions.push(y.line),c.fillOptions.push(y.fill),c.markerOptions.push(y.marker),c.markerSelectedOptions.push(y.markerSel),c.markerUnselectedOptions.push(y.markerUnsel),c.textOptions.push(y.text),c.textSelectedOptions.push(y.textSel),c.textUnselectedOptions.push(y.textUnsel),c.selectBatch.push([]),c.unselectBatch.push([]),d.x=w,d.y=k,d.rawx=w,d.rawy=k,d.r=g,d.theta=m,d.positions=_,d._scene=c,d.index=c.count,c.count++}}),a.plot(t,e,r)}},hoverPoints:function(t,e,r,n){var i=t.cd[0].t,o=i.r,s=i.theta,l=a.hoverPoints(t,e,r,n);if(l&&!1!==l[0].index){var u=l[0];if(void 0===u.index)return l;var c=t.subplot,h=u.cd[u.index],p=u.trace;if(h.r=o[u.index],h.theta=s[u.index],c.isPtInside(h))return u.xLabelVal=void 0,u.yLabelVal=void 0,f(h,p,c,u),l}},selectPoints:a.selectPoints,meta:{}}},{"../../lib":703,"../../plots/cartesian/axes":751,"../../plots/polar":815,"../scatter/calc":1076,"../scatter/colorscale_calc":1078,"../scatter/marker_colorbar":1092,"../scattergl":1127,"../scattergl/constants":1124,"../scattergl/convert":1125,"../scatterpolar/hover":1139,"./attributes":1142,"./defaults":1143,"fast-isnumeric":224,"point-cluster":464}],1145:[function(t,e,r){"use strict";var n=t("../../components/fx/hovertemplate_attributes"),i=t("../scatter/attributes"),a=t("../../plots/attributes"),o=t("../../components/colorscale/attributes"),s=t("../../components/drawing/attributes").dash,l=t("../../lib/extend").extendFlat,u=i.marker,c=i.line,f=u.line;e.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:l({},i.mode,{dflt:"markers"}),text:l({},i.text,{}),hovertext:l({},i.hovertext,{}),line:{color:c.color,width:c.width,dash:s,shape:l({},c.shape,{values:["linear","spline"]}),smoothing:c.smoothing,editType:"calc"},connectgaps:i.connectgaps,cliponaxis:i.cliponaxis,fill:l({},i.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:i.fillcolor,marker:l({symbol:u.symbol,opacity:u.opacity,maxdisplayed:u.maxdisplayed,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:l({width:f.width,editType:"calc"},o("marker.line")),gradient:u.gradient,editType:"calc"},o("marker")),textfont:i.textfont,textposition:i.textposition,selected:i.selected,unselected:i.unselected,hoverinfo:l({},a.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:i.hoveron,hovertemplate:n()}},{"../../components/colorscale/attributes":587,"../../components/drawing/attributes":600,"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../../plots/attributes":748,"../scatter/attributes":1075}],1146:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=["a","b","c"],u={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var r,c,f,h,p,d,v=t._fullLayout[e.subplot],g=v.sum,m=e.sum||g,y={a:e.a,b:e.b,c:e.c};for(r=0;r"),s.hovertemplate=p.hovertemplate,o}function y(t,e){g.push(t._hovertitle+": "+i.tickText(t,e,"hover").text)}}},{"../../plots/cartesian/axes":751,"../scatter/hover":1085}],1150:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../scatter/select"),eventData:t("./event_data"),moduleType:"trace",name:"scatterternary",basePlotModule:t("../../plots/ternary"),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/ternary":827,"../scatter/marker_colorbar":1092,"../scatter/select":1095,"../scatter/style":1097,"./attributes":1145,"./calc":1146,"./defaults":1147,"./event_data":1148,"./hover":1149,"./plot":1151}],1151:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e,r){var i=e.plotContainer;i.select(".scatterlayer").selectAll("*").remove();var a={xaxis:e.xaxis,yaxis:e.yaxis,plot:i,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null},o=e.layers.frontplot.select("g.scatterlayer");n(t,a,r,o)}},{"../scatter/plot":1094}],1152:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/fx/hovertemplate_attributes"),o=t("../scattergl/attributes"),s=t("../../plots/cartesian/constants").idRegex,l=t("../../plot_api/plot_template").templatedArray,u=t("../../lib/extend").extendFlat,c=n.marker,f=c.line,h=u(i("marker.line",{editTypeOverride:"calc"}),{width:u({},f.width,{editType:"calc"}),editType:"calc"}),p=u(i("marker"),{symbol:c.symbol,size:u({},c.size,{editType:"markerSize"}),sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,opacity:c.opacity,colorbar:c.colorbar,line:h,editType:"calc"});function d(t){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:s[t],editType:"plot"}}}p.color.editType=p.cmin.editType=p.cmax.editType="style",e.exports={dimensions:l("dimension",{visible:{valType:"boolean",dflt:!0,editType:"calc"},label:{valType:"string",editType:"calc"},values:{valType:"data_array",editType:"calc+clearAxisTypes"},axis:{type:{valType:"enumerated",values:["linear","log","date","category"],editType:"calc+clearAxisTypes"},matches:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc+clearAxisTypes"},editType:"calc+clearAxisTypes"}),text:u({},o.text,{}),hovertext:u({},o.hovertext,{}),hovertemplate:a(),marker:p,xaxes:d("x"),yaxes:d("y"),diagonal:{visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},showupperhalf:{valType:"boolean",dflt:!0,editType:"calc"},showlowerhalf:{valType:"boolean",dflt:!0,editType:"calc"},selected:{marker:o.selected.marker,editType:"calc"},unselected:{marker:o.unselected.marker,editType:"calc"},opacity:o.opacity}},{"../../components/colorscale/attributes":587,"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../../plot_api/plot_template":741,"../../plots/cartesian/constants":757,"../scatter/attributes":1075,"../scattergl/attributes":1123}],1153:[function(t,e,r){"use strict";var n=t("regl-line2d"),i=t("../../registry"),a=t("../../lib/prepare_regl"),o=t("../../plots/get_data").getModuleCalcData,s=t("../../plots/cartesian"),l=t("../../plots/cartesian/axis_ids").getFromId,u=t("../../plots/cartesian/axes").shouldShowZeroLine,c="splom";function f(t,e,r){for(var n=r.matrixOptions.data.length,i=e._visibleDims,a=r.viewOpts.ranges=new Array(n),o=0;oa&&l?r._splomSubplots[E]=1:i-1,T="lasso"===y||"select"===y||!!h.selectedpoints||A,M=!0;if(T){var E=h._length;if(h.selectedpoints){d.selectBatch=h.selectedpoints;var S=h.selectedpoints,C={};for(a=0;ag?2*(x.sizeAvg||Math.max(x.size,3)):u(e,y),n=0;n2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function d(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function v(t,e){var r=t.fullSceneLayout,i=t.dataScale,c=e._len,f={};function v(t,e){var n=r[e],o=i[u[e]];return a.simpleMap(t,function(t){return n.d2l(t)*o})}f.vectors=l(v(e.u,"xaxis"),v(e.v,"yaxis"),v(e.w,"zaxis"),c);var g=h(e.x.slice(0,c)),m=h(e.y.slice(0,c)),y=h(e.z.slice(0,c));if(g.length*m.length*y.length>c)return{positions:[],cells:[]};var x=v(g,"xaxis"),b=v(m,"yaxis"),_=v(y,"zaxis");if(f.meshgrid=[x,b,_],e.starts){var w=e._slen;f.startingPositions=l(v(e.starts.x.slice(0,w),"xaxis"),v(e.starts.y.slice(0,w),"yaxis"),v(e.starts.z.slice(0,w),"zaxis"))}else{for(var k=b[0],A=p(x),T=p(_),M=new Array(A.length*T.length),E=0,S=0;S=0};v?(r=Math.min(d.length,m.length),s=function(t){return k(d[t])&&A(t)},u=function(t){return String(d[t])}):(r=Math.min(g.length,m.length),s=function(t){return k(g[t])&&A(t)},u=function(t){return String(g[t])}),x&&(r=Math.min(r,y.length));for(var T=0;T1){for(var C=a.randstr(),L=0;L0,h=n.select(r),p=h.selectAll("g.slice"),m=e[0],y=m.trace,w=m.hierarchy,M=x(w,y.level),E=y.maxdepth>=0?y.maxdepth:1/0,S=o._size,C=y.domain,L=S.w*(C.x[1]-C.x[0]),O=S.h*(C.y[1]-C.y[0]),I=.5*Math.min(L,O),P=m.cx=S.l+S.w*(C.x[1]+C.x[0])/2,D=m.cy=S.t+S.h*(1-C.y[0])-O/2;if(!M)return p.remove();var z=null,R={};c&&p.each(function(t){R[k(t)]={rpx0:t.rpx0,rpx1:t.rpx1,x0:t.x0,x1:t.x1,transform:t.transform},!z&&_(t)&&(z=t)});var F=function(t){return i.partition().size([2*Math.PI,t.height+1])(t)}(M).descendants(),B=M.height+1,N=0,j=E;m.hasMultipleRoots&&b(M)&&(F=F.slice(1),B-=1,N=1,j+=1),F=F.filter(function(t){return t.y1<=j});var V=Math.min(B,E),U=function(t){return(t-N)/V*I},H=function(t,e){return[t*Math.cos(e),-t*Math.sin(e)]},q=function(t){return u.pathAnnulus(t.rpx0,t.rpx1,t.x0,t.x1,P,D)},G=function(t){return P+t.pxmid[0]*t.transform.rCenter+(t.transform.x||0)},W=function(t){return D+t.pxmid[1]*t.transform.rCenter+(t.transform.y||0)};(p=p.data(F,function(t){return k(t)})).enter().append("g").classed("slice",!0),c?p.exit().transition().each(function(){var t=n.select(this),e=t.select("path.surface");e.transition().attrTween("d",function(t){var e=function(t){var e,r=k(t),i=R[r],a=R[k(M)];if(a){var o=t.x1>a.x1?2*Math.PI:0;e=t.rpx1Y?2*Math.PI:0;e={x0:a,x1:a}}else e={rpx0:I,rpx1:I},u.extendFlat(e,$(t));else e={rpx0:0,rpx1:0};else e={x0:0,x1:0};return n.interpolate(e,i)}(t);return function(t){return q(e(t))}}):a.attr("d",q),i.call(T,t,e).call(A,t,{isTransitioning:t._transitioning}),a.call(g,r,y);var h=u.ensureSingle(i,"g","slicetext"),p=u.ensureSingle(h,"text","",function(t){t.attr("data-notex",1)});p.text(function(t,e,r){var n=e.textinfo;if(!n||"none"===n)return"";var i=t.data.data,a=r.separators,o=n.split("+"),s=function(t){return-1!==o.indexOf(t)},l=[];if(s("label")&&i.label&&l.push(i.label),i.hasOwnProperty("v")&&s("value")&&l.push(v(i.v,a)),s("text")){var c=u.castOption(e,i.i,"text");u.isValidTextValue(c)&&l.push(c)}return l.join("
")}(r,y,o)).classed("slicetext",!0).attr("text-anchor","middle").call(l.font,b(r)?function(t,e,r){var n=e.data.data.i,i=u.castOption(t,n,"outsidetextfont.color")||u.castOption(t,n,"textfont.color")||r.color,a=u.castOption(t,n,"outsidetextfont.family")||u.castOption(t,n,"textfont.family")||r.family,o=u.castOption(t,n,"outsidetextfont.size")||u.castOption(t,n,"textfont.size")||r.size;return{color:i,family:a,size:o}}(y,r,o.font):function(t,e,r){var n=e.data.data,i=n.i,a=u.castOption(t,i,"insidetextfont.color");!a&&t._input.textfont&&(a=u.castOption(t._input,i,"textfont.color"));var o=u.castOption(t,i,"insidetextfont.family")||u.castOption(t,i,"textfont.family")||r.family,l=u.castOption(t,i,"insidetextfont.size")||u.castOption(t,i,"textfont.size")||r.size;return{color:a||s.contrast(n.color),family:o,size:l}}(y,r,o.font)).call(f.convertToTspans,t);var x=l.bBox(p.node());r.transform=d(x,r,m),r.translateX=G(r),r.translateY=W(r);var _=function(t,e){return"translate("+t.translateX+","+t.translateY+")"+(t.transform.scale<1?"scale("+t.transform.scale+")":"")+(t.transform.rotate?"rotate("+t.transform.rotate+")":"")+"translate("+-(e.left+e.right)/2+","+-(e.top+e.bottom)/2+")"};c?p.transition().attrTween("transform",function(t){var e=function(t){var e,r=R[k(t)],i=t.transform;if(r)e=r;else if(e={rpx1:t.rpx1,transform:{scale:0,rotate:i.rotate,rCenter:i.rCenter,x:i.x,y:i.y}},z)if(t.parent)if(Y){var a=t.x1>Y?2*Math.PI:0;e.x0=e.x1=a}else u.extendFlat(e,$(t));else e.x0=e.x1=0;else e.x0=e.x1=0;var o=n.interpolate(e.rpx1,t.rpx1),s=n.interpolate(e.x0,t.x0),l=n.interpolate(e.x1,t.x1),c=n.interpolate(e.transform.scale,i.scale),f=n.interpolate(e.transform.rotate,i.rotate),h=0===i.rCenter?3:0===e.transform.rCenter?1/3:1,p=n.interpolate(e.transform.rCenter,i.rCenter);return function(t){var e=o(t),r=s(t),n=l(t),a=function(t){return p(Math.pow(t,h))}(t),u={pxmid:H(e,(r+n)/2),transform:{rCenter:a,x:i.x,y:i.y}},d={rpx1:o(t),translateX:G(u),translateY:W(u),transform:{scale:c(t),rotate:f(t),rCenter:a}};return d}}(t);return function(t){return _(e(t),x)}}):p.attr("transform",_(r,x))})}function x(t,e){var r;return e&&t.eachAfter(function(t){if(k(t)===e)return r=t.copy()}),r||t}function b(t){var e=t.data.data;return""===e.pid}function _(t){return!t.parent}function w(t){return!t.children}function k(t){var e=t.data.data;return e.id}function A(t,e,r){var n=t.datum(),i=(r||{}).isTransitioning;h(t,i||w(n)||b(n)?null:"pointer")}function T(t,e,r){var i=r[0],s=i.trace;"_hasHoverLabel"in s||(s._hasHoverLabel=!1),"_hasHoverEvent"in s||(s._hasHoverEvent=!1),t.on("mouseover",function(t){var r=e._fullLayout;if(!e._dragging&&!1!==r.hovermode){var a=e._fullData[s.index],l=t.data.data,c=l.i,f=function(t){return u.castOption(a,c,t)},h=f("hovertemplate"),p=o.castHoverinfo(a,r,c),d=r.separators;if(h||p&&"none"!==p&&"skip"!==p){var g=t.rInscribed,m=i.cx+t.pxmid[0]*(1-g),y=i.cy+t.pxmid[1]*(1-g),x={},b=[],_=[],w=function(t){return-1!==b.indexOf(t)};if(p&&(b="all"===p?a._module.attributes.hoverinfo.flags:p.split("+")),x.label=l.label,w("label")&&x.label&&_.push(x.label),l.hasOwnProperty("v")&&(x.value=l.v,x.valueLabel=v(x.value,d),w("value")&&_.push(x.valueLabel)),x.text=f("hovertext")||f("text"),w("text")){var k=x.text;u.isValidTextValue(k)&&_.push(k)}o.loneHover({trace:a,x0:m-g*t.rpx1,x1:m+g*t.rpx1,y:y,idealAlign:t.pxmid[0]<0?"left":"right",text:_.join("
"),name:h||w("name")?a.name:void 0,color:f("hoverlabel.bgcolor")||l.color,borderColor:f("hoverlabel.bordercolor"),fontFamily:f("hoverlabel.font.family"),fontSize:f("hoverlabel.font.size"),fontColor:f("hoverlabel.font.color"),nameLength:f("hoverlabel.namelength"),textAlign:f("hoverlabel.align"),hovertemplate:h,hovertemplateLabels:x,eventData:[M(t,a)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e}),s._hasHoverLabel=!0}s._hasHoverEvent=!0,e.emit("plotly_hover",{points:[M(t,a)],event:n.event})}}),t.on("mouseout",function(t){var r=e._fullLayout,i=e._fullData[s.index],a=n.select(this).datum();s._hasHoverEvent&&(t.originalEvent=n.event,e.emit("plotly_unhover",{points:[M(a,i)],event:n.event}),s._hasHoverEvent=!1),s._hasHoverLabel&&(o.loneUnhover(r._hoverlayer.node()),s._hasHoverLabel=!1)}),t.on("click",function(t){var r=e._fullLayout,l=e._fullData[s.index],u=c.triggerHandler(e,"plotly_sunburstclick",{points:[M(t,l)],event:n.event});if(!1===u||w(t)||b(t))r.hovermode&&(e._hoverdata=[M(t,l)],o.click(e,n.event));else if(!e._dragging&&!e._transitioning){a.call("_storeDirectGUIEdit",l,r._tracePreGUI[l.uid],{level:l.level});var f=i.hierarchy,h=k(t),p=_(t)?function(t,e){var r;return t.eachAfter(function(t){for(var n=t.children||[],i=0;i0;if((a=l.selectAll("g.trace.sunburst").data(e,function(t){return t[0].trace.uid})).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),a.order(),c){i&&(o=i());var f=n.transition().duration(r.duration).ease(r.easing).each("end",function(){o&&o()}).each("interrupt",function(){o&&o()});f.each(function(){l.selectAll("g.trace").each(function(e){y(t,e,this,r)})})}else a.each(function(e){y(t,e,this,r)});u&&a.exit().remove()}},{"../../components/color":580,"../../components/drawing":601,"../../components/fx":619,"../../components/fx/helpers":615,"../../lib":703,"../../lib/events":692,"../../lib/setcursor":723,"../../lib/svg_text_utils":727,"../../registry":831,"../pie/helpers":1054,"../pie/plot":1058,"./constants":1164,"./style":1170,d3:157,"d3-hierarchy":150}],1170:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/color"),a=t("../../lib");function o(t,e,r){var n=e.data.data,o=!e.children,s=n.i,l=a.castOption(r,s,"marker.line.color")||i.defaultLine,u=a.castOption(r,s,"marker.line.width")||0;t.style("stroke-width",u).call(i.fill,n.color).call(i.stroke,l).style("opacity",o?r.leaf.opacity:null)}e.exports={style:function(t){t._fullLayout._sunburstlayer.selectAll(".trace").each(function(t){var e=n.select(this),r=t[0],i=r.trace;e.style("opacity",i.opacity),e.selectAll("path.surface").each(function(t){n.select(this).call(o,t,i)})})},styleOne:o}},{"../../components/color":580,"../../lib":703,d3:157}],1171:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/attributes"),a=t("../../components/fx/hovertemplate_attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll;function u(t){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:n.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:n.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var c=e.exports=l(s({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:a(),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},i("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:u(),y:u(),z:u()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},_deprecated:{zauto:s({},i.zauto,{}),zmin:s({},i.zmin,{}),zmax:s({},i.zmax,{})},hoverinfo:s({},o.hoverinfo)}),"calc","nested");c.x.editType=c.y.editType=c.z.editType="calc+clearAxisTypes",c.transforms=void 0},{"../../components/color":580,"../../components/colorscale/attributes":587,"../../components/fx/hovertemplate_attributes":618,"../../lib/extend":693,"../../plot_api/edit_types":734,"../../plots/attributes":748}],1172:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(t,e,{vals:e.surfacecolor,containerStr:"",cLetter:"c"}):n(t,e,{vals:e.z,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":588}],1173:[function(t,e,r){"use strict";var n=t("gl-surface3d"),i=t("ndarray"),a=t("ndarray-homography"),o=t("ndarray-fill"),s=t("../../lib").isArrayOrTypedArray,l=t("../../lib/gl_format_color").parseColorScale,u=t("../../lib/str2rgbarray"),c=t("../../components/colorscale").extractOpts,f=t("../heatmap/interp2d"),h=t("../heatmap/find_empties");function p(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var d=p.prototype;d.getXat=function(t,e,r,n){var i=s(this.data.x)?s(this.data.x[0])?this.data.x[e][t]:this.data.x[t]:t;return void 0===r?i:n.d2l(i,0,r)},d.getYat=function(t,e,r,n){var i=s(this.data.y)?s(this.data.y[0])?this.data.y[e][t]:this.data.y[e]:e;return void 0===r?i:n.d2l(i,0,r)},d.getZat=function(t,e,r,n){var i=this.data.z[e][t];return null===i&&this.data.connectgaps&&this.data._interpolatedZ&&(i=this.data._interpolatedZ[e][t]),void 0===r?i:n.d2l(i,0,r)},d.handlePick=function(t){if(t.object===this.surface){var e=(t.data.index[0]-1)/this.dataScaleX-1,r=(t.data.index[1]-1)/this.dataScaleY-1,n=Math.max(Math.min(Math.round(e),this.data.z[0].length-1),0),i=Math.max(Math.min(Math.round(r),this.data._ylength-1),0);t.index=[n,i],t.traceCoordinate=[this.getXat(n,i),this.getYat(n,i),this.getZat(n,i)],t.dataCoordinate=[this.getXat(n,i,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(n,i,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(n,i,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var a=0;a<3;a++){var o=t.dataCoordinate[a];null!=o&&(t.dataCoordinate[a]*=this.scene.dataScale[a])}var s=this.data.hovertext||this.data.text;return Array.isArray(s)&&s[i]&&void 0!==s[i][n]?t.textLabel=s[i][n]:t.textLabel=s||"",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}};var v=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function g(t,e){if(t0){r=v[n];break}return r}function x(t,e){if(!(t<1||e<1)){for(var r=m(t),n=m(e),i=1,a=0;aw;)n--,n/=y(n),++n<_&&(n=w);var i=Math.round(n/t);return i>1?i:1},d.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,n=t[0].shape[0],o=t[0].shape[1],s=0|Math.floor(t[0].shape[0]*e+1),l=0|Math.floor(t[0].shape[1]*r+1),u=1+n+1,c=1+o+1,f=i(new Float32Array(u*c),[u,c]),h=0;h0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(i[t]=!0,e=this.contourStart[t];ea&&(this.minValues[e]=a),this.maxValues[e]",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1180:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib/extend").extendFlat,a=t("fast-isnumeric");function o(t){if(Array.isArray(t)){for(var e=0,r=0;r=e||u===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=u,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=u+1,a=0);return n}e.exports=function(t,e){var r=l(e.cells.values),p=function(t){return t.slice(e.header.values.length,t.length)},d=l(e.header.values);d.length&&!d[0].length&&(d[0]=[""],d=l(d));var v=d.concat(p(r).map(function(){return u((d[0]||[""]).length)})),g=e.domain,m=Math.floor(t._fullLayout._size.w*(g.x[1]-g.x[0])),y=Math.floor(t._fullLayout._size.h*(g.y[1]-g.y[0])),x=e.header.values.length?v[0].map(function(){return e.header.height}):[n.emptyHeaderHeight],b=r.length?r[0].map(function(){return e.cells.height}):[],_=x.reduce(s,0),w=y-_,k=w+n.uplift,A=h(b,k),T=h(x,_),M=f(T,[]),E=f(A,M),S={},C=e._fullInput.columnorder.concat(p(r.map(function(t,e){return e}))),L=v.map(function(t,r){var n=Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return a(n)?Number(n):1}),O=L.reduce(s,0);L=L.map(function(t){return t/O*m});var I=Math.max(o(e.header.line.width),o(e.cells.line.width)),P={key:e.uid+t._context.staticPlot,translateX:g.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-g.y[1]),size:t._fullLayout._size,width:m,maxLineWidth:I,height:y,columnOrder:C,groupHeight:y,rowBlocks:E,headerRowBlocks:M,scrollY:0,cells:i({},e.cells,{values:r}),headerCells:i({},e.header,{values:v}),gdColumns:v.map(function(t){return t[0]}),gdColumnsOriginalOrder:v.map(function(t){return t[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:v.map(function(t,e){var r=S[t];S[t]=(r||0)+1;var n=t+"__"+S[t];return{key:n,label:t,specIndex:e,xIndex:C[e],xScale:c,x:void 0,calcdata:void 0,columnWidth:L[e]}})};return P.columns.forEach(function(t){t.calcdata=P,t.x=c(t)}),P}},{"../../lib/extend":693,"./constants":1179,"fast-isnumeric":224}],1181:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=n({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:n({},t.calcdata,{cells:t.calcdata.headerCells})}),i=n({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),a=n({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks});return[i,a,r]},r.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0,n=e?r+e.rows.length:0;return[r,n]}(t);return(t.values||[]).slice(e[0],e[1]).map(function(r,n){var i="string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:n+i,key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}})}},{"../../lib/extend":693}],1182:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../plots/domain").defaults;e.exports=function(t,e,r,o){function s(r,a){return n.coerce(t,e,i,r,a)}a(e,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),n.coerceFont(s,"header.font",n.extendFlat({},o.font)),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort(function(t,e){return t-e}),o=i.map(function(t){return a.indexOf(t)}),s=o.length;s/i),l=!o||s;t.mayHaveMarkup=o&&a.match(/[<&>]/);var u,c="string"==typeof(u=a)&&u.match(n.latexCheck);t.latex=c;var f,h,p=c?"":_(t.calcdata.cells.prefix,e,r)||"",d=c?"":_(t.calcdata.cells.suffix,e,r)||"",v=c?null:_(t.calcdata.cells.format,e,r)||null,g=p+(v?i.format(v)(t.value):t.value)+d;if(t.wrappingNeeded=!t.wrapped&&!l&&!c&&(f=b(g)),t.cellHeightMayIncrease=s||c||t.mayHaveMarkup||(void 0===f?b(g):f),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var m=" "===n.wrapSplitCharacter?g.replace(/
i&&n.push(a),i+=l}return n}(i,l,s);1===u.length&&(u[0]===i.length-1?u.unshift(u[0]-1):u.push(u[0]+1)),u[0]%2&&u.reverse(),e.each(function(t,e){t.page=u[e],t.scrollY=l}),e.attr("transform",function(t){var e=P(t.rowBlocks,t.page)-t.scrollY;return"translate(0 "+e+")"}),t&&(S(t,r,e,u,n.prevPages,n,0),S(t,r,e,u,n.prevPages,n,1),m(r,t))}}function E(t,e,r,a){return function(o){var s=o.calcdata?o.calcdata:o,l=e.filter(function(t){return s.key===t.key}),u=r||s.scrollbarState.dragMultiplier,c=s.scrollY;s.scrollY=void 0===a?s.scrollY+u*i.event.dy:a;var f=l.selectAll("."+n.cn.yColumn).selectAll("."+n.cn.columnBlock).filter(k);return M(t,f,l),s.scrollY===c}}function S(t,e,r,n,i,a,o){var s=n[o]!==i[o];s&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout(function(){var a=r.filter(function(t,e){return e===o&&n[e]!==i[e]});y(t,e,a,r),i[o]=n[o]}))}function C(t,e,r,a){return function(){var o=i.select(e.parentNode);o.each(function(t){var e=t.fragments;o.selectAll("tspan.line").each(function(t,r){e[r].width=this.getComputedTextLength()});var r,i,a=e[e.length-1].width,s=e.slice(0,-1),l=[],u=0,c=t.column.columnWidth-2*n.cellPad;for(t.value="";s.length;)r=s.shift(),i=r.width+a,u+i>c&&(t.value+=l.join(n.wrapSpacer)+n.lineBreaker,l=[],u=0),l.push(r.text),u+=i;u&&(t.value+=l.join(n.wrapSpacer)),t.wrapped=!0}),o.selectAll("tspan.line").remove(),x(o.select("."+n.cn.cellText),r,t,a),i.select(e.parentNode.parentNode).call(I)}}function L(t,e,r,a,o){return function(){if(!o.settledY){var s=i.select(e.parentNode),l=R(o),u=o.key-l.firstRowIndex,c=l.rows[u].rowHeight,f=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*n.cellPad:c,h=Math.max(f,c),p=h-l.rows[u].rowHeight;p&&(l.rows[u].rowHeight=h,t.selectAll("."+n.cn.columnCell).call(I),M(null,t.filter(k),0),m(r,a,!0)),s.attr("transform",function(){var t=this.parentNode,e=t.getBoundingClientRect(),r=i.select(this.parentNode).select("."+n.cn.cellRect).node().getBoundingClientRect(),a=this.transform.baseVal.consolidate(),s=r.top-e.top+(a?a.matrix.f:n.cellPad);return"translate("+O(o,i.select(this.parentNode).select("."+n.cn.cellTextHolder).node().getBoundingClientRect().width)+" "+s+")"}),o.settledY=!0}}}function O(t,e){switch(t.align){case"left":return n.cellPad;case"right":return t.column.columnWidth-(e||0)-n.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return n.cellPad}}function I(t){t.attr("transform",function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce(function(t,e){return t+D(e,1/0)},0),r=R(t),n=D(r,t.key),i=n+e;return"translate(0 "+i+")"}).selectAll("."+n.cn.cellRect).attr("height",function(t){return(e=R(t),r=t.key,e.rows[r-e.firstRowIndex]).rowHeight;var e,r})}function P(t,e){for(var r=0,n=e-1;n>=0;n--)r+=z(t[n]);return r}function D(t,e){for(var r=0,n=0;n0){var y,x,b,_,w,k=t.xa,A=t.ya;"h"===h.orientation?(w=e,y="y",b=A,x="x",_=k):(w=r,y="x",b=k,x="y",_=A);var T=f[t.index];if(w>=T.span[0]&&w<=T.span[1]){var M=n.extendFlat({},t),E=_.c2p(w,!0),S=o.getKdeValue(T,h,w),C=o.getPositionOnKdePath(T,h,E),L=b._offset,O=b._length;M[y+"0"]=C[0],M[y+"1"]=C[1],M[x+"0"]=M[x+"1"]=E,M[x+"Label"]=x+": "+i.hoverLabelText(_,w)+", "+f[0].t.labels.kde+" "+S.toFixed(3),M.spikeDistance=m[0].spikeDistance;var I=y+"Spike";M[I]=m[0][I],m[0].spikeDistance=void 0,m[0][I]=void 0,M.hovertemplate=!1,g.push(M),(c={stroke:t.color})[y+"1"]=n.constrain(L+C[0],L,L+O),c[y+"2"]=n.constrain(L+C[1],L,L+O),c[x+"1"]=c[x+"2"]=_._offset+E}}d&&(g=g.concat(m))}-1!==p.indexOf("points")&&(u=a.hoverOnPoints(t,e,r));var P=l.selectAll(".violinline-"+h.uid).data(c?[0]:[]);return P.enter().append("line").classed("violinline-"+h.uid,!0).attr("stroke-width",1.5),P.exit().remove(),P.attr(c),"closest"===s?u?[u]:g:u?(g.push(u),g):g}},{"../../lib":703,"../../plots/cartesian/axes":751,"../box/hover":869,"./helpers":1189}],1191:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("../box/defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../box/select"),moduleType:"trace",name:"violin",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}},{"../../plots/cartesian":762,"../box/defaults":867,"../box/select":874,"../scatter/style":1097,"./attributes":1185,"./calc":1186,"./cross_trace_calc":1187,"./defaults":1188,"./hover":1190,"./layout_attributes":1192,"./layout_defaults":1193,"./plot":1194,"./style":1195}],1192:[function(t,e,r){"use strict";var n=t("../box/layout_attributes"),i=t("../../lib").extendFlat;e.exports={violinmode:i({},n.boxmode,{}),violingap:i({},n.boxgap,{}),violingroupgap:i({},n.boxgroupgap,{})}},{"../../lib":703,"../box/layout_attributes":871}],1193:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("../box/layout_defaults");e.exports=function(t,e,r){a._supply(t,e,r,function(r,a){return n.coerce(t,e,i,r,a)},"violin")}},{"../../lib":703,"../box/layout_defaults":872,"./layout_attributes":1192}],1194:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../box/plot"),s=t("../scatter/line_points"),l=t("./helpers");e.exports=function(t,e,r,u){var c=t._fullLayout,f=e.xaxis,h=e.yaxis;function p(t){var e=s(t,{xaxis:f,yaxis:h,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0});return a.smoothopen(e[0],1)}i.makeTraceGroups(u,r,"trace violins").each(function(t){var r=n.select(this),a=t[0],s=a.t,u=a.trace;if(e.isRangePlot||(a.node3=r),!0!==u.visible||s.empty)r.remove();else{var d=s.bPos,v=s.bdPos,g=e[s.valLetter+"axis"],m=e[s.posLetter+"axis"],y="both"===u.side,x=y||"positive"===u.side,b=y||"negative"===u.side,_=r.selectAll("path.violin").data(i.identity);_.enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin"),_.exit().remove(),_.each(function(t){var e,r,i,a,o,l,f,h,_=n.select(this),w=t.density,k=w.length,A=t.pos+d,T=m.c2p(A);if(u.width)e=s.maxKDE/v;else{var M=c._violinScaleGroupStats[u.scalegroup];e="count"===u.scalemode?M.maxKDE/v*(M.maxCount/t.pts.length):M.maxKDE/v}if(x){for(f=new Array(k),o=0;o0)l.extraText=g(v)+" "+o.increasing;else{if(!(v<0))return;l.extraText="("+g(-v)+") "+o.decreasing}l.extraText+="
Initial: "+g(d.b+d.s-v)}return l.color=function(t,e){var r=t[e.dir].marker,n=r.color,a=r.line.color,o=r.line.width;return i(n)?n:i(a)&&o?a:void 0}(c,d),[l]}function g(t){return n(h,t)}}},{"../../components/color":580,"../../plots/cartesian/axes":751,"../bar/hover":847}],1205:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),selectPoints:t("../bar/select"),moduleType:"trace",name:"waterfall",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":762,"../bar/select":852,"./attributes":1200,"./calc":1201,"./cross_trace_calc":1202,"./defaults":1203,"./hover":1204,"./layout_attributes":1206,"./layout_defaults":1207,"./plot":1208,"./style":1209}],1206:[function(t,e,r){"use strict";e.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],1207:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a=!1;function o(r,a){return n.coerce(t,e,i,r,a)}for(var s=0;s0&&(v+=f?"M"+c[0]+","+p[1]+"V"+p[0]:"M"+c[1]+","+p[0]+"H"+c[0]),"between"!==h&&(r.isSum||o path").each(function(t){if(!t.isBlank){var e=s[t.dir].marker;n.select(this).call(a.fill,e.color).call(a.stroke,e.line.color).call(i.dashLine,e.line.dash,e.line.width).style("opacity",s.selectedpoints&&!t.selected?.3:1)}}),o(r,s,t),r.selectAll(".lines").each(function(){var t=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)})})}}},{"../../components/color":580,"../../components/drawing":601,"../bar/style":854,d3:157}],1210:[function(t,e,r){"use strict";var n=t("../plots/cartesian/axes"),i=t("../lib"),a=t("../plot_api/plot_schema"),o=t("./helpers").pointsAccessorFunction,s=t("../constants/numerical").BADNUM;r.moduleType="transform",r.name="aggregate";var l=r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},u=l.aggregations;function c(t,e,r,a){if(a.enabled){for(var o=a.target,l=i.nestedProperty(e,o),u=l.get(),c=n.getDataConversions(t,e,o,u),d=function(t,e){var r=t.func,n=e.d2c,i=e.c2d;switch(r){case"count":return f;case"first":return h;case"last":return p;case"sum":return function(t,e){for(var r=0,a=0;aa&&(a=c,o=u)}}return a?i(o):s};case"rms":return function(t,e){for(var r=0,a=0,o=0;o":return function(t){return h(t)>s};case">=":return function(t){return h(t)>=s};case"[]":return function(t){var e=h(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=h(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=h(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=h(t);return es[1]};case"](":return function(t){var e=h(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=h(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(h(t))};case"}{":return function(t){return-1===s.indexOf(h(t))}}}(r,y,h),b={},_={},w=0;d?(g=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set(new Array(f))},m=function(t,e){var r=b[t.astr][e];t.get()[e]=r}):(g=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set([])},m=function(t,e){var r=b[t.astr][e];t.get().push(r)}),M(g);for(var k=o(e.transforms,r),A=0;A1?"%{group} (%{trace})":"%{group}");var u=t.styles,c=o.styles=[];if(u)for(a=0;aConsensus",en:"Consensus",id:"".concat(a.default.maxBy(r,"id").id+1,"")},c=(0,o.getConsensus)(t);i=[].concat(s(e),[c]),l=[].concat(s(r),[u])}return{sequencesArray:i,sequencesInfo:l}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version=e.xhr=e.seqs=e.parser=e.newick=e.matrix=e.gff=e.fasta=e.clustal=void 0;var n=c(r(92)),i=c(r(112)),a=c(r(114)),o=c(r(116)),s=c(r(117)),l=c(r(54)),u=c(r(67));function c(t){return t&&t.__esModule?t:{default:t}}e.clustal=n.default,e.fasta=i.default,e.gff=a.default,e.matrix=o.default,e.newick=s.default,e.parser=l.default,e.seqs=u.default;var f=r(70);e.xhr=f;var h="imported";"undefined"!=typeof IO_VERSION&&(h=IO_VERSION);e.version=h},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(r(54)),i=a(r(67));function a(t){return t&&t.__esModule?t:{default:t}}var o;e.default=o={parse:function(t){var e=[];if("[object Array]"===Object.prototype.toString.call(t))var r=t;else r=t.split("\n");if(!1===r[0].slice(0,6))throw new Error("Invalid CLUSTAL Header");for(var n=0,a=1,o=0;n=e.length){var f=i.default.getMeta(u.trim());u=f.name;var h=new i.default.model(c,u,o);h.ids=f.ids||{},h.details=f.details||{};var p=Object.keys(h.ids);p.length>0&&(h.id=h.ids[p[0]]),e.push(h)}else e[o].seq+=c;o++}else console.log("parse error",s)}}else a=1;else a=1}return e}},n.default.mixin(o)},function(t,e,r){(function(e){var r;r="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},t.exports=r}).call(this,r(51))},function(t,e){t.exports=function(t){var e=r.call(t);return"[object Function]"===e||"function"==typeof t&&"[object RegExp]"!==e||"undefined"!=typeof window&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)};var r=Object.prototype.toString},function(t,e,r){var n=r(96),i=r(110);t.exports=function(t){if(!t)return{};var e={};return i(n(t).split("\n"),function(t){var r,i=t.indexOf(":"),a=n(t.slice(0,i)).toLowerCase(),o=n(t.slice(i+1));void 0===e[a]?e[a]=o:(r=e[a],"[object Array]"===Object.prototype.toString.call(r)?e[a].push(o):e[a]=[e[a],o])}),e}},function(t,e,r){"use strict";var n=r(65),i=r(71),a=r(72),o=r(73),s=r(109),l=n.call(Function.call,o());i(l,{getPolyfill:o,implementation:a,shim:s}),t.exports=l},function(t,e,r){"use strict";var n=Array.prototype.slice,i=Object.prototype.toString;t.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==i.call(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var r,a=n.call(arguments,1),o=Math.max(0,e.length-a.length),s=[],l=0;l0&&!n.call(t,0))for(var v=0;v0)for(var g=0;g=0&&"[object Function]"===n.call(t.callee)),r}},function(t,e,r){"use strict";var n=r(101),i=n("%Object%"),a=n("%TypeError%"),o=n("%String%"),s=r(102),l=r(103),u=r(104),c=r(105),f=r(66),h=r(106),p=r(108),d={ToPrimitive:h,ToBoolean:function(t){return!!t},ToNumber:function(t){return+t},ToInteger:function(t){var e=this.ToNumber(t);return s(e)?0:0!==e&&l(e)?u(e)*Math.floor(Math.abs(e)):e},ToInt32:function(t){return this.ToNumber(t)>>0},ToUint32:function(t){return this.ToNumber(t)>>>0},ToUint16:function(t){var e=this.ToNumber(t);if(s(e)||0===e||!l(e))return 0;var r=u(e)*Math.floor(Math.abs(e));return c(r,65536)},ToString:function(t){return o(t)},ToObject:function(t){return this.CheckObjectCoercible(t),i(t)},CheckObjectCoercible:function(t,e){if(null==t)throw new a(e||"Cannot call method on "+t);return t},IsCallable:f,SameValue:function(t,e){return t===e?0!==t||1/t==1/e:s(t)&&s(e)},Type:function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0},IsPropertyDescriptor:function(t){if("Object"!==this.Type(t))return!1;var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t)if(p(t,r)&&!e[r])return!1;var n=p(t,"[[Value]]"),i=p(t,"[[Get]]")||p(t,"[[Set]]");if(n&&i)throw new a("Property Descriptors may not be both accessor and data descriptors");return!0},IsAccessorDescriptor:function(t){if(void 0===t)return!1;if(!this.IsPropertyDescriptor(t))throw new a("Desc must be a Property Descriptor");return!(!p(t,"[[Get]]")&&!p(t,"[[Set]]"))},IsDataDescriptor:function(t){if(void 0===t)return!1;if(!this.IsPropertyDescriptor(t))throw new a("Desc must be a Property Descriptor");return!(!p(t,"[[Value]]")&&!p(t,"[[Writable]]"))},IsGenericDescriptor:function(t){if(void 0===t)return!1;if(!this.IsPropertyDescriptor(t))throw new a("Desc must be a Property Descriptor");return!this.IsAccessorDescriptor(t)&&!this.IsDataDescriptor(t)},FromPropertyDescriptor:function(t){if(void 0===t)return t;if(!this.IsPropertyDescriptor(t))throw new a("Desc must be a Property Descriptor");if(this.IsDataDescriptor(t))return{value:t["[[Value]]"],writable:!!t["[[Writable]]"],enumerable:!!t["[[Enumerable]]"],configurable:!!t["[[Configurable]]"]};if(this.IsAccessorDescriptor(t))return{get:t["[[Get]]"],set:t["[[Set]]"],enumerable:!!t["[[Enumerable]]"],configurable:!!t["[[Configurable]]"]};throw new a("FromPropertyDescriptor must be called with a fully populated Property Descriptor")},ToPropertyDescriptor:function(t){if("Object"!==this.Type(t))throw new a("ToPropertyDescriptor requires an object");var e={};if(p(t,"enumerable")&&(e["[[Enumerable]]"]=this.ToBoolean(t.enumerable)),p(t,"configurable")&&(e["[[Configurable]]"]=this.ToBoolean(t.configurable)),p(t,"value")&&(e["[[Value]]"]=t.value),p(t,"writable")&&(e["[[Writable]]"]=this.ToBoolean(t.writable)),p(t,"get")){var r=t.get;if(void 0!==r&&!this.IsCallable(r))throw new TypeError("getter must be a function");e["[[Get]]"]=r}if(p(t,"set")){var n=t.set;if(void 0!==n&&!this.IsCallable(n))throw new a("setter must be a function");e["[[Set]]"]=n}if((p(e,"[[Get]]")||p(e,"[[Set]]"))&&(p(e,"[[Value]]")||p(e,"[[Writable]]")))throw new a("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}};t.exports=d},function(t,e,r){"use strict";var n=Object.getOwnPropertyDescriptor?function(){return Object.getOwnPropertyDescriptor(arguments,"callee").get}():function(){throw new TypeError},i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,a=Object.getPrototypeOf||function(t){return t.__proto__},o=void 0,s="undefined"==typeof Uint8Array?void 0:a(Uint8Array),l={"$ %Array%":Array,"$ %ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"$ %ArrayBufferPrototype%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer.prototype,"$ %ArrayIteratorPrototype%":i?a([][Symbol.iterator]()):void 0,"$ %ArrayPrototype%":Array.prototype,"$ %ArrayProto_entries%":Array.prototype.entries,"$ %ArrayProto_forEach%":Array.prototype.forEach,"$ %ArrayProto_keys%":Array.prototype.keys,"$ %ArrayProto_values%":Array.prototype.values,"$ %AsyncFromSyncIteratorPrototype%":void 0,"$ %AsyncFunction%":void 0,"$ %AsyncFunctionPrototype%":void 0,"$ %AsyncGenerator%":void 0,"$ %AsyncGeneratorFunction%":void 0,"$ %AsyncGeneratorPrototype%":void 0,"$ %AsyncIteratorPrototype%":o&&i&&Symbol.asyncIterator?o[Symbol.asyncIterator]():void 0,"$ %Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"$ %Boolean%":Boolean,"$ %BooleanPrototype%":Boolean.prototype,"$ %DataView%":"undefined"==typeof DataView?void 0:DataView,"$ %DataViewPrototype%":"undefined"==typeof DataView?void 0:DataView.prototype,"$ %Date%":Date,"$ %DatePrototype%":Date.prototype,"$ %decodeURI%":decodeURI,"$ %decodeURIComponent%":decodeURIComponent,"$ %encodeURI%":encodeURI,"$ %encodeURIComponent%":encodeURIComponent,"$ %Error%":Error,"$ %ErrorPrototype%":Error.prototype,"$ %eval%":eval,"$ %EvalError%":EvalError,"$ %EvalErrorPrototype%":EvalError.prototype,"$ %Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"$ %Float32ArrayPrototype%":"undefined"==typeof Float32Array?void 0:Float32Array.prototype,"$ %Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"$ %Float64ArrayPrototype%":"undefined"==typeof Float64Array?void 0:Float64Array.prototype,"$ %Function%":Function,"$ %FunctionPrototype%":Function.prototype,"$ %Generator%":void 0,"$ %GeneratorFunction%":void 0,"$ %GeneratorPrototype%":void 0,"$ %Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"$ %Int8ArrayPrototype%":"undefined"==typeof Int8Array?void 0:Int8Array.prototype,"$ %Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"$ %Int16ArrayPrototype%":"undefined"==typeof Int16Array?void 0:Int8Array.prototype,"$ %Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"$ %Int32ArrayPrototype%":"undefined"==typeof Int32Array?void 0:Int32Array.prototype,"$ %isFinite%":isFinite,"$ %isNaN%":isNaN,"$ %IteratorPrototype%":i?a(a([][Symbol.iterator]())):void 0,"$ %JSON%":JSON,"$ %JSONParse%":JSON.parse,"$ %Map%":"undefined"==typeof Map?void 0:Map,"$ %MapIteratorPrototype%":"undefined"!=typeof Map&&i?a((new Map)[Symbol.iterator]()):void 0,"$ %MapPrototype%":"undefined"==typeof Map?void 0:Map.prototype,"$ %Math%":Math,"$ %Number%":Number,"$ %NumberPrototype%":Number.prototype,"$ %Object%":Object,"$ %ObjectPrototype%":Object.prototype,"$ %ObjProto_toString%":Object.prototype.toString,"$ %ObjProto_valueOf%":Object.prototype.valueOf,"$ %parseFloat%":parseFloat,"$ %parseInt%":parseInt,"$ %Promise%":"undefined"==typeof Promise?void 0:Promise,"$ %PromisePrototype%":"undefined"==typeof Promise?void 0:Promise.prototype,"$ %PromiseProto_then%":"undefined"==typeof Promise?void 0:Promise.prototype.then,"$ %Promise_all%":"undefined"==typeof Promise?void 0:Promise.all,"$ %Promise_reject%":"undefined"==typeof Promise?void 0:Promise.reject,"$ %Promise_resolve%":"undefined"==typeof Promise?void 0:Promise.resolve,"$ %Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"$ %RangeError%":RangeError,"$ %RangeErrorPrototype%":RangeError.prototype,"$ %ReferenceError%":ReferenceError,"$ %ReferenceErrorPrototype%":ReferenceError.prototype,"$ %Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"$ %RegExp%":RegExp,"$ %RegExpPrototype%":RegExp.prototype,"$ %Set%":"undefined"==typeof Set?void 0:Set,"$ %SetIteratorPrototype%":"undefined"!=typeof Set&&i?a((new Set)[Symbol.iterator]()):void 0,"$ %SetPrototype%":"undefined"==typeof Set?void 0:Set.prototype,"$ %SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"$ %SharedArrayBufferPrototype%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer.prototype,"$ %String%":String,"$ %StringIteratorPrototype%":i?a(""[Symbol.iterator]()):void 0,"$ %StringPrototype%":String.prototype,"$ %Symbol%":i?Symbol:void 0,"$ %SymbolPrototype%":i?Symbol.prototype:void 0,"$ %SyntaxError%":SyntaxError,"$ %SyntaxErrorPrototype%":SyntaxError.prototype,"$ %ThrowTypeError%":n,"$ %TypedArray%":s,"$ %TypedArrayPrototype%":s?s.prototype:void 0,"$ %TypeError%":TypeError,"$ %TypeErrorPrototype%":TypeError.prototype,"$ %Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"$ %Uint8ArrayPrototype%":"undefined"==typeof Uint8Array?void 0:Uint8Array.prototype,"$ %Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"$ %Uint8ClampedArrayPrototype%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray.prototype,"$ %Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"$ %Uint16ArrayPrototype%":"undefined"==typeof Uint16Array?void 0:Uint16Array.prototype,"$ %Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"$ %Uint32ArrayPrototype%":"undefined"==typeof Uint32Array?void 0:Uint32Array.prototype,"$ %URIError%":URIError,"$ %URIErrorPrototype%":URIError.prototype,"$ %WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"$ %WeakMapPrototype%":"undefined"==typeof WeakMap?void 0:WeakMap.prototype,"$ %WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet,"$ %WeakSetPrototype%":"undefined"==typeof WeakSet?void 0:WeakSet.prototype};t.exports=function(t,e){if(arguments.length>1&&"boolean"!=typeof e)throw new TypeError('"allowMissing" argument must be a boolean');var r="$ "+t;if(!(r in l))throw new SyntaxError("intrinsic "+t+" does not exist!");if(void 0===l[r]&&!e)throw new TypeError("intrinsic "+t+" exists, but is not available. Please file an issue!");return l[r]}},function(t,e){t.exports=Number.isNaN||function(t){return t!=t}},function(t,e){var r=Number.isNaN||function(t){return t!=t};t.exports=Number.isFinite||function(t){return"number"==typeof t&&!r(t)&&t!==1/0&&t!==-1/0}},function(t,e){t.exports=function(t){return t>=0?1:-1}},function(t,e){t.exports=function(t,e){var r=t%e;return Math.floor(r>=0?r:r+e)}},function(t,e,r){"use strict";var n=Object.prototype.toString,i=r(107),a=r(66),o=function(t){var e;if((e=arguments.length>1?arguments[1]:"[object Date]"===n.call(t)?String:Number)===String||e===Number){var r,o,s=e===String?["toString","valueOf"]:["valueOf","toString"];for(o=0;o1?o(t,arguments[1]):o(t)}},function(t,e){t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},function(t,e,r){"use strict";var n=r(65);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},function(t,e,r){"use strict";var n=r(71),i=r(73);t.exports=function(){var t=i();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},function(t,e,r){"use strict";var n=r(66),i=Object.prototype.toString,a=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=r),"[object Array]"===i.call(t)?function(t,e,r){for(var n=0,i=t.length;n"===a[0]||";"===a[0]){var o=a.slice(1).trim(),l=r(o.trim());o=l.name;var u=l.id||e.length,c=new n.default.model("",l.name,u);c.ids=l.ids||{},c.details=l.details||{},e.push(c)}else c.seq+=a}return e},write:function(t,e){for(var r="",i=0;i"+a.name+"\n",r+=n.default.splitNChars(a.seq,80).join("\n"),r+="\n"}return r}},a.default.mixin(s)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){t=t||{};for(var e=function(t,e,r){for(var n=[],i=ta;i?o++:o--)n.push(o);return n}(0,arguments.length,!1),r=0;r=0)break;var s=o.split(/\t/),l=s[0].trim();if("GFF"===l)break;if(2===s.length)if("startgroup"===l)e=s[1].trim();else{if("endgroup"===l){e="";continue}r[s[0]]=i.parseColor(s[1])}else if(s.length>=5){var u=i.parseLine(s);e&&(u.attributes.Parent=e),a.push(u)}}return{offset:n,colors:r,features:a}},i.parseColor=function(t){return t.indexOf(",")>=0?(0,n.rgbToHex)(t.split(",").map(function(t){return parseInt(t)})):6===t.length&&parseInt(t.charAt(0),16)<=16&&"bisque"!==t?"#"+t:t},i.parseLine=function(t){var e={attributes:{}};return e.attributes.Name=t[0].trim(),e.seqname=t[1].trim(),e.start=parseInt(t[3]),e.end=parseInt(t[4]),e.feature=t[5].trim(),"ID_NOT_SPECIFIED"===e.seqname&&(e.seqname=t[2].trim()),e}},function(t,e,r){"use strict";var n,i=r(54),a=(n=i)&&n.__esModule?n:{default:n};var o=function t(e){return this.constructor!=t?new t(e):(this.matrix={},this.parsingOrder=[],null!=e&&this.parse(e),this)};a.default.mixin(o),t.exports=o,o.prototype.parse=function(t){return t.split("\n").forEach(function(t){this.parseLine(t)}.bind(this)),this.buildMatrix(),this.matrix},o.read=function(t,e){return(new o).read(t,e)},o.parse=function(t){return(new o).parse(t)},o.prototype.parseLine=function(t){var e=t.charAt(0);if("#"!==e){this.parsingOrder.push(e);for(var r=t.substring(1).split(/\s+/).filter(function(t){return t.length>0}).map(function(t){return parseInt(t)}),n={},i=0;i=0;t--){var e=this.parsingOrder[t],r=this.matrix[e];for(var n in r)this.matrix[n][e]=r[n]}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseNhx=e.parse=void 0;var n=a(r(118)),i=a(r(119));function a(t){return t&&t.__esModule?t:{default:t}}var o={};o.parse=n.default,o.parseNhx=i.default,e.default=o,e.parse=n.default,e.parseNhx=i.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){for(var e=[],r={},n=t.split(/\s*(;|\(|\)|,|:)\s*/),i=0;i1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n.default.isString(t)?(e=x[t]||v.default,b.includes(t)?(r="#ffffff",i=1):(r="#444444",i=.75)):(e=t,r="#ffffff",i=1),a&&(r=a),o&&(i=o);var s=function(t){t["-"]||(t["-"]="#ffffff");var e=1/n.default.size(t),r=0,i={},a=[];return n.default.forEach(t,function(t,n){i[n]=r+.005,a.push([r,t]),r+=e,a.push([r,t])}),a[a.length-1][0]=1,{colormap:i,colorscale:a}}(e);return{colormap:s.colormap,colorscale:s.colorscale,textcolor:r,opacity:i}}},function(t,e,r){"use strict";t.exports={A:"#00a35c",R:"#00fc03",N:"#00eb14",D:"#00eb14",C:"#0000ff",Q:"#00f10e",E:"#00f10e",G:"#009d62",H:"#00d52a",I:"#0054ab",L:"#007b84",K:"#00ff00",M:"#009768",F:"#008778",P:"#00e01f",S:"#00d52a",T:"#00db24",W:"#00a857",Y:"#00e619",V:"#005fa0",B:"#00eb14",X:"#00b649",Z:"#00f10e"}},function(t,e,r){"use strict";t.exports={A:"#BBBBBB",B:"grey",C:"yellow",D:"red",E:"red",F:"magenta",G:"brown",H:"#00FFFF",I:"#BBBBBB",J:"#fff",K:"#00FFFF",L:"#BBBBBB",M:"#BBBBBB",N:"green",O:"#fff",P:"brown",Q:"green",R:"#00FFFF",S:"green",T:"green",U:"#fff",V:"#BBBBBB",W:"magenta",X:"grey",Y:"magenta",Z:"grey","-":"grey"}},function(t,e,r){"use strict";t.exports={A:"orange",B:"#fff",C:"green",D:"red",E:"red",F:"blue",G:"orange",H:"red",I:"green",J:"#fff",K:"red",L:"green",M:"green",N:"#fff",O:"#fff",P:"orange",Q:"#fff",R:"red",S:"orange",T:"orange",U:"#fff",V:"green",W:"blue",X:"#fff",Y:"blue",Z:"#fff"}},function(t,e,r){"use strict";t.exports={A:"#80a0f0",R:"#f01505",N:"#00ff00",D:"#c048c0",C:"#f08080",Q:"#00ff00",E:"#c048c0",G:"#f09048",H:"#15a4a4",I:"#80a0f0",L:"#80a0f0",K:"#f01505",M:"#80a0f0",F:"#80a0f0",P:"#ffff00",S:"#00ff00",T:"#00ff00",W:"#80a0f0",Y:"#15a4a4",V:"#80a0f0",B:"#fff",X:"#fff",Z:"#fff"}},function(t,e,r){"use strict";t.exports={A:"#e718e7",R:"#6f906f",N:"#1be41b",D:"#778877",C:"#23dc23",Q:"#926d92",E:"#ff00ff",G:"#00ff00",H:"#758a75",I:"#8a758a",L:"#ae51ae",K:"#a05fa0",M:"#ef10ef",F:"#986798",P:"#00ff00",S:"#36c936",T:"#47b847",W:"#8a758a",Y:"#21de21",V:"#857a85",B:"#49b649",X:"#758a75",Z:"#c936c9"}},function(t,e,r){"use strict";t.exports={A:"#ad0052",B:"#0c00f3",C:"#c2003d",D:"#0c00f3",E:"#0c00f3",F:"#cb0034",G:"#6a0095",H:"#1500ea",I:"#ff0000",J:"#fff",K:"#0000ff",L:"#ea0015",M:"#b0004f",N:"#0c00f3",O:"#fff",P:"#4600b9",Q:"#0c00f3",R:"#0000ff",S:"#5e00a1",T:"#61009e",U:"#fff",V:"#f60009",W:"#5b00a4",X:"#680097",Y:"#4f00b0",Z:"#0c00f3"}},function(t,e,r){"use strict";t.exports={A:" orange",B:" #fff",C:" green",D:" red",E:" red",F:" green",G:" orange",H:" magenta",I:" green",J:" #fff",K:" red",L:" green",M:" green",N:" magenta",O:" #fff",P:" green",Q:" magenta",R:" red",S:" orange",T:" orange",U:" #fff",V:" green",W:" green",X:" #fff",Y:" green",Z:" #fff"}},function(t,e,r){"use strict";t.exports={A:" #77dd88",B:" #fff",C:" #99ee66",D:" #55bb33",E:" #55bb33",F:" #9999ff",G:" #77dd88",H:" #5555ff",I:" #66bbff",J:" #fff",K:" #ffcc77",L:" #66bbff",M:" #66bbff",N:" #55bb33",O:" #fff",P:" #eeaaaa",Q:" #55bb33",R:" #ffcc77",S:" #ff4455",T:" #ff4455",U:" #fff",V:" #66bbff",W:" #9999ff",X:" #fff",Y:" #9999ff",Z:" #fff"}},function(t,e,r){"use strict";t.exports={A:" #64F73F",C:" #FFB340",G:" #EB413C",T:" #3C88EE",U:" #3C88EE"}},function(t,e,r){"use strict";t.exports={A:" #FF83FA",C:" #40E0D0",G:" #FF83FA",R:" #FF83FA",T:" #40E0D0",U:" #40E0D0",Y:" #40E0D0"}},function(t,e,r){"use strict";t.exports={A:"#5858a7",R:"#6b6b94",N:"#64649b",D:"#2121de",C:"#9d9d62",Q:"#8c8c73",E:"#0000ff",G:"#4949b6",H:"#60609f",I:"#ecec13",L:"#b2b24d",K:"#4747b8",M:"#82827d",F:"#c2c23d",P:"#2323dc",S:"#4949b6",T:"#9d9d62",W:"#c0c03f",Y:"#d3d32c",V:"#ffff00",B:"#4343bc",X:"#797986",Z:"#4747b8"}},function(t,e,r){"use strict";t.exports={A:"#ccff00",R:"#0000ff",N:"#cc00ff",D:"#ff0000",C:"#ffff00",Q:"#ff00cc",E:"#ff0066",G:"#ff9900",H:"#0066ff",I:"#66ff00",L:"#33ff00",K:"#6600ff",M:"#00ff00",F:"#00ff66",P:"#ffcc00",S:"#ff3300",T:"#ff6600",W:"#00ccff",Y:"#00ffcc",V:"#99ff00",B:"#fff",X:"#fff",Z:"#fff"}},function(t,e,r){"use strict";t.exports={A:"#2cd3d3",R:"#708f8f",N:"#ff0000",D:"#e81717",C:"#a85757",Q:"#3fc0c0",E:"#778888",G:"#ff0000",H:"#708f8f",I:"#00ffff",L:"#1ce3e3",K:"#7e8181",M:"#1ee1e1",F:"#1ee1e1",P:"#f60909",S:"#e11e1e",T:"#738c8c",W:"#738c8c",Y:"#9d6262",V:"#07f8f8",B:"#f30c0c",X:"#7c8383",Z:"#5ba4a4"}},function(t,e,r){"use strict";t.exports={A:"#ffafaf",R:"#6464ff",N:"#00ff00",D:"#ff0000",C:"#ffff00",Q:"#00ff00",E:"#ff0000",G:"#ff00ff",H:"#6464ff",I:"#ffafaf",L:"#ffafaf",K:"#6464ff",M:"#ffafaf",F:"#ffc800",P:"#ff00ff",S:"#00ff00",T:"#00ff00",W:"#ffc800",Y:"#ffc800",V:"#ffafaf",B:"#fff",X:"#fff",Z:"#fff"}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DropdownSelect=e.Caption=void 0;var n,i=o(r(1)),a=((n=r(0))&&n.__esModule,o(r(180)));function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,r):{};n.get||n.set?Object.defineProperty(e,r,n):e[r]=t[r]}return e.default=t,e}function s(){return(s=Object.assign||function(t){for(var e=1;e=0||(i[r]=t[r]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}var u=function(t){return i.default.createElement("div",{style:{marginTop:-8,marginBottom:-8}},i.default.createElement("p",{style:{fontSize:12,fontColor:"#444444"}},t.children))};e.Caption=u;e.DropdownSelect=function(t){var e=t.caption,r=t.isCreatable,n=t.outerStyle,o=l(t,["caption","isCreatable","outerStyle"]);return i.default.createElement("div",{style:n},e&&i.default.createElement(u,null,e),!e&&i.default.createElement(u,null," "),r&&i.default.createElement(a.Creatable,s({allowCreate:!0},o)),!r&&i.default.createElement(a.default,o))}},function(t,e,r){"use strict";(function(t){r.d(e,"b",function(){return o}),r.d(e,"a",function(){return s});var n=r(179),i=void 0!==t?t:{},a=Object(n.a)(i),o=(a.flush,a.hydrate,a.cx,a.merge,a.getRegisteredStyles,a.injectGlobal),s=(a.keyframes,a.css);a.sheet,a.caches}).call(this,r(51))},function(t,e,r){t.exports=function(){"use strict";return function(t){function e(e){if(e)try{t(e+"}")}catch(t){}}return function(r,n,i,a,o,s,l,u,c,f){switch(r){case 1:if(0===c&&64===n.charCodeAt(0))return t(n+";"),"";break;case 2:if(0===u)return n+"/*|*/";break;case 3:switch(u){case 102:case 112:return t(i[0]+n),"";default:return n+(0===f?"/*|*/":"")}case-2:n.split("/*|*/}").forEach(e)}}}}()},function(t,e,r){(function(e){for(var n=r(139),i="undefined"==typeof window?e:window,a=["moz","webkit"],o="AnimationFrame",s=i["request"+o],l=i["cancel"+o]||i["cancelRequest"+o],u=0;!s&&u1)for(var r=1;r=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r}(this.props,[]);return function(t){c.forEach(function(e){return delete t[e]})}(i),i.className=this.props.inputClassName,i.id=this.state.inputId,i.style=r,o.default.createElement("div",{className:this.props.className,style:e},this.renderStyles(),o.default.createElement("input",n({},i,{ref:this.inputRef})),o.default.createElement("div",{ref:this.sizerRef,style:u},t),this.props.placeholder?o.default.createElement("div",{ref:this.placeHolderSizerRef,style:u},this.props.placeholder):null)}}]),e}();d.propTypes={className:s.default.string,defaultValue:s.default.any,extraWidth:s.default.oneOfType([s.default.number,s.default.string]),id:s.default.string,injectStyles:s.default.bool,inputClassName:s.default.string,inputRef:s.default.func,inputStyle:s.default.object,minWidth:s.default.oneOfType([s.default.number,s.default.string]),onAutosize:s.default.func,onChange:s.default.func,placeholder:s.default.string,placeholderIsMinWidth:s.default.bool,style:s.default.object,value:s.default.any},d.defaultProps={minWidth:1,injectStyles:!0},e.default=d},function(t,e,r){"use strict";var n=s(r(143)),i=s(r(148)),a=s(r(80)),o=s(r(77));function s(t){return t&&t.__esModule?t:{default:t}}t.exports={Transition:o.default,TransitionGroup:a.default,ReplaceTransition:i.default,CSSTransition:n.default}},function(t,e,r){"use strict";e.__esModule=!0,e.default=void 0;!function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,r):{};n.get||n.set?Object.defineProperty(e,r,n):e[r]=t[r]}e.default=t}(r(0));var n=s(r(144)),i=s(r(147)),a=s(r(1)),o=s(r(77));r(79);function s(t){return t&&t.__esModule?t:{default:t}}function l(){return(l=Object.assign||function(t){for(var e=1;e=0||(i[r]=t[r]);return i}(t,["children","in"]),o=n.default.Children.toArray(e),s=o[0],l=o[1];return delete i.onEnter,delete i.onEntering,delete i.onEntered,delete i.onExit,delete i.onExiting,delete i.onExited,n.default.createElement(a.default,i,r?n.default.cloneElement(s,{key:"first",onEnter:this.handleEnter,onEntering:this.handleEntering,onEntered:this.handleEntered}):n.default.cloneElement(l,{key:"second",onEnter:this.handleExit,onEntering:this.handleExiting,onEntered:this.handleExited}))},o}(n.default.Component);s.propTypes={};var l=s;e.default=l,t.exports=e.default},function(t,e,r){"use strict";e.__esModule=!0,e.getChildMapping=i,e.mergeChildMappings=a,e.getInitialChildMapping=function(t,e){return i(t.children,function(r){return(0,n.cloneElement)(r,{onExited:e.bind(null,r),in:!0,appear:o(r,"appear",t),enter:o(r,"enter",t),exit:o(r,"exit",t)})})},e.getNextChildMapping=function(t,e,r){var s=i(t.children),l=a(e,s);return Object.keys(l).forEach(function(i){var a=l[i];if((0,n.isValidElement)(a)){var u=i in e,c=i in s,f=e[i],h=(0,n.isValidElement)(f)&&!f.props.in;!c||u&&!h?c||!u||h?c&&u&&(0,n.isValidElement)(f)&&(l[i]=(0,n.cloneElement)(a,{onExited:r.bind(null,a),in:f.props.in,exit:o(a,"exit",t),enter:o(a,"enter",t)})):l[i]=(0,n.cloneElement)(a,{in:!1}):l[i]=(0,n.cloneElement)(a,{onExited:r.bind(null,a),in:!0,exit:o(a,"exit",t),enter:o(a,"enter",t)})}}),l};var n=r(1);function i(t,e){var r=Object.create(null);return t&&n.Children.map(t,function(t){return t}).forEach(function(t){r[t.key]=function(t){return e&&(0,n.isValidElement)(t)?e(t):t}(t)}),r}function a(t,e){function r(r){return r in e?e[r]:t[r]}t=t||{},e=e||{};var n,i=Object.create(null),a=[];for(var o in t)o in e?a.length&&(i[o]=a,a=[]):a.push(o);var s={};for(var l in e){if(i[l])for(n=0;n=4;)e=1540483477*(65535&(e=255&t.charCodeAt(i)|(255&t.charCodeAt(++i))<<8|(255&t.charCodeAt(++i))<<16|(255&t.charCodeAt(++i))<<24))+((1540483477*(e>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(e=1540483477*(65535&(e^=e>>>24))+((1540483477*(e>>>16)&65535)<<16)),r-=4,++i;switch(r){case 3:n^=(255&t.charCodeAt(i+2))<<16;case 2:n^=(255&t.charCodeAt(i+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(i)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),((n^=n>>>15)>>>0).toString(36)};var o=function(t){function e(t,e,n){var i=e.trim().split(d);e=i;var a=i.length,o=t.length;switch(o){case 0:case 1:var s=0;for(t=0===o?"":t[0]+" ";sn&&(n=(e=e.trim()).charCodeAt(0)),n){case 38:return e.replace(v,"$1"+t.trim());case 58:return t.trim()+e.replace(v,"$1"+t.trim());default:if(0<1*r&&0l.charCodeAt(8))break;case 115:o=o.replace(l,"-webkit-"+l)+";"+o;break;case 207:case 102:o=o.replace(l,"-webkit-"+(102s.charCodeAt(0)&&(s=s.trim()),s=[s],0p)&&(N=(U=U.replace(" ",":")).length),01?i-1:0),s=1;s=0||(i[r]=t[r]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function E(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function S(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?E(t):e}function C(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e-1}function D(t){return P(t)?window.pageYOffset:t.scrollTop}function z(t,e){P(t)?window.scrollTo(0,e):t.scrollTop=e}function R(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:L,i=D(t),a=e-i,o=10,s=0;!function e(){var l,u=a*((l=(l=s+=o)/r-1)*l*l+1)+i;z(t,u),s=p)return{placement:"bottom",maxHeight:e};if(k>=p&&!o)return a&&R(l,A,160),{placement:"bottom",maxHeight:e};if(!o&&k>=n||o&&_>=n)return a&&R(l,A,160),{placement:"bottom",maxHeight:o?_-y:k-y};if("auto"===i||o){var M=e,E=o?b:w;return E>=n&&(M=Math.min(E-y-s.controlHeight,e)),{placement:"top",maxHeight:M}}if("bottom"===i)return z(l,A),{placement:"bottom",maxHeight:e};break;case"top":if(b>=p)return{placement:"top",maxHeight:e};if(w>=p&&!o)return a&&R(l,T,160),{placement:"top",maxHeight:e};if(!o&&w>=n||o&&b>=n){var S=e;return(!o&&w>=n||o&&b>=n)&&(S=o?b-x:w-x),a&&R(l,T,160),{placement:"top",maxHeight:S}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}var N=function(t){return"auto"===t?"bottom":t},j=function(t){function e(){var t,r;m(this,e);for(var n=arguments.length,i=new Array(n),a=0;a-1}},rt=function(t){return i.a.createElement("span",_({className:Object(s.a)({label:"a11yText",zIndex:9999,border:0,clip:"rect(1px, 1px, 1px, 1px)",height:1,width:1,position:"absolute",overflow:"hidden",padding:0,whiteSpace:"nowrap",backgroundColor:"red",color:"blue"})},t))},nt=function(t){function e(){return m(this,e),S(this,A(e).apply(this,arguments))}return k(e,n["Component"]),x(e,[{key:"render",value:function(){var t=this.props,e=(t.in,t.out,t.onExited,t.appear,t.enter,t.exit,t.innerRef),r=(t.emotion,M(t,["in","out","onExited","appear","enter","exit","innerRef","emotion"]));return i.a.createElement("input",_({ref:e},r,{className:Object(s.a)({label:"dummyInput",background:0,border:0,fontSize:"inherit",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(0)"})}))}}]),e}(),it=function(t){function e(){return m(this,e),S(this,A(e).apply(this,arguments))}return k(e,n["Component"]),x(e,[{key:"componentDidMount",value:function(){this.props.innerRef(Object(l.findDOMNode)(this))}},{key:"componentWillUnmount",value:function(){this.props.innerRef(null)}},{key:"render",value:function(){return this.props.children}}]),e}(),at=["boxSizing","height","overflow","paddingRight","position"],ot={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function st(t){t.preventDefault()}function lt(t){t.stopPropagation()}function ut(){var t=this.scrollTop,e=this.scrollHeight,r=t+this.offsetHeight;0===t?this.scrollTop=1:r===e&&(this.scrollTop=t-1)}function ct(){return"ontouchstart"in window||navigator.maxTouchPoints}var ft=!("undefined"==typeof window||!window.document||!window.document.createElement),ht=0,pt=function(t){function e(){var t,r;m(this,e);for(var n=arguments.length,i=new Array(n),a=0;a0,d=c-f-u,v=!1;d>e&&r.isBottom&&(a&&a(t),r.isBottom=!1),p&&r.isTop&&(s&&s(t),r.isTop=!1),p&&e>d?(i&&!r.isBottom&&i(t),h.scrollTop=c,v=!0,r.isBottom=!0):!p&&-e>u&&(o&&!r.isTop&&o(t),h.scrollTop=0,v=!0,r.isTop=!0),v&&r.cancelScroll(t)}),b(E(E(r)),"onWheel",function(t){r.handleEventDelta(t,t.deltaY)}),b(E(E(r)),"onTouchStart",function(t){r.touchStart=t.changedTouches[0].clientY}),b(E(E(r)),"onTouchMove",function(t){var e=r.touchStart-t.changedTouches[0].clientY;r.handleEventDelta(t,e)}),b(E(E(r)),"getScrollTarget",function(t){r.scrollTarget=t}),r}return k(e,n["Component"]),x(e,[{key:"componentDidMount",value:function(){this.startListening(this.scrollTarget)}},{key:"componentWillUnmount",value:function(){this.stopListening(this.scrollTarget)}},{key:"startListening",value:function(t){t&&(t.scrollHeight<=t.clientHeight||("function"==typeof t.addEventListener&&t.addEventListener("wheel",this.onWheel,!1),"function"==typeof t.addEventListener&&t.addEventListener("touchstart",this.onTouchStart,!1),"function"==typeof t.addEventListener&&t.addEventListener("touchmove",this.onTouchMove,!1)))}},{key:"stopListening",value:function(t){t.scrollHeight<=t.clientHeight||("function"==typeof t.removeEventListener&&t.removeEventListener("wheel",this.onWheel,!1),"function"==typeof t.removeEventListener&&t.removeEventListener("touchstart",this.onTouchStart,!1),"function"==typeof t.removeEventListener&&t.removeEventListener("touchmove",this.onTouchMove,!1))}},{key:"render",value:function(){return i.a.createElement(it,{innerRef:this.getScrollTarget},this.props.children)}}]),e}(),gt=function(t){function e(){return m(this,e),S(this,A(e).apply(this,arguments))}return k(e,n["Component"]),x(e,[{key:"render",value:function(){var t=this.props,e=t.isEnabled,r=M(t,["isEnabled"]);return e?i.a.createElement(vt,r):this.props.children}}]),e}();b(gt,"defaultProps",{isEnabled:!0});var mt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.isSearchable,n=e.isMulti,i=e.label,a=e.isDisabled;switch(t){case"menu":return"Use Up and Down to choose options".concat(a?"":", press Enter to select the currently focused option",", press Escape to exit the menu, press Tab to select the option and exit the menu.");case"input":return"".concat(i||"Select"," is focused ").concat(r?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":"");case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value"}},yt=function(t,e){var r=e.value,n=e.isDisabled;if(r)switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"select-option":return"option ".concat(r,n?" is disabled. Select another option.":", selected.")}},xt=function(t){return!!t.isDisabled},bt=function(t){function e(){return m(this,e),S(this,A(e).apply(this,arguments))}return k(e,n["Component"]),x(e,[{key:"render",value:function(){var t=this.props,e=t.children,r=t.className,n=t.cx,a=t.isMulti,o=t.getStyles,l=t.hasValue;return i.a.createElement("div",{className:n(Object(s.a)(o("valueContainer",this.props)),{"value-container":!0,"value-container--is-multi":a,"value-container--has-value":l},r)},e)}}]),e}(),_t=function(t){var e=t.size,r=M(t,["size"]);return i.a.createElement("svg",_({height:e,width:e,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",className:Object(s.a)({display:"inline-block",fill:"currentColor",lineHeight:1,stroke:"currentColor",strokeWidth:0})},r))},wt=function(t){return i.a.createElement(_t,_({size:20},t),i.a.createElement("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},kt=function(t){return i.a.createElement(_t,_({size:20},t),i.a.createElement("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},At=function(t){var e=t.isFocused,r=t.theme,n=r.spacing.baseUnit,i=r.colors;return{label:"indicatorContainer",color:e?i.neutral60:i.neutral20,display:"flex",padding:2*n,transition:"color 150ms",":hover":{color:e?i.neutral80:i.neutral40}}},Tt=At,Mt=At,Et=!1,St=function(t){var e=t.color,r=t.delay,n=t.offset;return i.a.createElement("span",{className:Object(s.a)({animationDuration:"1s",animationDelay:"".concat(r,"ms"),animationIterationCount:"infinite",animationName:"react-select-loading-indicator",animationTimingFunction:"ease-in-out",backgroundColor:e,borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":null,height:"1em",verticalAlign:"top",width:"1em"})})},Ct=function(t){var e=t.className,r=t.cx,n=t.getStyles,a=t.innerProps,o=t.isFocused,l=t.isRtl,u=t.theme.colors,c=o?u.neutral80:u.neutral20;return Et||(Object(s.b)("@keyframes ","react-select-loading-indicator","{0%,80%,100%{opacity:0;}40%{opacity:1;}};"),Et=!0),i.a.createElement("div",_({},a,{className:r(Object(s.a)(n("loadingIndicator",t)),{indicator:!0,"loading-indicator":!0},e)}),i.a.createElement(St,{color:c,delay:0,offset:l}),i.a.createElement(St,{color:c,delay:160,offset:!0}),i.a.createElement(St,{color:c,delay:320,offset:!l}))};Ct.defaultProps={size:4};var Lt=function(t){var e=t.children,r=t.innerProps;return i.a.createElement("div",r,e)},Ot=Lt,It=Lt,Pt=function(t){function e(){return m(this,e),S(this,A(e).apply(this,arguments))}return k(e,n["Component"]),x(e,[{key:"render",value:function(){var t=this.props,e=t.children,r=t.innerProps;return i.a.createElement("div",r,e||i.a.createElement(wt,{size:14}))}}]),e}(),Dt=function(t){function e(){return m(this,e),S(this,A(e).apply(this,arguments))}return k(e,n["Component"]),x(e,[{key:"render",value:function(){var t=this.props,e=t.children,r=t.className,n=t.components,a=t.cx,o=t.data,l=t.getStyles,u=t.innerProps,c=t.isDisabled,f=t.removeProps,h=t.selectProps,p=n.Container,d=n.Label,v=n.Remove,g=w({className:a(Object(s.a)(l("multiValue",this.props)),{"multi-value":!0,"multi-value--is-disabled":c},r)},u),m={className:a(Object(s.a)(l("multiValueLabel",this.props)),{"multi-value__label":!0},r)},y=w({className:a(Object(s.a)(l("multiValueRemove",this.props)),{"multi-value__remove":!0},r)},f);return i.a.createElement(p,{data:o,innerProps:g,selectProps:h},i.a.createElement(d,{data:o,innerProps:m,selectProps:h},e),i.a.createElement(v,{data:o,innerProps:y,selectProps:h}))}}]),e}();b(Dt,"defaultProps",{cropWithEllipsis:!0});var zt={ClearIndicator:function(t){var e=t.children,r=t.className,n=t.cx,a=t.getStyles,o=t.innerProps;return i.a.createElement("div",_({},o,{className:n(Object(s.a)(a("clearIndicator",t)),{indicator:!0,"clear-indicator":!0},r)}),e||i.a.createElement(wt,null))},Control:function(t){var e=t.children,r=t.cx,n=t.getStyles,a=t.className,o=t.isDisabled,l=t.isFocused,u=t.innerRef,c=t.innerProps,f=t.menuIsOpen;return i.a.createElement("div",_({ref:u,className:r(Object(s.a)(n("control",t)),{control:!0,"control--is-disabled":o,"control--is-focused":l,"control--menu-is-open":f},a)},c),e)},DropdownIndicator:function(t){var e=t.children,r=t.className,n=t.cx,a=t.getStyles,o=t.innerProps;return i.a.createElement("div",_({},o,{className:n(Object(s.a)(a("dropdownIndicator",t)),{indicator:!0,"dropdown-indicator":!0},r)}),e||i.a.createElement(kt,null))},DownChevron:kt,CrossIcon:wt,Group:function(t){var e=t.children,r=t.className,n=t.cx,a=t.getStyles,o=t.Heading,l=t.headingProps,u=t.label,c=t.theme,f=t.selectProps;return i.a.createElement("div",{className:n(Object(s.a)(a("group",t)),{group:!0},r)},i.a.createElement(o,_({},l,{selectProps:f,theme:c,getStyles:a,cx:n}),u),i.a.createElement("div",null,e))},GroupHeading:function(t){var e=t.className,r=t.cx,n=t.getStyles,a=t.theme,o=(t.selectProps,M(t,["className","cx","getStyles","theme","selectProps"]));return i.a.createElement("div",_({className:r(Object(s.a)(n("groupHeading",w({theme:a},o))),{"group-heading":!0},e)},o))},IndicatorsContainer:function(t){var e=t.children,r=t.className,n=t.cx,a=t.getStyles;return i.a.createElement("div",{className:n(Object(s.a)(a("indicatorsContainer",t)),{indicators:!0},r)},e)},IndicatorSeparator:function(t){var e=t.className,r=t.cx,n=t.getStyles,a=t.innerProps;return i.a.createElement("span",_({},a,{className:r(Object(s.a)(n("indicatorSeparator",t)),{"indicator-separator":!0},e)}))},Input:function(t){var e=t.className,r=t.cx,n=t.getStyles,a=t.innerRef,o=t.isHidden,l=t.isDisabled,u=t.theme,c=(t.selectProps,M(t,["className","cx","getStyles","innerRef","isHidden","isDisabled","theme","selectProps"]));return i.a.createElement("div",{className:Object(s.a)(n("input",w({theme:u},c)))},i.a.createElement(d.a,_({className:r(null,{input:!0},e),inputRef:a,inputStyle:function(t){return{label:"input",background:0,border:0,fontSize:"inherit",opacity:t?0:1,outline:0,padding:0,color:"inherit"}}(o),disabled:l},c)))},LoadingIndicator:Ct,Menu:function(t){var e=t.children,r=t.className,n=t.cx,a=t.getStyles,o=t.innerRef,l=t.innerProps,u=n(Object(s.a)(a("menu",t)),{menu:!0},r);return i.a.createElement("div",_({className:u},l,{ref:o}),e)},MenuList:function(t){var e=t.children,r=t.className,n=t.cx,a=t.getStyles,o=t.isMulti,l=t.innerRef;return i.a.createElement("div",{className:n(Object(s.a)(a("menuList",t)),{"menu-list":!0,"menu-list--is-multi":o},r),ref:l},e)},MenuPortal:W,LoadingMessage:G,NoOptionsMessage:q,MultiValue:Dt,MultiValueContainer:Ot,MultiValueLabel:It,MultiValueRemove:Pt,Option:function(t){var e=t.children,r=t.className,n=t.cx,a=t.getStyles,o=t.isDisabled,l=t.isFocused,u=t.isSelected,c=t.innerRef,f=t.innerProps;return i.a.createElement("div",_({ref:c,className:n(Object(s.a)(a("option",t)),{option:!0,"option--is-disabled":o,"option--is-focused":l,"option--is-selected":u},r)},f),e)},Placeholder:function(t){var e=t.children,r=t.className,n=t.cx,a=t.getStyles,o=t.innerProps;return i.a.createElement("div",_({className:n(Object(s.a)(a("placeholder",t)),{placeholder:!0},r)},o),e)},SelectContainer:function(t){var e=t.children,r=t.className,n=t.cx,a=t.getStyles,o=t.innerProps,l=t.isDisabled,u=t.isRtl;return i.a.createElement("div",_({className:n(Object(s.a)(a("container",t)),{"--is-disabled":l,"--is-rtl":u},r)},o),e)},SingleValue:function(t){var e=t.children,r=t.className,n=t.cx,a=t.getStyles,o=t.isDisabled,l=t.innerProps;return i.a.createElement("div",_({className:n(Object(s.a)(a("singleValue",t)),{"single-value":!0,"single-value--is-disabled":o},r)},l),e)},ValueContainer:bt},Rt=function(t){return w({},zt,t.components)},Ft={clearIndicator:Mt,container:function(t){var e=t.isDisabled;return{label:"container",direction:t.isRtl?"rtl":null,pointerEvents:e?"none":null,position:"relative"}},control:function(t){var e=t.isDisabled,r=t.isFocused,n=t.theme,i=n.colors,a=n.borderRadius,o=n.spacing;return{label:"control",alignItems:"center",backgroundColor:e?i.neutral5:i.neutral0,borderColor:e?i.neutral10:r?i.primary:i.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(i.primary):null,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:o.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:r?i.primary:i.neutral30}}},dropdownIndicator:Tt,group:function(t){var e=t.theme.spacing;return{paddingBottom:2*e.baseUnit,paddingTop:2*e.baseUnit}},groupHeading:function(t){var e=t.theme.spacing;return{label:"group",color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:"500",marginBottom:"0.25em",paddingLeft:3*e.baseUnit,paddingRight:3*e.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(t){var e=t.isDisabled,r=t.theme,n=r.spacing.baseUnit,i=r.colors;return{label:"indicatorSeparator",alignSelf:"stretch",backgroundColor:e?i.neutral10:i.neutral20,marginBottom:2*n,marginTop:2*n,width:1}},input:function(t){var e=t.isDisabled,r=t.theme,n=r.spacing,i=r.colors;return{margin:n.baseUnit/2,paddingBottom:n.baseUnit/2,paddingTop:n.baseUnit/2,visibility:e?"hidden":"visible",color:i.neutral80}},loadingIndicator:function(t){var e=t.isFocused,r=t.size,n=t.theme,i=n.colors,a=n.spacing.baseUnit;return{label:"loadingIndicator",color:e?i.neutral60:i.neutral20,display:"flex",padding:2*a,transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"}},loadingMessage:H,menu:function(t){var e,r=t.placement,n=t.theme,i=n.borderRadius,a=n.spacing,o=n.colors;return b(e={label:"menu"},function(t){return t?{bottom:"top",top:"bottom"}[t]:"bottom"}(r),"100%"),b(e,"backgroundColor",o.neutral0),b(e,"borderRadius",i),b(e,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),b(e,"marginBottom",a.menuGutter),b(e,"marginTop",a.menuGutter),b(e,"position","absolute"),b(e,"width","100%"),b(e,"zIndex",1),e},menuList:function(t){var e=t.maxHeight,r=t.theme.spacing.baseUnit;return{maxHeight:e,overflowY:"auto",paddingBottom:r,paddingTop:r,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(t){var e=t.rect,r=t.offset,n=t.position;return{left:e.left,position:n,top:r,width:e.width,zIndex:1}},multiValue:function(t){var e=t.theme,r=e.spacing,n=e.borderRadius;return{label:"multiValue",backgroundColor:e.colors.neutral10,borderRadius:n/2,display:"flex",margin:r.baseUnit/2,minWidth:0}},multiValueLabel:function(t){var e=t.theme,r=e.borderRadius,n=e.colors,i=t.cropWithEllipsis;return{borderRadius:r/2,color:n.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:i?"ellipsis":null,whiteSpace:"nowrap"}},multiValueRemove:function(t){var e=t.theme,r=e.spacing,n=e.borderRadius,i=e.colors;return{alignItems:"center",borderRadius:n/2,backgroundColor:t.isFocused&&i.dangerLight,display:"flex",paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}}},noOptionsMessage:U,option:function(t){var e=t.isDisabled,r=t.isFocused,n=t.isSelected,i=t.theme,a=i.spacing,o=i.colors;return{label:"option",backgroundColor:n?o.primary:r?o.primary25:"transparent",color:e?o.neutral20:n?o.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:"".concat(2*a.baseUnit,"px ").concat(3*a.baseUnit,"px"),width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:n?o.primary:o.primary50}}},placeholder:function(t){var e=t.theme,r=e.spacing;return{label:"placeholder",color:e.colors.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2,position:"absolute",top:"50%",transform:"translateY(-50%)"}},singleValue:function(t){var e=t.isDisabled,r=t.theme,n=r.spacing,i=r.colors;return{label:"singleValue",color:e?i.neutral40:i.neutral80,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2,maxWidth:"calc(100% - ".concat(2*n.baseUnit,"px)"),overflow:"hidden",position:"absolute",textOverflow:"ellipsis",whiteSpace:"nowrap",top:"50%",transform:"translateY(-50%)"}},valueContainer:function(t){var e=t.theme.spacing;return{alignItems:"center",display:"flex",flex:1,flexWrap:"wrap",padding:"".concat(e.baseUnit/2,"px ").concat(2*e.baseUnit,"px"),WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}}};function Bt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=w({},t);return Object.keys(e).forEach(function(n){t[n]?r[n]=function(r,i){return e[n](t[n](r,i),i)}:r[n]=e[n]}),r}var Nt={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},jt={backspaceRemovesValue:!0,blurInputOnSelect:F(),captureMenuScroll:!F(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:et(),formatGroupLabel:function(t){return t.label},getOptionLabel:function(t){return t.label},getOptionValue:function(t){return t.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:xt,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(t){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var e=t.count;return"".concat(e," result").concat(1!==e?"s":""," available")},styles:{},tabIndex:"0",tabSelectsValue:!0},Vt=1,Ut=function(t){function e(t){var r;m(this,e),b(E(E(r=S(this,A(e).call(this,t)))),"state",{ariaLiveSelection:"",ariaLiveContext:"",focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,isComposing:!1,menuOptions:{render:[],focusable:[]},selectValue:[]}),b(E(E(r)),"blockOptionHover",!1),b(E(E(r)),"clearFocusValueOnUpdate",!1),b(E(E(r)),"commonProps",void 0),b(E(E(r)),"components",void 0),b(E(E(r)),"hasGroups",!1),b(E(E(r)),"initialTouchX",0),b(E(E(r)),"initialTouchY",0),b(E(E(r)),"inputIsHiddenAfterUpdate",void 0),b(E(E(r)),"instancePrefix",""),b(E(E(r)),"openAfterFocus",!1),b(E(E(r)),"scrollToFocusedOptionOnUpdate",!1),b(E(E(r)),"userIsDragging",void 0),b(E(E(r)),"controlRef",null),b(E(E(r)),"getControlRef",function(t){r.controlRef=t}),b(E(E(r)),"focusedOptionRef",null),b(E(E(r)),"getFocusedOptionRef",function(t){r.focusedOptionRef=t}),b(E(E(r)),"menuListRef",null),b(E(E(r)),"getMenuListRef",function(t){r.menuListRef=t}),b(E(E(r)),"inputRef",null),b(E(E(r)),"getInputRef",function(t){r.inputRef=t}),b(E(E(r)),"cacheComponents",function(t){r.components=Rt({components:t})}),b(E(E(r)),"focus",r.focusInput),b(E(E(r)),"blur",r.blurInput),b(E(E(r)),"onChange",function(t,e){var n=r.props;(0,n.onChange)(t,w({},e,{name:n.name}))}),b(E(E(r)),"setValue",function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"set-value",n=arguments.length>2?arguments[2]:void 0,i=r.props,a=i.closeMenuOnSelect,o=i.isMulti;r.onInputChange("",{action:"set-value"}),a&&(r.inputIsHiddenAfterUpdate=!o,r.onMenuClose()),r.clearFocusValueOnUpdate=!0,r.onChange(t,{action:e,option:n})}),b(E(E(r)),"selectOption",function(t){var e=r.props,n=e.blurInputOnSelect,i=e.isMulti,a=r.state.selectValue;if(i)if(r.isOptionSelected(t,a)){var o=r.getOptionValue(t);r.setValue(a.filter(function(t){return r.getOptionValue(t)!==o}),"deselect-option",t),r.announceAriaLiveSelection({event:"deselect-option",context:{value:r.getOptionLabel(t)}})}else r.isOptionDisabled(t,a)?r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(t),isDisabled:!0}}):(r.setValue([].concat(C(a),[t]),"select-option",t),r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(t)}}));else r.isOptionDisabled(t,a)?r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(t),isDisabled:!0}}):(r.setValue(t,"select-option"),r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(t)}}));n&&r.blurInput()}),b(E(E(r)),"removeValue",function(t){var e=r.state.selectValue,n=r.getOptionValue(t);r.onChange(e.filter(function(t){return r.getOptionValue(t)!==n}),{action:"remove-value",removedValue:t}),r.announceAriaLiveSelection({event:"remove-value",context:{value:t?r.getOptionLabel(t):""}}),r.focusInput()}),b(E(E(r)),"clearValue",function(){var t=r.props.isMulti;r.onChange(t?[]:null,{action:"clear"})}),b(E(E(r)),"popValue",function(){var t=r.state.selectValue,e=t[t.length-1];r.announceAriaLiveSelection({event:"pop-value",context:{value:e?r.getOptionLabel(e):""}}),r.onChange(t.slice(0,t.length-1),{action:"pop-value",removedValue:e})}),b(E(E(r)),"getOptionLabel",function(t){return r.props.getOptionLabel(t)}),b(E(E(r)),"getOptionValue",function(t){return r.props.getOptionValue(t)}),b(E(E(r)),"getStyles",function(t,e){var n=Ft[t](e);n.boxSizing="border-box";var i=r.props.styles[t];return i?i(n,e):n}),b(E(E(r)),"getElementId",function(t){return"".concat(r.instancePrefix,"-").concat(t)}),b(E(E(r)),"getActiveDescendentId",function(){var t=r.props.menuIsOpen,e=r.state,n=e.menuOptions,i=e.focusedOption;if(i&&t){var a=n.focusable.indexOf(i),o=n.render[a];return o&&o.key}}),b(E(E(r)),"announceAriaLiveSelection",function(t){var e=t.event,n=t.context;r.setState({ariaLiveSelection:yt(e,n)})}),b(E(E(r)),"announceAriaLiveContext",function(t){var e=t.event,n=t.context;r.setState({ariaLiveContext:mt(e,w({},n,{label:r.props["aria-label"]}))})}),b(E(E(r)),"onMenuMouseDown",function(t){0===t.button&&(t.stopPropagation(),t.preventDefault(),r.focusInput())}),b(E(E(r)),"onMenuMouseMove",function(t){r.blockOptionHover=!1}),b(E(E(r)),"onControlMouseDown",function(t){var e=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?"INPUT"!==t.target.tagName&&r.onMenuClose():e&&r.openMenu("first"):(e&&(r.openAfterFocus=!0),r.focusInput()),"INPUT"!==t.target.tagName&&t.preventDefault()}),b(E(E(r)),"onDropdownIndicatorMouseDown",function(t){if(!(t&&"mousedown"===t.type&&0!==t.button||r.props.isDisabled)){var e=r.props,n=e.isMulti,i=e.menuIsOpen;r.focusInput(),i?(r.inputIsHiddenAfterUpdate=!n,r.onMenuClose()):r.openMenu("first"),t.preventDefault(),t.stopPropagation()}}),b(E(E(r)),"onClearIndicatorMouseDown",function(t){t&&"mousedown"===t.type&&0!==t.button||(r.clearValue(),t.stopPropagation(),r.openAfterFocus=!1,setTimeout(function(){return r.focusInput()}))}),b(E(E(r)),"onScroll",function(t){"boolean"==typeof r.props.closeMenuOnScroll?t.target instanceof HTMLElement&&P(t.target)&&r.props.onMenuClose():"function"==typeof r.props.closeMenuOnScroll&&r.props.closeMenuOnScroll(t)&&r.props.onMenuClose()}),b(E(E(r)),"onCompositionStart",function(){r.setState({isComposing:!0})}),b(E(E(r)),"onCompositionEnd",function(){r.setState({isComposing:!1})}),b(E(E(r)),"onTouchStart",function(t){var e=t.touches.item(0);e&&(r.initialTouchX=e.clientX,r.initialTouchY=e.clientY,r.userIsDragging=!1)}),b(E(E(r)),"onTouchMove",function(t){var e=t.touches.item(0);if(e){var n=Math.abs(e.clientX-r.initialTouchX),i=Math.abs(e.clientY-r.initialTouchY);r.userIsDragging=n>5||i>5}}),b(E(E(r)),"onTouchEnd",function(t){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(t.target)&&r.menuListRef&&!r.menuListRef.contains(t.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)}),b(E(E(r)),"onControlTouchEnd",function(t){r.userIsDragging||r.onControlMouseDown(t)}),b(E(E(r)),"onClearIndicatorTouchEnd",function(t){r.userIsDragging||r.onClearIndicatorMouseDown(t)}),b(E(E(r)),"onDropdownIndicatorTouchEnd",function(t){r.userIsDragging||r.onDropdownIndicatorMouseDown(t)}),b(E(E(r)),"handleInputChange",function(t){var e=t.currentTarget.value;r.inputIsHiddenAfterUpdate=!1,r.onInputChange(e,{action:"input-change"}),r.onMenuOpen()}),b(E(E(r)),"onInputFocus",function(t){var e=r.props,n=e.isSearchable,i=e.isMulti;r.props.onFocus&&r.props.onFocus(t),r.inputIsHiddenAfterUpdate=!1,r.announceAriaLiveContext({event:"input",context:{isSearchable:n,isMulti:i}}),r.setState({isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1}),b(E(E(r)),"onInputBlur",function(t){r.menuListRef&&r.menuListRef.contains(document.activeElement)?r.inputRef.focus():(r.props.onBlur&&r.props.onBlur(t),r.onInputChange("",{action:"input-blur"}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1}))}),b(E(E(r)),"onOptionHover",function(t){r.blockOptionHover||r.state.focusedOption===t||r.setState({focusedOption:t})}),b(E(E(r)),"shouldHideSelectedOptions",function(){var t=r.props,e=t.hideSelectedOptions,n=t.isMulti;return void 0===e?n:e}),b(E(E(r)),"onKeyDown",function(t){var e=r.props,n=e.isMulti,i=e.backspaceRemovesValue,a=e.escapeClearsValue,o=e.inputValue,s=e.isClearable,l=e.isDisabled,u=e.menuIsOpen,c=e.onKeyDown,f=e.tabSelectsValue,h=e.openMenuOnFocus,p=r.state,d=p.isComposing,v=p.focusedOption,g=p.focusedValue,m=p.selectValue;if(!(l||"function"==typeof c&&(c(t),t.defaultPrevented))){switch(r.blockOptionHover=!0,t.key){case"ArrowLeft":if(!n||o)return;r.focusValue("previous");break;case"ArrowRight":if(!n||o)return;r.focusValue("next");break;case"Delete":case"Backspace":if(o)return;if(g)r.removeValue(g);else{if(!i)return;n?r.popValue():s&&r.clearValue()}break;case"Tab":if(d)return;if(t.shiftKey||!u||!f||!v||h&&r.isOptionSelected(v,m))return;r.selectOption(v);break;case"Enter":if(229===t.keyCode)break;if(u){if(!v)return;if(d)return;r.selectOption(v);break}return;case"Escape":u?(r.inputIsHiddenAfterUpdate=!1,r.onInputChange("",{action:"menu-close"}),r.onMenuClose()):s&&a&&r.clearValue();break;case" ":if(o)return;if(!u){r.openMenu("first");break}if(!v)return;r.selectOption(v);break;case"ArrowUp":u?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":u?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!u)return;r.focusOption("pageup");break;case"PageDown":if(!u)return;r.focusOption("pagedown");break;case"Home":if(!u)return;r.focusOption("first");break;case"End":if(!u)return;r.focusOption("last");break;default:return}t.preventDefault()}});var n=t.value;r.cacheComponents=o(r.cacheComponents,$).bind(E(E(r))),r.cacheComponents(t.components),r.instancePrefix="react-select-"+(r.props.instanceId||++Vt);var i=I(n),a=r.buildMenuOptions(t,i);return r.state.menuOptions=a,r.state.selectValue=i,r}return k(e,n["Component"]),x(e,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentWillReceiveProps",value:function(t){var e=this.props,r=e.options,n=e.value,i=e.inputValue;if(this.cacheComponents(t.components),t.value!==n||t.options!==r||t.inputValue!==i){var a=I(t.value),o=this.buildMenuOptions(t,a),s=this.getNextFocusedValue(a),l=this.getNextFocusedOption(o.focusable);this.setState({menuOptions:o,selectValue:a,focusedOption:l,focusedValue:s})}null!=this.inputIsHiddenAfterUpdate&&(this.setState({inputIsHidden:this.inputIsHiddenAfterUpdate}),delete this.inputIsHiddenAfterUpdate)}},{key:"componentDidUpdate",value:function(t){var e,r,n,i,a,o=this.props,s=o.isDisabled,l=o.menuIsOpen,u=this.state.isFocused;(u&&!s&&t.isDisabled||u&&l&&!t.menuIsOpen)&&this.focusInput(),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(e=this.menuListRef,r=this.focusedOptionRef,n=e.getBoundingClientRect(),i=r.getBoundingClientRect(),a=r.offsetHeight/3,i.bottom+a>n.bottom?z(e,Math.min(r.offsetTop+r.clientHeight-e.offsetHeight+a,e.scrollHeight)):i.top-a-1&&(o=s)}this.scrollToFocusedOptionOnUpdate=!(i&&this.menuListRef),this.inputIsHiddenAfterUpdate=!1,this.onMenuOpen(),this.setState({focusedValue:null,focusedOption:r.focusable[o]}),this.announceAriaLiveContext({event:"menu"})}},{key:"focusValue",value:function(t){var e=this.props,r=e.isMulti,n=e.isSearchable,i=this.state,a=i.selectValue,o=i.focusedValue;if(r){this.setState({focusedOption:null});var s=a.indexOf(o);o||(s=-1,this.announceAriaLiveContext({event:"value"}));var l=a.length-1,u=-1;if(a.length){switch(t){case"previous":u=0===s?0:-1===s?l:s-1;break;case"next":s>-1&&s0&&void 0!==arguments[0]?arguments[0]:"first",e=this.props.pageSize,r=this.state,n=r.focusedOption,i=r.menuOptions.focusable;if(i.length){var a=0,o=i.indexOf(n);n||(o=-1,this.announceAriaLiveContext({event:"menu"})),"up"===t?a=o>0?o-1:i.length-1:"down"===t?a=(o+1)%i.length:"pageup"===t?(a=o-e)<0&&(a=0):"pagedown"===t?(a=o+e)>i.length-1&&(a=i.length-1):"last"===t&&(a=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[a],focusedValue:null}),this.announceAriaLiveContext({event:"menu",context:{isDisabled:xt(i[a])}})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(Nt):w({},Nt,this.props.theme):Nt}},{key:"getCommonProps",value:function(){var t=this.clearValue,e=this.getStyles,r=this.setValue,n=this.selectOption,i=this.props,a=i.classNamePrefix,o=i.isMulti,s=i.isRtl,l=i.options,u=this.state.selectValue,c=this.hasValue();return{cx:function(t,e,r,n){var i=[e,n];if(r&&t)for(var a in r)r.hasOwnProperty(a)&&r[a]&&i.push("".concat(O(t,a)));return i.filter(function(t){return t}).map(function(t){return String(t).trim()}).join(" ")}.bind(null,a),clearValue:t,getStyles:e,getValue:function(){return u},hasValue:c,isMulti:o,isRtl:s,options:l,selectOption:n,setValue:r,selectProps:i,theme:this.getTheme()}}},{key:"getNextFocusedValue",value:function(t){if(this.clearFocusValueOnUpdate)return this.clearFocusValueOnUpdate=!1,null;var e=this.state,r=e.focusedValue,n=e.selectValue.indexOf(r);if(n>-1){if(t.indexOf(r)>-1)return r;if(n-1?e:t[0]}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.state.menuOptions.render.length}},{key:"countOptions",value:function(){return this.state.menuOptions.focusable.length}},{key:"isClearable",value:function(){var t=this.props,e=t.isClearable,r=t.isMulti;return void 0===e?r:e}},{key:"isOptionDisabled",value:function(t,e){return"function"==typeof this.props.isOptionDisabled&&this.props.isOptionDisabled(t,e)}},{key:"isOptionSelected",value:function(t,e){var r=this;if(e.indexOf(t)>-1)return!0;if("function"==typeof this.props.isOptionSelected)return this.props.isOptionSelected(t,e);var n=this.getOptionValue(t);return e.some(function(t){return r.getOptionValue(t)===n})}},{key:"filterOption",value:function(t,e){return!this.props.filterOption||this.props.filterOption(t,e)}},{key:"formatOptionLabel",value:function(t,e){if("function"==typeof this.props.formatOptionLabel){var r=this.props.inputValue,n=this.state.selectValue;return this.props.formatOptionLabel(t,{context:e,inputValue:r,selectValue:n})}return this.getOptionLabel(t)}},{key:"formatGroupLabel",value:function(t){return this.props.formatGroupLabel(t)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"buildMenuOptions",value:function(t,e){var r=this,n=t.inputValue,i=void 0===n?"":n,a=t.options,o=function(t,n){var a=r.isOptionDisabled(t,e),o=r.isOptionSelected(t,e),s=r.getOptionLabel(t),l=r.getOptionValue(t);if(!(r.shouldHideSelectedOptions()&&o||!r.filterOption({label:s,value:l,data:t},i))){var u=a?void 0:function(){return r.onOptionHover(t)},c=a?void 0:function(){return r.selectOption(t)},f="".concat(r.getElementId("option"),"-").concat(n);return{innerProps:{id:f,onClick:c,onMouseMove:u,onMouseOver:u,tabIndex:-1},data:t,isDisabled:a,isSelected:o,key:f,label:s,type:"option",value:l}}};return a.reduce(function(t,e,n){if(e.options){r.hasGroups||(r.hasGroups=!0);var i=e.options.map(function(e,r){var i=o(e,"".concat(n,"-").concat(r));return i&&t.focusable.push(e),i}).filter(Boolean);if(i.length){var a="".concat(r.getElementId("group"),"-").concat(n);t.render.push({type:"group",key:a,data:e,options:i})}}else{var s=o(e,"".concat(n));s&&(t.render.push(s),t.focusable.push(e))}return t},{render:[],focusable:[]})}},{key:"constructAriaLiveMessage",value:function(){var t=this.state,e=t.ariaLiveContext,r=t.selectValue,n=t.focusedValue,i=t.focusedOption,a=this.props,o=a.options,s=a.menuIsOpen,l=a.inputValue,u=a.screenReaderStatus,c=n?function(t){var e=t.focusedValue,r=t.getOptionLabel,n=t.selectValue;return"value ".concat(r(e)," focused, ").concat(n.indexOf(e)+1," of ").concat(n.length,".")}({focusedValue:n,getOptionLabel:this.getOptionLabel,selectValue:r}):"",f=i&&s?function(t){var e=t.focusedOption,r=t.getOptionLabel,n=t.options;return"option ".concat(r(e)," focused").concat(e.isDisabled?" disabled":"",", ").concat(n.indexOf(e)+1," of ").concat(n.length,".")}({focusedOption:i,getOptionLabel:this.getOptionLabel,options:o}):"",h=function(t){var e=t.inputValue,r=t.screenReaderMessage;return"".concat(r).concat(e?" for search term "+e:"",".")}({inputValue:l,screenReaderMessage:u({count:this.countOptions()})});return"".concat(c," ").concat(f," ").concat(h," ").concat(e)}},{key:"renderInput",value:function(){var t=this.props,e=t.isDisabled,r=t.isSearchable,n=t.inputId,a=t.inputValue,o=t.tabIndex,s=this.components.Input,l=this.state.inputIsHidden,u=n||this.getElementId("input");if(!r)return i.a.createElement(nt,{id:u,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:L,onFocus:this.onInputFocus,readOnly:!0,disabled:e,tabIndex:o,value:""});var c={"aria-autocomplete":"list","aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"]},f=this.commonProps,h=f.cx,p=f.theme,d=f.selectProps;return i.a.createElement(s,_({autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",cx:h,getStyles:this.getStyles,id:u,innerRef:this.getInputRef,isDisabled:e,isHidden:l,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,selectProps:d,spellCheck:"false",tabIndex:o,theme:p,type:"text",value:a},c))}},{key:"renderPlaceholderOrValue",value:function(){var t=this,e=this.components,r=e.MultiValue,n=e.MultiValueContainer,a=e.MultiValueLabel,o=e.MultiValueRemove,s=e.SingleValue,l=e.Placeholder,u=this.commonProps,c=this.props,f=c.controlShouldRenderValue,h=c.isDisabled,p=c.isMulti,d=c.inputValue,v=c.placeholder,g=this.state,m=g.selectValue,y=g.focusedValue,x=g.isFocused;if(!this.hasValue()||!f)return d?null:i.a.createElement(l,_({},u,{key:"placeholder",isDisabled:h,isFocused:x}),v);if(p)return m.map(function(e){var s=e===y;return i.a.createElement(r,_({},u,{components:{Container:n,Label:a,Remove:o},isFocused:s,isDisabled:h,key:t.getOptionValue(e),removeProps:{onClick:function(){return t.removeValue(e)},onTouchEnd:function(){return t.removeValue(e)},onMouseDown:function(t){t.preventDefault(),t.stopPropagation()}},data:e}),t.formatOptionLabel(e,"value"))});if(d)return null;var b=m[0];return i.a.createElement(s,_({},u,{data:b,isDisabled:h}),this.formatOptionLabel(b,"value"))}},{key:"renderClearIndicator",value:function(){var t=this.components.ClearIndicator,e=this.commonProps,r=this.props,n=r.isDisabled,a=r.isLoading,o=this.state.isFocused;if(!this.isClearable()||!t||n||!this.hasValue()||a)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return i.a.createElement(t,_({},e,{innerProps:s,isFocused:o}))}},{key:"renderLoadingIndicator",value:function(){var t=this.components.LoadingIndicator,e=this.commonProps,r=this.props,n=r.isDisabled,a=r.isLoading,o=this.state.isFocused;if(!t||!a)return null;return i.a.createElement(t,_({},e,{innerProps:{"aria-hidden":"true"},isDisabled:n,isFocused:o}))}},{key:"renderIndicatorSeparator",value:function(){var t=this.components,e=t.DropdownIndicator,r=t.IndicatorSeparator;if(!e||!r)return null;var n=this.commonProps,a=this.props.isDisabled,o=this.state.isFocused;return i.a.createElement(r,_({},n,{isDisabled:a,isFocused:o}))}},{key:"renderDropdownIndicator",value:function(){var t=this.components.DropdownIndicator;if(!t)return null;var e=this.commonProps,r=this.props.isDisabled,n=this.state.isFocused,a={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return i.a.createElement(t,_({},e,{innerProps:a,isDisabled:r,isFocused:n}))}},{key:"renderMenu",value:function(){var t=this,e=this.components,r=e.Group,n=e.GroupHeading,a=e.Menu,o=e.MenuList,s=e.MenuPortal,l=e.LoadingMessage,u=e.NoOptionsMessage,c=e.Option,f=this.commonProps,h=this.state,p=h.focusedOption,d=h.menuOptions,v=this.props,g=v.captureMenuScroll,m=v.inputValue,y=v.isLoading,x=v.loadingMessage,b=v.minMenuHeight,w=v.maxMenuHeight,k=v.menuIsOpen,A=v.menuPlacement,T=v.menuPosition,E=v.menuPortalTarget,S=v.menuShouldBlockScroll,C=v.menuShouldScrollIntoView,L=v.noOptionsMessage,O=v.onMenuScrollToTop,I=v.onMenuScrollToBottom;if(!k)return null;var P,D=function(e){var r=p===e.data;return e.innerRef=r?t.getFocusedOptionRef:void 0,i.a.createElement(c,_({},f,e,{isFocused:r}),t.formatOptionLabel(e.data,"menu"))};if(this.hasOptions())P=d.render.map(function(e){if("group"===e.type){e.type;var a=M(e,["type"]),o="".concat(e.key,"-heading");return i.a.createElement(r,_({},f,a,{Heading:n,headingProps:{id:o},label:t.formatGroupLabel(e.data)}),e.options.map(function(t){return D(t)}))}if("option"===e.type)return D(e)});else if(y){var z=x({inputValue:m});if(null===z)return null;P=i.a.createElement(l,f,z)}else{var R=L({inputValue:m});if(null===R)return null;P=i.a.createElement(u,f,R)}var F={minMenuHeight:b,maxMenuHeight:w,menuPlacement:A,menuPosition:T,menuShouldScrollIntoView:C},B=i.a.createElement(j,_({},f,F),function(e){var r=e.ref,n=e.placerProps,s=n.placement,l=n.maxHeight;return i.a.createElement(a,_({},f,F,{innerRef:r,innerProps:{onMouseDown:t.onMenuMouseDown,onMouseMove:t.onMenuMouseMove},isLoading:y,placement:s}),i.a.createElement(gt,{isEnabled:g,onTopArrive:O,onBottomArrive:I},i.a.createElement(dt,{isEnabled:S},i.a.createElement(o,_({},f,{innerRef:t.getMenuListRef,isLoading:y,maxHeight:l}),P))))});return E||"fixed"===T?i.a.createElement(s,_({},f,{appendTo:E,controlElement:this.controlRef,menuPlacement:A,menuPosition:T}),B):B}},{key:"renderFormField",value:function(){var t=this,e=this.props,r=e.delimiter,n=e.isDisabled,a=e.isMulti,o=e.name,s=this.state.selectValue;if(o&&!n){if(a){if(r){var l=s.map(function(e){return t.getOptionValue(e)}).join(r);return i.a.createElement("input",{name:o,type:"hidden",value:l})}var u=s.length>0?s.map(function(e,r){return i.a.createElement("input",{key:"i-".concat(r),name:o,type:"hidden",value:t.getOptionValue(e)})}):i.a.createElement("input",{name:o,type:"hidden"});return i.a.createElement("div",null,u)}var c=s[0]?this.getOptionValue(s[0]):"";return i.a.createElement("input",{name:o,type:"hidden",value:c})}}},{key:"renderLiveRegion",value:function(){return this.state.isFocused?i.a.createElement(rt,{"aria-live":"assertive"},i.a.createElement("p",{id:"aria-selection-event"}," ",this.state.ariaLiveSelection),i.a.createElement("p",{id:"aria-context"}," ",this.constructAriaLiveMessage())):null}},{key:"render",value:function(){var t=this.components,e=t.Control,r=t.IndicatorsContainer,n=t.SelectContainer,a=t.ValueContainer,o=this.props,s=o.className,l=o.id,u=o.isDisabled,c=o.menuIsOpen,f=this.state.isFocused,h=this.commonProps=this.getCommonProps();return i.a.createElement(n,_({},h,{className:s,innerProps:{id:l,onKeyDown:this.onKeyDown},isDisabled:u,isFocused:f}),this.renderLiveRegion(),i.a.createElement(e,_({},h,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:u,isFocused:f,menuIsOpen:c}),i.a.createElement(a,_({},h,{isDisabled:u}),this.renderPlaceholderOrValue(),this.renderInput()),i.a.createElement(r,_({},h,{isDisabled:u}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}]),e}();b(Ut,"defaultProps",jt);var Ht={defaultInputValue:"",defaultMenuIsOpen:!1,defaultValue:null},qt=function(t){var e,r;return r=e=function(e){function r(){var t,e;m(this,r);for(var n=arguments.length,i=new Array(n),a=0;a1?r-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0,r=String(t).toLowerCase(),n=String(e.value).toLowerCase(),i=String(e.label).toLowerCase();return n===r||i===r},$t=w({allowCreateWhileLoading:!1,createOptionPosition:"last"},{formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,e,r){return!(!t||e.some(function(e){return Zt(t,e)})||r.some(function(e){return Zt(t,e)}))},getNewOptionData:function(t,e){return{label:e,value:t,__isNew__:!0}}}),Jt=function(t){var e,r;return r=e=function(e){function r(t){var e;m(this,r),b(E(E(e=S(this,A(r).call(this,t)))),"select",void 0),b(E(E(e)),"onChange",function(t,r){var n=e.props,i=n.getNewOptionData,a=n.inputValue,o=n.isMulti,s=n.onChange,l=n.onCreateOption,u=n.value;if("select-option"!==r.action)return s(t,r);var c=e.state.newOption,f=Array.isArray(t)?t:[t];if(f[f.length-1]!==c)s(t,r);else if(l)l(a);else{var h=i(a,a),p={action:"create-option"};s(o?[].concat(C(I(u)),[h]):h,p)}});var n=t.options||[];return e.state={newOption:void 0,options:n},e}return k(r,n["Component"]),x(r,[{key:"componentWillReceiveProps",value:function(t){var e=t.allowCreateWhileLoading,r=t.createOptionPosition,n=t.formatCreateLabel,i=t.getNewOptionData,a=t.inputValue,o=t.isLoading,s=t.isValidNewOption,l=t.value,u=t.options||[],c=this.state.newOption;c=s(a,I(l),u)?i(a,n(a)):void 0,this.setState({newOption:c,options:!e&&o||!c?u:"first"===r?[c].concat(C(u)):[].concat(C(u),[c])})}},{key:"focus",value:function(){this.select.focus()}},{key:"blur",value:function(){this.select.blur()}},{key:"render",value:function(){var e=this,r=_({},this.props),n=this.state.options;return i.a.createElement(t,_({},r,{ref:function(t){e.select=t},options:n,onChange:this.onChange}))}}]),r}(),b(e,"defaultProps",$t),r},Kt=qt(Jt(Ut)),Qt=qt(Jt(Ut)),te=Wt(Qt),ee=function(t){var e=t.component,r=t.duration,n=void 0===r?1:r,a=t.in,o=(t.onExited,M(t,["component","duration","in","onExited"])),s={entering:{opacity:0},entered:{opacity:1,transition:"opacity ".concat(n,"ms")},exiting:{opacity:0},exited:{opacity:0}};return i.a.createElement(v.Transition,{mountOnEnter:!0,unmountOnExit:!0,in:a,timeout:n},function(t){var r={style:w({},s[t])};return i.a.createElement(e,_({innerProps:r},o))})},re=260,ne=function(t){function e(){var t,r;m(this,e);for(var n=arguments.length,i=new Array(n),a=0;a0&&void 0!==arguments[0]?arguments[0]:{},r=Rt({components:e}),n=r.Input,a=r.MultiValue,o=r.Placeholder,s=r.SingleValue,l=r.ValueContainer,u=M(r,["Input","MultiValue","Placeholder","SingleValue","ValueContainer"]);return w({Input:(t=n,function(e){e.in,e.onExited,e.appear,e.enter,e.exit;var r=M(e,["in","onExited","appear","enter","exit"]);return i.a.createElement(t,r)}),MultiValue:function(t){return function(e){var r=e.in,n=e.onExited,a=M(e,["in","onExited"]);return i.a.createElement(ne,{in:r,onExited:n},i.a.createElement(t,_({cropWithEllipsis:r},a)))}}(a),Placeholder:function(t){return function(e){return i.a.createElement(ee,_({component:t,duration:e.isMulti?re:1},e))}}(o),SingleValue:function(t){return function(e){return i.a.createElement(ee,_({component:t},e))}}(s),ValueContainer:function(t){return function(e){return i.a.createElement(v.TransitionGroup,_({component:t},e))}}(l)},u)},ae=ie(),oe=(ae.Input,ae.MultiValue,ae.Placeholder,ae.SingleValue,ae.ValueContainer,o(ie,$)),se=qt(Ut);e.default=se},function(t,e,r){"use strict";var n=r(9),i=Object(n.a)(function(t,e){for(var r={},n={},i=0,a=t.length;i0))return o;do{o.push(a=new Date(+t)),n(t,i),e(t)}while(a=t)for(;e(t),!r(t);)t.setTime(t-1)},function(t,e){if(t>=t)if(e<0)for(;++e<=0;)for(;n(t,-1),!r(t););else for(;--e>=0;)for(;n(t,1),!r(t););})};a&&(c.count=function(t,n){return r.setTime(+t),i.setTime(+n),e(r),e(i),Math.floor(a(r,i))},c.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?c.filter(o?function(e){return o(e)%t==0}:function(e){return c.count(0,e)%t==0}):c:null});return c};var r=new Date,i=new Date},function(t,e,n){var r=n(128),i="object"==typeof self&&self&&self.Object===Object&&self,a=r||i||Function("return this")();t.exports=a},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){"use strict";var r=n(99);n.d(e,"a",function(){return r.a});n(171),n(102),n(169),n(172);var i=n(69);n.d(e,"c",function(){return i.a});n(173);var a=n(357);n.d(e,"f",function(){return a.a});var o=n(174);n.d(e,"g",function(){return o.a});var c=n(358);n.d(e,"h",function(){return c.a}),n.d(e,"i",function(){return c.b});var u=n(361);n.d(e,"j",function(){return u.a});var f=n(168);n.d(e,"d",function(){return f.a}),n.d(e,"e",function(){return f.b});n(362),n(363),n(364);var s=n(365);n.d(e,"b",function(){return s.a});n(366)},function(t,e,n){"use strict";var r=n(100);n.d(e,"a",function(){return r.e}),n.d(e,"f",function(){return r.g}),n.d(e,"d",function(){return r.f});var i=n(355);n.d(e,"e",function(){return i.a}),n.d(e,"c",function(){return i.b});var a=n(356);n.d(e,"b",function(){return a.a})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(197);n.d(e,"bisect",function(){return r.c}),n.d(e,"bisectRight",function(){return r.b}),n.d(e,"bisectLeft",function(){return r.a});var i=n(36);n.d(e,"ascending",function(){return i.a});var a=n(198);n.d(e,"bisector",function(){return a.a});var o=n(452);n.d(e,"cross",function(){return o.a});var c=n(453);n.d(e,"descending",function(){return c.a});var u=n(200);n.d(e,"deviation",function(){return u.a});var f=n(202);n.d(e,"extent",function(){return f.a});var s=n(454);n.d(e,"histogram",function(){return s.a});var l=n(457);n.d(e,"thresholdFreedmanDiaconis",function(){return l.a});var d=n(458);n.d(e,"thresholdScott",function(){return d.a});var h=n(206);n.d(e,"thresholdSturges",function(){return h.a});var b=n(459);n.d(e,"max",function(){return b.a});var p=n(460);n.d(e,"mean",function(){return p.a});var v=n(461);n.d(e,"median",function(){return v.a});var y=n(462);n.d(e,"merge",function(){return y.a});var _=n(207);n.d(e,"min",function(){return _.a});var g=n(199);n.d(e,"pairs",function(){return g.a});var m=n(463);n.d(e,"permute",function(){return m.a});var x=n(112);n.d(e,"quantile",function(){return x.a});var w=n(204);n.d(e,"range",function(){return w.a});var j=n(464);n.d(e,"scan",function(){return j.a});var O=n(465);n.d(e,"shuffle",function(){return O.a});var M=n(466);n.d(e,"sum",function(){return M.a});var k=n(205);n.d(e,"ticks",function(){return k.a}),n.d(e,"tickIncrement",function(){return k.b}),n.d(e,"tickStep",function(){return k.c});var A=n(208);n.d(e,"transpose",function(){return A.a});var T=n(201);n.d(e,"variance",function(){return T.a});var S=n(467);n.d(e,"zip",function(){return S.a})},function(t,e,n){"use strict";n.d(e,"c",function(){return C}),e.a=I;var r=n(315),i=n(316),a=n(317),o=n(318),c=n(162),u=n(320),f=n(321),s=n(322),l=n(323),d=n(324),h=n(325),b=n(326),p=n(327),v=n(328),y=n(329),_=n(330),g=n(164),m=n(331),x=n(332),w=n(333),j=n(334),O=n(335),M=n(336),k=n(337),A=n(338),T=n(339),S=n(340),P=n(341),R=n(97),E=n(342),C=[null];function I(t,e){this._groups=t,this._parents=e}function N(){return new I([[document.documentElement]],C)}I.prototype=N.prototype={constructor:I,select:r.a,selectAll:i.a,filter:a.a,data:o.a,enter:c.b,exit:u.a,merge:f.a,order:s.a,sort:l.a,call:d.a,nodes:h.a,node:b.a,size:p.a,empty:v.a,each:y.a,attr:_.a,style:g.a,property:m.a,classed:x.a,text:w.a,html:j.a,raise:O.a,lower:M.a,append:k.a,insert:A.a,remove:T.a,clone:S.a,datum:P.a,on:R.b,dispatch:E.a},e.b=N},function(t,e,n){"use strict";n.d(e,"c",function(){return u}),n.d(e,"d",function(){return f}),n.d(e,"b",function(){return d}),n.d(e,"a",function(){return h}),e.g=function(t,e){var n=b(t,e);if(n.state>c)throw new Error("too late; already scheduled");return n},e.h=function(t,e){var n=b(t,e);if(n.state>f)throw new Error("too late; already started");return n},e.f=b;var r=n(68),i=n(177),a=Object(r.dispatch)("start","end","interrupt"),o=[],c=0,u=1,f=2,s=3,l=4,d=5,h=6;function b(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}e.e=function(t,e,n,r,b,p){var v=t.__transition;if(v){if(n in v)return}else t.__transition={};!function(t,e,n){var r,a=t.__transition;function o(d){var p,v,y,_;if(n.state!==u)return b();for(p in a)if((_=a[p]).name===n.name){if(_.state===s)return Object(i.b)(o);_.state===l?(_.state=h,_.timer.stop(),_.on.call("interrupt",t,t.__data__,_.index,_.group),delete a[p]):+p0&&(0,l.renderAxes)(o,this.conf,t,this.scale);var u=this.renderDatum(o,this.conf,t._layout);return this.conf.tooltipContent&&(0,i.registerTooltip)(this,t,u,this.conf),u.on("mouseover",function(e,n){r.dispatch.call("mouseover",r,e),r.conf.tooltipContent&&t.clipboard.attr("value",r.conf.tooltipContent(e))}),u.on("mouseout",function(t,e){r.dispatch.call("mouseout",r,t)}),Object.keys(this.conf.events).forEach(function(t){var e=r.conf;u.on(t,function(n,r,i){e.events[t](n,r,i,c.event)})}),this}},{key:"renderBlock",value:function(t,e,n,r){var i=this,a=t.selectAll(".block").data(e).enter().append("g").attr("class","block").attr("transform",function(t){return"rotate("+360*n.blocks[t.key].start/(2*Math.PI)+")"});return r.backgrounds&&a.selectAll(".background").data(function(t){return r.backgrounds.map(function(e){return{start:e.start||r.cmin,end:e.end||r.cmax,angle:n.blocks[t.key].end-n.blocks[t.key].start,color:e.color,opacity:e.opacity}})}).enter().append("path").attr("class","background").attr("fill",function(t){return t.color}).attr("opacity",function(t){return t.opacity||1}).attr("d",(0,o.arc)().innerRadius(function(t){return"in"===r.direction?r.outerRadius-i.scale(t.start):r.innerRadius+i.scale(t.start)}).outerRadius(function(t){return"in"===r.direction?r.outerRadius-i.scale(t.end):r.innerRadius+i.scale(t.end)}).startAngle(0).endAngle(function(t){return t.angle})),a}},{key:"theta",value:function(t,e){return t/e.len*(e.end-e.start)}},{key:"x",value:function(t,e,n){var r=this.scale(t.value),i="in"===n.direction?n.outerRadius-r:n.innerRadius+r,a=this.theta(t.position,e.blocks[t.block_id])-Math.PI/2;return i*Math.cos(a)}},{key:"y",value:function(t,e,n){var r=this.scale(t.value),i="in"===n.direction?n.outerRadius-r:n.innerRadius+r,a=this.theta(t.position,e.blocks[t.block_id])-Math.PI/2;return i*Math.sin(a)}}]),t}();e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseSpanValueData=function(t,e){if(0===t.length)return{data:[],meta:{min:null,max:null}};return d(t.filter(function(t,n){return s(t.block_id,n,e,"parent")}))},e.parseSpanStringData=function(t,e){if(0===t.length)return{data:[],meta:{min:null,max:null}};return d(t.filter(function(t,n){return s(t.block_id,n,e,"parent")}).filter(function(t,e){return l({start:t.start,end:t.end},e)}).filter(function(t){return!(t.start<0||t.end>e[t.block_id])||(f.log(2,"position","position inconsistency",{datum:t,layoutSummary:e}),!1)}))},e.parsePositionValueData=function(t,e){if(0===t.length)return{data:[],meta:{min:null,max:null}};return d(t.filter(function(t,n){return s(t.block_id,n,e,"parent")}).filter(function(t,e){return l({position:t.position,value:t.value},e)}))},e.parsePositionTextData=function(t,e){if(0===t.length)return{data:[],meta:{min:null,max:null}};return d(t.filter(function(t,n){return s(t.block_id,n,e,"parent")}).filter(function(t,e){return l({position:t.position},e)}))},e.parseChordData=function(t,e){if(0===t.length)return{data:[],meta:{min:null,max:null}};var n=t.filter(function(t,n){return t.source?s(t.source.id,n,e,"sourceId"):(f.warn("No source for data at index "+n),!1)}).filter(function(t,n){return t.target?s(t.target.id,n,e,"targetId"):(f.warn("No target for data at index "+n),!1)}).filter(function(t,e){return l({sourceStart:t.source.start,sourceEnd:t.source.end,targetStart:t.target.start,targetEnd:t.target.end,value:t.value||1},e)});return{data:n,meta:{min:(0,c.min)(n,function(t){return t.value}),max:(0,c.max)(n,function(t){return t.value})}}};var r=u(n(18)),i=u(n(613)),a=u(n(617)),o=(u(n(144)),n(227)),c=n(10);function u(t){return t&&t.__esModule?t:{default:t}}var f=console;function s(t,e,n,a){return!!(0,i.default)((0,r.default)(n),t)||(f.log(1,"datum","unknown parent id",{line:e+1,value:t,header:a,layoutSummary:n}),!1)}function l(t,e){return(0,a.default)(t,function(t,n){return!isNaN(t)||(f.log(1,"datum","not a number",{line:e+1,value:t,header:n}),!1)})}function d(t){return{data:(0,o.nest)().key(function(t){return t.block_id}).entries(t),meta:{min:(0,c.min)(t,function(t){return t.value}),max:(0,c.max)(t,function(t){return t.value})}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={min:{value:null,iteratee:!1},max:{value:null,iteratee:!1},logScale:{value:!1,iteratee:!1},logScaleBase:{value:Math.E,iteratee:!1}};e.axes={axes:{value:[],iteratee:!1},showAxesTooltip:{value:!0,iteratee:!1}},e.palette={colorPaletteSize:{value:9,iteratee:!1},colorPalette:{value:"YlGnBu",iteratee:!1},usePalette:{value:!0,iteratee:!1},colorPaletteReverse:{value:!0,iteratee:!1}},e.radial={innerRadius:{value:0,iteratee:!1},outerRadius:{value:0,iteratee:!1}},e.values=r,e.common={zIndex:{value:!1,iteratee:!1},opacity:{value:1,iteratee:!0},tooltipContent:{value:null,iteratee:!1},events:{value:{},iteratee:!1}}},function(t,e,n){var r=n(243),i=n(248);t.exports=function(t,e){var n=i(t,e);return r(n)?n:void 0}},function(t,e,n){var r=n(16),i=n(7),a="[object AsyncFunction]",o="[object Function]",c="[object GeneratorFunction]",u="[object Proxy]";t.exports=function(t){if(!i(t))return!1;var e=r(t);return e==o||e==c||e==a||e==u}},function(t,e,n){"use strict";e.a=function(t){return function(){return t}}},function(t,e){t.exports={}},function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"b",function(){return a});var r=Array.prototype,i=r.map,a=r.slice},function(t,e){t.exports=function(t){return t}},function(t,e,n){var r=n(5).Symbol;t.exports=r},function(t,e){t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++ne?1:t>=e?0:NaN}},function(t,e,n){var r=n(476),i=n(478);t.exports=function(t,e,n){return r(i,t,e,n)}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(283),i=n(285)(r);t.exports=i},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n180||n<-180?n-360*Math.round(n/360):n):Object(r.a)(isNaN(t)?e:t)},e.b=function(t){return 1==(t=+t)?a: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(r){return Math.pow(t+r*e,n)}}(e,n,t):Object(r.a)(isNaN(e)?n:e)}},e.a=a;var r=n(170);function i(t,e){return function(n){return t+n*e}}function a(t,e){var n=e-t;return n?i(t,n):Object(r.a)(isNaN(t)?e:t)}},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n.d(e,"d",function(){return i}),n.d(e,"e",function(){return a}),n.d(e,"h",function(){return o}),n.d(e,"i",function(){return c}),n.d(e,"k",function(){return u}),n.d(e,"l",function(){return f}),n.d(e,"f",function(){return s}),n.d(e,"j",function(){return l}),n.d(e,"g",function(){return d}),n.d(e,"m",function(){return h}),e.b=function(t){return t>1?0:t<-1?l:Math.acos(t)},e.c=function(t){return t>=1?d:t<=-1?-d:Math.asin(t)};var r=Math.abs,i=Math.atan2,a=Math.cos,o=Math.max,c=Math.min,u=Math.sin,f=Math.sqrt,s=1e-12,l=Math.PI,d=l/2,h=2*l},function(t,e,n){"use strict";e.a=function(t,e){if((i=t.length)>1)for(var n,r,i,a=1,o=t[e[0]],c=o.length;a=0;)n[e]=e;return n}},function(t,e,n){"use strict";e.a=function(t){return null===t?NaN:+t}},function(t,e,n){"use strict";e.b=c,e.a=function t(){var e=Object(a.b)(a.c,i.c);e.copy=function(){return Object(a.a)(e,t())};return c(e)};var r=n(10),i=n(8),a=n(76),o=n(527);function c(t){var e=t.domain;return t.ticks=function(t){var n=e();return Object(r.ticks)(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){return Object(o.a)(e(),t,n)},t.nice=function(n){null==n&&(n=10);var i,a=e(),o=0,c=a.length-1,u=a[o],f=a[c];return f0?(u=Math.floor(u/i)*i,f=Math.ceil(f/i)*i,i=Object(r.tickIncrement)(u,f,n)):i<0&&(u=Math.ceil(u*i)/i,f=Math.floor(f*i)/i,i=Object(r.tickIncrement)(u,f,n)),i>0?(a[o]=Math.floor(u/i)*i,a[c]=Math.ceil(f/i)*i,e(a)):i<0&&(a[o]=Math.ceil(u*i)/i,a[c]=Math.floor(f*i)/i,e(a)),t},t}},function(t,e,n){"use strict";e.a=function(t){return t.match(/.{6}/g).map(function(t){return"#"+t})}},function(t,e){t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},function(t,e,n){var r=n(52),i=n(255),a=n(256),o=n(257),c=n(258),u=n(259);function f(t){var e=this.__data__=new r(t);this.size=e.size}f.prototype.clear=i,f.prototype.delete=a,f.prototype.get=o,f.prototype.has=c,f.prototype.set=u,t.exports=f},function(t,e,n){var r=n(250),i=n(251),a=n(252),o=n(253),c=n(254);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t2?l:s,r=o=null,y}function y(e){return(r||(r=n(d,h,p?function(t){return function(e,n){var r=t(e=+e,n=+n);return function(t){return t<=e?0:t>=n?1:r(t)}}}(t):t,b)))(+e)}return y.invert=function(t){return(o||(o=n(h,d,f,p?function(t){return function(e,n){var r=t(e=+e,n=+n);return function(t){return t<=0?e:t>=1?n:r(t)}}}(e):e)))(+t)},y.domain=function(t){return arguments.length?(d=a.a.call(t,c.a),v()):d.slice()},y.range=function(t){return arguments.length?(h=a.b.call(t),v()):h.slice()},y.rangeRound=function(t){return h=a.b.call(t),b=i.f,v()},y.clamp=function(t){return arguments.length?(p=!!t,v()):p},y.interpolate=function(t){return arguments.length?(b=t,v()):b},v()};var r=n(10),i=n(8),a=n(27),o=n(121),c=n(228),u=[0,1];function f(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:Object(o.a)(e)}function s(t,e,n,r){var i=t[0],a=t[1],o=e[0],c=e[1];return a-1&&t%1==0&&t<=n}},function(t,e,n){var r=n(277),i=n(60),a=n(89),o=a&&a.isTypedArray,c=o?i(o):r;t.exports=c},function(t,e,n){(function(t){var r=n(128),i="object"==typeof e&&e&&!e.nodeType&&e,a=i&&"object"==typeof t&&t&&!t.nodeType&&t,o=a&&a.exports===i&&r.process,c=function(){try{var t=a&&a.require&&a.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=c}).call(e,n(84)(t))},function(t,e,n){var r=n(83),i=n(38),a=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var o=t[e];a.call(t,e)&&i(o,n)&&(void 0!==n||e in t)||r(t,e,n)}},function(t,e,n){var r=n(149),i=n(150),a=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols,c=o?function(t){return null==t?[]:(t=Object(t),r(o(t),function(e){return a.call(t,e)}))}:i;t.exports=c},function(t,e,n){var r=n(2),i=n(34),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!i(t))||o.test(t)||!a.test(t)||null!=e&&t in Object(e)}},function(t,e,n){"use strict";var r=n(94);e.a=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),r.a.hasOwnProperty(e)?{space:r.a[e],local:t}:t}},function(t,e,n){"use strict";n.d(e,"b",function(){return r});var r="http://www.w3.org/1999/xhtml";e.a={svg:"http://www.w3.org/2000/svg",xhtml:r,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}},function(t,e,n){"use strict";function r(){}e.a=function(t){return null==t?r:function(){return this.querySelector(t)}}},function(t,e,n){"use strict";e.a=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}},function(t,e,n){"use strict";n.d(e,"c",function(){return i}),e.a=function(t,e,n,r){var a=i;t.sourceEvent=i,i=t;try{return e.apply(n,r)}finally{i=a}};var r={},i=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(r={mouseenter:"mouseover",mouseleave:"mouseout"}));function a(t,e,n){return t=o(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function o(t,e,n){return function(r){var a=i;i=r;try{t.call(this,this.__data__,e,n)}finally{i=a}}}function c(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,a=e.length;r=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}(t+""),o=a.length;if(!(arguments.length<2)){for(f=e?u:c,null==n&&(n=!1),r=0;r>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=l.exec(t))?m(parseInt(e[1],16)):(e=d.exec(t))?new O(e[1],e[2],e[3],1):(e=h.exec(t))?new O(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=b.exec(t))?x(e[1],e[2],e[3],e[4]):(e=p.exec(t))?x(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=v.exec(t))?M(e[1],e[2]/100,e[3]/100,1):(e=y.exec(t))?M(e[1],e[2]/100,e[3]/100,e[4]):_.hasOwnProperty(t)?m(_[t]):"transparent"===t?new O(NaN,NaN,NaN,0):null}function m(t){return new O(t>>16&255,t>>8&255,255&t,1)}function x(t,e,n,r){return r<=0&&(t=e=n=NaN),new O(t,e,n,r)}function w(t){return t instanceof i||(t=g(t)),t?new O((t=t.rgb()).r,t.g,t.b,t.opacity):new O}function j(t,e,n,r){return 1===arguments.length?w(t):new O(t,e,n,null==r?1:r)}function O(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function M(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new A(t,e,n,r)}function k(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof A)return new A(t.h,t.s,t.l,t.opacity);if(t instanceof i||(t=g(t)),!t)return new A;if(t instanceof A)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,a=Math.min(e,n,r),o=Math.max(e,n,r),c=NaN,u=o-a,f=(o+a)/2;return u?(c=e===o?(n-r)/u+6*(n0&&f<1?0:c,new A(c,u,f,t.opacity)}(t):new A(t,e,n,null==r?1:r)}function A(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function T(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Object(r.a)(i,g,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),Object(r.a)(O,j,Object(r.b)(i,{brighter:function(t){return t=null==t?o:Math.pow(o,t),new O(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?a:Math.pow(a,t),new O(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},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+")")}})),Object(r.a)(A,k,Object(r.b)(i,{brighter:function(t){return t=null==t?o:Math.pow(o,t),new A(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?a:Math.pow(a,t),new A(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,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new O(T(t>=240?t-240:t+120,i,r),T(t,i,r),T(t<120?t+240:t-120,i,r),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}}))},function(t,e,n){"use strict";e.b=function(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n},e.a=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t}},function(t,e,n){"use strict";function r(t,e,n,r,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*r+o*i)/6}e.a=r,e.b=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),a=t[i],o=t[i+1],c=i>0?t[i-1]:2*a-o,u=i=0&&e._call.call(null,t),e=e._next;--a}()}finally{a=0,function(){var t,e,n=r,a=1/0;for(;n;)n._call?(a>n._time&&(a=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:r=e);i=t,m(a)}(),s=0}}function g(){var t=d.now(),e=t-f;e>u&&(l-=e,f=t)}function m(t){a||(o&&(o=clearTimeout(o)),t-s>24?(t<1/0&&(o=setTimeout(_,t-d.now()-l)),c&&(c=clearInterval(c))):(c||(f=d.now(),c=setInterval(g,u)),a=1,h(_)))}v.prototype=y.prototype={constructor:v,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?b():+n)+(null==e?0:+e),this._next||i===this||(i?i._next=this:r=this,i=this),this._call=t,this._time=n,m()},stop:function(){this._call&&(this._call=null,this._time=1/0,m())}}},function(t,e,n){var r=n(51),i=n(64),a=n(90),o=n(181),c=n(404),u=n(134),f=n(30),s=n(405),l=n(406),d=n(147),h=n(407),b=n(41),p=n(408),v=n(409),y=n(137),_=n(2),g=n(59),m=n(413),x=n(7),w=n(415),j=n(18),O=1,M=2,k=4,A="[object Arguments]",T="[object Function]",S="[object GeneratorFunction]",P="[object Object]",R={};R[A]=R["[object Array]"]=R["[object ArrayBuffer]"]=R["[object DataView]"]=R["[object Boolean]"]=R["[object Date]"]=R["[object Float32Array]"]=R["[object Float64Array]"]=R["[object Int8Array]"]=R["[object Int16Array]"]=R["[object Int32Array]"]=R["[object Map]"]=R["[object Number]"]=R[P]=R["[object RegExp]"]=R["[object Set]"]=R["[object String]"]=R["[object Symbol]"]=R["[object Uint8Array]"]=R["[object Uint8ClampedArray]"]=R["[object Uint16Array]"]=R["[object Uint32Array]"]=!0,R["[object Error]"]=R[T]=R["[object WeakMap]"]=!1,t.exports=function t(e,n,E,C,I,N){var D,z=n&O,B=n&M,U=n&k;if(E&&(D=I?E(e,C,I,N):E(e)),void 0!==D)return D;if(!x(e))return e;var L=_(e);if(L){if(D=p(e),!z)return f(e,D)}else{var W=b(e),F=W==T||W==S;if(g(e))return u(e,z);if(W==P||W==A||F&&!I){if(D=B||F?{}:y(e),!z)return B?l(e,c(D,e)):s(e,o(D,e))}else{if(!R[W])return I?e:{};D=v(e,W,z)}}N||(N=new r);var Y=N.get(e);if(Y)return Y;if(N.set(e,D),w(e))return e.forEach(function(r){D.add(t(r,n,E,r,e,N))}),D;if(m(e))return e.forEach(function(r,i){D.set(i,t(r,n,E,i,e,N))}),D;var q=U?B?h:d:B?keysIn:j,G=L?void 0:q(e);return i(G||e,function(r,i){G&&(r=e[i=r]),a(D,i,t(r,n,E,i,e,N))}),D}},function(t,e,n){var r=n(417),i=n(39),a=n(33),o=n(418),c=n(2);t.exports=function(t,e,n){var u=c(t)?r:o,f=arguments.length<3;return u(t,a(e,4),n,f,i)}},function(t,e,n){var r=n(107),i=n(422),a=n(78),o=n(63),c=a(function(t,e){if(null==t)return[];var n=e.length;return n>1&&o(t,e[0],e[1])?e=[]:n>2&&o(e[0],e[1],e[2])&&(e=[e[0]]),i(t,r(e,1),[])});t.exports=c},function(t,e,n){var r=n(65),i=n(421);t.exports=function t(e,n,a,o,c){var u=-1,f=e.length;for(a||(a=i),c||(c=[]);++u0&&a(s)?n>1?t(s,n-1,a,o,c):r(c,s):o||(c[c.length]=s)}return c}},function(t,e,n){"use strict";var r=n(35),i=n(25),a=n(71),o=n(109);e.a=function(){var t=o.a,e=o.b,n=Object(i.a)(!0),c=null,u=a.a,f=null;function s(i){var a,o,s,l=i.length,d=!1;for(null==c&&(f=u(s=Object(r.a)())),a=0;a<=l;++a)!(ar.f){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,f=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/f,a=(a*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/f}if(t._l23_a>r.f){var s=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*s+t._x1*t._l23_2a-e*t._l12_2a)/l,c=(c*s+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(i,a,o,c,t._x2,t._y2)}function o(t,e){this._context=t,this._alpha=e}o.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,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:a(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}},e.a=function t(e){function n(t){return e?new o(t,e):new i.a(t,0)}return n.alpha=function(e){return t(+e)},n}(.5)},function(t,e,n){"use strict";e.b=i;var r=n(46);function i(t){for(var e,n=0,r=-1,i=t.length;++r=1)return+n(t[i-1],i-1,t);var i,a=(i-1)*e,o=Math.floor(a),c=+n(t[o],o,t);return c+(+n(t[o+1],o+1,t)-c)*(a-o)}}},function(t,e,n){var r=n(211),i=n(480),a=n(481),o=n(213),c=n(495),u=n(116),f=n(496),s=n(219),l=n(220),d=n(119),h="Expected a function",b=1,p=2,v=8,y=16,_=32,g=64,m=Math.max;t.exports=function(t,e,n,x,w,j,O,M){var k=e&p;if(!k&&"function"!=typeof t)throw new TypeError(h);var A=x?x.length:0;if(A||(e&=~(_|g),x=w=void 0),O=void 0===O?O:m(d(O),0),M=void 0===M?M:d(M),A-=w?w.length:0,e&g){var T=x,S=w;x=w=void 0}var P=k?void 0:u(t),R=[t,e,n,x,w,T,S,j,O,M];if(P&&f(R,P),t=R[0],e=R[1],n=R[2],x=R[3],w=R[4],!(M=R[9]=void 0===R[9]?k?0:t.length:m(R[9]-A,0))&&e&(v|y)&&(e&=~(v|y)),e&&e!=b)E=e==v||e==y?a(t,e,M):e!=_&&e!=(b|_)||w.length?o.apply(void 0,R):c(t,e,n,x);else var E=i(t,e,n);return l((P?r:s)(E,R),t,e)}},function(t,e,n){var r=n(56),i=n(115),a=4294967295;function o(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=a,this.__views__=[]}o.prototype=r(i.prototype),o.prototype.constructor=o,t.exports=o},function(t,e){t.exports=function(){}},function(t,e,n){var r=n(212),i=n(483),a=r?function(t){return r.get(t)}:i;t.exports=a},function(t,e,n){var r=n(56),i=n(115);function a(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}a.prototype=r(i.prototype),a.prototype.constructor=a,t.exports=a},function(t,e){var n="__lodash_placeholder__";t.exports=function(t,e){for(var r=-1,i=t.length,a=0,o=[];++r1?r[0]+r.slice(2):r,+t.slice(n+1)]}},function(t,e,n){"use strict";n(4);var r=n(542);n.d(e,"c",function(){return r.a}),n.d(e,"n",function(){return r.a});var i=n(543);n.d(e,"g",function(){return i.a}),n.d(e,"r",function(){return i.a});var a=n(544);n.d(e,"d",function(){return a.a});var o=n(545);n.d(e,"b",function(){return o.a});var c=n(546);n.d(e,"a",function(){return c.a});var u=n(547);n.d(e,"j",function(){return u.b}),n.d(e,"h",function(){return u.b}),n.d(e,"e",function(){return u.a}),n.d(e,"i",function(){return u.c});var f=n(548);n.d(e,"f",function(){return f.a});var s=n(549);n.d(e,"k",function(){return s.a});var l=n(550);n.d(e,"o",function(){return l.a});var d=n(551);n.d(e,"m",function(){return d.a});var h=n(552);n.d(e,"l",function(){return h.a});var b=n(553);n.d(e,"u",function(){return b.b}),n.d(e,"s",function(){return b.b}),n.d(e,"p",function(){return b.a}),n.d(e,"t",function(){return b.c});var p=n(554);n.d(e,"q",function(){return p.a});var v=n(555);n.d(e,"v",function(){return v.a})},function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"b",function(){return a}),n.d(e,"c",function(){return o});var r,i,a,o,c,u=n(237);c={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"]},r=Object(u.a)(c),i=r.format,r.parse,a=r.utcFormat,o=r.utcParse},function(t,e,n){var r=n(50),i=n(78),a=n(249),o=n(282),c=i(function(t){return t.push(void 0,a),r(o,void 0,t)});t.exports=c},function(t,e,n){var r=n(50),i=Math.max;t.exports=function(t,e,n){return e=i(void 0===e?t.length-1:e,0),function(){for(var a=arguments,o=-1,c=i(a.length-e,0),u=Array(c);++o0){if(++e>=n)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var r=n(51),i=n(132),a=n(133),o=n(273),c=n(7),u=n(61),f=n(140);t.exports=function t(e,n,s,l,d){e!==n&&a(n,function(a,u){if(c(a))d||(d=new r),o(e,n,u,s,t,l,d);else{var h=l?l(f(e,u),a,u+"",e,n,d):void 0;void 0===h&&(h=a),i(e,u,h)}},u)}},function(t,e,n){var r=n(83),i=n(38);t.exports=function(t,e,n){(void 0===n||i(t[e],n))&&(void 0!==n||e in t)||r(t,e,n)}},function(t,e,n){var r=n(272)();t.exports=r},function(t,e,n){(function(t){var r=n(5),i="object"==typeof e&&e&&!e.nodeType&&e,a=i&&"object"==typeof t&&t&&!t.nodeType&&t,o=a&&a.exports===i?r.Buffer:void 0,c=o?o.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=c?c(n):new t.constructor(n);return t.copy(r),r}}).call(e,n(84)(t))},function(t,e,n){var r=n(85);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},function(t,e,n){var r=n(5).Uint8Array;t.exports=r},function(t,e,n){var r=n(56),i=n(86),a=n(57);t.exports=function(t){return"function"!=typeof t.constructor||a(t)?{}:r(i(t))}},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){var r=n(16),i=n(86),a=n(6),o="[object Object]",c=Function.prototype,u=Object.prototype,f=c.toString,s=u.hasOwnProperty,l=f.call(Object);t.exports=function(t){if(!a(t)||r(t)!=o)return!1;var e=i(t);if(null===e)return!0;var n=s.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&f.call(n)==l}},function(t,e){t.exports=function(t,e){if("__proto__"!=e)return t[e]}},function(t,e,n){var r=n(279),i=n(58),a=n(2),o=n(59),c=n(62),u=n(88),f=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=a(t),s=!n&&i(t),l=!n&&!s&&o(t),d=!n&&!s&&!l&&u(t),h=n||s||l||d,b=h?r(t.length,String):[],p=b.length;for(var v in t)!e&&!f.call(t,v)||h&&("length"==v||l&&("offset"==v||"parent"==v)||d&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||c(v,p))||b.push(v);return b}},function(t,e,n){var r=n(78),i=n(63);t.exports=function(t){return r(function(e,n){var r=-1,a=n.length,o=a>1?n[a-1]:void 0,c=a>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(a--,o):void 0,c&&i(n[0],n[1],c)&&(o=a<3?void 0:o,a=1),e=Object(e);++rd))return!1;var b=s.get(t);if(b&&s.get(e))return b==e;var p=-1,v=!0,y=n&c?new r:void 0;for(s.set(t,e),s.set(e,t);++p1?this.each((null==e?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof e?function(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}:function(t,e,n){return function(){this.style.setProperty(t,e,n)}})(t,e,null==n?"":n)):i(this.node(),t)}},function(t,e,n){"use strict";e.b=function(t,e){var n=t.document.documentElement,a=Object(r.select)(t).on("dragstart.drag",null);e&&(a.on("click.drag",i.a,!0),setTimeout(function(){a.on("click.drag",null)},0));"onselectstart"in n?a.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)};var r=n(3),i=n(166);e.a=function(t){var e=t.document.documentElement,n=Object(r.select)(t).on("dragstart.drag",i.a,!0);"onselectstart"in e?n.on("selectstart.drag",i.a,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}},function(t,e,n){"use strict";e.b=function(){r.event.stopImmediatePropagation()};var r=n(3);e.a=function(){r.event.preventDefault(),r.event.stopImmediatePropagation()}},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n.d(e,"b",function(){return i});var r=Math.PI/180,i=180/Math.PI},function(t,e,n){"use strict";n.d(e,"b",function(){return u});var r=n(9),i=n(102),a=n(169),o=n(43);function c(t){return function(e){var n,i,a=e.length,o=new Array(a),c=new Array(a),u=new Array(a);for(n=0;nu&&(c=e.slice(u,c),s[f]?s[f]+=c:s[++f]=c),(n=n[0])===(o=o[0])?s[f]?s[f]+=o:s[++f]=o:(s[++f]=null,l.push({i:f,x:Object(r.a)(n,o)})),u=a.lastIndex;return ur.d&&n.state=o;--c)d.point(y[c],_[c]);d.lineEnd(),d.areaEnd()}v&&(y[a]=+t(h,a,i),_[a]=+n(h,a,i),d.point(e?+e(h,a,i):y[a],u?+u(h,a,i):_[a]))}if(b)return d=null,b+""||null}function b(){return Object(o.a)().defined(f).curve(l).context(s)}return h.x=function(n){return arguments.length?(t="function"==typeof n?n:Object(i.a)(+n),e=null,h):t},h.x0=function(e){return arguments.length?(t="function"==typeof e?e:Object(i.a)(+e),h):t},h.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:Object(i.a)(+t),h):e},h.y=function(t){return arguments.length?(n="function"==typeof t?t:Object(i.a)(+t),u=null,h):n},h.y0=function(t){return arguments.length?(n="function"==typeof t?t:Object(i.a)(+t),h):n},h.y1=function(t){return arguments.length?(u=null==t?null:"function"==typeof t?t:Object(i.a)(+t),h):u},h.lineX0=h.lineY0=function(){return b().x(t).y(n)},h.lineY1=function(){return b().x(t).y(u)},h.lineX1=function(){return b().x(e).y(n)},h.defined=function(t){return arguments.length?(f="function"==typeof t?t:Object(i.a)(!!t),h):f},h.curve=function(t){return arguments.length?(l=t,null!=s&&(d=l(s)),h):l},h.context=function(t){return arguments.length?(null==t?s=d=null:d=l(s=t),h):s},h}},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),e.b=a;var r=a(n(71).a);function i(t){this._curve=t}function a(t){function e(e){return new i(t(e))}return e._curve=t,e}i.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))}}},function(t,e,n){"use strict";e.b=a;var r=n(184),i=n(108);function a(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(Object(r.b)(t)):e()._curve},t}e.a=function(){return a(Object(i.a)().curve(r.a))}},function(t,e,n){"use strict";e.a=function(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=Array.prototype.slice},function(t,e,n){"use strict";var r=n(44);e.a={draw:function(t,e){var n=Math.sqrt(e/r.j);t.moveTo(n,0),t.arc(0,0,n,0,r.m)}}},function(t,e,n){"use strict";e.a={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()}}},function(t,e,n){"use strict";var r=Math.sqrt(1/3),i=2*r;e.a={draw:function(t,e){var n=Math.sqrt(e/i),a=n*r;t.moveTo(0,-n),t.lineTo(a,0),t.lineTo(0,n),t.lineTo(-a,0),t.closePath()}}},function(t,e,n){"use strict";var r=n(44),i=Math.sin(r.j/10)/Math.sin(7*r.j/10),a=Math.sin(r.m/10)*i,o=-Math.cos(r.m/10)*i;e.a={draw:function(t,e){var n=Math.sqrt(.8908130915292852*e),i=a*n,c=o*n;t.moveTo(0,-n),t.lineTo(i,c);for(var u=1;u<5;++u){var f=r.m*u/5,s=Math.cos(f),l=Math.sin(f);t.lineTo(l*n,-s*n),t.lineTo(s*i-l*c,l*i+s*c)}t.closePath()}}},function(t,e,n){"use strict";e.a={draw:function(t,e){var n=Math.sqrt(e),r=-n/2;t.rect(r,r,n,n)}}},function(t,e,n){"use strict";var r=Math.sqrt(3);e.a={draw:function(t,e){var n=-Math.sqrt(e/(3*r));t.moveTo(0,2*n),t.lineTo(-r*n,-n),t.lineTo(r*n,-n),t.closePath()}}},function(t,e,n){"use strict";var r=-.5,i=Math.sqrt(3)/2,a=1/Math.sqrt(12),o=3*(a/2+1);e.a={draw:function(t,e){var n=Math.sqrt(e/o),c=n/2,u=n*a,f=c,s=n*a+n,l=-f,d=s;t.moveTo(c,u),t.lineTo(f,s),t.lineTo(l,d),t.lineTo(r*c-i*u,i*c+r*u),t.lineTo(r*f-i*s,i*f+r*s),t.lineTo(r*l-i*d,i*l+r*d),t.lineTo(r*c+i*u,r*u-i*c),t.lineTo(r*f+i*s,r*s-i*f),t.lineTo(r*l+i*d,r*d-i*l),t.closePath()}}},function(t,e,n){"use strict";e.a=a;var r=n(72),i=n(74);function a(t,e){this._context=t,this._k=(1-e)/6}a.prototype={areaStart:r.a,areaEnd:r.a,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:Object(i.c)(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}},e.b=function t(e){function n(t){return new a(t,e)}return n.tension=function(e){return t(+e)},n}(0)},function(t,e,n){"use strict";e.a=i;var r=n(74);function i(t,e){this._context=t,this._k=(1-e)/6}i.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:Object(r.c)(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}},e.b=function t(e){function n(t){return new i(t,e)}return n.tension=function(e){return t(+e)},n}(0)},function(t,e,n){"use strict";n.d(e,"b",function(){return o}),n.d(e,"a",function(){return c});var r=n(36),i=n(198),a=Object(i.a)(r.a),o=a.right,c=a.left;e.c=o},function(t,e,n){"use strict";var r=n(36);e.a=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return Object(r.a)(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[a],n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[a],n)>0?i=a:r=a+1}return r}}}},function(t,e,n){"use strict";function r(t,e){return[t,e]}e.b=r,e.a=function(t,e){null==e&&(e=r);for(var n=0,i=t.length-1,a=t[0],o=new Array(i<0?0:i);n1)return f/(o-1)}},function(t,e,n){"use strict";e.a=function(t,e){var n,r,i,a=t.length,o=-1;if(null==e){for(;++o=n)for(r=i=n;++on&&(r=n),i=n)for(r=i=n;++on&&(r=n),i=r?c*=10:u>=i?c*=5:u>=a&&(c*=2);return e=0?(u>=r?10:u>=i?5:u>=a?2:1)*Math.pow(10,c):-Math.pow(10,-c)/(u>=r?10:u>=i?5:u>=a?2:1)}e.a=function(t,e,n){var r,i,a,c,u=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((r=e0)for(t=Math.ceil(t/c),e=Math.floor(e/c),a=new Array(i=Math.ceil(e-t+1));++u=n)for(r=n;++an&&(r=n)}else for(;++a=n)for(r=n;++an&&(r=n);return r}},function(t,e,n){"use strict";var r=n(207);function i(t){return t.length}e.a=function(t){if(!(o=t.length))return[];for(var e=-1,n=Object(r.a)(t,i),a=new Array(n);++e3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Math.E;r&&t*e<=0&&console.warn("As log(0) = -∞, a log scale domain must be\n strictly-positive or strictly-negative. logscale ignored");return(r&&t*e>0?(0,f.scaleLog)().base(i):(0,f.scaleLinear)()).domain([t,e]).range([0,n]).clamp(!0)};var r=s(n(475)),i=s(n(506)),a=s(n(509)),o=s(n(511)),c=s(n(514)),u=s(n(518)),f=n(225);function s(t){return t&&t.__esModule?t:{default:t}}},function(t,e,n){var r=n(28),i=n(212),a=i?function(t,e){return i.set(t,e),t}:r;t.exports=a},function(t,e,n){var r=n(151),i=r&&new r;t.exports=i},function(t,e,n){var r=n(214),i=n(215),a=n(482),o=n(75),c=n(216),u=n(222),f=n(494),s=n(118),l=n(5),d=1,h=2,b=8,p=16,v=128,y=512;t.exports=function t(e,n,_,g,m,x,w,j,O,M){var k=n&v,A=n&d,T=n&h,S=n&(b|p),P=n&y,R=T?void 0:o(e);return function d(){for(var h=arguments.length,b=Array(h),p=h;p--;)b[p]=arguments[p];if(S)var v=u(d),y=a(b,v);if(g&&(b=r(b,g,m,S)),x&&(b=i(b,x,w,S)),h-=y,S&&h1&&b.reverse(),k&&O(c=t.charCodeAt(n))||c>57){h=(46===c?l+t.slice(n+1):t.slice(n))+h,t=t.slice(0,n);break}}v&&!b&&(t=e(t,1/0));var O=f.length+t.length+h.length,M=O>1)+f+t+h+M.slice(O);break;default:t=M+f+t+h}return d(t)}return y=null==y?_?6:12:/[gprs]/.test(_)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),j.toString=function(){return t+""},j}return{format:b,formatPrefix:function(t,e){var n=b(((t=Object(o.a)(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(Object(r.a)(e)/3))),a=Math.pow(10,-i),c=s[8+i/3];return function(t){return n(a*t)+c}}}}},function(t,e,n){"use strict";e.a=a;var r=n(232),i=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;function a(t){return new o(t)}function o(t){if(!(e=i.exec(t)))throw new Error("invalid format: "+t);var e,n=e[1]||" ",a=e[2]||">",o=e[3]||"-",c=e[4]||"",u=!!e[5],f=e[6]&&+e[6],s=!!e[7],l=e[8]&&+e[8].slice(1),d=e[9]||"";"n"===d?(s=!0,d="g"):r.a[d]||(d=""),(u||"0"===n&&"="===a)&&(u=!0,n="0",a="="),this.fill=n,this.align=a,this.sign=o,this.symbol=c,this.zero=u,this.width=f,this.comma=s,this.precision=l,this.type=d}a.prototype=o.prototype,o.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.type}},function(t,e,n){"use strict";var r=n(531),i=n(233),a=n(532);e.a={"":r.a,"%":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 Object(a.a)(100*t,e)},r:a.a,s:i.a,X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}}},function(t,e,n){"use strict";n.d(e,"b",function(){return r});var r,i=n(122);e.a=function(t,e){var n=Object(i.a)(t,e);if(!n)return t+"";var a=n[0],o=n[1],c=o-(r=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,u=a.length;return c===u?a:c>u?a+new Array(c-u+1).join("0"):c>0?a.slice(0,c)+"."+a.slice(c):"0."+new Array(1-c).join("0")+Object(i.a)(t,Math.max(0,e+c-1))[0]}},function(t,e,n){"use strict";e.a=function(t,e){var n,r=0,i=(t=t.slice()).length-1,a=t[r],o=t[i];return o=12)]},Q:pt,s:vt,S:F,u:Y,U:q,V:G,w:V,W:X,x:null,X:null,y:H,Y:$,Z:Z,"%":bt},St={a:function(t){return l[t.getUTCDay()]},A:function(t){return s[t.getUTCDay()]},b:function(t){return yt[t.getUTCMonth()]},B:function(t){return d[t.getUTCMonth()]},c:null,d:K,e:K,f:nt,H:J,I:Q,j:tt,L:et,m:rt,M:it,p:function(t){return f[+(t.getUTCHours()>=12)]},Q:pt,s:vt,S:at,u:ot,U:ct,V:ut,w:ft,W:st,x:null,X:null,y:lt,Y:dt,Z:ht,"%":bt},Pt={a:function(t,e,n){var r=wt.exec(e.slice(n));return r?(t.w=jt[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=mt.exec(e.slice(n));return r?(t.w=xt[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=kt.exec(e.slice(n));return r?(t.m=At[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=Ot.exec(e.slice(n));return r?(t.m=Mt[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,n,r){return Ct(t,e,n,r)},d:O,e:O,f:P,H:k,I:k,j:M,L:S,m:j,M:A,p:function(t,e,n){var r=_t.exec(e.slice(n));return r?(t.p=gt[r[0].toLowerCase()],n+r[0].length):-1},Q:E,s:C,S:T,u:v,U:y,V:_,w:p,W:g,x:function(t,e,r){return Ct(t,n,e,r)},X:function(t,e,n){return Ct(t,u,e,n)},y:x,Y:m,Z:w,"%":R};function Rt(t,e){return function(n){var r,i,a,o=[],u=-1,f=0,s=t.length;for(n instanceof Date||(n=new Date(+n));++u53)return null;"w"in u||(u.w=1),"Z"in u?(i=a(o(u.y)),c=i.getUTCDay(),i=c>4||0===c?r.p.ceil(i):Object(r.p)(i),i=r.l.offset(i,7*(u.V-1)),u.y=i.getUTCFullYear(),u.m=i.getUTCMonth(),u.d=i.getUTCDate()+(u.w+6)%7):(i=e(o(u.y)),c=i.getDay(),i=c>4||0===c?r.e.ceil(i):Object(r.e)(i),i=r.a.offset(i,7*(u.V-1)),u.y=i.getFullYear(),u.m=i.getMonth(),u.d=i.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:"W"in u?1:0),c="Z"in u?a(o(u.y)).getUTCDay():e(o(u.y)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+7*u.W-(c+5)%7:u.w+7*u.U-(c+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,a(u)):e(u)}}function Ct(t,e,n,r){for(var i,a,o=0,u=e.length,f=n.length;o=f)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=Pt[i in c?e.charAt(o++):i])||(r=a(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return Tt.x=Rt(n,Tt),Tt.X=Rt(u,Tt),Tt.c=Rt(e,Tt),St.x=Rt(n,St),St.X=Rt(u,St),St.c=Rt(e,St),{format:function(t){var e=Rt(t+="",Tt);return e.toString=function(){return t},e},parse:function(t){var e=Et(t+="",i);return e.toString=function(){return t},e},utcFormat:function(t){var e=Rt(t+="",St);return e.toString=function(){return t},e},utcParse:function(t){var e=Et(t,a);return e.toString=function(){return t},e}}};var r=n(123);function i(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 a(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 o(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}var c={"-":"",_:" ",0:"0"},u=/^\s*\d+/,f=/^%/,s=/[\\^$*+?|[\]().{}]/g;function l(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a68?1900:2e3),n+r[0].length):-1}function w(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function j(t,e,n){var r=u.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function O(t,e,n){var r=u.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function M(t,e,n){var r=u.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function k(t,e,n){var r=u.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function A(t,e,n){var r=u.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function T(t,e,n){var r=u.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function S(t,e,n){var r=u.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function P(t,e,n){var r=u.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function R(t,e,n){var r=f.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function E(t,e,n){var r=u.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function C(t,e,n){var r=u.exec(e.slice(n));return r?(t.Q=1e3*+r[0],n+r[0].length):-1}function I(t,e){return l(t.getDate(),e,2)}function N(t,e){return l(t.getHours(),e,2)}function D(t,e){return l(t.getHours()%12||12,e,2)}function z(t,e){return l(1+r.a.count(Object(r.k)(t),t),e,3)}function B(t,e){return l(t.getMilliseconds(),e,3)}function U(t,e){return B(t,e)+"000"}function L(t,e){return l(t.getMonth()+1,e,2)}function W(t,e){return l(t.getMinutes(),e,2)}function F(t,e){return l(t.getSeconds(),e,2)}function Y(t){var e=t.getDay();return 0===e?7:e}function q(t,e){return l(r.h.count(Object(r.k)(t),t),e,2)}function G(t,e){var n=t.getDay();return t=n>=4||0===n?Object(r.i)(t):r.i.ceil(t),l(r.i.count(Object(r.k)(t),t)+(4===Object(r.k)(t).getDay()),e,2)}function V(t){return t.getDay()}function X(t,e){return l(r.e.count(Object(r.k)(t),t),e,2)}function H(t,e){return l(t.getFullYear()%100,e,2)}function $(t,e){return l(t.getFullYear()%1e4,e,4)}function Z(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+l(e/60|0,"0",2)+l(e%60,"0",2)}function K(t,e){return l(t.getUTCDate(),e,2)}function J(t,e){return l(t.getUTCHours(),e,2)}function Q(t,e){return l(t.getUTCHours()%12||12,e,2)}function tt(t,e){return l(1+r.l.count(Object(r.v)(t),t),e,3)}function et(t,e){return l(t.getUTCMilliseconds(),e,3)}function nt(t,e){return et(t,e)+"000"}function rt(t,e){return l(t.getUTCMonth()+1,e,2)}function it(t,e){return l(t.getUTCMinutes(),e,2)}function at(t,e){return l(t.getUTCSeconds(),e,2)}function ot(t){var e=t.getUTCDay();return 0===e?7:e}function ct(t,e){return l(r.s.count(Object(r.v)(t),t),e,2)}function ut(t,e){var n=t.getUTCDay();return t=n>=4||0===n?Object(r.t)(t):r.t.ceil(t),l(r.t.count(Object(r.v)(t),t)+(4===Object(r.v)(t).getUTCDay()),e,2)}function ft(t){return t.getUTCDay()}function st(t,e){return l(r.p.count(Object(r.v)(t),t),e,2)}function lt(t,e){return l(t.getUTCFullYear()%100,e,2)}function dt(t,e){return l(t.getUTCFullYear()%1e4,e,4)}function ht(){return"+0000"}function bt(){return"%"}function pt(t){return+t}function vt(t){return Math.floor(+t/1e3)}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(124),i="%Y-%m-%dT%H:%M:%S.%LZ";Date.prototype.toISOString||Object(r.b)(i)},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n.d(e,"d",function(){return i}),n.d(e,"b",function(){return o}),n.d(e,"e",function(){return c}),n.d(e,"c",function(){return u});var r=Math.cos,i=Math.sin,a=Math.PI,o=a/2,c=2*a,u=Math.max},function(t,e,n){"use strict";var r=function(){function t(t,e){for(var n=0;n-1}},function(t,e,n){var r=n(53);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},function(t,e,n){var r=n(52);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(52),i=n(81),a=n(82),o=200;t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var c=n.__data__;if(!i||c.length=O&&(O=j+1);!(w=m[O])&&++O<_;);x._next=w||null}}return(s=new r.a(s,i))._enter=l,s._exit=d,s}},function(t,e,n){"use strict";e.a=function(t){return function(){return t}}},function(t,e,n){"use strict";var r=n(163),i=n(11);e.a=function(){return new i.a(this._exit||this._groups.map(r.a),this._parents)}},function(t,e,n){"use strict";var r=n(11);e.a=function(t){for(var e=this._groups,n=t._groups,i=e.length,a=n.length,o=Math.min(i,a),c=new Array(i),u=0;u=0;)(r=i[a])&&(o&&o!==r.nextSibling&&o.parentNode.insertBefore(r,o),o=r);return this}},function(t,e,n){"use strict";var r=n(11);function i(t,e){return te?1:t>=e?0:NaN}e.a=function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=i);for(var n=this._groups,a=n.length,o=new Array(a),c=0;c1?this.each((null==e?function(t){return function(){delete this[t]}}:"function"==typeof e?function(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}:function(t,e){return function(){this[t]=e}})(t,e)):this.node()[t]}},function(t,e,n){"use strict";function r(t){return t.trim().split(/^|\s+/)}function i(t){return t.classList||new a(t)}function a(t){this._node=t,this._names=r(t.getAttribute("class")||"")}function o(t,e){for(var n=i(t),r=-1,a=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}},e.a=function(t,e){var n=r(t+"");if(arguments.length<2){for(var a=i(this.node()),u=-1,f=n.length;++ur?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}e.a=function(){var t,e,n=d,_=h,g=y,m=p,x=v,w=[0,1/0],j=[[-1/0,-1/0],[1/0,1/0]],O=250,M=a.j,k=[],A=Object(r.dispatch)("start","zoom","end"),T=500,S=150,P=0;function R(t){t.property("__zoom",b).on("wheel.zoom",B).on("mousedown.zoom",U).on("dblclick.zoom",L).filter(x).on("touchstart.zoom",W).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",Y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function E(t,e){return(e=Math.max(w[0],Math.min(w[1],e)))===t.k?t:new s.a(e,t.x,t.y)}function C(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new s.a(t.k,r,i)}function I(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function N(t,e,n){t.on("start.zoom",function(){D(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){D(this,arguments).end()}).tween("zoom",function(){var t=arguments,r=D(this,t),i=_.apply(this,t),a=n||I(i),o=Math.max(i[1][0]-i[0][0],i[1][1]-i[0][1]),c=this.__zoom,u="function"==typeof e?e.apply(this,t):e,f=M(c.invert(a).concat(o/c.k),u.invert(a).concat(o/u.k));return function(t){if(1===t)t=u;else{var e=f(t),n=o/e[2];t=new s.a(n,a[0]-e[0]*n,a[1]-e[1]*n)}r.zoom(null,t)}})}function D(t,e){for(var n,r=0,i=k.length;rP}t.zoom("mouse",g(C(t.that.__zoom,t.mouse[0]=Object(o.mouse)(t.that),t.mouse[1]),t.extent,j))},!0).on("mouseup.zoom",function(){r.on("mousemove.zoom mouseup.zoom",null),Object(i.b)(o.event.view,t.moved),Object(l.a)(),t.end()},!0),a=Object(o.mouse)(this),u=o.event.clientX,f=o.event.clientY;Object(i.a)(o.event.view),Object(l.b)(),t.mouse=[a,this.__zoom.invert(a)],Object(c.interrupt)(this),t.start()}}function L(){if(n.apply(this,arguments)){var t=this.__zoom,e=Object(o.mouse)(this),r=t.invert(e),i=t.k*(o.event.shiftKey?.5:2),a=g(C(E(t,i),e,r),_.apply(this,arguments),j);Object(l.a)(),O>0?Object(o.select)(this).transition().duration(O).call(N,a,e):Object(o.select)(this).call(R.transform,a)}}function W(){if(n.apply(this,arguments)){var e,r,i,a,u=D(this,arguments),f=o.event.changedTouches,s=f.length;for(Object(l.b)(),r=0;r=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),u=-1,f=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++u0)for(var n,r,i=new Array(n),a=0;ad?Math.pow(t,1/3):t/l+f}function y(t){return t>s?t*t*t:l*(t-f)}function _(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function g(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function m(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof x)return new x(t.h,t.c,t.l,t.opacity);t instanceof p||(t=h(t));var e=Math.atan2(t.b,t.a)*a.b;return new x(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new x(t,e,n,null==r?1:r)}function x(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}Object(r.a)(p,b,Object(r.b)(i.a,{brighter:function(t){return new p(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new p(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 t=c*y(t),e=o*y(e),n=u*y(n),new i.b(_(3.2404542*e-1.5371385*t-.4985314*n),_(-.969266*e+1.8760108*t+.041556*n),_(.0556434*e-.2040259*t+1.0572252*n),this.opacity)}})),Object(r.a)(x,m,Object(r.b)(i.a,{brighter:function(t){return new x(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new x(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return h(this).rgb()}}))},function(t,e,n){"use strict";e.a=b;var r=n(101),i=n(100),a=n(167),o=-.14861,c=1.78277,u=-.29227,f=-.90649,s=1.97294,l=s*f,d=s*c,h=c*u-f*o;function b(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof p)return new p(t.h,t.s,t.l,t.opacity);t instanceof i.b||(t=Object(i.h)(t));var e=t.r/255,n=t.g/255,r=t.b/255,o=(h*r+l*e-d*n)/(h+l-d),c=r-o,b=(s*(n-o)-u*c)/f,v=Math.sqrt(b*b+c*c)/(s*o*(1-o)),y=v?Math.atan2(b,c)*a.b-120:NaN;return new p(y<0?y+360:y,v,o,t.opacity)}(t):new p(t,e,n,null==r?1:r)}function p(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Object(r.a)(p,b,Object(r.b)(i.a,{brighter:function(t){return t=null==t?i.c:Math.pow(i.c,t),new p(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?i.d:Math.pow(i.d,t),new p(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*a.a,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),l=Math.sin(t);return new i.b(255*(e+n*(o*r+c*l)),255*(e+n*(u*r+f*l)),255*(e+n*(s*r)),this.opacity)}}))},function(t,e,n){"use strict";e.a=function(t,e){return e-=t=+t,function(n){return Math.round(t+e*n)}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o}),n.d(e,"b",function(){return c});var r=n(69),i=n(359);function a(t,e,n,i){function a(t){return t.length?t.pop()+" ":""}return function(o,c){var u=[],f=[];return o=t(o),c=t(c),function(t,i,a,o,c,u){if(t!==a||i!==o){var f=c.push("translate(",null,e,null,n);u.push({i:f-4,x:Object(r.a)(t,a)},{i:f-2,x:Object(r.a)(i,o)})}else(a||o)&&c.push("translate("+a+e+o+n)}(o.translateX,o.translateY,c.translateX,c.translateY,u,f),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(a(n)+"rotate(",null,i)-2,x:Object(r.a)(t,e)})):e&&n.push(a(n)+"rotate("+e+i)}(o.rotate,c.rotate,u,f),function(t,e,n,o){t!==e?o.push({i:n.push(a(n)+"skewX(",null,i)-2,x:Object(r.a)(t,e)}):e&&n.push(a(n)+"skewX("+e+i)}(o.skewX,c.skewX,u,f),function(t,e,n,i,o,c){if(t!==n||e!==i){var u=o.push(a(o)+"scale(",null,",",null,")");c.push({i:u-4,x:Object(r.a)(t,n)},{i:u-2,x:Object(r.a)(e,i)})}else 1===n&&1===i||o.push(a(o)+"scale("+n+","+i+")")}(o.scaleX,o.scaleY,c.scaleX,c.scaleY,u,f),o=c=null,function(t){for(var e,n=-1,r=f.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t})}(e)?r.g:r.h;return function(){var r=o(this,t),c=r.on;c!==i&&(a=(i=c).copy()).on(e,n),r.on=a}}(n,t,e))}},function(t,e,n){"use strict";e.a=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}},function(t,e,n){"use strict";var r=n(3),i=n(19),a=n(12);e.a=function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Object(r.selector)(t));for(var o=this._groups,c=o.length,u=new Array(c),f=0;fi.c&&n.name===e)return new r.a([[t]],a,e,+o);return null}},function(t,e,n){"use strict";e.a=function(t){return function(){return t}}},function(t,e,n){"use strict";e.a=function(t,e,n){this.target=t,this.type=e,this.transform=n}},function(t,e,n){"use strict";e.b=function(){r.event.stopImmediatePropagation()};var r=n(3);e.a=function(){r.event.preventDefault(),r.event.stopImmediatePropagation()}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[],e=arguments[1],n=arguments[2],o=0===t.length,c=n.svg.attr("width",n.conf.width).attr("height",n.conf.height);e&&(0,r.default)(n.tracks,function(t,e){c.select("."+e).remove()});var u=c.select(".all");u.empty()&&(u=c.append("g").attr("class","all").attr("transform","translate(\n "+parseInt(n.conf.width/2)+",\n "+parseInt(n.conf.height/2)+"\n )"));(0,r.default)(n.tracks,function(e,r){(o||r in t)&&e.render(n,u,r)}),(o||"layout"in t)&&(0,a.default)(u,n);var f=c.selectAll(".all > g").remove(),s=(0,i.default)(f._groups[0],function(t){return t.getAttribute("z-index")});return c.select(".all").selectAll("g").data(s).enter().append(function(t){return t}),n};var r=o(n(32)),i=o(n(106)),a=o(n(426));function o(t){return t&&t.__esModule?t:{default:t}}},function(t,e,n){var r=n(29),i=n(58),a=n(2),o=r?r.isConcatSpreadable:void 0;t.exports=function(t){return a(t)||i(t)||!!(o&&t&&t[o])}},function(t,e,n){var r=n(40),i=n(33),a=n(158),o=n(423),c=n(60),u=n(424),f=n(28);t.exports=function(t,e,n){var s=-1;e=r(e.length?e:[f],c(i));var l=a(t,function(t,n,i){return{criteria:r(e,function(e){return e(t)}),index:++s,value:t}});return o(l,function(t,e){return u(t,e,n)})}},function(t,e){t.exports=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}},function(t,e,n){var r=n(425);t.exports=function(t,e,n){for(var i=-1,a=t.criteria,o=e.criteria,c=a.length,u=n.length;++i=u?f:f*("desc"==n[i]?-1:1)}return t.index-e.index}},function(t,e,n){var r=n(34);t.exports=function(t,e){if(t!==e){var n=void 0!==t,i=null===t,a=t==t,o=r(t),c=void 0!==e,u=null===e,f=e==e,s=r(e);if(!u&&!s&&!o&&t>e||o&&c&&f&&!u&&!s||i&&c&&f||!n&&f||!a)return 1;if(!i&&!o&&!s&&tMath.PI?"rotate(180)translate(-16)":null}).style("text-anchor",function(t){return t.angle>Math.PI?"end":null}).style("font-size",t.ticks.labelSize+"px").style("fill",t.ticks.labelColor).text(function(t){return t.label})}(n,o,e)};var r=n(13),i=n(10),a=n(3)},function(t,e,n){"use strict";var r=n(35),i=n(25),a=n(44);function o(t){return t.innerRadius}function c(t){return t.outerRadius}function u(t){return t.startAngle}function f(t){return t.endAngle}function s(t){return t&&t.padAngle}function l(t,e,n,r,i,o,c){var u=t-n,f=e-r,s=(c?o:-o)/Object(a.l)(u*u+f*f),l=s*f,d=-s*u,h=t+l,b=e+d,p=n+l,v=r+d,y=(h+p)/2,_=(b+v)/2,g=p-h,m=v-b,x=g*g+m*m,w=i-o,j=h*v-p*b,O=(m<0?-1:1)*Object(a.l)(Object(a.h)(0,w*w*x-j*j)),M=(j*m-g*O)/x,k=(-j*g-m*O)/x,A=(j*m+g*O)/x,T=(-j*g+m*O)/x,S=M-y,P=k-_,R=A-y,E=T-_;return S*S+P*P>R*R+E*E&&(M=A,k=T),{cx:M,cy:k,x01:-l,y01:-d,x11:M*(i/w-1),y11:k*(i/w-1)}}e.a=function(){var t=o,e=c,n=Object(i.a)(0),d=null,h=u,b=f,p=s,v=null;function y(){var i,o,c=+t.apply(this,arguments),u=+e.apply(this,arguments),f=h.apply(this,arguments)-a.g,s=b.apply(this,arguments)-a.g,y=Object(a.a)(s-f),_=s>f;if(v||(v=i=Object(r.a)()),ua.f)if(y>a.m-a.f)v.moveTo(u*Object(a.e)(f),u*Object(a.k)(f)),v.arc(0,0,u,f,s,!_),c>a.f&&(v.moveTo(c*Object(a.e)(s),c*Object(a.k)(s)),v.arc(0,0,c,s,f,_));else{var g,m,x=f,w=s,j=f,O=s,M=y,k=y,A=p.apply(this,arguments)/2,T=A>a.f&&(d?+d.apply(this,arguments):Object(a.l)(c*c+u*u)),S=Object(a.i)(Object(a.a)(u-c)/2,+n.apply(this,arguments)),P=S,R=S;if(T>a.f){var E=Object(a.c)(T/c*Object(a.k)(A)),C=Object(a.c)(T/u*Object(a.k)(A));(M-=2*E)>a.f?(j+=E*=_?1:-1,O-=E):(M=0,j=O=(f+s)/2),(k-=2*C)>a.f?(x+=C*=_?1:-1,w-=C):(k=0,x=w=(f+s)/2)}var I=u*Object(a.e)(x),N=u*Object(a.k)(x),D=c*Object(a.e)(O),z=c*Object(a.k)(O);if(S>a.f){var B=u*Object(a.e)(w),U=u*Object(a.k)(w),L=c*Object(a.e)(j),W=c*Object(a.k)(j);if(ya.f?function(t,e,n,r,i,a,o,c){var u=n-t,f=r-e,s=o-i,l=c-a,d=(s*(e-a)-l*(t-i))/(l*u-s*f);return[t+d*u,e+d*f]}(I,N,L,W,B,U,D,z):[D,z],Y=I-F[0],q=N-F[1],G=B-F[0],V=U-F[1],X=1/Object(a.k)(Object(a.b)((Y*G+q*V)/(Object(a.l)(Y*Y+q*q)*Object(a.l)(G*G+V*V)))/2),H=Object(a.l)(F[0]*F[0]+F[1]*F[1]);P=Object(a.i)(S,(c-H)/(X-1)),R=Object(a.i)(S,(u-H)/(X+1))}}k>a.f?R>a.f?(g=l(L,W,I,N,u,R,_),m=l(B,U,D,z,u,R,_),v.moveTo(g.cx+g.x01,g.cy+g.y01),Ra.f&&M>a.f?P>a.f?(g=l(D,z,B,U,c,-P,_),m=l(I,N,L,W,c,-P,_),v.lineTo(g.cx+g.x01,g.cy+g.y01),P1e-6)if(Math.abs(l*u-f*s)>1e-6&&a){var h=n-o,b=i-c,p=u*u+f*f,v=h*h+b*b,y=Math.sqrt(p),_=Math.sqrt(d),g=a*Math.tan((r-Math.acos((p+d-v)/(2*y*_)))/2),m=g/_,x=g/y;Math.abs(m-1)>1e-6&&(this._+="L"+(t+m*s)+","+(e+m*l)),this._+="A"+a+","+a+",0,0,"+ +(l*h>s*b)+","+(this._x1=t+x*u)+","+(this._y1=e+x*f)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,o,c,u){t=+t,e=+e;var f=(n=+n)*Math.cos(o),s=n*Math.sin(o),l=t+f,d=e+s,h=1^u,b=u?o-c:c-o;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+d:(Math.abs(this._x1-l)>1e-6||Math.abs(this._y1-d)>1e-6)&&(this._+="L"+l+","+d),n&&(b<0&&(b=b%i+i),b>a?this._+="A"+n+","+n+",0,1,"+h+","+(t-f)+","+(e-s)+"A"+n+","+n+",0,1,"+h+","+(this._x1=l)+","+(this._y1=d):b>1e-6&&(this._+="A"+n+","+n+",0,"+ +(b>=r)+","+h+","+(this._x1=t+n*Math.cos(c))+","+(this._y1=e+n*Math.sin(c))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}},e.a=c},function(t,e,n){"use strict";var r=n(25),i=n(430),a=n(431),o=n(44);e.a=function(){var t=a.a,e=i.a,n=null,c=Object(r.a)(0),u=Object(r.a)(o.m),f=Object(r.a)(0);function s(r){var i,a,s,l,d,h=r.length,b=0,p=new Array(h),v=new Array(h),y=+c.apply(this,arguments),_=Math.min(o.m,Math.max(-o.m,u.apply(this,arguments)-y)),g=Math.min(Math.abs(_)/h,f.apply(this,arguments)),m=g*(_<0?-1:1);for(i=0;i0&&(b+=d);for(null!=e?p.sort(function(t,n){return e(v[t],v[n])}):null!=n&&p.sort(function(t,e){return n(r[t],r[e])}),i=0,s=b?(_-h*m)/b:0;i0?d*s:0)+m,v[a]={data:r[a],index:i,value:d,startAngle:y,endAngle:l,padAngle:g};return v}return s.value=function(e){return arguments.length?(t="function"==typeof e?e:Object(r.a)(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,n=null,s):e},s.sort=function(t){return arguments.length?(n=t,e=null,s):n},s.startAngle=function(t){return arguments.length?(c="function"==typeof t?t:Object(r.a)(+t),s):c},s.endAngle=function(t){return arguments.length?(u="function"==typeof t?t:Object(r.a)(+t),s):u},s.padAngle=function(t){return arguments.length?(f="function"==typeof t?t:Object(r.a)(+t),s):f},s}},function(t,e,n){"use strict";e.a=function(t,e){return et?1:e>=t?0:NaN}},function(t,e,n){"use strict";e.a=function(t){return t}},function(t,e,n){"use strict";var r=n(184),i=n(183),a=n(185);e.a=function(){var t=Object(i.a)().curve(r.a),e=t.curve,n=t.lineX0,o=t.lineX1,c=t.lineY0,u=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 Object(a.b)(n())},delete t.lineX0,t.lineEndAngle=function(){return Object(a.b)(o())},delete t.lineX1,t.lineInnerRadius=function(){return Object(a.b)(c())},delete t.lineY0,t.lineOuterRadius=function(){return Object(a.b)(u())},delete t.lineY1,t.curve=function(t){return arguments.length?e(Object(r.b)(t)):e()._curve},t}},function(t,e,n){"use strict";e.a=function(){return s(l)},e.c=function(){return s(d)},e.b=function(){var t=s(h);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t};var r=n(35),i=n(187),a=n(25),o=n(109),c=n(186);function u(t){return t.source}function f(t){return t.target}function s(t){var e=u,n=f,c=o.a,s=o.b,l=null;function d(){var a,o=i.a.call(arguments),u=e.apply(this,o),f=n.apply(this,o);if(l||(l=a=Object(r.a)()),t(l,+c.apply(this,(o[0]=u,o)),+s.apply(this,o),+c.apply(this,(o[0]=f,o)),+s.apply(this,o)),a)return l=null,a+""||null}return d.source=function(t){return arguments.length?(e=t,d):e},d.target=function(t){return arguments.length?(n=t,d):n},d.x=function(t){return arguments.length?(c="function"==typeof t?t:Object(a.a)(+t),d):c},d.y=function(t){return arguments.length?(s="function"==typeof t?t:Object(a.a)(+t),d):s},d.context=function(t){return arguments.length?(l=null==t?null:t,d):l},d}function l(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e=(e+r)/2,n,e,i,r,i)}function d(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e,n=(n+i)/2,r,n,r,i)}function h(t,e,n,r,i){var a=Object(c.a)(e,n),o=Object(c.a)(e,n=(n+i)/2),u=Object(c.a)(r,n),f=Object(c.a)(r,i);t.moveTo(a[0],a[1]),t.bezierCurveTo(o[0],o[1],u[0],u[1],f[0],f[1])}},function(t,e,n){"use strict";n.d(e,"b",function(){return d});var r=n(35),i=n(188),a=n(189),o=n(190),c=n(191),u=n(192),f=n(193),s=n(194),l=n(25),d=[i.a,a.a,o.a,u.a,c.a,f.a,s.a];e.a=function(){var t=Object(l.a)(i.a),e=Object(l.a)(64),n=null;function a(){var i;if(n||(n=i=Object(r.a)()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),i)return n=null,i+""||null}return a.type=function(e){return arguments.length?(t="function"==typeof e?e:Object(l.a)(e),a):t},a.size=function(t){return arguments.length?(e="function"==typeof t?t:Object(l.a)(+t),a):e},a.context=function(t){return arguments.length?(n=null==t?null:t,a):n},a}},function(t,e,n){"use strict";var r=n(72),i=n(73);function a(t){this._context=t}a.prototype={areaStart:r.a,areaEnd:r.a,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:Object(i.c)(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},e.a=function(t){return new a(t)}},function(t,e,n){"use strict";var r=n(73);function i(t){this._context=t}i.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:Object(r.c)(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},e.a=function(t){return new i(t)}},function(t,e,n){"use strict";var r=n(73);function i(t,e){this._basis=new r.a(t),this._beta=e}i.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 r,i=t[0],a=e[0],o=t[n]-i,c=e[n]-a,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*t[u]+(1-this._beta)*(i+r*o),this._beta*e[u]+(1-this._beta)*(a+r*c));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}},e.a=function t(e){function n(t){return 1===e?new r.a(t):new i(t,e)}return n.beta=function(e){return t(+e)},n}(.85)},function(t,e,n){"use strict";var r=n(195),i=n(72),a=n(110);function o(t,e){this._context=t,this._alpha=e}o.prototype={areaStart:i.a,areaEnd:i.a,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,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:Object(a.b)(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}},e.a=function t(e){function n(t){return e?new o(t,e):new r.a(t,0)}return n.alpha=function(e){return t(+e)},n}(.5)},function(t,e,n){"use strict";var r=n(196),i=n(110);function a(t,e){this._context=t,this._alpha=e}a.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,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:Object(i.b)(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}},e.a=function t(e){function n(t){return e?new a(t,e):new r.a(t,0)}return n.alpha=function(e){return t(+e)},n}(.5)},function(t,e,n){"use strict";var r=n(72);function i(t){this._context=t}i.prototype={areaStart:r.a,areaEnd:r.a,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))}},e.a=function(t){return new i(t)}},function(t,e,n){"use strict";function r(t){return t<0?-1:1}function i(t,e,n){var i=t._x1-t._x0,a=e-t._x1,o=(t._y1-t._y0)/(i||a<0&&-0),c=(n-t._y1)/(a||i<0&&-0),u=(o*a+c*i)/(i+a);return(r(o)+r(c))*Math.min(Math.abs(o),Math.abs(c),.5*Math.abs(u))||0}function a(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function o(t,e,n){var r=t._x0,i=t._y0,a=t._x1,o=t._y1,c=(a-r)/3;t._context.bezierCurveTo(r+c,i+c*e,a-c,o-c*n,a,o)}function c(t){this._context=t}function u(t){this._context=new f(t)}function f(t){this._context=t}e.a=function(t){return new c(t)},e.b=function(t){return new u(t)},c.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:o(this,this._t0,a(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,o(this,a(this,n=i(this,t,e)),n);break;default:o(this,this._t0,n=i(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(u.prototype=Object.create(c.prototype)).point=function(t,e){c.prototype.point.call(this,e,t)},f.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,r,i,a){this._context.bezierCurveTo(e,t,r,n,a,i)}}},function(t,e,n){"use strict";function r(t){this._context=t}function i(t){var e,n,r=t.length-1,i=new Array(r),a=new Array(r),o=new Array(r);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e=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}},e.a=function(t){return new r(t,.5)}},function(t,e,n){"use strict";var r=n(187),i=n(25),a=n(45),o=n(46);function c(t,e){return t[e]}e.a=function(){var t=Object(i.a)([]),e=o.a,n=a.a,u=c;function f(r){var i,a,o=t.apply(this,arguments),c=r.length,f=o.length,s=new Array(f);for(i=0;i0){for(var n,i,a,o=0,c=t[0].length;o1)for(var n,r,i,a,o,c,u=0,f=t[e[0]].length;u=0?(r[0]=a,r[1]=a+=i):i<0?(r[1]=o,r[0]=o+=i):r[0]=a}},function(t,e,n){"use strict";var r=n(45);e.a=function(t,e){if((n=t.length)>0){for(var n,i=0,a=t[e[0]],o=a.length;i0&&(i=(n=t[e[0]]).length)>0){for(var n,i,a,o=0,c=1;ct?1:e>=t?0:NaN}},function(t,e,n){"use strict";var r=n(203),i=n(197),a=n(455),o=n(202),c=n(456),u=n(204),f=n(205),s=n(206);e.a=function(){var t=c.a,e=o.a,n=s.a;function l(r){var a,o,c=r.length,s=new Array(c);for(a=0;ah;)b.pop(),--p;var v,y=new Array(p+1);for(a=0;a<=p;++a)(v=y[a]=[]).x0=a>0?b[a-1]:d,v.x1=a=n)for(r=n;++ar&&(r=n)}else for(;++a=n)for(r=n;++ar&&(r=n);return r}},function(t,e,n){"use strict";var r=n(47);e.a=function(t,e){var n,i=t.length,a=i,o=-1,c=0;if(null==e)for(;++o=0;)for(e=(r=t[i]).length;--e>=0;)n[--o]=r[e];return n}},function(t,e,n){"use strict";e.a=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r}},function(t,e,n){"use strict";var r=n(36);e.a=function(t,e){if(n=t.length){var n,i,a=0,o=0,c=t[o];for(null==e&&(e=r.a);++a90?"end":"start",t._rotate=t._angle>90?180:0,t})}).enter().append("g").append("text").text(function(t){return t.value}).attr("transform",function(t){return"\n rotate("+t._angle+")\n translate("+e.innerRadius+", 0)\n rotate("+t._rotate+")\n "}).attr("text-anchor",function(t){return t._anchor});return(0,o.default)(e.style,function(t,e){i.style(e,t)}),i}}]),e}();e.default=l},function(t,e,n){var r=n(470);"string"==typeof r&&(r=[[t.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(472)(r,i);r.locals&&(t.exports=r.locals)},function(t,e,n){(t.exports=n(471)(!1)).push([t.i,"div.circos-tooltip {\r\n position: absolute;\r\n text-align: center;\r\n padding: 5px 10px;\r\n background: #111111;\r\n color: white;\r\n border: 0px;\r\n pointer-events: none;\r\n z-index: 1000;\r\n}\r\n",""])},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var i=(o=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),a=r.sources.map(function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"});return[n].concat(a).concat([i]).join("\n")}var o;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},i=0;i=0&&s.splice(e,1)}function v(t){var e=document.createElement("style");return void 0===t.attrs.type&&(t.attrs.type="text/css"),y(e,t.attrs),b(t,e),e}function y(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function _(t,e){var n,r,i,a;if(e.transform&&t.css){if(!(a=e.transform(t.css)))return function(){};t.css=a}if(e.singleton){var o=f++;n=u||(u=v(e)),r=x.bind(null,n,o,!1),i=x.bind(null,n,o,!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",y(e,t.attrs),b(t,e),e}(e),r=function(t,e,n){var r=n.css,i=n.sourceMap,a=void 0===e.convertToAbsoluteUrls&&i;(e.convertToAbsoluteUrls||a)&&(r=l(r));i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var o=new Blob([r],{type:"text/css"}),c=t.href;t.href=URL.createObjectURL(o),c&&URL.revokeObjectURL(c)}.bind(null,n,e),i=function(){p(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(e),r=function(t,e){var n=e.css,r=e.media;r&&t.setAttribute("media",r);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),i=function(){p(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}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=o()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=h(t,e);return d(n,e),function(t){for(var r=[],i=0;i0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1],r={};return(0,i.default)(n,function(n,i){void 0!==n.iteratee?n.iteratee?Object.keys(e).indexOf(i)>-1?((0,a.default)(e[i]),r[i]=e[i]):r[i]=function(){return n.value}:r[i]=Object.keys(e).indexOf(i)>-1?e[i]:n.value:r[i]=t(e[i],n)}),r}(t,(0,r.default)(e));return(0,o.default)(f,function(t,e){return{cmin:null===t.min?e.min:t.min,cmax:null===t.max?e.max:t.max}}(f,n),function(t,e){if(0===t.innerRadius&&0===t.outerRadius){var n=(0,c.smartBorders)(t,e._layout,e.tracks);return{innerRadius:n.in,outerRadius:n.out}}return t.innerRadius<=1&&t.outerRadius<=1?{innerRadius:t.innerRadius*e._layout.conf.innerRadius,outerRadius:t.outerRadius*e._layout.conf.innerRadius}:t.innerRadius<=10&&t.outerRadius<=10?{innerRadius:t.innerRadius*e._layout.conf.outerRadius,outerRadius:t.outerRadius*e._layout.conf.outerRadius}:void 0}(f,u)),f}},function(t,e,n){var r=n(37)("sortBy",n(106));r.placeholder=n(26),t.exports=r},function(t,e,n){var r=n(477),i=n(26),a=Array.prototype.push;function o(t,e){return 2==e?function(e,n){return t(e,n)}:function(e){return t(e)}}function c(t){for(var e=t?t.length:0,n=Array(e);e--;)n[e]=t[e];return n}function u(t,e){return function(){var n=arguments.length;if(n){for(var r=Array(n);n--;)r[n]=arguments[n];var i=r[0]=e.apply(void 0,r);return t.apply(void 0,r),i}}}t.exports=function t(e,n,f,s){var l="function"==typeof n,d=n===Object(n);if(d&&(s=f,f=n,n=void 0),null==f)throw new TypeError;s||(s={});var h={cap:!("cap"in s)||s.cap,curry:!("curry"in s)||s.curry,fixed:!("fixed"in s)||s.fixed,immutable:!("immutable"in s)||s.immutable,rearg:!("rearg"in s)||s.rearg},b=l?f:i,p="curry"in s&&s.curry,v="fixed"in s&&s.fixed,y="rearg"in s&&s.rearg,_=l?f.runInContext():void 0,g=l?f:{ary:e.ary,assign:e.assign,clone:e.clone,curry:e.curry,forEach:e.forEach,isArray:e.isArray,isError:e.isError,isFunction:e.isFunction,isWeakMap:e.isWeakMap,iteratee:e.iteratee,keys:e.keys,rearg:e.rearg,toInteger:e.toInteger,toPath:e.toPath},m=g.ary,x=g.assign,w=g.clone,j=g.curry,O=g.forEach,M=g.isArray,k=g.isError,A=g.isFunction,T=g.isWeakMap,S=g.keys,P=g.rearg,R=g.toInteger,E=g.toPath,C=S(r.aryMethod),I={castArray:function(t){return function(){var e=arguments[0];return M(e)?t(c(e)):t.apply(void 0,arguments)}},iteratee:function(t){return function(){var e=arguments[0],n=arguments[1],r=t(e,n),i=r.length;return h.cap&&"number"==typeof n?(n=n>2?n-2:1,i&&i<=n?r:o(r,n)):r}},mixin:function(t){return function(e){var n=this;if(!A(n))return t(n,Object(e));var r=[];return O(S(e),function(t){A(e[t])&&r.push([t,n.prototype[t]])}),t(n,Object(e)),O(r,function(t){var e=t[1];A(e)?n.prototype[t[0]]=e:delete n.prototype[t[0]]}),n}},nthArg:function(t){return function(e){var n=e<0?1:R(e)+1;return j(t(e),n)}},rearg:function(t){return function(e,n){var r=n?n.length:0;return j(t(e,n),r)}},runInContext:function(n){return function(r){return t(e,n(r),s)}}};function N(t,e){if(h.cap){var n=r.iterateeRearg[t];if(n)return function(t,e){return L(t,function(t){var n=e.length;return function(t,e){return 2==e?function(e,n){return t.apply(void 0,arguments)}:function(e){return t.apply(void 0,arguments)}}(P(o(t,n),e),n)})}(e,n);var i=!l&&r.iterateeAry[t];if(i)return function(t,e){return L(t,function(t){return"function"==typeof t?o(t,e):t})}(e,i)}return e}function D(t,e,n){if(h.fixed&&(v||!r.skipFixed[t])){var i=r.methodSpread[t],o=i&&i.start;return void 0===o?m(e,n):function(t,e){return function(){for(var n=arguments.length,r=n-1,i=Array(n);n--;)i[n]=arguments[n];var o=i[e],c=i.slice(0,e);return o&&a.apply(c,o),e!=r&&a.apply(c,i.slice(e+1)),t.apply(this,c)}}(e,o)}return e}function z(t,e,n){return h.rearg&&n>1&&(y||!r.skipRearg[t])?P(e,r.methodRearg[t]||r.aryRearg[n]):e}function B(t,e){for(var n=-1,r=(e=E(e)).length,i=r-1,a=w(Object(t)),o=a;null!=o&&++n1?j(u,f):u,!1}var u,f}),!i}),i||(i=o),i==e&&(i=p?j(i,1):function(){return e.apply(this,arguments)}),i.convert=U(a,e),i.placeholder=e.placeholder=n,i}if(!d)return W(n,f,b);var F=f,Y=[];return O(C,function(t){O(r.aryMethod[t],function(t){var e=F[r.remap[t]||t];e&&Y.push([t,W(t,e,F)])})}),O(S(F),function(t){var e=F[t];if("function"==typeof e){for(var n=Y.length;n--;)if(Y[n][0]==t)return;e.convert=U(t,e),Y.push([t,e])}}),O(Y,function(t){F[t[0]]=t[1]}),F.convert=function(t){return F.runInContext.convert(t)(void 0)},F.placeholder=F,O(S(F),function(t){O(r.realToAlias[t]||[],function(e){F[e]=F[t]})}),F}},function(t,e){e.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},e.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},e.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},e.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},e.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},e.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},e.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},e.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},e.realToAlias=function(){var t=Object.prototype.hasOwnProperty,n=e.aliasToReal,r={};for(var i in n){var a=n[i];t.call(r,a)?r[a].push(i):r[a]=[i]}return r}(),e.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},e.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},e.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}},function(t,e,n){t.exports={ary:n(479),assign:n(181),clone:n(498),curry:n(499),forEach:n(64),isArray:n(2),isError:n(500),isFunction:n(24),isWeakMap:n(501),iteratee:n(502),keys:n(143),rearg:n(503),toInteger:n(119),toPath:n(505)}},function(t,e,n){var r=n(113),i=128;t.exports=function(t,e,n){return e=n?void 0:e,e=t&&null==e?t.length:e,r(t,i,void 0,void 0,void 0,void 0,e)}},function(t,e,n){var r=n(75),i=n(5),a=1;t.exports=function(t,e,n){var o=e&a,c=r(t);return function e(){return(this&&this!==i&&this instanceof e?c:t).apply(o?n:this,arguments)}}},function(t,e,n){var r=n(50),i=n(75),a=n(213),o=n(216),c=n(222),u=n(118),f=n(5);t.exports=function(t,e,n){var s=i(t);return function i(){for(var l=arguments.length,d=Array(l),h=l,b=c(i);h--;)d[h]=arguments[h];var p=l<3&&d[0]!==b&&d[l-1]!==b?[]:u(d,b);return(l-=p.length)1?"& ":"")+e[i],e=e.join(r>2?", ":" "),t.replace(n,"{\n/* [wrapped with "+e+"] */\n")}},function(t,e,n){var r=n(64),i=n(490),a=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];t.exports=function(t,e){return r(a,function(n){var r="_."+n[0];e&n[1]&&!i(t,r)&&t.push(r)}),t.sort()}},function(t,e,n){var r=n(221);t.exports=function(t,e){return!(null==t||!t.length)&&r(t,e,0)>-1}},function(t,e){t.exports=function(t,e,n,r){for(var i=t.length,a=n+(r?1:-1);r?a--:++a=u.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var c,f,l,d=-1,h=n.length,b=u[i++],p=Object(r.a)(),v=a();++du.length)return n;var i,a=f[r-1];return null!=e&&r>=u.length?i=n.entries():(i=[],n.each(function(e,n){i.push({key:n,values:t(e,r)})})),null!=a?i.sort(function(t,e){return a(t.key,e.key)}):i}(s(t,0,o,c),0)},key:function(t){return u.push(t),n},sortKeys:function(t){return f[u.length-1]=t,n},sortValues:function(e){return t=e,n},rollup:function(t){return e=t,n}}}},function(t,e,n){"use strict";var r=n(120);function i(){}var a=r.a.prototype;function o(t,e){var n=new i;if(t instanceof i)t.each(function(t){n.add(t)});else if(t){var r=-1,a=t.length;if(null==e)for(;++r0&&c>0&&(u+c+1>r&&(c=Math.max(1,r-u)),a.push(n.substring(i-=c,i+c)),!((u+=c+1)>r));)c=t[o=(o+1)%t.length];return a.reverse().join(e)}}},function(t,e,n){"use strict";e.a=function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}},function(t,e,n){"use strict";e.a=function(t,e){t:for(var n,r=(t=t.toPrecision(e)).length,i=1,a=-1;i0&&(a=0)}return a>0?t.slice(0,a)+t.slice(n+1):t}},function(t,e,n){"use strict";var r=n(122);e.a=function(t,e){var n=Object(r.a)(t,e);if(!n)return t+"";var i=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}},function(t,e,n){"use strict";e.a=function(t){return t}},function(t,e,n){"use strict";var r=n(77);e.a=function(t){return Math.max(0,-Object(r.a)(Math.abs(t)))}},function(t,e,n){"use strict";var r=n(77);e.a=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Object(r.a)(e)/3)))-Object(r.a)(Math.abs(t)))}},function(t,e,n){"use strict";var r=n(77);e.a=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Object(r.a)(e)-Object(r.a)(t))+1}},function(t,e,n){"use strict";e.a=function t(){var e=Object(c.b)(u,f).domain([1,10]),n=e.domain,a=10,s=d(10),b=l(10);function p(){return s=d(a),b=l(a),n()[0]<0&&(s=h(s),b=h(b)),e}e.base=function(t){return arguments.length?(a=+t,p()):a};e.domain=function(t){return arguments.length?(n(t),p()):n()};e.ticks=function(t){var e,i=n(),o=i[0],c=i[i.length-1];(e=c0){for(;dc)break;v.push(l)}}else for(;d=1;--f)if(!((l=u*f)c)break;v.push(l)}}else v=Object(r.ticks)(d,h,Math.min(h-d,p)).map(b);return e?v.reverse():v};e.tickFormat=function(t,n){if(null==n&&(n=10===a?".0e":","),"function"!=typeof n&&(n=Object(i.a)(n)),t===1/0)return n;null==t&&(t=10);var r=Math.max(1,a*t/e.ticks().length);return function(t){var e=t/b(Math.round(s(t)));return e*a0?a[r-1]:e[0],r=o?[c[o-1],n]:[c[r-1],c[r]]};f.copy=function(){return t().domain([e,n]).range(u)};return Object(a.b)(f)};var r=n(10),i=n(27),a=n(48)},function(t,e,n){"use strict";e.a=function t(){var e=[.5],n=[0,1],a=1;function o(t){if(t<=t)return n[Object(r.bisect)(e,t,0,a)]}o.domain=function(t){return arguments.length?(e=i.b.call(t),a=Math.min(e.length,n.length-1),o):e.slice()};o.range=function(t){return arguments.length?(n=i.b.call(t),a=Math.min(e.length,n.length-1),o):n.slice()};o.invertExtent=function(t){var r=n.indexOf(t);return[e[r-1],e[r]]};o.copy=function(){return t().domain(e).range(n)};return o};var r=n(10),i=n(27)},function(t,e,n){"use strict";var r=n(4),i=Object(r.a)(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Object(r.a)(function(e){e.setTime(Math.floor(e/t)*t)},function(e,n){e.setTime(+e+n*t)},function(e,n){return(n-e)/t}):i:null},e.a=i;i.range},function(t,e,n){"use strict";var r=n(4),i=n(15),a=Object(r.a)(function(t){t.setTime(Math.floor(t/i.d)*i.d)},function(t,e){t.setTime(+t+e*i.d)},function(t,e){return(e-t)/i.d},function(t){return t.getUTCSeconds()});e.a=a;a.range},function(t,e,n){"use strict";var r=n(4),i=n(15),a=Object(r.a)(function(t){t.setTime(Math.floor(t/i.c)*i.c)},function(t,e){t.setTime(+t+e*i.c)},function(t,e){return(e-t)/i.c},function(t){return t.getMinutes()});e.a=a;a.range},function(t,e,n){"use strict";var r=n(4),i=n(15),a=Object(r.a)(function(t){var e=t.getTimezoneOffset()*i.c%i.b;e<0&&(e+=i.b),t.setTime(Math.floor((+t-e)/i.b)*i.b+e)},function(t,e){t.setTime(+t+e*i.b)},function(t,e){return(e-t)/i.b},function(t){return t.getHours()});e.a=a;a.range},function(t,e,n){"use strict";var r=n(4),i=n(15),a=Object(r.a)(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())*i.c)/i.a},function(t){return t.getDate()-1});e.a=a;a.range},function(t,e,n){"use strict";n.d(e,"b",function(){return o}),n.d(e,"a",function(){return c}),n.d(e,"c",function(){return s});var r=n(4),i=n(15);function a(t){return Object(r.a)(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())*i.c)/i.e})}var o=a(0),c=a(1),u=a(2),f=a(3),s=a(4),l=a(5),d=a(6);o.range,c.range,u.range,f.range,s.range,l.range,d.range},function(t,e,n){"use strict";var r=n(4),i=Object(r.a)(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()});e.a=i;i.range},function(t,e,n){"use strict";var r=n(4),i=Object(r.a)(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()});i.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Object(r.a)(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},e.a=i;i.range},function(t,e,n){"use strict";var r=n(4),i=n(15),a=Object(r.a)(function(t){t.setUTCSeconds(0,0)},function(t,e){t.setTime(+t+e*i.c)},function(t,e){return(e-t)/i.c},function(t){return t.getUTCMinutes()});e.a=a;a.range},function(t,e,n){"use strict";var r=n(4),i=n(15),a=Object(r.a)(function(t){t.setUTCMinutes(0,0,0)},function(t,e){t.setTime(+t+e*i.b)},function(t,e){return(e-t)/i.b},function(t){return t.getUTCHours()});e.a=a;a.range},function(t,e,n){"use strict";var r=n(4),i=n(15),a=Object(r.a)(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/i.a},function(t){return t.getUTCDate()-1});e.a=a;a.range},function(t,e,n){"use strict";n.d(e,"b",function(){return o}),n.d(e,"a",function(){return c}),n.d(e,"c",function(){return s});var r=n(4),i=n(15);function a(t){return Object(r.a)(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)/i.e})}var o=a(0),c=a(1),u=a(2),f=a(3),s=a(4),l=a(5),d=a(6);o.range,c.range,u.range,f.range,s.range,l.range,d.range},function(t,e,n){"use strict";var r=n(4),i=Object(r.a)(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()});e.a=i;i.range},function(t,e,n){"use strict";var r=n(4),i=Object(r.a)(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()});i.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Object(r.a)(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},e.a=i;i.range},function(t,e,n){"use strict";var r=n(238),i=n(124);+new Date("2000-01-01T00:00:00.000Z")||Object(i.c)(r.a)},function(t,e,n){"use strict";var r=n(235),i=n(236),a=n(123);e.a=function(){return Object(r.a)(a.v,a.q,a.u,a.l,a.m,a.o,a.r,a.n,i.b).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)])}},function(t,e,n){"use strict";var r=n(49);e.a=Object(r.a)("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf")},function(t,e,n){"use strict";var r=n(49);e.a=Object(r.a)("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6")},function(t,e,n){"use strict";var r=n(49);e.a=Object(r.a)("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9")},function(t,e,n){"use strict";var r=n(49);e.a=Object(r.a)("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5")},function(t,e,n){"use strict";var r=n(9),i=n(8);e.a=Object(i.b)(Object(r.b)(300,.5,0),Object(r.b)(-240,.5,1))},function(t,e,n){"use strict";n.d(e,"c",function(){return a}),n.d(e,"a",function(){return o});var r=n(9),i=n(8),a=Object(i.b)(Object(r.b)(-100,.75,.35),Object(r.b)(80,1.5,.8)),o=Object(i.b)(Object(r.b)(260,.75,.35),Object(r.b)(80,1.5,.8)),c=Object(r.b)();e.b=function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return c.h=360*t-100,c.s=1.5-1.5*e,c.l=.8-.9*e,c+""}},function(t,e,n){"use strict";n.d(e,"c",function(){return a}),n.d(e,"b",function(){return o}),n.d(e,"d",function(){return c});var r=n(49);function i(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}e.a=i(Object(r.a)("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var a=i(Object(r.a)("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),o=i(Object(r.a)("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),c=i(Object(r.a)("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"))},function(t,e,n){"use strict";e.a=function t(e){var n=0,i=1,a=!1;function o(t){var r=(t-n)/(i-n);return e(a?Math.max(0,Math.min(1,r)):r)}o.domain=function(t){return arguments.length?(n=+t[0],i=+t[1],o):[n,i]};o.clamp=function(t){return arguments.length?(a=!!t,o):a};o.interpolator=function(t){return arguments.length?(e=t,o):e};o.copy=function(){return t(e).domain([n,i]).clamp(a)};return Object(r.b)(o)};var r=n(48)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildColorValue=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Math.E;if((0,a.default)(t))return t;var o="-"===t[0],c="-"===t[0]?t.slice(1):t;if(u[c]){var s=f(u[c],e,n,o,r,i);return function(t){return s(t.value)}}return t};var r,i=n(24),a=(r=i)&&r.__esModule?r:{default:r},o=n(225),c=n(567);var u={BrBG:c.interpolateBrBG,PRGn:c.interpolatePRGn,PiYG:c.interpolatePiYG,PuOr:c.interpolatePuOr,RdBu:c.interpolateRdBu,RdGy:c.interpolateRdGy,RdYlBu:c.interpolateRdYlBu,RdYlGn:c.interpolateRdYlGn,Spectral:c.interpolateSpectral,Blues:c.interpolateBlues,Greens:c.interpolateGreens,Greys:c.interpolateGreys,Oranges:c.interpolateOranges,Purples:c.interpolatePurples,Reds:c.interpolateReds,BuGn:c.interpolateBuGn,BuPu:c.interpolateBuPu,GnBu:c.interpolateGnBu,OrRd:c.interpolateOrRd,PuBuGn:c.interpolatePuBuGn,PuBu:c.interpolatePuBu,PuRd:c.interpolatePuRd,RdPu:c.interpolateRdPu,YlGnBu:c.interpolateYlGnBu,YlGn:c.interpolateYlGn,YlOrBr:c.interpolateYlOrBr,YlOrRd:c.interpolateYlOrRd};var f=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Math.E;if(i&&e*n<=0&&console.warn("As log(0) = -∞, a log scale domain must be\n strictly-positive or strictly-negative. logscale ignored"),i&&e*n>0){var c=(0,o.scaleLog)().base(a).domain(r?[n,e]:[e,n]).range([0,1]);return(0,o.scaleSequential)(function(e){return t(c(e))}).domain([0,1])}return(0,o.scaleSequential)(t).domain(r?[n,e]:[e,n])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(568);n.d(e,"schemeCategory10",function(){return r.a});var i=n(569);n.d(e,"schemeAccent",function(){return i.a});var a=n(570);n.d(e,"schemeDark2",function(){return a.a});var o=n(571);n.d(e,"schemePaired",function(){return o.a});var c=n(572);n.d(e,"schemePastel1",function(){return c.a});var u=n(573);n.d(e,"schemePastel2",function(){return u.a});var f=n(574);n.d(e,"schemeSet1",function(){return f.a});var s=n(575);n.d(e,"schemeSet2",function(){return s.a});var l=n(576);n.d(e,"schemeSet3",function(){return l.a});var d=n(577);n.d(e,"interpolateBrBG",function(){return d.a}),n.d(e,"schemeBrBG",function(){return d.b});var h=n(578);n.d(e,"interpolatePRGn",function(){return h.a}),n.d(e,"schemePRGn",function(){return h.b});var b=n(579);n.d(e,"interpolatePiYG",function(){return b.a}),n.d(e,"schemePiYG",function(){return b.b});var p=n(580);n.d(e,"interpolatePuOr",function(){return p.a}),n.d(e,"schemePuOr",function(){return p.b});var v=n(581);n.d(e,"interpolateRdBu",function(){return v.a}),n.d(e,"schemeRdBu",function(){return v.b});var y=n(582);n.d(e,"interpolateRdGy",function(){return y.a}),n.d(e,"schemeRdGy",function(){return y.b});var _=n(583);n.d(e,"interpolateRdYlBu",function(){return _.a}),n.d(e,"schemeRdYlBu",function(){return _.b});var g=n(584);n.d(e,"interpolateRdYlGn",function(){return g.a}),n.d(e,"schemeRdYlGn",function(){return g.b});var m=n(585);n.d(e,"interpolateSpectral",function(){return m.a}),n.d(e,"schemeSpectral",function(){return m.b});var x=n(586);n.d(e,"interpolateBuGn",function(){return x.a}),n.d(e,"schemeBuGn",function(){return x.b});var w=n(587);n.d(e,"interpolateBuPu",function(){return w.a}),n.d(e,"schemeBuPu",function(){return w.b});var j=n(588);n.d(e,"interpolateGnBu",function(){return j.a}),n.d(e,"schemeGnBu",function(){return j.b});var O=n(589);n.d(e,"interpolateOrRd",function(){return O.a}),n.d(e,"schemeOrRd",function(){return O.b});var M=n(590);n.d(e,"interpolatePuBuGn",function(){return M.a}),n.d(e,"schemePuBuGn",function(){return M.b});var k=n(591);n.d(e,"interpolatePuBu",function(){return k.a}),n.d(e,"schemePuBu",function(){return k.b});var A=n(592);n.d(e,"interpolatePuRd",function(){return A.a}),n.d(e,"schemePuRd",function(){return A.b});var T=n(593);n.d(e,"interpolateRdPu",function(){return T.a}),n.d(e,"schemeRdPu",function(){return T.b});var S=n(594);n.d(e,"interpolateYlGnBu",function(){return S.a}),n.d(e,"schemeYlGnBu",function(){return S.b});var P=n(595);n.d(e,"interpolateYlGn",function(){return P.a}),n.d(e,"schemeYlGn",function(){return P.b});var R=n(596);n.d(e,"interpolateYlOrBr",function(){return R.a}),n.d(e,"schemeYlOrBr",function(){return R.b});var E=n(597);n.d(e,"interpolateYlOrRd",function(){return E.a}),n.d(e,"schemeYlOrRd",function(){return E.b});var C=n(598);n.d(e,"interpolateBlues",function(){return C.a}),n.d(e,"schemeBlues",function(){return C.b});var I=n(599);n.d(e,"interpolateGreens",function(){return I.a}),n.d(e,"schemeGreens",function(){return I.b});var N=n(600);n.d(e,"interpolateGreys",function(){return N.a}),n.d(e,"schemeGreys",function(){return N.b});var D=n(601);n.d(e,"interpolatePurples",function(){return D.a}),n.d(e,"schemePurples",function(){return D.b});var z=n(602);n.d(e,"interpolateReds",function(){return z.a}),n.d(e,"schemeReds",function(){return z.b});var B=n(603);n.d(e,"interpolateOranges",function(){return B.a}),n.d(e,"schemeOranges",function(){return B.b});var U=n(604);n.d(e,"interpolateCubehelixDefault",function(){return U.a});var L=n(605);n.d(e,"interpolateRainbow",function(){return L.b}),n.d(e,"interpolateWarm",function(){return L.c}),n.d(e,"interpolateCool",function(){return L.a});var W=n(606);n.d(e,"interpolateSinebow",function(){return W.a});var F=n(607);n.d(e,"interpolateViridis",function(){return F.a}),n.d(e,"interpolateMagma",function(){return F.c}),n.d(e,"interpolateInferno",function(){return F.b}),n.d(e,"interpolatePlasma",function(){return F.d})},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3")},function(t,e,n){"use strict";var r=n(0);e.a=Object(r.a)("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f")},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";n.d(e,"b",function(){return a});var r=n(0),i=n(1),a=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(r.a);e.a=Object(i.a)(a)},function(t,e,n){"use strict";var r=n(9),i=n(8);e.a=Object(i.b)(Object(r.b)(300,.5,0),Object(r.b)(-240,.5,1))},function(t,e,n){"use strict";n.d(e,"c",function(){return a}),n.d(e,"a",function(){return o});var r=n(9),i=n(8),a=Object(i.b)(Object(r.b)(-100,.75,.35),Object(r.b)(80,1.5,.8)),o=Object(i.b)(Object(r.b)(260,.75,.35),Object(r.b)(80,1.5,.8)),c=Object(r.b)();e.b=function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return c.h=360*t-100,c.s=1.5-1.5*e,c.l=.8-.9*e,c+""}},function(t,e,n){"use strict";var r=n(9),i=Object(r.f)(),a=Math.PI/3,o=2*Math.PI/3;e.a=function(t){var e;return t=(.5-t)*Math.PI,i.r=255*(e=Math.sin(t))*e,i.g=255*(e=Math.sin(t+a))*e,i.b=255*(e=Math.sin(t+o))*e,i+""}},function(t,e,n){"use strict";n.d(e,"c",function(){return a}),n.d(e,"b",function(){return o}),n.d(e,"d",function(){return c});var r=n(0);function i(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}e.a=i(Object(r.a)("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var a=i(Object(r.a)("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),o=i(Object(r.a)("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),c=i(Object(r.a)("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.renderAxes=e._buildAxesData=void 0;var r=c(n(609)),i=c(n(105)),a=n(13),o=c(n(612));function c(t){return t&&t.__esModule?t:{default:t}}var u=function(t,e,n){return{value:t,thickness:e.thickness||1,color:e.color||"#d3d3d3",opacity:e.opacity||n.opacity}},f=e._buildAxesData=function(t){return(0,i.default)(t.axes,function(e,n){if(!n.position&&!n.spacing)return o.default.warn("Skipping axe group with no position and spacing defined"),e;if(n.position&&e.push(u(n.position,n,t)),n.spacing){var i=(0,r.default)(n.start||t.cmin,n.end||t.cmax,n.spacing).map(function(e){return u(e,n,t)});return e.concat(i)}return e},[])};e.renderAxes=function(t,e,n,r){var i=f(e),o=(0,a.arc)().innerRadius(function(t){return"in"===e.direction?e.outerRadius-r(t.value):e.innerRadius+r(t.value)}).outerRadius(function(t){return"in"===e.direction?e.outerRadius-r(t.value):e.innerRadius+r(t.value)}).startAngle(0).endAngle(function(t){return t.length}),c=t.selectAll(".axis").data(function(t){var e=n._layout.blocks[t.key];return i.map(function(n){return{value:n.value,thickness:n.thickness,color:n.color,opacity:n.opacity,block_id:t.key,length:e.end-e.start}})}).enter().append("path").attr("opacity",function(t){return t.opacity}).attr("class","axis").attr("d",o).attr("stroke-width",function(t){return t.thickness}).attr("stroke",function(t){return t.color});return e.showAxesTooltip&&(c.on("mouseover",function(t,e){n.tip.html(t.value).transition().style("opacity",.9).style("left",event.pageX+"px").style("top",event.pageY-28+"px")}),c.on("mouseout",function(t,e){n.tip.transition().duration(500).style("opacity",0)})),c}},function(t,e,n){var r=n(610)();t.exports=r},function(t,e,n){var r=n(611),i=n(63),a=n(223);t.exports=function(t){return function(e,n,o){return o&&"number"!=typeof o&&i(e,n,o)&&(n=o=void 0),e=a(e),void 0===n?(n=e,e=0):n=a(n),o=void 0===o?e-1:!!s&&r(t,e,n)>-1}},function(t,e,n){var r=n(16),i=n(2),a=n(6),o="[object String]";t.exports=function(t){return"string"==typeof t||!i(t)&&a(t)&&r(t)==o}},function(t,e,n){var r=n(616),i=n(18);t.exports=function(t){return null==t?[]:r(t,i(t))}},function(t,e,n){var r=n(40);t.exports=function(t,e){return r(e,function(e){return t[e]})}},function(t,e,n){var r=n(618),i=n(619),a=n(33),o=n(2),c=n(63);t.exports=function(t,e,n){var u=o(t)?r:i;return n&&c(t,e,n)&&(e=void 0),u(t,a(e,3))}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n=1?t:t*e},p=function(t){function e(t,n,r){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,h,r,a.parseChordData))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,i.default),r(e,[{key:"getCoordinates",value:function(t,e,n,r){var i=e.blocks[t.id],a=i.start+t.start/i.len*(i.end-i.start),o=i.start+t.end/i.len*(i.end-i.start),c=void 0;return(0,f.default)(n.radius)?c=b(n.radius(r),e.conf.innerRadius):n.radius&&(c=b(n.radius,e.conf.innerRadius)),c||(c=e.conf.innerRadius),{radius:c,startAngle:a,endAngle:o}}},{key:"renderChords",value:function(t,e,n,r,i,a){var o=this,u=t.append("g").selectAll(".chord").data(r).enter().append("path").attr("class","chord").attr("d",(0,c.ribbon)().source(function(t){return a(t.source,i._layout,o.conf,t)}).target(function(t){return a(t.target,i._layout,o.conf,t)})).attr("opacity",n.opacity).on("mouseover",function(t){o.dispatch.call("mouseover",o,t),i.clipboard.attr("value",n.tooltipContent(t))}).on("mouseout",function(t){return o.dispatch.call("mouseout",o,t)});return Object.keys(n.events).forEach(function(t){u.on(t,function(e,r,i){n.events[t](e,r,i,s.event)})}),u.attr("fill",n.colorValue),u}},{key:"render",value:function(t,e,n){e.select("."+n).remove();var r=e.append("g").attr("class",n).attr("z-index",this.conf.zIndex),i=this.renderChords(r,n,this.conf,this.data,t,this.getCoordinates);return this.conf.tooltipContent&&(0,o.registerTooltip)(this,t,i,this.conf),this}}]),e}();e.default=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(624);n.d(e,"chord",function(){return r.a});var i=n(625);n.d(e,"ribbon",function(){return i.a})},function(t,e,n){"use strict";var r=n(10),i=n(239);e.a=function(){var t=0,e=null,n=null,a=null;function o(o){var c,u,f,s,l,d,h=o.length,b=[],p=Object(r.range)(h),v=[],y=[],_=y.groups=new Array(h),g=new Array(h*h);for(c=0,l=-1;++lt.position+r?t.groups.push([e]):t.groups[t.groups.length-1].push(e),t.position=e.position,t)},{position:null,groups:[]}).groups):[t.values];var n,r}).enter().append("g").attr("class","line").append("path").datum(function(t){return t.map(function(t){var i=r.scale(t.value);return(0,o.default)(t,{angle:r.theta(t.position,n.blocks[t.block_id])},function(t){return e.fill?{innerRadius:"out"===e.direction?e.innerRadius:e.outerRadius-t,outerRadius:"out"===e.direction?e.innerRadius+t:e.outerRadius}:{radius:"out"===e.direction?e.innerRadius+t:e.outerRadius-t}}(i))})}).attr("d",f).attr("opacity",e.opacity).attr("stroke-width",e.thickness).attr("stroke",e.colorValue).attr("fill","none");return e.fill&&l.attr("fill",e.fillColor),l}}]),e}();e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;ne.end?-1:t.start==e.start&&t.end==e.end?0:1});var r=[];(0,u.default)(t.values,function(t){var n=!1;(0,u.default)(r,function(r,i){if(r.slice(0).pop().end+et;t++)a.call(this,this._deferreds[t]);this._deferreds=null}function f(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function s(t,e,n){var r=!1;try{t(function(t){r||(r=!0,e(t))},function(t){r||(r=!0,n(t))})}catch(t){if(r)return;r=!0,n(t)}}var l=i.immediateFn||"function"==typeof e&&e||function(t){setTimeout(t,1)},d=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=this;return new i(function(r,i){a.call(n,new f(t,e,r,i))})},i.all=function(){var t=Array.prototype.slice.call(1===arguments.length&&d(arguments[0])?arguments[0]:arguments);return new i(function(e,n){function r(a,o){try{if(o&&("object"==typeof o||"function"==typeof o)){var c=o.then;if("function"==typeof c)return void c.call(o,function(t){r(a,t)},n)}t[a]=o,0==--i&&e(t)}catch(t){n(t)}}if(0===t.length)return e([]);for(var i=t.length,a=0;ar;r++)t[r].then(e,n)})},void 0!==t&&t.exports?t.exports=i:n.Promise||(n.Promise=i)}(this),a.copy=function(t){return new Promise(function(e,n){if("string"!=typeof t&&!("text/plain"in t))throw new Error("You must provide a text/plain type.");var r="string"==typeof t?t:t["text/plain"],i=window.clipboardData.setData("Text",r);i?e():n(new Error("Copying was rejected."))})},a.paste=function(){return new Promise(function(t,e){var n=window.clipboardData.getData("Text");n?t(n):e(new Error("Pasting was rejected."))})}),a}()}).call(e,n(634).setImmediate)},function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function a(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new a(i.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new a(i.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(r,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(635),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(e,n(80))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,a,o,c,u=1,f={},s=!1,l=t.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(t);d=d&&d.setTimeout?d:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick(function(){b(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?((a=new MessageChannel).port1.onmessage=function(t){b(t.data)},r=function(t){a.port2.postMessage(t)}):l&&"onreadystatechange"in l.createElement("script")?(i=l.documentElement,r=function(t){var e=l.createElement("script");e.onreadystatechange=function(){b(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(b,0,t)}:(o="setImmediate$"+Math.random()+"$",c=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(o)&&b(+e.data.slice(o.length))},t.addEventListener?t.addEventListener("message",c,!1):t.attachEvent("onmessage",c),r=function(e){t.postMessage(o+e,"*")}),d.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n1)for(var n=1;nn.value[r]){e=n.color[r];break}return e}}}},{key:"setToolTip",value:function(t){if(void 0!==t.tooltipContent){if(void 0!==t.tooltipContent.name)if("all"===t.tooltipContent.name)t.tooltipContent=function(t){var e="";for(var n in t){e="

"+(n.charAt(0).toUpperCase()+n.slice(1))+" : "+t[n]+"

"+e}return"

"+e+"

"};else{var e=t.tooltipContent.name;t.tooltipContent=function(t){return t[e]}}else if(void 0!==t.tooltipContent.source){var n=t.tooltipContent;void 0!==n.sourceID&&void 0!==n.targetID?t.tooltipContent=function(t){return"

"+t[n.source][n.sourceID]+" ➤ "+t[n.target][n.targetID]+": "+t[n.target][n.targetEnd]+"

"}:t.tooltipContent=function(t){return"

"+t[n.source]+" ➤ "+t[n.target]+": "+t[n.targetEnd]+"

"}}}else t.tooltipContent=null}},{key:"configCircos",value:function(t,e,n,r){var i=this;this.circos.layout(t,e),n&&n.forEach(function(t,e){var n,a=t.id,o=t.data,c=t.config,u=t.type;void 0!==c&&((n=c).events=i.setEvent(r,e),i.setColor(n),i.setToolTip(n)),i.circos[u.toLowerCase()](a||"track-".concat(e),o,n)}),this.circos.render()}},{key:"componentDidMount",value:function(){var t=this.props,e=t.enableDownloadSVG,n=t.enableZoomPan,r=t.size,i=t.layout,a=t.config,c=t.tracks,u=t.setProps;this.circos=new o.a({container:this.ref,width:r,height:r,enableZoomPan:n,enableDownloadSVG:e}),this.configCircos(i,a,c,u),this.setStopScroll(n)}},{key:"shouldComponentUpdate",value:function(t){return this.props.config!==t.config||this.props.layout!==t.layout||this.props.tracks!==t.tracks||this.props.size!==t.size||this.props.selectEvent!==t.selectEvent}},{key:"componentDidUpdate",value:function(){var t=this.props,e=t.size,n=t.layout,r=t.config,i=t.tracks,a=t.setProps;this.circos.removeTracks(),this.container=this.ref,this.circos.width=e,this.circos.height=e,this.configCircos(n,r,i,a)}},{key:"componentWillUnmount",value:function(){this.setStopScroll(!1)}},{key:"render",value:function(){var t=this,e=this.props,n=e.id,r=e.style,a=e.config,o=e.layout,c=e.tracks,u=e.size,f=e.eventDatum;return i.a.createElement("div",{id:n,style:r,eventDatum:f},i.a.createElement("div",{id:"Circos-container",ref:function(e){t.ref=e},config:a,layout:o,tracks:c,size:u}))}}])&&f(n.prototype,a),c&&f(n,c),e}();h.defaultProps=c.b,h.propTypes=c.c}}]); \ No newline at end of file diff --git a/dash_bio/async~ideogram.js b/dash_bio/async~ideogram.js new file mode 100644 index 000000000..3a984137a --- /dev/null +++ b/dash_bio/async~ideogram.js @@ -0,0 +1 @@ +(window.webpackJsonpdash_bio=window.webpackJsonpdash_bio||[]).push([[1],{153:function(module,__webpack_exports__,__webpack_require__){"use strict";function setBandData(t,n,e,r){var o,i,a;for(o in n)a=n[o],t.includes(a)&&""!==a&&(i=o);r.bandData[i]=e}function fetchBands(bandDataFileNames,taxid,t0,ideo){var bandDataUrl=ideo.config.dataDir+bandDataFileNames[taxid];ideo.numBandDataResponses||(ideo.numBandDataResponses=0),fetch(bandDataUrl).then(function(response){return response.text().then(function(rawBands){if(delete window.chrBands,eval(rawBands),setBandData(response.url,bandDataFileNames,chrBands,ideo),ideo.numBandDataResponses+=1,ideo.numBandDataResponses===ideo.config.taxids.length){var bandsArray=ideo.processBandData();ideo.writeContainer(bandsArray,taxid,t0),delete ideo.numBandDataResponses}})})}__webpack_require__.d(__webpack_exports__,"a",function(){return fetchBands})},154:function(t,n,e){t.exports=e(155).crossfilter},155:function(t,n,e){!function(t){function n(t){return t}function e(t,n){for(var e=0,r=n.length,o=new Array(r);e>>1;e>>1;t(n[i])>>1);--i>0;)e(t,i,o,n);return t}function e(n,e,r,o){for(var i,a=n[--o+e],s=t(a);(i=e<<1)<=r&&(it(n[o+i+1])&&i++,!(s<=t(n[o+i])));)n[o+e]=n[o+i],e=i;n[o+e]=a}return n.sort=function(t,n,r){for(var o,i=r-n;--i>0;)o=t[n],t[n]=t[n+i],t[n+i]=o,e(t,1,i,n);return t},n}function a(t){var n=i(t);return function(e,r,o,i){var a,s,c,u=new Array(i=Math.min(o-r,i));for(s=0;sa&&(u[0]=c,a=t(n(u,0,i)[0]))}while(++re&&t(n[i-1])>s;--i)n[i]=n[i-1];n[i]=a}return n}}function c(t){var n=s(t);function e(r,o,i){return(i-o>1,f=u-a,l=u+a,h=n[s],d=t(h),g=n[f],p=t(g),m=n[u],b=t(m),v=n[l],y=t(v),w=n[c],_=t(w);d>p&&(i=h,h=g,g=i,i=d,d=p,p=i);y>_&&(i=v,v=w,w=i,i=y,y=_,_=i);d>b&&(i=h,h=m,m=i,i=d,d=b,b=i);p>b&&(i=g,g=m,m=i,i=p,p=b,b=i);d>y&&(i=h,h=v,v=i,i=d,d=y,y=i);b>y&&(i=m,m=v,v=i,i=b,b=y,y=i);p>_&&(i=g,g=w,w=i,i=p,p=_,_=i);p>b&&(i=g,g=m,m=i,i=p,p=b,b=i);y>_&&(i=v,v=w,w=i,i=y,y=_,_=i);var x=g,A=p,M=v,C=y;n[s]=h,n[f]=n[r],n[u]=m,n[l]=n[o-1],n[c]=w;var T=r+1,k=o-2,S=A<=C&&A>=C;if(S)for(var O=T;O<=k;++O){var L=n[O],D=t(L);if(DA)for(;;){var B=t(n[k]);if(!(B>A)){if(BC)for(;;){var B=t(n[k]);if(!(B>C)){Bc){for(var j;(j=t(n[T]))<=A&&j>=A;)++T;for(;(B=t(n[k]))<=C&&B>=C;)--k;for(var O=T;O<=k;O++){var L=n[O],D=t(L);if(D<=A&&D>=A)O!==T&&(n[O]=n[T],n[T]=L),T++;else if(D<=C&&D>=C)for(;;){var B=t(n[k]);if(!(B<=C&&B>=C)){B32)throw new Error("invalid array width!");return t};function p(t){for(var n=new Array(t),e=-1;++er;)h[--s]=0},dimension:function(t){var f,k,S,O,L,D={filter:function(t){return null==t?X():Array.isArray(t)?q(t):"function"==typeof t?$(t):z(t)},filterExact:z,filterRange:q,filterFunction:$,filterAll:X,top:function(t){var n,e=[],r=I;for(;--r>=H&&t>0;)h[n=k[r]]||(e.push(o[n]),--t);return e},bottom:function(t){var n,e=[],r=H;for(;r0;)h[n=k[r]]||(e.push(o[n]),--t),r++;return e},group:G,groupAll:function(){var t=G(b),n=t.all;return delete t.all,delete t.top,delete t.order,delete t.orderNatural,delete t.size,t.value=function(){return n()[0].value},t},dispose:Q,remove:Q},B=~u&-~u,j=~B,N=c(function(t){return S[t]}),F=m,P=[],E=[],H=0,I=0;A.unshift(U),A.push(W),T.push(R),u|=B,(l>=32?!B:u&-(1<H)for(r=H,o=Math.min(n,I);rI)for(r=Math.max(n,I),o=e;r1?d(c,s):M(s,L),k&&(l=(f=_[0]).key);P=v);)++P;for(;Pw||(c[u=e[P]+i]=D,h[u]&j||(y.value=A(y.value,o[u])),++P>=a));)v=t(n[P]);E()}for(;BB)for(B=0;B1?(N=R,F=z):(!D&&I&&(D=1,r=[{key:null,value:T()}]),1===D?(N=Y,F=q):(N=b,F=b),c=null),p[u]=N}function W(){if(D>1){for(var t=D,n=r,e=M(t,t),o=0,i=0;o1)for(var o=0;o1?(F=z,N=R):1===D?(F=q,N=Y):F=N=b}else if(1===D){if(I)return;for(var o=0;o=0&&p.splice(t,1),(t=P.indexOf(U))>=0&&P.splice(t,1),(t=T.indexOf(W))>=0&&T.splice(t,1),e}return arguments.length<1&&(t=n),p.push(N),P.push(U),T.push(W),U(f,k,0,s),V().orderNatural()}function Q(){E.forEach(function(t){t.dispose()});var t=A.indexOf(U);return t>=0&&A.splice(t,1),(t=A.indexOf(W))>=0&&A.splice(t,1),(t=T.indexOf(R))>=0&&T.splice(t,1),u&=j,X()}return U(o,0,s),W(o,0,s),D},groupAll:function(){var t,n,e,r,i={reduce:f,reduceCount:l,reduceSum:function(t){return f(_(t),x(t),v)},value:function(){a&&(function(){var e;for(t=r(),e=0;e=0&&p.splice(t),(t=A.indexOf(c))>=0&&A.splice(t),i}return p.push(u),A.push(c),c(o,0),l()},size:function(){return s}},o=[],s=0,u=0,l=8,h=f(0),p=[],A=[],T=[];function k(n){var e=s,r=n.length;return r&&(o=o.concat(n),h=d(h,s+=r),A.forEach(function(t){t(n,e,r)})),t}return arguments.length?k(arguments[0]):t}function M(t,n){return(n<257?f:n<65537?l:h)(t)}function C(t){return 8===t?256:16===t?65536:4294967296}"undefined"!=typeof Uint8Array&&(f=function(t){return new Uint8Array(t)},l=function(t){return new Uint16Array(t)},h=function(t){return new Uint32Array(t)},d=function(t,n){if(t.length>=n)return t;var e=new t.constructor(n);return e.set(t),e},g=function(t,n){var e;switch(n){case 16:e=l(t.length);break;case 32:e=h(t.length);break;default:throw new Error("invalid array width!")}return e.set(t),e}),t.crossfilter=A}(n||this)},40:function(t,n,e){"use strict";e.r(n);var r={};e.r(r),e.d(r,"brush",function(){return P}),e.d(r,"brushX",function(){return N}),e.d(r,"brushY",function(){return F}),e.d(r,"brushSelection",function(){return j});var o=e(1),i=e.n(o),a=e(44),s=e(57),c=e(49),u=e(58),f=e(47),l=e(55),h=function(t){return function(){return t}},d=function(t,n,e){this.target=t,this.type=n,this.selection=e};function g(){a.event.stopImmediatePropagation()}var p=function(){a.event.preventDefault(),a.event.stopImmediatePropagation()},m={name:"drag"},b={name:"space"},v={name:"handle"},y={name:"center"},w={name:"x",handles:["e","w"].map(S),input:function(t,n){return t&&[[t[0],n[0][1]],[t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},_={name:"y",handles:["n","s"].map(S),input:function(t,n){return t&&[[n[0][0],t[0]],[n[1][0],t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},x={name:"xy",handles:["n","e","s","w","nw","ne","se","sw"].map(S),input:function(t){return t},output:function(t){return t}},A={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"},M={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},C={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},T={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 S(t){return{type:t}}function O(){return!a.event.button}function L(){var t=this.ownerSVGElement||this;return[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function D(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function B(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function j(t){var n=t.__brush;return n?n.dim.output(n.selection):null}function N(){return E(w)}function F(){return E(_)}var P=function(){return E(x)};function E(t){var n,e=L,r=O,o=Object(c.dispatch)(s,"start","brush","end"),i=6;function s(n){var e=n.property("__brush",P).selectAll(".overlay").data([S("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",A.overlay).merge(e).each(function(){var t=D(this).extent;Object(a.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])}),n.selectAll(".selection").data([S("selection")]).enter().append("rect").attr("class","selection").attr("cursor",A.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=n.selectAll(".handle").data(t.handles,function(t){return t.type});r.exit().remove(),r.enter().append("rect").attr("class",function(t){return"handle handle--"+t.type}).attr("cursor",function(t){return A[t.type]}),n.each(x).attr("fill","none").attr("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush touchstart.brush",F)}function x(){var t=Object(a.select)(this),n=D(this).selection;n?(t.selectAll(".selection").style("display",null).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1]),t.selectAll(".handle").style("display",null).attr("x",function(t){return"e"===t.type[t.type.length-1]?n[1][0]-i/2:n[0][0]-i/2}).attr("y",function(t){return"s"===t.type[0]?n[1][1]-i/2:n[0][1]-i/2}).attr("width",function(t){return"n"===t.type||"s"===t.type?n[1][0]-n[0][0]+i:i}).attr("height",function(t){return"e"===t.type||"w"===t.type?n[1][1]-n[0][1]+i:i})):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function j(t,n){return t.__brush.emitter||new N(t,n)}function N(t,n){this.that=t,this.args=n,this.state=t.__brush,this.active=0}function F(){if(a.event.touches){if(a.event.changedTouches.length0&&(e=o-S),U<0?h=d-O:U>0&&(i=s-O),H=b,K.attr("cursor",A.selection),et());break;default:return}p()},!0).on("keyup.brush",function(){switch(a.event.keyCode){case 16:V&&(N=F=V=!1,et());break;case 18:H===y&&(I<0?c=f:I>0&&(e=o),U<0?h=d:U>0&&(i=s),H=v,et());break;case 32:H===b&&(a.event.altKey?(I&&(c=f-S*I,e=o+S*I),U&&(h=d-O*U,i=s+O*U),H=y):(I<0?c=f:I>0&&(e=o),U<0?h=d:U>0&&(i=s),H=v),K.attr("cursor",A[E]),et());break;default:return}p()},!0).on("mousemove.brush",nt,!0).on("mouseup.brush",rt,!0);Object(u.b)(a.event.view)}g(),Object(l.b)(P),x.call(P),Z.start()}function nt(){var t=Object(a.mouse)(P);!V||N||F||(Math.abs(t[0]-Q[0])>Math.abs(t[1]-Q[1])?F=!0:N=!0),Q=t,L=!0,p(),et()}function et(){var t;switch(S=Q[0]-G[0],O=Q[1]-G[1],H){case b:case m:I&&(S=Math.max(z-e,Math.min(X-c,S)),o=e+S,f=c+S),U&&(O=Math.max(q-i,Math.min($-h,O)),s=i+O,d=h+O);break;case v:I<0?(S=Math.max(z-e,Math.min(X-e,S)),o=e+S,f=c):I>0&&(S=Math.max(z-c,Math.min(X-c,S)),o=e,f=c+S),U<0?(O=Math.max(q-i,Math.min($-i,O)),s=i+O,d=h):U>0&&(O=Math.max(q-h,Math.min($-h,O)),s=i,d=h+O);break;case y:I&&(o=Math.max(z,Math.min(X,e-S*I)),f=Math.max(z,Math.min(X,c+S*I))),U&&(s=Math.max(q,Math.min($,i-O*U)),d=Math.max(q,Math.min($,h+O*U)))}fp)return 1}for(var b=0,v=h.length,y=d.length,w=Math.max(v,y);br)return 1}}var W="1.4.1",R=e(45);function Y(t){var n;this.config=JSON.parse(JSON.stringify(t)),(n=this).chromosomesArray=[],n.coordinateSystem="iscn",n.maxLength={bp:0,iscn:0},n.chromosomes={},n.numChromosomes=0,n.config.debug||(n.config.debug=!1),n.config.dataDir||(n.config.dataDir=n.getDataDir()),n.config.container||(n.config.container="body"),n.selector=n.config.container+" #_ideogram",n.config.resolution||(n.config.resolution=""),n.config.orientation||(n.config.orientation="vertical"),n.config.brush||(n.config.brush=null),n.config.rows||(n.config.rows=1),"showChromosomeLabels"in n.config==0&&(n.config.showChromosomeLabels=!0),n.config.showNonNuclearChromosomes||(n.config.showNonNuclearChromosomes=!1),function(t){t.config.ploidy||(t.config.ploidy=1),t.config.ploidy>1&&(t.sexChromosomes={},t.config.sex||(t.config.sex="male"),2!==t.config.ploidy||t.config.ancestors||(t.config.ancestors={M:"#ffb6c1",P:"#add8e6"},t.config.ploidyDesc="MP"))}(this),function(t){t.config.showBandLabels||(t.config.showBandLabels=!1),"showFullyBanded"in t.config?t.config.showFullyBanded=t.config.showFullyBanded:t.config.showFullyBanded=!0,t.bandsToShow=[],t.bandData={}}(this),function(t){var n,e,r;t.config.chrHeight||(n=t.config.container,e=document.querySelector(n).getBoundingClientRect(),r="vertical"===t.config.orientation?e.height:e.width,"body"!==n&&0!==r||(r=400),t.config.chrHeight=r)}(this),function(t){var n,e;t.config.chrWidth||(n=10,(e=t.config.chrHeight)<900&&e>500?n=Math.round(e/40):e>=900&&(n=Math.round(e/45)),t.config.chrWidth=n)}(this),function(t){t.config.chrMargin||(1===t.config.ploidy?t.config.chrMargin=10:t.config.chrMargin=Math.round(t.config.chrWidth/4)),t.config.showBandLabels&&(t.config.chrMargin+=20)}(this),function(t,n){t.onLoad&&(n.onLoadCallback=t.onLoad),t.onLoadAnnots&&(n.onLoadAnnotsCallback=t.onLoadAnnots),t.onDrawAnnots&&(n.onDrawAnnotsCallback=t.onDrawAnnots),t.onBrushMove&&(n.onBrushMoveCallback=t.onBrushMove),t.onDidRotate&&(n.onDidRotateCallback=t.onDidRotate),t.onWillShowAnnotTooltip&&(n.onWillShowAnnotTooltipCallback=t.onWillShowAnnotTooltip)}(t,this),function(t){t.organisms={9606:{commonName:"Human",scientificName:"Homo sapiens",scientificNameAbbr:"H. sapiens",assemblies:{default:"GCF_000001405.26",GRCh38:"GCF_000001405.26",GRCh37:"GCF_000001405.13"}},10090:{commonName:"Mouse",scientificName:"Mus musculus",scientificNameAbbr:"M. musculus",assemblies:{default:"GCF_000001635.20"}},4641:{commonName:"banana",scientificName:"Musa acuminata",scientificNameAbbr:"M. acuminata",assemblies:{default:"mock"}}}}(this),function(t){t.bump=Math.round(t.config.chrHeight/125),t.adjustedBump=!1,t.config.chrHeight<200&&(t.adjustedBump=!0,t.bump=4)}(this),function(t,n){t.chromosome&&(n.config.chromosomes=[t.chromosome],"showBandLabels"in t==0&&(n.config.showBandLabels=!0),"rotatable"in t==0&&(n.config.rotatable=!1))}(t,this),this.initAnnotSettings(),this.config.chrMargin+=this.config.chrWidth,"heatmap"===this.config.annotationsLayout?this.config.chrMargin+=this.config.annotTracksHeight:this.config.chrMargin+=2*this.config.annotTracksHeight,this.init()}var z=R.a.assign({},a);function q(t){void 0!==t.timeout&&window.clearTimeout(t.timeout),t.rawAnnots=t.setOriginalTrackIndexes(t.rawAnnots),t.config.annotationsDisplayedTracks?t.annots=t.updateDisplayedTracks(t.config.annotationsDisplayedTracks):(t.annots=t.processAnnotData(t.rawAnnots),t.config.filterable&&t.initCrossFilter(),t.drawProcessedAnnots(t.annots))}function X(t,n){var e=(new Date).getTime(),r=this.config;this.initDrawChromosomes(t),r.annotationsPath&&function(t){t.rawAnnots?q(t):function n(){t.timeout=setTimeout(function(){t.rawAnnots?q(t):n()},50)}()}(this),function(t,n){var e,r,o,i;if(!0===t.showBandLabels&&(o=(new Date).getTime(),n.hideUnshownBandLabels(),i=(new Date).getTime(),t.debug&&console.log("Time in showing bands: "+(i-o)+" ms"),"vertical"===t.orientation))for(e=0;e0}return!0}}var V=R.a.assign({},a);class G{constructor(t){this._node=t}getLabel(){return V.select(this._node.parentNode).select("text.chrLabel").text()}getSetLabel(){return V.select(this._node.parentNode).select("text.chrSetLabel").text()}}var Q=R.a.assign({},a);var Z=class{constructor(t,n){if(this._config=t,this._ideo=n,this._ploidy=this._ideo._ploidy,this._translate=void 0,"chrSetMargin"in t)this.chrSetMargin=t.chrSetMargin;else{var e=this._config.chrMargin;this.chrSetMargin=this._config.ploidy>1?e:0}this._tickSize=8,this._isRotated=!1}_getLeftMargin(){return this.margin.left}_getYScale(){return 20/this._config.chrWidth}getChromosomeLabels(t){var n=new G(t),e=[];return this._ideo.config.ploidy>1&&e.push(n.getSetLabel()),e.push(n.getLabel()),e.filter(function(t){return t.length>0})}getChromosomeBandLabelTranslate(t){var n,e,r,o=this._ideo,i=this._tickSize,a=o.config.orientation;return"vertical"===a?r="rotate(-90)translate("+(n=i)+","+(e=o.round(2+t.px.start+t.px.width/2))+")":"horizontal"===a&&(r="translate("+(n=o.round(-i+t.px.start+t.px.width/2))+","+(e=-10)+")"),{x:n,y:e,translate:r}}didRotate(t,n){var e,r,o,i,a,s,c,u,f;r=(e=this._ideo).config.taxid,o=n.id.split("-")[0].replace("chr",""),i=(a=e.chromosomes[r][o]).bands,u=(c=Q.select(n.parentNode)).attr("transform"),f=/scale\(.*\)/.exec(u),u=u.replace(f,""),c.attr("transform",u),s=a.width,(a=e.getChromosomeModel(i,o,r,t)).oldWidth=s,e.chromosomes[r][o]=a,e.drawChromosome(a),e.handleRotateOnClick(),e.rawAnnots&&(e.displayedTrackIndexes?e.updateDisplayedTracks(e.displayedTrackIndexes):(e.annots=e.processAnnotData(e.rawAnnots),e.drawProcessedAnnots(e.annots),e.config.filterable&&e.initCrossFilter())),!0===e.config.showBandLabels&&(e.drawBandLabels(e.chromosomes),e.hideUnshownBandLabels()),e.onDidRotateCallback&&e.onDidRotateCallback(a)}rotate(t,n,e){var r,o,i,a;r=this._ideo,a=r.selector+" .chrSetLabel, "+r.selector+" .chrLabel",i=document.querySelector(r.selector).getBoundingClientRect(),o=Q.selectAll(r.selector+" g.chromosome").filter(function(){return this!==e}),this._isRotated?(this._isRotated=!1,r.config.chrHeight=r.config.chrHeightOriginal,r.config.chrWidth=r.config.chrWidthOriginal,r.config.annotationHeight=r.config.annotationHeightOriginal,this.rotateBack(t,n,e,function(){o.style("display",null),Q.selectAll(a).style("display",null),r._layout.didRotate(n,e)})):(this._isRotated=!0,o.style("display","none"),Q.selectAll(a).style("display","none"),this.rotateForward(t,n,e,function(){var t,o,a;r.config.chrHeightOriginal=r.config.chrHeight,r.config.chrWidthOriginal=r.config.chrWidth,r.config.annotationHeightOriginal=r.config.annotationHeight,"VerticalLayout"===r._layout._class?(o=i.width,a=window.innerWidth):(o=i.height-10,a=window.innerHeight-10),t=a0?n:n+4+2*t);if(!this._translate){var i;this._translate=[this._ploidy.getSetSize(0)*o*2];for(var a=1;a1&&(t*=1.8),t}rotateForward(t,n,e,r){var o;tt.select(e.parentNode).transition().attr("transform","rotate(90) translate(30, -37.5) ").on("end",r),o=this.getChromosomeLabels(e),tt.select(this._ideo.getSvg()).append("g").attr("class","tmp").selectAll("text").data(o).enter().append("text").attr("class",function(t,n){return 0===n&&2===o.length?"chrSetLabel":null}).attr("x",26).attr("y",function(t,n){return 12*(n+1+o.length%2)}).style("text-anchor","middle").style("opacity",0).text(String).transition().style("opacity",1),this._ideo.config.orientation="vertical"}rotateBack(t,n,e,r){var o=this.getChromosomeSetTranslate(t);tt.select(e.parentNode).transition().attr("transform",o).on("end",r),tt.selectAll(this._ideo.selector+" g.tmp").style("opacity",0).remove(),this._ideo.config.orientation="horizontal"}getHeight(t){var n=this._config.chromosomes[t].length,e=this.getChromosomeSetYTranslate(n-1);return(e+=this._getChromosomeSetSize(n-1))+2*this._getAdditionalOffset()}getWidth(){return this._config.chrHeight+1.5*this.margin.top}getChromosomeSetLabelAnchor(){return"end"}getChromosomeBandLabelAnchor(){return null}getChromosomeBandTickY1(){return 2}getChromosomeBandTickY2(){return 10}getChromosomeSetLabelTranslate(){return null}getChromosomeSetTranslate(t){return"translate("+this._getLeftMargin()+", "+this.getChromosomeSetYTranslate(t)+")"}getChromosomeSetYTranslate(t){if(!this._config.ploidyDesc)return this._config.chrMargin*(t+1);if(!this._translate){this._translate=[1];for(var n=1;no-1?(e=this.margin.left+1.4*this._config.chrHeight,r=this.getChromosomeSetYTranslate(t-o)):(e=this.margin.left,r=this.getChromosomeSetYTranslate(t)),"rotate(90) translate("+e+", -"+r+")"}getChromosomeSetYTranslate(t){var n=this._getAdditionalOffset();return this.margin.left*t+this._config.chrWidth+2*n+n*t}getChromosomeSetLabelXPosition(t){return(this._ploidy.getSetSize(t)*this._config.chrWidth+20)/-2+(this._config.ploidy>1?0:this._config.chrWidth)}getChromosomeLabelXPosition(){return this._config.chrWidth/-2}};var ot=R.a.assign({},a);function it(t,n,e){this.config.annotationsPath&&this.fetchAnnots(this.config.annotationsPath),function(t){if("ploidyDesc"in t.config&&"string"==typeof t.config.ploidyDesc){for(var n=[],e=0;e1?new rt(n,t):"vertical"===n.orientation?new K(n,t):"horizontal"===n.orientation?new nt(n,t):new K(n,t)}(this),function(t,n){ot.selectAll(n.config.container+" #_ideogramOuterWrap").remove(),ot.select(n.config.container).append("div").attr("id","_ideogramOuterWrap").append("div").attr("id","_ideogramTrackLabelContainer").style("position","absolute"),ot.select(n.config.container+" #_ideogramOuterWrap").append("div").attr("id","_ideogramMiddleWrap").style("position","relative").style("overflow-x","auto").append("div").attr("id","_ideogramInnerWrap").append("svg").attr("id","_ideogram").attr("class",function(t){var n="";return t.config.showChromosomeLabels&&("horizontal"===t.config.orientation?n+="labeledLeft ":n+="labeled "),t.config.annotationsLayout&&"overlay"===t.config.annotationsLayout&&(n+="faint"),n}(n)).attr("width",n._layout.getWidth(t)).attr("height",n._layout.getHeight(t)).html(n.getBandColorGradients())}(n,this),this.isOnlyIdeogram=1===document.querySelectorAll("#_ideogram").length,function(t){ot.select(t.config.container+" #_ideogramOuterWrap").append("div").attr("class","_ideogramTooltip").attr("id","_ideogramTooltip").style("opacity",0).style("position","fixed").style("text-align","center").style("padding","4px").style("font","12px sans-serif").style("background","white").style("border","1px solid black").style("border-radius","5px").style("z-index","100")}(this),this.finishInit(t,e)}var at=e(153),st=R.a.assign({},s,a);function ct(t,n,e){var r=e.config.ploidy;return"sex"in e.config&&(2===r&&e.sexChromosomes.index+2===n||"female"===e.config.sex&&"Y"===t.name)}function ut(t,n,e,r,o){var i,a,s,c;for(i=0;i=chrBands.length/2&&(n.coordinateSystem="bp")}function lt(t){var n,e,r,o=this.config.taxids,i=0;for(t.length>0&&(this.bandsArray={}),e=0;e=4&&(f=l[3],r[0]=f),l.length>=8&&(c=l[8].split(","),u=vt.rgbToHex(c[0],c[1],c[2]),r.push(u)),[o,r])}parseRawAnnots(t,n,e,r){var o,i,a,s,c,u;for(u=!0,!1===isNaN(parseInt(e[n],10))&&(u=!1),o=n;o=8&&c.push("color"),{keys:c,annots:t}}parseBed(t,n){var e,r,o,i,a=[],s=t.split(/\r\n|\n/);for(r=Object.keys(n.chromosomes[n.config.taxid]),e=0;e!wt.includes(t));return t.displayedTrackIndexes&&(n=n.filter(function(n,e){return t.displayedTrackIndexes.includes(e+1)})),n=n.join("
")}(n),yt.select(n.config.container+" #_ideogramTrackLabel").interrupt().style("top","").style("left","").style("transform",null).style("transform","rotate(-90deg)").html(e),[r,o]=function(t,n,e){var r,o,i,a,s;return r=n.id.split("-").slice(0,-1).join("-")+"-0",o=yt.select(e.config.container+" #"+r).nodes()[0].getBoundingClientRect(),i=yt.select(e.config.container+" #_ideogramTrackLabel").nodes()[0].getBoundingClientRect(),a=yt.select(e.config.container).nodes()[0].getBoundingClientRect(),s=Math.round(o.left+i.width)-o.width-1,[s-=a.left-7,-(t.split("
").length-2)*o.width+2]}(e,t,n),function(t,n,e){yt.select(e.config.container+" #_ideogramTrackLabel").style("opacity",1).style("left",n+"px").style("top",t+"px").style("width","max-content").style("transform-origin","bottom left").style("text-align","left").on("mouseover",function(){clearTimeout(e.hideTrackLabelTimeout)}).on("mouseout",function(){_t(e)})}(o,r,n)}var At=Object.assign({},a);function Mt(t,n,e,r){var o,i,a,s,c,u=[],f=r.config.numAnnotTracks;for(o=0;or||e===o||0!==t&&t!==n&&e<=o&&e>r||0===t&&e<=o}function St(t,n){var e,r,o,i,a,s,c,u;for(e=0;e0&&(r+="-"+t.stop.toLocaleString()),n=r,e=24,t.name&&(n=(t.displayName?t.displayName:t.name)+"
"+n,e+=8),[n,e]}(t),function(t,n,e,r,o){t.html(n).style("opacity",1).style("left",e.e+"px").style("top",e.f-r+"px").style("pointer-events",null).on("mouseover",function(){clearTimeout(o.hideAnnotTooltipTimeout)}).on("mouseout",function(){o.startHideAnnotTooltipTimeout()})}(i,r,e,o,this))}function Et(t){var n,e,r=!1,o=(new Date).getTime();return n=this.chromosomes[this.config.taxid],function(t){"histogramScaling"in t.config==0&&(t.config.histogramScaling="absolute")}(this),void 0===this.maxAnnotsPerBar&&(this.maxAnnotsPerBar={},r=!0),function(t,n,e){var r,o,i,a,s,c,u;if(n||"relative"===e.config.histogramScaling){for(r=0,o=0;oi&&(i=u),u>r&&(r=u);e.maxAnnotsPerBar[s]=i}e.maxAnnotsPerBarAllChrs=r}}(e=function(t,n,e,r){var o,i,a,s,c,u,f,l,h,d,g=r.config.barWidth;for(o in t)for(i=t[o].annots,s=n[(a=e[t[o].chr]).chrIndex].annots,c=0;c=h&&f":"triangle"===r&&(n='"):n='",n}function Rt(t,n,e){var r,o,i;for(r=0;r"+(i=e.rows[r]).name+"",o=It*r,"name"in e&&(o+=It),n+=''+Wt(i)+"";return[t,n]}var Yt=Object.assign({},a);function zt(t){var n,e,r=[],o=this.chromosomes[this.config.taxid];if("annots"in t[0])return this.drawProcessedAnnots(t);for(e in o)r.push({chr:e,annots:[]});r=function(t,n){var e,r,o,i;for(e=0;e2e3&&console.warn('Rendering more than 2000 annotations in Ideogram?\nTry setting "annotationsLayout" to "heatmap" or "histogram" in your Ideogram configuration object for better layout and performance.')}}(t,n),"histogram"===t&&(n=e.getHistogramBars(n)),r=function(t,n){return Yt.selectAll(n.selector+" .chromosome").data(t).selectAll("path.annot").data(function(t){return t.annots}).enter()}(e.fillAnnots(n),e),"tracks"===t?function(t,n){var e,r=n.config.annotationHeight;e=function(t){var n;return{triangle:"m0,0 l -"+t+" "+2*t+" l "+2*t+" 0 z",circle:"m -"+(n=t)+", "+n+"a "+n+","+n+" 0 1,0 "+2*n+",0a "+n+","+n+" 0 1,0 -"+2*n+",0",rectangle:"m0,0 l 0 "+2*t+"l "+t+" 0l 0 -"+2*t+"z"}}(r),t.append("g").attr("id",function(t){return t.id}).attr("class","annot").attr("transform",function(t){var e=n.config.chrWidth+t.trackIndex*r*2;return"translate("+t.px+","+e+")"}).append("path").attr("d",function(t){return function(t,n){return t.shape&&"triangle"!==t.shape?"circle"===t.shape?n.circle:"rectangle"===t.shape?n.rectangle:t.shape:n.triangle}(t,e)}).attr("fill",function(t){return t.color}).on("mouseover",function(t){n.showAnnotTooltip(t,this)}).on("mouseout",function(){n.startHideAnnotTooltipTimeout()})}(r,e):"overlay"===t?function(t,n){t.append("polygon").attr("id",function(t){return t.id}).attr("class","annot").attr("points",function(t){var e,r,o=n.config.chrWidth;return t.stopPx-t.startPx>1?(e=t.startPx,r=t.stopPx):(e=t.px-.5,r=t.px+.5),e+","+o+" "+r+","+o+" "+r+",0 "+e+",0"}).attr("fill",function(t){return t.color}).on("mouseover",function(t){n.showAnnotTooltip(t,this)}).on("mouseout",function(){n.startHideAnnotTooltipTimeout()})}(r,e):"histogram"===t&&function(t,n){var e,r,o={},i=n.config.chrWidth;for(r in e=n.chromosomes[n.config.taxid])o[r]=e[r];t.append("polygon").attr("class","annot").attr("points",function(t){return function(t,n,e,r){var o,i,a,s;o=t.px+r.bump,i=t.px+r.config.barWidth+r.bump,a=n,s=n+t.height;var c=e[t.chr];return i>c&&(i=c),o+","+a+" "+i+","+a+" "+i+","+s+" "+o+","+s}(t,i,o,n)}).attr("fill",function(t){return t.color})}(r,e)}function Xt(t){var n;Yt.selectAll(this.selector+" .annot").remove(),n="tracks",this.config.annotationsLayout&&(n=this.config.annotationsLayout),"legend"in this.config&&function(t){var n,e,r,o,i,a;for(Ht.select(t.config.container+" #_ideogramLegend").remove(),e=t.config.legend,a="",n=0;n"+i.name+""),r='',[o,r]=Rt(o,r,i),a+=(r+="")+"
    "+o+"
";var s=Ht.select(t.config.container+" #_ideogramOuterWrap");s.append("style").html(Ut),s.append("div").attr("id","_ideogramLegend").html(a)}(this),"heatmap"!==n?(qt(n,t,this),this.onDrawAnnotsCallback&&this.onDrawAnnotsCallback()):this.drawHeatmaps(t)}var $t=Object.assign({},a);function Vt(t,n,e){return t.append("g").attr("class","syntenicRegion").attr("id",n).on("click",function(){var t=this,n=$t.selectAll(e.selector+" .syntenicRegion").filter(function(){return this!==t});n.classed("hidden",!n.classed("hidden"))}).on("mouseover",function(){var t=this;$t.selectAll(e.selector+" .syntenicRegion").filter(function(){return this!==t}).classed("ghost",!0)}).on("mouseout",function(){$t.selectAll(e.selector+" .syntenicRegion").classed("ghost",!1)})}function Gt(t,n,e){var r,o;return r=t.r1,o=t.r2,r.startPx=e.convertBpToPx(r.chr,r.start)+n,r.stopPx=e.convertBpToPx(r.chr,r.stop)+n,o.startPx=e.convertBpToPx(o.chr,o.start)+n,o.stopPx=e.convertBpToPx(o.chr,o.stop)+n,[r,o]}function Qt(t,n,e,r,o,i){var a,s;a="color"in i?i.color:"#CFC",s="opacity"in i?i.opacity:1,t.append("polygon").attr("points",n+", "+r.startPx+" "+n+", "+r.stopPx+" "+e+", "+o.stopPx+" "+e+", "+o.startPx).attr("style","fill: "+a+"; fill-opacity: "+s)}function Zt(t,n,e,r,o){t.append("line").attr("class","syntenyBorder").attr("x1",n).attr("x2",e).attr("y1",r.startPx).attr("y2",o.startPx),t.append("line").attr("class","syntenyBorder").attr("x1",n).attr("x2",e).attr("y1",r.stopPx).attr("y2",o.stopPx)}function Jt(t){var n=(new Date).getTime();(function(t,n,e,r){var o,i,a,s,c,u,f,l;for(o=0;oc&&(c=s+1),i.splice(4,0,s),a.push(i);u.push({chr:o.chr,annots:a})}return n.numAvailTracks=c,u}(t.annots,this),n.splice(4,0,"trackIndexOriginal"),t={keys:n,annots:e},this.rawAnnots.metadata&&(t.metadata=this.rawAnnots.metadata),t)}var rn=[["F00"],["F00","88F"],["F00","CCC","88F"],["F00","FA0","0AF","88F"],["F00","FA0","CCC","0AF","88F"],["F00","FA0","875","578","0AF","88F"],["F00","FA0","875","CCC","578","0AF","88F"],["F00","FA0","7A0","875","0A7","578","0AF","88F"],["F00","FA0","7A0","875","CCC","0A7","578","0AF","88F"],["F00","FA0","7A0","875","552","255","0A7","578","0AF","88F"]];function on(t,n,e,r,o,i,a){return a.config.annotationTracks?o=function(t,n,e,r,o){var i;return n.trackIndex=e[3],(i=o.config.annotationTracks[n.trackIndex]).color&&(n.color=i.color),i.shape&&(n.shape=i.shape),t[r].annots.push(n),t}(o,t,e,i,a):"trackIndex"===n[3]&&1!==a.numAvailTracks?[o,r]=function(t,n,e,r,o,i){var a=rn[i.numAvailTracks-1];return t.trackIndex=n[3],t.trackIndexOriginal=n[4],t.color="#"+a[t.trackIndexOriginal],t.trackIndex>i.config.numTracks-1?(t.trackIndex in e?e[t.trackIndex].push(t):e[t.trackIndex]=[t],[r,e]):(r[o].annots.push(t),[r,e])}(t,e,r,o,i,a):o=function(t,n,e,r){return n.trackIndex=0,n.color||(n.color=r.config.annotationsColor),n.shape||(n.shape="triangle"),t[e].annots.push(n),t}(o,t,i,a),[o,r]}function an(t,n,e,r,o,i,a){var s,c,u,f;for(s=0;s10&&console.error("Ideogram only displays up to 10 tracks at a time. You specified "+r+" tracks. Perhaps consider a different way to visualize your data."),(e=Object.keys(t).length)&&console.warn("Ideogram configuration specified "+r+" tracks, but loaded annotations contain "+e+" extra tracks.")}(r,this),e}var un=R.a.assign({},a,s);function fn(){var t=this.config;t.annotationsPath||t.localAnnotationsPath||this.annots||t.annotations?function(t,n){var e;n.annotationHeight||(e="heatmap"===n.annotationsLayout?n.chrWidth-1:Math.round(n.chrHeight/100),t.config.annotationHeight=e),n.annotationTracks?t.config.numAnnotTracks=n.annotationTracks.length:n.annotationsNumTracks?t.config.numAnnotTracks=n.annotationsNumTracks:t.config.numAnnotTracks=1,t.config.annotTracksHeight=n.annotationHeight*n.numAnnotTracks,void 0===n.barWidth&&(t.config.barWidth=3)}(this,t):this.config.annotTracksHeight=0,void 0===t.annotationsColor&&(this.config.annotationsColor="#F00"),function(t,n){!1!==n.showAnnotTooltip&&(t.config.showAnnotTooltip=!0),n.onWillShowAnnotTooltip&&(t.onWillShowAnnotTooltipCallback=n.onWillShowAnnotTooltip)}(this,t)}function ln(t){t.rawAnnots.annots=t.rawAnnots.annots.sort(function(t,n){return U(t.chr,n.chr)}),t.onLoadAnnotsCallback&&t.onLoadAnnotsCallback(),t.config.heatmaps&&t.deserializeAnnotsForHeatmap(t.rawAnnots)}function hn(t){var n,e=this;"http"===t.slice(0,4)?(n=function(t){var n,e;return"bed"!==(e=(n=t.split("?")[0].split("."))[n.length-1])&&"json"!==e?(e=e.toUpperCase(),void alert("Ideogram.js only supports BED and Ideogram JSON at the moment. Sorry, check back soon for "+e+" support!")):e}(t),un.text(t).then(function(t){e.rawAnnots="bed"===n?new vt(t,e).rawAnnots:JSON.parse(t),ln(e)})):un.json(e.config.annotationsPath).then(function(t){e.rawAnnots=t,ln(e)})}function dn(t){var n,e,r,o,i,a,s;for(n=[],e=[],r=this.chromosomesArray,o=0;o100){if(void 0===e.recovering)return o.getAssemblyAndChromosomesFromEutils(e.callback,!0),Promise.reject("Unexpectedly found genomic scaffolds instead of chromosomes while querying RefSeq. Recovering.");throw Error("Failed to find chromosomes for genome "+r)}}(t,n,e),r=t.linksets[0].linksetdbs[0].links.join(","),o=e.ideo.esummary+"&db=nucleotide&id="+r,wn.json(o)}function An(t,n){var e,r,[e,r]=function(t,n){var e=t.genome;return"mitochondrion"===e?function(t,n){var e,r;return n.config.showNonNuclearChromosomes?(e=t.genome,[-1===(r=t.subtype.split("|").indexOf("plasmid"))?"MT":t.subname.split("|")[r],e]):[null,null]}(t,n):"chloroplast"===e||"plastid"===e?function(t){return t.config.showNonNuclearChromosomes?["CP","chloroplast"]:[null,null]}(n):"apicoplast"===e?function(t){return t.config.showNonNuclearChromosomes?["AP","apicoplast"]:[null,null]}(n):function(t){var n,e;return n=t.subtype.split("|").indexOf("chromosome"),void 0!==(e=t.subname.split("|")[n])&&"chr"===e.substr(0,3)&&(e=e.substr(3)),[e,"nuclear"]}(t)}(t,n);return{name:e,length:t.slen,type:r}}function Mn(t,n){var e,r,o=[],i=this,a={callback:t,recovering:n,ideo:i};e=function(t){var n,e;return n=t.config.organism,e=t.assemblyIsAccession()?t.config.assembly+"%22[Assembly%20Accession]":n+"%22[organism]AND%20(%22latest%20refseq%22[filter])%20",t.esearch+"&db=assembly&term=%22"+e+"AND%20(%22chromosome%20level%22[filter]%20OR%20%22complete%20genome%22[filter])"}(i),wn.json(e).then(function(t){return function(t,n){var e,r;return e=t.esearchresult.idlist[0],r=n.esummary+"&db=assembly&id="+e,wn.json(r)}(t,i)}).then(function(t){return[o,r]=_n(t,o,n,i),wn.json(r)}).then(function(t){return xn(t,o,a)}).then(function(n){return o=function(t,n,e){var r,o,i=[];for(r in t)"uids"!==r&&(o=An(t[r],e),i.push(o));return i=i.sort(Ideogram.sortChromosomes),e.coordinateSystem="bp",n.push(i),n}(n.result,o,i),t(o)},function(t){console.warn(t)})}var Cn,Tn,kn,Sn=R.a.assign({},a);function On(){var t=this.bandsToShow.join(",");Sn.selectAll(this.selector+" .bandLabel, .bandLabelStalk").style("display","none"),Sn.selectAll(t).style("display","")}function Ln(t,n,e,r,o){return n!==e&&(36,t=r[o.id][e]+36),t}function Dn(t,n,e,r,o,i,a){var s,c;return e#_ideogram {padding-left: 5px;} #_ideogram .labeled {padding-left: 15px;} #_ideogram.labeledLeft {padding-left: 15px; padding-top: 15px;} #_ideogram text {font: 9px Tahoma; fill: #000;} #_ideogram .italic {font-style: italic;} #_ideogram .chromosome {cursor: pointer; fill: #AAA;}#_ideogram .chrSetLabel {font-weight: bolder;}#_ideogram .ghost {opacity: 0.2;}#_ideogram .hidden {display: none;}#_ideogram .bandLabelStalk line {stroke: #AAA; stroke-width: 1;}#_ideogram .syntenyBorder {stroke:#AAA;stroke-width:1;}#_ideogram .brush .selection { fill: #F00; stroke: #F00; fill-opacity: .3; shape-rendering: crispEdges;}#_ideogram .noBands {fill: #AAA;}#_ideogram .gneg {fill: #FFF}#_ideogram .gpos25 {fill: #BBB}#_ideogram .gpos33 {fill: #AAA}#_ideogram .gpos50 {fill: #888}#_ideogram .gpos66 {fill: #666}#_ideogram .gpos75 {fill: #444}#_ideogram .gpos100 {fill: #000}#_ideogram .gpos {fill: #000}#_ideogram .acen {fill: #FDD}#_ideogram .stalk {fill: #CCE;}#_ideogram .gvar {fill: #DDF}#_ideogram.faint .gneg {fill: #FFF}#_ideogram.faint .gpos25 {fill: #EEE}#_ideogram.faint .gpos33 {fill: #EEE}#_ideogram.faint .gpos50 {fill: #EEE}#_ideogram.faint .gpos66 {fill: #EEE}#_ideogram.faint .gpos75 {fill: #EEE}#_ideogram.faint .gpos100 {fill: #DDD}#_ideogram.faint .gpos {fill: #DDD}#_ideogram.faint .acen {fill: #FEE}#_ideogram.faint .stalk {fill: #EEF;}#_ideogram.faint .gvar {fill: #EEF}#_ideogram .gneg {fill: url("#gneg")} #_ideogram .gpos25 {fill: url("#gpos25")} #_ideogram .gpos33 {fill: url("#gpos33")} #_ideogram .gpos50 {fill: url("#gpos50")} #_ideogram .gpos66 {fill: url("#gpos66")} #_ideogram .gpos75 {fill: url("#gpos75")} #_ideogram .gpos100 {fill: url("#gpos100")} #_ideogram .gpos {fill: url("#gpos100")} #_ideogram .acen {fill: url("#acen")} #_ideogram .stalk {fill: url("#stalk")} #_ideogram .gvar {fill: url("#gvar")} #_ideogram .noBands {fill: url("#noBands")} #_ideogram .chromosome {fill: url("#noBands")} ',kn=' ';var Nn=R.a.assign({},a);function Fn(t,n,e,r){var o=this,i=o._layout,a=e.chrIndex;return t.selectAll("text").data(n).enter().append("g").attr("class",function(t,n){return"bandLabel bsbsl-"+n}).attr("transform",function(t){var n=i.getChromosomeBandLabelTranslate(t,a);return"horizontal"===o.config.orientation?r[e.id].push(n.x+13):r[e.id].push(n.y+6),n.translate}).append("text").attr("text-anchor",i.getChromosomeBandLabelAnchor(a)).text(function(t){return t.name}),r}function Pn(t,n,e,r){var o=this;t.selectAll("line.bandLabelStalk").data(n).enter().append("g").attr("class",function(t,n){return"bandLabelStalk bsbsl-"+n}).attr("transform",function(t){var n;return n=o.round(t.px.start+t.px.width/2),-10,r[e.id].push(n+13),"translate("+n+","+-10+")"}).append("line").attr("x1",0).attr("y1",o._layout.getChromosomeBandTickY1(e.chrIndex)).attr("x2",0).attr("y2",o._layout.getChromosomeBandTickY2(e.chrIndex))}function En(t){var n,e,r,o,i,a={};for(o=function(t){var n,e,r=[];for(n in t)for(e in t[n])r.push(t[n][e]);return r}(t),n=0;n"pter"!==t.name),a=this.drawBandLabelText(e,i,r,a),this.drawBandLabelStalk(e,i,r,a);this.setBandsToShow(o,a)}function Hn(t,n){return[n[t][0],n[t][1],n[t][2],n[t][3]]}function In(){var t="";return t=function(t){var n,e,r,o,i,a="";for(n=0;n',a+="gneg"===e?'':'',a+="";return a}(Cn),t=Tn+(t=""+(t+=kn)+"")}var Un=e(81);function Wn(t,n,e,r){var o,i;return o=n[t],e.push(o),(i={iscn:o[o.length-1].iscn.stop,bp:o[o.length-1].bp.stop}).iscn>r.maxLength.iscn&&(r.maxLength.iscn=i.iscn),i.bp>r.maxLength.bp&&(r.maxLength.bp=i.bp),e}function Rn(t,n,e,r){var o,i;if("iscn"===r.coordinateSystem||r.config.multiorganism)e=function(t,n,e,r){var o,i,a;for(o=r.bandData[t],i=r.parseBands(o,t,n),n=Object.keys(i).sort(function(t,n){return U(t,n)}),r.config.chromosomes[t]=n.slice(),r.numChromosomes+=r.config.chromosomes[t].length,a=0;ar.maxLength.bp&&(r.maxLength.bp=o.length);return e}function Yn(){var t,n,e,r,o,i,a=(new Date).getTime();t=[],[e,r]=function(t){var n,e,r;if(!0===t.config.multiorganism)for(t.coordinateSystem="bp",r=t.config.taxids,n=0;n1&&o.length>1&&(t=r[0].replace("chr",""),o=r[1].split("-"),n=parseInt(o[0]),e=parseInt(o[1]-1)),[t,n,e]}(t,n,e),r=function(t,n){var e,r;for(e=0;e1){if([r,e]=function(t,n){var e,r,o,i,a,s,c,u,f;for(e=0;e=a&&n<=s)return[u+f*(o+i/c*(n-a)-o)/i,r];return[null,r]}(t,n),null!==r)return r}else if(n>=1&&n<=t.length)return r=t.scale.bp*n;!function(t,n,e){throw new Error("Base pair out of range. bp: "+t+"; length of chr"+n.name+": "+e.bp.stop)}(n,t,e)}function Qn(t,n,e,r,o,i,a){var s,c,u,f;return a=t-n,s=r-o,c=i.bp.stop-i.bp.start,u=n+(e-o)*(a/s),f=i.bp.start+c*(u-n)/a,Math.round(f)}function Zn(t,n){var e,r,o,i,a,s;for(0===n&&(n=t.bands[0].px.start),e=0;e=o&&n<=i)return Qn(s,a,n,i,o,r,void 0);!function(t,n,e){throw new Error("Pixel out of range. px: "+t+"; length of chr"+n.name+": "+e)}(n,t,i)}zn.scaleLinear=H.l,zn.max=I.k;var Jn=e(154),Kn=Object.assign({},a);function te(){var t,n,e=[],r=this.annots;for(n=0;n1&&this._model.bands.push({name:"q",px:{start:0,stop:this._model.width,width:this._model.width},bp:{start:1,stop:this._model.length}}),this._model}getCssClass(){return"noBands"}}class ce{constructor(t){this._config=t,this._ploidy=new $(this._config)}getArmColor(t,n,e){return this._config.armColors?this._config.armColors[e]:this._config.ancestors?this._getPolyploidArmColor(t,n,e):null}getBorderColor(t,n,e){return n1&&(r=this._ploidy.getChromosomesNumber(n)),i=0;i1||""===n.orientation)&&(t-=1),t}(n,s),o=-4,!0===s.showBandLabels&&(o=s.chrMargin+s.chrWidth+26),i=s.chrMargin*n,s.numAnnotTracks>1==0&&(i+=1),a=i+o,t.selectAll("text.chrLabel").attr("transform",e.scaleSvg).selectAll("tspan").attr("x",e.x).attr("y",a)}(t,n,o,this):function(t,n,e,r){var o,i,a,s=r.config;o=-s.chrWidth-2,!0===s.showBandLabels&&(o=s.chrMargin+8),i=s.annotTracksHeight,"overlay"!==s.annotationsLayout&&(i*=2),a=3-(s.chrMargin*n+o)+i,a/=e.scale.x,t.selectAll("text.chrLabel").attr("transform","rotate(-90)"+e.scaleSvg).selectAll("tspan").attr("x",a).attr("y",e.y)}(t,n,o,this)}var xe=R.a.assign({},a,s,r,c);xe.scaleLinear=H.l,xe.max=I.k;class Ae{constructor(t){this.configure=Y,this.initDrawChromosomes=lt,this.onLoad=dt,this.handleRotateOnClick=ht,this.init=bt,this.finishInit=X,this.writeContainer=it,this.onLoadAnnots=Bt,this.onDrawAnnots=jt,this.processAnnotData=cn,this.restoreDefaultTracks=tn,this.updateDisplayedTracks=nn,this.initAnnotSettings=fn,this.fetchAnnots=hn,this.drawAnnots=zt,this.getHistogramBars=Et,this.drawHeatmaps=Tt,this.deserializeAnnotsForHeatmap=Lt,this.fillAnnots=dn,this.drawProcessedAnnots=Xt,this.drawSynteny=Jt,this.startHideAnnotTooltipTimeout=Nt,this.showAnnotTooltip=Pt,this.onWillShowAnnotTooltip=Ft,this.setOriginalTrackIndexes=en,this.esearch=mn,this.esummary=bn,this.elink=vn,this.getTaxidFromEutils=yn.b,this.setTaxidData=yn.e,this.setTaxidAndAssemblyAndChromosomes=yn.d,this.getOrganismFromEutils=yn.a,this.getTaxids=yn.c,this.getAssemblyAndChromosomesFromEutils=Mn,this.parseBands=Un.a,this.drawBandLabels=En,this.getBandColorGradients=In,this.processBandData=Yn,this.setBandsToShow=jn,this.hideUnshownBandLabels=On,this.drawBandLabelText=Fn,this.drawBandLabelStalk=Pn,this.onBrushMove=qn,this.createBrush=Xn,this.drawSexChromosomes=$n,this.setSexChromosomes=Vn,this.convertBpToPx=Gn,this.convertPxToBp=Zn,this.unpackAnnots=te,this.packAnnots=ne,this.initCrossFilter=ee,this.filterAnnots=re,this.assemblyIsAccession=R.b,this.getDataDir=R.c,this.round=R.h,this.onDidRotate=R.g,this.getSvg=R.d,this.getChromosomeModel=ie,this.getChromosomePixels=oe,this.drawChromosomeLabels=we,this.rotateChromosomeLabels=_e,this.appendHomolog=ge,this.drawChromosome=pe,this.rotateAndToggleDisplay=me,this.setOverflowScroll=be,this.configure(t)}static get version(){return W}static get d3(){return xe}static slugify(t){return t.toLowerCase().replace(" ","-")}static sortChromosomes(t,n){var e="nuclear"===t.type,r="nuclear"===n.type,o="chloroplast"===t.type,i="chloroplast"===n.type,a="mitochondrion"===t.type,s="mitochondrion"===n.type,c="apicoplast"===t.type,u="apicoplast"===n.type;return e&&r?U(t.name,n.name):!e&&r?1:a&&i?1:o&&s?-1:c||a||o||!(s||i||u)?void 0:-1}}window.Ideogram=Ae;var Me=Ae,Ce=e(181),Te=e(11);function ke(t){return(ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Se(){return(Se=Object.assign||function(t){for(var n=1;n=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),o.hasOwnProperty(n)?{space:o[n],local:t}:t};var a=function(t){var n=i(t);return(n.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===r&&n.documentElement.namespaceURI===r?n.createElement(t):n.createElementNS(e,t)}})(n)};function s(){}var c=function(t){return null==t?s:function(){return this.querySelector(t)}};function u(){return[]}var f=function(t){return null==t?u:function(){return this.querySelectorAll(t)}},l=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var h=document.documentElement;if(!h.matches){var d=h.webkitMatchesSelector||h.msMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector;l=function(t){return function(){return d.call(this,t)}}}}var g=l,p=function(t){return new Array(t.length)};function m(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}m.prototype={constructor:m,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var b="$";function v(t,n,e,r,o,i){for(var a,s=0,c=n.length,u=i.length;sn?1:t>=n?0:NaN}var _=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function x(t,n){return t.style.getPropertyValue(n)||_(t).getComputedStyle(t,null).getPropertyValue(n)}function A(t){return t.trim().split(/^|\s+/)}function M(t){return t.classList||new C(t)}function C(t){this._node=t,this._names=A(t.getAttribute("class")||"")}function T(t,n){for(var e=M(t),r=-1,o=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function S(){this.textContent=""}function O(){this.innerHTML=""}function L(){this.nextSibling&&this.parentNode.appendChild(this)}function D(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function B(){return null}function j(){var t=this.parentNode;t&&t.removeChild(this)}function N(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function F(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}var P={},E=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(P={mouseenter:"mouseover",mouseleave:"mouseout"}));function H(t,n,e){return t=I(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function I(t,n,e){return function(r){var o=E;E=r;try{t.call(this,this.__data__,n,e)}finally{E=o}}}function U(t){return function(){var n=this.__on;if(n){for(var e,r=0,o=-1,i=n.length;r=A&&(A=x+1);!(_=b[A])&&++A=0;)(r=o[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=w);for(var e=this._groups,r=e.length,o=new Array(r),i=0;i1?this.each((null==n?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof n?function(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}:function(t,n,e){return function(){this.style.setProperty(t,n,e)}})(t,n,null==e?"":e)):x(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?function(t){return function(){delete this[t]}}:"function"==typeof n?function(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}:function(t,n){return function(){this[t]=n}})(t,n)):this.node()[t]},classed:function(t,n){var e=A(t+"");if(arguments.length<2){for(var r=M(this.node()),o=-1,i=e.length;++o=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}(t+""),a=i.length;if(!(arguments.length<2)){for(s=n?W:U,null==e&&(e=!1),r=0;rn?1:t>=n?0:NaN},o=function(t){var n;return 1===t.length&&(n=t,t=function(t,e){return r(n(t),e)}),{left:function(n,e,r,o){for(null==r&&(r=0),null==o&&(o=n.length);r>>1;t(n[i],e)<0?r=i+1:o=i}return r},right:function(n,e,r,o){for(null==r&&(r=0),null==o&&(o=n.length);r>>1;t(n[i],e)>0?o=i:r=i+1}return r}}};var i=o(r),a=i.right,s=i.left,c=a,u=function(t,n){null==n&&(n=f);for(var e=0,r=t.length-1,o=t[0],i=new Array(r<0?0:r);et?1:n>=t?0:NaN},d=function(t){return null===t?NaN:+t},g=function(t,n){var e,r,o=t.length,i=0,a=-1,s=0,c=0;if(null==n)for(;++a1)return c/(i-1)},p=function(t,n){var e=g(t,n);return e?Math.sqrt(e):e},m=function(t,n){var e,r,o,i=t.length,a=-1;if(null==n){for(;++a=e)for(r=o=e;++ae&&(r=e),o=e)for(r=o=e;++ae&&(r=e),o0)return[t];if((r=n0)for(t=Math.ceil(t/a),n=Math.floor(n/a),i=new Array(o=Math.ceil(n-t+1));++s=0?(i>=A?10:i>=M?5:i>=C?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(i>=A?10:i>=M?5:i>=C?2:1)}function S(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),o=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),i=r/o;return i>=A?o*=10:i>=M?o*=5:i>=C&&(o*=2),nl;)h.pop(),--d;var g,p=new Array(d+1);for(o=0;o<=d;++o)(g=p[o]=[]).x0=o>0?h[o-1]:f,g.x1=o=1)return+e(t[r-1],r-1,t);var r,o=(r-1)*n,i=Math.floor(o),a=+e(t[i],i,t);return a+(+e(t[i+1],i+1,t)-a)*(o-i)}},B=function(t,n,e){return t=y.call(t,d).sort(r),Math.ceil((e-n)/(2*(D(t,.75)-D(t,.25))*Math.pow(t.length,-1/3)))},j=function(t,n,e){return Math.ceil((e-n)/(3.5*p(t)*Math.pow(t.length,-1/3)))},N=function(t,n){var e,r,o=t.length,i=-1;if(null==n){for(;++i=e)for(r=e;++ir&&(r=e)}else for(;++i=e)for(r=e;++ir&&(r=e);return r},F=function(t,n){var e,r=t.length,o=r,i=-1,a=0;if(null==n)for(;++i=0;)for(n=(r=t[o]).length;--n>=0;)e[--a]=r[n];return e},H=function(t,n){var e,r,o=t.length,i=-1;if(null==n){for(;++i=e)for(r=e;++ie&&(r=e)}else for(;++i=e)for(r=e;++ie&&(r=e);return r},I=function(t,n){for(var e=n.length,r=new Array(e);e--;)r[e]=t[n[e]];return r},U=function(t,n){if(e=t.length){var e,o,i=0,a=0,s=t[a];for(null==n&&(n=r);++i=1?(e=1,n-1):Math.floor(e*n),i=t[r],a=t[r+1],s=r>0?t[r-1]:2*i-a,c=r180||e<-180?e-360*Math.round(e/360):e):s(isNaN(t)?n:t)}function f(t){return 1==(t=+t)?l:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):s(isNaN(n)?e:n)}}function l(t,n){var e=n-t;return e?c(t,e):s(isNaN(t)?n:t)}var h=function t(n){var e=f(n);function o(t,n){var o=e((t=Object(r.f)(t)).r,(n=Object(r.f)(n)).r),i=e(t.g,n.g),a=e(t.b,n.b),s=l(t.opacity,n.opacity);return function(n){return t.r=o(n),t.g=i(n),t.b=a(n),t.opacity=s(n),t+""}}return o.gamma=t,o}(1);function d(t){return function(n){var e,o,i=n.length,a=new Array(i),s=new Array(i),c=new Array(i);for(e=0;ei&&(o=n.slice(i,o),s[a]?s[a]+=o:s[++a]=o),(e=e[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,c.push({i:a,x:v(e,r)})),i=_.lastIndex;return i180?n+=360:n-t>180&&(t+=360),i.push({i:e.push(o(e)+"rotate(",null,r)-2,x:v(t,n)})):n&&e.push(o(e)+"rotate("+n+r)}(i.rotate,a.rotate,s,c),function(t,n,e,i){t!==n?i.push({i:e.push(o(e)+"skewX(",null,r)-2,x:v(t,n)}):n&&e.push(o(e)+"skewX("+n+r)}(i.skewX,a.skewX,s,c),function(t,n,e,r,i,a){if(t!==e||n!==r){var s=i.push(o(i)+"scale(",null,",",null,")");a.push({i:s-4,x:v(t,e)},{i:s-2,x:v(n,r)})}else 1===e&&1===r||i.push(o(i)+"scale("+e+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,s,c),i=a=null,function(t){for(var n,e=-1,r=c.length;++e>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):(n=f.exec(t))?y(parseInt(n[1],16)):(n=l.exec(t))?new A(n[1],n[2],n[3],1):(n=h.exec(t))?new A(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=d.exec(t))?w(n[1],n[2],n[3],n[4]):(n=g.exec(t))?w(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=p.exec(t))?M(n[1],n[2]/100,n[3]/100,1):(n=m.exec(t))?M(n[1],n[2]/100,n[3]/100,n[4]):b.hasOwnProperty(t)?y(b[t]):"transparent"===t?new A(NaN,NaN,NaN,0):null}function y(t){return new A(t>>16&255,t>>8&255,255&t,1)}function w(t,n,e,r){return r<=0&&(t=n=e=NaN),new A(t,n,e,r)}function _(t){return t instanceof i||(t=v(t)),t?new A((t=t.rgb()).r,t.g,t.b,t.opacity):new A}function x(t,n,e,r){return 1===arguments.length?_(t):new A(t,n,e,null==r?1:r)}function A(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function M(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new T(t,n,e,r)}function C(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof T)return new T(t.h,t.s,t.l,t.opacity);if(t instanceof i||(t=v(t)),!t)return new T;if(t instanceof T)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,o=Math.min(n,e,r),a=Math.max(n,e,r),s=NaN,c=a-o,u=(a+o)/2;return c?(s=n===a?(e-r)/c+6*(e0&&u<1?0:s,new T(s,c,u,t.opacity)}(t):new T(t,n,e,null==r?1:r)}function T(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function k(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}r(i,v,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),r(A,x,o(i,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new A(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new A(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},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+")")}})),r(T,C,o(i,{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),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,o=2*e-r;return new A(k(t>=240?t-240:t+120,o,r),k(t,o,r),k(t<120?t+240:t-120,o,r),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 S=Math.PI/180,O=180/Math.PI,L=.95047,D=1,B=1.08883,j=4/29,N=6/29,F=3*N*N,P=N*N*N;function E(t){if(t instanceof I)return new I(t.l,t.a,t.b,t.opacity);if(t instanceof q){var n=t.h*S;return new I(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof A||(t=_(t));var e=Y(t.r),r=Y(t.g),o=Y(t.b),i=U((.4124564*e+.3575761*r+.1804375*o)/L),a=U((.2126729*e+.7151522*r+.072175*o)/D);return new I(116*a-16,500*(i-a),200*(a-U((.0193339*e+.119192*r+.9503041*o)/B)),t.opacity)}function H(t,n,e,r){return 1===arguments.length?E(t):new I(t,n,e,null==r?1:r)}function I(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function U(t){return t>P?Math.pow(t,1/3):t/F+j}function W(t){return t>N?t*t*t:F*(t-j)}function R(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Y(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function z(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof q)return new q(t.h,t.c,t.l,t.opacity);t instanceof I||(t=E(t));var n=Math.atan2(t.b,t.a)*O;return new q(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new q(t,n,e,null==r?1:r)}function q(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}r(I,H,o(i,{brighter:function(t){return new I(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new I(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=D*W(t),new A(R(3.2404542*(n=L*W(n))-1.5371385*t-.4985314*(e=B*W(e))),R(-.969266*n+1.8760108*t+.041556*e),R(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),r(q,z,o(i,{brighter:function(t){return new q(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new q(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return E(this).rgb()}}));var X=-.14861,$=1.78277,V=-.29227,G=-.90649,Q=1.97294,Z=Q*G,J=Q*$,K=$*V-G*X;function tt(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof nt)return new nt(t.h,t.s,t.l,t.opacity);t instanceof A||(t=_(t));var n=t.r/255,e=t.g/255,r=t.b/255,o=(K*r+Z*n-J*e)/(K+Z-J),i=r-o,a=(Q*(e-o)-V*i)/G,s=Math.sqrt(a*a+i*i)/(Q*o*(1-o)),c=s?Math.atan2(a,i)*O-120:NaN;return new nt(c<0?c+360:c,s,o,t.opacity)}(t):new nt(t,n,e,null==r?1:r)}function nt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}r(nt,tt,o(i,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new nt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new nt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*S,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),o=Math.sin(t);return new A(255*(n+e*(X*r+$*o)),255*(n+e*(V*r+G*o)),255*(n+e*(Q*r)),this.opacity)}})),e.d(n,"a",function(){return v}),e.d(n,"f",function(){return x}),e.d(n,"d",function(){return C}),e.d(n,"e",function(){return H}),e.d(n,"c",function(){return z}),e.d(n,"b",function(){return tt})},49:function(t,n,e){"use strict";e.r(n);var r={value:function(){}};function o(){for(var t,n=0,e=arguments.length,r={};n=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})),c=-1,u=i.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++c0)for(var e,r,o=new Array(e),i=0;i=r.length)return null!=t&&e.sort(t),null!=n?n(e):e;for(var u,f,l,h=-1,d=e.length,g=r[o++],p=i(),m=s();++hr.length)return e;var a,s=o[i-1];return null!=n&&i>=r.length?a=e.entries():(a=[],e.each(function(n,e){a.push({key:e,values:t(n,i)})})),null!=s?a.sort(function(t,n){return s(t.key,n.key)}):a}(a(t,0,u,f),0)},key:function(t){return r.push(t),e},sortKeys:function(t){return o[r.length-1]=t,e},sortValues:function(n){return t=n,e},rollup:function(t){return n=t,e}}};function s(){return{}}function c(t,n,e){t[n]=e}function u(){return i()}function f(t,n,e){t.set(n,e)}function l(){}var h=i.prototype;function d(t,n){var e=new l;if(t instanceof l)t.each(function(t){e.add(t)});else if(t){var r=-1,o=t.length;if(null==n)for(;++rc)throw new Error("too late; already scheduled");return e}function b(t,n){var e=v(t,n);if(e.state>f)throw new Error("too late; already started");return e}function v(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}var y=function(t,n){var e,r,o,i=t.__transition,a=!0;if(i){for(o in n=null==n?null:n+"",i)(e=i[o]).name===n?(r=e.state>f&&e.state=0&&(t=t.slice(0,n)),!t||"start"===t})}(n)?m:b;return function(){var a=i(this,t),s=a.on;s!==r&&(o=(r=s).copy()).on(n,e),a.on=o}}(e,t,n))},attr:function(t,n){var e=Object(r.namespace)(t),o="transform"===e?w.u:A;return this.attrTween(t,"function"==typeof n?(e.local?function(t,n,e){var r,o,i;return function(){var a,s=e(this);if(null!=s)return(a=this.getAttributeNS(t.space,t.local))===s?null:a===r&&s===o?i:i=n(r=a,o=s);this.removeAttributeNS(t.space,t.local)}}:function(t,n,e){var r,o,i;return function(){var a,s=e(this);if(null!=s)return(a=this.getAttribute(t))===s?null:a===r&&s===o?i:i=n(r=a,o=s);this.removeAttribute(t)}})(e,o,_(this,"attr."+t,n)):null==n?(e.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(e):(e.local?function(t,n,e){var r,o;return function(){var i=this.getAttributeNS(t.space,t.local);return i===e?null:i===r?o:o=n(r=i,e)}}:function(t,n,e){var r,o;return function(){var i=this.getAttribute(t);return i===e?null:i===r?o:o=n(r=i,e)}})(e,o,n+""))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var o=Object(r.namespace)(t);return this.tween(e,(o.local?function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttributeNS(t.space,t.local,r(n))}}return e._value=n,e}:function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttribute(t,r(n))}}return e._value=n,e})(o,n))},style:function(t,n,e){var o="transform"==(t+="")?w.t:A;return null==n?this.styleTween(t,function(t,n){var e,o,i;return function(){var a=Object(r.style)(this,t),s=(this.style.removeProperty(t),Object(r.style)(this,t));return a===s?null:a===e&&s===o?i:i=n(e=a,o=s)}}(t,o)).on("end.style."+t,function(t){return function(){this.style.removeProperty(t)}}(t)):this.styleTween(t,"function"==typeof n?function(t,n,e){var o,i,a;return function(){var s=Object(r.style)(this,t),c=e(this);return null==c&&(this.style.removeProperty(t),c=Object(r.style)(this,t)),s===c?null:s===o&&c===i?a:a=n(o=s,i=c)}}(t,o,_(this,"style."+t,n)):function(t,n,e){var o,i;return function(){var a=Object(r.style)(this,t);return a===e?null:a===o?i:i=n(o=a,e)}}(t,o,n+""),e)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){function r(){var r=this,o=n.apply(r,arguments);return o&&function(n){r.style.setProperty(t,o(n),e)}}return r._value=n,r}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(_(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 n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}));var t},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,o=v(this.node(),e).tween,i=0,a=o.length;iu&&e.name===n)return new T([[t]],B,n,+r);return null};e.d(n,"c",function(){return k}),e.d(n,"a",function(){return j}),e.d(n,"b",function(){return y})},56:function(t,n,e){"use strict";var r=new Date,o=new Date;function i(t,n,e,a){function s(n){return t(n=new Date(+n)),n}return s.floor=s,s.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},s.round=function(t){var n=s(t),e=s.ceil(t);return t-n0))return a;do{a.push(i=new Date(+e)),n(e,o),t(e)}while(i=n)for(;t(n),!e(n);)n.setTime(n-1)},function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););})},e&&(s.count=function(n,i){return r.setTime(+n),o.setTime(+i),t(r),t(o),Math.floor(e(r,o))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(a?function(n){return a(n)%t==0}:function(n){return s.count(0,n)%t==0}):s:null}),s}var a=i(function(){},function(t,n){t.setTime(+t+n)},function(t,n){return n-t});a.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i(function(n){n.setTime(Math.floor(n/t)*t)},function(n,e){n.setTime(+n+e*t)},function(n,e){return(e-n)/t}):a:null};var s=a,c=a.range,u=6e4,f=6048e5,l=i(function(t){t.setTime(1e3*Math.floor(t/1e3))},function(t,n){t.setTime(+t+1e3*n)},function(t,n){return(n-t)/1e3},function(t){return t.getUTCSeconds()}),h=l,d=l.range,g=i(function(t){t.setTime(Math.floor(t/u)*u)},function(t,n){t.setTime(+t+n*u)},function(t,n){return(n-t)/u},function(t){return t.getMinutes()}),p=g,m=g.range,b=i(function(t){var n=t.getTimezoneOffset()*u%36e5;n<0&&(n+=36e5),t.setTime(36e5*Math.floor((+t-n)/36e5)+n)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getHours()}),v=b,y=b.range,w=i(function(t){t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*u)/864e5},function(t){return t.getDate()-1}),_=w,x=w.range;function A(t){return i(function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+7*n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*u)/f})}var M=A(0),C=A(1),T=A(2),k=A(3),S=A(4),O=A(5),L=A(6),D=M.range,B=C.range,j=T.range,N=k.range,F=S.range,P=O.range,E=L.range,H=i(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,n){t.setMonth(t.getMonth()+n)},function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),I=H,U=H.range,W=i(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t,n){return n.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});W.every=function(t){return isFinite(t=Math.floor(t))&&t>0?i(function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,e){n.setFullYear(n.getFullYear()+e*t)}):null};var R=W,Y=W.range,z=i(function(t){t.setUTCSeconds(0,0)},function(t,n){t.setTime(+t+n*u)},function(t,n){return(n-t)/u},function(t){return t.getUTCMinutes()}),q=z,X=z.range,$=i(function(t){t.setUTCMinutes(0,0,0)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getUTCHours()}),V=$,G=$.range,Q=i(function(t){t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n)},function(t,n){return(n-t)/864e5},function(t){return t.getUTCDate()-1}),Z=Q,J=Q.range;function K(t){return i(function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+7*n)},function(t,n){return(n-t)/f})}var tt=K(0),nt=K(1),et=K(2),rt=K(3),ot=K(4),it=K(5),at=K(6),st=tt.range,ct=nt.range,ut=et.range,ft=rt.range,lt=ot.range,ht=it.range,dt=at.range,gt=i(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCMonth(t.getUTCMonth()+n)},function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()}),pt=gt,mt=gt.range,bt=i(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)},function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});bt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?i(function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)}):null};var vt=bt,yt=bt.range;e.d(n,"g",function(){return i}),e.d(n,"h",function(){return s}),e.d(n,"i",function(){return c}),e.d(n,"L",function(){return s}),e.d(n,"M",function(){return c}),e.d(n,"r",function(){return h}),e.d(n,"s",function(){return d}),e.d(n,"V",function(){return h}),e.d(n,"W",function(){return d}),e.d(n,"j",function(){return p}),e.d(n,"k",function(){return m}),e.d(n,"e",function(){return v}),e.d(n,"f",function(){return y}),e.d(n,"a",function(){return _}),e.d(n,"b",function(){return x}),e.d(n,"B",function(){return M}),e.d(n,"C",function(){return D}),e.d(n,"t",function(){return M}),e.d(n,"u",function(){return D}),e.d(n,"l",function(){return C}),e.d(n,"m",function(){return B}),e.d(n,"x",function(){return T}),e.d(n,"y",function(){return j}),e.d(n,"z",function(){return k}),e.d(n,"A",function(){return N}),e.d(n,"v",function(){return S}),e.d(n,"w",function(){return F}),e.d(n,"c",function(){return O}),e.d(n,"d",function(){return P}),e.d(n,"p",function(){return L}),e.d(n,"q",function(){return E}),e.d(n,"n",function(){return I}),e.d(n,"o",function(){return U}),e.d(n,"D",function(){return R}),e.d(n,"E",function(){return Y}),e.d(n,"N",function(){return q}),e.d(n,"O",function(){return X}),e.d(n,"J",function(){return V}),e.d(n,"K",function(){return G}),e.d(n,"F",function(){return Z}),e.d(n,"G",function(){return J}),e.d(n,"fb",function(){return tt}),e.d(n,"gb",function(){return st}),e.d(n,"X",function(){return tt}),e.d(n,"Y",function(){return st}),e.d(n,"P",function(){return nt}),e.d(n,"Q",function(){return ct}),e.d(n,"bb",function(){return et}),e.d(n,"cb",function(){return ut}),e.d(n,"db",function(){return rt}),e.d(n,"eb",function(){return ft}),e.d(n,"Z",function(){return ot}),e.d(n,"ab",function(){return lt}),e.d(n,"H",function(){return it}),e.d(n,"I",function(){return ht}),e.d(n,"T",function(){return at}),e.d(n,"U",function(){return dt}),e.d(n,"R",function(){return pt}),e.d(n,"S",function(){return mt}),e.d(n,"hb",function(){return vt}),e.d(n,"ib",function(){return yt})},57:function(t,n,e){"use strict";function r(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.blob()}e.r(n);var o=function(t,n){return fetch(t,n).then(r)};function i(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.arrayBuffer()}var a=function(t,n){return fetch(t,n).then(i)},s=e(59);function c(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}var u=function(t,n){return fetch(t,n).then(c)};function f(t){return function(n,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=void 0),u(n,e).then(function(n){return t(n,r)})}}function l(t,n,e,r){3===arguments.length&&"function"==typeof e&&(r=e,e=void 0);var o=Object(s.e)(t);return u(n,e).then(function(t){return o.parse(t,r)})}var h=f(s.c),d=f(s.h),g=function(t,n){return new Promise(function(e,r){var o=new Image;for(var i in n)o[i]=n[i];o.onerror=r,o.onload=function(){e(o)},o.src=t})};function p(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.json()}var m=function(t,n){return fetch(t,n).then(p)};function b(t){return function(n,e){return u(n,e).then(function(n){return(new DOMParser).parseFromString(n,t)})}}var v=b("application/xml"),y=b("text/html"),w=b("image/svg+xml");e.d(n,"blob",function(){return o}),e.d(n,"buffer",function(){return a}),e.d(n,"dsv",function(){return l}),e.d(n,"csv",function(){return h}),e.d(n,"tsv",function(){return d}),e.d(n,"image",function(){return g}),e.d(n,"json",function(){return m}),e.d(n,"text",function(){return u}),e.d(n,"xml",function(){return v}),e.d(n,"html",function(){return y}),e.d(n,"svg",function(){return w})},58:function(t,n,e){"use strict";var r=e(49),o=e(44);function i(){o.event.stopImmediatePropagation()}var a=function(){o.event.preventDefault(),o.event.stopImmediatePropagation()},s=function(t){var n=t.document.documentElement,e=Object(o.select)(t).on("dragstart.drag",a,!0);"onselectstart"in n?e.on("selectstart.drag",a,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")};function c(t,n){var e=t.document.documentElement,r=Object(o.select)(t).on("dragstart.drag",null);n&&(r.on("click.drag",a,!0),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}var u=function(t){return function(){return t}};function f(t,n,e,r,o,i,a,s,c,u){this.target=t,this.type=n,this.subject=e,this.identifier=r,this.active=o,this.x=i,this.y=a,this.dx=s,this.dy=c,this._=u}function l(){return!o.event.button}function h(){return this.parentNode}function d(t){return null==t?{x:o.event.x,y:o.event.y}:t}function g(){return"ontouchstart"in this}f.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var p=function(){var t,n,e,p,m=l,b=h,v=d,y=g,w={},_=Object(r.dispatch)("start","drag","end"),x=0,A=0;function M(t){t.on("mousedown.drag",C).filter(y).on("touchstart.drag",S).on("touchmove.drag",O).on("touchend.drag touchcancel.drag",L).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function C(){if(!p&&m.apply(this,arguments)){var r=D("mouse",b.apply(this,arguments),o.mouse,this,arguments);r&&(Object(o.select)(o.event.view).on("mousemove.drag",T,!0).on("mouseup.drag",k,!0),s(o.event.view),i(),e=!1,t=o.event.clientX,n=o.event.clientY,r("start"))}}function T(){if(a(),!e){var r=o.event.clientX-t,i=o.event.clientY-n;e=r*r+i*i>A}w.mouse("drag")}function k(){Object(o.select)(o.event.view).on("mousemove.drag mouseup.drag",null),c(o.event.view,e),a(),w.mouse("end")}function S(){if(m.apply(this,arguments)){var t,n,e=o.event.changedTouches,r=b.apply(this,arguments),a=e.length;for(t=0;t=f?d=!0:(c=t.charCodeAt(l++))===a?g=!0:c===s&&(g=!0,t.charCodeAt(l)===a&&++l),t.slice(u+1,n-1).replace(/""/g,'"')}for(;l=0&&n._call.call(null,t),n=n._next;--i}function y(){f=(u=h.now())+l,i=a=0;try{v()}finally{i=0,function(){var t,n,e=r,i=1/0;for(;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:r=n);o=t,_(i)}(),f=0}}function w(){var t=h.now(),n=t-u;n>c&&(l-=n,u=t)}function _(t){i||(a&&(a=clearTimeout(a)),t-f>24?(t<1/0&&(a=setTimeout(y,t-h.now()-l)),s&&(s=clearInterval(s))):(s||(u=h.now(),s=setInterval(w,c)),i=1,d(y)))}m.prototype=b.prototype={constructor:m,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?g():+e)+(null==n?0:+n),this._next||o===this||(o?o._next=this:r=this,o=this),this._call=t,this._time=e,_()},stop:function(){this._call&&(this._call=null,this._time=1/0,_())}};var x=function(t,n,e){var r=new m;return n=null==n?0:+n,r.restart(function(e){r.stop(),t(e+n)},n,e),r},A=function(t,n,e){var r=new m,o=n;return null==n?(r.restart(t,n,e),r):(n=+n,e=null==e?g():+e,r.restart(function i(a){a+=o,r.restart(i,o+=n,e),t(a)},n,e),r)};e.d(n,"b",function(){return g}),e.d(n,"d",function(){return b}),e.d(n,"e",function(){return v}),e.d(n,"c",function(){return x}),e.d(n,"a",function(){return A})},61:function(t,n,e){"use strict";var r=e(46),o=e(53),i=Array.prototype,a=i.map,s=i.slice,c={name:"implicit"};function u(t){var n=Object(o.c)(),e=[],r=c;function i(o){var i=o+"",a=n.get(i);if(!a){if(r!==c)return r;n.set(i,a=e.push(o))}return t[(a-1)%t.length]}return t=null==t?[]:s.call(t),i.domain=function(t){if(!arguments.length)return e.slice();e=[],n=Object(o.c)();for(var r,a,s=-1,c=t.length;++s2?v:b,r=o=null,d}function d(n){return(r||(r=e(i,c,f?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=n?0:t>=e?1:r(t)}}}(t):t,u)))(+n)}return d.invert=function(t){return(o||(o=e(c,i,m,f?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=0?n:t>=1?e:r(t)}}}(n):n)))(+t)},d.domain=function(t){return arguments.length?(i=a.call(t,g),l()):i.slice()},d.range=function(t){return arguments.length?(c=s.call(t),l()):c.slice()},d.rangeRound=function(t){return c=s.call(t),u=h.r,l()},d.clamp=function(t){return arguments.length?(f=!!t,l()):f},d.interpolate=function(t){return arguments.length?(u=t,l()):u},l()}var _=e(62),x=function(t,n,e){var o,i=t[0],a=t[t.length-1],s=Object(r.A)(i,a,null==n?10:n);switch((e=Object(_.e)(null==e?",f":e)).type){case"s":var c=Math.max(Math.abs(i),Math.abs(a));return null!=e.precision||isNaN(o=Object(_.g)(s,c))||(e.precision=o),Object(_.d)(e,c);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(o=Object(_.h)(s,Math.max(Math.abs(i),Math.abs(a))))||(e.precision=o-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(o=Object(_.f)(s))||(e.precision=o-2*("%"===e.type))}return Object(_.a)(e)};function A(t){var n=t.domain;return t.ticks=function(t){var e=n();return Object(r.B)(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){return x(n(),t,e)},t.nice=function(e){null==e&&(e=10);var o,i=n(),a=0,s=i.length-1,c=i[a],u=i[s];return u0?(c=Math.floor(c/o)*o,u=Math.ceil(u/o)*o,o=Object(r.z)(c,u,e)):o<0&&(c=Math.ceil(c*o)/o,u=Math.floor(u*o)/o,o=Object(r.z)(c,u,e)),o>0?(i[a]=Math.floor(c/o)*o,i[s]=Math.ceil(u/o)*o,n(i)):o<0&&(i[a]=Math.ceil(c*o)/o,i[s]=Math.floor(u*o)/o,n(i)),t},t}function M(){var t=w(m,h.m);return t.copy=function(){return y(t,M())},A(t)}function C(){var t=[0,1];function n(t){return+t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=a.call(e,g),n):t.slice()},n.copy=function(){return C().domain(t)},A(n)}var T=function(t,n){var e,r=0,o=(t=t.slice()).length-1,i=t[r],a=t[o];return a0){for(;du)break;m.push(h)}}else for(;d=1;--l)if(!((h=f*l)u)break;m.push(h)}}else m=Object(r.B)(d,g,Math.min(g-d,p)).map(i);return a?m.reverse():m},t.tickFormat=function(n,r){if(null==r&&(r=10===e?".0e":","),"function"!=typeof r&&(r=Object(_.a)(r)),n===1/0)return r;null==n&&(n=10);var a=Math.max(1,e*n/t.ticks().length);return function(t){var n=t/i(Math.round(o(t)));return n*e0?e[o-1]:t[0],o=e?[o[e-1],n]:[o[a-1],o[a]]},a.copy=function(){return H().domain([t,n]).range(i)},A(a)}function I(){var t=[.5],n=[0,1],e=1;function o(o){if(o<=o)return n[Object(r.b)(t,o,0,e)]}return o.domain=function(r){return arguments.length?(t=s.call(r),e=Math.min(t.length,n.length-1),o):t.slice()},o.range=function(r){return arguments.length?(n=s.call(r),e=Math.min(t.length,n.length-1),o):n.slice()},o.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},o.copy=function(){return I().domain(t).range(n)},o}var U=e(56),W=e(63),R=1e3,Y=60*R,z=60*Y,q=24*z,X=7*q,$=30*q,V=365*q;function G(t){return new Date(t)}function Q(t){return t instanceof Date?+t:+new Date(+t)}function Z(t,n,e,o,i,s,c,u,f){var l=w(m,h.m),d=l.invert,g=l.domain,p=f(".%L"),b=f(":%S"),v=f("%I:%M"),_=f("%I %p"),x=f("%a %d"),A=f("%b %d"),M=f("%B"),C=f("%Y"),k=[[c,1,R],[c,5,5*R],[c,15,15*R],[c,30,30*R],[s,1,Y],[s,5,5*Y],[s,15,15*Y],[s,30,30*Y],[i,1,z],[i,3,3*z],[i,6,6*z],[i,12,12*z],[o,1,q],[o,2,2*q],[e,1,X],[n,1,$],[n,3,3*$],[t,1,V]];function S(r){return(c(r)1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return ut.h=360*t-100,ut.s=1.5-1.5*n,ut.l=.8-.9*n,ut+""};function lt(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}var ht=lt(tt("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),dt=lt(tt("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),gt=lt(tt("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),pt=lt(tt("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function mt(t){var n=0,e=1,r=!1;function o(o){var i=(o-n)/(e-n);return t(r?Math.max(0,Math.min(1,i)):i)}return o.domain=function(t){return arguments.length?(n=+t[0],e=+t[1],o):[n,e]},o.clamp=function(t){return arguments.length?(r=!!t,o):r},o.interpolator=function(n){return arguments.length?(t=n,o):t},o.copy=function(){return mt(t).domain([n,e]).clamp(r)},A(o)}e.d(n,"i",function(){return f}),e.d(n,"o",function(){return l}),e.d(n,"j",function(){return C}),e.d(n,"l",function(){return M}),e.d(n,"m",function(){return j}),e.d(n,"n",function(){return u}),e.d(n,"k",function(){return c}),e.d(n,"p",function(){return F}),e.d(n,"t",function(){return P}),e.d(n,"q",function(){return E}),e.d(n,"r",function(){return H}),e.d(n,"u",function(){return I}),e.d(n,"v",function(){return J}),e.d(n,"w",function(){return K}),e.d(n,"x",function(){return nt}),e.d(n,"z",function(){return et}),e.d(n,"A",function(){return rt}),e.d(n,"y",function(){return ot}),e.d(n,"b",function(){return at}),e.d(n,"f",function(){return ft}),e.d(n,"h",function(){return st}),e.d(n,"a",function(){return ct}),e.d(n,"g",function(){return ht}),e.d(n,"d",function(){return dt}),e.d(n,"c",function(){return gt}),e.d(n,"e",function(){return pt}),e.d(n,"s",function(){return mt})},62:function(t,n,e){"use strict";var r,o=function(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]},i=function(t){return(t=o(Math.abs(t)))?t[1]:NaN},a=function(t,n){var e=o(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},s={"":function(t,n){t:for(var e,r=(t=t.toPrecision(n)).length,o=1,i=-1;o0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t},"%":function(t,n){return(100*t).toFixed(n)},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,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return a(100*t,n)},r:a,s:function(t,n){var e=o(t,n);if(!e)return t+"";var i=e[0],a=e[1],s=a-(r=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,c=i.length;return s===c?i:s>c?i+new Array(s-c+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+o(t,Math.max(0,n+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},c=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;function u(t){return new f(t)}function f(t){if(!(n=c.exec(t)))throw new Error("invalid format: "+t);var n,e=n[1]||" ",r=n[2]||">",o=n[3]||"-",i=n[4]||"",a=!!n[5],u=n[6]&&+n[6],f=!!n[7],l=n[8]&&+n[8].slice(1),h=n[9]||"";"n"===h?(f=!0,h="g"):s[h]||(h=""),(a||"0"===e&&"="===r)&&(a=!0,e="0",r="="),this.fill=e,this.align=r,this.sign=o,this.symbol=i,this.zero=a,this.width=u,this.comma=f,this.precision=l,this.type=h}u.prototype=f.prototype,f.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.type};var l,h,d,g=function(t){return t},p=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],m=function(t){var n,e,o=t.grouping&&t.thousands?(n=t.grouping,e=t.thousands,function(t,r){for(var o=t.length,i=[],a=0,s=n[0],c=0;o>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),i.push(t.substring(o-=s,o+s)),!((c+=s+1)>r));)s=n[a=(a+1)%n.length];return i.reverse().join(e)}):g,a=t.currency,c=t.decimal,f=t.numerals?function(t){return function(n){return n.replace(/[0-9]/g,function(n){return t[+n]})}}(t.numerals):g,l=t.percent||"%";function h(t){var n=(t=u(t)).fill,e=t.align,i=t.sign,h=t.symbol,d=t.zero,g=t.width,m=t.comma,b=t.precision,v=t.type,y="$"===h?a[0]:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",w="$"===h?a[1]:/[%p]/.test(v)?l:"",_=s[v],x=!v||/[defgprs%]/.test(v);function A(t){var a,s,u,l=y,h=w;if("c"===v)h=_(t)+h,t="";else{var A=(t=+t)<0;if(t=_(Math.abs(t),b),A&&0==+t&&(A=!1),l=(A?"("===i?i:"-":"-"===i||"("===i?"":i)+l,h=("s"===v?p[8+r/3]:"")+h+(A&&"("===i?")":""),x)for(a=-1,s=t.length;++a(u=t.charCodeAt(a))||u>57){h=(46===u?c+t.slice(a+1):t.slice(a))+h,t=t.slice(0,a);break}}m&&!d&&(t=o(t,1/0));var M=l.length+t.length+h.length,C=M>1)+l+t+h+C.slice(M);break;default:t=C+l+t+h}return f(t)}return b=null==b?v?6:12:/[gprs]/.test(v)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b)),A.toString=function(){return t+""},A}return{format:h,formatPrefix:function(t,n){var e=h(((t=u(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(i(n)/3))),o=Math.pow(10,-r),a=p[8+r/3];return function(t){return e(o*t)+a}}}};function b(t){return l=m(t),h=l.format,d=l.formatPrefix,l}b({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var v=function(t){return Math.max(0,-i(Math.abs(t)))},y=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(i(n)/3)))-i(Math.abs(t)))},w=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,i(n)-i(t))+1};e.d(n,"b",function(){return b}),e.d(n,"a",function(){return h}),e.d(n,"d",function(){return d}),e.d(n,"c",function(){return m}),e.d(n,"e",function(){return u}),e.d(n,"f",function(){return v}),e.d(n,"g",function(){return y}),e.d(n,"h",function(){return w})},63:function(t,n,e){"use strict";var r=e(56);function o(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function i(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}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 n=t.dateTime,e=t.date,s=t.time,c=t.periods,u=t.days,f=t.shortDays,l=t.months,h=t.shortMonths,g=y(c),p=w(c),m=y(u),b=w(u),v=y(f),At=w(f),Mt=y(l),Ct=w(l),Tt=y(h),kt=w(h),St={a:function(t){return f[t.getDay()]},A:function(t){return u[t.getDay()]},b:function(t){return h[t.getMonth()]},B:function(t){return l[t.getMonth()]},c:null,d:U,e:U,f:q,H:W,I:R,j:Y,L:z,m:X,M:$,p:function(t){return c[+(t.getHours()>=12)]},Q:_t,s:xt,S:V,u:G,U:Q,V:Z,w:J,W:K,x:null,X:null,y:tt,Y:nt,Z:et,"%":wt},Ot={a:function(t){return f[t.getUTCDay()]},A:function(t){return u[t.getUTCDay()]},b:function(t){return h[t.getUTCMonth()]},B:function(t){return l[t.getUTCMonth()]},c:null,d:rt,e:rt,f:ct,H:ot,I:it,j:at,L:st,m:ut,M:ft,p:function(t){return c[+(t.getUTCHours()>=12)]},Q:_t,s:xt,S:lt,u:ht,U:dt,V:gt,w:pt,W:mt,x:null,X:null,y:bt,Y:vt,Z:yt,"%":wt},Lt={a:function(t,n,e){var r=v.exec(n.slice(e));return r?(t.w=At[r[0].toLowerCase()],e+r[0].length):-1},A:function(t,n,e){var r=m.exec(n.slice(e));return r?(t.w=b[r[0].toLowerCase()],e+r[0].length):-1},b:function(t,n,e){var r=Tt.exec(n.slice(e));return r?(t.m=kt[r[0].toLowerCase()],e+r[0].length):-1},B:function(t,n,e){var r=Mt.exec(n.slice(e));return r?(t.m=Ct[r[0].toLowerCase()],e+r[0].length):-1},c:function(t,e,r){return jt(t,n,e,r)},d:L,e:L,f:P,H:B,I:B,j:D,L:F,m:O,M:j,p:function(t,n,e){var r=g.exec(n.slice(e));return r?(t.p=p[r[0].toLowerCase()],e+r[0].length):-1},Q:H,s:I,S:N,u:x,U:A,V:M,w:_,W:C,x:function(t,n,r){return jt(t,e,n,r)},X:function(t,n,e){return jt(t,s,n,e)},y:k,Y:T,Z:S,"%":E};function Dt(t,n){return function(e){var r,o,i,a=[],s=-1,c=0,u=t.length;for(e instanceof Date||(e=new Date(+e));++s53)return null;"w"in c||(c.w=1),"Z"in c?(s=(o=i(a(c.y))).getUTCDay(),o=s>4||0===s?r.P.ceil(o):Object(r.P)(o),o=r.F.offset(o,7*(c.V-1)),c.y=o.getUTCFullYear(),c.m=o.getUTCMonth(),c.d=o.getUTCDate()+(c.w+6)%7):(s=(o=n(a(c.y))).getDay(),o=s>4||0===s?r.l.ceil(o):Object(r.l)(o),o=r.a.offset(o,7*(c.V-1)),c.y=o.getFullYear(),c.m=o.getMonth(),c.d=o.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?i(a(c.y)).getUTCDay():n(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,i(c)):n(c)}}function jt(t,n,e,r){for(var o,i,a=0,s=n.length,c=e.length;a=c)return-1;if(37===(o=n.charCodeAt(a++))){if(o=n.charAt(a++),!(i=Lt[o in d?n.charAt(a++):o])||(r=i(t,e,r))<0)return-1}else if(o!=e.charCodeAt(r++))return-1}return r}return St.x=Dt(e,St),St.X=Dt(s,St),St.c=Dt(n,St),Ot.x=Dt(e,Ot),Ot.X=Dt(s,Ot),Ot.c=Dt(n,Ot),{format:function(t){var n=Dt(t+="",St);return n.toString=function(){return t},n},parse:function(t){var n=Bt(t+="",o);return n.toString=function(){return t},n},utcFormat:function(t){var n=Dt(t+="",Ot);return n.toString=function(){return t},n},utcParse:function(t){var n=Bt(t,i);return n.toString=function(){return t},n}}}var c,u,f,l,h,d={"-":"",_:" ",0:"0"},g=/^\s*\d+/,p=/^%/,m=/[\\^$*+?|[\]().{}]/g;function b(t,n,e){var r=t<0?"-":"",o=(r?-t:t)+"",i=o.length;return r+(i68?1900:2e3),e+r[0].length):-1}function S(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function O(t,n,e){var r=g.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function L(t,n,e){var r=g.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function D(t,n,e){var r=g.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function B(t,n,e){var r=g.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function j(t,n,e){var r=g.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function N(t,n,e){var r=g.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function F(t,n,e){var r=g.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function P(t,n,e){var r=g.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function E(t,n,e){var r=p.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function H(t,n,e){var r=g.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function I(t,n,e){var r=g.exec(n.slice(e));return r?(t.Q=1e3*+r[0],e+r[0].length):-1}function U(t,n){return b(t.getDate(),n,2)}function W(t,n){return b(t.getHours(),n,2)}function R(t,n){return b(t.getHours()%12||12,n,2)}function Y(t,n){return b(1+r.a.count(Object(r.D)(t),t),n,3)}function z(t,n){return b(t.getMilliseconds(),n,3)}function q(t,n){return z(t,n)+"000"}function X(t,n){return b(t.getMonth()+1,n,2)}function $(t,n){return b(t.getMinutes(),n,2)}function V(t,n){return b(t.getSeconds(),n,2)}function G(t){var n=t.getDay();return 0===n?7:n}function Q(t,n){return b(r.t.count(Object(r.D)(t),t),n,2)}function Z(t,n){var e=t.getDay();return t=e>=4||0===e?Object(r.v)(t):r.v.ceil(t),b(r.v.count(Object(r.D)(t),t)+(4===Object(r.D)(t).getDay()),n,2)}function J(t){return t.getDay()}function K(t,n){return b(r.l.count(Object(r.D)(t),t),n,2)}function tt(t,n){return b(t.getFullYear()%100,n,2)}function nt(t,n){return b(t.getFullYear()%1e4,n,4)}function et(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+b(n/60|0,"0",2)+b(n%60,"0",2)}function rt(t,n){return b(t.getUTCDate(),n,2)}function ot(t,n){return b(t.getUTCHours(),n,2)}function it(t,n){return b(t.getUTCHours()%12||12,n,2)}function at(t,n){return b(1+r.F.count(Object(r.hb)(t),t),n,3)}function st(t,n){return b(t.getUTCMilliseconds(),n,3)}function ct(t,n){return st(t,n)+"000"}function ut(t,n){return b(t.getUTCMonth()+1,n,2)}function ft(t,n){return b(t.getUTCMinutes(),n,2)}function lt(t,n){return b(t.getUTCSeconds(),n,2)}function ht(t){var n=t.getUTCDay();return 0===n?7:n}function dt(t,n){return b(r.X.count(Object(r.hb)(t),t),n,2)}function gt(t,n){var e=t.getUTCDay();return t=e>=4||0===e?Object(r.Z)(t):r.Z.ceil(t),b(r.Z.count(Object(r.hb)(t),t)+(4===Object(r.hb)(t).getUTCDay()),n,2)}function pt(t){return t.getUTCDay()}function mt(t,n){return b(r.P.count(Object(r.hb)(t),t),n,2)}function bt(t,n){return b(t.getUTCFullYear()%100,n,2)}function vt(t,n){return b(t.getUTCFullYear()%1e4,n,4)}function yt(){return"+0000"}function wt(){return"%"}function _t(t){return+t}function xt(t){return Math.floor(+t/1e3)}function At(t){return c=s(t),u=c.format,f=c.parse,l=c.utcFormat,h=c.utcParse,c}At({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 Mt=Date.prototype.toISOString?function(t){return t.toISOString()}:l("%Y-%m-%dT%H:%M:%S.%LZ");var Ct=+new Date("2000-01-01T00:00:00.000Z")?function(t){var n=new Date(t);return isNaN(n)?null:n}:h("%Y-%m-%dT%H:%M:%S.%LZ");e.d(n,"d",function(){return At}),e.d(n,"c",function(){return u}),e.d(n,"f",function(){return f}),e.d(n,"g",function(){return l}),e.d(n,"h",function(){return h}),e.d(n,"e",function(){return s}),e.d(n,"a",function(){return Mt}),e.d(n,"b",function(){return Ct})},68:function(t,n,e){"use strict";function r(t){return+t}function o(t){return t*t}function i(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 u(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var f=function t(n){function e(t){return Math.pow(t,n)}return n=+n,e.exponent=t,e}(3),l=function t(n){function e(t){return 1-Math.pow(1-t,n)}return n=+n,e.exponent=t,e}(3),h=function t(n){function e(t){return((t*=2)<=1?Math.pow(t,n):2-Math.pow(2-t,n))/2}return n=+n,e.exponent=t,e}(3),d=Math.PI,g=d/2;function p(t){return 1-Math.cos(t*g)}function m(t){return Math.sin(t*g)}function b(t){return(1-Math.cos(d*t))/2}function v(t){return Math.pow(2,10*t-10)}function y(t){return 1-Math.pow(2,-10*t)}function w(t){return((t*=2)<=1?Math.pow(2,10*t-10):2-Math.pow(2,10-10*t))/2}function _(t){return 1-Math.sqrt(1-t*t)}function x(t){return Math.sqrt(1- --t*t)}function A(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var M=4/11,C=6/11,T=8/11,k=.75,S=9/11,O=10/11,L=.9375,D=21/22,B=63/64,j=1/M/M;function N(t){return 1-F(1-t)}function F(t){return(t=+t)=0&&y.splice(n,1)}function a(t){var n=document.createElement("style");return n.type="text/css",o(t,n),n}function c(t){var n=document.createElement("link");return n.rel="stylesheet",o(t,n),n}function s(t,n){var e,r,i;if(n.singleton){var o=v++;e=_||(_=a(n)),r=l.bind(null,e,o,!1),i=l.bind(null,e,o,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(e=c(n),r=function(t,n){var e=n.css,r=n.sourceMap;r&&(e+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var i=new Blob([e],{type:"text/css"}),o=t.href;t.href=URL.createObjectURL(i),o&&URL.revokeObjectURL(o)}.bind(null,e),i=function(){u(e),e.href&&URL.revokeObjectURL(e.href)}):(e=a(n),r=function(t,n){var e=n.css,r=n.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}.bind(null,e),i=function(){u(e)});return r(t),function(n){if(n){if(n.css===t.css&&n.media===t.media&&n.sourceMap===t.sourceMap)return;r(t=n)}else i()}}function l(t,n,e,r){var i=e?"":r.css;if(t.styleSheet)t.styleSheet.cssText=g(n,i);else{var o=document.createTextNode(i),u=t.childNodes;u[n]&&t.removeChild(u[n]),u.length?t.insertBefore(o,u[n]):t.appendChild(o)}}var f={},h=function(t){var n;return function(){return void 0===n&&(n=t.apply(this,arguments)),n}},d=h(function(){return/msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase())}),p=h(function(){return document.head||document.getElementsByTagName("head")[0]}),_=null,v=0,y=[];t.exports=function(t,n){void 0===(n=n||{}).singleton&&(n.singleton=d()),void 0===n.insertAt&&(n.insertAt="bottom");var e=i(t);return r(e,n),function(t){for(var o=[],u=0;u1}).append("line").attr("class","separator separator-double"),t.selectAll(".separator-double").style("stroke","#FFF").style("stroke-width",function(t){return 4*t.bond-5+"px"}),e.filter(function(t){return 3===t.bond}).append("line").attr("class","separator separator-triple"),t.selectAll(".separator-triple").style("stroke",function(t){return c.default.chooseColor(t,"black")}).style("stroke-width","1px"),n.exit().remove()}}},{key:"render",value:function(){var t=this;return o.default.createElement("g",{className:"links-container",ref:function(n){t.linksContainer=n}})}}]),n}();s.propTypes={links:u.default.arrayOf(u.default.object)},n.default=s},function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function t(t,n){for(var e=0;e0&&(e=i-d),E<0?f=h-p:E>0&&(o=u-p),b=N,$.attr("cursor",R.selection),et());break;default:return}T()},!0).on("keyup.brush",function(){switch(w.event.keyCode){case 16:G&&(v=y=G=!1,et());break;case 18:b===O&&(k<0?s=l:k>0&&(e=i),E<0?f=h:E>0&&(o=u),b=C,et());break;case 32:b===N&&(w.event.altKey?(k&&(s=l-d*k,e=i+d*k),E&&(f=h-p*E,o=u+p*E),b=O):(k<0?s=l:k>0&&(e=i),E<0?f=h:E>0&&(o=u),b=C),$.attr("cursor",R[x]),et());break;default:return}T()},!0).on("mousemove.brush",nt,!0).on("mouseup.brush",rt,!0);Object(m.b)(w.event.view)}S(),Object(M.b)(g),a.call(g),J.start()}function nt(){var t=Object(w.mouse)(g);!G||v||y||(Math.abs(t[0]-K[0])>Math.abs(t[1]-K[1])?y=!0:v=!0),K=t,_=!0,T(),et()}function et(){var t;switch(d=K[0]-Q[0],p=K[1]-Q[1],b){case N:case A:k&&(d=Math.max(F-e,Math.min(W-s,d)),i=e+d,l=s+d),E&&(p=Math.max(X-o,Math.min(V-f,p)),u=o+p,h=f+p);break;case C:k<0?(d=Math.max(F-e,Math.min(W-e,d)),i=e+d,l=s):k>0&&(d=Math.max(F-s,Math.min(W-s,d)),i=e,l=s+d),E<0?(p=Math.max(X-o,Math.min(V-o,p)),u=o+p,h=f):E>0&&(p=Math.max(X-f,Math.min(V-f,p)),u=o,h=f+p);break;case O:k&&(i=Math.max(F,Math.min(W,e-d*k)),l=Math.max(F,Math.min(W,s+d*k))),E&&(u=Math.max(X,Math.min(V,o-p*E)),h=Math.max(X,Math.min(V,f+p*E)))}l1e-6)if(Math.abs(l*a-c*s)>1e-6&&i){var h=e-o,d=r-u,p=a*a+c*c,_=h*h+d*d,v=Math.sqrt(p),y=Math.sqrt(f),g=i*Math.tan((ot-Math.acos((p+f-_)/(2*v*y)))/2),x=g/y,m=g/v;Math.abs(x-1)>1e-6&&(this._+="L"+(t+x*s)+","+(n+x*l)),this._+="A"+i+","+i+",0,0,"+ +(l*h>s*d)+","+(this._x1=t+m*a)+","+(this._y1=n+m*c)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,r,i,o){t=+t,n=+n;var u=(e=+e)*Math.cos(r),a=e*Math.sin(r),c=t+u,s=n+a,l=1^o,f=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+c+","+s:(Math.abs(this._x1-c)>1e-6||Math.abs(this._y1-s)>1e-6)&&(this._+="L"+c+","+s),e&&(f<0&&(f=f%ut+ut),f>at?this._+="A"+e+","+e+",0,1,"+l+","+(t-u)+","+(n-a)+"A"+e+","+e+",0,1,"+l+","+(this._x1=c)+","+(this._y1=s):f>1e-6&&(this._+="A"+e+","+e+",0,"+ +(f>=ot)+","+l+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}};var lt=st;function ft(t){return t.source}function ht(t){return t.target}function dt(t){return t.radius}function pt(t){return t.startAngle}function _t(t){return t.endAngle}var vt=function(){var t=ft,n=ht,e=dt,r=pt,i=_t,o=null;function u(){var u,a=rt.call(arguments),c=t.apply(this,a),s=n.apply(this,a),l=+e.apply(this,(a[0]=c,a)),f=r.apply(this,a)-$,h=i.apply(this,a)-$,d=l*K(f),p=l*J(f),_=+e.apply(this,(a[0]=s,a)),v=r.apply(this,a)-$,y=i.apply(this,a)-$;if(o||(o=u=lt()),o.moveTo(d,p),o.arc(0,0,l,f,h),f===v&&h===y||(o.quadraticCurveTo(0,0,_*K(v),_*J(v)),o.arc(0,0,_,v,y)),o.quadraticCurveTo(0,0,d,p),o.closePath(),u)return o=null,u+""||null}return u.radius=function(t){return arguments.length?(e="function"==typeof t?t:it(+t),u):e},u.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:it(+t),u):r},u.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:it(+t),u):i},u.source=function(n){return arguments.length?(t=n,u):t},u.target=function(t){return arguments.length?(n=t,u):n},u.context=function(t){return arguments.length?(o=null==t?null:t,u):o},u},yt=e(53),gt=e(48),xt=e(59),mt=e(68),bt=function(t,n){var e;function r(){var r,i,o=e.length,u=0,a=0;for(r=0;r=(o=(_+y)/2))?_=o:y=o,(l=e>=(u=(v+g)/2))?v=u:g=u,i=d,!(d=d[f=l<<1|s]))return i[f]=p,t;if(a=+t._x.call(null,d.data),c=+t._y.call(null,d.data),n===a&&e===c)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(s=n>=(o=(_+y)/2))?_=o:y=o,(l=e>=(u=(v+g)/2))?v=u:g=u}while((f=l<<1|s)==(h=(c>=u)<<1|a>=o));return i[h]=d,i[f]=p,t}var Et=function(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i};function St(t){return t[0]}function Tt(t){return t[1]}function At(t,n,e){var r=new Nt(null==n?St:n,null==e?Tt:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Nt(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Ct(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var Ot=At.prototype=Nt.prototype;function Pt(t){return t.x+t.vx}function zt(t){return t.y+t.vy}Ot.copy=function(){var t,n,e=new Nt(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=Ct(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=Ct(n));return e},Ot.add=function(t){var n=+this._x.call(null,t),e=+this._y.call(null,t);return kt(this.cover(n,e),n,e,t)},Ot.addAll=function(t){var n,e,r,i,o=t.length,u=new Array(o),a=new Array(o),c=1/0,s=1/0,l=-1/0,f=-1/0;for(e=0;el&&(l=r),if&&(f=i));for(lt||t>i||r>n||n>o))return this;var u,a,c=i-e,s=this._root;switch(a=(n<(r+o)/2)<<1|t<(e+i)/2){case 0:do{(u=new Array(4))[a]=s,s=u}while(o=r+(c*=2),t>(i=e+c)||n>o);break;case 1:do{(u=new Array(4))[a]=s,s=u}while(o=r+(c*=2),(e=i-c)>t||n>o);break;case 2:do{(u=new Array(4))[a]=s,s=u}while(r=o-(c*=2),t>(i=e+c)||r>n);break;case 3:do{(u=new Array(4))[a]=s,s=u}while(r=o-(c*=2),(e=i-c)>t||r>n)}this._root&&this._root.length&&(this._root=s)}return this._x0=e,this._y0=r,this._x1=i,this._y1=o,this},Ot.data=function(){var t=[];return this.visit(function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)}),t},Ot.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]]},Ot.find=function(t,n,e){var r,i,o,u,a,c,s,l=this._x0,f=this._y0,h=this._x1,d=this._y1,p=[],_=this._root;for(_&&p.push(new Et(_,l,f,h,d)),null==e?e=1/0:(l=t-e,f=n-e,h=t+e,d=n+e,e*=e);c=p.pop();)if(!(!(_=c.node)||(i=c.x0)>h||(o=c.y0)>d||(u=c.x1)=y)<<1|t>=v)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-s],p[p.length-1-s]=c)}else{var g=t-+this._x.call(null,_.data),x=n-+this._y.call(null,_.data),m=g*g+x*x;if(m=(a=(p+v)/2))?p=a:v=a,(l=u>=(c=(_+y)/2))?_=c:y=c,n=d,!(d=d[f=l<<1|s]))return this;if(!d.length)break;(n[f+1&3]||n[f+2&3]||n[f+3&3])&&(e=n,h=f)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[f]=i:delete n[f],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[h]=d:this._root=d),this):(this._root=i,this)},Ot.removeAll=function(t){for(var n=0,e=t.length;nc+d||is+d||oa.index){var p=c-u.x-u.vx,_=s-u.y-u.vy,v=p*p+_*_;vt.r&&(t.r=t[n].r)}function a(){if(n){var r,i,o=n.length;for(e=new Array(o),r=0;r1?(null==e?a.remove(t):a.set(t,d(e)),n):a.get(t)},find:function(n,e,r){var i,o,u,a,c,s=0,l=t.length;for(null==r?r=1/0:r*=r,s=0;s1?(s.on(t,e),n):s.on(t)}}},Ht=function(){var t,n,e,r,i=wt(-30),o=1,u=1/0,a=.81;function c(r){var i,o=t.length,u=At(t,Dt,Bt).visitAfter(l);for(e=r,i=0;i=u)){(t.data!==n||t.next)&&(0===l&&(d+=(l=Mt())*l),0===f&&(d+=(f=Mt())*f),d0?1:t<0?-1:0},yn=Math.sqrt,gn=Math.tan;function xn(t){return t>1?0:t<-1?tn:Math.acos(t)}function mn(t){return t>1?nn:t<-1?-nn:Math.asin(t)}function bn(t){return(t=_n(t/2))*t}function wn(){}function Mn(t,n){t&&En.hasOwnProperty(t.type)&&En[t.type](t,n)}var kn={Feature:function(t,n){Mn(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r=0?1:-1,i=r*e,o=ln(n=(n*=un)/2+en),u=_n(n),a=Pn*u,c=On*o+a*ln(i),s=a*r*_n(i);jn.add(sn(s,c)),Cn=t,On=o,Pn=u}var Un=function(t){return Rn.reset(),zn(t,Ln),2*Rn};function Fn(t){return[sn(t[1],t[0]),mn(t[2])]}function Yn(t){var n=t[0],e=t[1],r=ln(e);return[r*ln(n),r*_n(n),_n(e)]}function Hn(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Xn(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function Wn(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function Vn(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function Gn(t){var n=yn(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}var Qn,Kn,Jn,Zn,$n,te,ne,ee,re,ie,oe=Qt(),ue={point:ae,lineStart:se,lineEnd:le,polygonStart:function(){ue.point=fe,ue.lineStart=he,ue.lineEnd=de,oe.reset(),Ln.polygonStart()},polygonEnd:function(){Ln.polygonEnd(),ue.point=ae,ue.lineStart=se,ue.lineEnd=le,jn<0?(Qn=-(Jn=180),Kn=-(Zn=90)):oe>$t?Zn=90:oe<-$t&&(Kn=-90),ie[0]=Qn,ie[1]=Jn}};function ae(t,n){re.push(ie=[Qn=t,Jn=t]),nZn&&(Zn=n)}function ce(t,n){var e=Yn([t*un,n*un]);if(ee){var r=Xn(ee,e),i=Xn([r[1],-r[0],0],r);Gn(i),i=Fn(i);var o,u=t-$n,a=u>0?1:-1,c=i[0]*on*a,s=an(u)>180;s^(a*$nZn&&(Zn=o):s^(a*$n<(c=(c+360)%360-180)&&cZn&&(Zn=n)),s?t<$n?pe(Qn,t)>pe(Qn,Jn)&&(Jn=t):pe(t,Jn)>pe(Qn,Jn)&&(Qn=t):Jn>=Qn?(tJn&&(Jn=t)):t>$n?pe(Qn,t)>pe(Qn,Jn)&&(Jn=t):pe(t,Jn)>pe(Qn,Jn)&&(Qn=t)}else re.push(ie=[Qn=t,Jn=t]);nZn&&(Zn=n),ee=e,$n=t}function se(){ue.point=ce}function le(){ie[0]=Qn,ie[1]=Jn,ue.point=ae,ee=null}function fe(t,n){if(ee){var e=t-$n;oe.add(an(e)>180?e+(e>0?360:-360):e)}else te=t,ne=n;Ln.point(t,n),ce(t,n)}function he(){Ln.lineStart()}function de(){fe(te,ne),Ln.lineEnd(),an(oe)>$t&&(Qn=-(Jn=180)),ie[0]=Qn,ie[1]=Jn,ee=null}function pe(t,n){return(n-=t)<0?n+360:n}function _e(t,n){return t[0]-n[0]}function ve(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:npe(r[0],r[1])&&(r[1]=i[1]),pe(i[0],r[1])>pe(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(u=-1/0,n=0,r=o[e=o.length-1];n<=e;r=i,++n)i=o[n],(a=pe(r[1],i[0]))>u&&(u=a,Qn=i[0],Jn=r[1])}return re=ie=null,Qn===1/0||Kn===1/0?[[NaN,NaN],[NaN,NaN]]:[[Qn,Kn],[Jn,Zn]]},je={sphere:wn,point:Re,lineStart:Ie,lineEnd:Be,polygonStart:function(){je.lineStart=Ue,je.lineEnd=Fe},polygonEnd:function(){je.lineStart=Ie,je.lineEnd=Be}};function Re(t,n){t*=un;var e=ln(n*=un);Le(e*ln(t),e*_n(t),_n(n))}function Le(t,n,e){xe+=(t-xe)/++ye,me+=(n-me)/ye,be+=(e-be)/ye}function Ie(){je.point=qe}function qe(t,n){t*=un;var e=ln(n*=un);Ce=e*ln(t),Oe=e*_n(t),Pe=_n(n),je.point=De,Le(Ce,Oe,Pe)}function De(t,n){t*=un;var e=ln(n*=un),r=e*ln(t),i=e*_n(t),o=_n(n),u=sn(yn((u=Oe*o-Pe*i)*u+(u=Pe*r-Ce*o)*u+(u=Ce*i-Oe*r)*u),Ce*r+Oe*i+Pe*o);ge+=u,we+=u*(Ce+(Ce=r)),Me+=u*(Oe+(Oe=i)),ke+=u*(Pe+(Pe=o)),Le(Ce,Oe,Pe)}function Be(){je.point=Re}function Ue(){je.point=Ye}function Fe(){He(Ae,Ne),je.point=Re}function Ye(t,n){Ae=t,Ne=n,t*=un,n*=un,je.point=He;var e=ln(n);Ce=e*ln(t),Oe=e*_n(t),Pe=_n(n),Le(Ce,Oe,Pe)}function He(t,n){t*=un;var e=ln(n*=un),r=e*ln(t),i=e*_n(t),o=_n(n),u=Oe*o-Pe*i,a=Pe*r-Ce*o,c=Ce*i-Oe*r,s=yn(u*u+a*a+c*c),l=mn(s),f=s&&-l/s;Ee+=f*u,Se+=f*a,Te+=f*c,ge+=l,we+=l*(Ce+(Ce=r)),Me+=l*(Oe+(Oe=i)),ke+=l*(Pe+(Pe=o)),Le(Ce,Oe,Pe)}var Xe=function(t){ye=ge=xe=me=be=we=Me=ke=Ee=Se=Te=0,zn(t,je);var n=Ee,e=Se,r=Te,i=n*n+e*e+r*r;return i<1e-12&&(n=we,e=Me,r=ke,ge<$t&&(n=xe,e=me,r=be),(i=n*n+e*e+r*r)<1e-12)?[NaN,NaN]:[sn(e,n)*on,mn(r/yn(i))*on]},We=function(t){return function(){return t}},Ve=function(t,n){function e(e,r){return e=t(e,r),n(e[0],e[1])}return t.invert&&n.invert&&(e.invert=function(e,r){return(e=n.invert(e,r))&&t.invert(e[0],e[1])}),e};function Ge(t,n){return[t>tn?t-rn:t<-tn?t+rn:t,n]}function Qe(t,n,e){return(t%=rn)?n||e?Ve(Je(t),Ze(n,e)):Je(t):n||e?Ze(n,e):Ge}function Ke(t){return function(n,e){return[(n+=t)>tn?n-rn:n<-tn?n+rn:n,e]}}function Je(t){var n=Ke(t);return n.invert=Ke(-t),n}function Ze(t,n){var e=ln(t),r=_n(t),i=ln(n),o=_n(n);function u(t,n){var u=ln(n),a=ln(t)*u,c=_n(t)*u,s=_n(n),l=s*e+a*r;return[sn(c*i-l*o,a*e-s*r),mn(l*i+c*o)]}return u.invert=function(t,n){var u=ln(n),a=ln(t)*u,c=_n(t)*u,s=_n(n),l=s*i-c*o;return[sn(c*i+s*o,a*e+l*r),mn(l*e-a*r)]},u}Ge.invert=Ge;var $e=function(t){function n(n){return(n=t(n[0]*un,n[1]*un))[0]*=on,n[1]*=on,n}return t=Qe(t[0]*un,t[1]*un,t.length>2?t[2]*un:0),n.invert=function(n){return(n=t.invert(n[0]*un,n[1]*un))[0]*=on,n[1]*=on,n},n};function tr(t,n,e,r,i,o){if(e){var u=ln(n),a=_n(n),c=r*e;null==i?(i=n+r*rn,o=n-c/2):(i=nr(u,i),o=nr(u,o),(r>0?io)&&(i+=r*rn));for(var s,l=i;r>0?l>o:l1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}},ir=function(t,n){return an(t[0]-n[0])<$t&&an(t[1]-n[1])<$t};function or(t,n,e,r){this.x=t,this.z=n,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}var ur=function(t,n,e,r,i){var o,u,a=[],c=[];if(t.forEach(function(t){if(!((n=t.length-1)<=0)){var n,e,r=t[0],u=t[n];if(ir(r,u)){for(i.lineStart(),o=0;o=0;--o)i.point((l=s[o])[0],l[1]);else r(h.x,h.p.x,-1,i);h=h.p}s=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}};function ar(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r=0?1:-1,k=M*w,E=k>tn,S=p*m;if(cr.add(sn(S*M*_n(k),_*b+S*ln(k))),o+=E?w+M*rn:w,E^h>=e^g>=e){var T=Xn(Yn(f),Yn(y));Gn(T);var A=Xn(i,T);Gn(A);var N=(E^w>=0?-1:1)*mn(A[2]);(r>N||r===N&&(T[0]||T[1]))&&(u+=E^w>=0?1:-1)}}return(o<-$t||o<$t&&cr<-$t)^1&u},lr=function(t,n,e,i){return function(o){var u,a,c,s=n(o),l=rr(),f=n(l),h=!1,d={point:p,lineStart:v,lineEnd:y,polygonStart:function(){d.point=g,d.lineStart=x,d.lineEnd=m,a=[],u=[]},polygonEnd:function(){d.point=p,d.lineStart=v,d.lineEnd=y,a=Object(r.n)(a);var t=sr(u,i);a.length?(h||(o.polygonStart(),h=!0),ur(a,hr,t,e,o)):t&&(h||(o.polygonStart(),h=!0),o.lineStart(),e(null,null,1,o),o.lineEnd()),h&&(o.polygonEnd(),h=!1),a=u=null},sphere:function(){o.polygonStart(),o.lineStart(),e(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function p(n,e){t(n,e)&&o.point(n,e)}function _(t,n){s.point(t,n)}function v(){d.point=_,s.lineStart()}function y(){d.point=p,s.lineEnd()}function g(t,n){c.push([t,n]),f.point(t,n)}function x(){f.lineStart(),c=[]}function m(){g(c[0][0],c[0][1]),f.lineEnd();var t,n,e,r,i=f.clean(),s=l.result(),d=s.length;if(c.pop(),u.push(c),c=null,d)if(1&i){if((n=(e=s[0]).length-1)>0){for(h||(o.polygonStart(),h=!0),o.lineStart(),t=0;t1&&2&i&&s.push(s.pop().concat(s.shift())),a.push(s.filter(fr))}return d}};function fr(t){return t.length>1}function hr(t,n){return((t=t.x)[0]<0?t[1]-nn-$t:nn-t[1])-((n=n.x)[0]<0?n[1]-nn-$t:nn-n[1])}var dr=lr(function(){return!0},function(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(o,u){var a=o>0?tn:-tn,c=an(o-e);an(c-tn)<$t?(t.point(e,r=(r+u)/2>0?nn:-nn),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),n=0):i!==a&&c>=tn&&(an(e-i)<$t&&(e-=i*$t),an(o-a)<$t&&(o-=a*$t),r=function(t,n,e,r){var i,o,u=_n(t-e);return an(u)>$t?cn((_n(n)*(o=ln(r))*_n(e)-_n(r)*(i=ln(n))*_n(t))/(i*o*u)):(n+r)/2}(e,r,o,u),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),n=0),t.point(e=o,r=u),i=a},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}},function(t,n,e,r){var i;if(null==t)i=e*nn,r.point(-tn,i),r.point(0,i),r.point(tn,i),r.point(tn,0),r.point(tn,-i),r.point(0,-i),r.point(-tn,-i),r.point(-tn,0),r.point(-tn,i);else if(an(t[0]-n[0])>$t){var o=t[0]0,i=an(n)>$t;function o(t,e){return ln(t)*ln(e)>n}function u(t,e,r){var i=[1,0,0],o=Xn(Yn(t),Yn(e)),u=Hn(o,o),a=o[0],c=u-a*a;if(!c)return!r&&t;var s=n*u/c,l=-n*a/c,f=Xn(i,o),h=Vn(i,s);Wn(h,Vn(o,l));var d=f,p=Hn(h,d),_=Hn(d,d),v=p*p-_*(Hn(h,h)-1);if(!(v<0)){var y=yn(v),g=Vn(d,(-p-y)/_);if(Wn(g,h),g=Fn(g),!r)return g;var x,m=t[0],b=e[0],w=t[1],M=e[1];b0^g[1]<(an(g[0]-m)<$t?w:M):w<=g[1]&&g[1]<=M:k>tn^(m<=g[0]&&g[0]<=b)){var S=Vn(d,(-p+y)/_);return Wn(S,h),[g,Fn(S)]}}}function a(n,e){var i=r?t:tn-t,o=0;return n<-i?o|=1:n>i&&(o|=2),e<-i?o|=4:e>i&&(o|=8),o}return lr(o,function(t){var n,e,c,s,l;return{lineStart:function(){s=c=!1,l=1},point:function(f,h){var d,p=[f,h],_=o(f,h),v=r?_?0:a(f,h):_?a(f+(f<0?tn:-tn),h):0;if(!n&&(s=c=_)&&t.lineStart(),_!==c&&(!(d=u(n,p))||ir(n,d)||ir(p,d))&&(p[0]+=$t,p[1]+=$t,_=o(p[0],p[1])),_!==c)l=0,_?(t.lineStart(),d=u(p,n),t.point(d[0],d[1])):(d=u(n,p),t.point(d[0],d[1]),t.lineEnd()),n=d;else if(i&&n&&r^_){var y;v&e||!(y=u(p,n,!0))||(l=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!_||n&&ir(n,p)||t.point(p[0],p[1]),n=p,c=_,e=v},lineEnd:function(){c&&t.lineEnd(),n=null},clean:function(){return l|(s&&c)<<1}}},function(n,r,i,o){tr(o,t,e,i,n,r)},r?[0,-t]:[-tn,t-tn])},_r=function(t,n,e,r,i,o){var u,a=t[0],c=t[1],s=0,l=1,f=n[0]-a,h=n[1]-c;if(u=e-a,f||!(u>0)){if(u/=f,f<0){if(u0){if(u>l)return;u>s&&(s=u)}if(u=i-a,f||!(u<0)){if(u/=f,f<0){if(u>l)return;u>s&&(s=u)}else if(f>0){if(u0)){if(u/=h,h<0){if(u0){if(u>l)return;u>s&&(s=u)}if(u=o-c,h||!(u<0)){if(u/=h,h<0){if(u>l)return;u>s&&(s=u)}else if(h>0){if(u0&&(t[0]=a+s*f,t[1]=c+s*h),l<1&&(n[0]=a+l*f,n[1]=c+l*h),!0}}}}},vr=1e9,yr=-vr;function gr(t,n,e,i){function o(r,o){return t<=r&&r<=e&&n<=o&&o<=i}function u(r,o,u,c){var l=0,f=0;if(null==r||(l=a(r,u))!==(f=a(o,u))||s(r,o)<0^u>0)do{c.point(0===l||3===l?t:e,l>1?i:n)}while((l=(l+u+4)%4)!==f);else c.point(o[0],o[1])}function a(r,i){return an(r[0]-t)<$t?i>0?0:3:an(r[0]-e)<$t?i>0?2:1:an(r[1]-n)<$t?i>0?1:0:i>0?3:2}function c(t,n){return s(t.x,n.x)}function s(t,n){var e=a(t,1),r=a(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(a){var s,l,f,h,d,p,_,v,y,g,x,m=a,b=rr(),w={point:M,lineStart:function(){w.point=k,l&&l.push(f=[]);g=!0,y=!1,_=v=NaN},lineEnd:function(){s&&(k(h,d),p&&y&&b.rejoin(),s.push(b.result()));w.point=M,y&&m.lineEnd()},polygonStart:function(){m=b,s=[],l=[],x=!0},polygonEnd:function(){var n=function(){for(var n=0,e=0,r=l.length;ei&&(h-o)*(i-u)>(d-u)*(t-o)&&++n:d<=i&&(h-o)*(i-u)<(d-u)*(t-o)&&--n;return n}(),e=x&&n,o=(s=Object(r.n)(s)).length;(e||o)&&(a.polygonStart(),e&&(a.lineStart(),u(null,null,1,a),a.lineEnd()),o&&ur(s,c,n,u,a),a.polygonEnd());m=a,s=l=f=null}};function M(t,n){o(t,n)&&m.point(t,n)}function k(r,u){var a=o(r,u);if(l&&f.push([r,u]),g)h=r,d=u,p=a,g=!1,a&&(m.lineStart(),m.point(r,u));else if(a&&y)m.point(r,u);else{var c=[_=Math.max(yr,Math.min(vr,_)),v=Math.max(yr,Math.min(vr,v))],s=[r=Math.max(yr,Math.min(vr,r)),u=Math.max(yr,Math.min(vr,u))];_r(c,s,t,n,e,i)?(y||(m.lineStart(),m.point(c[0],c[1])),m.point(s[0],s[1]),a||m.lineEnd(),x=!1):a&&(m.lineStart(),m.point(r,u),x=!1)}_=r,v=u,y=a}return w}}var xr,mr,br,wr=function(){var t,n,e,r=0,i=0,o=960,u=500;return e={stream:function(e){return t&&n===e?t:t=gr(r,i,o,u)(n=e)},extent:function(a){return arguments.length?(r=+a[0][0],i=+a[0][1],o=+a[1][0],u=+a[1][1],t=n=null,e):[[r,i],[o,u]]}}},Mr=Qt(),kr={sphere:wn,point:wn,lineStart:function(){kr.point=Sr,kr.lineEnd=Er},lineEnd:wn,polygonStart:wn,polygonEnd:wn};function Er(){kr.point=kr.lineEnd=wn}function Sr(t,n){xr=t*=un,mr=_n(n*=un),br=ln(n),kr.point=Tr}function Tr(t,n){t*=un;var e=_n(n*=un),r=ln(n),i=an(t-xr),o=ln(i),u=r*_n(i),a=br*e-mr*r*o,c=mr*e+br*r*o;Mr.add(sn(yn(u*u+a*a),c)),xr=t,mr=e,br=r}var Ar=function(t){return Mr.reset(),zn(t,kr),+Mr},Nr=[null,null],Cr={type:"LineString",coordinates:Nr},Or=function(t,n){return Nr[0]=t,Nr[1]=n,Ar(Cr)},Pr={Feature:function(t,n){return jr(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r$t}).map(s)).concat(Object(r.s)(fn(u/p)*p,o,p).filter(function(t){return an(t%v)>$t}).map(l))}return g.lines=function(){return x().map(function(t){return{type:"LineString",coordinates:t}})},g.outline=function(){return{type:"Polygon",coordinates:[f(i).concat(h(a).slice(1),f(e).reverse().slice(1),h(c).reverse().slice(1))]}},g.extent=function(t){return arguments.length?g.extentMajor(t).extentMinor(t):g.extentMinor()},g.extentMajor=function(t){return arguments.length?(i=+t[0][0],e=+t[1][0],c=+t[0][1],a=+t[1][1],i>e&&(t=i,i=e,e=t),c>a&&(t=c,c=a,a=t),g.precision(y)):[[i,c],[e,a]]},g.extentMinor=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],u=+e[0][1],o=+e[1][1],n>t&&(e=n,n=t,t=e),u>o&&(e=u,u=o,o=e),g.precision(y)):[[n,u],[t,o]]},g.step=function(t){return arguments.length?g.stepMajor(t).stepMinor(t):g.stepMinor()},g.stepMajor=function(t){return arguments.length?(_=+t[0],v=+t[1],g):[_,v]},g.stepMinor=function(t){return arguments.length?(d=+t[0],p=+t[1],g):[d,p]},g.precision=function(r){return arguments.length?(y=+r,s=Ur(u,o,90),l=Fr(n,t,y),f=Ur(c,a,90),h=Fr(i,e,y),g):y},g.extentMajor([[-180,-90+$t],[180,90-$t]]).extentMinor([[-180,-80-$t],[180,80+$t]])}function Hr(){return Yr()()}var Xr,Wr,Vr,Gr,Qr=function(t,n){var e=t[0]*un,r=t[1]*un,i=n[0]*un,o=n[1]*un,u=ln(r),a=_n(r),c=ln(o),s=_n(o),l=u*ln(e),f=u*_n(e),h=c*ln(i),d=c*_n(i),p=2*mn(yn(bn(o-r)+u*c*bn(i-e))),_=_n(p),v=p?function(t){var n=_n(t*=p)/_,e=_n(p-t)/_,r=e*l+n*h,i=e*f+n*d,o=e*a+n*s;return[sn(i,r)*on,sn(o,yn(r*r+i*i))*on]}:function(){return[e*on,r*on]};return v.distance=p,v},Kr=function(t){return t},Jr=Qt(),Zr=Qt(),$r={point:wn,lineStart:wn,lineEnd:wn,polygonStart:function(){$r.lineStart=ti,$r.lineEnd=ri},polygonEnd:function(){$r.lineStart=$r.lineEnd=$r.point=wn,Jr.add(an(Zr)),Zr.reset()},result:function(){var t=Jr/2;return Jr.reset(),t}};function ti(){$r.point=ni}function ni(t,n){$r.point=ei,Xr=Vr=t,Wr=Gr=n}function ei(t,n){Zr.add(Gr*t-Vr*n),Vr=t,Gr=n}function ri(){ei(Xr,Wr)}var ii=$r,oi=1/0,ui=oi,ai=-oi,ci=ai;var si,li,fi,hi,di={point:function(t,n){tai&&(ai=t);nci&&(ci=n)},lineStart:wn,lineEnd:wn,polygonStart:wn,polygonEnd:wn,result:function(){var t=[[oi,ui],[ai,ci]];return ai=ci=-(ui=oi=1/0),t}},pi=0,_i=0,vi=0,yi=0,gi=0,xi=0,mi=0,bi=0,wi=0,Mi={point:ki,lineStart:Ei,lineEnd:Ai,polygonStart:function(){Mi.lineStart=Ni,Mi.lineEnd=Ci},polygonEnd:function(){Mi.point=ki,Mi.lineStart=Ei,Mi.lineEnd=Ai},result:function(){var t=wi?[mi/wi,bi/wi]:xi?[yi/xi,gi/xi]:vi?[pi/vi,_i/vi]:[NaN,NaN];return pi=_i=vi=yi=gi=xi=mi=bi=wi=0,t}};function ki(t,n){pi+=t,_i+=n,++vi}function Ei(){Mi.point=Si}function Si(t,n){Mi.point=Ti,ki(fi=t,hi=n)}function Ti(t,n){var e=t-fi,r=n-hi,i=yn(e*e+r*r);yi+=i*(fi+t)/2,gi+=i*(hi+n)/2,xi+=i,ki(fi=t,hi=n)}function Ai(){Mi.point=ki}function Ni(){Mi.point=Oi}function Ci(){Pi(si,li)}function Oi(t,n){Mi.point=Pi,ki(si=fi=t,li=hi=n)}function Pi(t,n){var e=t-fi,r=n-hi,i=yn(e*e+r*r);yi+=i*(fi+t)/2,gi+=i*(hi+n)/2,xi+=i,mi+=(i=hi*t-fi*n)*(fi+t),bi+=i*(hi+n),wi+=3*i,ki(fi=t,hi=n)}var zi=Mi;function ji(t){this._context=t}ji.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,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,rn)}},result:wn};var Ri,Li,Ii,qi,Di,Bi=Qt(),Ui={point:wn,lineStart:function(){Ui.point=Fi},lineEnd:function(){Ri&&Yi(Li,Ii),Ui.point=wn},polygonStart:function(){Ri=!0},polygonEnd:function(){Ri=null},result:function(){var t=+Bi;return Bi.reset(),t}};function Fi(t,n){Ui.point=Yi,Li=qi=t,Ii=Di=n}function Yi(t,n){qi-=t,Di-=n,Bi.add(yn(qi*qi+Di*Di)),qi=t,Di=n}var Hi=Ui;function Xi(){this._string=[]}function Wi(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}Xi.prototype={_radius:4.5,_circle:Wi(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,n){switch(this._point){case 0:this._string.push("M",t,",",n),this._point=1;break;case 1:this._string.push("L",t,",",n);break;default:null==this._circle&&(this._circle=Wi(this._radius)),this._string.push("M",t,",",n,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var Vi=function(t,n){var e,r,i=4.5;function o(t){return t&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),zn(t,e(r))),r.result()}return o.area=function(t){return zn(t,e(ii)),ii.result()},o.measure=function(t){return zn(t,e(Hi)),Hi.result()},o.bounds=function(t){return zn(t,e(di)),di.result()},o.centroid=function(t){return zn(t,e(zi)),zi.result()},o.projection=function(n){return arguments.length?(e=null==n?(t=null,Kr):(t=n).stream,o):t},o.context=function(t){return arguments.length?(r=null==t?(n=null,new Xi):new ji(n=t),"function"!=typeof i&&r.pointRadius(i),o):n},o.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(r.pointRadius(+t),+t),o):i},o.projection(t).context(n)},Gi=function(t){return{stream:Qi(t)}};function Qi(t){return function(n){var e=new Ki;for(var r in t)e[r]=t[r];return e.stream=n,e}}function Ki(){}function Ji(t,n,e){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),zn(e,t.stream(di)),n(di.result()),null!=r&&t.clipExtent(r),t}function Zi(t,n,e){return Ji(t,function(e){var r=n[1][0]-n[0][0],i=n[1][1]-n[0][1],o=Math.min(r/(e[1][0]-e[0][0]),i/(e[1][1]-e[0][1])),u=+n[0][0]+(r-o*(e[1][0]+e[0][0]))/2,a=+n[0][1]+(i-o*(e[1][1]+e[0][1]))/2;t.scale(150*o).translate([u,a])},e)}function $i(t,n,e){return Zi(t,[[0,0],n],e)}function to(t,n,e){return Ji(t,function(e){var r=+n,i=r/(e[1][0]-e[0][0]),o=(r-i*(e[1][0]+e[0][0]))/2,u=-i*e[0][1];t.scale(150*i).translate([o,u])},e)}function no(t,n,e){return Ji(t,function(e){var r=+n,i=r/(e[1][1]-e[0][1]),o=-i*e[0][0],u=(r-i*(e[1][1]+e[0][1]))/2;t.scale(150*i).translate([o,u])},e)}Ki.prototype={constructor:Ki,point:function(t,n){this.stream.point(t,n)},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 eo=16,ro=ln(30*un),io=function(t,n){return+n?function(t,n){function e(r,i,o,u,a,c,s,l,f,h,d,p,_,v){var y=s-r,g=l-i,x=y*y+g*g;if(x>4*n&&_--){var m=u+h,b=a+d,w=c+p,M=yn(m*m+b*b+w*w),k=mn(w/=M),E=an(an(w)-1)<$t||an(o-f)<$t?(o+f)/2:sn(b,m),S=t(E,k),T=S[0],A=S[1],N=T-r,C=A-i,O=g*N-y*C;(O*O/x>n||an((y*N+g*C)/x-.5)>.3||u*h+a*d+c*p2?t[2]%360*un:0,A()):[v*on,y*on,g*on]},E.precision=function(t){return arguments.length?(k=io(T,M=t*t),N()):yn(M)},E.fitExtent=function(t,n){return Zi(E,t,n)},E.fitSize=function(t,n){return $i(E,t,n)},E.fitWidth=function(t,n){return to(E,t,n)},E.fitHeight=function(t,n){return no(E,t,n)},function(){return n=t.apply(this,arguments),E.invert=n.invert&&S,A()}}function co(t){var n=0,e=tn/3,r=ao(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*un,e=t[1]*un):[n*on,e*on]},i}function so(t,n){var e=_n(t),r=(e+_n(n))/2;if(an(r)<$t)return function(t){var n=ln(t);function e(t,e){return[t*n,_n(e)/n]}return e.invert=function(t,e){return[t/n,mn(e*n)]},e}(t);var i=1+e*(2*r-e),o=yn(i)/r;function u(t,n){var e=yn(i-2*r*_n(n))/r;return[e*_n(t*=r),o-e*ln(t)]}return u.invert=function(t,n){var e=o-n;return[sn(t,an(e))/r*vn(e),mn((i-(t*t+e*e)*r*r)/(2*r))]},u}var lo=function(){return co(so).scale(155.424).center([0,33.6442])},fo=function(){return lo().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])};var ho=function(){var t,n,e,r,i,o,u=fo(),a=lo().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=lo().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(t,n){o=[t,n]}};function l(t){var n=t[0],u=t[1];return o=null,e.point(n,u),o||(r.point(n,u),o)||(i.point(n,u),o)}function f(){return t=n=null,l}return l.invert=function(t){var n=u.scale(),e=u.translate(),r=(t[0]-e[0])/n,i=(t[1]-e[1])/n;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?a:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:u).invert(t)},l.stream=function(e){return t&&n===e?t:(r=[u.stream(n=e),a.stream(e),c.stream(e)],i=r.length,t={point:function(t,n){for(var e=-1;++e0?n<-nn+$t&&(n=-nn+$t):n>nn-$t&&(n=nn-$t);var e=i/pn(Mo(n),r);return[e*_n(r*t),i-e*ln(r*t)]}return o.invert=function(t,n){var e=i-n,o=vn(r)*yn(t*t+e*e);return[sn(t,an(e))/r*vn(e),2*cn(pn(i/o,1/r))-nn]},o}var Eo=function(){return co(ko).scale(109.5).parallels([30,30])};function So(t,n){return[t,n]}So.invert=So;var To=function(){return uo(So).scale(152.63)};function Ao(t,n){var e=ln(t),r=t===n?_n(t):(e-ln(n))/(n-t),i=e/r+t;if(an(r)<$t)return So;function o(t,n){var e=i-n,o=r*t;return[e*_n(o),i-e*ln(o)]}return o.invert=function(t,n){var e=i-n;return[sn(t,an(e))/r*vn(e),i-vn(r)*yn(t*t+e*e)]},o}var No=function(){return co(Ao).scale(131.154).center([0,13.9389])};function Co(t,n){var e=ln(n),r=ln(t)*e;return[e*_n(t)/r,_n(n)/r]}Co.invert=_o(cn);var Oo=function(){return uo(Co).scale(144.049).clipAngle(60)};function Po(t,n,e,r){return 1===t&&1===n&&0===e&&0===r?Kr:Qi({point:function(i,o){this.stream.point(i*t+e,o*n+r)}})}var zo=function(){var t,n,e,r,i,o,u=1,a=0,c=0,s=1,l=1,f=Kr,h=null,d=Kr;function p(){return r=i=null,o}return o={stream:function(t){return r&&i===t?r:r=f(d(i=t))},postclip:function(r){return arguments.length?(d=r,h=t=n=e=null,p()):d},clipExtent:function(r){return arguments.length?(d=null==r?(h=t=n=e=null,Kr):gr(h=+r[0][0],t=+r[0][1],n=+r[1][0],e=+r[1][1]),p()):null==h?null:[[h,t],[n,e]]},scale:function(t){return arguments.length?(f=Po((u=+t)*s,u*l,a,c),p()):u},translate:function(t){return arguments.length?(f=Po(u*s,u*l,a=+t[0],c=+t[1]),p()):[a,c]},reflectX:function(t){return arguments.length?(f=Po(u*(s=t?-1:1),u*l,a,c),p()):s<0},reflectY:function(t){return arguments.length?(f=Po(u*s,u*(l=t?-1:1),a,c),p()):l<0},fitExtent:function(t,n){return Zi(o,t,n)},fitSize:function(t,n){return $i(o,t,n)},fitWidth:function(t,n){return to(o,t,n)},fitHeight:function(t,n){return no(o,t,n)}}};function jo(t,n){var e=n*n,r=e*e;return[t*(.8707-.131979*e+r*(r*(.003971*e-.001529*r)-.013791)),n*(1.007226+e*(.015085+r*(.028874*e-.044475-.005916*r)))]}jo.invert=function(t,n){var e,r=n,i=25;do{var o=r*r,u=o*o;r-=e=(r*(1.007226+o*(.015085+u*(.028874*o-.044475-.005916*u)))-n)/(1.007226+o*(.045255+u*(.259866*o-.311325-.005916*11*u)))}while(an(e)>$t&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]};var Ro=function(){return uo(jo).scale(175.295)};function Lo(t,n){return[ln(n)*_n(t),_n(n)]}Lo.invert=_o(mn);var Io=function(){return uo(Lo).scale(249.5).clipAngle(90+$t)};function qo(t,n){var e=ln(n),r=1+ln(t)*e;return[e*_n(t)/r,_n(n)/r]}qo.invert=_o(function(t){return 2*cn(t)});var Do=function(){return uo(qo).scale(250).clipAngle(142)};function Bo(t,n){return[dn(gn((nn+n)/2)),-t]}Bo.invert=function(t,n){return[-n,2*cn(hn(t))-nn]};var Uo=function(){var t=wo(Bo),n=t.center,e=t.rotate;return t.center=function(t){return arguments.length?n([-t[1],t[0]]):[(t=n())[1],-t[0]]},t.rotate=function(t){return arguments.length?e([t[0],t[1],t.length>2?t[2]+90:90]):[(t=e())[0],t[1],t[2]-90]},e([0,0,90]).scale(159.155)};function Fo(t,n){return t.parent===n.parent?1:2}function Yo(t,n){return t+n.x}function Ho(t,n){return Math.max(t,n.y)}var Xo=function(){var t=Fo,n=1,e=1,r=!1;function i(i){var o,u=0;i.eachAfter(function(n){var e=n.children;e?(n.x=function(t){return t.reduce(Yo,0)/t.length}(e),n.y=function(t){return 1+t.reduce(Ho,0)}(e)):(n.x=o?u+=t(n,o):0,n.y=0,o=n)});var a=function(t){for(var n;n=t.children;)t=n[0];return t}(i),c=function(t){for(var n;n=t.children;)t=n[n.length-1];return t}(i),s=a.x-t(a,c)/2,l=c.x+t(c,a)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*n,t.y=(i.y-t.y)*e}:function(t){t.x=(t.x-s)/(l-s)*n,t.y=(1-(i.y?t.y/i.y:1))*e})}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i};function Wo(t){var n=0,e=t.children,r=e&&e.length;if(r)for(;--r>=0;)n+=e[r].value;else n=1;t.value=n}function Vo(t,n){var e,r,i,o,u,a=new Jo(t),c=+t.value&&(a.value=t.value),s=[a];for(null==n&&(n=Go);e=s.pop();)if(c&&(e.value=+e.data.value),(i=n(e.data))&&(u=i.length))for(e.children=new Array(u),o=u-1;o>=0;--o)s.push(r=e.children[o]=new Jo(i[o])),r.parent=e,r.depth=e.depth+1;return a.eachBefore(Ko)}function Go(t){return t.children}function Qo(t){t.data=t.data.data}function Ko(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function Jo(t){this.data=t,this.depth=this.height=0,this.parent=null}Jo.prototype=Vo.prototype={constructor:Jo,count:function(){return this.eachAfter(Wo)},each:function(t){var n,e,r,i,o=this,u=[o];do{for(n=u.reverse(),u=[];o=n.pop();)if(t(o),e=o.children)for(r=0,i=e.length;r=0;--e)i.push(n[e]);return this},sum:function(t){return this.eachAfter(function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e})},sort:function(t){return this.eachBefore(function(n){n.children&&n.children.sort(t)})},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;for(t=e.pop(),n=r.pop();t===n;)i=t,t=e.pop(),n=r.pop();return i}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){var t=[];return this.each(function(n){t.push(n)}),t},leaves:function(){var t=[];return this.eachBefore(function(n){n.children||t.push(n)}),t},links:function(){var t=this,n=[];return t.each(function(e){e!==t&&n.push({source:e.parent,target:e})}),n},copy:function(){return Vo(this).eachBefore(Qo)}};var Zo=Array.prototype.slice;var $o=function(t){for(var n,e,r=0,i=(t=function(t){for(var n,e,r=t.length;r;)e=Math.random()*r--|0,n=t[r],t[r]=t[e],t[e]=n;return t}(Zo.call(t))).length,o=[];r0&&e*e>r*r+i*i}function ru(t,n){for(var e=0;ee*e+r*r}function su(t){var n=t._,e=t.next._,r=n.r+e.r,i=(n.x*e.r+e.x*n.r)/r,o=(n.y*e.r+e.y*n.r)/r;return i*i+o*o}function lu(t){this._=t,this.next=null,this.previous=null}function fu(t){if(!(i=t.length))return 0;var n,e,r,i,o,u,a,c,s,l,f;if((n=t[0]).x=0,n.y=0,!(i>1))return n.r;if(e=t[1],n.x=-e.r,e.x=n.r,e.y=0,!(i>2))return n.r+e.r;au(e,n,r=t[2]),n=new lu(n),e=new lu(e),r=new lu(r),n.next=r.previous=e,e.next=n.previous=r,r.next=e.previous=n;t:for(a=3;a0)throw new Error("cycle");return o}return e.id=function(n){return arguments.length?(t=du(n),e):t},e.parentId=function(t){return arguments.length?(n=du(t),e):n},e};function Cu(t,n){return t.parent===n.parent?1:2}function Ou(t){var n=t.children;return n?n[0]:t.t}function Pu(t){var n=t.children;return n?n[n.length-1]:t.t}function zu(t,n,e){var r=e/(n.i-t.i);n.c-=r,n.s+=e,t.c+=r,n.z+=e,n.m+=e}function ju(t,n,e){return t.a.parent===n.parent?t.a:e}function Ru(t,n){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=n}Ru.prototype=Object.create(Jo.prototype);var Lu=function(){var t=Cu,n=1,e=1,r=null;function i(i){var c=function(t){for(var n,e,r,i,o,u=new Ru(t,0),a=[u];n=a.pop();)if(r=n._.children)for(n.children=new Array(o=r.length),i=o-1;i>=0;--i)a.push(e=n.children[i]=new Ru(r[i],i)),e.parent=n;return(u.parent=new Ru(null,0)).children=[u],u}(i);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(u),r)i.eachBefore(a);else{var s=i,l=i,f=i;i.eachBefore(function(t){t.xl.x&&(l=t),t.depth>f.depth&&(f=t)});var h=s===l?1:t(s,l)/2,d=h-s.x,p=n/(l.x+h+d),_=e/(f.depth||1);i.eachBefore(function(t){t.x=(t.x+d)*p,t.y=t.depth*_})}return i}function o(n){var e=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(e){!function(t){for(var n,e=0,r=0,i=t.children,o=i.length;--o>=0;)(n=i[o]).z+=e,n.m+=e,e+=n.s+(r+=n.c)}(n);var o=(e[0].z+e[e.length-1].z)/2;i?(n.z=i.z+t(n._,i._),n.m=n.z-o):n.z=o}else i&&(n.z=i.z+t(n._,i._));n.parent.A=function(n,e,r){if(e){for(var i,o=n,u=n,a=e,c=o.parent.children[0],s=o.m,l=u.m,f=a.m,h=c.m;a=Pu(a),o=Ou(o),a&&o;)c=Ou(c),(u=Pu(u)).a=n,(i=a.z+f-o.z-s+t(a._,o._))>0&&(zu(ju(a,n,r),n,i),s+=i,l+=i),f+=a.m,s+=o.m,h+=c.m,l+=u.m;a&&!Pu(u)&&(u.t=a,u.m+=f-l),o&&!Ou(c)&&(c.t=o,c.m+=s-h,r=n)}return r}(n,i,n.parent.A||r[0])}function u(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function a(t){t.x*=n,t.y=t.depth*e}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i},Iu=function(t,n,e,r,i){for(var o,u=t.children,a=-1,c=u.length,s=t.value&&(i-e)/t.value;++ah&&(h=a),v=l*l*_,(d=Math.max(h/v,v/f))>p){l-=a;break}p=d}y.push(u={value:l,dice:c1?n:1)},e}(qu),Uu=function(){var t=Bu,n=!1,e=1,r=1,i=[0],o=pu,u=pu,a=pu,c=pu,s=pu;function l(t){return t.x0=t.y0=0,t.x1=e,t.y1=r,t.eachBefore(f),i=[0],n&&t.eachBefore(bu),t}function f(n){var e=i[n.depth],r=n.x0+e,l=n.y0+e,f=n.x1-e,h=n.y1-e;f=e-1){var l=a[n];return l.x0=i,l.y0=o,l.x1=u,void(l.y1=c)}var f=s[n],h=r/2+f,d=n+1,p=e-1;for(;d>>1;s[_]c-o){var g=(i*y+u*v)/r;t(n,d,v,i,o,g,c),t(d,e,y,g,o,u,c)}else{var x=(o*y+c*v)/r;t(n,d,v,i,o,u,x),t(d,e,y,i,x,u,c)}}(0,c,t.value,n,e,r,i)},Yu=function(t,n,e,r,i){(1&t.depth?Iu:wu)(t,n,e,r,i)},Hu=function t(n){function e(t,e,r,i,o){if((u=t._squarify)&&u.ratio===n)for(var u,a,c,s,l,f=-1,h=u.length,d=t.value;++f1?n:1)},e}(qu),Xu=function(t){for(var n,e=-1,r=t.length,i=t[r-1],o=0;++e1&&Vu(t[e[r-2]],t[e[r-1]],t[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}var Ku=function(t){if((e=t.length)<3)return null;var n,e,r=new Array(e),i=new Array(e);for(n=0;n=0;--n)s.push(t[r[o[n]][2]]);for(n=+a;na!=s>a&&u<(c-e)*(a-r)/(s-r)+e&&(l=!l),c=e,s=r;return l},Zu=function(t){for(var n,e,r=-1,i=t.length,o=t[i-1],u=o[0],a=o[1],c=0;++r=0;)if((e=t._tasks[r])&&(t._tasks[r]=null,e.abort))try{e.abort()}catch(n){}t._active=NaN,oa(t)}function oa(t){if(!t._active&&t._call){var n=t._data;t._data=void 0,t._call(t._error,n)}}function ua(t){if(null==t)t=1/0;else if(!((t=+t)>=1))throw new Error("invalid concurrency");return new na(t)}na.prototype=ua.prototype={constructor:na,defer:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("defer after await");if(null!=this._error)return this;var n=$u.call(arguments,1);return n.push(t),++this._waiting,this._tasks.push(n),ea(this),this},abort:function(){return null==this._error&&ia(this,new Error("abort")),this},await:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=function(n,e){t.apply(null,[n].concat(e))},oa(this),this},awaitAll:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=t,oa(this),this}};var aa=function(){return Math.random()},ca=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,1===arguments.length?(e=t,t=0):e-=t,function(){return n()*e+t}}return e.source=t,e}(aa),sa=function t(n){function e(t,e){var r,i;return t=null==t?0:+t,e=null==e?1:+e,function(){var o;if(null!=r)o=r,r=null;else do{r=2*n()-1,o=2*n()-1,i=r*r+o*o}while(!i||i>1);return t+e*o*Math.sqrt(-2*Math.log(i)/i)}}return e.source=t,e}(aa),la=function t(n){function e(){var t=sa.source(n).apply(this,arguments);return function(){return Math.exp(t())}}return e.source=t,e}(aa),fa=function t(n){function e(t){return function(){for(var e=0,r=0;r=200&&r<300||304===r){if(i)try{n=i.call(e,c)}catch(t){return void u.call("error",e,t)}else n=c;u.call("load",e,n)}else u.call("error",e,t)}if("undefined"==typeof XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(t)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=c.ontimeout=h:c.onreadystatechange=function(t){c.readyState>3&&h(t)},c.onprogress=function(t){u.call("progress",e,t)},e={header:function(t,n){return t=(t+"").toLowerCase(),arguments.length<2?a.get(t):(null==n?a.remove(t):a.set(t,n+""),e)},mimeType:function(t){return arguments.length?(r=null==t?null:t+"",e):r},responseType:function(t){return arguments.length?(o=t,e):o},timeout:function(t){return arguments.length?(f=+t,e):f},user:function(t){return arguments.length<1?s:(s=null==t?null:t+"",e)},password:function(t){return arguments.length<1?l:(l=null==t?null:t+"",e)},response:function(t){return i=t,e},get:function(t,n){return e.send("GET",t,n)},post:function(t,n){return e.send("POST",t,n)},send:function(n,i,h){return c.open(n,t,!0,s,l),null==r||a.has("accept")||a.set("accept",r+",*/*"),c.setRequestHeader&&a.each(function(t,n){c.setRequestHeader(n,t)}),null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=o&&(c.responseType=o),f>0&&(c.timeout=f),null==h&&"function"==typeof i&&(h=i,i=null),null!=h&&1===h.length&&(h=function(t){return function(n,e){t(null==n?e:null)}}(h)),null!=h&&e.on("error",h).on("load",function(t){h(null,t)}),u.call("beforesend",e,c),c.send(null==i?null:i),e},abort:function(){return c.abort(),e},on:function(){var t=u.on.apply(u,arguments);return t===u?e:t}},null!=n){if("function"!=typeof n)throw new Error("invalid callback: "+n);return e.get(n)}return e};var _a=function(t,n){return function(e,r){var i=pa(e).mimeType(t).response(n);if(null!=r){if("function"!=typeof r)throw new Error("invalid callback: "+r);return i.get(r)}return i}},va=_a("text/html",function(t){return document.createRange().createContextualFragment(t.responseText)}),ya=_a("application/json",function(t){return JSON.parse(t.responseText)}),ga=_a("text/plain",function(t){return t.responseText}),xa=_a("application/xml",function(t){var n=t.responseXML;if(!n)throw new Error("parse error");return n}),ma=function(t,n){return function(e,r,i){arguments.length<3&&(i=r,r=null);var o=pa(e).mimeType(t);return o.row=function(t){return arguments.length?o.response(function(t,n){return function(e){return t(e.responseText,n)}}(n,r=t)):r},o.row(r),i?o.get(i):o}};var ba=ma("text/csv",xt.c),wa=ma("text/tab-separated-values",xt.h),Ma=e(61),ka=function(t){return function(){return t}},Ea=Math.abs,Sa=Math.atan2,Ta=Math.cos,Aa=Math.max,Na=Math.min,Ca=Math.sin,Oa=Math.sqrt,Pa=1e-12,za=Math.PI,ja=za/2,Ra=2*za;function La(t){return t>=1?ja:t<=-1?-ja:Math.asin(t)}function Ia(t){return t.innerRadius}function qa(t){return t.outerRadius}function Da(t){return t.startAngle}function Ba(t){return t.endAngle}function Ua(t){return t&&t.padAngle}function Fa(t,n,e,r,i,o,u){var a=t-e,c=n-r,s=(u?o:-o)/Oa(a*a+c*c),l=s*c,f=-s*a,h=t+l,d=n+f,p=e+l,_=r+f,v=(h+p)/2,y=(d+_)/2,g=p-h,x=_-d,m=g*g+x*x,b=i-o,w=h*_-p*d,M=(x<0?-1:1)*Oa(Aa(0,b*b*m-w*w)),k=(w*x-g*M)/m,E=(-w*g-x*M)/m,S=(w*x+g*M)/m,T=(-w*g+x*M)/m,A=k-v,N=E-y,C=S-v,O=T-y;return A*A+N*N>C*C+O*O&&(k=S,E=T),{cx:k,cy:E,x01:-l,y01:-f,x11:k*(i/b-1),y11:E*(i/b-1)}}var Ya=function(){var t=Ia,n=qa,e=ka(0),r=null,i=Da,o=Ba,u=Ua,a=null;function c(){var c,s,l,f=+t.apply(this,arguments),h=+n.apply(this,arguments),d=i.apply(this,arguments)-ja,p=o.apply(this,arguments)-ja,_=Ea(p-d),v=p>d;if(a||(a=c=lt()),hPa)if(_>Ra-Pa)a.moveTo(h*Ta(d),h*Ca(d)),a.arc(0,0,h,d,p,!v),f>Pa&&(a.moveTo(f*Ta(p),f*Ca(p)),a.arc(0,0,f,p,d,v));else{var y,g,x=d,m=p,b=d,w=p,M=_,k=_,E=u.apply(this,arguments)/2,S=E>Pa&&(r?+r.apply(this,arguments):Oa(f*f+h*h)),T=Na(Ea(h-f)/2,+e.apply(this,arguments)),A=T,N=T;if(S>Pa){var C=La(S/f*Ca(E)),O=La(S/h*Ca(E));(M-=2*C)>Pa?(b+=C*=v?1:-1,w-=C):(M=0,b=w=(d+p)/2),(k-=2*O)>Pa?(x+=O*=v?1:-1,m-=O):(k=0,x=m=(d+p)/2)}var P=h*Ta(x),z=h*Ca(x),j=f*Ta(w),R=f*Ca(w);if(T>Pa){var L=h*Ta(m),I=h*Ca(m),q=f*Ta(b),D=f*Ca(b);if(_Pa?function(t,n,e,r,i,o,u,a){var c=e-t,s=r-n,l=u-i,f=a-o,h=(l*(n-o)-f*(t-i))/(f*c-l*s);return[t+h*c,n+h*s]}(P,z,q,D,L,I,j,R):[j,R],U=P-B[0],F=z-B[1],Y=L-B[0],H=I-B[1],X=1/Ca(((l=(U*Y+F*H)/(Oa(U*U+F*F)*Oa(Y*Y+H*H)))>1?0:l<-1?za:Math.acos(l))/2),W=Oa(B[0]*B[0]+B[1]*B[1]);A=Na(T,(f-W)/(X-1)),N=Na(T,(h-W)/(X+1))}}k>Pa?N>Pa?(y=Fa(q,D,P,z,h,N,v),g=Fa(L,I,j,R,h,N,v),a.moveTo(y.cx+y.x01,y.cy+y.y01),NPa&&M>Pa?A>Pa?(y=Fa(j,R,L,I,f,-A,v),g=Fa(P,z,q,D,f,-A,v),a.lineTo(y.cx+y.x01,y.cy+y.y01),A=l;--f)a.point(v[f],y[f]);a.lineEnd(),a.areaEnd()}_&&(v[s]=+t(h,s,c),y[s]=+e(h,s,c),a.point(n?+n(h,s,c):v[s],r?+r(h,s,c):y[s]))}if(d)return a=null,d+""||null}function s(){return Ga().defined(i).curve(u).context(o)}return c.x=function(e){return arguments.length?(t="function"==typeof e?e:ka(+e),n=null,c):t},c.x0=function(n){return arguments.length?(t="function"==typeof n?n:ka(+n),c):t},c.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:ka(+t),c):n},c.y=function(t){return arguments.length?(e="function"==typeof t?t:ka(+t),r=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:ka(+t),c):e},c.y1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:ka(+t),c):r},c.lineX0=c.lineY0=function(){return s().x(t).y(e)},c.lineY1=function(){return s().x(t).y(r)},c.lineX1=function(){return s().x(n).y(e)},c.defined=function(t){return arguments.length?(i="function"==typeof t?t:ka(!!t),c):i},c.curve=function(t){return arguments.length?(u=t,null!=o&&(a=u(o)),c):u},c.context=function(t){return arguments.length?(null==t?o=a=null:a=u(o=t),c):o},c},Ka=function(t,n){return nt?1:n>=t?0:NaN},Ja=function(t){return t},Za=function(){var t=Ja,n=Ka,e=null,r=ka(0),i=ka(Ra),o=ka(0);function u(u){var a,c,s,l,f,h=u.length,d=0,p=new Array(h),_=new Array(h),v=+r.apply(this,arguments),y=Math.min(Ra,Math.max(-Ra,i.apply(this,arguments)-v)),g=Math.min(Math.abs(y)/h,o.apply(this,arguments)),x=g*(y<0?-1:1);for(a=0;a0&&(d+=f);for(null!=n?p.sort(function(t,e){return n(_[t],_[e])}):null!=e&&p.sort(function(t,n){return e(u[t],u[n])}),a=0,s=d?(y-h*x)/d:0;a0?f*s:0)+x,_[c]={data:u[c],index:a,value:f,startAngle:v,endAngle:l,padAngle:g};return _}return u.value=function(n){return arguments.length?(t="function"==typeof n?n:ka(+n),u):t},u.sortValues=function(t){return arguments.length?(n=t,e=null,u):n},u.sort=function(t){return arguments.length?(e=t,n=null,u):e},u.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:ka(+t),u):r},u.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:ka(+t),u):i},u.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:ka(+t),u):o},u},$a=nc(Xa);function tc(t){this._curve=t}function nc(t){function n(n){return new tc(t(n))}return n._curve=t,n}function ec(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(nc(t)):n()._curve},t}tc.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};var rc=function(){return ec(Ga().curve($a))},ic=function(){var t=Qa().curve($a),n=t.curve,e=t.lineX0,r=t.lineX1,i=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 ec(e())},delete t.lineX0,t.lineEndAngle=function(){return ec(r())},delete t.lineX1,t.lineInnerRadius=function(){return ec(i())},delete t.lineY0,t.lineOuterRadius=function(){return ec(o())},delete t.lineY1,t.curve=function(t){return arguments.length?n(nc(t)):n()._curve},t},oc=function(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]},uc=Array.prototype.slice;function ac(t){return t.source}function cc(t){return t.target}function sc(t){var n=ac,e=cc,r=Wa,i=Va,o=null;function u(){var u,a=uc.call(arguments),c=n.apply(this,a),s=e.apply(this,a);if(o||(o=u=lt()),t(o,+r.apply(this,(a[0]=c,a)),+i.apply(this,a),+r.apply(this,(a[0]=s,a)),+i.apply(this,a)),u)return o=null,u+""||null}return u.source=function(t){return arguments.length?(n=t,u):n},u.target=function(t){return arguments.length?(e=t,u):e},u.x=function(t){return arguments.length?(r="function"==typeof t?t:ka(+t),u):r},u.y=function(t){return arguments.length?(i="function"==typeof t?t:ka(+t),u):i},u.context=function(t){return arguments.length?(o=null==t?null:t,u):o},u}function lc(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n=(n+r)/2,e,n,i,r,i)}function fc(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n,e=(e+i)/2,r,e,r,i)}function hc(t,n,e,r,i){var o=oc(n,e),u=oc(n,e=(e+i)/2),a=oc(r,e),c=oc(r,i);t.moveTo(o[0],o[1]),t.bezierCurveTo(u[0],u[1],a[0],a[1],c[0],c[1])}function dc(){return sc(lc)}function pc(){return sc(fc)}function _c(){var t=sc(hc);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}var vc={draw:function(t,n){var e=Math.sqrt(n/za);t.moveTo(e,0),t.arc(0,0,e,0,Ra)}},yc={draw:function(t,n){var e=Math.sqrt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}},gc=Math.sqrt(1/3),xc=2*gc,mc={draw:function(t,n){var e=Math.sqrt(n/xc),r=e*gc;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},bc=Math.sin(za/10)/Math.sin(7*za/10),wc=Math.sin(Ra/10)*bc,Mc=-Math.cos(Ra/10)*bc,kc={draw:function(t,n){var e=Math.sqrt(.8908130915292852*n),r=wc*e,i=Mc*e;t.moveTo(0,-e),t.lineTo(r,i);for(var o=1;o<5;++o){var u=Ra*o/5,a=Math.cos(u),c=Math.sin(u);t.lineTo(c*e,-a*e),t.lineTo(a*r-c*i,c*r+a*i)}t.closePath()}},Ec={draw:function(t,n){var e=Math.sqrt(n),r=-e/2;t.rect(r,r,e,e)}},Sc=Math.sqrt(3),Tc={draw:function(t,n){var e=-Math.sqrt(n/(3*Sc));t.moveTo(0,2*e),t.lineTo(-Sc*e,-e),t.lineTo(Sc*e,-e),t.closePath()}},Ac=Math.sqrt(3)/2,Nc=1/Math.sqrt(12),Cc=3*(Nc/2+1),Oc={draw:function(t,n){var e=Math.sqrt(n/Cc),r=e/2,i=e*Nc,o=r,u=e*Nc+e,a=-o,c=u;t.moveTo(r,i),t.lineTo(o,u),t.lineTo(a,c),t.lineTo(-.5*r-Ac*i,Ac*r+-.5*i),t.lineTo(-.5*o-Ac*u,Ac*o+-.5*u),t.lineTo(-.5*a-Ac*c,Ac*a+-.5*c),t.lineTo(-.5*r+Ac*i,-.5*i-Ac*r),t.lineTo(-.5*o+Ac*u,-.5*u-Ac*o),t.lineTo(-.5*a+Ac*c,-.5*c-Ac*a),t.closePath()}},Pc=[vc,yc,mc,Ec,kc,Tc,Oc],zc=function(){var t=ka(vc),n=ka(64),e=null;function r(){var r;if(e||(e=r=lt()),t.apply(this,arguments).draw(e,+n.apply(this,arguments)),r)return e=null,r+""||null}return r.type=function(n){return arguments.length?(t="function"==typeof n?n:ka(n),r):t},r.size=function(t){return arguments.length?(n="function"==typeof t?t:ka(+t),r):n},r.context=function(t){return arguments.length?(e=null==t?null:t,r):e},r},jc=function(){};function Rc(t,n,e){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+n)/6,(t._y0+4*t._y1+e)/6)}function Lc(t){this._context=t}Lc.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:Rc(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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);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:Rc(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var Ic=function(t){return new Lc(t)};function qc(t){this._context=t}qc.prototype={areaStart:jc,areaEnd:jc,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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:Rc(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var Dc=function(t){return new qc(t)};function Bc(t){this._context=t}Bc.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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:Rc(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var Uc=function(t){return new Bc(t)};function Fc(t,n){this._basis=new Lc(t),this._beta=n}Fc.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],o=n[0],u=t[e]-i,a=n[e]-o,c=-1;++c<=e;)r=c/e,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*u),this._beta*n[c]+(1-this._beta)*(o+r*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var Yc=function t(n){function e(t){return 1===n?new Lc(t):new Fc(t,n)}return e.beta=function(n){return t(+n)},e}(.85);function Hc(t,n,e){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-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function Xc(t,n){this._context=t,this._k=(1-n)/6}Xc.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:Hc(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:Hc(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Wc=function t(n){function e(t){return new Xc(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Vc(t,n){this._context=t,this._k=(1-n)/6}Vc.prototype={areaStart:jc,areaEnd:jc,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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Hc(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Gc=function t(n){function e(t){return new Vc(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Qc(t,n){this._context=t,this._k=(1-n)/6}Qc.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,n){switch(t=+t,n=+n,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:Hc(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Kc=function t(n){function e(t){return new Qc(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Jc(t,n,e){var r=t._x1,i=t._y1,o=t._x2,u=t._y2;if(t._l01_a>Pa){var a=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);r=(r*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>Pa){var s=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*s+t._x1*t._l23_2a-n*t._l12_2a)/l,u=(u*s+t._y1*t._l23_2a-e*t._l12_2a)/l}t._context.bezierCurveTo(r,i,o,u,t._x2,t._y2)}function Zc(t,n){this._context=t,this._alpha=n}Zc.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,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:Jc(this,t,n)}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=n}};var $c=function t(n){function e(t){return n?new Zc(t,n):new Xc(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function ts(t,n){this._context=t,this._alpha=n}ts.prototype={areaStart:jc,areaEnd:jc,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,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Jc(this,t,n)}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=n}};var ns=function t(n){function e(t){return n?new ts(t,n):new Vc(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function es(t,n){this._context=t,this._alpha=n}es.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,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,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:Jc(this,t,n)}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=n}};var rs=function t(n){function e(t){return n?new es(t,n):new Qc(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function is(t){this._context=t}is.prototype={areaStart:jc,areaEnd:jc,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}};var os=function(t){return new is(t)};function us(t){return t<0?-1:1}function as(t,n,e){var r=t._x1-t._x0,i=n-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),u=(e-t._y1)/(i||r<0&&-0),a=(o*i+u*r)/(r+i);return(us(o)+us(u))*Math.min(Math.abs(o),Math.abs(u),.5*Math.abs(a))||0}function cs(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function ss(t,n,e){var r=t._x0,i=t._y0,o=t._x1,u=t._y1,a=(o-r)/3;t._context.bezierCurveTo(r+a,i+a*n,o-a,u-a*e,o,u)}function ls(t){this._context=t}function fs(t){this._context=new hs(t)}function hs(t){this._context=t}function ds(t){return new ls(t)}function ps(t){return new fs(t)}function _s(t){this._context=t}function vs(t){var n,e,r=t.length-1,i=new Array(r),o=new Array(r),u=new Array(r);for(i[0]=0,o[0]=2,u[0]=t[0]+2*t[1],n=1;n=0;--n)i[n]=(u[n]-i[n+1])/o[n];for(o[r-1]=(t[r]+i[r-1])/2,n=0;n=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}};var xs=function(t){return new gs(t,.5)};function ms(t){return new gs(t,0)}function bs(t){return new gs(t,1)}var ws=function(t,n){if((i=t.length)>1)for(var e,r,i,o=1,u=t[n[0]],a=u.length;o=0;)e[n]=n;return e};function ks(t,n){return t[n]}var Es=function(){var t=ka([]),n=Ms,e=ws,r=ks;function i(i){var o,u,a=t.apply(this,arguments),c=i.length,s=a.length,l=new Array(s);for(o=0;o0){for(var e,r,i,o=0,u=t[0].length;o1)for(var e,r,i,o,u,a,c=0,s=t[n[0]].length;c=0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=u,r[0]=u+=i):r[0]=o},As=function(t,n){if((e=t.length)>0){for(var e,r=0,i=t[n[0]],o=i.length;r0&&(r=(e=t[n[0]]).length)>0){for(var e,r,i,o=0,u=1;u0)){if(o/=h,h<0){if(o0){if(o>f)return;o>l&&(l=o)}if(o=r-c,h||!(o<0)){if(o/=h,h<0){if(o>f)return;o>l&&(l=o)}else if(h>0){if(o0)){if(o/=d,d<0){if(o0){if(o>f)return;o>l&&(l=o)}if(o=i-s,d||!(o<0)){if(o/=d,d<0){if(o>f)return;o>l&&(l=o)}else if(d>0){if(o0||f<1)||(l>0&&(t[0]=[c+l*h,s+l*d]),f<1&&(t[1]=[c+f*h,s+f*d]),!0)}}}}}function Ks(t,n,e,r,i){var o=t[1];if(o)return!0;var u,a,c=t[0],s=t.left,l=t.right,f=s[0],h=s[1],d=l[0],p=l[1],_=(f+d)/2,v=(h+p)/2;if(p===h){if(_=r)return;if(f>d){if(c){if(c[1]>=i)return}else c=[_,e];o=[_,i]}else{if(c){if(c[1]1)if(f>d){if(c){if(c[1]>=i)return}else c=[(e-a)/u,e];o=[(i-a)/u,i]}else{if(c){if(c[1]=r)return}else c=[n,u*n+a];o=[r,u*r+a]}else{if(c){if(c[0]=-gl)){var d=c*c+s*s,p=l*l+f*f,_=(f*d-s*p)/h,v=(c*p-l*d)/h,y=nl.pop()||new el;y.arc=t,y.site=i,y.x=_+u,y.y=(y.cy=v+a)+Math.sqrt(_*_+v*v),t.circle=y;for(var g=null,x=_l._;x;)if(y.yyl)a=a.L;else{if(!((i=o-hl(a,u))>yl)){r>-yl?(n=a.P,e=a):i>-yl?(n=a,e=a.N):n=e=a;break}if(!a.R){n=a;break}a=a.R}!function(t){pl[t.index]={site:t,halfedges:[]}}(t);var c=al(t);if(dl.insert(n,c),n||e){if(n===e)return il(n),e=al(n.site),dl.insert(c,e),c.edge=e.edge=Ws(n.site,c.site),rl(n),void rl(e);if(e){il(n),il(e);var s=n.site,l=s[0],f=s[1],h=t[0]-l,d=t[1]-f,p=e.site,_=p[0]-l,v=p[1]-f,y=2*(h*v-d*_),g=h*h+d*d,x=_*_+v*v,m=[(v*g-d*x)/y+l,(h*x-_*g)/y+f];Gs(e.edge,s,p,m),c.edge=Ws(s,t,null,m),e.edge=Ws(t,p,null,m),rl(n),rl(e)}else c.edge=Ws(n.site,c.site)}}function fl(t,n){var e=t.site,r=e[0],i=e[1],o=i-n;if(!o)return r;var u=t.P;if(!u)return-1/0;var a=(e=u.site)[0],c=e[1],s=c-n;if(!s)return a;var l=a-r,f=1/o-1/s,h=l/s;return f?(-h+Math.sqrt(h*h-2*f*(l*l/(-2*s)-c+s/2+i-o/2)))/f+r:(r+a)/2}function hl(t,n){var e=t.N;if(e)return fl(e,n);var r=t.site;return r[1]===n?r[0]:1/0}var dl,pl,_l,vl,yl=1e-6,gl=1e-12;function xl(t,n){return n[1]-t[1]||n[0]-t[0]}function ml(t,n){var e,r,i,o=t.sort(xl).pop();for(vl=[],pl=new Array(t.length),dl=new Xs,_l=new Xs;;)if(i=tl,o&&(!i||o[1]yl||Math.abs(i[0][1]-i[1][1])>yl)||delete vl[o]}(u,a,c,s),function(t,n,e,r){var i,o,u,a,c,s,l,f,h,d,p,_,v=pl.length,y=!0;for(i=0;iyl||Math.abs(_-h)>yl)&&(c.splice(a,0,vl.push(Vs(u,d,Math.abs(p-t)yl?[t,Math.abs(f-t)yl?[Math.abs(h-r)yl?[e,Math.abs(f-e)yl?[Math.abs(h-n)=a)return null;var c=t-i.site[0],s=n-i.site[1],l=c*c+s*s;do{i=o.cells[r=u],u=null,i.halfedges.forEach(function(e){var r=o.edges[e],a=r.left;if(a!==i.site&&a||(a=r.right)){var c=t-a[0],s=n-a[1],f=c*c+s*s;fr?(r+i)/2:Math.min(0,r)||Math.max(0,i),u>o?(o+u)/2:Math.min(0,o)||Math.max(0,u))}var Rl=function(){var t,n,e=Nl,r=Cl,i=jl,o=Pl,u=zl,a=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],s=250,l=b.v,f=[],h=Object(x.dispatch)("start","zoom","end"),d=500,p=150,_=0;function v(t){t.property("__zoom",Ol).on("wheel.zoom",A).on("mousedown.zoom",N).on("dblclick.zoom",C).filter(u).on("touchstart.zoom",O).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",z).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(t,n){return(n=Math.max(a[0],Math.min(a[1],n)))===t.k?t:new kl(n,t.x,t.y)}function g(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new kl(t.k,r,i)}function k(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function E(t,n,e){t.on("start.zoom",function(){S(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).end()}).tween("zoom",function(){var t=arguments,i=S(this,t),o=r.apply(this,t),u=e||k(o),a=Math.max(o[1][0]-o[0][0],o[1][1]-o[0][1]),c=this.__zoom,s="function"==typeof n?n.apply(this,t):n,f=l(c.invert(u).concat(a/c.k),s.invert(u).concat(a/s.k));return function(t){if(1===t)t=s;else{var n=f(t),e=a/n[2];t=new kl(e,u[0]-n[0]*e,u[1]-n[1]*e)}i.zoom(null,t)}})}function S(t,n){for(var e,r=0,i=f.length;r_}t.zoom("mouse",i(g(t.that.__zoom,t.mouse[0]=Object(w.mouse)(t.that),t.mouse[1]),t.extent,c))},!0).on("mouseup.zoom",function(){r.on("mousemove.zoom mouseup.zoom",null),Object(m.c)(w.event.view,t.moved),Al(),t.end()},!0),o=Object(w.mouse)(this),u=w.event.clientX,a=w.event.clientY;Object(m.b)(w.event.view),Tl(),t.mouse=[o,this.__zoom.invert(o)],Object(M.b)(this),t.start()}}function C(){if(e.apply(this,arguments)){var t=this.__zoom,n=Object(w.mouse)(this),o=t.invert(n),u=t.k*(w.event.shiftKey?.5:2),a=i(g(y(t,u),n,o),r.apply(this,arguments),c);Al(),s>0?Object(w.select)(this).transition().duration(s).call(E,a,n):Object(w.select)(this).call(v.transform,a)}}function O(){if(e.apply(this,arguments)){var n,r,i,o,u=S(this,arguments),a=w.event.changedTouches,c=a.length;for(Tl(),r=0;r0&&f.container.children[0].offsetParent&&(r.resize(),clearInterval(p))},50);this.oldModelData=this.props.modelData,this.glviewer=r}}},{key:"render",value:function(){var e=this;return s.default.createElement("div",{className:"molecule-3d",style:{width:this.props.width,height:this.props.height,position:"relative",margin:"0 auto"},ref:function(t){e.container=t}})}}]),t}();p.defaultProps={atomLabelsShown:!1,backgroundOpacity:1,backgroundColor:"#73757c",height:"500px",onRenderNewData:function(){},orbital:{},selectedAtomIds:[],selectionType:f.default.ATOM,shapes:[],labels:[],styles:{},width:"500px",outlineWidth:0,outlineColor:"#000000",nearClip:null,farClip:null},p.propTypes={atomLabelsShown:l.default.bool,backgroundColor:l.default.string,backgroundOpacity:l.default.number,height:l.default.string,modelData:l.default.shape({atoms:l.default.array,bonds:l.default.array}).isRequired,onChangeSelection:l.default.func,onRenderNewData:l.default.func,orbital:l.default.shape({cube_file:l.default.string,iso_val:l.default.number,opacity:l.default.number,positiveVolumetricColor:l.default.string,negativeVolumetricColor:l.default.string}),selectedAtomIds:l.default.arrayOf(l.default.number),selectionType:l.default.oneOf([f.default.ATOM,f.default.RESIDUE,f.default.CHAIN]),shapes:l.default.arrayOf(l.default.object),labels:l.default.arrayOf(l.default.object),styles:l.default.objectOf(l.default.object),width:l.default.string,nearClip:l.default.number,farClip:l.default.number,outlineWidth:l.default.number,outlineColor:l.default.string},t.default=p},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={ARROW:"Arrow",SPHERE:"Sphere",CYLINDER:"Cylinder"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e&&e.__esModule?e:{default:e}}(r(2));t.default=n.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw i}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(e){return e&&e.__esModule?e:{default:e}}(r(3)),i={colorStringToNumber:function(e){if(4!==e.length&&7!==e.length)return e;if("#"!==e[0])return e;var t=parseInt(e.substr(1,e.length-1),16);return isNaN(t)?e:t},getShapeSpec:function(e,t){var r=void 0;e.color&&(r=i.colorStringToNumber(e.color));var n=Object.assign({},{alpha:.8,callback:t,clickable:!1,color:65027,radius:e.radius},e,{color:r});if(e.type===o.default.ARROW)n.start=e.start,n.end=e.end;else if(e.type===o.default.SPHERE)n.center=e.center;else{if(e.type!==o.default.CYLINDER)throw new Error("Invalid shape type.");n.fromCap=!0,n.toCap=!0,n.start=e.start,n.end=e.end}return n},getLibStyle:function(e,t,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a={},s=o.visualization_type||"stick";return a[s]={},Object.entries(o).forEach(function(e){var t=n(e,2),r=t[0],o=t[1];"visualization_type"!==r&&(a[s][r]=o)}),t&&(a[s].color=2094078),"string"==typeof a[s].color&&(a[s].color=i.colorStringToNumber(a[s].color)),a}};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(8),o=function(e){return e&&e.__esModule?e:{default:e}}(r(1)),i={modelDataToCDJSON:function(e){return{m:[{a:e.atoms.map(function(e){return{l:e.elem,x:e.positions[0],y:e.positions[1],z:e.positions[2],mass:e.mass_magnitude}}),b:e.bonds.map(function(e){return{b:e.atom1_index,e:e.atom2_index,o:e.bond_order}})}]}},addSelection:function(e,t,r,n){var a=t.slice(),s=t.indexOf(r.serial),l=-1===s;return n===o.default.ATOM?(l?a.push(r.serial):a.splice(s,1),a):(l?e.forEach(function(e){i.isSameGroup(r,e,n)&&a.push(e.serial)}):a=a.filter(function(t){var o=e[t];return!i.isSameGroup(r,o,n)}),a)},isSameGroup:function(e,t,r){if(r===o.default.RESIDUE)return e.residue_index===t.residue_index;if(r===o.default.CHAIN)return e.chain===t.chain;throw new Error("selectionType must be either residue or chain")},modelDataEquivalent:function(e,t){if(!e||!t)return!1;var r=new n.Set(e.atoms.map(function(e){return e.serial})),o=new n.Set(t.atoms.map(function(e){return e.serial})),i=new n.Set(e.bonds.map(function(e){return e.atom1_index+"=>"+e.atom2_index})),a=new n.Set(t.bonds.map(function(e){return e.atom1_index+"=>"+e.atom2_index})),s=r.equals(o),l=i.equals(a);if(!s||!l)return!1;var u=new Map,c=!0,f=!1,h=void 0;try{for(var p,d=e.atoms[Symbol.iterator]();!(c=(p=d.next()).done);c=!0){var m=p.value;u.set(m.serial,m.positions||[])}}catch(e){f=!0,h=e}finally{try{!c&&d.return&&d.return()}finally{if(f)throw h}}return t.atoms.every(function(e){return u.get(e.serial).every(function(t,r){return(e.positions||[])[r]===t})})}};t.default=i},function(e,t){e.exports=r(161)},function(e,t){e.exports=r(162)},function(e,t){e.exports=r(82)},function(e,t){e.exports=r(0)},function(e,t){e.exports=r(1)}])},161:function(module,exports,__webpack_require__){(function(global){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,require,require,__WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_RESULT__,$jscomp=$jscomp||{},n,C;$jscomp.scope={},$jscomp.findInternal=function(e,t,r){e instanceof String&&(e=String(e));for(var n=e.length,o=0;otbody",e)[0]||e}function D(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function S(e){var t=Xe.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function C(e,t){var r,n;if(1===t.nodeType){if(Ce.hasData(e)){var o=Ce.access(e),i=Ce.set(t,o);if(o=o.events)for(n in delete i.handle,i.events={},o)for(i=0,r=o[n].length;it;t+=2)"margin"===r&&(i+=ie.css(e,r+Ee[t],!0,o)),n?("content"===r&&(i-=ie.css(e,"padding"+Ee[t],!0,o)),"margin"!==r&&(i-=ie.css(e,"border"+Ee[t]+"Width",!0,o))):(i+=ie.css(e,"padding"+Ee[t],!0,o),"padding"!==r&&(i+=ie.css(e,"border"+Ee[t]+"Width",!0,o)));return i}function k(e,t,r){var n=Je(e),o=M(e,t,n),i="border-box"===ie.css(e,"boxSizing",!1,n);if(Qe.test(o))return o;var a=i&&(oe.boxSizingReliable()||o===e.style[t]);return"auto"===o&&(o=e["offset"+t[0].toUpperCase()+t.slice(1)]),(o=parseFloat(o)||0)+L(e,t,r||(i?"border":"content"),a,n)+"px"}function I(e,t,r,n,o){return new I.prototype.init(e,t,r,n,o)}function O(){st&&(!1===W.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(O):e.setTimeout(O,ie.fx.interval),ie.fx.tick())}function j(){return e.setTimeout(function(){at=void 0}),at=ie.now()}function N(e,t){var r=0,n={height:e};for(t=t?1:0;4>r;r+=2-t){var o=Ee[r];n["margin"+o]=n["padding"+o]=e}return t&&(n.opacity=n.width=e),n}function F(e,t,r){for(var n,o=(P.tweeners[t]||[]).concat(P.tweeners["*"]),i=0,a=o.length;ir&&i?t:(i||a.notifyWith(e,[l,1,0]),a.resolveWith(e,[l]),!1)},l=a.promise({elem:e,props:ie.extend({},t),opts:ie.extend(!0,{specialEasing:{},easing:ie.easing._default},r),originalProperties:t,originalOptions:r,startTime:at||j(),duration:r.duration,tweens:[],createTween:function(t,r){return t=ie.Tween(e,l.opts,t,r,l.opts.specialEasing[t]||l.opts.easing),l.tweens.push(t),t},stop:function(t){var r=0,o=t?l.tweens.length:0;if(n)return this;for(n=!0;re?this[e+this.length]:this[e]},pushStack:function(e){return(e=ie.merge(this.constructor(),e)).prevObject=this,e},each:function(e){return ie.each(this,e)},map:function(e){return this.pushStack(ie.map(this,function(t,r){return e.call(t,r,t)}))},slice:function(){return this.pushStack(X.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length;return e=+e+(0>e?t:0),this.pushStack(0<=e&&eme.cacheLength&&delete t[e.shift()],t[r+" "]=n}}function n(e){return e[E]=!0,e}function o(e){var t=S.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t)}}function i(e,t){for(var r=(e=e.split("|")).length;r--;)me.attrHandle[e[r]]=t}function a(e,t){var r=t&&e,n=r&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(n)return n;if(r)for(;r=r.nextSibling;)if(r===t)return-1;return e?1:-1}function s(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function l(e){return function(t){var r=t.nodeName.toLowerCase();return("input"===r||"button"===r)&&t.type===e}}function u(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ce(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function c(e){return n(function(t){return t=+t,n(function(r,n){for(var o,i=e([],r.length,t),a=i.length;a--;)r[o=i[a]]&&(r[o]=!(n[o]=r[o]))})})}function f(e){return e&&void 0!==e.getElementsByTagName&&e}function h(){}function p(e){for(var t=0,r=e.length,n="";t+~]|[\x20\t\r\n\f])[\x20\t\r\n\f]*/,K=/=[\x20\t\r\n\f]*([^\]'"]*?)[\x20\t\r\n\f]*\]/g,Z=/:((?:\\.|[\w-]|[^\x00-\xa0])+)(?:\((('((?:\\.|[^\\'])*)'|"((?:\\.|[^\\"])*)")|((?:\\.|[^\\()[\]]|\[[\x20\t\r\n\f]*((?:\\.|[\w-]|[^\x00-\xa0])+)(?:[\x20\t\r\n\f]*([*^$|!~]?=)[\x20\t\r\n\f]*(?:'((?:\\.|[^\\'])*)'|"((?:\\.|[^\\"])*)"|((?:\\.|[\w-]|[^\x00-\xa0])+))|)[\x20\t\r\n\f]*\])*)|.*)\)|)/,Q=/^(?:\\.|[\w-]|[^\x00-\xa0])+$/,J={ID:/^#((?:\\.|[\w-]|[^\x00-\xa0])+)/,CLASS:/^\.((?:\\.|[\w-]|[^\x00-\xa0])+)/,TAG:/^((?:\\.|[\w-]|[^\x00-\xa0])+|[*])/,ATTR:/^\[[\x20\t\r\n\f]*((?:\\.|[\w-]|[^\x00-\xa0])+)(?:[\x20\t\r\n\f]*([*^$|!~]?=)[\x20\t\r\n\f]*(?:'((?:\\.|[^\\'])*)'|"((?:\\.|[^\\"])*)"|((?:\\.|[\w-]|[^\x00-\xa0])+))|)[\x20\t\r\n\f]*\]/,PSEUDO:/^:((?:\\.|[\w-]|[^\x00-\xa0])+)(?:\((('((?:\\.|[^\\'])*)'|"((?:\\.|[^\\"])*)")|((?:\\.|[^\\()[\]]|\[[\x20\t\r\n\f]*((?:\\.|[\w-]|[^\x00-\xa0])+)(?:[\x20\t\r\n\f]*([*^$|!~]?=)[\x20\t\r\n\f]*(?:'((?:\\.|[^\\'])*)'|"((?:\\.|[^\\"])*)"|((?:\\.|[\w-]|[^\x00-\xa0])+))|)[\x20\t\r\n\f]*\])*)|.*)\)|)/,CHILD:/^:(only|first|last|nth|nth-last)-(child|of-type)(?:\([\x20\t\r\n\f]*(even|odd|(([+-]|)(\d*)n|)[\x20\t\r\n\f]*(?:([+-]|)[\x20\t\r\n\f]*(\d+)|))[\x20\t\r\n\f]*\)|)/i,bool:/^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$/i,needsContext:/^[\x20\t\r\n\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\([\x20\t\r\n\f]*((?:-\d)?\d*)[\x20\t\r\n\f]*\)|)(?=[^-]|$)/i},ee=/^(?:input|select|textarea|button)$/i,te=/^h\d$/i,re=/^[^{]+\{\s*\[native \w/,ne=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,oe=/[+~]/,ie=/\\([\da-f]{1,6}[\x20\t\r\n\f]?|([\x20\t\r\n\f])|.)/gi,ae=function(e,t,r){return(e="0x"+t-65536)!=e||r?t:0>e?String.fromCharCode(e+65536):String.fromCharCode(e>>10|55296,1023&e|56320)},se=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,le=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ue=function(){pe()},ce=d(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{B.apply(R=U.call(L.childNodes),L.childNodes),R[L.childNodes.length].nodeType}catch(e){B={apply:R.length?function(e,t){q.apply(e,U.call(t))}:function(e,t){for(var r=e.length,n=0;e[r++]=t[n++];);e.length=r-1}}}var fe=t.support={},he=t.isXML=function(e){return!!(e=e&&(e.ownerDocument||e).documentElement)&&"HTML"!==e.nodeName},pe=t.setDocument=function(e){var t;return(e=e?e.ownerDocument||e:L)!==S&&9===e.nodeType&&e.documentElement?(C=(S=e).documentElement,A=!he(S),L!==S&&(t=S.defaultView)&&t.top!==t&&(t.addEventListener?t.addEventListener("unload",ue,!1):t.attachEvent&&t.attachEvent("onunload",ue)),fe.attributes=o(function(e){return e.className="i",!e.getAttribute("className")}),fe.getElementsByTagName=o(function(e){return e.appendChild(S.createComment("")),!e.getElementsByTagName("*").length}),fe.getElementsByClassName=re.test(S.getElementsByClassName),fe.getById=o(function(e){return C.appendChild(e).id=E,!S.getElementsByName||!S.getElementsByName(E).length}),fe.getById?(me.filter.ID=function(e){var t=e.replace(ie,ae);return function(e){return e.getAttribute("id")===t}},me.find.ID=function(e,t){if(void 0!==t.getElementById&&A)return(e=t.getElementById(e))?[e]:[]}):(me.filter.ID=function(e){var t=e.replace(ie,ae);return function(e){return(e=void 0!==e.getAttributeNode&&e.getAttributeNode("id"))&&e.value===t}},me.find.ID=function(e,t){if(void 0!==t.getElementById&&A){var r,n=t.getElementById(e);if(n){if((r=n.getAttributeNode("id"))&&r.value===e)return[n];var o=t.getElementsByName(e);for(t=0;n=o[t++];)if((r=n.getAttributeNode("id"))&&r.value===e)return[n]}return[]}}),me.find.TAG=fe.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):fe.qsa?t.querySelectorAll(e):void 0}:function(e,t){var r=[],n=0;if(t=t.getElementsByTagName(e),"*"===e){for(;e=t[n++];)1===e.nodeType&&r.push(e);return r}return t},me.find.CLASS=fe.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&A)return t.getElementsByClassName(e)},M=[],$=[],(fe.qsa=re.test(S.querySelectorAll))&&(o(function(e){C.appendChild(e).innerHTML="
",e.querySelectorAll("[msallowcapture^='']").length&&$.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),e.querySelectorAll("[selected]").length||$.push("\\[[\\x20\\t\\r\\n\\f]*(?:value|checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)"),e.querySelectorAll("[id~="+E+"-]").length||$.push("~="),e.querySelectorAll(":checked").length||$.push(":checked"),e.querySelectorAll("a#"+E+"+*").length||$.push(".#.+[+~]")}),o(function(e){e.innerHTML="";var t=S.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&$.push("name[\\x20\\t\\r\\n\\f]*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&$.push(":enabled",":disabled"),C.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&$.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),$.push(",.*:")})),(fe.matchesSelector=re.test(T=C.matches||C.webkitMatchesSelector||C.mozMatchesSelector||C.oMatchesSelector||C.msMatchesSelector))&&o(function(e){fe.disconnectedMatch=T.call(e,"*"),T.call(e,"[s!='']:x"),M.push("!=",":((?:\\\\.|[\\w-]|[^\0-\\xa0])+)(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|\\[[\\x20\\t\\r\\n\\f]*((?:\\\\.|[\\w-]|[^\0-\\xa0])+)(?:[\\x20\\t\\r\\n\\f]*([*^$|!~]?=)[\\x20\\t\\r\\n\\f]*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|((?:\\\\.|[\\w-]|[^\0-\\xa0])+))|)[\\x20\\t\\r\\n\\f]*\\])*)|.*)\\)|)")}),$=$.length&&new RegExp($.join("|")),M=M.length&&new RegExp(M.join("|")),z=(t=re.test(C.compareDocumentPosition))||re.test(C.contains)?function(e,t){var r=9===e.nodeType?e.documentElement:e;return e===(t=t&&t.parentNode)||!(!t||1!==t.nodeType||!(r.contains?r.contains(t):e.compareDocumentPosition&&16&e.compareDocumentPosition(t)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},F=t?function(e,t){if(e===t)return D=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!fe.sortDetached&&t.compareDocumentPosition(e)===r?e===S||e.ownerDocument===L&&z(L,e)?-1:t===S||t.ownerDocument===L&&z(L,t)?1:_?G(_,e)-G(_,t):0:4&r?-1:1)}:function(e,t){if(e===t)return D=!0,0;var r=0,n=e.parentNode,o=t.parentNode,i=[e],s=[t];if(!n||!o)return e===S?-1:t===S?1:n?-1:o?1:_?G(_,e)-G(_,t):0;if(n===o)return a(e,t);for(;e=e.parentNode;)i.unshift(e);for(e=t;e=e.parentNode;)s.unshift(e);for(;i[r]===s[r];)r++;return r?a(i[r],s[r]):i[r]===L?-1:s[r]===L?1:0},S):S};t.matches=function(e,r){return t(e,null,null,r)},t.matchesSelector=function(e,r){if((e.ownerDocument||e)!==S&&pe(e),r=r.replace(K,"='$1']"),!(!fe.matchesSelector||!A||N[r+" "]||M&&M.test(r)||$&&$.test(r)))try{var n=T.call(e,r);if(n||fe.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ie,ae),e[3]=(e[3]||e[4]||e[5]||"").replace(ie,ae),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,r=!e[6]&&e[2];return J.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":r&&Z.test(r)&&(t=ve(r,!0))&&(t=r.indexOf(")",r.length-t)-r.length)&&(e[0]=e[0].slice(0,t),e[2]=r.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ie,ae).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=O[e+" "];return t||(t=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+e+"([\\x20\\t\\r\\n\\f]|$)"),O(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,r,n){return function(o){return null==(o=t.attr(o,e))?"!="===r:!r||(o+="","="===r?o===n:"!="===r?o!==n:"^="===r?n&&0===o.indexOf(n):"*="===r?n&&-1e.nodeType)return!1;return!0},parent:function(e){return!me.pseudos.empty(e)},header:function(e){return te.test(e.nodeName)},input:function(e){return ee.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,r){return[0>r?r+t:r]}),even:c(function(e,t){for(var r=0;rr?r+t:r;0<=--t;)e.push(t);return e}),gt:c(function(e,t,r){for(r=0>r?r+t:r;++r:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,me=/^.[^:#\[\.,]*$/;ie.filter=function(e,t,r){var n=t[0];return r&&(e=":not("+e+")"),1===t.length&&1===n.nodeType?ie.find.matchesSelector(n,e)?[n]:[]:ie.find.matches(e,ie.grep(t,function(e){return 1===e.nodeType}))},ie.fn.extend({find:function(e){var t,r=this.length,n=this;if("string"!=typeof e)return this.pushStack(ie(e).filter(function(){for(t=0;t)[^>]*|#([\w-]+))$/;(ie.fn.init=function(e,t,r){if(!e)return this;if(r=r||ye,"string"==typeof e){var n="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:ve.exec(e);if(!n||!n[1]&&t)return!t||t.jquery?(t||r).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof ie?t[0]:t,ie.merge(this,ie.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:W,!0)),de.test(n[1])&&ie.isPlainObject(t))for(n in t)ie.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n])}else(e=W.getElementById(n[2]))&&(this[0]=e,this.length=1);return this}return e.nodeType?(this[0]=e,this.length=1,this):ie.isFunction(e)?void 0!==r.ready?r.ready(e):e(ie):ie.makeArray(e,this)}).prototype=ie.fn;var ye=ie(W),ge=/^(?:parents|prev(?:Until|All))/,be={children:!0,contents:!0,next:!0,prev:!0};ie.fn.extend({has:function(e){var t=ie(e,this),r=t.length;return this.filter(function(){for(var e=0;er.nodeType&&(a?-1=a&&(n!==l&&(u=void 0,c=[e]),r.rejectWith(u,c))}};t?h():(ie.Deferred.getStackHook&&(h.stackTrace=ie.Deferred.getStackHook()),e.setTimeout(h))}}var a=0;return ie.Deferred(function(e){r[0][3].add(i(0,e,ie.isFunction(o)?o:s,e.notifyWith)),r[1][3].add(i(0,e,ie.isFunction(t)?t:s)),r[2][3].add(i(0,e,ie.isFunction(n)?n:l))}).promise()},promise:function(e){return null!=e?ie.extend(e,o):o}},i={};return ie.each(r,function(e,t){var a=t[2],s=t[5];o[t[1]]=a.add,s&&a.add(function(){n=s},r[3-e][2].disable,r[0][2].lock),a.add(t[3].fire),i[t[0]]=function(){return i[t[0]+"With"](this===i?void 0:this,arguments),this},i[t[0]+"With"]=a.fireWith}),o.promise(i),t&&t.call(i,i),i},when:function(e){var t=arguments.length,r=t,n=Array(r),o=X.call(arguments),i=ie.Deferred(),a=function(e){return function(r){n[e]=this,o[e]=1=t&&(u(e,i.done(a(r)).resolve,i.reject,!t),"pending"===i.state()||ie.isFunction(o[r]&&o[r].then)))return i.then();for(;r--;)u(o[r],a(r),i.reject);return i.promise()}});var we=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;ie.Deferred.exceptionHook=function(t,r){e.console&&e.console.warn&&t&&we.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,r)},ie.readyException=function(t){e.setTimeout(function(){throw t})};var _e=ie.Deferred();ie.fn.ready=function(e){return _e.then(e).catch(function(e){ie.readyException(e)}),this},ie.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--ie.readyWait:ie.isReady)||(ie.isReady=!0,!0!==e&&0<--ie.readyWait||_e.resolveWith(W,[ie]))}}),ie.ready.then=_e.then,"complete"===W.readyState||"loading"!==W.readyState&&!W.documentElement.doScroll?e.setTimeout(ie.ready):(W.addEventListener("DOMContentLoaded",c),e.addEventListener("load",c));var De=function(e,t,r,n,o,i,a){var s=0,l=e.length,u=null==r;if("object"===ie.type(r))for(s in o=!0,r)De(e,t,s,r[s],!0,i,a);else if(void 0!==n&&(o=!0,ie.isFunction(n)||(a=!0),u&&(a?(t.call(e,n),t=null):(u=t,t=function(e,t,r){return u.call(ie(e),r)})),t))for(;s\x20\t\r\n\f]+)/i,Ne=/^$|\/(?:java|ecma)script/i,Fe={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};Fe.optgroup=Fe.option,Fe.tbody=Fe.tfoot=Fe.colgroup=Fe.caption=Fe.thead,Fe.th=Fe.td;var Pe,Re,Ve=/<|&#?\w+;/;Pe=W.createDocumentFragment().appendChild(W.createElement("div")),(Re=W.createElement("input")).setAttribute("type","radio"),Re.setAttribute("checked","checked"),Re.setAttribute("name","t"),Pe.appendChild(Re),oe.checkClone=Pe.cloneNode(!0).cloneNode(!0).lastChild.checked,Pe.innerHTML="",oe.noCloneChecked=!!Pe.cloneNode(!0).lastChild.defaultValue;var qe=W.documentElement,Be=/^key/,Ue=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ge=/^([^.]*)(?:\.(.+)|)/;ie.event={global:{},add:function(e,t,r,n,o){var i,a,s,l,u;if(s=Ce.get(e)){if(r.handler){var c=r;r=c.handler,o=c.selector}for(o&&ie.find.matchesSelector(qe,o),r.guid||(r.guid=ie.guid++),(a=s.events)||(a=s.events={}),(i=s.handle)||(i=s.handle=function(t){return void 0!==ie&&ie.event.triggered!==t.type?ie.event.dispatch.apply(e,arguments):void 0}),s=(t=(t||"").match(xe)||[""]).length;s--;){var f=Ge.exec(t[s])||[],h=l=f[1],p=(f[2]||"").split(".").sort();h&&(f=ie.event.special[h]||{},h=(o?f.delegateType:f.bindType)||h,f=ie.event.special[h]||{},l=ie.extend({type:h,origType:l,data:n,handler:r,guid:r.guid,selector:o,needsContext:o&&ie.expr.match.needsContext.test(o),namespace:p.join(".")},c),(u=a[h])||((u=a[h]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,n,p,i)||e.addEventListener&&e.addEventListener(h,i)),f.add&&(f.add.call(e,l),l.handler.guid||(l.handler.guid=r.guid)),o?u.splice(u.delegateCount++,0,l):u.push(l),ie.event.global[h]=!0)}}},remove:function(e,t,r,n,o){var i,a,s,l,u,c=Ce.hasData(e)&&Ce.get(e);if(c&&(s=c.events)){for(l=(t=(t||"").match(xe)||[""]).length;l--;){var f=Ge.exec(t[l])||[],h=u=f[1],p=(f[2]||"").split(".").sort();if(h){var d=ie.event.special[h]||{},m=s[h=(n?d.delegateType:d.bindType)||h]||[];for(f=f[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=i=m.length;i--;){var v=m[i];!o&&u!==v.origType||r&&r.guid!==v.guid||f&&!f.test(v.namespace)||n&&n!==v.selector&&("**"!==n||!v.selector)||(m.splice(i,1),v.selector&&m.delegateCount--,d.remove&&d.remove.call(e,v))}a&&!m.length&&(d.teardown&&!1!==d.teardown.call(e,p,c.handle)||ie.removeEvent(e,h,c.handle),delete s[h])}else for(h in s)ie.event.remove(e,h+t[l],r,n,!0)}ie.isEmptyObject(s)&&Ce.remove(e,"handle events")}},dispatch:function(e){var t,r,n,o=ie.event.fix(e),i=Array(arguments.length),a=(Ce.get(this,"events")||{})[o.type]||[],s=ie.event.special[o.type]||{};for(i[0]=o,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,We=/\s*$/g;ie.extend({htmlPrefilter:function(e){return e.replace(He,"<$1>")},clone:function(e,t,r){var n,o=e.cloneNode(!0),i=ie.contains(e.ownerDocument,e);if(!(oe.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ie.isXMLDoc(e))){var a=m(o),s=m(e),l=0;for(n=s.length;lie.inArray(this,e)&&(ie.cleanData(m(this)),r&&r.replaceChild(t,this))},e)}}),ie.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){ie.fn[e]=function(e){for(var r=[],n=ie(e),o=n.length-1,i=0;i<=o;i++)e=i===o?this:this.clone(!0),ie(n[i])[t](e),Z.apply(r,e.get());return this.pushStack(r)}});var Ze=/^margin/,Qe=new RegExp("^("+Te+")(?!px)[a-z%]+$","i"),Je=function(t){var r=t.ownerDocument.defaultView;return r&&r.opener||(r=e),r.getComputedStyle(t)};!function(){function t(){if(s){s.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",s.innerHTML="",qe.appendChild(a);var t=e.getComputedStyle(s);r="1%"!==t.top,i="2px"===t.marginLeft,n="4px"===t.width,s.style.marginRight="50%",o="4px"===t.marginRight,qe.removeChild(a),s=null}}var r,n,o,i,a=W.createElement("div"),s=W.createElement("div");s.style&&(s.style.backgroundClip="content-box",s.cloneNode(!0).style.backgroundClip="",oe.clearCloneStyle="content-box"===s.style.backgroundClip,a.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",a.appendChild(s),ie.extend(oe,{pixelPosition:function(){return t(),r},boxSizingReliable:function(){return t(),n},pixelMarginRight:function(){return t(),o},reliableMarginLeft:function(){return t(),i}}))}();var et=/^(none|table(?!-c[ea]).+)/,tt=/^--/,rt={position:"absolute",visibility:"hidden",display:"block"},nt={letterSpacing:"0",fontWeight:"400"},ot=["Webkit","Moz","ms"],it=W.createElement("div").style;ie.extend({cssHooks:{opacity:{get:function(e,t){if(t)return""===(e=M(e,"opacity"))?"1":e}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:"cssFloat"},style:function(e,t,r,n){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,i=ie.camelCase(t),a=tt.test(t),s=e.style;a||(t=z(i));var l=ie.cssHooks[t]||ie.cssHooks[i];if(void 0===r)return l&&"get"in l&&void 0!==(o=l.get(e,!1,n))?o:s[t];var u=typeof r;"string"===u&&(o=ze.exec(r))&&o[1]&&(r=p(e,t,o),u="number"),null!=r&&r==r&&("number"===u&&(r+=o&&o[3]||(ie.cssNumber[i]?"":"px")),oe.clearCloneStyle||""!==r||0!==t.indexOf("background")||(s[t]="inherit"),l&&"set"in l&&void 0===(r=l.set(e,r,n))||(a?s.setProperty(t,r):s[t]=r))}},css:function(e,t,r,n){var o,i=ie.camelCase(t);return tt.test(t)||(t=z(i)),(i=ie.cssHooks[t]||ie.cssHooks[i])&&"get"in i&&(o=i.get(e,!0,r)),void 0===o&&(o=M(e,t,n)),"normal"===o&&t in nt&&(o=nt[t]),""===r||r?(e=parseFloat(o),!0===r||isFinite(e)?e||0:o):o}}),ie.each(["height","width"],function(e,t){ie.cssHooks[t]={get:function(e,r,n){if(r)return!et.test(ie.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?k(e,t,n):ke(e,rt,function(){return k(e,t,n)})},set:function(e,r,n){var o,i=n&&Je(e);return(n=n&&L(e,t,n,"border-box"===ie.css(e,"boxSizing",!1,i),i))&&(o=ze.exec(r))&&"px"!==(o[3]||"px")&&(e.style[t]=r,r=ie.css(e,t)),E(e,r,n)}}}),ie.cssHooks.marginLeft=T(oe.reliableMarginLeft,function(e,t){if(t)return(parseFloat(M(e,"marginLeft"))||e.getBoundingClientRect().left-ke(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),ie.each({margin:"",padding:"",border:"Width"},function(e,t){ie.cssHooks[e+t]={expand:function(r){var n=0,o={};for(r="string"==typeof r?r.split(" "):[r];4>n;n++)o[e+Ee[n]+t]=r[n]||r[n-2]||r[0];return o}},Ze.test(e)||(ie.cssHooks[e+t].set=E)}),ie.fn.extend({css:function(e,t){return De(this,function(e,t,r){var n,o={},i=0;if(Array.isArray(t)){for(r=Je(e),n=t.length;in.indexOf(" "+o+" ")&&(n+=o+" ");s!==(n=R(n))&&r.setAttribute("class",n)}}return this},removeClass:function(e){var t,r,n,o,i,a=0;if(ie.isFunction(e))return this.each(function(t){ie(this).removeClass(e.call(this,t,V(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(xe)||[];r=this[a++];){var s=V(r);if(n=1===r.nodeType&&" "+R(s)+" "){for(i=0;o=t[i++];)for(;-1r?a:n?r:0;el.indexOf(":")&&"on"+l;if((t=t[ie.expando]?t:new ie.Event(l,"object"==typeof t&&t)).isTrigger=o?2:3,t.namespace=u.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+u.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),r=null==r?[t]:ie.makeArray(r,[t]),u=ie.event.special[l]||{},o||!u.trigger||!1!==u.trigger.apply(n,r)){if(!o&&!u.noBubble&&!ie.isWindow(n)){var h=u.delegateType||l;for(mt.test(h+l)||(c=c.parentNode);c;c=c.parentNode)s.push(c),i=c;i===(n.ownerDocument||W)&&s.push(i.defaultView||i.parentWindow||e)}for(i=0;(c=s[i++])&&!t.isPropagationStopped();)t.type=1t||304===t,n){for(var v,y,g,_,D=c,S=b,C=D.contents,A=D.dataTypes;"*"===A[0];)A.shift(),void 0===v&&(v=D.mimeType||S.getResponseHeader("Content-Type"));if(v)for(y in C)if(C[y]&&C[y].test(v)){A.unshift(y);break}if(A[0]in n)g=A[0];else{for(y in n){if(!A[0]||D.converters[y+" "+A[0]]){g=y;break}_||(_=y)}g=g||_}g?(g!==A[0]&&A.unshift(g),D=n[g]):D=void 0}e:{var $;if(v=D,y=b,g=a,S={},(C=(n=c).dataTypes.slice())[1])for(T in n.converters)S[T.toLowerCase()]=n.converters[T];for(_=C.shift();_;){n.responseFields[_]&&(y[n.responseFields[_]]=v),!M&&g&&n.dataFilter&&(v=n.dataFilter(v,n.dataType));var M=_;if(_=C.shift())if("*"===_)_=M;else if("*"!==M&&M!==_){var T=S[M+" "+_]||S["* "+_];if(!T)for($ in S)if((D=$.split(" "))[1]===_&&(T=S[M+" "+D[0]]||S["* "+D[0]])){!0===T?T=S[$]:!0!==S[$]&&(_=D[0],C.unshift(D[1]));break}if(!0!==T)if(T&&n.throws)v=T(v);else try{v=T(v)}catch(e){D={state:"parsererror",error:T?e:"No conversion from "+M+" to "+_};break e}}}D={state:"success",data:v}}if(a)if(c.ifModified&&((u=b.getResponseHeader("Last-Modified"))&&(ie.lastModified[x]=u),(u=b.getResponseHeader("etag"))&&(ie.etag[x]=u)),204===t||"HEAD"===c.type)u="nocontent";else if(304===t)u="notmodified";else{u=D.state;var z=D.data,E=D.error;a=!E}else E=u,(t||!u)&&(u="error",0>t&&(t=0));b.status=t,b.statusText=(r||u)+"",a?p.resolveWith(f,[z,u,b]):p.rejectWith(f,[b,u,E]),b.statusCode(m),m=void 0,l&&h.trigger(a?"ajaxSuccess":"ajaxError",[b,c,a?z:E]),d.fireWith(f,[b,u]),l&&(h.trigger("ajaxComplete",[b,c]),--ie.active||ie.event.trigger("ajaxStop"))}}"object"==typeof t&&(r=t,t=void 0),r=r||{};var o,i,a,s,l,u,c=ie.ajaxSetup({},r),f=c.context||c,h=c.context&&(f.nodeType||f.jquery)?ie(f):ie.event,p=ie.Deferred(),d=ie.Callbacks("once memory"),m=c.statusCode||{},v={},y={},g="canceled",b={readyState:0,getResponseHeader:function(e){var t;if(w){if(!a)for(a={};t=At.exec(i);)a[t[1].toLowerCase()]=t[2];t=a[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return w?i:null},setRequestHeader:function(e,t){return null==w&&(e=y[e.toLowerCase()]=y[e.toLowerCase()]||e,v[e]=t),this},overrideMimeType:function(e){return null==w&&(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(w)b.always(e[b.status]);else for(t in e)m[t]=[m[t],e[t]];return this},abort:function(e){return e=e||g,o&&o.abort(e),n(0,e),this}};if(p.promise(b),c.url=((t||c.url||vt.href)+"").replace(Mt,vt.protocol+"//"),c.type=r.method||r.type||c.method||c.type,c.dataTypes=(c.dataType||"*").toLowerCase().match(xe)||[""],null==c.crossDomain){t=W.createElement("a");try{t.href=c.url,t.href=t.href,c.crossDomain=Lt.protocol+"//"+Lt.host!=t.protocol+"//"+t.host}catch(e){c.crossDomain=!0}}if(c.data&&c.processData&&"string"!=typeof c.data&&(c.data=ie.param(c.data,c.traditional)),U(Tt,c,r,b),w)return b;(l=ie.event&&c.global)&&0==ie.active++&&ie.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!$t.test(c.type);var x=c.url.replace(St,"");for(u in c.hasContent?c.data&&c.processData&&0===(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&(c.data=c.data.replace(Dt,"+")):(t=c.url.slice(x.length),c.data&&(x+=(gt.test(x)?"&":"?")+c.data,delete c.data),!1===c.cache&&(x=x.replace(Ct,"$1"),t=(gt.test(x)?"&":"?")+"_="+yt+++t),c.url=x+t),c.ifModified&&(ie.lastModified[x]&&b.setRequestHeader("If-Modified-Since",ie.lastModified[x]),ie.etag[x]&&b.setRequestHeader("If-None-Match",ie.etag[x])),(c.data&&c.hasContent&&!1!==c.contentType||r.contentType)&&b.setRequestHeader("Content-Type",c.contentType),b.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+("*"!==c.dataTypes[0]?", "+Et+"; q=0.01":""):c.accepts["*"]),c.headers)b.setRequestHeader(u,c.headers[u]);if(c.beforeSend&&(!1===c.beforeSend.call(f,b,c)||w))return b.abort();if(g="abort",d.add(c.complete),b.done(c.success),b.fail(c.error),o=U(zt,c,r,b)){if(b.readyState=1,l&&h.trigger("ajaxSend",[b,c]),w)return b;c.async&&0").prop({charset:e.scriptCharset,src:e.url}).on("load error",r=function(e){t.remove(),r=null,e&&o("error"===e.type?404:200,e.type)}),W.head.appendChild(t[0])},abort:function(){r&&r()}}});var Ot=[],jt=/(=)\?(?=&|$)|\?\?/;ie.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Ot.pop()||ie.expando+"_"+yt++;return this[e]=!0,e}}),ie.ajaxPrefilter("json jsonp",function(t,r,n){var o,i=!1!==t.jsonp&&(jt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&jt.test(t.data)&&"data");if(i||"jsonp"===t.dataTypes[0]){var a=t.jsonpCallback=ie.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback;i?t[i]=t[i].replace(jt,"$1"+a):!1!==t.jsonp&&(t.url+=(gt.test(t.url)?"&":"?")+t.jsonp+"="+a),t.converters["script json"]=function(){return o||ie.error(a+" was not called"),o[0]},t.dataTypes[0]="json";var s=e[a];return e[a]=function(){o=arguments},n.always(function(){void 0===s?ie(e).removeProp(a):e[a]=s,t[a]&&(t.jsonpCallback=r.jsonpCallback,Ot.push(a)),o&&ie.isFunction(s)&&s(o[0]),o=s=void 0}),"script"}}),oe.createHTMLDocument=function(){var e=W.implementation.createHTMLDocument("").body;return e.innerHTML="
",2===e.childNodes.length}(),ie.parseHTML=function(e,t,r){if("string"!=typeof e)return[];if("boolean"==typeof t&&(r=t,t=!1),!t)if(oe.createHTMLDocument){var n=(t=W.implementation.createHTMLDocument("")).createElement("base");n.href=W.location.href,t.head.appendChild(n)}else t=W;return r=!r&&[],(n=de.exec(e))?[t.createElement(n[1])]:(n=y([e],t,r),r&&r.length&&ie(r).remove(),ie.merge([],n.childNodes))},ie.fn.load=function(e,t,r){var n,o,i=this,a=e.indexOf(" ");if(-1").append(ie.parseHTML(e)).find(s):e)}).always(r&&function(e,t){i.each(function(){r.apply(this,o||[e.responseText,t,e])})}),this},ie.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){ie.fn[t]=function(e){return this.on(t,e)}}),ie.expr.pseudos.animated=function(e){return ie.grep(ie.timers,function(t){return e===t.elem}).length},ie.offset={setOffset:function(e,t,r){var n=ie.css(e,"position"),o=ie(e),i={};"static"===n&&(e.style.position="relative");var a=o.offset(),s=ie.css(e,"top"),l=ie.css(e,"left");("absolute"===n||"fixed"===n)&&-1<(s+l).indexOf("auto")?(s=(l=o.position()).top,l=l.left):(s=parseFloat(s)||0,l=parseFloat(l)||0),ie.isFunction(t)&&(t=t.call(e,r,ie.extend({},a))),null!=t.top&&(i.top=t.top-a.top+s),null!=t.left&&(i.left=t.left-a.left+l),"using"in t?t.using.call(e,i):o.css(i)}},ie.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){ie.offset.setOffset(this,e,t)});var t;if(t=this[0]){if(!t.getClientRects().length)return{top:0,left:0};var r=t.getBoundingClientRect(),n=t.ownerDocument;return t=n.documentElement,n=n.defaultView,{top:r.top+n.pageYOffset-t.clientTop,left:r.left+n.pageXOffset-t.clientLeft}}},position:function(){if(this[0]){var e=this[0],t={top:0,left:0};if("fixed"===ie.css(e,"position"))var r=e.getBoundingClientRect();else{var n=this.offsetParent();r=this.offset(),o(n[0],"html")||(t=n.offset()),t={top:t.top+ie.css(n[0],"borderTopWidth",!0),left:t.left+ie.css(n[0],"borderLeftWidth",!0)}}return{top:r.top-t.top-ie.css(e,"marginTop",!0),left:r.left-t.left-ie.css(e,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===ie.css(e,"position");)e=e.offsetParent;return e||qe})}}),ie.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var r="pageYOffset"===t;ie.fn[e]=function(n){return De(this,function(e,n,o){if(ie.isWindow(e))var i=e;else 9===e.nodeType&&(i=e.defaultView);if(void 0===o)return i?i[t]:e[n];i?i.scrollTo(r?i.pageXOffset:o,r?o:i.pageYOffset):e[n]=o},e,n,arguments.length)}}),ie.each(["top","left"],function(e,t){ie.cssHooks[t]=T(oe.pixelPosition,function(e,r){if(r)return r=M(e,t),Qe.test(r)?ie(e).position()[t]+"px":r})}),ie.each({Height:"height",Width:"width"},function(e,t){ie.each({padding:"inner"+e,content:t,"":"outer"+e},function(r,n){ie.fn[n]=function(o,i){var a=arguments.length&&(r||"boolean"!=typeof o),s=r||(!0===o||!0===i?"margin":"border");return De(this,function(t,r,o){return ie.isWindow(t)?0===n.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(r=t.documentElement,Math.max(t.body["scroll"+e],r["scroll"+e],t.body["offset"+e],r["offset"+e],r["client"+e])):void 0===o?ie.css(t,r,s):ie.style(t,r,o,s)},t,a?o:void 0,a)}})}),ie.fn.extend({bind:function(e,t,r){return this.on(e,null,t,r)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,r,n){return this.on(t,e,r,n)},undelegate:function(e,t,r){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",r)}}),ie.holdReady=function(e){e?ie.readyWait++:ie.ready(!0)},ie.isArray=Array.isArray,ie.parseJSON=JSON.parse,ie.nodeName=o,void 0===(__WEBPACK_AMD_DEFINE_RESULT__=function(){return ie}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__=[]))||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__);var Nt=e.jQuery,Ft=e.$;return ie.noConflict=function(t){return e.$===ie&&(e.$=Ft),t&&e.jQuery===ie&&(e.jQuery=Nt),ie},t||(e.jQuery=e.$=ie),ie},"object"==typeof module.exports?module.exports=n.document?C(n,!0):function(e){if(!e.document)throw Error("jQuery requires a window with a document");return C(e)}:C(n);var $jscomp=$jscomp||{},g;$jscomp.scope={},$jscomp.ASSUME_ES5=!1,$jscomp.ASSUME_NO_NATIVE_MAP=!1,$jscomp.ASSUME_NO_NATIVE_SET=!1,$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,r){e!=Array.prototype&&e!=Object.prototype&&(e[t]=r.value)},$jscomp.getGlobal=function(e){return"undefined"!=typeof window&&window===e?e:void 0!==global&&null!=global?global:e},$jscomp.global=$jscomp.getGlobal(this),$jscomp.SYMBOL_PREFIX="jscomp_symbol_",$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){},$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)},$jscomp.symbolCounter_=0,$jscomp.Symbol=function(e){return $jscomp.SYMBOL_PREFIX+(e||"")+$jscomp.symbolCounter_++},$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var e=$jscomp.global.Symbol.iterator;e||(e=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator")),"function"!=typeof Array.prototype[e]&&$jscomp.defineProperty(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}}),$jscomp.initSymbolIterator=function(){}},$jscomp.arrayIterator=function(e){var t=0;return $jscomp.iteratorPrototype(function(){return ti)e.setUint8(t++,i>>>0&127|0);else if(2048>i)e.setUint8(t++,i>>>6&31|192),e.setUint8(t++,i>>>0&63|128);else if(65536>i)e.setUint8(t++,i>>>12&15|224),e.setUint8(t++,i>>>6&63|128),e.setUint8(t++,i>>>0&63|128);else{if(!(1114112>i))throw Error("bad codepoint "+i);e.setUint8(t++,i>>>18&7|240),e.setUint8(t++,i>>>12&63|128),e.setUint8(t++,i>>>6&63|128),e.setUint8(t++,i>>>0&63|128)}}}function r(e){for(var t=0,r=0,n=e.length;ro)t+=1;else if(2048>o)t+=2;else if(65536>o)t+=3;else{if(!(1114112>o))throw Error("bad codepoint "+o);t+=4}}return t}function n(e){var n=new ArrayBuffer(function e(t){var n=typeof t;if("string"===n){var o=r(t);if(32>o)return 1+o;if(256>o)return 2+o;if(65536>o)return 3+o;if(4294967296>o)return 5+o}if(t instanceof Uint8Array){if(256>(o=t.byteLength))return 2+o;if(65536>o)return 3+o;if(4294967296>o)return 5+o}if("number"===n){if(Math.floor(t)!==t)return 9;if(0<=t){if(128>t)return 1;if(256>t)return 2;if(65536>t)return 3;if(4294967296>t)return 5;throw Error("Number too big 0x"+t.toString(16))}if(-32<=t)return 1;if(-128<=t)return 2;if(-32768<=t)return 3;if(-2147483648<=t)return 5;throw Error("Number too small -0x"+t.toString(16).substr(1))}if("boolean"===n||null===t)return 1;if("object"===n){if(n=0,Array.isArray(t)){o=t.length;for(var i=0;io)return 1+n;if(65536>o)return 3+n;if(4294967296>o)return 5+n;throw Error("Array or object too long 0x"+o.toString(16))}throw Error("Unknown type "+n)}(e)),o=new DataView(n);return function e(n,o,i){var a=typeof n;if("string"===a){var s=r(n);if(32>s)return o.setUint8(i,160|s),t(o,i+1,n),1+s;if(256>s)return o.setUint8(i,217),o.setUint8(i+1,s),t(o,i+2,n),2+s;if(65536>s)return o.setUint8(i,218),o.setUint16(i+1,s),t(o,i+3,n),3+s;if(4294967296>s)return o.setUint8(i,219),o.setUint32(i+1,s),t(o,i+5,n),5+s}if(n instanceof Uint8Array){s=n.byteLength;var l=new Uint8Array(o.buffer);if(256>s)return o.setUint8(i,196),o.setUint8(i+1,s),l.set(n,i+2),2+s;if(65536>s)return o.setUint8(i,197),o.setUint16(i+1,s),l.set(n,i+3),3+s;if(4294967296>s)return o.setUint8(i,198),o.setUint32(i+1,s),l.set(n,i+5),5+s}if("number"===a){if(!isFinite(n))throw Error("Number not finite: "+n);if(Math.floor(n)!==n)return o.setUint8(i,203),o.setFloat64(i+1,n),9;if(0<=n){if(128>n)return o.setUint8(i,n),1;if(256>n)return o.setUint8(i,204),o.setUint8(i+1,n),2;if(65536>n)return o.setUint8(i,205),o.setUint16(i+1,n),3;if(4294967296>n)return o.setUint8(i,206),o.setUint32(i+1,n),5;throw Error("Number too big 0x"+n.toString(16))}if(-32<=n)return o.setInt8(i,n),1;if(-128<=n)return o.setUint8(i,208),o.setInt8(i+1,n),2;if(-32768<=n)return o.setUint8(i,209),o.setInt16(i+1,n),3;if(-2147483648<=n)return o.setUint8(i,210),o.setInt32(i+1,n),5;throw Error("Number too small -0x"+(-n).toString(16).substr(1))}if(null===n)return o.setUint8(i,192),1;if("boolean"===a)return o.setUint8(i,n?195:194),1;if("object"===a){if(a=0,l=Array.isArray(n))s=n.length;else{var u=Object.keys(n);s=u.length}if(16>s?(o.setUint8(i,s|(l?144:128)),a=1):65536>s?(o.setUint8(i,l?220:222),o.setUint16(i+1,s),a=3):4294967296>s&&(o.setUint8(i,l?221:223),o.setUint32(i+1,s),a=5),l)for(l=0;li&&++t;t=new Int32Array(t)}for(n=r=0;r=l;)e[c]=-32768,++c,l-=-32768;e[c]=l,++c}for(t=void 0,l=e.length,t||(t=new Uint8Array(2*l)),r=o(DataView,t),a=0;a=s&&C<=p||A>=s&&A<=p)&&t({atomIndex1:C,atomIndex2:A,bondOrder:D?D[M/2]:null});u+=1}},e.fetch=function(e,t,r){A(e,"http://mmtf.rcsb.org/v1.0/full/",t,r)},e.fetchReduced=function(e,t,r){A(e,"http://mmtf.rcsb.org/v1.0/reduced/",t,r)},e.version="v1.0.0",e.fetchUrl="http://mmtf.rcsb.org/v1.0/full/",e.fetchReducedUrl="http://mmtf.rcsb.org/v1.0/reduced/",e.encodeMsgpack=n,e.encodeMmtf=_,e.decodeMsgpack=D,e.decodeMmtf=S,Object.defineProperty(e,"__esModule",{value:!0})}(g.MMTF=g.MMTF||{}),module.exports=function e(t,r,n){function o(a,s){if(!r[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return require(a,!0);if(i)return i(a,!0);throw(s=Error("Cannot find module '"+a+"'")).code="MODULE_NOT_FOUND",s}s=r[a]={exports:{}},t[a][0].call(s.exports,function(e){var r=t[a][1][e];return o(r||e)},s,s.exports,e,t,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;at&&(e.subarray&&a||!e.subarray&&i))return String.fromCharCode.apply(null,o.shrinkBuf(e,t));for(var r="",n=0;ne;e++)s[e]=252<=e?6:248<=e?5:240<=e?4:224<=e?3:192<=e?2:1;s[254]=s[254]=1,r.string2buf=function(e){var t,r,n=e.length,i=0;for(t=0;ta?1:2048>a?2:65536>a?3:4}var l=new o.Buf8(i);for(t=r=0;ra?l[r++]=a:(2048>a?l[r++]=192|a>>>6:(65536>a?l[r++]=224|a>>>12:(l[r++]=240|a>>>18,l[r++]=128|a>>>12&63),l[r++]=128|a>>>6&63),l[r++]=128|63&a);return l},r.buf2binstring=function(e){return n(e,e.length)},r.binstring2buf=function(e){for(var t=new o.Buf8(e.length),r=0,n=t.length;ra)i[r++]=a;else{var l=s[a];if(4a?i[r++]=a:(a-=65536,i[r++]=55296|a>>10&1023,i[r++]=56320|1023&a)}}}return n(i,r)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return 0>r||0===r?t:r+s[e[r]]>t?r:t}},{"./common":1}],3:[function(e,t,r){t.exports=function(e,t,r,n){var o,i=65535&e|0;for(e=e>>>16&65535|0;0!==r;){r-=o=2e3r;r++){e=r;for(var n=0;8>n;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,o){for(r=o+r,e^=-1;o>>8^n[255&(e^t[o])];return-1^e}},{}],6:[function(e,t,r){t.exports=function(){this.os=this.xflags=this.time=this.text=0,this.extra=null,this.extra_len=0,this.comment=this.name="",this.hcrc=0,this.done=!1}},{}],7:[function(e,t,r){t.exports=function(e,t){var r=e.state,n=e.next_in,o=e.input,i=n+(e.avail_in-5),a=e.next_out,s=e.output;t=a-(t-e.avail_out);var l=a+(e.avail_out-257),u=r.dmax,c=r.wsize,f=r.whave,h=r.wnext,p=r.window,d=r.hold,m=r.bits,v=r.lencode,y=r.distcode,g=(1<m&&(d+=o[n++]<>>24;if(d>>>=w,m-=w,0==(w=x>>>16&255))s[a++]=65535&x;else{if(!(16&w)){if(0==(64&w)){x=v[(65535&x)+(d&(1<>>=w,m-=w),15>m&&(d+=o[n++]<>>=w=x>>>24,m-=w,!(16&(w=x>>>16&255))){if(0==(64&w)){x=y[(65535&x)+(d&(1<u){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=w,m-=w,x>(w=a-t)){if((w=x-w)>f&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}var D=0,S=p;if(0===h){if(D+=c-w,w<_){_-=w;do{s[a++]=p[D++]}while(--w);D=a-x,S=s}}else if(h>3,m-=_<<3,e.next_in=n,e.next_out=a,e.avail_in=n>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function o(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.total=this.check=this.dmax=this.flags=0,this.head=null,this.wnext=this.whave=this.wsize=this.wbits=0,this.window=null,this.extra=this.offset=this.length=this.bits=this.hold=0,this.distcode=this.lencode=null,this.have=this.ndist=this.nlen=this.ncode=this.distbits=this.lenbits=0,this.next=null,this.lens=new f.Buf16(320),this.work=new f.Buf16(288),this.distdyn=this.lendyn=null,this.was=this.back=this.sane=0}function i(e){if(!e||!e.state)return-2;var t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new f.Buf32(852),t.distcode=t.distdyn=new f.Buf32(592),t.sane=1,t.back=-1,0}function a(e){if(!e||!e.state)return-2;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,i(e)}function s(e,t){if(!e||!e.state)return-2;var r=e.state;if(0>t){var n=0;t=-t}else n=1+(t>>4),48>t&&(t&=15);return t&&(8>t||15_;){if(0===x)break e;x--,w+=b[g++]<<_,_+=8}if(2&a.wrap&&35615===w){a.check=0,o[0]=255&w,o[1]=w>>>8&255,a.check=p(a.check,o,2,0),_=w=0,a.mode=2;break}if(a.flags=0,a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&w)<<8)+(w>>8))%31){e.msg="incorrect header check",a.mode=30;break}if(8!=(15&w)){e.msg="unknown compression method",a.mode=30;break}_-=4;var A=8+(15&(w>>>=4));if(0===a.wbits)a.wbits=A;else if(A>a.wbits){e.msg="invalid window size",a.mode=30;break}a.dmax=1<_;){if(0===x)break e;x--,w+=b[g++]<<_,_+=8}if(a.flags=w,8!=(255&a.flags)){e.msg="unknown compression method",a.mode=30;break}if(57344&a.flags){e.msg="unknown header flags set",a.mode=30;break}a.head&&(a.head.text=w>>8&1),512&a.flags&&(o[0]=255&w,o[1]=w>>>8&255,a.check=p(a.check,o,2,0)),_=w=0,a.mode=3;case 3:for(;32>_;){if(0===x)break e;x--,w+=b[g++]<<_,_+=8}a.head&&(a.head.time=w),512&a.flags&&(o[0]=255&w,o[1]=w>>>8&255,o[2]=w>>>16&255,o[3]=w>>>24&255,a.check=p(a.check,o,4,0)),_=w=0,a.mode=4;case 4:for(;16>_;){if(0===x)break e;x--,w+=b[g++]<<_,_+=8}a.head&&(a.head.xflags=255&w,a.head.os=w>>8),512&a.flags&&(o[0]=255&w,o[1]=w>>>8&255,a.check=p(a.check,o,2,0)),_=w=0,a.mode=5;case 5:if(1024&a.flags){for(;16>_;){if(0===x)break e;x--,w+=b[g++]<<_,_+=8}a.length=w,a.head&&(a.head.extra_len=w),512&a.flags&&(o[0]=255&w,o[1]=w>>>8&255,a.check=p(a.check,o,2,0)),_=w=0}else a.head&&(a.head.extra=null);a.mode=6;case 6:if(1024&a.flags){var $=a.length;if($>x&&($=x),$&&(a.head&&(A=a.head.extra_len-a.length,a.head.extra||(a.head.extra=Array(a.head.extra_len)),f.arraySet(a.head.extra,b,g,$,A)),512&a.flags&&(a.check=p(a.check,b,$,g)),x-=$,g+=$,a.length-=$),a.length)break e}a.length=0,a.mode=7;case 7:if(2048&a.flags){if(0===x)break e;$=0;do{A=b[g+$++],a.head&&A&&65536>a.length&&(a.head.name+=String.fromCharCode(A))}while(A&&$a.length&&(a.head.comment+=String.fromCharCode(A))}while(A&&$_;){if(0===x)break e;x--,w+=b[g++]<<_,_+=8}if(w!==(65535&a.check)){e.msg="header crc mismatch",a.mode=30;break}_=w=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),e.adler=a.check=0,a.mode=12;break;case 10:for(;32>_;){if(0===x)break e;x--,w+=b[g++]<<_,_+=8}e.adler=a.check=n(w),_=w=0,a.mode=11;case 11:if(0===a.havedict)return e.next_out=s,e.avail_out=y,e.next_in=g,e.avail_in=x,a.hold=w,a.bits=_,2;e.adler=a.check=1,a.mode=12;case 12:if(5===t||6===t)break e;case 13:if(a.last){w>>>=7&_,_-=7&_,a.mode=27;break}for(;3>_;){if(0===x)break e;x--,w+=b[g++]<<_,_+=8}switch(a.last=1&w,--_,3&(w>>>=1)){case 0:a.mode=14;break;case 1:if(A=a,v){for(u=new f.Buf32(512),c=new f.Buf32(32),$=0;144>$;)A.lens[$++]=8;for(;256>$;)A.lens[$++]=9;for(;280>$;)A.lens[$++]=7;for(;288>$;)A.lens[$++]=8;for(m(1,A.lens,0,288,u,0,A.work,{bits:9}),$=0;32>$;)A.lens[$++]=5;m(2,A.lens,0,32,c,0,A.work,{bits:5}),v=!1}if(A.lencode=u,A.lenbits=9,A.distcode=c,A.distbits=5,a.mode=20,6===t){w>>>=2,_-=2;break e}break;case 2:a.mode=17;break;case 3:e.msg="invalid block type",a.mode=30}w>>>=2,_-=2;break;case 14:for(w>>>=7&_,_-=7&_;32>_;){if(0===x)break e;x--,w+=b[g++]<<_,_+=8}if((65535&w)!=(w>>>16^65535)){e.msg="invalid stored block lengths",a.mode=30;break}if(a.length=65535&w,_=w=0,a.mode=15,6===t)break e;case 15:a.mode=16;case 16:if($=a.length){if($>x&&($=x),$>y&&($=y),0===$)break e;f.arraySet(l,b,g,$,s),x-=$,g+=$,y-=$,s+=$,a.length-=$;break}a.mode=12;break;case 17:for(;14>_;){if(0===x)break e;x--,w+=b[g++]<<_,_+=8}if(a.nlen=257+(31&w),w>>>=5,_-=5,a.ndist=1+(31&w),w>>>=5,_-=5,a.ncode=4+(15&w),w>>>=4,_-=4,286_;){if(0===x)break e;x--,w+=b[g++]<<_,_+=8}a.lens[i[a.have++]]=7&w,w>>>=3,_-=3}for(;19>a.have;)a.lens[i[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,$={bits:a.lenbits},C=m(0,a.lens,0,19,a.lencode,0,a.work,$),a.lenbits=$.bits,C){e.msg="invalid code lengths set",a.mode=30;break}a.have=0,a.mode=19;case 19:for(;a.have>>24,M&=65535,$<=_)break;if(0===x)break e;x--,w+=b[g++]<<_,_+=8}if(16>M)w>>>=$,_-=$,a.lens[a.have++]=M;else{if(16===M){for(A=$+2;_>>=$,_-=$,0===a.have){e.msg="invalid bit length repeat",a.mode=30;break}A=a.lens[a.have-1],$=3+(3&w),w>>>=2,_-=2}else if(17===M){for(A=$+3;_>>=$)),w>>>=3,_-=3}else{for(A=$+7;_>>=$)),w>>>=7,_-=7}if(a.have+$>a.nlen+a.ndist){e.msg="invalid bit length repeat",a.mode=30;break}for(;$--;)a.lens[a.have++]=A}}if(30===a.mode)break;if(0===a.lens[256]){e.msg="invalid code -- missing end-of-block",a.mode=30;break}if(a.lenbits=9,$={bits:a.lenbits},C=m(1,a.lens,0,a.nlen,a.lencode,0,a.work,$),a.lenbits=$.bits,C){e.msg="invalid literal/lengths set",a.mode=30;break}if(a.distbits=6,a.distcode=a.distdyn,$={bits:a.distbits},C=m(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,$),a.distbits=$.bits,C){e.msg="invalid distances set",a.mode=30;break}if(a.mode=20,6===t)break e;case 20:a.mode=21;case 21:if(6<=x&&258<=y){e.next_out=s,e.avail_out=y,e.next_in=g,e.avail_in=x,a.hold=w,a.bits=_,d(e,S),s=e.next_out,l=e.output,y=e.avail_out,g=e.next_in,b=e.input,x=e.avail_in,w=a.hold,_=a.bits,12===a.mode&&(a.back=-1);break}for(a.back=0;M=a.lencode[w&(1<>>24,A=M>>>16&255,M&=65535,!($<=_);){if(0===x)break e;x--,w+=b[g++]<<_,_+=8}if(A&&0==(240&A)){var T=$,z=A;for(r=M;M=a.lencode[r+((w&(1<>T)],$=M>>>24,A=M>>>16&255,M&=65535,!(T+$<=_);){if(0===x)break e;x--,w+=b[g++]<<_,_+=8}w>>>=T,_-=T,a.back+=T}if(w>>>=$,_-=$,a.back+=$,a.length=M,0===A){a.mode=26;break}if(32&A){a.back=-1,a.mode=12;break}if(64&A){e.msg="invalid literal/length code",a.mode=30;break}a.extra=15&A,a.mode=22;case 22:if(a.extra){for(A=a.extra;_>>=a.extra,_-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=23;case 23:for(;M=a.distcode[w&(1<>>24,A=M>>>16&255,M&=65535,!($<=_);){if(0===x)break e;x--,w+=b[g++]<<_,_+=8}if(0==(240&A)){for(T=$,z=A,r=M;M=a.distcode[r+((w&(1<>T)],$=M>>>24,A=M>>>16&255,M&=65535,!(T+$<=_);){if(0===x)break e;x--,w+=b[g++]<<_,_+=8}w>>>=T,_-=T,a.back+=T}if(w>>>=$,_-=$,a.back+=$,64&A){e.msg="invalid distance code",a.mode=30;break}a.offset=M,a.extra=15&A,a.mode=24;case 24:if(a.extra){for(A=a.extra;_>>=a.extra,_-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){e.msg="invalid distance too far back",a.mode=30;break}a.mode=25;case 25:if(0===y)break e;if($=S-y,a.offset>$){if(($=a.offset-$)>a.whave&&a.sane){e.msg="invalid distance too far back",a.mode=30;break}$>a.wnext?($-=a.wnext,A=a.wsize-$):A=a.wnext-$,$>a.length&&($=a.length),T=a.window}else T=l,A=s-a.offset,$=a.length;$>y&&($=y),y-=$,a.length-=$;do{l[s++]=T[A++]}while(--$);0===a.length&&(a.mode=21);break;case 26:if(0===y)break e;l[s++]=a.length,y--,a.mode=21;break;case 27:if(a.wrap){for(;32>_;){if(0===x)break e;x--,w|=b[g++]<<_,_+=8}if(S-=y,e.total_out+=S,a.total+=S,S&&(e.adler=a.check=a.flags?p(a.check,l,S,s-S):h(a.check,l,S,s-S)),S=y,(a.flags?w:n(w))!==a.check){e.msg="incorrect data check",a.mode=30;break}_=w=0}a.mode=28;case 28:if(a.wrap&&a.flags){for(;32>_;){if(0===x)break e;x--,w+=b[g++]<<_,_+=8}if(w!==(4294967295&a.total)){e.msg="incorrect length check",a.mode=30;break}_=w=0}a.mode=29;case 29:C=1;break e;case 30:C=-3;break e;case 31:return-4;default:return-2}return e.next_out=s,e.avail_out=y,e.next_in=g,e.avail_in=x,a.hold=w,a.bits=_,(a.wsize||S!==e.avail_out&&30>a.mode&&(27>a.mode||4!==t))&&(b=e.output,g=e.next_out,s=S-e.avail_out,null===(y=e.state).window&&(y.wsize=1<=y.wsize?(f.arraySet(y.window,b,g-y.wsize,y.wsize,0),y.wnext=0,y.whave=y.wsize):((x=y.wsize-y.wnext)>s&&(x=s),f.arraySet(y.window,b,g-s,x,y.wnext),(s-=x)?(f.arraySet(y.window,b,g-s,s,0),y.wnext=s,y.whave=y.wsize):(y.wnext+=x,y.wnext===y.wsize&&(y.wnext=0),y.whave=p;p++)_[p]=0;for(d=0;dm&&(C=m),0===m)return u[c++]=20971520,u[c++]=20971520,h.bits=1,0;for(x=1;x=p;p++)if(v<<=1,0>(v-=_[p]))return-1;if(0p;p++)D[p+1]=D[p]+_[p];for(d=0;d$?(k=b[S+f[d]],I=A[w+f[d]]):(k=96,I=0);v=1<>D)+(g-=v)]=L<<24|k<<16|I|0}while(0!==g);for(v=1<>=1;if(0!==v?(y&=v-1,y+=v):y=0,d++,0==--_[p]){if(p===m)break;p=t[r+f[d]]}if(p>C&&(y&E)!==T){for(0===D&&(D=C),M+=x,v=1<<(l=p-D);l+D=(v-=_[l+D]));)l++,v<<=1;if(z+=1<t.windowBits&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&16>t.windowBits)||e&&e.windowBits||(t.windowBits+=32),15t.windowBits&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0,(e=o.inflateInit2(this.strm,t.windowBits))!==s.Z_OK)throw Error(l[e]);this.header=new c,o.inflateGetHeader(this.strm,this.header)};h.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize;if(this.ended)return!1;t=t===~~t?t:!0===t?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof e?r.input=a.binstring2buf(e):"[object ArrayBuffer]"===f.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(0===r.avail_out&&(r.output=new i.Buf8(n),r.next_out=0,r.avail_out=n),(e=o.inflate(r,s.Z_NO_FLUSH))!==s.Z_STREAM_END&&e!==s.Z_OK)return this.onEnd(e),this.ended=!0,!1;if(r.next_out&&(0===r.avail_out||e===s.Z_STREAM_END||0===r.avail_in&&(t===s.Z_FINISH||t===s.Z_SYNC_FLUSH)))if("string"===this.options.to){var l=a.utf8border(r.output,r.next_out),u=r.next_out-l,c=a.buf2string(r.output,l);r.next_out=u,r.avail_out=n-u,u&&i.arraySet(r.output,r.output,l,u,0),this.onData(c)}else this.onData(i.shrinkBuf(r.output,r.next_out))}while(0e||1342177279>>=1)&&(t+=t);return r}},"es6","es3"),$jscomp.polyfill("String.prototype.startsWith",function(e){return e||function(e,t){var r=$jscomp.checkStringArgs(this,e,"startsWith");e+="";var n=r.length,o=e.length;t=Math.max(0,Math.min(0|t,r.length));for(var i=0;i=o}},"es6","es3"),$jscomp.polyfill("String.prototype.endsWith",function(e){return e||function(e,t){var r=$jscomp.checkStringArgs(this,e,"endsWith");e+="",void 0===t&&(t=r.length),t=Math.max(0,Math.min(0|t,r.length));for(var n=e.length;0=n}},"es6","es3"),$jscomp.polyfill("Array.prototype.fill",function(e){return e||function(e,t,r){var n=this.length||0;for(0>t&&(t=Math.max(0,n+t)),(null==r||r>n)&&(r=n),0>(r=Number(r))&&(r=Math.max(0,n+r)),t=Number(t||0);tp.x?c:p.x,o=o>p.y?o:p.y,i=i>p.z?i:p.z,p.symmetries&&u))for(var d=0;dp.symmetries[d].x?c:p.symmetries[d].x,o=o>p.symmetries[d].y?o:p.symmetries[d].y,i=i>p.symmetries[d].z?i:p.symmetries[d].z}return[[t,r,n],[c,o,i],[f/l,a/l,s/l]]},$3Dmol.getAtomProperty=function(e,t){var r=null;return e.properties&&void 0!==e.properties[t]?r=e.properties[t]:void 0!==e[t]&&(r=e[t]),r},$3Dmol.getPropertyRange=function(e,t){for(var r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,o=0,i=e.length;on&&(n=a))}return isFinite(r)||isFinite(n)?isFinite(r)?isFinite(n)||(n=r):r=n:r=n=0,[r,n]},__WEBPACK_AMD_DEFINE_FACTORY__=$3Dmol,__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof __WEBPACK_AMD_DEFINE_FACTORY__?__WEBPACK_AMD_DEFINE_FACTORY__.call(exports,__webpack_require__,exports,module):__WEBPACK_AMD_DEFINE_FACTORY__,void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__),$3Dmol.createStereoViewer=function(e){var t=this;if("string"===$.type(e)&&(e=$("#"+e)),e){e=$3Dmol.createViewerGrid(e,{rows:1,cols:2,control_all:!0}),this.glviewer1=e[0][0],this.glviewer2=e[0][1],this.glviewer1.setAutoEyeSeparation(!1),this.glviewer2.setAutoEyeSeparation(!0),this.glviewer1.linkViewer(this.glviewer2),this.glviewer2.linkViewer(this.glviewer1),e=Object.getOwnPropertyNames(this.glviewer1).filter(function(e){return"function"==typeof t.glviewer1[e]});for(var r=0;rMath.abs(o)?(this.x=Math.atan2(-a,r),this.z=Math.atan2(-n,e)):(this.x=Math.atan2(s,i),this.z=0)):console.error("Error with vector's setEulerFromRotationMatrix: Unknown order: "+t),this},rotateAboutVector:function(e,t){e.normalize();var r=Math.cos(t),n=Math.sin(t);return t=this.clone().multiplyScalar(r),n=e.clone().cross(this).multiplyScalar(n),e=e.clone().multiplyScalar(e.clone().dot(this)).multiplyScalar(1-r),e=t.add(n).add(e),this.x=e.x,this.y=e.y,this.z=e.z,this},setFromMatrixPosition:function(e){return e=e.elements,this.x=e[12],this.y=e[13],this.z=e[14],this},transformDirection:function(e){var t=this.x,r=this.y,n=this.z;return e=e.elements,this.x=e[0]*t+e[4]*r+e[8]*n,this.y=e[1]*t+e[5]*r+e[9]*n,this.z=e[2]*t+e[6]*r+e[10]*n,this.normalize()},clone:function(){return new $3Dmol.Vector3(this.x,this.y,this.z)}},$3Dmol.Matrix3=function(e,t,r,n,o,i,a,s,l){this.elements=new Float32Array(9),this.set(void 0!==e?e:1,t||0,r||0,n||0,void 0!==o?o:1,i||0,a||0,s||0,void 0!==l?l:1)},$3Dmol.Matrix3.prototype={constructor:$3Dmol.Matrix3,set:function(e,t,r,n,o,i,a,s,l){var u=this.elements;return u[0]=e,u[3]=t,u[6]=r,u[1]=n,u[4]=o,u[7]=i,u[2]=a,u[5]=s,u[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},copy:function(e){e=e.elements,this.set(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},getInverse:function(e,t){e=e.elements;var r=this.elements;if(r[0]=e[10]*e[5]-e[6]*e[9],r[1]=-e[10]*e[1]+e[2]*e[9],r[2]=e[6]*e[1]-e[2]*e[5],r[3]=-e[10]*e[4]+e[6]*e[8],r[4]=e[10]*e[0]-e[2]*e[8],r[5]=-e[6]*e[0]+e[2]*e[4],r[6]=e[9]*e[4]-e[5]*e[8],r[7]=-e[9]*e[0]+e[1]*e[8],r[8]=e[5]*e[0]-e[1]*e[4],0===(e=e[0]*r[0]+e[1]*r[3]+e[2]*r[6])){if(t)throw Error("Matrix3.getInverse(): can't invert matrix, determinant is 0");return console.warn("Matrix3.getInverse(): can't invert matrix, determinant is 0"),this.identity(),this}return this.multiplyScalar(1/e),this},getDeterminant:function(){var e=this.elements;return e[0]*e[4]*e[8]+e[1]*e[5]*e[6]+e[2]*e[3]*e[7]-e[2]*e[4]*e[6]-e[1]*e[3]*e[8]-e[0]*e[5]*e[7]},transpose:function(){var e=this.elements,t=e[1];return 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},clone:function(){var e=this.elements;return new $3Dmol.Matrix3(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])}},$3Dmol.Matrix4=function(e,t,r,n,o,i,a,s,l,u,c,f,h,p,d,m){if(void 0===t&&void 0!==e)this.elements=new Float32Array(e);else{var v=this.elements=new Float32Array(16);v[0]=void 0!==e?e:1,v[4]=t||0,v[8]=r||0,v[12]=n||0,v[1]=o||0,v[5]=void 0!==i?i:1,v[9]=a||0,v[13]=s||0,v[2]=l||0,v[6]=u||0,v[10]=void 0!==c?c:1,v[14]=f||0,v[3]=h||0,v[7]=p||0,v[11]=d||0,v[15]=void 0!==m?m:1}},$3Dmol.Matrix4.prototype={constructor:$3Dmol.Matrix4,set:function(e,t,r,n,o,i,a,s,l,u,c,f,h,p,d,m){var v=this.elements;return v[0]=e,v[4]=t,v[8]=r,v[12]=n,v[1]=o,v[5]=i,v[9]=a,v[13]=s,v[2]=l,v[6]=u,v[10]=c,v[14]=f,v[3]=h,v[7]=p,v[11]=d,v[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},copy:function(e){return e=e.elements,this.set(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15]),this},matrix3FromTopLeft:function(){var e=this.elements;return new $3Dmol.Matrix3(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10])},setRotationFromEuler:function(e,t){var r=this.elements,n=e.x,o=e.y,i=e.z;e=Math.cos(n),n=Math.sin(n);var a=Math.cos(o);o=Math.sin(o);var s=Math.cos(i);if(i=Math.sin(i),void 0===t||"XYZ"===t){t=e*s;var l=e*i,u=n*s,c=n*i;r[0]=a*s,r[4]=-a*i,r[8]=o,r[1]=l+u*o,r[5]=t-c*o,r[9]=-n*a,r[2]=c-t*o,r[6]=u+l*o,r[10]=e*a}else console.error("Error with matrix4 setRotationFromEuler. Order: "+t);return this},setRotationFromQuaternion:function(e){var t=this.elements,r=e.x,n=e.y,o=e.z,i=e.w,a=r+r,s=n+n,l=o+o;e=r*a;var u=r*s;r*=l;var c=n*s;return n*=l,o*=l,a*=i,s*=i,i*=l,t[0]=1-(c+o),t[4]=u-i,t[8]=r+s,t[1]=u+i,t[5]=1-(e+o),t[9]=n-a,t[2]=r-s,t[6]=n+a,t[10]=1-(e+c),this},lookAt:function(){var e=new $3Dmol.Vector3,t=new $3Dmol.Vector3,r=new $3Dmol.Vector3;return function(n,o,i){var a=this.elements;return r.subVectors(n,o).normalize(),0===r.length()&&(r.z=1),e.crossVectors(i,r).normalize(),0===e.length()&&(r.x+=1e-4,e.crossVectors(i,r).normalize()),t.crossVectors(r,e),a[0]=e.x,a[4]=t.x,a[8]=r.x,a[1]=e.y,a[5]=t.y,a[9]=r.y,a[2]=e.z,a[6]=t.z,a[10]=r.z,this}}(),multiplyMatrices:function(e,t){var r=e.elements,n=t.elements;t=this.elements,e=r[0];var o=r[4],i=r[8],a=r[12],s=r[1],l=r[5],u=r[9],c=r[13],f=r[2],h=r[6],p=r[10],d=r[14],m=r[3],v=r[7],y=r[11];r=r[15];var g=n[0],b=n[4],x=n[8],w=n[12],_=n[1],D=n[5],S=n[9],C=n[13],A=n[2],$=n[6],M=n[10],T=n[14],z=n[3],E=n[7],L=n[11];return n=n[15],t[0]=e*g+o*_+i*A+a*z,t[4]=e*b+o*D+i*$+a*E,t[8]=e*x+o*S+i*M+a*L,t[12]=e*w+o*C+i*T+a*n,t[1]=s*g+l*_+u*A+c*z,t[5]=s*b+l*D+u*$+c*E,t[9]=s*x+l*S+u*M+c*L,t[13]=s*w+l*C+u*T+c*n,t[2]=f*g+h*_+p*A+d*z,t[6]=f*b+h*D+p*$+d*E,t[10]=f*x+h*S+p*M+d*L,t[14]=f*w+h*C+p*T+d*n,t[3]=m*g+v*_+y*A+r*z,t[7]=m*b+v*D+y*$+r*E,t[11]=m*x+v*S+y*M+r*L,t[15]=m*w+v*C+y*T+r*n,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},makeTranslation:function(e,t,r){return this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this},transpose:function(){var e=this.elements,t=e[1];return 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},getPosition:function(){var e=new $3Dmol.Vector3;return function(){console.warn("DEPRECATED: Matrix4's .getPosition() has been removed. Use Vector3.getPositionFromMatrix( matrix ) instead.");var t=this.elements;return e.set(t[12],t[13],t[14])}}(),setPosition:function(e){var t=this.elements;return t[12]=e.x,t[13]=e.y,t[14]=e.z,this},getInverse:function(e,t){var r=this.elements,n=(e=e.elements)[0],o=e[4],i=e[8],a=e[12],s=e[1],l=e[5],u=e[9],c=e[13],f=e[2],h=e[6],p=e[10],d=e[14],m=e[3],v=e[7],y=e[11],g=e[15];if(r[0]=u*d*v-c*p*v+c*h*y-l*d*y-u*h*g+l*p*g,r[4]=a*p*v-i*d*v-a*h*y+o*d*y+i*h*g-o*p*g,r[8]=i*c*v-a*u*v+a*l*y-o*c*y-i*l*g+o*u*g,r[12]=a*u*h-i*c*h-a*l*p+o*c*p+i*l*d-o*u*d,r[1]=c*p*m-u*d*m-c*f*y+s*d*y+u*f*g-s*p*g,r[5]=i*d*m-a*p*m+a*f*y-n*d*y-i*f*g+n*p*g,r[9]=a*u*m-i*c*m-a*s*y+n*c*y+i*s*g-n*u*g,r[13]=i*c*f-a*u*f+a*s*p-n*c*p-i*s*d+n*u*d,r[2]=l*d*m-c*h*m+c*f*v-s*d*v-l*f*g+s*h*g,r[6]=a*h*m-o*d*m-a*f*v+n*d*v+o*f*g-n*h*g,r[10]=o*c*m-a*l*m+a*s*v-n*c*v-o*s*g+n*l*g,r[14]=a*l*f-o*c*f-a*s*h+n*c*h+o*s*d-n*l*d,r[3]=u*h*m-l*p*m-u*f*v+s*p*v+l*f*y-s*h*y,r[7]=o*p*m-i*h*m+i*f*v-n*p*v-o*f*y+n*h*y,r[11]=i*l*m-o*u*m-i*s*v+n*u*v+o*s*y-n*l*y,r[15]=o*u*f-i*l*f+i*s*h-n*u*h-o*s*p+n*l*p,0===(r=e[0]*r[0]+e[1]*r[4]+e[2]*r[8]+e[3]*r[12])){if(t)throw Error("Matrix4.getInverse(): can't invert matrix, determinant is 0");return console.warn("Matrix4.getInverse(): can't invert matrix, determinant is 0"),this.identity(),this}return this.multiplyScalar(1/r),this},isReflected:function(){return 0>this.matrix3FromTopLeft().getDeterminant()},compose:function(){var e=new $3Dmol.Matrix4,t=new $3Dmol.Matrix4;return function(r,n,o){var i=this.elements;return e.identity(),e.setRotationFromQuaternion(n),t.makeScale(o.x,o.y,o.z),this.multiplyMatrices(e,t),i[12]=r.x,i[13]=r.y,i[14]=r.z,this}}(),decompose:function(){var e=new $3Dmol.Vector3,t=new $3Dmol.Vector3,r=new $3Dmol.Vector3,n=new $3Dmol.Matrix4;return function(o,i,a){var s=this.elements;return e.set(s[0],s[1],s[2]),t.set(s[4],s[5],s[6]),r.set(s[8],s[9],s[10]),o=o instanceof $3Dmol.Vector3?o:new $3Dmol.Vector3,i=i instanceof $3Dmol.Quaternion?i:new $3Dmol.Quaternion,(a=a instanceof $3Dmol.Vector3?a:new $3Dmol.Vector3).x=e.length(),a.y=t.length(),a.z=r.length(),o.x=s[12],o.y=s[13],o.z=s[14],n.copy(this),n.elements[0]/=a.x,n.elements[1]/=a.x,n.elements[2]/=a.x,n.elements[4]/=a.y,n.elements[5]/=a.y,n.elements[6]/=a.y,n.elements[8]/=a.z,n.elements[9]/=a.z,n.elements[10]/=a.z,i.setFromRotationMatrix(n),[o,i,a]}}(),scale:function(e){var t=this.elements,r=e.x,n=e.y;return e=e.z,t[0]*=r,t[4]*=n,t[8]*=e,t[1]*=r,t[5]*=n,t[9]*=e,t[2]*=r,t[6]*=n,t[10]*=e,t[3]*=r,t[7]*=n,t[11]*=e,this},getMaxScaleOnAxis:function(){var e=this.elements;return Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1]+e[2]*e[2],Math.max(e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10])))},makeFrustum:function(e,t,r,n,o,i){var a=this.elements;return a[0]=2*o/(t-e),a[4]=0,a[8]=(t+e)/(t-e),a[12]=0,a[1]=0,a[5]=2*o/(n-r),a[9]=(n+r)/(n-r),a[13]=0,a[2]=0,a[6]=0,a[10]=-(i+o)/(i-o),a[14]=-2*i*o/(i-o),a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makePerspective:function(e,t,r,n){var o=-(e=r*Math.tan($3Dmol.Math.degToRad(.5*e)));return this.makeFrustum(o*t,e*t,o,e,r,n)},makeOrthographic:function(e,t,r,n,o,i){var a=this.elements,s=1/(t-e),l=1/(r-n),u=1/(i-o);return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-(t+e)*s,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-(r+n)*l,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-(i+o)*u,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},isEqual:function(e){e=e.elements;var t=this.elements;return t[0]==e[0]&&t[4]==e[4]&&t[8]==e[8]&&t[12]==e[12]&&t[1]==e[1]&&t[5]==e[5]&&t[9]==e[9]&&t[13]==e[13]&&t[2]==e[2]&&t[6]==e[6]&&t[10]==e[10]&&t[14]==e[14]&&t[3]==e[3]&&t[7]==e[7]&&t[11]==e[11]&&t[15]==e[15]},clone:function(){var e=this.elements;return new $3Dmol.Matrix4(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},isIdentity:function(){var e=this.elements;return 1==e[0]&&0==e[4]&&0==e[8]&&0==e[12]&&0==e[1]&&1==e[5]&&0==e[9]&&0==e[13]&&0==e[2]&&0==e[6]&&1==e[10]&&0==e[14]&&0==e[3]&&0==e[7]&&0==e[11]&&1==e[15]}},$3Dmol.Vector3.prototype.unproject=function(){var e=new $3Dmol.Matrix4;return function(t){return e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyMatrix4(e)}}(),$3Dmol.Ray=function(e,t){this.origin=void 0!==e?e:new $3Dmol.Vector3,this.direction=void 0!==t?t:new $3Dmol.Vector3},$3Dmol.Ray.prototype={constructor:$3Dmol.Ray,set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return(t||new $3Dmol.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)},recast:function(){var e=new $3Dmol.Vector3;return function(t){return this.origin.copy(this.at(t,e)),this}}(),closestPointToPoint:function(e,t){return(t=t||new $3Dmol.Vector3).subVectors(e,this.origin),e=t.dot(this.direction),t.copy(this.direction).multiplyScalar(e).add(this.origin)},distanceToPoint:(c=new $3Dmol.Vector3,function(e){var t=c.subVectors(e,this.origin).dot(this.direction);return c.copy(this.direction).multiplyScalar(t).add(this.origin),c.distanceTo(e)}),isIntersectionCylinder:function(){},isIntersectionSphere:function(e){return this.distanceToPoint(e.center)<=e.radius},isIntersectionPlane:function(e){return 0!==e.normal.dot(this.direction)||0===e.distanceToPoint(this.origin)},distanceToPlane:function(e){var t=e.normal.dot(this.direction);return 0!==t?-(this.origin.dot(e.normal)+e.constant)/t:0===e.distanceToPoint(this.origin)?0:void 0},intersectPlane:function(e,t){if(void 0!==(e=this.distanceToPlane(e)))return this.at(e,t)},applyMatrix4:function(e){return this.direction.add(this.origin).applyMatrix4(e),this.origin.applyMatrix4(e),this.direction.sub(this.origin),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)},clone:function(){return(new $3Dmol.Ray).copy(this)}},$3Dmol.Sphere=function(e,t){this.center=void 0!==e?e:new $3Dmol.Vector3,this.radius=void 0!==t?t:0},$3Dmol.Sphere.prototype={constructor:$3Dmol.Sphere,set:function(e,t){return this.center.copy(e),this.radius=t,this},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius*=e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius},clone:function(){return(new $3Dmol.Sphere).copy(this)}},$3Dmol.Cylinder=function(e,t,r){this.c1=void 0!==e?e:new $3Dmol.Vector3,this.c2=void 0!==t?t:new $3Dmol.Vector3,this.direction=(new $3Dmol.Vector3).subVectors(this.c2,this.c1).normalize(),this.radius=void 0!==r?r:0},$3Dmol.Cylinder.prototype={constructor:$3Dmol.Cylinder,copy:function(e){return this.c1.copy(e.c1),this.c2.copy(e.c2),this.direction.copy(e.direction),this.radius=e.radius,this},lengthSq:function(){var e=new $3Dmol.Vector3;return function(){return e.subVectors(this.c2,this.c1).lengthSq()}}(),applyMatrix4:function(e){return this.direction.add(this.c1).applyMatrix4(e),this.c1.applyMatrix4(e),this.c2.applyMatrix4(e),this.direction.sub(this.c1).normalize(),this.radius*=e.getMaxScaleOnAxis(),this}},$3Dmol.Triangle=function(e,t,r){this.a=void 0!==e?e:new $3Dmol.Vector3,this.b=void 0!==t?t:new $3Dmol.Vector3,this.c=void 0!==r?r:new $3Dmol.Vector3},$3Dmol.Triangle.prototype={constructor:$3Dmol.Triangle,copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},applyMatrix4:function(e){return this.a.applyMatrix4(e),this.b.applyMatrix4(e),this.c.applyMatrix4(e),this},getNormal:function(){var e=new $3Dmol.Vector3;return function(){var t=this.a.clone();return t.sub(this.b),e.subVectors(this.c,this.b),t.cross(e),t.normalize(),t}}()},$3Dmol.EventDispatcher=function(){var e={};this.addEventListener=function(t,r){void 0===e[t]&&(e[t]=[]),-1===e[t].indexOf(r)&&e[t].push(r)},this.removeEventListener=function(t,r){-1!==(r=e[t].indexOf(r))&&e[t].splice(r,1)},this.dispatchEvent=function(t){var r=e[t.type];if(void 0!==r){t.target=this;for(var n=0,o=r.length;n>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},getHex:function(){return Math.round(255*this.r)<<16|Math.round(255*this.g)<<8|Math.round(255*this.b)},clone:function(){return new $3Dmol.Color(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},scaled:function(){var e={};return e.r=Math.round(255*this.r),e.g=Math.round(255*this.g),e.b=Math.round(255*this.b),e.a=1,e}},$3Dmol.Object3D=function(){this.id=$3Dmol.Object3DIDCount++,this.name="",this.parent=void 0,this.children=[],this.position=new $3Dmol.Vector3,this.rotation=new $3Dmol.Vector3,this.matrix=new $3Dmol.Matrix4,this.matrixWorld=new $3Dmol.Matrix4,this.quaternion=new $3Dmol.Quaternion,this.eulerOrder="XYZ",this.up=new $3Dmol.Vector3(0,1,0),this.scale=new $3Dmol.Vector3(1,1,1),this.rotationAutoUpdate=this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=!0,this.useQuaternion=!1,this.visible=!0},$3Dmol.Object3D.prototype={constructor:$3Dmol.Object3D,lookAt:function(e){this.matrix.lookAt(e,this.position,this.up),this.rotationAutoUpdate&&(!0===this.useQuaternion?this.quaternion.copy(this.matrix.decompose()[1]):this.rotation.setEulerFromRotationMatrix(this.matrix,this.eulerOrder))},add:function(e){if(e===this)console.error("Can't add $3Dmol.Object3D to itself");else{e.parent=this,this.children.push(e);for(var t=this;void 0!==t.parent;)t=t.parent;void 0!==t&&t instanceof $3Dmol.Scene&&t.__addObject(e)}},remove:function(e){var t=this.children.indexOf(e);if(-1!==t){for(e.parent=void 0,this.children.splice(t,1),t=this;void 0!==t.parent;)t=t.parent;void 0!==t&&t instanceof $3Dmol.Scene&&t.__removeObject(e)}},updateMatrix:function(){this.matrix.setPosition(this.position),!1===this.useQuaternion?this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder):this.matrix.setRotationFromQuaternion(this.quaternion),1===this.scale.x&&1===this.scale.y&&1===this.scale.z||this.matrix.scale(this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){for(!0===this.matrixAutoUpdate&&this.updateMatrix(),!0!==this.matrixWorldNeedsUpdate&&!0!==e||(void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=0;er.vertexArray.length/3)&&(r=t(this)),r},addGeoGroup:function(){return t(this)},setUpNormals:function(e){e=e||!1;for(var t=0;tD)){i.copy(this.ray.direction).multiplyScalar(D).add(this.ray.origin),i.sub(n.a),a.copy(n.b).sub(n.a),s.copy(n.c).sub(n.a),_=a.dot(s);var S=a.lengthSq();w=s.lengthSq(),0>(w=(S*i.dot(s)-_*i.dot(a))/(S*w-_*_))||1(_=(i.dot(a)-w*_)/S)||1<_||1<_+w||v.push({clickable:m,distance:D}))}}}for(x=0,g=y.cylinder.length;x(_=_*(w=D=0>=(A=(_*C-S)*(_*C-S)-w*(o.lengthSq()-C*C-A))?Math.sqrt(M):(S-_*C-Math.sqrt(A))/w)-C)||_*_>r.lengthSq()||0>w||v.push({clickable:m,distance:D}))}}for(x=0,g=y.line.length;xd)break e;D=0>=A?d:d-Math.sqrt(A),v.push({clickable:m,distance:D});break e}}}return f.sort(u),f},e}(),$3Dmol.Projector=function(){new $3Dmol.Matrix4;var e=new $3Dmol.Matrix4;this.projectVector=function(t,r){return r.matrixWorldInverse.getInverse(r.matrixWorld),e.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),t.applyProjection(e)},this.unprojectVector=function(t,r){return r.projectionMatrixInverse.getInverse(r.projectionMatrix),e.multiplyMatrices(r.matrixWorld,r.projectionMatrixInverse),t.applyProjection(e)}},$3Dmol.Camera=function(e,t,r,n,o){$3Dmol.Object3D.call(this),this.fov=void 0!==e?e:50,this.aspect=void 0!==t?t:1,this.near=void 0!==r?r:.1,this.far=void 0!==n?n:2e3,this.projectionMatrix=new $3Dmol.Matrix4,this.projectionMatrixInverse=new $3Dmol.Matrix4,this.matrixWorldInverse=new $3Dmol.Matrix4,this.right=this.position.z*Math.tan(Math.PI/180*e),this.left=-this.right,this.top=this.right/this.aspect,this.bottom=-this.top,this.ortho=!!o,this.updateProjectionMatrix()},$3Dmol.Camera.prototype=Object.create($3Dmol.Object3D.prototype),$3Dmol.Camera.prototype.lookAt=function(e){this.matrix.lookAt(this.position,e,this.up),this.rotationAutoUpdate&&(!1===this.useQuaternion?this.rotation.setEulerFromRotationMatrix(this.matrix,this.eulerOrder):this.quaternion.copy(this.matrix.decompose()[1]))},$3Dmol.Camera.prototype.updateProjectionMatrix=function(){this.ortho?this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far):this.projectionMatrix.makePerspective(this.fov,this.aspect,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},$3Dmol.SpritePlugin=function(){function e(e,t){return e.z!==t.z?t.z-e.z:t.id-e.id}var t,r,n,o,i,a,s,l,u,c;this.init=function(e){t=e.context,r=e,n=e.getPrecision(),o=new Float32Array(16),i=new Uint16Array(6),e=0,o[e++]=-1,o[e++]=-1,o[e++]=0,o[e++]=0,o[e++]=1,o[e++]=-1,o[e++]=1,o[e++]=0,o[e++]=1,o[e++]=1,o[e++]=1,o[e++]=1,o[e++]=-1,o[e++]=1,o[e++]=0,o[e++]=1,e=0,i[e++]=0,i[e++]=1,i[e++]=2,i[e++]=0,i[e++]=2,i[e++]=3,a=t.createBuffer(),s=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,o,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,s),t.bufferData(t.ELEMENT_ARRAY_BUFFER,i,t.STATIC_DRAW),e=$3Dmol.ShaderLib.sprite;var f=n,h=t.createProgram(),p=t.createShader(t.FRAGMENT_SHADER),d=t.createShader(t.VERTEX_SHADER);f="precision "+f+" float;\n",t.shaderSource(p,f+e.fragmentShader),t.shaderSource(d,f+e.vertexShader),t.compileShader(p),t.compileShader(d),t.getShaderParameter(p,t.COMPILE_STATUS)&&t.getShaderParameter(d,t.COMPILE_STATUS)?(t.attachShader(h,p),t.attachShader(h,d),t.linkProgram(h),t.getProgramParameter(h,t.LINK_STATUS)||console.error("Could not initialize shader"),e=h):(console.error(t.getShaderInfoLog(p)),console.error("could not initialize shader"),e=null),l=e,c={},(u={}).position=t.getAttribLocation(l,"position"),u.uv=t.getAttribLocation(l,"uv"),c.uvOffset=t.getUniformLocation(l,"uvOffset"),c.uvScale=t.getUniformLocation(l,"uvScale"),c.rotation=t.getUniformLocation(l,"rotation"),c.scale=t.getUniformLocation(l,"scale"),c.alignment=t.getUniformLocation(l,"alignment"),c.color=t.getUniformLocation(l,"color"),c.map=t.getUniformLocation(l,"map"),c.opacity=t.getUniformLocation(l,"opacity"),c.useScreenCoordinates=t.getUniformLocation(l,"useScreenCoordinates"),c.screenPosition=t.getUniformLocation(l,"screenPosition"),c.modelViewMatrix=t.getUniformLocation(l,"modelViewMatrix"),c.projectionMatrix=t.getUniformLocation(l,"projectionMatrix"),c.fogType=t.getUniformLocation(l,"fogType"),c.fogDensity=t.getUniformLocation(l,"fogDensity"),c.fogNear=t.getUniformLocation(l,"fogNear"),c.fogFar=t.getUniformLocation(l,"fogFar"),c.fogColor=t.getUniformLocation(l,"fogColor"),c.alphaTest=t.getUniformLocation(l,"alphaTest")},this.render=function(n,o,i,f){var h=n.__webglSprites,p=h.length;if(p){var d=u,m=c,v=.5*i,y=.5*f;if(t.useProgram(l),t.enableVertexAttribArray(d.position),t.enableVertexAttribArray(d.uv),t.disable(t.CULL_FACE),t.enable(t.BLEND),t.bindBuffer(t.ARRAY_BUFFER,a),t.vertexAttribPointer(d.position,2,t.FLOAT,!1,16,0),t.vertexAttribPointer(d.uv,2,t.FLOAT,!1,16,8),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,s),t.uniformMatrix4fv(m.projectionMatrix,!1,o.projectionMatrix.elements),t.activeTexture(t.TEXTURE0),t.uniform1i(m.map,0),d=n.fog){t.uniform3f(m.fogColor,d.color.r,d.color.g,d.color.b),t.uniform1f(m.fogNear,d.near),t.uniform1f(m.fogFar,d.far),t.uniform1i(m.fogType,1);var g=d=1}else t.uniform1i(m.fogType,0),g=d=0;var b,x=[];for(b=0;b 0.0) {\n vec3 cp;\n if( dotp1 < 0.0) { cp = p1;\n } else {\n cp = p2;\n }\n vec3 diff = p-cp;\n A = dot(v,v);\n B = dot(diff,v)*2.0;\n C = dot(diff,diff)-r*r;\n det = (B*B) - (4.0*C);\n if(det < 0.0) discard;\n sqrtDet = sqrt(det);\n posT = (-B+sqrtDet)/(2.0);\n negT = (-B-sqrtDet)/(2.0);\n float t = min(posT,negT);\n qi = p+v*t;\n norm = normalize(qi-cp);\n } else {\n norm = normalize(qi-(dotp1*va + p1));\n }\n vec4 clipPos = projectionMatrix * vec4(qi, 1.0);\n float ndcDepth = clipPos.z / clipPos.w;\n float depth = ((gl_DepthRange.diff * ndcDepth) + gl_DepthRange.near + gl_DepthRange.far) / 2.0;\n gl_FragDepthEXT = depth;"},$3Dmol.ShaderLib={basic:{fragmentShader:"uniform mat4 viewMatrix;\nuniform float opacity;\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\nvarying vec3 vColor;\nvoid main() {\n gl_FragColor = vec4( vColor, opacity );\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n float fogFactor = smoothstep( fogNear, fogFar, depth );\n gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}",vertexShader:"uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nattribute vec3 position;\nattribute vec3 color;\nvarying vec3 vColor;\nvoid main() {\n vColor = color;\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * mvPosition;\n}",uniforms:{opacity:{type:"f",value:1},fogColor:{type:"c",value:new $3Dmol.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3}}},sphereimposter:{fragmentShader:"uniform mat4 viewMatrix;\nuniform float opacity;\nuniform mat4 projectionMatrix;\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\nuniform float uDepth;\nuniform vec3 directionalLightColor[ 1 ];\nvarying vec3 vColor;\nvarying vec2 mapping;\nvarying float rval;\nvarying vec3 vLight;\nvarying vec3 center;\nvoid main() {\n float lensqr = dot(mapping,mapping);\n float rsqr = rval*rval;\n if(lensqr > rsqr)\n discard;\n float z = sqrt(rsqr-lensqr);\n vec3 cameraPos = center+ vec3(mapping.x,mapping.y,z);\n vec4 clipPos = projectionMatrix * vec4(cameraPos, 1.0);\n float ndcDepth = clipPos.z / clipPos.w;\n gl_FragDepthEXT = ((gl_DepthRange.diff * ndcDepth) + gl_DepthRange.near + gl_DepthRange.far) / 2.0;\n vec3 norm = normalize(vec3(mapping.x,mapping.y,z));\n float dotProduct = dot( norm, vLight );\n vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n vec3 vLight = directionalLightColor[ 0 ] * directionalLightWeighting;\n gl_FragColor = vec4(vLight*vColor, opacity*opacity );\n float fogFactor = smoothstep( fogNear, fogFar, gl_FragDepthEXT/gl_FragCoord.w );\n gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}",vertexShader:"uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 directionalLightColor[ 1 ];\nuniform vec3 directionalLightDirection[ 1 ];\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nvarying vec2 mapping;\nvarying vec3 vColor;\nvarying float rval;\nvarying vec3 vLight;\nvarying vec3 center;\nvoid main() {\n vColor = color;\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n center = mvPosition.xyz;\n vec4 projPosition = projectionMatrix * mvPosition;\n vec4 adjust = projectionMatrix* vec4(normal,0.0); adjust.z = 0.0; adjust.w = 0.0;\n vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );\n vLight = normalize( lDirection.xyz );\n mapping = normal.xy;\n rval = abs(normal.x);\n gl_Position = projPosition+adjust;\n}",uniforms:{opacity:{type:"f",value:1},fogColor:{type:"c",value:new $3Dmol.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},directionalLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]}}},lambert:{fragmentShader:"uniform mat4 viewMatrix;\nuniform float opacity;\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\nvarying vec3 vLightFront;\nvarying vec3 vColor;\nvoid main() {\n gl_FragColor = vec4( vec3 ( 1.0 ), opacity );\n #ifndef WIREFRAME\n gl_FragColor.xyz *= vLightFront;\n #endif\n gl_FragColor = gl_FragColor * vec4( vColor, opacity );\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n float fogFactor = smoothstep( fogNear, fogFar, depth );\n gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}",vertexShader:"uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 directionalLightColor[ 1 ];\nuniform vec3 directionalLightDirection[ 1 ];\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nvarying vec3 vColor;\nvarying vec3 vLightFront;\nvoid main() {\n vColor = color;\n vec3 objectNormal = normal;\n vec3 transformedNormal = normalMatrix * objectNormal;\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n vLightFront = vec3( 0.0 );\n transformedNormal = normalize( transformedNormal );\n vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );\n vec3 dirVector = normalize( lDirection.xyz );\n float dotProduct = dot( transformedNormal, dirVector );\n vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n vLightFront += directionalLightColor[ 0 ] * directionalLightWeighting;\n gl_Position = projectionMatrix * mvPosition;\n}",uniforms:{opacity:{type:"f",value:1},fogColor:{type:"c",value:new $3Dmol.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},directionalLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]}}},instanced:{fragmentShader:"uniform mat4 viewMatrix;\nuniform float opacity;\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\nvarying vec3 vLightFront;\nvarying vec3 vColor;\nvoid main() {\n gl_FragColor = vec4( vec3 ( 1.0 ), opacity );\n #ifndef WIREFRAME\n gl_FragColor.xyz *= vLightFront;\n #endif\n gl_FragColor = gl_FragColor * vec4( vColor, opacity );\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n float fogFactor = smoothstep( fogNear, fogFar, depth );\n gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}",vertexShader:"uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 directionalLightColor[ 1 ];\nuniform vec3 directionalLightDirection[ 1 ];\nattribute vec3 offset;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nattribute float radius;\nvarying vec3 vColor;\nvarying vec3 vLightFront;\nvoid main() {\n vColor = color;\n vec3 objectNormal = normal;\n vec3 transformedNormal = normalMatrix * objectNormal;\n vec4 mvPosition = modelViewMatrix * vec4( position * radius + offset, 1.0 );\n vLightFront = vec3( 0.0 );\n transformedNormal = normalize( transformedNormal );\n vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );\n vec3 dirVector = normalize( lDirection.xyz );\n float dotProduct = dot( transformedNormal, dirVector );\n vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n vLightFront += directionalLightColor[ 0 ] * directionalLightWeighting;\n gl_Position = projectionMatrix * mvPosition;\n}",uniforms:{opacity:{type:"f",value:1},fogColor:{type:"c",value:new $3Dmol.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},directionalLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]}}},outline:{fragmentShader:"uniform float opacity;\nuniform vec3 outlineColor;\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\nvoid main() {\n gl_FragColor = vec4( outlineColor, 1 );\n}",vertexShader:"uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float outlineWidth;\nuniform float outlinePushback;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nvoid main() {\n vec4 norm = modelViewMatrix*vec4(normalize(normal),0.0);\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n mvPosition.xy += norm.xy*outlineWidth;\n gl_Position = projectionMatrix * mvPosition;\n mvPosition.z -= outlinePushback;\n vec4 pushpos = projectionMatrix*mvPosition;\n gl_Position.z = gl_Position.w*pushpos.z/pushpos.w;\n}",uniforms:{opacity:{type:"f",value:1},outlineColor:{type:"c",value:new $3Dmol.Color(0,0,0)},fogColor:{type:"c",value:new $3Dmol.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},outlineWidth:{type:"f",value:.1},outlinePushback:{type:"f",value:1}}},sphereimposteroutline:{fragmentShader:"uniform float opacity;\nuniform vec3 outlineColor;\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\nuniform mat4 projectionMatrix;\nvarying vec2 mapping;\nvarying float rval;\nvarying vec3 center;\nuniform float outlinePushback;\nvoid main() {\n float lensqr = dot(mapping,mapping);\n float rsqr = rval*rval;\n if(lensqr > rsqr)\n discard;\n float z = sqrt(rsqr-lensqr);\n vec3 cameraPos = center+ vec3(mapping.x,mapping.y,z-outlinePushback);\n vec4 clipPos = projectionMatrix * vec4(cameraPos, 1.0);\n float ndcDepth = clipPos.z / clipPos.w;\n gl_FragDepthEXT = ((gl_DepthRange.diff * ndcDepth) + gl_DepthRange.near + gl_DepthRange.far) / 2.0;\n gl_FragColor = vec4(outlineColor, 1 );\n}",vertexShader:"uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float outlineWidth;\nuniform float outlinePushback;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nvarying vec2 mapping;\nvarying float rval;\nvarying vec3 center;\nvoid main() {\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n center = mvPosition.xyz;\n vec4 projPosition = projectionMatrix * mvPosition;\n vec2 norm = normal.xy + vec2(sign(normal.x)*outlineWidth,sign(normal.y)*outlineWidth);\n vec4 adjust = projectionMatrix* vec4(norm,normal.z,0.0); adjust.z = 0.0; adjust.w = 0.0;\n mapping = norm.xy;\n rval = abs(norm.x);\n gl_Position = projPosition+adjust;\n}",uniforms:{opacity:{type:"f",value:1},outlineColor:{type:"c",value:new $3Dmol.Color(0,0,0)},fogColor:{type:"c",value:new $3Dmol.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},outlineWidth:{type:"f",value:.1},outlinePushback:{type:"f",value:1}}},stickimposter:{fragmentShader:[$3Dmol.ShaderUtils.stickimposterFragmentShader," float dotProduct = dot( norm, vLight );\n vec3 light = vec3( max( dotProduct, 0.0 ) );\n gl_FragColor = vec4(light*color, opacity*opacity );\n float fogFactor = smoothstep( fogNear, fogFar, depth );\n gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}"].join("\n"),vertexShader:"uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 directionalLightColor[ 1 ];\nuniform vec3 directionalLightDirection[ 1 ];\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nattribute float radius;\nvarying vec3 vColor;\nvarying vec3 vLight;\nvarying vec3 cposition;\nvarying vec3 p1;\nvarying vec3 p2;\nvarying float r;\nvoid main() {\n vColor = color; vColor.z = abs(vColor.z);\n r = abs(radius);\n vec4 to = modelViewMatrix*vec4(normal, 1.0);\n vec4 pt = modelViewMatrix*vec4(position, 1.0);\n vec4 mvPosition = pt;\n p1 = pt.xyz; p2 = to.xyz;\n vec3 norm = to.xyz-pt.xyz;\n float mult = 1.1;\n if(length(p1) > length(p2)) {\n mvPosition = to;\n }\n vec3 n = normalize(mvPosition.xyz);\n if(color.z >= 0.0) {\n vec3 pnorm = normalize(p1);\n float t = dot(mvPosition.xyz-p1,n)/dot(pnorm,n);\n mvPosition.xyz = p1+t*pnorm;\n } else {\n vec3 pnorm = normalize(p2);\n float t = dot(mvPosition.xyz-p2,n)/dot(pnorm,n);\n mvPosition.xyz = p2+t*pnorm;\n mult *= -1.0;\n }\n vec3 cr = normalize(cross(mvPosition.xyz,norm))*radius;\n vec3 doublecr = normalize(cross(mvPosition.xyz,cr))*radius;\n mvPosition.xy += mult*(cr + doublecr).xy;\n cposition = mvPosition.xyz;\n gl_Position = projectionMatrix * mvPosition;\n vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );\n vLight = normalize( lDirection.xyz )*directionalLightColor[0];\n}",uniforms:{opacity:{type:"f",value:1},fogColor:{type:"c",value:new $3Dmol.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},directionalLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]}}},stickimposteroutline:{fragmentShader:$3Dmol.ShaderUtils.stickimposterFragmentShader+"gl_FragColor = vec4(color,1.0);}",vertexShader:"uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 directionalLightColor[ 1 ];\nuniform vec3 directionalLightDirection[ 1 ];\nuniform vec3 outlineColor;\nuniform float outlineWidth;\nuniform float outlinePushback;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nattribute float radius;\nvarying vec3 vColor;\nvarying vec3 vLight;\nvarying vec3 cposition;\nvarying vec3 p1;\nvarying vec3 p2;\nvarying float r;\nvoid main() {\n vColor = outlineColor;\n float rad = radius+sign(radius)*outlineWidth;\n r = abs(rad);\n vec4 to = modelViewMatrix*vec4(normal, 1.0);\n vec4 pt = modelViewMatrix*vec4(position, 1.0);\n to.xyz += normalize(to.xyz)*outlinePushback;\n pt.xyz += normalize(pt.xyz)*outlinePushback;\n vec4 mvPosition = pt;\n p1 = pt.xyz; p2 = to.xyz;\n vec3 norm = to.xyz-pt.xyz;\n float mult = 1.1;\n if(length(p1) > length(p2)) {\n mvPosition = to;\n }\n vec3 n = normalize(mvPosition.xyz);\n if(color.z >= 0.0) {\n vec3 pnorm = normalize(p1);\n float t = dot(mvPosition.xyz-p1,n)/dot(pnorm,n);\n mvPosition.xyz = p1+t*pnorm;\n } else {\n vec3 pnorm = normalize(p2);\n float t = dot(mvPosition.xyz-p2,n)/dot(pnorm,n);\n mvPosition.xyz = p2+t*pnorm;\n mult *= -1.0;\n }\n vec3 cr = normalize(cross(mvPosition.xyz,norm))*rad;\n vec3 doublecr = normalize(cross(mvPosition.xyz,cr))*rad;\n mvPosition.xy += mult*(cr + doublecr).xy;\n cposition = mvPosition.xyz;\n gl_Position = projectionMatrix * mvPosition;\n vLight = vec3(1.0,1.0,1.0);\n}",uniforms:{opacity:{type:"f",value:1},fogColor:{type:"c",value:new $3Dmol.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},outlineColor:{type:"c",value:new $3Dmol.Color(0,0,0)},outlineWidth:{type:"f",value:.1},outlinePushback:{type:"f",value:1}}},lambertdouble:{fragmentShader:"uniform mat4 viewMatrix;\nuniform float opacity;\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\nvarying vec3 vLightFront;\nvarying vec3 vLightBack;\nvarying vec3 vColor;\nvoid main() {\n gl_FragColor = vec4( vec3 ( 1.0 ), opacity );\n #ifndef WIREFRAME\n if ( gl_FrontFacing )\n gl_FragColor.xyz *= vLightFront;\n else\n gl_FragColor.xyz *= vLightBack;\n #endif\n gl_FragColor = gl_FragColor * vec4( vColor, opacity );\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n float fogFactor = smoothstep( fogNear, fogFar, depth );\n gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}",vertexShader:"uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 directionalLightColor[ 1 ];\nuniform vec3 directionalLightDirection[ 1 ];\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nvarying vec3 vColor;\nvarying vec3 vLightFront;\nvarying vec3 vLightBack;\nvoid main() {\n vColor = color;\n vec3 objectNormal = normal;\n vec3 transformedNormal = normalMatrix * objectNormal;\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n vLightFront = vec3( 0.0 );\n vLightBack = vec3( 0.0 );\n transformedNormal = normalize( transformedNormal );\n vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );\n vec3 dirVector = normalize( lDirection.xyz );\n float dotProduct = dot( transformedNormal, dirVector );\n vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n vec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n vLightFront += directionalLightColor[ 0 ] * directionalLightWeighting;\n vLightBack += directionalLightColor[ 0 ] * directionalLightWeightingBack;\n gl_Position = projectionMatrix * mvPosition;\n}",uniforms:{opacity:{type:"f",value:1},fogColor:{type:"c",value:new $3Dmol.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},directionalLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]}}},sprite:{fragmentShader:"uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\n vec4 texture = texture2D(map, vUV);\n if (texture.a < alphaTest) discard;\n gl_FragColor = vec4(color * texture.xyz, texture.a * opacity);\n if (fogType > 0) {\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n float fogFactor = 0.0;\n if (fogType == 1) {\n fogFactor = smoothstep(fogNear, fogFar, depth);\n }\n else {\n const float LOG2 = 1.442695;\n float fogFactor = exp2(- fogDensity * fogDensity * depth * depth * LOG2);\n fogFactor = 1.0 - clamp(fogFactor, 0.0, 1.0);\n }\n gl_FragColor = mix(gl_FragColor, vec4(fogColor, gl_FragColor.w), fogFactor);\n }\n}",vertexShader:"uniform int useScreenCoordinates;\nuniform vec3 screenPosition;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 alignment;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\n vUV = uvOffset + uv * uvScale;\n vec2 alignedPosition = position + alignment;\n vec2 rotatedPosition;\n rotatedPosition.x = ( cos(rotation) * alignedPosition.x - sin(rotation) * alignedPosition.y ) * scale.x;\n rotatedPosition.y = ( sin(rotation) * alignedPosition.x + cos(rotation) * alignedPosition.y ) * scale.y;\n vec4 finalPosition;\n if(useScreenCoordinates != 0) {\n finalPosition = vec4(screenPosition.xy + rotatedPosition, screenPosition.z, 1.0);\n }\n else {\n finalPosition = projectionMatrix * modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0); finalPosition /= finalPosition.w;\n finalPosition.xy += rotatedPosition; \n }\n gl_Position = finalPosition;\n}",uniforms:{}}},$3Dmol.autoload=function(b,c){if(void 0!==$(".viewer_3Dmoljs")[0]&&($3Dmol.autoinit=!0),$3Dmol.autoinit){b=null!=b?b:null,$3Dmol.viewers={};var d=0;$(".viewer_3Dmoljs").each(function(){var h,e,t=$(this),g=[],q=[];"static"==t.css("position")&&t.css("position","relative");var p=null;if(t.data("pdb"))g.push("https://files.rcsb.org/view/"+t.data("pdb")+".pdb"),q.push("pdb");else if(t.data("cid"))q.push("sdf"),g.push("https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/"+t.data("cid")+"/SDF?record_type=3d");else if(t.data("href")||t.data("url")){var u=t.data("href");g.push(u),p=u.substr(u.lastIndexOf(".")+1),q.push(p)}for(h in p=t.data(),p)"pdb"===h.substring(0,3)&&"pdb"!==h?(g.push("https://files.rcsb.org/view/"+p[h]+".pdb"),q.push("pdb")):"href"===h.substring(0,4)&&"href"!==h?(u=p[h],g.push(u),q.push(u.substr(u.lastIndexOf(".")+1))):"cid"===h.substring(0,3)&&"cid"!==h&&(g.push("https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/"+p[h]+"/SDF?record_type=3d"),q.push("sdf"));var m={};t.data("options")&&(m=$3Dmol.specStringToObject(t.data("options"))),p=$3Dmol.CC.color(t.data("backgroundcolor"));var l={line:{}};t.data("style")&&(l=$3Dmol.specStringToObject(t.data("style")));var n={};t.data("select")&&(n=$3Dmol.specStringToObject(t.data("select")));var y=[],f=[],x=[],w=t.data(),R=/style(.+)/,P=/surface(.*)/,A=/labelres(.*)/,T=[];for(G in w)w.hasOwnProperty(G)&&T.push(G);for(T.sort(),h=0;hl;++l)u[f+3*l]=s.r,u[f+1+3*l]=s.g,u[f+2+3*l]=s.b;0r.length)){var l=r[0];r=r[r.length-1];var u=o||axisDIV;if(l=$3Dmol.subdivide_spline(l,u),r=$3Dmol.subdivide_spline(r,u),i){var c,f,h,p,d;u=[],s=[[0,2,-6,-8],[-4,-2,6,4],[7,-1,-5,3],[-3,5,1,-7]];var m=0;for(d=l.length;mb;++b)x[_+3*b]=v.r,x[_+1+3*b]=v.g,x[_+2+3*b]=v.b;if(0b;b++)if(_=[a+s[b][0],a+s[b][1],a+s[b][2],a+s[b][3]],w[f=o.faceidx]=_[0],w[f+1]=_[1],w[f+2]=_[3],w[f+3]=_[1],w[f+4]=_[2],w[f+5]=_[3],o.faceidx+=6,g.clickable||$.clickable||g.hoverable||$.hoverable){p=u[_[3]].clone(),f=u[_[0]].clone();var D=u[_[2]].clone();if(h=u[_[1]].clone(),p.atom=u[_[3]].atom||null,D.atom=u[_[2]].atom||null,f.atom=u[_[0]].atom||null,h.atom=u[_[1]].atom||null,x){var S=p.clone().add(f).multiplyScalar(.5),C=D.clone().add(h).multiplyScalar(.5),A=p.clone().add(h).multiplyScalar(.5);0==b%2?(($.clickable||$.hoverable)&&(_=new $3Dmol.Triangle(S,A,p),c=new $3Dmol.Triangle(C,D,A),p=new $3Dmol.Triangle(A,D,p),$.intersectionShape.triangle.push(_),$.intersectionShape.triangle.push(c),$.intersectionShape.triangle.push(p)),(g.clickable||g.hoverable)&&(_=new $3Dmol.Triangle(f,h,A),c=new $3Dmol.Triangle(h,C,A),p=new $3Dmol.Triangle(f,A,S),g.intersectionShape.triangle.push(_),g.intersectionShape.triangle.push(c),g.intersectionShape.triangle.push(p))):((g.clickable||g.hoverable)&&(_=new $3Dmol.Triangle(S,A,p),c=new $3Dmol.Triangle(C,D,A),p=new $3Dmol.Triangle(A,D,p),g.intersectionShape.triangle.push(_),g.intersectionShape.triangle.push(c),g.intersectionShape.triangle.push(p)),($.clickable||$.hoverable)&&(_=new $3Dmol.Triangle(f,h,A),c=new $3Dmol.Triangle(h,C,A),p=new $3Dmol.Triangle(f,A,S),$.intersectionShape.triangle.push(_),$.intersectionShape.triangle.push(c),$.intersectionShape.triangle.push(p)))}else(g.clickable||g.hoverable)&&(_=new $3Dmol.Triangle(f,h,p),c=new $3Dmol.Triangle(h,D,p),g.intersectionShape.triangle.push(_),g.intersectionShape.triangle.push(c))}o.vertices+=8;var $=g}for(n=u.length-8,b=(o=t.updateGeoGroup(8)).vertexArray,x=o.colorArray,w=o.faceArray,_=3*(a=o.vertices),f=o.faceidx,m=0;4>m;m++)u.push(u[2*m]),u.push(u[n+2*m]),i=u[2*m],t=u[n+2*m],b[_+6*m]=i.x,b[_+1+6*m]=i.y,b[_+2+6*m]=i.z,b[_+3+6*m]=t.x,b[_+4+6*m]=t.y,b[_+5+6*m]=t.z,x[_+6*m]=v.r,x[_+1+6*m]=v.g,x[_+2+6*m]=v.b,x[_+3+6*m]=v.r,x[_+4+6*m]=v.g,x[_+5+6*m]=v.b;_=[a,a+2,a+6,a+4],c=[a+1,a+5,a+7,a+3],w[f]=_[0],w[f+1]=_[1],w[f+2]=_[3],w[f+3]=_[1],w[f+4]=_[2],w[f+5]=_[3],w[f+6]=c[0],w[f+7]=c[1],w[f+8]=c[3],w[f+9]=c[1],w[f+10]=c[2],w[f+11]=c[3],o.faceidx+=12,o.vertices+=8}else e(t,l,r,n,u,a)}}else if(!("rectangle"!==s&&"oval"!==s&&"parabola"!==s||(v=s,g=r.length,2>g||2>r[0].length))){for(o=o||axisDIV,$=0;$r*r+n*n+(e=e.z-t.z)*e)return!0}}return!1},o=function(e,t,r,n,o){null!=t&&0!=t.vertices&&(o&&(t.initTypedArrays(),t.setUpNormals()),(o=new $3Dmol.MeshDoubleLambertMaterial).vertexColors=$3Dmol.FaceColors,"number"==typeof r&&0<=r&&1>r&&(o.transparent=!0,o.opacity=r),o.outline=n,t=new $3Dmol.Mesh(t,o),e.add(t))},i={C:!0,CA:!0,O:!0,P:!0,OP2:!0,O2P:!0,"O5'":!0,"O3'":!0,"C5'":!0,"C2'":!0,"O5*":!0,"O3*":!0,"C5*":!0,"C2*":!0,N1:!0,N3:!0},a={DA:!0,DG:!0,A:!0,G:!0},s={DT:!0,DC:!0,U:!0,C:!0,T:!0},l={DA:!0,DG:!0,A:!0,G:!0,DT:!0,DC:!0,U:!0,C:!0,T:!0},u=function(e,u,f,h,p,d,m){d=d||5,m=m||5;var v,y,g=new $3Dmol.Geometry(!0),b=new $3Dmol.Geometry(!0),x=[],w=[],_=1,D=!1,S={};for(T in $3Dmol.Gradient.builtinGradients)$3Dmol.Gradient.builtinGradients.hasOwnProperty(T)&&(S[T]=new $3Dmol.Gradient.builtinGradients[T](f[1],f[0]));var C=function(e,t){return f&&"spectrum"===t.color?t.colorscheme in S?S[t.colorscheme].valueToHex(e.resi):S.sinebow.valueToHex(e.resi):$3Dmol.getColorFromStyle(e,t).getHex()};for(y=0;y3e4/d/m/2&&u(!0),"trace"===v.style){if(!T.hetflag&&("C"===T.elem&&"CA"===T.atom||A&&"P"===T.atom)){var k=C(T,v),I=$.isNumeric(v.thickness)?v.thickness:.4;if(n(L,T))if(k==O){var O=$3Dmol.CC.color(k);$3Dmol.GLDraw.drawCylinder(g,L,T,I,O,2,2)}else v=(new $3Dmol.Vector3).addVectors(L,T).multiplyScalar(.5),O=$3Dmol.CC.color(O),y=$3Dmol.CC.color(k),$3Dmol.GLDraw.drawCylinder(g,L,v,I,O,2,0),$3Dmol.GLDraw.drawCylinder(g,v,T,I,y,0,2);L=T,O=k}}else{if(T&&"C"===T.elem&&"CA"===T.atom||A&&("P"===T.atom||0==T.atom.indexOf("O5"))){if(j)if("tube end"===T.ss){var j=!1;y=new $3Dmol.Vector3(T.x,T.y,T.z),$3Dmol.GLDraw.drawCylinder(g,N,y,2,$3Dmol.CC.color(O),1,1),T.ss="h"}else{if(L.chain==T.chain&&"tube end"!==L.ss)continue;j=!1,L.ss="h",y=new $3Dmol.Vector3(L.x,L.y,L.z),$3Dmol.GLDraw.drawCylinder(g,N,y,2,$3Dmol.CC.color(O),1,1)}if(L&&(!n(L,T)||"tube start"===L.ss)){if("tube start"===L.ss){j=!0;var N=new $3Dmol.Vector3(L.x,L.y,L.z);L.ss="h"}if(F){y=q?(new $3Dmol.Vector3).addVectors(L,q).multiplyScalar(.5):new $3Dmol.Vector3(L.x,L.y,L.z),$3Dmol.GLDraw.drawCylinder(g,y,F,.4,$3Dmol.CC.color(F.color),0,2),c(w,d,!p,q,V,B,L,M,E),x.push(k);var F=y=null}for(y=0;!I&&yu.dot(i)&&u.negate(),u.multiplyScalar(l),l=0;li?(t=0,i=1):(t=-r/i,i=n/i),n=-t*r+i*n,1e-4>(r=Math.sqrt(n*n+o*o))?(o=0,n=1):(o/=r,n/=r),(r=new Float32Array(9))[0]=i,r[1]=t,r[2]=0,r[3]=-t*n,r[4]=i*n,r[5]=o,r[6]=t*o,r[7]=-i*o,r[8]=n,r}}(),r=function(){var e,t,r=[],n=Math.pow(2,4),o=Math.pow(2,2),i=n/o;for(r[0]=new $3Dmol.Vector3(-1,0,0),r[i]=new $3Dmol.Vector3(0,0,1),r[2*i]=new $3Dmol.Vector3(1,0,0),r[3*i]=new $3Dmol.Vector3(0,0,-1),e=3;4>=e;e++){for(i=n/(o=Math.pow(2,e-1)),t=0;t=c;c++){var p=0===c||10===c,d=5===c,m=[],v=[];for(u=0;u<=i;u++)if(d){var y=uMath.abs(y.x)&&(y.x=0),1e-5>Math.abs(y.y)&&(y.y=0),1e-5>Math.abs(y.z)&&(y.z=0),(o=t==$3Dmol.CAP.FLAT?new $3Dmol.Vector3(0,Math.cos(0+g*h),0):new $3Dmol.Vector3(y.x,y.y,y.z)).normalize(),a.push(y),s.push(o),m.push(a.length-1)):m.push(a.length-i)}d&&l.push(v),l.push(m)}return i={vertices:a,normals:s,verticesRows:l,w:i,h:10},e in this.cache||(this.cache[e]={}),this.cache[e][t+n]=i}};e.drawCylinder=function(e,r,o,i,a,s,l){if(r&&o){0;var u=l||s;a=a||{r:0,g:0,b:0};var c=[o.x,o.y,o.z];c[0]-=r.x,c[1]-=r.y,c[2]-=r.z,c=t(c);var f=n.getVerticesForRadius(i,l,"to"),h=f.w,p=f.h,d=u?p*h+2:2*h;e=e.updateGeoGroup(d);var m,v=f.vertices,y=f.normals,g=(f=f.verticesRows)[p/2],b=f[p/2+1],x=e.vertices,w=e.vertexArray,_=e.normalArray,D=e.colorArray,S=e.faceArray;for(m=0;me&&(r=10,n=8);var o,i,a=2*Math.PI,s=Math.PI;for(i=0;i<=n;i++){var l=[];for(o=0;o<=r;o++){var u=o/r,c=i/n,f={};f.x=-e*Math.cos(0+u*a)*Math.sin(0+c*s),f.y=e*Math.cos(0+c*s),f.z=e*Math.sin(0+u*a)*Math.sin(0+c*s),(u=new $3Dmol.Vector3(f.x,f.y,f.z)).normalize(),t.vertices.push(f),t.normals.push(u),l.push(t.vertices.length-1)}t.verticesRows.push(l)}return this.cache[e]=t}};return e.drawSphere=function(e,t,r,n){new $3Dmol.Vector3(t.x,t.y,t.z);for(var i=o.getVerticesForRadius(r),a=i.vertices,s=i.normals,l=(e=e.updateGeoGroup(a.length)).vertices,u=e.vertexArray,c=e.colorArray,f=e.faceArray,h=e.lineArray,p=e.normalArray,d=0,m=a.length;dn&&(r=a,.1<(n=d)))break}return r},o=new $3Dmol.Vector3(e.x,e.y,e.z),i=new $3Dmol.Vector3(t.x,t.y,t.z).clone(),a=null;if(i.sub(o),1===e.bonds.length)if(1===t.bonds.length)a=i.clone(),1e-4(a=n(e,t)).lengthSq()&&(null!=(t=n(t,e))&&(a=t));return.01>a.lengthSq()&&(a=i.clone(),1e-4s;s++)a[i+3*s]=t.x,a[i+3*s+1]=t.y,a[i+3*s+2]=t.z;for(a=e.normalArray,t=e.colorArray,s=0;4>s;s++)t[i+3*s]=n.r,t[i+3*s+1]=n.g,t[i+3*s+2]=n.b;a[i+0]=-r,a[i+1]=r,a[i+2]=0,a[i+3]=-r,a[i+4]=-r,a[i+5]=0,a[i+6]=r,a[i+7]=-r,a[i+8]=0,a[i+9]=r,a[i+10]=r,a[i+11]=0,e.vertices+=4,(r=e.faceArray)[(n=e.faceidx)+0]=o,r[n+1]=o+1,r[n+2]=o+2,r[n+3]=o+2,r[n+4]=o+3,r[n+5]=o,e.faceidx+=6},T=function(e,t){if(e.style.sphere){var r=e.style.sphere;if(!r.hidden){var n=_(e,r);if(r=$3Dmol.getColorFromStyle(e,r),(!0===e.clickable||e.hoverable)&&void 0!==e.intersectionShape){var o=new $3Dmol.Vector3(e.x,e.y,e.z);e.intersectionShape.sphere.push(new $3Dmol.Sphere(o,n))}M(t,e,n,r)}}},z=function(e,t,r,n,o,i,a){i=(e=e.updateGeoGroup(4)).vertices,a=e.vertexArray;var s=e.colorArray,l=e.radiusArray,u=e.normalArray,c=o.r,f=o.g;o=o.b;for(var h=3*i,p=0;4>p;p++){if(a[h]=t.x,u[h]=r.x,s[h]=c,a[++h]=t.y,u[h]=r.y,s[h]=f,a[++h]=t.z,u[h]=r.z,2>p)s[h]=o;else{var d=-o;0==d&&(d=-1e-4),s[h]=d}h++}e.vertices+=4,l[i]=-n,l[i+1]=n,l[i+2]=-n,l[i+3]=n,(t=e.faceArray)[(r=e.faceidx)+0]=i,t[r+1]=i+1,t[r+2]=i+2,t[r+3]=i+2,t[r+4]=i+3,t[r+5]=i,e.faceidx+=6};this.getCrystData=function(){return m.cryst?m.cryst:null},this.getSymmetries=function(){return void 0===m.symmetries&&(m.symmetries=[v]),m.symmetries},this.setSymmetries=function(e){m.symmetries=void 0===e?[v]:e},this.getID=function(){return n},this.getNumFrames=function(){return null!=l.numFrames?l.numFrames:l.length};var E=function(e,t,r,n){return(e=t-e)<-r?t+n:e>r?t-n:t};this.setFrame=function(e){var t=this.getNumFrames();return new Promise(function(r,n){0==t&&r(),(0>e||e>=t)&&(e=t-1),null!=l.url?$3Dmol.getbin(l.url+"/traj/frame/"+e+"/"+l.path,null,"POST").then(function(e){e=new Float32Array(e,44);for(var t=0,n=0;n=r&&e<=n)return!0}return!1};this.atomIsSelected=function(e,t){var r;if(void 0===t)return!0;var n,o=!!t.invert,i=!0;for(n in t)if("and"==n||"or"==n||"not"==n){if("not"==n){if(this.atomIsSelected(e,t[n])){i=!1;break}}else if("and"==n){var a=t[n];for(r=0;r=(o=parseFloat(e.expand)))o=n;else{for(i=$3Dmol.getExtent(n),r=[[],[],[]],t=0;3>t;t++)r[0][t]=i[0][t]-o,r[1][t]=i[1][t]+o,r[2][t]=i[2][t];for(o=[],t=0;t=r[0][0]&&a<=r[1][0]&&l>=r[0][1]&&l<=r[1][1]&&u>=r[0][2]&&u<=r[1][2]&&(a>=i[0][0]&&a<=i[1][0]&&l>=i[0][1]&&l<=i[1][1]&&u>=i[0][2]&&u<=i[1][2]||o.push(s[t]))}}for(a=n.length,i=0;i=a||(i={b:i,e:a},1!=(a=o.bondOrder[n])&&(i.o=a),t.b.push(i))}}return t},this.globj=function(e,t){if(null===h){var r=s,n=t;n=n||{};var o=new $3Dmol.Object3D,i=[],a={},l={},u=C;if(n.supportsImposters){u=T;var c=new $3Dmol.Geometry(!0);c.imposter=!0;var d=new $3Dmol.Geometry(!0,!0);d.imposter=!0,d.sphereGeometry=new $3Dmol.Geometry(!0),d.sphereGeometry.imposter=!0,d.drawnCaps={}}else n.supportsAIA?(u=A,(c=new $3Dmol.Geometry(!1,!0,!0)).instanced=!0):c=new $3Dmol.Geometry(!0),d=new $3Dmol.Geometry(!0);var v,g,b={},x=[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],$=0;for(g=r.length;$Y;Y++){var X=3*V.vertices;if(V.vertices++,H[X]=N.x+B[Y][0],H[X+1]=N.y+B[Y][1],H[X+2]=N.z+B[Y][2],W[X]=G.r,W[X+1]=G.g,W[X+2]=G.b,U){var K=new $3Dmol.Vector3(B[Y][0],B[Y][1],B[Y][2]);K.multiplyScalar(.1),K.set(K.x+N.x,K.y+N.y,K.z+N.z),N.intersectionShape.line.push(K)}}}}var Z=void 0,Q=void 0,J=void 0,ee=void 0,te=void 0,re=void 0,ne=E,oe=r,ie=a;if(ne.style.line){var ae=ne.style.line;if(!ae.hidden){var se=ae.linewidth||1;ie[se]||(ie[se]=new $3Dmol.Geometry);for(var le=ie[se].updateGeoGroup(6*ne.bonds.length),ue=le.vertexArray,ce=le.colorArray,fe=0;fe=he.serial)){var pe=new $3Dmol.Vector3(ne.x,ne.y,ne.z),de=new $3Dmol.Vector3(he.x,he.y,he.z),me=pe.clone().add(de).multiplyScalar(.5),ve=!1,ye=ne.clickable||ne.hoverable,ge=he.clickable||he.hoverable;(ye||ge)&&(ye&&(void 0===ne.intersectionShape&&(ne.intersectionShape={sphere:[],cylinder:[],line:[],triangle:[]}),ne.intersectionShape.line.push(pe),ne.intersectionShape.line.push(me)),ge&&(void 0===he.intersectionShape&&(he.intersectionShape={sphere:[],cylinder:[],line:[],triangle:[]}),he.intersectionShape.line.push(me),he.intersectionShape.line.push(de)));var be=$3Dmol.getColorFromStyle(ne,ne.style.line),xe=$3Dmol.getColorFromStyle(he,he.style.line);if(ne.bondStyles&&ne.bondStyles[fe]){var we=ne.bondStyles[fe];if(!we.iswire)continue;we.radius&&(bondR=we.radius),we.singleBond&&(ve=!0),void 0!==we.color1&&(be=$3Dmol.CC.color(we.color1)),void 0!==we.color2&&(xe=$3Dmol.CC.color(we.color2))}var _e=3*le.vertices;if(1ne.bondOrder[fe]&&!ve){var De=D(ne,he,fe),Se=de.clone();Se.sub(pe),2==ne.bondOrder[fe]?(De.multiplyScalar(.1),(ee=pe.clone()).add(De),(J=pe.clone()).sub(De),(Q=ee.clone()).add(Se),(Z=J.clone()).add(Se),be==xe?(le.vertices+=4,S(ue,ce,_e,ee,Q,be),S(ue,ce,_e+6,J,Z,be)):(le.vertices+=8,Se.multiplyScalar(.5),(te=ee.clone()).add(Se),(re=J.clone()).add(Se),S(ue,ce,_e,ee,te,be),S(ue,ce,_e+6,te,Q,xe),S(ue,ce,_e+12,J,re,be),S(ue,ce,_e+18,re,Z,xe))):3==ne.bondOrder[fe]&&(De.multiplyScalar(.1),(ee=pe.clone()).add(De),(J=pe.clone()).sub(De),(Q=ee.clone()).add(Se),(Z=J.clone()).add(Se),be==xe?(le.vertices+=6,S(ue,ce,_e,pe,de,be),S(ue,ce,_e+6,ee,Q,be),S(ue,ce,_e+12,J,Z,be)):(le.vertices+=12,Se.multiplyScalar(.5),(te=ee.clone()).add(Se),(re=J.clone()).add(Se),S(ue,ce,_e,pe,me,be),S(ue,ce,_e+6,me,de,xe),S(ue,ce,_e+12,ee,te,be),S(ue,ce,_e+18,te,Q,xe),S(ue,ce,_e+24,J,re,be),S(ue,ce,_e+30,re,Z,xe)))}else be==xe?(le.vertices+=2,S(ue,ce,_e,pe,de,be)):(le.vertices+=4,S(ue,ce,_e,pe,me,be),S(ue,ce,_e+6,me,de,xe))}}}}var Ce=void 0,Ae=void 0,$e=void 0,Me=void 0,Te=void 0,ze=void 0,Ee=void 0,Le=void 0,ke=void 0,Ie=void 0,Oe=void 0,je=void 0,Ne=void 0,Fe=E,Pe=r,Re=d;if(Fe.style.stick){var Ve=Fe.style.stick;if(!Ve.hidden){var qe=Ve.radius||.25,Be=Ve.singleBonds||!1,Ue=0,Ge=0,He=$3Dmol.getColorFromStyle(Fe,Ve);!Fe.capDrawn&&4>Fe.bonds.length&&(Ue=2);var We=$3Dmol.GLDraw.drawCylinder;Re.imposter&&(We=z);for(var Ye=0;YeXe.bonds.length&&(Ge=2),He!=Ze?(We(Re,Qe,Ae=(new $3Dmol.Vector3).addVectors(Qe,Je).multiplyScalar(.5),$e,He,Ue,0),We(Re,Ae,Je,$e,Ze,0,Ge)):We(Re,Qe,Je,$e,He,Ue,Ge),ze=Fe.clickable||Fe.hoverable,Ee=Xe.clickable||Xe.hoverable,ze||Ee){if(Ae||(Ae=(new $3Dmol.Vector3).addVectors(Qe,Je).multiplyScalar(.5)),ze){var et=new $3Dmol.Cylinder(Qe,Ae,$e),tt=new $3Dmol.Sphere(Qe,$e);Fe.intersectionShape.cylinder.push(et),Fe.intersectionShape.sphere.push(tt)}if(Ee){var rt=new $3Dmol.Cylinder(Je,Ae,$e),nt=new $3Dmol.Sphere(Je,$e);Xe.intersectionShape.cylinder.push(rt),Xe.intersectionShape.sphere.push(nt)}}}else if(1x[1]&&(x[1]=E.resi)),i.push(E))}}if(0b.sphere&&0<=b.sphere&&(vt.transparent=!0,vt.opacity=b.sphere),yt=new $3Dmol.Mesh(c,vt),o.add(yt)}if(0b.stick&&0<=b.stick&&(xt.transparent=!0,xt.opacity=b.stick,wt.transparent=!0,wt.opacity=b.stick);var _t=new $3Dmol.Mesh(d,xt);if(o.add(_t),gt){var Dt=new $3Dmol.Mesh(gt,wt);o.add(Dt)}}for($ in a)if(a.hasOwnProperty($)){var St=$,Ct=new $3Dmol.LineBasicMaterial({linewidth:St,vertexColors:!0});1>b.line&&0<=b.line&&(Ct.transparent=!0,Ct.opacity=b.line),a[$].initTypedArrays();var At=new $3Dmol.Line(a[$],Ct,$3Dmol.LinePieces);o.add(At)}for($ in l)if(l.hasOwnProperty($)){St=$;var $t=new $3Dmol.LineBasicMaterial({linewidth:St,vertexColors:!0});1>b.cross&&0<=b.cross&&($t.transparent=!0,$t.opacity=b.cross),l[$].initTypedArrays();var Mt=new $3Dmol.Line(l[$],$t,$3Dmol.LinePieces);o.add(Mt)}if(y&&m.symmetries&&0MOLECULE/gm)?"mol2":e.match(/^HETATM/gm)||e.match(/^ATOM/gm)?"pdb":e.match(/ITEM: TIMESTEP/gm)?"lammpstrj":e.match(/^.*\n.*\n.\s*(\d+)\s+(\d+)/gm)?"sdf":e.match(/^%VERSION\s+\VERSION_STAMP/gm)?"prmtop":"xyz",console.log("Best guess: "+t))),(0,$3Dmol.Parsers[t])(e,r)},e.setAtomDefaults=function(e,r){for(var n=0;nt.length)console.log("Too few points in addCurve");else{var r=e.radius||.1,n=$3Dmol.CC.color(e.color),o=0,i=t.length-1,a=t[0].distanceTo(t[1]),s=Math.ceil(2*r/a);for(e.toArrow&&(a={start:t[i-=s],end:t[t.length-1],radius:r,color:n,mid:1e-4},this.addArrow(a)),e.fromArrow&&(a={start:t[o+=s],end:t[0],radius:r,color:n,mid:1e-4},this.addArrow(a)),e=Math.ceil(t.length/2),r={radius:r,color:n,fromCap:2,toCap:2};oe?0:2,r.toCap=2),this.addCylinder(r)}},this.addLine=function(e){e.start=e.start||{},e.end=e.end||{};var t=new $3Dmol.Vector3(e.start.x||0,e.start.y||0,e.start.z||0);void 0===(e=new $3Dmol.Vector3(e.end.x,e.end.y||0,e.end.z||0)).x&&(e.x=3);var r=l.updateGeoGroup(2),o=r.vertices,a=3*o,s=r.vertexArray;s[a]=t.x,s[a+1]=t.y,s[a+2]=t.z,s[a+3]=e.x,s[a+4]=e.y,s[a+5]=e.z,r.vertices+=2,(a=r.lineArray)[s=r.lineidx]=o,a[s+1]=o+1,r.lineidx+=2,r=new $3Dmol.Vector3,i.push({centroid:r.addVectors(t,e).multiplyScalar(.5)}),r=l.updateGeoGroup(0),n(this.boundingSphere,i,r.vertexArray,r.vertices)},this.addArrow=function(e){if(e.start=e.start||{},e.end=e.end||{},e.start=new $3Dmol.Vector3(e.start.x||0,e.start.y||0,e.start.z||0),e.dir instanceof $3Dmol.Vector3&&e.length instanceof number){var t=e.dir.clone().multiplyScalar(e.length).add(start);e.end=t}else e.end=new $3Dmol.Vector3(e.end.x,e.end.y||0,e.end.z||0),void 0===e.end.x&&(e.end.x=3);e.radius=e.radius||.1,e.radiusRatio=e.radiusRatio||1.618034,e.mid=0e.mid?e.mid:.618034;var r=e.start,o=e.end,a=e.radius,s=e.radiusRatio,u=e.mid;if(r&&o){t=l.updateGeoGroup(51);var c=o.clone();c.sub(r).multiplyScalar(u);var f=r.clone().add(c);u=c.clone().negate(),this.intersectionShape.cylinder.push(new $3Dmol.Cylinder(r.clone(),f.clone(),a)),this.intersectionShape.sphere.push(new $3Dmol.Sphere(r.clone(),a));var h=[];h[0]=c.clone(),1e-4c?c=t.coords[d].x:t.coords[d].xf?f=t.coords[d].y:t.coords[d].yh?h=t.coords[d].z:t.coords[d].zo&&i[d].xm&&i[d].yv&&i[d].zthis.opacity,opacity:this.opacity,wireframeLinewidth:this.linewidth}):new $3Dmol.MeshLambertMaterial({wireframe:this.wireframe,side:this.side,transparent:1>this.opacity,opacity:this.opacity,wireframeLinewidth:this.linewidth}),r=new $3Dmol.Mesh(l,r),a.add(r),r=new $3Dmol.LineBasicMaterial({linewidth:this.linewidth,color:this.color}),r=new $3Dmol.Line(u,r,$3Dmol.LinePieces),a.add(r),s=a.clone(),e.add(s)}},this.removegl=function(e){s&&(void 0!==s.geometry&&s.geometry.dispose(),void 0!==s.material&&s.material.dispose(),e.remove(s),s=null),a=null}}var t=function(e){0<(e=e.updateGeoGroup(0)).vertices&&e.truncateArrayBuffers(!0,!0)},r=function(e,t,r){var o=r.faceArr;0!==r.vertexArr.length&&0!==o.length||console.warn("Error adding custom shape component: No vertices and/or face indices supplied!"),void 0===(o=r.color)&&(o=e.color),o=$3Dmol.CC.color(o);for(var i=$3Dmol.splitMesh(r),a=0,s=i.length;ae.vertexArr.length)return[e];var t=[{vertexArr:[],normalArr:[],faceArr:[]}];e.colorArr&&(t.colorArr=[]);for(var r=[],n=[],o=0,i=e.faceArr,a=0,s=i.length;au;u++){var c=i[a+u];r[c]!==o&&(r[c]=o,n[c]=l.vertexArr.length,l.vertexArr.push(e.vertexArr[c]),e.normalArr&&e.normalArr[c]&&l.normalArr.push(e.normalArr[c]),e.colorArr&&e.colorArr[c]&&l.colorArr.push(e.colorArr[c])),l.faceArr.push(n[c])}64e3<=l.vertexArr.length&&(t.push({vertexArr:[],normalArr:[],faceArr:[]}),e.colorArr&&(t.colorArr=[]),o++)}return t},$3Dmol.GLViewer=function(e,t){function r(e){var t=[];if(void 0===e.model)for(e=0;er&&(r+=d.length),t[e]=d[r]}return t}function n(e){var t=[];void 0===e&&(e={});for(var n=r(e),o=0;o--H&&(H=0)},re=function(){var e,t=0;for(e in m)if(m.hasOwnProperty(e)){var r=parseInt(e);isNaN(r)||(e=r),e>t&&(t=e)}return t+1},ne=function(){var e=O.position.z-R.position.z;1>e&&(e=1),O.near=e+q,1>O.near&&(O.near=1),O.far=e+B,O.near+1>O.far&&(O.far=O.near+1),O.fov=20,O.right=e*Math.tan(Math.PI/180*20),O.left=-O.right,O.top=O.right/I,O.bottom=-O.top,O.updateProjectionMatrix(),P.fog.near=O.near+.4*(O.far-O.near),P.fog.far=O.far,t.disableFog&&(P.fog.near=P.fog.far)},oe=function(e){if(A.setViewport(),P&&(ne(),A.render(P,O),!e&&0r&&(e=r)}return t.upperZoomLimit&&0(e=.85*(150-R.position.z))&&(e=80),R.position.z=Q+s*e,R.position.z=ue(R.position.z)):1==t||2==ce||e.ctrlKey?(e=function(e,t){e/=D,t/=S;var r=R.quaternion,n=new $3Dmol.Vector3(0,0,R.position.z);return F.projectVector(n,O),n.x+=2*e,n.y-=2*t,F.unprojectVector(n,O),n.z=0,n.applyQuaternion(r),n}(u*(i-Y),c*(a-X)),V.position.addVectors(Z,e)):0!==t&&1!=ce||0===l||(e=Math.sin(l*Math.PI)/l,G.x=Math.cos(l*Math.PI),G.y=0,G.z=e*o,G.w=-e*s,R.quaternion=new $3Dmol.Quaternion(1,0,0,0),R.quaternion.multiply(G),R.quaternion.multiply(U)),oe()}}},me=function(e){D=(h=e).width(),S=h.height(),I=A.getAspect(D,S),A.setSize(D,S),h.append(A.domElement),p=$(A.domElement),u||(p.bind("mousedown touchstart",fe),p.bind("DOMMouseScroll mousewheel",he),p.bind("mousemove touchmove",de),p.bind("contextmenu",function(e){e.preventDefault()}))};me(h),this.setContainer=function(e){return"string"===$.type(e)&&(e=$("#"+e)),e||(e=h),me(e),this},this.setBackgroundColor=function(e,t){return void 0===t?t=1:(0>t||1n&&(t=t.clone().multiplyScalar(-1),n=-n),1n&&(n=-1),r*=Math.acos(n),(t=t.clone()).sub(e.clone().multiplyScalar(n)),t.normalize(),n=Math.cos(r),r=Math.sin(r),(e=new $3Dmol.Quaternion(e.x*n+t.x*r,e.y*n+t.y*r,e.z*n+t.z*r,e.w*n+t.w*r)).normalize(),e)};this.spin=function(e){if(clearInterval(ve),void 0===e&&(e="y"),"boolean"==typeof e){if(!e)return;e="y"}Array.isArray(e)&&(e={x:e[0],y:e[1],z:e[2]});var t=this;ve=setInterval(function(){t.rotate(1,e)},25)};var ge=function(e,t,r,n,o,i){var a=Math.ceil(e/20);1>a&&(a=1),H++,e=V.position.clone();var s=R.position.z,l=R.quaternion.clone(),u=j.clone();if(t){for(var c=(a=Array(a)).length,f=0;f(e=Math.sqrt(e*e+r*r+t*t))&&(e=5),q=-e/1.9,B=e/2,this},this.center=function(e,t,r){t=void 0!==t?t:0;var o=n(e=e||{}),i=$3Dmol.getExtent(o);if($.isEmptyObject(e)){$.each(v,function(e,t){t&&t.boundingSphere&&t.boundingSphere.center&&(e=t.boundingSphere.center,0<(t=t.boundingSphere.radius)?(o.push(new $3Dmol.Vector3(e.x+t,e.y,e.z)),o.push(new $3Dmol.Vector3(e.x-t,e.y,e.z)),o.push(new $3Dmol.Vector3(e.x,e.y+t,e.z)),o.push(new $3Dmol.Vector3(e.x,e.y-t,e.z)),o.push(new $3Dmol.Vector3(e.x,e.y,e.z+t)),o.push(new $3Dmol.Vector3(e.x,e.y,e.z-t))):o.push(e))}),i=$3Dmol.getExtent(o),e=o;var a=i}else e=n({}),a=$3Dmol.getExtent(e);e=new $3Dmol.Vector3(i[2][0],i[2][1],i[2][2]);var s=a[1][0]-a[0][0],l=a[1][1]-a[0][1];for(a=a[1][2]-a[0][2],5>(s=Math.sqrt(s*s+l*l+a*a))&&(s=5),q=-s/1.9,B=s/2,s=i[1][0]-i[0][0],l=i[1][1]-i[0][1],a=i[1][2]-i[0][2],5>(s=Math.sqrt(s*s+l*l+a*a))&&(s=5),i=25,s=0;si&&(i=l);return s=2*Math.sqrt(i),e=e.clone().multiplyScalar(-1),0(l=Math.sqrt(l*l+u*u+s*s))&&(l=5),q=-l/1.9,B=l/2,0===Object.keys(e).length&&(q=-999999,B=999999),l=i[1][0]-i[0][0],u=i[1][1]-i[0][1],s=i[1][2]-i[0][2],5>(l=Math.sqrt(l*l+u*u+s*s))&&(l=5),e=25,i=0;ie&&(e=l);return l=2*Math.sqrt(e),a=a.clone().multiplyScalar(-1),e=-(.5*l/Math.tan(Math.PI/180*O.fov/2)-150),e=ue(e),0l){e.start=r,e.end=n,t.addLine(e);break}a.addVectors(r,u),e.start=r,e.end=a,t.addLine(e),r=a.clone(),s+=c,a.addVectors(r,o),r=a.clone(),s+=i}t.finalize()}else t.addLine(e);return v.push(t),t.finalize(),t},this.addUnitCell=function(e){e||(e=this.getModel());var t=new $3Dmol.GLShape({wireframe:!0});t.shapePosition=v.length;var r=e.getCrystData();if(r){if(r.matrix)e=r.matrix;else{e=r.a;var n=r.b,o=r.c,i=r.alpha,a=r.beta;r=r.gamma,i=i*Math.PI/180,a=a*Math.PI/180,r=r*Math.PI/180;var s=Math.cos(a);i=(Math.cos(i)-Math.cos(a)*Math.cos(r))/Math.sin(r),e=new $3Dmol.Matrix4(e,n*Math.cos(r),o*s,0,0,n*Math.sin(r),o*i,0,0,0,o*Math.sqrt(Math.max(0,1-s*s-i*i)),0,0,0,0,1)}for(n=[new $3Dmol.Vector3(0,0,0),new $3Dmol.Vector3(1,0,0),new $3Dmol.Vector3(0,1,0),new $3Dmol.Vector3(0,0,1),new $3Dmol.Vector3(1,1,0),new $3Dmol.Vector3(0,1,1),new $3Dmol.Vector3(1,0,1),new $3Dmol.Vector3(1,1,1)],o=0;oe&&(e=d[t].getNumFrames());return e},this.animate=function(e){H++;var t=100,r="forward",n=0;(e=e||{}).interval&&(t=e.interval),e.loop&&(r=e.loop),e.reps&&(n=e.reps);var o=this.getNumFrames(),i=this,a=0,s=1;e.step&&(n/=s=e.step);var l=0,u=o*n,c=new Date,f=function(){if(i.render(),++l!=u&&i.isAnimated()){var e=t-(new Date-c);setTimeout(h,0t[1][0]||o.yt[1][1]||o.zt[1][2]||r.push(o))}return r},we=function(e){return(e[1][0]-e[0][0])*(e[1][1]-e[0][1])*(e[1][2]-e[0][2])},_e=function(e,t,r){var n=new $3Dmol.Geometry(!0),o=n.updateGeoGroup(0),i=[],a=0;for(l=e.length;awe(e))return[e];var t=e[1][0]-e[0][0],r=e[1][1]-e[0][1],n=e[1][2]-e[0][2];return r=t>r&&t>n?0:r>t&&r>n?1:2,n=l(e),t=l(e),e=(e[1][r]-e[0][r])/2+e[0][r],n[1][r]=e,t[0][r]=e,e=u(n),t=u(t),e.concat(t)};for(i=0,a=(e=u(e)).length;ie&&(e=0),d=0,u=4;d=e?(rt&&(r=t),{lo:e,hi:t,val:r}):(r>e&&(r=e),rv&&(v=b),(d=t.backgroundHeight?t.backgroundHeight:g.height)>y&&(y=d)}this.canvas.width=v,this.canvas.height=y,this.context.clearRect(0,0,this.canvas.width,this.canvas.height),d="",t.bold&&(d="bold "),this.context.font=d+i+"px "+o,this.context.fillStyle="rgba("+u.r+","+u.g+","+u.b+","+u.a+")",this.context.strokeStyle="rgba("+c.r+","+c.g+","+c.b+","+c.a+")",this.context.lineWidth=l,n&&(u=o=l,v-=2*l,y-=2*l,c=0y[e]&&(y[e]=i.length,i.push(s)),y[e])};var g=new Int32Array(12),b=u?n:t;for(u=u?o:r,s=0;sD;++D)_|=!!(2&e[(d*(s+((4&D)>>2))+x+((2&D)>>1))*m+w+(1&D)])<a;a++)s[a]=Array(t.length);for(a=0,n=t.length;as[0][a])i[a].x=t[a].x,i[a].y=t[a].y,i[a].z=t[a].z;else if(3==s[0][a]||4==s[0][a]){for(i[a].x=0,i[a].y=0,h=i[a].z=0,o=s[0][a];hMath.abs(i.resi-o.resi)||(ar.length)return t;if(!r[1].match(/\d+/))return console.log("Warning: second line of the vasp structure file must be a number"),t;if(0>(e=parseFloat(r[1])))return console.log("Warning: Vasp implementation for negative lattice lengths is not yet available"),t;var n=new Float32Array(r[2].replace(/^\s+/,"").split(/\s+/)),o=new Float32Array(r[3].replace(/^\s+/,"").split(/\s+/)),i=new Float32Array(r[4].replace(/^\s+/,"").split(/\s+/)),a=new $3Dmol.Matrix4(n[0],n[1],n[2],0,o[0],o[1],o[2],0,i[0],i[1],i[2],0,0,0,0,1);a.multiplyScalar(e),t.modelData=[{symmetries:[],cryst:{matrix:a}}],a=r[5].replace(/\s+/,"").replace(/\s+$/,"").split(/\s+/);var s=new Int16Array(r[6].replace(/^\s+/,"").split(/\s+/)),l=r[7].replace(/\s+/,"");if(l.match(/C/))l="cartesian";else{if(!l.match(/D/))return console.log("Warning: Unknown vasp mode in POSCAR file: mode must be either C(artesian) or D(irect)"),t;l="direct"}if(a.length!=s.length)return console.log("Warning: declaration of atomary species wrong:"),console.log(a),console.log(s),t;r.splice(0,8);for(var u=0,c=0,f=a.length;c(e=e.replace(/^\s+/,"").split(/\n\r|\r+/)).length)return r;var n=e[2].replace(/^\s+/,"").replace(/\s+/g," ").split(" "),o=Math.abs(parseFloat(n[0]));n=e[3].replace(/^\s+/,"").replace(/\s+/g," ").split(" "),n=0o.length);){var i=parseInt(o[0]);if(isNaN(i)||0>=i)break;if(o.lengthe.length);){var o=parseInt(e[3].substr(0,3));if(isNaN(o)||0>=o)break;var i=parseInt(e[3].substr(3,3)),a=4;if(e.length<4+o+i)break;var s=[],l=r[r.length-1].length,u=l+o;for(o=l;od;d++)for(v=m[d].split("+"),y=0;yMOLECULE/),i=e.search(/@ATOM/);if(-1==o||-1==i)return r;for(e=e.substr(o,e.length).split(/\r?\n|\r/);0ATOM"==e[l]){u=l+1;break}for(s=(l=r[r.length-1].length)+s;lBOND"==e[u++]){l=!0;break}if(l&&i)for(l=0;lr)return!1;var i=e.y-t.y;if((i*=i)>r)return!1;var a=e.z-t.z;return!((a*=a)>r)&&(n=n+i+a,!isNaN(n)&&(!(.5>n)&&(!(n>r)&&(e.altLoc==t.altLoc||" "==e.altLoc||" "==t.altLoc))))},a=function(e,t,r){var n,o,i=r.length,a=i;if(t){if(1O;O++)if(z=u[T=x[T=parseInt(_.substr(M[O],5))]],void 0!==A&&void 0!==z)if(w[[$,T]])for(w[[$,T]]+=1,z=0;z=O;O++)if(_=f[c].replace(/^\s*/,""),parseInt(_.substr(18,1))==O)$.elements[O-1]=parseFloat(_.substr(23,10)),$.elements[O-1+4]=parseFloat(_.substr(33,10)),$.elements[O-1+8]=parseFloat(_.substr(43,10)),$.elements[O-1+12]=parseFloat(_.substr(53)),c++;else for(;"BIOMT"==_.substr(13,5);)_=f[++c].replace(/^\s*/,"");$.elements[3]=0,$.elements[7]=0,$.elements[11]=0,$.elements[15]=1,g.symmetries.push($),c--}}for((new Date).getTime(),f=0,h=(c=u).length;f_.bonds.indexOf(O)&&(_.bonds.push(O),_.bondOrder.push(y.bondOrder[w]));r(u),m||a(g.symmetries,v,u),d&&!p&&((new Date).getTime(),n(u)),(new Date).getTime();e:{for(p in p=void 0,d=e){p=!1;break e}p=!0}if(!p)for(c=0;cu;u++)f=parseInt(l.substr([11,16,21,26][u],5)),h=o[o.length-1][s[f]],void 0!==c&&void 0!==h&&(c.bonds.push(s[f]),c.bondOrder.push(1))}for(a=0;a=g.length||l(g[U]!=B))&&(q=!0)}e.insCodeList&&String.fromCharCode(b[v]);var G=e.groupIdList[v],H=F.groupName;for(U=y,B=0;BR,chain:O,resi:G,icode:X,rescode:G+(" "!=X?"^"+X:""),serial:Z,altLoc:X,index:y,atom:Q,bonds:[],ss:l(R),ssbegin:V,ssend:q,bondOrder:[],properties:{charge:J,occupancy:K},b:Y})}}y+=1}for(V=F.bondAtomList,B=0,R=F.bondOrderList.length;B=y){z=B;break}q=k[q],W=k[G],H=L[q],G=L[W],H&&G&&(H.bonds.push(W),H.bondOrder.push(P),G.bonds.push(q),G.bondOrder.push(P))}if(t.multimodel&&(t.onemol||h.push([])),!u)for(A=0;A=u)return[];if(-1==(e=r("ATOM_NAME")))return[];for(var c=(l=n(e))[0],f=0;fe.length);){var n=parseInt(e[1]);if(isNaN(n)||0>=n)break;if(e.lengthn;n++)o[n]=10*parseFloat(o[n]);t.box=o}e.splice(0,++i)}for(a=0;an?_[r][indx]=-1:(o=Math.sqrt(n-o),_[r][indx]=Math.floor(o)),indx++}}},this.fillvoxels=function(e,t){var r,n=0;for(r=f.length;nh;h++)for(d=-1;2>d;d++)for(m=-1;2>m;m++)if(0!==h&&0!==d&&0!==m){var $=h*A,M=m*i;for(c=0;c<=_[x][S];c++){var T=c*d,z=y+$,E=g+T,L=b+M;if(!(0>z||0>E||0>L||z>=u||E>=l||L>=s))if(1&f[L=z*C+E*s+L]){var k=t[p[L]];k.serial!=e.serial&&($*$+T*T+M*M<(z=y+$-Math.floor(.5+a*(k.x+r)))*z+(E=g+T-Math.floor(.5+a*(k.y+n)))*E+(k=b+M-Math.floor(.5+a*(k.z+o)))*k&&(p[L]=e.serial))}else f[L]|=1,p[L]=e.serial}}S++}},this.fillvoxelswaals=function(e,t){var r,n=0;for(r=f.length;nh;h++)for(d=-1;2>d;d++)for(m=-1;2>m;m++)if(0!==h&&0!==d&&0!==m){var $=h*A,M=m*i;for(c=0;c<=_[S][y];c++){var T=c*d,z=g+$,E=b+T,L=x+M;if(!(0>z||0>E||0>L||z>=u||E>=l||L>=s))if(2&f[L=z*C+E*s+L]){var k=t[p[L]];k.serial!=e.serial&&($*$+T*T+M*M<(z=g+$-Math.floor(.5+a*(k.x+r)))*z+(E=b+T-Math.floor(.5+a*(k.y+n)))*E+(k=x+M-Math.floor(.5+a*(k.z+o)))*k&&(p[L]=e.serial))}else f[L]|=2,p[L]=e.serial}}y++}},this.buildboundary=function(){var e=l*s;for(i=0;ir;){var n=i+S[r][0],o=j+S[r][2],a=k+S[r][1];if(-1(e=a-.5)&&(e=0),i-=.5/(.1+e),e=0;e=i)&&(f[d]|=4)},this.fastoneshell=function(e,t){var r,n,o=[];if(0===e.length)return o;tnv={ix:-1,iy:-1,iz:-1};var i=l*s,a=0;for(n=e.length;ar;r++)if(tnv.ix=c+S[r][0],tnv.iy=p+S[r][1],tnv.iz=d+S[r][2],tnv.ixr;r++)tnv.ix=c+S[r][0],tnv.iy=p+S[r][1],tnv.iz=d+S[r][2],tnv.ixr;r++)tnv.ix=c+S[r][0],tnv.iy=p+S[r][1],tnv.iz=d+S[r][2],tnv.ixe||e>=this.size.x||0>t||t>=this.size.y||0>r||r>=this.size.z?0:this.data[e*this.size.y*this.size.z+t*this.size.z+r]},$3Dmol.VolumeData.prototype.getCoordinates=function(e){var t=e/(this.size.y*this.size.z),r=e%(this.size.y*this.size.z);return e%=this.size.z,t*=this.unit.x,r*=this.unit.y,e*=this.unit.z,{x:t+=this.origin.x,y:r+=this.origin.y,z:e+=this.origin.z}},$3Dmol.VolumeData.prototype.vasp=function(e){var t=e.replace(/^\s+/,"").split(/[\n\r]/),r=$3Dmol.Parsers.vasp(e)[0].length;if(0==r)console.log("No good formating of CHG or CHGCAR file, not atomic information provided in the file."),this.data=[];else{var n=parseFloat(t[1]),o=t[2].replace(/^\s+/,"").split(/\s+/);e=new $3Dmol.Vector3(parseFloat(o[0]),parseFloat(o[1]),parseFloat(o[2])).multiplyScalar(1.889725992*n),o=t[3].replace(/^\s+/,"").split(/\s+/);var i=new $3Dmol.Vector3(parseFloat(o[0]),parseFloat(o[1]),parseFloat(o[2])).multiplyScalar(1.889725992*n);o=t[4].replace(/^\s+/,"").split(/\s+/),o=new $3Dmol.Vector3(parseFloat(o[0]),parseFloat(o[1]),parseFloat(o[2])).multiplyScalar(1.889725992*n),n=e.x*(i.y*o.z-o.y*i.z)-i.x*(e.y*o.z-o.y*e.z)+o.x*(e.y*i.z-i.y*e.z),n=1/(n=Math.abs(n)/Math.pow(1.889725992,3)),t.splice(0,8+r+1);var a=t[0].replace(/^\s+/,"").replace(/\s+/g," ").split(" ");r=Math.abs(a[0]);var s=Math.abs(a[1]);a=Math.abs(a[2]);var l=this.origin=new $3Dmol.Vector3(0,0,0);for(this.size={x:r,y:s,z:a},this.unit=new $3Dmol.Vector3(e.x,i.y,o.z),e=e.multiplyScalar(1/(1.889725992*r)),i=i.multiplyScalar(1/(1.889725992*s)),o=o.multiplyScalar(1/(1.889725992*a)),0==e.y&&0==e.z&&0==i.x&&0==i.z&&0==o.x&&0==o.y||(this.matrix=new $3Dmol.Matrix4(e.x,i.x,o.x,0,e.y,i.y,o.y,0,e.z,i.z,o.z,0,0,0,0,1),this.matrix=this.matrix.multiplyMatrices(this.matrix,(new $3Dmol.Matrix4).makeTranslation(l.x,l.y,l.z)),this.origin=new $3Dmol.Vector3(0,0,0),this.unit=new $3Dmol.Vector3(1,1,1)),t.splice(0,1),(t=(t=(t=t.join(" ")).replace(/^\s+/,"")).split(/[\s\r]+/)).splice(r*s*a+1),t=new Float32Array(t),e=0;e(e=e.replace(/^\s+/,"").split(/[\n\r]+/)).length)){var t=e[2].replace(/^\s+/,"").replace(/\s+/g," ").split(" "),r=parseFloat(t[0]),n=Math.abs(r),o=this.origin=new $3Dmol.Vector3(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])),i=0<(t=e[3].replace(/^\s+/,"").replace(/\s+/g," ").split(" "))[0]?.529177:1;o.multiplyScalar(i);var a=Math.abs(t[0]),s=new $3Dmol.Vector3(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])).multiplyScalar(i);t=e[4].replace(/^\s+/,"").replace(/\s+/g," ").split(" ");var l=Math.abs(t[0]),u=new $3Dmol.Vector3(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])).multiplyScalar(i);t=e[5].replace(/^\s+/,"").replace(/\s+/g," ").split(" ");var c=Math.abs(t[0]);t=new $3Dmol.Vector3(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])).multiplyScalar(i),this.size={x:a,y:l,z:c},this.unit=new $3Dmol.Vector3(s.x,u.y,t.z),0==s.y&&0==s.z&&0==u.x&&0==u.z&&0==t.x&&0==t.y||(this.matrix=new $3Dmol.Matrix4(s.x,u.x,t.x,0,s.y,u.y,t.y,0,s.z,u.z,t.z,0,0,0,0,1),this.matrix=this.matrix.multiplyMatrices(this.matrix,(new $3Dmol.Matrix4).makeTranslation(o.x,o.y,o.z)),this.origin=new $3Dmol.Vector3(0,0,0),this.unit=new $3Dmol.Vector3(1,1,1)),o=6,0>r&&o++,e=(e=(e=e.splice(n+o).join(" ")).replace(/^\s+/,"")).split(/[\s\r]+/),this.data=new Float32Array(e)}},$3Dmol.VolumeData.prototype.ccp4=function(e){var t;e=new Int8Array(e);var r=new Int32Array(e.buffer,0,56),n=new Float32Array(e.buffer,0,56),o=new DataView(e.buffer);String.fromCharCode(o.getUint8(208),o.getUint8(209),o.getUint8(210),o.getUint8(211));var i=[o.getUint8(212),o.getUint8(213)];if(17===i[0]&&17===i[1])for(i=e.byteLength,t=0;tt)self.atomData=e.atoms,self.volume=e.volume,self.ps=new ProteinSurface;else{var r=self.ps;r.initparm(e.expandedExtent,1!=t,self.volume),r.fillvoxels(self.atomData,e.extendedAtoms),r.buildboundary(),4!==t&&2!==t||(r.fastdistancemap(),r.boundingatom(!1),r.fillvoxelswaals(self.atomData,e.extendedAtoms)),r.marchingcube(t),e=r.getFacesAndVertices(e.atomsToShow),self.postMessage(e)}}}.toString().replace(/(^.*?\{|\}$)/g,""),$3Dmol.workerString+="; var ProteinSurface="+$3Dmol.ProteinSurface.toString().replace(/[a-zA-Z_$]{1}[0-9a-zA-Z_$]*.MarchingCube./g,"MarchingCube."),$3Dmol.workerString+=",MarchingCube=("+$3Dmol.MarchingCubeInitializer.toString()+")();",$3Dmol.SurfaceWorker=window.URL?window.URL.createObjectURL(new Blob([$3Dmol.workerString],{type:"text/javascript"})):{postMessage:function(){}},$3Dmol.workerString=$3Dmol.workerString,$3Dmol.SurfaceWorker=$3Dmol.SurfaceWorker}).call(this,__webpack_require__(51))},162:function(e,t,r){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function r(e){return a(e)?e:H(e)}function n(e){return s(e)?e:W(e)}function o(e){return l(e)?e:Y(e)}function i(e){return a(e)&&!u(e)?e:X(e)}function a(e){return!(!e||!e[f])}function s(e){return!(!e||!e[h])}function l(e){return!(!e||!e[p])}function u(e){return s(e)||l(e)}function c(e){return!(!e||!e[d])}t(n,r),t(o,r),t(i,r),r.isIterable=a,r.isKeyed=s,r.isIndexed=l,r.isAssociative=u,r.isOrdered=c,r.Keyed=n,r.Indexed=o,r.Set=i;var f="@@__IMMUTABLE_ITERABLE__@@",h="@@__IMMUTABLE_KEYED__@@",p="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",m=5,v=1<>>0;if(""+r!==t||4294967295===r)return NaN;t=r}return t<0?C(e)+t:t}function $(){return!0}function M(e,t,r){return(0===e||void 0!==r&&e<=-r)&&(void 0===t||void 0!==r&&t>=r)}function T(e,t){return E(e,t,0)}function z(e,t){return E(e,t,t)}function E(e,t,r){return void 0===e?r:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var L=0,k=1,I=2,O="function"==typeof Symbol&&Symbol.iterator,j="@@iterator",N=O||j;function F(e){this.next=e}function P(e,t,r,n){var o=0===e?t:1===e?r:[t,r];return n?n.value=o:n={value:o,done:!1},n}function R(){return{value:void 0,done:!0}}function V(e){return!!U(e)}function q(e){return e&&"function"==typeof e.next}function B(e){var t=U(e);return t&&t.call(e)}function U(e){var t=e&&(O&&e[O]||e[j]);if("function"==typeof t)return t}function G(e){return e&&"number"==typeof e.length}function H(e){return null==e?ie():a(e)?e.toSeq():function(e){var t=le(e)||"object"==typeof e&&new te(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}(e)}function W(e){return null==e?ie().toKeyedSeq():a(e)?s(e)?e.toSeq():e.fromEntrySeq():ae(e)}function Y(e){return null==e?ie():a(e)?s(e)?e.entrySeq():e.toIndexedSeq():se(e)}function X(e){return(null==e?ie():a(e)?s(e)?e.entrySeq():e:se(e)).toSetSeq()}F.prototype.toString=function(){return"[Iterator]"},F.KEYS=L,F.VALUES=k,F.ENTRIES=I,F.prototype.inspect=F.prototype.toSource=function(){return this.toString()},F.prototype[N]=function(){return this},t(H,r),H.of=function(){return H(arguments)},H.prototype.toSeq=function(){return this},H.prototype.toString=function(){return this.__toString("Seq {","}")},H.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},H.prototype.__iterate=function(e,t){return ue(this,e,t,!0)},H.prototype.__iterator=function(e,t){return ce(this,e,t,!0)},t(W,H),W.prototype.toKeyedSeq=function(){return this},t(Y,H),Y.of=function(){return Y(arguments)},Y.prototype.toIndexedSeq=function(){return this},Y.prototype.toString=function(){return this.__toString("Seq [","]")},Y.prototype.__iterate=function(e,t){return ue(this,e,t,!1)},Y.prototype.__iterator=function(e,t){return ce(this,e,t,!1)},t(X,H),X.of=function(){return X(arguments)},X.prototype.toSetSeq=function(){return this},H.isSeq=oe,H.Keyed=W,H.Set=X,H.Indexed=Y;var K,Z,Q,J="@@__IMMUTABLE_SEQ__@@";function ee(e){this._array=e,this.size=e.length}function te(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function re(e){this._iterable=e,this.size=e.length||e.size}function ne(e){this._iterator=e,this._iteratorCache=[]}function oe(e){return!(!e||!e[J])}function ie(){return K||(K=new ee([]))}function ae(e){var t=Array.isArray(e)?new ee(e).fromEntrySeq():q(e)?new ne(e).fromEntrySeq():V(e)?new re(e).fromEntrySeq():"object"==typeof e?new te(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function se(e){var t=le(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function le(e){return G(e)?new ee(e):q(e)?new ne(e):V(e)?new re(e):void 0}function ue(e,t,r,n){var o=e._cache;if(o){for(var i=o.length-1,a=0;a<=i;a++){var s=o[r?i-a:a];if(!1===t(s[1],n?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,r)}function ce(e,t,r,n){var o=e._cache;if(o){var i=o.length-1,a=0;return new F(function(){var e=o[r?i-a:a];return a++>i?{value:void 0,done:!0}:P(t,n?e[0]:a-1,e[1])})}return e.__iteratorUncached(t,r)}function fe(e,t){return t?function e(t,r,n,o){return Array.isArray(r)?t.call(o,n,Y(r).map(function(n,o){return e(t,n,o,r)})):pe(r)?t.call(o,n,W(r).map(function(n,o){return e(t,n,o,r)})):r}(t,e,"",{"":e}):he(e)}function he(e){return Array.isArray(e)?Y(e).map(he).toList():pe(e)?W(e).map(he).toMap():e}function pe(e){return e&&(e.constructor===Object||void 0===e.constructor)}function de(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if(e=e.valueOf(),t=t.valueOf(),e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function me(e,t){if(e===t)return!0;if(!a(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||s(e)!==s(t)||l(e)!==l(t)||c(e)!==c(t))return!1;if(0===e.size&&0===t.size)return!0;var r=!u(e);if(c(e)){var n=e.entries();return t.every(function(e,t){var o=n.next().value;return o&&de(o[1],e)&&(r||de(o[0],t))})&&n.next().done}var o=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{o=!0;var i=e;e=t,t=i}var f=!0,h=t.__iterate(function(t,n){if(r?!e.has(t):o?!de(t,e.get(n,g)):!de(e.get(n,g),t))return f=!1,!1});return f&&e.size===h}function ve(e,t){if(!(this instanceof ve))return new ve(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(Z)return Z;Z=this}}function ye(e,t){if(!e)throw new Error(t)}function ge(e,t,r){if(!(this instanceof ge))return new ge(e,t,r);if(ye(0!==r,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),r=void 0===r?1:Math.abs(r),tn?{value:void 0,done:!0}:P(e,o,r[t?n-o++:o++])})},t(te,W),te.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},te.prototype.has=function(e){return this._object.hasOwnProperty(e)},te.prototype.__iterate=function(e,t){for(var r=this._object,n=this._keys,o=n.length-1,i=0;i<=o;i++){var a=n[t?o-i:i];if(!1===e(r[a],a,this))return i+1}return i},te.prototype.__iterator=function(e,t){var r=this._object,n=this._keys,o=n.length-1,i=0;return new F(function(){var a=n[t?o-i:i];return i++>o?{value:void 0,done:!0}:P(e,a,r[a])})},te.prototype[d]=!0,t(re,Y),re.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var r=this._iterable,n=B(r),o=0;if(q(n))for(var i;!(i=n.next()).done&&!1!==e(i.value,o++,this););return o},re.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var r=this._iterable,n=B(r);if(!q(n))return new F(R);var o=0;return new F(function(){var t=n.next();return t.done?t:P(e,o++,t.value)})},t(ne,Y),ne.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var r,n=this._iterator,o=this._iteratorCache,i=0;i=n.length){var t=r.next();if(t.done)return t;n[o]=t.value}return P(e,o,n[o++])})},t(ve,Y),ve.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},ve.prototype.get=function(e,t){return this.has(e)?this._value:t},ve.prototype.includes=function(e){return de(this._value,e)},ve.prototype.slice=function(e,t){var r=this.size;return M(e,t,r)?this:new ve(this._value,z(t,r)-T(e,r))},ve.prototype.reverse=function(){return this},ve.prototype.indexOf=function(e){return de(this._value,e)?0:-1},ve.prototype.lastIndexOf=function(e){return de(this._value,e)?this.size:-1},ve.prototype.__iterate=function(e,t){for(var r=0;r=0&&t=0&&rr?{value:void 0,done:!0}:P(e,i++,a)})},ge.prototype.equals=function(e){return e instanceof ge?this._start===e._start&&this._end===e._end&&this._step===e._step:me(this,e)},t(be,r),t(xe,be),t(we,be),t(_e,be),be.Keyed=xe,be.Indexed=we,be.Set=_e;var De="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var r=65535&(e|=0),n=65535&(t|=0);return r*n+((e>>>16)*n+r*(t>>>16)<<16>>>0)|0};function Se(e){return e>>>1&1073741824|3221225471&e}function Ce(e){if(!1===e||null==e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var t,r,n=typeof e;if("number"===n){if(e!=e||e===1/0)return 0;var o=0|e;for(o!==e&&(o^=4294967295*e);e>4294967295;)o^=e/=4294967295;return Se(o)}if("string"===n)return e.length>ke?(void 0===(r=je[t=e])&&(r=Ae(t),Oe===Ie&&(Oe=0,je={}),Oe++,je[t]=r),r):Ae(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===n)return function(e){var t;if(ze&&void 0!==(t=$e.get(e)))return t;if(void 0!==(t=e[Le]))return t;if(!Te){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Le]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=++Ee,1073741824&Ee&&(Ee=0),ze)$e.set(e,t);else{if(void 0!==Me&&!1===Me(e))throw new Error("Non-extensible objects are not allowed as keys.");if(Te)Object.defineProperty(e,Le,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Le]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Le]=t}}return t}(e);if("function"==typeof e.toString)return Ae(e.toString());throw new Error("Value type "+n+" cannot be hashed.")}function Ae(e){for(var t=0,r=0;r=t.length)throw new Error("Missing value for key: "+t[r]);e.set(t[r],t[r+1])}})},Fe.prototype.toString=function(){return this.__toString("Map {","}")},Fe.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},Fe.prototype.set=function(e,t){return Je(this,e,t)},Fe.prototype.setIn=function(e,t){return this.updateIn(e,g,function(){return t})},Fe.prototype.remove=function(e){return Je(this,e,g)},Fe.prototype.deleteIn=function(e){return this.updateIn(e,function(){return g})},Fe.prototype.update=function(e,t,r){return 1===arguments.length?e(this):this.updateIn([e],t,r)},Fe.prototype.updateIn=function(e,t,r){r||(r=t,t=void 0);var n=function e(t,r,n,o){var i=t===g,a=r.next();if(a.done){var s=i?n:t,l=o(s);return l===s?t:l}ye(i||t&&t.set,"invalid keyPath");var u=a.value,c=i?g:t.get(u,g),f=e(c,r,n,o);return f===c?t:f===g?t.remove(u):(i?Qe():t).set(u,f)}(this,rr(e),t,r);return n===g?void 0:n},Fe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Qe()},Fe.prototype.merge=function(){return nt(this,void 0,arguments)},Fe.prototype.mergeWith=function(t){var r=e.call(arguments,1);return nt(this,t,r)},Fe.prototype.mergeIn=function(t){var r=e.call(arguments,1);return this.updateIn(t,Qe(),function(e){return"function"==typeof e.merge?e.merge.apply(e,r):r[r.length-1]})},Fe.prototype.mergeDeep=function(){return nt(this,ot,arguments)},Fe.prototype.mergeDeepWith=function(t){var r=e.call(arguments,1);return nt(this,it(t),r)},Fe.prototype.mergeDeepIn=function(t){var r=e.call(arguments,1);return this.updateIn(t,Qe(),function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,r):r[r.length-1]})},Fe.prototype.sort=function(e){return Tt(Gt(this,e))},Fe.prototype.sortBy=function(e,t){return Tt(Gt(this,t,e))},Fe.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},Fe.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new D)},Fe.prototype.asImmutable=function(){return this.__ensureOwner()},Fe.prototype.wasAltered=function(){return this.__altered},Fe.prototype.__iterator=function(e,t){return new Ye(this,e,t)},Fe.prototype.__iterate=function(e,t){var r=this,n=0;return this._root&&this._root.iterate(function(t){return n++,e(t[1],t[0],r)},t),n},Fe.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Ze(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Fe.isMap=Pe;var Re,Ve="@@__IMMUTABLE_MAP__@@",qe=Fe.prototype;function Be(e,t){this.ownerID=e,this.entries=t}function Ue(e,t,r){this.ownerID=e,this.bitmap=t,this.nodes=r}function Ge(e,t,r){this.ownerID=e,this.count=t,this.nodes=r}function He(e,t,r){this.ownerID=e,this.keyHash=t,this.entries=r}function We(e,t,r){this.ownerID=e,this.keyHash=t,this.entry=r}function Ye(e,t,r){this._type=t,this._reverse=r,this._stack=e._root&&Ke(e._root)}function Xe(e,t){return P(e,t[0],t[1])}function Ke(e,t){return{node:e,index:0,__prev:t}}function Ze(e,t,r,n){var o=Object.create(qe);return o.size=e,o._root=t,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function Qe(){return Re||(Re=Ze(0))}function Je(e,t,r){var n,o;if(e._root){var i=w(b),a=w(x);if(n=et(e._root,e.__ownerID,0,void 0,t,r,i,a),!a.value)return e;o=e.size+(i.value?r===g?-1:1:0)}else{if(r===g)return e;o=1,n=new Be(e.__ownerID,[[t,r]])}return e.__ownerID?(e.size=o,e._root=n,e.__hash=void 0,e.__altered=!0,e):n?Ze(o,n):Qe()}function et(e,t,r,n,o,i,a,s){return e?e.update(t,r,n,o,i,a,s):i===g?e:(_(s),_(a),new We(t,n,[o,i]))}function tt(e){return e.constructor===We||e.constructor===He}function rt(e,t,r,n,o){if(e.keyHash===n)return new He(t,n,[e.entry,o]);var i,a=(0===r?e.keyHash:e.keyHash>>>r)&y,s=(0===r?n:n>>>r)&y,l=a===s?[rt(e,t,r+m,n,o)]:(i=new We(t,n,o),a>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function lt(e,t,r,n){var o=n?e:S(e);return o[t]=r,o}qe[Ve]=!0,qe.delete=qe.remove,qe.removeIn=qe.deleteIn,Be.prototype.get=function(e,t,r,n){for(var o=this.entries,i=0,a=o.length;i=ut)return function(e,t,r,n){e||(e=new D);for(var o=new We(e,Ce(r),[r,n]),i=0;i>>e)&y),i=this.bitmap;return 0==(i&o)?n:this.nodes[st(i&o-1)].get(e+m,t,r,n)},Ue.prototype.update=function(e,t,r,n,o,i,a){void 0===r&&(r=Ce(n));var s=(0===t?r:r>>>t)&y,l=1<=ct)return function(e,t,r,n,o){for(var i=0,a=new Array(v),s=0;0!==r;s++,r>>>=1)a[s]=1&r?t[i++]:void 0;return a[n]=o,new Ge(e,i+1,a)}(e,h,u,s,d);if(c&&!d&&2===h.length&&tt(h[1^f]))return h[1^f];if(c&&d&&1===h.length&&tt(d))return d;var b=e&&e===this.ownerID,x=c?d?u:u^l:u|l,w=c?d?lt(h,f,d,b):function(e,t,r){var n=e.length-1;if(r&&t===n)return e.pop(),e;for(var o=new Array(n),i=0,a=0;a>>e)&y,i=this.nodes[o];return i?i.get(e+m,t,r,n):n},Ge.prototype.update=function(e,t,r,n,o,i,a){void 0===r&&(r=Ce(n));var s=(0===t?r:r>>>t)&y,l=o===g,u=this.nodes,c=u[s];if(l&&!c)return this;var f=et(c,e,t+m,r,n,o,i,a);if(f===c)return this;var h=this.count;if(c){if(!f&&--h0&&n=0&&e=e.size||t<0)return e.withMutations(function(e){t<0?At(e,t).set(0,r):At(e,0,t+1).set(t,r)});t+=e._origin;var n=e._tail,o=e._root,i=w(x);return t>=Mt(e._capacity)?n=Dt(n,e.__ownerID,0,t,r,i):o=Dt(o,e.__ownerID,e._level,t,r,i),i.value?e.__ownerID?(e._root=o,e._tail=n,e.__hash=void 0,e.__altered=!0,e):wt(e._origin,e._capacity,e._level,o,n):e}(this,e,t)},ht.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},ht.prototype.insert=function(e,t){return this.splice(e,0,t)},ht.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=m,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):_t()},ht.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations(function(r){At(r,0,t+e.length);for(var n=0;n>>t&y;if(n>=this.array.length)return new vt([],e);var o,i=0===n;if(t>0){var a=this.array[n];if((o=a&&a.removeBefore(e,t-m,r))===a&&i)return this}if(i&&!o)return this;var s=St(this,e);if(!i)for(var l=0;l>>t&y;if(o>=this.array.length)return this;if(t>0){var i=this.array[o];if((n=i&&i.removeAfter(e,t-m,r))===i&&o===this.array.length-1)return this}var a=St(this,e);return a.array.splice(o+1),n&&(a.array[o]=n),a};var yt,gt,bt={};function xt(e,t){var r=e._origin,n=e._capacity,o=Mt(n),i=e._tail;return a(e._root,e._level,0);function a(e,s,l){return 0===s?function(e,a){var s=a===o?i&&i.array:e&&e.array,l=a>r?0:r-a,u=n-a;return u>v&&(u=v),function(){if(l===u)return bt;var e=t?--u:l++;return s&&s[e]}}(e,l):function(e,o,i){var s,l=e&&e.array,u=i>r?0:r-i>>o,c=1+(n-i>>o);return c>v&&(c=v),function(){for(;;){if(s){var e=s();if(e!==bt)return e;s=null}if(u===c)return bt;var r=t?--c:u++;s=a(l&&l[r],o-m,i+(r<>>r&y,l=e&&s0){var u=e&&e.array[s],c=Dt(u,t,r-m,n,o,i);return c===u?e:((a=St(e,t)).array[s]=c,a)}return l&&e.array[s]===o?e:(_(i),a=St(e,t),void 0===o&&s===a.array.length-1?a.array.pop():a.array[s]=o,a)}function St(e,t){return t&&e&&t===e.ownerID?e:new vt(e?e.array.slice():[],t)}function Ct(e,t){if(t>=Mt(e._capacity))return e._tail;if(t<1<0;)r=r.array[t>>>n&y],n-=m;return r}}function At(e,t,r){void 0!==t&&(t|=0),void 0!==r&&(r|=0);var n=e.__ownerID||new D,o=e._origin,i=e._capacity,a=o+t,s=void 0===r?i:r<0?i+r:o+r;if(a===o&&s===i)return e;if(a>=s)return e.clear();for(var l=e._level,u=e._root,c=0;a+c<0;)u=new vt(u&&u.array.length?[void 0,u]:[],n),c+=1<<(l+=m);c&&(a+=c,o+=c,s+=c,i+=c);for(var f=Mt(i),h=Mt(s);h>=1<f?new vt([],n):p;if(p&&h>f&&am;g-=m){var b=f>>>g&y;v=v.array[b]=St(v.array[b],n)}v.array[f>>>m&y]=p}if(s=h)a-=h,s-=h,l=m,u=null,d=d&&d.removeBefore(n,0,a);else if(a>o||h>>l&y;if(x!==h>>>l&y)break;x&&(c+=(1<o&&(u=u.removeBefore(n,l,a-c)),u&&hi&&(i=u.size),a(l)||(u=u.map(function(e){return fe(e)})),n.push(u)}return i>e.size&&(e=e.setSize(i)),at(e,t,n)}function Mt(e){return e>>m<=v&&a.size>=2*i.size?(o=a.filter(function(e,t){return void 0!==e&&s!==t}),n=o.toKeyedSeq().map(function(e){return e[0]}).flip().toMap(),e.__ownerID&&(n.__ownerID=o.__ownerID=e.__ownerID)):(n=i.remove(t),o=s===a.size-1?a.pop():a.set(s,void 0))}else if(l){if(r===a.get(s)[1])return e;n=i,o=a.set(s,[t,r])}else n=i.set(t,a.size),o=a.set(a.size,[t,r]);return e.__ownerID?(e.size=n.size,e._map=n,e._list=o,e.__hash=void 0,e):Et(n,o)}function It(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function Ot(e){this._iter=e,this.size=e.size}function jt(e){this._iter=e,this.size=e.size}function Nt(e){this._iter=e,this.size=e.size}function Ft(e){var t=Jt(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=er,t.__iterateUncached=function(t,r){var n=this;return e.__iterate(function(e,r){return!1!==t(r,e,n)},r)},t.__iteratorUncached=function(t,r){if(t===I){var n=e.__iterator(t,r);return new F(function(){var e=n.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e})}return e.__iterator(t===k?L:k,r)},t}function Pt(e,t,r){var n=Jt(e);return n.size=e.size,n.has=function(t){return e.has(t)},n.get=function(n,o){var i=e.get(n,g);return i===g?o:t.call(r,i,n,e)},n.__iterateUncached=function(n,o){var i=this;return e.__iterate(function(e,o,a){return!1!==n(t.call(r,e,o,a),o,i)},o)},n.__iteratorUncached=function(n,o){var i=e.__iterator(I,o);return new F(function(){var o=i.next();if(o.done)return o;var a=o.value,s=a[0];return P(n,s,t.call(r,a[1],s,e),o)})},n}function Rt(e,t){var r=Jt(e);return r._iter=e,r.size=e.size,r.reverse=function(){return e},e.flip&&(r.flip=function(){var t=Ft(e);return t.reverse=function(){return e.flip()},t}),r.get=function(r,n){return e.get(t?r:-1-r,n)},r.has=function(r){return e.has(t?r:-1-r)},r.includes=function(t){return e.includes(t)},r.cacheResult=er,r.__iterate=function(t,r){var n=this;return e.__iterate(function(e,r){return t(e,r,n)},!r)},r.__iterator=function(t,r){return e.__iterator(t,!r)},r}function Vt(e,t,r,n){var o=Jt(e);return n&&(o.has=function(n){var o=e.get(n,g);return o!==g&&!!t.call(r,o,n,e)},o.get=function(n,o){var i=e.get(n,g);return i!==g&&t.call(r,i,n,e)?i:o}),o.__iterateUncached=function(o,i){var a=this,s=0;return e.__iterate(function(e,i,l){if(t.call(r,e,i,l))return s++,o(e,n?i:s-1,a)},i),s},o.__iteratorUncached=function(o,i){var a=e.__iterator(I,i),s=0;return new F(function(){for(;;){var i=a.next();if(i.done)return i;var l=i.value,u=l[0],c=l[1];if(t.call(r,c,u,e))return P(o,n?u:s++,c,i)}})},o}function qt(e,t,r,n){var o=e.size;if(void 0!==t&&(t|=0),void 0!==r&&(r===1/0?r=o:r|=0),M(t,r,o))return e;var i=T(t,o),a=z(r,o);if(i!=i||a!=a)return qt(e.toSeq().cacheResult(),t,r,n);var s,l=a-i;l==l&&(s=l<0?0:l);var u=Jt(e);return u.size=0===s?s:e.size&&s||void 0,!n&&oe(e)&&s>=0&&(u.get=function(t,r){return(t=A(this,t))>=0&&ts)return{value:void 0,done:!0};var e=o.next();return n||t===k?e:P(t,l-1,t===L?void 0:e.value[1],e)})},u}function Bt(e,t,r,n){var o=Jt(e);return o.__iterateUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterate(o,i);var s=!0,l=0;return e.__iterate(function(e,i,u){if(!s||!(s=t.call(r,e,i,u)))return l++,o(e,n?i:l-1,a)}),l},o.__iteratorUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterator(o,i);var s=e.__iterator(I,i),l=!0,u=0;return new F(function(){var e,i,c;do{if((e=s.next()).done)return n||o===k?e:P(o,u++,o===L?void 0:e.value[1],e);var f=e.value;i=f[0],c=f[1],l&&(l=t.call(r,c,i,a))}while(l);return o===I?e:P(o,i,c,e)})},o}function Ut(e,t,r){var n=Jt(e);return n.__iterateUncached=function(n,o){var i=0,s=!1;return function e(l,u){var c=this;l.__iterate(function(o,l){return(!t||u0}function Yt(e,t,n){var o=Jt(e);return o.size=new ee(n).map(function(e){return e.size}).min(),o.__iterate=function(e,t){for(var r,n=this.__iterator(k,t),o=0;!(r=n.next()).done&&!1!==e(r.value,o++,this););return o},o.__iteratorUncached=function(e,o){var i=n.map(function(e){return e=r(e),B(o?e.reverse():e)}),a=0,s=!1;return new F(function(){var r;return s||(r=i.map(function(e){return e.next()}),s=r.some(function(e){return e.done})),s?{value:void 0,done:!0}:P(e,a++,t.apply(null,r.map(function(e){return e.value})))})},o}function Xt(e,t){return oe(e)?t:e.constructor(t)}function Kt(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Zt(e){return Ne(e.size),C(e)}function Qt(e){return s(e)?n:l(e)?o:i}function Jt(e){return Object.create((s(e)?W:l(e)?Y:X).prototype)}function er(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):H.prototype.cacheResult.call(this)}function tr(e,t){return e>t?1:e=0;r--)t={value:arguments[r],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):Ar(e,t)},wr.prototype.pushAll=function(e){if(0===(e=o(e)).size)return this;Ne(e.size);var t=this.size,r=this._head;return e.reverse().forEach(function(e){t++,r={value:e,next:r}}),this.__ownerID?(this.size=t,this._head=r,this.__hash=void 0,this.__altered=!0,this):Ar(t,r)},wr.prototype.pop=function(){return this.slice(1)},wr.prototype.unshift=function(){return this.push.apply(this,arguments)},wr.prototype.unshiftAll=function(e){return this.pushAll(e)},wr.prototype.shift=function(){return this.pop.apply(this,arguments)},wr.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):$r()},wr.prototype.slice=function(e,t){if(M(e,t,this.size))return this;var r=T(e,this.size),n=z(t,this.size);if(n!==this.size)return we.prototype.slice.call(this,e,t);for(var o=this.size-r,i=this._head;r--;)i=i.next;return this.__ownerID?(this.size=o,this._head=i,this.__hash=void 0,this.__altered=!0,this):Ar(o,i)},wr.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Ar(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},wr.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var r=0,n=this._head;n&&!1!==e(n.value,r++,this);)n=n.next;return r},wr.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var r=0,n=this._head;return new F(function(){if(n){var t=n.value;return n=n.next,P(e,r++,t)}return{value:void 0,done:!0}})},wr.isStack=_r;var Dr,Sr="@@__IMMUTABLE_STACK__@@",Cr=wr.prototype;function Ar(e,t,r,n){var o=Object.create(Cr);return o.size=e,o._head=t,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function $r(){return Dr||(Dr=Ar(0))}function Mr(e,t){var r=function(r){e.prototype[r]=t[r]};return Object.keys(t).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(r),e}Cr[Sr]=!0,Cr.withMutations=qe.withMutations,Cr.asMutable=qe.asMutable,Cr.asImmutable=qe.asImmutable,Cr.wasAltered=qe.wasAltered,r.Iterator=F,Mr(r,{toArray:function(){Ne(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate(function(t,r){e[r]=t}),e},toIndexedSeq:function(){return new Ot(this)},toJS:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJS?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new It(this,!0)},toMap:function(){return Fe(this.toKeyedSeq())},toObject:function(){Ne(this.size);var e={};return this.__iterate(function(t,r){e[r]=t}),e},toOrderedMap:function(){return Tt(this.toKeyedSeq())},toOrderedSet:function(){return mr(s(this)?this.valueSeq():this)},toSet:function(){return sr(s(this)?this.valueSeq():this)},toSetSeq:function(){return new jt(this)},toSeq:function(){return l(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return wr(s(this)?this.valueSeq():this)},toList:function(){return ht(s(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){var t=e.call(arguments,0);return Xt(this,function(e,t){var r=s(e),o=[e].concat(t).map(function(e){return a(e)?r&&(e=n(e)):e=r?ae(e):se(Array.isArray(e)?e:[e]),e}).filter(function(e){return 0!==e.size});if(0===o.length)return e;if(1===o.length){var i=o[0];if(i===e||r&&s(i)||l(e)&&l(i))return i}var u=new ee(o);return r?u=u.toKeyedSeq():l(e)||(u=u.toSetSeq()),(u=u.flatten(!0)).size=o.reduce(function(e,t){if(void 0!==e){var r=t.size;if(void 0!==r)return e+r}},0),u}(this,t))},includes:function(e){return this.some(function(t){return de(t,e)})},entries:function(){return this.__iterator(I)},every:function(e,t){Ne(this.size);var r=!0;return this.__iterate(function(n,o,i){if(!e.call(t,n,o,i))return r=!1,!1}),r},filter:function(e,t){return Xt(this,Vt(this,e,t,!0))},find:function(e,t,r){var n=this.findEntry(e,t);return n?n[1]:r},forEach:function(e,t){return Ne(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Ne(this.size),e=void 0!==e?""+e:",";var t="",r=!0;return this.__iterate(function(n){r?r=!1:t+=e,t+=null!=n?n.toString():""}),t},keys:function(){return this.__iterator(L)},map:function(e,t){return Xt(this,Pt(this,e,t))},reduce:function(e,t,r){var n,o;return Ne(this.size),arguments.length<2?o=!0:n=t,this.__iterate(function(t,i,a){o?(o=!1,n=t):n=e.call(r,n,t,i,a)}),n},reduceRight:function(e,t,r){var n=this.toKeyedSeq().reverse();return n.reduce.apply(n,arguments)},reverse:function(){return Xt(this,Rt(this,!0))},slice:function(e,t){return Xt(this,qt(this,e,t,!0))},some:function(e,t){return!this.every(kr(e),t)},sort:function(e){return Xt(this,Gt(this,e))},values:function(){return this.__iterator(k)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(e,t){return C(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,r){var n=Fe().asMutable();return e.__iterate(function(o,i){n.update(t.call(r,o,i,e),0,function(e){return e+1})}),n.asImmutable()}(this,e,t)},equals:function(e){return me(this,e)},entrySeq:function(){var e=this;if(e._cache)return new ee(e._cache);var t=e.toSeq().map(Lr).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(kr(e),t)},findEntry:function(e,t,r){var n=r;return this.__iterate(function(r,o,i){if(e.call(t,r,o,i))return n=[o,r],!1}),n},findKey:function(e,t){var r=this.findEntry(e,t);return r&&r[0]},findLast:function(e,t,r){return this.toKeyedSeq().reverse().find(e,t,r)},findLastEntry:function(e,t,r){return this.toKeyedSeq().reverse().findEntry(e,t,r)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find($)},flatMap:function(e,t){return Xt(this,function(e,t,r){var n=Qt(e);return e.toSeq().map(function(o,i){return n(t.call(r,o,i,e))}).flatten(!0)}(this,e,t))},flatten:function(e){return Xt(this,Ut(this,e,!0))},fromEntrySeq:function(){return new Nt(this)},get:function(e,t){return this.find(function(t,r){return de(r,e)},void 0,t)},getIn:function(e,t){for(var r,n=this,o=rr(e);!(r=o.next()).done;){var i=r.value;if((n=n&&n.get?n.get(i,g):g)===g)return t}return n},groupBy:function(e,t){return function(e,t,r){var n=s(e),o=(c(e)?Tt():Fe()).asMutable();e.__iterate(function(i,a){o.update(t.call(r,i,a,e),function(e){return(e=e||[]).push(n?[a,i]:i),e})});var i=Qt(e);return o.map(function(t){return Xt(e,i(t))})}(this,e,t)},has:function(e){return this.get(e,g)!==g},hasIn:function(e){return this.getIn(e,g)!==g},isSubset:function(e){return e="function"==typeof e.includes?e:r(e),this.every(function(t){return e.includes(t)})},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:r(e)).isSubset(this)},keyOf:function(e){return this.findKey(function(t){return de(t,e)})},keySeq:function(){return this.toSeq().map(Er).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return Ht(this,e)},maxBy:function(e,t){return Ht(this,t,e)},min:function(e){return Ht(this,e?Ir(e):Nr)},minBy:function(e,t){return Ht(this,t?Ir(t):Nr,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Xt(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Xt(this,Bt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(kr(e),t)},sortBy:function(e,t){return Xt(this,Gt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Xt(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Xt(this,function(e,t,r){var n=Jt(e);return n.__iterateUncached=function(n,o){var i=this;if(o)return this.cacheResult().__iterate(n,o);var a=0;return e.__iterate(function(e,o,s){return t.call(r,e,o,s)&&++a&&n(e,o,i)}),a},n.__iteratorUncached=function(n,o){var i=this;if(o)return this.cacheResult().__iterator(n,o);var a=e.__iterator(I,o),s=!0;return new F(function(){if(!s)return{value:void 0,done:!0};var e=a.next();if(e.done)return e;var o=e.value,l=o[0],u=o[1];return t.call(r,u,l,i)?n===I?e:P(n,l,u,e):(s=!1,{value:void 0,done:!0})})},n}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(kr(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=c(e),r=s(e),n=t?1:0;return function(e,t){return t=De(t,3432918353),t=De(t<<15|t>>>-15,461845907),t=De(t<<13|t>>>-13,5),t=De((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=Se((t=De(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(r?t?function(e,t){n=31*n+Fr(Ce(e),Ce(t))|0}:function(e,t){n=n+Fr(Ce(e),Ce(t))|0}:t?function(e){n=31*n+Ce(e)|0}:function(e){n=n+Ce(e)|0}),n)}(this))}});var Tr=r.prototype;Tr[f]=!0,Tr[N]=Tr.values,Tr.__toJS=Tr.toArray,Tr.__toStringMapper=Or,Tr.inspect=Tr.toSource=function(){return this.toString()},Tr.chain=Tr.flatMap,Tr.contains=Tr.includes,Mr(n,{flip:function(){return Xt(this,Ft(this))},mapEntries:function(e,t){var r=this,n=0;return Xt(this,this.toSeq().map(function(o,i){return e.call(t,[i,o],n++,r)}).fromEntrySeq())},mapKeys:function(e,t){var r=this;return Xt(this,this.toSeq().flip().map(function(n,o){return e.call(t,n,o,r)}).flip())}});var zr=n.prototype;function Er(e,t){return t}function Lr(e,t){return[t,e]}function kr(e){return function(){return!e.apply(this,arguments)}}function Ir(e){return function(){return-e.apply(this,arguments)}}function Or(e){return"string"==typeof e?JSON.stringify(e):String(e)}function jr(){return S(arguments)}function Nr(e,t){return et?-1:0}function Fr(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}return zr[h]=!0,zr[N]=Tr.entries,zr.__toJS=Tr.toObject,zr.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+Or(e)},Mr(o,{toKeyedSeq:function(){return new It(this,!1)},filter:function(e,t){return Xt(this,Vt(this,e,t,!1))},findIndex:function(e,t){var r=this.findEntry(e,t);return r?r[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Xt(this,Rt(this,!1))},slice:function(e,t){return Xt(this,qt(this,e,t,!1))},splice:function(e,t){var r=arguments.length;if(t=Math.max(0|t,0),0===r||2===r&&!t)return this;e=T(e,e<0?this.count():this.size);var n=this.slice(0,e);return Xt(this,1===r?n:n.concat(S(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var r=this.findLastEntry(e,t);return r?r[0]:-1},first:function(){return this.get(0)},flatten:function(e){return Xt(this,Ut(this,e,!1))},get:function(e,t){return(e=A(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find(function(t,r){return r===e},void 0,t)},has:function(e){return(e=A(this,e))>=0&&(void 0!==this.size?this.size===1/0||e0&&t-1 in e)}D.fn=D.prototype={jquery:"3.4.0",constructor:D,length:0,toArray:function(){return l.call(this)},get:function(e){return null==e?l.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=D.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return D.each(this,e)},map:function(e){return this.pushStack(D.map(this,function(t,r){return e.call(t,r,t)}))},slice:function(){return this.pushStack(l.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,r=+e+(e<0?t:0);return this.pushStack(r>=0&&r+~]|"+N+")"+N+"*"),G=new RegExp(N+"|>"),H=new RegExp(R),W=new RegExp("^"+F+"$"),Y={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+R),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+N+"*(even|odd|(([+-]|)(\\d*)n|)"+N+"*(?:([+-]|)"+N+"*(\\d+)|))"+N+"*\\)|)","i"),bool:new RegExp("^(?:"+j+")$","i"),needsContext:new RegExp("^"+N+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+N+"*((?:-\\d)?\\d*)"+N+"*\\)|)(?=[^-]|$)","i")},X=/HTML$/i,K=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+N+"?|("+N+")|.)","ig"),re=function(e,t,r){var n="0x"+t-65536;return n!=n||r?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)},ne=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,oe=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ie=function(){h()},ae=xe(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{k.apply(z=I.call(w.childNodes),w.childNodes),z[w.childNodes.length].nodeType}catch(e){k={apply:z.length?function(e,t){L.apply(e,I.call(t))}:function(e,t){for(var r=e.length,n=0;e[r++]=t[n++];);e.length=r-1}}}function se(e,t,n,o){var i,s,u,c,f,d,y,g=t&&t.ownerDocument,_=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==_&&9!==_&&11!==_)return n;if(!o&&((t?t.ownerDocument||t:w)!==p&&h(t),t=t||p,m)){if(11!==_&&(f=J.exec(e)))if(i=f[1]){if(9===_){if(!(u=t.getElementById(i)))return n;if(u.id===i)return n.push(u),n}else if(g&&(u=g.getElementById(i))&&b(t,u)&&u.id===i)return n.push(u),n}else{if(f[2])return k.apply(n,t.getElementsByTagName(e)),n;if((i=f[3])&&r.getElementsByClassName&&t.getElementsByClassName)return k.apply(n,t.getElementsByClassName(i)),n}if(r.qsa&&!$[e+" "]&&(!v||!v.test(e))&&(1!==_||"object"!==t.nodeName.toLowerCase())){if(y=e,g=t,1===_&&G.test(e)){for((c=t.getAttribute("id"))?c=c.replace(ne,oe):t.setAttribute("id",c=x),s=(d=a(e)).length;s--;)d[s]="#"+c+" "+be(d[s]);y=d.join(","),g=ee.test(e)&&ye(t.parentNode)||t}try{return k.apply(n,g.querySelectorAll(y)),n}catch(t){$(e,!0)}finally{c===x&&t.removeAttribute("id")}}}return l(e.replace(q,"$1"),t,n,o)}function le(){var e=[];return function t(r,o){return e.push(r+" ")>n.cacheLength&&delete t[e.shift()],t[r+" "]=o}}function ue(e){return e[x]=!0,e}function ce(e){var t=p.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){for(var r=e.split("|"),o=r.length;o--;)n.attrHandle[r[o]]=t}function he(e,t){var r=t&&e,n=r&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(n)return n;if(r)for(;r=r.nextSibling;)if(r===t)return-1;return e?1:-1}function pe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function de(e){return function(t){var r=t.nodeName.toLowerCase();return("input"===r||"button"===r)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ve(e){return ue(function(t){return t=+t,ue(function(r,n){for(var o,i=e([],r.length,t),a=i.length;a--;)r[o=i[a]]&&(r[o]=!(n[o]=r[o]))})})}function ye(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in r=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,r=(e.ownerDocument||e).documentElement;return!X.test(t||r&&r.nodeName||"HTML")},h=se.setDocument=function(e){var t,o,a=e?e.ownerDocument||e:w;return a!==p&&9===a.nodeType&&a.documentElement?(d=(p=a).documentElement,m=!i(p),w!==p&&(o=p.defaultView)&&o.top!==o&&(o.addEventListener?o.addEventListener("unload",ie,!1):o.attachEvent&&o.attachEvent("onunload",ie)),r.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ce(function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=Q.test(p.getElementsByClassName),r.getById=ce(function(e){return d.appendChild(e).id=x,!p.getElementsByName||!p.getElementsByName(x).length}),r.getById?(n.filter.ID=function(e){var t=e.replace(te,re);return function(e){return e.getAttribute("id")===t}},n.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var r=t.getElementById(e);return r?[r]:[]}}):(n.filter.ID=function(e){var t=e.replace(te,re);return function(e){var r=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return r&&r.value===t}},n.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var r,n,o,i=t.getElementById(e);if(i){if((r=i.getAttributeNode("id"))&&r.value===e)return[i];for(o=t.getElementsByName(e),n=0;i=o[n++];)if((r=i.getAttributeNode("id"))&&r.value===e)return[i]}return[]}}),n.find.TAG=r.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):r.qsa?t.querySelectorAll(e):void 0}:function(e,t){var r,n=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;r=i[o++];)1===r.nodeType&&n.push(r);return n}return i},n.find.CLASS=r.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},y=[],v=[],(r.qsa=Q.test(p.querySelectorAll))&&(ce(function(e){d.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+N+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+N+"*(?:value|"+j+")"),e.querySelectorAll("[id~="+x+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+N+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),d.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(r.matchesSelector=Q.test(g=d.matches||d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ce(function(e){r.disconnectedMatch=g.call(e,"*"),g.call(e,"[s!='']:x"),y.push("!=",R)}),v=v.length&&new RegExp(v.join("|")),y=y.length&&new RegExp(y.join("|")),t=Q.test(d.compareDocumentPosition),b=t||Q.test(d.contains)?function(e,t){var r=9===e.nodeType?e.documentElement:e,n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(r.contains?r.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},M=t?function(e,t){if(e===t)return f=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!r.sortDetached&&t.compareDocumentPosition(e)===n?e===p||e.ownerDocument===w&&b(w,e)?-1:t===p||t.ownerDocument===w&&b(w,t)?1:c?O(c,e)-O(c,t):0:4&n?-1:1)}:function(e,t){if(e===t)return f=!0,0;var r,n=0,o=e.parentNode,i=t.parentNode,a=[e],s=[t];if(!o||!i)return e===p?-1:t===p?1:o?-1:i?1:c?O(c,e)-O(c,t):0;if(o===i)return he(e,t);for(r=e;r=r.parentNode;)a.unshift(r);for(r=t;r=r.parentNode;)s.unshift(r);for(;a[n]===s[n];)n++;return n?he(a[n],s[n]):a[n]===w?-1:s[n]===w?1:0},p):p},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&h(e),r.matchesSelector&&m&&!$[t+" "]&&(!y||!y.test(t))&&(!v||!v.test(t)))try{var n=g.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){$(t,!0)}return se(t,p,null,[e]).length>0},se.contains=function(e,t){return(e.ownerDocument||e)!==p&&h(e),b(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!==p&&h(e);var o=n.attrHandle[t.toLowerCase()],i=o&&T.call(n.attrHandle,t.toLowerCase())?o(e,t,!m):void 0;return void 0!==i?i:r.attributes||!m?e.getAttribute(t):(i=e.getAttributeNode(t))&&i.specified?i.value:null},se.escape=function(e){return(e+"").replace(ne,oe)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],o=0,i=0;if(f=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(M),f){for(;t=e[i++];)t===e[i]&&(o=n.push(i));for(;o--;)e.splice(n[o],1)}return c=null,e},o=se.getText=function(e){var t,r="",n=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)r+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[n++];)r+=o(t);return r},(n=se.selectors={cacheLength:50,createPseudo:ue,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,re),e[3]=(e[3]||e[4]||e[5]||"").replace(te,re),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,r=!e[6]&&e[2];return Y.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":r&&H.test(r)&&(t=a(r,!0))&&(t=r.indexOf(")",r.length-t)-r.length)&&(e[0]=e[0].slice(0,t),e[2]=r.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,re).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=S[e+" "];return t||(t=new RegExp("(^|"+N+")"+e+"("+N+"|$)"))&&S(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,r){return function(n){var o=se.attr(n,e);return null==o?"!="===t:!t||(o+="","="===t?o===r:"!="===t?o!==r:"^="===t?r&&0===o.indexOf(r):"*="===t?r&&o.indexOf(r)>-1:"$="===t?r&&o.slice(-r.length)===r:"~="===t?(" "+o.replace(V," ")+" ").indexOf(r)>-1:"|="===t&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,r,n,o){var i="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===n&&0===o?function(e){return!!e.parentNode}:function(t,r,l){var u,c,f,h,p,d,m=i!==a?"nextSibling":"previousSibling",v=t.parentNode,y=s&&t.nodeName.toLowerCase(),g=!l&&!s,b=!1;if(v){if(i){for(;m;){for(h=t;h=h[m];)if(s?h.nodeName.toLowerCase()===y:1===h.nodeType)return!1;d=m="only"===e&&!d&&"nextSibling"}return!0}if(d=[a?v.firstChild:v.lastChild],a&&g){for(b=(p=(u=(c=(f=(h=v)[x]||(h[x]={}))[h.uniqueID]||(f[h.uniqueID]={}))[e]||[])[0]===_&&u[1])&&u[2],h=p&&v.childNodes[p];h=++p&&h&&h[m]||(b=p=0)||d.pop();)if(1===h.nodeType&&++b&&h===t){c[e]=[_,p,b];break}}else if(g&&(b=p=(u=(c=(f=(h=t)[x]||(h[x]={}))[h.uniqueID]||(f[h.uniqueID]={}))[e]||[])[0]===_&&u[1]),!1===b)for(;(h=++p&&h&&h[m]||(b=p=0)||d.pop())&&((s?h.nodeName.toLowerCase()!==y:1!==h.nodeType)||!++b||(g&&((c=(f=h[x]||(h[x]={}))[h.uniqueID]||(f[h.uniqueID]={}))[e]=[_,b]),h!==t)););return(b-=o)===n||b%n==0&&b/n>=0}}},PSEUDO:function(e,t){var r,o=n.pseudos[e]||n.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return o[x]?o(t):o.length>1?(r=[e,e,"",t],n.setFilters.hasOwnProperty(e.toLowerCase())?ue(function(e,r){for(var n,i=o(e,t),a=i.length;a--;)e[n=O(e,i[a])]=!(r[n]=i[a])}):function(e){return o(e,0,r)}):o}},pseudos:{not:ue(function(e){var t=[],r=[],n=s(e.replace(q,"$1"));return n[x]?ue(function(e,t,r,o){for(var i,a=n(e,null,o,[]),s=e.length;s--;)(i=a[s])&&(e[s]=!(t[s]=i))}):function(e,o,i){return t[0]=e,n(t,null,i,r),t[0]=null,!r.pop()}}),has:ue(function(e){return function(t){return se(e,t).length>0}}),contains:ue(function(e){return e=e.replace(te,re),function(t){return(t.textContent||o(t)).indexOf(e)>-1}}),lang:ue(function(e){return W.test(e||"")||se.error("unsupported lang: "+e),e=e.replace(te,re).toLowerCase(),function(t){var r;do{if(r=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(r=r.toLowerCase())===e||0===r.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var r=e.location&&e.location.hash;return r&&r.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!n.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return K.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,r){return[r<0?r+t:r]}),even:ve(function(e,t){for(var r=0;rt?t:r;--n>=0;)e.push(n);return e}),gt:ve(function(e,t,r){for(var n=r<0?r+t:r;++n1?function(t,r,n){for(var o=e.length;o--;)if(!e[o](t,r,n))return!1;return!0}:e[0]}function _e(e,t,r,n,o){for(var i,a=[],s=0,l=e.length,u=null!=t;s-1&&(i[u]=!(a[u]=f))}}else y=_e(y===a?y.splice(d,y.length):y),o?o(null,a,y,l):k.apply(a,y)})}function Se(e){for(var t,r,o,i=e.length,a=n.relative[e[0].type],s=a||n.relative[" "],l=a?1:0,c=xe(function(e){return e===t},s,!0),f=xe(function(e){return O(t,e)>-1},s,!0),h=[function(e,r,n){var o=!a&&(n||r!==u)||((t=r).nodeType?c(e,r,n):f(e,r,n));return t=null,o}];l1&&we(h),l>1&&be(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(q,"$1"),r,l0,o=e.length>0,i=function(i,a,s,l,c){var f,d,v,y=0,g="0",b=i&&[],x=[],w=u,D=i||o&&n.find.TAG("*",c),S=_+=null==w?1:Math.random()||.1,C=D.length;for(c&&(u=a===p||a||c);g!==C&&null!=(f=D[g]);g++){if(o&&f){for(d=0,a||f.ownerDocument===p||(h(f),s=!m);v=e[d++];)if(v(f,a||p,s)){l.push(f);break}c&&(_=S)}r&&((f=!v&&f)&&y--,i&&b.push(f))}if(y+=g,r&&g!==y){for(d=0;v=t[d++];)v(b,x,a,s);if(i){if(y>0)for(;g--;)b[g]||x[g]||(x[g]=E.call(l));x=_e(x)}k.apply(l,x),c&&!i&&x.length>0&&y+t.length>1&&se.uniqueSort(l)}return c&&(_=S,u=w),b};return r?ue(i):i}(i,o))).selector=e}return s},l=se.select=function(e,t,r,o){var i,l,u,c,f,h="function"==typeof e&&e,p=!o&&a(e=h.selector||e);if(r=r||[],1===p.length){if((l=p[0]=p[0].slice(0)).length>2&&"ID"===(u=l[0]).type&&9===t.nodeType&&m&&n.relative[l[1].type]){if(!(t=(n.find.ID(u.matches[0].replace(te,re),t)||[])[0]))return r;h&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(i=Y.needsContext.test(e)?0:l.length;i--&&(u=l[i],!n.relative[c=u.type]);)if((f=n.find[c])&&(o=f(u.matches[0].replace(te,re),ee.test(l[0].type)&&ye(t.parentNode)||t))){if(l.splice(i,1),!(e=o.length&&be(l)))return k.apply(r,o),r;break}}return(h||s(e,p))(o,t,!m,r,!t||ee.test(e)&&ye(t.parentNode)||t),r},r.sortStable=x.split("").sort(M).join("")===x,r.detectDuplicates=!!f,h(),r.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(p.createElement("fieldset"))}),ce(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,r){if(!r)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),r.attributes&&ce(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,r){if(!r&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(j,function(e,t,r){var n;if(!r)return!0===e[t]?t.toLowerCase():(n=e.getAttributeNode(t))&&n.specified?n.value:null}),se}(r);D.find=A,D.expr=A.selectors,D.expr[":"]=D.expr.pseudos,D.uniqueSort=D.unique=A.uniqueSort,D.text=A.getText,D.isXMLDoc=A.isXML,D.contains=A.contains,D.escapeSelector=A.escape;var $=function(e,t,r){for(var n=[],o=void 0!==r;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(o&&D(e).is(r))break;n.push(e)}return n},M=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r},T=D.expr.match.needsContext;function z(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var E=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function L(e,t,r){return g(t)?D.grep(e,function(e,n){return!!t.call(e,n,e)!==r}):t.nodeType?D.grep(e,function(e){return e===t!==r}):"string"!=typeof t?D.grep(e,function(e){return f.call(t,e)>-1!==r}):D.filter(t,e,r)}D.filter=function(e,t,r){var n=t[0];return r&&(e=":not("+e+")"),1===t.length&&1===n.nodeType?D.find.matchesSelector(n,e)?[n]:[]:D.find.matches(e,D.grep(t,function(e){return 1===e.nodeType}))},D.fn.extend({find:function(e){var t,r,n=this.length,o=this;if("string"!=typeof e)return this.pushStack(D(e).filter(function(){for(t=0;t1?D.uniqueSort(r):r},filter:function(e){return this.pushStack(L(this,e||[],!1))},not:function(e){return this.pushStack(L(this,e||[],!0))},is:function(e){return!!L(this,"string"==typeof e&&T.test(e)?D(e):e||[],!1).length}});var k,I=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(D.fn.init=function(e,t,r){var n,o;if(!e)return this;if(r=r||k,"string"==typeof e){if(!(n="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:I.exec(e))||!n[1]&&t)return!t||t.jquery?(t||r).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof D?t[0]:t,D.merge(this,D.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:a,!0)),E.test(n[1])&&D.isPlainObject(t))for(n in t)g(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return(o=a.getElementById(n[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==r.ready?r.ready(e):e(D):D.makeArray(e,this)}).prototype=D.fn,k=D(a);var O=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function N(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}D.fn.extend({has:function(e){var t=D(e,this),r=t.length;return this.filter(function(){for(var e=0;e-1:1===r.nodeType&&D.find.matchesSelector(r,e))){i.push(r);break}return this.pushStack(i.length>1?D.uniqueSort(i):i)},index:function(e){return e?"string"==typeof e?f.call(D(e),this[0]):f.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(D.uniqueSort(D.merge(this.get(),D(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),D.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return $(e,"parentNode")},parentsUntil:function(e,t,r){return $(e,"parentNode",r)},next:function(e){return N(e,"nextSibling")},prev:function(e){return N(e,"previousSibling")},nextAll:function(e){return $(e,"nextSibling")},prevAll:function(e){return $(e,"previousSibling")},nextUntil:function(e,t,r){return $(e,"nextSibling",r)},prevUntil:function(e,t,r){return $(e,"previousSibling",r)},siblings:function(e){return M((e.parentNode||{}).firstChild,e)},children:function(e){return M(e.firstChild)},contents:function(e){return void 0!==e.contentDocument?e.contentDocument:(z(e,"template")&&(e=e.content||e),D.merge([],e.childNodes))}},function(e,t){D.fn[e]=function(r,n){var o=D.map(this,t,r);return"Until"!==e.slice(-5)&&(n=r),n&&"string"==typeof n&&(o=D.filter(n,o)),this.length>1&&(j[e]||D.uniqueSort(o),O.test(e)&&o.reverse()),this.pushStack(o)}});var F=/[^\x20\t\r\n\f]+/g;function P(e){return e}function R(e){throw e}function V(e,t,r,n){var o;try{e&&g(o=e.promise)?o.call(e).done(t).fail(r):e&&g(o=e.then)?o.call(e,t,r):t.apply(void 0,[e].slice(n))}catch(e){r.apply(void 0,[e])}}D.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return D.each(e.match(F)||[],function(e,r){t[r]=!0}),t}(e):D.extend({},e);var t,r,n,o,i=[],a=[],s=-1,l=function(){for(o=o||e.once,n=t=!0;a.length;s=-1)for(r=a.shift();++s-1;)i.splice(r,1),r<=s&&s--}),this},has:function(e){return e?D.inArray(e,i)>-1:i.length>0},empty:function(){return i&&(i=[]),this},disable:function(){return o=a=[],i=r="",this},disabled:function(){return!i},lock:function(){return o=a=[],r||t||(i=r=""),this},locked:function(){return!!o},fireWith:function(e,r){return o||(r=[e,(r=r||[]).slice?r.slice():r],a.push(r),t||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!n}};return u},D.extend({Deferred:function(e){var t=[["notify","progress",D.Callbacks("memory"),D.Callbacks("memory"),2],["resolve","done",D.Callbacks("once memory"),D.Callbacks("once memory"),0,"resolved"],["reject","fail",D.Callbacks("once memory"),D.Callbacks("once memory"),1,"rejected"]],n="pending",o={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},catch:function(e){return o.then(null,e)},pipe:function(){var e=arguments;return D.Deferred(function(r){D.each(t,function(t,n){var o=g(e[n[4]])&&e[n[4]];i[n[1]](function(){var e=o&&o.apply(this,arguments);e&&g(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[n[0]+"With"](this,o?[e]:arguments)})}),e=null}).promise()},then:function(e,n,o){var i=0;function a(e,t,n,o){return function(){var s=this,l=arguments,u=function(){var r,u;if(!(e=i&&(n!==R&&(s=void 0,l=[r]),t.rejectWith(s,l))}};e?c():(D.Deferred.getStackHook&&(c.stackTrace=D.Deferred.getStackHook()),r.setTimeout(c))}}return D.Deferred(function(r){t[0][3].add(a(0,r,g(o)?o:P,r.notifyWith)),t[1][3].add(a(0,r,g(e)?e:P)),t[2][3].add(a(0,r,g(n)?n:R))}).promise()},promise:function(e){return null!=e?D.extend(e,o):o}},i={};return D.each(t,function(e,r){var a=r[2],s=r[5];o[r[1]]=a.add,s&&a.add(function(){n=s},t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),a.add(r[3].fire),i[r[0]]=function(){return i[r[0]+"With"](this===i?void 0:this,arguments),this},i[r[0]+"With"]=a.fireWith}),o.promise(i),e&&e.call(i,i),i},when:function(e){var t=arguments.length,r=t,n=Array(r),o=l.call(arguments),i=D.Deferred(),a=function(e){return function(r){n[e]=this,o[e]=arguments.length>1?l.call(arguments):r,--t||i.resolveWith(n,o)}};if(t<=1&&(V(e,i.done(a(r)).resolve,i.reject,!t),"pending"===i.state()||g(o[r]&&o[r].then)))return i.then();for(;r--;)V(o[r],a(r),i.reject);return i.promise()}});var q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;D.Deferred.exceptionHook=function(e,t){r.console&&r.console.warn&&e&&q.test(e.name)&&r.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},D.readyException=function(e){r.setTimeout(function(){throw e})};var B=D.Deferred();function U(){a.removeEventListener("DOMContentLoaded",U),r.removeEventListener("load",U),D.ready()}D.fn.ready=function(e){return B.then(e).catch(function(e){D.readyException(e)}),this},D.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--D.readyWait:D.isReady)||(D.isReady=!0,!0!==e&&--D.readyWait>0||B.resolveWith(a,[D]))}}),D.ready.then=B.then,"complete"===a.readyState||"loading"!==a.readyState&&!a.documentElement.doScroll?r.setTimeout(D.ready):(a.addEventListener("DOMContentLoaded",U),r.addEventListener("load",U));var G=function(e,t,r,n,o,i,a){var s=0,l=e.length,u=null==r;if("object"===_(r))for(s in o=!0,r)G(e,t,s,r[s],!0,i,a);else if(void 0!==n&&(o=!0,g(n)||(a=!0),u&&(a?(t.call(e,n),t=null):(u=t,t=function(e,t,r){return u.call(D(e),r)})),t))for(;s1,null,!0)},removeData:function(e){return this.each(function(){J.remove(this,e)})}}),D.extend({queue:function(e,t,r){var n;if(e)return t=(t||"fx")+"queue",n=Q.get(e,t),r&&(!n||Array.isArray(r)?n=Q.access(e,t,D.makeArray(r)):n.push(r)),n||[]},dequeue:function(e,t){t=t||"fx";var r=D.queue(e,t),n=r.length,o=r.shift(),i=D._queueHooks(e,t);"inprogress"===o&&(o=r.shift(),n--),o&&("fx"===t&&r.unshift("inprogress"),delete i.stop,o.call(e,function(){D.dequeue(e,t)},i)),!n&&i&&i.empty.fire()},_queueHooks:function(e,t){var r=t+"queueHooks";return Q.get(e,r)||Q.access(e,r,{empty:D.Callbacks("once memory").add(function(){Q.remove(e,[t+"queue",r])})})}}),D.fn.extend({queue:function(e,t){var r=2;return"string"!=typeof e&&(t=e,e="fx",r--),arguments.length\x20\t\r\n\f]*)/i,ye=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function be(e,t){var r;return r=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&z(e,t)?D.merge([e],r):r}function xe(e,t){for(var r=0,n=e.length;r-1)o&&o.push(i);else if(u=se(i),a=be(f.appendChild(i),"script"),u&&xe(a),r)for(c=0;i=a[c++];)ye.test(i.type||"")&&r.push(i);return f}we=a.createDocumentFragment().appendChild(a.createElement("div")),(_e=a.createElement("input")).setAttribute("type","radio"),_e.setAttribute("checked","checked"),_e.setAttribute("name","t"),we.appendChild(_e),y.checkClone=we.cloneNode(!0).cloneNode(!0).lastChild.checked,we.innerHTML="",y.noCloneChecked=!!we.cloneNode(!0).lastChild.defaultValue;var Ce=/^key/,Ae=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,$e=/^([^.]*)(?:\.(.+)|)/;function Me(){return!0}function Te(){return!1}function ze(e,t){return e===function(){try{return a.activeElement}catch(e){}}()==("focus"===t)}function Ee(e,t,r,n,o,i){var a,s;if("object"==typeof t){for(s in"string"!=typeof r&&(n=n||r,r=void 0),t)Ee(e,s,r,n,t[s],i);return e}if(null==n&&null==o?(o=r,n=r=void 0):null==o&&("string"==typeof r?(o=n,n=void 0):(o=n,n=r,r=void 0)),!1===o)o=Te;else if(!o)return e;return 1===i&&(a=o,(o=function(e){return D().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=D.guid++)),e.each(function(){D.event.add(this,t,o,n,r)})}function Le(e,t,r){r?(Q.set(e,t,!1),D.event.add(e,t,{namespace:!1,handler:function(e){var n,o,i=Q.get(this,t);if(1&e.isTrigger&&this[t]){if(i)(D.event.special[t]||{}).delegateType&&e.stopPropagation();else if(i=l.call(arguments),Q.set(this,t,i),n=r(this,t),this[t](),i!==(o=Q.get(this,t))||n?Q.set(this,t,!1):o=void 0,i!==o)return e.stopImmediatePropagation(),e.preventDefault(),o}else i&&(Q.set(this,t,D.event.trigger(D.extend(i.shift(),D.Event.prototype),i,this)),e.stopImmediatePropagation())}})):D.event.add(e,t,Me)}D.event={global:{},add:function(e,t,r,n,o){var i,a,s,l,u,c,f,h,p,d,m,v=Q.get(e);if(v)for(r.handler&&(r=(i=r).handler,o=i.selector),o&&D.find.matchesSelector(ae,o),r.guid||(r.guid=D.guid++),(l=v.events)||(l=v.events={}),(a=v.handle)||(a=v.handle=function(t){return void 0!==D&&D.event.triggered!==t.type?D.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(F)||[""]).length;u--;)p=m=(s=$e.exec(t[u])||[])[1],d=(s[2]||"").split(".").sort(),p&&(f=D.event.special[p]||{},p=(o?f.delegateType:f.bindType)||p,f=D.event.special[p]||{},c=D.extend({type:p,origType:m,data:n,handler:r,guid:r.guid,selector:o,needsContext:o&&D.expr.match.needsContext.test(o),namespace:d.join(".")},i),(h=l[p])||((h=l[p]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,n,d,a)||e.addEventListener&&e.addEventListener(p,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=r.guid)),o?h.splice(h.delegateCount++,0,c):h.push(c),D.event.global[p]=!0)},remove:function(e,t,r,n,o){var i,a,s,l,u,c,f,h,p,d,m,v=Q.hasData(e)&&Q.get(e);if(v&&(l=v.events)){for(u=(t=(t||"").match(F)||[""]).length;u--;)if(p=m=(s=$e.exec(t[u])||[])[1],d=(s[2]||"").split(".").sort(),p){for(f=D.event.special[p]||{},h=l[p=(n?f.delegateType:f.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=i=h.length;i--;)c=h[i],!o&&m!==c.origType||r&&r.guid!==c.guid||s&&!s.test(c.namespace)||n&&n!==c.selector&&("**"!==n||!c.selector)||(h.splice(i,1),c.selector&&h.delegateCount--,f.remove&&f.remove.call(e,c));a&&!h.length&&(f.teardown&&!1!==f.teardown.call(e,d,v.handle)||D.removeEvent(e,p,v.handle),delete l[p])}else for(p in l)D.event.remove(e,p+t[u],r,n,!0);D.isEmptyObject(l)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,r,n,o,i,a,s=D.event.fix(e),l=new Array(arguments.length),u=(Q.get(this,"events")||{})[s.type]||[],c=D.event.special[s.type]||{};for(l[0]=s,t=1;t=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(i=[],a={},r=0;r-1:D.find(o,this,null,[u]).length),a[o]&&i.push(n);i.length&&s.push({elem:u,handlers:i})}return u=this,l\x20\t\r\n\f]*)[^>]*)\/>/gi,Ie=/\s*$/g;function Ne(e,t){return z(e,"table")&&z(11!==t.nodeType?t:t.firstChild,"tr")&&D(e).children("tbody")[0]||e}function Fe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Pe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Re(e,t){var r,n,o,i,a,s,l,u;if(1===t.nodeType){if(Q.hasData(e)&&(i=Q.access(e),a=Q.set(t,i),u=i.events))for(o in delete a.handle,a.events={},u)for(r=0,n=u[o].length;r1&&"string"==typeof d&&!y.checkClone&&Oe.test(d))return e.each(function(o){var i=e.eq(o);m&&(t[0]=d.call(this,o,i.html())),Ve(i,t,r,n)});if(h&&(i=(o=Se(t,e[0].ownerDocument,!1,e,n)).firstChild,1===o.childNodes.length&&(o=i),i||n)){for(s=(a=D.map(be(o,"script"),Fe)).length;f")},clone:function(e,t,r){var n,o,i,a,s,l,u,c=e.cloneNode(!0),f=se(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||D.isXMLDoc(e)))for(a=be(c),n=0,o=(i=be(e)).length;n0&&xe(a,!f&&be(e,"script")),c},cleanData:function(e){for(var t,r,n,o=D.event.special,i=0;void 0!==(r=e[i]);i++)if(K(r)){if(t=r[Q.expando]){if(t.events)for(n in t.events)o[n]?D.event.remove(r,n):D.removeEvent(r,n,t.handle);r[Q.expando]=void 0}r[J.expando]&&(r[J.expando]=void 0)}}}),D.fn.extend({detach:function(e){return qe(this,e,!0)},remove:function(e){return qe(this,e)},text:function(e){return G(this,function(e){return void 0===e?D.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Ve(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ne(this,e).appendChild(e)})},prepend:function(){return Ve(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Ne(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Ve(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Ve(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(D.cleanData(be(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return D.clone(this,e,t)})},html:function(e){return G(this,function(e){var t=this[0]||{},r=0,n=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ie.test(e)&&!ge[(ve.exec(e)||["",""])[1].toLowerCase()]){e=D.htmlPrefilter(e);try{for(;r=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-i-l-s-.5))||0),l}function ot(e,t,r){var n=Ue(e),o=(!y.boxSizingReliable()||r)&&"border-box"===D.css(e,"boxSizing",!1,n),i=o,a=He(e,t,n),s="offset"+t[0].toUpperCase()+t.slice(1);if(Be.test(a)){if(!r)return a;a="auto"}return(!y.boxSizingReliable()&&o||"auto"===a||!parseFloat(a)&&"inline"===D.css(e,"display",!1,n))&&e.getClientRects().length&&(o="border-box"===D.css(e,"boxSizing",!1,n),(i=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+nt(e,t,r||(o?"border":"content"),i,n,a)+"px"}function it(e,t,r,n,o){return new it.prototype.init(e,t,r,n,o)}D.extend({cssHooks:{opacity:{get:function(e,t){if(t){var r=He(e,"opacity");return""===r?"1":r}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,r,n){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,i,a,s=X(t),l=Je.test(t),u=e.style;if(l||(t=Ze(s)),a=D.cssHooks[t]||D.cssHooks[s],void 0===r)return a&&"get"in a&&void 0!==(o=a.get(e,!1,n))?o:u[t];"string"===(i=typeof r)&&(o=oe.exec(r))&&o[1]&&(r=fe(e,t,o),i="number"),null!=r&&r==r&&("number"!==i||l||(r+=o&&o[3]||(D.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==r||0!==t.indexOf("background")||(u[t]="inherit"),a&&"set"in a&&void 0===(r=a.set(e,r,n))||(l?u.setProperty(t,r):u[t]=r))}},css:function(e,t,r,n){var o,i,a,s=X(t);return Je.test(t)||(t=Ze(s)),(a=D.cssHooks[t]||D.cssHooks[s])&&"get"in a&&(o=a.get(e,!0,r)),void 0===o&&(o=He(e,t,n)),"normal"===o&&t in tt&&(o=tt[t]),""===r||r?(i=parseFloat(o),!0===r||isFinite(i)?i||0:o):o}}),D.each(["height","width"],function(e,t){D.cssHooks[t]={get:function(e,r,n){if(r)return!Qe.test(D.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ot(e,t,n):ce(e,et,function(){return ot(e,t,n)})},set:function(e,r,n){var o,i=Ue(e),a=!y.scrollboxSize()&&"absolute"===i.position,s=(a||n)&&"border-box"===D.css(e,"boxSizing",!1,i),l=n?nt(e,t,n,s,i):0;return s&&a&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(i[t])-nt(e,t,"border",!1,i)-.5)),l&&(o=oe.exec(r))&&"px"!==(o[3]||"px")&&(e.style[t]=r,r=D.css(e,t)),rt(0,r,l)}}}),D.cssHooks.marginLeft=We(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(He(e,"marginLeft"))||e.getBoundingClientRect().left-ce(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),D.each({margin:"",padding:"",border:"Width"},function(e,t){D.cssHooks[e+t]={expand:function(r){for(var n=0,o={},i="string"==typeof r?r.split(" "):[r];n<4;n++)o[e+ie[n]+t]=i[n]||i[n-2]||i[0];return o}},"margin"!==e&&(D.cssHooks[e+t].set=rt)}),D.fn.extend({css:function(e,t){return G(this,function(e,t,r){var n,o,i={},a=0;if(Array.isArray(t)){for(n=Ue(e),o=t.length;a1)}}),D.Tween=it,it.prototype={constructor:it,init:function(e,t,r,n,o,i){this.elem=e,this.prop=r,this.easing=o||D.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=n,this.unit=i||(D.cssNumber[r]?"":"px")},cur:function(){var e=it.propHooks[this.prop];return e&&e.get?e.get(this):it.propHooks._default.get(this)},run:function(e){var t,r=it.propHooks[this.prop];return this.options.duration?this.pos=t=D.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),r&&r.set?r.set(this):it.propHooks._default.set(this),this}},it.prototype.init.prototype=it.prototype,it.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=D.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){D.fx.step[e.prop]?D.fx.step[e.prop](e):1!==e.elem.nodeType||!D.cssHooks[e.prop]&&null==e.elem.style[Ze(e.prop)]?e.elem[e.prop]=e.now:D.style(e.elem,e.prop,e.now+e.unit)}}},it.propHooks.scrollTop=it.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},D.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},D.fx=it.prototype.init,D.fx.step={};var at,st,lt=/^(?:toggle|show|hide)$/,ut=/queueHooks$/;function ct(){st&&(!1===a.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(ct):r.setTimeout(ct,D.fx.interval),D.fx.tick())}function ft(){return r.setTimeout(function(){at=void 0}),at=Date.now()}function ht(e,t){var r,n=0,o={height:e};for(t=t?1:0;n<4;n+=2-t)o["margin"+(r=ie[n])]=o["padding"+r]=e;return t&&(o.opacity=o.width=e),o}function pt(e,t,r){for(var n,o=(dt.tweeners[t]||[]).concat(dt.tweeners["*"]),i=0,a=o.length;i1)},removeAttr:function(e){return this.each(function(){D.removeAttr(this,e)})}}),D.extend({attr:function(e,t,r){var n,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return void 0===e.getAttribute?D.prop(e,t,r):(1===i&&D.isXMLDoc(e)||(o=D.attrHooks[t.toLowerCase()]||(D.expr.match.bool.test(t)?mt:void 0)),void 0!==r?null===r?void D.removeAttr(e,t):o&&"set"in o&&void 0!==(n=o.set(e,r,t))?n:(e.setAttribute(t,r+""),r):o&&"get"in o&&null!==(n=o.get(e,t))?n:null==(n=D.find.attr(e,t))?void 0:n)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&z(e,"input")){var r=e.value;return e.setAttribute("type",t),r&&(e.value=r),t}}}},removeAttr:function(e,t){var r,n=0,o=t&&t.match(F);if(o&&1===e.nodeType)for(;r=o[n++];)e.removeAttribute(r)}}),mt={set:function(e,t,r){return!1===t?D.removeAttr(e,r):e.setAttribute(r,r),r}},D.each(D.expr.match.bool.source.match(/\w+/g),function(e,t){var r=vt[t]||D.find.attr;vt[t]=function(e,t,n){var o,i,a=t.toLowerCase();return n||(i=vt[a],vt[a]=o,o=null!=r(e,t,n)?a:null,vt[a]=i),o}});var yt=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function bt(e){return(e.match(F)||[]).join(" ")}function xt(e){return e.getAttribute&&e.getAttribute("class")||""}function wt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(F)||[]}D.fn.extend({prop:function(e,t){return G(this,D.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[D.propFix[e]||e]})}}),D.extend({prop:function(e,t,r){var n,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&D.isXMLDoc(e)||(t=D.propFix[t]||t,o=D.propHooks[t]),void 0!==r?o&&"set"in o&&void 0!==(n=o.set(e,r,t))?n:e[t]=r:o&&"get"in o&&null!==(n=o.get(e,t))?n:e[t]},propHooks:{tabIndex:{get:function(e){var t=D.find.attr(e,"tabindex");return t?parseInt(t,10):yt.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),y.optSelected||(D.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),D.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){D.propFix[this.toLowerCase()]=this}),D.fn.extend({addClass:function(e){var t,r,n,o,i,a,s,l=0;if(g(e))return this.each(function(t){D(this).addClass(e.call(this,t,xt(this)))});if((t=wt(e)).length)for(;r=this[l++];)if(o=xt(r),n=1===r.nodeType&&" "+bt(o)+" "){for(a=0;i=t[a++];)n.indexOf(" "+i+" ")<0&&(n+=i+" ");o!==(s=bt(n))&&r.setAttribute("class",s)}return this},removeClass:function(e){var t,r,n,o,i,a,s,l=0;if(g(e))return this.each(function(t){D(this).removeClass(e.call(this,t,xt(this)))});if(!arguments.length)return this.attr("class","");if((t=wt(e)).length)for(;r=this[l++];)if(o=xt(r),n=1===r.nodeType&&" "+bt(o)+" "){for(a=0;i=t[a++];)for(;n.indexOf(" "+i+" ")>-1;)n=n.replace(" "+i+" "," ");o!==(s=bt(n))&&r.setAttribute("class",s)}return this},toggleClass:function(e,t){var r=typeof e,n="string"===r||Array.isArray(e);return"boolean"==typeof t&&n?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(r){D(this).toggleClass(e.call(this,r,xt(this),t),t)}):this.each(function(){var t,o,i,a;if(n)for(o=0,i=D(this),a=wt(e);t=a[o++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==r||((t=xt(this))&&Q.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Q.get(this,"__className__")||""))})},hasClass:function(e){var t,r,n=0;for(t=" "+e+" ";r=this[n++];)if(1===r.nodeType&&(" "+bt(xt(r))+" ").indexOf(t)>-1)return!0;return!1}});var _t=/\r/g;D.fn.extend({val:function(e){var t,r,n,o=this[0];return arguments.length?(n=g(e),this.each(function(r){var o;1===this.nodeType&&(null==(o=n?e.call(this,r,D(this).val()):e)?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=D.map(o,function(e){return null==e?"":e+""})),(t=D.valHooks[this.type]||D.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,o,"value")||(this.value=o))})):o?(t=D.valHooks[o.type]||D.valHooks[o.nodeName.toLowerCase()])&&"get"in t&&void 0!==(r=t.get(o,"value"))?r:"string"==typeof(r=o.value)?r.replace(_t,""):null==r?"":r:void 0}}),D.extend({valHooks:{option:{get:function(e){var t=D.find.attr(e,"value");return null!=t?t:bt(D.text(e))}},select:{get:function(e){var t,r,n,o=e.options,i=e.selectedIndex,a="select-one"===e.type,s=a?null:[],l=a?i+1:o.length;for(n=i<0?l:a?i:0;n-1)&&(r=!0);return r||(e.selectedIndex=-1),i}}}}),D.each(["radio","checkbox"],function(){D.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=D.inArray(D(e).val(),t)>-1}},y.checkOn||(D.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in r;var Dt=/^(?:focusinfocus|focusoutblur)$/,St=function(e){e.stopPropagation()};D.extend(D.event,{trigger:function(e,t,n,o){var i,s,l,u,c,f,h,p,m=[n||a],v=d.call(e,"type")?e.type:e,y=d.call(e,"namespace")?e.namespace.split("."):[];if(s=p=l=n=n||a,3!==n.nodeType&&8!==n.nodeType&&!Dt.test(v+D.event.triggered)&&(v.indexOf(".")>-1&&(y=v.split("."),v=y.shift(),y.sort()),c=v.indexOf(":")<0&&"on"+v,(e=e[D.expando]?e:new D.Event(v,"object"==typeof e&&e)).isTrigger=o?2:3,e.namespace=y.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:D.makeArray(t,[e]),h=D.event.special[v]||{},o||!h.trigger||!1!==h.trigger.apply(n,t))){if(!o&&!h.noBubble&&!b(n)){for(u=h.delegateType||v,Dt.test(u+v)||(s=s.parentNode);s;s=s.parentNode)m.push(s),l=s;l===(n.ownerDocument||a)&&m.push(l.defaultView||l.parentWindow||r)}for(i=0;(s=m[i++])&&!e.isPropagationStopped();)p=s,e.type=i>1?u:h.bindType||v,(f=(Q.get(s,"events")||{})[e.type]&&Q.get(s,"handle"))&&f.apply(s,t),(f=c&&s[c])&&f.apply&&K(s)&&(e.result=f.apply(s,t),!1===e.result&&e.preventDefault());return e.type=v,o||e.isDefaultPrevented()||h._default&&!1!==h._default.apply(m.pop(),t)||!K(n)||c&&g(n[v])&&!b(n)&&((l=n[c])&&(n[c]=null),D.event.triggered=v,e.isPropagationStopped()&&p.addEventListener(v,St),n[v](),e.isPropagationStopped()&&p.removeEventListener(v,St),D.event.triggered=void 0,l&&(n[c]=l)),e.result}},simulate:function(e,t,r){var n=D.extend(new D.Event,r,{type:e,isSimulated:!0});D.event.trigger(n,null,t)}}),D.fn.extend({trigger:function(e,t){return this.each(function(){D.event.trigger(e,t,this)})},triggerHandler:function(e,t){var r=this[0];if(r)return D.event.trigger(e,t,r,!0)}}),y.focusin||D.each({focus:"focusin",blur:"focusout"},function(e,t){var r=function(e){D.event.simulate(t,e.target,D.event.fix(e))};D.event.special[t]={setup:function(){var n=this.ownerDocument||this,o=Q.access(n,t);o||n.addEventListener(e,r,!0),Q.access(n,t,(o||0)+1)},teardown:function(){var n=this.ownerDocument||this,o=Q.access(n,t)-1;o?Q.access(n,t,o):(n.removeEventListener(e,r,!0),Q.remove(n,t))}}});var Ct=r.location,At=Date.now(),$t=/\?/;D.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new r.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||D.error("Invalid XML: "+e),t};var Mt=/\[\]$/,Tt=/\r?\n/g,zt=/^(?:submit|button|image|reset|file)$/i,Et=/^(?:input|select|textarea|keygen)/i;function Lt(e,t,r,n){var o;if(Array.isArray(t))D.each(t,function(t,o){r||Mt.test(e)?n(e,o):Lt(e+"["+("object"==typeof o&&null!=o?t:"")+"]",o,r,n)});else if(r||"object"!==_(t))n(e,t);else for(o in t)Lt(e+"["+o+"]",t[o],r,n)}D.param=function(e,t){var r,n=[],o=function(e,t){var r=g(t)?t():t;n[n.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==r?"":r)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!D.isPlainObject(e))D.each(e,function(){o(this.name,this.value)});else for(r in e)Lt(r,e[r],t,o);return n.join("&")},D.fn.extend({serialize:function(){return D.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=D.prop(this,"elements");return e?D.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!D(this).is(":disabled")&&Et.test(this.nodeName)&&!zt.test(e)&&(this.checked||!me.test(e))}).map(function(e,t){var r=D(this).val();return null==r?null:Array.isArray(r)?D.map(r,function(e){return{name:t.name,value:e.replace(Tt,"\r\n")}}):{name:t.name,value:r.replace(Tt,"\r\n")}}).get()}});var kt=/%20/g,It=/#.*$/,Ot=/([?&])_=[^&]*/,jt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Nt=/^(?:GET|HEAD)$/,Ft=/^\/\//,Pt={},Rt={},Vt="*/".concat("*"),qt=a.createElement("a");function Bt(e){return function(t,r){"string"!=typeof t&&(r=t,t="*");var n,o=0,i=t.toLowerCase().match(F)||[];if(g(r))for(;n=i[o++];)"+"===n[0]?(n=n.slice(1)||"*",(e[n]=e[n]||[]).unshift(r)):(e[n]=e[n]||[]).push(r)}}function Ut(e,t,r,n){var o={},i=e===Rt;function a(s){var l;return o[s]=!0,D.each(e[s]||[],function(e,s){var u=s(t,r,n);return"string"!=typeof u||i||o[u]?i?!(l=u):void 0:(t.dataTypes.unshift(u),a(u),!1)}),l}return a(t.dataTypes[0])||!o["*"]&&a("*")}function Gt(e,t){var r,n,o=D.ajaxSettings.flatOptions||{};for(r in t)void 0!==t[r]&&((o[r]?e:n||(n={}))[r]=t[r]);return n&&D.extend(!0,e,n),e}qt.href=Ct.href,D.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Vt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":D.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Gt(Gt(e,D.ajaxSettings),t):Gt(D.ajaxSettings,e)},ajaxPrefilter:Bt(Pt),ajaxTransport:Bt(Rt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,o,i,s,l,u,c,f,h,p,d=D.ajaxSetup({},t),m=d.context||d,v=d.context&&(m.nodeType||m.jquery)?D(m):D.event,y=D.Deferred(),g=D.Callbacks("once memory"),b=d.statusCode||{},x={},w={},_="canceled",S={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s)for(s={};t=jt.exec(i);)s[t[1].toLowerCase()+" "]=(s[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=s[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return c?i:null},setRequestHeader:function(e,t){return null==c&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,x[e]=t),this},overrideMimeType:function(e){return null==c&&(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)S.always(e[S.status]);else for(t in e)b[t]=[b[t],e[t]];return this},abort:function(e){var t=e||_;return n&&n.abort(t),C(0,t),this}};if(y.promise(S),d.url=((e||d.url||Ct.href)+"").replace(Ft,Ct.protocol+"//"),d.type=t.method||t.type||d.method||d.type,d.dataTypes=(d.dataType||"*").toLowerCase().match(F)||[""],null==d.crossDomain){u=a.createElement("a");try{u.href=d.url,u.href=u.href,d.crossDomain=qt.protocol+"//"+qt.host!=u.protocol+"//"+u.host}catch(e){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=D.param(d.data,d.traditional)),Ut(Pt,d,t,S),c)return S;for(h in(f=D.event&&d.global)&&0==D.active++&&D.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Nt.test(d.type),o=d.url.replace(It,""),d.hasContent?d.data&&d.processData&&0===(d.contentType||"").indexOf("application/x-www-form-urlencoded")&&(d.data=d.data.replace(kt,"+")):(p=d.url.slice(o.length),d.data&&(d.processData||"string"==typeof d.data)&&(o+=($t.test(o)?"&":"?")+d.data,delete d.data),!1===d.cache&&(o=o.replace(Ot,"$1"),p=($t.test(o)?"&":"?")+"_="+At+++p),d.url=o+p),d.ifModified&&(D.lastModified[o]&&S.setRequestHeader("If-Modified-Since",D.lastModified[o]),D.etag[o]&&S.setRequestHeader("If-None-Match",D.etag[o])),(d.data&&d.hasContent&&!1!==d.contentType||t.contentType)&&S.setRequestHeader("Content-Type",d.contentType),S.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Vt+"; q=0.01":""):d.accepts["*"]),d.headers)S.setRequestHeader(h,d.headers[h]);if(d.beforeSend&&(!1===d.beforeSend.call(m,S,d)||c))return S.abort();if(_="abort",g.add(d.complete),S.done(d.success),S.fail(d.error),n=Ut(Rt,d,t,S)){if(S.readyState=1,f&&v.trigger("ajaxSend",[S,d]),c)return S;d.async&&d.timeout>0&&(l=r.setTimeout(function(){S.abort("timeout")},d.timeout));try{c=!1,n.send(x,C)}catch(e){if(c)throw e;C(-1,e)}}else C(-1,"No Transport");function C(e,t,a,s){var u,h,p,x,w,_=t;c||(c=!0,l&&r.clearTimeout(l),n=void 0,i=s||"",S.readyState=e>0?4:0,u=e>=200&&e<300||304===e,a&&(x=function(e,t,r){for(var n,o,i,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=e.mimeType||t.getResponseHeader("Content-Type"));if(n)for(o in s)if(s[o]&&s[o].test(n)){l.unshift(o);break}if(l[0]in r)i=l[0];else{for(o in r){if(!l[0]||e.converters[o+" "+l[0]]){i=o;break}a||(a=o)}i=i||a}if(i)return i!==l[0]&&l.unshift(i),r[i]}(d,S,a)),x=function(e,t,r,n){var o,i,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(i=c.shift();i;)if(e.responseFields[i]&&(r[e.responseFields[i]]=t),!l&&n&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=i,i=c.shift())if("*"===i)i=l;else if("*"!==l&&l!==i){if(!(a=u[l+" "+i]||u["* "+i]))for(o in u)if((s=o.split(" "))[1]===i&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[o]:!0!==u[o]&&(i=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+i}}}return{state:"success",data:t}}(d,x,S,u),u?(d.ifModified&&((w=S.getResponseHeader("Last-Modified"))&&(D.lastModified[o]=w),(w=S.getResponseHeader("etag"))&&(D.etag[o]=w)),204===e||"HEAD"===d.type?_="nocontent":304===e?_="notmodified":(_=x.state,h=x.data,u=!(p=x.error))):(p=_,!e&&_||(_="error",e<0&&(e=0))),S.status=e,S.statusText=(t||_)+"",u?y.resolveWith(m,[h,_,S]):y.rejectWith(m,[S,_,p]),S.statusCode(b),b=void 0,f&&v.trigger(u?"ajaxSuccess":"ajaxError",[S,d,u?h:p]),g.fireWith(m,[S,_]),f&&(v.trigger("ajaxComplete",[S,d]),--D.active||D.event.trigger("ajaxStop")))}return S},getJSON:function(e,t,r){return D.get(e,t,r,"json")},getScript:function(e,t){return D.get(e,void 0,t,"script")}}),D.each(["get","post"],function(e,t){D[t]=function(e,r,n,o){return g(r)&&(o=o||n,n=r,r=void 0),D.ajax(D.extend({url:e,type:t,dataType:o,data:r,success:n},D.isPlainObject(e)&&e))}}),D._evalUrl=function(e,t){return D.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){D.globalEval(e,t)}})},D.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=D(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g(e)?this.each(function(t){D(this).wrapInner(e.call(this,t))}):this.each(function(){var t=D(this),r=t.contents();r.length?r.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(r){D(this).wrapAll(t?e.call(this,r):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){D(this).replaceWith(this.childNodes)}),this}}),D.expr.pseudos.hidden=function(e){return!D.expr.pseudos.visible(e)},D.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},D.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(e){}};var Ht={0:200,1223:204},Wt=D.ajaxSettings.xhr();y.cors=!!Wt&&"withCredentials"in Wt,y.ajax=Wt=!!Wt,D.ajaxTransport(function(e){var t,n;if(y.cors||Wt&&!e.crossDomain)return{send:function(o,i){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];for(a in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest"),o)s.setRequestHeader(a,o[a]);t=function(e){return function(){t&&(t=n=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?i(0,"error"):i(s.status,s.statusText):i(Ht[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),n=s.onerror=s.ontimeout=t("error"),void 0!==s.onabort?s.onabort=n:s.onreadystatechange=function(){4===s.readyState&&r.setTimeout(function(){t&&n()})},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}}),D.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),D.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return D.globalEval(e),e}}}),D.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),D.ajaxTransport("script",function(e){var t,r;if(e.crossDomain||e.scriptAttrs)return{send:function(n,o){t=D("