Last active
June 19, 2018 04:25
-
-
Save brwnj/51bc53de2af92f516cb4cf81a06528fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 50, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"%matplotlib inline" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 12, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<script>requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min']},});if(!window.Plotly) {{require(['plotly'],function(plotly) {window.Plotly=plotly;});}}</script>" | |
], | |
"text/vnd.plotly.v1+html": [ | |
"<script>requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min']},});if(!window.Plotly) {{require(['plotly'],function(plotly) {window.Plotly=plotly;});}}</script>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
}, | |
{ | |
"data": { | |
"text/html": [ | |
"<script type='text/javascript'>if(!window.Plotly){define('plotly', function(require, exports, module) {/**\n", | |
"* plotly.js v1.35.2\n", | |
"* Copyright 2012-2018, Plotly, Inc.\n", | |
"* All rights reserved.\n", | |
"* Licensed under the MIT license\n", | |
"*/\n", | |
"!function(t){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=t();else if(\"function\"==typeof define&&define.amd)define([],t);else{(\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:this).Plotly=t()}}(function(){var t={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,MINUS_SIGN:\"\\u2212\"},e={exports:{}};!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,h=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){h.call(this,t,e+\"\",r)}}function f(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function p(t){return null===t?NaN:+t}function d(t){return!isNaN(t)}function g(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n<i;){var a=n+i>>>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<i;){var a=n+i>>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}t.ascending=f,t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=t[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=t[i])&&r>n&&(r=n)}else{for(;++i<a;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=e.call(t,t[i],i))&&r>n&&(r=n)}return r},t.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=t[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=t[i])&&n>r&&(r=n)}else{for(;++i<a;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=e.call(t,t[i],i))&&n>r&&(r=n)}return r},t.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a<o;)if(null!=(n=t[a])&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=t[a])&&(r>n&&(r=n),i<n&&(i=n))}else{for(;++a<o;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=e.call(t,t[a],a))&&(r>n&&(r=n),i<n&&(i=n))}return[r,i]},t.sum=function(t,e){var r,n=0,i=t.length,a=-1;if(1===arguments.length)for(;++a<i;)d(r=+t[a])&&(n+=r);else for(;++a<i;)d(r=+e.call(t,t[a],a))&&(n+=r);return n},t.mean=function(t,e){var r,n=0,i=t.length,a=-1,o=i;if(1===arguments.length)for(;++a<i;)d(r=p(t[a]))?n+=r:--o;else for(;++a<i;)d(r=p(e.call(t,t[a],a)))?n+=r:--o;if(o)return n/o},t.quantile=function(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),i=+t[n-1],a=r-n;return a?i+a*(t[n]-i):i},t.median=function(e,r){var n,i=[],a=e.length,o=-1;if(1===arguments.length)for(;++o<a;)d(n=p(e[o]))&&i.push(n);else for(;++o<a;)d(n=p(r.call(e,e[o],o)))&&i.push(n);if(i.length)return t.quantile(i.sort(f),.5)},t.variance=function(t,e){var r,n,i=t.length,a=0,o=0,s=-1,l=0;if(1===arguments.length)for(;++s<i;)d(r=p(t[s]))&&(o+=(n=r-a)*(r-(a+=n/++l)));else for(;++s<i;)d(r=p(e.call(t,t[s],s)))&&(o+=(n=r-a)*(r-(a+=n/++l)));if(l>1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var v=g(f);function m(t){return t.length}t.bisectLeft=v.left,t.bisect=t.bisectRight=v.right,t.bisector=function(t){return g(1===t.length?function(e,r){return f(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<r;)i[e]=[n,n=t[++e]];return i},t.transpose=function(e){if(!(a=e.length))return[];for(var r=-1,n=t.min(e,m),i=new Array(n);++r<n;)for(var a,o=-1,s=i[r]=new Array(a);++o<a;)s[o]=e[o][r];return i},t.zip=function(){return t.transpose(arguments)},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},t.merge=function(t){for(var e,r,n,i=t.length,a=-1,o=0;++a<i;)o+=t[a].length;for(r=new Array(o);--i>=0;)for(e=(n=t[i]).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){var e=1;for(;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)<e;)i.push(n/a);return i},t.map=function(t,e){var r=new b;if(t instanceof b)t.forEach(function(t,e){r.set(t,e)});else if(Array.isArray(t)){var n,i=-1,a=t.length;if(1===arguments.length)for(;++i<a;)r.set(i,t[i]);else for(;++i<a;)r.set(e.call(t,n=t[i],i),n)}else for(var o in t)r.set(o,t[o]);return r};var _=\"__proto__\",w=\"\\0\";function M(t){return(t+=\"\")===_||t[0]===w?w+t:t}function A(t){return(t+=\"\")[0]===w?t.slice(1):t}function k(t){return M(t)in this._}function T(t){return(t=M(t))in this._&&delete this._[t]}function S(){var t=[];for(var e in this._)t.push(A(e));return t}function E(){var t=0;for(var e in this._)++t;return t}function C(){for(var t in this._)return!1;return!0}function L(){this._=Object.create(null)}function z(t){return t}function P(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function I(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=D.length;r<n;++r){var i=D[r]+e;if(i in t)return i}}x(b,{has:k,get:function(t){return this._[M(t)]},set:function(t,e){return this._[M(t)]=e},remove:T,keys:S,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:A(e),value:this._[e]});return t},size:E,empty:C,forEach:function(t){for(var e in this._)t.call(this,A(e),this._[e])}}),t.nest=function(){var e,r,n={},i=[],a=[];function o(t,a,s){if(s>=i.length)return r?r.call(n,a):e?a.sort(e):a;for(var l,u,c,h,f=-1,p=a.length,d=i[s++],g=new b;++f<p;)(h=g.get(l=d(u=a[f])))?h.push(u):g.set(l,[u]);return t?(u=t(),c=function(e,r){u.set(e,o(t,r,s))}):(u={},c=function(e,r){u[e]=o(t,r,s)}),g.forEach(c),u}return n.map=function(t,e){return o(e,t,0)},n.entries=function(e){return function t(e,r){if(r>=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<n;++r)e.add(t[r]);return e},x(L,{has:k,add:function(t){return this._[M(t+=\"\")]=!0,t},remove:T,values:S,size:E,empty:C,forEach:function(t){for(var e in this._)t.call(this,A(e))}}),t.behavior={},t.rebind=function(t,e){for(var r,n=1,i=arguments.length;++n<i;)t[r=arguments[n]]=P(t,e,e[r]);return t};var D=[\"webkit\",\"ms\",\"moz\",\"Moz\",\"o\",\"O\"];function O(){}function R(){}function F(t){var e=[],r=new b;function n(){for(var r,n=e,i=-1,a=n.length;++i<a;)(r=n[i].on)&&r.apply(this,arguments);return t}return n.on=function(n,i){var a,o=r.get(n);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,a=e.indexOf(o)).concat(e.slice(a+1)),r.remove(n)),i&&e.push(r.set(n,{on:i})),t)},n}function B(){t.event.preventDefault()}function N(){for(var e,r=t.event;e=r.sourceEvent;)r=e;return r}function j(e){for(var r=new R,n=0,i=arguments.length;++n<i;)r[arguments[n]]=F(r);return r.of=function(n,i){return function(a){try{var o=a.sourceEvent=t.event;a.target=e,t.event=a,r[a.type].apply(n,i)}finally{t.event=o}}},r}t.dispatch=function(){for(var t=new R,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=F(t);return t},R.prototype.on=function(t,e){var r=t.indexOf(\".\"),n=\"\";if(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 q(t){return U(t,Y),t}var H=function(t,e){return e.querySelector(t)},G=function(t,e){return e.querySelectorAll(t)},W=function(t,e){var r=t.matches||t[I(t,\"matchesSelector\")];return(W=function(t,e){return r.call(t,e)})(t,e)};\"function\"==typeof Sizzle&&(H=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 H(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<s;){a.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var l=-1,u=n.length;++l<u;)(i=n[l])?(e.push(r=t.call(i,i.__data__,l,o)),r&&\"__data__\"in i&&(r.__data__=i.__data__)):e.push(null)}return q(a)},Y.selectAll=function(t){var e,r,i=[];t=Z(t);for(var a=-1,o=this.length;++a<o;)for(var s=this[a],l=-1,u=s.length;++l<u;)(r=s[l])&&(i.push(e=n(t.call(r,r.__data__,l,a))),e.parentNode=r);return q(i)};var J=\"http://www.w3.org/1999/xhtml\",K={svg:\"http://www.w3.org/2000/svg\",xhtml:J,xlink:\"http://www.w3.org/1999/xlink\",xml:\"http://www.w3.org/XML/1998/namespace\",xmlns:\"http://www.w3.org/2000/xmlns/\"};function Q(e,r){return e=t.ns.qualify(e),null==r?e.local?function(){this.removeAttributeNS(e.space,e.local)}:function(){this.removeAttribute(e)}:\"function\"==typeof r?e.local?function(){var t=r.apply(this,arguments);null==t?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,t)}:function(){var t=r.apply(this,arguments);null==t?this.removeAttribute(e):this.setAttribute(e,t)}:e.local?function(){this.setAttributeNS(e.space,e.local,r)}:function(){this.setAttribute(e,r)}}function $(t){return t.trim().replace(/\\s+/g,\" \")}function tt(e){return new RegExp(\"(?:^|\\\\s+)\"+t.requote(e)+\"(?:\\\\s+|$)\",\"g\")}function et(t){return(t+\"\").trim().split(/^|\\s+/)}function rt(t,e){var r=(t=et(t).map(nt)).length;return\"function\"==typeof e?function(){for(var n=-1,i=e.apply(this,arguments);++n<r;)t[n](this,i)}:function(){for(var n=-1;++n<r;)t[n](this,e)}}function nt(t){var e=tt(t);return function(r,n){if(i=r.classList)return n?i.add(t):i.remove(t);var i=r.getAttribute(\"class\")||\"\";n?(e.lastIndex=0,e.test(i)||r.setAttribute(\"class\",$(i+\" \"+t))):r.setAttribute(\"class\",$(i.replace(e,\" \")))}}function it(t,e,r){return null==e?function(){this.style.removeProperty(t)}:\"function\"==typeof e?function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}:function(){this.style.setProperty(t,e,r)}}function at(t,e){return null==e?function(){delete this[t]}:\"function\"==typeof e?function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}:function(){this[t]=e}}function ot(e){return\"function\"==typeof e?e:(e=t.ns.qualify(e)).local?function(){return this.ownerDocument.createElementNS(e.space,e.local)}:function(){var t=this.ownerDocument,r=this.namespaceURI;return r===J&&t.documentElement.namespaceURI===J?t.createElement(e):t.createElementNS(r,e)}}function st(){var t=this.parentNode;t&&t.removeChild(this)}function lt(t){return{__data__:t}}function ut(t){return function(){return W(this,t)}}function ct(t,e){for(var r=0,n=t.length;r<n;r++)for(var i,a=t[r],o=0,s=a.length;o<s;o++)(i=a[o])&&e(i,o,r);return t}function ht(t){return U(t,ft),t}t.ns={prefix:K,qualify:function(t){var e=t.indexOf(\":\"),r=t;return e>=0&&\"xmlns\"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),K.hasOwnProperty(r)?{space:K[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(Q(r,e[r]));return this}return this.each(Q(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<n;)if(!e.contains(t[i]))return!1}else for(e=r.getAttribute(\"class\");++i<n;)if(!tt(t[i]).test(e))return!1;return!0}for(e in t)this.each(rt(e,t[e]));return this}return this.each(rt(t,e))},Y.style=function(t,e,r){var n=arguments.length;if(n<3){if(\"string\"!=typeof t){for(r in n<2&&(e=\"\"),t)this.each(it(r,t[r],e));return this}if(n<2){var i=this.node();return o(i).getComputedStyle(i,null).getPropertyValue(t)}r=\"\"}return this.each(it(t,e,r))},Y.property=function(t,e){if(arguments.length<2){if(\"string\"==typeof t)return this.node()[t];for(e in t)this.each(at(e,t[e]));return this}return this.each(at(t,e))},Y.text=function(t){return arguments.length?this.each(\"function\"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?\"\":e}:null==t?function(){this.textContent=\"\"}:function(){this.textContent=t}):this.node().textContent},Y.html=function(t){return arguments.length?this.each(\"function\"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?\"\":e}:null==t?function(){this.innerHTML=\"\"}:function(){this.innerHTML=t}):this.node().innerHTML},Y.append=function(t){return t=ot(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},Y.insert=function(t,e){return t=ot(t),e=X(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},Y.remove=function(){return this.each(st)},Y.data=function(t,e){var r,n,i=-1,a=this.length;if(!arguments.length){for(t=new Array(a=(r=this[0]).length);++i<a;)(n=r[i])&&(t[i]=n.__data__);return t}function o(t,r){var n,i,a,o=t.length,c=r.length,h=Math.min(o,c),f=new Array(c),p=new Array(c),d=new Array(o);if(e){var g,v=new b,m=new Array(o);for(n=-1;++n<o;)(i=t[n])&&(v.has(g=e.call(i,i.__data__,n))?d[n]=i:v.set(g,i),m[n]=g);for(n=-1;++n<c;)(i=v.get(g=e.call(r,a=r[n],n)))?!0!==i&&(f[n]=i,i.__data__=a):p[n]=lt(a),v.set(g,!0);for(n=-1;++n<o;)n in m&&!0!==v.get(m[n])&&(d[n]=t[n])}else{for(n=-1;++n<h;)i=t[n],a=r[n],i?(i.__data__=a,f[n]=i):p[n]=lt(a);for(;n<c;++n)p[n]=lt(r[n]);for(;n<o;++n)d[n]=t[n]}p.update=f,p.parentNode=f.parentNode=d.parentNode=t.parentNode,s.push(p),l.push(f),u.push(d)}var s=ht([]),l=q([]),u=q([]);if(\"function\"==typeof t)for(;++i<a;)o(r=this[i],t.call(r,r.parentNode.__data__,i));else for(;++i<a;)o(r=this[i],t);return l.enter=function(){return s},l.exit=function(){return u},l},Y.datum=function(t){return arguments.length?this.property(\"__data__\",t):this.property(\"__data__\")},Y.filter=function(t){var e,r,n,i=[];\"function\"!=typeof t&&(t=ut(t));for(var a=0,o=this.length;a<o;a++){i.push(e=[]),e.parentNode=(r=this[a]).parentNode;for(var s=0,l=r.length;s<l;s++)(n=r[s])&&t.call(n,n.__data__,s,a)&&e.push(n)}return q(i)},Y.order=function(){for(var t=-1,e=this.length;++t<e;)for(var r,n=this[t],i=n.length-1,a=n[i];--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){arguments.length||(t=f);return function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},Y.each=function(t){return ct(this,function(e,r,n){t.call(e,e.__data__,r,n)})},Y.call=function(t){var e=n(arguments);return t.apply(e[0]=this,e),this},Y.empty=function(){return!this.node()},Y.node=function(){for(var t=0,e=this.length;t<e;t++)for(var r=this[t],n=0,i=r.length;n<i;n++){var a=r[n];if(a)return a}return null},Y.size=function(){var t=0;return ct(this,function(){++t}),t};var ft=[];function pt(e,r,i){var a=\"__on\"+e,o=e.indexOf(\".\"),s=gt;o>0&&(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=vt),o?r?function(){var t=s(r,n(arguments));u.call(this),this.addEventListener(e,this[a]=t,t.$=i),t._=r}:u:r?O: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=ht,t.selection.enter.prototype=ft,ft.append=Y.append,ft.empty=Y.empty,ft.node=Y.node,ft.call=Y.call,ft.size=Y.size,ft.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++s<l;){n=(i=this[s]).update,o.push(e=[]),e.parentNode=i.parentNode;for(var u=-1,c=i.length;++u<c;)(a=i[u])?(e.push(n[u]=r=t.call(i.parentNode,a.__data__,u,s)),r.__data__=a.__data__):e.push(null)}return q(o)},ft.insert=function(t,e){var r,n,i;return arguments.length<2&&(r=this,e=function(t,e,a){var o,s=r[a].update,l=s.length;for(a!=i&&(i=a,n=0),e>=n&&(n=e+1);!(o=s[n])&&++n<l;);return o}),Y.insert.call(this,t,e)},t.select=function(t){var e;return\"string\"==typeof t?(e=[H(t,i)]).parentNode=i.documentElement:(e=[t]).parentNode=a(t),q([e])},t.selectAll=function(t){var e;return\"string\"==typeof t?(e=n(G(t,i))).parentNode=i.documentElement:(e=n(t)).parentNode=null,q([e])},Y.on=function(t,e,r){var n=arguments.length;if(n<3){if(\"string\"!=typeof t){for(r in n<2&&(e=!1),t)this.each(pt(r,t[r],e));return this}if(n<2)return(n=this.node()[\"__on\"+t])&&n._;r=!1}return this.each(pt(t,e,r))};var dt=t.map({mouseenter:\"mouseover\",mouseleave:\"mouseout\"});function gt(e,r){return function(n){var i=t.event;t.event=n,r[0]=this.__data__;try{e.apply(this,r)}finally{t.event=i}}}function vt(t,e){var r=gt(t,e);return function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||r.call(this,t)}}i&&dt.forEach(function(t){\"on\"+t in i&&dt.remove(t)});var mt,yt=0;function xt(e){var r=\".dragsuppress-\"+ ++yt,n=\"click\"+r,i=t.select(o(e)).on(\"touchmove\"+r,B).on(\"dragstart\"+r,B).on(\"selectstart\"+r,B);if(null==mt&&(mt=!(\"onselectstart\"in e)&&I(e.style,\"userSelect\")),mt){var s=a(e).style,l=s[mt];s[mt]=\"none\"}return function(t){if(i.on(r,null),mt&&(s[mt]=l),t){var e=function(){i.on(n,null)};i.on(n,function(){B(),e()},!0),setTimeout(e,0)}}}t.mouse=function(t){return _t(t,N())};var bt=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function _t(e,r){r.changedTouches&&(r=r.changedTouches[0]);var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();if(bt<0){var a=o(e);if(a.scrollX||a.scrollY){var s=(n=t.select(\"body\").append(\"svg\").style({position:\"absolute\",top:0,left:0,margin:0,padding:0,border:\"none\"},\"important\"))[0][0].getScreenCTM();bt=!(s.f||s.e),n.remove()}}return bt?(i.x=r.pageX,i.y=r.pageY):(i.x=r.clientX,i.y=r.clientY),[(i=i.matrixTransform(e.getScreenCTM().inverse())).x,i.y]}var l=e.getBoundingClientRect();return[r.clientX-l.left-e.clientLeft,r.clientY-l.top-e.clientTop]}function wt(){return t.event.changedTouches[0].identifier}t.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=N().changedTouches),e)for(var n,i=0,a=e.length;i<a;++i)if((n=e[i]).identifier===r)return _t(t,n)},t.behavior.drag=function(){var e=j(a,\"drag\",\"dragstart\",\"dragend\"),r=null,n=s(O,t.mouse,o,\"mousemove\",\"mouseup\"),i=s(wt,t.touch,z,\"touchmove\",\"touchend\");function a(){this.on(\"mousedown.drag\",n).on(\"touchstart.drag\",i)}function s(n,i,a,o,s){return function(){var l,u=t.event.target.correspondingElement||t.event.target,c=this.parentNode,h=e.of(this,arguments),f=0,p=n(),d=\".drag\"+(null==p?\"\":\"-\"+p),g=t.select(a(u)).on(o+d,function(){var t,e,r=i(c,p);if(!r)return;t=r[0]-m[0],e=r[1]-m[1],f|=t|e,m=r,h({type:\"drag\",x:r[0]+l[0],y:r[1]+l[1],dx:t,dy:e})}).on(s+d,function(){if(!i(c,p))return;g.on(o+d,null).on(s+d,null),v(f),h({type:\"dragend\"})}),v=xt(u),m=i(c,p);l=r?[(l=r.apply(this,arguments)).x-m[0],l.y-m[1]]:[0,0],h({type:\"dragstart\"})}}return a.origin=function(t){return arguments.length?(r=t,a):r},t.rebind(a,e,\"on\")},t.touches=function(t,e){return arguments.length<2&&(e=N().touches),e?n(e).map(function(e){var r=_t(t,e);return r.identifier=e.identifier,r}):[]};var Mt=1e-6,At=Mt*Mt,kt=Math.PI,Tt=2*kt,St=Tt-Mt,Et=kt/2,Ct=kt/180,Lt=180/kt;function zt(t){return t>0?1:t<0?-1:0}function Pt(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function It(t){return t>1?0:t<-1?kt:Math.acos(t)}function Dt(t){return t>1?Et:t<-1?-Et:Math.asin(t)}function Ot(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,h=l-a,f=c*c+h*h;if(f<At)n=Math.log(u/o)/Ft,r=function(t){return[i+t*c,a+t*h,o*Math.exp(Ft*t*n)]};else{var p=Math.sqrt(f),d=(u*u-o*o+4*f)/(2*o*2*p),g=(u*u-o*o-4*f)/(2*u*2*p),v=Math.log(Math.sqrt(d*d+1)-d),m=Math.log(Math.sqrt(g*g+1)-g);n=(m-v)/Ft,r=function(t){var e,r=t*n,s=Ot(v),l=o/(2*p)*(s*(e=Ft*r+v,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(v));return[i+l*c,a+l*h,o*s/Ot(Ft*r+v)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,a,s,l,u,c,h,f={x:0,y:0,k:1},p=[960,500],d=jt,g=250,v=0,m=\"mousedown.zoom\",y=\"mousemove.zoom\",x=\"mouseup.zoom\",b=\"touchstart.zoom\",_=j(w,\"zoomstart\",\"zoom\",\"zoomend\");function w(t){t.on(m,z).on(Nt+\".zoom\",I).on(\"dblclick.zoom\",D).on(b,P)}function M(t){return[(t[0]-f.x)/f.k,(t[1]-f.y)/f.k]}function A(t){f.k=Math.max(d[0],Math.min(d[1],t))}function k(t,e){e=function(t){return[t[0]*f.k+f.x,t[1]*f.k+f.y]}(e),f.x+=t[0]-e[0],f.y+=t[1]-e[1]}function T(e,n,i,a){e.__chart__={x:f.x,y:f.y,k:f.k},A(Math.pow(2,a)),k(r=n,i),e=t.select(e),g>0&&(e=e.transition().duration(g)),e.call(w.event)}function S(){u&&u.domain(l.range().map(function(t){return(t-f.x)/f.k}).map(l.invert)),h&&h.domain(c.range().map(function(t){return(t-f.y)/f.k}).map(c.invert))}function E(t){v++||t({type:\"zoomstart\"})}function C(t){S(),t({type:\"zoom\",scale:f.k,translate:[f.x,f.y]})}function L(t){--v||(t({type:\"zoomend\"}),r=null)}function z(){var e=this,r=_.of(e,arguments),n=0,i=t.select(o(e)).on(y,function(){n=1,k(t.mouse(e),a),C(r)}).on(x,function(){i.on(y,null).on(x,null),s(n),L(r)}),a=M(t.mouse(e)),s=xt(e);ss.call(e),E(r)}function P(){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=[],h=t.select(r),p=xt(r);function d(){var n=t.touches(r);return e=f.k,n.forEach(function(t){t.identifier in i&&(i[t.identifier]=M(t))}),n}function g(){var e=t.event.target;t.select(e).on(l,v).on(u,y),c.push(e);for(var n=t.event.changedTouches,o=0,h=n.length;o<h;++o)i[n[o].identifier]=null;var p=d(),g=Date.now();if(1===p.length){if(g-s<500){var m=p[0];T(r,m,i[m.identifier],Math.floor(Math.log(f.k)/Math.LN2)+1),B()}s=g}else if(p.length>1){m=p[0];var x=p[1],b=m[0]-x[0],_=m[1]-x[1];a=b*b+_*_}}function v(){var o,l,u,c,h=t.touches(r);ss.call(r);for(var f=0,p=h.length;f<p;++f,c=null)if(u=h[f],c=i[u.identifier]){if(l)break;o=u,l=c}if(c){var d=(d=u[0]-o[0])*d+(d=u[1]-o[1])*d,g=a&&Math.sqrt(d/a);o=[(o[0]+u[0])/2,(o[1]+u[1])/2],l=[(l[0]+c[0])/2,(l[1]+c[1])/2],A(g*e)}s=null,k(o,l),C(n)}function y(){if(t.event.touches.length){for(var e=t.event.changedTouches,r=0,a=e.length;r<a;++r)delete i[e[r].identifier];for(var s in i)return void d()}t.selectAll(c).on(o,null),h.on(m,z).on(b,P),p(),L(n)}g(),E(n),h.on(m,null).on(b,g)}function I(){var i=_.of(this,arguments);a?clearTimeout(a):(ss.call(this),e=M(r=n||t.mouse(this)),E(i)),a=setTimeout(function(){a=null,L(i)},50),B(),A(Math.pow(2,.002*Bt())*f.k),k(r,e),C(i)}function D(){var e=t.mouse(this),r=Math.log(f.k)/Math.LN2;T(this,e,M(e),t.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}return Nt||(Nt=\"onwheel\"in i?(Bt=function(){return-t.event.deltaY*(t.event.deltaMode?120:1)},\"wheel\"):\"onmousewheel\"in i?(Bt=function(){return t.event.wheelDelta},\"mousewheel\"):(Bt=function(){return-t.event.detail},\"MozMousePixelScroll\")),w.event=function(e){e.each(function(){var e=_.of(this,arguments),n=f;cs?t.select(this).transition().each(\"start.zoom\",function(){f=this.__chart__||{x:0,y:0,k:1},E(e)}).tween(\"zoom:zoom\",function(){var i=p[0],a=p[1],o=r?r[0]:i/2,s=r?r[1]:a/2,l=t.interpolateZoom([(o-f.x)/f.k,(s-f.y)/f.k,i/f.k],[(o-n.x)/n.k,(s-n.y)/n.k,i/n.k]);return function(t){var r=l(t),n=i/r[2];this.__chart__=f={x:o-r[0]*n,y:s-r[1]*n,k:n},C(e)}}).each(\"interrupt.zoom\",function(){L(e)}).each(\"end.zoom\",function(){L(e)}):(this.__chart__=f,E(e),C(e),L(e))})},w.translate=function(t){return arguments.length?(f={x:+t[0],y:+t[1],k:f.k},S(),w):[f.x,f.y]},w.scale=function(t){return arguments.length?(f={x:f.x,y:f.y,k:null},A(+t),S(),w):f.k},w.scaleExtent=function(t){return arguments.length?(d=null==t?jt:[+t[0],+t[1]],w):d},w.center=function(t){return arguments.length?(n=t&&[+t[0],+t[1]],w):n},w.size=function(t){return arguments.length?(p=t&&[+t[0],+t[1]],w):p},w.duration=function(t){return arguments.length?(g=+t,w):g},w.x=function(t){return arguments.length?(u=t,l=t.copy(),f={x:0,y:0,k:1},w):u},w.y=function(t){return arguments.length?(h=t,c=t.copy(),f={x:0,y:0,k:1},w):h},t.rebind(w,_,\"on\")};var Bt,Nt,jt=[0,1/0];function Vt(){}function Ut(t,e,r){return this instanceof Ut?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof Ut?new Ut(t.h,t.s,t.l):ce(\"\"+t,he,Ut):new Ut(t,e,r)}t.color=Vt,Vt.prototype.toString=function(){return this.rgb()+\"\"},t.hsl=Ut;var qt=Ut.prototype=new Vt;function Ht(t,e,r){var n,i;function a(t){return Math.round(255*function(t){return t>360?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=fe((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Gt(e,r,n)}qt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ut(this.h,this.s,this.l/t)},qt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ut(this.h,this.s,t*this.l)},qt.rgb=function(){return Ht(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):fe((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,Jt=.95047,Kt=1,Qt=1.08883,$t=Xt.prototype=new Vt;function te(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return new ae(ie(3.2404542*(i=re(i)*Jt)-1.5371385*(n=re(n)*Kt)-.4985314*(a=re(a)*Qt)),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,Ht):new ae(t,e,r)}function oe(t){return new ae(t>>16,t>>8&255,255&t)}function se(t){return oe(t)+\"\"}$t.brighter=function(t){return new Xt(Math.min(100,this.l+Zt*(arguments.length?t:1)),this.a,this.b)},$t.darker=function(t){return new Xt(Math.max(0,this.l-Zt*(arguments.length?t:1)),this.a,this.b)},$t.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=ge.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 he(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+(e<r?6:0):e==o?(r-t)/s+2:(t-e)/s+4,n*=60):(n=NaN,i=l>0&&l<1?0:n),new Ut(n,i,l)}function fe(t,e,r){var n=ne((.4124564*(t=pe(t))+.3575761*(e=pe(e))+.1804375*(r=pe(r)))/Jt),i=ne((.2126729*t+.7151522*e+.072175*r)/Kt);return Xt(116*i-16,500*(n-i),200*(i-ne((.0193339*t+.119192*e+.9503041*r)/Qt)))}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<i&&(e=i),r&&r<i&&(r=i),n&&n<i&&(n=i),new ae(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new ae(i,i,i)},le.darker=function(t){return new ae((t=Math.pow(.7,arguments.length?t:1))*this.r,t*this.g,t*this.b)},le.hsl=function(){return he(this.r,this.g,this.b)},le.toString=function(){return\"#\"+ue(this.r)+ue(this.g)+ue(this.b)};var ge=t.map({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 ve(t){return\"function\"==typeof t?t:function(){return t}}function me(t){return function(e,r,n){return 2===arguments.length&&\"function\"==typeof r&&(n=r,r=null),ye(e,r,t,n)}}function ye(e,r,i,a){var o={},s=t.dispatch(\"beforesend\",\"progress\",\"load\",\"error\"),l={},u=new XMLHttpRequest,c=null;function h(){var t,e=u.status;if(!e&&function(t){var e=t.responseType;return e&&\"text\"!==e?t.response:t.responseText}(u)||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=h:u.onreadystatechange=function(){u.readyState>3&&h()},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))}ge.forEach(function(t,e){ge.set(t,oe(e))}),t.functor=ve,t.xhr=me(z),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 h(){if(u>=l)return o;if(i)return i=!1,a;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++<l;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}return u=r+2,13===(s=t.charCodeAt(r+1))?(i=!0,10===t.charCodeAt(r+2)&&++u):10===s&&(i=!0),t.slice(e+1,r).replace(/\"\"/g,'\"')}for(;u<l;){var s,c=1;if(10===(s=t.charCodeAt(u++)))i=!0;else if(13===s)i=!0,10===t.charCodeAt(u)&&(++u,++c);else if(s!==n)continue;return t.slice(e,u-c)}return t.slice(e)}for(;(r=h())!==o;){for(var f=[];r!==a&&r!==o;)f.push(r),r=h();e&&null==(f=e(f,c++))||s.push(f)}return s},i.format=function(e){if(Array.isArray(e[0]))return i.formatRows(e);var r=new L,n=[];return e.forEach(function(t){for(var e in t)r.has(e)||n.push(r.add(e))}),[n.map(l).join(t)].concat(e.map(function(e){return n.map(function(t){return l(e[t])}).join(t)})).join(\"\\n\")},i.formatRows=function(t){return t.map(s).join(\"\\n\")},i},t.csv=t.dsv(\",\",\"text/csv\"),t.tsv=t.dsv(\"\\t\",\"text/tab-separated-values\");var xe,be,_e,we,Me=this[I(this,\"requestAnimationFrame\")]||function(t){setTimeout(t,17)};function Ae(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var i={c:t,t:r+e,n:null};return be?be.n=i:xe=i,be=i,_e||(we=clearTimeout(we),_e=1,Me(ke)),i}function ke(){var t=Te(),e=Se()-t;e>24?(isFinite(e)&&(clearTimeout(we),we=setTimeout(ke,e)),_e=0):(_e=1,Me(ke))}function Te(){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 Se(){for(var t,e=xe,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:xe=e.n;return be=t,r}function Ee(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}t.timer=function(){Ae.apply(this,arguments)},t.timer.flush=function(){Te(),Se()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var Ce=[\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"\\xb5\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"].map(function(t,e){var r=Math.pow(10,3*y(8-e));return{scale:e>8?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,Ee(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,ze=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,Ee(e,r))).toFixed(Math.max(0,Math.min(20,Ee(e*(1+1e-15),r))))}});function Pe(t){return t+\"\"}var Ie=t.time={},De=Date;function Oe(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Oe.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-r<n-e?r:n}function i(r){return e(r=t(new De(r-1)),1),r}function a(t,r){return e(t=new De(+t),r),t}function o(t,n,a){var o=i(t),s=[];if(a>1)for(;o<n;)r(o)%a||s.push(new Date(+o)),e(o,1);else for(;o<n;)s.push(new Date(+o)),e(o,1);return s}t.floor=t,t.round=n,t.ceil=i,t.offset=a,t.range=o;var s=t.utc=Be(t);return s.floor=s,s.round=Be(n),s.ceil=Be(i),s.offset=Be(a),s.range=function(t,e,r){try{De=Oe;var n=new Oe;return n._=t,o(n,e,r)}finally{De=Date}},t}function Be(t){return function(e,r){try{De=Oe;var n=new Oe;return n._=e,t(n,r)._}finally{De=Date}}}Ie.year=Fe(function(t){return(t=Ie.day(t)).setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),Ie.years=Ie.year.range,Ie.years.utc=Ie.year.utc.range,Ie.day=Fe(function(t){var e=new De(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),Ie.days=Ie.day.range,Ie.days.utc=Ie.day.utc.range,Ie.dayOfYear=function(t){var e=Ie.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},[\"sunday\",\"monday\",\"tuesday\",\"wednesday\",\"thursday\",\"friday\",\"saturday\"].forEach(function(t,e){e=7-e;var r=Ie[t]=Fe(function(t){return(t=Ie.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var r=Ie.year(t).getDay();return Math.floor((Ie.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});Ie[t+\"s\"]=r.range,Ie[t+\"s\"].utc=r.utc.range,Ie[t+\"OfYear\"]=function(t){var r=Ie.year(t).getDay();return Math.floor((Ie.dayOfYear(t)+(r+e)%7)/7)}}),Ie.week=Ie.sunday,Ie.weeks=Ie.sunday.range,Ie.weeks.utc=Ie.sunday.utc.range,Ie.weekOfYear=Ie.sundayOfYear;var Ne={\"-\":\"\",_:\" \",0:\"0\"},je=/^\\s*\\d+/,Ve=/^%/;function Ue(t,e,r){var n=t<0?\"-\":\"\",i=(n?-t:t)+\"\",a=i.length;return n+(a<r?new Array(r-a+1).join(e)+i:i)}function qe(e){return new RegExp(\"^(?:\"+e.map(t.requote).join(\"|\")+\")\",\"i\")}function He(t){for(var e=new b,r=-1,n=t.length;++r<n;)e.set(t[r].toLowerCase(),r);return e}function Ge(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function We(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function Ye(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function Xe(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Ze(t,e,r){je.lastIndex=0;var n,i=je.exec(e.slice(r,r+2));return i?(t.y=(n=+i[0])+(n>68?1900:2e3),r+i[0].length):-1}function Je(t,e,r){return/^[+-]\\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Ke(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 Qe(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 $e(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;++r<e;)t[r][0]=this(t[r][0]);return function(e){for(var r=0,n=t[r];!n[1](e);)n=t[++r];return n[0](e)}}t.locale=function(e){return{numberFormat:function(e){var r=e.decimal,n=e.thousands,i=e.grouping,a=e.currency,o=i&&n?function(t,e){for(var r=t.length,a=[],o=0,s=i[0],l=0;r>0&&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)}:z;return function(e){var n=Le.exec(e),i=n[1]||\" \",s=n[2]||\">\",l=n[3]||\"-\",u=n[4]||\"\",c=n[5],h=+n[6],f=n[7],p=n[8],d=n[9],g=1,v=\"\",m=\"\",y=!1,x=!0;switch(p&&(p=+p.substring(1)),(c||\"0\"===i&&\"=\"===s)&&(c=i=\"0\",s=\"=\"),d){case\"n\":f=!0,d=\"g\";break;case\"%\":g=100,m=\"%\",d=\"f\";break;case\"p\":g=100,m=\"%\",d=\"r\";break;case\"b\":case\"o\":case\"x\":case\"X\":\"#\"===u&&(v=\"0\"+d.toLowerCase());case\"c\":x=!1;case\"d\":y=!0,p=0;break;case\"s\":g=-1,d=\"r\"}\"$\"===u&&(v=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=ze.get(d)||Pe;var b=c&&f;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(g<0){var u=t.formatPrefix(e,p);e=u.scale(e),n=u.symbol+m}else e*=g;var _,w,M=(e=d(e,p)).lastIndexOf(\".\");if(M<0){var A=x?e.lastIndexOf(\"e\"):-1;A<0?(_=e,w=\"\"):(_=e.substring(0,A),w=e.substring(A))}else _=e.substring(0,M),w=r+e.substring(M+1);!c&&f&&(_=o(_,1/0));var k=v.length+_.length+w.length+(b?0:a.length),T=k<h?new Array(k=h-k+1).join(i):\"\";return b&&(_=o(T+_,T.length?h-w.length:1/0)),a+=v,e=_+w,(\"<\"===s?a+e+T:\">\"===s?T+a+e:\"^\"===s?T.substring(0,k>>=1)+a+e+T.substring(k):a+(b?e:T+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<e;)37===t.charCodeAt(s)&&(o.push(t.slice(l,s)),null!=(i=Ne[n=t.charAt(++s)])&&(n=t.charAt(++s)),(a=_[n])&&(n=a(r,null==i?\"e\"===n?\" \":\"0\":i)),o.push(n),l=s+1);return o.push(t.slice(l,s)),o.join(\"\")}return r.parse=function(e){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(h(r,t,e,0)!=e.length)return null;\"p\"in r&&(r.H=r.H%12+12*r.p);var n=null!=r.Z&&De!==Oe,i=new(n?Oe:De);return\"j\"in r?i.setFullYear(r.y,0,r.j):\"W\"in r||\"U\"in r?(\"w\"in r||(r.w=\"W\"in r?1:0),i.setFullYear(r.y,0,1),i.setFullYear(r.y,0,\"W\"in r?(r.w+6)%7+7*r.W-(i.getDay()+5)%7:r.w+7*r.U-(i.getDay()+6)%7)):i.setFullYear(r.y,r.m,r.d),i.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),n?i._:i},r.toString=function(){return t},r}function h(t,e,r,n){for(var i,a,o,s=0,l=e.length,u=r.length;s<l;){if(n>=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=Oe);return r._=t,e(r)}finally{De=Date}}return r.parse=function(t){try{De=Oe;var r=e.parse(t);return r&&r._}finally{De=Date}},r.toString=e.toString,r},c.multi=c.utc.multi=or;var f=t.map(),p=qe(o),d=He(o),g=qe(s),v=He(s),m=qe(l),y=He(l),x=qe(u),b=He(u);a.forEach(function(t,e){f.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+Ie.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(Ie.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ue(Ie.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){g.lastIndex=0;var n=g.exec(e.slice(r));return n?(t.w=v.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 h(t,_.c.toString(),e,r)},d:Qe,e:Qe,H:tr,I:tr,j:$e,L:nr,m:Ke,M:er,p:function(t,e,r){var n=f.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 h(t,_.x.toString(),e,r)},X:function(t,e,r){return h(t,_.X.toString(),e,r)},y:Ze,Y:Xe,Z:Je,\"%\":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 hr(t,e){t&&pr.hasOwnProperty(t.type)&&pr[t.type](t,e)}t.geo.stream=function(t,e){t&&fr.hasOwnProperty(t.type)?fr[t.type](t,e):hr(t,e)};var fr={Feature:function(t,e){hr(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n<i;)hr(r[n].geometry,e)}},pr={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)t=r[n],e.point(t[0],t[1],t[2])},LineString:function(t,e){dr(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)dr(r[n],e,0)},Polygon:function(t,e){gr(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)gr(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,i=r.length;++n<i;)hr(r[n],e)}};function dr(t,e,r){var n,i=-1,a=t.length-r;for(e.lineStart();++i<a;)n=t[i],e.point(n[0],n[1],n[2]);e.lineEnd()}function gr(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)dr(t[r],e,1);e.polygonEnd()}t.geo.area=function(e){return vr=0,t.geo.stream(e,Cr),vr};var vr,mr,yr,xr,br,_r,wr,Mr,Ar,kr,Tr,Sr,Er=new lr,Cr={sphere:function(){vr+=4*kt},point:O,lineStart:O,lineEnd:O,polygonStart:function(){Er.reset(),Cr.lineStart=Lr},polygonEnd:function(){var t=2*Er;vr+=t<0?4*kt+t:t,Cr.lineStart=Cr.lineEnd=Cr.point=O}};function Lr(){var t,e,r,n,i;function a(t,e){e=e*Ct/2+kt/4;var a=(t*=Ct)-r,o=a>=0?1:-1,s=o*a,l=Math.cos(e),u=Math.sin(e),c=i*u,h=n*l+c*Math.cos(s),f=c*o*Math.sin(s);Er.add(Math.atan2(f,h)),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+kt/4),i=Math.sin(s)},Cr.lineEnd=function(){a(t,e)}}function zr(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 Pr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ir(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 Or(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])<Mt&&y(t[1]-e[1])<Mt}t.geo.bounds=function(){var e,r,n,i,a,o,s,l,u,c,h,f={point:p,lineStart:g,lineEnd:v,polygonStart:function(){f.point=m,f.lineStart=x,f.lineEnd=b,u=0,Cr.polygonStart()},polygonEnd:function(){Cr.polygonEnd(),f.point=p,f.lineStart=g,f.lineEnd=v,Er<0?(e=-(n=180),r=-(i=90)):u>Mt?i=90:u<-Mt&&(r=-90),h[0]=e,h[1]=n}};function p(t,a){c.push(h=[e=t,n=t]),a<r&&(r=a),a>i&&(i=a)}function d(t,o){var s=zr([t*Ct,o*Ct]);if(l){var u=Ir(l,s),c=Ir([u[1],-u[0],0],u);Rr(c),c=Fr(c);var h=t-a,f=h>0?1:-1,d=c[0]*Lt*f,g=y(h)>180;if(g^(f*a<d&&d<f*t))(v=c[1]*Lt)>i&&(i=v);else if(g^(f*a<(d=(d+360)%360-180)&&d<f*t)){var v;(v=-c[1]*Lt)<r&&(r=v)}else o<r&&(r=o),o>i&&(i=o);g?t<a?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t):n>=e?(t<e&&(e=t),t>n&&(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 g(){f.point=d}function v(){h[0]=e,h[1]=n,f.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)>Mt&&(e=-(n=180)),h[0]=e,h[1]=n,l=null}function _(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function M(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}return function(a){if(i=n=-(e=r=1/0),c=[],t.geo.stream(a,f),u=c.length){c.sort(w);for(var o=1,s=[g=c[0]];o<u;++o)M((p=c[o])[0],g)||M(p[1],g)?(_(g[0],p[1])>_(g[0],g[1])&&(g[1]=p[1]),_(p[0],g[1])>_(g[0],g[1])&&(g[0]=p[0])):s.push(g=p);for(var l,u,p,d=-1/0,g=(o=0,s[u=s.length-1]);o<=u;g=p,++o)p=s[o],(l=_(g[1],p[0]))>d&&(d=l,e=p[0],n=g[1])}return c=h=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=Mr=Ar=kr=Tr=Sr=0,t.geo.stream(e,Nr);var r=kr,n=Tr,i=Sr,a=r*r+n*n+i*i;return a<At&&(r=wr,n=Mr,i=Ar,yr<Mt&&(r=xr,n=br,i=_r),(a=r*r+n*n+i*i)<At)?[NaN,NaN]:[Math.atan2(n,r)*Lt,Dt(i/Math.sqrt(a))*Lt]};var Nr={sphere:O,point:jr,lineStart:Ur,lineEnd:qr,polygonStart:function(){Nr.lineStart=Hr},polygonEnd:function(){Nr.lineStart=Ur}};function jr(t,e){t*=Ct;var r=Math.cos(e*=Ct);Vr(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function Vr(t,e,r){xr+=(t-xr)/++mr,br+=(e-br)/mr,_r+=(r-_r)/mr}function Ur(){var t,e,r;function n(n,i){n*=Ct;var a=Math.cos(i*=Ct),o=a*Math.cos(n),s=a*Math.sin(n),l=Math.sin(i),u=Math.atan2(Math.sqrt((u=e*l-r*s)*u+(u=r*o-t*l)*u+(u=t*s-e*o)*u),t*o+e*s+r*l);yr+=u,wr+=u*(t+(t=o)),Mr+=u*(e+(e=s)),Ar+=u*(r+(r=l)),Vr(t,e,r)}Nr.point=function(i,a){i*=Ct;var o=Math.cos(a*=Ct);t=o*Math.cos(i),e=o*Math.sin(i),r=Math.sin(a),Nr.point=n,Vr(t,e,r)}}function qr(){Nr.point=jr}function Hr(){var t,e,r,n,i;function a(t,e){t*=Ct;var a=Math.cos(e*=Ct),o=a*Math.cos(t),s=a*Math.sin(t),l=Math.sin(e),u=n*l-i*s,c=i*o-r*l,h=r*s-n*o,f=Math.sqrt(u*u+c*c+h*h),p=r*o+n*s+i*l,d=f&&-It(p)/f,g=Math.atan2(f,p);kr+=d*u,Tr+=d*c,Sr+=d*h,yr+=g,wr+=g*(r+(r=o)),Mr+=g*(n+(n=s)),Ar+=g*(i+(i=l)),Vr(r,n,i)}Nr.point=function(o,s){t=o,e=s,Nr.point=a,o*=Ct;var l=Math.cos(s*=Ct);r=l*Math.cos(o),n=l*Math.sin(o),i=Math.sin(s),Vr(r,n,i)},Nr.lineEnd=function(){a(t,e),Nr.lineEnd=qr,Nr.point=jr}}function Gr(t,e){function r(r,n){return r=t(r,n),e(r[0],r[1])}return t.invert&&e.invert&&(r.invert=function(r,n){return(r=e.invert(r,n))&&t.invert(r[0],r[1])}),r}function Wr(){return!0}function Yr(t,e,r,n,i){var a=[],o=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,r=t[0],n=t[e];if(Br(r,n)){i.lineStart();for(var s=0;s<e;++s)i.point((r=t[s])[0],r[1]);i.lineEnd()}else{var l=new Zr(r,t,null,!0),u=new Zr(r,null,l,!1);l.o=u,a.push(l),o.push(u),u=new Zr(n,null,l=new Zr(n,t,null,!1),!0),l.o=u,a.push(l),o.push(u)}}}),o.sort(e),Xr(a),Xr(o),a.length){for(var s=0,l=r,u=o.length;s<u;++s)o[s].e=l=!l;for(var c,h,f=a[0];;){for(var p=f,d=!0;p.v;)if((p=p.n)===f)return;c=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(d)for(s=0,u=c.length;s<u;++s)i.point((h=c[s])[0],h[1]);else n(p.x,p.n.x,1,i);p=p.n}else{if(d)for(s=(c=p.p.z).length-1;s>=0;--s)i.point((h=c[s])[0],h[1]);else n(p.x,p.p.x,-1,i);p=p.p}c=(p=p.o).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<e;)i.n=r=t[n],r.p=i,i=r;i.n=r=t[0],r.p=i}}function Zr(t,e,r,n){this.x=t,this.z=e,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function Jr(e,r,n,i){return function(a,o){var s,l=r(o),u=a.invert(i[0],i[1]),c={point:h,lineStart:p,lineEnd:d,polygonStart:function(){c.point=b,c.lineStart=_,c.lineEnd=w,s=[],g=[]},polygonEnd:function(){c.point=h,c.lineStart=p,c.lineEnd=d,s=t.merge(s);var e=function(t,e){var r=t[0],n=t[1],i=[Math.sin(r),-Math.cos(r),0],a=0,o=0;Er.reset();for(var s=0,l=e.length;s<l;++s){var u=e[s],c=u.length;if(c)for(var h=u[0],f=h[0],p=h[1]/2+kt/4,d=Math.sin(p),g=Math.cos(p),v=1;;){v===c&&(v=0);var m=(t=u[v])[0],y=t[1]/2+kt/4,x=Math.sin(y),b=Math.cos(y),_=m-f,w=_>=0?1:-1,M=w*_,A=M>kt,k=d*x;if(Er.add(Math.atan2(k*w*Math.sin(M),g*b+k*Math.cos(M))),a+=A?_+w*Tt:_,A^f>=r^m>=r){var T=Ir(zr(h),zr(t));Rr(T);var S=Ir(i,T);Rr(S);var E=(A^_>=0?-1:1)*Dt(S[2]);(n>E||n===E&&(T[0]||T[1]))&&(o+=A^_>=0?1:-1)}if(!v++)break;f=m,d=x,g=b,h=t}}return(a<-Mt||a<Mt&&Er<-Mt)^1&o}(u,g);s.length?(x||(o.polygonStart(),x=!0),Yr(s,$r,e,n,o)):e&&(x||(o.polygonStart(),x=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),x&&(o.polygonEnd(),x=!1),s=g=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function h(t,r){var n=a(t,r);e(t=n[0],r=n[1])&&o.point(t,r)}function f(t,e){var r=a(t,e);l.point(r[0],r[1])}function p(){c.point=f,l.lineStart()}function d(){c.point=h,l.lineEnd()}var g,v,m=Qr(),y=r(m),x=!1;function b(t,e){v.push([t,e]);var r=a(t,e);y.point(r[0],r[1])}function _(){y.lineStart(),v=[]}function w(){b(v[0][0],v[0][1]),y.lineEnd();var t,e=y.clean(),r=m.buffer(),n=r.length;if(v.pop(),g.push(v),v=null,n)if(1&e){var i,a=-1;if((n=(t=r[0]).length-1)>0){for(x||(o.polygonStart(),x=!0),o.lineStart();++a<n;)o.point((i=t[a])[0],i[1]);o.lineEnd()}}else n>1&&2&e&&r.push(r.pop().concat(r.shift())),s.push(r.filter(Kr))}return c}}function Kr(t){return t.length>1}function Qr(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:O,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function $r(t,e){return((t=t.x)[0]<0?t[1]-Et-Mt:Et-t[1])-((e=e.x)[0]<0?e[1]-Et-Mt:Et-e[1])}var tn=Jr(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?kt:-kt,l=y(a-r);y(l-kt)<Mt?(t.point(r,n=(n+o)/2>0?Et:-Et),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=kt&&(y(r-i)<Mt&&(r-=i*Mt),y(a-s)<Mt&&(a-=s*Mt),n=function(t,e,r,n){var i,a,o=Math.sin(t-r);return y(o)>Mt?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*Et,n.point(-kt,i),n.point(0,i),n.point(kt,i),n.point(kt,0),n.point(kt,-i),n.point(0,-i),n.point(-kt,-i),n.point(-kt,0),n.point(-kt,i);else if(y(t[0]-e[0])>Mt){var a=t[0]<e[0]?kt:-kt;i=r*a/2,n.point(-a,i),n.point(0,i),n.point(a,i)}else n.point(e[0],e[1])},[-kt,-kt/2]);function en(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,u=o.y,c=0,h=1,f=s.x-l,p=s.y-u;if(a=t-l,f||!(a>0)){if(a/=f,f<0){if(a<c)return;a<h&&(h=a)}else if(f>0){if(a>h)return;a>c&&(c=a)}if(a=r-l,f||!(a<0)){if(a/=f,f<0){if(a>h)return;a>c&&(c=a)}else if(f>0){if(a<c)return;a<h&&(h=a)}if(a=e-u,p||!(a>0)){if(a/=p,p<0){if(a<c)return;a<h&&(h=a)}else if(p>0){if(a>h)return;a>c&&(c=a)}if(a=n-u,p||!(a<0)){if(a/=p,p<0){if(a>h)return;a>c&&(c=a)}else if(p>0){if(a<c)return;a<h&&(h=a)}return c>0&&(i.a={x:l+c*f,y:u+c*p}),h<1&&(i.b={x:l+h*f,y:u+h*p}),i}}}}}}var rn=1e9;function nn(e,r,n,i){return function(l){var u,c,h,f,p,d,g,v,m,y,x,b=l,_=Qr(),w=en(e,r,n,i),M={point:T,lineStart:function(){M.point=S,c&&c.push(h=[]);y=!0,m=!1,g=v=NaN},lineEnd:function(){u&&(S(f,p),d&&m&&_.rejoin(),u.push(_.buffer()));M.point=T,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;i<r;++i)for(var a,o=1,s=c[i],l=s.length,u=s[0];o<l;++o)a=s[o],u[1]<=n?a[1]>n&&Pt(u,a,t)>0&&++e:a[1]<=n&&Pt(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=h=null}};function A(t,o,l,u){var c=0,h=0;if(null==t||(c=a(t,l))!==(h=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)!==h);else u.point(o[0],o[1])}function k(t,a){return e<=t&&t<=n&&r<=a&&a<=i}function T(t,e){k(t,e)&&l.point(t,e)}function S(t,e){var r=k(t=Math.max(-rn,Math.min(rn,t)),e=Math.max(-rn,Math.min(rn,e)));if(c&&h.push([t,e]),y)f=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:g,y:v},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)}g=t,v=e,m=r}return M};function a(t,i){return y(t[0]-e)<Mt?i>0?0:3:y(t[0]-n)<Mt?i>0?2:1:y(t[1]-r)<Mt?i>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=kt/3,n=Sn(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*kt/180,r=t[1]*kt/180):[e/kt*180,r/kt*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],h=+t[1];return r=a.translate(t).clipExtent([[c-.455*e,h-.238*e],[c+.455*e,h+.238*e]]).stream(l).point,n=o.translate([c-.307*e,h+.201*e]).clipExtent([[c-.425*e+Mt,h+.12*e+Mt],[c-.214*e-Mt,h+.234*e-Mt]]).stream(l).point,i=s.translate([c-.205*e,h+.212*e]).clipExtent([[c-.214*e+Mt,h+.166*e+Mt],[c-.115*e-Mt,h+.234*e-Mt]]).stream(l).point,u},u.scale(1070)};var sn,ln,un,cn,hn,fn,pn={point:O,lineStart:O,lineEnd:O,polygonStart:function(){ln=0,pn.lineStart=dn},polygonEnd:function(){pn.lineStart=pn.lineEnd=pn.point=O,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 gn={point:function(t,e){t<un&&(un=t);t>hn&&(hn=t);e<cn&&(cn=e);e>fn&&(fn=e)},lineStart:O,lineEnd:O,polygonStart:O,polygonEnd:O};function vn(t){return\"m0,\"+t+\"a\"+t+\",\"+t+\" 0 1,1 0,\"+-2*t+\"a\"+t+\",\"+t+\" 0 1,1 0,\"+2*t+\"z\"}var mn,yn={point:xn,lineStart:bn,lineEnd:_n,polygonStart:function(){yn.lineStart=wn},polygonEnd:function(){yn.point=xn,yn.lineStart=bn,yn.lineEnd=_n}};function xn(t,e){xr+=t,br+=e,++_r}function bn(){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,Mr+=o*(e+n)/2,Ar+=o,xn(t=r,e=n)}yn.point=function(n,i){yn.point=r,xn(t=n,e=i)}}function _n(){yn.point=xn}function wn(){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,Mr+=o*(n+e)/2,Ar+=o,kr+=(o=n*t-r*e)*(r+t),Tr+=o*(n+e),Sr+=3*o,xn(r=t,n=e)}yn.point=function(a,o){yn.point=i,xn(t=r=a,e=n=o)},yn.lineEnd=function(){i(t,e)}}function Mn(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,h,f,p,d,g,v={point:m,lineStart:y,lineEnd:b,polygonStart:function(){e.polygonStart(),v.lineStart=_},polygonEnd:function(){e.polygonEnd(),v.lineStart=y}};function m(r,n){r=t(r,n),e.point(r[0],r[1])}function y(){h=NaN,v.point=x,e.lineStart()}function x(r,i){var o=zr([r,i]),s=t(r,i);a(h,f,c,p,d,g,h=s[0],f=s[1],c=r,p=o[0],d=o[1],g=o[2],n,e),e.point(h,f)}function b(){v.point=m,e.lineEnd()}function _(){y(),v.point=w,v.lineEnd=M}function w(t,e){x(r=t,e),i=h,o=f,s=p,l=d,u=g,v.point=x}function M(){a(h,f,c,p,d,g,i,o,r,s,l,u,n,e),v.lineEnd=b,b()}return v}:function(e){return kn(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})})(e)}function a(n,i,o,s,l,u,c,h,f,p,d,g,v,m){var x=c-n,b=h-i,_=x*x+b*b;if(_>4*e&&v--){var w=s+p,M=l+d,A=u+g,k=Math.sqrt(w*w+M*M+A*A),T=Math.asin(A/=k),S=y(y(A)-1)<Mt||y(o-f)<Mt?(o+f)/2:Math.atan2(M,w),E=t(S,T),C=E[0],L=E[1],z=C-n,P=L-i,I=b*z-x*P;(I*I/_>e||y((x*z+b*P)/_-.5)>.3||s*p+l*d+u*g<r)&&(a(n,i,o,s,l,u,C,L,S,w/=k,M/=k,A,v,m),m.point(C,L),a(C,L,S,w,M,A,c,h,f,p,d,g,v,m))}}return i.precision=function(t){return arguments.length?(n=(e=t*t)>0&&16,i):Math.sqrt(e)},i}function An(t){this.stream=t}function kn(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 Tn(t){return Sn(function(){return t})()}function Sn(e){var r,n,i,a,o,s,l=Mn(function(t,e){return[(t=r(t,e))[0]*u+a,o-t[1]*u]}),u=150,c=480,h=250,f=0,p=0,d=0,g=0,v=0,m=tn,x=z,b=null,_=null;function w(t){return[(t=i(t[0]*Ct,t[1]*Ct))[0]*u+a,o-t[1]*u]}function M(t){return(t=i.invert((t[0]-a)/u,(o-t[1])/u))&&[t[0]*Lt,t[1]*Lt]}function A(){i=Gr(n=zn(d,g,v),r);var t=r(f,p);return a=c-t[0]*u,o=h+t[1]*u,k()}function k(){return s&&(s.valid=!1,s=null),w}return w.stream=function(t){return s&&(s.valid=!1),(s=En(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)>Mt;return Jr(i,function(t){var e,s,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(h,f){var p,d=[h,f],g=i(h,f),v=r?g?0:o(h,f):g?o(h+(h<0?kt:-kt),f):0;if(!e&&(u=l=g)&&t.lineStart(),g!==l&&(p=a(e,d),(Br(e,p)||Br(d,p))&&(d[0]+=Mt,d[1]+=Mt,g=i(d[0],d[1]))),g!==l)c=0,g?(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^g){var m;v&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])))}!g||e&&Br(e,d)||t.point(d[0],d[1]),e=d,l=g,s=v},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return c|(u&&l)<<1}}},On(t,6*Ct),r?[0,-t]:[-kt,t-kt]);function i(t,r){return Math.cos(t)*Math.cos(r)>e}function a(t,r,n){var i=[1,0,0],a=Ir(zr(t),zr(r)),o=Pr(a,a),s=a[0],l=o-s*s;if(!l)return!n&&t;var u=e*o/l,c=-e*s/l,h=Ir(i,a),f=Or(i,u);Dr(f,Or(a,c));var p=h,d=Pr(f,p),g=Pr(p,p),v=d*d-g*(Pr(f,f)-1);if(!(v<0)){var m=Math.sqrt(v),x=Or(p,(-d-m)/g);if(Dr(x,f),x=Fr(x),!n)return x;var b,_=t[0],w=r[0],M=t[1],A=r[1];w<_&&(b=_,_=w,w=b);var k=w-_,T=y(k-kt)<Mt;if(!T&&A<M&&(b=M,M=A,A=b),T||k<Mt?T?M+A>0^x[1]<(y(x[0]-_)<Mt?M:A):M<=x[1]&&x[1]<=A:k>kt^(_<=x[0]&&x[0]<=w)){var S=Or(p,(-d+m)/g);return Dr(S,f),[x,Fr(S)]}}}function o(e,n){var i=r?t:kt-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}}((b=+t)*Ct),k()):b},w.clipExtent=function(t){return arguments.length?(_=t,x=t?nn(t[0][0],t[0][1],t[1][0],t[1][1]):z,k()):_},w.scale=function(t){return arguments.length?(u=+t,A()):u},w.translate=function(t){return arguments.length?(c=+t[0],h=+t[1],A()):[c,h]},w.center=function(t){return arguments.length?(f=t[0]%360*Ct,p=t[1]%360*Ct,A()):[f*Lt,p*Lt]},w.rotate=function(t){return arguments.length?(d=t[0]%360*Ct,g=t[1]%360*Ct,v=t.length>2?t[2]%360*Ct:0,A()):[d*Lt,g*Lt,v*Lt]},t.rebind(w,l,\"precision\"),function(){return r=e.apply(this,arguments),w.invert=r.invert&&M,A()}}function En(t){return kn(t,function(e,r){t.point(e*Ct,r*Ct)})}function Cn(t,e){return[t,e]}function Ln(t,e){return[t>kt?t-Tt:t<-kt?t+Tt:t,e]}function zn(t,e,r){return t?e||r?Gr(In(t),Dn(e,r)):In(t):e||r?Dn(e,r):Ln}function Pn(t){return function(e,r){return[(e+=t)>kt?e-Tt:e<-kt?e+Tt:e,r]}}function In(t){var e=Pn(t);return e.invert=Pn(-t),e}function Dn(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 On(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=Rn(r,i),a=Rn(r,a),(o>0?i<a:i>a)&&(i+=o*Tt)):(i=t+o*Tt,a=t-.5*l);for(var u,c=i;o>0?c>a:c<a;c-=l)s.point((u=Fr([r,-n*Math.cos(c),-n*Math.sin(c)]))[0],u[1])}}function Rn(t,e){var r=zr(e);r[0]-=t,Rr(r);var n=It(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-Mt)%(2*Math.PI)}function Fn(e,r,n){var i=t.range(e,r-Mt,n).concat(r);return function(t){return i.map(function(e){return[t,e]})}}function Bn(e,r,n){var i=t.range(e,r-Mt,n).concat(r);return function(t){return i.map(function(e){return[e,t]})}}function Nn(t){return t.source}function jn(t){return t.target}t.geo.path=function(){var e,r,n,i,a,o=4.5;function s(e){return e&&(\"function\"==typeof o&&i.pointRadius(+o.apply(this,arguments)),a&&a.valid||(a=n(i)),t.geo.stream(e,a)),i.result()}function l(){return a=null,s}return s.area=function(e){return sn=0,t.geo.stream(e,n(pn)),sn},s.centroid=function(e){return xr=br=_r=wr=Mr=Ar=kr=Tr=Sr=0,t.geo.stream(e,n(yn)),Sr?[kr/Sr,Tr/Sr]:Ar?[wr/Ar,Mr/Ar]:_r?[xr/_r,br/_r]:[NaN,NaN]},s.bounds=function(e){return hn=fn=-(un=cn=1/0),t.geo.stream(e,n(gn)),[[un,cn],[hn,fn]]},s.projection=function(t){return arguments.length?(n=(e=t)?t.stream||(r=t,i=Mn(function(t,e){return r([t*Lt,e*Lt])}),function(t){return En(i(t))}):z,l()):e;var r,i},s.context=function(t){return arguments.length?(i=null==(r=t)?new function(){var t=vn(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=vn(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}:new function(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:O};function n(r,n){t.moveTo(r+e,n),t.arc(r,n,e,0,Tt)}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}(t),\"function\"!=typeof o&&i.pointRadius(o),l()):r},s.pointRadius=function(t){return arguments.length?(o=\"function\"==typeof t?t:(i.pointRadius(+t),+t),s):o},s.projection(t.geo.albersUsa()).context(null)},t.geo.transform=function(t){return{stream:function(e){var r=new An(e);for(var n in t)r[n]=t[n];return r}}},An.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},t.geo.projection=Tn,t.geo.projectionMutator=Sn,(t.geo.equirectangular=function(){return Tn(Cn)}).raw=Cn.invert=Cn,t.geo.rotation=function(t){function e(e){return(e=t(e[0]*Ct,e[1]*Ct))[0]*=Lt,e[1]*=Lt,e}return t=zn(t[0]%360*Ct,t[1]*Ct,t.length>2?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},Ln.invert=Cn,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=zn(-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=On((t=+r)*Ct,n*Ct),i):t},i.precision=function(r){return arguments.length?(e=On(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),h=Math.cos(a);return Math.atan2(Math.sqrt((r=h*o)*r+(r=u*c-l*h*s)*r),l*c+u*h*s)},t.geo.graticule=function(){var e,r,n,i,a,o,s,l,u,c,h,f,p=10,d=p,g=90,v=360,m=2.5;function x(){return{type:\"MultiLineString\",coordinates:b()}}function b(){return t.range(Math.ceil(i/g)*g,n,g).map(h).concat(t.range(Math.ceil(l/v)*v,s,v).map(f)).concat(t.range(Math.ceil(r/p)*p,e,p).filter(function(t){return y(t%g)>Mt}).map(u)).concat(t.range(Math.ceil(o/d)*d,a,d).filter(function(t){return y(t%v)>Mt}).map(c))}return x.lines=function(){return b().map(function(t){return{type:\"LineString\",coordinates:t}})},x.outline=function(){return{type:\"Polygon\",coordinates:[h(i).concat(f(s).slice(1),h(n).reverse().slice(1),f(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?(g=+t[0],v=+t[1],x):[g,v]},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=Fn(o,a,90),c=Bn(r,e,m),h=Fn(l,s,90),f=Bn(i,n,m),x):m},x.majorExtent([[-180,-90+Mt],[180,90-Mt]]).minorExtent([[-180,-80-Mt],[180,80+Mt]])},t.geo.greatArc=function(){var e,r,n=Nn,i=jn;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),h=o*Math.sin(r),f=l*Math.cos(i),p=l*Math.sin(i),d=2*Math.asin(Math.sqrt(Rt(a-n)+o*l*Rt(i-r))),g=1/Math.sin(d),(v=d?function(t){var e=Math.sin(t*=d)*g,r=Math.sin(d-t)*g,n=r*c+e*f,i=r*h+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,v;var r,n,i,a,o,s,l,u,c,h,f,p,d,g,v},t.geo.length=function(e){return mn=0,t.geo.stream(e,Vn),mn};var Vn={sphere:O,point:O,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);mn+=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}Vn.point=function(i,a){t=i*Ct,e=Math.sin(a*=Ct),r=Math.cos(a),Vn.point=n},Vn.lineEnd=function(){Vn.point=Vn.lineEnd=O}},lineEnd:O,polygonStart:O,polygonEnd:O};function Un(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 qn=Un(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(t.geo.azimuthalEqualArea=function(){return Tn(qn)}).raw=qn;var Hn=Un(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},z);function Gn(t,e){var r=Math.cos(t),n=function(t){return Math.tan(kt/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 Xn;function o(t,e){a>0?e<-Et+Mt&&(e=-Et+Mt):e>Et-Mt&&(e=Et-Mt);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=zt(i)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/i,2*Math.atan(Math.pow(a/n,1/i))-Et]},o}function Wn(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)<Mt)return Cn;function a(t,e){var r=i-e;return[r*Math.sin(n*t),i-r*Math.cos(n*t)]}return a.invert=function(t,e){var r=i-e;return[Math.atan2(t,r)/n,i-zt(n)*Math.sqrt(t*t+r*r)]},a}(t.geo.azimuthalEquidistant=function(){return Tn(Hn)}).raw=Hn,(t.geo.conicConformal=function(){return an(Gn)}).raw=Gn,(t.geo.conicEquidistant=function(){return an(Wn)}).raw=Wn;var Yn=Un(function(t){return 1/t},Math.atan);function Xn(t,e){return[t,Math.log(Math.tan(kt/4+e/2))]}function Zn(t){var e,r=Tn(t),n=r.scale,i=r.translate,a=r.clipExtent;return r.scale=function(){var t=n.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.translate=function(){var t=i.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.clipExtent=function(t){var o=a.apply(r,arguments);if(o===r){if(e=null==t){var s=kt*n(),l=i();a([[l[0]-s,l[1]-s],[l[0]+s,l[1]+s]])}}else e&&(o=null);return o},r.clipExtent(null)}(t.geo.gnomonic=function(){return Tn(Yn)}).raw=Yn,Xn.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Et]},(t.geo.mercator=function(){return Zn(Xn)}).raw=Xn;var Jn=Un(function(){return 1},Math.asin);(t.geo.orthographic=function(){return Tn(Jn)}).raw=Jn;var Kn=Un(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});function Qn(t,e){return[Math.log(Math.tan(kt/4+e/2)),-t]}function $n(t){return t[0]}function ti(t){return t[1]}function ei(t){for(var e=t.length,r=[0,1],n=2,i=2;i<e;i++){for(;n>1&&Pt(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function ri(t,e){return t[0]-e[0]||t[1]-e[1]}(t.geo.stereographic=function(){return Tn(Kn)}).raw=Kn,Qn.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Et]},(t.geo.transverseMercator=function(){var t=Zn(Qn),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=Qn,t.geom={},t.geom.hull=function(t){var e=$n,r=ti;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=ve(e),a=ve(r),o=t.length,s=[],l=[];for(n=0;n<o;n++)s.push([+i.call(this,t[n],n),+a.call(this,t[n],n),n]);for(s.sort(ri),n=0;n<o;n++)l.push([s[n][0],-s[n][1]]);var u=ei(s),c=ei(l),h=c[0]===u[0],f=c[c.length-1]===u[u.length-1],p=[];for(n=u.length-1;n>=0;--n)p.push(t[s[u[n]][2]]);for(n=+h;n<c.length-f;++n)p.push(t[s[c[n]][2]]);return p}return n.x=function(t){return arguments.length?(e=t,n):e},n.y=function(t){return arguments.length?(r=t,n):r},n},t.geom.polygon=function(t){return U(t,ni),t};var ni=t.geom.polygon.prototype=[];function ii(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function ai(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],u=r[1],c=e[1]-l,h=n[1]-u,f=(s*(l-u)-h*(i-a))/(h*o-s*c);return[i+f*o,l+f*c]}function oi(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}ni.area=function(){for(var t,e=-1,r=this.length,n=this[r-1],i=0;++e<r;)t=n,n=this[e],i+=t[1]*n[0]-t[0]*n[1];return.5*i},ni.centroid=function(t){var e,r,n=-1,i=this.length,a=0,o=0,s=this[i-1];for(arguments.length||(t=-1/(6*this.area()));++n<i;)e=s,s=this[n],r=e[0]*s[1]-s[0]*e[1],a+=(e[0]+s[0])*r,o+=(e[1]+s[1])*r;return[a*t,o*t]},ni.clip=function(t){for(var e,r,n,i,a,o,s=oi(t),l=-1,u=this.length-oi(this),c=this[u-1];++l<u;){for(e=t.slice(),t.length=0,i=this[l],a=e[(n=e.length-s)-1],r=-1;++r<n;)ii(o=e[r],c,i)?(ii(a,c,i)||t.push(ai(a,o,c,i)),t.push(o)):ii(a,c,i)&&t.push(ai(a,o,c,i)),a=o;s&&t.push(t[0]),c=i}return t};var si,li,ui,ci,hi,fi=[],pi=[];function di(t){var e=fi.pop()||new function(){Li(this),this.edge=this.site=this.circle=null};return e.site=t,e}function gi(t){Mi(t),ui.remove(t),fi.push(t),Li(t)}function vi(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];gi(t);for(var l=a;l.circle&&y(r-l.circle.x)<Mt&&y(n-l.circle.cy)<Mt;)a=l.P,s.unshift(l),gi(l),l=a;s.unshift(l),Mi(l);for(var u=o;u.circle&&y(r-u.circle.x)<Mt&&y(n-u.circle.cy)<Mt;)o=u.N,s.push(u),gi(u),u=o;s.push(u),Mi(u);var c,h=s.length;for(c=1;c<h;++c)u=s[c],l=s[c-1],Si(u.edge,l.site,u.site,i);l=s[0],(u=s[h-1]).edge=Ti(l.site,u.site,null,i),wi(l),wi(u)}function mi(t){for(var e,r,n,i,a=t.x,o=t.y,s=ui._;s;)if((n=yi(s,o)-a)>Mt)s=s.L;else{if(!((i=a-xi(s,o))>Mt)){n>-Mt?(e=s.P,r=s):i>-Mt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=di(t);if(ui.insert(e,l),e||r){if(e===r)return Mi(e),r=di(e.site),ui.insert(l,r),l.edge=r.edge=Ti(e.site,l.site),wi(e),void wi(r);if(r){Mi(e),Mi(r);var u=e.site,c=u.x,h=u.y,f=t.x-c,p=t.y-h,d=r.site,g=d.x-c,v=d.y-h,m=2*(f*v-p*g),y=f*f+p*p,x=g*g+v*v,b={x:(v*y-p*x)/m+c,y:(f*x-g*y)/m+h};Si(r.edge,u,d,b),l.edge=Ti(u,t,null,b),r.edge=Ti(t,d,null,b),wi(e),wi(r)}else l.edge=Ti(e.site,l.site)}}function yi(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,h=1/a-1/u,f=c/u;return h?(-f+Math.sqrt(f*f-2*h*(c*c/(-2*u)-l+u/2+i-a/2)))/h+n:(n+s)/2}function xi(t,e){var r=t.N;if(r)return yi(r,e);var n=t.site;return n.y===e?n.x:1/0}function bi(t){this.site=t,this.edges=[]}function _i(t,e){return e.angle-t.angle}function wi(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,h=2*(l*(v=a.y-s)-u*c);if(!(h>=-At)){var f=l*l+u*u,p=c*c+v*v,d=(v*f-u*p)/h,g=(l*p-c*f)/h,v=g+s,m=pi.pop()||new function(){Li(this),this.x=this.y=this.arc=this.site=this.cy=null};m.arc=t,m.site=i,m.x=d+o,m.y=v+Math.sqrt(d*d+g*g),m.cy=v,t.circle=m;for(var y=null,x=hi._;x;)if(m.y<x.y||m.y===x.y&&m.x<=x.x){if(!x.L){y=x.P;break}x=x.L}else{if(!x.R){y=x;break}x=x.R}hi.insert(y,m),y||(ci=m)}}}}function Mi(t){var e=t.circle;e&&(e.P||(ci=e.N),hi.remove(e),pi.push(e),Li(e),t.circle=null)}function Ai(t,e){var r=t.b;if(r)return!0;var n,i,a=t.a,o=e[0][0],s=e[1][0],l=e[0][1],u=e[1][1],c=t.l,h=t.r,f=c.x,p=c.y,d=h.x,g=h.y,v=(f+d)/2,m=(p+g)/2;if(g===p){if(v<o||v>=s)return;if(f>d){if(a){if(a.y>=u)return}else a={x:v,y:l};r={x:v,y:u}}else{if(a){if(a.y<l)return}else a={x:v,y:u};r={x:v,y:l}}}else if(i=m-(n=(f-d)/(g-p))*v,n<-1||n>1)if(f>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<l)return}else a={x:(u-i)/n,y:u};r={x:(l-i)/n,y:l}}else if(p<g){if(a){if(a.x>=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x<o)return}else a={x:s,y:n*s+i};r={x:o,y:n*o+i}}return t.a=a,t.b=r,!0}function ki(t,e){this.l=t,this.r=e,this.a=this.b=null}function Ti(t,e,r,n){var i=new ki(t,e);return si.push(i),r&&Si(i,t,e,r),n&&Si(i,e,t,n),li[t.i].edges.push(new Ei(i,t,e)),li[e.i].edges.push(new Ei(i,e,t)),i}function Si(t,e,r,n){t.a||t.b?t.l===r?t.b=n:t.a=n:(t.a=n,t.l=e,t.r=r)}function Ei(t,e,r){var n=t.a,i=t.b;this.edge=t,this.site=e,this.angle=r?Math.atan2(r.y-e.y,r.x-e.x):t.l===e?Math.atan2(i.x-n.x,n.y-i.y):Math.atan2(n.x-i.x,i.y-n.y)}function Ci(){this._=null}function Li(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function zi(t,e){var r=e,n=e.R,i=r.U;i?i.L===r?i.L=n:i.R=n:t._=n,n.U=i,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function Pi(t,e){var r=e,n=e.L,i=r.U;i?i.L===r?i.L=n:i.R=n:t._=n,n.U=i,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function Ii(t){for(;t.L;)t=t.L;return t}function Di(t,e){var r,n,i,a=t.sort(Oi).pop();for(si=[],li=new Array(t.length),ui=new Ci,hi=new Ci;;)if(i=ci,a&&(!i||a.y<i.y||a.y===i.y&&a.x<i.x))a.x===r&&a.y===n||(li[a.i]=new bi(a),mi(a),r=a.x,n=a.y),a=t.pop();else{if(!i)break;vi(i.arc)}e&&(function(t){for(var e,r=si,n=en(t[0][0],t[0][1],t[1][0],t[1][1]),i=r.length;i--;)(!Ai(e=r[i],t)||!n(e)||y(e.a.x-e.b.x)<Mt&&y(e.a.y-e.b.y)<Mt)&&(e.a=e.b=null,r.splice(i,1))}(e),function(t){for(var e,r,n,i,a,o,s,l,u,c,h=t[0][0],f=t[1][0],p=t[0][1],d=t[1][1],g=li,v=g.length;v--;)if((a=g[v])&&a.prepare())for(l=(s=a.edges).length,o=0;o<l;)n=(c=s[o].end()).x,i=c.y,e=(u=s[++o%l].start()).x,r=u.y,(y(n-e)>Mt||y(i-r)>Mt)&&(s.splice(o,0,new Ei((m=a.site,x=c,b=y(n-h)<Mt&&d-i>Mt?{x:h,y:y(e-h)<Mt?r:d}:y(i-d)<Mt&&f-n>Mt?{x:y(r-d)<Mt?e:f,y:d}:y(n-f)<Mt&&i-p>Mt?{x:f,y:y(e-f)<Mt?r:p}:y(i-p)<Mt&&n-h>Mt?{x:y(r-p)<Mt?e:h,y:p}:null,_=void 0,_=new ki(m,null),_.a=x,_.b=b,si.push(_),_),a.site,null)),++l);var m,x,b,_}(e));var o={cells:li,edges:si};return ui=hi=si=li=null,o}function Oi(t,e){return e.y-t.y||e.x-t.x}bi.prototype.prepare=function(){for(var t,e=this.edges,r=e.length;r--;)(t=e[r].edge).b&&t.a||e.splice(r,1);return e.sort(_i),e.length},Ei.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},Ci.prototype={insert:function(t,e){var r,n,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;r=t}else this._?(t=Ii(this._),e.P=null,e.N=t,t.P=t.L=e,r=t):(e.P=e.N=null,this._=e,r=null);for(e.L=e.R=null,e.U=r,e.C=!0,t=e;r&&r.C;)r===(n=r.U).L?(i=n.R)&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.R&&(zi(this,r),r=(t=r).U),r.C=!1,n.C=!0,Pi(this,n)):(i=n.L)&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.L&&(Pi(this,r),r=(t=r).U),r.C=!1,n.C=!0,zi(this,n)),r=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,r,n,i=t.U,a=t.L,o=t.R;if(r=a?o?Ii(o):a:o,i?i.L===t?i.L=r:i.R=r:this._=r,a&&o?(n=r.C,r.C=t.C,r.L=a,a.U=r,r!==o?(i=r.U,r.U=t.U,t=r.R,i.L=t,r.R=o,o.U=r):(r.U=i,i=r,t=r.R)):(n=t.C,t=r),t&&(t.U=i),!n)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,zi(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,Pi(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,zi(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,Pi(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,zi(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,Pi(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}},t.geom.voronoi=function(t){var e=$n,r=ti,n=e,i=r,a=Ri;if(t)return o(t);function o(t){var e=new Array(t.length),r=a[0][0],n=a[0][1],i=a[1][0],o=a[1][1];return Di(s(t),a).cells.forEach(function(a,s){var l=a.edges,u=a.site;(e[s]=l.length?l.map(function(t){var e=t.start();return[e.x,e.y]}):u.x>=r&&u.x<=i&&u.y>=n&&u.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=t[s]}),e}function s(t){return t.map(function(t,e){return{x:Math.round(n(t,e)/Mt)*Mt,y:Math.round(i(t,e)/Mt)*Mt,i:e}})}return o.links=function(t){return Di(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 Di(s(t)).cells.forEach(function(r,n){for(var i,a,o,s,l=r.site,u=r.edges.sort(_i),c=-1,h=u.length,f=u[h-1].edge,p=f.l===l?f.r:f.l;++c<h;)f,i=p,p=(f=u[c].edge).l===l?f.r:f.l,n<i.i&&n<p.i&&(o=i,s=p,((a=l).x-s.x)*(o.y-a.y)-(a.x-o.x)*(s.y-a.y)<0)&&e.push([t[n],t[i.i],t[p.i]])}),e},o.x=function(t){return arguments.length?(n=ve(e=t),o):e},o.y=function(t){return arguments.length?(i=ve(r=t),o):r},o.clipExtent=function(t){return arguments.length?(a=null==t?Ri:t,o):a===Ri?null:a},o.size=function(t){return arguments.length?o.clipExtent(t&&[[0,0],t]):a===Ri?null:a&&a[1]},o};var Ri=[[-1e6,-1e6],[1e6,1e6]];function Fi(t){return t.x}function Bi(t){return t.y}function Ni(e,r){e=t.rgb(e),r=t.rgb(r);var n=e.r,i=e.g,a=e.b,o=r.r-n,s=r.g-i,l=r.b-a;return function(t){return\"#\"+ue(Math.round(n+o*t))+ue(Math.round(i+s*t))+ue(Math.round(a+l*t))}}function ji(t,e){var r,n={},i={};for(r in t)r in e?n[r]=Gi(t[r],e[r]):i[r]=t[r];for(r in e)r in t||(i[r]=e[r]);return function(t){for(r in n)i[r]=n[r](t);return i}}function Vi(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Ui(t,e){var r,n,i,a=qi.lastIndex=Hi.lastIndex=0,o=-1,s=[],l=[];for(t+=\"\",e+=\"\";(r=qi.exec(t))&&(n=Hi.exec(e));)(i=n.index)>a&&(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:Vi(r,n)})),a=Hi.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?(e=l[0].x,function(t){return e(t)+\"\"}):function(){return e}:(e=l.length,function(t){for(var r,n=0;n<e;++n)s[(r=l[n]).i]=r.x(t);return s.join(\"\")})}t.geom.delaunay=function(e){return t.geom.voronoi().triangles(e)},t.geom.quadtree=function(t,e,r,n,i){var a,o=$n,s=ti;if(a=arguments.length)return o=Fi,s=Bi,3===a&&(i=r,n=e,r=e=0),l(t);function l(t){var l,u,c,h,f,p,d,g,v,m=ve(o),x=ve(s);if(null!=e)p=e,d=r,g=n,v=i;else if(g=v=-(p=d=1/0),u=[],c=[],f=t.length,a)for(h=0;h<f;++h)(l=t[h]).x<p&&(p=l.x),l.y<d&&(d=l.y),l.x>g&&(g=l.x),l.y>v&&(v=l.y),u.push(l.x),c.push(l.y);else for(h=0;h<f;++h){var b=+m(l=t[h],h),_=+x(l,h);b<p&&(p=b),_<d&&(d=_),b>g&&(g=b),_>v&&(v=_),u.push(b),c.push(_)}var w=g-p,M=v-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)k(t,e,r,n,i,a,o,s);else{var c=t.point;t.x=t.y=t.point=null,k(t,c,l,u,i,a,o,s),k(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else k(t,e,r,n,i,a,o,s)}function k(t,e,r,n,i,a,o,s){var l=.5*(i+o),u=.5*(a+s),c=r>=l,h=n>=u,f=h<<1|c;t.leaf=!1,t=t.nodes[f]||(t.nodes[f]={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){A(T,t,+m(t,++h),+x(t,h),p,d,g,v)}}),c?i=l:o=l,h?a=u:s=u,A(t,e,r,n,i,a,o,s)}w>M?v=d+w:g=p+M;var T={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){A(T,t,+m(t,++h),+x(t,h),p,d,g,v)}};if(T.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,T,p,d,g,v)},T.find=function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(u,c,h,f,p){if(!(c>a||h>o||f<n||p<i)){if(d=u.point){var d,g=e-u.x,v=r-u.y,m=g*g+v*v;if(m<l){var y=Math.sqrt(l=m);n=e-y,i=r-y,a=e+y,o=r+y,s=d}}for(var x=u.nodes,b=.5*(c+f),_=.5*(h+p),w=(r>=_)<<1|e>=b,M=w+4;w<M;++w)if(u=x[3&w])switch(3&w){case 0:t(u,c,h,b,_);break;case 1:t(u,b,h,f,_);break;case 2:t(u,c,_,b,p);break;case 3:t(u,b,_,f,p)}}}(t,n,i,a,o),s}(T,t[0],t[1],p,d,g,v)},h=-1,null==e){for(;++h<f;)A(T,t[h],u[h],c[h],p,d,g,v);--h}else t.forEach(T.add);return u=c=t=l=null,T}return l.x=function(t){return arguments.length?(o=t,l):o},l.y=function(t){return arguments.length?(s=t,l):s},l.extent=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=+t[0][0],r=+t[0][1],n=+t[1][0],i=+t[1][1]),l):null==e?null:[[e,r],[n,i]]},l.size=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=r=0,n=+t[0],i=+t[1]),l):null==e?null:[n-e,i-r]},l},t.interpolateRgb=Ni,t.interpolateObject=ji,t.interpolateNumber=Vi,t.interpolateString=Ui;var qi=/[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,Hi=new RegExp(qi.source,\"g\");function Gi(e,r){for(var n,i=t.interpolators.length;--i>=0&&!(n=t.interpolators[i](e,r)););return n}function Wi(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r<s;++r)n.push(Gi(t[r],e[r]));for(;r<a;++r)i[r]=t[r];for(;r<o;++r)i[r]=e[r];return function(t){for(r=0;r<s;++r)i[r]=n[r](t);return i}}t.interpolate=Gi,t.interpolators=[function(t,e){var r=typeof e;return(\"string\"===r?ge.has(e.toLowerCase())||/^(#|rgb\\(|hsl\\()/i.test(e)?Ni:Ui:e instanceof Vt?Ni:Array.isArray(e)?Wi:\"object\"===r&&isNaN(e)?ji:Vi)(t,e)}],t.interpolateArray=Wi;var Yi=function(){return z},Xi=t.map({linear:Yi,poly:function(t){return function(e){return Math.pow(e,t)}},quad:function(){return Qi},cubic:function(){return $i},sin:function(){return ea},exp:function(){return ra},circle:function(){return na},elastic:function(t,e){var r;arguments.length<2&&(e=.45);arguments.length?r=e/Tt*Math.asin(1/t):(t=1,r=e/4);return function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*Tt/e)}},back:function(t){t||(t=1.70158);return function(e){return e*e*((t+1)*e-t)}},bounce:function(){return ia}}),Zi=t.map({in:z,out:Ji,\"in-out\":Ki,\"out-in\":function(t){return Ki(Ji(t))}});function Ji(t){return function(e){return 1-t(1-e)}}function Ki(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Qi(t){return t*t}function $i(t){return t*t*t}function ta(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function ea(t){return 1-Math.cos(t*Et)}function ra(t){return Math.pow(2,10*(t-1))}function na(t){return 1-Math.sqrt(1-t*t)}function ia(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 aa(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function oa(t){var e,r,n,i=[t.a,t.b],a=[t.c,t.d],o=la(i),s=sa(i,a),l=la(((e=a)[0]+=(n=-s)*(r=i)[0],e[1]+=n*r[1],e))||0;i[0]*a[1]<a[0]*i[1]&&(i[0]*=-1,i[1]*=-1,o*=-1,s*=-1),this.rotate=(o?Math.atan2(i[1],i[0]):Math.atan2(-a[0],a[1]))*Lt,this.translate=[t.e,t.f],this.scale=[o,l],this.skew=l?Math.atan2(s,l)*Lt:0}function sa(t,e){return t[0]*e[0]+t[1]*e[1]}function la(t){var e=Math.sqrt(sa(t,t));return e&&(t[0]/=e,t[1]/=e),e}t.ease=function(t){var e,n=t.indexOf(\"-\"),i=n>=0?t.slice(0,n):t,a=n>=0?t.slice(n+1):\"in\";return i=Xi.get(i)||Yi,a=Zi.get(a)||z,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;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);return 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;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);return function(t){return Ht(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=aa,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 oa(e?e.matrix:ua)})(e)},oa.prototype.toString=function(){return\"translate(\"+this.translate+\")rotate(\"+this.rotate+\")skewX(\"+this.skew+\")scale(\"+this.scale+\")\"};var ua={a:1,b:0,c:0,d:1,e:0,f:0};function ca(t){return t.length?t.pop()+\",\":\"\"}function ha(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:Vi(t[0],e[0])},{i:i-2,x:Vi(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(ca(r)+\"rotate(\",null,\")\")-2,x:Vi(t,e)})):e&&r.push(ca(r)+\"rotate(\"+e+\")\")}(e.rotate,r.rotate,n,i),function(t,e,r,n){t!==e?n.push({i:r.push(ca(r)+\"skewX(\",null,\")\")-2,x:Vi(t,e)}):e&&r.push(ca(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(ca(r)+\"scale(\",null,\",\",null,\")\");n.push({i:i-4,x:Vi(t[0],e[0])},{i:i-2,x:Vi(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(ca(r)+\"scale(\"+e+\")\")}(e.scale,r.scale,n,i),e=r=null,function(t){for(var e,r=-1,a=i.length;++r<a;)n[(e=i[r]).i]=e.x(t);return n.join(\"\")}}function fa(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function pa(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function da(t){for(var e=t.source,r=t.target,n=function(t,e){if(t===e)return t;var r=ga(t),n=ga(e),i=r.pop(),a=n.pop(),o=null;for(;i===a;)o=i,i=r.pop(),a=n.pop();return o}(e,r),i=[e];e!==n;)e=e.parent,i.push(e);for(var a=i.length;r!==n;)i.splice(a,0,r),r=r.parent;return i}function ga(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function va(t){t.fixed|=2}function ma(t){t.fixed&=-7}function ya(t){t.fixed|=4,t.px=t.x,t.py=t.y}function xa(t){t.fixed&=-5}t.interpolateTransform=ha,t.layout={},t.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(da(t[r]));return e}},t.layout.chord=function(){var e,r,n,i,a,o,s,l={},u=0;function c(){var l,c,f,p,d,g={},v=[],m=t.range(i),y=[];for(e=[],r=[],l=0,p=-1;++p<i;){for(c=0,d=-1;++d<i;)c+=n[p][d];v.push(c),y.push(t.range(i)),l+=c}for(a&&m.sort(function(t,e){return a(v[t],v[e])}),o&&y.forEach(function(t,e){t.sort(function(t,r){return o(n[e][t],n[e][r])})}),l=(Tt-u*i)/l,c=0,p=-1;++p<i;){for(f=c,d=-1;++d<i;){var x=m[p],b=y[x][d],_=n[x][b],w=c,M=c+=_*l;g[x+\"-\"+b]={index:x,subindex:b,startAngle:w,endAngle:M,value:_}}r[x]={index:x,startAngle:f,endAngle:c,value:v[x]},c+=u}for(p=-1;++p<i;)for(d=p-1;++d<i;){var A=g[p+\"-\"+d],k=g[d+\"-\"+p];(A.value||k.value)&&e.push(A.value<k.value?{source:k,target:A}:{source:A,target:k})}s&&h()}function h(){e.sort(function(t,e){return s((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}return l.matrix=function(t){return arguments.length?(i=(n=t)&&n.length,e=r=null,l):n},l.padding=function(t){return arguments.length?(u=t,e=r=null,l):u},l.sortGroups=function(t){return arguments.length?(a=t,e=r=null,l):a},l.sortSubgroups=function(t){return arguments.length?(o=t,e=null,l):o},l.sortChords=function(t){return arguments.length?(s=t,e&&h(),l):s},l.chords=function(){return e||c(),e},l.groups=function(){return r||c(),r},l},t.layout.force=function(){var e,r,n,i,a,o,s={},l=t.dispatch(\"start\",\"tick\",\"end\"),u=[1,1],c=.9,h=ba,f=_a,p=-30,d=wa,g=.1,v=.64,m=[],y=[];function x(t){return function(e,r,n,i){if(e.point!==t){var a=e.cx-t.x,o=e.cy-t.y,s=i-r,l=a*a+o*o;if(s*s/v<l){if(l<d){var u=e.charge/l;t.px-=a*u,t.py-=o*u}return!0}if(e.point&&l&&l<d){u=e.pointCharge/l;t.px-=a*u,t.py-=o*u}}return!e.charge}}function b(e){e.px=t.event.x,e.py=t.event.y,s.resume()}return s.tick=function(){if((n*=.99)<.005)return e=null,l.end({type:\"end\",alpha:n=0}),!0;var r,s,h,f,d,v,b,_,w,M=m.length,A=y.length;for(s=0;s<A;++s)f=(h=y[s]).source,(v=(_=(d=h.target).x-f.x)*_+(w=d.y-f.y)*w)&&(_*=v=n*a[s]*((v=Math.sqrt(v))-i[s])/v,w*=v,d.x-=_*(b=f.weight+d.weight?f.weight/(f.weight+d.weight):.5),d.y-=w*b,f.x+=_*(b=1-b),f.y+=w*b);if((b=n*g)&&(_=u[0]/2,w=u[1]/2,s=-1,b))for(;++s<M;)(h=m[s]).x+=(_-h.x)*b,h.y+=(w-h.y)*b;if(p)for(!function t(e,r,n){var i=0,a=0;e.charge=0;if(!e.leaf)for(var o,s=e.nodes,l=s.length,u=-1;++u<l;)null!=(o=s[u])&&(t(o,r,n),e.charge+=o.charge,i+=o.charge*o.cx,a+=o.charge*o.cy);if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var c=r*n[e.point.index];e.charge+=e.pointCharge=c,i+=c*e.point.x,a+=c*e.point.y}e.cx=i/e.charge;e.cy=a/e.charge}(r=t.geom.quadtree(m),n,o),s=-1;++s<M;)(h=m[s]).fixed||r.visit(x(h));for(s=-1;++s<M;)(h=m[s]).fixed?(h.x=h.px,h.y=h.py):(h.x-=(h.px-(h.px=h.x))*c,h.y-=(h.py-(h.py=h.y))*c);l.tick({type:\"tick\",alpha:n})},s.nodes=function(t){return arguments.length?(m=t,s):m},s.links=function(t){return arguments.length?(y=t,s):y},s.size=function(t){return arguments.length?(u=t,s):u},s.linkDistance=function(t){return arguments.length?(h=\"function\"==typeof t?t:+t,s):h},s.distance=s.linkDistance,s.linkStrength=function(t){return arguments.length?(f=\"function\"==typeof t?t:+t,s):f},s.friction=function(t){return arguments.length?(c=+t,s):c},s.charge=function(t){return arguments.length?(p=\"function\"==typeof t?t:+t,s):p},s.chargeDistance=function(t){return arguments.length?(d=t*t,s):Math.sqrt(d)},s.gravity=function(t){return arguments.length?(g=+t,s):g},s.theta=function(t){return arguments.length?(v=t*t,s):Math.sqrt(v)},s.alpha=function(t){return arguments.length?(t=+t,n?t>0?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<n;++t)(r=m[t]).index=t,r.weight=0;for(t=0;t<l;++t)\"number\"==typeof(r=y[t]).source&&(r.source=m[r.source]),\"number\"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(t=0;t<n;++t)r=m[t],isNaN(r.x)&&(r.x=g(\"x\",c)),isNaN(r.y)&&(r.y=g(\"y\",d)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],\"function\"==typeof h)for(t=0;t<l;++t)i[t]=+h.call(this,y[t],t);else for(t=0;t<l;++t)i[t]=h;if(a=[],\"function\"==typeof f)for(t=0;t<l;++t)a[t]=+f.call(this,y[t],t);else for(t=0;t<l;++t)a[t]=f;if(o=[],\"function\"==typeof p)for(t=0;t<n;++t)o[t]=+p.call(this,m[t],t);else for(t=0;t<n;++t)o[t]=p;function g(r,i){if(!e){for(e=new Array(n),u=0;u<n;++u)e[u]=[];for(u=0;u<l;++u){var a=y[u];e[a.source.index].push(a.target),e[a.target.index].push(a.source)}}for(var o,s=e[t],u=-1,c=s.length;++u<c;)if(!isNaN(o=s[u][r]))return o;return Math.random()*i}return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){if(r||(r=t.behavior.drag().origin(z).on(\"dragstart.force\",va).on(\"drag.force\",b).on(\"dragend.force\",ma)),!arguments.length)return r;this.on(\"mouseover.force\",ya).on(\"mouseout.force\",xa).call(r)},t.rebind(s,l,\"on\")};var ba=20,_a=1,wa=1/0;function Ma(e,r){return t.rebind(e,r,\"sort\",\"children\",\"value\"),e.nodes=e,e.links=Ca,e}function Aa(t,e){for(var r=[t];null!=(t=r.pop());)if(e(t),(i=t.children)&&(n=i.length))for(var n,i;--n>=0;)r.push(i[n])}function ka(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<i;)r.push(a[o]);for(;null!=(t=n.pop());)e(t)}function Ta(t){return t.children}function Sa(t){return t.value}function Ea(t,e){return e.value-t.value}function Ca(e){return t.merge(e.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}t.layout.hierarchy=function(){var t=Ea,e=Ta,r=Sa;function n(i){var a,o=[i],s=[];for(i.depth=0;null!=(a=o.pop());)if(s.push(a),(u=e.call(n,a,a.depth))&&(l=u.length)){for(var l,u,c;--l>=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 ka(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&&(Aa(t,function(t){t.children&&(t.value=0)}),ka(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;++u<o;)t(s=a[u],r,l=s.value*n,i),r+=l}}(i[0],0,r[0],r[1]/function t(e){var r=e.children,n=0;if(r&&(i=r.length))for(var i,a=-1;++a<i;)n=Math.max(n,t(r[a]));return 1+n}(i[0])),i}return n.size=function(t){return arguments.length?(r=t,n):r},Ma(n,e)},t.layout.pie=function(){var e=Number,r=La,n=0,i=Tt,a=0;function o(s){var l,u=s.length,c=s.map(function(t,r){return+e.call(o,t,r)}),h=+(\"function\"==typeof n?n.apply(this,arguments):n),f=(\"function\"==typeof i?i.apply(this,arguments):i)-h,p=Math.min(Math.abs(f)/u,+(\"function\"==typeof a?a.apply(this,arguments):a)),d=p*(f<0?-1:1),g=t.sum(c),v=g?(f-u*d)/g:0,m=t.range(u),y=[];return null!=r&&m.sort(r===La?function(t,e){return c[e]-c[t]}:function(t,e){return r(s[t],s[e])}),m.forEach(function(t){y[t]={data:s[t],value:l=c[t],startAngle:h,endAngle:h+=l*v+d,padAngle:p}}),y}return o.value=function(t){return arguments.length?(e=t,o):e},o.sort=function(t){return arguments.length?(r=t,o):r},o.startAngle=function(t){return arguments.length?(n=t,o):n},o.endAngle=function(t){return arguments.length?(i=t,o):i},o.padAngle=function(t){return arguments.length?(a=t,o):a},o};var La={};function za(t){return t.x}function Pa(t){return t.y}function Ia(t,e,r){t.y0=e,t.y=r}t.layout.stack=function(){var e=z,r=Ra,n=Fa,i=Ia,a=za,o=Pa;function s(l,u){if(!(p=l.length))return l;var c=l.map(function(t,r){return e.call(s,t,r)}),h=c.map(function(t){return t.map(function(t,e){return[a.call(s,t,e),o.call(s,t,e)]})}),f=r.call(s,h,u);c=t.permute(c,f),h=t.permute(h,f);var p,d,g,v,m=n.call(s,h,u),y=c[0].length;for(g=0;g<y;++g)for(i.call(s,c[0][g],v=m[g],h[0][g][1]),d=1;d<p;++d)i.call(s,c[d][g],v+=h[d-1][g][1],h[d][g][1]);return l}return s.values=function(t){return arguments.length?(e=t,s):e},s.order=function(t){return arguments.length?(r=\"function\"==typeof t?t:Da.get(t)||Ra,s):r},s.offset=function(t){return arguments.length?(n=\"function\"==typeof t?t:Oa.get(t)||Fa,s):n},s.x=function(t){return arguments.length?(a=t,s):a},s.y=function(t){return arguments.length?(o=t,s):o},s.out=function(t){return arguments.length?(i=t,s):i},s};var Da=t.map({\"inside-out\":function(e){var r,n,i=e.length,a=e.map(Ba),o=e.map(Na),s=t.range(i).sort(function(t,e){return a[t]-a[e]}),l=0,u=0,c=[],h=[];for(r=0;r<i;++r)n=s[r],l<u?(l+=o[n],c.push(n)):(u+=o[n],h.push(n));return h.reverse().concat(c)},reverse:function(e){return t.range(e.length).reverse()},default:Ra}),Oa=t.map({silhouette:function(t){var e,r,n,i=t.length,a=t[0].length,o=[],s=0,l=[];for(r=0;r<a;++r){for(e=0,n=0;e<i;e++)n+=t[e][r][1];n>s&&(s=n),o.push(n)}for(r=0;r<a;++r)l[r]=(s-o[r])/2;return l},wiggle:function(t){var e,r,n,i,a,o,s,l,u,c=t.length,h=t[0],f=h.length,p=[];for(p[0]=l=u=0,r=1;r<f;++r){for(e=0,i=0;e<c;++e)i+=t[e][r][1];for(e=0,a=0,s=h[r][0]-h[r-1][0];e<c;++e){for(n=0,o=(t[e][r][1]-t[e][r-1][1])/(2*s);n<e;++n)o+=(t[n][r][1]-t[n][r-1][1])/s;a+=o*t[e][r][1]}p[r]=l-=i?a/i*s:0,l<u&&(u=l)}for(r=0;r<f;++r)p[r]-=u;return p},expand:function(t){var e,r,n,i=t.length,a=t[0].length,o=1/i,s=[];for(r=0;r<a;++r){for(e=0,n=0;e<i;e++)n+=t[e][r][1];if(n)for(e=0;e<i;e++)t[e][r][1]/=n;else for(e=0;e<i;e++)t[e][r][1]=o}for(r=0;r<a;++r)s[r]=0;return s},zero:Fa});function Ra(e){return t.range(e.length)}function Fa(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function Ba(t){for(var e,r=1,n=0,i=t[0][1],a=t.length;r<a;++r)(e=t[r][1])>i&&(n=r,i=e);return n}function Na(t){return t.reduce(ja,0)}function ja(t,e){return t+e[1]}function Va(t,e){return Ua(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Ua(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 qa(e){return[t.min(e),t.max(e)]}function Ha(t,e){return t.value-e.value}function Ga(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Wa(t,e){t._pack_next=e,e._pack_prev=t}function Ya(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 Xa(t){if((e=t.children)&&(l=e.length)){var e,r,n,i,a,o,s,l,u=1/0,c=-1/0,h=1/0,f=-1/0;if(e.forEach(Za),(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(Ka(r,n,i=e[2]),x(i),Ga(r,i),r._pack_prev=i,Ga(i,n),n=r._pack_next,a=3;a<l;a++){Ka(r,n,i=e[a]);var p=0,d=1,g=1;for(o=n._pack_next;o!==n;o=o._pack_next,d++)if(Ya(o,i)){p=1;break}if(1==p)for(s=r._pack_prev;s!==o._pack_prev&&!Ya(s,i);s=s._pack_prev,g++);p?(d<g||d==g&&n.r<r.r?Wa(r,n=o):Wa(r=s,n),a--):(Ga(r,i),n=i,x(i))}var v=(u+c)/2,m=(h+f)/2,y=0;for(a=0;a<l;a++)(i=e[a]).x-=v,i.y-=m,y=Math.max(y,i.r+Math.sqrt(i.x*i.x+i.y*i.y));t.r=y,e.forEach(Ja)}function x(t){u=Math.min(t.x-t.r,u),c=Math.max(t.x+t.r,c),h=Math.min(t.y-t.r,h),f=Math.max(t.y+t.r,f)}}function Za(t){t._pack_next=t._pack_prev=t}function Ja(t){delete t._pack_next,delete t._pack_prev}function Ka(t,e,r){var n=t.r+r.r,i=e.x-t.x,a=e.y-t.y;if(n&&(i||a)){var o=e.r+r.r,s=i*i+a*a,l=.5+((n*=n)-(o*=o))/(2*s),u=Math.sqrt(Math.max(0,2*o*(n+s)-(n-=s)*n-o*o))/(2*s);r.x=t.x+l*i+u*a,r.y=t.y+l*a-u*i}else r.x=t.x+n,r.y=t.y}function Qa(t,e){return t.parent==e.parent?1:2}function $a(t){var e=t.children;return e.length?e[0]:t.t}function to(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function eo(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}function ro(t,e,r){return t.a.parent===e.parent?t.a:r}function no(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function io(t,e){var r=t.x+e[3],n=t.y+e[0],i=t.dx-e[1]-e[3],a=t.dy-e[0]-e[2];return i<0&&(r+=i/2,i=0),a<0&&(n+=a/2,a=0),{x:r,y:n,dx:i,dy:a}}function ao(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function oo(t){return t.rangeExtent?t.rangeExtent():ao(t.range())}function so(t,e,r,n){var i=r(t[0],t[1]),a=n(e[0],e[1]);return function(t){return a(i(t))}}function lo(t,e){var r,n=0,i=t.length-1,a=t[n],o=t[i];return o<a&&(r=n,n=i,i=r,r=a,a=o,o=r),t[n]=e.floor(a),t[i]=e.ceil(o),t}function uo(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:co}t.layout.histogram=function(){var e=!0,r=Number,n=qa,i=Va;function a(a,o){for(var s,l,u=[],c=a.map(r,this),h=n.call(this,c,o),f=i.call(this,h,c,o),p=(o=-1,c.length),d=f.length-1,g=e?1:1/p;++o<d;)(s=u[o]=[]).dx=f[o+1]-(s.x=f[o]),s.y=0;if(d>0)for(o=-1;++o<p;)(l=c[o])>=h[0]&&l<=h[1]&&((s=u[t.bisect(f,l,1,d)-1]).y+=g,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=ve(t),a):n},a.bins=function(t){return arguments.length?(i=\"number\"==typeof t?function(e){return Ua(e,t)}:ve(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(Ha),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,ka(s,function(t){t.r=+c(t.value)}),ka(s,Xa),n){var h=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;ka(s,function(t){t.r+=h}),ka(s,Xa),ka(s,function(t){t.r-=h})}return function t(e,r,n,i){var a=e.children;e.x=r+=i*e.x;e.y=n+=i*e.y;e.r*=i;if(a)for(var o=-1,s=a.length;++o<s;)t(a[o],r,n,i)}(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u)),o}return a.size=function(t){return arguments.length?(i=t,a):i},a.radius=function(t){return arguments.length?(e=null==t||\"function\"==typeof t?t:+t,a):e},a.padding=function(t){return arguments.length?(n=+t,a):n},Ma(a,r)},t.layout.tree=function(){var e=t.layout.hierarchy().sort(null).value(null),r=Qa,n=[1,1],i=null;function a(t,a){var u=e.call(this,t,a),c=u[0],h=function(t){var e,r={A:null,children:[t]},n=[r];for(;null!=(e=n.pop());)for(var i,a=e.children,o=0,s=a.length;o<s;++o)n.push((a[o]=i={_:a[o],parent:e,children:(i=a[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return r.children[0]}(c);if(ka(h,o),h.parent.m=-h.z,Aa(h,s),i)Aa(c,l);else{var f=c,p=c,d=c;Aa(c,function(t){t.x<f.x&&(f=t),t.x>p.x&&(p=t),t.depth>d.depth&&(d=t)});var g=r(f,p)/2-f.x,v=n[0]/(p.x+r(p,f)/2+g),m=n[1]/(d.depth||1);Aa(c,function(t){t.x=(t.x+g)*v,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){var e,r=0,n=0,i=t.children,a=i.length;for(;--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,h=s.m,f=l.m;s=to(s),a=$a(a),s&&a;)l=$a(l),(o=to(o)).a=t,(i=s.z+h-a.z-u+r(s._,a._))>0&&(eo(ro(s,t,n),t,i),u+=i,c+=i),h+=s.m,u+=a.m,f+=l.m,c+=o.m;s&&!to(o)&&(o.t=s,o.m+=h-c),a&&!$a(l)&&(l.t=a,l.m+=u-f,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},Ma(a,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=Qa,n=[1,1],i=!1;function a(a,o){var s,l=e.call(this,a,o),u=l[0],c=0;ka(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 h=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(u),f=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(u),p=h.x-r(h,f)/2,d=f.x+r(f,h)/2;return ka(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},Ma(a,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,i=[1,1],a=null,o=no,s=!1,l=\"squarify\",u=.5*(1+Math.sqrt(5));function c(t,e){for(var r,n,i=-1,a=t.length;++i<a;)n=(r=t[i]).value*(e<0?0:e),r.area=isNaN(n)||n<=0?0:n}function h(t){var e=t.children;if(e&&e.length){var r,n,i,a=o(t),s=[],u=e.slice(),f=1/0,g=\"slice\"===l?a.dx:\"dice\"===l?a.dy:\"slice-dice\"===l?1&t.depth?a.dy:a.dx:Math.min(a.dx,a.dy);for(c(u,a.dx*a.dy/t.value),s.area=0;(i=u.length)>0;)s.push(r=u[i-1]),s.area+=r.area,\"squarify\"!==l||(n=p(s,g))<=f?(u.pop(),f=n):(s.area-=s.pop().area,d(s,g,a,!1),g=Math.min(a.dx,a.dy),s.length=s.area=0,f=1/0);s.length&&(d(s,g,a,!0),s.length=s.area=0),e.forEach(h)}}function f(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(f)}}function p(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++o<s;)(r=t[o].area)&&(r<a&&(a=r),r>i&&(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);++o<s;)(a=t[o]).x=l,a.y=u,a.dy=c,l+=a.dx=Math.min(r.x+r.dx-l,c?n(a.area/c):0);a.z=!0,a.dx+=r.x+r.dx-l,r.y+=c,r.dy-=c}else{for((i||c>r.dx)&&(c=r.dx);++o<s;)(a=t[o]).x=l,a.y=u,a.dx=c,u+=a.dy=Math.min(r.y+r.dy-u,c?n(a.area/c):0);a.z=!1,a.dy+=r.y+r.dy-u,r.x+=c,r.dx-=c}}function g(t){var n=e||r(t),a=n[0];return a.x=a.y=0,a.value?(a.dx=i[0],a.dy=i[1]):a.dx=a.dy=0,e&&r.revalue(a),c([a],a.dx*a.dy/a.value),(e?f:h)(a),s&&(e=n),n}return g.size=function(t){return arguments.length?(i=t,g):i},g.padding=function(t){if(!arguments.length)return a;function e(e){return io(e,t)}var r;return o=null==(a=t)?no:\"function\"==(r=typeof t)?function(e){var r=t.call(g,e,e.depth);return null==r?no(e):io(e,\"number\"==typeof r?[r,r,r,r]:r)}:\"number\"===r?(t=[t,t,t,t],e):e,g},g.round=function(t){return arguments.length?(n=t?Math.round:Number,g):n!=Number},g.sticky=function(t){return arguments.length?(s=t,e=null,g):s},g.ratio=function(t){return arguments.length?(u=t,g):u},g.mode=function(t){return arguments.length?(l=t+\"\",g):l},Ma(g,r)},t.random={normal:function(t,e){var r=arguments.length;return r<2&&(e=1),r<1&&(t=0),function(){var r,n,i;do{i=(r=2*Math.random()-1)*r+(n=2*Math.random()-1)*n}while(!i||i>1);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;r<t;r++)e+=Math.random();return e}}},t.scale={};var co={floor:z,ceil:z};function ho(e,r,n,i){var a=[],o=[],s=0,l=Math.min(e.length,r.length)-1;for(e[l]<e[0]&&(e=e.slice().reverse(),r=r.slice().reverse());++s<=l;)a.push(n(e[s-1],e[s])),o.push(i(r[s-1],r[s]));return function(r){var n=t.bisect(e,r,1,l)-1;return o[n](a[n](r))}}function fo(e,r){return t.rebind(e,r,\"range\",\"rangeRound\",\"interpolate\",\"clamp\")}function po(t,e){return lo(t,uo(go(t,e)[2])),lo(t,uo(go(t,e)[2])),t}function go(t,e){null==e&&(e=10);var r=ao(t),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),a=e/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function vo(e,r){return t.range.apply(t,go(e,r))}function mo(e,r,n){var i=go(e,r);if(n){var a=Le.exec(n);if(a.shift(),\"s\"===a[8]){var o=t.formatPrefix(Math.max(y(i[0]),y(i[1])));return a[7]||(a[7]=\".\"+xo(o.scale(i[2]))),a[8]=\"f\",n=t.format(a.join(\"\")),function(t){return n(o.scale(t))+o.symbol}}a[7]||(a[7]=\".\"+function(t,e){var r=xo(e[2]);return t in yo?Math.abs(r-xo(Math.max(y(e[0]),y(e[1]))))+ +(\"e\"!==t):r-2*(\"%\"===t)}(a[8],i)),n=a.join(\"\")}else n=\",.\"+xo(i[2])+\"f\";return t.format(n)}t.scale.linear=function(){return function t(e,r,n,i){var a,o;function s(){var t=Math.min(e.length,r.length)>2?ho:so,s=i?pa:fa;return a=t(e,r,s,n),o=t(r,e,s,Gi),l}function l(t){return a(t)}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(aa)};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 vo(e,t)};l.tickFormat=function(t,r){return mo(e,t,r)};l.nice=function(t){return po(e,t),s()};l.copy=function(){return t(e,r,n,i)};return s()}([0,1],[0,1],Gi,!1)};var yo={s:1,g:1,p:1,r:1,e:1};function xo(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))}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=lo(a.map(o),i?Math:_o);return r.domain(t),a=t.map(s),l};l.ticks=function(){var t=ao(a),e=[],r=t[0],l=t[1],u=Math.floor(o(r)),c=Math.ceil(o(l)),h=n%1?2:n;if(isFinite(c-u)){if(i){for(;u<c;u++)for(var f=1;f<h;f++)e.push(s(u)*f);e.push(s(u))}else for(e.push(s(u));u++<c;)for(var f=h-1;f>0;f--)e.push(s(u)*f);for(u=0;e[u]<r;u++);for(c=e.length;e[c-1]>l;c--);e=e.slice(u,c)}return e};l.tickFormat=function(e,r){if(!arguments.length)return bo;arguments.length<2?r=bo:\"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*n<n-.5&&(e*=n),e<=i?r(t):\"\"}};l.copy=function(){return e(r.copy(),n,i,a)};return fo(l,r)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var bo=t.format(\".0e\"),_o={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function wo(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}t.scale.pow=function(){return function t(e,r,n){var i=wo(r),a=wo(1/r);function o(t){return e(i(t))}o.invert=function(t){return a(e.invert(t))};o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(i)),o):n};o.ticks=function(t){return vo(n,t)};o.tickFormat=function(t,e){return mo(n,t,e)};o.nice=function(t){return o.domain(po(n,t))};o.exponent=function(t){return arguments.length?(i=wo(r=t),a=wo(1/r),e.domain(n.map(i)),o):r};o.copy=function(){return t(e.copy(),r,n)};return fo(o,e)}(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return function e(r,n){var i,a,o;function s(t){return a[((i.get(t)||(\"range\"===n.t?i.set(t,r.push(t)):NaN))-1)%a.length]}function l(e,n){return t.range(r.length).map(function(t){return e+n*t})}s.domain=function(t){if(!arguments.length)return r;r=[],i=new b;for(var e,a=-1,o=t.length;++a<o;)i.has(e=t[a])||i.set(e,r.push(e));return s[n.t].apply(s,n.a)};s.range=function(t){return arguments.length?(a=t,o=0,n={t:\"range\",a:arguments},s):a};s.rangePoints=function(t,e){arguments.length<2&&(e=0);var i=t[0],u=t[1],c=r.length<2?(i=(i+u)/2,0):(u-i)/(r.length-1+e);return a=l(i+c*e/2,c),o=0,n={t:\"rangePoints\",a:arguments},s};s.rangeRoundPoints=function(t,e){arguments.length<2&&(e=0);var i=t[0],u=t[1],c=r.length<2?(i=u=Math.round((i+u)/2),0):(u-i)/(r.length-1+e)|0;return a=l(i+Math.round(c*e/2+(u-i-(r.length-1+e)*c)/2),c),o=0,n={t:\"rangeRoundPoints\",a:arguments},s};s.rangeBands=function(t,e,i){arguments.length<2&&(e=0),arguments.length<3&&(i=e);var u=t[1]<t[0],c=t[u-0],h=t[1-u],f=(h-c)/(r.length-e+2*i);return a=l(c+f*i,f),u&&a.reverse(),o=f*(1-e),n={t:\"rangeBands\",a:arguments},s};s.rangeRoundBands=function(t,e,i){arguments.length<2&&(e=0),arguments.length<3&&(i=e);var u=t[1]<t[0],c=t[u-0],h=t[1-u],f=Math.floor((h-c)/(r.length-e+2*i));return a=l(c+Math.round((h-c-(r.length-e)*f)/2),f),u&&a.reverse(),o=Math.round(f*(1-e)),n={t:\"rangeRoundBands\",a:arguments},s};s.rangeBand=function(){return o};s.rangeExtent=function(){return ao(n.a[0])};s.copy=function(){return e(r,n)};return s.domain(r)}([],{t:\"range\",a:[[]]})},t.scale.category10=function(){return t.scale.ordinal().range(Mo)},t.scale.category20=function(){return t.scale.ordinal().range(Ao)},t.scale.category20b=function(){return t.scale.ordinal().range(ko)},t.scale.category20c=function(){return t.scale.ordinal().range(To)};var Mo=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(se),Ao=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(se),ko=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(se),To=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(se);function So(){return 0}t.scale.quantile=function(){return function e(r,n){var i;function a(){var e=0,a=n.length;for(i=[];++e<a;)i[e-1]=t.quantile(r,e/a);return o}function o(e){if(!isNaN(e=+e))return n[t.bisect(i,e)]}o.domain=function(t){return arguments.length?(r=t.map(p).filter(d).sort(f),a()):r};o.range=function(t){return arguments.length?(n=t,a()):n};o.quantiles=function(){return i};o.invertExtent=function(t){return(t=n.indexOf(t))<0?[NaN,NaN]:[t>0?i[t-1]:r[0],t<i.length?i[t]:r[r.length-1]]};o.copy=function(){return e(r,n)};return a()}([],[])},t.scale.quantize=function(){return function t(e,r,n){var i,a;function o(t){return n[Math.max(0,Math.min(a,Math.floor(i*(t-e))))]}function s(){return i=n.length/(r-e),a=n.length-1,o}o.domain=function(t){return arguments.length?(e=+t[0],r=+t[t.length-1],s()):[e,r]};o.range=function(t){return arguments.length?(n=t,s()):n};o.invertExtent=function(t){return[t=(t=n.indexOf(t))<0?NaN:t/i+e,t+1/i]};o.copy=function(){return t(e,r,n)};return s()}(0,1,[0,1])},t.scale.threshold=function(){return function e(r,n){function i(e){if(e<=e)return n[t.bisect(r,e)]}i.domain=function(t){return arguments.length?(r=t,i):r};i.range=function(t){return arguments.length?(n=t,i):n};i.invertExtent=function(t){return t=n.indexOf(t),[r[t-1],r[t]]};i.copy=function(){return e(r,n)};return i}([.5],[0,1])},t.scale.identity=function(){return function t(e){function r(t){return+t}r.invert=r;r.domain=r.range=function(t){return arguments.length?(e=t.map(r),r):e};r.ticks=function(t){return vo(e,t)};r.tickFormat=function(t,r){return mo(e,t,r)};r.copy=function(){return t(e)};return r}([0,1])},t.svg={},t.svg.arc=function(){var t=Co,e=Lo,r=So,n=Eo,i=zo,a=Po,o=Io;function s(){var s=Math.max(0,+t.apply(this,arguments)),u=Math.max(0,+e.apply(this,arguments)),c=i.apply(this,arguments)-Et,h=a.apply(this,arguments)-Et,f=Math.abs(h-c),p=c>h?0:1;if(u<s&&(d=u,u=s,s=d),f>=St)return l(u,p)+(s?l(s,1-p):\"\")+\"Z\";var d,g,v,m,y,x,b,_,w,M,A,k,T=0,S=0,E=[];if((m=(+o.apply(this,arguments)||0)/2)&&(v=n===Eo?Math.sqrt(s*s+u*u):+n.apply(this,arguments),p||(S*=-1),u&&(S=Dt(v/u*Math.sin(m))),s&&(T=Dt(v/s*Math.sin(m)))),u){y=u*Math.cos(c+S),x=u*Math.sin(c+S),b=u*Math.cos(h-S),_=u*Math.sin(h-S);var C=Math.abs(h-c-2*S)<=kt?0:1;if(S&&Do(y,x,b,_)===p^C){var L=(c+h)/2;y=u*Math.cos(L),x=u*Math.sin(L),b=_=null}}else y=x=0;if(s){w=s*Math.cos(h-T),M=s*Math.sin(h-T),A=s*Math.cos(c+T),k=s*Math.sin(c+T);var z=Math.abs(c-h+2*T)<=kt?0:1;if(T&&Do(w,M,A,k)===1-p^z){var P=(c+h)/2;w=s*Math.cos(P),M=s*Math.sin(P),A=k=null}}else w=M=0;if(f>Mt&&(d=Math.min(Math.abs(u-s)/2,+r.apply(this,arguments)))>.001){g=s<u^p?0:1;var I=d,D=d;if(f<kt){var O=null==A?[w,M]:null==b?[y,x]:ai([y,x],[A,k],[b,_],[w,M]),R=y-O[0],F=x-O[1],B=b-O[0],N=_-O[1],j=1/Math.sin(Math.acos((R*B+F*N)/(Math.sqrt(R*R+F*F)*Math.sqrt(B*B+N*N)))/2),V=Math.sqrt(O[0]*O[0]+O[1]*O[1]);D=Math.min(d,(s-V)/(j-1)),I=Math.min(d,(u-V)/(j+1))}if(null!=b){var U=Oo(null==A?[w,M]:[A,k],[y,x],u,I,p),q=Oo([b,_],[w,M],u,I,p);d===I?E.push(\"M\",U[0],\"A\",I,\",\",I,\" 0 0,\",g,\" \",U[1],\"A\",u,\",\",u,\" 0 \",1-p^Do(U[1][0],U[1][1],q[1][0],q[1][1]),\",\",p,\" \",q[1],\"A\",I,\",\",I,\" 0 0,\",g,\" \",q[0]):E.push(\"M\",U[0],\"A\",I,\",\",I,\" 0 1,\",g,\" \",q[0])}else E.push(\"M\",y,\",\",x);if(null!=A){var H=Oo([y,x],[A,k],s,-D,p),G=Oo([w,M],null==b?[y,x]:[b,_],s,-D,p);d===D?E.push(\"L\",G[0],\"A\",D,\",\",D,\" 0 0,\",g,\" \",G[1],\"A\",s,\",\",s,\" 0 \",p^Do(G[1][0],G[1][1],H[1][0],H[1][1]),\",\",1-p,\" \",H[1],\"A\",D,\",\",D,\" 0 0,\",g,\" \",H[0]):E.push(\"L\",G[0],\"A\",D,\",\",D,\" 0 0,\",g,\" \",H[0])}else E.push(\"L\",w,\",\",M)}else E.push(\"M\",y,\",\",x),null!=b&&E.push(\"A\",u,\",\",u,\" 0 \",C,\",\",p,\" \",b,\",\",_),E.push(\"L\",w,\",\",M),null!=A&&E.push(\"A\",s,\",\",s,\" 0 \",z,\",\",1-p,\" \",A,\",\",k);return E.push(\"Z\"),E.join(\"\")}function l(t,e){return\"M0,\"+t+\"A\"+t+\",\"+t+\" 0 1,\"+e+\" 0,\"+-t+\"A\"+t+\",\"+t+\" 0 1,\"+e+\" 0,\"+t}return s.innerRadius=function(e){return arguments.length?(t=ve(e),s):t},s.outerRadius=function(t){return arguments.length?(e=ve(t),s):e},s.cornerRadius=function(t){return arguments.length?(r=ve(t),s):r},s.padRadius=function(t){return arguments.length?(n=t==Eo?Eo:ve(t),s):n},s.startAngle=function(t){return arguments.length?(i=ve(t),s):i},s.endAngle=function(t){return arguments.length?(a=ve(t),s):a},s.padAngle=function(t){return arguments.length?(o=ve(t),s):o},s.centroid=function(){var r=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Et;return[Math.cos(n)*r,Math.sin(n)*r]},s};var Eo=\"auto\";function Co(t){return t.innerRadius}function Lo(t){return t.outerRadius}function zo(t){return t.startAngle}function Po(t){return t.endAngle}function Io(t){return t&&t.padAngle}function Do(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function Oo(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,h=t[1]+u,f=e[0]+l,p=e[1]+u,d=(c+f)/2,g=(h+p)/2,v=f-c,m=p-h,y=v*v+m*m,x=r-n,b=c*p-f*h,_=(m<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*m-v*_)/y,M=(-b*v-m*_)/y,A=(b*m+v*_)/y,k=(-b*v+m*_)/y,T=w-d,S=M-g,E=A-d,C=k-g;return T*T+S*S>E*E+C*C&&(w=A,M=k),[[w-l,M-u],[w*r/x,M*r/x]]}function Ro(t){var e=$n,r=ti,n=Wr,i=Bo,a=i.key,o=.7;function s(a){var s,l=[],u=[],c=-1,h=a.length,f=ve(e),p=ve(r);function d(){l.push(\"M\",i(t(u),o))}for(;++c<h;)n.call(this,s=a[c],c)?u.push([+f.call(this,s,c),+p.call(this,s,c)]):u.length&&(d(),u=[]);return u.length&&d(),l.length?l.join(\"\"):null}return s.x=function(t){return arguments.length?(e=t,s):e},s.y=function(t){return arguments.length?(r=t,s):r},s.defined=function(t){return arguments.length?(n=t,s):n},s.interpolate=function(t){return arguments.length?(a=\"function\"==typeof t?i=t:(i=Fo.get(t)||Bo).key,s):a},s.tension=function(t){return arguments.length?(o=t,s):o},s}t.svg.line=function(){return Ro(z)};var Fo=t.map({linear:Bo,\"linear-closed\":No,step:function(t){var e=0,r=t.length,n=t[0],i=[n[0],\",\",n[1]];for(;++e<r;)i.push(\"H\",(n[0]+(n=t[e])[0])/2,\"V\",n[1]);r>1&&i.push(\"H\",n[0]);return i.join(\"\")},\"step-before\":jo,\"step-after\":Vo,basis:Ho,\"basis-open\":function(t){if(t.length<4)return Bo(t);var e,r=[],n=-1,i=t.length,a=[0],o=[0];for(;++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);r.push(Go(Xo,a)+\",\"+Go(Xo,o)),--n;for(;++n<i;)e=t[n],a.shift(),a.push(e[0]),o.shift(),o.push(e[1]),Zo(r,a,o);return r.join(\"\")},\"basis-closed\":function(t){var e,r,n=-1,i=t.length,a=i+4,o=[],s=[];for(;++n<4;)r=t[n%i],o.push(r[0]),s.push(r[1]);e=[Go(Xo,o),\",\",Go(Xo,s)],--n;for(;++n<a;)r=t[n%i],o.shift(),o.push(r[0]),s.shift(),s.push(r[1]),Zo(e,o,s);return e.join(\"\")},bundle:function(t,e){var r=t.length-1;if(r)for(var n,i,a=t[0][0],o=t[0][1],s=t[r][0]-a,l=t[r][1]-o,u=-1;++u<=r;)n=t[u],i=u/r,n[0]=e*n[0]+(1-e)*(a+i*s),n[1]=e*n[1]+(1-e)*(o+i*l);return Ho(t)},cardinal:function(t,e){return t.length<3?Bo(t):t[0]+Uo(t,qo(t,e))},\"cardinal-open\":function(t,e){return t.length<4?Bo(t):t[1]+Uo(t.slice(1,-1),qo(t,e))},\"cardinal-closed\":function(t,e){return t.length<3?No(t):t[0]+Uo((t.push(t[0]),t),qo([t[t.length-2]].concat(t,[t[1]]),e))},monotone:function(t){return t.length<3?Bo(t):t[0]+Uo(t,function(t){var e,r,n,i,a=[],o=function(t){var e=0,r=t.length-1,n=[],i=t[0],a=t[1],o=n[0]=Jo(i,a);for(;++e<r;)n[e]=(o+(o=Jo(i=a,a=t[e+1])))/2;return n[e]=o,n}(t),s=-1,l=t.length-1;for(;++s<l;)e=Jo(t[s],t[s+1]),y(e)<Mt?o[s]=o[s+1]=0:(r=o[s]/e,n=o[s+1]/e,(i=r*r+n*n)>9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n));s=-1;for(;++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 Bo(t){return t.length>1?t.join(\"L\"):t+\"Z\"}function No(t){return t.join(\"L\")+\"Z\"}function jo(t){for(var e=0,r=t.length,n=t[0],i=[n[0],\",\",n[1]];++e<r;)i.push(\"V\",(n=t[e])[1],\"H\",n[0]);return i.join(\"\")}function Vo(t){for(var e=0,r=t.length,n=t[0],i=[n[0],\",\",n[1]];++e<r;)i.push(\"H\",(n=t[e])[0],\"V\",n[1]);return i.join(\"\")}function Uo(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return Bo(t);var r=t.length!=e.length,n=\"\",i=t[0],a=t[1],o=e[0],s=o,l=1;if(r&&(n+=\"Q\"+(a[0]-2*o[0]/3)+\",\"+(a[1]-2*o[1]/3)+\",\"+a[0]+\",\"+a[1],i=t[1],l=2),e.length>1){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;u<e.length;u++,l++)a=t[l],s=e[u],n+=\"S\"+(a[0]-s[0])+\",\"+(a[1]-s[1])+\",\"+a[0]+\",\"+a[1]}if(r){var c=t[l];n+=\"Q\"+(a[0]+2*s[0]/3)+\",\"+(a[1]+2*s[1]/3)+\",\"+c[0]+\",\"+c[1]}return n}function qo(t,e){for(var r,n=[],i=(1-e)/2,a=t[0],o=t[1],s=1,l=t.length;++s<l;)r=a,a=o,o=t[s],n.push([i*(o[0]-r[0]),i*(o[1]-r[1])]);return n}function Ho(t){if(t.length<3)return Bo(t);var e=1,r=t.length,n=t[0],i=n[0],a=n[1],o=[i,i,i,(n=t[1])[0]],s=[a,a,a,n[1]],l=[i,\",\",a,\"L\",Go(Xo,o),\",\",Go(Xo,s)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),s.shift(),s.push(n[1]),Zo(l,o,s);return t.pop(),l.push(\"L\",n),l.join(\"\")}function Go(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}Fo.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Wo=[0,2/3,1/3,0],Yo=[0,1/3,2/3,0],Xo=[0,1/6,2/3,1/6];function Zo(t,e,r){t.push(\"C\",Go(Wo,e),\",\",Go(Wo,r),\",\",Go(Yo,e),\",\",Go(Yo,r),\",\",Go(Xo,e),\",\",Go(Xo,r))}function Jo(t,e){return(e[1]-t[1])/(e[0]-t[0])}function Ko(t){for(var e,r,n,i=-1,a=t.length;++i<a;)r=(e=t[i])[0],n=e[1]-Et,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function Qo(t){var e=$n,r=$n,n=0,i=ti,a=Wr,o=Bo,s=o.key,l=o,u=\"L\",c=.7;function h(s){var h,f,p,d=[],g=[],v=[],m=-1,y=s.length,x=ve(e),b=ve(n),_=e===r?function(){return f}:ve(r),w=n===i?function(){return p}:ve(i);function M(){d.push(\"M\",o(t(v),c),u,l(t(g.reverse()),c),\"Z\")}for(;++m<y;)a.call(this,h=s[m],m)?(g.push([f=+x.call(this,h,m),p=+b.call(this,h,m)]),v.push([+_.call(this,h,m),+w.call(this,h,m)])):g.length&&(M(),g=[],v=[]);return g.length&&M(),d.length?d.join(\"\"):null}return h.x=function(t){return arguments.length?(e=r=t,h):r},h.x0=function(t){return arguments.length?(e=t,h):e},h.x1=function(t){return arguments.length?(r=t,h):r},h.y=function(t){return arguments.length?(n=i=t,h):i},h.y0=function(t){return arguments.length?(n=t,h):n},h.y1=function(t){return arguments.length?(i=t,h):i},h.defined=function(t){return arguments.length?(a=t,h):a},h.interpolate=function(t){return arguments.length?(s=\"function\"==typeof t?o=t:(o=Fo.get(t)||Bo).key,l=o.reverse||o,u=o.closed?\"M\":\"L\",h):s},h.tension=function(t){return arguments.length?(c=t,h):c},h}function $o(t){return t.radius}function ts(t){return[t.x,t.y]}function es(){return 64}function rs(){return\"circle\"}function ns(t){var e=Math.sqrt(t/kt);return\"M0,\"+e+\"A\"+e+\",\"+e+\" 0 1,1 0,\"+-e+\"A\"+e+\",\"+e+\" 0 1,1 0,\"+e+\"Z\"}t.svg.line.radial=function(){var t=Ro(Ko);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},jo.reverse=Vo,Vo.reverse=jo,t.svg.area=function(){return Qo(z)},t.svg.area.radial=function(){var t=Qo(Ko);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},t.svg.chord=function(){var t=Nn,e=jn,r=$o,n=zo,i=Po;function a(r,n){var i,a,u=o(this,t,r,n),c=o(this,e,r,n);return\"M\"+u.p0+s(u.r,u.p1,u.a1-u.a0)+(a=c,(i=u).a0==a.a0&&i.a1==a.a1?l(u.r,u.p1,u.r,u.p0):l(u.r,u.p1,c.r,c.p0)+s(c.r,c.p1,c.a1-c.a0)+l(c.r,c.p1,u.r,u.p0))+\"Z\"}function o(t,e,a,o){var s=e.call(t,a,o),l=r.call(t,s,o),u=n.call(t,s,o)-Et,c=i.call(t,s,o)-Et;return{r:l,a0:u,a1:c,p0:[l*Math.cos(u),l*Math.sin(u)],p1:[l*Math.cos(c),l*Math.sin(c)]}}function s(t,e,r){return\"A\"+t+\",\"+t+\" 0 \"+ +(r>kt)+\",1 \"+e}function l(t,e,r,n){return\"Q 0,0 \"+n}return a.radius=function(t){return arguments.length?(r=ve(t),a):r},a.source=function(e){return arguments.length?(t=ve(e),a):t},a.target=function(t){return arguments.length?(e=ve(t),a):e},a.startAngle=function(t){return arguments.length?(n=ve(t),a):n},a.endAngle=function(t){return arguments.length?(i=ve(t),a):i},a},t.svg.diagonal=function(){var t=Nn,e=jn,r=ts;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=ve(e),n):t},n.target=function(t){return arguments.length?(e=ve(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=ts,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]-Et;return[r*Math.cos(n),r*Math.sin(n)]}}(r=t)):r},e},t.svg.symbol=function(){var t=rs,e=es;function r(r,n){return(is.get(t.call(this,r,n))||ns)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ve(e),r):t},r.size=function(t){return arguments.length?(e=ve(t),r):e},r};var is=t.map({circle:ns,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*os)),r=e*os;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/as),r=e*as/2;return\"M0,\"+r+\"L\"+e+\",\"+-r+\" \"+-e+\",\"+-r+\"Z\"},\"triangle-up\":function(t){var e=Math.sqrt(t/as),r=e*as/2;return\"M0,\"+-r+\"L\"+e+\",\"+r+\" \"+-e+\",\"+r+\"Z\"}});t.svg.symbolTypes=is.keys();var as=Math.sqrt(3),os=Math.tan(30*Ct);Y.transition=function(t){for(var e,r,n=cs||++ps,i=vs(t),a=[],o=hs||{time:Date.now(),ease:ta,delay:0,duration:250},s=-1,l=this.length;++s<l;){a.push(e=[]);for(var u=this[s],c=-1,h=u.length;++c<h;)(r=u[c])&&ms(r,c,i,n,o),e.push(r)}return us(a,i,n)},Y.interrupt=function(t){return this.each(null==t?ss:ls(vs(t)))};var ss=ls(vs());function ls(t){return function(){var e,r,n;(e=this[t])&&(n=e[r=e.active])&&(n.timer.c=null,n.timer.t=NaN,--e.count?delete e[r]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function us(t,e,r){return U(t,fs),t.namespace=e,t.id=r,t}var cs,hs,fs=[],ps=0;function ds(t,e,r,n){var i=t.id,a=t.namespace;return ct(t,\"function\"==typeof r?function(t,o,s){t[a][i].tween.set(e,n(r.call(t,t.__data__,o,s)))}:(r=n(r),function(t){t[a][i].tween.set(e,r)}))}function gs(t){return null==t&&(t=\"\"),function(){this.textContent=t}}function vs(t){return null==t?\"__transition__\":\"__transition_\"+t+\"__\"}function ms(t,e,r,n,i){var a,o,s,l,u,c=t[r]||(t[r]={active:0,count:0}),h=c[n];function f(r){var i=c.active,f=c[i];for(var d in f&&(f.timer.c=null,f.timer.t=NaN,--c.count,delete c[i],f.event&&f.event.interrupt.call(t,t.__data__,f.index)),c)if(+d<n){var g=c[d];g.timer.c=null,g.timer.t=NaN,--c.count,delete c[d]}o.c=p,Ae(function(){return o.c&&p(r||1)&&(o.c=null,o.t=NaN),1},0,a),c.active=n,h.event&&h.event.start.call(t,t.__data__,e),u=[],h.tween.forEach(function(r,n){(n=n.call(t,t.__data__,e))&&u.push(n)}),l=h.ease,s=h.duration}function p(i){for(var a=i/s,o=l(a),f=u.length;f>0;)u[--f].call(t,o);if(a>=1)return h.event&&h.event.end.call(t,t.__data__,e),--c.count?delete c[n]:delete t[r],1}h||(a=i.time,o=Ae(function(t){var e=h.delay;if(o.t=e+a,e<=t)return f(t-e);o.c=f},0,a),h=c[n]={tween:new b,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++c.count)}fs.call=Y.call,fs.empty=Y.empty,fs.node=Y.node,fs.size=Y.size,t.transition=function(e,r){return e&&e.transition?cs?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=fs,fs.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=X(t);for(var s=-1,l=this.length;++s<l;){o.push(e=[]);for(var u=this[s],c=-1,h=u.length;++c<h;)(n=u[c])&&(r=t.call(n,n.__data__,c,s))?(\"__data__\"in n&&(r.__data__=n.__data__),ms(r,c,a,i,n[a][i]),e.push(r)):e.push(null)}return us(o,a,i)},fs.selectAll=function(t){var e,r,n,i,a,o=this.id,s=this.namespace,l=[];t=Z(t);for(var u=-1,c=this.length;++u<c;)for(var h=this[u],f=-1,p=h.length;++f<p;)if(n=h[f]){a=n[s][o],r=t.call(n,n.__data__,f,u),l.push(e=[]);for(var d=-1,g=r.length;++d<g;)(i=r[d])&&ms(i,d,s,o,a),e.push(i)}return us(l,s,o)},fs.filter=function(t){var e,r,n=[];\"function\"!=typeof t&&(t=ut(t));for(var i=0,a=this.length;i<a;i++){n.push(e=[]);for(var o,s=0,l=(o=this[i]).length;s<l;s++)(r=o[s])&&t.call(r,r.__data__,s,i)&&e.push(r)}return us(n,this.namespace,this.id)},fs.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):ct(this,null==e?function(e){e[n][r].tween.remove(t)}:function(i){i[n][r].tween.set(t,e)})},fs.attr=function(e,r){if(arguments.length<2){for(r in e)this.attr(r,e[r]);return this}var n=\"transform\"==e?ha:Gi,i=t.ns.qualify(e);function a(){this.removeAttribute(i)}function o(){this.removeAttributeNS(i.space,i.local)}return ds(this,\"attr.\"+e,r,i.local?function(t){return null==t?o:(t+=\"\",function(){var e,r=this.getAttributeNS(i.space,i.local);return r!==t&&(e=n(r,t),function(t){this.setAttributeNS(i.space,i.local,e(t))})})}:function(t){return null==t?a:(t+=\"\",function(){var e,r=this.getAttribute(i);return r!==t&&(e=n(r,t),function(t){this.setAttribute(i,e(t))})})})},fs.attrTween=function(e,r){var n=t.ns.qualify(e);return this.tween(\"attr.\"+e,n.local?function(t,e){var i=r.call(this,t,e,this.getAttributeNS(n.space,n.local));return i&&function(t){this.setAttributeNS(n.space,n.local,i(t))}}:function(t,e){var i=r.call(this,t,e,this.getAttribute(n));return i&&function(t){this.setAttribute(n,i(t))}})},fs.style=function(t,e,r){var n=arguments.length;if(n<3){if(\"string\"!=typeof t){for(r in n<2&&(e=\"\"),t)this.style(r,t[r],e);return this}r=\"\"}function i(){this.style.removeProperty(t)}return ds(this,\"style.\"+t,e,function(e){return null==e?i:(e+=\"\",function(){var n,i=o(this).getComputedStyle(this,null).getPropertyValue(t);return i!==e&&(n=Gi(i,e),function(e){this.style.setProperty(t,n(e),r)})})})},fs.styleTween=function(t,e,r){return arguments.length<3&&(r=\"\"),this.tween(\"style.\"+t,function(n,i){var a=e.call(this,n,i,o(this).getComputedStyle(this,null).getPropertyValue(t));return a&&function(e){this.style.setProperty(t,a(e),r)}})},fs.text=function(t){return ds(this,\"text\",t,gs)},fs.remove=function(){var t=this.namespace;return this.each(\"end.transition\",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},fs.ease=function(e){var r=this.id,n=this.namespace;return arguments.length<1?this.node()[n][r].ease:(\"function\"!=typeof e&&(e=t.ease.apply(t,arguments)),ct(this,function(t){t[n][r].ease=e}))},fs.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:ct(this,\"function\"==typeof t?function(n,i,a){n[r][e].delay=+t.call(n,n.__data__,i,a)}:(t=+t,function(n){n[r][e].delay=t}))},fs.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:ct(this,\"function\"==typeof t?function(n,i,a){n[r][e].duration=Math.max(1,t.call(n,n.__data__,i,a))}:(t=Math.max(1,t),function(n){n[r][e].duration=t}))},fs.each=function(e,r){var n=this.id,i=this.namespace;if(arguments.length<2){var a=hs,o=cs;try{cs=n,ct(this,function(t,r,a){hs=t[i][n],e.call(t,t.__data__,r,a)})}finally{hs=a,cs=o}}else ct(this,function(a){var o=a[i][n];(o.event||(o.event=t.dispatch(\"start\",\"end\",\"interrupt\"))).on(e,r)});return this},fs.transition=function(){for(var t,e,r,n=this.id,i=++ps,a=this.namespace,o=[],s=0,l=this.length;s<l;s++){o.push(t=[]);for(var u,c=0,h=(u=this[s]).length;c<h;c++)(e=u[c])&&ms(e,c,a,i,{time:(r=e[a][n]).time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration}),t.push(e)}return us(o,a,i)},t.svg.axis=function(){var e,r=t.scale.linear(),i=ys,a=6,o=6,s=3,l=[10],u=null;function c(n){n.each(function(){var n,c=t.select(this),h=this.__chart__||r,f=this.__chart__=r.copy(),p=null==u?f.ticks?f.ticks.apply(f,l):f.domain():u,d=null==e?f.tickFormat?f.tickFormat.apply(f,l):z:e,g=c.selectAll(\".tick\").data(p,f),v=g.enter().insert(\"g\",\".domain\").attr(\"class\",\"tick\").style(\"opacity\",Mt),m=t.transition(g.exit()).style(\"opacity\",Mt).remove(),y=t.transition(g.order()).style(\"opacity\",1),x=Math.max(a,0)+s,b=oo(f),_=c.selectAll(\".domain\").data([0]),w=(_.enter().append(\"path\").attr(\"class\",\"domain\"),t.transition(_));v.append(\"line\"),v.append(\"text\");var M,A,k,T,S=v.select(\"line\"),E=y.select(\"line\"),C=g.select(\"text\").text(d),L=v.select(\"text\"),P=y.select(\"text\"),I=\"top\"===i||\"left\"===i?-1:1;if(\"bottom\"===i||\"top\"===i?(n=bs,M=\"x\",k=\"y\",A=\"x2\",T=\"y2\",C.attr(\"dy\",I<0?\"0em\":\".71em\").style(\"text-anchor\",\"middle\"),w.attr(\"d\",\"M\"+b[0]+\",\"+I*o+\"V0H\"+b[1]+\"V\"+I*o)):(n=_s,M=\"y\",k=\"x\",A=\"y2\",T=\"x2\",C.attr(\"dy\",\".32em\").style(\"text-anchor\",I<0?\"end\":\"start\"),w.attr(\"d\",\"M\"+I*o+\",\"+b[0]+\"H0V\"+b[1]+\"H\"+I*o)),S.attr(T,I*a),L.attr(k,I*x),E.attr(A,0).attr(T,I*a),P.attr(M,0).attr(k,I*x),f.rangeBand){var D=f,O=D.rangeBand()/2;h=f=function(t){return D(t)+O}}else h.rangeBand?h=f:m.call(n,f,h);v.call(n,h,f),y.call(n,f,f)})}return c.scale=function(t){return arguments.length?(r=t,c):r},c.orient=function(t){return arguments.length?(i=t in xs?t+\"\":ys,c):i},c.ticks=function(){return arguments.length?(l=n(arguments),c):l},c.tickValues=function(t){return arguments.length?(u=t,c):u},c.tickFormat=function(t){return arguments.length?(e=t,c):e},c.tickSize=function(t){var e=arguments.length;return e?(a=+t,o=+arguments[e-1],c):a},c.innerTickSize=function(t){return arguments.length?(a=+t,c):a},c.outerTickSize=function(t){return arguments.length?(o=+t,c):o},c.tickPadding=function(t){return arguments.length?(s=+t,c):s},c.tickSubdivide=function(){return arguments.length&&c},c};var ys=\"bottom\",xs={top:1,right:1,bottom:1,left:1};function bs(t,e,r){t.attr(\"transform\",function(t){var n=e(t);return\"translate(\"+(isFinite(n)?n:r(t))+\",0)\"})}function _s(t,e,r){t.attr(\"transform\",function(t){var n=e(t);return\"translate(0,\"+(isFinite(n)?n:r(t))+\")\"})}t.svg.brush=function(){var e,r,n=j(f,\"brushstart\",\"brush\",\"brushend\"),i=null,a=null,s=[0,0],l=[0,0],u=!0,c=!0,h=Ms[0];function f(e){e.each(function(){var e=t.select(this).style(\"pointer-events\",\"all\").style(\"-webkit-tap-highlight-color\",\"rgba(0,0,0,0)\").on(\"mousedown.brush\",v).on(\"touchstart.brush\",v),r=e.selectAll(\".background\").data([0]);r.enter().append(\"rect\").attr(\"class\",\"background\").style(\"visibility\",\"hidden\").style(\"cursor\",\"crosshair\"),e.selectAll(\".extent\").data([0]).enter().append(\"rect\").attr(\"class\",\"extent\").style(\"cursor\",\"move\");var n=e.selectAll(\".resize\").data(h,z);n.exit().remove(),n.enter().append(\"g\").attr(\"class\",function(t){return\"resize \"+t}).style(\"cursor\",function(t){return ws[t]}).append(\"rect\").attr(\"x\",function(t){return/[ew]$/.test(t)?-3:null}).attr(\"y\",function(t){return/^[ns]/.test(t)?-3:null}).attr(\"width\",6).attr(\"height\",6).style(\"visibility\",\"hidden\"),n.style(\"display\",f.empty()?\"none\":null);var o,s=t.transition(e),l=t.transition(r);i&&(o=oo(i),l.attr(\"x\",o[0]).attr(\"width\",o[1]-o[0]),d(s)),a&&(o=oo(a),l.attr(\"y\",o[0]).attr(\"height\",o[1]-o[0]),g(s)),p(s)})}function p(t){t.selectAll(\".resize\").attr(\"transform\",function(t){return\"translate(\"+s[+/e$/.test(t)]+\",\"+l[+/^s/.test(t)]+\")\"})}function d(t){t.select(\".extent\").attr(\"x\",s[0]),t.selectAll(\".extent,.n>rect,.s>rect\").attr(\"width\",s[1]-s[0])}function g(t){t.select(\".extent\").attr(\"y\",l[0]),t.selectAll(\".extent,.e>rect,.w>rect\").attr(\"height\",l[1]-l[0])}function v(){var h,v,m=this,y=t.select(t.event.target),x=n.of(m,arguments),b=t.select(m),_=y.datum(),w=!/^(n|s)$/.test(_)&&i,M=!/^(e|w)$/.test(_)&&a,A=y.classed(\"extent\"),k=xt(m),T=t.mouse(m),S=t.select(o(m)).on(\"keydown.brush\",function(){32==t.event.keyCode&&(A||(h=null,T[0]-=s[1],T[1]-=l[1],A=2),B())}).on(\"keyup.brush\",function(){32==t.event.keyCode&&2==A&&(T[0]+=s[1],T[1]+=l[1],A=0,B())});if(t.event.changedTouches?S.on(\"touchmove.brush\",L).on(\"touchend.brush\",P):S.on(\"mousemove.brush\",L).on(\"mouseup.brush\",P),b.interrupt().selectAll(\"*\").interrupt(),A)T[0]=s[0]-T[0],T[1]=l[0]-T[1];else if(_){var E=+/w$/.test(_),C=+/^n/.test(_);v=[s[1-E]-T[0],l[1-C]-T[1]],T[0]=s[E],T[1]=l[C]}else t.event.altKey&&(h=T.slice());function L(){var e=t.mouse(m),r=!1;v&&(e[0]+=v[0],e[1]+=v[1]),A||(t.event.altKey?(h||(h=[(s[0]+s[1])/2,(l[0]+l[1])/2]),T[0]=s[+(e[0]<h[0])],T[1]=l[+(e[1]<h[1])]):h=null),w&&z(e,i,0)&&(d(b),r=!0),M&&z(e,a,1)&&(g(b),r=!0),r&&(p(b),x({type:\"brush\",mode:A?\"move\":\"resize\"}))}function z(t,n,i){var a,o,f=oo(n),p=f[0],d=f[1],g=T[i],v=i?l:s,m=v[1]-v[0];if(A&&(p-=g,d-=m+g),a=(i?c:u)?Math.max(p,Math.min(d,t[i])):t[i],A?o=(a+=g)+m:(h&&(g=Math.max(p,Math.min(d,2*h[i]-a))),g<a?(o=a,a=g):o=g),v[0]!=a||v[1]!=o)return i?r=null:e=null,v[0]=a,v[1]=o,!0}function P(){L(),b.style(\"pointer-events\",\"all\").selectAll(\".resize\").style(\"display\",f.empty()?\"none\":null),t.select(\"body\").style(\"cursor\",null),S.on(\"mousemove.brush\",null).on(\"mouseup.brush\",null).on(\"touchmove.brush\",null).on(\"touchend.brush\",null).on(\"keydown.brush\",null).on(\"keyup.brush\",null),k(),x({type:\"brushend\"})}b.style(\"pointer-events\",\"none\").selectAll(\".resize\").style(\"display\",null),t.select(\"body\").style(\"cursor\",y.style(\"cursor\")),x({type:\"brushstart\"}),L()}return f.event=function(i){i.each(function(){var i=n.of(this,arguments),a={x:s,y:l,i:e,j:r},o=this.__chart__||a;this.__chart__=a,cs?t.select(this).transition().each(\"start.brush\",function(){e=o.i,r=o.j,s=o.x,l=o.y,i({type:\"brushstart\"})}).tween(\"brush:brush\",function(){var t=Wi(s,a.x),n=Wi(l,a.y);return e=r=null,function(e){s=a.x=t(e),l=a.y=n(e),i({type:\"brush\",mode:\"resize\"})}}).each(\"end.brush\",function(){e=a.i,r=a.j,i({type:\"brush\",mode:\"resize\"}),i({type:\"brushend\"})}):(i({type:\"brushstart\"}),i({type:\"brush\",mode:\"resize\"}),i({type:\"brushend\"}))})},f.x=function(t){return arguments.length?(h=Ms[!(i=t)<<1|!a],f):i},f.y=function(t){return arguments.length?(h=Ms[!i<<1|!(a=t)],f):a},f.clamp=function(t){return arguments.length?(i&&a?(u=!!t[0],c=!!t[1]):i?u=!!t:a&&(c=!!t),f):i&&a?[u,c]:i?u:a?c:null},f.extent=function(t){var n,o,u,c,h;return arguments.length?(i&&(n=t[0],o=t[1],a&&(n=n[0],o=o[0]),e=[n,o],i.invert&&(n=i(n),o=i(o)),o<n&&(h=n,n=o,o=h),n==s[0]&&o==s[1]||(s=[n,o])),a&&(u=t[0],c=t[1],i&&(u=u[1],c=c[1]),r=[u,c],a.invert&&(u=a(u),c=a(c)),c<u&&(h=u,u=c,c=h),u==l[0]&&c==l[1]||(l=[u,c])),f):(i&&(e?(n=e[0],o=e[1]):(n=s[0],o=s[1],i.invert&&(n=i.invert(n),o=i.invert(o)),o<n&&(h=n,n=o,o=h))),a&&(r?(u=r[0],c=r[1]):(u=l[0],c=l[1],a.invert&&(u=a.invert(u),c=a.invert(c)),c<u&&(h=u,u=c,c=h))),i&&a?[[n,u],[o,c]]:i?[n,o]:a&&[u,c])},f.clear=function(){return f.empty()||(s=[0,0],l=[0,0],e=r=null),f},f.empty=function(){return!!i&&s[0]==s[1]||!!a&&l[0]==l[1]},t.rebind(f,n,\"on\")};var ws={n:\"ns-resize\",e:\"ew-resize\",s:\"ns-resize\",w:\"ew-resize\",nw:\"nwse-resize\",ne:\"nesw-resize\",se:\"nwse-resize\",sw:\"nesw-resize\"},Ms=[[\"n\",\"e\",\"s\",\"w\",\"nw\",\"ne\",\"se\",\"sw\"],[\"e\",\"w\"],[\"n\",\"s\"],[]],As=Ie.format=sr.timeFormat,ks=As.utc,Ts=ks(\"%Y-%m-%dT%H:%M:%S.%LZ\");function Ss(t){return t.toISOString()}function Es(e,r,n){function i(t){return e(t)}function a(e,n){var i=(e[1]-e[0])/n,a=t.bisect(Ls,i);return a==Ls.length?[r.year,go(e.map(function(t){return t/31536e6}),n)[2]]:a?r[i/Ls[a-1]<Ls[a]/i?a-1:a]:[Is,go(e,n)[2]]}return i.invert=function(t){return Cs(e.invert(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain().map(Cs)},i.nice=function(t,e){var r=i.domain(),n=ao(r),o=null==t?a(n,10):\"number\"==typeof t&&a(n,t);function s(r){return!isNaN(r)&&!t.range(r,Cs(+r+1),e).length}return o&&(t=o[0],e=o[1]),i.domain(lo(r,e>1?{floor:function(e){for(;s(e=t.floor(e));)e=Cs(e-1);return e},ceil:function(e){for(;s(e=t.ceil(e));)e=Cs(+e+1);return e}}:t))},i.ticks=function(t,e){var r=ao(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],Cs(+r[1]+1),e<1?1:e)},i.tickFormat=function(){return n},i.copy=function(){return Es(e.copy(),r,n)},fo(i,e)}function Cs(t){return new Date(t)}As.iso=Date.prototype.toISOString&&+new Date(\"2000-01-01T00:00:00.000Z\")?Ss:Ts,Ss.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Ss.toString=Ts.toString,Ie.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()}),Ie.seconds=Ie.second.range,Ie.seconds.utc=Ie.second.utc.range,Ie.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()}),Ie.minutes=Ie.minute.range,Ie.minutes.utc=Ie.minute.utc.range,Ie.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()}),Ie.hours=Ie.hour.range,Ie.hours.utc=Ie.hour.utc.range,Ie.month=Fe(function(t){return(t=Ie.day(t)).setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),Ie.months=Ie.month.range,Ie.months.utc=Ie.month.utc.range;var Ls=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],zs=[[Ie.second,1],[Ie.second,5],[Ie.second,15],[Ie.second,30],[Ie.minute,1],[Ie.minute,5],[Ie.minute,15],[Ie.minute,30],[Ie.hour,1],[Ie.hour,3],[Ie.hour,6],[Ie.hour,12],[Ie.day,1],[Ie.day,2],[Ie.week,1],[Ie.month,1],[Ie.month,3],[Ie.year,1]],Ps=As.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]]),Is={range:function(e,r,n){return t.range(Math.ceil(e/n)*n,+r,n).map(Cs)},floor:z,ceil:z};zs.year=Ie.year,Ie.scale=function(){return Es(t.scale.linear(),zs,Ps)};var Ds=zs.map(function(t){return[t[0].utc,t[1]]}),Os=ks.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 Rs(t){return JSON.parse(t.responseText)}function Fs(t){var e=i.createRange();return e.selectNode(i.body),e.createContextualFragment(t.responseText)}Ds.year=Ie.year.utc,Ie.scale.utc=function(){return Es(t.scale.linear(),Ds,Os)},t.text=me(function(t){return t.responseText}),t.json=function(t,e){return ye(t,\"application/json\",Rs,e)},t.html=function(t,e){return ye(t,\"text/html\",Fs,e)},t.xml=me(function(t){return t.responseXML}),e.exports?e.exports=t:this.d3=t}(),e=e.exports;var r=function(t){var e=typeof t;if(\"string\"===e){var r=t;if(0===(t=+t)&&function(t){for(var e,r=t.length,n=0;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&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}(r))return!1}else if(\"number\"!==e)return!1;return t-t<1},n={},i=Math.PI;n.deg2rad=function(t){return t/180*i},n.rad2deg=function(t){return t/i*180},n.wrap360=function(t){var e=t%360;return e<0?e+360:e},n.wrap180=function(t){return Math.abs(t)>180&&(t-=360*Math.round(t/360)),t};var a=t.BADNUM,o=/^['\"%,$#\\s']+|[, ]|['\"%,$#\\s']+$/g,s={exports:{}};!function(t){var e=/^\\s+/,r=/\\s+$/,n=0,i=t.round,a=t.min,o=t.max,l=t.random;function u(s,l){if(s=s||\"\",l=l||{},s instanceof u)return s;if(!(this instanceof u))return new u(s,l);var c=function(n){var i={r:0,g:0,b:0},s=1,l=null,u=null,c=null,h=!1,f=!1;\"string\"==typeof n&&(n=function(t){t=t.replace(e,\"\").replace(r,\"\").toLowerCase();var n,i=!1;if(S[t])t=S[t],i=!0;else if(\"transparent\"==t)return{r:0,g:0,b:0,a:0,format:\"name\"};if(n=j.rgb.exec(t))return{r:n[1],g:n[2],b:n[3]};if(n=j.rgba.exec(t))return{r:n[1],g:n[2],b:n[3],a:n[4]};if(n=j.hsl.exec(t))return{h:n[1],s:n[2],l:n[3]};if(n=j.hsla.exec(t))return{h:n[1],s:n[2],l:n[3],a:n[4]};if(n=j.hsv.exec(t))return{h:n[1],s:n[2],v:n[3]};if(n=j.hsva.exec(t))return{h:n[1],s:n[2],v:n[3],a:n[4]};if(n=j.hex8.exec(t))return{r:P(n[1]),g:P(n[2]),b:P(n[3]),a:R(n[4]),format:i?\"name\":\"hex8\"};if(n=j.hex6.exec(t))return{r:P(n[1]),g:P(n[2]),b:P(n[3]),format:i?\"name\":\"hex\"};if(n=j.hex4.exec(t))return{r:P(n[1]+\"\"+n[1]),g:P(n[2]+\"\"+n[2]),b:P(n[3]+\"\"+n[3]),a:R(n[4]+\"\"+n[4]),format:i?\"name\":\"hex8\"};if(n=j.hex3.exec(t))return{r:P(n[1]+\"\"+n[1]),g:P(n[2]+\"\"+n[2]),b:P(n[3]+\"\"+n[3]),format:i?\"name\":\"hex\"};return!1}(n));\"object\"==typeof n&&(V(n.r)&&V(n.g)&&V(n.b)?(p=n.r,d=n.g,g=n.b,i={r:255*L(p,255),g:255*L(d,255),b:255*L(g,255)},h=!0,f=\"%\"===String(n.r).substr(-1)?\"prgb\":\"rgb\"):V(n.h)&&V(n.s)&&V(n.v)?(l=D(n.s),u=D(n.v),i=function(e,r,n){e=6*L(e,360),r=L(r,100),n=L(n,100);var i=t.floor(e),a=e-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),u=i%6;return{r:255*[n,s,o,o,l,n][u],g:255*[l,n,n,s,o,o][u],b:255*[o,o,l,n,n,s][u]}}(n.h,l,u),h=!0,f=\"hsv\"):V(n.h)&&V(n.s)&&V(n.l)&&(l=D(n.s),c=D(n.l),i=function(t,e,r){var n,i,a;function o(t,e,r){return r<0&&(r+=1),r>1&&(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}}(n.h,l,c),h=!0,f=\"hsl\"),n.hasOwnProperty(\"a\")&&(s=n.a));var p,d,g;return s=C(s),{ok:h,format:n.format||f,r:a(255,o(i.r,0)),g:a(255,o(i.g,0)),b:a(255,o(i.b,0)),a:s}}(s);this._originalInput=s,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=i(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=c.ok,this._tc_id=n++}function c(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,i,s=o(t,e,r),l=a(t,e,r),u=(s+l)/2;if(s==l)n=i=0;else{var c=s-l;switch(i=u>.5?c/(2-s-l):c/(s+l),s){case t:n=(e-r)/c+(e<r?6:0);break;case e:n=(r-t)/c+2;break;case r:n=(t-e)/c+4}n/=6}return{h:n,s:i,l:u}}function h(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,i,s=o(t,e,r),l=a(t,e,r),u=s,c=s-l;if(i=0===s?0:c/s,s==l)n=0;else{switch(s){case t:n=(e-r)/c+(e<r?6:0);break;case e:n=(r-t)/c+2;break;case r:n=(t-e)/c+4}n/=6}return{h:n,s:i,v:u}}function f(t,e,r,n){var a=[I(i(t).toString(16)),I(i(e).toString(16)),I(i(r).toString(16))];return n&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join(\"\")}function p(t,e,r,n){return[I(O(n)),I(i(t).toString(16)),I(i(e).toString(16)),I(i(r).toString(16))].join(\"\")}function d(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.s-=e/100,r.s=z(r.s),u(r)}function g(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.s+=e/100,r.s=z(r.s),u(r)}function v(t){return u(t).desaturate(100)}function m(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.l+=e/100,r.l=z(r.l),u(r)}function y(t,e){e=0===e?0:e||10;var r=u(t).toRgb();return r.r=o(0,a(255,r.r-i(-e/100*255))),r.g=o(0,a(255,r.g-i(-e/100*255))),r.b=o(0,a(255,r.b-i(-e/100*255))),u(r)}function x(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.l-=e/100,r.l=z(r.l),u(r)}function b(t,e){var r=u(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,u(r)}function _(t){var e=u(t).toHsl();return e.h=(e.h+180)%360,u(e)}function w(t){var e=u(t).toHsl(),r=e.h;return[u(t),u({h:(r+120)%360,s:e.s,l:e.l}),u({h:(r+240)%360,s:e.s,l:e.l})]}function M(t){var e=u(t).toHsl(),r=e.h;return[u(t),u({h:(r+90)%360,s:e.s,l:e.l}),u({h:(r+180)%360,s:e.s,l:e.l}),u({h:(r+270)%360,s:e.s,l:e.l})]}function A(t){var e=u(t).toHsl(),r=e.h;return[u(t),u({h:(r+72)%360,s:e.s,l:e.l}),u({h:(r+216)%360,s:e.s,l:e.l})]}function k(t,e,r){e=e||6,r=r||30;var n=u(t).toHsl(),i=360/r,a=[u(t)];for(n.h=(n.h-(i*e>>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(u(n));return a}function T(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=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=C(t),this._roundA=i(100*this._a)/100,this},toHsv:function(){var t=h(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=h(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(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=i(360*t.h),r=i(100*t.s),n=i(100*t.l);return 1==this._a?\"hsl(\"+e+\", \"+r+\"%, \"+n+\"%)\":\"hsla(\"+e+\", \"+r+\"%, \"+n+\"%, \"+this._roundA+\")\"},toHex:function(t){return f(this._r,this._g,this._b,t)},toHexString:function(t){return\"#\"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,a){var o=[I(i(t).toString(16)),I(i(e).toString(16)),I(i(r).toString(16)),I(O(n))];if(a&&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))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join(\"\")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return\"#\"+this.toHex8(t)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?\"rgb(\"+i(this._r)+\", \"+i(this._g)+\", \"+i(this._b)+\")\":\"rgba(\"+i(this._r)+\", \"+i(this._g)+\", \"+i(this._b)+\", \"+this._roundA+\")\"},toPercentageRgb:function(){return{r:i(100*L(this._r,255))+\"%\",g:i(100*L(this._g,255))+\"%\",b:i(100*L(this._b,255))+\"%\",a:this._a}},toPercentageRgbString:function(){return 1==this._a?\"rgb(\"+i(100*L(this._r,255))+\"%, \"+i(100*L(this._g,255))+\"%, \"+i(100*L(this._b,255))+\"%)\":\"rgba(\"+i(100*L(this._r,255))+\"%, \"+i(100*L(this._g,255))+\"%, \"+i(100*L(this._b,255))+\"%, \"+this._roundA+\")\"},toName:function(){return 0===this._a?\"transparent\":!(this._a<1)&&(E[f(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;return e||!n||\"hex\"!==t&&\"hex6\"!==t&&\"hex3\"!==t&&\"hex4\"!==t&&\"hex8\"!==t&&\"name\"!==t?(\"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()):\"name\"===t&&0===this._a?this.toName():this.toRgbString()},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(g,arguments)},greyscale:function(){return this._applyModification(v,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(k,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(T,arguments)},splitcomplement:function(){return this._applyCombination(A,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(M,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;return u({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})},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=u.readability(t,e);switch(i=!1,(n=function(t){var e,r;e=((t=t||{level:\"AA\",size:\"small\"}).level||\"AA\").toUpperCase(),r=(t.size||\"small\").toLowerCase(),\"AA\"!==e&&\"AAA\"!==e&&(e=\"AA\");\"small\"!==r&&\"large\"!==r&&(r=\"small\");return{level:e,size:r}}(r)).level+n.size){case\"AAsmall\":case\"AAAlarge\":i=a>=4.5;break;case\"AAlarge\":i=a>=3;break;case\"AAAsmall\":i=a>=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;c<e.length;c++)(n=u.readability(t,e[c]))>l&&(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 S=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\"},E=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);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=a(r,o(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function z(t){return a(1,o(0,t))}function P(t){return parseInt(t,16)}function I(t){return 1==t.length?\"0\"+t:\"\"+t}function D(t){return t<=1&&(t=100*t+\"%\"),t}function O(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return P(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)}s.exports?s.exports=u:window.tinycolor=u}(Math),s=s.exports;var l={Greys:[[0,\"rgb(0,0,0)\"],[1,\"rgb(255,255,255)\"]],YlGnBu:[[0,\"rgb(8,29,88)\"],[.125,\"rgb(37,52,148)\"],[.25,\"rgb(34,94,168)\"],[.375,\"rgb(29,145,192)\"],[.5,\"rgb(65,182,196)\"],[.625,\"rgb(127,205,187)\"],[.75,\"rgb(199,233,180)\"],[.875,\"rgb(237,248,217)\"],[1,\"rgb(255,255,217)\"]],Greens:[[0,\"rgb(0,68,27)\"],[.125,\"rgb(0,109,44)\"],[.25,\"rgb(35,139,69)\"],[.375,\"rgb(65,171,93)\"],[.5,\"rgb(116,196,118)\"],[.625,\"rgb(161,217,155)\"],[.75,\"rgb(199,233,192)\"],[.875,\"rgb(229,245,224)\"],[1,\"rgb(247,252,245)\"]],YlOrRd:[[0,\"rgb(128,0,38)\"],[.125,\"rgb(189,0,38)\"],[.25,\"rgb(227,26,28)\"],[.375,\"rgb(252,78,42)\"],[.5,\"rgb(253,141,60)\"],[.625,\"rgb(254,178,76)\"],[.75,\"rgb(254,217,118)\"],[.875,\"rgb(255,237,160)\"],[1,\"rgb(255,255,204)\"]],Bluered:[[0,\"rgb(0,0,255)\"],[1,\"rgb(255,0,0)\"]],RdBu:[[0,\"rgb(5,10,172)\"],[.35,\"rgb(106,137,247)\"],[.5,\"rgb(190,190,190)\"],[.6,\"rgb(220,170,132)\"],[.7,\"rgb(230,145,90)\"],[1,\"rgb(178,10,28)\"]],Reds:[[0,\"rgb(220,220,220)\"],[.2,\"rgb(245,195,157)\"],[.4,\"rgb(245,160,105)\"],[1,\"rgb(178,10,28)\"]],Blues:[[0,\"rgb(5,10,172)\"],[.35,\"rgb(40,60,190)\"],[.5,\"rgb(70,100,245)\"],[.6,\"rgb(90,120,245)\"],[.7,\"rgb(106,137,247)\"],[1,\"rgb(220,220,220)\"]],Picnic:[[0,\"rgb(0,0,255)\"],[.1,\"rgb(51,153,255)\"],[.2,\"rgb(102,204,255)\"],[.3,\"rgb(153,204,255)\"],[.4,\"rgb(204,204,255)\"],[.5,\"rgb(255,255,255)\"],[.6,\"rgb(255,204,255)\"],[.7,\"rgb(255,153,255)\"],[.8,\"rgb(255,102,204)\"],[.9,\"rgb(255,102,102)\"],[1,\"rgb(255,0,0)\"]],Rainbow:[[0,\"rgb(150,0,90)\"],[.125,\"rgb(0,0,200)\"],[.25,\"rgb(0,25,255)\"],[.375,\"rgb(0,152,255)\"],[.5,\"rgb(44,255,150)\"],[.625,\"rgb(151,255,0)\"],[.75,\"rgb(255,234,0)\"],[.875,\"rgb(255,111,0)\"],[1,\"rgb(255,0,0)\"]],Portland:[[0,\"rgb(12,51,131)\"],[.25,\"rgb(10,136,186)\"],[.5,\"rgb(242,211,56)\"],[.75,\"rgb(242,143,56)\"],[1,\"rgb(217,30,30)\"]],Jet:[[0,\"rgb(0,0,131)\"],[.125,\"rgb(0,60,170)\"],[.375,\"rgb(5,255,255)\"],[.625,\"rgb(255,255,0)\"],[.875,\"rgb(250,0,0)\"],[1,\"rgb(128,0,0)\"]],Hot:[[0,\"rgb(0,0,0)\"],[.3,\"rgb(230,0,0)\"],[.6,\"rgb(255,210,0)\"],[1,\"rgb(255,255,255)\"]],Blackbody:[[0,\"rgb(0,0,0)\"],[.2,\"rgb(230,0,0)\"],[.4,\"rgb(230,210,0)\"],[.7,\"rgb(255,255,255)\"],[1,\"rgb(160,200,255)\"]],Earth:[[0,\"rgb(0,0,130)\"],[.1,\"rgb(0,180,180)\"],[.2,\"rgb(40,210,40)\"],[.4,\"rgb(230,230,50)\"],[.6,\"rgb(120,70,20)\"],[1,\"rgb(255,255,255)\"]],Electric:[[0,\"rgb(0,0,0)\"],[.15,\"rgb(30,0,100)\"],[.4,\"rgb(120,0,100)\"],[.6,\"rgb(160,90,0)\"],[.8,\"rgb(230,200,0)\"],[1,\"rgb(255,250,220)\"]],Viridis:[[0,\"#440154\"],[.06274509803921569,\"#48186a\"],[.12549019607843137,\"#472d7b\"],[.18823529411764706,\"#424086\"],[.25098039215686274,\"#3b528b\"],[.3137254901960784,\"#33638d\"],[.3764705882352941,\"#2c728e\"],[.4392156862745098,\"#26828e\"],[.5019607843137255,\"#21918c\"],[.5647058823529412,\"#1fa088\"],[.6274509803921569,\"#28ae80\"],[.6901960784313725,\"#3fbc73\"],[.7529411764705882,\"#5ec962\"],[.8156862745098039,\"#84d44b\"],[.8784313725490196,\"#addc30\"],[.9411764705882353,\"#d8e219\"],[1,\"#fde725\"]],Cividis:[[0,\"rgb(0,32,76)\"],[.058824,\"rgb(0,42,102)\"],[.117647,\"rgb(0,52,110)\"],[.176471,\"rgb(39,63,108)\"],[.235294,\"rgb(60,74,107)\"],[.294118,\"rgb(76,85,107)\"],[.352941,\"rgb(91,95,109)\"],[.411765,\"rgb(104,106,112)\"],[.470588,\"rgb(117,117,117)\"],[.529412,\"rgb(131,129,120)\"],[.588235,\"rgb(146,140,120)\"],[.647059,\"rgb(161,152,118)\"],[.705882,\"rgb(176,165,114)\"],[.764706,\"rgb(192,177,109)\"],[.823529,\"rgb(209,191,102)\"],[.882353,\"rgb(225,204,92)\"],[.941176,\"rgb(243,219,79)\"],[1,\"rgb(255,233,69)\"]]},u=l.RdBu,c=function(t){var e=0;if(!Array.isArray(t)||t.length<2)return!1;if(!t[0]||!t[t.length-1])return!1;if(0!=+t[0][0]||1!=+t[t.length-1][0])return!1;for(var r=0;r<t.length;r++){var n=t[r];if(2!==n.length||+n[0]<e||!s(n[1]).isValid())return!1;e=+n[0]}return!0},h=function(t,e){if(e||(e=u),!t)return e;function r(){try{t=l[t]||JSON.parse(t)}catch(r){t=e}}return\"string\"==typeof t&&(r(),\"string\"==typeof t&&r()),c(t)?t:e},f={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2},p={},d=\"undefined\"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},g=\"undefined\"==typeof DataView?function(){}:DataView;p.isTypedArray=function(t){return d.isView(t)&&!(t instanceof g)},p.isArrayOrTypedArray=function(t){return Array.isArray(t)||p.isTypedArray(t)};var v=function(t){return window&&window.process&&window.process.versions?\"[object Object]\"===Object.prototype.toString.call(t):\"[object Object]\"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype},m={},y=Array.isArray;function x(t,e,r,n){var i,a,o,s,l,u,c=t[0],h=t.length;if(2===h&&y(c)&&y(t[1])&&0===c.length){if(function(t,e){var r,n;for(r=0;r<t.length;r++){if(null!==(n=t[r])&&\"object\"==typeof n)return!1;void 0!==n&&(e[r]=n)}return!0}(t[1],c))return c;c.splice(0,c.length)}for(var f=1;f<h;f++)for(a in i=t[f])o=c[a],s=i[a],n&&y(s)?c[a]=s:e&&s&&(v(s)||(l=y(s)))?(l?(l=!1,u=o&&y(o)?o:[]):u=o&&v(o)?o:{},c[a]=x([u,s],e,r,n)):(void 0!==s||r)&&(c[a]=s);return c}m.extendFlat=function(){return x(arguments,!1,!1,!1)},m.extendDeep=function(){return x(arguments,!0,!1,!1)},m.extendDeepAll=function(){return x(arguments,!0,!0,!1)},m.extendDeepNoArrays=function(){return x(arguments,!0,!1,!0)};var b={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:\"reset+autosize\",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:\"Edit chart\",showSources:!1,displayModeBar:\"hover\",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:\"transparent\",topojsonURL:\"https://cdn.plot.ly/\",mapboxAccessToken:null,logging:1,globalTransforms:[],locale:\"en-US\",locales:{}},_={},w=_={};function M(t,e){if(t.apply)t.apply(t,e);else for(var r=0;r<e.length;r++)t(e[r])}w.log=function(){if(b.logging>1){for(var t=[\"LOG:\"],e=0;e<arguments.length;e++)t.push(arguments[e]);M(console.trace||console.log,t)}},w.warn=function(){if(b.logging>0){for(var t=[\"WARN:\"],e=0;e<arguments.length;e++)t.push(arguments[e]);M(console.trace||console.log,t)}},w.error=function(){if(b.logging>0){for(var t=[\"ERROR:\"],e=0;e<arguments.length;e++)t.push(arguments[e]);M(console.error,t)}};var A=function(){},k=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;r<t.length;r++)if(t[r]instanceof RegExp&&t[r].toString()===n)return t;t.push(e)}else!e&&0!==e||-1!==t.indexOf(e)||t.push(e);return t},T=function(t){var e=t.editType,r=t.colorEditType;void 0===r&&(r=e);var n={family:{valType:\"string\",noBlank:!0,strict:!0,editType:e},size:{valType:\"number\",min:1,editType:e},color:{valType:\"color\",editType:r},editType:e};return t.arrayOk&&(n.family.arrayOk=!0,n.size.arrayOk=!0,n.color.arrayOk=!0),n},S={hoverlabel:{bgcolor:{valType:\"color\",arrayOk:!0,editType:\"none\"},bordercolor:{valType:\"color\",arrayOk:!0,editType:\"none\"},font:T({arrayOk:!0,editType:\"none\"}),namelength:{valType:\"integer\",min:-1,arrayOk:!0,editType:\"none\"},editType:\"calc\"}},E={type:{valType:\"enumerated\",values:[],dflt:\"scatter\",editType:\"calc+clearAxisTypes\"},visible:{valType:\"enumerated\",values:[!0,!1,\"legendonly\"],dflt:!0,editType:\"calc\"},showlegend:{valType:\"boolean\",dflt:!0,editType:\"style\"},legendgroup:{valType:\"string\",dflt:\"\",editType:\"style\"},opacity:{valType:\"number\",min:0,max:1,dflt:1,editType:\"style\"},name:{valType:\"string\",editType:\"style\"},uid:{valType:\"string\",dflt:\"\",editType:\"calc\"},ids:{valType:\"data_array\",editType:\"calc\"},customdata:{valType:\"data_array\",editType:\"calc\"},selectedpoints:{valType:\"any\",editType:\"calc\"},hoverinfo:{valType:\"flaglist\",flags:[\"x\",\"y\",\"z\",\"text\",\"name\"],extras:[\"all\",\"none\",\"skip\"],arrayOk:!0,dflt:\"all\",editType:\"none\"},hoverlabel:S.hoverlabel,stream:{token:{valType:\"string\",noBlank:!0,strict:!0,editType:\"calc\"},maxpoints:{valType:\"number\",min:0,max:1e4,dflt:500,editType:\"calc\"},editType:\"calc\"}},C={defaults:[\"#1f77b4\",\"#ff7f0e\",\"#2ca02c\",\"#d62728\",\"#9467bd\",\"#8c564b\",\"#e377c2\",\"#7f7f7f\",\"#bcbd22\",\"#17becf\"],defaultLine:\"#444\",lightLine:\"#eee\",background:\"#fff\",borderLine:\"#BEC8D9\",lightFraction:1e3/11},L=T({editType:\"calc\"});L.family.dflt='\"Open Sans\", verdana, arial, sans-serif',L.size.dflt=12,L.color.dflt=C.defaultLine;var z={font:L,title:{valType:\"string\",editType:\"layoutstyle\"},titlefont:T({editType:\"layoutstyle\"}),autosize:{valType:\"boolean\",dflt:!1,editType:\"none\"},width:{valType:\"number\",min:10,dflt:700,editType:\"plot\"},height:{valType:\"number\",min:10,dflt:450,editType:\"plot\"},margin:{l:{valType:\"number\",min:0,dflt:80,editType:\"plot\"},r:{valType:\"number\",min:0,dflt:80,editType:\"plot\"},t:{valType:\"number\",min:0,dflt:100,editType:\"plot\"},b:{valType:\"number\",min:0,dflt:80,editType:\"plot\"},pad:{valType:\"number\",min:0,dflt:0,editType:\"plot\"},autoexpand:{valType:\"boolean\",dflt:!0,editType:\"plot\"},editType:\"plot\"},paper_bgcolor:{valType:\"color\",dflt:C.background,editType:\"plot\"},plot_bgcolor:{valType:\"color\",dflt:C.background,editType:\"layoutstyle\"},separators:{valType:\"string\",editType:\"plot\"},hidesources:{valType:\"boolean\",dflt:!1,editType:\"plot\"},showlegend:{valType:\"boolean\",editType:\"legend\"},colorway:{valType:\"colorlist\",dflt:C.defaults,editType:\"calc\"},datarevision:{valType:\"any\",editType:\"calc\"}},P={},I=m.extendFlat,D=m.extendDeepAll;function O(t){var e=t.name,r=t.categories,n=t.meta;if(P.modules[e])_.log(\"Type \"+e+\" already registered\");else{P.subplotsRegistry[t.basePlotModule.name]||function(t){var e=t.name;if(P.subplotsRegistry[e])return void _.log(\"Plot type \"+e+\" already registered.\");for(var r in N(t),P.subplotsRegistry[e]=t,P.componentsRegistry)U(r,t.name)}(t.basePlotModule);for(var i={},a=0;a<r.length;a++)i[r[a]]=!0,P.allCategories[r[a]]=!0;for(var o in P.modules[e]={_module:t,categories:i},n&&Object.keys(n).length&&(P.modules[e].meta=n),P.allTypes.push(e),P.componentsRegistry)j(o,e);t.layoutAttributes&&I(P.traceLayoutAttributes,t.layoutAttributes)}}function R(t){if(\"string\"!=typeof t.name)throw new Error(\"Component module *name* must be a string.\");var e=t.name;for(var r in P.componentsRegistry[e]=t,t.layoutAttributes&&(t.layoutAttributes._isLinkedToArray&&k(P.layoutArrayContainers,e),N(t)),P.modules)j(e,r);for(var n in P.subplotsRegistry)U(e,n);for(var i in P.transformsRegistry)V(e,i);t.schema&&t.schema.layout&&D(z,t.schema.layout)}function F(t){if(\"string\"!=typeof t.name)throw new Error(\"Transform module *name* must be a string.\");var e=\"Transform module \"+t.name,r=\"function\"==typeof t.transform,n=\"function\"==typeof t.calcTransform;if(!r&&!n)throw new Error(e+\" is missing a *transform* or *calcTransform* method.\");for(var i in r&&n&&_.log([e+\" has both a *transform* and *calcTransform* methods.\",\"Please note that all *transform* methods are executed\",\"before all *calcTransform* methods.\"].join(\" \")),v(t.attributes)||_.log(e+\" registered without an *attributes* object.\"),\"function\"!=typeof t.supplyDefaults&&_.log(e+\" registered without a *supplyDefaults* method.\"),P.transformsRegistry[t.name]=t,P.componentsRegistry)V(i,t.name)}function B(t){var e=t.name,r=e.split(\"-\")[0],n=t.dictionary,i=t.format,a=n&&Object.keys(n).length,o=i&&Object.keys(i).length,s=P.localeRegistry,l=s[e];if(l||(s[e]=l={}),r!==e){var u=s[r];u||(s[r]=u={}),a&&u.dictionary===l.dictionary&&(u.dictionary=n),o&&u.format===l.format&&(u.format=i)}a&&(l.dictionary=n),o&&(l.format=i)}function N(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var r=0;r<e.length;r++)k(P.layoutArrayRegexes,e[r])}}function j(t,e){var r=P.componentsRegistry[t].schema;if(r&&r.traces){var n=r.traces[e];n&&D(P.modules[e]._module.attributes,n)}}function V(t,e){var r=P.componentsRegistry[t].schema;if(r&&r.transforms){var n=r.transforms[e];n&&D(P.transformsRegistry[e].attributes,n)}}function U(t,e){var r=P.componentsRegistry[t].schema;if(r&&r.subplots){var n=P.subplotsRegistry[e],i=n.layoutAttributes,a=\"subplot\"===n.attr?n.name:n.attr;Array.isArray(a)&&(a=a[0]);var o=r.subplots[a];i&&o&&D(i,o)}}function q(t){return\"object\"==typeof t&&(t=t.type),t}P.modules={},P.allCategories={},P.allTypes=[],P.subplotsRegistry={},P.transformsRegistry={},P.componentsRegistry={},P.layoutArrayContainers=[],P.layoutArrayRegexes=[],P.traceLayoutAttributes={},P.localeRegistry={},P.apiMethodRegistry={},P.register=function(t){if(!t)throw new Error(\"No argument passed to Plotly.register.\");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e<t.length;e++){var r=t[e];if(!r)throw new Error(\"Invalid module was attempted to be registered!\");switch(r.moduleType){case\"trace\":O(r);break;case\"transform\":F(r);break;case\"component\":R(r);break;case\"locale\":B(r);break;case\"apiMethod\":var n=r.name;P.apiMethodRegistry[n]=r.fn;break;default:throw new Error(\"Invalid module was attempted to be registered!\")}}},P.getModule=function(t){var e=P.modules[q(t)];return!!e&&e._module},P.traceIs=function(t,e){if(\"various\"===(t=q(t)))return!1;var r=P.modules[t];return r||(t&&\"area\"!==t&&_.log(\"Unrecognized trace type \"+t+\".\"),r=P.modules[E.type.dflt]),!!r.categories[e]},P.getTransformIndices=function(t,e){for(var r=[],n=t.transforms||[],i=0;i<n.length;i++)n[i].type===e&&r.push(i);return r},P.hasTransform=function(t,e){for(var r=t.transforms||[],n=0;n<r.length;n++)if(r[n].type===e)return!0;return!1},P.getComponentMethod=function(t,e){var r=P.componentsRegistry[t];return r&&r[e]||A},P.call=function(){var t=arguments[0],e=[].slice.call(arguments,1);return P.apiMethodRegistry[t].apply(null,e)};var H=function(t){for(var e,r,n=P.layoutArrayContainers,i=P.layoutArrayRegexes,a=t.split(\"[\")[0],o=0;o<i.length;o++)if((r=t.match(i[o]))&&0===r.index){e=r[0];break}if(e||(e=n[n.indexOf(a)]),!e)return!1;var s=t.substr(e.length);return s?!!(r=s.match(/^\\[(0|[1-9][0-9]*)\\](\\.(.+))?$/))&&{array:e,index:Number(r[1]),property:r[3]||\"\"}:{array:e,index:\"\",property:\"\"}},G=p.isArrayOrTypedArray,W=function(t,e){if(r(e))e=String(e);else if(\"string\"!=typeof e||\"[-1]\"===e.substr(e.length-4))throw\"bad property string\";for(var n,i,a,o=0,s=e.split(\".\");o<s.length;){if(n=String(s[o]).match(/^([^\\[\\]]*)((\\[\\-?[0-9]*\\])+)$/)){if(n[1])s[o]=n[1];else{if(0!==o)throw\"bad property string\";s.splice(0,1)}for(i=n[2].substr(1,n[2].length-2).split(\"][\"),a=0;a<i.length;a++)o++,s.splice(o,0,Number(i[a]))}o++}return\"object\"!=typeof t?function(t,e,r){return{set:function(){throw\"bad container\"},get:function(){},astr:e,parts:r,obj:t}}(t,e,s):{set:J(t,s,e),get:function t(e,r){return function(){var n,i,a,o,s,l=e;for(o=0;o<r.length-1;o++){if(-1===(n=r[o])){for(i=!0,a=[],s=0;s<l.length;s++)a[s]=t(l[s],r.slice(o+1))(),a[s]!==a[0]&&(i=!1);return i?a[0]:a}if(\"number\"==typeof n&&!G(l))return;if(\"object\"!=typeof(l=l[n])||null===l)return}if(\"object\"==typeof l&&null!==l&&null!==(a=l[r[o]]))return a}}(t,s),astr:e,parts:s,obj:t}};var Y=/(^|\\.)((domain|range)(\\.[xy])?|args|parallels)$/,X=/(^|\\.)args\\[/;function Z(t,e){if(void 0!==(r=t)&&null!==r&&(\"object\"!=typeof r||(G(r)?r.length:Object.keys(r).length))||v(t)&&\"]\"===e.charAt(e.length-1)||e.match(X)&&void 0!==t)return!1;var r;if(!G(t))return!0;if(e.match(Y))return!0;var n=H(e);return n&&\"\"===n.index}function J(t,e,r){return function(n){var i,a,o=t,s=\"\",l=[[t,s]],u=Z(n,r);for(a=0;a<e.length-1;a++){if(\"number\"==typeof(i=e[a])&&!G(o))throw\"array index but container is not an array\";if(-1===i){if(u=!Q(o,e.slice(a+1),n,r))break;return}if(!$(o,i,e[a+1],u))break;if(\"object\"!=typeof(o=o[i])||null===o)throw\"container is not an object\";s=K(s,i),l.push([o,s])}u?(a===e.length-1&&delete o[e[a]],function(t){var e,r,n,i,a,o;for(e=t.length-1;e>=0;e--){if(n=t[e][0],i=t[e][1],o=!1,G(n))for(r=n.length-1;r>=0;r--)Z(n[r],K(i,r))?o?n[r]=void 0:n.pop():o=!0;else if(\"object\"==typeof n&&null!==n)for(a=Object.keys(n),o=!1,r=a.length-1;r>=0;r--)Z(n[a[r]],K(i,a[r]))?delete n[a[r]]:o=!0;if(o)return}}(l)):o[e[a]]=n}}function K(t,e){var n=e;return r(e)?n=\"[\"+e+\"]\":t&&(n=\".\"+e),t+n}function Q(t,e,r,n){var i,a=G(r),o=!0,s=r,l=n.replace(\"-1\",0),u=!a&&Z(r,l),c=e[0];for(i=0;i<t.length;i++)l=n.replace(\"-1\",i),a&&(u=Z(s=r[i%r.length],l)),u&&(o=!1),$(t,i,c,u)&&J(t[i],e,n.replace(\"-1\",i))(s);return o}function $(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]=\"number\"==typeof r?[]:{}}return!0}var tt={counter:function(t,e,r){var n=(e||\"\")+(r?\"\":\"$\");return\"xy\"===t?new RegExp(\"^x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?\"+n):new RegExp(\"^\"+t+\"([2-9]|[1-9][0-9]+)?\"+n)}},et={},rt=(Object.keys(l),tt.counter),nt=f.DESELECTDIM,it=n.wrap180,at=p.isArrayOrTypedArray;et.valObjectMeta={data_array:{coerceFunction:function(t,e,r){at(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;n<r.length;n++){var i=String(r[n]);if(\"/\"===i.charAt(0)&&\"/\"===i.charAt(i.length-1)){if(new RegExp(i.substr(1,i.length-2)).test(t))return!0}else if(t===r[n])return!0}return!1}},boolean:{coerceFunction:function(t,e,r){!0===t||!1===t?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,n,i){!r(t)||void 0!==i.min&&t<i.min||void 0!==i.max&&t>i.max?e.set(n):e.set(+t)}},integer:{coerceFunction:function(t,e,n,i){t%1||!r(t)||void 0!==i.min&&t<i.min||void 0!==i.max&&t>i.max?e.set(n):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){s(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every(function(t){return s(t).isValid()})?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(h(t,r))}},angle:{coerceFunction:function(t,e,n){\"auto\"===t?e.set(\"auto\"):r(t)?e.set(it(+t)):e.set(n)}},subplotid:{coerceFunction:function(t,e,r){\"string\"==typeof t&&rt(r).test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||\"string\"==typeof t&&!!rt(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<i.length;){var o=i[a];-1===n.flags.indexOf(o)||i.indexOf(o)<a?i.splice(a,1):a++}i.length?e.set(i.join(\"+\")):e.set(r)}else e.set(t);else e.set(r)}},any:{coerceFunction:function(t,e,r){void 0===t?e.set(r):e.set(t)}},info_array:{coerceFunction:function(t,e,r,n){function i(t,e,r){var n,i={set:function(t){n=t}};return void 0===r&&(r=e.dflt),et.valObjectMeta[e.valType].coerceFunction(t,i,r,e),n}var a=2===n.dimensions;if(Array.isArray(t)){var o,s,l,u,c=n.items,h=[],f=Array.isArray(c),p=f?c.length:t.length;if(r=Array.isArray(r)?r:[],a)for(o=0;o<p;o++){h[o]=[];var d=Array.isArray(t[o])?t[o]:[];for(l=f?c[o].length:d.length,s=0;s<l;s++)void 0!==(u=i(d[s],f?c[o][s]:c,(r[o]||[])[s]))&&(h[o][s]=u)}else for(o=0;o<p;o++)void 0!==(u=i(t[o],f?c[o]:c,r[o]))&&(h[o]=u);e.set(h)}else e.set(r)},validateFunction:function(t,e){if(!Array.isArray(t))return!1;var r=e.items,n=Array.isArray(r),i=2===e.dimensions;if(!e.freeLength&&t.length!==r.length)return!1;for(var a=0;a<t.length;a++)if(i){if(!Array.isArray(t[a])||!e.freeLength&&t[a].length!==r[a].length)return!1;for(var o=0;o<t[a].length;o++)if(!et.validate(t[a][o],n?r[a][o]:r))return!1}else if(!et.validate(t[a],n?r[a]:r))return!1;return!0}}},et.coerce=function(t,e,r,n,i){var a=W(r,n).get(),o=W(t,n),s=W(e,n),l=o.get();return void 0===i&&(i=a.dflt),a.arrayOk&&at(l)?(s.set(l),l):(et.valObjectMeta[a.valType].coerceFunction(l,s,i,a),s.get())},et.coerce2=function(t,e,r,n,i){var a=W(t,n),o=et.coerce(t,e,r,n,i),s=a.get();return void 0!==s&&null!==s&&o},et.coerceFont=function(t,e,r){var n={};return r=r||{},n.family=t(e+\".family\",r.family),n.size=t(e+\".size\",r.size),n.color=t(e+\".color\",r.color),n},et.coerceHoverinfo=function(t,e,r){var n,i=e._module.attributes,a=i.hoverinfo?{hoverinfo:i.hoverinfo}:E,o=a.hoverinfo;if(1===r._dataLength){var s=\"all\"===o.dflt?o.flags.slice():o.dflt.split(\"+\");s.splice(s.indexOf(\"name\"),1),n=s.join(\"+\")}return et.coerce(t,e,a,\"hoverinfo\",n)},et.coerceSelectionMarkerOpacity=function(t,e){if(t.marker){var r,n,i=t.marker.opacity;if(void 0!==i)at(i)||t.selected||t.unselected||(r=i,n=nt*i),e(\"selected.marker.opacity\",r),e(\"unselected.marker.opacity\",n)}},et.validate=function(t,e){var r=et.valObjectMeta[e.valType];if(e.arrayOk&&at(t))return!0;if(r.validateFunction)return r.validateFunction(t,e);var n={},i=n,a={set:function(t){i=t}};return r.coerceFunction(t,a,n,e),i!==n};var ot,st,lt=function(t,e){var r=t%e;return r<0?r+e:r},ut={},ct=t.BADNUM,ht=t.ONEDAY,ft=t.ONEHOUR,pt=t.ONEMIN,dt=t.ONESEC,gt=t.EPOCHJD,vt=e.time.format.utc,mt=/^\\s*(-?\\d\\d\\d\\d|\\d\\d)(-(\\d?\\d)(-(\\d?\\d)([ Tt]([01]?\\d|2[0-3])(:([0-5]\\d)(:([0-5]\\d(\\.\\d+)?))?(Z|z|[+\\-]\\d\\d:?\\d\\d)?)?)?)?)?\\s*$/m,yt=/^\\s*(-?\\d\\d\\d\\d|\\d\\d)(-(\\d?\\di?)(-(\\d?\\d)([ Tt]([01]?\\d|2[0-3])(:([0-5]\\d)(:([0-5]\\d(\\.\\d+)?))?(Z|z|[+\\-]\\d\\d:?\\d\\d)?)?)?)?)?\\s*$/m,xt=(new Date).getFullYear()-70;function bt(t){return t&&P.componentsRegistry.calendars&&\"string\"==typeof t&&\"gregorian\"!==t}function _t(t,e){return String(t+Math.pow(10,e)).substr(1)}ut.dateTick0=function(t,e){return bt(t)?e?P.getComponentMethod(\"calendars\",\"CANONICAL_SUNDAY\")[t]:P.getComponentMethod(\"calendars\",\"CANONICAL_TICK\")[t]:e?\"2000-01-02\":\"2000-01-01\"},ut.dfltRange=function(t){return bt(t)?P.getComponentMethod(\"calendars\",\"DFLTRANGE\")[t]:[\"2000-01-01\",\"2001-01-01\"]},ut.isJSDate=function(t){return\"object\"==typeof t&&null!==t&&\"function\"==typeof t.getTime},ut.dateTime2ms=function(t,e){if(ut.isJSDate(t))return(t=Number(t)-t.getTimezoneOffset()*pt)>=ot&&t<=st?t:ct;if(\"string\"!=typeof t&&\"number\"!=typeof t)return ct;t=String(t);var r=bt(e),n=t.charAt(0);!r||\"G\"!==n&&\"g\"!==n||(t=t.substr(1),e=\"\");var i=r&&\"chinese\"===e.substr(0,7),a=t.match(i?yt:mt);if(!a)return ct;var o=a[1],s=a[3]||\"1\",l=Number(a[5]||1),u=Number(a[7]||0),c=Number(a[9]||0),h=Number(a[11]||0);if(r){if(2===o.length)return ct;var f;o=Number(o);try{var p=P.getComponentMethod(\"calendars\",\"getCal\")(e);if(i){var d=\"i\"===s.charAt(s.length-1);s=parseInt(s,10),f=p.newDate(o,p.toMonthIndex(o,s,d),l)}else f=p.newDate(o,Number(s),l)}catch(t){return ct}return f?(f.toJD()-gt)*ht+u*ft+c*pt+h*dt:ct}o=2===o.length?(Number(o)+2e3-xt)%100+xt:Number(o),s-=1;var g=new Date(Date.UTC(2e3,s,l,u,c));return g.setUTCFullYear(o),g.getUTCMonth()!==s?ct:g.getUTCDate()!==l?ct:g.getTime()+h*dt},ot=ut.MIN_MS=ut.dateTime2ms(\"-9999\"),st=ut.MAX_MS=ut.dateTime2ms(\"9999-12-31 23:59:59.9999\"),ut.isDateTime=function(t,e){return ut.dateTime2ms(t,e)!==ct};var wt=90*ht,Mt=3*ft,At=5*pt;function kt(t,e,r,n,i){if((e||r||n||i)&&(t+=\" \"+_t(e,2)+\":\"+_t(r,2),(n||i)&&(t+=\":\"+_t(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+=\".\"+_t(i,a)}return t}ut.ms2DateTime=function(t,e,r){if(\"number\"!=typeof t||!(t>=ot&&t<=st))return ct;e||(e=0);var n,i,a,o,s,l,u=Math.floor(10*lt(t+.05,1)),c=Math.round(t-u/10);if(bt(r)){var h=Math.floor(c/ht)+gt,f=Math.floor(lt(t,ht));try{n=P.getComponentMethod(\"calendars\",\"getCal\")(r).fromJD(h).formatDate(\"yyyy-mm-dd\")}catch(t){n=vt(\"G%Y-%m-%d\")(new Date(c))}if(\"-\"===n.charAt(0))for(;n.length<11;)n=\"-0\"+n.substr(1);else for(;n.length<10;)n=\"0\"+n;i=e<wt?Math.floor(f/ft):0,a=e<wt?Math.floor(f%ft/pt):0,o=e<Mt?Math.floor(f%pt/dt):0,s=e<At?f%dt*10+u:0}else l=new Date(c),n=vt(\"%Y-%m-%d\")(l),i=e<wt?l.getUTCHours():0,a=e<wt?l.getUTCMinutes():0,o=e<Mt?l.getUTCSeconds():0,s=e<At?10*l.getUTCMilliseconds()+u:0;return kt(n,i,a,o,s)},ut.ms2DateTimeLocal=function(t){if(!(t>=ot+ht&&t<=st-ht))return ct;var r=Math.floor(10*lt(t+.05,1)),n=new Date(Math.round(t-r/10));return kt(e.time.format(\"%Y-%m-%d\")(n),n.getHours(),n.getMinutes(),n.getSeconds(),10*n.getUTCMilliseconds()+r)},ut.cleanDate=function(t,e,r){if(ut.isJSDate(t)||\"number\"==typeof t){if(bt(r))return _.error(\"JS Dates and milliseconds are incompatible with world calendars\",t),e;if(!(t=ut.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!ut.isDateTime(t,r))return _.error(\"unrecognized date\",t),e;return t};var Tt=/%\\d?f/g;function St(t,e,r,n){t=t.replace(Tt,function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,\"\")||\"0\"});var i=new Date(Math.floor(e+.05));if(bt(n))try{t=P.getComponentMethod(\"calendars\",\"worldCalFmt\")(t,e,n)}catch(t){return\"Invalid\"}return r(t)(i)}var Et=[59,59.9,59.99,59.999,59.9999];ut.formatDate=function(t,e,n,i,a,o){if(a=bt(a)&&a,!e)if(\"y\"===n)e=o.year;else if(\"m\"===n)e=o.month;else{if(\"d\"!==n)return function(t,e){var n=lt(t+.05,ht),i=_t(Math.floor(n/ft),2)+\":\"+_t(lt(Math.floor(n/pt),60),2);if(\"M\"!==e){r(e)||(e=0);var a=(100+Math.min(lt(t/dt,60),Et[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,\"\").replace(/[\\.]$/,\"\")),i+=\":\"+a}return i}(t,n)+\"\\n\"+St(o.dayMonthYear,t,i,a);e=o.dayMonth+\"\\n\"+o.year}return St(e,t,i,a)};var Ct=3*ht;ut.incrementMonth=function(t,e,r){r=bt(r)&&r;var n=lt(t,ht);if(t=Math.round(t-n),r)try{var i=Math.round(t/ht)+gt,a=P.getComponentMethod(\"calendars\",\"getCal\")(r),o=a.fromJD(i);return e%12?a.add(o,e,\"m\"):a.add(o,e/12,\"y\"),(o.toJD()-gt)*ht+n}catch(e){_.error(\"invalid ms \"+t+\" in calendar \"+r)}var s=new Date(t+Ct);return s.setUTCMonth(s.getUTCMonth()+e)+n-Ct},ut.findExactDates=function(t,e){for(var n,i,a=0,o=0,s=0,l=0,u=bt(e)&&P.getComponentMethod(\"calendars\",\"getCal\")(e),c=0;c<t.length;c++)if(i=t[c],r(i)){if(!(i%ht))if(u)try{1===(n=u.fromJD(i/ht+gt)).day()?1===n.month()?a++:o++:s++}catch(t){}else 1===(n=new Date(i)).getUTCDate()?0===n.getUTCMonth()?a++:o++:s++}else l++;s+=o+=a;var h=t.length-l;return{exactYears:a/h,exactMonths:o/h,exactDays:s/h}};function Lt(t){return!0===t.visible}function zt(t){return!0===t[0].trace.visible}var Pt,It,Dt,Ot={};function Rt(t,e,r,n,i,a,o,s){var l=r-t,u=i-t,c=o-i,h=n-e,f=a-e,p=s-a,d=l*p-c*h;if(0===d)return null;var g=(u*p-c*f)/d,v=(u*h-l*f)/d;return v<0||v>1||g<0||g>1?null:{x:t+l*g,y:e+h*g}}function Ft(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}Ot.segmentsIntersect=Rt,Ot.segmentDistance=function(t,e,r,n,i,a,o,s){if(Rt(t,e,r,n,i,a,o,s))return 0;var l=r-t,u=n-e,c=o-i,h=s-a,f=l*l+u*u,p=c*c+h*h,d=Math.min(Ft(l,u,f,i-t,a-e),Ft(l,u,f,o-t,s-e),Ft(c,h,p,t-i,e-a),Ft(c,h,p,r-i,n-a));return Math.sqrt(d)},Ot.getTextLocation=function(t,e,r,n){if(t===It&&n===Dt||(Pt={},It=t,Dt=n),Pt[r])return Pt[r];var i=t.getPointAtLength(lt(r-n/2,e)),a=t.getPointAtLength(lt(r+n/2,e)),o=Math.atan((a.y-i.y)/(a.x-i.x)),s=t.getPointAtLength(lt(r,e)),l={x:(4*s.x+i.x+a.x)/6,y:(4*s.y+i.y+a.y)/6,theta:o};return Pt[r]=l,l},Ot.clearLocationCache=function(){It=null},Ot.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(),h=c;function f(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(i=r);var u=r.x<a?a-r.x:r.x>o?r.x-o:0,h=r.y<s?s-r.y:r.y>l?r.y-l:0;return Math.sqrt(u*u+h*h)}for(var p=f(u);p;){if((u+=p+r)>h)return;p=f(u)}for(p=f(h);p;){if(u>(h-=p+r))return;p=f(h)}return{min:u,max:h,len:h-u,total:c,isClosed:0===u&&h===c&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},Ot.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,h=0,f=0,p=s;h<u;){if(i=(f+p)/2,o=(a=t.getPointAtLength(i))[r]-e,Math.abs(o)<l)return a;c*o>0?p=i:f=i,h++}return a};var Bt=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||void 0===t)throw new Error(\"DOM element provided is null or undefined\");return t},Nt=function(t){return t},jt=/^\\w*$/,Vt={init2dArray:function(t,e){for(var r=new Array(t),n=0;n<t;n++)r[n]=new Array(e);return r},transposeRagged:function(t){var e,r,n=0,i=t.length;for(e=0;e<i;e++)n=Math.max(n,t[e].length);var a=new Array(n);for(e=0;e<n;e++)for(a[e]=new Array(i),r=0;r<i;r++)a[e][r]=t[r][e];return a},dot:function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var r,n,i=t.length;if(t[0].length)for(r=new Array(i),n=0;n<i;n++)r[n]=Vt.dot(t[n],e);else if(e[0].length){var a=Vt.transposeRagged(e);for(r=new Array(a.length),n=0;n<a.length;n++)r[n]=Vt.dot(t,a[n])}else for(r=0,n=0;n<i;n++)r+=t[n]*e[n];return r},translationMatrix:function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},rotationMatrix:function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},rotationXYMatrix:function(t,e,r){return Vt.dot(Vt.dot(Vt.translationMatrix(e,r),Vt.rotationMatrix(t)),Vt.translationMatrix(-e,-r))},apply2DTransform:function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var r=1===arguments.length?e[0]:[e[0],e[1]];return Vt.dot(t,[r[0],r[1],1]).slice(0,2)}},apply2DTransform2:function(t){var e=Vt.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}}},Ut=[],qt=/^(.*)(\\.[^\\.\\[\\]]+|\\[\\d\\])$/,Ht=/^[^\\.\\[\\]]+$/,Gt=p.isArrayOrTypedArray,Wt={};function Yt(t,e){return t<e}function Xt(t,e){return t<=e}function Zt(t,e){return t>e}function Jt(t,e){return t>=e}Wt.findBin=function(t,e,n){if(r(e.start))return n?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var i,a,o=0,s=e.length,l=0,u=s>1?(e[s-1]-e[0])/(s-1):1;for(a=u>=0?n?Yt:Xt:n?Jt:Zt,t+=1e-9*u*(n?-1:1)*(u>=0?1:-1);o<s&&l++<100;)a(e[i=Math.floor((o+s)/2)],t)?o=i+1:s=i;return l>90&&_.log(\"Long binary search...\"),o-1},Wt.sorterAsc=function(t,e){return t-e},Wt.sorterDes=function(t,e){return e-t},Wt.distinctVals=function(t){var e=t.slice();e.sort(Wt.sorterAsc);for(var r=e.length-1,n=e[r]-e[0]||1,i=n/(r||1)/1e4,a=[e[0]],o=0;o<r;o++)e[o+1]>e[o]+i&&(n=Math.min(n,e[o+1]-e[o]),a.push(e[o+1]));return{vals:a,minDiff:n}},Wt.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;i<a&&o++<100;)e[n=u((i+a)/2)]<=t?i=n+s:a=n-l;return e[i]};var Kt={},Qt=p.isArrayOrTypedArray;Kt.aggNums=function(t,e,n,i){var a,o;if((!i||i>n.length)&&(i=n.length),r(e)||(e=!1),Qt(n[0])){for(o=new Array(i),a=0;a<i;a++)o[a]=Kt.aggNums(t,e,n[a]);n=o}for(a=0;a<i;a++)r(e)?r(n[a])&&(e=t(+e,+n[a])):e=n[a];return e},Kt.len=function(t){return Kt.aggNums(function(t){return t+1},0,t)},Kt.mean=function(t,e){return e||(e=Kt.len(t)),Kt.aggNums(function(t,e){return t+e},0,t)/e},Kt.variance=function(t,e,n){return e||(e=Kt.len(t)),r(n)||(n=Kt.mean(t,e)),Kt.aggNums(function(t,e){return t+Math.pow(e-n,2)},0,t)/e},Kt.stdev=function(t,e,r){return Math.sqrt(Kt.variance(t,e,r))},Kt.interp=function(t,e){if(!r(e))throw\"n should be a finite number\";if((e=e*t.length-.5)<0)return t[0];if(e>t.length-1)return t[t.length-1];var n=e%1;return n*t[Math.ceil(e)]+(1-n)*t[Math.floor(e)]};var $t={},te={};function ee(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}$t.throttle=function(t,e,r){var n=te[t],i=Date.now();if(!n){for(var a in te)te[a].ts<i-6e4&&delete te[a];n=te[t]={ts:0,timer:null}}function o(){r(),n.ts=Date.now(),n.onDone&&(n.onDone(),n.onDone=null)}ee(n),i>n.ts+e?o():n.timer=setTimeout(function(){o(),n.timer=null},e)},$t.done=function(t){var e=te[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},$t.clear=function(t){if(t)ee(te[t]),delete te[t];else for(var e in te)$t.clear(e)};var re=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var n=Math.log(Math.min(e[0],e[1]))/Math.LN10;return r(n)||(n=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),n},ne={},ie=t.FP_SAFE,ae=t.BADNUM,oe=ne={};oe.nestedProperty=W,oe.keyedContainer=function(t,e,r,n){var i,a;r=r||\"name\",n=n||\"value\";var o={};a=e&&e.length?W(t,e).get():t,e=e||\"\",a=a||[];var s={};for(i=0;i<a.length;i++)s[a[i][r]]=i;var l=jt.test(n),u={set:function(t,e){var i=null===e?4:0,c=s[t];void 0===c?(i|=3,c=a.length,s[t]=c):e!==(l?a[c][n]:W(a[c],n).get())&&(i|=2);var h=a[c]=a[c]||{};return h[r]=t,l?h[n]=e:W(h,n).set(e),null!==e&&(i&=-5),o[c]=o[c]|i,u},get:function(t){var e=s[t];return void 0===e?void 0:l?a[e][n]:W(a[e],n).get()},rename:function(t,e){var n=s[t];return void 0===n?u:(o[n]=1|o[n],s[e]=n,delete s[t],a[n][r]=e,u)},remove:function(t){var e=s[t];if(void 0===e)return u;var c=a[e];if(Object.keys(c).length>2)return o[e]=2|o[e],u.set(t,null);if(l){for(i=e;i<a.length;i++)o[i]=3|o[i];for(i=e;i<a.length;i++)s[a[i][r]]--;a.splice(e,1),delete s[t]}else W(c,n).set(null),o[e]=6|o[e];return u},constructUpdate:function(){for(var t,i,s={},u=Object.keys(o),c=0;c<u.length;c++)i=u[c],t=e+\"[\"+i+\"]\",a[i]?(1&o[i]&&(s[t+\".\"+r]=a[i][r]),2&o[i]&&(s[t+\".\"+n]=l?4&o[i]?null:a[i][n]:4&o[i]?null:W(a[i],n).get())):s[t]=null;return s}};return u},oe.relativeAttr=function(t,e){for(;e;){var r=t.match(qt);if(r)t=r[1];else{if(!t.match(Ht))throw new Error(\"bad relativeAttr call:\"+[t,e]);t=\"\"}if(\"^\"!==e.charAt(0))break;e=e.slice(1)}return t&&\"[\"!==e.charAt(0)?t+\".\"+e:t+e},oe.isPlainObject=v,oe.mod=lt,oe.toLogRange=re,oe.relinkPrivateKeys=function t(e,r){for(var n in r){var i=r[n],a=e[n];if(a!==i)if(\"_\"===n.charAt(0)||\"function\"==typeof i){if(n in e)continue;e[n]=i}else if(Gt(i)&&Gt(a)&&v(i[0])){if(\"customdata\"===n||\"ids\"===n)continue;for(var o=Math.min(i.length,a.length),s=0;s<o;s++)a[s]!==i[s]&&v(i[s])&&v(a[s])&&t(a[s],i[s])}else v(i)&&v(a)&&(t(a,i),Object.keys(a).length||delete e[n])}},oe.ensureArray=function(t,e){return Array.isArray(t)||(t=[]),t.length=e,t},oe.isTypedArray=p.isTypedArray,oe.isArrayOrTypedArray=p.isArrayOrTypedArray,oe.valObjectMeta=et.valObjectMeta,oe.coerce=et.coerce,oe.coerce2=et.coerce2,oe.coerceFont=et.coerceFont,oe.coerceHoverinfo=et.coerceHoverinfo,oe.coerceSelectionMarkerOpacity=et.coerceSelectionMarkerOpacity,oe.validate=et.validate,oe.dateTime2ms=ut.dateTime2ms,oe.isDateTime=ut.isDateTime,oe.ms2DateTime=ut.ms2DateTime,oe.ms2DateTimeLocal=ut.ms2DateTimeLocal,oe.cleanDate=ut.cleanDate,oe.isJSDate=ut.isJSDate,oe.formatDate=ut.formatDate,oe.incrementMonth=ut.incrementMonth,oe.dateTick0=ut.dateTick0,oe.dfltRange=ut.dfltRange,oe.findExactDates=ut.findExactDates,oe.MIN_MS=ut.MIN_MS,oe.MAX_MS=ut.MAX_MS,oe.findBin=Wt.findBin,oe.sorterAsc=Wt.sorterAsc,oe.sorterDes=Wt.sorterDes,oe.distinctVals=Wt.distinctVals,oe.roundUp=Wt.roundUp,oe.aggNums=Kt.aggNums,oe.len=Kt.len,oe.mean=Kt.mean,oe.variance=Kt.variance,oe.stdev=Kt.stdev,oe.interp=Kt.interp,oe.init2dArray=Vt.init2dArray,oe.transposeRagged=Vt.transposeRagged,oe.dot=Vt.dot,oe.translationMatrix=Vt.translationMatrix,oe.rotationMatrix=Vt.rotationMatrix,oe.rotationXYMatrix=Vt.rotationXYMatrix,oe.apply2DTransform=Vt.apply2DTransform,oe.apply2DTransform2=Vt.apply2DTransform2,oe.deg2rad=n.deg2rad,oe.rad2deg=n.rad2deg,oe.wrap360=n.wrap360,oe.wrap180=n.wrap180,oe.segmentsIntersect=Ot.segmentsIntersect,oe.segmentDistance=Ot.segmentDistance,oe.getTextLocation=Ot.getTextLocation,oe.clearLocationCache=Ot.clearLocationCache,oe.getVisibleSegment=Ot.getVisibleSegment,oe.findPointOnPath=Ot.findPointOnPath,oe.extendFlat=m.extendFlat,oe.extendDeep=m.extendDeep,oe.extendDeepAll=m.extendDeepAll,oe.extendDeepNoArrays=m.extendDeepNoArrays,oe.log=_.log,oe.warn=_.warn,oe.error=_.error,oe.counterRegex=tt.counter,oe.throttle=$t.throttle,oe.throttleDone=$t.done,oe.clearThrottle=$t.clear,oe.getGraphDiv=Bt,oe._=function(t,e){for(var r=t._context.locale,n=0;n<2;n++){for(var i=t._context.locales,a=0;a<2;a++){var o=(i[r]||{}).dictionary;if(o){var s=o[e];if(s)return s}i=P.localeRegistry}var l=r.split(\"-\")[0];if(l===r)break;r=l}return e},oe.notifier=function(t,n){if(-1===Ut.indexOf(t)){Ut.push(t);var i=1e3;r(n)?i=n:\"long\"===n&&(i=3e3);var a=e.select(\"body\").selectAll(\".plotly-notifier\").data([0]);a.enter().append(\"div\").classed(\"plotly-notifier\",!0),a.selectAll(\".notifier-note\").data(Ut).enter().append(\"div\").classed(\"notifier-note\",!0).style(\"opacity\",0).each(function(t){var r=e.select(this);r.append(\"button\").classed(\"notifier-close\",!0).html(\"×\").on(\"click\",function(){r.transition().call(o)});for(var n=r.append(\"p\"),a=t.split(/<br\\s*\\/?>/g),s=0;s<a.length;s++)s&&n.append(\"br\"),n.append(\"span\").text(a[s]);r.transition().duration(700).style(\"opacity\",1).transition().delay(i).call(o)})}function o(t){t.duration(700).style(\"opacity\",0).each(\"end\",function(t){var r=Ut.indexOf(t);-1!==r&&Ut.splice(r,1),e.select(this).remove()})}},oe.filterUnique=function(t){for(var e={},r=[],n=0,i=0;i<t.length;i++){var a=t[i];1!==e[a]&&(e[a]=1,r[n++]=a)}return r},oe.filterVisible=function(t){for(var e,r=(e=t,Array.isArray(e)&&Array.isArray(e[0])&&e[0][0]&&e[0][0].trace?zt:Lt),n=[],i=0;i<t.length;i++){var a=t[i];r(a)&&n.push(a)}return n},oe.pushUnique=k,oe.cleanNumber=function(t){return\"string\"==typeof t&&(t=t.replace(o,\"\")),r(t)?Number(t):a},oe.ensureNumber=function(t){return r(t)?(t=Number(t))<-ie||t>ie?ae:r(t)?Number(t):ae:ae},oe.noop=A,oe.identity=Nt,oe.swapAttrs=function(t,e,r,n){r||(r=\"x\"),n||(n=\"y\");for(var i=0;i<e.length;i++){var a=e[i],o=oe.nestedProperty(t,a.replace(\"?\",r)),s=oe.nestedProperty(t,a.replace(\"?\",n)),l=o.get();o.set(s.get()),s.set(l)}},oe.raiseToTop=function(t){t.parentNode.appendChild(t)},oe.cancelTransition=function(t){return t.transition().duration(0)},oe.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},oe.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},oe.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o<i;o++)a[o]=e(t[o],r,n);return a},oe.randstr=function t(e,r,n){if(n||(n=16),void 0===r&&(r=24),r<=0)return\"0\";var i,a,o=Math.log(Math.pow(2,r))/Math.log(n),s=\"\";for(i=2;o===1/0;i*=2)o=Math.log(Math.pow(2,r/i))/Math.log(n)*i;var l=o-Math.floor(o);for(i=0;i<Math.floor(o);i++)s=Math.floor(Math.random()*n).toString(n)+s;l&&(a=Math.pow(n,l),s=Math.floor(Math.random()*a).toString(n)+s);var u=parseInt(s,n);return e&&e.indexOf(s)>-1||u!==1/0&&u>=Math.pow(2,r)?t(e,r,n):s},oe.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},oe.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<l;r++)u[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;r<o;r++){for(a=0,n=0;n<l;n++)(i=r+n+1-e)<-o?i-=s*Math.round(i/s):i>=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},oe.syncOrAsync=function(t,e,r){var n;function i(){return oe.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i).then(void 0,oe.promiseError);return r&&r(e)},oe.stripTrailingSlash=function(t){return\"/\"===t.substr(-1)?t.substr(0,t.length-1):t},oe.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;n<r.length;n++)void 0!==(i=t[r[n]])&&null!==i?a=!0:o=!1;if(a&&!o)for(n=0;n<r.length;n++)t[r[n]]=e[r[n]]}},oe.mergeArray=function(t,e,r){if(oe.isArrayOrTypedArray(t))for(var n=Math.min(t.length,e.length),i=0;i<n;i++)e[i][r]=t[i]},oe.fillArray=function(t,e,r,n){if(n=n||oe.identity,oe.isArrayOrTypedArray(t))for(var i=0;i<e.length;i++)e[i][r]=n(t[i])},oe.castOption=function(t,e,r,n){n=n||oe.identity;var i=oe.nestedProperty(t,r).get();return oe.isArrayOrTypedArray(i)?Array.isArray(e)&&oe.isArrayOrTypedArray(i[e[0]])?n(i[e[0]][e[1]]):n(i[e]):i},oe.extractOption=function(t,e,r,n){if(r in t)return t[r];var i=oe.nestedProperty(e,n).get();return Array.isArray(i)?void 0:i},oe.tagSelected=function(t,e,n){var i,a,o=e.selectedpoints,s=e._indexToPoints;if(s)for(var l in i={},s)for(var u=s[l],c=0;c<u.length;c++)i[u[c]]=l;function h(e){return void 0!==e&&e<t.length}for(var f=0;f<o.length;f++){var p=o[f];if(r(a=p)&&a>=0&&a%1==0){var d=i?i[p]:p,g=n?n[d]:d;h(g)&&(t[g].selected=1)}}},oe.getTargetArray=function(t,e){var r=e.target;if(\"string\"==typeof r&&r){var n=oe.nestedProperty(t,r).get();return!!Array.isArray(n)&&n}return!!Array.isArray(r)&&r},oe.minExtend=function(t,e){var r={};\"object\"!=typeof e&&(e={});var n,i,a,o=Object.keys(t);for(n=0;n<o.length;n++)a=t[i=o[n]],\"_\"!==i.charAt(0)&&\"function\"!=typeof a&&(\"module\"===i?r[i]=a:Array.isArray(a)?r[i]=a.slice(0,3):r[i]=a&&\"object\"==typeof a?oe.minExtend(t[i],e[i]):a);for(o=Object.keys(e),n=0;n<o.length;n++)\"object\"==typeof(a=e[i=o[n]])&&i in r&&\"object\"==typeof r[i]||(r[i]=a);return r},oe.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},oe.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r]))return!0;return!1},oe.isPlotDiv=function(t){var r=e.select(t);return r.node()instanceof HTMLElement&&r.size()&&r.classed(\"js-plotly-plot\")},oe.removeElement=function(t){var e=t&&t.parentNode;e&&e.removeChild(t)},oe.addStyleRule=function(t,e){if(!oe.styleSheet){var r=document.createElement(\"style\");r.appendChild(document.createTextNode(\"\")),document.head.appendChild(r),oe.styleSheet=r.sheet}var n=oe.styleSheet;n.insertRule?n.insertRule(t+\"{\"+e+\"}\",0):n.addRule?n.addRule(t,e,0):oe.warn(\"addStyleRule failed\")},oe.isIE=function(){return void 0!==window.navigator.msSaveBlob},oe.isD3Selection=function(t){return t&&\"function\"==typeof t.classed},oe.objectFromPath=function(t,e){for(var r,n=t.split(\".\"),i=r={},a=0;a<n.length;a++){var o=n[a],s=null,l=n[a].match(/(.*)\\[([0-9]+)\\]/);l?(o=l[1],s=l[2],r=r[o]=[],a===n.length-1?r[s]=e:r[s]={},r=r[s]):(a===n.length-1?r[o]=e:r[o]={},r=r[o])}return i};var se=/^([^\\[\\.]+)\\.(.+)?/,le=/^([^\\.]+)\\[([0-9]+)\\](\\.)?(.+)?/;oe.expandObjectPaths=function(t){var e,r,n,i,a,o,s;if(\"object\"==typeof t&&!Array.isArray(t))for(r in t)t.hasOwnProperty(r)&&((e=r.match(se))?(i=t[r],n=e[1],delete t[r],t[n]=oe.extendDeepNoArrays(t[n]||{},oe.objectFromPath(r,oe.expandObjectPaths(i))[n])):(e=r.match(le))?(i=t[r],n=e[1],a=parseInt(e[2]),delete t[r],t[n]=t[n]||[],\".\"===e[3]?(s=e[4],o=t[n][a]=t[n][a]||{},oe.extendDeepNoArrays(o,oe.objectFromPath(s,oe.expandObjectPaths(i)))):t[n][a]=oe.expandObjectPaths(i)):t[r]=oe.expandObjectPaths(t[r]));return t},oe.numSeparate=function(t,e,r){if(r||(r=!1),\"string\"!=typeof e||0===e.length)throw new Error(\"Separator string required for formatting!\");\"number\"==typeof t&&(t=String(t));var n=/(\\d+)(\\d{3})/,i=e.charAt(0),a=e.charAt(1),o=t.split(\".\"),s=o[0],l=o.length>1?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};var ue=/%{([^\\s%{}]*)}/g,ce=/^\\w*$/;oe.templateString=function(t,e){var r={};return t.replace(ue,function(t,n){return ce.test(n)?e[n]||\"\":(r[n]=r[n]||oe.nestedProperty(e,n).get,r[n]()||\"\")})};oe.subplotSort=function(t,e){for(var r=Math.min(t.length,e.length)+1,n=0,i=0,a=0;a<r;a++){var o=t.charCodeAt(a)||0,s=e.charCodeAt(a)||0,l=o>=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 he=2e9;oe.seedPseudoRandom=function(){he=2e9},oe.pseudoRandom=function(){var t=he;return he=(69069*he+1)%4294967296,Math.abs(he-t)<429496729?oe.pseudoRandom():he/4294967296};var fe=ne.extendFlat,pe=ne.isPlainObject,de={valType:\"flaglist\",extras:[\"none\"],flags:[\"calc\",\"calcIfAutorange\",\"clearAxisTypes\",\"plot\",\"style\",\"colorbars\"]},ge={valType:\"flaglist\",extras:[\"none\"],flags:[\"calc\",\"calcIfAutorange\",\"plot\",\"legend\",\"ticks\",\"margins\",\"layoutstyle\",\"modebar\",\"camera\",\"arraydraw\"]},ve=de.flags.slice().concat([\"clearCalc\",\"fullReplot\"]),me=ge.flags.slice().concat(\"layoutReplot\"),ye={traces:de,layout:ge,traceFlags:function(){return xe(ve)},layoutFlags:function(){return xe(me)},update:function(t,e){var r=e.editType;if(r&&\"none\"!==r)for(var n=r.split(\"+\"),i=0;i<n.length;i++)t[n[i]]=!0},overrideAll:be};function xe(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=!1;return e}function be(t,e,r){var n=fe({},t);for(var i in n){var a=n[i];pe(a)&&(n[i]=_e(a,e,r,i))}return\"from-root\"===r&&(n.editType=e),n}function _e(t,e,r,n){if(t.valType){var i=fe({},t);if(i.editType=e,Array.isArray(t.items)){i.items=new Array(t.items.length);for(var a=0;a<t.items.length;a++)i.items[a]=_e(t.items[a],e,\"from-root\")}return i}return be(t,e,\"_\"===n.charAt(0)?\"nested\":\"from-root\")}var we={mode:{valType:\"enumerated\",dflt:\"afterall\",values:[\"immediate\",\"next\",\"afterall\"]},direction:{valType:\"enumerated\",values:[\"forward\",\"reverse\"],dflt:\"forward\"},fromcurrent:{valType:\"boolean\",dflt:!1},frame:{duration:{valType:\"number\",min:0,dflt:500},redraw:{valType:\"boolean\",dflt:!0}},transition:{duration:{valType:\"number\",min:0,dflt:500},easing:{valType:\"enumerated\",dflt:\"cubic-in-out\",values:[\"linear\",\"quad\",\"cubic\",\"sin\",\"exp\",\"circle\",\"elastic\",\"back\",\"bounce\",\"linear-in\",\"quad-in\",\"cubic-in\",\"sin-in\",\"exp-in\",\"circle-in\",\"elastic-in\",\"back-in\",\"bounce-in\",\"linear-out\",\"quad-out\",\"cubic-out\",\"sin-out\",\"exp-out\",\"circle-out\",\"elastic-out\",\"back-out\",\"bounce-out\",\"linear-in-out\",\"quad-in-out\",\"cubic-in-out\",\"sin-in-out\",\"exp-in-out\",\"circle-in-out\",\"elastic-in-out\",\"back-in-out\",\"bounce-in-out\"]}}},Me={_isLinkedToArray:\"frames_entry\",group:{valType:\"string\"},name:{valType:\"string\"},traces:{valType:\"any\"},baseframe:{valType:\"string\"},data:{valType:\"any\"},layout:{valType:\"any\"}},Ae={dash:{valType:\"string\",values:[\"solid\",\"dot\",\"dash\",\"longdash\",\"dashdot\",\"longdashdot\"],dflt:\"solid\",editType:\"style\"}},ke=tt.counter,Te={idRegex:{x:ke(\"x\"),y:ke(\"y\")},attrRegex:ke(\"[xy]axis\"),xAxisMatch:ke(\"xaxis\"),yAxisMatch:ke(\"yaxis\"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:\"-select\",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:[\"imagelayer\",\"maplayer\",\"barlayer\",\"carpetlayer\",\"violinlayer\",\"boxlayer\",\"scatterlayer\"],layerValue2layerClass:{\"above traces\":\"above\",\"below traces\":\"below\"}},Se=Ae.dash,Ee=m.extendFlat,Ce={visible:{valType:\"boolean\",editType:\"plot\"},color:{valType:\"color\",dflt:C.defaultLine,editType:\"ticks\"},title:{valType:\"string\",editType:\"ticks+margins\"},titlefont:T({editType:\"ticks+margins\"}),type:{valType:\"enumerated\",values:[\"-\",\"linear\",\"log\",\"date\",\"category\"],dflt:\"-\",editType:\"calc\"},autorange:{valType:\"enumerated\",values:[!0,!1,\"reversed\"],dflt:!0,editType:\"calc\",impliedEdits:{\"range[0]\":void 0,\"range[1]\":void 0}},rangemode:{valType:\"enumerated\",values:[\"normal\",\"tozero\",\"nonnegative\"],dflt:\"normal\",editType:\"plot\"},range:{valType:\"info_array\",items:[{valType:\"any\",editType:\"plot+margins\",impliedEdits:{\"^autorange\":!1}},{valType:\"any\",editType:\"plot+margins\",impliedEdits:{\"^autorange\":!1}}],editType:\"plot+margins\",impliedEdits:{autorange:!1}},fixedrange:{valType:\"boolean\",dflt:!1,editType:\"calc\"},scaleanchor:{valType:\"enumerated\",values:[Te.idRegex.x.toString(),Te.idRegex.y.toString()],editType:\"plot\"},scaleratio:{valType:\"number\",min:0,dflt:1,editType:\"plot\"},constrain:{valType:\"enumerated\",values:[\"range\",\"domain\"],dflt:\"range\",editType:\"plot\"},constraintoward:{valType:\"enumerated\",values:[\"left\",\"center\",\"right\",\"top\",\"middle\",\"bottom\"],editType:\"plot\"},tickmode:{valType:\"enumerated\",values:[\"auto\",\"linear\",\"array\"],editType:\"ticks+margins\",impliedEdits:{tick0:void 0,dtick:void 0}},nticks:{valType:\"integer\",min:0,dflt:0,editType:\"ticks+margins\"},tick0:{valType:\"any\",editType:\"ticks+margins\",impliedEdits:{tickmode:\"linear\"}},dtick:{valType:\"any\",editType:\"ticks+margins\",impliedEdits:{tickmode:\"linear\"}},tickvals:{valType:\"data_array\",editType:\"ticks+margins\"},ticktext:{valType:\"data_array\",editType:\"ticks+margins\"},ticks:{valType:\"enumerated\",values:[\"outside\",\"inside\",\"\"],editType:\"ticks+margins\"},mirror:{valType:\"enumerated\",values:[!0,\"ticks\",!1,\"all\",\"allticks\"],dflt:!1,editType:\"ticks+layoutstyle\"},ticklen:{valType:\"number\",min:0,dflt:5,editType:\"ticks\"},tickwidth:{valType:\"number\",min:0,dflt:1,editType:\"ticks\"},tickcolor:{valType:\"color\",dflt:C.defaultLine,editType:\"ticks\"},showticklabels:{valType:\"boolean\",dflt:!0,editType:\"ticks+margins\"},automargin:{valType:\"boolean\",dflt:!1,editType:\"ticks+margins\"},showspikes:{valType:\"boolean\",dflt:!1,editType:\"modebar\"},spikecolor:{valType:\"color\",dflt:null,editType:\"none\"},spikethickness:{valType:\"number\",dflt:3,editType:\"none\"},spikedash:Ee({},Se,{dflt:\"dash\",editType:\"none\"}),spikemode:{valType:\"flaglist\",flags:[\"toaxis\",\"across\",\"marker\"],dflt:\"toaxis\",editType:\"none\"},spikesnap:{valType:\"enumerated\",values:[\"data\",\"cursor\"],dflt:\"data\",editType:\"none\"},tickfont:T({editType:\"ticks+margins\"}),tickangle:{valType:\"angle\",dflt:\"auto\",editType:\"ticks+margins\"},tickprefix:{valType:\"string\",dflt:\"\",editType:\"ticks+margins\"},showtickprefix:{valType:\"enumerated\",values:[\"all\",\"first\",\"last\",\"none\"],dflt:\"all\",editType:\"ticks+margins\"},ticksuffix:{valType:\"string\",dflt:\"\",editType:\"ticks+margins\"},showticksuffix:{valType:\"enumerated\",values:[\"all\",\"first\",\"last\",\"none\"],dflt:\"all\",editType:\"ticks+margins\"},showexponent:{valType:\"enumerated\",values:[\"all\",\"first\",\"last\",\"none\"],dflt:\"all\",editType:\"ticks+margins\"},exponentformat:{valType:\"enumerated\",values:[\"none\",\"e\",\"E\",\"power\",\"SI\",\"B\"],dflt:\"B\",editType:\"ticks+margins\"},separatethousands:{valType:\"boolean\",dflt:!1,editType:\"ticks+margins\"},tickformat:{valType:\"string\",dflt:\"\",editType:\"ticks+margins\"},tickformatstops:{_isLinkedToArray:\"tickformatstop\",dtickrange:{valType:\"info_array\",items:[{valType:\"any\",editType:\"ticks+margins\"},{valType:\"any\",editType:\"ticks+margins\"}],editType:\"ticks+margins\"},value:{valType:\"string\",dflt:\"\",editType:\"ticks+margins\"},editType:\"ticks+margins\"},hoverformat:{valType:\"string\",dflt:\"\",editType:\"none\"},showline:{valType:\"boolean\",dflt:!1,editType:\"layoutstyle\"},linecolor:{valType:\"color\",dflt:C.defaultLine,editType:\"layoutstyle\"},linewidth:{valType:\"number\",min:0,dflt:1,editType:\"ticks+layoutstyle\"},showgrid:{valType:\"boolean\",editType:\"ticks\"},gridcolor:{valType:\"color\",dflt:C.lightLine,editType:\"ticks\"},gridwidth:{valType:\"number\",min:0,dflt:1,editType:\"ticks\"},zeroline:{valType:\"boolean\",editType:\"ticks\"},zerolinecolor:{valType:\"color\",dflt:C.defaultLine,editType:\"ticks\"},zerolinewidth:{valType:\"number\",dflt:1,editType:\"ticks\"},anchor:{valType:\"enumerated\",values:[\"free\",Te.idRegex.x.toString(),Te.idRegex.y.toString()],editType:\"plot+margins\"},side:{valType:\"enumerated\",values:[\"top\",\"bottom\",\"left\",\"right\"],editType:\"plot+margins\"},overlaying:{valType:\"enumerated\",values:[\"free\",Te.idRegex.x.toString(),Te.idRegex.y.toString()],editType:\"plot\"},layer:{valType:\"enumerated\",values:[\"above traces\",\"below traces\"],dflt:\"above traces\",editType:\"plot\"},domain:{valType:\"info_array\",items:[{valType:\"number\",min:0,max:1,editType:\"plot+margins\"},{valType:\"number\",min:0,max:1,editType:\"plot+margins\"}],dflt:[0,1],editType:\"plot+margins\"},position:{valType:\"number\",min:0,max:1,dflt:0,editType:\"plot+margins\"},categoryorder:{valType:\"enumerated\",values:[\"trace\",\"category ascending\",\"category descending\",\"array\"],dflt:\"trace\",editType:\"calc\"},categoryarray:{valType:\"data_array\",editType:\"calc\"},editType:\"calc\",_deprecated:{autotick:{valType:\"boolean\",editType:\"ticks+margins\"}}},Le=m.extendFlat,ze=(0,ye.overrideAll)({thicknessmode:{valType:\"enumerated\",values:[\"fraction\",\"pixels\"],dflt:\"pixels\"},thickness:{valType:\"number\",min:0,dflt:30},lenmode:{valType:\"enumerated\",values:[\"fraction\",\"pixels\"],dflt:\"fraction\"},len:{valType:\"number\",min:0,dflt:1},x:{valType:\"number\",dflt:1.02,min:-2,max:3},xanchor:{valType:\"enumerated\",values:[\"left\",\"center\",\"right\"],dflt:\"left\"},xpad:{valType:\"number\",min:0,dflt:10},y:{valType:\"number\",dflt:.5,min:-2,max:3},yanchor:{valType:\"enumerated\",values:[\"top\",\"middle\",\"bottom\"],dflt:\"middle\"},ypad:{valType:\"number\",min:0,dflt:10},outlinecolor:Ce.linecolor,outlinewidth:Ce.linewidth,bordercolor:Ce.linecolor,borderwidth:{valType:\"number\",min:0,dflt:0},bgcolor:{valType:\"color\",dflt:\"rgba(0,0,0,0)\"},tickmode:Ce.tickmode,nticks:Ce.nticks,tick0:Ce.tick0,dtick:Ce.dtick,tickvals:Ce.tickvals,ticktext:Ce.ticktext,ticks:Le({},Ce.ticks,{dflt:\"\"}),ticklen:Ce.ticklen,tickwidth:Ce.tickwidth,tickcolor:Ce.tickcolor,showticklabels:Ce.showticklabels,tickfont:T({}),tickangle:Ce.tickangle,tickformat:Ce.tickformat,tickformatstops:Ce.tickformatstops,tickprefix:Ce.tickprefix,showtickprefix:Ce.showtickprefix,ticksuffix:Ce.ticksuffix,showticksuffix:Ce.showticksuffix,separatethousands:Ce.separatethousands,exponentformat:Ce.exponentformat,showexponent:Ce.showexponent,title:{valType:\"string\"},titlefont:T({}),titleside:{valType:\"enumerated\",values:[\"right\",\"top\",\"bottom\"],dflt:\"top\"}},\"colorbars\",\"from-root\"),Pe={zauto:{valType:\"boolean\",dflt:!0,editType:\"calc\",impliedEdits:{zmin:void 0,zmax:void 0}},zmin:{valType:\"number\",dflt:null,editType:\"plot\",impliedEdits:{zauto:!1}},zmax:{valType:\"number\",dflt:null,editType:\"plot\",impliedEdits:{zauto:!1}},colorscale:{valType:\"colorscale\",editType:\"calc\",impliedEdits:{autocolorscale:!1}},autocolorscale:{valType:\"boolean\",dflt:!0,editType:\"calc\",impliedEdits:{colorscale:void 0}},reversescale:{valType:\"boolean\",dflt:!1,editType:\"calc\"},showscale:{valType:\"boolean\",dflt:!0,editType:\"calc\"}},Ie=m.extendFlat,De=function(t,e,r){return{color:{valType:\"color\",arrayOk:!0,editType:e||\"style\"},colorscale:Ie({},Pe.colorscale,{}),cauto:Ie({},Pe.zauto,{impliedEdits:{cmin:void 0,cmax:void 0}}),cmax:Ie({},Pe.zmax,{editType:e||Pe.zmax.editType,impliedEdits:{cauto:!1}}),cmin:Ie({},Pe.zmin,{editType:e||Pe.zmin.editType,impliedEdits:{cauto:!1}}),autocolorscale:Ie({},Pe.autocolorscale,{dflt:!1===r?r:Pe.autocolorscale.dflt}),reversescale:Ie({},Pe.reversescale,{})}},Oe={},Re=Oe={};Re.defaults=C.defaults;var Fe=Re.defaultLine=C.defaultLine;Re.lightLine=C.lightLine;var Be=Re.background=C.background;function Ne(t){if(r(t)||\"string\"!=typeof t)return t;var e=t.trim();if(\"rgb\"!==e.substr(0,3))return t;var n=e.match(/^rgba?\\s*\\(([^()]*)\\)$/);if(!n)return t;var i=n[1].trim().split(/\\s*[\\s,]\\s*/),a=\"a\"===e.charAt(3)&&4===i.length;if(!a&&3!==i.length)return t;for(var o=0;o<i.length;o++){if(!i[o].length)return t;if(i[o]=Number(i[o]),!(i[o]>=0))return t;if(3===o)i[o]>1&&(i[o]=1);else if(i[o]>=1)return t}var s=Math.round(255*i[0])+\", \"+Math.round(255*i[1])+\", \"+Math.round(255*i[2]);return a?\"rgba(\"+s+\", \"+i[3]+\")\":\"rgb(\"+s+\")\"}Re.tinyRGB=function(t){var e=t.toRgb();return\"rgb(\"+Math.round(e.r)+\", \"+Math.round(e.g)+\", \"+Math.round(e.b)+\")\"},Re.rgb=function(t){return Re.tinyRGB(s(t))},Re.opacity=function(t){return t?s(t).getAlpha():0},Re.addOpacity=function(t,e){var r=s(t).toRgb();return\"rgba(\"+Math.round(r.r)+\", \"+Math.round(r.g)+\", \"+Math.round(r.b)+\", \"+e+\")\"},Re.combine=function(t,e){var r=s(t).toRgb();if(1===r.a)return s(t).toRgbString();var n=s(e||Be).toRgb(),i=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.a},a={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return s(a).toRgbString()},Re.contrast=function(t,e,r){var n=s(t);return 1!==n.getAlpha()&&(n=s(Re.combine(t,Be))),(n.isDark()?e?n.lighten(e):Be:r?n.darken(r):Fe).toString()},Re.stroke=function(t,e){var r=s(e);t.style({stroke:Re.tinyRGB(r),\"stroke-opacity\":r.getAlpha()})},Re.fill=function(t,e){var r=s(e);t.style({fill:Re.tinyRGB(r),\"fill-opacity\":r.getAlpha()})},Re.clean=function(t){if(t&&\"object\"==typeof t){var e,r,n,i,a=Object.keys(t);for(e=0;e<a.length;e++)if(i=t[n=a[e]],\"color\"===n.substr(n.length-5))if(Array.isArray(i))for(r=0;r<i.length;r++)i[r]=Ne(i[r]);else t[n]=Ne(i);else if(\"colorscale\"===n.substr(n.length-10)&&Array.isArray(i))for(r=0;r<i.length;r++)Array.isArray(i[r])&&(i[r][1]=Ne(i[r][1]));else if(Array.isArray(i)){var o=i[0];if(!Array.isArray(o)&&o&&\"object\"==typeof o)for(r=0;r<i.length;r++)Re.clean(i[r])}else i&&\"object\"==typeof i&&Re.clean(i)}};var je=function(t){for(var e,r=t.length,n=new Array(r),i=r-1,a=0;i>=0;i--,a++)e=t[i],n[a]=[1-e[0],e[1]];return n},Ve=function(t,e,r,n){var i,a;r?(i=ne.nestedProperty(t,r).get(),a=ne.nestedProperty(t._input,r).get()):(i=t,a=t._input);var o=n+\"auto\",s=n+\"min\",u=n+\"max\",c=i[o],h=i[s],f=i[u],p=i.colorscale;!1===c&&void 0!==h||(h=ne.aggNums(Math.min,null,e)),!1===c&&void 0!==f||(f=ne.aggNums(Math.max,null,e)),h===f&&(h-=.5,f+=.5),i[s]=h,i[u]=f,a[s]=h,a[u]=f,a[o]=!1!==c||void 0===h&&void 0===f,i.autocolorscale&&(p=h*f<0?l.RdBu:h>=0?l.Reds:l.Blues,a.colorscale=p,i.reversescale&&(p=je(p)),i.colorscale=p)},Ue=function(t,e,r,n,i){var a=function(t){var e=[\"showexponent\",\"showtickprefix\",\"showticksuffix\"].filter(function(e){return void 0!==t[e]});if(e.every(function(r){return t[r]===t[e[0]]})||1===e.length)return t[e[0]]}(t);if(r(\"tickprefix\")&&r(\"showtickprefix\",a),r(\"ticksuffix\",i.tickSuffixDflt)&&r(\"showticksuffix\",a),r(\"showticklabels\")){var o=i.font||{},s=e.color===t.color?e.color:o.color;if(ne.coerceFont(r,\"tickfont\",{family:o.family,size:o.size,color:s}),r(\"tickangle\"),\"category\"!==n){var l=r(\"tickformat\");!function(t,e){var r,n,i=t.tickformatstops,a=e.tickformatstops=[];if(!Array.isArray(i))return;function o(t,e){return ne.coerce(r,n,Ce.tickformatstops,t,e)}for(var s=0;s<i.length;s++)r=i[s],n={},o(\"dtickrange\"),o(\"value\"),a.push(n)}(t,e),l||\"date\"===n||(r(\"showexponent\",a),r(\"exponentformat\"),r(\"separatethousands\"))}}};var qe=function(t,e,r,n){var i=ne.coerce2(t,e,Ce,\"ticklen\"),a=ne.coerce2(t,e,Ce,\"tickwidth\"),o=ne.coerce2(t,e,Ce,\"tickcolor\",e.color);r(\"ticks\",n.outerTicks||i||a||o?\"outside\":\"\")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)},He=t.ONEDAY,Ge=function(t,e,n,i){var a=\"auto\";\"array\"!==t.tickmode||\"log\"!==i&&\"date\"!==i||(t.tickmode=\"auto\"),Array.isArray(t.tickvals)?a=\"array\":t.dtick&&(a=\"linear\");var o=n(\"tickmode\",a);if(\"auto\"===o)n(\"nticks\");else if(\"linear\"===o){var s=\"date\"===i?He:1,l=n(\"dtick\",s);if(r(l))e.dtick=l>0?Number(l):s;else if(\"string\"!=typeof l)e.dtick=s;else{var u=l.charAt(0),c=l.substr(1);((c=r(c)?Number(c):0)<=0||!(\"date\"===i&&\"M\"===u&&c===Math.round(c)||\"log\"===i&&\"L\"===u||\"log\"===i&&\"D\"===u&&(1===c||2===c)))&&(e.dtick=s)}var h=\"date\"===i?ne.dateTick0(e.calendar):0,f=n(\"tick0\",h);\"date\"===i?e.tick0=ne.cleanDate(f,h):r(f)&&\"D1\"!==l&&\"D2\"!==l?e.tick0=Number(f):e.tick0=h}else{void 0===n(\"tickvals\")?e.tickmode=\"auto\":n(\"ticktext\")}},We=function(t){return void 0!==l[t]||c(t)},Ye=function(t,e,n,i,a){var o,s=a.prefix,l=a.cLetter,u=s.slice(0,s.length-1),c=s?ne.nestedProperty(t,u).get()||{}:t,h=s?ne.nestedProperty(e,u).get()||{}:e,f=c[l+\"min\"],p=c[l+\"max\"],d=c.colorscale;i(s+l+\"auto\",!(r(f)&&r(p)&&f<p)),i(s+l+\"min\"),i(s+l+\"max\"),void 0!==d&&(o=!We(d)),i(s+\"autocolorscale\",o);var g,v,m=i(s+\"colorscale\");(i(s+\"reversescale\")&&(h.colorscale=je(m)),\"marker.line.\"!==s)&&(s&&(v=c,g=ne.isPlainObject(v.colorbar)),i(s+\"showscale\",g)&&function(t,e,r){var n=e.colorbar={},i=t.colorbar||{};function a(t,e){return ne.coerce(i,n,ze,t,e)}a(\"thickness\",\"fraction\"===a(\"thicknessmode\")?30/(r.width-r.margin.l-r.margin.r):30),a(\"len\",\"fraction\"===a(\"lenmode\")?1:r.height-r.margin.t-r.margin.b),a(\"x\"),a(\"xanchor\"),a(\"xpad\"),a(\"y\"),a(\"yanchor\"),a(\"ypad\"),ne.noneOrAll(i,n,[\"x\",\"y\"]),a(\"outlinecolor\"),a(\"outlinewidth\"),a(\"bordercolor\"),a(\"borderwidth\"),a(\"bgcolor\"),Ge(i,n,a,\"linear\");var o={outerTicks:!1,font:r.font};Ue(i,n,a,\"linear\",o),qe(i,n,a,\"linear\",o),a(\"title\",r._dfltTitle.colorbar),ne.coerceFont(a,\"titlefont\",r.font),a(\"titleside\")}(c,h,n))},Xe=function(t,e){var n=e?ne.nestedProperty(t,e).get()||{}:t,i=n.color,a=!1;if(ne.isArrayOrTypedArray(i))for(var o=0;o<i.length;o++)if(r(i[o])){a=!0;break}return ne.isPlainObject(n)&&(a||!0===n.showscale||r(n.cmin)&&r(n.cmax)||We(n.colorscale)||ne.isPlainObject(n.colorbar))};function Ze(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return s(e).toRgbString()}var Je={};Je.scales=l,Je.defaultScale=u,Je.attributes=Pe,Je.handleDefaults=Ye,Je.calc=Ve,Je.hasColorscale=Xe,Je.isValidScale=We,Je.getScale=h,Je.flipScale=je,Je.extractScale=function(t,e,r){for(var n=t.length,i=new Array(n),a=new Array(n),o=0;o<n;o++){var s=t[o];i[o]=e+s[0]*(r-e),a[o]=s[1]}return{domain:i,range:a}},Je.makeColorScaleFunc=function(t,n){n=n||{};for(var i=t.domain,a=t.range,o=a.length,l=new Array(o),u=0;u<o;u++){var c=s(a[u]).toRgb();l[u]=[c.r,c.g,c.b,c.a]}var h,f=e.scale.linear().domain(i).range(l).clamp(!0),p=n.noNumericCheck,d=n.returnArray;return(h=p&&d?f:p?function(t){return Ze(f(t))}:d?function(t){return r(t)?f(t):s(t).isValid()?t:Oe.defaultLine}:function(t){return r(t)?Ze(f(t)):s(t).isValid()?t:Oe.defaultLine}).domain=f.domain,h.range=function(){return a},h};var Ke={circle:{n:0,f:function(t){var r=e.round(t,2);return\"M\"+r+\",0A\"+r+\",\"+r+\" 0 1,1 0,-\"+r+\"A\"+r+\",\"+r+\" 0 0,1 \"+r+\",0Z\"}},square:{n:1,f:function(t){var r=e.round(t,2);return\"M\"+r+\",\"+r+\"H-\"+r+\"V-\"+r+\"H\"+r+\"Z\"}},diamond:{n:2,f:function(t){var r=e.round(1.3*t,2);return\"M\"+r+\",0L0,\"+r+\"L-\"+r+\",0L0,-\"+r+\"Z\"}},cross:{n:3,f:function(t){var r=e.round(.4*t,2),n=e.round(1.2*t,2);return\"M\"+n+\",\"+r+\"H\"+r+\"V\"+n+\"H-\"+r+\"V\"+r+\"H-\"+n+\"V-\"+r+\"H-\"+r+\"V-\"+n+\"H\"+r+\"V-\"+r+\"H\"+n+\"Z\"}},x:{n:4,f:function(t){var r=e.round(.8*t/Math.sqrt(2),2),n=\"l\"+r+\",\"+r,i=\"l\"+r+\",-\"+r,a=\"l-\"+r+\",-\"+r,o=\"l-\"+r+\",\"+r;return\"M0,\"+r+n+i+a+i+a+o+a+o+n+o+n+\"Z\"}},\"triangle-up\":{n:5,f:function(t){var r=e.round(2*t/Math.sqrt(3),2);return\"M-\"+r+\",\"+e.round(t/2,2)+\"H\"+r+\"L0,-\"+e.round(t,2)+\"Z\"}},\"triangle-down\":{n:6,f:function(t){var r=e.round(2*t/Math.sqrt(3),2);return\"M-\"+r+\",-\"+e.round(t/2,2)+\"H\"+r+\"L0,\"+e.round(t,2)+\"Z\"}},\"triangle-left\":{n:7,f:function(t){var r=e.round(2*t/Math.sqrt(3),2);return\"M\"+e.round(t/2,2)+\",-\"+r+\"V\"+r+\"L-\"+e.round(t,2)+\",0Z\"}},\"triangle-right\":{n:8,f:function(t){var r=e.round(2*t/Math.sqrt(3),2);return\"M-\"+e.round(t/2,2)+\",-\"+r+\"V\"+r+\"L\"+e.round(t,2)+\",0Z\"}},\"triangle-ne\":{n:9,f:function(t){var r=e.round(.6*t,2),n=e.round(1.2*t,2);return\"M-\"+n+\",-\"+r+\"H\"+r+\"V\"+n+\"Z\"}},\"triangle-se\":{n:10,f:function(t){var r=e.round(.6*t,2),n=e.round(1.2*t,2);return\"M\"+r+\",-\"+n+\"V\"+r+\"H-\"+n+\"Z\"}},\"triangle-sw\":{n:11,f:function(t){var r=e.round(.6*t,2),n=e.round(1.2*t,2);return\"M\"+n+\",\"+r+\"H-\"+r+\"V-\"+n+\"Z\"}},\"triangle-nw\":{n:12,f:function(t){var r=e.round(.6*t,2),n=e.round(1.2*t,2);return\"M-\"+r+\",\"+n+\"V-\"+r+\"H\"+n+\"Z\"}},pentagon:{n:13,f:function(t){var r=e.round(.951*t,2),n=e.round(.588*t,2),i=e.round(-t,2),a=e.round(-.309*t,2);return\"M\"+r+\",\"+a+\"L\"+n+\",\"+e.round(.809*t,2)+\"H-\"+n+\"L-\"+r+\",\"+a+\"L0,\"+i+\"Z\"}},hexagon:{n:14,f:function(t){var r=e.round(t,2),n=e.round(t/2,2),i=e.round(t*Math.sqrt(3)/2,2);return\"M\"+i+\",-\"+n+\"V\"+n+\"L0,\"+r+\"L-\"+i+\",\"+n+\"V-\"+n+\"L0,-\"+r+\"Z\"}},hexagon2:{n:15,f:function(t){var r=e.round(t,2),n=e.round(t/2,2),i=e.round(t*Math.sqrt(3)/2,2);return\"M-\"+n+\",\"+i+\"H\"+n+\"L\"+r+\",0L\"+n+\",-\"+i+\"H-\"+n+\"L-\"+r+\",0Z\"}},octagon:{n:16,f:function(t){var r=e.round(.924*t,2),n=e.round(.383*t,2);return\"M-\"+n+\",-\"+r+\"H\"+n+\"L\"+r+\",-\"+n+\"V\"+n+\"L\"+n+\",\"+r+\"H-\"+n+\"L-\"+r+\",\"+n+\"V-\"+n+\"Z\"}},star:{n:17,f:function(t){var r=1.4*t,n=e.round(.225*r,2),i=e.round(.951*r,2),a=e.round(.363*r,2),o=e.round(.588*r,2),s=e.round(-r,2),l=e.round(-.309*r,2),u=e.round(.118*r,2),c=e.round(.809*r,2);return\"M\"+n+\",\"+l+\"H\"+i+\"L\"+a+\",\"+u+\"L\"+o+\",\"+c+\"L0,\"+e.round(.382*r,2)+\"L-\"+o+\",\"+c+\"L-\"+a+\",\"+u+\"L-\"+i+\",\"+l+\"H-\"+n+\"L0,\"+s+\"Z\"}},hexagram:{n:18,f:function(t){var r=e.round(.66*t,2),n=e.round(.38*t,2),i=e.round(.76*t,2);return\"M-\"+i+\",0l-\"+n+\",-\"+r+\"h\"+i+\"l\"+n+\",-\"+r+\"l\"+n+\",\"+r+\"h\"+i+\"l-\"+n+\",\"+r+\"l\"+n+\",\"+r+\"h-\"+i+\"l-\"+n+\",\"+r+\"l-\"+n+\",-\"+r+\"h-\"+i+\"Z\"}},\"star-triangle-up\":{n:19,f:function(t){var r=e.round(t*Math.sqrt(3)*.8,2),n=e.round(.8*t,2),i=e.round(1.6*t,2),a=e.round(4*t,2),o=\"A \"+a+\",\"+a+\" 0 0 1 \";return\"M-\"+r+\",\"+n+o+r+\",\"+n+o+\"0,-\"+i+o+\"-\"+r+\",\"+n+\"Z\"}},\"star-triangle-down\":{n:20,f:function(t){var r=e.round(t*Math.sqrt(3)*.8,2),n=e.round(.8*t,2),i=e.round(1.6*t,2),a=e.round(4*t,2),o=\"A \"+a+\",\"+a+\" 0 0 1 \";return\"M\"+r+\",-\"+n+o+\"-\"+r+\",-\"+n+o+\"0,\"+i+o+r+\",-\"+n+\"Z\"}},\"star-square\":{n:21,f:function(t){var r=e.round(1.1*t,2),n=e.round(2*t,2),i=\"A \"+n+\",\"+n+\" 0 0 1 \";return\"M-\"+r+\",-\"+r+i+\"-\"+r+\",\"+r+i+r+\",\"+r+i+r+\",-\"+r+i+\"-\"+r+\",-\"+r+\"Z\"}},\"star-diamond\":{n:22,f:function(t){var r=e.round(1.4*t,2),n=e.round(1.9*t,2),i=\"A \"+n+\",\"+n+\" 0 0 1 \";return\"M-\"+r+\",0\"+i+\"0,\"+r+i+r+\",0\"+i+\"0,-\"+r+i+\"-\"+r+\",0Z\"}},\"diamond-tall\":{n:23,f:function(t){var r=e.round(.7*t,2),n=e.round(1.4*t,2);return\"M0,\"+n+\"L\"+r+\",0L0,-\"+n+\"L-\"+r+\",0Z\"}},\"diamond-wide\":{n:24,f:function(t){var r=e.round(1.4*t,2),n=e.round(.7*t,2);return\"M0,\"+n+\"L\"+r+\",0L0,-\"+n+\"L-\"+r+\",0Z\"}},hourglass:{n:25,f:function(t){var r=e.round(t,2);return\"M\"+r+\",\"+r+\"H-\"+r+\"L\"+r+\",-\"+r+\"H-\"+r+\"Z\"},noDot:!0},bowtie:{n:26,f:function(t){var r=e.round(t,2);return\"M\"+r+\",\"+r+\"V-\"+r+\"L-\"+r+\",\"+r+\"V-\"+r+\"Z\"},noDot:!0},\"circle-cross\":{n:27,f:function(t){var r=e.round(t,2);return\"M0,\"+r+\"V-\"+r+\"M\"+r+\",0H-\"+r+\"M\"+r+\",0A\"+r+\",\"+r+\" 0 1,1 0,-\"+r+\"A\"+r+\",\"+r+\" 0 0,1 \"+r+\",0Z\"},needLine:!0,noDot:!0},\"circle-x\":{n:28,f:function(t){var r=e.round(t,2),n=e.round(t/Math.sqrt(2),2);return\"M\"+n+\",\"+n+\"L-\"+n+\",-\"+n+\"M\"+n+\",-\"+n+\"L-\"+n+\",\"+n+\"M\"+r+\",0A\"+r+\",\"+r+\" 0 1,1 0,-\"+r+\"A\"+r+\",\"+r+\" 0 0,1 \"+r+\",0Z\"},needLine:!0,noDot:!0},\"square-cross\":{n:29,f:function(t){var r=e.round(t,2);return\"M0,\"+r+\"V-\"+r+\"M\"+r+\",0H-\"+r+\"M\"+r+\",\"+r+\"H-\"+r+\"V-\"+r+\"H\"+r+\"Z\"},needLine:!0,noDot:!0},\"square-x\":{n:30,f:function(t){var r=e.round(t,2);return\"M\"+r+\",\"+r+\"L-\"+r+\",-\"+r+\"M\"+r+\",-\"+r+\"L-\"+r+\",\"+r+\"M\"+r+\",\"+r+\"H-\"+r+\"V-\"+r+\"H\"+r+\"Z\"},needLine:!0,noDot:!0},\"diamond-cross\":{n:31,f:function(t){var r=e.round(1.3*t,2);return\"M\"+r+\",0L0,\"+r+\"L-\"+r+\",0L0,-\"+r+\"ZM0,-\"+r+\"V\"+r+\"M-\"+r+\",0H\"+r},needLine:!0,noDot:!0},\"diamond-x\":{n:32,f:function(t){var r=e.round(1.3*t,2),n=e.round(.65*t,2);return\"M\"+r+\",0L0,\"+r+\"L-\"+r+\",0L0,-\"+r+\"ZM-\"+n+\",-\"+n+\"L\"+n+\",\"+n+\"M-\"+n+\",\"+n+\"L\"+n+\",-\"+n},needLine:!0,noDot:!0},\"cross-thin\":{n:33,f:function(t){var r=e.round(1.4*t,2);return\"M0,\"+r+\"V-\"+r+\"M\"+r+\",0H-\"+r},needLine:!0,noDot:!0,noFill:!0},\"x-thin\":{n:34,f:function(t){var r=e.round(t,2);return\"M\"+r+\",\"+r+\"L-\"+r+\",-\"+r+\"M\"+r+\",-\"+r+\"L-\"+r+\",\"+r},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(t){var r=e.round(1.2*t,2),n=e.round(.85*t,2);return\"M0,\"+r+\"V-\"+r+\"M\"+r+\",0H-\"+r+\"M\"+n+\",\"+n+\"L-\"+n+\",-\"+n+\"M\"+n+\",-\"+n+\"L-\"+n+\",\"+n},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(t){var r=e.round(t/2,2),n=e.round(t,2);return\"M\"+r+\",\"+n+\"V-\"+n+\"m-\"+n+\",0V\"+n+\"M\"+n+\",\"+r+\"H-\"+n+\"m0,-\"+n+\"H\"+n},needLine:!0,noFill:!0},\"y-up\":{n:37,f:function(t){var r=e.round(1.2*t,2),n=e.round(1.6*t,2),i=e.round(.8*t,2);return\"M-\"+r+\",\"+i+\"L0,0M\"+r+\",\"+i+\"L0,0M0,-\"+n+\"L0,0\"},needLine:!0,noDot:!0,noFill:!0},\"y-down\":{n:38,f:function(t){var r=e.round(1.2*t,2),n=e.round(1.6*t,2),i=e.round(.8*t,2);return\"M-\"+r+\",-\"+i+\"L0,0M\"+r+\",-\"+i+\"L0,0M0,\"+n+\"L0,0\"},needLine:!0,noDot:!0,noFill:!0},\"y-left\":{n:39,f:function(t){var r=e.round(1.2*t,2),n=e.round(1.6*t,2),i=e.round(.8*t,2);return\"M\"+i+\",\"+r+\"L0,0M\"+i+\",-\"+r+\"L0,0M-\"+n+\",0L0,0\"},needLine:!0,noDot:!0,noFill:!0},\"y-right\":{n:40,f:function(t){var r=e.round(1.2*t,2),n=e.round(1.6*t,2),i=e.round(.8*t,2);return\"M-\"+i+\",\"+r+\"L0,0M-\"+i+\",-\"+r+\"L0,0M\"+n+\",0L0,0\"},needLine:!0,noDot:!0,noFill:!0},\"line-ew\":{n:41,f:function(t){var r=e.round(1.4*t,2);return\"M\"+r+\",0H-\"+r},needLine:!0,noDot:!0,noFill:!0},\"line-ns\":{n:42,f:function(t){var r=e.round(1.4*t,2);return\"M0,\"+r+\"V-\"+r},needLine:!0,noDot:!0,noFill:!0},\"line-ne\":{n:43,f:function(t){var r=e.round(t,2);return\"M\"+r+\",-\"+r+\"L-\"+r+\",\"+r},needLine:!0,noDot:!0,noFill:!0},\"line-nw\":{n:44,f:function(t){var r=e.round(t,2);return\"M\"+r+\",\"+r+\"L-\"+r+\",-\"+r},needLine:!0,noDot:!0,noFill:!0}},Qe={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,MID_SHIFT:.35,OPPOSITE_SIDE:{left:\"right\",right:\"left\",top:\"bottom\",bottom:\"top\"}},$e={xmlns:\"http://www.w3.org/2000/xmlns/\",svg:\"http://www.w3.org/2000/svg\",xlink:\"http://www.w3.org/1999/xlink\"};$e.svgAttrs={xmlns:$e.svg,\"xmlns:xlink\":$e.xlink};var tr={entityToUnicode:{mu:\"\\u03bc\",\"#956\":\"\\u03bc\",amp:\"&\",\"#28\":\"&\",lt:\"<\",\"#60\":\"<\",gt:\">\",\"#62\":\">\",nbsp:\"\\xa0\",\"#160\":\"\\xa0\",times:\"\\xd7\",\"#215\":\"\\xd7\",plusmn:\"\\xb1\",\"#177\":\"\\xb1\",deg:\"\\xb0\",\"#176\":\"\\xb0\"}},er={},rr=Qe.LINE_SPACING;function nr(t,e){return t.node().getBoundingClientRect()[e]}var ir=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;er.convertToTspans=function(t,r,n){var i=t.text(),a=!t.attr(\"data-notex\")&&\"undefined\"!=typeof MathJax&&i.match(ir),o=e.select(t.node().parentNode);if(!o.empty()){var s=t.attr(\"class\")?t.attr(\"class\").split(\" \")[0]:\"text\";return s+=\"-math\",o.selectAll(\"svg.\"+s).remove(),o.selectAll(\"g.\"+s+\"-group\").remove(),t.style(\"display\",null).attr({\"data-unformatted\":i,\"data-math\":\"N\"}),a?(r&&r._promises||[]).push(new Promise(function(r){t.style(\"display\",\"none\");var u=parseInt(t.node().style.fontSize,10),c={fontSize:u};!function(t,r,n){var i=\"math-output-\"+ne.randstr([],64),a=e.select(\"body\").append(\"div\").attr({id:i}).style({visibility:\"hidden\",position:\"absolute\"}).style({\"font-size\":r.fontSize+\"px\"}).text((o=t,o.replace(ar,\"\\\\lt \").replace(or,\"\\\\gt \")));var o;MathJax.Hub.Queue([\"Typeset\",MathJax.Hub,a.node()],function(){var r=e.select(\"body\").select(\"#MathJax_SVG_glyphs\");if(a.select(\".MathJax_SVG\").empty()||!a.select(\"svg\").node())ne.log(\"There was an error in the tex syntax.\",t),n();else{var i=a.select(\"svg\").node().getBoundingClientRect();n(a.select(\".MathJax_SVG\"),r,i)}a.remove()})}(a[2],c,function(e,a,c){o.selectAll(\"svg.\"+s).remove(),o.selectAll(\"g.\"+s+\"-group\").remove();var h=e&&e.select(\"svg\");if(!h||!h.node())return l(),void r();var f=o.append(\"g\").classed(s+\"-group\",!0).attr({\"pointer-events\":\"none\",\"data-unformatted\":i,\"data-math\":\"Y\"});f.node().appendChild(h.node()),a&&a.node()&&h.node().insertBefore(a.node().cloneNode(!0),h.node().firstChild),h.attr({class:s,height:c.height,preserveAspectRatio:\"xMinYMin meet\"}).style({overflow:\"visible\",\"pointer-events\":\"none\"});var p=t.node().style.fill||\"black\";h.select(\"g\").attr({fill:p,stroke:p});var d=nr(h,\"width\"),g=nr(h,\"height\"),v=+t.attr(\"x\")-d*{start:0,middle:.5,end:1}[t.attr(\"text-anchor\")||\"start\"],m=-(u||nr(t,\"height\"))/4;\"y\"===s[0]?(f.attr({transform:\"rotate(\"+[-90,+t.attr(\"x\"),+t.attr(\"y\")]+\") translate(\"+[-d/2,m-g/2]+\")\"}),h.attr({x:+t.attr(\"x\"),y:+t.attr(\"y\")})):\"l\"===s[0]?h.attr({x:t.attr(\"x\"),y:m-g/2}):\"a\"===s[0]?h.attr({x:0,y:m}):h.attr({x:v,y:+t.attr(\"y\")+m-g/2}),n&&n.call(t,f),r(f)})})):l(),t}function l(){o.empty()||(s=t.attr(\"class\")+\"-math\",o.select(\"svg.\"+s).remove()),t.text(\"\").style(\"white-space\",\"pre\"),function(t,r){r=(n=r,function(t,e){if(!t)return\"\";for(var r=0;r<e.length;r++){var n=e[r];t=t.replace(n.regExp,n.sub)}return t}(n,pr)).replace(dr,\" \");var n;var i,a=!1,o=[],s=-1;function l(){s++;var r=document.createElementNS($e.svg,\"tspan\");e.select(r).attr({class:\"line\",dy:s*rr+\"em\"}),t.appendChild(r),i=r;var n=o;if(o=[{node:r}],n.length>1)for(var a=1;a<n.length;a++)u(n[a])}function u(t){var r,n=t.type,a={};if(\"a\"===n){r=\"a\";var s=t.target,l=t.href,u=t.popup;l&&(a={\"xlink:xlink:show\":\"_blank\"===s||\"_\"!==s.charAt(0)?\"new\":\"replace\",target:s,\"xlink:xlink:href\":l},u&&(a.onclick='window.open(this.href.baseVal,this.target.baseVal,\"'+u+'\");return false;'))}else r=\"tspan\";t.style&&(a.style=t.style);var h=document.createElementNS($e.svg,r);if(\"sup\"===n||\"sub\"===n){c(i,cr),i.appendChild(h);var f=document.createElementNS($e.svg,\"tspan\");c(f,cr),e.select(f).attr(\"dy\",ur[n]),a.dy=lr[n],i.appendChild(h),i.appendChild(f)}else i.appendChild(h);e.select(h).attr(a),i=t.node=h,o.push(t)}function c(t,e){t.appendChild(document.createTextNode(e))}function h(t){if(1!==o.length){var e=o.pop();t!==e.type&&ne.log(\"Start tag <\"+e.type+\"> doesnt match end tag <\"+t+\">. Pretending it did match.\",r),i=o[o.length-1].node}else ne.log(\"Ignoring unexpected end tag </\"+t+\">.\",r)}mr.test(r)?l():(i=t,o=[{node:t}]);for(var f=r.split(gr),p=0;p<f.length;p++){var d=f[p],g=d.match(vr),v=g&&g[2].toLowerCase(),m=sr[v];if(\"br\"===v)l();else if(void 0===m)c(i,d);else if(g[1])h(v);else{var y=g[4],x={type:v},b=wr(y,yr);if(b?(b=b.replace(Mr,\"$1 fill:\"),m&&(b+=\";\"+m)):m&&(b=m),b&&(x.style=b),\"a\"===v){a=!0;var _=wr(y,xr);if(_){var w=document.createElement(\"a\");w.href=_,-1!==hr.indexOf(w.protocol)&&(x.href=encodeURI(_),x.target=wr(y,br)||\"_blank\",x.popup=wr(y,_r))}}u(x)}}return a}(t.node(),i)&&t.style(\"pointer-events\",\"all\"),er.positionText(t),n&&n.call(t)}};var ar=/(<|<|<)/g,or=/(>|>|>)/g;var sr={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\"},lr={sub:\"0.3em\",sup:\"-0.6em\"},ur={sub:\"-0.21em\",sup:\"0.42em\"},cr=\"\\u200b\",hr=[\"http:\",\"https:\",\"mailto:\",\"\",void 0,\":\"],fr=new RegExp(\"</?(\"+Object.keys(sr).join(\"|\")+\")( [^>]*)?/?>\",\"g\"),pr=Object.keys(tr.entityToUnicode).map(function(t){return{regExp:new RegExp(\"&\"+t+\";\",\"g\"),sub:tr.entityToUnicode[t]}}),dr=/(\\r\\n?|\\n)/g,gr=/(<[^<>]*>)/,vr=/<(\\/?)([^ >]*)(\\s+(.*))?>/i,mr=/<br(\\s+.*)?>/i,yr=/(^|[\\s\"'])style\\s*=\\s*(\"([^\"]*);?\"|'([^']*);?')/i,xr=/(^|[\\s\"'])href\\s*=\\s*(\"([^\"]*)\"|'([^']*)')/i,br=/(^|[\\s\"'])target\\s*=\\s*(\"([^\"\\s]*)\"|'([^'\\s]*)')/i,_r=/(^|[\\s\"'])popup\\s*=\\s*(\"([\\w=,]*)\"|'([\\w=,]*)')/i;function wr(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}var Mr=/(^|;)\\s*color:/;function Ar(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}}er.plainText=function(t){return(t||\"\").replace(fr,\" \")},er.lineCount=function(t){return t.selectAll(\"tspan.line\").size()||1},er.positionText=function(t,r,n){return t.each(function(){var t=e.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\",r),o=i(\"y\",n);\"text\"===this.nodeName&&t.selectAll(\"tspan.line\").attr({x:a,y:o})})},er.makeEditable=function(t,r){var n=r.gd,i=r.delegate,a=e.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;i=e.select(n).select(\".svg-container\"),s=i.append(\"div\"),u=t.node().style,c=parseFloat(u.fontSize||12),s.classed(\"plugin-editable editable\",!0).style({position:\"absolute\",\"font-family\":u.fontFamily||\"Arial\",\"font-size\":c,color:r.fill||u.fill||\"black\",opacity:1,\"background-color\":r.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(r.text||t.attr(\"data-unformatted\")).call(Ar(t,i,r)).on(\"blur\",function(){n._editing=!1,t.text(this.textContent).style({opacity:1});var r,i=e.select(this).attr(\"class\");(r=i?\".\"+i.split(\" \")[0]+\"-math-group\":\"[class*=-math-group]\")&&e.select(t.node().parentNode).select(r).style({opacity:0});var o=this.textContent;e.select(this).transition().duration(0).remove(),e.select(document).on(\"mouseup\",null),a.edit.call(t,o)}).on(\"focus\",function(){var t=this;n._editing=!0,e.select(document).on(\"mouseup\",function(){if(e.event.target===t)return!1;document.activeElement===s.node()&&s.node().blur()})}).on(\"keyup\",function(){27===e.event.which?(n._editing=!1,t.style({opacity:1}),e.select(this).style({opacity:0}).on(\"blur\",function(){return!1}).transition().remove(),a.cancel.call(t,this.textContent)):(a.input.call(t,this.textContent),e.select(this).call(Ar(t,i,r)))}).on(\"keydown\",function(){13===e.event.which&&this.blur()}).call(l),t.style({opacity:0});var h,f=o.attr(\"class\");(h=f?\".\"+f.split(\" \")[0]+\"-math-group\":\"[class*=-math-group]\")&&e.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 r.immediate?s():o.on(\"click\",s),e.rebind(t,a,\"on\")};var kr=function(t){var e=t.marker,n=e.sizeref||1,i=e.sizemin||0,a=\"area\"===e.sizemode?function(t){return Math.sqrt(t/n)}:function(t){return t/n};return function(t){var e=a(t/2);return r(e)&&e>0?Math.max(e,i):0}},Tr={hasLines:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf(\"lines\")},hasMarkers:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf(\"markers\")},hasText:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf(\"text\")},isBubble:function(t){return ne.isPlainObject(t.marker)&&ne.isArrayOrTypedArray(t.marker.size)}},Sr={},Er=Qe.LINE_SPACING,Cr=f.DESELECTDIM,Lr=Sr={};Lr.font=function(t,e,r,n){ne.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(Oe.fill,n)},Lr.setPosition=function(t,e,r){t.attr(\"x\",e).attr(\"y\",r)},Lr.setSize=function(t,e,r){t.attr(\"width\",e).attr(\"height\",r)},Lr.setRect=function(t,e,r,n,i){t.call(Lr.setPosition,e,r).call(Lr.setSize,n,i)},Lr.translatePoint=function(t,e,n,i){var a=n.c2p(t.x),o=i.c2p(t.y);return!!(r(a)&&r(o)&&e.node())&&(\"text\"===e.node().nodeName?e.attr(\"x\",a).attr(\"y\",o):e.attr(\"transform\",\"translate(\"+a+\",\"+o+\")\"),!0)},Lr.translatePoints=function(t,r,n){t.each(function(t){var i=e.select(this);Lr.translatePoint(t,i,r,n)})},Lr.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr(\"display\",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:\"none\")},Lr.hideOutsideRangePoints=function(t,r,n){if(r._hasClipOnAxisFalse){n=n||\".point,.textpoint\";var i=r.xaxis,a=r.yaxis;t.each(function(r){var o=r[0].trace,s=o.xcalendar,l=o.ycalendar;t.selectAll(n).each(function(t){Lr.hideOutsideRangePoint(t,e.select(this),i,a,s,l)})})}},Lr.crispRound=function(t,e,n){return e&&r(e)?t._context.staticPlot?e:e<1?1:Math.round(e):n||0},Lr.singleLineStyle=function(t,e,r,n,i){e.style(\"fill\",\"none\");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||\"\";Oe.stroke(e,n||a.color),Lr.dashLine(e,s,o)},Lr.lineGroupStyle=function(t,r,n,i){t.style(\"fill\",\"none\").each(function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||\"\";e.select(this).call(Oe.stroke,n||a.color).call(Lr.dashLine,s,o)})},Lr.dashLine=function(t,e,r){r=+r||0,e=Lr.dashStyle(e,r),t.style({\"stroke-dasharray\":e,\"stroke-width\":r+\"px\"})},Lr.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},Lr.singleFillStyle=function(t){var r=(((e.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;r&&t.call(Oe.fill,r)},Lr.fillGroupStyle=function(t){t.style(\"stroke-width\",0).each(function(r){var n=e.select(this);try{n.call(Oe.fill,r[0].trace.fillcolor)}catch(e){ne.error(e,t),n.remove()}})},Lr.symbolNames=[],Lr.symbolFuncs=[],Lr.symbolNeedLines={},Lr.symbolNoDot={},Lr.symbolNoFill={},Lr.symbolList=[],Object.keys(Ke).forEach(function(t){var e=Ke[t];Lr.symbolList=Lr.symbolList.concat([e.n,t,e.n+100,t+\"-open\"]),Lr.symbolNames[e.n]=t,Lr.symbolFuncs[e.n]=e.f,e.needLine&&(Lr.symbolNeedLines[e.n]=!0),e.noDot?Lr.symbolNoDot[e.n]=!0:Lr.symbolList=Lr.symbolList.concat([e.n+200,t+\"-dot\",e.n+300,t+\"-open-dot\"]),e.noFill&&(Lr.symbolNoFill[e.n]=!0)});var zr=Lr.symbolNames.length,Pr=\"M0,0.5L0.5,0L0,-0.5L-0.5,0Z\";function Ir(t,e){var r=t%100;return Lr.symbolFuncs[r](e)+(t>=200?Pr:\"\")}Lr.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=Lr.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=zr||t>=400?0:Math.floor(Math.max(t,0))};var Dr={x1:1,x2:0,y1:0,y2:0},Or={x1:0,x2:0,y1:1,y2:0};Lr.gradient=function(t,r,n,i,a,o){var l=r._fullLayout._defs.select(\".gradients\").selectAll(\"#\"+n).data([i+a+o],ne.identity);l.exit().remove(),l.enter().append(\"radial\"===i?\"radialGradient\":\"linearGradient\").each(function(){var t=e.select(this);\"horizontal\"===i?t.attr(Dr):\"vertical\"===i&&t.attr(Or),t.attr(\"id\",n);var r=s(a),l=s(o);t.append(\"stop\").attr({offset:\"0%\",\"stop-color\":Oe.tinyRGB(l),\"stop-opacity\":l.getAlpha()}),t.append(\"stop\").attr({offset:\"100%\",\"stop-color\":Oe.tinyRGB(r),\"stop-opacity\":r.getAlpha()})}),t.style({fill:\"url(#\"+n+\")\",\"fill-opacity\":null})},Lr.initGradients=function(t){var e=t._fullLayout._defs.selectAll(\".gradients\").data([0]);e.enter().append(\"g\").classed(\"gradients\",!0),e.selectAll(\"linearGradient,radialGradient\").remove()},Lr.singlePointStyle=function(t,e,r,n,i,a){var o=r.marker;!function(t,e,r,n,i,a,o,s){if(P.traceIs(r,\"symbols\")){var l=kr(r);e.attr(\"d\",function(t){var e;e=\"various\"===t.ms||\"various\"===a.size?3:Tr.isBubble(r)?l(t.ms):(a.size||6)/2,t.mrc=e;var n=Lr.symbolNumber(t.mx||a.symbol)||0;return t.om=n%200>=100,Ir(n,e)})}e.style(\"opacity\",function(t){return(t.mo+1||a.opacity+1)-1});var u,c,h,f=!1;if(t.so?(h=o.outlierwidth,c=o.outliercolor,u=a.outliercolor):(h=(t.mlw+1||o.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,c=\"mlc\"in t?t.mlcc=i(t.mlc):ne.isArrayOrTypedArray(o.color)?Oe.defaultLine:o.color,ne.isArrayOrTypedArray(a.color)&&(u=Oe.defaultLine,f=!0),u=\"mc\"in t?t.mcc=n(t.mc):a.color||\"rgba(0,0,0,0)\"),t.om)e.call(Oe.stroke,u).style({\"stroke-width\":(h||1)+\"px\",fill:\"none\"});else{e.style(\"stroke-width\",h+\"px\");var p=a.gradient,d=t.mgt;if(d?f=!0:d=p&&p.type,d&&\"none\"!==d){var g=t.mgc;g?f=!0:g=p.color;var v=\"g\"+s._fullLayout._uid+\"-\"+r.uid;f&&(v+=\"-\"+t.i),e.call(Lr.gradient,s,v,d,u,g)}else e.call(Oe.fill,u);h&&e.call(Oe.stroke,c)}}(t,e,r,n,i,o,o.line,a)},Lr.pointStyle=function(t,r,n){if(t.size()){var i=r.marker,a=Lr.tryColorscale(i,\"\"),o=Lr.tryColorscale(i,\"line\");t.each(function(t){Lr.singlePointStyle(t,e.select(this),r,a,o,n)})}},Lr.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.marker||{},a=r.marker||{},o=n.marker||{},s=i.opacity,l=a.opacity,u=o.opacity,c=void 0!==l,h=void 0!==u;e.opacityFn=function(t){var e=t.mo,r=void 0!==e;if(r||c||h){if(!t.selected)return h?u:Cr*(r?e:s);if(c)return l}};var f=a.color,p=o.color;(f||p)&&(e.colorFn=function(t){if(t.selected){if(f)return f}else if(p)return p});var d=a.size,g=o.size,v=void 0!==d,m=void 0!==g;return(v||m)&&(e.sizeFn=function(t){var e=t.mrc;return t.selected?v?d/2:e:m?g/2:e}),e},Lr.selectedPointStyle=function(t,r){if(t.size()&&r.selectedpoints){var n=Lr.makeSelectedPointStyleFns(r),i=r.marker||{};t.each(function(t){var r=e.select(this),i=n.opacityFn(t);void 0!==i&&r.style(\"opacity\",i)}),n.colorFn&&t.each(function(t){var r=e.select(this),i=n.colorFn(t);i&&Oe.fill(r,i)}),P.traceIs(r,\"symbols\")&&n.sizeFn&&t.each(function(t){var r=e.select(this),a=t.mx||i.symbol||0,o=n.sizeFn(t);r.attr(\"d\",Ir(Lr.symbolNumber(a),o)),t.mrc2=o})}},Lr.tryColorscale=function(t,e){var r=e?ne.nestedProperty(t,e).get():t,n=r.colorscale,i=r.color;return n&&ne.isArrayOrTypedArray(i)?Je.makeColorScaleFunc(Je.extractScale(n,r.cmin,r.cmax)):ne.identity};var Rr={start:1,end:-1,middle:0,bottom:1,top:-1};function Fr(t,r,n,i){var a=e.select(t.node().parentNode),o=-1!==r.indexOf(\"top\")?\"top\":-1!==r.indexOf(\"bottom\")?\"bottom\":\"middle\",s=-1!==r.indexOf(\"left\")?\"end\":-1!==r.indexOf(\"right\")?\"start\":\"middle\",l=i?i/.8+1:0,u=(er.lineCount(t)-1)*Er+1,c=Rr[s]*l,h=.75*n+Rr[o]*l+(Rr[o]-1)*u*n/2;t.attr(\"text-anchor\",s),a.attr(\"transform\",\"translate(\"+c+\",\"+h+\")\")}function Br(t,e){var n=t.ts||e.textfont.size;return r(n)&&n>0?n:0}Lr.textPointStyle=function(t,r,n){t.each(function(t){var i=e.select(this),a=ne.extractOption(t,r,\"tx\",\"text\");if(a){var o=t.tp||r.textposition,s=Br(t,r);i.call(Lr.font,t.tf||r.textfont.family,s,t.tc||r.textfont.color).text(a).call(er.convertToTspans,n).call(Fr,o,s,t.mrc)}else i.remove()})},Lr.selectedTextStyle=function(t,r){if(t.size()&&r.selectedpoints){var n=r.selected||{},i=r.unselected||{};t.each(function(t){var a,o=e.select(this),s=t.tc||r.textfont.color,l=t.tp||r.textposition,u=Br(t,r),c=(n.textfont||{}).color,h=(i.textfont||{}).color;t.selected?c&&(a=c):h?a=h:c||(a=Oe.addOpacity(s,Cr)),a&&Oe.fill(o,a),Fr(o,l,u,t.mrc2||t.mrc)})}};var Nr=.5;function jr(t,r,n,i){var a=t[0]-r[0],o=t[1]-r[1],s=n[0]-r[0],l=n[1]-r[1],u=Math.pow(a*a+o*o,Nr/2),c=Math.pow(s*s+l*l,Nr/2),h=(c*c*a-u*u*s)*i,f=(c*c*o-u*u*l)*i,p=3*c*(u+c),d=3*u*(u+c);return[[e.round(r[0]+(p&&h/p),2),e.round(r[1]+(p&&f/p),2)],[e.round(r[0]-(d&&h/d),2),e.round(r[1]-(d&&f/d),2)]]}Lr.smoothopen=function(t,e){if(t.length<3)return\"M\"+t.join(\"L\");var r,n=\"M\"+t[0],i=[];for(r=1;r<t.length-1;r++)i.push(jr(t[r-1],t[r],t[r+1],e));for(n+=\"Q\"+i[0][0]+\" \"+t[1],r=2;r<t.length-1;r++)n+=\"C\"+i[r-2][1]+\" \"+i[r-1][0]+\" \"+t[r];return n+=\"Q\"+i[t.length-3][1]+\" \"+t[t.length-1]},Lr.smoothclosed=function(t,e){if(t.length<3)return\"M\"+t.join(\"L\")+\"Z\";var r,n=\"M\"+t[0],i=t.length-1,a=[jr(t[i],t[0],t[1],e)];for(r=1;r<i;r++)a.push(jr(t[r-1],t[r],t[r+1],e));for(a.push(jr(t[i-1],t[i],t[0],e)),r=1;r<=i;r++)n+=\"C\"+a[r-1][1]+\" \"+a[r][0]+\" \"+t[r];return n+=\"C\"+a[i][1]+\" \"+a[0][0]+\" \"+t[0]+\"Z\"};var Vr={hv:function(t,r){return\"H\"+e.round(r[0],2)+\"V\"+e.round(r[1],2)},vh:function(t,r){return\"V\"+e.round(r[1],2)+\"H\"+e.round(r[0],2)},hvh:function(t,r){return\"H\"+e.round((t[0]+r[0])/2,2)+\"V\"+e.round(r[1],2)+\"H\"+e.round(r[0],2)},vhv:function(t,r){return\"V\"+e.round((t[1]+r[1])/2,2)+\"H\"+e.round(r[0],2)+\"V\"+e.round(r[1],2)}},Ur=function(t,r){return\"L\"+e.round(r[0],2)+\",\"+e.round(r[1],2)};Lr.steps=function(t){var r=Vr[t]||Ur;return function(t){for(var n=\"M\"+e.round(t[0][0],2)+\",\"+e.round(t[0][1],2),i=1;i<t.length;i++)n+=r(t[i-1],t[i]);return n}},Lr.makeTester=function(){var t=e.select(\"body\").selectAll(\"#js-plotly-tester\").data([0]);t.enter().append(\"svg\").attr(\"id\",\"js-plotly-tester\").attr($e.svgAttrs).style({position:\"absolute\",left:\"-10000px\",top:\"-10000px\",width:\"9000px\",height:\"9000px\",\"z-index\":\"1\"});var r=t.selectAll(\".js-reference-point\").data([0]);r.enter().append(\"path\").classed(\"js-reference-point\",!0).attr(\"d\",\"M0,0H1V1H0Z\").style({\"stroke-width\":0,fill:\"black\"}),Lr.tester=t,Lr.testref=r},Lr.savedBBoxes={};var qr=0;function Hr(t){var e=t.getAttribute(\"data-unformatted\");if(null!==e)return e+t.getAttribute(\"data-math\")+t.getAttribute(\"text-anchor\")+t.getAttribute(\"style\")}Lr.bBox=function(t,r,n){var i,a,o;if(n||(n=Hr(t)),n){if(i=Lr.savedBBoxes[n])return ne.extendFlat({},i)}else if(1===t.childNodes.length){var s=t.childNodes[0];if(n=Hr(s)){var l=+s.getAttribute(\"x\")||0,u=+s.getAttribute(\"y\")||0,c=s.getAttribute(\"transform\");if(!c){var h=Lr.bBox(s,!1,n);return l&&(h.left+=l,h.right+=l),u&&(h.top+=u,h.bottom+=u),h}if(n+=\"~\"+l+\"~\"+u+\"~\"+c,i=Lr.savedBBoxes[n])return ne.extendFlat({},i)}}r?a=t:(o=Lr.tester.node(),a=t.cloneNode(!0),o.appendChild(a)),e.select(a).attr(\"transform\",null).call(er.positionText,0,0);var f=a.getBoundingClientRect(),p=Lr.testref.node().getBoundingClientRect();r||o.removeChild(a);var d={height:f.height,width:f.width,left:f.left-p.left,top:f.top-p.top,right:f.right-p.left,bottom:f.bottom-p.top};return qr>=1e4&&(Lr.savedBBoxes={},qr=0),n&&(Lr.savedBBoxes[n]=d),qr++,ne.extendFlat({},d)},Lr.setClipUrl=function(t,r){if(r){var n=\"#\"+r,i=e.select(\"base\");i.size()&&i.attr(\"href\")&&(n=window.location.href.split(\"#\")[0]+n),t.attr(\"clip-path\",\"url(\"+n+\")\")}else t.attr(\"clip-path\",null)},Lr.getTranslate=function(t){var e=(t[t.attr?\"attr\":\"getAttribute\"](\"transform\")||\"\").replace(/.*\\btranslate\\((-?\\d*\\.?\\d*)[^-\\d]*(-?\\d*\\.?\\d*)[^\\d].*/,function(t,e,r){return[e,r].join(\" \")}).split(\" \");return{x:+e[0]||0,y:+e[1]||0}},Lr.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},Lr.getScale=function(t){var e=(t[t.attr?\"attr\":\"getAttribute\"](\"transform\")||\"\").replace(/.*\\bscale\\((\\d*\\.?\\d*)[^\\d]*(\\d*\\.?\\d*)[^\\d].*/,function(t,e,r){return[e,r].join(\" \")}).split(\" \");return{x:+e[0]||1,y:+e[1]||1}},Lr.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},Lr.setPointGroupScale=function(t,e,r){var n,i,a;return e=e||1,r=r||1,i=1===e&&1===r?\"\":\" scale(\"+e+\",\"+r+\")\",a=/\\s*sc.*/,t.each(function(){n=(this.getAttribute(\"transform\")||\"\").replace(a,\"\"),n=(n+=i).trim(),this.setAttribute(\"transform\",n)}),i};var Gr=/translate\\([^)]*\\)\\s*$/;Lr.setTextPointsScale=function(t,r,n){t.each(function(){var t,i=e.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(Gr);t=1===r&&1===n?[]:[\"translate(\"+o+\",\"+s+\")\",\"scale(\"+r+\",\"+n+\")\",\"translate(\"+-o+\",\"+-s+\")\"],l&&t.push(l),i.attr(\"transform\",t.join(\" \"))}})};var Wr={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20},Yr=Ae.dash,Xr=m.extendFlat,Zr={x:{valType:\"data_array\",editType:\"calc+clearAxisTypes\"},x0:{valType:\"any\",dflt:0,editType:\"calc+clearAxisTypes\"},dx:{valType:\"number\",dflt:1,editType:\"calc\"},y:{valType:\"data_array\",editType:\"calc+clearAxisTypes\"},y0:{valType:\"any\",dflt:0,editType:\"calc+clearAxisTypes\"},dy:{valType:\"number\",dflt:1,editType:\"calc\"},text:{valType:\"string\",dflt:\"\",arrayOk:!0,editType:\"calc\"},hovertext:{valType:\"string\",dflt:\"\",arrayOk:!0,editType:\"style\"},mode:{valType:\"flaglist\",flags:[\"lines\",\"markers\",\"text\"],extras:[\"none\"],editType:\"calc\"},hoveron:{valType:\"flaglist\",flags:[\"points\",\"fills\"],editType:\"style\"},line:{color:{valType:\"color\",editType:\"style\"},width:{valType:\"number\",min:0,dflt:2,editType:\"style\"},shape:{valType:\"enumerated\",values:[\"linear\",\"spline\",\"hv\",\"vh\",\"hvh\",\"vhv\"],dflt:\"linear\",editType:\"plot\"},smoothing:{valType:\"number\",min:0,max:1.3,dflt:1,editType:\"plot\"},dash:Xr({},Yr,{editType:\"style\"}),simplify:{valType:\"boolean\",dflt:!0,editType:\"plot\"},editType:\"plot\"},connectgaps:{valType:\"boolean\",dflt:!1,editType:\"calc\"},cliponaxis:{valType:\"boolean\",dflt:!0,editType:\"plot\"},fill:{valType:\"enumerated\",values:[\"none\",\"tozeroy\",\"tozerox\",\"tonexty\",\"tonextx\",\"toself\",\"tonext\"],dflt:\"none\",editType:\"calc\"},fillcolor:{valType:\"color\",editType:\"style\"},marker:Xr({symbol:{valType:\"enumerated\",values:Sr.symbolList,dflt:\"circle\",arrayOk:!0,editType:\"style\"},opacity:{valType:\"number\",min:0,max:1,arrayOk:!0,editType:\"style\"},size:{valType:\"number\",min:0,dflt:6,arrayOk:!0,editType:\"calcIfAutorange\"},maxdisplayed:{valType:\"number\",min:0,dflt:0,editType:\"plot\"},sizeref:{valType:\"number\",dflt:1,editType:\"calc\"},sizemin:{valType:\"number\",min:0,dflt:0,editType:\"calc\"},sizemode:{valType:\"enumerated\",values:[\"diameter\",\"area\"],dflt:\"diameter\",editType:\"calc\"},showscale:{valType:\"boolean\",dflt:!1,editType:\"calc\"},colorbar:ze,line:Xr({width:{valType:\"number\",min:0,arrayOk:!0,editType:\"style\"},editType:\"calc\"},De()),gradient:{type:{valType:\"enumerated\",values:[\"radial\",\"horizontal\",\"vertical\",\"none\"],arrayOk:!0,dflt:\"none\",editType:\"calc\"},color:{valType:\"color\",arrayOk:!0,editType:\"calc\"},editType:\"calc\"},editType:\"calc\"},De()),selected:{marker:{opacity:{valType:\"number\",min:0,max:1,editType:\"style\"},color:{valType:\"color\",editType:\"style\"},size:{valType:\"number\",min:0,editType:\"style\"},editType:\"style\"},textfont:{color:{valType:\"color\",editType:\"style\"},editType:\"style\"},editType:\"style\"},unselected:{marker:{opacity:{valType:\"number\",min:0,max:1,editType:\"style\"},color:{valType:\"color\",editType:\"style\"},size:{valType:\"number\",min:0,editType:\"style\"},editType:\"style\"},textfont:{color:{valType:\"color\",editType:\"style\"},editType:\"style\"},editType:\"style\"},textposition:{valType:\"enumerated\",values:[\"top left\",\"top center\",\"top right\",\"middle left\",\"middle center\",\"middle right\",\"bottom left\",\"bottom center\",\"bottom right\"],dflt:\"middle center\",arrayOk:!0,editType:\"calc\"},textfont:T({editType:\"calc\",colorEditType:\"style\",arrayOk:!0}),r:{valType:\"data_array\",editType:\"calc\"},t:{valType:\"data_array\",editType:\"calc\"}},Jr=Zr.marker,Kr={r:Zr.r,t:Zr.t,marker:{color:Jr.color,size:Jr.size,symbol:Jr.symbol,opacity:Jr.opacity,editType:\"calc\"}},Qr=m.extendFlat,$r=ye.overrideAll,tn=Qr({},Ce.domain,{});function en(t,e){return Qr({},e,{showline:{valType:\"boolean\"},showticklabels:{valType:\"boolean\"},tickorientation:{valType:\"enumerated\",values:[\"horizontal\",\"vertical\"]},ticklen:{valType:\"number\",min:0},tickcolor:{valType:\"color\"},ticksuffix:{valType:\"string\"},endpadding:{valType:\"number\"},visible:{valType:\"boolean\"}})}var rn=$r({radialaxis:en(0,{range:{valType:\"info_array\",items:[{valType:\"number\"},{valType:\"number\"}]},domain:tn,orientation:{valType:\"number\"}}),angularaxis:en(0,{range:{valType:\"info_array\",items:[{valType:\"number\",dflt:0},{valType:\"number\",dflt:360}]},domain:tn}),layout:{direction:{valType:\"enumerated\",values:[\"clockwise\",\"counterclockwise\"]},orientation:{valType:\"angle\"}}},\"plot\",\"nested\"),nn={},an=ne.extendFlat,on=ne.extendDeepAll,sn=\"_isSubplotObj\",ln=\"_isLinkedToArray\",un=[sn,ln,\"_arrayAttrRegexps\",\"_deprecated\"];function cn(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(hn(e[r]))r++;else if(r<e.length)return!1;for(;r<e.length;r++){var n=t[e[r]];if(!ne.isPlainObject(n))break;if(t=n,r===e.length-1)break;if(t._isLinkedToArray){if(!hn(e[++r]))return!1}else if(\"info_array\"===t.valType){var i=e[++r];if(!hn(i))return!1;var a=t.items;if(Array.isArray(a)){if(i>=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!hn(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function hn(t){return t===Math.round(t)&&t>=0}function fn(t){return function(t){nn.crawl(t,function(t,e,r){nn.isValObject(t)?\"data_array\"===t.valType?(t.role=\"data\",r[e+\"src\"]={valType:\"string\",editType:\"none\"}):!0===t.arrayOk&&(r[e+\"src\"]={valType:\"string\",editType:\"none\"}):ne.isPlainObject(t)&&(t.role=\"object\")})}(t),function(t){nn.crawl(t,function(t,e,r){if(!t)return;var n=t[ln];if(!n)return;delete t[ln],r[e]={items:{}},r[e].items[n]=t,r[e].role=\"object\"})}(t),t}function pn(t,e,r){var n=ne.nestedProperty(t,r),i=on({},e.layoutAttributes);i[sn]=!0,n.set(i)}function dn(t,e,r){var n=ne.nestedProperty(t,r);n.set(on(n.get()||{},e))}nn.IS_SUBPLOT_OBJ=sn,nn.IS_LINKED_TO_ARRAY=ln,nn.DEPRECATED=\"_deprecated\",nn.UNDERSCORE_ATTRS=un,nn.get=function(){var t={};P.allTypes.concat(\"area\").forEach(function(e){t[e]=function(t){var e,r;\"area\"===t?(e={attributes:Kr},r={}):(e=P.modules[t]._module,r=e.basePlotModule);var n={type:null};on(n,E),on(n,e.attributes),r.attributes&&on(n,r.attributes);n.type=t;var i={meta:e.meta||{},attributes:fn(n)};if(e.layoutAttributes){var a={};on(a,e.layoutAttributes),i.layoutAttributes=fn(a)}return i}(e)});var e,r={};return Object.keys(P.transformsRegistry).forEach(function(t){r[t]=function(t){var e=P.transformsRegistry[t],r=on({},e.attributes);return Object.keys(P.componentsRegistry).forEach(function(e){var n=P.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){dn(r,n.schema.transforms[t][e],e)})}),{attributes:fn(r)}}(t)}),{defs:{valObjects:ne.valObjectMeta,metaKeys:un.concat([\"description\",\"role\",\"editType\",\"impliedEdits\"]),editType:{traces:ye.traces,layout:ye.layout},impliedEdits:{}},traces:t,layout:function(){var t,e,r={};for(t in on(r,z),P.subplotsRegistry)if((e=P.subplotsRegistry[t]).layoutAttributes)if(\"cartesian\"===e.name)pn(r,e,\"xaxis\"),pn(r,e,\"yaxis\");else{var n=\"subplot\"===e.attr?e.name:e.attr;pn(r,e,n)}for(t in r=function(t){return an(t,{radialaxis:rn.radialaxis,angularaxis:rn.angularaxis}),an(t,rn.layout),t}(r),P.componentsRegistry){var i=(e=P.componentsRegistry[t]).schema;if(i&&(i.subplots||i.layout)){var a=i.subplots;if(a&&a.xaxis&&!a.yaxis)for(var o in a.xaxis)delete r.yaxis[o]}else e.layoutAttributes&&dn(r,e.layoutAttributes,e.name)}return{layoutAttributes:fn(r)}}(),transforms:r,frames:(e={frames:ne.extendDeepAll({},Me)},fn(e),e.frames),animation:fn(we)}},nn.crawl=function(t,e,r,n){var i=r||0;n=n||\"\",Object.keys(t).forEach(function(r){var a=t[r];if(-1===un.indexOf(r)){var o=(n?n+\".\":\"\")+r;e(a,r,t,i,o),nn.isValObject(a)||ne.isPlainObject(a)&&\"impliedEdits\"!==r&&nn.crawl(a,e,i+1,o)}})},nn.isValObject=function(t){return t&&void 0!==t.valType},nn.findArrayAttributes=function(t){var e=[],r=[];function n(n,i,a,o){if(r=r.slice(0,o).concat([i]),n&&(\"data_array\"===n.valType||!0===n.arrayOk)&&!(\"colorbar\"===r[o-1]&&(\"ticktext\"===i||\"tickvals\"===i))){var s=function(t){return t.join(\".\")}(r),l=ne.nestedProperty(t,s).get();ne.isArrayOrTypedArray(l)&&e.push(s)}}if(nn.crawl(E,n),t._module&&t._module.attributes&&nn.crawl(t._module.attributes,n),t.transforms)for(var i=t.transforms,a=0;a<i.length;a++){var o=i[a]._module;o&&(r=[\"transforms[\"+a+\"]\"],nn.crawl(o.attributes,n,1))}return t._fullInput&&t._fullInput._module&&t._fullInput._module.attributes&&(nn.crawl(t._fullInput._module.attributes,n),e=ne.filterUnique(e)),e},nn.getTraceValObject=function(t,e){var r,n,i=e[0],a=1;if(\"transforms\"===i){if(!Array.isArray(t.transforms))return!1;var o=e[1];if(!hn(o)||o>=t.transforms.length)return!1;n=(r=(P.transformsRegistry[t.transforms[o].type]||{}).attributes)&&r[e[2]],a=3}else if(\"area\"===t.type)n=Kr[i];else{var s=t._module;if(s||(s=(P.modules[t.type||E.type.dflt]||{})._module),!s)return!1;if(!(n=(r=s.attributes)&&r[i])){var l=s.basePlotModule;l&&l.attributes&&(n=l.attributes[i])}n||(n=E[i])}return cn(n,e,a)},nn.getLayoutValObject=function(t,e){return cn(function(t,e){var r,n,i,a,o=t._basePlotModules;if(o){var s;for(r=0;r<o.length;r++){if((i=o[r]).attrRegex&&i.attrRegex.test(e)){if(i.layoutAttrOverrides)return i.layoutAttrOverrides;!s&&i.layoutAttributes&&(s=i.layoutAttributes)}var l=i.baseLayoutAttrOverrides;if(l&&e in l)return l[e]}if(s)return s}var u=t._modules;if(u)for(r=0;r<u.length;r++)if((a=u[r].layoutAttributes)&&e in a)return a[e];for(n in P.componentsRegistry)if(!(i=P.componentsRegistry[n]).schema&&e===i.name)return i.layoutAttributes;if(e in z)return z[e];if(\"radialaxis\"===e||\"angularaxis\"===e)return rn[e];return rn.layout[e]||!1}(t,e[0]),e,1)};var gn={id2name:function(t){if(\"string\"==typeof t&&t.match(Te.AX_ID_PATTERN)){var e=t.substr(1);return\"1\"===e&&(e=\"\"),t.charAt(0)+\"axis\"+e}},name2id:function(t){if(t.match(Te.AX_NAME_PATTERN)){var e=t.substr(5);return\"1\"===e&&(e=\"\"),t.charAt(0)+e}},cleanId:function(t,e){if(t.match(Te.AX_ID_PATTERN)&&(!e||t.charAt(0)===e)){var r=t.substr(1).replace(/^0+/,\"\");return\"1\"===r&&(r=\"\"),t.charAt(0)+r}},list:function(t,e,r){var n=t._fullLayout;if(!n)return[];var i,a=gn.listIds(t,e),o=new Array(a.length);for(i=0;i<a.length;i++){var s=a[i];o[i]=n[s.charAt(0)+\"axis\"+s.substr(1)]}if(!r){var l=n._subplots.gl3d||[];for(i=0;i<l.length;i++){var u=n[l[i]];e?o.push(u[e+\"axis\"]):o.push(u.xaxis,u.yaxis,u.zaxis)}}return o},listIds:function(t,e){var r=t._fullLayout;if(!r)return[];var n=r._subplots;return e?n[e+\"axis\"]:n.xaxis.concat(n.yaxis)},getFromId:function(t,e,r){var n=t._fullLayout;return\"x\"===r?e=e.replace(/y[0-9]*/,\"\"):\"y\"===r&&(e=e.replace(/x[0-9]*/,\"\")),n[gn.id2name(e)]},getFromTrace:function(t,e,r){var n=t._fullLayout,i=null;if(P.traceIs(e,\"gl3d\")){var a=e.scene;\"scene\"===a.substr(0,5)&&(i=n[a][r+\"axis\"])}else i=gn.getFromId(t,e[r+\"axis\"]||r);return i},idSort:function(t,e){var r=t.charAt(0),n=e.charAt(0);return r!==n?r>n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)}},vn={};function mn(t,e,r){var n,i,a,o=!1;if(\"data\"===e.type)n=t._fullData[null!==e.traces?e.traces[0]:0];else{if(\"layout\"!==e.type)return!1;n=t._fullLayout}return i=ne.nestedProperty(n,e.prop).get(),(a=r[e.type]=r[e.type]||{}).hasOwnProperty(e.prop)&&a[e.prop]!==i&&(o=!0),a[e.prop]=i,{changed:o,value:i}}function yn(t,e){var r=[],n=e[0],i={};if(\"string\"==typeof n)i[n]=e[1];else{if(!ne.isPlainObject(n))return r;i=n}return bn(i,function(t,e,n){r.push({type:\"layout\",prop:t,value:n})},\"\",0),r}function xn(t,e){var r,n,i,a,o=[];if(n=e[0],i=e[1],r=e[2],a={},\"string\"==typeof n)a[n]=i;else{if(!ne.isPlainObject(n))return o;a=n,void 0===r&&(r=i)}return void 0===r&&(r=null),bn(a,function(e,n,i){var a;if(Array.isArray(i)){var s=Math.min(i.length,t.data.length);r&&(s=Math.min(s,r.length)),a=[];for(var l=0;l<s;l++)a[l]=r?r[l]:l}else a=r?r.slice(0):null;if(null===a)Array.isArray(i)&&(i=i[0]);else if(Array.isArray(a)){if(!Array.isArray(i)){var u=i;i=[];for(var c=0;c<a.length;c++)i[c]=u}i.length=Math.min(a.length,i.length)}o.push({type:\"data\",prop:e,traces:a,value:i})},\"\",0),o}function bn(t,e,r,n){Object.keys(t).forEach(function(i){var a=t[i];if(\"_\"!==i[0]){var o=r+(n>0?\".\":\"\")+i;ne.isPlainObject(a)?bn(a,e,o,n+1):e(o,i,a)}})}vn.manageCommandObserver=function(t,e,r,n){var i={},a=!0;e&&e._commandObserver&&(i=e._commandObserver),i.cache||(i.cache={}),i.lookupTable={};var o=vn.hasSimpleAPICommandBindings(t,r,i.lookupTable);if(e&&e._commandObserver){if(o)return i;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,i}if(o){mn(t,o,i.cache),i.check=function(){if(a){var e=mn(t,o,i.cache);return e.changed&&n&&void 0!==i.lookupTable[e.value]&&(i.disable(),Promise.resolve(n({value:e.value,type:o.type,prop:o.prop,traces:o.traces,index:i.lookupTable[e.value]})).then(i.enable,i.enable)),e.changed}};for(var s=[\"plotly_relayout\",\"plotly_redraw\",\"plotly_restyle\",\"plotly_update\",\"plotly_animatingframe\",\"plotly_afterplot\"],l=0;l<s.length;l++)t._internalOn(s[l],i.check);i.remove=function(){for(var e=0;e<s.length;e++)t._removeInternalListener(s[e],i.check)}}else ne.log(\"Unable to automatically bind plot updates to API command\"),i.lookupTable={},i.remove=function(){};return i.disable=function(){a=!1},i.enable=function(){a=!0},e&&(e._commandObserver=i),i},vn.hasSimpleAPICommandBindings=function(t,e,r){var n,i,a=e.length;for(n=0;n<a;n++){var o,s=e[n],l=s.method,u=s.args;if(Array.isArray(u)||(u=[]),!l)return!1;var c=vn.computeAPICommandBindings(t,l,u);if(1!==c.length)return!1;if(i){if((o=c[0]).type!==i.type)return!1;if(o.prop!==i.prop)return!1;if(Array.isArray(i.traces)){if(!Array.isArray(o.traces))return!1;o.traces.sort();for(var h=0;h<i.traces.length;h++)if(i.traces[h]!==o.traces[h])return!1}else if(o.prop!==i.prop)return!1}else i=c[0],Array.isArray(i.traces)&&i.traces.sort();var f=(o=c[0]).value;if(Array.isArray(f)){if(1!==f.length)return!1;f=f[0]}r&&(r[f]=n)}return i},vn.executeAPICommand=function(t,e,r){if(\"skip\"===e)return Promise.resolve();var n=P.apiMethodRegistry[e],i=[t];Array.isArray(r)||(r=[]);for(var a=0;a<r.length;a++)i.push(r[a]);return n.apply(null,i).catch(function(t){return ne.warn(\"API call to Plotly.\"+e+\" rejected.\",t),Promise.reject(t)})},vn.computeAPICommandBindings=function(t,e,r){var n;switch(Array.isArray(r)||(r=[]),e){case\"restyle\":n=xn(t,r);break;case\"relayout\":n=yn(t,r);break;case\"update\":n=xn(t,[r[0],r[2]]).concat(yn(t,[r[1]]));break;case\"animate\":n=function(t,e){return Array.isArray(e[0])&&1===e[0].length&&-1!==[\"string\",\"number\"].indexOf(typeof e[0][0])?[{type:\"layout\",prop:\"_currentFrame\",value:e[0][0].toString()}]:[]}(0,r);break;default:n=[]}return n};var _n={},wn=ne._,Mn=t.BADNUM,An=_n={},kn=ne.relinkPrivateKeys;ne.extendFlat(An,P),An.attributes=E,An.attributes.type.values=An.allTypes,An.fontAttrs=T,An.layoutAttributes=z,An.fontWeight=\"normal\";var Tn=An.transformsRegistry;An.executeAPICommand=vn.executeAPICommand,An.computeAPICommandBindings=vn.computeAPICommandBindings,An.manageCommandObserver=vn.manageCommandObserver,An.hasSimpleAPICommandBindings=vn.hasSimpleAPICommandBindings,An.redrawText=function(t){if(!((t=ne.getGraphDiv(t)).data&&t.data[0]&&t.data[0].r))return new Promise(function(e){setTimeout(function(){P.getComponentMethod(\"annotations\",\"draw\")(t),P.getComponentMethod(\"legend\",\"draw\")(t),(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()}),e(An.previousPromises(t))},300)})},An.resize=function(t){return t=ne.getGraphDiv(t),new Promise(function(e,r){t&&!function(t){var e=window.getComputedStyle(t).display;return!e||\"none\"===e}(t)||r(new Error(\"Resize must be passed a displayed plot div element.\")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._redrawTimer=setTimeout(function(){if(t.layout.width&&t.layout.height)e(t);else{delete t.layout.width,delete t.layout.height;var r=t.changed;t.autoplay=!0,P.call(\"relayout\",t,{autosize:!0}).then(function(){t.changed=r,e(t)})}},100)})},An.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then(function(){t._promises=[]})},An.addLinks=function(t){if(t._context.showLink||t._context.showSources){var r=t._fullLayout,n=r._paper.selectAll(\"text.js-plot-link-container\").data([0]);n.enter().append(\"text\").classed(\"js-plot-link-container\",!0).style({\"font-family\":'\"Open Sans\", Arial, sans-serif',\"font-size\":\"12px\",fill:Oe.defaultLine,\"pointer-events\":\"all\"}).each(function(){var t=e.select(this);t.append(\"tspan\").classed(\"js-link-to-tool\",!0),t.append(\"tspan\").classed(\"js-link-spacer\",!0),t.append(\"tspan\").classed(\"js-sourcelinks\",!0)});var i=n.node(),a={y:r._paper.attr(\"height\")-9};document.body.contains(i)&&i.getComputedTextLength()>=r.width-20?(a[\"text-anchor\"]=\"start\",a.x=5):(a[\"text-anchor\"]=\"end\",a.x=r._paper.attr(\"width\")-7),n.attr(a);var o=n.select(\".js-link-to-tool\"),s=n.select(\".js-link-spacer\"),l=n.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(){An.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()&&l.text()?\" - \":\"\")}},An.sendDataToCloud=function(t){t.emit(\"plotly_beforeexport\");var r=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||\"https://plot.ly\",n=e.select(t).append(\"div\").attr(\"id\",\"hiddenform\").style(\"display\",\"none\"),i=n.append(\"form\").attr({action:r+\"/external\",method:\"post\",target:\"_blank\"});return i.append(\"input\").attr({type:\"text\",name:\"data\"}).node().value=An.graphJson(t,!1,\"keepdata\"),i.node().submit(),n.remove(),t.emit(\"plotly_afterexport\"),!1};var Sn,En=[\"days\",\"shortDays\",\"months\",\"shortMonths\",\"periods\",\"dateTime\",\"date\",\"time\",\"decimal\",\"thousands\",\"grouping\",\"currency\"],Cn=[\"year\",\"month\",\"dayMonth\",\"dayMonthYear\"];function Ln(t,e){var r,n,i=t.trace,a=i._arrayAttrs,o={};for(r=0;r<a.length;r++)o[n=a[r]]=ne.nestedProperty(i,n).get().slice();for(t.trace=e,r=0;r<a.length;r++)n=a[r],ne.nestedProperty(t.trace,n).set(o[n])}function zn(t,e){var r=t._context.locale,n=!1,i={};function a(t){for(var r=!0,a=0;a<e.length;a++){var o=e[a];i[o]||(t[o]?i[o]=t[o]:r=!1)}r&&(n=!0)}for(var o=0;o<2;o++){for(var s=t._context.locales,l=0;l<2;l++){var u=(s[r]||{}).format;if(u&&(a(u),n))break;s=P.localeRegistry}var c=r.split(\"-\")[0];if(n||c===r)break;r=c}return n||a(P.localeRegistry.en.format),i}function Pn(t,e,r,n){for(var i=t.transforms,a=[t],o=0;o<i.length;o++){var s=i[o],l=Tn[s.type];l&&l.transform&&(a=l.transform(a,{transform:s,fullTrace:t,fullData:e,layout:r,fullLayout:n,transformIndex:o}))}return a}function In(t){for(var e=0;e<t.length;e++)t[e].clearCalc()}An.supplyDefaults=function(t){var r=t._fullLayout||{};if(r._skipDefaults)delete r._skipDefaults;else{var n,i=t._fullLayout={},a=t.layout||{},o=t._fullData||[],s=t._fullData=[],l=t.data||[],u=t._context||{};t._transitionData||An.createTransitionData(t),i._dfltTitle={plot:wn(t,\"Click to enter Plot title\"),x:wn(t,\"Click to enter X axis title\"),y:wn(t,\"Click to enter Y axis title\"),colorbar:wn(t,\"Click to enter Colorscale title\"),annotation:wn(t,\"new text\")},i._traceWord=wn(t,\"trace\");var c=zn(t,En);if(i._mapboxAccessToken=u.mapboxAccessToken,r._initialAutoSizeIsDone){var h=r.width,f=r.height;An.supplyLayoutGlobalDefaults(a,i,c),a.width||(i.width=h),a.height||(i.height=f)}else{An.supplyLayoutGlobalDefaults(a,i,c);var p=!a.width||!a.height,d=i.autosize,g=u.autosizable;p&&(d||g)?An.plotAutoSize(t,a,i):p&&An.sanitizeMargins(t),!d&&p&&(a.width=i.width,a.height=i.height)}i._d3locale=function(t,r){return t.decimal=r.charAt(0),t.thousands=r.charAt(1),e.locale(t)}(c,i.separators),i._extraFormat=zn(t,Cn),i._initialAutoSizeIsDone=!0,i._dataLength=l.length,i._modules=[],i._basePlotModules=[],i._subplots=function(){var t,e,r={};if(!Sn){Sn=[];var n=P.subplotsRegistry;for(var i in n){var a=n[i],o=a.attr;if(o&&(Sn.push(i),Array.isArray(o)))for(e=0;e<o.length;e++)ne.pushUnique(Sn,o[e])}}for(t=0;t<Sn.length;t++)r[Sn[t]]=[];return r}(),i._globalTransforms=(t._context||{}).globalTransforms,An.supplyDataDefaults(l,s,a,i),i._has=An._hasPlotType.bind(i);var v=i._modules;for(n=0;n<v.length;n++){var m=v[n];m.cleanData&&m.cleanData(s)}if(o.length===l.length)for(n=0;n<s.length;n++)kn(s[n],o[n]);An.supplyLayoutModuleDefaults(a,i,s,t._transitionData),i._hasCartesian=i._has(\"cartesian\"),i._hasGeo=i._has(\"geo\"),i._hasGL3D=i._has(\"gl3d\"),i._hasGL2D=i._has(\"gl2d\"),i._hasTernary=i._has(\"ternary\"),i._hasPie=i._has(\"pie\"),An.cleanPlot(s,i,o,r),An.linkSubplots(s,i,o,r),kn(i,r),An.doAutoMargin(t);var y=gn.list(t);for(n=0;n<y.length;n++){y[n].setScale()}if((t.calcdata||[]).length===s.length)for(n=0;n<s.length;n++){var x=s[n],b=t.calcdata[n][0];b&&b.trace&&(b.trace._hasCalcTransform?Ln(b,x):b.trace=x)}}},An.createTransitionData=function(t){t._transitionData||(t._transitionData={}),t._transitionData._frames||(t._transitionData._frames=[]),t._transitionData._frameHash||(t._transitionData._frameHash={}),t._transitionData._counter||(t._transitionData._counter=0),t._transitionData._interruptCallbacks||(t._transitionData._interruptCallbacks=[])},An._hasPlotType=function(t){var e,r=this._basePlotModules||[];for(e=0;e<r.length;e++){if(r[e].name===t)return!0}var n=this._modules||[];for(e=0;e<n.length;e++){var i=n[e];if(i.categories&&i.categories.indexOf(t)>=0)return!0}return!1},An.cleanPlot=function(t,e,r,n){var i,a,o=n._basePlotModules||[];for(i=0;i<o.length;i++){var s=o[i];s.clean&&s.clean(t,e,r,n)}var l=!!n._paper,u=!!n._infolayer,c=n._has&&n._has(\"gl\"),h=e._has&&e._has(\"gl\");c&&!h&&void 0!==n._glcontainer&&(n._glcontainer.selectAll(\".gl-canvas\").remove(),n._glcanvas=null);t:for(i=0;i<r.length;i++){var f=r[i].uid;for(a=0;a<t.length;a++){if(f===t[a].uid)continue t}var p=\".hm\"+f+\",.contour\"+f+\",.carpet\"+f+\",#clip\"+f+\",.trace\"+f;l&&n._paper.selectAll(p).remove(),u&&(n._infolayer.selectAll(\".cb\"+f).remove(),n._infolayer.selectAll(\"g.rangeslider-container\").selectAll(p).remove())}n._zoomlayer&&n._zoomlayer.selectAll(\".select-outline\").remove()},An.linkSubplots=function(t,e,r,n){var i,a,o,s,l=n._plots||{},u=e._plots={},c=e._subplots,h={_fullData:t,_fullLayout:e},f=c.cartesian.concat(c.gl2d||[]);for(i=0;i<f.length;i++){var p,d=l[o=f[i]],g=gn.getFromId(h,o,\"x\"),v=gn.getFromId(h,o,\"y\");for(d?((p=u[o]=d).xaxis.layer!==g.layer&&(p.xlines.attr(\"d\",null),p.xaxislayer.selectAll(\"*\").remove()),p.yaxis.layer!==v.layer&&(p.ylines.attr(\"d\",null),p.yaxislayer.selectAll(\"*\").remove())):(p=u[o]={}).id=o,p.xaxis=g,p.yaxis=v,p._hasClipOnAxisFalse=!1,a=0;a<t.length;a++){var m=t[a];if(m.xaxis===p.xaxis._id&&m.yaxis===p.yaxis._id&&!1===m.cliponaxis){p._hasClipOnAxisFalse=!0;break}}}var y=gn.list(h,null,!0);for(i=0;i<y.length;i++){var x=null;(s=y[i]).overlaying&&(x=gn.getFromId(h,s.overlaying))&&x.overlaying&&(s.overlaying=!1,x=null),s._mainAxis=x||s,x&&(s.domain=x.domain.slice()),s._anchorAxis=\"free\"===s.anchor?null:gn.getFromId(h,s.anchor)}for(i=0;i<y.length;i++){var b=\"x\"===(s=y[i])._id.charAt(0),_=s._mainAxis._anchorAxis,w=\"\",M=\"\",A=\"\";if(_&&(A=_._mainAxis._id,w=b?s._id+A:A+s._id),!w||-1===f.indexOf(w))for(w=\"\",a=0;a<f.length;a++){var k=(o=f[a]).indexOf(\"y\"),T=b?o.substr(0,k):o.substr(k),S=b?o.substr(k):o.substr(0,k);if(T===s._id){M||(M=o);var E=gn.getFromId(h,S);if(A&&E.overlaying===A){w=o;break}}}s._mainSubplot=w||M}},An.clearExpandedTraceDefaultColors=function(t){var e,r,n;for(r=[],(e=t._module._colorAttrs)||(t._module._colorAttrs=e=[],nn.crawl(t._module.attributes,function(t,n,i,a){r[a]=n,r.length=a+1,\"color\"===t.valType&&void 0===t.dflt&&e.push(r.join(\".\"))})),n=0;n<e.length;n++){ne.nestedProperty(t,\"_input.\"+e[n]).get()||ne.nestedProperty(t,e[n]).set(null)}},An.supplyDataDefaults=function(t,e,r,n){var i,a,o,s=n._modules,l=n._basePlotModules,u=0,c=0;function h(t){e.push(t);var r=t._module;r&&(!0===t.visible&&ne.pushUnique(s,r),ne.pushUnique(l,t._module.basePlotModule),u++,!1!==t._input.visible&&c++)}n._transformModules=[];var f={},p=[];for(i=0;i<t.length;i++){if(o=t[i],(a=An.supplyTraceDefaults(o,c,n,i)).index=i,a._input=o,a._expandedIndex=u,a.transforms&&a.transforms.length)for(var d=Pn(a,e,r,n),g=0;g<d.length;g++){var v=d[g],m=An.supplyTraceDefaults(v,u,n,i);kn(m,v),v.uid=m.uid=a.uid+g,m.index=i,m._input=o,m._fullInput=a,m._expandedIndex=u,m._expandedInput=v,h(m)}else a._fullInput=a,a._expandedInput=a,h(a);P.traceIs(a,\"carpetAxis\")&&(f[a.carpet]=a),P.traceIs(a,\"carpetDependent\")&&p.push(i)}for(i=0;i<p.length;i++)if((a=e[p[i]]).visible){var y=f[a.carpet];a._carpet=y,y&&y.visible?(a.xaxis=y.xaxis,a.yaxis=y.yaxis):a.visible=!1}},An.supplyAnimationDefaults=function(t){var e;t=t||{};var r={};function n(e,n){return ne.coerce(t||{},r,we,e,n)}if(n(\"mode\"),n(\"direction\"),n(\"fromcurrent\"),Array.isArray(t.frame))for(r.frame=[],e=0;e<t.frame.length;e++)r.frame[e]=An.supplyAnimationFrameDefaults(t.frame[e]||{});else r.frame=An.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(r.transition=[],e=0;e<t.transition.length;e++)r.transition[e]=An.supplyAnimationTransitionDefaults(t.transition[e]||{});else r.transition=An.supplyAnimationTransitionDefaults(t.transition||{});return r},An.supplyAnimationFrameDefaults=function(t){var e={};function r(r,n){return ne.coerce(t||{},e,we.frame,r,n)}return r(\"duration\"),r(\"redraw\"),e},An.supplyAnimationTransitionDefaults=function(t){var e={};function r(r,n){return ne.coerce(t||{},e,we.transition,r,n)}return r(\"duration\"),r(\"easing\"),e},An.supplyFrameDefaults=function(t){var e={};function r(r,n){return ne.coerce(t,e,Me,r,n)}return r(\"group\"),r(\"name\"),r(\"traces\"),r(\"baseframe\"),r(\"data\"),r(\"layout\"),e},An.supplyTraceDefaults=function(t,e,r,n){var i,a=r.colorway||Oe.defaults,o={},s=a[e%a.length];function l(e,r){return ne.coerce(t,o,An.attributes,e,r)}var u=l(\"visible\");l(\"type\"),l(\"uid\"),l(\"name\",r._traceWord+\" \"+n);var c=An.getModule(o);if(o._module=c,c){var h=c.basePlotModule,f=h.attr;if(f){var p=r._subplots,d=h.attributes,g=\"\";if(\"gl2d\"!==h.name||u){if(Array.isArray(f))for(i=0;i<f.length;i++){var v=f[i],m=ne.coerce(t,o,d,v);p[v]&&ne.pushUnique(p[v],m),g+=m}else g=ne.coerce(t,o,d,f);p[h.name]&&ne.pushUnique(p[h.name],g)}}}return u&&(l(\"customdata\"),l(\"ids\"),P.traceIs(o,\"showLegend\")&&(l(\"showlegend\"),l(\"legendgroup\")),P.getComponentMethod(\"fx\",\"supplyDefaults\")(t,o,s,r),c&&(c.supplyDefaults(t,o,s,r),ne.coerceHoverinfo(t,o,r)),P.traceIs(o,\"noOpacity\")||l(\"opacity\"),P.traceIs(o,\"notLegendIsolatable\")&&(o.visible=!!o.visible),c&&c.selectPoints&&l(\"selectedpoints\"),An.supplyTransformDefaults(t,o,r)),o},An.supplyTransformDefaults=function(t,e,r){var n=r._globalTransforms||[],i=r._transformModules||[];if(Array.isArray(t.transforms)||0!==n.length)for(var a=t.transforms||[],o=n.concat(a),s=e.transforms=[],l=0;l<o.length;l++){var u,c=o[l],h=c.type,f=Tn[h],p=!(c._module&&c._module===f),d=f&&\"function\"==typeof f.transform;f||ne.warn(\"Unrecognized transform type \"+h+\".\"),f&&f.supplyDefaults&&(p||d)?((u=f.supplyDefaults(c,e,r,t)).type=h,u._module=f,ne.pushUnique(i,f)):u=ne.extendFlat({},c),s.push(u)}},An.supplyLayoutGlobalDefaults=function(t,e,r){function n(r,n){return ne.coerce(t,e,An.layoutAttributes,r,n)}var i=ne.coerceFont(n,\"font\");n(\"title\",e._dfltTitle.plot),ne.coerceFont(n,\"titlefont\",{family:i.family,size:Math.round(1.4*i.size),color:i.color}),n(\"autosize\",!(t.width&&t.height)),n(\"width\"),n(\"height\"),n(\"margin.l\"),n(\"margin.r\"),n(\"margin.t\"),n(\"margin.b\"),n(\"margin.pad\"),n(\"margin.autoexpand\"),t.width&&t.height&&An.sanitizeMargins(e),P.getComponentMethod(\"grid\",\"sizeDefaults\")(t,e),n(\"paper_bgcolor\"),n(\"separators\",r.decimal+r.thousands),n(\"hidesources\"),n(\"colorway\"),n(\"datarevision\"),P.getComponentMethod(\"calendars\",\"handleDefaults\")(t,e,\"calendar\"),P.getComponentMethod(\"fx\",\"supplyLayoutGlobalDefaults\")(t,e,n)},An.plotAutoSize=function(t,e,n){var i,a,o=t._context||{},s=o.frameMargins,l=ne.isPlotDiv(t);if(l&&t.emit(\"plotly_autosize\"),o.fillFrame)i=window.innerWidth,a=window.innerHeight,document.body.style.overflow=\"hidden\";else if(r(s)&&s>0){var u=function(t){var e,r={left:0,right:0,bottom:0,top:0};if(t)for(e in t)t.hasOwnProperty(e)&&(r.left+=t[e].left||0,r.right+=t[e].right||0,r.bottom+=t[e].bottom||0,r.top+=t[e].top||0);return r}(t._boundingBoxMargins),c=u.left+u.right,h=u.bottom+u.top,f=1-2*s,p=n._container&&n._container.node?n._container.node().getBoundingClientRect():{width:n.width,height:n.height};i=Math.round(f*(p.width-c)),a=Math.round(f*(p.height-h))}else{var d=l?window.getComputedStyle(t):{};i=parseFloat(d.width)||n.width,a=parseFloat(d.height)||n.height}var g=An.layoutAttributes.width.min,v=An.layoutAttributes.height.min;i<g&&(i=g),a<v&&(a=v);var m=!e.width&&Math.abs(n.width-i)>1,y=!e.height&&Math.abs(n.height-a)>1;(y||m)&&(m&&(n.width=i),y&&(n.height=a)),t._initialAutoSize||(t._initialAutoSize={width:i,height:a}),An.sanitizeMargins(n)},An.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,s=P.componentsRegistry,l=e._basePlotModules,u=P.subplotsRegistry.cartesian;for(i in s)(o=s[i]).includeBasePlot&&o.includeBasePlot(t,e);for(var c in l.length||l.push(u),e._has(\"cartesian\")&&(P.getComponentMethod(\"grid\",\"contentDefaults\")(t,e),u.finalizeSubplots(t,e)),e._subplots)e._subplots[c].sort(ne.subplotSort);for(a=0;a<l.length;a++)(o=l[a]).supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r);var h=e._modules;for(a=0;a<h.length;a++)(o=h[a]).supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r);var f=e._transformModules;for(a=0;a<f.length;a++)(o=f[a]).supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r,n);for(i in s)(o=s[i]).supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r)},An.purge=function(t){var e=t._fullLayout||{};void 0!==e._glcontainer&&(e._glcontainer.selectAll(\".gl-canvas\").remove(),e._glcontainer.remove(),e._glcanvas=null),void 0!==e._geocontainer&&e._geocontainer.remove(),e._modeBar&&e._modeBar.destroy(),t._transitionData&&(t._transitionData._interruptCallbacks&&(t._transitionData._interruptCallbacks.length=0),t._transitionData._animationRaf&&window.cancelAnimationFrame(t._transitionData._animationRaf)),ne.clearThrottle(),delete t.data,delete t.layout,delete t._fullData,delete t._fullLayout,delete t.calcdata,delete t.framework,delete t.empty,delete t.fid,delete t.undoqueue,delete t.undonum,delete t.autoplay,delete t.changed,delete t._promises,delete t._redrawTimer,delete t.firstscatter,delete t._hmlumcount,delete t._hmpixcount,delete t._transitionData,delete t._transitioning,delete t._initialAutoSize,delete t._transitioningWithDuration,delete t._dragging,delete t._dragged,delete t._hoverdata,delete t._snapshotInProgress,delete t._editing,delete t._replotPending,delete t._mouseDownTime,delete t._legendMouseDownTime,t.removeAllListeners&&t.removeAllListeners()},An.style=function(t){var e,r=t._fullLayout._modules,n=[];for(e=0;e<r.length;e++){var i=r[e];i.style&&ne.pushUnique(n,i.style)}for(e=0;e<n.length;e++)n[e](t)},An.sanitizeMargins=function(t){if(t&&t.margin){var e,r=t.width,n=t.height,i=t.margin,a=r-(i.l+i.r),o=n-(i.t+i.b);a<0&&(e=(r-1)/(i.l+i.r),i.l=Math.floor(e*i.l),i.r=Math.floor(e*i.r)),o<0&&(e=(n-1)/(i.t+i.b),i.t=Math.floor(e*i.t),i.b=Math.floor(e*i.b))}},An.autoMargin=function(t,e,r){var n=t._fullLayout;if(n._pushmargin||(n._pushmargin={}),!1!==n.margin.autoexpand){if(r){var i=void 0===r.pad?12:r.pad;r.l+r.r>.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];n._replotting||An.doAutoMargin(t)}},An.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var n=e._size,i=JSON.stringify(n),a=Math.max(e.margin.l||0,0),o=Math.max(e.margin.r||0,0),s=Math.max(e.margin.t||0,0),l=Math.max(e.margin.b||0,0),u=e._pushmargin;if(!1!==e.margin.autoexpand)for(var c in u.base={l:{val:0,size:a},r:{val:1,size:o},t:{val:1,size:s},b:{val:0,size:l}},u){var h=u[c].l||{},f=u[c].b||{},p=h.val,d=h.size,g=f.val,v=f.size;for(var m in u){if(r(d)&&u[m].r){var y=u[m].r.val,x=u[m].r.size;if(y>p){var b=(d*y+(x-e.width)*p)/(y-p),_=(x*(1-p)+(d-e.width)*(1-y))/(y-p);b>=0&&_>=0&&b+_>a+o&&(a=b,o=_)}}if(r(v)&&u[m].t){var w=u[m].t.val,M=u[m].t.size;if(w>g){var A=(v*w+(M-e.height)*g)/(w-g),k=(M*(1-g)+(v-e.height)*(1-w))/(w-g);A>=0&&k>=0&&A+k>l+s&&(l=A,s=k)}}}}if(n.l=Math.round(a),n.r=Math.round(o),n.t=Math.round(s),n.b=Math.round(l),n.p=Math.round(e.margin.pad),n.w=Math.round(e.width)-n.l-n.r,n.h=Math.round(e.height)-n.t-n.b,!e._replotting&&\"{}\"!==i&&i!==JSON.stringify(e._size))return P.call(\"plot\",t)},An.graphJson=function(t,e,r,n,i){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&An.supplyDefaults(t);var a=i?t._fullData:t.data,o=i?t._fullLayout:t.layout,s=(t._transitionData||{})._frames;function l(t){if(\"function\"==typeof t)return null;if(ne.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&&!ne.isPlainObject(t.stream))continue}else if(\"keepall\"!==r&&\"string\"==typeof(n=t[e+\"src\"])&&n.indexOf(\":\")>0)continue;i[e]=l(t[e])}return i}return Array.isArray(t)?t.map(l):ne.isJSDate(t)?ne.ms2DateTimeLocal(+t):t}var u={data:(a||[]).map(function(t){var r=l(t);return e&&delete r.fit,r})};return e||(u.layout=l(o)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),s&&(u.frames=l(s)),\"object\"===n?u:JSON.stringify(u)},An.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r<e.length;r++)switch((n=e[r]).type){case\"replace\":i=n.value;var s=(a[n.index]||{}).name,l=i.name;a[n.index]=o[l]=i,l!==s&&(delete o[s],o[l]=i);break;case\"insert\":o[(i=n.value).name]=i,a.splice(n.index,0,i);break;case\"delete\":delete o[(i=a[n.index]).name],a.splice(n.index,1)}return Promise.resolve()},An.computeFrame=function(t,e){var r,n,i,a,o=t._transitionData._frameHash;if(!e)throw new Error(\"computeFrame must be given a string frame name\");var s=o[e.toString()];if(!s)return!1;for(var l=[s],u=[s.name];s.baseframe&&(s=o[s.baseframe.toString()])&&-1===u.indexOf(s.name);)l.push(s),u.push(s.name);for(var c={};s=l.pop();)if(s.layout&&(c.layout=An.extendLayout(c.layout,s.layout)),s.data){if(c.data||(c.data=[]),!(n=s.traces))for(n=[],r=0;r<s.data.length;r++)n[r]=r;for(c.traces||(c.traces=[]),r=0;r<s.data.length;r++)void 0!==(i=n[r])&&null!==i&&(-1===(a=c.traces.indexOf(i))&&(a=c.data.length,c.traces[a]=i),c.data[a]=An.extendTrace(c.data[a],s.data[r]))}return c},An.recomputeFrameHash=function(t){for(var e=t._transitionData._frameHash={},r=t._transitionData._frames,n=0;n<r.length;n++){var i=r[n];i&&i.name&&(e[i.name]=i)}},An.extendObjectWithContainers=function(t,e,r){var n,i,a,o,s,l,u,c=ne.extendDeepNoArrays({},e||{}),h=ne.expandObjectPaths(c),f={};if(r&&r.length)for(a=0;a<r.length;a++)void 0===(i=(n=ne.nestedProperty(h,r[a])).get())?ne.nestedProperty(f,r[a]).set(null):(n.set(null),ne.nestedProperty(f,r[a]).set(i));if(t=ne.extendDeepNoArrays(t||{},h),r&&r.length)for(a=0;a<r.length;a++)if(l=ne.nestedProperty(f,r[a]).get()){for(u=(s=ne.nestedProperty(t,r[a])).get(),Array.isArray(u)||(u=[],s.set(u)),o=0;o<l.length;o++){var p=l[o];u[o]=null===p?null:An.extendObjectWithContainers(u[o],p)}s.set(u)}return t},An.dataArrayContainers=[\"transforms\",\"dimensions\"],An.layoutArrayContainers=P.layoutArrayContainers,An.extendTrace=function(t,e){return An.extendObjectWithContainers(t,e,An.dataArrayContainers)},An.extendLayout=function(t,e){return An.extendObjectWithContainers(t,e,An.layoutArrayContainers)},An.transition=function(t,e,r,n,i,a){var o,s,l=Array.isArray(e)?e.length:0,u=n.slice(0,l),c=[];var h=!1;for(o=0;o<u.length;o++){s=u[o];t._fullData[s]._module}var f=[An.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)},function(){var n;for(n=0;n<u.length;n++){var i=u[n],a=t._fullData[i]._module;a&&(a.animatable&&c.push(i),t.data[u[n]]=An.extendTrace(t.data[u[n]],e[n]))}var o=ne.expandObjectPaths(ne.extendDeepNoArrays({},r)),s=/^[xy]axis[0-9]*$/;for(var l in o)s.test(l)&&delete o[l].range;return An.extendLayout(t.layout,o),delete t.calcdata,An.supplyDefaults(t),An.doCalcdata(t),P.getComponentMethod(\"errorbars\",\"calc\")(t),Promise.resolve()},An.rehover,function(){return t.emit(\"plotly_transitioning\",[]),new Promise(function(e){t._transitioning=!0,a.duration>0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){h=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return P.call(\"redraw\",t)}),t._transitionData._interruptCallbacks.push(function(){t.emit(\"plotly_transitioninterrupted\",[])});var n,o,s=0,l=0;function u(){return s++,function(){var r;h||++l!==s||(r=e,t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(i.redraw)return P.call(\"redraw\",t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit(\"plotly_transitioned\",[])}).then(r)))}}var f=t._fullLayout._basePlotModules,p=!1;if(r)for(o=0;o<f.length;o++)if(f[o].transitionAxes){var d=ne.expandObjectPaths(r);p=f[o].transitionAxes(t,d,a,u)||p}for(p?(n=ne.extendFlat({},a)).duration=0:n=a,o=0;o<f.length;o++)f[o].plot(t,c,n,u);setTimeout(u())})}],p=ne.syncOrAsync(f,t);return p&&p.then||(p=Promise.resolve()),p.then(function(){return t})},An.doCalcdata=function(t,e){var r,n,i,a,o=gn.list(t),s=t._fullData,l=t._fullLayout,u=new Array(s.length),c=(t.calcdata||[]).slice(0);for(t.calcdata=u,t.firstscatter=!0,l._numBoxes=0,l._numViolins=0,l._violinScaleGroupStats={},t._hmpixcount=0,t._hmlumcount=0,l._piecolormap={},l._piecolorway=null,l._piedefaultcolorcount=0,i=0;i<s.length;i++)Array.isArray(e)&&-1===e.indexOf(i)&&(u[i]=c[i]);for(i=0;i<s.length;i++)(r=s[i])._arrayAttrs=nn.findArrayAttributes(r);var h=l._subplots.polar||[];for(i=0;i<h.length;i++)o.push(l[h[i]].radialaxis,l[h[i]].angularaxis);In(o);var f=!1;for(i=0;i<s.length;i++)if(!0===(r=s[i]).visible&&r.transforms)for((n=r._module)&&n.calc&&n.calc(t,r),a=0;a<r.transforms.length;a++){var p=r.transforms[a];(n=Tn[p.type])&&n.calcTransform&&(r._hasCalcTransform=!0,f=!0,n.calcTransform(t,r,p))}for(f&&In(o),i=0;i<s.length;i++){var d=[];if(!0===(r=s[i]).visible){n=r._module;var g=r.transforms||[];for(a=g.length-1;a>=0;a--)if(g[a].enabled){r._indexToPoints=g[a]._indexToPoints;break}n&&n.calc&&(d=n.calc(t,r))}Array.isArray(d)&&d[0]||(d=[{x:Mn,y:Mn}]),d[0].t||(d[0].t={}),d[0].trace=r,u[i]=d}P.getComponentMethod(\"fx\",\"calc\")(t)},An.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},An.generalUpdatePerTraceModule=function(t,e,r,n){var i,a=e.traceHash,o={};for(i=0;i<r.length;i++){var s=r[i],l=s[0].trace;l.visible&&(o[l.type]=o[l.type]||[],o[l.type].push(s))}for(var u in a)if(!o[u]){var c=a[u][0];c[0].trace.visible=!1,o[u]=[c]}for(var h in o){var f=o[h];f[0][0].trace._module.plot(t,e,ne.filterVisible(f),n)}e.traceHash=o};var Dn={draw:function(t,n,i){var a,o=i.propContainer,s=i.propName,l=i.placeholder,u=i.traceIndex,c=i.avoid||{},h=i.attributes,p=i.transform,d=i.containerGroup,g=t._fullLayout,v=o.titlefont||{},m=v.family,y=v.size,x=v.color,b=1,_=!1,w=(o.title||\"\").trim();\"title\"===s?a=\"titleText\":-1!==s.indexOf(\"axis\")?a=\"axisTitleText\":s.indexOf(!0)&&(a=\"colorbarTitleText\");var M=t._context.edits[a];\"\"===w?b=0:w.replace(On,\" % \")===l.replace(On,\" % \")&&(b=.2,_=!0,M||(w=\"\"));var A=w||M;d||(d=g._infolayer.selectAll(\".g-\"+n).data([0])).enter().append(\"g\").classed(\"g-\"+n,!0);var k=d.selectAll(\"text\").data(A?[0]:[]);if(k.enter().append(\"text\"),k.text(w).attr(\"class\",n),k.exit().remove(),!A)return d;function T(t){ne.syncOrAsync([S,E],t)}function S(r){var n;return p?(n=\"\",p.rotate&&(n+=\"rotate(\"+[p.rotate,h.x,h.y]+\")\"),p.offset&&(n+=\"translate(0, \"+p.offset+\")\")):n=null,r.attr(\"transform\",n),r.style({\"font-family\":m,\"font-size\":e.round(y,2)+\"px\",fill:Oe.rgb(x),opacity:b*Oe.opacity(x),\"font-weight\":_n.fontWeight}).attr(h).call(er.convertToTspans,t),_n.previousPromises(t)}function E(t){var n=e.select(t.node().parentNode);if(c&&c.selection&&c.side&&w){n.attr(\"transform\",null);var i=0,a={left:\"right\",right:\"left\",top:\"bottom\",bottom:\"top\"}[c.side],o=-1!==[\"left\",\"top\"].indexOf(c.side)?-1:1,s=r(c.pad)?c.pad:2,l=Sr.bBox(n.node()),u={left:0,top:0,right:g.width,bottom:g.height},h=c.maxShift||(u[c.side]-l[c.side])*(\"left\"===c.side||\"top\"===c.side?-1:1);if(h<0)i=h;else{var f=c.offsetLeft||0,p=c.offsetTop||0;l.left-=f,l.right-=f,l.top-=p,l.bottom-=p,c.selection.each(function(){var t=Sr.bBox(this);ne.bBoxIntersect(l,t,s)&&(i=Math.max(i,o*(t[c.side]-l[a])+s))}),i=Math.min(h,i)}if(i>0||h<0){var d={left:[-i,0],right:[i,0],top:[0,-i],bottom:[0,i]}[c.side];n.attr(\"transform\",\"translate(\"+d+\")\")}}}k.call(T),M&&(w?k.on(\".opacity\",null):(b=0,_=!0,k.text(l).on(\"mouseover.opacity\",function(){e.select(this).transition().duration(f.SHOW_PLACEHOLDER).style(\"opacity\",1)}).on(\"mouseout.opacity\",function(){e.select(this).transition().duration(f.HIDE_PLACEHOLDER).style(\"opacity\",0)})),k.call(er.makeEditable,{gd:t}).on(\"edit\",function(e){void 0!==u?P.call(\"restyle\",t,s,e,u):P.call(\"relayout\",t,s,e)}).on(\"cancel\",function(){this.text(this.attr(\"data-unformatted\")).call(T)}).on(\"input\",function(t){this.text(t||\" \").call(er.positionText,h.x,h.y)}));return k.classed(\"js-placeholder\",_),d}},On=/ [XY][0-9]* /;var Rn=t.FP_SAFE,Fn=Vn,Bn=Un,Nn=function(t){t._length||t.setScale();var e,r=t._min&&t._max&&t._min.length&&t._max.length;t.autorange&&r&&(t.range=Vn(t),t._r=t.range.slice(),t._rl=ne.simpleMap(t._r,t.r2l),(e=t._input).range=t.range.slice(),e.autorange=t.autorange);if(t._anchorAxis&&t._anchorAxis.rangeslider){var n=t._anchorAxis.rangeslider[t._name];n&&\"auto\"===n.rangemode&&(n.range=r?Vn(t):t._rangeInitial?t._rangeInitial.slice():t.range.slice()),(e=t._anchorAxis._input).rangeslider[t._name]=ne.extendFlat({},n)}},jn=function(t,e,n){if(!function(t){return t.autorange||t._rangesliderAutorange}(t)||!e)return;t._min||(t._min=[]);t._max||(t._max=[]);n||(n={});t._m||t.setScale();var i,a,o,s,l,u,c,h,f,p,d,g,v=e.length,m=n.padded||!1,y=n.tozero&&(\"linear\"===t.type||\"-\"===t.type),x=\"log\"===t.type,b=!1;function _(t){if(Array.isArray(t))return b=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var w=_((t._m>0?n.ppadplus:n.ppadminus)||n.ppad||0),M=_((t._m>0?n.ppadminus:n.ppadplus)||n.ppad||0),A=_(n.vpadplus||n.vpad),k=_(n.vpadminus||n.vpad);if(!b){if(d=1/0,g=-1/0,x)for(i=0;i<v;i++)(s=e[i])<d&&s>0&&(d=s),s>g&&s<Rn&&(g=s);else for(i=0;i<v;i++)(s=e[i])<d&&s>-Rn&&(d=s),s>g&&s<Rn&&(g=s);e=[d,g],v=2}function T(n){if(l=e[n],r(l))for(h=w(n),f=M(n),d=l-k(n),g=l+A(n),x&&d<g/10&&(d=g/10),u=t.c2l(d),c=t.c2l(g),y&&(u=Math.min(0,u),c=Math.max(0,c)),o=0;o<2;o++){var i=o?c:u;if(qn(i)){var v=o?t._max:t._min,b=o?h:f,_=o?Gn:Hn;for(p=!0,a=0;a<v.length&&p;a++){if(s=v[a],_(s.val,i)&&s.pad>=b&&(s.extrapad||!m)){p=!1;break}_(i,s.val)&&s.pad<=b&&(m||!s.extrapad)&&(v.splice(a,1),a--)}if(p){var T=y&&0===i;v.push({val:i,pad:T?0:b,extrapad:!T&&m})}}}}var S=Math.min(6,v);for(i=0;i<S;i++)T(i);for(i=v-1;i>=S;i--)T(i)};function Vn(t){var e,r,n,i,a,o,s,l,u=[],c=t._min[0].val,h=t._max[0].val,f=0,p=!1,d=Un(t);for(e=1;e<t._min.length&&c===h;e++)c=Math.min(c,t._min[e].val);for(e=1;e<t._max.length&&c===h;e++)h=Math.max(h,t._max[e].val);if(t.range){var g=ne.simpleMap(t.range,t.r2l);p=g[1]<g[0]}for(\"reversed\"===t.autorange&&(p=!0,t.autorange=!0),e=0;e<t._min.length;e++)for(n=t._min[e],r=0;r<t._max.length;r++)l=(i=t._max[r]).val-n.val,s=t._length-d(n)-d(i),l>0&&s>0&&l/s>f&&(a=n,o=i,f=l/s);if(c===h){var v=c-1,m=c+1;u=\"tozero\"===t.rangemode?c<0?[v,0]:[0,m]:\"nonnegative\"===t.rangemode?[Math.max(0,v),Math.max(0,m)]:[v,m]}else f&&(\"linear\"!==t.type&&\"-\"!==t.type||(\"tozero\"===t.rangemode?(a.val>=0&&(a={val:0,pad:0}),o.val<=0&&(o={val:0,pad:0})):\"nonnegative\"===t.rangemode&&(a.val-f*d(a)<0&&(a={val:0,pad:0}),o.val<0&&(o={val:1,pad:0})),f=(o.val-a.val)/(t._length-d(a)-d(o))),u=[a.val-f*d(a),o.val+f*d(o)]);return u[0]===u[1]&&(\"tozero\"===t.rangemode?u=u[0]<0?[u[0],0]:u[0]>0?[0,u[0]]:[0,1]:(u=[u[0]-1,u[0]+1],\"nonnegative\"===t.rangemode&&(u[0]=Math.max(0,u[0])))),p&&u.reverse(),ne.simpleMap(u,t.l2r||Number)}function Un(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 qn(t){return r(t)&&Math.abs(t)<Rn}function Hn(t,e){return t<=e}function Gn(t,e){return t>=e}var Wn=t.BADNUM,Yn=function(t,e){return function(t,e){for(var n,i=0,a=0,o=Math.max(1,(t.length-1)/1e3),s=0;s<t.length;s+=o)n=t[Math.round(s)],ne.isDateTime(n,e)&&(i+=1),r(n)&&(a+=1);return i>2*a}(t,e)?\"date\":function(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,i=0,a=0;a<t.length;a+=r)e=t[Math.round(a)],ne.cleanNumber(e)!==Wn?n++:\"string\"==typeof e&&\"\"!==e&&\"None\"!==e&&i++;return i>2*n}(t)?\"category\":function(t){if(!t)return!1;for(var e=0;e<t.length;e++)if(r(t[e]))return!0;return!1}(t)?\"linear\":\"-\"};var Xn=ne.cleanNumber,Zn=ne.ms2DateTime,Jn=ne.dateTime2ms,Kn=ne.ensureNumber,Qn=t.FP_SAFE,$n=t.BADNUM;function ti(t){return Math.pow(10,t)}var ei=function(t,n){n=n||{};var i=(t._id||\"x\").charAt(0),a=10;function o(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-3*a*Math.abs(n-i))}return $n}function s(e,n,i){var a=Jn(e,i||t.calendar);if(a===$n){if(!r(e))return $n;a=Jn(new Date(+e))}return a}function l(e,r,n){return Zn(e,r,n||t.calendar)}function u(e){return t._categories[Math.round(e)]}function c(e){if(t._categoriesMap){var n=t._categoriesMap[e];if(void 0!==n)return n}if(r(e))return+e}function h(n){return r(n)?e.round(t._b+t._m*n,2):$n}function f(e){return(e-t._b)/t._m}t.c2l=\"log\"===t.type?o:Kn,t.l2c=\"log\"===t.type?ti:Kn,t.l2p=h,t.p2l=f,t.c2p=\"log\"===t.type?function(t,e){return h(o(t,e))}:h,t.p2c=\"log\"===t.type?function(t){return ti(f(t))}:f,-1!==[\"linear\",\"-\"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=Xn,t.c2d=t.c2r=t.l2d=t.l2r=Kn,t.d2p=t.r2p=function(e){return t.l2p(Xn(e))},t.p2d=t.p2r=f,t.cleanPos=Kn):\"log\"===t.type?(t.d2r=t.d2l=function(t,e){return o(Xn(t),e)},t.r2d=t.r2c=function(t){return ti(Xn(t))},t.d2c=t.r2l=Xn,t.c2d=t.l2r=Kn,t.c2r=o,t.l2d=ti,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return ti(f(t))},t.r2p=function(e){return t.l2p(Xn(e))},t.p2r=f,t.cleanPos=Kn):\"date\"===t.type?(t.d2r=t.r2d=ne.identity,t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=l,t.d2p=t.r2p=function(e,r,n){return t.l2p(s(e,0,n))},t.p2d=t.p2r=function(t,e,r){return l(f(t),e,r)},t.cleanPos=function(e){return ne.cleanDate(e,$n,t.calendar)}):\"category\"===t.type&&(t.d2c=t.d2l=function(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return $n},t.r2d=t.c2d=t.l2d=u,t.d2r=t.d2l_noadd=c,t.r2c=function(e){var r=c(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=Kn,t.r2l=c,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return u(f(t))},t.r2p=t.d2p,t.p2r=f,t.cleanPos=function(t){return\"string\"==typeof t&&\"\"!==t?t:Kn(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e,n){n||(n={}),e||(e=\"range\");var a,o,s=ne.nestedProperty(t,e).get();if(o=(o=\"date\"===t.type?ne.dfltRange(t.calendar):\"y\"===i?Te.DFLTRANGEY:n.dfltRange||Te.DFLTRANGEX).slice(),s&&2===s.length)for(\"date\"===t.type&&(s[0]=ne.cleanDate(s[0],$n,t.calendar),s[1]=ne.cleanDate(s[1],$n,t.calendar)),a=0;a<2;a++)if(\"date\"===t.type){if(!ne.isDateTime(s[a],t.calendar)){t[e]=o;break}if(t.r2l(s[0])===t.r2l(s[1])){var l=ne.constrain(t.r2l(s[0]),ne.MIN_MS+1e3,ne.MAX_MS-1e3);s[0]=t.l2r(l-1e3),s[1]=t.l2r(l+1e3);break}}else{if(!r(s[a])){if(!r(s[1-a])){t[e]=o;break}s[a]=s[1-a]*(a?10:.1)}if(s[a]<-Qn?s[a]=-Qn:s[a]>Qn&&(s[a]=Qn),s[0]===s[1]){var u=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=u,s[1]+=u}}else ne.nestedProperty(t,e).set(o)},t.setScale=function(e){var r=n._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var a=gn.getFromId({_fullLayout:n},t.overlaying);t.domain=a.domain}var o=e&&t._r?\"_r\":\"range\",s=t.calendar;t.cleanRange(o);var l=t.r2l(t[o][0],s),u=t.r2l(t[o][1],s);if(\"y\"===i?(t._offset=r.t+(1-t.domain[1])*r.h,t._length=r.h*(t.domain[1]-t.domain[0]),t._m=t._length/(l-u),t._b=-t._m*u):(t._offset=r.l+t.domain[0]*r.w,t._length=r.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-l),t._b=-t._m*l),!isFinite(t._m)||!isFinite(t._b))throw n._replotting=!1,new Error(\"Something went wrong with axis scaling\")},t.makeCalcdata=function(e,r){var n,i,a,o,s=t.type,l=\"date\"===s&&e[r+\"calendar\"];if(r in e){if(n=e[r],o=e._length||n.length,ne.isTypedArray(n)&&(\"linear\"===s||\"log\"===s)){if(o===n.length)return n;if(n.subarray)return n.subarray(0,o)}for(i=new Array(o),a=0;a<o;a++)i[a]=t.d2c(n[a],0,l)}else{var u=r+\"0\"in e?t.d2c(e[r+\"0\"],0,l):0,c=e[\"d\"+r]?Number(e[\"d\"+r]):1;for(n=e[{x:\"y\",y:\"x\"}[r]],o=e._length||n.length,i=new Array(o),a=0;a<o;a++)i[a]=u+a*c}return i},t.isValidRange=function(e){return Array.isArray(e)&&2===e.length&&r(t.r2l(e[0]))&&r(t.r2l(e[1]))},t.isPtWithinRange=function(e,r){var n=t.c2l(e[i],null,r);return n>=t.r2l(t.range[0])&&n<=t.r2l(t.range[1])},t.clearCalc=function(){t._min=[],t._max=[],t._categories=(t._initialCategories||[]).slice(),t._categoriesMap={};for(var e=0;e<t._categories.length;e++)t._categoriesMap[t._categories[e]]=e};var p=n._d3locale;\"date\"===t.type&&(t._dateFormat=p?p.timeFormat.utc:e.time.format.utc,t._extraFormat=n._extraFormat),t._separators=n.separators,t._numFormat=p?p.numberFormat:e.format,delete t._minDtick,delete t._forceTick0},ri={},ni=t.ONEAVGYEAR,ii=t.ONEAVGMONTH,ai=t.ONEDAY,oi=t.ONEHOUR,si=t.ONEMIN,li=t.ONESEC,ui=t.MINUS_SIGN,ci=t.BADNUM,hi=Qe.MID_SHIFT,fi=Qe.LINE_SPACING,pi=ri={};pi.setConvert=ei,pi.id2name=gn.id2name,pi.name2id=gn.name2id,pi.cleanId=gn.cleanId,pi.list=gn.list,pi.listIds=gn.listIds,pi.getFromId=gn.getFromId,pi.getFromTrace=gn.getFromTrace,pi.expand=jn,pi.getAutoRange=Fn,pi.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+\"axis\"],l=n+\"ref\",u={};return i||(i=s[0]||a),a||(a=i),u[l]={valType:\"enumerated\",values:s.concat(a?[a]:[]),dflt:i},ne.coerce(t,e,u,l)},pi.coercePosition=function(t,e,r,n,i,a){var o,s;if(\"paper\"===n||\"pixel\"===n)o=ne.ensureNumber,s=r(i,a);else{var l=pi.getFromId(e,n);s=r(i,a=l.fraction2r(a)),o=l.cleanPos}t[i]=o(s)},pi.cleanPosition=function(t,e,r){return(\"paper\"===r||\"pixel\"===r?ne.ensureNumber:pi.getFromId(e,r).cleanPos)(t)};var di=pi.getDataConversions=function(t,e,r,n){var i,a=\"x\"===r||\"y\"===r||\"z\"===r?r:n;if(Array.isArray(a)){if(i={type:Yn(n),_categories:[]},pi.setConvert(i),\"category\"===i.type)for(var o=0;o<n.length;o++)i.d2c(n[o])}else i=pi.getFromTrace(t,e,a);return i?{d2c:i.d2c,c2d:i.c2d}:\"ids\"===a?{d2c:vi,c2d:vi}:{d2c:gi,c2d:gi}};function gi(t){return+t}function vi(t){return String(t)}pi.getDataToCoordFunc=function(t,e,r,n){return di(t,e,r,n).d2c},pi.counterLetter=function(t){var e=t.charAt(0);return\"x\"===e?\"y\":\"y\"===e?\"x\":void 0},pi.minDtick=function(t,e,r,n){-1===[\"log\",\"category\"].indexOf(t.type)&&n?void 0===t._minDtick?(t._minDtick=e,t._forceTick0=r):t._minDtick&&((t._minDtick/e+1e-6)%1<2e-6&&((r-t._forceTick0)/e%1+1.000001)%1<2e-6?(t._minDtick=e,t._forceTick0=r):((e/t._minDtick+1e-6)%1>2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},pi.saveRangeInitial=function(t,e){for(var r=pi.list(t,\"\",!0),n=!1,i=0;i<r.length;i++){var a=r[i],o=void 0===a._rangeInitial,s=o||!(a.range[0]===a._rangeInitial[0]&&a.range[1]===a._rangeInitial[1]);(o&&!1===a.autorange||e&&s)&&(a._rangeInitial=a.range.slice(),n=!0)}return n},pi.saveShowSpikeInitial=function(t,e){for(var r=pi.list(t,\"\",!0),n=!1,i=\"on\",a=0;a<r.length;a++){var o=r[a],s=void 0===o._showSpikeInitial,l=s||!(o.showspikes===o._showspikes);(s||e&&l)&&(o._showSpikeInitial=o.showspikes,n=!0),\"on\"!==i||o.showspikes||(i=\"off\")}return t._fullLayout._cartesianSpikesEnabled=i,n},pi.autoBin=function(t,e,n,i,a){var o,s,l=ne.aggNums(Math.min,null,t),u=ne.aggNums(Math.max,null,t);if(a||(a=e.calendar),\"category\"===e.type)return{start:l-.5,end:u+.5,size:1,_dataSpan:u-l};if(n)o=(u-l)/n;else{var c=ne.distinctVals(t),h=Math.pow(10,Math.floor(Math.log(c.minDiff)/Math.LN10)),f=h*ne.roundUp(c.minDiff/h,[.9,1.9,4.9,9.9],!0);o=Math.max(f,2*ne.stdev(t)/Math.pow(t.length,i?.25:.4)),r(o)||(o=1)}s=\"log\"===e.type?{type:\"linear\",range:[l,u]}:{type:e.type,range:ne.simpleMap([l,u],e.c2r,0,a),calendar:a},pi.setConvert(s),pi.autoTicks(s,o);var p,d=pi.tickIncrement(pi.tickFirst(s),s.dtick,\"reverse\",a);if(\"number\"==typeof s.dtick)p=(d=function(t,e,n,i,a){var o=0,s=0,l=0,u=0;function c(e){return(1+100*(e-t)/n.dtick)%100<2}for(var h=0;h<e.length;h++)e[h]%1==0?l++:r(e[h])||u++,c(e[h])&&o++,c(e[h]+n.dtick/2)&&s++;var f=e.length-u;if(l===f&&\"date\"!==n.type)n.dtick<1?t=i-.5*n.dtick:(t-=.5)+n.dtick<i&&(t+=n.dtick);else if(s<.1*f&&(o>.3*f||c(i)||c(a))){var p=n.dtick/2;t+=t+p<i?p:-p}return t}(d,t,s,l,u))+(1+Math.floor((u-d)/s.dtick))*s.dtick;else for(\"M\"===s.dtick.charAt(0)&&(d=function(t,e,r,n,i){var a=ne.findExactDates(e,i);if(a.exactDays>.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=pi.tickIncrement(t,\"M6\",\"reverse\")+1.5*ai:a.exactMonths>.8?t=pi.tickIncrement(t,\"M1\",\"reverse\")+15.5*ai:t-=ai/2;var s=pi.tickIncrement(t,r);if(s<=n)return s}return t}(d,t,s.dtick,l,a)),p=d,0;p<=u;)p=pi.tickIncrement(p,s.dtick,!1,a),0;return{start:e.c2r(d,0,a),end:e.c2r(p,0,a),size:s.dtick,_dataSpan:u-l}},pi.prepTicks=function(t){var e=ne.simpleMap(t.range,t.r2l);if(\"auto\"===t.tickmode||!t.dtick){var r,n=t.nticks;n||(\"category\"===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=ne.constrain(t._length/r,4,9)+1),\"radialaxis\"===t._name&&(n*=2)),\"array\"===t.tickmode&&(n*=100),pi.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),ki(t)},pi.calcTicks=function(t){pi.prepTicks(t);var e=ne.simpleMap(t.range,t.r2l);if(\"array\"===t.tickmode)return function(t){var e,r,n=t.tickvals,i=t.ticktext,a=new Array(n.length),o=ne.simpleMap(t.range,t.r2l),s=1.0001*o[0]-1e-4*o[1],l=1.0001*o[1]-1e-4*o[0],u=Math.min(s,l),c=Math.max(s,l),h=0;Array.isArray(i)||(i=[]);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(r=0;r<n.length;r++)(e=f(n[r]))>u&&e<c&&(void 0===i[r]?a[h]=pi.tickText(t,e):a[h]=Ti(t,e,String(i[r])),h++);h<n.length&&a.splice(h,n.length-h);return a}(t);t._tmin=pi.tickFirst(t);var r=1.0001*e[0]-1e-4*e[1],n=1.0001*e[1]-1e-4*e[0],i=e[1]<e[0];if(t._tmin<r!==i)return[];var a=[];\"category\"===t.type&&(n=i?Math.max(-.5,n):Math.min(t._categories.length-.5,n));for(var o=null,s=Math.max(1e3,t._length||0),l=t._tmin;(i?l>=n:l<=n)&&!(a.length>s||l===o);l=pi.tickIncrement(l,t.dtick,i,t.calendar))o=l,a.push(l);\"angular\"===t._id&&360===Math.abs(e[1]-e[0])&&a.pop(),t._tmax=a[a.length-1],t._prevDateHead=\"\",t._inCalcTicks=!0;for(var u=new Array(a.length),c=0;c<a.length;c++)u[c]=pi.tickText(t,a[c]);return t._inCalcTicks=!1,u};var mi=[2,5,10],yi=[1,2,3,6,12],xi=[1,2,5,10,15,30],bi=[1,2,3,7,14],_i=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],wi=[-.301,0,.301,.699,1],Mi=[15,30,45,90,180];function Ai(t,e,r){return e*ne.roundUp(t/e,r)}function ki(t){var e=t.dtick;if(t._tickexponent=0,r(e)||\"string\"==typeof e||(e=1),\"category\"===t.type&&(t._tickround=null),\"date\"===t.type){var n=t.r2l(t.tick0),i=t.l2r(n).replace(/(^-|i)/g,\"\"),a=i.length;if(\"M\"===String(e).charAt(0))a>10||\"01-01\"!==i.substr(5)?t._tickround=\"d\":t._tickround=+e.substr(1)%12==0?\"y\":\"m\";else if(e>=ai&&a<=10||e>=15*ai)t._tickround=\"d\";else if(e>=si&&a<=16||e>=oi)t._tickround=\"M\";else if(e>=li&&a<=19||e>=si)t._tickround=\"S\";else{var o=t.l2r(n+e).replace(/^-/,\"\").length;t._tickround=Math.max(a,o)-20}}else if(r(e)||\"L\"===e.charAt(0)){var s=t.range.map(t.r2d||Number);r(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&&(Ei(t.exponentformat)&&!Ci(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function Ti(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}}pi.autoTicks=function(t,e){var n;function i(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if(\"date\"===t.type){t.tick0=ne.dateTick0(t.calendar);var a=2*e;a>ni?(e/=ni,n=i(10),t.dtick=\"M\"+12*Ai(e,n,mi)):a>ii?(e/=ii,t.dtick=\"M\"+Ai(e,1,yi)):a>ai?(t.dtick=Ai(e,ai,bi),t.tick0=ne.dateTick0(t.calendar,!0)):a>oi?t.dtick=Ai(e,oi,yi):a>si?t.dtick=Ai(e,si,xi):a>li?t.dtick=Ai(e,li,xi):(n=i(10),t.dtick=Ai(e,n,mi))}else if(\"log\"===t.type){t.tick0=0;var o=ne.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var s=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/s,n=i(10),t.dtick=\"L\"+Ai(e,n,mi)}else t.dtick=e>.3?\"D2\":\"D1\"}else\"category\"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):\"angular\"===t._id?(t.tick0=0,n=1,t.dtick=Ai(e,n,Mi)):(t.tick0=0,n=i(10),t.dtick=Ai(e,n,mi));if(0===t.dtick&&(t.dtick=1),!r(t.dtick)&&\"string\"!=typeof t.dtick){var l=t.dtick;throw t.dtick=1,\"ax.dtick error: \"+String(l)}},pi.tickIncrement=function(t,n,i,a){var o=i?-1:1;if(r(n))return t+o*n;var s=n.charAt(0),l=o*Number(n.substr(1));if(\"M\"===s)return ne.incrementMonth(t,l,a);if(\"L\"===s)return Math.log(Math.pow(10,t)+l)/Math.LN10;if(\"D\"===s){var u=\"D2\"===n?wi:_i,c=t+.01*o,h=ne.roundUp(ne.mod(c,1),u,i);return Math.floor(c)+Math.log(e.round(Math.pow(10,h),1))/Math.LN10}throw\"unrecognized dtick \"+String(n)},pi.tickFirst=function(t){var n=t.r2l||Number,i=ne.simpleMap(t.range,n),a=i[1]<i[0],o=a?Math.floor:Math.ceil,s=1.0001*i[0]-1e-4*i[1],l=t.dtick,u=n(t.tick0);if(r(l)){var c=o((s-u)/l)*l+u;return\"category\"===t.type&&(c=ne.constrain(c,0,t._categories.length-1)),c}var h=l.charAt(0),f=Number(l.substr(1));if(\"M\"===h){for(var p,d,g,v=0,m=u;v<10;){if(((p=pi.tickIncrement(m,l,a,t.calendar))-s)*(m-s)<=0)return a?Math.min(m,p):Math.max(m,p);d=(s-(m+p)/2)/(p-m),g=h+(Math.abs(Math.round(d))||1)*f,m=pi.tickIncrement(m,g,d<0?!a:a,t.calendar),v++}return ne.error(\"tickFirst did not converge\",t),m}if(\"L\"===h)return Math.log(o((Math.pow(10,s)-u)/f)*f+u)/Math.LN10;if(\"D\"===h){var y=\"D2\"===l?wi:_i,x=ne.roundUp(ne.mod(s,1),y,a);return Math.floor(s)+Math.log(e.round(Math.pow(10,x),1))/Math.LN10}throw\"unrecognized dtick \"+String(l)},pi.tickText=function(t,e,n){var i,a,o=Ti(t,e),s=\"array\"===t.tickmode,l=n||s,u=\"category\"===t.type?t.d2l_noadd:t.d2l;if(s&&Array.isArray(t.ticktext)){var c=ne.simpleMap(t.range,t.r2l),h=Math.abs(c[1]-c[0])/1e4;for(a=0;a<t.ticktext.length&&!(Math.abs(e-u(t.tickvals[a]))<h);a++);if(a<t.ticktext.length)return o.text=String(t.ticktext[a]),o}function f(r){var i;return void 0===r||(n?\"none\"===r:(i={first:t._tmin,last:t._tmax}[r],\"all\"!==r&&e!==i))}return i=n?\"never\":\"none\"!==t.exponentformat&&f(t.showexponent)?\"hide\":\"\",\"date\"===t.type?function(t,e,n,i){var a=t._tickround,o=n&&t.hoverformat||pi.getTickFormat(t);i&&(a=r(a)?4:{y:\"m\",m:\"d\",d:\"M\",M:\"S\",S:4}[a]);var s,l=ne.formatDate(e.x,o,a,t._dateFormat,t.calendar,t._extraFormat),u=l.indexOf(\"\\n\");-1!==u&&(s=l.substr(u+1),l=l.substr(0,u));i&&(\"00:00:00\"===l||\"00:00\"===l?(l=s,s=\"\"):8===l.length&&(l=l.replace(/:00$/,\"\")));s&&(n?\"d\"===a?l+=\", \"+s:l=s+(l?\", \"+l:\"\"):t._inCalcTicks&&s===t._prevDateHead||(l+=\"<br>\"+s,t._prevDateHead=s));e.text=l}(t,o,n,l):\"log\"===t.type?function(t,e,n,i,a){var o=t.dtick,s=e.x,l=t.tickformat;\"never\"===a&&(a=\"\");!i||\"string\"==typeof o&&\"L\"===o.charAt(0)||(o=\"L3\");if(l||\"string\"==typeof o&&\"L\"===o.charAt(0))e.text=Li(Math.pow(10,s),t,a,i);else if(r(o)||\"D\"===o.charAt(0)&&ne.mod(s+.01,1)<.1){var u=Math.round(s);-1!==[\"e\",\"E\",\"power\"].indexOf(t.exponentformat)||Ei(t.exponentformat)&&Ci(u)?(e.text=0===u?1:1===u?\"10\":u>1?\"10<sup>\"+u+\"</sup>\":\"10<sup>\"+ui+-u+\"</sup>\",e.fontSize*=1.25):(e.text=Li(Math.pow(10,s),t,\"\",\"fakehover\"),\"D1\"===o&&\"y\"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if(\"D\"!==o.charAt(0))throw\"unrecognized dtick \"+String(o);e.text=String(Math.round(Math.pow(10,ne.mod(s,1)))),e.fontSize*=.75}if(\"D1\"===t.dtick){var c=String(e.text).charAt(0);\"0\"!==c&&\"1\"!==c||(\"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*(s<0?.5:.25)))}}(t,o,0,l,i):\"category\"===t.type?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=\"\");e.text=String(r)}(t,o):\"angular\"===t._id?function(t,e,r,n,i){if(\"radians\"!==t.thetaunit||r)e.text=Li(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){var r=1;for(;!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=Li(ne.deg2rad(e.x),t,i,n);else{var s=e.x<0;1===o[1]?1===o[0]?e.text=\"\\u03c0\":e.text=o[0]+\"\\u03c0\":e.text=[\"<sup>\",o[0],\"</sup>\",\"\\u2044\",\"<sub>\",o[1],\"</sub>\",\"\\u03c0\"].join(\"\"),s&&(e.text=ui+e.text)}}}}(t,o,n,l,i):function(t,e,r,n,i){\"never\"===i?i=\"\":\"all\"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i=\"hide\");e.text=Li(e.x,t,i,n)}(t,o,0,l,i),t.tickprefix&&!f(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!f(t.showticksuffix)&&(o.text+=t.ticksuffix),o},pi.hoverLabelText=function(t,e,r){if(r!==ci&&r!==e)return pi.hoverLabelText(t,e)+\" - \"+pi.hoverLabelText(t,r);var n=\"log\"===t.type&&e<=0,i=pi.tickText(t,t.c2l(n?-e:e),\"hover\").text;return n?0===e?\"0\":ui+i:i};var Si=[\"f\",\"p\",\"n\",\"\\u03bc\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\"];function Ei(t){return\"SI\"===t||\"B\"===t}function Ci(t){return t>14||t<-15}function Li(t,e,n,i){var a=t<0,o=e._tickround,s=n||e.exponentformat||\"B\",l=e._tickexponent,u=pi.getTickFormat(e),c=e.separatethousands;if(i){var h={exponentformat:s,dtick:\"none\"===e.showexponent?e.dtick:r(t)&&Math.abs(t)||1,range:\"none\"===e.showexponent?e.range.map(e.r2d):[0,t||1]};ki(h),o=(Number(h._tickround)||0)+4,l=h._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,ui);var f,p=Math.pow(10,-o)/2;if(\"none\"===s&&(l=0),(t=Math.abs(t))<p)t=\"0\",a=!1;else{if(t+=p,l&&(t*=Math.pow(10,-l),o+=l),0===o)t=String(Math.floor(t));else if(o<0){t=(t=String(Math.round(t))).substr(0,t.length+o);for(var d=o;d<0;d++)t+=\"0\"}else{var g=(t=String(t)).indexOf(\".\")+1;g&&(t=t.substr(0,g+o).replace(/\\.?0+$/,\"\"))}t=ne.numSeparate(t,e._separators,c)}l&&\"hide\"!==s&&(Ei(s)&&Ci(l)&&(s=\"power\"),f=l<0?ui+-l:\"power\"!==s?\"+\"+l:String(l),\"e\"===s?t+=\"e\"+f:\"E\"===s?t+=\"E\"+f:\"power\"===s?t+=\"\\xd710<sup>\"+f+\"</sup>\":\"B\"===s&&9===l?t+=\"B\":Ei(s)&&(t+=Si[l/3+5]));return a?ui+t:t}function zi(t,e){for(var r=0;r<e.length;r++)-1===t.indexOf(e[r])&&t.push(e[r])}function Pi(t,e,r){var n,i,a=[],o=[],s=t.layout;for(n=0;n<e.length;n++)a.push(pi.getFromId(t,e[n]));for(n=0;n<r.length;n++)o.push(pi.getFromId(t,r[n]));var l=Object.keys(a[0]),u=[\"anchor\",\"domain\",\"overlaying\",\"position\",\"side\",\"tickangle\"],c=[\"linear\",\"log\"];for(n=0;n<l.length;n++){var h=l[n],f=a[0][h],p=o[0][h],d=!0,g=!1,v=!1;if(\"_\"!==h.charAt(0)&&\"function\"!=typeof f&&-1===u.indexOf(h)){for(i=1;i<a.length&&d;i++){var m=a[i][h];\"type\"===h&&-1!==c.indexOf(f)&&-1!==c.indexOf(m)&&f!==m?g=!0:m!==f&&(d=!1)}for(i=1;i<o.length&&d;i++){var y=o[i][h];\"type\"===h&&-1!==c.indexOf(p)&&-1!==c.indexOf(y)&&p!==y?v=!0:o[i][h]!==p&&(d=!1)}d&&(g&&(s[a[0]._name].type=\"linear\"),v&&(s[o[0]._name].type=\"linear\"),Ii(s,h,a,o,t._fullLayout._dfltTitle))}}for(n=0;n<t._fullLayout.annotations.length;n++){var x=t._fullLayout.annotations[n];-1!==e.indexOf(x.xref)&&-1!==r.indexOf(x.yref)&&ne.swapAttrs(s.annotations[n],[\"?\"])}}function Ii(t,e,r,n,i){var a,o=ne.nestedProperty,s=o(t[r[0]._name],e).get(),l=o(t[n[0]._name],e).get();for(\"title\"===e&&(s===i.x&&(s=i.y),l===i.y&&(l=i.x)),a=0;a<r.length;a++)o(t,r[a]._name+\".\"+e).set(l);for(a=0;a<n.length;a++)o(t,n[a]._name+\".\"+e).set(s)}pi.getTickFormat=function(t){var e,r,n,i,a,o,s;function l(t){return\"string\"!=typeof t?t:Number(t.replace(\"M\",\"\"))*ii}function u(t,e){var r=[\"L\",\"D\"];if(typeof t==typeof e){if(\"number\"==typeof t)return t-e;var n=r.indexOf(t.charAt(0)),i=r.indexOf(e.charAt(0));return n===i?Number(t.replace(/(L|D)/g,\"\"))-Number(e.replace(/(L|D)/g,\"\")):n-i}return\"number\"==typeof t?1:-1}function c(t,e){var r=null===e[0],n=null===e[1],i=u(t,e[0])>=0,a=u(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<t.tickformatstops.length;e++)if(n=t.dtick,i=t.tickformatstops[e].dtickrange,a=void 0,void 0,void 0,a=l||function(t){return t},o=i[0],s=i[1],(!o&&\"number\"!=typeof o||a(o)<=a(n))&&(!s&&\"number\"!=typeof s||a(s)>=a(n))){r=t.tickformatstops[e];break}break;case\"log\":for(e=0;e<t.tickformatstops.length;e++)if(c(t.dtick,t.tickformatstops[e].dtickrange)){r=t.tickformatstops[e];break}}return r?r.value:t.tickformat},pi.getSubplots=function(t,e){var r=t._fullLayout._subplots,n=r.cartesian.concat(r.gl2d||[]),i=e?pi.findSubplotsWithAxis(n,e):n;return i.sort(function(t,e){var r=t.substr(1).split(\"y\"),n=e.substr(1).split(\"y\");return r[0]===n[0]?+r[1]-+n[1]:+r[0]-+n[0]}),i},pi.findSubplotsWithAxis=function(t,e){for(var r=new RegExp(\"x\"===e._id.charAt(0)?\"^\"+e._id+\"y\":e._id+\"$\"),n=[],i=0;i<t.length;i++){var a=t[i];r.test(a)&&n.push(a)}return n},pi.makeClipPaths=function(t){var r,n,i=t._fullLayout,a={_offset:0,_length:i.width,_id:\"\"},o={_offset:0,_length:i.height,_id:\"\"},s=pi.list(t,\"x\",!0),l=pi.list(t,\"y\",!0),u=[];for(r=0;r<s.length;r++)for(u.push({x:s[r],y:o}),n=0;n<l.length;n++)0===r&&u.push({x:a,y:l[n]}),u.push({x:s[r],y:l[n]});var c=i._clips.selectAll(\".axesclip\").data(u,function(t){return t.x._id+t.y._id});c.enter().append(\"clipPath\").classed(\"axesclip\",!0).attr(\"id\",function(t){return\"clip\"+i._uid+t.x._id+t.y._id}).append(\"rect\"),c.exit().remove(),c.each(function(t){e.select(this).select(\"rect\").attr({x:t.x._offset||0,y:t.y._offset||0,width:t.x._length||1,height:t.y._length||1})})},pi.doTicks=function(t,n,i){var a,o=t._fullLayout,s=!1;if(\"object\"==typeof n)n=(a=n)._id,s=!0;else if(a=pi.getFromId(t,n),\"redraw\"===n&&o._paper.selectAll(\"g.subplot\").each(function(t){var e=o._plots[t],r=e.xaxis,n=e.yaxis;e.xaxislayer.selectAll(\".\"+r._id+\"tick\").remove(),e.yaxislayer.selectAll(\".\"+n._id+\"tick\").remove(),e.gridlayer.selectAll(\"path\").remove(),e.zerolinelayer.selectAll(\"path\").remove(),o._infolayer.select(\".g-\"+r._id+\"title\").remove(),o._infolayer.select(\".g-\"+n._id+\"title\").remove()}),!n||\"redraw\"===n)return ne.syncOrAsync(pi.list(t,\"\",!0).map(function(e){return function(){if(e._id){var r=pi.doTicks(t,e._id);return\"redraw\"===n&&(e._r=e.range.slice(),e._rl=ne.simpleMap(e._r,e.r2l)),r}}}));a.setScale();var l,u,c,h,f,p=n.charAt(0),d=pi.counterLetter(n),g=pi.calcTicks(a),v=function(t){return[t.text,t.x,a.mirror,t.font,t.fontSize,t.fontColor].join(\"_\")},m=n+\"tick\",y=n+\"grid\",x=n+\"zl\",b=(a.linewidth||1)/2,_=\"outside\"===a.ticks?a.ticklen:0,w=0,M=Sr.crispRound(t,a.gridwidth,1),A=Sr.crispRound(t,a.zerolinewidth,M),k=Sr.crispRound(t,a.tickwidth,1);if(a._counterangle&&\"outside\"===a.ticks){var T=a._counterangle*Math.PI/180;_=a.ticklen*Math.cos(T)+1,w=a.ticklen*Math.sin(T)}if(a.showticklabels&&(\"outside\"===a.ticks||a.showline)&&(_+=.2*a.tickfont.size),\"x\"===p)l=[\"bottom\",\"top\"],u=a._transfn||function(t){return\"translate(\"+(a._offset+a.l2p(t.x))+\",0)\"},c=function(t,e){if(a._counterangle){var r=a._counterangle*Math.PI/180;return\"M0,\"+t+\"l\"+Math.sin(r)*e+\",\"+Math.cos(r)*e}return\"M0,\"+t+\"v\"+e};else if(\"y\"===p)l=[\"left\",\"right\"],u=a._transfn||function(t){return\"translate(0,\"+(a._offset+a.l2p(t.x))+\")\"},c=function(t,e){if(a._counterangle){var r=a._counterangle*Math.PI/180;return\"M\"+t+\",0l\"+Math.cos(r)*e+\",\"+-Math.sin(r)*e}return\"M\"+t+\",0h\"+e};else{if(\"angular\"!==n)return void ne.warn(\"Unrecognized doTicks axis:\",n);l=[\"left\",\"right\"],u=a._transfn,c=function(t,e){return\"M\"+t+\",0h\"+e}}var S=a.side||l[0],E=[-1,1,S===l[1]?1:-1];if(\"inside\"!==a.ticks==(\"x\"===p)&&(E=E.map(function(t){return-t})),a.visible){a._tickFilter&&(g=g.filter(a._tickFilter));var C=g.filter(F);if(\"angular\"===a._id&&(C=g),s){if(B(a._axislayer,c(a._pos+b*E[2],E[2]*a.ticklen)),a._counteraxis)U({gridlayer:a._gridlayer,zerolinelayer:a._zerolinelayer},a._counteraxis);return N(a._axislayer,a._pos)}if(o._has(\"cartesian\")){var L={};(h=pi.getSubplots(t,a)).map(function(t){var e=o._plots[t],r=e[d+\"axis\"],n=r._mainAxis._id;L[n]||(L[n]=1,U(e,r,t))});var z=a._mainSubplot,I=o._plots[z],D=[];if(a.ticks){var O=E[2],R=c(a._mainLinePosition+b*O,O*a.ticklen);a._anchorAxis&&a.mirror&&!0!==a.mirror&&(R+=c(a._mainMirrorPosition-b*O,-O*a.ticklen)),B(I[p+\"axislayer\"],R),D=Object.keys(a._linepositions)}return D.map(function(t){var e=o._plots[t][p+\"axislayer\"],r=a._linepositions[t]||[];function n(t){var e=E[t];return c(r[t]+b*e,e*a.ticklen)}B(e,n(0)+n(1))}),N(I[p+\"axislayer\"],a._mainLinePosition)}}function F(t){var e=a.l2p(t.x);return e>1&&e<a._length-1}function B(t,e){var r=t.selectAll(\"path.\"+m).data(\"inside\"===a.ticks?C:g,v);e&&a.ticks?(r.enter().append(\"path\").classed(m,1).classed(\"ticks\",1).classed(\"crisp\",1).call(Oe.stroke,a.tickcolor).style(\"stroke-width\",k+\"px\").attr(\"d\",e),r.attr(\"transform\",u),r.exit().remove()):r.remove()}function N(i,s){var l,c,d,y,x,M=i.selectAll(\"g.\"+m).data(g,v);if(!r(s))return M.remove(),void j();if(!a.showticklabels)return M.remove(),j(),void C();\"x\"===p?(l=function(t){return t.dx+w*x},y=s+(_+b)*(x=\"bottom\"===S?1:-1),c=function(t){return t.dy+y+t.fontSize*(\"bottom\"===S?1:-.2)},d=function(t){return r(t)&&0!==t&&180!==t?t*x<0?\"end\":\"start\":\"middle\"}):\"y\"===p?(x=\"right\"===S?1:-1,c=function(t){return t.dy+t.fontSize*hi-w*x},l=function(t){return t.dx+s+(_+b+(90===Math.abs(a.tickangle)?t.fontSize/2:0))*x},d=function(t){return r(t)&&90===Math.abs(t)?\"middle\":\"right\"===S?\"start\":\"end\"}):\"angular\"===n&&(a._labelShift=w,a._labelStandoff=_,a._pad=b,l=a._labelx,c=a._labely,d=a._labelanchor);var A=0,k=0,T=[];function E(t,n){t.each(function(t){var i=d(n,t),a=e.select(this),o=a.select(\".text-math-group\"),s=u.call(a.node(),t)+(r(n)&&0!=+n?\" rotate(\"+n+\",\"+l(t)+\",\"+(c(t)-t.fontSize/2)+\")\":\"\"),h=function(t,e,r){var n=(t-1)*e;if(\"x\"===p){if(r<-60||60<r)return-.5*n;if(\"top\"===S)return-n}else{if((r*=\"left\"===S?1:-1)<-30)return-n;if(r<30)return-.5*n}return 0}(er.lineCount(a),fi*t.fontSize,r(n)?+n:0);if(h&&(s+=\" translate(0, \"+h+\")\"),o.empty())a.select(\"text\").attr({transform:s,\"text-anchor\":i});else{var f=Sr.bBox(o.node()).width*{end:-.5,start:.5}[i];o.attr(\"transform\",s+(f?\"translate(\"+f+\",0)\":\"\"))}})}function C(){if(a.showticklabels){var e=t.getBoundingClientRect(),r=i.node().getBoundingClientRect();a._boundingBox={width:r.width,height:r.height,left:r.left-e.left,right:r.right-e.left,top:r.top-e.top,bottom:r.bottom-e.top}}else{var n,s=o._size;\"x\"===p?(n=\"free\"===a.anchor?s.t+s.h*(1-a.position):s.t+s.h*(1-a._anchorAxis.domain[{bottom:0,top:1}[a.side]]),a._boundingBox={top:n,bottom:n,left:a._offset,right:a._offset+a._length,width:a._length,height:0}):(n=\"free\"===a.anchor?s.l+s.w*a.position:s.l+s.w*a._anchorAxis.domain[{left:0,right:1}[a.side]],a._boundingBox={left:n,right:n,bottom:a._offset+a._length,top:a._offset,height:a._length,width:0})}if(h){var l=a._counterSpan=[1/0,-1/0];for(f=0;f<h.length;f++){var u=o._plots[h[f]][\"x\"===p?\"yaxis\":\"xaxis\"];c(l,[u._offset,u._offset+u._length])}\"free\"===a.anchor&&c(l,\"x\"===p?[a._boundingBox.bottom,a._boundingBox.top]:[a._boundingBox.right,a._boundingBox.left])}function c(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.max(t[1],e[1])}}M.enter().append(\"g\").classed(m,1).append(\"text\").attr(\"text-anchor\",\"middle\").each(function(r){var n=e.select(this),i=t._promises.length;n.call(er.positionText,l(r),c(r)).call(Sr.font,r.font,r.fontSize,r.fontColor).text(r.text).call(er.convertToTspans,t),(i=t._promises[i])?T.push(t._promises.pop().then(function(){E(n,a.tickangle)})):E(n,a.tickangle)}),M.exit().remove(),M.each(function(t){A=Math.max(A,t.fontSize)}),\"angular\"===n&&M.each(function(t){e.select(this).select(\"text\").call(er.positionText,l(t),c(t))}),E(M,a._lastangle||a.tickangle);var L=ne.syncOrAsync([function(){return T.length&&Promise.all(T)},function(){if(E(M,a.tickangle),\"x\"===p&&!r(a.tickangle)&&(\"log\"!==a.type||\"D\"!==String(a.dtick).charAt(0))){var t=[];for(M.each(function(r){var n=e.select(this),i=n.select(\".text-math-group\"),o=a.l2p(r.x);i.empty()&&(i=n.select(\"text\"));var s=Sr.bBox(i.node());t.push({top:0,bottom:10,height:10,left:o-s.width/2,right:o+s.width/2+2,width:s.width+2})}),f=0;f<t.length-1;f++)if(ne.bBoxIntersect(t[f],t[f+1])){k=30;break}k&&(Math.abs((g[g.length-1].x-g[0].x)*a._m)/(g.length-1)<2.5*A&&(k=90),E(M,k)),a._lastangle=k}return j(),n+\" done\"},C,function(){if(a.automargin&&(\"x\"===p||\"y\"===p)){var e=a.side[0],r={x:0,y:0,r:0,l:0,t:0,b:0};\"x\"===p?(r.y=\"free\"===a.anchor?a.position:a._anchorAxis.domain[\"t\"===e?1:0],r[e]+=a._boundingBox.height):(r.x=\"free\"===a.anchor?a.position:a._anchorAxis.domain[\"r\"===e?1:0],r[e]+=a._boundingBox.width),a.title!==o._dfltTitle[p]&&(r[e]+=a.titlefont.size);var n=a._name+\".automargin\",i=o._pushmargin[n];(!i||i[e].size<r[e])&&_n.autoMargin(t,n,r)}}]);return L&&L.then&&t._promises.push(L),L}function j(){if(!i){var r=gn.getFromId(t,n);if(!(r.rangeslider&&r.rangeslider.visible&&r._boundingBox&&\"bottom\"===r.side)){var a,s,l,u,c=e.select(t).selectAll(\"g.\"+n+\"tick\"),h={selection:c,side:r.side},f=n.charAt(0),p=t._fullLayout._size,d=r.titlefont.size;if(c.size()){var g=Sr.getTranslate(c.node().parentNode);h.offsetLeft=g.x,h.offsetTop=g.y}var v=10+1.5*d+(r.linewidth?r.linewidth-1:0);\"x\"===f?(s=\"free\"===r.anchor?{_offset:p.t+(1-(r.position||0))*p.h,_length:0}:gn.getFromId(t,r.anchor),l=r._offset+r._length/2,u=\"top\"===r.side?-v-d*(r.showticklabels?1:0):s._length+v+d*(r.showticklabels?1.5:.5),u+=s._offset,h.side||(h.side=\"bottom\")):(s=\"free\"===r.anchor?{_offset:p.l+(r.position||0)*p.w,_length:0}:gn.getFromId(t,r.anchor),u=r._offset+r._length/2,l=\"right\"===r.side?s._length+v+d*(r.showticklabels?1:.5):-v-d*(r.showticklabels?.5:0),l+=s._offset,a={rotate:\"-90\",offset:0},h.side||(h.side=\"left\")),Dn.draw(t,n+\"title\",{propContainer:r,propName:r._name+\".title\",placeholder:o._dfltTitle[f],avoid:h,transform:a,attributes:{x:l,y:u,\"text-anchor\":\"middle\"}})}}}function V(t,e){return!0===t.visible&&t.xaxis+t.yaxis===e&&(!(!P.traceIs(t,\"bar\")||t.orientation!=={x:\"h\",y:\"v\"}[p])||t.fill&&t.fill.charAt(t.fill.length-1)===p)}function U(r,i,o){var s=r.gridlayer.selectAll(\".\"+n),l=r.zerolinelayer,c=r[\"hidegrid\"+p]?[]:C,h=a._gridpath||(\"x\"===p?\"M0,\"+i._offset+\"v\":\"M\"+i._offset+\",0h\")+i._length,f=s.selectAll(\"path.\"+y).data(!1===a.showgrid?[]:c,v);if(f.enter().append(\"path\").classed(y,1).classed(\"crisp\",1).attr(\"d\",h).each(function(t){a.zeroline&&(\"linear\"===a.type||\"-\"===a.type)&&Math.abs(t.x)<a.dtick/100&&e.select(this).remove()}),f.attr(\"transform\",u).call(Oe.stroke,a.gridcolor||\"#ddd\").style(\"stroke-width\",M+\"px\"),\"function\"==typeof h&&f.attr(\"d\",h),f.exit().remove(),l){for(var d=!1,g=0;g<t._fullData.length;g++)if(V(t._fullData[g],o)){d=!0;break}var m=ne.simpleMap(a.range,a.r2l),b=m[0]*m[1]<=0&&a.zeroline&&(\"linear\"===a.type||\"-\"===a.type)&&c.length&&(d||F({x:0})||!a.showline),_=l.selectAll(\"path.\"+x).data(b?[{x:0,id:n}]:[]);_.enter().append(\"path\").classed(x,1).classed(\"zl\",1).classed(\"crisp\",1).attr(\"d\",h).each(function(){l.selectAll(\"path\").sort(function(t,e){return gn.idSort(t.id,e.id)})}),_.attr(\"transform\",u).call(Oe.stroke,a.zerolinecolor||Oe.defaultLine).style(\"stroke-width\",A+\"px\"),_.exit().remove()}}},pi.swap=function(t,e){for(var r=function(t,e){var r,n,i=[];for(r=0;r<e.length;r++){var a=[],o=t._fullData[e[r]].xaxis,s=t._fullData[e[r]].yaxis;if(o&&s){for(n=0;n<i.length;n++)-1===i[n].x.indexOf(o)&&-1===i[n].y.indexOf(s)||a.push(n);if(a.length){var l,u=i[a[0]];if(a.length>1)for(n=1;n<a.length;n++)l=i[a[n]],zi(u.x,l.x),zi(u.y,l.y);zi(u.x,[o]),zi(u.y,[s])}else i.push({x:[o],y:[s]})}}return i}(t,e),n=0;n<r.length;n++)Pi(t,r[n].x,r[n].y)};var Di={pointsAccessorFunction:function(t,e){for(var r,n,i=0;i<t.length&&(r=t[i])!==e;i++)r._indexToPoints&&!1!==r.enabled&&(n=r._indexToPoints);return n?function(t){return n[t]}:function(t){return[t]}}},Oi={},Ri=Di.pointsAccessorFunction,Fi=t.BADNUM;Oi.moduleType=\"transform\",Oi.name=\"aggregate\";var Bi=Oi.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\"],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\"},Ni=Bi.aggregations;function ji(t,e,r,n){if(n.enabled){for(var i=n.target,a=ne.nestedProperty(e,i),o=a.get(),s=function(t,e){var r=t.func,n=e.d2c,i=e.c2d;switch(r){case\"count\":return Vi;case\"first\":return Ui;case\"last\":return qi;case\"sum\":return function(t,e){for(var r=0,a=0;a<e.length;a++){var o=n(t[e[a]]);o!==Fi&&(r+=o)}return i(r)};case\"avg\":return function(t,e){for(var r=0,a=0,o=0;o<e.length;o++){var s=n(t[e[o]]);s!==Fi&&(r+=s,a++)}return a?i(r/a):Fi};case\"min\":return function(t,e){for(var r=1/0,a=0;a<e.length;a++){var o=n(t[e[a]]);o!==Fi&&(r=Math.min(r,o))}return r===1/0?Fi:i(r)};case\"max\":return function(t,e){for(var r=-1/0,a=0;a<e.length;a++){var o=n(t[e[a]]);o!==Fi&&(r=Math.max(r,o))}return r===-1/0?Fi:i(r)};case\"median\":return function(t,e){for(var r=[],a=0;a<e.length;a++){var o=n(t[e[a]]);o!==Fi&&r.push(o)}if(!r.length)return Fi;r.sort();var s=(r.length-1)/2;return i((r[Math.floor(s)]+r[Math.ceil(s)])/2)};case\"mode\":return function(t,e){for(var r={},a=0,o=Fi,s=0;s<e.length;s++){var l=n(t[e[s]]);if(l!==Fi){var u=r[l]=(r[l]||0)+1;u>a&&(a=u,o=l)}}return a?i(o):Fi};case\"rms\":return function(t,e){for(var r=0,a=0,o=0;o<e.length;o++){var s=n(t[e[o]]);s!==Fi&&(r+=s*s,a++)}return a?i(Math.sqrt(r/a)):Fi};case\"stddev\":return function(e,r){var i,a=0,o=0,s=1,l=Fi;for(i=0;i<r.length&&l===Fi;i++)l=n(e[r[i]]);if(l===Fi)return Fi;for(;i<r.length;i++){var u=n(e[r[i]]);if(u!==Fi){var c=u-l;a+=c,o+=c*c,s++}}var h=\"sample\"===t.funcmode?s-1:s;return h?Math.sqrt((o-a*a/s)/h):0}}}(n,ri.getDataConversions(t,e,i,o)),l=new Array(r.length),u=0;u<r.length;u++)l[u]=s(o,r[u]);a.set(l)}}function Vi(t,e){return e.length}function Ui(t,e){return t[e[0]]}function qi(t,e){return t[e[e.length-1]]}Oi.supplyDefaults=function(t,e){var r,n={};function i(e,r){return ne.coerce(t,n,Bi,e,r)}if(!i(\"enabled\"))return n;var a=nn.findArrayAttributes(e),o={};for(r=0;r<a.length;r++)o[a[r]]=1;var s=i(\"groups\");if(!Array.isArray(s)){if(!o[s])return void(n.enabled=!1);o[s]=0}var l,u=t.aggregations||[],c=n.aggregations=new Array(u.length);function h(t,e){return ne.coerce(u[r],l,Ni,t,e)}for(r=0;r<u.length;r++){l={_index:r};var f=h(\"target\"),p=h(\"func\");h(\"enabled\")&&f&&(o[f]||\"count\"===p&&void 0===o[f])?(\"stddev\"===p&&h(\"funcmode\"),o[f]=0,c[r]=l):c[r]={enabled:!1,_index:r}}for(r=0;r<a.length;r++)o[a[r]]&&c.push({target:a[r],func:Ni.func.dflt,enabled:!0,_index:-1});return n},Oi.calcTransform=function(t,e,r){if(r.enabled){var n=r.groups,i=ne.getTargetArray(e,{target:n});if(i){var a,o,s,l,u={},c={},h=[],f=Ri(e.transforms,r);for(a=0;a<i.length;a++)void 0===(s=u[o=i[a]])?(u[o]=h.length,l=[a],h.push(l),c[u[o]]=f(a)):(h[s].push(a),c[u[o]]=(c[u[o]]||[]).concat(f(a)));r._indexToPoints=c;var p=r.aggregations;for(a=0;a<p.length;a++)ji(t,e,h,p[a]);\"string\"==typeof n&&ji(t,e,h,{target:n,func:\"first\",enabled:!0})}}};var Hi=Oi,Gi={xaxis:{valType:\"subplotid\",dflt:\"x\",editType:\"calc+clearAxisTypes\"},yaxis:{valType:\"subplotid\",dflt:\"y\",editType:\"calc+clearAxisTypes\"}},Wi=function(t,e,r){if(\"category\"===e.type){var n,i=t.categoryarray,a=Array.isArray(i)&&i.length>0;a&&(n=\"array\");var o=r(\"categoryorder\",n);\"array\"===o&&r(\"categoryarray\"),a||\"array\"!==o||(e.categoryorder=\"trace\")}},Yi=s.mix,Xi=C.lightFraction,Zi=function(t,e,r,n){var i=(n=n||{}).dfltColor;function a(r,i){return ne.coerce2(t,e,n.attributes,r,i)}var o=a(\"linecolor\",i),s=a(\"linewidth\");r(\"showline\",n.showLine||!!o||!!s)||(delete e.linecolor,delete e.linewidth);var l=a(\"gridcolor\",Yi(i,n.bgColor,n.blend||Xi).toRgbString()),u=a(\"gridwidth\");if(r(\"showgrid\",n.showGrid||!!l||!!u)||(delete e.gridcolor,delete e.gridwidth),!n.noZeroLine){var c=a(\"zerolinecolor\",i),h=a(\"zerolinewidth\");r(\"zeroline\",n.showGrid||!!c||!!h)||(delete e.zerolinecolor,delete e.zerolinewidth)}};function Ji(t,r,n){var i,a,o,s,l,u=[],c=n.map(function(e){return e[t]}),h=e.bisector(r).left;for(i=0;i<c.length;i++)for(o=c[i],a=0;a<o.length;a++)null!==(s=o[a])&&void 0!==s&&((l=h(u,s))<u.length&&u[l]===s||u.splice(l,0,s));return u}var Ki=function(t,r,n,i){switch(r){case\"array\":return Array.isArray(n)?n.slice():[];case\"category ascending\":return Ji(t,e.ascending,i);case\"category descending\":return Ji(t,e.descending,i);case\"trace\":default:return[]}},Qi=function(t,e,r,n,i){var a=n.letter,o=n.font||{},s=r(\"visible\",!n.cheateronly),l=e.type;\"date\"===l&&P.getComponentMethod(\"calendars\",\"handleDefaults\")(t,e,\"calendar\",n.calendar);ei(e,i);var u=r(\"autorange\",!e.isValidRange(t.range));if(e._rangesliderAutorange=!1,u&&r(\"rangemode\"),r(\"range\"),e.cleanRange(),Wi(t,e,r),e._initialCategories=\"category\"===l?Ki(a,e.categoryorder,e.categoryarray,n.data):[],\"category\"===l||n.noHover||r(\"hoverformat\"),!s)return e;var c=r(\"color\"),h=c===t.color?c:o.color;return r(\"title\",i._dfltTitle[a]),ne.coerceFont(r,\"titlefont\",{family:o.family,size:Math.round(1.2*o.size),color:h}),Ge(t,e,r,l),Ue(t,e,r,l,n),qe(t,e,r,n),Zi(t,e,r,{dfltColor:c,bgColor:n.bgColor,showGrid:n.showGrid,attributes:Ce}),(e.showline||e.ticks)&&r(\"mirror\"),n.automargin&&r(\"automargin\"),e},$i=gn.id2name,ta=function(t,e,r,n,i){var a=i._axisConstraintGroups,o=e._id,s=o.charAt(0);if(!e.fixedrange&&(r(\"constrain\"),ne.coerce(t,e,{constraintoward:{valType:\"enumerated\",values:\"x\"===s?[\"left\",\"center\",\"right\"]:[\"bottom\",\"middle\",\"top\"],dflt:\"x\"===s?\"center\":\"middle\"}},\"constraintoward\"),t.scaleanchor)){var l=function(t,e,r,n){var i,a,o,s,l=n[$i(e)].type,u=[];for(a=0;a<r.length;a++)(o=r[a])!==e&&((s=n[$i(o)]).type!==l||s.fixedrange||u.push(o));for(i=0;i<t.length;i++)if(t[i][e]){var c=t[i],h=[];for(a=0;a<u.length;a++)o=u[a],c[o]||h.push(o);return{linkableAxes:h,thisGroup:c}}return{linkableAxes:u,thisGroup:null}}(a,o,n,i),u=ne.coerce(t,e,{scaleanchor:{valType:\"enumerated\",values:l.linkableAxes}},\"scaleanchor\");if(u){var c=r(\"scaleratio\");c||(c=e.scaleratio=1),function(t,e,r,n,i){var a,o,s,l,u;null===e?((e={})[r]=1,u=t.length,t.push(e)):u=t.indexOf(e);var c=Object.keys(e);for(a=0;a<t.length;a++)if(s=t[a],a!==u&&s[n]){var h=s[n];for(o=0;o<c.length;o++)l=c[o],s[l]=h*i*e[l];return void t.splice(u,1)}if(1!==i)for(o=0;o<c.length;o++)e[c[o]]*=i;e[n]=1}(a,l.thisGroup,o,u,c)}else-1!==n.indexOf(t.scaleanchor)&&ne.warn(\"ignored \"+e._name+'.scaleanchor: \"'+t.scaleanchor+'\" to avoid either an infinite loop and possibly inconsistent scaleratios, or because the targetaxis has fixed range.')}};var ea=function(t,e,n,i){var a,o,s,l,u=i.counterAxes||[],c=i.overlayableAxes||[],h=i.letter,f=i.grid;f&&(o=f._domains[h][f._axisMap[e._id]],a=f._anchors[e._id],o&&(s=f[h+\"side\"].split(\" \")[0],l=f.domain[h][\"right\"===s||\"top\"===s?1:0])),o=o||[0,1],a=a||(r(t.position)?\"free\":u[0]||\"free\"),s=s||(\"x\"===h?\"bottom\":\"left\"),l=l||0,\"free\"===ne.coerce(t,e,{anchor:{valType:\"enumerated\",values:[\"free\"].concat(u),dflt:a}},\"anchor\")&&n(\"position\",l),ne.coerce(t,e,{side:{valType:\"enumerated\",values:\"x\"===h?[\"bottom\",\"top\"]:[\"left\",\"right\"],dflt:s}},\"side\");var p=!1;if(c.length&&(p=ne.coerce(t,e,{overlaying:{valType:\"enumerated\",values:[!1].concat(c),dflt:!1}},\"overlaying\")),!p){var d=n(\"domain\",o);d[0]>d[1]-.01&&(e.domain=o),ne.noneOrAll(t.domain,e.domain,o)}return n(\"layer\"),e},ra=gn.name2id,na=function(t,e,r,n,i){i&&(e._name=i,e._id=ra(i)),\"-\"===r(\"type\")&&(!function(t,e){if(\"-\"!==t.type)return;var r=t._id,n=r.charAt(0);-1!==r.indexOf(\"scene\")&&(r=n);var i=function(t,e,r){for(var n=0;n<t.length;n++){var i=t[n];if((i[r+\"axis\"]||r)===e){if(aa(i,r))return i;if((i[r]||[]).length||i[r+\"0\"])return i}}}(e,r,n);if(!i)return;if(\"histogram\"===i.type&&n==={v:\"y\",h:\"x\"}[i.orientation||\"v\"])return void(t.type=\"linear\");var a=n+\"calendar\",o=i[a];if(aa(i,n)){for(var s,l=ia(i),u=[],c=0;c<e.length;c++)s=e[c],P.traceIs(s,\"box-violin\")&&(s[n+\"axis\"]||n)===r&&(void 0!==s[l]?u.push(s[l][0]):void 0!==s.name?u.push(s.name):u.push(\"text\"),s[a]!==o&&(o=void 0));t.type=Yn(u,o)}else t.type=Yn(i[n]||[i[n+\"0\"]],o)}(e,n),\"-\"===e.type?e.type=\"linear\":t.type=e.type)};function ia(t){return{v:\"x\",h:\"y\"}[t.orientation||\"v\"]}function aa(t,e){var r=ia(t),n=P.traceIs(t,\"box-violin\"),i=P.traceIs(t._fullInput||{},\"candlestick\");return n&&!i&&e===r&&void 0===t[r]&&void 0===t[r+\"0\"]}var oa=Te.attrRegex,sa={},la=Te.SUBPLOT_PATTERN;sa.getSubplotCalcData=function(t,e,r){var n=P.subplotsRegistry[e];if(!n)return[];for(var i=n.attr,a=[],o=0;o<t.length;o++){var s=t[o];s[0].trace[i]===r&&a.push(s)}return a},sa.getModuleCalcData=function(t,e){var r=[],n=\"string\"==typeof e?P.getModule(e):e;if(!n)return r;for(var i=0;i<t.length;i++){var a=t[i],o=a[0].trace;o._module===n&&!0===o.visible&&r.push(a)}return r},sa.getSubplotData=function(t,e,r){if(!P.subplotsRegistry[e])return[];var n,i,a,o=P.subplotsRegistry[e].attr,s=[];if(\"gl2d\"===e){var l=r.match(la);i=\"x\"+l[1],a=\"y\"+l[2]}for(var u=0;u<t.length;u++)n=t[u],\"gl2d\"===e&&P.traceIs(n,\"gl2d\")?n[o[0]]===i&&n[o[1]]===a&&s.push(n):n[o]===r&&s.push(n);return s};var ua={},ca=sa.getModuleCalcData;function ha(t,e,r,n,i){var a=t._fullLayout._modules;e.plot&&e.plot.selectAll(\"g:not(.scatterlayer)\").selectAll(\"g.trace\").remove();for(var o=0;o<a.length;o++){var s=a[o];if(\"cartesian\"===s.basePlotModule.name){var l=ca(r,s);s.plot&&s.plot(t,e,l,n,i)}}}function fa(t){var e=t.plotgroup,r=t.id,n=Te.layerValue2layerClass[t.xaxis.layer],i=Te.layerValue2layerClass[t.yaxis.layer];if(t.mainplot){var a=t.mainplotinfo,o=a.plotgroup,s=r+\"-x\",l=r+\"-y\";t.gridlayer=a.gridlayer,t.zerolinelayer=a.zerolinelayer,ga(a.overlinesBelow,\"path\",s),ga(a.overlinesBelow,\"path\",l),ga(a.overaxesBelow,\"g\",s),ga(a.overaxesBelow,\"g\",l),t.plot=ga(a.overplot,\"g\",r),ga(a.overlinesAbove,\"path\",s),ga(a.overlinesAbove,\"path\",l),ga(a.overaxesAbove,\"g\",s),ga(a.overaxesAbove,\"g\",l),t.xlines=o.select(\".overlines-\"+n).select(\".\"+s),t.ylines=o.select(\".overlines-\"+i).select(\".\"+l),t.xaxislayer=o.select(\".overaxes-\"+n).select(\".\"+s),t.yaxislayer=o.select(\".overaxes-\"+i).select(\".\"+l)}else{var u=ga(e,\"g\",\"layer-subplot\");t.shapelayer=ga(u,\"g\",\"shapelayer\"),t.imagelayer=ga(u,\"g\",\"imagelayer\"),t.gridlayer=ga(e,\"g\",\"gridlayer\"),t.zerolinelayer=ga(e,\"g\",\"zerolinelayer\"),ga(e,\"path\",\"xlines-below\"),ga(e,\"path\",\"ylines-below\"),t.overlinesBelow=ga(e,\"g\",\"overlines-below\"),ga(e,\"g\",\"xaxislayer-below\"),ga(e,\"g\",\"yaxislayer-below\"),t.overaxesBelow=ga(e,\"g\",\"overaxes-below\"),t.plot=ga(e,\"g\",\"plot\"),t.overplot=ga(e,\"g\",\"overplot\"),ga(e,\"path\",\"xlines-above\"),ga(e,\"path\",\"ylines-above\"),t.overlinesAbove=ga(e,\"g\",\"overlines-above\"),ga(e,\"g\",\"xaxislayer-above\"),ga(e,\"g\",\"yaxislayer-above\"),t.overaxesAbove=ga(e,\"g\",\"overaxes-above\"),t.xlines=e.select(\".xlines-\"+n),t.ylines=e.select(\".ylines-\"+i),t.xaxislayer=e.select(\".xaxislayer-\"+n),t.yaxislayer=e.select(\".yaxislayer-\"+i)}ga(t.gridlayer,\"g\",t.xaxis._id,t.xaxis._id),ga(t.gridlayer,\"g\",t.yaxis._id,t.yaxis._id),t.gridlayer.selectAll(\"g\").sort(gn.idSort);for(var c=0;c<Te.traceLayerClasses.length;c++)ga(t.plot,\"g\",Te.traceLayerClasses[c]);t.xlines.style(\"fill\",\"none\").classed(\"crisp\",!0),t.ylines.style(\"fill\",\"none\").classed(\"crisp\",!0)}function pa(t,r){if(t){var n={};t.each(function(t){e.select(this).remove(),da(t,r),n[t]=!0});for(var i=r._plots,a=Object.keys(i),o=0;o<a.length;o++)for(var s=i[a[o]].overlays||[],l=0;l<s.length;l++){var u=s[l];n[u.id]&&u.plot.selectAll(\".trace\").remove()}}}function da(t,e){e._draggers.selectAll(\"g.\"+t).remove(),e._defs.select(\"#clip\"+e._uid+t+\"plot\").remove()}function ga(t,e,r,n){var i=t.selectAll(\".\"+r).data([n||0]);return i.enter().append(e).classed(r,!0),i}ua.name=\"cartesian\",ua.attr=[\"xaxis\",\"yaxis\"],ua.idRoot=[\"x\",\"y\"],ua.idRegex=Te.idRegex,ua.attrRegex=Te.attrRegex,ua.attributes=Gi,ua.layoutAttributes=Ce,ua.supplyLayoutDefaults=function(t,e,r){var n,i={},a={},o={},s={};for(n=0;n<r.length;n++){var l=r[n];if(P.traceIs(l,\"cartesian\")||P.traceIs(l,\"gl2d\")){var u=gn.id2name(l.xaxis),c=gn.id2name(l.yaxis);P.traceIs(l,\"carpet\")&&(\"carpet\"!==l.type||l._cheater)||u&&(a[u]=1),\"carpet\"===l.type&&l._cheater&&u&&(i[u]=1),P.traceIs(l,\"2dMap\")&&(o[u]=!0,o[c]=!0),P.traceIs(l,\"oriented\")&&(s[\"h\"===l.orientation?c:u]=!0)}}var h=e._subplots,f=h.xaxis,p=h.yaxis,d=ne.simpleMap(f,gn.id2name),g=ne.simpleMap(p,gn.id2name),v=d.concat(g),m=Oe.background;f.length&&p.length&&(m=ne.coerce(t,e,z,\"plot_bgcolor\"));var y,x,b,_,w=Oe.combine(m,e.paper_bgcolor);function M(t,e){return ne.coerce(b,_,Ce,t,e)}function A(t,e){return ne.coerce2(b,_,Ce,t,e)}function k(t){return\"x\"===t?p:f}var T={x:k(\"x\"),y:k(\"y\")};function S(e,r){for(var n=\"x\"===e?d:g,i=[],a=0;a<n.length;a++){var o=n[a];o===r||(t[o]||{}).overlaying||i.push(gn.name2id(o))}return i}for(n=0;n<v.length;n++){y=v[n],ne.isPlainObject(t[y])||(t[y]={}),b=t[y],_=e[y]={},na(b,_,M,r,y);var E=S(x=y.charAt(0),y),C={letter:x,font:e.font,outerTicks:o[y],showGrid:!s[y],data:r,bgColor:w,calendar:e.calendar,automargin:!0,cheateronly:\"x\"===x&&i[y]&&!a[y]};Qi(b,_,M,C,e);var L=A(\"spikecolor\"),I=A(\"spikethickness\"),D=A(\"spikedash\"),O=A(\"spikemode\"),R=A(\"spikesnap\");M(\"showspikes\",!!(L||I||D||O||R))||(delete _.spikecolor,delete _.spikethickness,delete _.spikedash,delete _.spikemode,delete _.spikesnap);var F={letter:x,counterAxes:T[x],overlayableAxes:E,grid:e.grid};ea(b,_,M,F),_._input=b}var B=P.getComponentMethod(\"rangeslider\",\"handleDefaults\"),N=P.getComponentMethod(\"rangeselector\",\"handleDefaults\");for(n=0;n<d.length;n++)y=d[n],b=t[y],_=e[y],B(t,e,y),\"date\"===_.type&&N(b,_,e,g,_.calendar),M(\"fixedrange\");for(n=0;n<g.length;n++){y=g[n],b=t[y],_=e[y];var j=e[gn.id2name(_.anchor)];M(\"fixedrange\",j&&j.rangeslider&&j.rangeslider.visible)}e._axisConstraintGroups=[];var V=T.x.concat(T.y);for(n=0;n<v.length;n++)x=(y=v[n]).charAt(0),b=t[y],_=e[y],ta(b,_,M,V,e)},ua.transitionAxes=function(t,r,n,i){var a=t._fullLayout,o=[];var s,l,u,c,h=function(t){var e,r,n,i,s={};for(e in t)if((r=e.split(\".\"))[0].match(oa)){var l=e.charAt(0),u=r[0];if(n=a[u],i={},Array.isArray(t[e])?i.to=t[e].slice(0):Array.isArray(t[e].range)&&(i.to=t[e].range.slice(0)),!i.to)continue;i.axisName=u,i.length=n._length,o.push(l),s[l]=i}return s}(r),f=Object.keys(h),p=function(t,e,r){var n,i,a,o=t._plots,s=[];for(n in o){var l=o[n];if(-1===s.indexOf(l)){var u=l.xaxis._id,c=l.yaxis._id,h=l.xaxis.range,f=l.yaxis.range;l.xaxis._r=l.xaxis.range.slice(),l.yaxis._r=l.yaxis.range.slice(),i=r[u]?r[u].to:h,a=r[c]?r[c].to:f,h[0]===i[0]&&h[1]===i[1]&&f[0]===a[0]&&f[1]===a[1]||-1===e.indexOf(u)&&-1===e.indexOf(c)||s.push(l)}}return s}(a,f,h);if(!p.length)return function(){function e(e,r,n){for(var i=0;i<e.length;i++)if(r(t,i),n)return}e(a.annotations||[],P.getComponentMethod(\"annotations\",\"drawOne\")),e(a.shapes||[],P.getComponentMethod(\"shapes\",\"drawOne\")),e(a.images||[],P.getComponentMethod(\"images\",\"draw\"),!0)}(),!1;function d(t){var e=t.xaxis,r=t.yaxis;a._defs.select(\"#\"+t.clipId+\"> rect\").call(Sr.setTranslate,0,0).call(Sr.setScale,1,1),t.plot.call(Sr.setTranslate,e._offset,r._offset).call(Sr.setScale,1,1);var n=t.plot.selectAll(\".scatterlayer .trace\");n.selectAll(\".point\").call(Sr.setPointGroupScale,1,1),n.selectAll(\".textpoint\").call(Sr.setTextPointsScale,1,1),n.call(Sr.hideOutsideRangePoints,t)}function g(e,r){var n,i,o,s=h[e.xaxis._id],l=h[e.yaxis._id],u=[];if(s){i=(n=t._fullLayout[s.axisName])._r,o=s.to,u[0]=(i[0]*(1-r)+r*o[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var c=i[1]-i[0],f=o[1]-o[0];n.range[0]=i[0]*(1-r)+r*o[0],n.range[1]=i[1]*(1-r)+r*o[1],u[2]=e.xaxis._length*(1-r+r*f/c)}else u[0]=0,u[2]=e.xaxis._length;if(l){i=(n=t._fullLayout[l.axisName])._r,o=l.to,u[1]=(i[1]*(1-r)+r*o[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var p=i[1]-i[0],d=o[1]-o[0];n.range[0]=i[0]*(1-r)+r*o[0],n.range[1]=i[1]*(1-r)+r*o[1],u[3]=e.yaxis._length*(1-r+r*d/p)}else u[1]=0,u[3]=e.yaxis._length;!function(e,r){var n,i=[];for(i=[e._id,r._id],n=0;n<i.length;n++)ri.doTicks(t,i[n],!0);function o(e,r,a){for(n=0;n<e.length;n++){var o=e[n];if(-1===i.indexOf(o.xref)&&-1===i.indexOf(o.yref)||r(t,n),a)return}}o(a.annotations||[],P.getComponentMethod(\"annotations\",\"drawOne\")),o(a.shapes||[],P.getComponentMethod(\"shapes\",\"drawOne\")),o(a.images||[],P.getComponentMethod(\"images\",\"draw\"),!0)}(e.xaxis,e.yaxis);var g=e.xaxis,v=e.yaxis,m=!!s,y=!!l,x=m?g._length/u[2]:1,b=y?v._length/u[3]:1,_=m?u[0]:0,w=y?u[1]:0,M=m?u[0]/u[2]*g._length:0,A=y?u[1]/u[3]*v._length:0,k=g._offset-M,T=v._offset-A;a._defs.select(\"#\"+e.clipId+\"> rect\").call(Sr.setTranslate,_,w).call(Sr.setScale,1/x,1/b),e.plot.call(Sr.setTranslate,k,T).call(Sr.setScale,x,b).selectAll(\".points\").selectAll(\".point\").call(Sr.setPointGroupScale,1/x,1/b),e.plot.selectAll(\".points\").selectAll(\".textpoint\").call(Sr.setTextPointsScale,1/x,1/b)}i&&(s=i());var v=e.ease(n.easing);return t._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(c),c=null,function(){for(var e={},r=0;r<f.length;r++){var n=t._fullLayout[f[r]+\"axis\"];e[n._name+\".range[0]\"]=n.range[0],e[n._name+\".range[1]\"]=n.range[1],n.range=n._r.slice()}return P.call(\"relayout\",t,e).then(function(){for(var t=0;t<p.length;t++)d(p[t])})}()}),l=Date.now(),c=window.requestAnimationFrame(function e(){u=Date.now();for(var r=Math.min(1,(u-l)/n.duration),i=v(r),a=0;a<p.length;a++)g(p[a],i);u-l>n.duration?(function(){for(var e={},r=0;r<f.length;r++){var n=t._fullLayout[h[f[r]].axisName],i=h[f[r]].to;e[n._name+\".range[0]\"]=i[0],e[n._name+\".range[1]\"]=i[1],n.range=i.slice()}s&&s(),P.call(\"relayout\",t,e).then(function(){for(var t=0;t<p.length;t++)d(p[t])})}(),c=window.cancelAnimationFrame(e)):c=window.requestAnimationFrame(e)}),Promise.resolve()},ua.finalizeSubplots=function(t,e){var r,n,i,a=e._subplots,o=a.xaxis,s=a.yaxis,l=a.cartesian,u=l.concat(a.gl2d||[]),c={},h={};for(r=0;r<u.length;r++){var f=u[r].split(\"y\");c[f[0]]=1,h[\"y\"+f[1]]=1}for(r=0;r<o.length;r++)c[n=o[r]]||(i=(t[gn.id2name(n)]||{}).anchor,Te.idRegex.y.test(i)||(i=\"y\"),l.push(n+i),u.push(n+i),h[i]||(h[i]=1,ne.pushUnique(s,i)));for(r=0;r<s.length;r++)h[i=s[r]]||(n=(t[gn.id2name(i)]||{}).anchor,Te.idRegex.x.test(n)||(n=\"x\"),l.push(n+i),u.push(n+i),c[n]||(c[n]=1,ne.pushUnique(o,n)));if(!u.length){for(var p in n=\"\",i=\"\",t){if(Te.attrRegex.test(p))\"x\"===p.charAt(0)?(!n||+p.substr(5)<+n.substr(5))&&(n=p):(!i||+p.substr(5)<+i.substr(5))&&(i=p)}n=n?gn.name2id(n):\"x\",i=i?gn.name2id(i):\"y\",o.push(n),s.push(i),l.push(n+i)}},ua.plot=function(t,e,r,n){var i,a=t._fullLayout,o=a._subplots.cartesian,s=t.calcdata;if(!Array.isArray(e))for(e=[],i=0;i<s.length;i++)e.push(i);for(a._glcanvas&&a._glcanvas.size()&&a._glcanvas.each(function(t){t.regl&&t.regl.clear({color:!0})}),i=0;i<o.length;i++){for(var l,u=o[i],c=a._plots[u],h=[],f=0;f<s.length;f++){var p=s[f],d=p[0].trace;d.xaxis+d.yaxis===u&&((-1!==e.indexOf(d.index)||d.carpet)&&(l&&l[0].trace.xaxis+l[0].trace.yaxis===u&&-1!==[\"tonextx\",\"tonexty\",\"tonext\"].indexOf(d.fill)&&-1===h.indexOf(l)&&h.push(l),h.push(p)),l=p)}ha(t,c,h,r,n)}},ua.clean=function(t,e,r,n){var i,a,o,s,l,u,c,h,f,p=n._modules||[],d=e._modules||[];for(l=0;l<p.length;l++)\"scatter\"===(f=p[l].name)?i=!0:\"scattergl\"===f&&(o=!0);for(l=0;l<d.length;l++)\"scatter\"===(f=d[l].name)?a=!0:\"scattergl\"===f&&(s=!0);if(i&&!a){for(u=n._plots,c=Object.keys(u||{}),l=0;l<c.length;l++)(h=u[c[l]]).plot&&h.plot.select(\"g.scatterlayer\").selectAll(\"g.trace\").remove();n._infolayer.selectAll(\"g.rangeslider-container\").select(\"g.scatterlayer\").selectAll(\"g.trace\").remove()}if(o&&!s)for(u=n._plots,c=Object.keys(u||{}),l=0;l<c.length;l++)(h=u[c[l]])._scene&&h._scene.destroy();var g=n._subplots||{},v=e._subplots||{xaxis:[],yaxis:[]};if(g.xaxis&&g.yaxis){var m=g.xaxis.concat(g.yaxis),y=v.xaxis.concat(v.yaxis);for(l=0;l<m.length;l++)-1===y.indexOf(m[l])&&n._infolayer.selectAll(\".g-\"+m[l]+\"title\").remove()}var x=n._has&&n._has(\"cartesian\"),b=e._has&&e._has(\"cartesian\");if(x&&!b)pa(n._cartesianlayer.selectAll(\".subplot\"),n),n._defs.selectAll(\".axesclip\").remove(),delete n._axisConstraintGroups;else if(g.cartesian)for(l=0;l<g.cartesian.length;l++){var _=g.cartesian[l];if(-1===v.cartesian.indexOf(_)){var w=\".\"+_+\",.\"+_+\"-x,.\"+_+\"-y\";n._cartesianlayer.selectAll(w).remove(),da(_,n)}}},ua.drawFramework=function(t){var r=t._fullLayout,n=function(t){for(var e=t._fullLayout,r=Object.keys(e._plots),n=[],i=[],a=0;a<r.length;a++){var o=r[a],s=e._plots[o],l=s.xaxis,u=s.yaxis,c=l._mainAxis,h=u._mainAxis,f=c._id+h._id;f!==o&&-1!==r.indexOf(f)?(s.mainplot=f,s.mainplotinfo=e._plots[f],i.push(o)):n.push(o)}return n=n.concat(i)}(t),i=r._cartesianlayer.selectAll(\".subplot\").data(n,ne.identity);i.enter().append(\"g\").attr(\"class\",function(t){return\"subplot \"+t}),i.order(),i.exit().call(pa,r),i.each(function(t){var n=r._plots[t];(n.plotgroup=e.select(this),n.overlays=[],fa(n),n.mainplot)&&r._plots[n.mainplot].overlays.push(n);n.draglayer=ga(r._draggers,\"g\",t)})},ua.rangePlot=function(t,e,r){fa(e),ha(t,e,r),_n.style(t)},ua.toSVG=function(t){var r=t._fullLayout._glimages,n=e.select(t).selectAll(\".svg-container\");n.filter(function(t,e){return e===n.size()-1}).selectAll(\".gl-canvas-context, .gl-canvas-focus\").each(function(){var t=this.toDataURL(\"image/png\");r.append(\"svg:image\").attr({xmlns:$e.svg,\"xlink:href\":t,preserveAspectRatio:\"none\",x:0,y:0,width:this.width,height:this.height})})};var va=ne.mergeArray,ma=function(t,e){for(var r=0;r<t.length;r++)t[r].i=r;va(e.text,t,\"tx\"),va(e.hovertext,t,\"htx\");var n=e.marker;if(n){va(n.opacity,t,\"mo\"),va(n.color,t,\"mc\");var i=n.line;i&&(va(i.color,t,\"mlc\"),va(i.width,t,\"mlw\"))}},ya=m.extendFlat,xa=T({editType:\"calc\",arrayOk:!0}),ba=Zr.marker,_a=ya({line:ya({width:ya({},ba.line.width,{dflt:0}),editType:\"calc\"},De()),editType:\"calc\"},De(),{showscale:ba.showscale,colorbar:ze,opacity:{valType:\"number\",arrayOk:!0,dflt:1,min:0,max:1,editType:\"style\"}}),wa={x:Zr.x,x0:Zr.x0,dx:Zr.dx,y:Zr.y,y0:Zr.y0,dy:Zr.dy,text:Zr.text,hovertext:Zr.hovertext,textposition:{valType:\"enumerated\",values:[\"inside\",\"outside\",\"auto\",\"none\"],dflt:\"none\",arrayOk:!0,editType:\"calc\"},textfont:ya({},xa,{}),insidetextfont:ya({},xa,{}),outsidetextfont:ya({},xa,{}),constraintext:{valType:\"enumerated\",values:[\"inside\",\"outside\",\"both\",\"none\"],dflt:\"both\",editType:\"calc\"},cliponaxis:ya({},Zr.cliponaxis,{}),orientation:{valType:\"enumerated\",values:[\"v\",\"h\"],editType:\"calc+clearAxisTypes\"},base:{valType:\"any\",dflt:null,arrayOk:!0,editType:\"calc\"},offset:{valType:\"number\",dflt:null,arrayOk:!0,editType:\"calc\"},width:{valType:\"number\",dflt:null,min:0,arrayOk:!0,editType:\"calc\"},marker:_a,selected:{marker:{opacity:Zr.selected.marker.opacity,color:Zr.selected.marker.color,editType:\"style\"},textfont:Zr.selected.textfont,editType:\"style\"},unselected:{marker:{opacity:Zr.unselected.marker.opacity,color:Zr.unselected.marker.color,editType:\"style\"},textfont:Zr.unselected.textfont,editType:\"style\"},r:Zr.r,t:Zr.t,_deprecated:{bardir:{valType:\"enumerated\",editType:\"calc\",values:[\"v\",\"h\"]}}},Ma=function(t,e){ne.isArrayOrTypedArray(e.selectedpoints)&&ne.tagSelected(t,e)},Aa=ne.isArrayOrTypedArray,ka=function(t,e,r,n,i){r(\"marker.color\",n),Xe(t,\"marker\")&&Ye(t,e,i,r,{prefix:\"marker.\",cLetter:\"c\"}),r(\"marker.line.color\",Oe.defaultLine),Xe(t,\"marker.line\")&&Ye(t,e,i,r,{prefix:\"marker.line.\",cLetter:\"c\"}),r(\"marker.line.width\"),r(\"marker.opacity\"),r(\"selected.marker.color\"),r(\"unselected.marker.color\")},Ta=function(t,e,r,n){var i,a=n(\"x\"),o=n(\"y\");if(P.getComponentMethod(\"calendars\",\"handleTraceDefaults\")(t,e,[\"x\",\"y\"],r),a)o?i=Math.min(a.length,o.length):(i=a.length,n(\"y0\"),n(\"dy\"));else{if(!o)return 0;i=e.y.length,n(\"x0\"),n(\"dx\")}return e._length=i,i},Sa={};(function(t){\"use strict\";var e;e=\"function\"!=typeof t.matchMedia||!t.matchMedia(\"(hover: none)\").matches,Sa=e}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{});var Ea=function(){var t=!1;try{var e=Object.defineProperty({},\"passive\",{get:function(){t=!0}});window.addEventListener(\"test\",null,e),window.removeEventListener(\"test\",null,e)}catch(e){t=!1}return t}(),Ca={left:0,top:0},La=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var n=t.clientX||0,i=t.clientY||0,a=(o=e,o===window||o===document||o===document.body?Ca:o.getBoundingClientRect());var o;return r[0]=n-a.left,r[1]=i-a.top,r};var za=[[\"sw-resize\",\"s-resize\",\"se-resize\"],[\"w-resize\",\"move\",\"e-resize\"],[\"nw-resize\",\"n-resize\",\"ne-resize\"]],Pa={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:\"Arial, sans-serif\",HOVERMINTIME:50,HOVERID:\"-hover\"};function Ia(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}var Da=Ia;function Oa(t){return\"function\"==typeof t}function Ra(t){return\"object\"==typeof t&&null!==t}function Fa(t){return void 0===t}Ia.EventEmitter=Ia,Ia.prototype._events=void 0,Ia.prototype._maxListeners=void 0,Ia.defaultMaxListeners=10,Ia.prototype.setMaxListeners=function(t){if(\"number\"!=typeof t||t<0||isNaN(t))throw TypeError(\"n must be a positive number\");return this._maxListeners=t,this},Ia.prototype.emit=function(t){var e,r,n,i,a,o;if(this._events||(this._events={}),\"error\"===t&&(!this._events.error||Ra(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var s=new Error('Uncaught, unspecified \"error\" event. ('+e+\")\");throw s.context=e,s}if(Fa(r=this._events[t]))return!1;if(Oa(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),r.apply(this,i)}else if(Ra(r))for(i=Array.prototype.slice.call(arguments,1),n=(o=r.slice()).length,a=0;a<n;a++)o[a].apply(this,i);return!0},Ia.prototype.addListener=function(t,e){var r;if(!Oa(e))throw TypeError(\"listener must be a function\");return this._events||(this._events={}),this._events.newListener&&this.emit(\"newListener\",t,Oa(e.listener)?e.listener:e),this._events[t]?Ra(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,Ra(this._events[t])&&!this._events[t].warned&&(r=Fa(this._maxListeners)?Ia.defaultMaxListeners:this._maxListeners)&&r>0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error(\"(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.\",this._events[t].length),\"function\"==typeof console.trace&&console.trace()),this},Ia.prototype.on=Ia.prototype.addListener,Ia.prototype.once=function(t,e){if(!Oa(e))throw TypeError(\"listener must be a function\");var r=!1;function n(){this.removeListener(t,n),r||(r=!0,e.apply(this,arguments))}return n.listener=e,this.on(t,n),this},Ia.prototype.removeListener=function(t,e){var r,n,i,a;if(!Oa(e))throw TypeError(\"listener must be a function\");if(!this._events||!this._events[t])return this;if(i=(r=this._events[t]).length,n=-1,r===e||Oa(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit(\"removeListener\",t,e);else if(Ra(r)){for(a=i;a-- >0;)if(r[a]===e||r[a].listener&&r[a].listener===e){n=a;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit(\"removeListener\",t,e)}return this},Ia.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)\"removeListener\"!==e&&this.removeAllListeners(e);return this.removeAllListeners(\"removeListener\"),this._events={},this}if(Oa(r=this._events[t]))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},Ia.prototype.listeners=function(t){return this._events&&this._events[t]?Oa(this._events[t])?[this._events[t]]:this._events[t].slice():[]},Ia.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(Oa(e))return 1;if(e)return e.length}return 0},Ia.listenerCount=function(t,e){return t.listenerCount(e)};var Ba,Na=Da.EventEmitter,ja={init:function(t){if(t._ev instanceof Na)return t;var e=new Na,r=new Na;return t._ev=e,t._internalEv=r,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t._internalOn=r.on.bind(r),t._internalOnce=r.once.bind(r),t._removeInternalListener=r.removeListener.bind(r),t._removeAllInternalListeners=r.removeAllListeners.bind(r),t.emit=function(n,i){\"undefined\"!=typeof jQuery&&jQuery(t).trigger(n,i),e.emit(n,i),r.emit(n,i)},t},triggerHandler:function(t,e,r){var n,i;\"undefined\"!=typeof jQuery&&(n=jQuery(t).triggerHandler(e,r));var a=t._ev;if(!a)return n;var o=a._events[e];if(!o)return n;\"function\"==typeof o&&(o=[o]);for(var s=o.pop(),l=0;l<o.length;l++)o[l](r);return i=s(r),void 0!==n?n:i},purge:function(t){return delete t._ev,delete t.on,delete t.once,delete t.removeListener,delete t.removeAllListeners,delete t.emit,delete t._ev,delete t._internalEv,delete t._internalOn,delete t._internalOnce,delete t._removeInternalListener,delete t._removeAllInternalListeners,t}},Va=Ba={};Va.wrapped=function(t,e,r){(t=Bt(t))._fullLayout&&$t.clear(t._fullLayout._uid+Pa.HOVERID),Va.raw(t,e,r)},Va.raw=function(t,e){var r=t._fullLayout,n=t._hoverdata;e||(e={}),e.target&&!1===ja.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&&n&&t.emit(\"plotly_unhover\",{event:e,points:n}))};var Ua={},qa=Ua={};function Ha(){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 Ga(t){return La(t.changedTouches?t.changedTouches[0]:t,document.body)}qa.align=function(t,e,r,n,i){var a=(t-r)/(n-r),o=a+e/(n-r),s=(a+o)/2;return\"left\"===i||\"bottom\"===i?a:\"center\"===i||\"middle\"===i?s:\"right\"===i||\"top\"===i?o:a<2/3-s?a:o>4/3-s?o:s},qa.getCursor=function(t,e,r,n){return t=\"left\"===r?0:\"center\"===r?1:\"right\"===r?2:ne.constrain(Math.floor(3*t),0,2),e=\"bottom\"===n?0:\"middle\"===n?1:\"top\"===n?2:ne.constrain(Math.floor(3*e),0,2),za[e][t]},qa.unhover=Ba.wrapped,qa.unhoverRaw=Ba.raw,qa.init=function(t){var e,r,n,i,a,o,s,l,u=t.gd,c=1,h=f.DBLCLICKDELAY,p=t.element;u._mouseDownTime||(u._mouseDownTime=0),p.style.pointerEvents=\"all\",p.onmousedown=g,Ea?(p._ontouchstart&&p.removeEventListener(\"touchstart\",p._ontouchstart),p._ontouchstart=g,p.addEventListener(\"touchstart\",g,{passive:!1})):p.ontouchstart=g;var d=t.clampFn||function(t,e,r){return Math.abs(t)<r&&(t=0),Math.abs(e)<r&&(e=0),[t,e]};function g(f){f.preventDefault(),u._dragged=!1,u._dragging=!0;var d=Ga(f);e=d[0],r=d[1],s=f.target,o=f,l=2===f.buttons||f.ctrlKey,(n=(new Date).getTime())-u._mouseDownTime<h?c+=1:(c=1,u._mouseDownTime=n),t.prepFn&&t.prepFn(f,e,r),Sa&&!l?(a=Ha()).style.cursor=window.getComputedStyle(p).cursor:Sa||(a=document,i=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(p).cursor),document.addEventListener(\"mousemove\",v),document.addEventListener(\"mouseup\",m),document.addEventListener(\"touchmove\",v),document.addEventListener(\"touchend\",m)}function v(n){n.preventDefault();var i=Ga(n),a=t.minDrag||Te.MINDRAG,o=d(i[0]-e,i[1]-r,a),s=o[0],c=o[1];(s||c)&&(u._dragged=!0,qa.unhover(u)),u._dragged&&t.moveFn&&!l&&t.moveFn(s,c)}function m(e){if(document.removeEventListener(\"mousemove\",v),document.removeEventListener(\"mouseup\",m),document.removeEventListener(\"touchmove\",v),document.removeEventListener(\"touchend\",m),e.preventDefault(),Sa?ne.removeElement(a):i&&(a.documentElement.style.cursor=i,i=null),u._dragging){if(u._dragging=!1,(new Date).getTime()-u._mouseDownTime>h&&(c=Math.max(c-1,1)),u._dragged)t.doneFn&&t.doneFn(e);else if(t.clickFn&&t.clickFn(c,o),!l){var r;try{r=new MouseEvent(\"click\",e)}catch(t){var n=Ga(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)}s.dispatchEvent(r)}!function(t){t._dragging=!1,t._replotPending&&P.call(\"plot\",t)}(u),u._dragged=!1}else u._dragged=!1}},qa.coverSlip=Ha;function Wa(t,e,r,n){n=n||ne.identity,Array.isArray(t)&&(e[0][r]=n(t))}var Ya={getSubplot:function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},flat:function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=e;return r},p2c:function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=t[n].p2c(e);return r},getDistanceFunction:function(t,e,r,n){return\"closest\"===t?n||Ya.quadrature(e,r):\"x\"===t?e:r},getClosest:function(t,e,r){if(!1!==r.index)r.index>=0&&r.index<t.length?r.distance=0:r.index=!1;else for(var n=0;n<t.length;n++){var i=e(t[n]);i<=r.distance&&(r.index=n,r.distance=i)}return r},inbox:function(t,e,r){return t*e<0||0===t?r:1/0},quadrature:function(t,e){return function(r){var n=t(r),i=e(r);return Math.sqrt(n*n+i*i)}},makeEventData:function(t,e,r){var n=\"index\"in t?t.index:t.pointNumber,i={data:e._input,fullData:e,curveNumber:e.index,pointNumber:n};if(e._indexToPoints){var a=e._indexToPoints[n];1===a.length?i.pointIndex=a[0]:i.pointIndices=a}else i.pointIndex=n;return e._module.eventData?i=e._module.eventData(i,t,e,r,n):(\"xVal\"in t?i.x=t.xVal:\"x\"in t&&(i.x=t.x),\"yVal\"in t?i.y=t.yVal:\"y\"in t&&(i.y=t.y),t.xa&&(i.xaxis=t.xa),t.ya&&(i.yaxis=t.ya),void 0!==t.zLabelVal&&(i.z=t.zLabelVal)),Ya.appendArrayPointValue(i,e,n),i},appendArrayPointValue:function(t,e,r){var n=e._arrayAttrs;if(n)for(var i=0;i<n.length;i++){var a=n[i],o=Za(a);if(void 0===t[o]){var s=Ja(ne.nestedProperty(e,a).get(),r);void 0!==s&&(t[o]=s)}}},appendArrayMultiPointValues:function(t,e,r){var n=e._arrayAttrs;if(n)for(var i=0;i<n.length;i++){var a=n[i],o=Za(a);if(void 0===t[o]){for(var s=ne.nestedProperty(e,a).get(),l=new Array(r.length),u=0;u<r.length;u++)l[u]=Ja(s,r[u]);t[o]=l}}}},Xa={ids:\"id\",locations:\"location\",labels:\"label\",values:\"value\",\"marker.colors\":\"color\"};function Za(t){return Xa[t]||t}function Ja(t,e){return Array.isArray(e)?Array.isArray(t)&&Array.isArray(t[e[0]])?t[e[0]][e[1]]:void 0:t[e]}var Ka=function(t,e){(t.attr(\"class\")||\"\").split(\" \").forEach(function(e){0===e.indexOf(\"cursor-\")&&t.classed(e,!1)}),e&&t.classed(\"cursor-\"+e,!0)},Qa=\"data-savedcursor\",$a=function(t,e){var r=t.attr(Qa);if(e){if(!r){for(var n=(t.attr(\"class\")||\"\").split(\" \"),i=0;i<n.length;i++){var a=n[i];0===a.indexOf(\"cursor-\")&&t.attr(Qa,a.substr(7)).classed(a,!1)}t.attr(Qa)||t.attr(Qa,\"!!\")}Ka(t,e)}else r&&(t.attr(Qa,null),\"!!\"===r?Ka(t):Ka(t,r))},to={},eo=Pa.YANGLE,ro=Math.PI*eo/180,no=1/Math.sin(ro),io=Math.cos(ro),ao=Math.sin(ro),oo=Pa.HOVERARROWSIZE,so=Pa.HOVERTEXTPAD;function lo(t,r,n){var i=r.hovermode,a=r.rotateLabels,o=r.bgColor,s=r.container,l=r.outerContainer,u=r.commonLabelOpts||{},c=r.fontFamily||Pa.HOVERFONT,h=r.fontSize||Pa.HOVERFONTSIZE,f=t[0],p=f.xa,d=f.ya,g=\"y\"===i?\"yLabel\":\"xLabel\",v=f[g],m=(String(v)||\"\").split(\" \")[0],y=l.node().getBoundingClientRect(),x=y.top,b=y.width,_=y.height,w=void 0!==v&&f.distance<=r.hoverdistance&&(\"x\"===i||\"y\"===i);if(w){var M,A,k=!0;for(M=0;M<t.length;M++){k&&void 0===t[M].zLabel&&(k=!1),A=t[M].hoverinfo||t[M].trace.hoverinfo;var T=Array.isArray(A)?A:A.split(\"+\");if(-1===T.indexOf(\"all\")&&-1===T.indexOf(i)){w=!1;break}}k&&(w=!1)}var S=s.selectAll(\"g.axistext\").data(w?[0]:[]);S.enter().append(\"g\").classed(\"axistext\",!0),S.exit().remove(),S.each(function(){var r=e.select(this),a=r.selectAll(\"path\").data([0]),o=r.selectAll(\"text\").data([0]);a.enter().append(\"path\").style({\"stroke-width\":\"1px\"}),a.style({fill:u.bgcolor||Oe.defaultLine,stroke:u.bordercolor||Oe.background}),o.enter().append(\"text\").attr(\"data-notex\",1),o.text(v).call(Sr.font,u.font.family||c,u.font.size||h,u.font.color||Oe.background).call(er.positionText,0,0).call(er.convertToTspans,n),r.attr(\"transform\",\"\");var s=o.node().getBoundingClientRect();if(\"x\"===i){o.attr(\"text-anchor\",\"middle\").call(er.positionText,0,\"top\"===p.side?x-s.bottom-oo-so:x-s.top+oo+so);var l=\"top\"===p.side?\"-\":\"\";a.attr(\"d\",\"M0,0L\"+oo+\",\"+l+oo+\"H\"+(so+s.width/2)+\"v\"+l+(2*so+s.height)+\"H-\"+(so+s.width/2)+\"V\"+l+oo+\"H-\"+oo+\"Z\"),r.attr(\"transform\",\"translate(\"+(p._offset+(f.x0+f.x1)/2)+\",\"+(d._offset+(\"top\"===p.side?0:d._length))+\")\")}else{o.attr(\"text-anchor\",\"right\"===d.side?\"start\":\"end\").call(er.positionText,(\"right\"===d.side?1:-1)*(so+oo),x-s.top-s.height/2);var y=\"right\"===d.side?\"\":\"-\";a.attr(\"d\",\"M0,0L\"+y+oo+\",\"+oo+\"V\"+(so+s.height/2)+\"h\"+y+(2*so+s.width)+\"V-\"+(so+s.height/2)+\"H\"+y+oo+\"V-\"+oo+\"Z\"),r.attr(\"transform\",\"translate(\"+(p._offset+(\"right\"===d.side?p._length:0))+\",\"+(d._offset+(f.y0+f.y1)/2)+\")\")}t=t.filter(function(t){return void 0!==t.zLabelVal||(t[g]||\"\").split(\" \")[0]===m})});var E=s.selectAll(\"g.hovertext\").data(t,function(t){return[t.trace.index,t.index,t.x0,t.y0,t.name,t.attr,t.xa,t.ya||\"\"].join(\",\")});return E.enter().append(\"g\").classed(\"hovertext\",!0).each(function(){var t=e.select(this);t.append(\"rect\").call(Oe.fill,Oe.addOpacity(o,.8)),t.append(\"text\").classed(\"name\",!0),t.append(\"path\").style(\"stroke-width\",\"1px\"),t.append(\"text\").classed(\"nums\",!0).call(Sr.font,c,h)}),E.exit().remove(),E.each(function(t){var r=e.select(this).attr(\"transform\",\"\"),s=\"\",l=\"\",u=Oe.opacity(t.color)?t.color:Oe.defaultLine,f=Oe.combine(u,o),p=t.borderColor||Oe.contrast(f);if(void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name){s=er.plainText(t.name||\"\");var d=Math.round(t.nameLength);d>-1&&s.length>d&&(s=d>3?s.substr(0,d-3)+\"...\":s.substr(0,d))}void 0!==t.extraText&&(l+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(l+=\"x: \"+t.xLabel+\"<br>\"),void 0!==t.yLabel&&(l+=\"y: \"+t.yLabel+\"<br>\"),l+=(l?\"z: \":\"\")+t.zLabel):w&&t[i+\"Label\"]===v?l=t[(\"x\"===i?\"y\":\"x\")+\"Label\"]||\"\":void 0===t.xLabel?void 0!==t.yLabel&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:\"(\"+t.xLabel+\", \"+t.yLabel+\")\",t.text&&!Array.isArray(t.text)&&(l+=(l?\"<br>\":\"\")+t.text),\"\"===l&&(\"\"===s&&r.remove(),l=s);var g=r.select(\"text.nums\").call(Sr.font,t.fontFamily||c,t.fontSize||h,t.fontColor||p).text(l).attr(\"data-notex\",1).call(er.positionText,0,0).call(er.convertToTspans,n),m=r.select(\"text.name\"),y=0;s&&s!==l?(m.call(Sr.font,t.fontFamily||c,t.fontSize||h,f).text(s).attr(\"data-notex\",1).call(er.positionText,0,0).call(er.convertToTspans,n),y=m.node().getBoundingClientRect().width+2*so):(m.remove(),r.select(\"rect\").remove()),r.select(\"path\").style({fill:f,stroke:p});var M,A,k=g.node().getBoundingClientRect(),T=t.xa._offset+(t.x0+t.x1)/2,S=t.ya._offset+(t.y0+t.y1)/2,E=Math.abs(t.x1-t.x0),C=Math.abs(t.y1-t.y0),L=k.width+oo+so+y;t.ty0=x-k.top,t.bx=k.width+2*so,t.by=k.height+2*so,t.anchor=\"start\",t.txwidth=k.width,t.tx2width=y,t.offset=0,a?(t.pos=T,M=S+C/2+L<=_,A=S-C/2-L>=0,\"top\"!==t.idealAlign&&M||!A?M?(S+=C/2,t.anchor=\"start\"):t.anchor=\"middle\":(S-=C/2,t.anchor=\"end\")):(t.pos=S,M=T+E/2+L<=b,A=T-E/2-L>=0,\"left\"!==t.idealAlign&&M||!A?M?(T+=E/2,t.anchor=\"start\"):t.anchor=\"middle\":(T-=E/2,t.anchor=\"end\")),g.attr(\"text-anchor\",t.anchor),y&&m.attr(\"text-anchor\",t.anchor),r.attr(\"transform\",\"translate(\"+T+\",\"+S+\")\"+(a?\"rotate(\"+eo+\")\":\"\"))}),E}function uo(t,r){t.each(function(t){var n=e.select(this);if(t.del)n.remove();else{var i=\"end\"===t.anchor?-1:1,a=n.select(\"text.nums\"),o={start:1,end:-1,middle:0}[t.anchor],s=o*(oo+so),l=s+o*(t.txwidth+so),u=0,c=t.offset;\"middle\"===t.anchor&&(s-=t.tx2width/2,l+=t.txwidth/2+so),r&&(c*=-ao,u=t.offset*io),n.select(\"path\").attr(\"d\",\"middle\"===t.anchor?\"M-\"+(t.bx/2+t.tx2width/2)+\",\"+(c-t.by/2)+\"h\"+t.bx+\"v\"+t.by+\"h-\"+t.bx+\"Z\":\"M0,0L\"+(i*oo+u)+\",\"+(oo+c)+\"v\"+(t.by/2-oo)+\"h\"+i*t.bx+\"v-\"+t.by+\"H\"+(i*oo+u)+\"V\"+(c-oo)+\"Z\"),a.call(er.positionText,s+u,c+t.ty0-t.by/2+so),t.tx2width&&(n.select(\"text.name\").call(er.positionText,l+o*so+u,c+t.ty0-t.by/2+so),n.select(\"rect\").call(Sr.setRect,l+(o-1)*t.tx2width/2+u,c-t.by/2-1,t.tx2width,t.by+2))}})}function co(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],a=t.cd[r]||{},o=Array.isArray(r)?function(t,e){return ne.castOption(i,r,t)||ne.extractOption({},n,\"\",e)}:function(t,e){return ne.extractOption(a,n,t,e)};function s(e,r,n){var i=o(r,n);i&&(t[e]=i)}if(s(\"hoverinfo\",\"hi\",\"hoverinfo\"),s(\"color\",\"hbg\",\"hoverlabel.bgcolor\"),s(\"borderColor\",\"hbc\",\"hoverlabel.bordercolor\"),s(\"fontFamily\",\"htf\",\"hoverlabel.font.family\"),s(\"fontSize\",\"hts\",\"hoverlabel.font.size\"),s(\"fontColor\",\"htc\",\"hoverlabel.font.color\"),s(\"nameLength\",\"hnl\",\"hoverlabel.namelength\"),t.posref=\"y\"===e?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=ne.constrain(t.x0,0,t.xa._length),t.x1=ne.constrain(t.x1,0,t.xa._length),t.y0=ne.constrain(t.y0,0,t.ya._length),t.y1=ne.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel=\"xLabel\"in t?t.xLabel:ri.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel=\"yLabel\"in t?t.yLabel:ri.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 l=ri.tickText(t.xa,t.xa.c2l(t.xerr),\"hover\").text;void 0!==t.xerrneg?t.xLabel+=\" +\"+l+\" / -\"+ri.tickText(t.xa,t.xa.c2l(t.xerrneg),\"hover\").text:t.xLabel+=\" \\xb1 \"+l,\"x\"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||\"log\"===t.ya.type&&t.yerr<=0)){var u=ri.tickText(t.ya,t.ya.c2l(t.yerr),\"hover\").text;void 0!==t.yerrneg?t.yLabel+=\" +\"+u+\" / -\"+ri.tickText(t.ya,t.ya.c2l(t.yerrneg),\"hover\").text:t.yLabel+=\" \\xb1 \"+u,\"y\"===e&&(t.distance+=1)}var c=t.hoverinfo||t.trace.hoverinfo;return\"all\"!==c&&(-1===(c=Array.isArray(c)?c:c.split(\"+\")).indexOf(\"x\")&&(t.xLabel=void 0),-1===c.indexOf(\"y\")&&(t.yLabel=void 0),-1===c.indexOf(\"z\")&&(t.zLabel=void 0),-1===c.indexOf(\"text\")&&(t.text=void 0),-1===c.indexOf(\"name\")&&(t.name=void 0)),t}function ho(t,e){var r,n,i=e.container,a=e.fullLayout,o=e.event,l=!!t.hLinePoint,u=!!t.vLinePoint;if(i.selectAll(\".spikeline\").remove(),u||l){var c=Oe.combine(a.plot_bgcolor,a.paper_bgcolor);if(l){var h,f,p=t.hLinePoint;r=p&&p.xa,\"cursor\"===(n=p&&p.ya).spikesnap?(h=o.pointerX,f=o.pointerY):(h=r._offset+p.x,f=n._offset+p.y);var d,g,v=s.readability(p.color,c)<1.5?Oe.contrast(c):p.color,m=n.spikemode,y=n.spikethickness,x=n.spikecolor||v,b=n._boundingBox,_=(b.left+b.right)/2<h?b.right:b.left;-1===m.indexOf(\"toaxis\")&&-1===m.indexOf(\"across\")||(-1!==m.indexOf(\"toaxis\")&&(d=_,g=h),-1!==m.indexOf(\"across\")&&(d=n._counterSpan[0],g=n._counterSpan[1]),i.insert(\"line\",\":first-child\").attr({x1:d,x2:g,y1:f,y2:f,\"stroke-width\":y,stroke:x,\"stroke-dasharray\":Sr.dashStyle(n.spikedash,y)}).classed(\"spikeline\",!0).classed(\"crisp\",!0),i.insert(\"line\",\":first-child\").attr({x1:d,x2:g,y1:f,y2:f,\"stroke-width\":y+2,stroke:c}).classed(\"spikeline\",!0).classed(\"crisp\",!0)),-1!==m.indexOf(\"marker\")&&i.insert(\"circle\",\":first-child\").attr({cx:_+(\"right\"!==n.side?y:-y),cy:f,r:y,fill:x}).classed(\"spikeline\",!0)}if(u){var w,M,A=t.vLinePoint;r=A&&A.xa,n=A&&A.ya,\"cursor\"===r.spikesnap?(w=o.pointerX,M=o.pointerY):(w=r._offset+A.x,M=n._offset+A.y);var k,T,S=s.readability(A.color,c)<1.5?Oe.contrast(c):A.color,E=r.spikemode,C=r.spikethickness,L=r.spikecolor||S,z=r._boundingBox,P=(z.top+z.bottom)/2<M?z.bottom:z.top;-1===E.indexOf(\"toaxis\")&&-1===E.indexOf(\"across\")||(-1!==E.indexOf(\"toaxis\")&&(k=P,T=M),-1!==E.indexOf(\"across\")&&(k=r._counterSpan[0],T=r._counterSpan[1]),i.insert(\"line\",\":first-child\").attr({x1:w,x2:w,y1:k,y2:T,\"stroke-width\":C,stroke:L,\"stroke-dasharray\":Sr.dashStyle(r.spikedash,C)}).classed(\"spikeline\",!0).classed(\"crisp\",!0),i.insert(\"line\",\":first-child\").attr({x1:w,x2:w,y1:k,y2:T,\"stroke-width\":C+2,stroke:c}).classed(\"spikeline\",!0).classed(\"crisp\",!0)),-1!==E.indexOf(\"marker\")&&i.insert(\"circle\",\":first-child\").attr({cx:w,cy:P-(\"top\"!==r.side?C:-C),r:C,fill:L}).classed(\"spikeline\",!0)}}}function fo(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}to.hover=function(t,n,i,a){t=ne.getGraphDiv(t),ne.throttle(t._fullLayout._uid+Pa.HOVERID,Pa.HOVERMINTIME,function(){!function(t,n,i,a){i||(i=\"xy\");var o=Array.isArray(i)?i:[i],s=t._fullLayout,l=s._plots||[],u=l[i],c=s._has(\"cartesian\");if(u){var h=u.overlays.map(function(t){return t.id});o=o.concat(h)}for(var f=o.length,p=new Array(f),d=new Array(f),g=!1,v=0;v<f;v++){var m=o[v],y=l[m];if(y)g=!0,p[v]=ri.getFromId(t,y.xaxis._id),d[v]=ri.getFromId(t,y.yaxis._id);else{var x=s[m]._subplot;p[v]=x.xaxis,d[v]=x.yaxis}}var b=n.hovermode||s.hovermode;b&&!g&&(b=\"closest\");if(-1===[\"x\",\"y\",\"closest\"].indexOf(b)||!t.calcdata||t.querySelector(\".zoombox\")||t._dragging)return Ua.unhoverRaw(t,n);var _,w,M,A,k,T,S,E,C,L,z,I,D,O=-1===s.hoverdistance?1/0:s.hoverdistance,R=-1===s.spikedistance?1/0:s.spikedistance,F=[],B=[],N={hLinePoint:null,vLinePoint:null};if(Array.isArray(n))for(b=\"array\",M=0;M<n.length;M++)\"skip\"!==(k=t.calcdata[n[M].curveNumber||0])[0].trace.hoverinfo&&B.push(k);else{for(A=0;A<t.calcdata.length;A++)k=t.calcdata[A],\"skip\"!==(T=k[0].trace).hoverinfo&&-1!==o.indexOf(Ya.getSubplot(T))&&B.push(k);var j,V,U=!n.target;if(U)j=\"xpx\"in n?n.xpx:p[0]._length/2,n.pointerX=j+p[0]._offset,V=\"ypx\"in n?n.ypx:d[0]._length/2,n.pointerY=V+d[0]._offset;else{if(!1===ja.triggerHandler(t,\"plotly_beforehover\",n))return;var q=n.target.getBoundingClientRect();if(j=n.clientX-q.left,V=n.clientY-q.top,j<0||j>q.width||V<0||V>q.height)return Ua.unhoverRaw(t,n);n.pointerX=n.offsetX,n.pointerY=n.offsetY}if(_=\"xval\"in n?Ya.flat(o,n.xval):Ya.p2c(p,j),w=\"yval\"in n?Ya.flat(o,n.yval):Ya.p2c(d,V),!r(_[0])||!r(w[0]))return ne.warn(\"Fx.hover failed\",n,t),Ua.unhoverRaw(t,n)}var H=1/0;for(A=0;A<B.length;A++)if((k=B[A])&&k[0]&&k[0].trace&&!0===k[0].trace.visible&&(T=k[0].trace,-1===[\"carpet\",\"contourcarpet\"].indexOf(T._module.name))){if(S=Ya.getSubplot(T),E=o.indexOf(S),C=b,I={cd:k,trace:T,xa:p[E],ya:d[E],maxHoverDistance:O,maxSpikeDistance:R,index:!1,distance:Math.min(H,O),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:Oe.defaultLine,name:T.name,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},s[S]&&(I.subplot=s[S]._subplot),D=F.length,\"array\"===C){var G=n[A];\"pointNumber\"in G?(I.index=G.pointNumber,C=\"closest\"):(C=\"\",\"xval\"in G&&(L=G.xval,C=\"x\"),\"yval\"in G&&(z=G.yval,C=C?\"closest\":\"y\"))}else L=_[E],z=w[E];if(0!==O)if(T._module&&T._module.hoverPoints){var W=T._module.hoverPoints(I,L,z,C,s._hoverlayer);if(W)for(var Y,X=0;X<W.length;X++)Y=W[X],r(Y.x0)&&r(Y.y0)&&F.push(co(Y,b))}else ne.log(\"Unrecognized trace type in hover:\",T);if(\"closest\"===b&&F.length>D&&(F.splice(0,D),H=F[0].distance),c&&0!==R&&0===F.length){I.distance=R,I.index=!1;var Z=T._module.hoverPoints(I,L,z,\"closest\",s._hoverlayer);if(Z&&(Z=Z.filter(function(t){return t.spikeDistance<=R})),Z&&Z.length){var J,K=Z.filter(function(t){return t.xa.showspikes});if(K.length){var Q=K[0];r(Q.x0)&&r(Q.y0)&&(J=rt(Q),(!N.vLinePoint||N.vLinePoint.spikeDistance>J.spikeDistance)&&(N.vLinePoint=J))}var $=Z.filter(function(t){return t.ya.showspikes});if($.length){var tt=$[0];r(tt.x0)&&r(tt.y0)&&(J=rt(tt),(!N.hLinePoint||N.hLinePoint.spikeDistance>J.spikeDistance)&&(N.hLinePoint=J))}}}}function et(t,e){for(var r,n=null,i=1/0,a=0;a<t.length;a++)(r=t[a].spikeDistance)<i&&r<=e&&(n=t[a],i=r);return n}function rt(t){return t?{xa:t.xa,ya:t.ya,x:void 0!==t.xSpike?t.xSpike:(t.x0+t.x1)/2,y:void 0!==t.ySpike?t.ySpike:(t.y0+t.y1)/2,distance:t.distance,spikeDistance:t.spikeDistance,curveNumber:t.trace.index,color:t.color,pointNumber:t.index}:null}var nt={fullLayout:s,container:s._hoverlayer,outerContainer:s._paperdiv,event:n},it=t._spikepoints,at={vLinePoint:N.vLinePoint,hLinePoint:N.hLinePoint};if(t._spikepoints=at,c&&0!==R&&0!==F.length){var ot=F.filter(function(t){return t.ya.showspikes}),st=et(ot,R);N.hLinePoint=rt(st);var lt=F.filter(function(t){return t.xa.showspikes}),ut=et(lt,R);N.vLinePoint=rt(ut)}if(0===F.length){var ct=Ua.unhoverRaw(t,n);return!c||null===N.hLinePoint&&null===N.vLinePoint||fo(it)&&ho(N,nt),ct}c&&fo(it)&&ho(N,nt);F.sort(function(t,e){return t.distance-e.distance});var ht=t._hoverdata,ft=[];for(M=0;M<F.length;M++){var pt=F[M];ft.push(Ya.makeEventData(pt,pt.trace,pt.cd))}t._hoverdata=ft;var dt=\"y\"===b&&B.length>1,gt=Oe.combine(s.plot_bgcolor||Oe.background,s.paper_bgcolor),vt={hovermode:b,rotateLabels:dt,bgColor:gt,container:s._hoverlayer,outerContainer:s._paperdiv,commonLabelOpts:s.hoverlabel,hoverdistance:s.hoverdistance},mt=lo(F,vt,t);if(function(t,e,r){var n,i,a,o,s,l,u,c=0,h=t.map(function(t,n){var i=t[e];return[{i:n,dp:0,pos:t.pos,posref:t.posref,size:t.by*(\"x\"===i._id.charAt(0)?no:1)/2,pmin:0,pmax:\"x\"===i._id.charAt(0)?r.width:r.height}]}).sort(function(t,e){return t[0].posref-e[0].posref});function f(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;o<t.length;o++)(l=t[o]).pos+l.dp+l.size>e.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<t.length&&!(u<=0);o++)if((l=t[o]).pos<e.pmin+1)for(l.del=!0,u--,a=2*l.size,s=t.length-1;s>=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(;!n&&c<=t.length;){for(c++,n=!0,o=0;o<h.length-1;){var p=h[o],d=h[o+1],g=p[p.length-1],v=d[0];if((i=g.pos+g.dp+g.size-v.pos-v.dp+v.size)>.01&&g.pmin===v.pmin&&g.pmax===v.pmax){for(s=d.length-1;s>=0;s--)d[s].dp+=i;for(p.push.apply(p,d),h.splice(o+1,1),u=0,s=p.length-1;s>=0;s--)u+=p[s].dp;for(a=u/p.length,s=p.length-1;s>=0;s--)p[s].dp-=a;n=!1}else o++}h.forEach(f)}for(o=h.length-1;o>=0;o--){var m=h[o];for(s=m.length-1;s>=0;s--){var y=m[s],x=t[y.i];x.offset=y.dp,x.del=y.del}}}(F,dt?\"xa\":\"ya\",s),uo(mt,dt),n.target&&n.target.tagName){var yt=P.getComponentMethod(\"annotations\",\"hasClickToShow\")(t,ft);$a(e.select(n.target),yt?\"pointer\":\"\")}if(!n.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))return!0}return!1}(t,0,ht))return;ht&&t.emit(\"plotly_unhover\",{event:n,points:ht});t.emit(\"plotly_hover\",{event:n,points:t._hoverdata,xaxes:p,yaxes:d,xvals:_,yvals:w})}(t,n,i,a)})},to.loneHover=function(t,r){var n={color:t.color||Oe.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,trace:{index:0,hoverinfo:\"\"},xa:{_offset:0},ya:{_offset:0},index:0},i=e.select(r.container),a=r.outerContainer?e.select(r.outerContainer):i,o={hovermode:\"closest\",rotateLabels:!1,bgColor:r.bgColor||Oe.background,container:i,outerContainer:a},s=lo([n],o,r.gd);return uo(s,o.rotateLabels),s.node()};var po=to.hover,go=function(t,e,r,n){r(\"hoverlabel.bgcolor\",(n=n||{}).bgcolor),r(\"hoverlabel.bordercolor\",n.bordercolor),r(\"hoverlabel.namelength\",n.namelength),ne.coerceFont(r,\"hoverlabel.font\",n.font)},vo=T({editType:\"none\"});vo.family.dflt=Pa.HOVERFONT,vo.size.dflt=Pa.HOVERFONTSIZE;var mo={dragmode:{valType:\"enumerated\",values:[\"zoom\",\"pan\",\"select\",\"lasso\",\"orbit\",\"turntable\"],dflt:\"zoom\",editType:\"modebar\"},hovermode:{valType:\"enumerated\",values:[\"x\",\"y\",\"closest\",!1],editType:\"modebar\"},hoverdistance:{valType:\"integer\",min:-1,dflt:20,editType:\"none\"},spikedistance:{valType:\"integer\",min:-1,dflt:20,editType:\"none\"},hoverlabel:{bgcolor:{valType:\"color\",editType:\"none\"},bordercolor:{valType:\"color\",editType:\"none\"},font:vo,namelength:{valType:\"integer\",min:-1,dflt:15,editType:\"none\"},editType:\"none\"}};var yo={moduleType:\"component\",name:\"fx\",constants:Pa,schema:{layout:mo},attributes:S,layoutAttributes:mo,supplyLayoutGlobalDefaults:function(t,e){go(0,0,function(r,n){return ne.coerce(t,e,mo,r,n)})},supplyDefaults:function(t,e,r,n){go(0,0,function(r,n){return ne.coerce(t,e,S,r,n)},n.hoverlabel)},supplyLayoutDefaults:function(t,e,r){function n(r,n){return ne.coerce(t,e,mo,r,n)}var i;n(\"dragmode\"),e._has(\"cartesian\")?(e._isHoriz=function(t){for(var e=!0,r=0;r<t.length;r++){var n=t[r];if(\"h\"!==n.orientation){e=!1;break}}return e}(r),i=e._isHoriz?\"y\":\"x\"):i=\"closest\",n(\"hovermode\",i)&&(n(\"hoverdistance\"),n(\"spikedistance\"));var a=e._has(\"mapbox\"),o=e._has(\"geo\"),s=e._basePlotModules.length;\"zoom\"===e.dragmode&&((a||o)&&1===s||a&&o&&2===s)&&(e.dragmode=\"pan\")},calc:function(t){var e=t.calcdata,r=t._fullLayout;function n(t){return function(e){return ne.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var i=0;i<e.length;i++){var a=e[i],o=a[0].trace;if(!P.traceIs(o,\"pie\")){var s=P.traceIs(o,\"2dMap\")?Wa:ne.fillArray;s(o.hoverinfo,a,\"hi\",n(o)),o.hoverlabel&&(s(o.hoverlabel.bgcolor,a,\"hbg\"),s(o.hoverlabel.bordercolor,a,\"hbc\"),s(o.hoverlabel.font.size,a,\"hts\"),s(o.hoverlabel.font.color,a,\"htc\"),s(o.hoverlabel.font.family,a,\"htf\"),s(o.hoverlabel.namelength,a,\"hnl\"))}}},getDistanceFunction:Ya.getDistanceFunction,getClosest:Ya.getClosest,inbox:Ya.inbox,quadrature:Ya.quadrature,appendArrayPointValue:Ya.appendArrayPointValue,castHoverOption:function(t,e,r){return ne.castOption(t,e,\"hoverlabel.\"+r)},castHoverinfo:function(t,e,r){return ne.castOption(t,r,\"hoverinfo\",function(r){return ne.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)})},hover:to.hover,unhover:Ua.unhover,loneHover:to.loneHover,loneUnhover:function(t){var r=ne.isD3Selection(t)?t:e.select(t);r.selectAll(\"g.hovertext\").remove(),r.selectAll(\".spikeline\").remove()},click:function(t,e,r){var n=P.getComponentMethod(\"annotations\",\"onClick\")(t,t._hoverdata);function i(){t.emit(\"plotly_click\",{points:t._hoverdata,event:e})}void 0!==r&&po(t,e,r,!0),t._hoverdata&&e&&e.target&&(n&&n.then?n.then(i):i(),e.stopImmediatePropagation&&e.stopImmediatePropagation())}};var xo=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=ne.extractOption(t,e,\"htx\",\"hovertext\");if(bo(i))return n(i);var a=ne.extractOption(t,e,\"tx\",\"text\");return bo(a)?n(a):void 0};function bo(t){return t||0===t}var _o=function(t,e,r,n){var i,a,o,s,l,u,c,h=t.cd,f=h[0].trace,p=h[0].t,d=\"closest\"===n,g=t.maxHoverDistance,v=t.maxSpikeDistance;function m(t){return t[o]-t.w/2}function y(t){return t[o]+t.w/2}var x=d?m:function(t){return Math.min(m(t),t.p-p.bardelta/2)},b=d?y:function(t){return Math.max(y(t),t.p+p.bardelta/2)};function _(t,e){return yo.inbox(t-i,e-i,g+Math.min(1,Math.abs(e-t)/c)-1)}function w(t){return _(x(t),b(t))}function M(t){return yo.inbox(t.b-a,t[s]-a,g+(t[s]-a)/(t[s]-t.b)-1)}\"h\"===f.orientation?(i=r,a=e,o=\"y\",s=\"x\",l=M,u=w):(i=e,a=r,o=\"x\",s=\"y\",u=M,l=w);var A=t[o+\"a\"],k=t[s+\"a\"];c=Math.abs(A.r2c(A.range[1])-A.r2c(A.range[0]));var T=yo.getDistanceFunction(n,l,u,function(t){return(l(t)+u(t))/2});if(yo.getClosest(h,T,t),!1!==t.index){d||(x=function(t){return Math.min(m(t),t.p-p.bargroupwidth/2)},b=function(t){return Math.max(y(t),t.p+p.bargroupwidth/2)});var S=h[t.index],E=S.mcc||f.marker.color,C=S.mlcc||f.marker.line.color,L=S.mlw||f.marker.line.width;Oe.opacity(E)?t.color=E:Oe.opacity(C)&&L&&(t.color=C);var z=f.base?S.b+S.s:S.s;t[s+\"0\"]=t[s+\"1\"]=k.c2p(S[s],!0),t[s+\"LabelVal\"]=z;var I=p.extents[p.extents.round(S.p)];return t[o+\"0\"]=A.c2p(d?x(S):I[0],!0),t[o+\"1\"]=A.c2p(d?b(S):I[1],!0),t[o+\"LabelVal\"]=S.p,t.spikeDistance=(M(S)+function(t){return _(m(t),y(t))}(S))/2+v-g,t[o+\"Spike\"]=A.c2p(S.p,!0),xo(S,f,t),P.getComponentMethod(\"errorbars\",\"hoverInfo\")(S,f,t),[t]}},wo={barmode:{valType:\"enumerated\",values:[\"stack\",\"group\",\"overlay\",\"relative\"],dflt:\"group\",editType:\"calc\"},barnorm:{valType:\"enumerated\",values:[\"\",\"fraction\",\"percent\"],dflt:\"\",editType:\"calc\"},bargap:{valType:\"number\",min:0,max:1,editType:\"calc\"},bargroupgap:{valType:\"number\",min:0,max:1,dflt:0,editType:\"calc\"}},Mo=function(t,e,r){function n(r,n){return ne.coerce(t,e,wo,r,n)}for(var i=!1,a=!1,o=!1,s={},l=0;l<r.length;l++){var u=r[l];if(P.traceIs(u,\"bar\")){if(i=!0,\"overlay\"!==t.barmode&&\"stack\"!==t.barmode){var c=u.xaxis+u.yaxis;s[c]&&(o=!0),s[c]=!0}if(u.visible&&\"histogram\"===u.type)\"category\"!==ri.getFromId({_fullLayout:e},u[\"v\"===u.orientation?\"xaxis\":\"yaxis\"]).type&&(a=!0)}}i&&(\"overlay\"!==n(\"barmode\")&&n(\"barnorm\"),n(\"bargap\",a&&!o?0:.2),n(\"bargroupgap\"))},Ao=wa.text,ko=wa.textposition,To=wa.textfont,So=wa.insidetextfont,Eo=wa.outsidetextfont,Co=3,Lo=function(t,n,i){var a=n.xaxis,o=n.yaxis,s=t._fullLayout,l=n.plot.select(\".barlayer\").selectAll(\"g.trace.bars\").data(i);l.enter().append(\"g\").attr(\"class\",\"trace bars\"),l.each(function(t){t[0].node3=e.select(this)}),l.append(\"g\").attr(\"class\",\"points\").each(function(i){var l=e.select(this),u=i[0].t,c=i[0].trace,h=u.poffset,f=Array.isArray(h);l.selectAll(\"g.point\").data(ne.identity).enter().append(\"g\").classed(\"point\",!0).each(function(l,u){var p,d,g,v,m=l.p+(f?h[u]:h),y=m+l.w,x=l.b,b=x+l.s;if(\"h\"===c.orientation?(g=o.c2p(m,!0),v=o.c2p(y,!0),p=a.c2p(x,!0),d=a.c2p(b,!0),l.ct=[d,(g+v)/2]):(p=a.c2p(m,!0),d=a.c2p(y,!0),g=o.c2p(x,!0),v=o.c2p(b,!0),l.ct=[(p+d)/2,v]),r(p)&&r(d)&&r(g)&&r(v)&&p!==d&&g!==v){var _=(l.mlw+1||c.marker.line.width+1||(l.trace?l.trace.marker.line.width:0)+1)-1,w=e.round(_/2%1,2);if(!t._context.staticPlot){var M=Oe.opacity(l.mc||c.marker.color)<1||_>.01?k:function(t,e){return Math.abs(t-e)>=2?k(t):t>e?Math.ceil(t):Math.floor(t)};d=M(d,p=M(p,d)),v=M(v,g=M(g,v))}var A=e.select(this);A.append(\"path\").style(\"vector-effect\",\"non-scaling-stroke\").attr(\"d\",\"M\"+p+\",\"+g+\"V\"+v+\"H\"+d+\"V\"+g+\"Z\").call(Sr.setClipUrl,n.layerClipId),function(t,e,r,n,i,a,o,s){var l;function u(e,r,n){var i=e.append(\"text\").text(r).attr({class:\"bartext bartext-\"+l,transform:\"\",\"text-anchor\":\"middle\",\"data-notex\":1}).call(Sr.font,n).call(er.convertToTspans,t);return i}var c=r[0].trace,h=c.orientation,f=function(t,e){var r=Io(t.text,e);return Do(Ao,r)}(c,n);if(!f)return;if(\"none\"===(l=function(t,e){var r=Io(t.textposition,e);return function(t,e,r){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==r?r:t.dflt}(ko,r)}(c,n)))return;var p,d,g,v,m,y,x=function(t,e,r){return Po(To,t.textfont,e,r)}(c,n,t._fullLayout.font),b=function(t,e,r){return Po(So,t.insidetextfont,e,r)}(c,n,x),_=function(t,e,r){return Po(Eo,t.outsidetextfont,e,r)}(c,n,x),w=t._fullLayout.barmode,M=\"stack\"===w||\"relative\"===w,A=r[n],k=!M||A._outmost,T=Math.abs(a-i)-2*Co,S=Math.abs(s-o)-2*Co;\"outside\"===l&&(k||(l=\"inside\"));if(\"auto\"===l)if(k){l=\"inside\",p=u(e,f,b),d=Sr.bBox(p.node()),g=d.width,v=d.height;var E=g>0&&v>0,C=g<=T&&v<=S,L=g<=S&&v<=T,z=\"h\"===h?T>=g*(S/v):S>=v*(T/g);E&&(C||L||z)?l=\"inside\":(l=\"outside\",p.remove(),p=null)}else l=\"inside\";if(!p&&(p=u(e,f,\"outside\"===l?_:b),d=Sr.bBox(p.node()),g=d.width,v=d.height,g<=0||v<=0))return void p.remove();\"outside\"===l?(y=\"both\"===c.constraintext||\"outside\"===c.constraintext,m=function(t,e,r,n,i,a,o){var s,l=\"h\"===a?Math.abs(n-r):Math.abs(e-t);l>2*Co&&(s=Co);var u=1;o&&(u=\"h\"===a?Math.min(1,l/i.height):Math.min(1,l/i.width));var c,h,f,p,d=(i.left+i.right)/2,g=(i.top+i.bottom)/2;c=u*i.width,h=u*i.height,\"h\"===a?e<t?(f=e-s-c/2,p=(r+n)/2):(f=e+s+c/2,p=(r+n)/2):n>r?(f=(t+e)/2,p=n+s+h/2):(f=(t+e)/2,p=n-s-h/2);return zo(d,g,f,p,u,!1)}(i,a,o,s,d,h,y)):(y=\"both\"===c.constraintext||\"inside\"===c.constraintext,m=function(t,e,r,n,i,a,o){var s,l,u,c,h,f,p,d=i.width,g=i.height,v=(i.left+i.right)/2,m=(i.top+i.bottom)/2,y=Math.abs(e-t),x=Math.abs(n-r);y>2*Co&&x>2*Co?(y-=2*(h=Co),x-=2*h):h=0;d<=y&&g<=x?(f=!1,p=1):d<=x&&g<=y?(f=!0,p=1):d<g==y<x?(f=!1,p=o?Math.min(y/d,x/g):1):(f=!0,p=o?Math.min(x/d,y/g):1);f&&(f=90);f?(s=p*g,l=p*d):(s=p*d,l=p*g);\"h\"===a?e<t?(u=e+h+s/2,c=(r+n)/2):(u=e-h-s/2,c=(r+n)/2):n>r?(u=(t+e)/2,c=n-h-l/2):(u=(t+e)/2,c=n+h+l/2);return zo(v,m,u,c,p,f)}(i,a,o,s,d,h,y));p.attr(\"transform\",m)}(t,A,i,u,p,d,g,v),n.layerClipId&&Sr.hideOutsideRangePoint(i[u],A.select(\"text\"),a,o,c.xcalendar,c.ycalendar)}else e.select(this).remove();function k(t){return 0===s.bargap&&0===s.bargroupgap?e.round(Math.round(t)-w,2):t}})}),P.getComponentMethod(\"errorbars\",\"plot\")(l,n),l.each(function(t){var r=!1===t[0].trace.cliponaxis;Sr.setClipUrl(e.select(this),r?null:n.layerClipId)})};function zo(t,e,r,n,i,a){var o;return i<1?o=\"scale(\"+i+\") \":(i=1,o=\"\"),\"translate(\"+(r-i*t)+\" \"+(n-i*e)+\")\"+o+(a?\"rotate(\"+a+\" \"+t+\" \"+e+\") \":\"\")}function Po(t,e,n,i){var a=Io((e=e||{}).family,n),o=Io(e.size,n),l=Io(e.color,n);return{family:Do(t.family,a,i.family),size:function(t,e,n){if(r(e)){e=+e;var i=t.min,a=t.max,o=void 0!==i&&e<i||void 0!==a&&e>a;if(!o)return e}return void 0!==n?n:t.dflt}(t.size,o,i.size),color:function(t,e,r){return s(e).isValid()?e:void 0!==r?r:t.dflt}(t.color,l,i.color)}}function Io(t,e){var r;return Array.isArray(t)?e<t.length&&(r=t[e]):r=t,r}function Do(t,e,r){if(\"string\"==typeof e){if(e||!t.noBlank)return e}else if(\"number\"==typeof e&&!t.strict)return String(e);return void 0!==r?r:t.dflt}var Oo=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[];if(!1===e)for(r=0;r<n.length;r++)n[r].selected=0;else for(r=0;r<n.length;r++){var s=n[r];e.contains(s.ct)?(o.push({pointNumber:r,x:i.c2d(s.x),y:a.c2d(s.y)}),s.selected=1):s.selected=0}return o},Ro=Bo,Fo=t.BADNUM;function Bo(t,e,r){this.traces=t,this.separateNegativeValues=e,this.dontMergeOverlappingData=r;for(var n=1/0,i=[],a=0;a<t.length;a++){for(var o=t[a],s=0;s<o.length;s++){var l=o[s];l.p!==Fo&&i.push(l.p)}o[0]&&o[0].width1&&(n=Math.min(o[0].width1,n))}this.positions=i;var u=ne.distinctVals(i);this.distinctPositions=u.vals,1===u.vals.length&&n!==1/0?this.minDiff=n:this.minDiff=Math.min(u.minDiff,n),this.binWidth=this.minDiff,this.bins={}}Bo.prototype.put=function(t,e){var r=this.getLabel(t,e),n=this.bins[r]||0;return this.bins[r]=n+e,n},Bo.prototype.get=function(t,e){var r=this.getLabel(t,e);return this.bins[r]||0},Bo.prototype.getLabel=function(t,e){return(e<0&&this.separateNegativeValues?\"v\":\"^\")+(this.dontMergeOverlappingData?t:Math.round(t/this.binWidth))};var No=ne.isArrayOrTypedArray,jo=t.BADNUM,Vo=function(t,e){var r,n=e.xaxis,i=e.yaxis,a=t._fullData,o=t.calcdata,s=[],l=[];for(r=0;r<a.length;r++){var u=a[r];!0===u.visible&&P.traceIs(u,\"bar\")&&u.xaxis===n._id&&u.yaxis===i._id&&(\"h\"===u.orientation?s.push(o[r]):l.push(o[r]))}Uo(t,n,i,l),Uo(t,i,n,s)};function Uo(t,e,n,i){if(i.length){var a,o,s,l,u=t._fullLayout.barmode,c=\"group\"===u;if(\"overlay\"===u)qo(t,e,n,i);else if(c){for(a=[],o=[],s=0;s<i.length;s++)void 0===(l=i[s])[0].trace.offset?o.push(l):a.push(l);o.length&&function(t,e,r,n){var i=t._fullLayout.barnorm,a=new Ro(n,!1,!i);(function(t,e,r){var n,i,a,o,s=t._fullLayout,l=s.bargap,u=s.bargroupgap,c=r.positions,h=r.distinctPositions,f=r.minDiff,p=r.traces,d=c.length!==h.length,g=p.length,v=f*(1-l),m=d?v/g:v,y=m*(1-u);for(n=0;n<g;n++){i=p[n],a=i[0];var x=d?((2*n+1-g)*m-y)/2:-y/2;(o=a.t).barwidth=y,o.poffset=x,o.bargroupwidth=v,o.bardelta=f}r.binWidth=p[0][0].t.barwidth/100,Go(r),Wo(t,e,r),Yo(t,e,r,d)})(t,e,a),i?(Jo(t,r,a),Ko(t,r,a)):Zo(t,r,a)}(t,e,n,o),a.length&&qo(t,e,n,a)}else{for(a=[],o=[],s=0;s<i.length;s++)void 0===(l=i[s])[0].trace.base?o.push(l):a.push(l);o.length&&function(t,e,n,i){var a=t._fullLayout.barmode,o=\"stack\"===a,s=\"relative\"===a,l=t._fullLayout.barnorm,u=new Ro(i,s,!(l||o||s));Ho(t,e,u),function(t,e,n){var i,a,o,s,l=t._fullLayout.barnorm,u=Qo(e),c=n.traces,h=[null,null];for(i=0;i<c.length;i++)for(a=c[i],o=0;o<a.length;o++)if((s=a[o]).s!==jo){var f=n.put(s.p,s.b+s.s),p=f+s.b+s.s;s.b=f,s[u]=p,l||(r(e.c2l(p))&&Xo(h,p),s.hasB&&r(e.c2l(f))&&Xo(h,f))}l||ri.expand(e,h,{tozero:!0,padded:!0})}(t,n,u);for(var c=0;c<i.length;c++)for(var h=i[c],f=0;f<h.length;f++){var p=h[f];if(p.s!==jo){var d=p.b+p.s===u.get(p.p,p.s);d&&(p._outmost=!0)}}l&&Ko(t,n,u)}(t,e,n,o),a.length&&qo(t,e,n,a)}!function(t,e){var n,i,a,o=e._id.charAt(0),s={},l=1/0,u=-1/0;for(n=0;n<t.length;n++)for(a=t[n],i=0;i<a.length;i++){var c=a[i].p;r(c)&&(l=Math.min(l,c),u=Math.max(u,c))}var h=1e4/(u-l),f=s.round=function(t){return String(Math.round(h*(t-l)))};for(n=0;n<t.length;n++)for((a=t[n])[0].t.extents=s,i=0;i<a.length;i++){var p=a[i],d=p[o]-p.w/2;if(r(d)){var g=p[o]+p.w/2,v=f(p.p);s[v]?s[v]=[Math.min(d,s[v][0]),Math.max(g,s[v][1])]:s[v]=[d,g]}}}(i,e)}}function qo(t,e,r,n){for(var i=t._fullLayout.barnorm,a=!i,o=0;o<n.length;o++){var s=n[o],l=new Ro([s],!1,a);Ho(t,e,l),i?(Jo(t,r,l),Ko(t,r,l)):Zo(t,r,l)}}function Ho(t,e,r){var n,i,a=t._fullLayout,o=a.bargap,s=a.bargroupgap,l=r.minDiff,u=r.traces,c=l*(1-o),h=c*(1-s),f=-h/2;for(n=0;n<u.length;n++)(i=u[n][0].t).barwidth=h,i.poffset=f,i.bargroupwidth=c,i.bardelta=l;r.binWidth=u[0][0].t.barwidth/100,Go(r),Wo(t,e,r),Yo(t,e,r)}function Go(t){var e,n,i,a,o,s,l=t.traces;for(e=0;e<l.length;e++){a=(i=(n=l[e])[0]).trace,s=i.t;var u,c=a.offset,h=s.poffset;if(No(c)){for(u=c.slice(0,n.length),o=0;o<u.length;o++)r(u[o])||(u[o]=h);for(o=u.length;o<n.length;o++)u.push(h);s.poffset=u}else void 0!==c&&(s.poffset=c);var f=a.width,p=s.barwidth;if(No(f)){var d=f.slice(0,n.length);for(o=0;o<d.length;o++)r(d[o])||(d[o]=p);for(o=d.length;o<n.length;o++)d.push(p);if(s.barwidth=d,void 0===c){for(u=[],o=0;o<n.length;o++)u.push(h+(p-d[o])/2);s.poffset=u}}else void 0!==f&&(s.barwidth=f,void 0===c&&(s.poffset=h+(p-f)/2))}}function Wo(t,e,r){for(var n=r.traces,i=Qo(e),a=0;a<n.length;a++)for(var o=n[a],s=o[0].t,l=s.poffset,u=Array.isArray(l),c=s.barwidth,h=Array.isArray(c),f=0;f<o.length;f++){var p=o[f],d=p.w=h?c[f]:c;p[i]=p.p+(u?l[f]:l)+d/2}}function Yo(t,e,r,n){var i=r.traces,a=r.distinctPositions,o=a[0],s=r.minDiff,l=s/2;ri.minDtick(e,s,o,n);for(var u=Math.min.apply(Math,a)-l,c=Math.max.apply(Math,a)+l,h=0;h<i.length;h++){var f=i[h],p=f[0],d=p.trace;if(void 0!==d.width||void 0!==d.offset)for(var g=p.t,v=g.poffset,m=g.barwidth,y=Array.isArray(v),x=Array.isArray(m),b=0;b<f.length;b++){var _=f[b],w=y?v[b]:v,M=x?m[b]:m,A=_.p+w,k=A+M;u=Math.min(u,A),c=Math.max(c,k)}}ri.expand(e,[u,c],{padded:!1})}function Xo(t,e){r(t[0])?t[0]=Math.min(t[0],e):t[0]=e,r(t[1])?t[1]=Math.max(t[1],e):t[1]=e}function Zo(t,e,n){for(var i=n.traces,a=Qo(e),o=[null,null],s=0;s<i.length;s++)for(var l=i[s],u=0;u<l.length;u++){var c=l[u],h=c.b,f=h+c.s;c[a]=f,r(e.c2l(f))&&Xo(o,f),c.hasB&&r(e.c2l(h))&&Xo(o,h)}ri.expand(e,o,{tozero:!0,padded:!0})}function Jo(t,e,r){for(var n=r.traces,i=0;i<n.length;i++)for(var a=n[i],o=0;o<a.length;o++){var s=a[o];s.s!==jo&&r.put(s.p,s.b+s.s)}}function Ko(t,e,n){var i=n.traces,a=Qo(e),o=\"fraction\"===t._fullLayout.barnorm?1:100,s=o/1e9,l=e.l2c(e.c2l(0)),u=\"stack\"===t._fullLayout.barmode?o:l,c=[l,u],h=!1;function f(t){r(e.c2l(t))&&(t<l-s||t>u+s||!r(l))&&(h=!0,Xo(c,t))}for(var p=0;p<i.length;p++)for(var d=i[p],g=0;g<d.length;g++){var v=d[g];if(v.s!==jo){var m=Math.abs(o/n.get(v.p,v.s));v.b*=m,v.s*=m;var y=v.b,x=y+v.s;v[a]=x,f(x),v.hasB&&f(y)}}ri.expand(e,c,{tozero:!0,padded:h})}function Qo(t){return t._id.charAt(0)}var $o=function(t,r){var n=r?r[0].node3:e.select(t).selectAll(\"g.trace.bars\"),i=n.size(),a=t._fullLayout;n.style(\"opacity\",function(t){return t[0].trace.opacity}).each(function(t){(\"stack\"===a.barmode&&i>1||0===a.bargap&&0===a.bargroupgap&&!t[0].trace.marker.line.width)&&e.select(this).attr(\"shape-rendering\",\"crispEdges\")}),n.selectAll(\"g.points\").each(function(r){var n=e.select(this),i=n.selectAll(\"path\"),a=n.selectAll(\"text\"),o=r[0].trace;Sr.pointStyle(i,o,t),Sr.selectedPointStyle(i,o),a.each(function(t){var r,n=e.select(this);function i(e){var n=r[e];return Array.isArray(n)?n[t.i]:n}n.classed(\"bartext-inside\")?r=o.insidetextfont:n.classed(\"bartext-outside\")&&(r=o.outsidetextfont),r||(r=o.textfont),Sr.font(n,i(\"family\"),i(\"size\"),i(\"color\"))}),Sr.selectedTextStyle(a,o)}),P.getComponentMethod(\"errorbars\",\"style\")(n)},ts=m.extendFlat,es=Qe.LINE_SPACING,rs={colorbar:\"colorbar\",cbbg:\"cbbg\",cbfill:\"cbfill\",cbfills:\"cbfills\",cbline:\"cbline\",cblines:\"cblines\",cbaxis:\"cbaxis\",cbtitleunshift:\"cbtitleunshift\",cbtitle:\"cbtitle\",cboutline:\"cboutline\",crisp:\"crisp\",jsPlaceholder:\"js-placeholder\"},ns=function(t,r){var n={};function i(){var o=t._fullLayout,l=o._size;if(\"function\"==typeof n.fillcolor||\"function\"==typeof n.line.color){var u,c,h=e.extent((\"function\"==typeof n.fillcolor?n.fillcolor:n.line.color).domain()),f=[],p=[],d=\"function\"==typeof n.line.color?n.line.color:function(){return n.line.color},g=\"function\"==typeof n.fillcolor?n.fillcolor:function(){return n.fillcolor},v=n.levels.end+n.levels.size/100,m=n.levels.size,y=1.001*h[0]-.001*h[1],x=1.001*h[1]-.001*h[0];for(c=0;c<1e5&&(u=n.levels.start+c*m,!(m>0?u>=v:u<=v));c++)u>y&&u<x&&f.push(u);if(\"function\"==typeof n.fillcolor)if(n.filllevels)for(v=n.filllevels.end+n.filllevels.size/100,m=n.filllevels.size,c=0;c<1e5&&(u=n.filllevels.start+c*m,!(m>0?u>=v:u<=v));c++)u>h[0]&&u<h[1]&&p.push(u);else(p=f.map(function(t){return t-n.levels.size/2})).push(p[p.length-1]+n.levels.size);else n.fillcolor&&\"string\"==typeof n.fillcolor&&(p=[0]);n.levels.size<0&&(f.reverse(),p.reverse());var b,_=o.height-o.margin.t-o.margin.b,w=o.width-o.margin.l-o.margin.r,M=Math.round(n.thickness*(\"fraction\"===n.thicknessmode?w:1)),A=M/l.w,k=Math.round(n.len*(\"fraction\"===n.lenmode?_:1)),T=k/l.h,S=n.xpad/l.w,E=(n.borderwidth+n.outlinewidth)/2,C=n.ypad/l.h,L=Math.round(n.x*l.w+n.xpad),z=n.x-A*({middle:.5,right:1}[n.xanchor]||0),I=n.y+T*(({top:-.5,bottom:.5}[n.yanchor]||0)-.5),D=Math.round(l.h*(1-I)),O=D-k,R={type:\"linear\",range:h,tickmode:n.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:n.ticks,ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,tickfont:n.tickfont,tickangle:n.tickangle,tickformat:n.tickformat,exponentformat:n.exponentformat,separatethousands:n.separatethousands,showexponent:n.showexponent,showtickprefix:n.showtickprefix,tickprefix:n.tickprefix,showticksuffix:n.showticksuffix,ticksuffix:n.ticksuffix,title:n.title,titlefont:n.titlefont,showline:!0,anchor:\"free\",position:1},F={type:\"linear\",_id:\"y\"+r},B={letter:\"y\",font:o.font,noHover:!0,calendar:o.calendar};if(Qi(R,F,$,B,o),ea(R,F,$,B),F.position=n.x+S+A,i.axis=F,-1!==[\"top\",\"bottom\"].indexOf(n.titleside)&&(F.titleside=n.titleside,F.titlex=n.x+S,F.titley=I+(\"top\"===n.titleside?T-C:C)),n.line.color&&\"auto\"===n.tickmode){F.tickmode=\"linear\",F.tick0=n.levels.start;var N=n.levels.size,j=ne.constrain((D-O)/50,4,15)+1,V=(h[1]-h[0])/((n.nticks||j)*N);if(V>1){var U=Math.pow(10,Math.floor(Math.log(V)/Math.LN10));N*=U*ne.roundUp(V/U,[2,5,10]),(Math.abs(n.levels.start)/n.levels.size+1e-6)%1<2e-6&&(F.tick0=0)}F.dtick=N}F.domain=[I+C,I+T-C],F.setScale();var q=o._infolayer.selectAll(\"g.\"+r).data([0]);q.enter().append(\"g\").classed(r,!0).classed(rs.colorbar,!0).each(function(){var t=e.select(this);t.append(\"rect\").classed(rs.cbbg,!0),t.append(\"g\").classed(rs.cbfills,!0),t.append(\"g\").classed(rs.cblines,!0),t.append(\"g\").classed(rs.cbaxis,!0).classed(rs.crisp,!0),t.append(\"g\").classed(rs.cbtitleunshift,!0).append(\"g\").classed(rs.cbtitle,!0),t.append(\"rect\").classed(rs.cboutline,!0),t.select(\".cbtitle\").datum(0)}),q.attr(\"transform\",\"translate(\"+Math.round(l.l)+\",\"+Math.round(l.t)+\")\");var H=q.select(\".cbtitleunshift\").attr(\"transform\",\"translate(-\"+Math.round(l.l)+\",-\"+Math.round(l.t)+\")\");F._axislayer=q.select(\".cbaxis\");var G=0;if(-1!==[\"top\",\"bottom\"].indexOf(n.titleside)){var W,Y=l.l+(n.x+S)*l.w,X=F.titlefont.size;W=\"top\"===n.titleside?(1-(I+T-C))*l.h+l.t+3+.75*X:(1-(I+C))*l.h+l.t-3-.25*X,tt(F._id+\"title\",{attributes:{x:Y,y:W,\"text-anchor\":\"start\"}})}var Z,J,K,Q=ne.syncOrAsync([_n.previousPromises,function(){if(-1!==[\"top\",\"bottom\"].indexOf(n.titleside)){var r=q.select(\".cbtitle\"),i=r.select(\"text\"),a=[-n.outlinewidth/2,n.outlinewidth/2],u=r.select(\".h\"+F._id+\"title-math-group\").node(),c=15.6;if(i.node()&&(c=parseInt(i.node().style.fontSize,10)*es),u?(G=Sr.bBox(u).height)>c&&(a[1]-=(G-c)/2):i.node()&&!i.classed(rs.jsPlaceholder)&&(G=Sr.bBox(i.node()).height),G){if(G+=5,\"top\"===n.titleside)F.domain[1]-=G/l.h,a[1]*=-1;else{F.domain[0]+=G/l.h;var v=er.lineCount(i);a[1]+=(1-v)*c}r.attr(\"transform\",\"translate(\"+a+\")\"),F.setScale()}}q.selectAll(\".cbfills,.cblines\").attr(\"transform\",\"translate(0,\"+Math.round(l.h*(1-F.domain[1]))+\")\"),F._axislayer.attr(\"transform\",\"translate(0,\"+Math.round(-l.t)+\")\");var m=q.select(\".cbfills\").selectAll(\"rect.cbfill\").data(p);m.enter().append(\"rect\").classed(rs.cbfill,!0).style(\"stroke\",\"none\"),m.exit().remove(),m.each(function(t,r){var n=[0===r?h[0]:(p[r]+p[r-1])/2,r===p.length-1?h[1]:(p[r]+p[r+1])/2].map(F.c2p).map(Math.round);r!==p.length-1&&(n[1]+=n[1]>n[0]?1:-1);var i=g(t).replace(\"e-\",\"\"),a=s(i).toHexString();e.select(this).attr({x:L,width:Math.max(M,2),y:e.min(n),height:Math.max(e.max(n)-e.min(n),2),fill:a})});var y=q.select(\".cblines\").selectAll(\"path.cbline\").data(n.line.color&&n.line.width?f:[]);return y.enter().append(\"path\").classed(rs.cbline,!0),y.exit().remove(),y.each(function(t){e.select(this).attr(\"d\",\"M\"+L+\",\"+(Math.round(F.c2p(t))+n.line.width/2%1)+\"h\"+M).call(Sr.lineGroupStyle,n.line.width,d(t),n.line.dash)}),F._axislayer.selectAll(\"g.\"+F._id+\"tick,path\").remove(),F._pos=L+M+(n.outlinewidth||0)/2-(\"outside\"===n.ticks?1:0),F.side=\"right\",ne.syncOrAsync([function(){return ri.doTicks(t,F,!0)},function(){if(-1===[\"top\",\"bottom\"].indexOf(n.titleside)){var r=F.titlefont.size,i=F._offset+F._length/2,a=l.l+(F.position||0)*l.w+(\"right\"===F.side?10+r*(F.showticklabels?1:.5):-10-r*(F.showticklabels?.5:0));tt(\"h\"+F._id+\"title\",{avoid:{selection:e.select(t).selectAll(\"g.\"+F._id+\"tick\"),side:n.titleside,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:i,\"text-anchor\":\"middle\"},transform:{rotate:\"-90\",offset:0}})}}])},_n.previousPromises,function(){var e=M+n.outlinewidth/2+Sr.bBox(F._axislayer.node()).width;if((b=H.select(\"text\")).node()&&!b.classed(rs.jsPlaceholder)){var i,a=H.select(\".h\"+F._id+\"title-math-group\").node();i=a&&-1!==[\"top\",\"bottom\"].indexOf(n.titleside)?Sr.bBox(a).width:Sr.bBox(H.node()).right-L-l.l,e=Math.max(e,i)}var o=2*n.xpad+e+n.borderwidth+n.outlinewidth/2,s=D-O;q.select(\".cbbg\").attr({x:L-n.xpad-(n.borderwidth+n.outlinewidth)/2,y:O-E,width:Math.max(o,2),height:Math.max(s+2*E,2)}).call(Oe.fill,n.bgcolor).call(Oe.stroke,n.bordercolor).style({\"stroke-width\":n.borderwidth}),q.selectAll(\".cboutline\").attr({x:L,y:O+n.ypad+(\"top\"===n.titleside?G:0),width:Math.max(M,2),height:Math.max(s-2*n.ypad-G,2)}).call(Oe.stroke,n.outlinecolor).style({fill:\"None\",\"stroke-width\":n.outlinewidth});var u=({center:.5,right:1}[n.xanchor]||0)*o;q.attr(\"transform\",\"translate(\"+(l.l-u)+\",\"+l.t+\")\"),_n.autoMargin(t,r,{x:n.x,y:n.y,l:o*({right:1,center:.5}[n.xanchor]||0),r:o*({left:1,center:.5}[n.xanchor]||0),t:s*({bottom:1,middle:.5}[n.yanchor]||0),b:s*({top:1,middle:.5}[n.yanchor]||0)})}],t);if(Q&&Q.then&&(t._promises||[]).push(Q),t._context.edits.colorbarPosition)Ua.init({element:q.node(),gd:t,prepFn:function(){Z=q.attr(\"transform\"),Ka(q)},moveFn:function(t,e){q.attr(\"transform\",Z+\" translate(\"+t+\",\"+e+\")\"),J=Ua.align(z+t/l.w,A,0,1,n.xanchor),K=Ua.align(I-e/l.h,T,0,1,n.yanchor);var r=Ua.getCursor(J,K,n.xanchor,n.yanchor);Ka(q,r)},doneFn:function(){Ka(q),void 0!==J&&void 0!==K&&P.call(\"restyle\",t,{\"colorbar.x\":J,\"colorbar.y\":K},a().index)}});return Q}function $(t,e){return ne.coerce(R,F,Ce,t,e)}function tt(e,r){var n,i=a();n=P.traceIs(i,\"markerColorscale\")?\"marker.colorbar.title\":\"colorbar.title\";var s={propContainer:F,propName:n,traceIndex:i.index,placeholder:o._dfltTitle.colorbar,containerGroup:q.select(\".cbtitle\")},l=\"h\"===e.charAt(0)?e.substr(1):\"h\"+e;q.selectAll(\".\"+l+\",.\"+l+\"-math-group\").remove(),Dn.draw(t,e,ts(s,r||{}))}o._infolayer.selectAll(\"g.\"+r).remove()}function a(){var e,n,i=r.substr(2);for(e=0;e<t._fullData.length;e++)if((n=t._fullData[e]).uid===i)return n}return Object.keys(ze).forEach(function(t){n[t]=null}),n.fillcolor=null,n.line={color:null,width:null,dash:null},n.levels={start:null,end:null,size:null},n.filllevels=null,Object.keys(n).forEach(function(t){i[t]=function(e){return arguments.length?(n[t]=ne.isPlainObject(n[t])?ne.extendFlat(n[t],e):e,i):n[t]}}),i.options=function(t){return Object.keys(t).forEach(function(e){\"function\"==typeof i[e]&&i[e](t[e])}),i},i._opts=n,i},is=function(t,e){var n=e[0].trace,i=n.marker,a=\"cb\"+n.uid;if(t._fullLayout._infolayer.selectAll(\".\"+a).remove(),void 0!==i&&i.showscale){var o=i.color,s=i.cmin,l=i.cmax;r(s)||(s=ne.aggNums(Math.min,null,o)),r(l)||(l=ne.aggNums(Math.max,null,o));var u=e[0].t.cb=ns(t,a),c=Je.makeColorScaleFunc(Je.extractScale(i.colorscale,s,l),{noNumericCheck:!0});u.fillcolor(c).filllevels({start:s,end:l,size:(l-s)/254}).options(i.colorbar)()}else _n.autoMargin(t,a)},as={};as.attributes=wa,as.layoutAttributes=wo,as.supplyDefaults=function(t,e,r,n){function i(r,n){return ne.coerce(t,e,wa,r,n)}var a=ne.coerceFont;if(Ta(t,e,n,i)){i(\"orientation\",e.x&&!e.y?\"h\":\"v\"),i(\"base\"),i(\"offset\"),i(\"width\"),i(\"text\"),i(\"hovertext\");var o=i(\"textposition\"),s=Array.isArray(o)||\"auto\"===o,l=s||\"inside\"===o,u=s||\"outside\"===o;if(l||u){var c=a(i,\"textfont\",n.font);l&&a(i,\"insidetextfont\",c),u&&a(i,\"outsidetextfont\",c),i(\"constraintext\"),i(\"selected.textfont.color\"),i(\"unselected.textfont.color\"),i(\"cliponaxis\")}ka(t,e,i,r,n);var h=P.getComponentMethod(\"errorbars\",\"supplyDefaults\");h(t,e,Oe.defaultLine,{axis:\"y\"}),h(t,e,Oe.defaultLine,{axis:\"x\",inherit:\"y\"}),ne.coerceSelectionMarkerOpacity(e,i)}else e.visible=!1},as.supplyLayoutDefaults=Mo,as.calc=function(t,e){var n,i,a,o,s,l=ri.getFromId(t,e.xaxis||\"x\"),u=ri.getFromId(t,e.yaxis||\"y\");\"h\"===(e.orientation||(e.x&&!e.y?\"h\":\"v\"))?(n=l,a=l.makeCalcdata(e,\"x\"),i=u.makeCalcdata(e,\"y\"),s=e.xcalendar):(n=u,a=u.makeCalcdata(e,\"y\"),i=l.makeCalcdata(e,\"x\"),s=e.ycalendar);var c=Math.min(i.length,a.length),h=new Array(c);for(o=0;o<c;o++)h[o]={p:i[o],s:a[o]},e.ids&&(h[o].id=String(e.ids[o]));var f,p=e.base;if(Aa(p)){for(o=0;o<Math.min(p.length,h.length);o++)f=n.d2c(p[o],0,s),r(f)?(h[o].b=+f,h[o].hasB=1):h[o].b=0;for(;o<h.length;o++)h[o].b=0}else{f=n.d2c(p,0,s);var d=r(f);for(f=d?f:0,o=0;o<h.length;o++)h[o].b=f,d&&(h[o].hasB=1)}return Xe(e,\"marker\")&&Ve(e,e.marker.color,\"marker\",\"c\"),Xe(e,\"marker.line\")&&Ve(e,e.marker.line.color,\"marker.line\",\"c\"),ma(h,e),Ma(h,e),h},as.setPositions=Vo,as.colorbar=is,as.arraysToCalcdata=ma,as.plot=Lo,as.style=$o,as.hoverPoints=_o,as.selectPoints=Oo,as.moduleType=\"trace\",as.name=\"bar\",as.basePlotModule=ua,as.categories=[\"cartesian\",\"bar\",\"oriented\",\"markerColorscale\",\"errorBarsOK\",\"showLegend\"],as.meta={};var os=as,ss=m.extendFlat,ls=Zr.marker,us=ls.line,cs={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:ss({},Zr.text,{}),whiskerwidth:{valType:\"number\",min:0,max:1,dflt:.5,editType:\"calcIfAutorange\"},notched:{valType:\"boolean\",editType:\"calcIfAutorange\"},notchwidth:{valType:\"number\",min:0,max:.5,dflt:.25,editType:\"calcIfAutorange\"},boxpoints:{valType:\"enumerated\",values:[\"all\",\"outliers\",\"suspectedoutliers\",!1],dflt:\"outliers\",editType:\"calcIfAutorange\"},boxmean:{valType:\"enumerated\",values:[!0,\"sd\",!1],dflt:!1,editType:\"calcIfAutorange\"},jitter:{valType:\"number\",min:0,max:1,editType:\"calcIfAutorange\"},pointpos:{valType:\"number\",min:-2,max:2,editType:\"calcIfAutorange\"},orientation:{valType:\"enumerated\",values:[\"v\",\"h\"],editType:\"calc+clearAxisTypes\"},marker:{outliercolor:{valType:\"color\",dflt:\"rgba(0, 0, 0, 0)\",editType:\"style\"},symbol:ss({},ls.symbol,{arrayOk:!1,editType:\"plot\"}),opacity:ss({},ls.opacity,{arrayOk:!1,dflt:1,editType:\"style\"}),size:ss({},ls.size,{arrayOk:!1,editType:\"calcIfAutorange\"}),color:ss({},ls.color,{arrayOk:!1,editType:\"style\"}),line:{color:ss({},us.color,{arrayOk:!1,dflt:C.defaultLine,editType:\"style\"}),width:ss({},us.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:Zr.fillcolor,selected:{marker:Zr.selected.marker,editType:\"style\"},unselected:{marker:Zr.unselected.marker,editType:\"style\"},hoveron:{valType:\"flaglist\",flags:[\"boxes\",\"points\"],dflt:\"boxes+points\",editType:\"style\"}},hs=ne._,fs=function(t,e){var n,i,a,o,s,l=t._fullLayout,u=ri.getFromId(t,e.xaxis||\"x\"),c=ri.getFromId(t,e.yaxis||\"y\"),h=[],f=\"violin\"===e.type?\"_numViolins\":\"_numBoxes\";\"h\"===e.orientation?(i=u,a=\"x\",o=c,s=\"y\"):(i=c,a=\"y\",o=u,s=\"x\");var p=i.makeCalcdata(e,a),d=function(t,e,n,i,a){if(e in t)return n.makeCalcdata(t,e);var o;o=e+\"0\"in t?t[e+\"0\"]:\"name\"in t&&(\"category\"===n.type||r(t.name)&&-1!==[\"linear\",\"log\"].indexOf(n.type)||ne.isDateTime(t.name)&&\"date\"===n.type)?t.name:a;var s=n.d2c(o,0,t[e+\"calendar\"]);return i.map(function(){return s})}(e,s,o,p,l[f]),g=ne.distinctVals(d),v=g.vals,m=g.minDiff/2,y=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i<r;i++)n[i]=t[i]-e;return n[r]=t[r-1]+e,n}(v,m),x=p.length,b=v.length,_=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=[];return e}(b);for(n=0;n<x;n++){var w=p[n];if(r(w)){var M=ne.findBin(d[n],y);if(M>=0&&M<b){var A={v:w,i:n};ps(A,e,n),_[M].push(A)}}}for(n=0;n<b;n++)if(_[n].length>0){var k=_[n].sort(ds),T=k.map(gs),S=T.length,E={pos:v[n],pts:k};E.min=T[0],E.max=T[S-1],E.mean=ne.mean(T,S),E.sd=ne.stdev(T,S,E.mean),E.q1=ne.interp(T,.25),E.med=ne.interp(T,.5),E.q3=ne.interp(T,.75),E.lf=Math.min(E.q1,T[Math.min(ne.findBin(2.5*E.q1-1.5*E.q3,T,!0)+1,S-1)]),E.uf=Math.max(E.q3,T[Math.max(ne.findBin(2.5*E.q3-1.5*E.q1,T),0)]),E.lo=4*E.q1-3*E.q3,E.uo=4*E.q3-3*E.q1;var C=1.57*(E.q3-E.q1)/Math.sqrt(S);E.ln=E.med-C,E.un=E.med+C,h.push(E)}return function(t,e){if(ne.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r<t.length;r++){for(var n=t[r].pts||[],i={},a=0;a<n.length;a++)i[n[a].i]=a;ne.tagSelected(n,e,i)}}(h,e),ri.expand(i,p,{padded:!0}),h.length>0?(h[0].t={num:l[f],dPos:m,posLetter:s,valLetter:a,labels:{med:hs(t,\"median:\"),min:hs(t,\"min:\"),q1:hs(t,\"q1:\"),q3:hs(t,\"q3:\"),max:hs(t,\"max:\"),mean:\"sd\"===e.boxmean?hs(t,\"mean \\xb1 \\u03c3:\"):hs(t,\"mean:\"),lf:hs(t,\"lower fence:\"),uf:hs(t,\"upper fence:\")}},e._fullInput&&\"candlestick\"===e._fullInput.type&&delete h[0].t.labels,l[f]++,h):[{t:{empty:!0}}]};function ps(t,e,r){var n={text:\"tx\"};for(var i in n)Array.isArray(e[i])&&(t[n[i]]=e[i][r])}function ds(t,e){return t.v-e.v}function gs(t){return t.v}function vs(t,e,r,n){var i,a=r(\"y\"),o=r(\"x\");if(a&&a.length)i=\"v\",o||r(\"x0\");else{if(!o||!o.length)return void(e.visible=!1);i=\"h\",r(\"y0\")}P.getComponentMethod(\"calendars\",\"handleTraceDefaults\")(t,e,[\"x\",\"y\"],n),r(\"orientation\",i)}function ms(t,e,r,n){var i=n.prefix,a=ne.coerce2(t,e,cs,\"marker.outliercolor\"),o=r(\"marker.line.outliercolor\"),s=r(i+\"points\",a||o?\"suspectedoutliers\":void 0);s?(r(\"jitter\",\"all\"===s?.3:0),r(\"pointpos\",\"all\"===s?-1.5:0),r(\"marker.symbol\"),r(\"marker.opacity\"),r(\"marker.size\"),r(\"marker.color\",e.line.color),r(\"marker.line.color\"),r(\"marker.line.width\"),\"suspectedoutliers\"===s&&(r(\"marker.line.outliercolor\",e.marker.color),r(\"marker.line.outlierwidth\")),r(\"selected.marker.color\"),r(\"unselected.marker.color\"),r(\"selected.marker.size\"),r(\"unselected.marker.size\"),r(\"text\")):delete e.marker,r(\"hoveron\"),ne.coerceSelectionMarkerOpacity(e,r)}var ys={supplyDefaults:function(t,e,r,n){function i(r,n){return ne.coerce(t,e,cs,r,n)}vs(t,e,i,n),!1!==e.visible&&(i(\"line.color\",(t.marker||{}).color||r),i(\"line.width\"),i(\"fillcolor\",Oe.addOpacity(e.line.color,.5)),i(\"whiskerwidth\"),i(\"boxmean\"),i(\"notched\",void 0!==t.notchwidth)&&i(\"notchwidth\"),ms(t,e,i,{prefix:\"box\"}))},handleSampleDefaults:vs,handlePointsDefaults:ms};function xs(t,e,r,n){var i,a,o,s,l,u,c,h,f,p,d,g,v=t.cd,m=t.xa,y=t.ya,x=v[0].trace,b=v[0].t,_=\"violin\"===x.type,w=[],M=b.bdPos,A=function(t){return t.pos+b.bPos-u};_&&\"both\"!==x.side?(\"positive\"===x.side&&(f=function(t){var e=A(t);return yo.inbox(e,e+M,p)}),\"negative\"===x.side&&(f=function(t){var e=A(t);return yo.inbox(e-M,e,p)})):f=function(t){var e=A(t);return yo.inbox(e-M,e+M,p)},g=_?function(t){return yo.inbox(t.span[0]-l,t.span[1]-l,p)}:function(t){return yo.inbox(t.min-l,t.max-l,p)},\"h\"===x.orientation?(l=e,u=r,c=g,h=f,i=\"y\",o=y,a=\"x\",s=m):(l=r,u=e,c=f,h=g,i=\"x\",o=m,a=\"y\",s=y);var k=Math.min(1,M/Math.abs(o.r2c(o.range[1])-o.r2c(o.range[0])));function T(t){return(c(t)+h(t))/2}p=t.maxHoverDistance-k,d=t.maxSpikeDistance-k;var S=yo.getDistanceFunction(n,c,h,T);if(yo.getClosest(v,S,t),!1===t.index)return[];var E=v[t.index],C=x.line.color,L=(x.marker||{}).color;Oe.opacity(C)&&x.line.width?t.color=C:Oe.opacity(L)&&x.boxpoints?t.color=L:t.color=x.fillcolor,t[i+\"0\"]=o.c2p(E.pos+b.bPos-b.bdPos,!0),t[i+\"1\"]=o.c2p(E.pos+b.bPos+b.bdPos,!0),ri.tickText(o,o.c2l(E.pos),\"hover\").text,t[i+\"LabelVal\"]=E.pos;var z=i+\"Spike\";t.spikeDistance=T(E)*d/p,t[z]=o.c2p(E.pos,!0);var P={},I=[\"med\",\"min\",\"q1\",\"q3\",\"max\"];(x.boxmean||(x.meanline||{}).visible)&&I.push(\"mean\"),(x.boxpoints||x.points)&&I.push(\"lf\",\"uf\");for(var D=0;D<I.length;D++){var O=I[D];if(O in E&&!(E[O]in P)){P[E[O]]=!0;var R=E[O],F=s.c2p(R,!0),B=ne.extendFlat({},t);B[a+\"0\"]=B[a+\"1\"]=F,B[a+\"LabelVal\"]=R,B[a+\"Label\"]=(b.labels?b.labels[O]+\" \":\"\")+ri.hoverLabelText(s,R),\"mean\"===O&&\"sd\"in E&&\"sd\"===x.boxmean&&(B[a+\"err\"]=E.sd),t.name=\"\",t.spikeDistance=void 0,t[z]=void 0,w.push(B)}}return w}function bs(t,e,r){for(var n,i,a,o=t.cd,s=t.xa,l=t.ya,u=o[0].trace,c=s.c2p(e),h=l.c2p(r),f=yo.quadrature(function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(s.c2p(t.x)-c)-e,1-3/e)},function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(l.c2p(t.y)-h)-e,1-3/e)}),p=!1,d=0;d<o.length;d++){i=o[d];for(var g=0;g<(i.pts||[]).length;g++){var v=f(a=i.pts[g]);v<=t.distance&&(t.distance=v,p=[d,g])}}if(!p)return!1;a=(i=o[p[0]]).pts[p[1]];var m=s.c2p(a.x,!0),y=l.c2p(a.y,!0),x=a.mrc||1;n=ne.extendFlat({},t,{index:a.i,color:(u.marker||{}).color,name:u.name,x0:m-x,x1:m+x,xLabelVal:a.x,y0:y-x,y1:y+x,yLabelVal:a.y,spikeDistance:t.distance});var b=\"h\"===u.orientation?\"y\":\"x\",_=\"h\"===u.orientation?l:s;return n[b+\"Spike\"]=_.c2p(i.pos,!0),xo(a,u,n),n}var _s={hoverPoints:function(t,e,r,n){var i,a=t.cd[0].trace.hoveron,o=[];return-1!==a.indexOf(\"boxes\")&&(o=o.concat(xs(t,e,r,n))),-1!==a.indexOf(\"points\")&&(i=bs(t,e,r)),\"closest\"===n?i?[i]:o:i?(o.push(i),o):o},hoverOnBoxes:xs,hoverOnPoints:bs},ws={boxmode:{valType:\"enumerated\",values:[\"group\",\"overlay\"],dflt:\"overlay\",editType:\"calc\"},boxgap:{valType:\"number\",min:0,max:1,dflt:.3,editType:\"calc\"},boxgroupgap:{valType:\"number\",min:0,max:1,dflt:.3,editType:\"calc\"}};function Ms(t,e,r,n,i){for(var a,o=0;o<r.length;o++)if(r[o].type===i){a=!0;break}a&&(n(i+\"mode\"),n(i+\"gap\"),n(i+\"groupgap\"))}var As={supplyLayoutDefaults:function(t,e,r){Ms(0,0,r,function(r,n){return ne.coerce(t,e,ws,r,n)},\"box\")},_supply:Ms},ks=5,Ts=.01;function Ss(t,r,n,i){var a,o,s=r.pos,l=r.val,u=i.bPos,c=i.wdPos||0,h=i.bPosPxOffset||0,f=n.whiskerwidth||0,p=n.notched||!1,d=p?1-2*n.notchwidth:1;Array.isArray(i.bdPos)?(a=i.bdPos[0],o=i.bdPos[1]):(a=i.bdPos,o=i.bdPos),t.selectAll(\"path.box\").data(ne.identity).enter().append(\"path\").style(\"vector-effect\",\"non-scaling-stroke\").attr(\"class\",\"box\").each(function(t){var r=t.pos,i=s.c2p(r+u,!0)+h,g=s.c2p(r+u-a,!0)+h,v=s.c2p(r+u+o,!0)+h,m=s.c2p(r+u-c,!0)+h,y=s.c2p(r+u+c,!0)+h,x=s.c2p(r+u-a*d,!0)+h,b=s.c2p(r+u+o*d,!0)+h,_=l.c2p(t.q1,!0),w=l.c2p(t.q3,!0),M=ne.constrain(l.c2p(t.med,!0),Math.min(_,w)+1,Math.max(_,w)-1),A=l.c2p(!1===n.boxpoints?t.min:t.lf,!0),k=l.c2p(!1===n.boxpoints?t.max:t.uf,!0),T=l.c2p(t.ln,!0),S=l.c2p(t.un,!0);\"h\"===n.orientation?e.select(this).attr(\"d\",\"M\"+M+\",\"+x+\"V\"+b+\"M\"+_+\",\"+g+\"V\"+v+(p?\"H\"+T+\"L\"+M+\",\"+b+\"L\"+S+\",\"+v:\"\")+\"H\"+w+\"V\"+g+(p?\"H\"+S+\"L\"+M+\",\"+x+\"L\"+T+\",\"+g:\"\")+\"ZM\"+_+\",\"+i+\"H\"+A+\"M\"+w+\",\"+i+\"H\"+k+(0===f?\"\":\"M\"+A+\",\"+m+\"V\"+y+\"M\"+k+\",\"+m+\"V\"+y)):e.select(this).attr(\"d\",\"M\"+x+\",\"+M+\"H\"+b+\"M\"+g+\",\"+_+\"H\"+v+(p?\"V\"+T+\"L\"+b+\",\"+M+\"L\"+v+\",\"+S:\"\")+\"V\"+w+\"H\"+g+(p?\"V\"+S+\"L\"+x+\",\"+M+\"L\"+g+\",\"+T:\"\")+\"ZM\"+i+\",\"+_+\"V\"+A+\"M\"+i+\",\"+w+\"V\"+k+(0===f?\"\":\"M\"+m+\",\"+A+\"H\"+y+\"M\"+m+\",\"+k+\"H\"+y))})}function Es(t,e,r,n){var i=e.x,a=e.y,o=n.bdPos,s=n.bPos,l=r.boxpoints||r.points;ne.seedPseudoRandom(),t.selectAll(\"g.points\").data(function(t){return t.forEach(function(t){t.t=n,t.trace=r}),t}).enter().append(\"g\").attr(\"class\",\"points\").selectAll(\"path\").data(function(t){var e,n,i=\"all\"===l?t.pts:t.pts.filter(function(e){return e.v<t.lf||e.v>t.uf}),a=Math.max((t.max-t.min)/10,t.q3-t.q1),u=1e-9*a,c=a*Ts,h=[],f=0;if(r.jitter){if(0===a)for(f=1,h=new Array(i.length),e=0;e<i.length;e++)h[e]=1;else for(e=0;e<i.length;e++){var p=Math.max(0,e-ks),d=i[p].v,g=Math.min(i.length-1,e+ks),v=i[g].v;\"all\"!==l&&(i[e].v<t.lf?v=Math.min(v,t.lf):d=Math.max(d,t.uf));var m=Math.sqrt(c*(g-p)/(v-d+u))||0;m=ne.constrain(Math.abs(m),0,1),h.push(m),f=Math.max(m,f)}n=2*r.jitter/f}for(e=0;e<i.length;e++){var y=i[e],x=y.v,b=r.jitter?n*h[e]*(ne.pseudoRandom()-.5):0,_=t.pos+s+o*(r.pointpos+b);\"h\"===r.orientation?(y.y=_,y.x=x):(y.x=_,y.y=x),\"suspectedoutliers\"===l&&x<t.uo&&x>t.lo&&(y.so=!0)}return i}).enter().append(\"path\").classed(\"point\",!0).call(Sr.translatePoints,i,a)}function Cs(t,r,n,i){var a,o,s=r.pos,l=r.val,u=i.bPos,c=i.bPosPxOffset||0;Array.isArray(i.bdPos)?(a=i.bdPos[0],o=i.bdPos[1]):(a=i.bdPos,o=i.bdPos),t.selectAll(\"path.mean\").data(ne.identity).enter().append(\"path\").attr(\"class\",\"mean\").style({fill:\"none\",\"vector-effect\":\"non-scaling-stroke\"}).each(function(t){var r=s.c2p(t.pos+u,!0)+c,i=s.c2p(t.pos+u-a,!0)+c,h=s.c2p(t.pos+u+o,!0)+c,f=l.c2p(t.mean,!0),p=l.c2p(t.mean-t.sd,!0),d=l.c2p(t.mean+t.sd,!0);\"h\"===n.orientation?e.select(this).attr(\"d\",\"M\"+f+\",\"+i+\"V\"+h+(\"sd\"===n.boxmean?\"m0,0L\"+p+\",\"+r+\"L\"+f+\",\"+i+\"L\"+d+\",\"+r+\"Z\":\"\")):e.select(this).attr(\"d\",\"M\"+i+\",\"+f+\"H\"+h+(\"sd\"===n.boxmean?\"m0,0L\"+r+\",\"+p+\"L\"+i+\",\"+f+\"L\"+r+\",\"+d+\"Z\":\"\"))})}var Ls={plot:function(t,r,n){var i=t._fullLayout,a=r.xaxis,o=r.yaxis;r.plot.select(\".boxlayer\").selectAll(\"g.trace.boxes\").data(n).enter().append(\"g\").attr(\"class\",\"trace boxes\").each(function(t){var r,n,s=t[0],l=s.t,u=s.trace,c=s.node3=e.select(this),h=i._numBoxes,f=\"group\"===i.boxmode&&h>1,p=l.dPos*(1-i.boxgap)*(1-i.boxgroupgap)/(f?h:1),d=f?2*l.dPos*((l.num+.5)/h-.5)*(1-i.boxgap):0,g=p*u.whiskerwidth;!0!==u.visible||l.empty?e.select(this).remove():(\"h\"===u.orientation?(r=o,n=a):(r=a,n=o),l.bPos=d,l.bdPos=p,l.wdPos=g,Ss(c,{pos:r,val:n},u,l),u.boxpoints&&Es(c,{x:a,y:o},u,l),u.boxmean&&Cs(c,{pos:r,val:n},u,l))})},plotBoxAndWhiskers:Ss,plotPoints:Es,plotBoxMean:Cs},zs=function(t,e){var r,n,i=t.cd,a=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r<i.length;r++)for(n=0;n<(i[r].pts||[]).length;n++)i[r].pts[n].selected=0;else for(r=0;r<i.length;r++)for(n=0;n<(i[r].pts||[]).length;n++){var l=i[r].pts[n],u=a.c2p(l.x),c=o.c2p(l.y);e.contains([u,c])?(s.push({pointNumber:l.i,x:a.c2d(l.x),y:o.c2d(l.y)}),l.selected=1):l.selected=0}return s},Ps=[\"v\",\"h\"];function Is(t,e,r,n,i){var a,o,s,l=e.calcdata,u=e._fullLayout,c=[],h=\"violin\"===t?\"_numViolins\":\"_numBoxes\";for(a=0;a<r.length;a++)for(s=l[r[a]],o=0;o<s.length;o++)c.push(s[o].pos);if(c.length){var f=ne.distinctVals(c),p=f.minDiff/2;for(c.length===f.vals.length&&(u[h]=1),ri.minDtick(n,f.minDiff,f.vals[0],!0),a=0;a<r.length;a++)(s=l[r[a]])[0].t.dPos=p;var d=(1-u[t+\"gap\"])*(1-u[t+\"groupgap\"])*p/u[h];ri.expand(n,f.vals,{vpadminus:p+i[0]*d,vpadplus:p+i[1]*d})}}var Ds=function(t,e){for(var r=t.calcdata,n=e.xaxis,i=e.yaxis,a=0;a<Ps.length;a++){for(var o=Ps[a],s=\"h\"===o?i:n,l=[],u=0,c=0,h=0;h<r.length;h++){var f=r[h],p=f[0].t,d=f[0].trace;!0!==d.visible||\"box\"!==d.type||p.empty||d.orientation!==o||d.xaxis!==n._id||d.yaxis!==i._id||(l.push(h),!1!==d.boxpoints&&(u=Math.max(u,d.jitter-d.pointpos-1),c=Math.max(c,d.jitter+d.pointpos-1)))}Is(\"box\",t,l,s,[u,c])}},Os=Is,Rs={};Rs.attributes=cs,Rs.layoutAttributes=ws,Rs.supplyDefaults=ys.supplyDefaults,Rs.supplyLayoutDefaults=As.supplyLayoutDefaults,Rs.calc=fs,Rs.setPositions=Ds,Rs.plot=Ls.plot,Rs.style=function(t,r){var n=r?r[0].node3:e.select(t).selectAll(\"g.trace.boxes\");n.style(\"opacity\",function(t){return t[0].trace.opacity}),n.each(function(r){var n=e.select(this),i=r[0].trace,a=i.line.width;n.selectAll(\"path.box\").style(\"stroke-width\",a+\"px\").call(Oe.stroke,i.line.color).call(Oe.fill,i.fillcolor),n.selectAll(\"path.mean\").style({\"stroke-width\":a,\"stroke-dasharray\":2*a+\"px,\"+a+\"px\"}).call(Oe.stroke,i.line.color);var o=n.selectAll(\"path.point\");Sr.pointStyle(o,i,t),Sr.selectedPointStyle(o,i)})},Rs.hoverPoints=_s.hoverPoints,Rs.selectPoints=zs,Rs.moduleType=\"trace\",Rs.name=\"box\",Rs.basePlotModule=ua,Rs.categories=[\"cartesian\",\"symbols\",\"oriented\",\"box-violin\",\"showLegend\"],Rs.meta={};var Fs=Rs,Bs=Fs,Ns=Object.getOwnPropertySymbols,js=Object.prototype.hasOwnProperty,Vs=Object.prototype.propertyIsEnumerable;var Us=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;if(\"0123456789\"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(\"\"))return!1;var n={};return\"abcdefghijklmnopqrst\".split(\"\").forEach(function(t){n[t]=t}),\"abcdefghijklmnopqrst\"===Object.keys(Object.assign({},n)).join(\"\")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,n,i=function(t){if(null===t||void 0===t)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(t)}(t),a=1;a<arguments.length;a++){for(var o in r=Object(arguments[a]))js.call(r,o)&&(i[o]=r[o]);if(Ns){n=Ns(r);for(var s=0;s<n.length;s++)Vs.call(r,n[s])&&(i[n[s]]=r[n[s]])}}return i},qs={};function Hs(){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 Gs(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(Zs.local.invalidDate||Zs.regionalOptions[\"\"].invalidDate).replace(/\\{0\\}/,this._calendar.local.name)}function Ws(t,e){return\"000000\".substring(0,e-(t=\"\"+t).length)+t}function Ys(){this.shortYearCutoff=\"+10\"}function Xs(t){this.local=this.regionalOptions[t]||this.regionalOptions[\"\"]}Us(Hs.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]}}}),Us(Gs.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(Zs.local.invalidDate||Zs.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(Zs.local.differentCalendars||Zs.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?\"-\":\"\")+Ws(Math.abs(this.year()),4)+\"-\"+Ws(this.month(),2)+\"-\"+Ws(this.day(),2)}}),Us(Ys.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,Zs.local.invalidDate||Zs.regionalOptions[\"\"].invalidDate),r=t.day(),e=t.month(),t=t.year()),new Gs(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,Zs.local.invalidYear||Zs.regionalOptions[\"\"].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,Zs.local.invalidYear||Zs.regionalOptions[\"\"].invalidYear);return(e.year()<0?\"-\":\"\")+Ws(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,Zs.local.invalidYear||Zs.regionalOptions[\"\"].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,Zs.local.invalidMonth||Zs.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,Zs.local.invalidMonth||Zs.regionalOptions[\"\"].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,Zs.local.invalidYear||Zs.regionalOptions[\"\"].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,Zs.local.invalidDate||Zs.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,Zs.local.invalidDate||Zs.regionalOptions[\"\"].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,Zs.local.invalidDate||Zs.regionalOptions[\"\"].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,Zs.local.invalidDate||Zs.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(;o<t.minMonth;)a--,o+=t.monthsInYear(a);for(var e=t.monthsInYear(a);o>e-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,Zs.local.invalidDate||Zs.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.monthsInYear(i)&&r>=this.minDay&&r-this.minDay<this.daysInMonth(i)}return this._validateLevel--,n},toJSDate:function(t,e,r){var n=this._validate(t,e,r,Zs.local.invalidDate||Zs.regionalOptions[\"\"].invalidDate);return Zs.instance().fromJD(this.toJD(n)).toJSDate()},fromJSDate:function(t){return this.fromJD(Zs.instance().fromJSDate(t).toJD())},_validate:function(t,e,r,n){if(t.year){if(0===this._validateLevel&&this.name!==t.calendar().name)throw(Zs.local.differentCalendars||Zs.regionalOptions[\"\"].differentCalendars).replace(/\\{0\\}/,this.local.name).replace(/\\{1\\}/,t.calendar().local.name);return t}try{if(this._validateLevel++,1===this._validateLevel&&!this.isValid(t,e,r))throw n.replace(/\\{0\\}/,this.local.name);var i=this.newDate(t,e,r);return this._validateLevel--,i}catch(t){throw this._validateLevel--,t}}}),Xs.prototype=new Ys,Us(Xs.prototype,{name:\"Gregorian\",jdEpoch:1721425.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{\"\":{name:\"Gregorian\",epochs:[\"BCE\",\"CE\"],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,Zs.local.invalidYear||Zs.regionalOptions[\"\"].invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==0&&(t%100!=0||t%400==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,Zs.local.invalidMonth||Zs.regionalOptions[\"\"].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 n=this._validate(t,e,r,Zs.local.invalidDate||Zs.regionalOptions[\"\"].invalidDate);t=n.year(),e=n.month(),r=n.day(),t<0&&t++,e<3&&(e+=12,t--);var i=Math.floor(t/100),a=2-i+Math.floor(i/4);return Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r+a-1524.5},fromJD:function(t){var e=Math.floor(t+.5),r=Math.floor((e-1867216.25)/36524.25),n=(r=e+1+r-Math.floor(r/4))+1524,i=Math.floor((n-122.1)/365.25),a=Math.floor(365.25*i),o=Math.floor((n-a)/30.6001),s=n-a-Math.floor(30.6001*o),l=o-(o>13.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,Zs.local.invalidDate||Zs.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 Zs=qs=new Hs;Zs.cdate=Gs,Zs.baseCalendar=Ys,Zs.calendars.gregorian=Xs;var Js=qs.instance();function Ks(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}Ks.prototype=new qs.baseCalendar,Us(Ks.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($s);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(tl);return e?e[0]:\"\"}var r=this._validateYear(t),n=t.month(),i=[\"\\u4e00\\u6708\",\"\\u4e8c\\u6708\",\"\\u4e09\\u6708\",\"\\u56db\\u6708\",\"\\u4e94\\u6708\",\"\\u516d\\u6708\",\"\\u4e03\\u6708\",\"\\u516b\\u6708\",\"\\u4e5d\\u6708\",\"\\u5341\\u6708\",\"\\u5341\\u4e00\\u6708\",\"\\u5341\\u4e8c\\u6708\"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i=\"\\u95f0\"+i),i},monthNamesShort:function(t){if(\"string\"==typeof t){var e=t.match(el);return e?e[0]:\"\"}var r=this._validateYear(t),n=t.month(),i=[\"\\u4e00\",\"\\u4e8c\",\"\\u4e09\",\"\\u56db\",\"\\u4e94\",\"\\u516d\",\"\\u4e03\",\"\\u516b\",\"\\u4e5d\",\"\\u5341\",\"\\u5341\\u4e00\",\"\\u5341\\u4e8c\"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i=\"\\u95f0\"+i),i},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))\"\\u95f0\"===e[0]&&(r=!0,e=e.substring(1)),\"\\u6708\"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+[\"\\u4e00\",\"\\u4e8c\",\"\\u4e09\",\"\\u56db\",\"\\u4e94\",\"\\u516d\",\"\\u4e03\",\"\\u516b\",\"\\u4e5d\",\"\\u5341\",\"\\u5341\\u4e00\",\"\\u5341\\u4e8c\"].indexOf(e);else{var i=e[e.length-1];r=\"i\"===i||\"I\"===i}return this.toMonthIndex(t,n,r)},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 n=this.intercalaryMonth(t);if(r&&e!==n||e<1||e>12)throw qs.local.invalidMonth.replace(/\\{0\\}/,this.local.name);return n?!r&&e<=n?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw qs.local.invalidMonth.replace(/\\{0\\}/,this.local.name);return r?e<r?e+1:e:e+1},intercalaryMonth:function(t){return t=this._validateYear(t),rl[t-rl[0]]>>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var n,i=this._validateYear(t,qs.local.invalidyear),a=nl[i-nl[0]],o=a>>9&4095,s=a>>5&15,l=31&a;(n=Js.newDate(o,s,l)).add(4-(n.dayOfWeek()||7),\"d\");var u=this.toJD(t,e,r)-n.toJD();return 1+Math.floor(u/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=rl[t-rl[0]];if(e>(r>>13?12:11))throw qs.local.invalidMonth.replace(/\\{0\\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,a,r,qs.local.invalidDate);t=this._validateYear(n.year()),e=n.month(),r=n.day();var i=this.isIntercalaryMonth(t,e),a=this.toChineseMonth(t,e),o=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,h=\"number\"==typeof r&&r>=1&&r<=30;if(!h)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 f,p=rl[o.year-rl[0]],d=p>>13;f=d?o.month>d?o.month:o.isIntercalary?o.month:o.month-1:o.month-1;for(var g=0;g<f;g++){var v=p&1<<12-g?30:29;s+=v}var m=nl[o.year-nl[0]],y=new Date(m>>9&4095,(m>>5&15)-1,(31&m)+s);return a.year=y.getFullYear(),a.month=1+y.getMonth(),a.day=y.getDate(),a}(t,a,r,i);return Js.toJD(o.year,o.month,o.day)},fromJD:function(t){var e=Js.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=nl[i.year-nl[0]],c=i.year<<9|i.month<<5|i.day;a.year=c>=u?i.year:i.year-1,u=nl[a.year-nl[0]];var h,f=new Date(u>>9&4095,(u>>5&15)-1,31&u),p=new Date(i.year,i.month-1,i.day);h=Math.round((p-f)/864e5);var d,g=rl[a.year-rl[0]];for(d=0;d<13;d++){var v=g&1<<12-d?30:29;if(h<v)break;h-=v}var m=g>>13;!m||d<m?(a.isIntercalary=!1,a.month=1+d):d===m?(a.isIntercalary=!0,a.month=d):(a.isIntercalary=!1,a.month=d);return a.day=1+h,a}(e.year(),e.month(),e.day()),n=this.toMonthIndex(r.year,r.month,r.isIntercalary);return this.newDate(r.year,n,r.day)},fromString:function(t){var e=t.match(Qs),r=this._validateYear(+e[1]),n=+e[2],i=!!e[3],a=this.toMonthIndex(r,n,i),o=+e[4];return this.newDate(r,a,o)},add:function(t,e,r){var n=t.year(),i=t.month(),a=this.isIntercalaryMonth(n,i),o=this.toChineseMonth(n,i),s=Object.getPrototypeOf(Ks.prototype).add.call(this,t,e,r);if(\"y\"===r){var l=s.year(),u=s.month(),c=this.isIntercalaryMonth(l,o),h=a&&c?this.toMonthIndex(l,o,!0):this.toMonthIndex(l,o,!1);h!==u&&s.month(h)}return s}});var Qs=/^\\s*(-?\\d\\d\\d\\d|\\d\\d)[-/](\\d?\\d)([iI]?)[-/](\\d?\\d)/m,$s=/^\\d?\\d[iI]?/m,tl=/^\\u95f0?\\u5341?[\\u4e00\\u4e8c\\u4e09\\u56db\\u4e94\\u516d\\u4e03\\u516b\\u4e5d]?\\u6708/m,el=/^\\u95f0?\\u5341?[\\u4e00\\u4e8c\\u4e09\\u56db\\u4e94\\u516d\\u4e03\\u516b\\u4e5d]?/m;qs.calendars.chinese=Ks;var rl=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],nl=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function il(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}il.prototype=new qs.baseCalendar,Us(il.prototype,{name:\"Coptic\",jdEpoch:1825029.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:\"Coptic\",epochs:[\"BAM\",\"AM\"],monthNames:[\"Thout\",\"Paopi\",\"Hathor\",\"Koiak\",\"Tobi\",\"Meshir\",\"Paremhat\",\"Paremoude\",\"Pashons\",\"Paoni\",\"Epip\",\"Mesori\",\"Pi Kogi Enavot\"],monthNamesShort:[\"Tho\",\"Pao\",\"Hath\",\"Koi\",\"Tob\",\"Mesh\",\"Pat\",\"Pad\",\"Pash\",\"Pao\",\"Epi\",\"Meso\",\"PiK\"],dayNames:[\"Tkyriaka\",\"Pesnau\",\"Pshoment\",\"Peftoou\",\"Ptiou\",\"Psoou\",\"Psabbaton\"],dayNamesShort:[\"Tky\",\"Pes\",\"Psh\",\"Pef\",\"Pti\",\"Pso\",\"Psa\"],dayNamesMin:[\"Tk\",\"Pes\",\"Psh\",\"Pef\",\"Pt\",\"Pso\",\"Psa\"],digits:null,dateFormat:\"dd/mm/yyyy\",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear||qs.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,qs.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 n=this._validate(t,e,r,qs.local.invalidDate);return(t=n.year())<0&&t++,n.day()+30*(n.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)}}),qs.calendars.coptic=il;function al(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}al.prototype=new qs.baseCalendar,Us(al.prototype,{name:\"Discworld\",jdEpoch:1721425.5,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{\"\":{name:\"Discworld\",epochs:[\"BUC\",\"UC\"],monthNames:[\"Ick\",\"Offle\",\"February\",\"March\",\"April\",\"May\",\"June\",\"Grune\",\"August\",\"Spune\",\"Sektober\",\"Ember\",\"December\"],monthNamesShort:[\"Ick\",\"Off\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Gru\",\"Aug\",\"Spu\",\"Sek\",\"Emb\",\"Dec\"],dayNames:[\"Sunday\",\"Octeday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],dayNamesShort:[\"Sun\",\"Oct\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],dayNamesMin:[\"Su\",\"Oc\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],digits:null,dateFormat:\"yyyy/mm/dd\",firstDay:2,isRTL:!1}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear),!1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear),13},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear),400},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),\"d\"),Math.floor((n.dayOfYear()-1)/8)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,qs.local.invalidMonth);return this.daysPerMonth[r.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(t,e,r){return(this._validate(t,e,r,qs.local.invalidDate).day()+1)%8},weekDay:function(t,e,r){var n=this.dayOfWeek(t,e,r);return n>=2&&n<=6},extraInfo:function(t,e,r){var n=this._validate(t,e,r,qs.local.invalidDate);return{century:ol[Math.floor((n.year()-1)/100)+1]||\"\"}},toJD:function(t,e,r){var n=this._validate(t,e,r,qs.local.invalidDate);return t=n.year()+(n.year()<0?1:0),e=n.month(),(r=n.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 ol={20:\"Fruitbat\",21:\"Anchovy\"};qs.calendars.discworld=al;function sl(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}sl.prototype=new qs.baseCalendar,Us(sl.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,qs.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear||qs.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,qs.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 n=this._validate(t,e,r,qs.local.invalidDate);return(t=n.year())<0&&t++,n.day()+30*(n.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)}}),qs.calendars.ethiopian=sl;function ll(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}function ul(t,e){return t-e*Math.floor(t/e)}ll.prototype=new qs.baseCalendar,Us(ll.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,qs.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return ul(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,qs.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){return t=this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear).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,qs.local.invalidMonth),12===e&&this.leapYear(t)?30:8===e&&5===ul(this.daysInYear(t),10)?30:9===e&&3===ul(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 n=this._validate(t,e,r,qs.local.invalidDate);return{yearType:(this.leapYear(n)?\"embolismic\":\"common\")+\" \"+[\"deficient\",\"regular\",\"complete\"][this.daysInYear(n)%10-3]}},toJD:function(t,e,r){var n=this._validate(t,e,r,qs.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var i=t<=0?t+1:t,a=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(e<7){for(var o=7;o<=this.monthsInYear(t);o++)a+=this.daysInMonth(t,o);for(o=1;o<e;o++)a+=this.daysInMonth(t,o)}else for(o=7;o<e;o++)a+=this.daysInMonth(t,o);return a},_delay1:function(t){var e=Math.floor((235*t-234)/19),r=12084+13753*e,n=29*e+Math.floor(r/25920);return ul(3*(n+1),7)<3&&n++,n},_delay2:function(t){var e=this._delay1(t-1),r=this._delay1(t);return this._delay1(t+1)-r==356?2:r-e==382?1:0},fromJD:function(t){t=Math.floor(t)+.5;for(var e=Math.floor(98496*(t-this.jdEpoch)/35975351)-1;t>=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=t<this.toJD(e,1,1)?7:1;t>this.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),qs.calendars.hebrew=ll;function cl(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}cl.prototype=new qs.baseCalendar,Us(cl.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\\u012bs\",\"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){return(11*this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear).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,qs.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 n=this._validate(t,e,r,qs.local.invalidDate);return t=n.year(),e=n.month(),r=n.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)}}),qs.calendars.islamic=cl;function hl(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}hl.prototype=new qs.baseCalendar,Us(hl.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,qs.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%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,qs.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 n=this._validate(t,e,r,qs.local.invalidDate);return t=n.year(),e=n.month(),r=n.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)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),qs.calendars.julian=hl;function fl(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}function pl(t,e){return t-e*Math.floor(t/e)}function dl(t,e){return pl(t-1,e)+1}fl.prototype=new qs.baseCalendar,Us(fl.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,qs.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+\".\"+Math.floor(t/20)+\".\"+t%20},forYear:function(t){if((t=t.split(\".\")).length<3)throw\"Invalid Mayan year\";for(var e=0,r=0;r<t.length;r++){var n=parseInt(t[r],10);if(Math.abs(n)>19||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,qs.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,qs.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,qs.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,qs.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,qs.local.invalidDate),!0},extraInfo:function(t,e,r){var n=this._validate(t,e,r,qs.local.invalidDate).toJD(),i=this._toHaab(n),a=this._toTzolkin(n);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[a[0]-1],tzolkinDay:a[0],tzolkinTrecena:a[1]}},_toHaab:function(t){var e=pl((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,pl(e,20)]},_toTzolkin:function(t){return[dl((t-=this.jdEpoch)+20,20),dl(t+4,13)]},toJD:function(t,e,r){var n=this._validate(t,e,r,qs.local.invalidDate);return n.day()+20*n.month()+360*n.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)}}),qs.calendars.mayan=fl;function vl(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}vl.prototype=new qs.baseCalendar;var ml=qs.instance(\"gregorian\");Us(vl.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,qs.local.invalidYear||qs.regionalOptions[\"\"].invalidYear);return ml.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,qs.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 n=this._validate(t,e,r,qs.local.invalidMonth);(t=n.year())<0&&t++;for(var i=n.day(),a=1;a<n.month();a++)i+=this.daysPerMonth[a-1];return i+ml.toJD(t+1468,3,13)},fromJD:function(t){t=Math.floor(t+.5);for(var e=Math.floor((t-(this.jdEpoch-1))/366);t>=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)}}),qs.calendars.nanakshahi=vl;function yl(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}yl.prototype=new qs.baseCalendar,Us(yl.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){if(t=this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,qs.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 n=this._validate(t,e,r,qs.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var i=qs.instance(),a=0,o=e,s=t;this._createMissingCalendarData(t);var l=t-(o>9||9===o&&r>=this.NEPALI_CALENDAR_DATA[s][0]?56:57);for(9!==e&&(a=r,o--);9!==o;)o<=0&&(o=12,s--),a+=this.NEPALI_CALENDAR_DATA[s][o],o--;return 9===e?(a+=r-this.NEPALI_CALENDAR_DATA[s][0])<0&&(a+=i.daysInYear(l)):a+=this.NEPALI_CALENDAR_DATA[s][9]-this.NEPALI_CALENDAR_DATA[s][0],i.newDate(l,1,1).add(a,\"d\").toJD()},fromJD:function(t){var e=qs.instance().fromJD(t),r=e.year(),n=e.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var a=9,o=this.NEPALI_CALENDAR_DATA[i][0],s=this.NEPALI_CALENDAR_DATA[i][a]-o+1;n>s;)++a>12&&(a=1,i++),s+=this.NEPALI_CALENDAR_DATA[i][a];var l=this.NEPALI_CALENDAR_DATA[i][a]-(s-n);return this.newDate(i,a,l)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r<t+2;r++)void 0===this.NEPALI_CALENDAR_DATA[r]&&(this.NEPALI_CALENDAR_DATA[r]=e)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2000:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),qs.calendars.nepali=yl;function xl(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}function bl(t,e){return t-e*Math.floor(t/e)}xl.prototype=new qs.baseCalendar,Us(xl.prototype,{name:\"Persian\",jdEpoch:1948320.5,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{\"\":{name:\"Persian\",epochs:[\"BP\",\"AP\"],monthNames:[\"Farvardin\",\"Ordibehesht\",\"Khordad\",\"Tir\",\"Mordad\",\"Shahrivar\",\"Mehr\",\"Aban\",\"Azar\",\"Day\",\"Bahman\",\"Esfand\"],monthNamesShort:[\"Far\",\"Ord\",\"Kho\",\"Tir\",\"Mor\",\"Sha\",\"Meh\",\"Aba\",\"Aza\",\"Day\",\"Bah\",\"Esf\"],dayNames:[\"Yekshambe\",\"Doshambe\",\"Seshambe\",\"Ch\\xe6harshambe\",\"Panjshambe\",\"Jom'e\",\"Shambe\"],dayNamesShort:[\"Yek\",\"Do\",\"Se\",\"Ch\\xe6\",\"Panj\",\"Jom\",\"Sha\"],dayNamesMin:[\"Ye\",\"Do\",\"Se\",\"Ch\",\"Pa\",\"Jo\",\"Sh\"],digits:null,dateFormat:\"yyyy/mm/dd\",firstDay:6,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear);return 682*((e.year()-(e.year()>0?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,qs.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 n=this._validate(t,e,r,qs.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var i=t-(t>=0?474:473),a=474+bl(i,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*a-110)/2816)+365*(a-1)+1029983*Math.floor(i/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=bl(e,1029983),i=2820;if(1029982!==n){var a=Math.floor(n/366),o=bl(n,366);i=Math.floor((2134*a+2816*o+2815)/1028522)+a+1}var s=i+2820*r+474;s=s<=0?s-1:s;var l=t-this.toJD(s,1,1)+1,u=l<=186?Math.ceil(l/31):Math.ceil((l-6)/30),c=t-this.toJD(s,u,1)+1;return this.newDate(s,u,c)}}),qs.calendars.persian=xl,qs.calendars.jalali=xl;var _l=qs.instance();function wl(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}wl.prototype=new qs.baseCalendar,Us(wl.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,qs.local.invalidYear);t=this._t2gYear(e.year());return _l.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear);t=this._t2gYear(n.year());return _l.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,qs.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 n=this._validate(t,e,r,qs.local.invalidDate);t=this._t2gYear(n.year());return _l.toJD(t,n.month(),n.day())},fromJD:function(t){var e=_l.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)}}),qs.calendars.taiwan=wl;var Ml=qs.instance();function Al(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}Al.prototype=new qs.baseCalendar,Us(Al.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,qs.local.invalidYear);t=this._t2gYear(e.year());return Ml.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear);t=this._t2gYear(n.year());return Ml.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,qs.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 n=this._validate(t,e,r,qs.local.invalidDate);t=this._t2gYear(n.year());return Ml.toJD(t,n.month(),n.day())},fromJD:function(t){var e=Ml.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)}}),qs.calendars.thai=Al;function kl(t){this.local=this.regionalOptions[t||\"\"]||this.regionalOptions[\"\"]}kl.prototype=new qs.baseCalendar,Us(kl.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\\u0101th\\u0101\\u2019\",\"Yawm al-Arba\\u2018\\u0101\\u2019\",\"Yawm al-Kham\\u012bs\",\"Yawm al-Jum\\u2018a\",\"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,qs.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,qs.local.invalidMonth).toJD()-24e5+.5,n=0,i=0;i<Tl.length;i++){if(Tl[i]>r)return Tl[n]-Tl[n-1];n++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,qs.local.invalidDate),i=12*(n.year()-1)+n.month()-15292;return n.day()+Tl[i-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;n<Tl.length&&!(Tl[n]>e);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),o=a+1,s=i-12*a,l=e-Tl[r-1]+1;return this.newDate(o,s,l)},isValid:function(t,e,r){var n=qs.baseCalendar.prototype.isValid.apply(this,arguments);return n&&(n=(t=null!=t.year?t.year:t)>=1276&&t<=1500),n},_validate:function(t,e,r,n){var i=qs.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw n.replace(/\\{0\\}/,this.local.name);return i}}),qs.calendars.ummalqura=kl;var Tl=[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];Us(qs.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\"}),qs.local=qs.regionalOptions[\"\"],Us(qs.cdate.prototype,{formatDate:function(t,e){return\"string\"!=typeof t&&(e=t,t=\"\"),this._calendar.formatDate(t||\"\",this,e)}}),Us(qs.baseCalendar.prototype,{UNIX_EPOCH:qs.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:qs.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 qs.local.invalidFormat||qs.regionalOptions[\"\"].invalidFormat;t=t||this.local.dateFormat;for(var n,i,a,o,s=(r=r||{}).dayNamesShort||this.local.dayNamesShort,l=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,c=r.monthNamesShort||this.local.monthNamesShort,h=r.monthNames||this.local.monthNames,f=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;_+n<t.length&&t.charAt(_+n)===e;)n++;return _+=n-1,Math.floor(n/(r||1))>1}),p=function(t,e,r,n){var i=\"\"+e;if(f(t,n))for(;i.length<r;)i=\"0\"+i;return i},d=this,g=function(t){return\"function\"==typeof u?u.call(d,t,f(\"m\")):y(p(\"m\",t.month(),2))},v=function(t,e){return e?\"function\"==typeof h?h.call(d,t):h[t.month()-d.minMonth]:\"function\"==typeof c?c.call(d,t):c[t.month()-d.minMonth]},m=this.local.digits,y=function(t){return r.localNumbers&&m?m(t):t},x=\"\",b=!1,_=0;_<t.length;_++)if(b)\"'\"!==t.charAt(_)||f(\"'\")?x+=t.charAt(_):b=!1;else switch(t.charAt(_)){case\"d\":x+=y(p(\"d\",e.day(),2));break;case\"D\":x+=(n=\"D\",i=e.dayOfWeek(),a=s,o=l,f(n)?o[i]:a[i]);break;case\"o\":x+=p(\"o\",e.dayOfYear(),3);break;case\"w\":x+=p(\"w\",e.weekOfYear(),2);break;case\"m\":x+=g(e);break;case\"M\":x+=v(e,f(\"M\"));break;case\"y\":x+=f(\"y\",2)?e.year():(e.year()%100<10?\"0\":\"\")+e.year()%100;break;case\"Y\":f(\"Y\",2),x+=e.formatYear();break;case\"J\":x+=e.toJD();break;case\"@\":x+=(e.toJD()-this.UNIX_EPOCH)*this.SECS_PER_DAY;break;case\"!\":x+=(e.toJD()-this.TICKS_EPOCH)*this.TICKS_PER_DAY;break;case\"'\":f(\"'\")?x+=\"'\":b=!0;break;default:x+=t.charAt(_)}return x},parseDate:function(t,e,r){if(null==e)throw qs.local.invalidArguments||qs.regionalOptions[\"\"].invalidArguments;if(\"\"===(e=\"object\"==typeof e?e.toString():e+\"\"))return null;t=t||this.local.dateFormat;var n=(r=r||{}).shortYearCutoff||this.shortYearCutoff;n=\"string\"!=typeof n?n:this.today().year()%100+parseInt(n,10);for(var i=r.dayNamesShort||this.local.dayNamesShort,a=r.dayNames||this.local.dayNames,o=r.parseMonth||this.local.parseMonth,s=r.monthNumbers||this.local.monthNumbers,l=r.monthNamesShort||this.local.monthNamesShort,u=r.monthNames||this.local.monthNames,c=-1,h=-1,f=-1,p=-1,d=-1,g=!1,v=!1,m=function(e,r){for(var n=1;k+n<t.length&&t.charAt(k+n)===e;)n++;return k+=n-1,Math.floor(n/(r||1))>1},y=function(t,r){var n=m(t,r),i=[2,3,n?4:2,n?4:2,10,11,20][\"oyYJ@!\".indexOf(t)+1],a=new RegExp(\"^-?\\\\d{1,\"+i+\"}\"),o=e.substring(A).match(a);if(!o)throw(qs.local.missingNumberAt||qs.regionalOptions[\"\"].missingNumberAt).replace(/\\{0\\}/,A);return A+=o[0].length,parseInt(o[0],10)},x=this,b=function(){if(\"function\"==typeof s){m(\"m\");var t=s.call(x,e.substring(A));return A+=t.length,t}return y(\"m\")},_=function(t,r,n,i){for(var a=m(t,i)?n:r,o=0;o<a.length;o++)if(e.substr(A,a[o].length).toLowerCase()===a[o].toLowerCase())return A+=a[o].length,o+x.minMonth;throw(qs.local.unknownNameAt||qs.regionalOptions[\"\"].unknownNameAt).replace(/\\{0\\}/,A)},w=function(){if(\"function\"==typeof u){var t=m(\"M\")?u.call(x,e.substring(A)):l.call(x,e.substring(A));return A+=t.length,t}return _(\"M\",l,u)},M=function(){if(e.charAt(A)!==t.charAt(k))throw(qs.local.unexpectedLiteralAt||qs.regionalOptions[\"\"].unexpectedLiteralAt).replace(/\\{0\\}/,A);A++},A=0,k=0;k<t.length;k++)if(v)\"'\"!==t.charAt(k)||m(\"'\")?M():v=!1;else switch(t.charAt(k)){case\"d\":p=y(\"d\");break;case\"D\":_(\"D\",i,a);break;case\"o\":d=y(\"o\");break;case\"w\":y(\"w\");break;case\"m\":f=b();break;case\"M\":f=w();break;case\"y\":var T=k;g=!m(\"y\",2),k=T,h=y(\"y\",2);break;case\"Y\":h=y(\"Y\",2);break;case\"J\":c=y(\"J\")+.5,\".\"===e.charAt(A)&&(A++,y(\"J\"));break;case\"@\":c=y(\"@\")/this.SECS_PER_DAY+this.UNIX_EPOCH;break;case\"!\":c=y(\"!\")/this.TICKS_PER_DAY+this.TICKS_EPOCH;break;case\"*\":A=e.length;break;case\"'\":m(\"'\")?M():v=!0;break;default:M()}if(A<e.length)throw qs.local.unexpectedText||qs.regionalOptions[\"\"].unexpectedText;if(-1===h?h=this.today().year():h<100&&g&&(h+=-1===n?1900:this.today().year()-this.today().year()%100-(h<=n?0:100)),\"string\"==typeof f&&(f=o.call(this,h,f)),d>-1){f=1,p=d;for(var S=this.daysInMonth(h,f);p>S;S=this.daysInMonth(h,f))f++,p-=S}return c>-1?this.fromJD(c):this.newDate(h,f,p)},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)}});var Sl=qs,El=t.EPOCHJD,Cl=t.ONEDAY,Ll={valType:\"enumerated\",values:Object.keys(Sl.calendars),editType:\"calc\",dflt:\"gregorian\"},zl=function(t,e,r,n){var i={};return i[r]=Ll,ne.coerce(t,e,i,r,n)},Pl=\"##\",Il={d:{0:\"dd\",\"-\":\"d\"},e:{0:\"d\",\"-\":\"d\"},a:{0:\"D\",\"-\":\"D\"},A:{0:\"DD\",\"-\":\"DD\"},j:{0:\"oo\",\"-\":\"o\"},W:{0:\"ww\",\"-\":\"w\"},m:{0:\"mm\",\"-\":\"m\"},b:{0:\"M\",\"-\":\"M\"},B:{0:\"MM\",\"-\":\"MM\"},y:{0:\"yy\",\"-\":\"yy\"},Y:{0:\"yyyy\",\"-\":\"yyyy\"},U:Pl,w:Pl,c:{0:\"D M d %X yyyy\",\"-\":\"D M d %X yyyy\"},x:{0:\"mm/dd/yyyy\",\"-\":\"mm/dd/yyyy\"}};var Dl={};function Ol(t){var e=Dl[t];return e||(e=Dl[t]=Sl.instance(t))}function Rl(t){return ne.extendFlat({},Ll,{description:t})}function Fl(t){return\"Sets the calendar system to use with `\"+t+\"` date data.\"}var Bl={xcalendar:Rl(Fl(\"x\"))},Nl=ne.extendFlat({},Bl,{ycalendar:Rl(Fl(\"y\"))}),jl=ne.extendFlat({},Nl,{zcalendar:Rl(Fl(\"z\"))}),Vl=Rl([\"Sets the calendar system to use for `range` and `tick0`\",\"if this is a date axis. This does not set the calendar for\",\"interpreting data on this axis, that's specified in the trace\",\"or via the global `layout.calendar`\"].join(\" \")),Ul={moduleType:\"component\",name:\"calendars\",schema:{traces:{scatter:Nl,bar:Nl,box:Nl,heatmap:Nl,contour:Nl,histogram:Nl,histogram2d:Nl,histogram2dcontour:Nl,scatter3d:jl,surface:jl,mesh3d:jl,scattergl:Nl,ohlc:Bl,candlestick:Bl},layout:{calendar:Rl([\"Sets the default calendar system to use for interpreting and\",\"displaying dates throughout the plot.\"].join(\" \"))},subplots:{xaxis:{calendar:Vl},yaxis:{calendar:Vl},scene:{xaxis:{calendar:Vl},yaxis:{calendar:Vl},zaxis:{calendar:Vl}},polar:{radialaxis:{calendar:Vl}}},transforms:{filter:{valuecalendar:Rl([\"Sets the calendar system to use for `value`, if it is a date.\"].join(\" \")),targetcalendar:Rl([\"Sets the calendar system to use for `target`, if it is an\",\"array of dates. If `target` is a string (eg *x*) we use the\",\"corresponding trace attribute (eg `xcalendar`) if it exists,\",\"even if `targetcalendar` is provided.\"].join(\" \"))}}},layoutAttributes:Ll,handleDefaults:zl,handleTraceDefaults:function(t,e,r,n){for(var i=0;i<r.length;i++)zl(t,e,r[i]+\"calendar\",n.calendar)},CANONICAL_SUNDAY:{chinese:\"2000-01-02\",coptic:\"2000-01-03\",discworld:\"2000-01-03\",ethiopian:\"2000-01-05\",hebrew:\"5000-01-01\",islamic:\"1000-01-02\",julian:\"2000-01-03\",mayan:\"5000-01-01\",nanakshahi:\"1000-01-05\",nepali:\"2000-01-05\",persian:\"1000-01-01\",jalali:\"1000-01-01\",taiwan:\"1000-01-04\",thai:\"2000-01-04\",ummalqura:\"1400-01-06\"},CANONICAL_TICK:{chinese:\"2000-01-01\",coptic:\"2000-01-01\",discworld:\"2000-01-01\",ethiopian:\"2000-01-01\",hebrew:\"5000-01-01\",islamic:\"1000-01-01\",julian:\"2000-01-01\",mayan:\"5000-01-01\",nanakshahi:\"1000-01-01\",nepali:\"2000-01-01\",persian:\"1000-01-01\",jalali:\"1000-01-01\",taiwan:\"1000-01-01\",thai:\"2000-01-01\",ummalqura:\"1400-01-01\"},DFLTRANGE:{chinese:[\"2000-01-01\",\"2001-01-01\"],coptic:[\"1700-01-01\",\"1701-01-01\"],discworld:[\"1800-01-01\",\"1801-01-01\"],ethiopian:[\"2000-01-01\",\"2001-01-01\"],hebrew:[\"5700-01-01\",\"5701-01-01\"],islamic:[\"1400-01-01\",\"1401-01-01\"],julian:[\"2000-01-01\",\"2001-01-01\"],mayan:[\"5200-01-01\",\"5201-01-01\"],nanakshahi:[\"0500-01-01\",\"0501-01-01\"],nepali:[\"2000-01-01\",\"2001-01-01\"],persian:[\"1400-01-01\",\"1401-01-01\"],jalali:[\"1400-01-01\",\"1401-01-01\"],taiwan:[\"0100-01-01\",\"0101-01-01\"],thai:[\"2500-01-01\",\"2501-01-01\"],ummalqura:[\"1400-01-01\",\"1401-01-01\"]},getCal:Ol,worldCalFmt:function(t,e,r){for(var n,i,a,o,s,l=Math.floor((e+.05)/Cl)+El,u=Ol(r).fromJD(l),c=0;-1!==(c=t.indexOf(\"%\",c));)\"0\"===(n=t.charAt(c+1))||\"-\"===n||\"_\"===n?(a=3,i=t.charAt(c+2),\"_\"===n&&(n=\"-\")):(i=n,n=\"0\",a=2),(o=Il[i])?(s=o===Pl?Pl:u.formatDate(o[n]),t=t.substr(0,c)+s+t.substr(c+a),c+=s.length):c+=a;return t}},ql=ne.extendFlat,Hl=Ae.dash,Gl=Zr.line;function Wl(t){return{name:{valType:\"string\",editType:\"style\"},showlegend:{valType:\"boolean\",dflt:!0,editType:\"style\"},line:{color:ql({},Gl.color,{dflt:t}),width:Gl.width,dash:Hl,editType:\"style\"},editType:\"style\"}}var Yl={x:{valType:\"data_array\",editType:\"calc+clearAxisTypes\"},open:{valType:\"data_array\",dflt:[],editType:\"calc\"},high:{valType:\"data_array\",dflt:[],editType:\"calc\"},low:{valType:\"data_array\",dflt:[],editType:\"calc\"},close:{valType:\"data_array\",dflt:[],editType:\"calc\"},line:{width:ql({},Gl.width,{}),dash:ql({},Hl,{}),editType:\"style\"},increasing:Wl(\"#3D9970\"),decreasing:Wl(\"#FF4136\"),text:{valType:\"string\",dflt:\"\",arrayOk:!0,editType:\"calc\"},tickwidth:{valType:\"number\",min:0,max:.5,dflt:.3,editType:\"calcIfAutorange\"}},Xl=ne.extendFlat;function Zl(t){return{name:Yl.increasing.name,showlegend:Yl.increasing.showlegend,line:{color:Xl({},cs.line.color,{dflt:t}),width:cs.line.width,editType:\"style\"},fillcolor:cs.fillcolor,editType:\"style\"}}var Jl={x:Yl.x,open:Yl.open,high:Yl.high,low:Yl.low,close:Yl.close,line:{width:Xl({},cs.line.width,{}),editType:\"style\"},increasing:Zl(Yl.increasing.line.color.dflt),decreasing:Zl(Yl.decreasing.line.color.dflt),text:Yl.text,whiskerwidth:Xl({},cs.whiskerwidth,{dflt:0})},Kl=function(t,e,r,n){r(n+\".showlegend\"),!1===t.showlegend&&(e[n].showlegend=!1),r(n+\".name\",e.name+\" - \"+n)},Ql={};Ql.pushDummyTransformOpts=function(t,e){var r={type:e.type,_ephemeral:!0};Array.isArray(t.transforms)?t.transforms.push(r):t.transforms=[r]},Ql.clearEphemeralTransformOpts=function(t){var e=t.transforms;if(Array.isArray(e)){for(var r=0;r<e.length;r++)e[r]._ephemeral&&e.splice(r,1);0===e.length&&delete t.transforms}},Ql.copyOHLC=function(t,e){t.open&&(e.open=t.open),t.high&&(e.high=t.high),t.low&&(e.low=t.low),t.close&&(e.close=t.close)},Ql.makeTransform=function(t,e,r){var n=ne.extendFlat([],t.transforms);return n[e.transformIndex]={type:t.type,direction:r,open:t.open,high:t.high,low:t.low,close:t.close},n},Ql.getFilterFn=function(t){return new function(t){var e=!0,n=null;function i(t,r){return t===r?r>n?e=!0:r<n&&(e=!1):e=t<r,n=r,e}return\"increasing\"===t?function(t,e){return r(t)&&r(e)&&i(+t,+e)}:function(t,e){return r(t)&&r(e)&&!i(+t,+e)}}(t)},Ql.addRangeSlider=function(t,e){for(var r=!1,n=0;n<t.length;n++)if(!0===t[n].visible){r=!0;break}r&&(e.xaxis||(e.xaxis={}),e.xaxis.rangeslider||(e.xaxis.rangeslider={}))};var $l=function(t,e,r,n){var i,a=r(\"x\"),o=r(\"open\"),s=r(\"high\"),l=r(\"low\"),u=r(\"close\");return P.getComponentMethod(\"calendars\",\"handleTraceDefaults\")(t,e,[\"x\"],n),i=Math.min(o.length,s.length,l.length,u.length),a&&(i=Math.min(i,a.length))<a.length&&(e.x=a.slice(0,i)),i<o.length&&(e.open=o.slice(0,i)),i<s.length&&(e.high=s.slice(0,i)),i<l.length&&(e.low=l.slice(0,i)),i<u.length&&(e.close=u.slice(0,i)),i};function tu(t,e,r,n){Kl(t,e,r,n),r(n+\".line.color\"),r(n+\".line.width\",e.line.width),r(n+\".fillcolor\")}var eu={};function ru(t,e,r){var n={type:\"box\",boxpoints:!1,visible:t.visible,hoverinfo:t.hoverinfo,opacity:t.opacity,xaxis:t.xaxis,yaxis:t.yaxis,transforms:Ql.makeTransform(t,e,r)},i=t[r];return i&&ne.extendFlat(n,{x:t.x||[0],xcalendar:t.xcalendar,y:[].concat(t.low).concat(t.high),whiskerwidth:t.whiskerwidth,text:t.text,name:i.name,showlegend:i.showlegend,line:i.line,fillcolor:i.fillcolor}),n}eu.moduleType=\"transform\",eu.name=\"candlestick\",eu.attributes={},eu.supplyDefaults=function(t,e,r,n){return Ql.clearEphemeralTransformOpts(n),Ql.copyOHLC(t,e),t},eu.transform=function(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n];\"candlestick\"===i.type?r.push(ru(i,e,\"increasing\"),ru(i,e,\"decreasing\")):r.push(i)}return Ql.addRangeSlider(r,e.layout),r},eu.calcTransform=function(t,e,n){for(var i,a,o,s,l=n.direction,u=Ql.getFilterFn(l),c=e.open,h=e.high,f=e.low,p=e.close,d=c.length,g=[],v=[],m=e._fullInput.x?function(t){var r=e.x[t];g.push(r,r,r,r,r,r)}:function(t){g.push(t,t,t,t,t,t)},y=0;y<d;y++)u(c[y],p[y])&&r(h[y])&&r(f[y])&&(m(y),i=c[y],a=h[y],o=f[y],s=p[y],v.push(o,i,s,s,s,a));e.x=g,e.y=v};var nu={moduleType:\"trace\",name:\"candlestick\",basePlotModule:ua,categories:[\"cartesian\",\"showLegend\",\"candlestick\"],meta:{},attributes:Jl,supplyDefaults:function(t,e,r,n){function i(r,n){return ne.coerce(t,e,Jl,r,n)}Ql.pushDummyTransformOpts(t,e),0!==$l(t,e,i,n)?(i(\"line.width\"),tu(t,e,i,\"increasing\"),tu(t,e,i,\"decreasing\"),i(\"text\"),i(\"whiskerwidth\")):e.visible=!1}};P.register(Fs),P.register(eu);var iu=nu,au=ye.overrideAll,ou={color:{valType:\"color\",editType:\"calc\"},smoothing:{valType:\"number\",dflt:1,min:0,max:1.3,editType:\"calc\"},title:{valType:\"string\",editType:\"calc\"},titlefont:T({editType:\"calc\"}),titleoffset:{valType:\"number\",dflt:10,editType:\"calc\"},type:{valType:\"enumerated\",values:[\"-\",\"linear\",\"date\",\"category\"],dflt:\"-\",editType:\"calc\"},autorange:{valType:\"enumerated\",values:[!0,!1,\"reversed\"],dflt:!0,editType:\"calc\"},rangemode:{valType:\"enumerated\",values:[\"normal\",\"tozero\",\"nonnegative\"],dflt:\"normal\",editType:\"calc\"},range:{valType:\"info_array\",editType:\"calc\",items:[{valType:\"any\",editType:\"calc\"},{valType:\"any\",editType:\"calc\"}]},fixedrange:{valType:\"boolean\",dflt:!1,editType:\"calc\"},cheatertype:{valType:\"enumerated\",values:[\"index\",\"value\"],dflt:\"value\",editType:\"calc\"},tickmode:{valType:\"enumerated\",values:[\"linear\",\"array\"],dflt:\"array\",editType:\"calc\"},nticks:{valType:\"integer\",min:0,dflt:0,editType:\"calc\"},tickvals:{valType:\"data_array\",editType:\"calc\"},ticktext:{valType:\"data_array\",editType:\"calc\"},showticklabels:{valType:\"enumerated\",values:[\"start\",\"end\",\"both\",\"none\"],dflt:\"start\",editType:\"calc\"},tickfont:T({editType:\"calc\"}),tickangle:{valType:\"angle\",dflt:\"auto\",editType:\"calc\"},tickprefix:{valType:\"string\",dflt:\"\",editType:\"calc\"},showtickprefix:{valType:\"enumerated\",values:[\"all\",\"first\",\"last\",\"none\"],dflt:\"all\",editType:\"calc\"},ticksuffix:{valType:\"string\",dflt:\"\",editType:\"calc\"},showticksuffix:{valType:\"enumerated\",values:[\"all\",\"first\",\"last\",\"none\"],dflt:\"all\",editType:\"calc\"},showexponent:{valType:\"enumerated\",values:[\"all\",\"first\",\"last\",\"none\"],dflt:\"all\",editType:\"calc\"},exponentformat:{valType:\"enumerated\",values:[\"none\",\"e\",\"E\",\"power\",\"SI\",\"B\"],dflt:\"B\",editType:\"calc\"},separatethousands:{valType:\"boolean\",dflt:!1,editType:\"calc\"},tickformat:{valType:\"string\",dflt:\"\",editType:\"calc\"},tickformatstops:au(Ce.tickformatstops,\"calc\",\"from-root\"),categoryorder:{valType:\"enumerated\",values:[\"trace\",\"category ascending\",\"category descending\",\"array\"],dflt:\"trace\",editType:\"calc\"},categoryarray:{valType:\"data_array\",editType:\"calc\"},labelpadding:{valType:\"integer\",dflt:10,editType:\"calc\"},labelprefix:{valType:\"string\",editType:\"calc\"},labelsuffix:{valType:\"string\",dflt:\"\",editType:\"calc\"},showline:{valType:\"boolean\",dflt:!1,editType:\"calc\"},linecolor:{valType:\"color\",dflt:C.defaultLine,editType:\"calc\"},linewidth:{valType:\"number\",min:0,dflt:1,editType:\"calc\"},gridcolor:{valType:\"color\",editType:\"calc\"},gridwidth:{valType:\"number\",min:0,dflt:1,editType:\"calc\"},showgrid:{valType:\"boolean\",dflt:!0,editType:\"calc\"},minorgridcount:{valType:\"integer\",min:0,dflt:0,editType:\"calc\"},minorgridwidth:{valType:\"number\",min:0,dflt:1,editType:\"calc\"},minorgridcolor:{valType:\"color\",dflt:C.lightLine,editType:\"calc\"},startline:{valType:\"boolean\",editType:\"calc\"},startlinecolor:{valType:\"color\",editType:\"calc\"},startlinewidth:{valType:\"number\",dflt:1,editType:\"calc\"},endline:{valType:\"boolean\",editType:\"calc\"},endlinewidth:{valType:\"number\",dflt:1,editType:\"calc\"},endlinecolor:{valType:\"color\",editType:\"calc\"},tick0:{valType:\"number\",min:0,dflt:0,editType:\"calc\"},dtick:{valType:\"number\",min:0,dflt:1,editType:\"calc\"},arraytick0:{valType:\"integer\",min:0,dflt:0,editType:\"calc\"},arraydtick:{valType:\"integer\",min:1,dflt:1,editType:\"calc\"},editType:\"calc\"},su=T({editType:\"calc\"});su.family.dflt='\"Open Sans\", verdana, arial, sans-serif',su.size.dflt=12,su.color.dflt=C.defaultLine;var lu={carpet:{valType:\"string\",editType:\"calc\"},x:{valType:\"data_array\",editType:\"calc+clearAxisTypes\"},y:{valType:\"data_array\",editType:\"calc+clearAxisTypes\"},a:{valType:\"data_array\",editType:\"calc\"},a0:{valType:\"number\",dflt:0,editType:\"calc\"},da:{valType:\"number\",dflt:1,editType:\"calc\"},b:{valType:\"data_array\",editType:\"calc\"},b0:{valType:\"number\",dflt:0,editType:\"calc\"},db:{valType:\"number\",dflt:1,editType:\"calc\"},cheaterslope:{valType:\"number\",dflt:1,editType:\"calc\"},aaxis:ou,baxis:ou,font:su,color:{valType:\"color\",dflt:C.defaultLine,editType:\"plot\"}},uu=ne.isArrayOrTypedArray,cu=function(t){return function t(e,r){if(!uu(e)||r>=10)return null;var n=1/0;var i=-1/0;var a=e.length;for(var o=0;o<a;o++){var s=e[o];if(uu(s)){var l=t(s,r+1);l&&(n=Math.min(l[0],n),i=Math.max(l[1],i))}else n=Math.min(s,n),i=Math.max(s,i)}return[n,i]}(t,0)};var hu=m.extendFlat,fu=function(t,e,r,n){var i,a,o,s,l,u,c,h,f,p,d,g,v,m,y=t[r],x=t[r+\"axis\"],b=x._gridlines=[],_=x._minorgridlines=[],w=x._boundarylines=[],M=t[n],A=t[n+\"axis\"];\"array\"===x.tickmode&&(x.tickvals=y.slice());var k=t.xctrl,T=t.yctrl,S=k[0].length,E=k.length,C=t.a.length,L=t.b.length;ri.prepTicks(x),\"array\"===x.tickmode&&delete x.tickvals;var z=x.smoothing?3:1;function P(e){var i,a,o,s,l,u,c,f,p,d,g,v,m=[],y=[],b={};if(\"b\"===r)for(a=t.b2j(e),o=Math.floor(Math.max(0,Math.min(L-2,a))),s=a-o,b.length=L,b.crossLength=C,b.xy=function(e){return t.evalxy([],e,a)},b.dxy=function(e,r){return t.dxydi([],e,o,r,s)},i=0;i<C;i++)u=Math.min(C-2,i),c=i-u,f=t.evalxy([],i,a),A.smoothing&&i>0&&(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(e),u=Math.floor(Math.max(0,Math.min(C-2,i))),c=i-u,b.length=C,b.crossLength=L,b.xy=function(e){return t.evalxy([],i,e)},b.dxy=function(e,r){return t.dxydj([],u,e,c,r)},a=0;a<L;a++)o=Math.min(L-2,a),s=a-o,f=t.evalxy([],i,a),A.smoothing&&a>0&&(g=t.dxydj([],u,a-1,c,0),m.push(l[0]+g[0]/3),y.push(l[1]+g[1]/3),v=t.dxydj([],u,a-1,c,1),m.push(f[0]-v[0]/3),y.push(f[1]-v[1]/3)),m.push(f[0]),y.push(f[1]),l=f;return b.axisLetter=r,b.axis=x,b.crossAxis=A,b.value=e,b.constvar=n,b.index=h,b.x=m,b.y=y,b.smoothing=A.smoothing,b}function I(e){var i,a,o,s,l,u=[],c=[],h={};if(h.length=y.length,h.crossLength=M.length,\"b\"===r)for(o=Math.max(0,Math.min(L-2,e)),l=Math.min(1,Math.max(0,e-o)),h.xy=function(r){return t.evalxy([],r,e)},h.dxy=function(e,r){return t.dxydi([],e,o,r,l)},i=0;i<S;i++)u[i]=k[e*z][i],c[i]=T[e*z][i];else for(a=Math.max(0,Math.min(C-2,e)),s=Math.min(1,Math.max(0,e-a)),h.xy=function(r){return t.evalxy([],e,r)},h.dxy=function(e,r){return t.dxydj([],a,e,s,r)},i=0;i<E;i++)u[i]=k[i][e*z],c[i]=T[i][e*z];return h.axisLetter=r,h.axis=x,h.crossAxis=A,h.value=y[e],h.constvar=n,h.index=e,h.x=u,h.y=c,h.smoothing=A.smoothing,h}if(\"array\"===x.tickmode){for(s=5e-15,u=(l=[Math.floor((y.length-1-x.arraytick0)/x.arraydtick*(1+s)),Math.ceil(-x.arraytick0/x.arraydtick/(1+s))].sort(function(t,e){return t-e}))[0]-1,c=l[1]+1,h=u;h<c;h++)(a=x.arraytick0+x.arraydtick*h)<0||a>y.length-1||b.push(hu(I(a),{color:x.gridcolor,width:x.gridwidth}));for(h=u;h<c;h++)if(o=x.arraytick0+x.arraydtick*h,d=Math.min(o+x.arraydtick,y.length-1),!(o<0||o>y.length-1||d<0||d>y.length-1))for(g=y[o],v=y[d],i=0;i<x.minorgridcount;i++)(m=d-o)<=0||(p=g+(v-g)*(i+1)/(x.minorgridcount+1)*(x.arraydtick/m))<y[0]||p>y[y.length-1]||_.push(hu(P(p),{color:x.minorgridcolor,width:x.minorgridwidth}));x.startline&&w.push(hu(I(0),{color:x.startlinecolor,width:x.startlinewidth})),x.endline&&w.push(hu(I(y.length-1),{color:x.endlinecolor,width:x.endlinewidth}))}else{for(s=5e-15,u=(l=[Math.floor((y[y.length-1]-x.tick0)/x.dtick*(1+s)),Math.ceil((y[0]-x.tick0)/x.dtick/(1+s))].sort(function(t,e){return t-e}))[0],c=l[1],h=u;h<=c;h++)f=x.tick0+x.dtick*h,b.push(hu(P(f),{color:x.gridcolor,width:x.gridwidth}));for(h=u-1;h<c+1;h++)for(f=x.tick0+x.dtick*h,i=0;i<x.minorgridcount;i++)(p=f+x.dtick*(i+1)/(x.minorgridcount+1))<y[0]||p>y[y.length-1]||_.push(hu(P(p),{color:x.minorgridcolor,width:x.minorgridwidth}));x.startline&&w.push(hu(P(y[0]),{color:x.startlinecolor,width:x.startlinewidth})),x.endline&&w.push(hu(P(y[y.length-1]),{color:x.endlinecolor,width:x.endlinewidth}))}},pu=m.extendFlat,du=function(t,e){var r,n,i,a=e._labels=[],o=e._gridlines;for(r=0;r<o.length;r++)i=o[r],-1!==[\"start\",\"both\"].indexOf(e.showticklabels)&&(n=ri.tickText(e,i.value),pu(n,{prefix:void 0,suffix:void 0,endAnchor:!0,xy:i.xy(0),dxy:i.dxy(0,0),axis:i.axis,length:i.crossAxis.length,font:i.axis.tickfont,isFirst:0===r,isLast:r===o.length-1}),a.push(n)),-1!==[\"end\",\"both\"].indexOf(e.showticklabels)&&(n=ri.tickText(e,i.value),pu(n,{endAnchor:!1,xy:i.xy(i.crossLength-1),dxy:i.dxy(i.crossLength-2,1),axis:i.axis,length:i.crossAxis.length,font:i.axis.tickfont,isFirst:0===r,isLast:r===o.length-1}),a.push(n))},gu=ne.isArrayOrTypedArray,vu=ne.isArrayOrTypedArray,mu=function(t,e,r){var n,i;for(Array.isArray(t)?t.length>e.length&&(t=t.slice(0,e.length)):t=[],n=0;n<e.length;n++)for(vu(t[n])?t[n].length>e.length&&(t[n]=t[n].slice(0,e.length)):t[n]=[],i=0;i<e[0].length;i++)t[n][i]=r(e[n][i]);return t},yu=function(t,e,r){var n,i,a,o=[],s=[],l=t[0].length,u=t.length;function c(e,r){var n,i=0,a=0;return e>0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e<l-1&&void 0!==(n=t[r][e+1])&&(a++,i+=n),r>0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r<u-1&&void 0!==(n=t[r+1][e])&&(a++,i+=n),i/Math.max(1,a)}var h,f,p,d,g,v,m,y,x,b,_,w=0;for(n=0;n<l;n++)for(i=0;i<u;i++)void 0===t[i][n]&&(o.push(n),s.push(i),t[i][n]=c(n,i)),w=Math.max(w,Math.abs(t[i][n]));if(!o.length)return t;var M=0,A=0,k=o.length;do{for(M=0,a=0;a<k;a++){n=o[a],i=s[a];var T,S,E,C,L,z,P=0,I=0;0===n?(E=e[L=Math.min(l-1,2)],C=e[1],T=t[i][L],I+=(S=t[i][1])+(S-T)*(e[0]-C)/(C-E),P++):n===l-1&&(E=e[L=Math.max(0,l-3)],C=e[l-2],T=t[i][L],I+=(S=t[i][l-2])+(S-T)*(e[l-1]-C)/(C-E),P++),(0===n||n===l-1)&&i>0&&i<u-1&&(h=r[i+1]-r[i],I+=((f=r[i]-r[i-1])*t[i+1][n]+h*t[i-1][n])/(f+h),P++),0===i?(E=r[z=Math.min(u-1,2)],C=r[1],T=t[z][n],I+=(S=t[1][n])+(S-T)*(r[0]-C)/(C-E),P++):i===u-1&&(E=r[z=Math.max(0,u-3)],C=r[u-2],T=t[z][n],I+=(S=t[u-2][n])+(S-T)*(r[u-1]-C)/(C-E),P++),(0===i||i===u-1)&&n>0&&n<l-1&&(h=e[n+1]-e[n],I+=((f=e[n]-e[n-1])*t[i][n+1]+h*t[i][n-1])/(f+h),P++),P?I/=P:(p=e[n+1]-e[n],d=e[n]-e[n-1],y=(g=r[i+1]-r[i])*(v=r[i]-r[i-1])*(g+v),I=((m=p*d*(p+d))*(v*t[i+1][n]+g*t[i-1][n])+y*(d*t[i][n+1]+p*t[i][n-1]))/(y*(d+p)+m*(v+g))),M+=(b=(x=I-t[i][n])/w)*b,_=P?0:.85,t[i][n]+=x*(1+_)}M=Math.sqrt(M)}while(A++<100&&M>1e-5);return ne.log(\"Smoother converged to\",M,\"after\",A,\"iterations\"),t},xu=function(t,e){var n,i,a,o,s,l;function u(t){if(r(t))return+t}if(e){for(n=0,s=0;s<t.length;s++)n=Math.max(n,t[s].length);if(0===n)return!1;a=function(t){return t.length},o=function(t,e,r){return t[r][e]}}else n=t.length,a=function(t,e){return t[e].length},o=function(t,e,r){return t[e][r]};var c=new Array(n);for(s=0;s<n;s++)for(i=a(t,s),c[s]=new Array(i),l=0;l<i;l++)c[s][l]=u(o(t,s,l));return c},bu=Oe.addOpacity,_u=function(t,e,r){var n=r.letter,i=r.font||{},a=lu[n+\"axis\"];function o(r,n){return ne.coerce(t,e,a,r,n)}function s(r,n){return ne.coerce2(t,e,a,r,n)}r.name&&(e._name=r.name,e._id=r.name);var l=o(\"type\");(\"-\"===l&&(r.data&&function(t,e){if(\"-\"!==t.type)return;var r=t._id.charAt(0),n=t[r+\"calendar\"];t.type=Yn(e,n)}(e,r.data),\"-\"===e.type?e.type=\"linear\":l=t.type=e.type),o(\"smoothing\"),o(\"cheatertype\"),o(\"showticklabels\"),o(\"labelprefix\",n+\" = \"),o(\"labelsuffix\"),o(\"showtickprefix\"),o(\"showticksuffix\"),o(\"separatethousands\"),o(\"tickformat\"),o(\"exponentformat\"),o(\"showexponent\"),o(\"categoryorder\"),o(\"tickmode\"),o(\"tickvals\"),o(\"ticktext\"),o(\"tick0\"),o(\"dtick\"),\"array\"===e.tickmode&&(o(\"arraytick0\"),o(\"arraydtick\")),o(\"labelpadding\"),e._hovertitle=n,\"date\"===l)&&P.getComponentMethod(\"calendars\",\"handleDefaults\")(t,e,\"calendar\",r.calendar);ei(e,r.fullLayout);var u=o(\"color\",r.dfltColor),c=u===t.color?u:i.color;o(\"title\"),ne.coerceFont(o,\"titlefont\",{family:i.family,size:Math.round(1.2*i.size),color:c}),o(\"titleoffset\"),o(\"tickangle\"),o(\"autorange\",!e.isValidRange(t.range))&&o(\"rangemode\"),o(\"range\"),e.cleanRange(),o(\"fixedrange\"),Ge(t,e,o,l),Ue(t,e,o,l,r),Wi(t,e,o);var h=s(\"gridcolor\",bu(u,.3)),f=s(\"gridwidth\"),p=o(\"showgrid\");p||(delete e.gridcolor,delete e.gridwidth);var d=s(\"startlinecolor\",u),g=s(\"startlinewidth\",f);o(\"startline\",e.showgrid||!!d||!!g)||(delete e.startlinecolor,delete e.startlinewidth);var v=s(\"endlinecolor\",u),m=s(\"endlinewidth\",f);return o(\"endline\",e.showgrid||!!v||!!m)||(delete e.endlinecolor,delete e.endlinewidth),p?(o(\"minorgridcount\"),o(\"minorgridwidth\",f),o(\"minorgridcolor\",bu(h,.06)),e.minorgridcount||(delete e.minorgridwidth,delete e.minorgridcolor)):(delete e.gridcolor,delete e.gridWidth),e._initialCategories=\"category\"===l?Ki(n,e.categoryorder,e.categoryarray,r.data):[],\"none\"===e.showticklabels&&(delete e.tickfont,delete e.tickangle,delete e.showexponent,delete e.exponentformat,delete e.tickformat,delete e.showticksuffix,delete e.showtickprefix),e.showticksuffix||delete e.ticksuffix,e.showtickprefix||delete e.tickprefix,o(\"tickmode\"),(!e.title||e.title&&0===e.title.length)&&(delete e.titlefont,delete e.titleoffset),e};var wu=function(t,e,r,n,i){n(\"a\")||(n(\"da\"),n(\"a0\")),n(\"b\")||(n(\"db\"),n(\"b0\")),function(t,e,r,n){[\"aaxis\",\"baxis\"].forEach(function(i){var a=i.charAt(0),o=t[i]||{},s={},l={tickfont:\"x\",id:a+\"axis\",letter:a,font:e.font,name:i,data:t[a],calendar:e.calendar,dfltColor:n,bgColor:r.paper_bgcolor,fullLayout:r};_u(o,s,l),s._categories=s._categories||[],e[i]=s,t[i]||\"-\"===o.type||(t[i]={type:o.type})})}(t,e,r,i)};var Mu=function(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),u=Math.pow(o*o+s*s,.25),c=(u*u*i-l*l*o)*n,h=(u*u*a-l*l*s)*n,f=u*(l+u)*3,p=l*(l+u)*3;return[[e[0]+(f&&c/f),e[1]+(f&&h/f)],[e[0]-(p&&c/p),e[1]-(p&&h/p)]]},Au=ne.ensureArray;function ku(t,e,r){var n=-.5*r[0]+1.5*e[0],i=-.5*r[1]+1.5*e[1];return[(2*n+t[0])/3,(2*i+t[1])/3]}var Tu=1e-6,Su=Wt.findBin,Eu=function(t){var e=t.a,r=t.b,n=t.a.length,i=t.b.length,a=t.aaxis,o=t.baxis,s=e[0],l=e[n-1],u=r[0],c=r[i-1],h=e[e.length-1]-e[0],f=r[r.length-1]-r[0],p=h*Tu,d=f*Tu;s-=p,l+=p,u-=d,c+=d,t.isVisible=function(t,e){return t>s&&t<l&&e>u&&e<c},t.isOccluded=function(t,e){return t<s||t>l||e<u||e>c},a.c2p=function(t){return t},o.c2p=function(t){return t},t.setScale=function(){var e,r,s,l=t._x,u=t._y,c=function(t,e,r,n,i,a){var o,s,l,u,c,h,f,p,d,g,v=r[0].length,m=r.length,y=i?3*v-2:v,x=a?3*m-2:m;for(t=Au(t,x),e=Au(e,x),l=0;l<x;l++)t[l]=Au(t[l],y),e[l]=Au(e[l],y);for(s=0,u=0;s<m;s++,u+=a?3:1)for(c=t[u],h=e[u],f=r[s],p=n[s],o=0,l=0;o<v;o++,l+=i?3:1)c[l]=f[o],h[l]=p[o];if(i)for(s=0,u=0;s<m;s++,u+=a?3:1){for(o=1,l=3;o<v-1;o++,l+=3)d=Mu([r[s][o-1],n[s][o-1]],[r[s][o],n[s][o]],[r[s][o+1],n[s][o+1]],i),t[u][l-1]=d[0][0],e[u][l-1]=d[0][1],t[u][l+1]=d[1][0],e[u][l+1]=d[1][1];g=ku([t[u][0],e[u][0]],[t[u][2],e[u][2]],[t[u][3],e[u][3]]),t[u][1]=g[0],e[u][1]=g[1],g=ku([t[u][y-1],e[u][y-1]],[t[u][y-3],e[u][y-3]],[t[u][y-4],e[u][y-4]]),t[u][y-2]=g[0],e[u][y-2]=g[1]}if(a)for(l=0;l<y;l++){for(u=3;u<x-3;u+=3)d=Mu([t[u-3][l],e[u-3][l]],[t[u][l],e[u][l]],[t[u+3][l],e[u+3][l]],a),t[u-1][l]=d[0][0],e[u-1][l]=d[0][1],t[u+1][l]=d[1][0],e[u+1][l]=d[1][1];g=ku([t[0][l],e[0][l]],[t[2][l],e[2][l]],[t[3][l],e[3][l]]),t[1][l]=g[0],e[1][l]=g[1],g=ku([t[x-1][l],e[x-1][l]],[t[x-3][l],e[x-3][l]],[t[x-4][l],e[x-4][l]]),t[x-2][l]=g[0],e[x-2][l]=g[1]}if(i&&a)for(u=1;u<x;u+=(u+1)%3==0?2:1){for(l=3;l<y-3;l+=3)d=Mu([t[u][l-3],e[u][l-3]],[t[u][l],e[u][l]],[t[u][l+3],e[u][l+3]],i),t[u][l-1]=.5*(t[u][l-1]+d[0][0]),e[u][l-1]=.5*(e[u][l-1]+d[0][1]),t[u][l+1]=.5*(t[u][l+1]+d[1][0]),e[u][l+1]=.5*(e[u][l+1]+d[1][1]);g=ku([t[u][0],e[u][0]],[t[u][2],e[u][2]],[t[u][3],e[u][3]]),t[u][1]=.5*(t[u][1]+g[0]),e[u][1]=.5*(e[u][1]+g[1]),g=ku([t[u][y-1],e[u][y-1]],[t[u][y-3],e[u][y-3]],[t[u][y-4],e[u][y-4]]),t[u][y-2]=.5*(t[u][y-2]+g[0]),e[u][y-2]=.5*(e[u][y-2]+g[1])}return[t,e]}(t.xctrl,t.yctrl,l,u,a.smoothing,o.smoothing);t.xctrl=c[0],t.yctrl=c[1],t.evalxy=function(t,e,r,n,i){var a=e-2,o=r-2;return n&&i?function(e,r,n){var i,s,l,u,c,h;e||(e=[]);var f=Math.max(0,Math.min(Math.floor(r),a)),p=Math.max(0,Math.min(Math.floor(n),o)),d=Math.max(0,Math.min(1,r-f)),g=Math.max(0,Math.min(1,n-p));f*=3,p*=3;var v=d*d,m=v*d,y=1-d,x=y*y,b=x*y,_=g*g,w=_*g,M=1-g,A=M*M,k=A*M;for(h=0;h<t.length;h++)i=b*(c=t[h])[p][f]+3*(x*d*c[p][f+1]+y*v*c[p][f+2])+m*c[p][f+3],s=b*c[p+1][f]+3*(x*d*c[p+1][f+1]+y*v*c[p+1][f+2])+m*c[p+1][f+3],l=b*c[p+2][f]+3*(x*d*c[p+2][f+1]+y*v*c[p+2][f+2])+m*c[p+2][f+3],u=b*c[p+3][f]+3*(x*d*c[p+3][f+1]+y*v*c[p+3][f+2])+m*c[p+3][f+3],e[h]=k*i+3*(A*g*s+M*_*l)+w*u;return e}:n?function(e,r,n){e||(e=[]);var i,s,l,u,c,h,f=Math.max(0,Math.min(Math.floor(r),a)),p=Math.max(0,Math.min(Math.floor(n),o)),d=Math.max(0,Math.min(1,r-f)),g=Math.max(0,Math.min(1,n-p));f*=3;var v=d*d,m=v*d,y=1-d,x=y*y,b=x*y,_=1-g;for(c=0;c<t.length;c++)i=_*(h=t[c])[p][f]+g*h[p+1][f],s=_*h[p][f+1]+g*h[p+1][f+1],l=_*h[p][f+2]+g*h[p+1][f+1],u=_*h[p][f+3]+g*h[p+1][f+1],e[c]=b*i+3*(x*d*s+y*v*l)+m*u;return e}:i?function(e,r,n){e||(e=[]);var i,s,l,u,c,h,f=Math.max(0,Math.min(Math.floor(r),a)),p=Math.max(0,Math.min(Math.floor(n),o)),d=Math.max(0,Math.min(1,r-f)),g=Math.max(0,Math.min(1,n-p));p*=3;var v=g*g,m=v*g,y=1-g,x=y*y,b=x*y,_=1-d;for(c=0;c<t.length;c++)i=_*(h=t[c])[p][f]+d*h[p][f+1],s=_*h[p+1][f]+d*h[p+1][f+1],l=_*h[p+2][f]+d*h[p+2][f+1],u=_*h[p+3][f]+d*h[p+3][f+1],e[c]=b*i+3*(x*g*s+y*v*l)+m*u;return e}:function(e,r,n){e||(e=[]);var i,s,l,u,c=Math.max(0,Math.min(Math.floor(r),a)),h=Math.max(0,Math.min(Math.floor(n),o)),f=Math.max(0,Math.min(1,r-c)),p=Math.max(0,Math.min(1,n-h)),d=1-p,g=1-f;for(l=0;l<t.length;l++)i=g*(u=t[l])[h][c]+f*u[h][c+1],s=g*u[h+1][c]+f*u[h+1][c+1],e[l]=d*i+p*s;return e}}([t.xctrl,t.yctrl],n,i,a.smoothing,o.smoothing),t.dxydi=(e=[t.xctrl,t.yctrl],r=a.smoothing,s=o.smoothing,r&&s?function(t,r,n,i,a){var o,s,l,u,c,h;t||(t=[]),r*=3,n*=3;var f=i*i,p=1-i,d=p*p,g=p*i*2,v=-3*d,m=3*(d-g),y=3*(g-f),x=3*f,b=a*a,_=b*a,w=1-a,M=w*w,A=M*w;for(h=0;h<e.length;h++)o=v*(c=e[h])[n][r]+m*c[n][r+1]+y*c[n][r+2]+x*c[n][r+3],s=v*c[n+1][r]+m*c[n+1][r+1]+y*c[n+1][r+2]+x*c[n+1][r+3],l=v*c[n+2][r]+m*c[n+2][r+1]+y*c[n+2][r+2]+x*c[n+2][r+3],u=v*c[n+3][r]+m*c[n+3][r+1]+y*c[n+3][r+2]+x*c[n+3][r+3],t[h]=A*o+3*(M*a*s+w*b*l)+_*u;return t}:r?function(t,r,n,i,a){var o,s,l,u;t||(t=[]),r*=3;var c=i*i,h=1-i,f=h*h,p=h*i*2,d=-3*f,g=3*(f-p),v=3*(p-c),m=3*c,y=1-a;for(l=0;l<e.length;l++)o=d*(u=e[l])[n][r]+g*u[n][r+1]+v*u[n][r+2]+m*u[n][r+3],s=d*u[n+1][r]+g*u[n+1][r+1]+v*u[n+1][r+2]+m*u[n+1][r+3],t[l]=y*o+a*s;return t}:s?function(t,r,n,i,a){var o,s,l,u,c,h;t||(t=[]),n*=3;var f=a*a,p=f*a,d=1-a,g=d*d,v=g*d;for(c=0;c<e.length;c++)o=(h=e[c])[n][r+1]-h[n][r],s=h[n+1][r+1]-h[n+1][r],l=h[n+2][r+1]-h[n+2][r],u=h[n+3][r+1]-h[n+3][r],t[c]=v*o+3*(g*a*s+d*f*l)+p*u;return t}:function(t,r,n,i,a){var o,s,l,u;t||(t=[]);var c=1-a;for(l=0;l<e.length;l++)o=(u=e[l])[n][r+1]-u[n][r],s=u[n+1][r+1]-u[n+1][r],t[l]=c*o+a*s;return t}),t.dxydj=function(t,e,r){return e&&r?function(e,r,n,i,a){var o,s,l,u,c,h;e||(e=[]),r*=3,n*=3;var f=i*i,p=f*i,d=1-i,g=d*d,v=g*d,m=a*a,y=1-a,x=y*y,b=y*a*2,_=-3*x,w=3*(x-b),M=3*(b-m),A=3*m;for(h=0;h<t.length;h++)o=_*(c=t[h])[n][r]+w*c[n+1][r]+M*c[n+2][r]+A*c[n+3][r],s=_*c[n][r+1]+w*c[n+1][r+1]+M*c[n+2][r+1]+A*c[n+3][r+1],l=_*c[n][r+2]+w*c[n+1][r+2]+M*c[n+2][r+2]+A*c[n+3][r+2],u=_*c[n][r+3]+w*c[n+1][r+3]+M*c[n+2][r+3]+A*c[n+3][r+3],e[h]=v*o+3*(g*i*s+d*f*l)+p*u;return e}:e?function(e,r,n,i,a){var o,s,l,u,c,h;e||(e=[]),r*=3;var f=a*a,p=f*a,d=1-a,g=d*d,v=g*d;for(c=0;c<t.length;c++)o=(h=t[c])[n+1][r]-h[n][r],s=h[n+1][r+1]-h[n][r+1],l=h[n+1][r+2]-h[n][r+2],u=h[n+1][r+3]-h[n][r+3],e[c]=v*o+3*(g*a*s+d*f*l)+p*u;return e}:r?function(e,r,n,i,a){var o,s,l,u;e||(e=[]),n*=3;var c=1-i,h=a*a,f=1-a,p=f*f,d=f*a*2,g=-3*p,v=3*(p-d),m=3*(d-h),y=3*h;for(l=0;l<t.length;l++)o=g*(u=t[l])[n][r]+v*u[n+1][r]+m*u[n+2][r]+y*u[n+3][r],s=g*u[n][r+1]+v*u[n+1][r+1]+m*u[n+2][r+1]+y*u[n+3][r+1],e[l]=c*o+i*s;return e}:function(e,r,n,i,a){var o,s,l,u;e||(e=[]);var c=1-i;for(l=0;l<t.length;l++)o=(u=t[l])[n+1][r]-u[n][r],s=u[n+1][r+1]-u[n][r+1],e[l]=c*o+i*s;return e}}([t.xctrl,t.yctrl],a.smoothing,o.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),n-2),i=t[0]-r;return(1-i)*e[r]+i*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),n-2),i=t[1]-e;return(1-i)*r[e]+i*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(Su(t,e),n-2)),i=e[r],a=e[r+1];return Math.max(0,Math.min(n-1,r+(t-i)/(a-i)))},t.b2j=function(t){var e=Math.max(0,Math.min(Su(t,r),i-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(i-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(a,o,s){if(!s&&(a<e[0]||a>e[n-1]|o<r[0]||o>r[i-1]))return[!1,!1];var l=t.a2i(a),u=t.b2j(o),c=t.evalxy([],l,u);if(s){var h,f,p,d,g=0,v=0,m=[];a<e[0]?(h=0,f=0,g=(a-e[0])/(e[1]-e[0])):a>e[n-1]?(h=n-2,f=1,g=(a-e[n-1])/(e[n-1]-e[n-2])):f=l-(h=Math.max(0,Math.min(n-2,Math.floor(l)))),o<r[0]?(p=0,d=0,v=(o-r[0])/(r[1]-r[0])):o>r[i-1]?(p=i-2,d=1,v=(o-r[i-1])/(r[i-1]-r[i-2])):d=u-(p=Math.max(0,Math.min(i-2,Math.floor(u)))),g&&(t.dxydi(m,h,p,f,d),c[0]+=m[0]*g,c[1]+=m[1]*g),v&&(t.dxydj(m,h,p,f,d),c[0]+=m[0]*v,c[1]+=m[1]*v)}return c},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=h*(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=f*(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}},Cu=ne.isArrayOrTypedArray,Lu=function(t){return Cu(t[0])},zu=t.BADNUM,Pu=function(t,e,r,n,i,a){n=n||\"x\",i=i||\"y\",a=a||[\"z\"];var o,s,l,u=t[n].slice(),c=t[i].slice(),h=t.text,f=Math.min(u.length,c.length),p=void 0!==h&&!Array.isArray(h[0]),d=t[n+\"calendar\"],g=t[i+\"calendar\"];for(o=0;o<a.length;o++)(l=t[a[o]])&&(f=Math.min(f,l.length));for(f<u.length&&(u=u.slice(0,f)),f<c.length&&(c=c.slice(0,f)),o=0;o<f;o++)u[o]=e.d2c(u[o],0,d),c[o]=r.d2c(c[o],0,g);var v,m,y,x=ne.distinctVals(u),b=x.vals,_=ne.distinctVals(c),w=_.vals,M=[];for(o=0;o<a.length;o++)M[o]=ne.init2dArray(w.length,b.length);for(p&&(y=ne.init2dArray(w.length,b.length)),o=0;o<f;o++)if(u[o]!==zu&&c[o]!==zu){for(v=ne.findBin(u[o]+x.minDiff/2,b),m=ne.findBin(c[o]+_.minDiff/2,w),s=0;s<a.length;s++)l=t[a[s]],M[s][m][v]=l[o];p&&(y[m][v]=h[o])}for(t[\"_input_\"+n]=t[n],t[\"_input_\"+i]=t[i],t[n]=b,t[i]=w,s=0;s<a.length;s++)t[\"_input_\"+a[s]]=t[a[s]],t[a[s]]=M[s];p&&(t.text=y)},Iu=function(t,e,r){if(0===t.length)return\"\";var n,i=[],a=r?3:1;for(n=0;n<t.length;n+=a)i.push(t[n]+\",\"+e[n]),r&&n<t.length-a&&(i.push(\"C\"),i.push([t[n+1]+\",\"+e[n+1],t[n+2]+\",\"+e[n+2]+\" \"].join(\" \")));return i.join(r?\"\":\"L\")},Du=ne.isArrayOrTypedArray,Ou=function(t,e,r){var n;for(Du(t)?t.length>e.length&&(t=t.slice(0,e.length)):t=[],n=0;n<e.length;n++)t[n]=r(e[n]);return t},Ru=function(t,e,r,n,i,a){var o=i[0]*t.dpdx(e),s=i[1]*t.dpdy(r),l=1,u=1;if(a){var c=Math.sqrt(i[0]*i[0]+i[1]*i[1]),h=Math.sqrt(a[0]*a[0]+a[1]*a[1]),f=(i[0]*a[0]+i[1]*a[1])/c/h;u=Math.max(0,f)}var p=180*Math.atan2(s,o)/Math.PI;return p<-90?(p+=180,l=-l):p>90&&(p-=180,l=-l),{angle:p,flip:l,p:t.c2p(n,e,r),offsetMultplier:u}};function Fu(t,e,r){var n=t.selectAll(e+\".\"+r).data([0]);return n.enter().append(e).classed(r,!0),n}function Bu(t,e,r){var n=r[0],i=r[0].trace,a=e.xaxis,o=e.yaxis,s=i.aaxis,l=i.baxis,u=t._fullLayout,c=e.plot.selectAll(\".carpetlayer\"),h=u._clips,f=Fu(c,\"g\",\"carpet\"+i.uid).classed(\"trace\",!0),p=Fu(f,\"g\",\"minorlayer\"),d=Fu(f,\"g\",\"majorlayer\"),g=Fu(f,\"g\",\"boundarylayer\"),v=Fu(f,\"g\",\"labellayer\");f.style(\"opacity\",i.opacity),Nu(a,o,d,s,\"a\",s._gridlines),Nu(a,o,d,l,\"b\",l._gridlines),Nu(a,o,p,s,\"a\",s._minorgridlines),Nu(a,o,p,l,\"b\",l._minorgridlines),Nu(a,o,g,s,\"a-boundary\",s._boundarylines),Nu(a,o,g,l,\"b-boundary\",l._boundarylines),function(t,e,r,n,i,a,o,s){var l,u,c,h;l=.5*(r.a[0]+r.a[r.a.length-1]),u=r.b[0],c=r.ab2xy(l,u,!0),h=r.dxyda_rough(l,u),void 0===o.angle&&ne.extendFlat(o,Ru(r,i,a,c,r.dxydb_rough(l,u)));qu(t,e,r,n,c,h,r.aaxis,i,a,o,\"a-title\"),l=r.a[0],u=.5*(r.b[0]+r.b[r.b.length-1]),c=r.ab2xy(l,u,!0),h=r.dxydb_rough(l,u),void 0===s.angle&&ne.extendFlat(s,Ru(r,i,a,c,r.dxyda_rough(l,u)));qu(t,e,r,n,c,h,r.baxis,i,a,s,\"b-title\")}(t,v,i,n,a,o,ju(t,a,o,i,n,v,s._labels,\"a-label\"),ju(t,a,o,i,n,v,l._labels,\"b-label\")),function(t,e,r,n,i){var a,o,s,l,u=r.select(\"#\"+t._clipPathId);u.size()||(u=r.append(\"clipPath\").classed(\"carpetclip\",!0));var c=Fu(u,\"path\",\"carpetboundary\"),h=e.clipsegments,f=[];for(l=0;l<h.length;l++)a=h[l],o=Ou([],a.x,n.c2p),s=Ou([],a.y,i.c2p),f.push(Iu(o,s,a.bicubic));var p=\"M\"+f.join(\"L\")+\"Z\";u.attr(\"id\",t._clipPathId),c.attr(\"d\",p)}(i,n,h,a,o)}function Nu(t,r,n,i,a,o){var s=\"const-\"+a+\"-lines\",l=n.selectAll(\".\"+s).data(o);l.enter().append(\"path\").classed(s,!0).style(\"vector-effect\",\"non-scaling-stroke\"),l.each(function(n){var i=n,a=i.x,o=i.y,s=Ou([],a,t.c2p),l=Ou([],o,r.c2p),u=\"M\"+Iu(s,l,i.smoothing);e.select(this).attr(\"d\",u).style(\"stroke-width\",i.width).style(\"stroke\",i.color).style(\"fill\",\"none\")}),l.exit().remove()}function ju(t,r,n,i,a,o,s,l){var u=o.selectAll(\"text.\"+l).data(s);u.enter().append(\"text\").classed(l,!0);var c=0,h={};return u.each(function(a,o){var s;if(\"auto\"===a.axis.tickangle)s=Ru(i,r,n,a.xy,a.dxy);else{var l=(a.axis.tickangle+180)*Math.PI/180;s=Ru(i,r,n,a.xy,[Math.cos(l),Math.sin(l)])}o||(h={angle:s.angle,flip:s.flip});var u=(a.endAnchor?-1:1)*s.flip,f=e.select(this).attr({\"text-anchor\":u>0?\"start\":\"end\",\"data-notex\":1}).call(Sr.font,a.font).text(a.text).call(er.convertToTspans,t),p=Sr.bBox(this);f.attr(\"transform\",\"translate(\"+s.p[0]+\",\"+s.p[1]+\") rotate(\"+s.angle+\")translate(\"+a.axis.labelpadding*u+\",\"+.3*p.height+\")\"),c=Math.max(c,p.width+a.axis.labelpadding)}),u.exit().remove(),h.maxExtent=c,h}var Vu=Qe.LINE_SPACING,Uu=(1-Qe.MID_SHIFT)/Vu+1;function qu(t,r,n,i,a,o,s,l,u,c,h){var f=[];s.title&&f.push(s.title);var p=r.selectAll(\"text.\"+h).data(f),d=c.maxExtent;p.enter().append(\"text\").classed(h,!0),p.each(function(){var r=Ru(n,l,u,a,o);-1===[\"start\",\"both\"].indexOf(s.showticklabels)&&(d=0);var i=s.titlefont.size;d+=i+s.titleoffset;var h=(c.angle+(c.flip<0?180:0)-r.angle+450)%360,f=h>90&&h<270,p=e.select(this);p.text(s.title||\"\").call(er.convertToTspans,t),f&&(d=(-er.lineCount(p)+Uu)*Vu*i-d),p.attr(\"transform\",\"translate(\"+r.p[0]+\",\"+r.p[1]+\") rotate(\"+r.angle+\") translate(0,\"+d+\")\").classed(\"user-select-none\",!0).attr(\"text-anchor\",\"middle\").call(Sr.font,s.titlefont)}),p.exit().remove()}var Hu={};Hu.attributes=lu,Hu.supplyDefaults=function(t,e,r,n){function i(r,n){return ne.coerce(t,e,lu,r,n)}e._clipPathId=\"clip\"+e.uid+\"carpet\";var a=i(\"color\",C.defaultLine);if(ne.coerceFont(i,\"font\"),i(\"carpet\"),wu(t,e,n,i,a),e.a&&e.b){e.a.length<3&&(e.aaxis.smoothing=0),e.b.length<3&&(e.baxis.smoothing=0);var o=function(t,e,r){var n=[],i=r(\"x\");i&&!Lu(i)&&n.push(\"x\"),e._cheater=!i;var a=r(\"y\");if(a&&!Lu(a)&&n.push(\"y\"),i||a)return n.length&&Pu(e,e.aaxis,e.baxis,\"a\",\"b\",n),!0}(0,e,i);Eu(e),e._cheater&&i(\"cheaterslope\"),o||(e.visible=!1)}else e.visible=!1},Hu.plot=function(t,e,r){for(var n=0;n<r.length;n++)Bu(t,e,r[n])},Hu.calc=function(t,e){var r,n=ri.getFromId(t,e.xaxis||\"x\"),i=ri.getFromId(t,e.yaxis||\"y\"),a=e.aaxis,o=e.baxis,s=e._a=e.a,l=e._b=e.b,u={},c=e.y;r=e._cheater?function(t,e,r){var n,i,a,o,s,l,u=[],c=gu(t)?t.length:t,h=gu(e)?e.length:e,f=gu(t)?t:null,p=gu(e)?e:null;f&&(a=(f.length-1)/(f[f.length-1]-f[0])/(c-1)),p&&(o=(p.length-1)/(p[p.length-1]-p[0])/(h-1));var d=1/0,g=-1/0;for(i=0;i<h;i++)for(u[i]=[],s=p?(p[i]-p[0])*o:i/(h-1),n=0;n<c;n++)l=(f?(f[n]-f[0])*a:n/(c-1))-s*r,d=Math.min(l,d),g=Math.max(l,g),u[i][n]=l;var v=1/(g-d),m=-d*v;for(i=0;i<h;i++)for(n=0;n<c;n++)u[i][n]=v*u[i][n]+m;return u}(\"index\"===a.cheatertype?s.length:s,\"index\"===o.cheatertype?l.length:l,e.cheaterslope):e.x;e._x=r=xu(r),e._y=c=xu(c),yu(r,s,l),yu(c,s,l),e.setScale(),u.xp=e.xp=mu(e.xp,r,n.c2p),u.yp=e.yp=mu(e.yp,c,i.c2p);var h=cu(r),f=cu(c),p=.5*(h[1]-h[0]),d=.5*(h[1]+h[0]),g=.5*(f[1]-f[0]),v=.5*(f[1]+f[0]);return h=[d-1.3*p,d+1.3*p],f=[v-1.3*g,v+1.3*g],ri.expand(n,h,{padded:!0}),ri.expand(i,f,{padded:!0}),fu(e,0,\"a\",\"b\"),fu(e,0,\"b\",\"a\"),du(0,a),du(0,o),u.clipsegments=function(t,e,r,n){var i,a,o,s=[],l=!!r.smoothing,u=!!n.smoothing,c=t[0].length-1,h=t.length-1;for(i=0,a=[],o=[];i<=c;i++)a[i]=t[0][i],o[i]=e[0][i];for(s.push({x:a,y:o,bicubic:l}),i=0,a=[],o=[];i<=h;i++)a[i]=t[i][c],o[i]=e[i][c];for(s.push({x:a,y:o,bicubic:u}),i=c,a=[],o=[];i>=0;i--)a[c-i]=t[h][i],o[c-i]=e[h][i];for(s.push({x:a,y:o,bicubic:l}),i=h,a=[],o=[];i>=0;i--)a[h-i]=t[i][0],o[h-i]=e[i][0];return s.push({x:a,y:o,bicubic:u}),s}(e.xctrl,e.yctrl,a,o),u.x=r,u.y=c,u.a=s,u.b=l,[u]},Hu.animatable=!0,Hu.moduleType=\"trace\",Hu.name=\"carpet\",Hu.basePlotModule=ua,Hu.categories=[\"cartesian\",\"carpet\",\"carpetAxis\",\"notLegendIsolatable\"],Hu.meta={};var Gu=Hu,Wu={exports:{}};!function(t,e){\"object\"==typeof Wu.exports?e(Wu.exports):e(t.topojson=t.topojson||{})}(this,function(t){\"use strict\";var e=function(t){return t},r=function(t){if(null==(r=t.transform))return e;var r,n,i,a=r.scale[0],o=r.scale[1],s=r.translate[0],l=r.translate[1];return function(t,e){return e||(n=i=0),t[0]=(n+=t[0])*a+s,t[1]=(i+=t[1])*o+l,t}},n=function(t){var e=t.bbox;function n(t){l[0]=t[0],l[1]=t[1],s(l),l[0]<u&&(u=l[0]),l[0]>h&&(h=l[0]),l[1]<c&&(c=l[1]),l[1]>f&&(f=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,h=-u,f=-u;for(o in t.arcs.forEach(function(t){for(var e=-1,r=t.length;++e<r;)a=t[e],l[0]=a[0],l[1]=a[1],s(l,e),l[0]<u&&(u=l[0]),l[0]>h&&(h=l[0]),l[1]<c&&(c=l[1]),l[1]>f&&(f=l[1])}),t.objects)i(t.objects[o]);e=t.bbox=[u,c,h,f]}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;o<s;++o)e.push(n(r[o].slice(),o));t<0&&i(e,s)}function s(t){return n(t.slice())}function l(t){for(var e=[],r=0,n=t.length;r<n;++r)o(t[r],e);return e.length<2&&e.push(e[0].slice()),e}function u(t){for(var e=l(t);e.length<4;)e.push(e[0].slice());return e}function c(t){return t.map(u)}return function t(e){var r,n=e.type;switch(n){case\"GeometryCollection\":return{type:n,geometries:e.geometries.map(t)};case\"Point\":r=s(e.coordinates);break;case\"MultiPoint\":r=e.coordinates.map(s);break;case\"LineString\":r=l(e.arcs);break;case\"MultiLineString\":r=e.arcs.map(l);break;case\"Polygon\":r=c(e.arcs);break;case\"MultiPolygon\":r=e.arcs.map(c);break;default:return null}return{type:n,coordinates:r}}(e)}var s=function(t,e){var r={},n={},i={},a=[],o=-1;function s(t,e){for(var n in t){var i=t[n];delete e[i.start],delete i.start,delete i.end,i.forEach(function(t){r[t<0?~t:t]=1}),a.push(i)}}return e.forEach(function(r,n){var i,a=t.arcs[r<0?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++o],e[o]=r,e[n]=i)}),e.forEach(function(e){var r,a,o=function(e){var r,n=t.arcs[e<0?~e:e],i=n[0];t.transform?(r=[0,0],n.forEach(function(t){r[0]+=t[0],r[1]+=t[1]})):r=n[n.length-1];return e<0?[r,i]:[i,r]}(e),s=o[0],l=o[1];if(r=i[s])if(delete i[r.end],r.push(e),r.end=l,a=n[l]){delete n[a.start];var u=a===r?r:r.concat(a);n[u.start=r.start]=i[u.end=a.end]=u}else n[r.start]=i[r.end]=r;else if(r=n[l])if(delete n[r.start],r.unshift(e),r.start=s,a=i[s]){delete i[a.end];var c=a===r?r:a.concat(r);n[c.start=a.start]=i[c.end=r.end]=c}else n[r.start]=i[r.end]=r;else n[(r=[e]).start=s]=i[r.end=l]=r}),s(i,n),s(n,i),e.forEach(function(t){r[t<0?~t:t]||a.push([t])}),a};function l(t,e,r){var n,i,a;if(arguments.length>1)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);i<a;++i)n[i]=i;return{type:\"MultiLineString\",arcs:s(t,n)}}function u(t,e){var r={},n=[],i=[];function a(t){t.forEach(function(e){e.forEach(function(e){(r[e=e<0?~e:e]||(r[e]=[])).push(t)})}),n.push(t)}function l(e){return function(t){for(var e,r=-1,n=t.length,i=t[n-1],a=0;++r<n;)e=i,i=t[r],a+=e[0]*i[1]-e[1]*i[0];return Math.abs(a)}(o(t,{type:\"Polygon\",arcs:[e]}).coordinates[0])}return e.forEach(function t(e){switch(e.type){case\"GeometryCollection\":e.geometries.forEach(t);break;case\"Polygon\":a(e.arcs);break;case\"MultiPolygon\":e.arcs.forEach(a)}}),n.forEach(function(t){if(!t._){var e=[],n=[t];for(t._=1,i.push(e);t=n.pop();)e.push(t),t.forEach(function(t){t.forEach(function(t){r[t<0?~t:t].forEach(function(t){t._||(t._=1,n.push(t))})})})}}),n.forEach(function(t){delete t._}),{type:\"MultiPolygon\",arcs:i.map(function(e){var n,i=[];if(e.forEach(function(t){t.forEach(function(t){t.forEach(function(t){r[t<0?~t:t].length<2&&i.push(t)})})}),(n=(i=s(t,i)).length)>1)for(var a,o,u=1,c=l(i[0]);u<n;++u)(a=l(i[u]))>c&&(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<n;){var i=r+n>>>1;t[i]<e?r=i+1:n=i}return r};t.bbox=n,t.feature=function(t,e){return\"GeometryCollection\"===e.type?{type:\"FeatureCollection\",features:e.geometries.map(function(e){return a(t,e)})}:a(t,e)},t.mesh=function(t){return o(t,l.apply(this,arguments))},t.meshArcs=l,t.merge=function(t){return o(t,u.apply(this,arguments))},t.mergeArcs=u,t.neighbors=function(t){var e={},r=t.map(function(){return[]});function n(t,r){t.forEach(function(t){t<0&&(t=~t);var n=e[t];n?n.push(r):e[t]=[r]})}function i(t,e){t.forEach(function(t){n(t,e)})}var a={LineString:n,MultiLineString:i,Polygon:i,MultiPolygon:function(t,e){t.forEach(function(t){i(t,e)})}};for(var o in t.forEach(function t(e,r){\"GeometryCollection\"===e.type?e.geometries.forEach(function(e){t(e,r)}):e.type in a&&a[e.type](e.arcs,r)}),e)for(var s=e[o],l=s.length,u=0;u<l;++u)for(var h=u+1;h<l;++h){var f,p=s[u],d=s[h];(f=r[p])[o=c(f,d)]!==d&&f.splice(o,0,d),(f=r[d])[o=c(f,p)]!==p&&f.splice(o,0,p)}return r},t.quantize=function(t,e){if(!((e=Math.floor(e))>=2))throw new Error(\"n must be \\u22652\");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,h=t[0],f=h[0]=Math.round((h[0]-a)/o),p=h[1]=Math.round((h[1]-s)/l);i<c;++i)h=t[i],r=Math.round((h[0]-a)/o),n=Math.round((h[1]-s)/l),r===f&&n===p||((e=t[u++])[0]=r-f,f=r,e[1]=n-p,p=n);u<2&&((e=t[u++])[0]=0,e[1]=0),t.length=u}),t.objects)c(t.objects[r]);return t.transform={scale:[o,l],translate:[a,s]},t},t.transform=r,t.untransform=function(t){if(null==(r=t.transform))return e;var r,n,i,a=r.scale[0],o=r.scale[1],s=r.translate[0],l=r.translate[1];return function(t,e){e||(n=i=0);var r=Math.round((t[0]-s)/a),u=Math.round((t[1]-l)/o);return t[0]=r-n,n=r,t[1]=u-i,i=u,t}},Object.defineProperty(t,\"__esModule\",{value:!0})}),Wu=Wu.exports;var Yu={projNames:{equirectangular:\"equirectangular\",mercator:\"mercator\",orthographic:\"orthographic\",\"natural earth\":\"naturalEarth\",kavrayskiy7:\"kavrayskiy7\",miller:\"miller\",robinson:\"robinson\",eckert4:\"eckert4\",\"azimuthal equal area\":\"azimuthalEqualArea\",\"azimuthal equidistant\":\"azimuthalEquidistant\",\"conic equal area\":\"conicEqualArea\",\"conic conformal\":\"conicConformal\",\"conic equidistant\":\"conicEquidistant\",gnomonic:\"gnomonic\",stereographic:\"stereographic\",mollweide:\"mollweide\",hammer:\"hammer\",\"transverse mercator\":\"transverseMercator\",\"albers usa\":\"albersUsa\",\"winkel tripel\":\"winkel3\",aitoff:\"aitoff\",sinusoidal:\"sinusoidal\"},axesNames:[\"lonaxis\",\"lataxis\"],lonaxisSpan:{orthographic:180,\"azimuthal equal area\":360,\"azimuthal equidistant\":360,\"conic conformal\":180,gnomonic:160,stereographic:180,\"transverse mercator\":180,\"*\":360},lataxisSpan:{\"conic conformal\":150,stereographic:179.5,\"*\":180},scopeDefaults:{world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:\"equirectangular\",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:\"albers usa\"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,85],projType:\"conic conformal\",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:\"mercator\",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:\"mercator\",projRotate:[0,0,0]},\"north america\":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:\"conic conformal\",projRotate:[-100,0,0],projParallels:[29.5,45.5]},\"south america\":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:\"mercator\",projRotate:[0,0,0]}},clipPad:.001,precision:.1,landColor:\"#F0DC82\",waterColor:\"#3399FF\",locationmodeToLayer:{\"ISO-3\":\"countries\",\"USA-states\":\"subunits\",\"country names\":\"countries\"},sphereSVG:{type:\"Sphere\"},fillLayers:{ocean:1,land:1,lakes:1},lineLayers:{subunits:1,countries:1,coastlines:1,rivers:1,frame:1},layers:[\"bg\",\"ocean\",\"land\",\"lakes\",\"subunits\",\"countries\",\"coastlines\",\"rivers\",\"lataxis\",\"lonaxis\",\"frame\",\"backplot\",\"frontplot\"],layersForChoropleth:[\"bg\",\"ocean\",\"land\",\"subunits\",\"countries\",\"coastlines\",\"lataxis\",\"lonaxis\",\"frame\",\"backplot\",\"rivers\",\"lakes\",\"frontplot\"],layerNameToAdjective:{ocean:\"ocean\",land:\"land\",lakes:\"lake\",subunits:\"subunit\",countries:\"country\",coastlines:\"coastline\",rivers:\"river\",frame:\"frame\"}},Xu={},Zu=Xu={},Ju=Yu.locationmodeToLayer,Ku=Wu.feature;Zu.getTopojsonName=function(t){return[t.scope.replace(/ /g,\"-\"),\"_\",t.resolution.toString(),\"m\"].join(\"\")},Zu.getTopojsonPath=function(t,e){return t+e+\".json\"},Zu.getTopojsonFeatures=function(t,e){var r=Ju[t.locationmode],n=e.objects[r];return Ku(e,n).features};var Qu=function(){var t,e=0,r=!1;function n(e,r){return t.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),t}return t={list:[],segmentId:function(){return e++},checkIntersection:function(t,e){return n(\"check\",{seg1:t,seg2:e})},segmentChop:function(t,e){return n(\"div_seg\",{seg:t,pt:e}),n(\"chop\",{seg:t,pt:e})},statusRemove:function(t){return n(\"pop_seg\",{seg:t})},segmentUpdate:function(t){return n(\"seg_update\",{seg:t})},segmentNew:function(t,e){return n(\"new_seg\",{seg:t,primary:e})},segmentRemove:function(t){return n(\"rem_seg\",{seg:t})},tempStatus:function(t,e,r){return n(\"temp_status\",{seg:t,above:e,below:r})},rewind:function(t){return n(\"rewind\",{seg:t})},status:function(t,e,r){return n(\"status\",{seg:t,above:e,below:r})},vert:function(e){return e===r?t:(r=e,n(\"vert\",{x:e}))},log:function(t){return\"string\"!=typeof t&&(t=JSON.stringify(t,!1,\" \")),n(\"log\",{txt:t})},reset:function(){return n(\"reset\")},selected:function(t){return n(\"selected\",{segs:t})},chainStart:function(t){return n(\"chain_start\",{seg:t})},chainRemoveHead:function(t,e){return n(\"chain_rem_head\",{index:t,pt:e})},chainRemoveTail:function(t,e){return n(\"chain_rem_tail\",{index:t,pt:e})},chainNew:function(t,e){return n(\"chain_new\",{pt1:t,pt2:e})},chainMatch:function(t){return n(\"chain_match\",{index:t})},chainClose:function(t){return n(\"chain_close\",{index:t})},chainAddHead:function(t,e){return n(\"chain_add_head\",{index:t,pt:e})},chainAddTail:function(t,e){return n(\"chain_add_tail\",{index:t,pt:e})},chainConnect:function(t,e){return n(\"chain_con\",{index1:t,index2:e})},chainReverse:function(t){return n(\"chain_rev\",{index:t})},chainJoin:function(t,e){return n(\"chain_join\",{index1:t,index2:e})},done:function(){return n(\"done\")}}};var $u={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;i<e.length;i++)n=t.selectDifference(t.combine(n,r(e[i])));return n}if(\"Polygon\"===e.type)return t.polygon(r(e.coordinates));if(\"MultiPolygon\"===e.type){for(var n=t.segments({inverted:!1,regions:[]}),i=0;i<e.coordinates.length;i++)n=t.selectUnion(t.combine(n,r(e.coordinates[i])));return t.polygon(n)}throw new Error(\"PolyBool: Cannot convert GeoJSON object to PolyBool polygon\")},fromPolygon:function(t,e,r){function n(t,r){return e.pointInsideRegion([.5*(t[0][0]+t[1][0]),.5*(t[0][1]+t[1][1])],r)}function i(t){return{region:t,children:[]}}r=t.polygon(t.segments(r));var a=i(null);function o(t,e){for(var r=0;r<t.children.length;r++){if(n(e,(s=t.children[r]).region))return void o(s,e)}var a=i(e);for(r=0;r<t.children.length;r++){var s;n((s=t.children[r]).region,e)&&(a.children.push(s),t.children.splice(r,1),r--)}t.children.push(a)}for(var s=0;s<r.regions.length;s++){var l=r.regions[s];l.length<3||o(a,l)}function u(t,e){for(var r=0,n=t[t.length-1][0],i=t[t.length-1][1],a=[],o=0;o<t.length;o++){var s=t[o][0],l=t[o][1];a.push([s,l]),r+=l*n-s*i,n=s,i=l}return r<0!==e&&a.reverse(),a.push([a[0][0],a[0][1]]),a}var c=[];function h(t){var e=[u(t.region,!1)];c.push(e);for(var r=0;r<t.children.length;r++)e.push(f(t.children[r]))}function f(t){for(var e=0;e<t.children.length;e++)h(t.children[e]);return u(t.region,!0)}for(s=0;s<a.children.length;s++)h(a.children[s]);return c.length<=0?{type:\"Polygon\",coordinates:[]}:1==c.length?{type:\"Polygon\",coordinates:c[0]}:{type:\"MultiPolygon\",coordinates:c}}},tc={create:function(){var t={root:{root:!0,next:null},exists:function(e){return null!==e&&e!==t.root},isEmpty:function(){return null===t.root.next},getHead:function(){return t.root.next},insertBefore:function(e,r){for(var n=t.root,i=t.root.next;null!==i;){if(r(i))return e.prev=i.prev,e.next=i,i.prev.next=e,void(i.prev=e);n=i,i=i.next}n.next=e,e.prev=n,e.next=null},findTransition:function(e){for(var r=t.root,n=t.root.next;null!==n&&!e(n);)r=n,n=n.next;return{before:r===t.root?null:r,after:n,insert:function(t){return t.prev=r,t.next=n,r.next=t,null!==n&&(n.prev=t),t}}}};return t},node:function(t){return t.prev=null,t.next=null,t.remove=function(){t.prev.next=t.next,t.next&&(t.next.prev=t.prev),t.prev=null,t.next=null},t}};var ec=function(t,e,r){function n(t,e,n){return{id:r?r.segmentId():-1,start:t,end:e,myFill:{above:n.myFill.above,below:n.myFill.below},otherFill:null}}var i=tc.create();function a(t,r){i.insertBefore(t,function(n){return function(t,r,n,i,a,o){var s=e.pointsCompare(r,a);return 0!==s?s:e.pointsSame(n,o)?0:t!==i?t?1:-1:e.pointAboveOrOnLine(n,i?a:o,i?o:a)?1:-1}(t.isStart,t.pt,r,n.isStart,n.pt,n.other.pt)<0})}function o(t,e){var r=function(t,e){var r=tc.node({isStart:!0,pt:t.start,seg:t,primary:e,other:null,status:null});return a(r,t.end),r}(t,e);return function(t,e,r){var n=tc.node({isStart:!1,pt:e.end,seg:e,primary:r,other:t,status:null});t.other=n,a(n,t.pt)}(r,t,e),r}function s(t,e){var i=n(e,t.seg.end,t.seg);return function(t,e){r&&r.segmentChop(t.seg,e),t.other.remove(),t.seg.end=e,t.other.pt=e,a(t.other,t.pt)}(t,e),o(i,t.primary)}function l(n,a){var o=tc.create();function l(t){return o.findTransition(function(r){var n,i,a,o,s,l;return n=t,i=r.ev,a=n.seg.start,o=n.seg.end,s=i.seg.start,l=i.seg.end,(e.pointsCollinear(a,s,l)?e.pointsCollinear(o,s,l)?1:e.pointAboveOrOnLine(o,s,l)?1:-1:e.pointAboveOrOnLine(a,s,l)?1:-1)>0})}function u(t,n){var i=t.seg,a=n.seg,o=i.start,l=i.end,u=a.start,c=a.end;r&&r.checkIntersection(i,a);var h=e.linesIntersect(o,l,u,c);if(!1===h){if(!e.pointsCollinear(o,l,u))return!1;if(e.pointsSame(o,c)||e.pointsSame(l,u))return!1;var f=e.pointsSame(o,u),p=e.pointsSame(l,c);if(f&&p)return n;var d=!f&&e.pointBetween(o,u,c),g=!p&&e.pointBetween(l,u,c);if(f)return g?s(n,l):s(t,c),n;d&&(p||(g?s(n,l):s(t,c)),s(n,o))}else 0===h.alongA&&(-1===h.alongB?s(t,u):0===h.alongB?s(t,h.pt):1===h.alongB&&s(t,c)),0===h.alongB&&(-1===h.alongA?s(n,o):0===h.alongA?s(n,h.pt):1===h.alongA&&s(n,l));return!1}for(var c=[];!i.isEmpty();){var h=i.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var f=l(h),p=f.before?f.before.ev:null,d=f.after?f.after.ev:null;function g(){if(p){var t=u(h,p);if(t)return t}return!!d&&u(h,d)}r&&r.tempStatus(h.seg,!!p&&p.seg,!!d&&d.seg);var v,m,y=g();if(y)t?(m=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above):y.seg.otherFill=h.seg.myFill,r&&r.segmentUpdate(y.seg),h.other.remove(),h.remove();if(i.getHead()!==h){r&&r.rewind(h.seg);continue}t?(m=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=d?d.seg.myFill.above:n,h.seg.myFill.above=m?!h.seg.myFill.below:h.seg.myFill.below):null===h.seg.otherFill&&(v=d?h.primary===d.primary?d.seg.otherFill.above:d.seg.myFill.above:h.primary?a:n,h.seg.otherFill={above:v,below:v}),r&&r.status(h.seg,!!p&&p.seg,!!d&&d.seg),h.other.status=f.insert(tc.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error(\"PolyBool: Zero-length segment detected; your epsilon is probably too small or too large\");if(o.exists(x.prev)&&o.exists(x.next)&&u(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var b=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=b}c.push(h.seg)}i.getHead().remove()}return r&&r.done(),c}return t?{addRegion:function(t){for(var n,i,a,s=t[t.length-1],l=0;l<t.length;l++){n=s,s=t[l];var u=e.pointsCompare(n,s);0!==u&&o((i=u<0?n:s,a=u<0?s:n,{id:r?r.segmentId():-1,start:i,end:a,myFill:{above:null,below:null},otherFill:null}),!0)}},calculate:function(t){return l(t,!1)}}:{calculate:function(t,e,r,i){return t.forEach(function(t){o(n(t.start,t.end,t),!0)}),r.forEach(function(t){o(n(t.start,t.end,t),!1)}),l(e,i)}}};var rc=function(t,e,r){var n=[],i=[];return t.forEach(function(t){var a=t.start,o=t.end;if(e.pointsSame(a,o))console.warn(\"PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large\");else{r&&r.chainStart(t);for(var s={index:0,matches_head:!1,matches_pt1:!1},l={index:0,matches_head:!1,matches_pt1:!1},u=s,c=0;c<n.length;c++){var h=(v=n[c])[0],f=(v[1],v[v.length-1]);if(v[v.length-2],e.pointsSame(h,a)){if(A(c,!0,!0))break}else if(e.pointsSame(h,o)){if(A(c,!0,!1))break}else if(e.pointsSame(f,a)){if(A(c,!1,!0))break}else if(e.pointsSame(f,o)&&A(c,!1,!1))break}if(u===s)return n.push([a,o]),void(r&&r.chainNew(a,o));if(u===l){r&&r.chainMatch(s.index);var p=s.index,d=s.matches_pt1?o:a,g=s.matches_head,v=n[p],m=g?v[0]:v[v.length-1],y=g?v[1]:v[v.length-2],x=g?v[v.length-1]:v[0],b=g?v[v.length-2]:v[1];return e.pointsCollinear(y,m,d)&&(g?(r&&r.chainRemoveHead(s.index,d),v.shift()):(r&&r.chainRemoveTail(s.index,d),v.pop()),m=y),e.pointsSame(x,d)?(n.splice(p,1),e.pointsCollinear(b,x,m)&&(g?(r&&r.chainRemoveTail(s.index,m),v.pop()):(r&&r.chainRemoveHead(s.index,m),v.shift())),r&&r.chainClose(s.index),void i.push(v)):void(g?(r&&r.chainAddHead(s.index,d),v.unshift(d)):(r&&r.chainAddTail(s.index,d),v.push(d)))}var _=s.index,w=l.index;r&&r.chainConnect(_,w);var M=n[_].length<n[w].length;s.matches_head?l.matches_head?M?(k(_),T(_,w)):(k(w),T(w,_)):T(w,_):l.matches_head?T(_,w):M?(k(_),T(w,_)):(k(w),T(_,w))}function A(t,e,r){return u.index=t,u.matches_head=e,u.matches_pt1=r,u===s?(u=l,!1):(u=null,!0)}function k(t){r&&r.chainReverse(t),n[t].reverse()}function T(t,i){var a=n[t],o=n[i],s=a[a.length-1],l=a[a.length-2],u=o[0],c=o[1];e.pointsCollinear(l,s,u)&&(r&&r.chainRemoveTail(t,s),a.pop(),s=l),e.pointsCollinear(s,u,c)&&(r&&r.chainRemoveHead(i,u),o.shift()),r&&r.chainJoin(t,i),n[t]=a.concat(o),n.splice(i,1)}}),i};function nc(t,e,r){var n=[];return t.forEach(function(t){var i=(t.myFill.above?8:0)+(t.myFill.below?4:0)+(t.otherFill&&t.otherFill.above?2:0)+(t.otherFill&&t.otherFill.below?1:0);0!==e[i]&&n.push({id:r?r.segmentId():-1,start:t.start,end:t.end,myFill:{above:1===e[i],below:2===e[i]},otherFill:null})}),r&&r.selected(n),n}var ic,ac={union:function(t,e){return nc(t,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],e)},intersect:function(t,e){return nc(t,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],e)},difference:function(t,e){return nc(t,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],e)},differenceRev:function(t,e){return nc(t,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],e)},xor:function(t,e){return nc(t,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],e)}},oc=!1,sc=function(t){\"number\"!=typeof t&&(t=1e-10);var e={epsilon:function(e){return\"number\"==typeof e&&(t=e),t},pointAboveOrOnLine:function(e,r,n){var i=r[0],a=r[1],o=n[0],s=n[1],l=e[0];return(o-i)*(e[1]-a)-(s-a)*(l-i)>=-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;return!(l<t||l-(a*a+s*s)>-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])<t},pointsSameY:function(e,r){return Math.abs(e[1]-r[1])<t},pointsSame:function(t,r){return e.pointsSameX(t,r)&&e.pointsSameY(t,r)},pointsCompare:function(t,r){return e.pointsSameX(t,r)?e.pointsSameY(t,r)?0:t[1]<r[1]?-1:1:t[0]<r[0]?-1:1},pointsCollinear:function(e,r,n){var i=e[0]-r[0],a=e[1]-r[1],o=r[0]-n[0],s=r[1]-n[1];return Math.abs(i*s-o*a)<t},linesIntersect:function(e,r,n,i){var a=r[0]-e[0],o=r[1]-e[1],s=i[0]-n[0],l=i[1]-n[1],u=a*l-o*s;if(Math.abs(u)<t)return!1;var c=e[0]-n[0],h=e[1]-n[1],f=(s*h-l*c)/u,p=(a*h-o*c)/u,d={alongA:0,alongB:0,pt:[e[0]+f*a,e[1]+f*o]};return d.alongA=f<=-t?-2:f<t?-1:f-1<=-t?0:f-1<t?1:2,d.alongB=p<=-t?-2:p<t?-1:p-1<=-t?0:p-1<t?1:2,d},pointInsideRegion:function(e,r){for(var n=e[0],i=e[1],a=r[r.length-1][0],o=r[r.length-1][1],s=!1,l=0;l<r.length;l++){var u=r[l][0],c=r[l][1];c-i>t!=o-i>t&&(a-u)*(i-c)/(o-c)+u-n>t&&(s=!s),a=u,o=c}return s}};return e}();function lc(t,e,r){var n=ic.segments(t),i=ic.segments(e),a=r(ic.combine(n,i));return ic.polygon(a)}ic={buildLog:function(t){return!0===t?oc=Qu():!1===t&&(oc=!1),!1!==oc&&oc.list},epsilon:function(t){return sc.epsilon(t)},segments:function(t){var e=ec(!0,sc,oc);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:ec(!1,sc,oc).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:ac.union(t.combined,oc),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:ac.intersect(t.combined,oc),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:ac.difference(t.combined,oc),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:ac.differenceRev(t.combined,oc),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:ac.xor(t.combined,oc),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:rc(t.segments,sc,oc),inverted:t.inverted}},polygonFromGeoJSON:function(t){return $u.toPolygon(ic,t)},polygonToGeoJSON:function(t){return $u.fromPolygon(ic,sc,t)},union:function(t,e){return lc(t,e,ic.selectUnion)},intersect:function(t,e){return lc(t,e,ic.selectIntersect)},difference:function(t,e){return lc(t,e,ic.selectDifference)},differenceRev:function(t,e){return lc(t,e,ic.selectDifferenceRev)},xor:function(t,e){return lc(t,e,ic.selectXor)}},\"object\"==typeof window&&(window.PolyBool=ic);var uc=ic,cc={},hc=Vt.dot,fc=t.BADNUM,pc=cc={};pc.tester=function(t){if(Array.isArray(t[0][0]))return pc.multitester(t);var e,r=t.slice(),n=r[0][0],i=n,a=r[0][1],o=a;for(r.push(r[0]),e=1;e<r.length;e++)n=Math.min(n,r[e][0]),i=Math.max(i,r[e][0]),a=Math.min(a,r[e][1]),o=Math.max(o,r[e][1]);var s,l=!1;5===r.length&&(r[0][0]===r[1][0]?r[2][0]===r[3][0]&&r[0][1]===r[3][1]&&r[1][1]===r[2][1]&&(l=!0,s=function(t){return t[0]===r[0][0]}):r[0][1]===r[1][1]&&r[2][1]===r[3][1]&&r[0][0]===r[3][0]&&r[1][0]===r[2][0]&&(l=!0,s=function(t){return t[1]===r[0][1]}));var u=!0,c=r[0];for(e=1;e<r.length;e++)if(c[0]!==r[e][0]||c[1]!==r[e][1]){u=!1;break}return{xmin:n,xmax:i,ymin:a,ymax:o,pts:r,contains:l?function(t,e){var r=t[0],l=t[1];return!(r===fc||r<n||r>i||l===fc||l<a||l>o||e&&s(t))}:function(t,e){var s=t[0],l=t[1];if(s===fc||s<n||s>i||l===fc||l<a||l>o)return!1;var u,c,h,f,p,d=r.length,g=r[0][0],v=r[0][1],m=0;for(u=1;u<d;u++)if(c=g,h=v,g=r[u][0],v=r[u][1],!(s<(f=Math.min(c,g))||s>Math.max(c,g)||l>Math.max(h,v)))if(l<Math.min(h,v))s!==f&&m++;else{if(l===(p=g===c?l:h+(s-c)*(v-h)/(g-c)))return 1!==u||!e;l<=p&&s!==f&&m++}return m%2==1},isRect:l,degenerate:u}},pc.multitester=function(t){for(var e=[],r=t[0][0][0],n=r,i=t[0][0][1],a=i,o=0;o<t.length;o++){var s=pc.tester(t[o]);s.subtract=t[o].subtract,e.push(s),r=Math.min(r,s.xmin),n=Math.max(n,s.xmax),i=Math.min(i,s.ymin),a=Math.max(a,s.ymax)}return{xmin:r,xmax:n,ymin:i,ymax:a,pts:[],contains:function(t,r){for(var n=!1,i=0;i<e.length;i++)e[i].contains(t,r)&&(n=!1===e[i].subtract);return n},isRect:!1,degenerate:!1}};var dc=pc.isSegmentBent=function(t,e,r,n){var i,a,o,s=t[e],l=[t[r][0]-s[0],t[r][1]-s[1]],u=hc(l,l),c=Math.sqrt(u),h=[-l[1]/c,l[0]/c];for(i=e+1;i<r;i++)if(a=[t[i][0]-s[0],t[i][1]-s[1]],(o=hc(a,l))<0||o>u||Math.abs(hc(a,h))>n)return!0;return!1};pc.filter=function(t,e){var r=[t[0]],n=0,i=0;function a(a){t.push(a);var o=r.length,s=n;r.splice(i+1);for(var l=s+1;l<t.length;l++)(l===t.length-1||dc(t,s,l+1,e))&&(r.push(t[l]),r.length<o-2&&(n=l,i=r.length-1),s=l)}t.length>1&&a(t.pop());return{addPt:a,raw:t,filtered:r}};var gc=Ya.makeEventData,vc=cc.filter,mc=cc.tester,yc=cc.multitester,xc=Te.MINSELECT;function bc(t){return t._id}var _c=function(t,e,r,n,i){var a,o,s,l,u=n.gd,c=u._fullLayout,h=c._zoomlayer,f=n.element.getBoundingClientRect(),p=n.plotinfo,d=p.xaxis._offset,g=p.yaxis._offset,v=e-f.left,m=r-f.top,y=v,x=m,b=\"M\"+v+\",\"+m,_=n.xaxes[0]._length,w=n.yaxes[0]._length,M=n.xaxes.map(bc),A=n.yaxes.map(bc),k=n.xaxes.concat(n.yaxes),T=t.altKey;(t.shiftKey||t.altKey)&&p.selection&&p.selection.polygons&&!n.polygons?(n.polygons=p.selection.polygons,n.mergedPolygons=p.selection.mergedPolygons):(!t.shiftKey&&!t.altKey||(t.shiftKey||t.altKey)&&!p.selection)&&(p.selection={},p.selection.polygons=n.polygons=[],p.selection.mergedPolygons=n.mergedPolygons=[]),\"lasso\"===i&&(a=vc([[v,m]],Te.BENDPX));var S=h.selectAll(\"path.select-outline-\"+p.id).data([1,2]);S.enter().append(\"path\").attr(\"class\",function(t){return\"select-outline select-outline-\"+t+\" select-outline-\"+p.id}).attr(\"transform\",\"translate(\"+d+\", \"+g+\")\").attr(\"d\",b+\"Z\");var E,C,L,z,P,I,D=h.append(\"path\").attr(\"class\",\"zoombox-corners\").style({fill:Oe.background,stroke:Oe.defaultLine,\"stroke-width\":1}).attr(\"transform\",\"translate(\"+d+\", \"+g+\")\").attr(\"d\",\"M0,0Z\"),O=[],R=c._uid+Te.SELECTID,F=[];for(E=0;E<u.calcdata.length;E++)if(!0===(L=(C=u.calcdata[E])[0].trace).visible&&L._module&&L._module.selectPoints)if(n.subplot)L.subplot!==n.subplot&&L.geo!==n.subplot||O.push({selectPoints:L._module.selectPoints,style:L._module.style,cd:C,xaxis:n.xaxes[0],yaxis:n.yaxes[0]});else{if(-1===M.indexOf(L.xaxis))continue;if(-1===A.indexOf(L.yaxis))continue;O.push({selectPoints:L._module.selectPoints,style:L._module.style,cd:C,xaxis:ri.getFromId(u,L.xaxis),yaxis:ri.getFromId(u,L.yaxis)})}function B(t){var e=\"y\"===t._id.charAt(0)?1:0;return function(r){return t.p2d(r[e])}}function N(t,e){return t-e}I=p.fillRangeItems?p.fillRangeItems:\"select\"===i?function(t,e){var r=t.range={};for(E=0;E<k.length;E++){var n=k[E],i=n._id.charAt(0);r[n._id]=[n.p2d(e[i+\"min\"]),n.p2d(e[i+\"max\"])].sort(N)}}:function(t,e,r){var n=t.lassoPoints={};for(E=0;E<k.length;E++){var i=k[E];n[i._id]=r.filtered.map(B(i))}},n.moveFn=function(t,e){y=Math.max(0,Math.min(_,t+v)),x=Math.max(0,Math.min(w,e+m));var r=Math.abs(y-v),c=Math.abs(x-m);\"select\"===i?c<Math.min(.6*r,xc)?((l=[[v,0],[v,w],[y,w],[y,0]]).xmin=Math.min(v,y),l.xmax=Math.max(v,y),l.ymin=Math.min(0,w),l.ymax=Math.max(0,w),D.attr(\"d\",\"M\"+l.xmin+\",\"+(m-xc)+\"h-4v\"+2*xc+\"h4ZM\"+(l.xmax-1)+\",\"+(m-xc)+\"h4v\"+2*xc+\"h-4Z\")):r<Math.min(.6*c,xc)?((l=[[0,m],[0,x],[_,x],[_,m]]).xmin=Math.min(0,_),l.xmax=Math.max(0,_),l.ymin=Math.min(m,x),l.ymax=Math.max(m,x),D.attr(\"d\",\"M\"+(v-xc)+\",\"+l.ymin+\"v-4h\"+2*xc+\"v4ZM\"+(v-xc)+\",\"+(l.ymax-1)+\"v4h\"+2*xc+\"v-4Z\")):((l=[[v,m],[v,x],[y,x],[y,m]]).xmin=Math.min(v,y),l.xmax=Math.max(v,y),l.ymin=Math.min(m,x),l.ymax=Math.max(m,x),D.attr(\"d\",\"M0,0Z\")):\"lasso\"===i&&(a.addPt([y,x]),l=a.filtered),n.polygons&&n.polygons.length?(s=function(t,e,r){if(r)return uc.difference({regions:t,inverted:!1},{regions:[e],inverted:!1}).regions;return uc.union({regions:t,inverted:!1},{regions:[e],inverted:!1}).regions}(n.mergedPolygons,l,T),l.subtract=T,o=yc(n.polygons.concat([l]))):(s=[l],o=mc(l));var h=[];for(E=0;E<s.length;E++){var f=s[E];h.push(f.join(\"L\")+\"L\"+f[0])}S.attr(\"d\",\"M\"+h.join(\"M\")+\"Z\"),$t.throttle(R,Te.SELECTDELAY,function(){F=[];var t,e,r=[];for(E=0;E<O.length;E++)if(e=(z=O[E]).selectPoints(z,o),r.push(e),t=Mc(e,z),F.length)for(var i=0;i<t.length;i++)F.push(t[i]);else F=t;wc(u,O,P={points:F}),I(P,l,a),n.gd.emit(\"plotly_selecting\",P)})},n.clickFn=function(t,e){D.remove(),$t.done(R).then(function(){if($t.clear(R),2===t){for(S.remove(),E=0;E<O.length;E++)(z=O[E]).selectPoints(z,!1);wc(u,O),u.emit(\"plotly_deselect\",null)}else u.emit(\"plotly_selected\",void 0);yo.click(u,e)})},n.doneFn=function(){D.remove(),$t.done(R).then(function(){$t.clear(R),n.gd.emit(\"plotly_selected\",P),l&&n.polygons&&(l.subtract=T,n.polygons.push(l),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,s))})}};function wc(t,e,r){var n,i,a;if(r){var o=r.points||[];for(n=0;n<e.length;n++)(a=e[n].cd[0].trace).selectedpoints=[],a._input.selectedpoints=[];for(n=0;n<o.length;n++){var s=o[n],l=s.data,u=s.fullData;s.pointIndices?([].push.apply(l.selectedpoints,s.pointIndices),[].push.apply(u.selectedpoints,s.pointIndices)):(l.selectedpoints.push(s.pointIndex),u.selectedpoints.push(s.pointIndex))}}else for(n=0;n<e.length;n++)delete(a=e[n].cd[0].trace).selectedpoints,delete a._input.selectedpoints,e[n].cd[0].t&&e[n].cd[0].t.scene&&e[n].cd[0].t.scene.clearSelect();for(n=0;n<e.length;n++)(i=e[n]).style&&i.style(t,i.cd)}function Mc(t,e){if(Array.isArray(t))for(var r=e.cd,n=e.cd[0].trace,i=0;i<t.length;i++)t[i]=gc(t[i],n,r);return t}var Ac=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];++r<e;)n+=t[r-1][1]*t[r][0]-t[r-1][0]*t[r][1];return n<=0}(r)?e.push(r):t.push([r])}),e.forEach(function(e){var r=e[0];t.some(function(t){if(function(t,e){for(var r=e[0],n=e[1],i=!1,a=0,o=t.length,s=o-1;a<o;s=a++){var l=t[a],u=l[0],c=l[1],h=t[s],f=h[0],p=h[1];c>n^p>n&&r<(f-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 h=1e-6,f=h*h,p=Math.PI,d=p/2,g=(Math.sqrt(p),p/180),v=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)>h;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;o<s&&t>a[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<c;++u){var h=o[u];if(h[0][0]<=t&&t<h[1][0]&&h[0][1]<=a&&a<h[1][1]){var f=e.invert(t-e(s[u][1][0],0)[0],a);return f[0]+=s[u][1][0],l(i(f[0],f[1]),[t,a])?f:null}}});var a=t.geo.projection(i),o=a.stream;function s(t,e){for(var r,n,i,a=-1,o=t.length,s=t[0],l=[];++a<o;){n=((r=t[a])[0]-s[0])/e,i=(r[1]-s[1])/e;for(var u=0;u<e;++u)l.push([s[0]+u*n,s[1]+u*i]);s=r}return l.push(r),l}function l(t,e){return Math.abs(t[0]-e[0])<h&&Math.abs(t[1]-e[1])<h}return a.stream=function(e){var r=a.rotate(),i=o(e),l=(a.rotate([0,0]),o(e));return a.rotate(r),i.sphere=function(){t.geo.stream(function(){for(var e=1e-6,r=[],i=0,a=n[0].length;i<a;++i){var o=n[0][i],l=180*o[0][0]/p,u=180*o[0][1]/p,c=180*o[1][1]/p,h=180*o[2][0]/p,f=180*o[2][1]/p;r.push(s([[l+e,u+e],[l+e,c-e],[h-e,c-e],[h-e,f+e]],30))}for(var i=n[1].length-1;i>=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,h=180*o[2][0]/p,f=180*o[2][1]/p;r.push(s([[h-e,f-e],[h-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 M(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 k(t,e){return[3*t/(2*p)*Math.sqrt(p*p/3-e*e),e]}function T(t,e){return[t,1.25*Math.log(Math.tan(p/4+.4*e))]}function S(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)>h&&--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(M),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}).raw=M,k.invert=function(t,e){return[2/3*p*t/Math.sqrt(p*p/3-e*e),e]},(t.geo.kavrayskiy7=function(){return x(k)}).raw=k,T.invert=function(t,e){return[t,2.5*Math.atan(Math.exp(.8*e))-.625*p]},(t.geo.miller=function(){return x(T)}).raw=T,S(p);var E=function(t,e,r){var n=S(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(E)}).raw=E,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)>h&&--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 z(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],h=r[1];return[t*(l+a*(c-o)/2+a*a*(c-2*l+o)/2),(e>0?d:-d)*(u+a*(h-s)/2+a*a*(h-2*u+s)/2)]}function P(t,e){return[t*Math.cos(e),e]}function I(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=I(t,e);return[(r[0]+t/d)/2,(r[1]+e)/2]}L.forEach(function(t){t[1]*=1.0144}),z.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,h=2*(Math.abs(r)-s)/u,p=c/u,m=h*(1-p*h*(1-2*p*h));if(m>=0||1===a){n=(e>=0?5:-5)*(m+i);var y,x=50;do{m=(i=Math.min(18,Math.abs(n)/5))-(a=Math.floor(i)),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)*v}while(Math.abs(y)>f&&--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*g]},(t.geo.robinson=function(){return x(z)}).raw=z,P.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return x(P)}).raw=P,I.invert=function(t,e){if(!(t*t+4*e*e>p*p+h)){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),f=Math.sin(2*n),d=u*u,g=c*c,v=s*s,m=1-g*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*(g*v+x*c*l*d),M=a*(.5*o*f-2*x*u*s),A=.25*a*(f*s-x*u*g*o),k=a*(d*l+x*v*c),T=M*A-k*w;if(!T)break;var S=(_*M-b*k)/T,E=(b*A-_*w)/T;r-=S,n-=E}while((Math.abs(S)>h||Math.abs(E)>h)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return x(I)}).raw=I,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,f=Math.sin(r),p=Math.cos(r/2),g=Math.sin(r/2),v=g*g,m=1-c*p*p,x=m?y(o*p)*Math.sqrt(a=1/m):a=0,b=.5*(2*x*o*g+r/d)-t,_=.5*(x*s+n)-e,w=.5*a*(c*v+x*o*p*u)+.5/d,M=a*(f*l/4-x*s*g),A=.125*a*(l*g-x*s*c*f),k=.5*a*(u*p+x*v*o)+.5,T=M*A-k*w,S=(_*M-b*k)/T,E=(b*A-_*w)/T;r-=S,n-=E}while((Math.abs(S)>h||Math.abs(E)>h)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return x(D)}).raw=D},kc=Math.PI/180,Tc=180/Math.PI,Sc={cursor:\"pointer\"},Ec={cursor:\"auto\"};var Cc=function(t,e){var r=t.projection;return(e._isScoped?Pc:e._isClipped?Dc:Ic)(t,r)};function Lc(t,r){return e.behavior.zoom().translate(r.translate()).scale(r.scale())}function zc(t,e,r){var n=t.id,i=t.graphDiv,a=i.layout[n],o=i._fullLayout[n],s={};function l(t,e){var r=ne.nestedProperty(o,t);r.get()!==e&&(r.set(e),ne.nestedProperty(a,t).set(e),s[n+\".\"+t]=e)}r(l),l(\"projection.scale\",e.scale()/t.fitScale),i.emit(\"plotly_relayout\",s)}function Pc(t,r){var n=Lc(0,r);function i(e){var n=r.invert(t.midPt);e(\"center.lon\",n[0]),e(\"center.lat\",n[1])}return n.on(\"zoomstart\",function(){e.select(this).style(Sc)}).on(\"zoom\",function(){r.scale(e.event.scale).translate(e.event.translate),t.render()}).on(\"zoomend\",function(){e.select(this).style(Ec),zc(t,r,i)}),n}function Ic(t,r){var n,i,a,o,s,l,u,c,h=Lc(0,r),f=2;function p(t){return r.invert(t)}function d(e){var n=r.rotate(),i=r.invert(t.midPt);e(\"projection.rotation.lon\",-n[0]),e(\"center.lon\",i[0]),e(\"center.lat\",i[1])}return h.on(\"zoomstart\",function(){e.select(this).style(Sc),n=e.mouse(this),i=r.rotate(),a=r.translate(),o=i,s=p(n)}).on(\"zoom\",function(){if(l=e.mouse(this),g=r(p(d=n)),Math.abs(g[0]-d[0])>f||Math.abs(g[1]-d[1])>f)return h.scale(r.scale()),void h.translate(r.translate());var d,g;r.scale(e.event.scale),r.translate([a[0],e.event.translate[1]]),s?p(l)&&(c=p(l),u=[o[0]+(c[0]-s[0]),i[1],i[2]],r.rotate(u),o=u):s=p(n=l),t.render()}).on(\"zoomend\",function(){e.select(this).style(Ec),zc(t,r,d)}),h}function Dc(t,r){var n,i={r:r.rotate(),k:r.scale()},a=Lc(0,r),o=function(t){var r=0,n=arguments.length,i=[];for(;++r<n;)i.push(arguments[r]);var a=e.dispatch.apply(null,i);return a.of=function(r,n){return function(i){var o;try{o=i.sourceEvent=e.event,i.target=t,e.event=i,a[i.type].apply(r,n)}finally{e.event=o}}},a}(a,\"zoomstart\",\"zoom\",\"zoomend\"),s=0,l=a.on;function u(t){var e=r.rotate();t(\"projection.rotation.lon\",-e[0]),t(\"projection.rotation.lat\",-e[1])}return a.on(\"zoomstart\",function(){e.select(this).style(Sc);var t,u,c,h,f,p,d,g,v,m,y,x=e.mouse(this),b=r.rotate(),_=b,w=r.translate(),M=(u=.5*(t=b)[0]*kc,c=.5*t[1]*kc,h=.5*t[2]*kc,f=Math.sin(u),p=Math.cos(u),d=Math.sin(c),g=Math.cos(c),v=Math.sin(h),m=Math.cos(h),[p*g*m+f*d*v,f*g*m-p*d*v,p*d*m+f*g*v,p*g*v-f*d*m]);n=Oc(r,x),l.call(a,\"zoom\",function(){var t,a,s,l,u,c,h,f,p,d,g=e.mouse(this);if(r.scale(i.k=e.event.scale),n){if(Oc(r,g)){r.rotate(b).translate(w);var v=Oc(r,g),m=function(t,e){if(!t||!e)return;var r=function(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]]}(t,e),n=Math.sqrt(Nc(r,r)),i=.5*Math.acos(Math.max(-1,Math.min(1,Nc(t,e)))),a=Math.sin(i)/n;return n&&[Math.cos(i),r[2]*a,-r[1]*a,r[0]*a]}(n,v),y=function(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*Tc,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*Tc,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*Tc]}((a=m,s=(t=M)[0],l=t[1],u=t[2],c=t[3],h=a[0],f=a[1],p=a[2],d=a[3],[s*h-l*f-u*p-c*d,s*f+l*h+u*d-c*p,s*p-l*d+u*h+c*f,s*d+l*p-u*f+c*h])),A=i.r=function(t,e,r){var n=Bc(e,2,t[0]);n=Bc(n=Bc(n,1,t[1]),0,t[2]-r[2]);var i,a,o=e[0],s=e[1],l=e[2],u=n[0],c=n[1],h=n[2],f=Math.atan2(s,o)*Tc,p=Math.sqrt(o*o+s*s);Math.abs(c)>p?(a=(c>0?90:-90)-f,i=0):(a=Math.asin(c/p)*Tc-f,i=Math.sqrt(p*p-c*c));var d=180-a-2*f,g=(Math.atan2(h,u)-Math.atan2(l,i))*Tc,v=(Math.atan2(h,u)-Math.atan2(l,-i))*Tc,m=Rc(r[0],r[1],a,g),y=Rc(r[0],r[1],d,v);return m<=y?[a,g,r[2]]:[d,v,r[2]]}(y,n,_);isFinite(A[0])&&isFinite(A[1])&&isFinite(A[2])||(A=_),r.rotate(A),_=A}}else n=Oc(r,x=g);o.of(this,arguments)({type:\"zoom\"})}),y=o.of(this,arguments),s++||y({type:\"zoomstart\"})}).on(\"zoomend\",function(){var n;e.select(this).style(Ec),l.call(a,\"zoom\",null),n=o.of(this,arguments),--s||n({type:\"zoomend\"}),zc(t,r,u)}).on(\"zoom.redraw\",function(){t.render()}),e.rebind(a,o,\"on\")}function Oc(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&function(t){var e=t[0]*kc,r=t[1]*kc,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}(r)}function Rc(t,e,r,n){var i=Fc(r-t),a=Fc(n-e);return Math.sqrt(i*i+a*a)}function Fc(t){return(t%360+540)%360-180}function Bc(t,e,r){var n=r*kc,i=t.slice(),a=0===e?1:0,o=2===e?1:2,s=Math.cos(n),l=Math.sin(n);return i[a]=t[a]*s-t[o]*l,i[o]=t[o]*s+t[a]*l,i}function Nc(t,e){for(var r=0,n=0,i=t.length;n<i;++n)r+=t[n]*e[n];return r}var jc=Wu.feature;function Vc(t){this.id=t.id,this.graphDiv=t.graphDiv,this.container=t.container,this.topojsonURL=t.topojsonURL,this.isStatic=t.staticPlot,this.topojsonName=null,this.topojson=null,this.projection=null,this.viewInitial=null,this.fitScale=null,this.bounds=null,this.midPt=null,this.hasChoropleth=!1,this.traceHash={},this.layers={},this.basePaths={},this.dataPaths={},this.dataPoints={},this.clipDef=null,this.clipRect=null,this.bgRect=null,this.makeFramework()}Ac(e);var Uc=Vc.prototype;Uc.plot=function(t,e,r){var n=this,i=e[this.id],a=Xu.getTopojsonName(i);null===n.topojson||a!==n.topojsonName?(n.topojsonName=a,void 0===PlotlyGeoAssets.topojson[n.topojsonName]?r.push(n.fetchTopojson().then(function(r){PlotlyGeoAssets.topojson[n.topojsonName]=r,n.topojson=r,n.update(t,e)})):(n.topojson=PlotlyGeoAssets.topojson[n.topojsonName],n.update(t,e))):n.update(t,e)},Uc.fetchTopojson=function(){var t=Xu.getTopojsonPath(this.topojsonURL,this.topojsonName);return new Promise(function(r,n){e.json(t,function(e,i){if(e)return 404===e.status?n(new Error([\"plotly.js could not find topojson file at\",t,\".\",\"Make sure the *topojsonURL* plot config option\",\"is set properly.\"].join(\" \"))):n(new Error([\"unexpected error while fetching topojson file at\",t].join(\" \")));r(i)})})},Uc.update=function(t,e){var r=e[this.id];if(!this.updateProjection(e,r)){this.hasChoropleth=!1;for(var n=0;n<t.length;n++)if(\"choropleth\"===t[n][0].trace.type){this.hasChoropleth=!0;break}this.viewInitial||this.saveViewInitial(r),this.updateBaseLayers(e,r),this.updateDims(e,r),this.updateFx(e,r),_n.generalUpdatePerTraceModule(this.graphDiv,this,t,r);var i=this.layers.frontplot.select(\".scatterlayer\");this.dataPoints.point=i.selectAll(\".point\"),this.dataPoints.text=i.selectAll(\"text\"),this.dataPaths.line=i.selectAll(\".js-line\");var a=this.layers.backplot.select(\".choroplethlayer\");this.dataPaths.choropleth=a.selectAll(\"path\"),this.render()}},Uc.updateProjection=function(t,r){var n=t._size,i=r.domain,a=r.projection,o=a.rotation||{},s=r.center||{},l=this.projection=function(t){for(var r=t.projection.type,n=e.geo[Yu.projNames[r]](),i=t._isClipped?Yu.lonaxisSpan[r]/2:null,a=[\"center\",\"rotate\",\"parallels\",\"clipExtent\"],o=function(t){return t?n:[]},s=0;s<a.length;s++){var l=a[s];\"function\"!=typeof n[l]&&(n[l]=o)}n.isLonLatOverEdges=function(t){if(null===n(t))return!0;if(i){var r=n.rotate();return e.geo.distance(t,[-r[0],-r[1]])>i*Math.PI/180}return!1},n.getPath=function(){return e.geo.path().projection(n)},n.getBounds=function(t){return n.getPath().bounds(t)},n.fitExtent=function(t,e){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=n.clipExtent&&n.clipExtent();n.scale(150).translate([0,0]),a&&n.clipExtent(null);var o=n.getBounds(e),s=Math.min(r/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),l=+t[0][0]+(r-s*(o[1][0]+o[0][0]))/2,u=+t[0][1]+(i-s*(o[1][1]+o[0][1]))/2;return a&&n.clipExtent(a),n.scale(150*s).translate([l,u])},n.precision(Yu.precision),i&&n.clipAngle(i-Yu.clipPad);return n}(r);l.center([s.lon-o.lon,s.lat-o.lat]).rotate([-o.lon,-o.lat,o.roll]).parallels(a.parallels);var u=[[n.l+n.w*i.x[0],n.t+n.h*(1-i.y[1])],[n.l+n.w*i.x[1],n.t+n.h*(1-i.y[0])]],c=r.lonaxis,h=r.lataxis,f=function(t,e){var r=Yu.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]]]}}(c.range,h.range);l.fitExtent(u,f);var p=this.bounds=l.getBounds(f),d=this.fitScale=l.scale(),g=l.translate();if(!isFinite(p[0][0])||!isFinite(p[0][1])||!isFinite(p[1][0])||!isFinite(p[1][1])||isNaN(g[0])||isNaN(g[0])){for(var v=this.graphDiv,m=[\"projection.rotation\",\"center\",\"lonaxis.range\",\"lataxis.range\"],y=\"Invalid geo settings, relayout'ing to default view.\",x={},b=0;b<m.length;b++)x[this.id+\".\"+m[b]]=null;return this.viewInitial=null,ne.warn(y),v._promises.push(P.call(\"relayout\",v,x)),y}var _=this.midPt=[(p[0][0]+p[1][0])/2,(p[0][1]+p[1][1])/2];if(l.scale(a.scale*d).translate([g[0]+(_[0]-g[0]),g[1]+(_[1]-g[1])]).clipExtent(p),r._isAlbersUsa){var w=l([s.lon,s.lat]),M=l.translate();l.translate([M[0]-(w[0]-M[0]),M[1]-(w[1]-M[1])])}},Uc.updateBaseLayers=function(t,r){var n=this,i=n.topojson,a=n.layers,o=n.basePaths;function s(t){return\"lonaxis\"===t||\"lataxis\"===t}function l(t){return Boolean(Yu.lineLayers[t])}function u(t){return Boolean(Yu.fillLayers[t])}var c=(this.hasChoropleth?Yu.layersForChoropleth:Yu.layers).filter(function(t){return l(t)||u(t)?r[\"show\"+t]:!s(t)||r[t].showgrid}),h=n.framework.selectAll(\".layer\").data(c,String);h.exit().each(function(t){delete a[t],delete o[t],e.select(this).remove()}),h.enter().append(\"g\").attr(\"class\",function(t){return\"layer \"+t}).each(function(t){var r=a[t]=e.select(this);\"bg\"===t?n.bgRect=r.append(\"rect\").style(\"pointer-events\",\"all\"):s(t)?o[t]=r.append(\"path\").style(\"fill\",\"none\"):\"backplot\"===t?r.append(\"g\").classed(\"choroplethlayer\",!0):\"frontplot\"===t?r.append(\"g\").classed(\"scatterlayer\",!0):l(t)?o[t]=r.append(\"path\").style(\"fill\",\"none\").style(\"stroke-miterlimit\",2):u(t)&&(o[t]=r.append(\"path\").style(\"stroke\",\"none\"))}),h.order(),h.each(function(t){var n=o[t],a=Yu.layerNameToAdjective[t];\"frame\"===t?n.datum(Yu.sphereSVG):l(t)||u(t)?n.datum(jc(i,i.objects[t])):s(t)&&n.datum(function(t,r){var n=r[t].dtick,i=Yu.scopeDefaults[r.scope],a=i.lonaxisRange,o=i.lataxisRange,s=\"lonaxis\"===t?[n]:[0,n];return e.geo.graticule().extent([[a[0],o[0]],[a[1],o[1]]]).step(s)}(t,r)).call(Oe.stroke,r[t].gridcolor).call(Sr.dashLine,\"\",r[t].gridwidth),l(t)?n.call(Oe.stroke,r[a+\"color\"]).call(Sr.dashLine,\"\",r[a+\"width\"]):u(t)&&n.call(Oe.fill,r[a+\"color\"])})},Uc.updateDims=function(t,e){var r=this.bounds,n=(e.framewidth||0)/2,i=r[0][0]-n,a=r[0][1]-n,o=r[1][0]-i+n,s=r[1][1]-a+n;Sr.setRect(this.clipRect,i,a,o,s),this.bgRect.call(Sr.setRect,i,a,o,s).call(Oe.fill,e.bgcolor),this.xaxis._offset=i,this.xaxis._length=o,this.yaxis._offset=a,this.yaxis._length=s},Uc.updateFx=function(t,r){var n=this,i=n.graphDiv,a=n.bgRect,o=t.dragmode;if(!n.isStatic){if(\"pan\"===o)a.node().onmousedown=null,a.call(Cc(n,r)),a.on(\"dblclick.zoom\",function(){var t=n.viewInitial,e={};for(var r in t)e[n.id+\".\"+r]=t[r];P.call(\"relayout\",i,e),i.emit(\"plotly_doubleclick\",null)});else if(\"select\"===o||\"lasso\"===o){var s;a.on(\".zoom\",null),\"select\"===o?s=function(t,e){(t.range={})[n.id]=[u([e.xmin,e.ymin]),u([e.xmax,e.ymax])]}:\"lasso\"===o&&(s=function(t,e,r){(t.lassoPoints={})[n.id]=r.filtered.map(u)});var l={element:n.bgRect.node(),gd:i,plotinfo:{xaxis:n.xaxis,yaxis:n.yaxis,fillRangeItems:s},xaxes:[n.xaxis],yaxes:[n.yaxis],subplot:n.id,clickFn:function(e){2===e&&t._zoomlayer.selectAll(\".select-outline\").remove()},prepFn:function(t,e,r){_c(t,e,r,l,o)}};Ua.init(l)}a.on(\"mousemove\",function(){var t=n.projection.invert(e.mouse(this));if(!t||isNaN(t[0])||isNaN(t[1]))return Ua.unhover(i,e.event);n.xaxis.p2c=function(){return t[0]},n.yaxis.p2c=function(){return t[1]},yo.hover(i,e.event,n.id)}),a.on(\"mouseout\",function(){Ua.unhover(i,e.event)}),a.on(\"click\",function(){yo.click(i,e.event)})}function u(t){return n.projection.invert([t[0]+n.xaxis._offset,t[1]+n.yaxis._offset])}},Uc.makeFramework=function(){var t=this,r=t.graphDiv._fullLayout,n=\"clip\"+r._uid+t.id;t.clipDef=r._clips.append(\"clipPath\").attr(\"id\",n),t.clipRect=t.clipDef.append(\"rect\"),t.framework=e.select(t.container).append(\"g\").attr(\"class\",\"geo \"+t.id).call(Sr.setClipUrl,n),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\"},ri.setConvert(t.mockAxis,r)},Uc.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}},Uc.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)};var qc={},Hc=m.extendFlat;qc.attributes=function(t,e){t=t||{},e=e||{};var r={valType:\"info_array\",editType:t.editType,items:[{valType:\"number\",min:0,max:1,editType:t.editType},{valType:\"number\",min:0,max:1,editType:t.editType}],dflt:[0,1]},n=(t.name&&t.name,t.trace,e.description&&e.description,{x:Hc({},r,{}),y:Hc({},r,{}),editType:t.editType});return t.noGridCell||(n.row={valType:\"integer\",min:0,dflt:0,editType:t.editType},n.column={valType:\"integer\",min:0,dflt:0,editType:t.editType}),n},qc.defaults=function(t,e,r,n){var i=n&&n.x||[0,1],a=n&&n.y||[0,1],o=e.grid;if(o){var s=r(\"domain.column\");void 0!==s&&(s<o.columns?i=o._domains.x[s]:delete t.domain.column);var l=r(\"domain.row\");void 0!==l&&(l<o.rows?a=o._domains.y[l]:delete t.domain.row)}r(\"domain.x\",i),r(\"domain.y\",a)};var Gc=qc.attributes,Wc=ye.overrideAll,Yc={range:{valType:\"info_array\",items:[{valType:\"number\"},{valType:\"number\"}]},showgrid:{valType:\"boolean\",dflt:!1},tick0:{valType:\"number\"},dtick:{valType:\"number\"},gridcolor:{valType:\"color\",dflt:C.lightLine},gridwidth:{valType:\"number\",min:0,dflt:1}},Xc=Wc({domain:Gc({name:\"geo\"},{}),resolution:{valType:\"enumerated\",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:\"enumerated\",values:Object.keys(Yu.scopeDefaults),dflt:\"world\"},projection:{type:{valType:\"enumerated\",values:Object.keys(Yu.projNames)},rotation:{lon:{valType:\"number\"},lat:{valType:\"number\"},roll:{valType:\"number\"}},parallels:{valType:\"info_array\",items:[{valType:\"number\"},{valType:\"number\"}]},scale:{valType:\"number\",min:0,dflt:1}},center:{lon:{valType:\"number\"},lat:{valType:\"number\"}},showcoastlines:{valType:\"boolean\"},coastlinecolor:{valType:\"color\",dflt:C.defaultLine},coastlinewidth:{valType:\"number\",min:0,dflt:1},showland:{valType:\"boolean\",dflt:!1},landcolor:{valType:\"color\",dflt:Yu.landColor},showocean:{valType:\"boolean\",dflt:!1},oceancolor:{valType:\"color\",dflt:Yu.waterColor},showlakes:{valType:\"boolean\",dflt:!1},lakecolor:{valType:\"color\",dflt:Yu.waterColor},showrivers:{valType:\"boolean\",dflt:!1},rivercolor:{valType:\"color\",dflt:Yu.waterColor},riverwidth:{valType:\"number\",min:0,dflt:1},showcountries:{valType:\"boolean\"},countrycolor:{valType:\"color\",dflt:C.defaultLine},countrywidth:{valType:\"number\",min:0,dflt:1},showsubunits:{valType:\"boolean\"},subunitcolor:{valType:\"color\",dflt:C.defaultLine},subunitwidth:{valType:\"number\",min:0,dflt:1},showframe:{valType:\"boolean\"},framecolor:{valType:\"color\",dflt:C.defaultLine},framewidth:{valType:\"number\",min:0,dflt:1},bgcolor:{valType:\"color\",dflt:C.background},lonaxis:Yc,lataxis:Yc},\"plot\",\"from-root\"),Zc=qc.defaults,Jc=function(t,e,r,n){var i,a,o=n.type,s=n.attributes,l=n.handleDefaults,u=n.partition||\"x\",c=e._subplots[o],h=c.length;function f(t,e){return ne.coerce(i,a,s,t,e)}for(var p=0;p<h;p++){var d=c[p];i=t[d]?t[d]:t[d]={},e[d]=a={};var g={};g[u]=[p/h,(p+1)/h],Zc(a,e,f,g),n.id=d,l(i,a,f,n)}},Kc=Yu.axesNames;function Qc(t,e,r){var n=r(\"resolution\"),i=r(\"scope\"),a=Yu.scopeDefaults[i],o=r(\"projection.type\",a.projType),s=e._isAlbersUsa=\"albers usa\"===o;s&&(i=e.scope=\"usa\");var l=e._isScoped=\"world\"!==i,u=e._isConic=-1!==o.indexOf(\"conic\");e._isClipped=!!Yu.lonaxisSpan[o];for(var c=0;c<Kc.length;c++){var h,f=Kc[c],p=[30,10][c];if(l)h=a[f+\"Range\"];else{var d=Yu[f+\"Span\"],g=(d[o]||d[\"*\"])/2,v=r(\"projection.rotation.\"+f.substr(0,3),a.projRotate[c]);h=[v-g,v+g]}r(f+\".tick0\",r(f+\".range\",h)[0]),r(f+\".dtick\",p),r(f+\".showgrid\")&&(r(f+\".gridcolor\"),r(f+\".gridwidth\"))}var m=e.lonaxis.range,y=e.lataxis.range,x=m[0],b=m[1];x>0&&b<0&&(b+=360);var _,w,M,A=(x+b)/2;if(!s){var k=l?a.projRotate:[A,0,0];_=r(\"projection.rotation.lon\",k[0]),r(\"projection.rotation.lat\",k[1]),r(\"projection.rotation.roll\",k[2]),r(\"showcoastlines\",!l)&&(r(\"coastlinecolor\"),r(\"coastlinewidth\")),r(\"showocean\")&&r(\"oceancolor\")}(s?(w=-96.6,M=38.7):(w=l?A:_,M=(y[0]+y[1])/2),r(\"center.lon\",w),r(\"center.lat\",M),u)&&r(\"projection.parallels\",a.projParallels||[0,60]);r(\"projection.scale\"),r(\"showland\")&&r(\"landcolor\"),r(\"showlakes\")&&r(\"lakecolor\"),r(\"showrivers\")&&(r(\"rivercolor\"),r(\"riverwidth\")),r(\"showcountries\",l&&\"usa\"!==i)&&(r(\"countrycolor\"),r(\"countrywidth\")),(\"usa\"===i||\"north america\"===i&&50===n)&&(r(\"showsubunits\",!0),r(\"subunitcolor\"),r(\"subunitwidth\")),l||r(\"showframe\",!0)&&(r(\"framecolor\"),r(\"framewidth\")),r(\"bgcolor\")}var $c={},th=sa.getSubplotCalcData,eh=ne.counterRegex,rh=\"geo\";$c.name=rh,$c.attr=rh,$c.idRoot=rh,$c.idRegex=$c.attrRegex=eh(rh),$c.attributes={geo:{valType:\"subplotid\",dflt:\"geo\",editType:\"calc\"}},$c.layoutAttributes=Xc,$c.supplyLayoutDefaults=function(t,e,r){Jc(t,e,0,{type:\"geo\",attributes:Xc,handleDefaults:Qc,partition:\"y\"})},$c.plot=function(t){var e=t._fullLayout,r=t.calcdata,n=e._subplots.geo;void 0===window.PlotlyGeoAssets&&(window.PlotlyGeoAssets={topojson:{}});for(var i=0;i<n.length;i++){var a=n[i],o=th(r,rh,a),s=e[a]._subplot;s||(s=new Vc({id:a,graphDiv:t,container:e._geolayer.node(),topojsonURL:t._context.topojsonURL,staticPlot:t._context.staticPlot}),e[a]._subplot=s),s.plot(o,e,t._promises)}},$c.clean=function(t,e,r,n){for(var i=n._subplots.geo||[],a=0;a<i.length;a++){var o=i[a],s=n[o]._subplot;!e[o]&&s&&(s.framework.remove(),s.clipDef.remove())}},$c.updateFx=function(t){for(var e=t._subplots.geo,r=0;r<e.length;r++){var n=t[e[r]];n._subplot.updateFx(t,n)}};var nh=Ae.dash,ih=m.extendFlat,ah=ye.overrideAll,oh=Zr.marker,sh=Zr.line,lh=oh.line,uh=ah({lon:{valType:\"data_array\"},lat:{valType:\"data_array\"},locations:{valType:\"data_array\"},locationmode:{valType:\"enumerated\",values:[\"ISO-3\",\"USA-states\",\"country names\"],dflt:\"ISO-3\"},mode:ih({},Zr.mode,{dflt:\"markers\"}),text:ih({},Zr.text,{}),hovertext:ih({},Zr.hovertext,{}),textfont:Zr.textfont,textposition:Zr.textposition,line:{color:sh.color,width:sh.width,dash:nh},connectgaps:Zr.connectgaps,marker:ih({symbol:oh.symbol,opacity:oh.opacity,size:oh.size,sizeref:oh.sizeref,sizemin:oh.sizemin,sizemode:oh.sizemode,showscale:oh.showscale,colorbar:oh.colorbar,line:ih({width:lh.width},De()),gradient:oh.gradient},De()),fill:{valType:\"enumerated\",values:[\"none\",\"toself\"],dflt:\"none\"},fillcolor:Zr.fillcolor,selected:Zr.selected,unselected:Zr.unselected,hoverinfo:ih({},E.hoverinfo,{flags:[\"lon\",\"lat\",\"location\",\"text\",\"name\"]})},\"calc\",\"nested\"),ch=m.extendFlat,hh=m.extendDeepAll,fh=uh.marker.line,ph=ch({locations:{valType:\"data_array\",editType:\"calc\"},locationmode:uh.locationmode,z:{valType:\"data_array\",editType:\"calc\"},text:ch({},uh.text,{}),marker:{line:{color:fh.color,width:ch({},fh.width,{dflt:1}),editType:\"calc\"},opacity:{valType:\"number\",arrayOk:!0,min:0,max:1,dflt:1,editType:\"style\"},editType:\"calc\"},selected:{marker:{opacity:uh.selected.marker.opacity,editType:\"plot\"},editType:\"plot\"},unselected:{marker:{opacity:uh.unselected.marker.opacity,editType:\"plot\"},editType:\"plot\"},hoverinfo:ch({},E.hoverinfo,{editType:\"calc\",flags:[\"location\",\"z\",\"text\",\"name\"]})},hh({},Pe,{zmax:{editType:\"calc\"},zmin:{editType:\"calc\"}}),{colorbar:ze}),dh=function(t,e){for(var r=0;r<t.length;r++)t[r].i=r;ne.mergeArray(e.text,t,\"tx\"),ne.mergeArray(e.hovertext,t,\"htx\"),ne.mergeArray(e.customdata,t,\"data\"),ne.mergeArray(e.textposition,t,\"tp\"),e.textfont&&(ne.mergeArray(e.textfont.size,t,\"ts\"),ne.mergeArray(e.textfont.color,t,\"tc\"),ne.mergeArray(e.textfont.family,t,\"tf\"));var n=e.marker;if(n){ne.mergeArray(n.size,t,\"ms\"),ne.mergeArray(n.opacity,t,\"mo\"),ne.mergeArray(n.symbol,t,\"mx\"),ne.mergeArray(n.color,t,\"mc\");var i=n.line;n.line&&(ne.mergeArray(i.color,t,\"mlc\"),ne.mergeArray(i.width,t,\"mlw\"));var a=n.gradient;a&&\"none\"!==a.type&&(ne.mergeArray(a.type,t,\"mgt\"),ne.mergeArray(a.color,t,\"mgc\"))}},gh=t.BADNUM;var vh={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|\\xe7)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|\\xe9)union\",ROU:\"r(o|u|ou)mania\",RUS:\"\\\\brussia|soviet.?union|u\\\\.?s\\\\.?s\\\\.?r|socialist.?republics\",RWA:\"rwanda\",BLM:\"barth(e|\\xe9)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|\\xe3)o.?tom(e|\\xe9)\",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\"},mh={},yh=Object.keys(vh),xh={\"ISO-3\":ne.identity,\"USA-states\":ne.identity,\"country names\":function(t){for(var e=0;e<yh.length;e++){var r=yh[e],n=new RegExp(vh[r]);if(n.test(t.trim().toLowerCase()))return r}return ne.log(\"Unrecognized country name: \"+t+\".\"),!1}};mh.locationToFeature=function(t,e,r){if(!e||\"string\"!=typeof e)return!1;var n=function(t,e){return(0,xh[t])(e)}(t,e);if(n){for(var i=0;i<r.length;i++){var a=r[i];if(a.id===n)return a}ne.log([\"Location with id\",n,\"does not have a matching topojson feature at this resolution.\"].join(\" \"))}return!1};var bh=function(t,r){r&&function(t,r){var n=r[0].trace,i=r[0].node3.selectAll(\".choroplethlocation\"),a=n.marker||{},o=a.line||{},s=Je.makeColorScaleFunc(Je.extractScale(n.colorscale,n.zmin,n.zmax));i.each(function(t){e.select(this).attr(\"fill\",s(t.z)).call(Oe.stroke,t.mlc||o.color).call(Sr.dashLine,\"\",t.mlw||o.width||0).style(\"opacity\",a.opacity)}),Sr.selectedPointStyle(i,n)}(0,r)};var _h=Xu.getTopojsonFeatures,wh=mh.locationToFeature;function Mh(t,e){for(var r=t[0].trace,n=t.length,i=_h(r,e),a=0;a<n;a++){var o=t[a],s=wh(r.locationmode,o.loc,i);s?(o.geojson=s,o.ct=s.properties.ct,o.index=a,o._polygons=Ah(s)):o.geojson=null}}function Ah(t){var e,r,n,i,a=t.geometry,o=a.coordinates,s=t.id,l=[];function u(t){for(var e=0;e<t.length-1;e++)if(t[e][0]>0&&t[e+1][0]<0)return e;return null}switch(e=\"RUS\"===s||\"FJI\"===s?function(t){var e;if(null===u(t))e=t;else for(e=new Array(t.length),i=0;i<t.length;i++)e[i]=[t[i][0]<0?t[i][0]+360:t[i][0],t[i][1]];l.push(cc.tester(e))}:\"ATA\"===s?function(t){var e=u(t);if(null===e)return l.push(cc.tester(t));var r=new Array(t.length+1),n=0;for(i=0;i<t.length;i++)i>e?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 a=cc.tester(r);a.pts.pop(),l.push(a)}:function(t){l.push(cc.tester(t))},a.type){case\"MultiPolygon\":for(r=0;r<o.length;r++)for(n=0;n<o[r].length;n++)e(o[r][n]);break;case\"Polygon\":for(r=0;r<o.length;r++)e(o[r])}return l}var kh=function(t,e){var n=e[0].trace,i=\"cb\"+n.uid,a=n.zmin,o=n.zmax;if(r(a)||(a=ne.aggNums(Math.min,null,n.z)),r(o)||(o=ne.aggNums(Math.max,null,n.z)),t._fullLayout._infolayer.selectAll(\".\"+i).remove(),n.showscale){var s=e[0].t.cb=ns(t,i),l=Je.makeColorScaleFunc(Je.extractScale(n.colorscale,a,o),{noNumericCheck:!0});s.fillcolor(l).filllevels({start:a,end:o,size:(o-a)/254}).options(n.colorbar)()}else _n.autoMargin(t,i)},Th={};Th.attributes=ph,Th.supplyDefaults=function(t,e,r,n){function i(r,n){return ne.coerce(t,e,ph,r,n)}var a,o=i(\"locations\");if(o&&(a=o.length),o&&a){var s=i(\"z\");ne.isArrayOrTypedArray(s)?(s.length>a&&(e.z=s.slice(0,a)),i(\"locationmode\"),i(\"text\"),i(\"marker.line.color\"),i(\"marker.line.width\"),i(\"marker.opacity\"),Ye(t,e,n,i,{prefix:\"\",cLetter:\"z\"}),ne.coerceSelectionMarkerOpacity(e,i)):e.visible=!1}else e.visible=!1},Th.colorbar=kh,Th.calc=function(t,e){for(var n=e.locations.length,i=new Array(n),a=0;a<n;a++){var o=i[a]={},s=e.locations[a],l=e.z[a];o.loc=\"string\"==typeof s?s:null,o.z=r(l)?l:gh}return dh(i,e),Ve(e,e.z,\"\",\"z\"),Ma(i,e),i},Th.plot=function(t,r,n){for(var i=0;i<n.length;i++)Mh(n[i],r.topojson);var a=r.layers.backplot.select(\".choroplethlayer\").selectAll(\"g.trace.choropleth\").data(n,function(t){return t[0].trace.uid});a.enter().append(\"g\").attr(\"class\",\"trace choropleth\"),a.exit().remove(),a.each(function(t){var r=(t[0].node3=e.select(this)).selectAll(\"path.choroplethlocation\").data(ne.identity);r.enter().append(\"path\").classed(\"choroplethlocation\",!0),r.exit().remove(),bh(0,t)})},Th.style=bh,Th.hoverPoints=function(t,e,r){var n,i,a,o,s=t.cd,l=s[0].trace,u=t.subplot;for(i=0;i<s.length;i++)if(o=!1,(n=s[i])._polygons){for(a=0;a<n._polygons.length;a++)n._polygons[a].contains([e,r])&&(o=!o),n._polygons[a].contains([e+360,r])&&(o=!o);if(o)break}if(o&&n)return t.x0=t.x1=t.xa.c2p(n.ct),t.y0=t.y1=t.ya.c2p(n.ct),t.index=n.index,t.location=n.loc,t.z=n.z,function(t,e,r,n){var i,a=r.hi||e.hoverinfo,o=\"all\"===a?ph.hoverinfo.flags:a.split(\"+\"),s=-1!==o.indexOf(\"name\"),l=-1!==o.indexOf(\"location\"),u=-1!==o.indexOf(\"z\"),c=-1!==o.indexOf(\"text\"),h=[];!s&&l?t.nameOverride=r.loc:(s&&(t.nameOverride=e.name),l&&h.push(r.loc)),u&&h.push((i=r.z,ri.tickText(n,n.c2l(i),\"hover\").text)),c&&xo(r,e,h),t.extraText=h.join(\"<br>\")}(t,l,n,u.mockAxis),[t]},Th.eventData=function(t,e){return t.location=e.location,t.z=e.z,t},Th.selectPoints=function(t,e){var r,n,i,a,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[];if(!1===e)for(r=0;r<s.length;r++)s[r].selected=0;else for(r=0;r<s.length;r++)(i=(n=s[r]).ct)&&(a=l.c2p(i),o=u.c2p(i),e.contains([a,o])?(c.push({pointNumber:r,lon:i[0],lat:i[1]}),n.selected=1):n.selected=0);return c},Th.moduleType=\"trace\",Th.name=\"choropleth\",Th.basePlotModule=$c,Th.categories=[\"geo\",\"noOpacity\"],Th.meta={};var Sh=Th,Eh={COMPARISON_OPS:[\"=\",\"!=\",\"<\",\">=\",\">\",\"<=\"],COMPARISON_OPS2:[\"=\",\"<\",\">=\",\">\",\"<=\"],INTERVAL_OPS:[\"[]\",\"()\",\"[)\",\"(]\",\"][\",\")(\",\"](\",\")[\"],SET_OPS:[\"{}\",\"}{\"],CONSTRAINT_REDUCTION:{\"=\":\"=\",\"<\":\"<\",\"<=\":\"<\",\">\":\">\",\">=\":\">\",\"[]\":\"[]\",\"()\":\"[]\",\"[)\":\"[]\",\"(]\":\"[]\",\"][\":\"][\",\")(\":\"][\",\"](\":\"][\",\")[\":\"][\"}},Ch=m.extendFlat,Lh=Ch({},{z:{valType:\"data_array\",editType:\"calc\"},x:Ch({},Zr.x,{impliedEdits:{xtype:\"array\"}}),x0:Ch({},Zr.x0,{impliedEdits:{xtype:\"scaled\"}}),dx:Ch({},Zr.dx,{impliedEdits:{xtype:\"scaled\"}}),y:Ch({},Zr.y,{impliedEdits:{ytype:\"array\"}}),y0:Ch({},Zr.y0,{impliedEdits:{ytype:\"scaled\"}}),dy:Ch({},Zr.dy,{impliedEdits:{ytype:\"scaled\"}}),text:{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\"}},Pe,{autocolorscale:Ch({},Pe.autocolorscale,{dflt:!1})},{colorbar:ze}),zh=Ae.dash,Ph=m.extendFlat,Ih=Eh.COMPARISON_OPS2,Dh=Eh.INTERVAL_OPS,Oh=Zr.line,Rh=Ph({z:Lh.z,x:Lh.x,x0:Lh.x0,dx:Lh.dx,y:Lh.y,y0:Lh.y0,dy:Lh.dy,text:Lh.text,transpose:Lh.transpose,xtype:Lh.xtype,ytype:Lh.ytype,zhoverformat:Lh.zhoverformat,connectgaps:Lh.connectgaps,fillcolor:{valType:\"color\",editType:\"calc\"},autocontour:{valType:\"boolean\",dflt:!0,editType:\"calc\",impliedEdits:{\"contours.start\":void 0,\"contours.end\":void 0,\"contours.size\":void 0}},ncontours:{valType:\"integer\",dflt:15,min:1,editType:\"calc\"},contours:{type:{valType:\"enumerated\",values:[\"levels\",\"constraint\"],dflt:\"levels\",editType:\"calc\"},start:{valType:\"number\",dflt:null,editType:\"plot\",impliedEdits:{\"^autocontour\":!1}},end:{valType:\"number\",dflt:null,editType:\"plot\",impliedEdits:{\"^autocontour\":!1}},size:{valType:\"number\",dflt:null,min:0,editType:\"plot\",impliedEdits:{\"^autocontour\":!1}},coloring:{valType:\"enumerated\",values:[\"fill\",\"heatmap\",\"lines\",\"none\"],dflt:\"fill\",editType:\"calc\"},showlines:{valType:\"boolean\",dflt:!0,editType:\"plot\"},showlabels:{valType:\"boolean\",dflt:!1,editType:\"plot\"},labelfont:T({editType:\"plot\",colorEditType:\"style\"}),labelformat:{valType:\"string\",dflt:\"\",editType:\"plot\"},operation:{valType:\"enumerated\",values:[].concat(Ih).concat(Dh),dflt:\"=\",editType:\"calc\"},value:{valType:\"any\",dflt:0,editType:\"calc\"},editType:\"calc\",impliedEdits:{autocontour:!1}},line:{color:Ph({},Oh.color,{editType:\"style+colorbars\"}),width:Ph({},Oh.width,{editType:\"style+colorbars\"}),dash:zh,smoothing:Ph({},Oh.smoothing,{}),editType:\"plot\"}},Pe,{autocolorscale:Ph({},Pe.autocolorscale,{dflt:!1}),zmin:Ph({},Pe.zmin,{editType:\"calc\"}),zmax:Ph({},Pe.zmax,{editType:\"calc\"})},{colorbar:ze}),Fh=ne.extendFlat,Bh=function(t){var e=t.contours;if(t.autocontour){var r=Nh(t.zmin,t.zmax,t.ncontours);e.size=r.dtick,e.start=ri.tickFirst(r),r.range.reverse(),e.end=ri.tickFirst(r),e.start===t.zmin&&(e.start+=e.size),e.end===t.zmax&&(e.end-=e.size),e.start>e.end&&(e.start=e.end=(e.start+e.end)/2),t._input.contours||(t._input.contours={}),Fh(t._input.contours,{start:e.start,end:e.end,size:e.size}),t._input.autocontour=!0}else if(\"constraint\"!==e.type){var n,i=e.start,a=e.end,o=t._input.contours;if(i>a&&(e.start=o.start=a,a=e.end=o.end=i,i=e.start),!(e.size>0))n=i===a?1:Nh(i,a,t.ncontours).dtick,o.size=e.size=n}};function Nh(t,e,r){var n={type:\"linear\",range:[t,e]};return ri.autoTicks(n,(e-t)/(r||15)),n}var jh=function(t){for(var e=0,r=0;r<t.length;r++)e=Math.max(e,t[r].length);return e},Vh=function(t){var e,r,n,i,a,o,s,l,u=[],c={},h=[],f=t[0],p=[],d=[0,0,0],g=jh(t);for(r=0;r<t.length;r++)for(e=p,p=f,f=t[r+1]||[],n=0;n<g;n++)void 0===p[n]&&((o=(void 0!==p[n-1]?1:0)+(void 0!==p[n+1]?1:0)+(void 0!==e[n]?1:0)+(void 0!==f[n]?1:0))?(0===r&&o++,0===n&&o++,r===t.length-1&&o++,n===p.length-1&&o++,o<4&&(c[[r,n]]=[r,n,o]),u.push([r,n,o])):h.push([r,n]));for(;h.length;){for(s={},l=!1,a=h.length-1;a>=0;a--)(o=((c[[(r=(i=h[a])[0])-1,n=i[1]]]||d)[2]+(c[[r+1,n]]||d)[2]+(c[[r,n-1]]||d)[2]+(c[[r,n+1]]||d)[2])/20)&&(s[i]=[r,n,o],h.splice(a,1),l=!0);if(!l)throw\"findEmpties iterated with no new neighbors\";for(i in s)c[i]=s[i],u.push(s[i])}return u.sort(function(t,e){return e[2]-t[2]})},Uh=ne.isArrayOrTypedArray,qh=function(t){return!Uh(t.z[0])},Hh=[[-1,0],[1,0],[0,-1],[0,1]];function Gh(t){return.5-.25*Math.min(1,.5*t)}var Wh=function(t,e,r){var n,i,a=1;if(Array.isArray(r))for(n=0;n<e.length;n++)t[(i=e[n])[0]][i[1]]=r[i[0]][i[1]];else Yh(t,e);for(n=0;n<e.length&&!(e[n][2]<4);n++);for(e=e.slice(n),n=0;n<100&&a>.01;n++)a=Yh(t,e,Gh(a));return a>.01&&ne.log(\"interp2d didn't converge quickly\",a),t};function Yh(t,e,r){var n,i,a,o,s,l,u,c,h,f,p,d,g,v=0;for(o=0;o<e.length;o++){for(i=(n=e[o])[0],a=n[1],p=t[i][a],f=0,h=0,s=0;s<4;s++)(u=t[i+(l=Hh[s])[0]])&&void 0!==(c=u[a+l[1]])&&(0===f?d=g=c:(d=Math.min(d,c),g=Math.max(g,c)),h++,f+=c);if(0===h)throw\"iterateInterp2d order is wrong: no defined neighbors\";t[i][a]=f/h,void 0===p?h<4&&(v=1):(t[i][a]=(1+r)*t[i][a]-r*p,g>d&&(v=Math.max(v,Math.abs(t[i][a]-p)/(g-d))))}return v}var Xh=ne.isArrayOrTypedArray,Zh=function(t,e,r,n,i,a){var o,s,l,u=[],c=P.traceIs(t,\"contour\"),h=P.traceIs(t,\"histogram\"),f=P.traceIs(t,\"gl2d\");if(Xh(e)&&e.length>1&&!h&&\"category\"!==a.type){var p=e.length;if(!(p<=i))return c?e.slice(0,i):e.slice(0,i+1);if(c||f)u=e.slice(0,i);else if(1===i)u=[e[0]-.5,e[0]+.5];else{for(u=[1.5*e[0]-.5*e[1]],l=1;l<p;l++)u.push(.5*(e[l-1]+e[l]));u.push(1.5*e[p-1]-.5*e[p-2])}if(p<i){var d=u[u.length-1],g=d-u[u.length-2];for(l=p;l<i;l++)d+=g,u.push(d)}}else{s=n||1;var v=t[a._id.charAt(0)+\"calendar\"];for(o=h||\"category\"===a.type?a.r2c(r,0,v)||0:Xh(e)&&1===e.length?e[0]:void 0===r?0:a.d2c(r,0,v),l=c||f?0:-.5;l<i;l++)u.push(o+s*l)}return u},Jh=function(t,e){for(var r=t.length,n=0,i=0;i<r;i++)e[i]?(t[i]/=e[i],n+=t[i]):t[i]=null;return n},Kh={count:function(t,e,r){return r[t]++,1},sum:function(t,e,n,i){var a=i[e];return r(a)?(a=Number(a),n[t]+=a,a):0},avg:function(t,e,n,i,a){var o=i[e];return r(o)&&(o=Number(o),n[t]+=o,a[t]++),0},min:function(t,e,n,i){var a=i[e];if(r(a)){if(a=Number(a),!r(n[t]))return n[t]=a,a;if(n[t]>a){var o=a-n[t];return n[t]=a,o}}return 0},max:function(t,e,n,i){var a=i[e];if(r(a)){if(a=Number(a),!r(n[t]))return n[t]=a,a;if(n[t]<a){var o=a-n[t];return n[t]=a,o}}return 0}},Qh=t.ONEAVGYEAR,$h=t.ONEAVGMONTH,tf=t.ONEDAY,ef=t.ONEHOUR,rf=t.ONEMIN,nf=t.ONESEC,af=ri.tickIncrement,of=function(t,e,r,n,i){var a,o,s=-1.1*e,l=-.1*e,u=t-l,c=r[0],h=r[1],f=Math.min(sf(c+l,c+u,n,i),sf(h+l,h+u,n,i)),p=Math.min(sf(c+s,c+l,n,i),sf(h+s,h+l,n,i));if(f>p&&p<Math.abs(h-c)/4e3?(a=f,o=!1):(a=Math.min(f,p),o=!0),\"date\"===n.type&&a>tf){var d=a===Qh?1:6,g=a===Qh?\"M12\":\"M1\";return function(e,r){var a=n.c2d(e,Qh,i),s=a.indexOf(\"-\",d);s>0&&(a=a.substr(0,s));var l=n.d2c(a,0,i);if(l<e){var u=af(l,g,!1,i);(l+u)/2<e+t&&(l=u)}return r&&o?af(l,g,!0,i):l}}return function(e,r){var n=a*Math.round(e/a);return n+a/10<e&&n+.9*a<e+t&&(n+=a),r&&o&&(n-=a),n}};function sf(t,e,r,n){if(t*e<=0)return 1/0;for(var i=Math.abs(e-t),a=\"date\"===r.type,o=lf(i,a),s=0;s<10;s++){var l=lf(80*o,a);if(o===l)break;if(!uf(l,t,e,a,r,n))break;o=l}return o}function lf(t,e){return e&&t>nf?t>tf?t>1.1*Qh?Qh:t>1.1*$h?$h:tf:t>ef?ef:t>rf?rf:nf:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function uf(t,e,r,n,i,a){if(n&&t>tf){var o=cf(e,i,a),s=cf(r,i,a),l=t===Qh?0:1;return o[l]!==s[l]}return Math.floor(r/t)-Math.floor(e/t)>.1}function cf(t,e,r){var n=e.c2d(t,Qh,r).split(\"-\");return\"\"===n[0]&&(n.unshift(),n[0]=\"-\"+n[0]),n}var hf=ne.cleanDate,ff=t.ONEDAY,pf=t.BADNUM,df=function(t,e,n){var i=e.type,a=n+\"bins\",o=t[a];o||(o=t[a]={});var s=\"date\"===i?function(t){return t||0===t?hf(t,pf,o.calendar):null}:function(t){return r(t)?Number(t):null};o.start=s(o.start),o.end=s(o.end);var l=\"date\"===i?ff:1,u=o.size;if(r(u))o.size=u>0?Number(u):l;else if(\"string\"!=typeof u)o.size=l;else{var c=u.charAt(0),h=u.substr(1);((h=r(h)?Number(h):0)<=0||\"date\"!==i||\"M\"!==c||h!==Math.round(h))&&(o.size=l)}var f=\"autobin\"+n;\"boolean\"!=typeof t[f]&&(t[f]=t._fullInput[f]=t._input[f]=!((o.start||0===o.start)&&(o.end||0===o.end))),t[f]||(delete t[\"nbins\"+n],delete t._fullInput[\"nbins\"+n])},gf={percent:function(t,e){for(var r=t.length,n=100/e,i=0;i<r;i++)t[i]*=n},probability:function(t,e){for(var r=t.length,n=0;n<r;n++)t[n]/=e},density:function(t,e,r,n){var i=t.length;n=n||1;for(var a=0;a<i;a++)t[a]*=r[a]*n},\"probability density\":function(t,e,r,n){var i=t.length;n&&(e/=n);for(var a=0;a<i;a++)t[a]*=r[a]/e}};function vf(t,e,r,n,i,a,o){var s=e+\"bins\",l=\"autobin\"+e,u=t[s];df(t,n,e),!t[l]&&u&&null!==u.start&&null!==u.end||(u=ri.autoBin(r,n,t[\"nbins\"+e],\"2d\",o),\"histogram2dcontour\"===t.type&&(u.start=a(ri.tickIncrement(i(u.start),u.size,!0,o)),u.end=a(ri.tickIncrement(i(u.end),u.size,!1,o))),t._input[s]=t[s]=u,t._input[l]=t[l])}function mf(t,e,r,n){var i,a=new Array(t);if(n)for(i=0;i<t;i++)a[i]=1/(e[i+1]-e[i]);else{var o=1/r;for(i=0;i<t;i++)a[i]=o}return a}function yf(t,e){return{start:t(e.start),end:t(e.end),size:e.size}}function xf(t,e,r,n,i,a){var o,s=t.length-1,l=new Array(s);if(e)for(o=0;o<s;o++)l[o]=[e[o],e[o]];else{var u=of(r,n,t,i,a);for(o=0;o<s;o++)l[o]=[u(t[o]),u(t[o+1],!0)]}return l}var bf=function(t,e){var r,n,i,a,o,s,l,u,c,h=ri.getFromId(t,e.xaxis||\"x\"),f=ri.getFromId(t,e.yaxis||\"y\"),p=P.traceIs(e,\"contour\"),d=P.traceIs(e,\"histogram\"),g=P.traceIs(e,\"gl2d\"),v=p?\"best\":e.zsmooth;function m(t){v=e._input.zsmooth=e.zsmooth=!1,ne.warn('cannot use zsmooth: \"fast\": '+t)}if(h._minDtick=0,f._minDtick=0,d?(r=(c=function(t,e){var r,n,i,a,o=ri.getFromId(t,e.xaxis||\"x\"),s=e.x?o.makeCalcdata(e,\"x\"):[],l=ri.getFromId(t,e.yaxis||\"y\"),u=e.y?l.makeCalcdata(e,\"y\"):[],c=e.xcalendar,h=e.ycalendar,f=function(t){return o.r2c(t,0,c)},p=function(t){return l.r2c(t,0,h)},d=function(t){return o.c2r(t,0,c)},g=function(t){return l.c2r(t,0,h)},v=Math.min(s.length,u.length);s.length>v&&s.splice(v,s.length-v),u.length>v&&u.splice(v,u.length-v),vf(e,\"x\",s,o,f,d,c),vf(e,\"y\",u,l,p,g,h);var m=[],y=[],x=[],b=\"string\"==typeof e.xbins.size,_=\"string\"==typeof e.ybins.size,w=[],M=[],A=b?w:e.xbins,k=_?M:e.ybins,T=0,S=[],E=[],C=e.histnorm,L=e.histfunc,z=-1!==C.indexOf(\"density\"),P=\"max\"===L||\"min\"===L?null:0,I=Kh.count,D=gf[C],O=!1,R=[],F=[],B=\"z\"in e?e.z:\"marker\"in e&&Array.isArray(e.marker.color)?e.marker.color:\"\";B&&\"count\"!==L&&(O=\"avg\"===L,I=Kh[L]);var N=e.xbins,j=f(N.start),V=f(N.end)+(j-ri.tickIncrement(j,N.size,!1,c))/1e6;for(r=j;r<V;r=ri.tickIncrement(r,N.size,!1,c))y.push(P),w.push(r),O&&x.push(0);w.push(r);var U=y.length,q=f(e.xbins.start),H=(r-q)/U,G=d(q+H/2);for(j=p((N=e.ybins).start),V=p(N.end)+(j-ri.tickIncrement(j,N.size,!1,h))/1e6,r=j;r<V;r=ri.tickIncrement(r,N.size,!1,h)){m.push(y.slice()),M.push(r);var W=new Array(U);for(n=0;n<U;n++)W[n]=[];E.push(W),O&&S.push(x.slice())}M.push(r);var Y=m.length,X=p(e.ybins.start),Z=(r-X)/Y,J=g(X+Z/2);z&&(R=mf(y.length,A,H,b),F=mf(m.length,k,Z,_)),b||\"date\"!==o.type||(A=yf(f,A)),_||\"date\"!==l.type||(k=yf(p,k));var K=!0,Q=!0,$=new Array(U),tt=new Array(Y),et=1/0,rt=1/0,nt=1/0,it=1/0;for(r=0;r<v;r++){var at=s[r],ot=u[r];i=ne.findBin(at,A),a=ne.findBin(ot,k),i>=0&&i<U&&a>=0&&a<Y&&(T+=I(i,r,m[a],B,S[a]),E[a][i].push(r),K&&(void 0===$[i]?$[i]=at:$[i]!==at&&(K=!1)),Q&&(void 0===tt[i]?tt[i]=ot:tt[i]!==ot&&(Q=!1)),et=Math.min(et,at-w[i]),rt=Math.min(rt,w[i+1]-at),nt=Math.min(nt,ot-M[a]),it=Math.min(it,M[a+1]-ot))}if(O)for(a=0;a<Y;a++)T+=Jh(m[a],S[a]);if(D)for(a=0;a<Y;a++)D(m[a],T,R,F[a]);return{x:s,xRanges:xf(w,K&&$,et,rt,o,c),x0:G,dx:H,y:u,yRanges:xf(M,Q&&tt,nt,it,l,h),y0:J,dy:Z,z:m,pts:E}}(t,e)).x,n=c.x0,i=c.dx,a=c.y,o=c.y0,s=c.dy,l=c.z):(qh(e)?(Pu(e,h,f,\"x\",\"y\",[\"z\"]),r=e.x,a=e.y):(r=e.x?h.makeCalcdata(e,\"x\"):[],a=e.y?f.makeCalcdata(e,\"y\"):[]),n=e.x0||0,i=e.dx||1,o=e.y0||0,s=e.dy||1,l=xu(e.z,e.transpose),(p||e.connectgaps)&&(e._emptypoints=Vh(l),e._interpz=Wh(l,e._emptypoints,e._interpz))),\"fast\"===v)if(\"log\"===h.type||\"log\"===f.type)m(\"log axis found\");else if(!d){if(r.length){var y=(r[r.length-1]-r[0])/(r.length-1),x=Math.abs(y/100);for(u=0;u<r.length-1;u++)if(Math.abs(r[u+1]-r[u]-y)>x){m(\"x scale is not linear\");break}}if(a.length&&\"fast\"===v){var b=(a[a.length-1]-a[0])/(a.length-1),_=Math.abs(b/100);for(u=0;u<a.length-1;u++)if(Math.abs(a[u+1]-a[u]-b)>_){m(\"y scale is not linear\");break}}}var w=jh(l),M=\"scaled\"===e.xtype?\"\":r,A=Zh(e,M,n,i,w,h),k=\"scaled\"===e.ytype?\"\":a,T=Zh(e,k,o,s,l.length,f);g||(ri.expand(h,A),ri.expand(f,T));var S={x:A,y:T,z:l,text:e.text};if(M&&M.length===A.length-1&&(S.xCenter=M),k&&k.length===T.length-1&&(S.yCenter=k),d&&(S.xRanges=c.xRanges,S.yRanges=c.yRanges,S.pts=c.pts),p&&\"constraint\"===e.contours.type||Ve(e,l,\"\",\"z\"),p&&e.contours&&\"heatmap\"===e.contours.coloring){var E={type:\"contour\"===e.type?\"heatmap\":\"histogram2d\",xcalendar:e.xcalendar,ycalendar:e.ycalendar};S.xfill=Zh(E,M,n,i,w,h),S.yfill=Zh(E,k,o,s,l.length,f)}return[S]},_f=function(t,e){var r=bf(t,e);return Bh(e),r},wf=function(t){return t.end+t.size/1e6},Mf=function(t){var r=t.contours,n=r.start,i=wf(r),a=r.size||1,o=Math.floor((i-n)/a)+1,s=\"lines\"===r.coloring?0:1;isFinite(a)||(a=1,o=1);var l,u,c=t.colorscale,h=c.length,f=new Array(h),p=new Array(h);if(\"heatmap\"===r.coloring){for(t.zauto&&!1===t.autocontour&&(t.zmin=n-a/2,t.zmax=t.zmin+o*a),u=0;u<h;u++)l=c[u],f[u]=l[0]*(t.zmax-t.zmin)+t.zmin,p[u]=l[1];var d=e.extent([t.zmin,t.zmax,r.start,r.start+a*(o-1)]),g=d[t.zmin<t.zmax?0:1],v=d[t.zmin<t.zmax?1:0];g!==t.zmin&&(f.splice(0,0,g),p.splice(0,0,Range[0])),v!==t.zmax&&(f.push(v),p.push(p[p.length-1]))}else for(u=0;u<h;u++)l=c[u],f[u]=(l[0]*(o+s-1)-s/2)*a+n,p[u]=l[1];return Je.makeColorScaleFunc({domain:f,range:p},{noNumericCheck:!0})},Af=function(t,e){var r=e[0].trace,n=\"cb\"+r.uid;if(t._fullLayout._infolayer.selectAll(\".\"+n).remove(),r.showscale){var i=ns(t,n);e[0].t.cb=i;var a=r.contours,o=r.line,s=a.size||1,l=a.coloring,u=Mf(r);\"heatmap\"===l&&i.filllevels({start:r.zmin,end:r.zmax,size:(r.zmax-r.zmin)/254}),i.fillcolor(\"fill\"===l||\"heatmap\"===l?u:\"\").line({color:\"lines\"===l?u:o.color,width:!1!==a.showlines?o.width:0,dash:o.dash}).levels({start:a.start,end:wf(a),size:s}).options(r.colorbar)()}else _n.autoMargin(t,n)},kf=function(t,e,r,n){if(n||(n={}),t(\"contours.showlabels\")){var i=e.font;ne.coerceFont(t,\"contours.labelfont\",{family:i.family,size:i.size,color:r}),t(\"contours.labelformat\")}!1!==n.hasHover&&t(\"zhoverformat\")},Tf=Oe.addOpacity,Sf=Oe.opacity,Ef=Eh.CONSTRAINT_REDUCTION,Cf=Eh.COMPARISON_OPS2,Lf=function(t,e,n,i,a,o){var s,l,u,c=e.contours,h=n(\"contours.operation\");(c._operation=Ef[h],function(t,e){var n;-1===Cf.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?(n=parseFloat(e.value[0]),e.value=[n,n+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:r(e.value)&&(n=parseFloat(e.value),e.value=[n,n+1])):(t(\"contours.value\",0),r(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0))}(n,c),\"=\"===h?s=c.showlines=!0:(s=n(\"contours.showlines\"),u=n(\"fillcolor\",Tf((t.line||{}).color||a,.5))),s)&&(l=n(\"line.color\",u&&Sf(u)?Tf(e.fillcolor,1):a),n(\"line.width\",2),n(\"line.dash\"));n(\"line.smoothing\"),kf(n,i,l,o)};var zf=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\")},Pf=function(t,e,r,n,i){var a,o=r(\"contours.coloring\"),s=\"\";\"fill\"===o&&(a=r(\"contours.showlines\")),!1!==a&&(\"lines\"!==o&&(s=r(\"line.color\",\"#000\")),r(\"line.width\",.5),r(\"line.dash\")),\"none\"!==o&&Ye(t,e,n,r,{prefix:\"\",cLetter:\"z\"}),r(\"line.smoothing\"),kf(r,n,s,i)},If=ne.isArrayOrTypedArray,Df=function(t,e,n,i,a,o){var s,l,u=n(\"z\");if(a=a||\"x\",o=o||\"y\",void 0===u||!u.length)return 0;if(qh(t)){if(s=n(a),l=n(o),!s||!l)return 0}else{if(s=Of(a,n),l=Of(o,n),!function(t){for(var e,n=!0,i=!1,a=!1,o=0;o<t.length;o++){if(e=t[o],!If(e)){n=!1;break}e.length>0&&(i=!0);for(var s=0;s<e.length;s++)if(r(e[s])){a=!0;break}}return n&&i&&a}(u))return 0;n(\"transpose\")}return P.getComponentMethod(\"calendars\",\"handleTraceDefaults\")(t,e,[a,o],i),e.z.length};function Of(t,e){var r=e(t);return\"scaled\"===(r?e(t+\"type\",\"array\"):\"scaled\")&&(e(t+\"0\"),e(\"d\"+t)),r}var Rf=function(t,e,r,n,i,a){var o,s,l,u,c=t.cd[0],h=c.trace,f=t.xa,p=t.ya,d=c.x,g=c.y,v=c.z,m=c.xCenter,y=c.yCenter,x=c.zmask,b=[h.zmin,h.zmax],_=h.zhoverformat,w=d,M=g;if(!1!==t.index){try{l=Math.round(t.index[1]),u=Math.round(t.index[0])}catch(e){return void ne.error(\"Error hovering on heatmap, pointNumber must be [row,col], found:\",t.index)}if(l<0||l>=v[0].length||u<0||u>v.length)return}else{if(yo.inbox(e-d[0],e-d[d.length-1],0)>0||yo.inbox(r-g[0],r-g[g.length-1],0)>0)return;if(a){var A;for(w=[2*d[0]-d[1]],A=1;A<d.length;A++)w.push((d[A]+d[A-1])/2);for(w.push([2*d[d.length-1]-d[d.length-2]]),M=[2*g[0]-g[1]],A=1;A<g.length;A++)M.push((g[A]+g[A-1])/2);M.push([2*g[g.length-1]-g[g.length-2]])}l=Math.max(0,Math.min(w.length-2,ne.findBin(e,w))),u=Math.max(0,Math.min(M.length-2,ne.findBin(r,M)))}var k=f.c2p(d[l]),T=f.c2p(d[l+1]),S=p.c2p(g[u]),E=p.c2p(g[u+1]);a?(T=k,o=d[l],E=S,s=g[u]):(o=m?m[l]:(d[l]+d[l+1])/2,s=y?y[u]:(g[u]+g[u+1])/2,h.zsmooth&&(k=T=f.c2p(o),S=E=p.c2p(s)));var C,L,z=v[u][l];x&&!x[u][l]&&(z=void 0),Array.isArray(c.text)&&Array.isArray(c.text[u])&&(C=c.text[u][l]);var P={type:\"linear\",range:b,hoverformat:_,_separators:f._separators,_numFormat:f._numFormat};return L=ri.tickText(P,z,\"hover\").text,[ne.extendFlat(t,{index:[u,l],distance:t.maxHoverDistance,spikeDistance:t.maxSpikeDistance,x0:k,x1:T,y0:S,y1:E,xLabelVal:o,yLabelVal:s,zLabelVal:z,zLabel:L,text:C})]},Ff=function(t,e,r,n,i){var a=Rf(t,e,r,0,0,!0);return a&&a.forEach(function(t){var e=t.trace;\"constraint\"===e.contours.type&&(e.fillcolor&&Oe.opacity(e.fillcolor)?t.color=Oe.addOpacity(e.fillcolor,1):e.contours.showlines&&Oe.opacity(e.line.color)&&(t.color=Oe.addOpacity(e.line.color,1)))}),a},Bf=function(t,e,r,n){var i,a,o,s=t[0],l=s.x.length,u=s.y.length,c=s.z,h=n.contours,f=-1/0,p=1/0;for(i=0;i<u;i++)p=Math.min(p,c[i][0]),p=Math.min(p,c[i][l-1]),f=Math.max(f,c[i][0]),f=Math.max(f,c[i][l-1]);for(i=1;i<l-1;i++)p=Math.min(p,c[0][i]),p=Math.min(p,c[u-1][i]),f=Math.max(f,c[0][i]),f=Math.max(f,c[u-1][i]);switch(s.prefixBoundary=!1,e){case\">\":h.value>f&&(s.prefixBoundary=!0);break;case\"<\":h.value<p&&(s.prefixBoundary=!0);break;case\"[]\":a=Math.min.apply(null,h.value),((o=Math.max.apply(null,h.value))<p||a>f)&&(s.prefixBoundary=!0);break;case\"][\":a=Math.min.apply(null,h.value),o=Math.max.apply(null,h.value),a<p&&o>f&&(s.prefixBoundary=!0)}},Nf={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}},jf=function(t,e){var r,n,i,a=function(t){return t.reverse()},o=function(t){return t};switch(e){case\"=\":case\"<\":return t;case\">\":for(1!==t.length&&ne.warn(\"Contour data invalid for the specified inequality operation.\"),n=t[0],r=0;r<n.edgepaths.length;r++)n.edgepaths[r]=a(n.edgepaths[r]);for(r=0;r<n.paths.length;r++)n.paths[r]=a(n.paths[r]);return t;case\"][\":var s=a;a=o,o=s;case\"[]\":for(2!==t.length&&ne.warn(\"Contour data invalid for the specified inequality range operation.\"),n=Vf(t[0]),i=Vf(t[1]),r=0;r<n.edgepaths.length;r++)n.edgepaths[r]=a(n.edgepaths[r]);for(r=0;r<n.paths.length;r++)n.paths[r]=a(n.paths[r]);for(;i.edgepaths.length;)n.edgepaths.push(o(i.edgepaths.shift()));for(;i.paths.length;)n.paths.push(o(i.paths.shift()));return[n]}};function Vf(t){return ne.extendFlat({},t,{edgepaths:ne.extendDeep([],t.edgepaths),paths:ne.extendDeep([],t.paths)})}var Uf={\"[]\":Hf(\"[]\"),\"][\":Hf(\"][\"),\">\":Gf(\">\"),\"<\":Gf(\"<\"),\"=\":Gf(\"=\")};function qf(t,e){var n,i=Array.isArray(e);function a(t){return r(t)?+t:null}return-1!==Eh.COMPARISON_OPS2.indexOf(t)?n=a(i?e[0]:e):-1!==Eh.INTERVAL_OPS.indexOf(t)?n=i?[a(e[0]),a(e[1])]:[a(e),a(e)]:-1!==Eh.SET_OPS.indexOf(t)&&(n=i?e.map(a):[a(e)]),n}function Hf(t){return function(e){e=qf(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 Gf(t){return function(e){return{start:e=qf(t,e),end:1/0,size:1/0}}}var Wf=function(t,e,r){for(var n=\"constraint\"===t.type?Uf[t._operation](t.value):t,i=n.size,a=[],o=wf(n),s=r.trace.carpetTrace,l=s?{xaxis:s.aaxis,yaxis:s.baxis,x:r.a,y:r.b}:{xaxis:e.xaxis,yaxis:e.yaxis,x:r.x,y:r.y},u=n.start;u<o;u+=i)if(a.push(ne.extendFlat({level:u,crossings:{},starts:[],edgepaths:[],paths:[],z:r.z,smoothing:r.trace.line.smoothing},l)),a.length>1e3){ne.warn(\"Too many contours, clipping at 1000\",t);break}return a},Yf=function(t,e,r){var n,i,a,o;for(e=e||.01,r=r||.01,i=0;i<t.length;i++){for(a=t[i],o=0;o<a.starts.length;o++)Zf(a,a.starts[o],\"edge\",e,r);for(n=0;Object.keys(a.crossings).length&&n<1e4;)n++,Zf(a,Object.keys(a.crossings)[0].split(\",\").map(Number),void 0,e,r);1e4===n&&ne.log(\"Infinite loop in contour?\")}};function Xf(t,e,r,n){return Math.abs(t[0]-e[0])<r&&Math.abs(t[1]-e[1])<n}function Zf(t,e,r,n,i){var a,o=e.join(\",\"),s=o,l=t.crossings[s],u=function(t,e,r){var n=0,i=0;t>20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==Nf.BOTTOMSTART.indexOf(t)?i=1:-1!==Nf.LEFTSTART.indexOf(t)?n=1:-1!==Nf.TOPSTART.indexOf(t)?i=-1:n=-1;return[n,i]}(l,r,e),c=[Jf(t,e,[-u[0],-u[1]])],h=u.join(\",\"),f=t.z.length,p=t.z[0].length;for(a=0;a<1e4;a++){if(l>20?(l=Nf.CHOOSESADDLE[l][(u[0]||u[1])<0?0:1],t.crossings[s]=Nf.SADDLEREMAINDER[l]):delete t.crossings[s],!(u=Nf.NEWDELTA[l])){ne.log(\"Found bad marching index:\",l,e,t.level);break}c.push(Jf(t,e,u)),e[0]+=u[0],e[1]+=u[1],Xf(c[c.length-1],c[c.length-2],n,i)&&c.pop(),s=e.join(\",\");var d=u[0]&&(e[0]<0||e[0]>p-2)||u[1]&&(e[1]<0||e[1]>f-2);if(s===o&&u.join(\",\")===h||r&&d)break;l=t.crossings[s]}1e4===a&&ne.log(\"Infinite loop in contour?\");var g,v,m,y,x,b,_,w,M,A,k,T,S,E,C,L=Xf(c[0],c[c.length-1],n,i),z=0,P=.2*t.smoothing,I=[],D=0;for(a=1;a<c.length;a++)T=c[a],S=c[a-1],void 0,void 0,E=T[2]-S[2],C=T[3]-S[3],z+=_=Math.sqrt(E*E+C*C),I.push(_);var O=z/I.length*P;function R(t){return c[t%c.length]}for(a=c.length-2;a>=D;a--)if((g=I[a])<O){for(m=0,v=a-1;v>=D&&g+I[v]<O;v--)g+=I[v];if(L&&a===c.length-2)for(m=0;m<v&&g+I[m]<O;m++)g+=I[m];x=a-v+m+1,b=Math.floor((a+v+m+2)/2),y=L||a!==c.length-2?L||-1!==v?x%2?R(b):[(R(b)[0]+R(b+1)[0])/2,(R(b)[1]+R(b+1)[1])/2]:c[0]:c[c.length-1],c.splice(v+1,a-v+1,y),a=v+1,m&&(D=m),L&&(a===c.length-2?c[m]=c[c.length-1]:0===a&&(c[c.length-1]=c[0]))}for(c.splice(0,D),a=0;a<c.length;a++)c[a].length=2;if(!(c.length<2))if(L)c.pop(),t.paths.push(c);else{r||ne.log(\"Unclosed interior contour?\",t.level,o,c.join(\"L\"));var F=!1;for(w=0;w<t.edgepaths.length;w++)if(A=t.edgepaths[w],!F&&Xf(A[0],c[c.length-1],n,i)){c.pop(),F=!0;var B=!1;for(M=0;M<t.edgepaths.length;M++)if(Xf((k=t.edgepaths[M])[k.length-1],c[0],n,i)){B=!0,c.shift(),t.edgepaths.splice(w,1),M===w?t.paths.push(c.concat(k)):(M>w&&M--,t.edgepaths[M]=k.concat(c,A));break}B||(t.edgepaths[w]=c.concat(A))}for(w=0;w<t.edgepaths.length&&!F;w++)Xf((A=t.edgepaths[w])[A.length-1],c[0],n,i)&&(c.shift(),t.edgepaths[w]=A.concat(c),F=!0);F||t.edgepaths.push(c)}}function Jf(t,e,r){var n=e[0]+Math.max(r[0],0),i=e[1]+Math.max(r[1],0),a=t.z[i][n],o=t.xaxis,s=t.yaxis;if(r[1]){var l=(t.level-a)/(t.z[i][n+1]-a);return[o.c2p((1-l)*t.x[n]+l*t.x[n+1],!0),s.c2p(t.y[i],!0),n+l,i]}var u=(t.level-a)/(t.z[i+1][n]-a);return[o.c2p(t.x[n],!0),s.c2p((1-u)*t.y[i]+u*t.y[i+1],!0),n,i+u]}var Kf=function(t){var e,r,n,i,a,o,s,l,u,c=t[0].z,h=c.length,f=c[0].length,p=2===h||2===f;for(r=0;r<h-1;r++)for(i=[],0===r&&(i=i.concat(Nf.BOTTOMSTART)),r===h-2&&(i=i.concat(Nf.TOPSTART)),e=0;e<f-1;e++)for(n=i.slice(),0===e&&(n=n.concat(Nf.LEFTSTART)),e===f-2&&(n=n.concat(Nf.RIGHTSTART)),a=e+\",\"+r,o=[[c[r][e],c[r][e+1]],[c[r+1][e],c[r+1][e+1]]],u=0;u<t.length;u++)(s=Qf((l=t[u]).level,o))&&(l.crossings[a]=s,-1!==n.indexOf(s)&&(l.starts.push([e,r]),p&&-1!==n.indexOf(s,n.indexOf(s)+1)&&l.starts.push([e,r])))};function Qf(t,e){var r=(e[0][0]>t?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);return 5===r||10===r?t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}var $f=function(t,e,r){for(var n=0;n<r.length;n++)tp(t,e,r[n])};function tp(t,e,r){var n=r[0],i=n.trace,a=i.uid,o=e.xaxis,l=e.yaxis,u=t._fullLayout,c=\"hm\"+a;if(u._paper.selectAll(\".contour\"+a).remove(),u._infolayer.selectAll(\"g.rangeslider-container\").selectAll(\".contour\"+a).remove(),!0!==i.visible)return u._paper.selectAll(\".\"+c).remove(),void u._infolayer.selectAll(\".cb\"+a).remove();var h,f,p,d,g,v,m=n.z,y=n.x,x=n.y,b=n.xCenter,_=n.yCenter,w=P.traceIs(i,\"contour\"),M=w?\"best\":i.zsmooth,A=m.length,k=jh(m),T=!1,S=!1;for(v=0;void 0===h&&v<y.length-1;)h=o.c2p(y[v]),v++;for(v=y.length-1;void 0===f&&v>0;)f=o.c2p(y[v]),v--;for(f<h&&(p=f,f=h,h=p,T=!0),v=0;void 0===d&&v<x.length-1;)d=l.c2p(x[v]),v++;for(v=x.length-1;void 0===g&&v>0;)g=l.c2p(x[v]),v--;if(g<d&&(p=d,d=g,g=p,S=!0),w&&(b=y,_=x,y=n.xfill,x=n.yfill),\"fast\"!==M){var E=\"best\"===M?0:.5;h=Math.max(-E*o._length,h),f=Math.min((1+E)*o._length,f),d=Math.max(-E*l._length,d),g=Math.min((1+E)*l._length,g)}var C=Math.round(f-h),L=Math.round(g-d),z=C<=0||L<=0,I=e.plot.select(\".imagelayer\").selectAll(\"g.hm.\"+c).data(z?[]:[0]);if(I.enter().append(\"g\").classed(\"hm\",!0).classed(c,!0),I.exit().remove(),!z){var D,O;\"fast\"===M?(D=k,O=A):(D=C,O=L);var R=document.createElement(\"canvas\");R.width=D,R.height=O;var F,B,N=R.getContext(\"2d\"),j=Je.makeColorScaleFunc(Je.extractScale(i.colorscale,i.zmin,i.zmax),{noNumericCheck:!0,returnArray:!0});\"fast\"===M?(F=T?function(t){return k-1-t}:ne.identity,B=S?function(t){return A-1-t}:ne.identity):(F=function(t){return ne.constrain(Math.round(o.c2p(y[t])-h),0,C)},B=function(t){return ne.constrain(Math.round(l.c2p(x[t])-d),0,L)});var V,U,q,H,G,W=B(0),Y=[W,W],X=T?0:1,Z=S?0:1,J=0,K=0,Q=0,$=0;if(M){var tt,et=0;try{tt=new Uint8Array(C*L*4)}catch(t){tt=new Array(C*L*4)}if(\"best\"===M){var rt,nt,it,at=b||y,ot=_||x,st=new Array(at.length),lt=new Array(ot.length),ut=new Array(C),ct=b?rp:ep,ht=_?rp:ep;for(v=0;v<at.length;v++)st[v]=Math.round(o.c2p(at[v])-h);for(v=0;v<ot.length;v++)lt[v]=Math.round(l.c2p(ot[v])-d);for(v=0;v<C;v++)ut[v]=ct(v,st);for(U=0;U<L;U++)for(nt=m[(rt=ht(U,lt)).bin0],it=m[rt.bin1],v=0;v<C;v++,et+=4)np(tt,et,G=wt(nt,it,ut[v],rt))}else for(U=0;U<A;U++)for(H=m[U],Y=B(U),v=0;v<C;v++)G=_t(H[v],1),np(tt,et=4*(Y*C+F(v)),G);var ft=N.createImageData(C,L);try{ft.data.set(tt)}catch(t){var pt=ft.data,dt=pt.length;for(U=0;U<dt;U++)pt[U]=tt[U]}N.putImageData(ft,0,0)}else{var gt=i.xgap,vt=i.ygap,mt=Math.floor(gt/2),yt=Math.floor(vt/2);for(U=0;U<A;U++)if(H=m[U],Y.reverse(),Y[Z]=B(U+1),Y[0]!==Y[1]&&void 0!==Y[0]&&void 0!==Y[1])for(V=[q=F(0),q],v=0;v<k;v++)V.reverse(),V[X]=F(v+1),V[0]!==V[1]&&void 0!==V[0]&&void 0!==V[1]&&(G=_t(H[v],(V[1]-V[0])*(Y[1]-Y[0])),N.fillStyle=\"rgba(\"+G.join(\",\")+\")\",N.fillRect(V[0]+mt,Y[0]+yt,V[1]-V[0]-gt,Y[1]-Y[0]-vt))}K=Math.round(K/J),Q=Math.round(Q/J),$=Math.round($/J);var xt=s(\"rgb(\"+K+\",\"+Q+\",\"+$+\")\");t._hmpixcount=(t._hmpixcount||0)+J,t._hmlumcount=(t._hmlumcount||0)+J*xt.getLuminance();var bt=I.selectAll(\"image\").data(r);bt.enter().append(\"svg:image\").attr({xmlns:$e.svg,preserveAspectRatio:\"none\"}),bt.attr({height:L,width:C,x:h,y:d,\"xlink:href\":R.toDataURL(\"image/png\")}),bt.exit().remove()}function _t(t,e){if(void 0!==t){var r=j(t);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),J+=e,K+=r[0]*e,Q+=r[1]*e,$+=r[2]*e,r}return[0,0,0,0]}function wt(t,e,r,n){var i=t[r.bin0];if(void 0===i)return _t(void 0,1);var a,o=t[r.bin1],s=e[r.bin0],l=e[r.bin1],u=o-i||0,c=s-i||0;return a=void 0===o?void 0===l?0:void 0===s?2*(l-i):2*(2*l-s-i)/3:void 0===l?void 0===s?0:2*(2*i-o-s)/3:void 0===s?2*(2*l-o-i)/3:l+i-o-s,_t(i+r.frac*u+n.frac*(c+r.frac*a))}}function ep(t,e){var r=e.length-2,n=ne.constrain(ne.findBin(t,e),0,r),i=e[n],a=e[n+1],o=ne.constrain(n+(t-i)/(a-i)-.5,0,r),s=Math.round(o),l=Math.abs(o-s);return o&&o!==r&&l?{bin0:s,frac:l,bin1:Math.round(s+l/(o-s))}:{bin0:s,bin1:s,frac:0}}function rp(t,e){var r=e.length-1,n=ne.constrain(ne.findBin(t,e),0,r),i=e[n],a=(t-i)/(e[n+1]-i)||0;return a<=0?{bin0:n,bin1:n,frac:0}:a<.5?{bin0:n,bin1:n+1,frac:a}:{bin0:n+1,bin1:n,frac:1-a}}function np(t,e,r){t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=Math.round(255*r[3])}var ip={},ap=Nf.LABELOPTIMIZER;function op(t,r,n){var i=n[0].trace,a=n[0].x,o=n[0].y,s=i.contours,l=i.uid,u=r.xaxis,c=r.yaxis,h=t._fullLayout,f=\"contour\"+l,p=Wf(s,r,n[0]);if(!0!==i.visible)return h._paper.selectAll(\".\"+f+\",.hm\"+l).remove(),void h._infolayer.selectAll(\".cb\"+l).remove();\"heatmap\"===s.coloring?(i.zauto&&!1===i.autocontour&&(i._input.zmin=i.zmin=s.start-s.size/2,i._input.zmax=i.zmax=i.zmin+p.length*s.size),$f(t,r,[n])):(h._paper.selectAll(\".hm\"+l).remove(),h._infolayer.selectAll(\"g.rangeslider-container\").selectAll(\".hm\"+l).remove()),Kf(p),Yf(p);var d=u.c2p(a[0],!0),g=u.c2p(a[a.length-1],!0),v=c.c2p(o[0],!0),m=c.c2p(o[o.length-1],!0),y=[[d,m],[g,m],[g,v],[d,v]],x=p;\"constraint\"===s.type&&(x=jf(p,s._operation),Bf(x,s._operation,y,i));var b=ip.makeContourGroup(r,n,f);!function(t,e,r){var n=t.selectAll(\"g.contourbg\").data([0]);n.enter().append(\"g\").classed(\"contourbg\",!0);var i=n.selectAll(\"path\").data(\"fill\"===r.coloring?[0]:[]);i.enter().append(\"path\"),i.exit().remove(),i.attr(\"d\",\"M\"+e.join(\"L\")+\"Z\").style(\"stroke\",\"none\")}(b,y,s),function(t,r,n,i){var a=t.selectAll(\"g.contourfill\").data([0]);a.enter().append(\"g\").classed(\"contourfill\",!0);var o=a.selectAll(\"path\").data(\"fill\"===i.coloring||\"constraint\"===i.type&&\"=\"!==i._operation?r:[]);o.enter().append(\"path\"),o.exit().remove(),o.each(function(t){var r=sp(t,n);r?e.select(this).attr(\"d\",r).style(\"stroke\",\"none\"):e.select(this).remove()})}(b,x,y,s),function(t,r,n,i,a,o){var s=t.selectAll(\"g.contourlines\").data([0]);s.enter().append(\"g\").classed(\"contourlines\",!0);var l=!1!==a.showlines,u=a.showlabels,c=l&&u,h=ip.createLines(s,l||u,r),f=ip.createLineClip(s,c,n._fullLayout._clips,i.trace.uid),p=t.selectAll(\"g.contourlabels\").data(u?[0]:[]);if(p.exit().remove(),p.enter().append(\"g\").classed(\"contourlabels\",!0),u){var d=[o],g=[];ne.clearLocationCache();var v=ip.labelFormatter(a,i.t.cb,n._fullLayout),m=Sr.tester.append(\"text\").attr(\"data-notex\",1).call(Sr.font,a.labelfont),y=r[0].xaxis._length,x=r[0].yaxis._length,b={left:Math.max(o[0][0],0),right:Math.min(o[2][0],y),top:Math.max(o[0][1],0),bottom:Math.min(o[2][1],x)};b.middle=(b.top+b.bottom)/2,b.center=(b.left+b.right)/2;var _=Math.sqrt(y*y+x*x),w=Nf.LABELDISTANCE*_/Math.max(1,r.length/Nf.LABELINCREASE);h.each(function(t){var r=ip.calcTextOpts(t.level,v,m,n);e.select(this).selectAll(\"path\").each(function(){var t=ne.getVisibleSegment(this,b,r.height/2);if(t&&!(t.len<(r.width+r.height)*Nf.LABELMIN))for(var e=Math.min(Math.ceil(t.len/w),Nf.LABELMAX),n=0;n<e;n++){var i=ip.findBestTextLocation(this,t,r,g,b);if(!i)break;ip.addLabelData(i,r,g,d)}})}),m.remove(),ip.drawLabels(p,g,n,f,c?d:null)}u&&!l&&h.remove()}(b,p,t,n[0],s,y),function(t,e,r,n,i){var a=\"clip\"+n.trace.uid,o=r.selectAll(\"#\"+a).data(n.trace.connectgaps?[]:[0]);if(o.enter().append(\"clipPath\").classed(\"contourclip\",!0).attr(\"id\",a),o.exit().remove(),!1===n.trace.connectgaps){var s={level:.9,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:e.xaxis,yaxis:e.yaxis,x:n.x,y:n.y,z:function(t){var e,r,n=t.trace._emptypoints,i=[],a=t.z.length,o=t.z[0].length,s=[];for(e=0;e<o;e++)s.push(1);for(e=0;e<a;e++)i.push(s.slice());for(e=0;e<n.length;e++)r=n[e],i[r[0]][r[1]]=0;return t.zmask=i,i}(n),smoothing:0};Kf([s]),Yf([s]);var l=sp(s,i),u=o.selectAll(\"path\").data([0]);u.enter().append(\"path\"),u.attr(\"d\",l)}else a=null;t.call(Sr.setClipUrl,a),e.plot.selectAll(\".hm\"+n.trace.uid).call(Sr.setClipUrl,a)}(b,r,h._clips,n[0],y)}function sp(t,e){var r,n,i,a,o,s,l,u=function(t,e){var r=t.prefixBoundary;if(void 0===r){var n=Math.min(t.z[0][0],t.z[0][1]);r=!t.edgepaths.length&&n>t.level}return r?\"M\"+e.join(\"L\")+\"Z\":\"\"}(t,e),c=0,h=t.edgepaths.map(function(t,e){return e}),f=!0;function p(t){return Math.abs(t[1]-e[2][1])<.01}function d(t){return Math.abs(t[0]-e[0][0])<.01}function g(t){return Math.abs(t[0]-e[2][0])<.01}for(;h.length;){for(s=Sr.smoothopen(t.edgepaths[c],t.smoothing),u+=f?s:s.replace(/^M/,\"L\"),h.splice(h.indexOf(c),1),r=t.edgepaths[c][t.edgepaths[c].length-1],a=-1,i=0;i<4;i++){if(!r){ne.log(\"Missing end?\",c,t);break}for(l=r,Math.abs(l[1]-e[0][1])<.01&&!g(r)?n=e[1]:d(r)?n=e[0]:p(r)?n=e[3]:g(r)&&(n=e[2]),o=0;o<t.edgepaths.length;o++){var v=t.edgepaths[o][0];Math.abs(r[0]-n[0])<.01?Math.abs(r[0]-v[0])<.01&&(v[1]-r[1])*(n[1]-v[1])>=0&&(n=v,a=o):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-v[1])<.01&&(v[0]-r[0])*(n[0]-v[0])>=0&&(n=v,a=o):ne.log(\"endpt to newendpt is not vert. or horz.\",r,n,v)}if(r=n,a>=0)break;u+=\"L\"+n}if(a===t.edgepaths.length){ne.log(\"unclosed perimeter path\");break}c=a,(f=-1===h.indexOf(c))&&(c=h[0],u+=\"Z\")}for(c=0;c<t.paths.length;c++)u+=Sr.smoothclosed(t.paths[c],t.smoothing);return u}function lp(t,e,r,n){var i=e.width/2,a=e.height/2,o=t.x,s=t.y,l=t.theta,u=Math.cos(l)*i,c=Math.sin(l)*i,h=(o>n.center?n.right-o:o-n.left)/(u+Math.abs(Math.sin(l)*a)),f=(s>n.middle?n.bottom-s:s-n.top)/(Math.abs(c)+Math.cos(l)*a);if(h<1||f<1)return 1/0;var p=ap.EDGECOST*(1/(h-1)+1/(f-1));p+=ap.ANGLECOST*l*l;for(var d=o-u,g=s-c,v=o+u,m=s+c,y=0;y<r.length;y++){var x=r[y],b=Math.cos(x.theta)*x.width/2,_=Math.sin(x.theta)*x.width/2,w=2*ne.segmentDistance(d,g,v,m,x.x-b,x.y-_,x.x+b,x.y+_)/(e.height+x.height),M=x.level===e.level,A=M?ap.SAMELEVELDISTANCE:1;if(w<=A)return 1/0;p+=ap.NEIGHBORCOST*(M?ap.SAMELEVELFACTOR:1)/(w-A)}return p}ip.plot=function(t,e,r){for(var n=0;n<r.length;n++)op(t,e,r[n])},ip.makeContourGroup=function(t,e,r){var n=t.plot.select(\".maplayer\").selectAll(\"g.contour.\"+r).data(e);return n.enter().append(\"g\").classed(\"contour\",!0).classed(r,!0),n.exit().remove(),n},ip.createLines=function(t,e,r){var n=r[0].smoothing,i=t.selectAll(\"g.contourlevel\").data(e?r:[]);if(i.exit().remove(),i.enter().append(\"g\").classed(\"contourlevel\",!0),e){var a=i.selectAll(\"path.openline\").data(function(t){return t.pedgepaths||t.edgepaths});a.exit().remove(),a.enter().append(\"path\").classed(\"openline\",!0),a.attr(\"d\",function(t){return Sr.smoothopen(t,n)}).style(\"stroke-miterlimit\",1).style(\"vector-effect\",\"non-scaling-stroke\");var o=i.selectAll(\"path.closedline\").data(function(t){return t.ppaths||t.paths});o.exit().remove(),o.enter().append(\"path\").classed(\"closedline\",!0),o.attr(\"d\",function(t){return Sr.smoothclosed(t,n)}).style(\"stroke-miterlimit\",1).style(\"vector-effect\",\"non-scaling-stroke\")}return i},ip.createLineClip=function(t,e,r,n){var i=e?\"clipline\"+n:null,a=r.selectAll(\"#\"+i).data(e?[0]:[]);return a.exit().remove(),a.enter().append(\"clipPath\").classed(\"contourlineclip\",!0).attr(\"id\",i),Sr.setClipUrl(t,i),a},ip.labelFormatter=function(t,e,r){if(t.labelformat)return r._d3locale.numberFormat(t.labelformat);var n;if(e)n=e.axis;else{if(n={type:\"linear\",_id:\"ycontour\",showexponent:\"all\"},\"constraint\"===t.type){var i=t.value;Array.isArray(i)?n.range=[i[0],i[i.length-1]]:n.range=[i,i]}else n.range=[t.start,t.end],n.nticks=(t.end-t.start)/t.size;n.range[0]===n.range[1]&&(n.range[1]+=n.range[0]||1),n.nticks||(n.nticks=1e3),ei(n,r),ri.prepTicks(n),n._tmin=null,n._tmax=null}return function(t){return ri.tickText(n,t).text}},ip.calcTextOpts=function(t,e,r,n){var i=e(t);r.text(i).call(er.convertToTspans,n);var a=Sr.bBox(r.node(),!0);return{text:i,width:a.width,height:a.height,level:t,dy:(a.top+a.bottom)/2}},ip.findBestTextLocation=function(t,e,r,n,i){var a,o,s,l,u,c=r.width;e.isClosed?(o=e.len/ap.INITIALSEARCHPOINTS,a=e.min+o/2,s=e.max):(o=(e.len-c)/(ap.INITIALSEARCHPOINTS+1),a=e.min+o+c/2,s=e.max-(o+c)/2);for(var h=1/0,f=0;f<ap.ITERATIONS;f++){for(var p=a;p<s;p+=o){var d=ne.getTextLocation(t,e.total,p,c),g=lp(d,r,n,i);g<h&&(h=g,u=d,l=p)}if(h>2*ap.MAXCOST)break;f&&(o/=2),s=(a=l-o/2)+1.5*o}if(h<=ap.MAXCOST)return u},ip.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),h=i*c,f=a*u,p=i*u,d=-a*c,g=[[o-h-f,s-p-d],[o+h-f,s+p-d],[o+h+f,s+p+d],[o-h+f,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(g)},ip.drawLabels=function(t,r,n,i,a){var o=t.selectAll(\"text\").data(r,function(t){return t.text+\",\"+t.x+\",\"+t.y+\",\"+t.theta});if(o.exit().remove(),o.enter().append(\"text\").attr({\"data-notex\":1,\"text-anchor\":\"middle\"}).each(function(t){var r=t.x+Math.sin(t.theta)*t.dy,i=t.y-Math.cos(t.theta)*t.dy;e.select(this).text(t.text).attr({x:r,y:i,transform:\"rotate(\"+180*t.theta/Math.PI+\" \"+r+\" \"+i+\")\"}).call(er.convertToTspans,n)}),a){for(var s=\"\",l=0;l<a.length;l++)s+=\"M\"+a[l].join(\"L\")+\"Z\";var u=i.selectAll(\"path\").data([0]);u.enter().append(\"path\"),u.attr(\"d\",s)}};var up=function(t){e.select(t).selectAll(\".hm image\").style(\"opacity\",function(t){return t.trace.opacity})},cp=function(t){var r=e.select(t).selectAll(\"g.contour\");r.style(\"opacity\",function(t){return t.trace.opacity}),r.each(function(t){var r=e.select(this),n=t.trace,i=n.contours,a=n.line,o=i.size||1,s=i.start,l=\"constraint\"===i.type,u=!l&&\"lines\"===i.coloring,c=!l&&\"fill\"===i.coloring,h=u||c?Mf(n):null;r.selectAll(\"g.contourlevel\").each(function(t){e.select(this).selectAll(\"path\").call(Sr.lineGroupStyle,a.width,u?h(t.level):a.color,a.dash)});var f=i.labelfont;if(r.selectAll(\"g.contourlabels text\").each(function(t){Sr.font(e.select(this),{family:f.family,size:f.size,color:f.color||(u?h(t.level):a.color)})}),l)r.selectAll(\"g.contourfill path\").style(\"fill\",n.fillcolor);else if(c){var p;r.selectAll(\"g.contourfill path\").style(\"fill\",function(t){return void 0===p&&(p=t.level),h(t.level+.5*o)}),void 0===p&&(p=s),r.selectAll(\"g.contourbg path\").style(\"fill\",h(p-.5*o))}}),up(t)},hp={};hp.attributes=Rh,hp.supplyDefaults=function(t,e,r,n){function i(r,n){return ne.coerce(t,e,Rh,r,n)}if(Df(t,e,i,n)){i(\"text\");var a=\"constraint\"===i(\"contours.type\");i(\"connectgaps\",qh(e)),a||delete e.showlegend,a?Lf(t,e,i,n,r):(zf(0,e,i,function(r){return ne.coerce2(t,e,Rh,r)}),Pf(t,e,i,n))}else e.visible=!1},hp.calc=_f,hp.plot=ip.plot,hp.style=cp,hp.colorbar=Af,hp.hoverPoints=Ff,hp.moduleType=\"trace\",hp.name=\"contour\",hp.basePlotModule=ua,hp.categories=[\"cartesian\",\"2dMap\",\"contour\",\"showLegend\"],hp.meta={};var fp=hp,pp=Rh.contours,dp=m.extendFlat,gp=Zr.line,vp=dp({},{carpet:{valType:\"string\",editType:\"calc\"},z:Lh.z,a:Lh.x,a0:Lh.x0,da:Lh.dx,b:Lh.y,b0:Lh.y0,db:Lh.dy,text:Lh.text,transpose:Lh.transpose,atype:Lh.xtype,btype:Lh.ytype,fillcolor:Rh.fillcolor,autocontour:Rh.autocontour,ncontours:Rh.ncontours,contours:{type:pp.type,start:pp.start,end:pp.end,size:pp.size,coloring:{valType:\"enumerated\",values:[\"fill\",\"lines\",\"none\"],dflt:\"fill\",editType:\"calc\"},showlines:pp.showlines,showlabels:pp.showlabels,labelfont:pp.labelfont,labelformat:pp.labelformat,operation:pp.operation,value:pp.value,editType:\"calc\",impliedEdits:{autocontour:!1}},line:{color:dp({},gp.color,{}),width:gp.width,dash:gp.dash,smoothing:dp({},gp.smoothing,{}),editType:\"plot\"}},Pe,{autocolorscale:dp({},Pe.autocolorscale,{dflt:!1})},{colorbar:ze}),mp=function(t,e){for(var r,n=t._fullData.length,i=0;i<n;i++){var a=t._fullData[i];if(a.index!==e.index&&(\"carpet\"===a.type&&(r||(r=a),a.carpet===e.carpet)))return a}return r},yp=function(t,e,r,n){function i(r,n){return ne.coerce(t,e,vp,r,n)}if(i(\"carpet\"),t.a&&t.b){if(!Df(t,e,i,n,\"a\",\"b\"))return void(e.visible=!1);i(\"text\");var a=\"constraint\"===i(\"contours.type\");a||delete e.showlegend,a?Lf(t,e,i,n,r,{hasHover:!1}):(zf(0,e,i,function(r){return ne.coerce2(t,e,vp,r)}),Pf(t,e,i,n,{hasHover:!1}))}else e._defaultColor=r};var xp=ne.isArrayOrTypedArray,bp=function(t,e,r,n){var i,a,o,s,l,u,c,h,f,p,d,g,v,m=xp(r)?\"a\":\"b\",y=(\"a\"===m?t.aaxis:t.baxis).smoothing,x=\"a\"===m?t.a2i:t.b2j,b=\"a\"===m?r:n,_=\"a\"===m?n:r,w=\"a\"===m?e.a.length:e.b.length,M=\"a\"===m?e.b.length:e.a.length,A=Math.floor(\"a\"===m?t.b2j(_):t.a2i(_)),k=\"a\"===m?function(e){return t.evalxy([],e,A)}:function(e){return t.evalxy([],A,e)};y&&(o=Math.max(0,Math.min(M-2,A)),s=A-o,a=\"a\"===m?function(e,r){return t.dxydi([],e,o,r,s)}:function(e,r){return t.dxydj([],o,e,s,r)});var T=x(b[0]),S=x(b[1]),E=T<S?1:-1,C=1e-8*(S-T),L=E>0?Math.floor:Math.ceil,z=E>0?Math.ceil:Math.floor,P=E>0?Math.min:Math.max,I=E>0?Math.max:Math.min,D=L(T+C),O=z(S-C),R=[[c=k(T)]];for(i=D;i*E<O*E;i+=E)l=[],d=I(T,i),v=(g=P(S,i+E))-d,u=Math.max(0,Math.min(w-2,Math.floor(.5*(d+g)))),h=k(g),y&&(f=a(u,d-u),p=a(u,g-u),l.push([c[0]+f[0]/3*v,c[1]+f[1]/3*v]),l.push([h[0]-p[0]/3*v,h[1]-p[1]/3*v])),l.push(h),R.push(l),c=h;return R},_p=function(t,e,r,n,i,a,o,s){var l,u,c,h,f,p,d,g=\"\",v=e.edgepaths.map(function(t,e){return e}),m=!0,y=1e-4*Math.abs(r[0][0]-r[2][0]),x=1e-4*Math.abs(r[0][1]-r[2][1]);function b(t){return Math.abs(t[1]-r[0][1])<x}function _(t){return Math.abs(t[1]-r[2][1])<x}function w(t){return Math.abs(t[0]-r[0][0])<y}function M(t){return Math.abs(t[0]-r[2][0])<y}function A(t,e){var r,n,l,u,c=\"\";for(b(t)&&!M(t)||_(t)&&!w(t)?(u=i.aaxis,l=bp(i,a,[t[0],e[0]],.5*(t[1]+e[1]))):(u=i.baxis,l=bp(i,a,.5*(t[0]+e[0]),[t[1],e[1]])),r=1;r<l.length;r++)for(c+=u.smoothing?\"C\":\"L\",n=0;n<l[r].length;n++){var h=l[r][n];c+=[o.c2p(h[0]),s.c2p(h[1])]+\" \"}return c}for(l=0,u=null;v.length;){var k=e.edgepaths[l][0];for(u&&(g+=A(u,k)),d=Sr.smoothopen(e.edgepaths[l].map(n),e.smoothing),g+=m?d:d.replace(/^M/,\"L\"),v.splice(v.indexOf(l),1),u=e.edgepaths[l][e.edgepaths[l].length-1],f=-1,h=0;h<4;h++){if(!u){ne.log(\"Missing end?\",l,e);break}for(b(u)&&!M(u)?c=r[1]:w(u)?c=r[0]:_(u)?c=r[3]:M(u)&&(c=r[2]),p=0;p<e.edgepaths.length;p++){var T=e.edgepaths[p][0];Math.abs(u[0]-c[0])<y?Math.abs(u[0]-T[0])<y&&(T[1]-u[1])*(c[1]-T[1])>=0&&(c=T,f=p):Math.abs(u[1]-c[1])<x?Math.abs(u[1]-T[1])<x&&(T[0]-u[0])*(c[0]-T[0])>=0&&(c=T,f=p):ne.log(\"endpt to newendpt is not vert. or horz.\",u,c,T)}if(f>=0)break;g+=A(u,c),u=c}if(f===e.edgepaths.length){ne.log(\"unclosed perimeter path\");break}l=f,(m=-1===v.indexOf(l))&&(l=v[0],g+=A(u,c)+\"Z\",u=null)}for(l=0;l<e.paths.length;l++)g+=Sr.smoothclosed(e.paths[l].map(n),e.smoothing);return g},wp=function(t,e){var r,n,i,a,o,s,l,u,c;for(r=0;r<t.length;r++){for(o=(a=t[r]).pedgepaths=[],s=a.ppaths=[],n=0;n<a.edgepaths.length;n++){for(c=a.edgepaths[n],l=[],i=0;i<c.length;i++)l[i]=e(c[i]);o.push(l)}for(n=0;n<a.paths.length;n++){for(c=a.paths[n],u=[],i=0;i<c.length;i++)u[i]=e(c[i]);s.push(u)}}};function Mp(t,r,n){var i=n[0].trace,a=i.carpetTrace=mp(t,i),o=t.calcdata[a.index][0];if(a.visible&&\"legendonly\"!==a.visible){var s=n[0].a,l=n[0].b,u=i.contours,c=i.uid,h=r.xaxis,f=r.yaxis,p=t._fullLayout,d=\"contour\"+c,g=Wf(u,r,n[0]),v=\"constraint\"===u.type,m=u._operation,y=v?\"=\"===m?\"lines\":\"fill\":u.coloring;if(!0===i.visible){var x=[[s[0],l[l.length-1]],[s[s.length-1],l[l.length-1]],[s[s.length-1],l[0]],[s[0],l[0]]];Kf(g);var b=1e-8*(s[s.length-1]-s[0]),_=1e-8*(l[l.length-1]-l[0]);Yf(g,b,_);var w=g;\"constraint\"===u.type&&(w=jf(g,m),Bf(w,m,x,i)),wp(g,L);var M,A,k,T,S=ip.makeContourGroup(r,n,d),E=[];for(T=o.clipsegments.length-1;T>=0;T--)M=o.clipsegments[T],A=Ou([],M.x,h.c2p),k=Ou([],M.y,f.c2p),A.reverse(),k.reverse(),E.push(Iu(A,k,M.bicubic));var C=\"M\"+E.join(\"L\")+\"Z\";!function(t,e,r,n,i,a){var o,s,l,u,c=t.selectAll(\"g.contourbg\").data([0]);c.enter().append(\"g\").classed(\"contourbg\",!0);var h=c.selectAll(\"path\").data(\"fill\"!==a||i?[]:[0]);h.enter().append(\"path\"),h.exit().remove();var f=[];for(u=0;u<e.length;u++)o=e[u],s=Ou([],o.x,r.c2p),l=Ou([],o.y,n.c2p),f.push(Iu(s,l,o.bicubic));h.attr(\"d\",\"M\"+f.join(\"L\")+\"Z\").style(\"stroke\",\"none\")}(S,o.clipsegments,h,f,v,y),function(t,r,n,i,a,o,s,l,u,c,h){var f=r.selectAll(\"g.contourfill\").data([0]);f.enter().append(\"g\").classed(\"contourfill\",!0);var p=f.selectAll(\"path\").data(\"fill\"===c?a:[]);p.enter().append(\"path\"),p.exit().remove(),p.each(function(r){var a=_p(t,r,o,s,l,u,n,i);r.prefixBoundary&&(a=h+a),a?e.select(this).attr(\"d\",a).style(\"stroke\",\"none\"):e.select(this).remove()})}(i,S,h,f,w,x,L,a,o,y,C),function(t,r,n,i,a,o,s){var l=t.selectAll(\"g.contourlines\").data([0]);l.enter().append(\"g\").classed(\"contourlines\",!0);var u=!1!==a.showlines,c=a.showlabels,h=u&&c,f=ip.createLines(l,u||c,r),p=ip.createLineClip(l,h,n._fullLayout._defs,i.trace.uid),d=t.selectAll(\"g.contourlabels\").data(c?[0]:[]);if(d.exit().remove(),d.enter().append(\"g\").classed(\"contourlabels\",!0),c){var g=o.xaxis,v=o.yaxis,m=g._length,y=v._length,x=[[[0,0],[m,0],[m,y],[0,y]]],b=[];ne.clearLocationCache();var _=ip.labelFormatter(a,i.t.cb,n._fullLayout),w=Sr.tester.append(\"text\").attr(\"data-notex\",1).call(Sr.font,a.labelfont),M={left:0,right:m,center:m/2,top:0,bottom:y,middle:y/2},A=Math.sqrt(m*m+y*y),k=Nf.LABELDISTANCE*A/Math.max(1,r.length/Nf.LABELINCREASE);f.each(function(t){var r=ip.calcTextOpts(t.level,_,w,n);e.select(this).selectAll(\"path\").each(function(e){var n=ne.getVisibleSegment(this,M,r.height/2);if(n&&(function(t,e,r,n,i,a){for(var o,s=0;s<r.pedgepaths.length;s++)e===r.pedgepaths[s]&&(o=r.edgepaths[s]);if(!o)return;var l=i.a[0],u=i.a[i.a.length-1],c=i.b[0],h=i.b[i.b.length-1];function f(t,e){var r,n=0;return(Math.abs(t[0]-l)<.1||Math.abs(t[0]-u)<.1)&&(r=kp(i.dxydb_rough(t[0],t[1],.1)),n=Math.max(n,a*Tp(e,r)/2)),(Math.abs(t[1]-c)<.1||Math.abs(t[1]-h)<.1)&&(r=kp(i.dxyda_rough(t[0],t[1],.1)),n=Math.max(n,a*Tp(e,r)/2)),n}var p=Ap(t,0,1),d=Ap(t,n.total,n.total-1),g=f(o[0],p),v=n.total-f(o[o.length-1],d);n.min<g&&(n.min=g);n.max>v&&(n.max=v);n.len=n.max-n.min}(this,e,t,n,s,r.height),!(n.len<(r.width+r.height)*Nf.LABELMIN)))for(var i=Math.min(Math.ceil(n.len/k),Nf.LABELMAX),a=0;a<i;a++){var o=ip.findBestTextLocation(this,n,r,b,M);if(!o)break;ip.addLabelData(o,r,b,x)}})}),w.remove(),ip.drawLabels(d,b,n,p,h?x:null)}c&&!u&&f.remove()}(S,g,t,n[0],u,r,a),Sr.setClipUrl(S,a._clipPathId)}else p._infolayer.selectAll(\".cb\"+c).remove()}function L(t){var e=a.ab2xy(t[0],t[1],!0);return[h.c2p(e[0]),f.c2p(e[1])]}}function Ap(t,e,r){var n=t.getPointAtLength(e),i=t.getPointAtLength(r),a=i.x-n.x,o=i.y-n.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function kp(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}function Tp(t,e){var r=Math.abs(t[0]*e[0]+t[1]*e[1]);return Math.sqrt(1-r*r)/r}var Sp={};Sp.attributes=vp,Sp.supplyDefaults=yp,Sp.colorbar=Af,Sp.calc=function(t,e){var r=e.carpetTrace=mp(t,e);if(r&&r.visible&&\"legendonly\"!==r.visible){if(!e.a||!e.b){var n=t.data[r.index],i=t.data[e.index];i.a||(i.a=n.a),i.b||(i.b=n.b),yp(i,e,e._defaultColor,t._fullLayout)}var a=function(t,e){var r,n,i,a,o,s,l,u=e.carpetTrace,c=u.aaxis,h=u.baxis;c._minDtick=0,h._minDtick=0,qh(e)&&Pu(e,c,h,\"a\",\"b\",[\"z\"]),r=e.a?c.makeCalcdata(e,\"a\"):[],a=e.b?h.makeCalcdata(e,\"b\"):[],n=e.a0||0,i=e.da||1,o=e.b0||0,s=e.db||1,l=xu(e.z,e.transpose),e._emptypoints=Vh(l),e._interpz=Wh(l,e._emptypoints,e._interpz);var f=jh(l),p=\"scaled\"===e.xtype?\"\":r,d=Zh(e,p,n,i,f,c),g=\"scaled\"===e.ytype?\"\":a,v=Zh(e,g,o,s,l.length,h),m={a:d,b:v,z:l};return\"levels\"===e.contours.type&&Ve(e,l,\"\",\"z\"),[m]}(0,e);return Bh(e),a}},Sp.plot=function(t,e,r){for(var n=0;n<r.length;n++)Mp(t,e,r[n])},Sp.style=cp,Sp.moduleType=\"trace\",Sp.name=\"contourcarpet\",Sp.basePlotModule=ua,Sp.categories=[\"cartesian\",\"carpet\",\"contour\",\"symbols\",\"showLegend\",\"hasLines\",\"carpetDependent\"],Sp.meta={};var Ep=Sp,Cp={\"X,X div\":\"font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;\",\"X input,X button\":\"font-family:'Open Sans', verdana, arial, sans-serif;\",\"X input:focus,X button:focus\":\"outline:none;\",\"X a\":\"text-decoration:none;\",\"X a:hover\":\"text-decoration:none;\",\"X .crisp\":\"shape-rendering:crispEdges;\",\"X .user-select-none\":\"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;\",\"X svg\":\"overflow:hidden;\",\"X svg a\":\"fill:#447adb;\",\"X svg a:hover\":\"fill:#3c6dc5;\",\"X .main-svg\":\"position:absolute;top:0;left:0;pointer-events:none;\",\"X .main-svg .draglayer\":\"pointer-events:all;\",\"X .cursor-default\":\"cursor:default;\",\"X .cursor-pointer\":\"cursor:pointer;\",\"X .cursor-crosshair\":\"cursor:crosshair;\",\"X .cursor-move\":\"cursor:move;\",\"X .cursor-col-resize\":\"cursor:col-resize;\",\"X .cursor-row-resize\":\"cursor:row-resize;\",\"X .cursor-ns-resize\":\"cursor:ns-resize;\",\"X .cursor-ew-resize\":\"cursor:ew-resize;\",\"X .cursor-sw-resize\":\"cursor:sw-resize;\",\"X .cursor-s-resize\":\"cursor:s-resize;\",\"X .cursor-se-resize\":\"cursor:se-resize;\",\"X .cursor-w-resize\":\"cursor:w-resize;\",\"X .cursor-e-resize\":\"cursor:e-resize;\",\"X .cursor-nw-resize\":\"cursor:nw-resize;\",\"X .cursor-n-resize\":\"cursor:n-resize;\",\"X .cursor-ne-resize\":\"cursor:ne-resize;\",\"X .modebar\":\"position:absolute;top:2px;right:2px;z-index:1001;background:rgba(255,255,255,0.7);\",\"X .modebar--hover\":\"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\":\"opacity:1;\",\"X .modebar-group\":\"float:left;display:inline-block;box-sizing:border-box;margin-left:8px;position:relative;vertical-align:middle;white-space:nowrap;\",\"X .modebar-group:first-child\":\"margin-left:0px;\",\"X .modebar-btn\":\"position:relative;font-size:16px;padding:3px 4px;cursor:pointer;line-height:normal;box-sizing:border-box;\",\"X .modebar-btn svg\":\"position:relative;top:2px;\",\"X .modebar-btn path\":\"fill:rgba(0,31,95,0.3);\",\"X .modebar-btn.active path,X .modebar-btn:hover path\":\"fill:rgba(0,22,72,0.5);\",\"X .modebar-btn.modebar-btn--logo\":\"padding:3px 1px;\",\"X .modebar-btn.modebar-btn--logo path\":\"fill:#447adb !important;\",\"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 .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 Lp in Cp){var zp=Lp.replace(/^,/,\" ,\").replace(/X/g,\".js-plotly-plot .plotly\").replace(/Y/g,\".plotly-notifier\");ne.addStyleRule(zp,Cp[Lp])}var Pp,Ip,Dp,Op={undo:{width:857.1,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\",ascent:850,descent:-150},home:{width:928.6,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\",ascent:850,descent:-150},\"camera-retro\":{width: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\",ascent:850,descent:-150},zoombox:{width: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\",ascent:850,descent:-150},pan:{width: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\",ascent:850,descent:-150},zoom_plus:{width: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\",ascent:850,descent:-150},zoom_minus:{width:1e3,path:\"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z\",ascent:850,descent:-150},autoscale:{width: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\",ascent:850,descent:-150},tooltip_basic:{width:1500,path:\"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z\",ascent:850,descent:-150},tooltip_compare:{width:1125,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\",ascent:850,descent:-150},plotlylogo:{width:1542,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\",ascent:850,descent:-150},\"z-axis\":{width: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\",ascent:850,descent:-150},\"3d_rotate\":{width: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\",ascent:850,descent:-150},camera:{width: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\",ascent:850,descent:-150},movie:{width: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\",ascent:850,descent:-150},question:{width:857.1,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\",ascent:850,descent:-150},disk:{width:857.1,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\",ascent:850,descent:-150},lasso:{width:1031,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\",ascent:850,descent:-150},selectbox:{width: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\",ascent:850,descent:-150},spikeline:{width: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\",ascent:850,descent:-150}},Rp=Pp={};function Fp(){throw new Error(\"setTimeout has not been defined\")}function Bp(){throw new Error(\"clearTimeout has not been defined\")}function Np(t){if(Ip===setTimeout)return setTimeout(t,0);if((Ip===Fp||!Ip)&&setTimeout)return Ip=setTimeout,setTimeout(t,0);try{return Ip(t,0)}catch(e){try{return Ip.call(null,t,0)}catch(e){return Ip.call(this,t,0)}}}!function(){try{Ip=\"function\"==typeof setTimeout?setTimeout:Fp}catch(t){Ip=Fp}try{Dp=\"function\"==typeof clearTimeout?clearTimeout:Bp}catch(t){Dp=Bp}}();var jp,Vp=[],Up=!1,qp=-1;function Hp(){Up&&jp&&(Up=!1,jp.length?Vp=jp.concat(Vp):qp=-1,Vp.length&&Gp())}function Gp(){if(!Up){var t=Np(Hp);Up=!0;for(var e=Vp.length;e;){for(jp=Vp,Vp=[];++qp<e;)jp&&jp[qp].run();qp=-1,e=Vp.length}jp=null,Up=!1,function(t){if(Dp===clearTimeout)return clearTimeout(t);if((Dp===Bp||!Dp)&&clearTimeout)return Dp=clearTimeout,clearTimeout(t);try{Dp(t)}catch(e){try{return Dp.call(null,t)}catch(e){return Dp.call(this,t)}}}(t)}}function Wp(t,e){this.fun=t,this.array=e}function Yp(){}Rp.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Vp.push(new Wp(t,e)),1!==Vp.length||Up||Np(Gp)},Wp.prototype.run=function(){this.fun.apply(null,this.array)},Rp.title=\"browser\",Rp.browser=!0,Rp.env={},Rp.argv=[],Rp.version=\"\",Rp.versions={},Rp.on=Yp,Rp.addListener=Yp,Rp.once=Yp,Rp.off=Yp,Rp.removeListener=Yp,Rp.removeAllListeners=Yp,Rp.emit=Yp,Rp.prependListener=Yp,Rp.prependOnceListener=Yp,Rp.listeners=function(t){return[]},Rp.binding=function(t){throw new Error(\"process.binding is not supported\")},Rp.cwd=function(){return\"/\"},Rp.chdir=function(t){throw new Error(\"process.chdir is not supported\")},Rp.umask=function(){return 0};var Xp={exports:{}};(function(t,e){!function(t,e){\"object\"==typeof Xp.exports?Xp.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)},i=0,a=void 0,o=void 0,s=function(t,e){d[i]=t,d[i+1]=e,2===(i+=2)&&(o?o(g):b())};var l=\"undefined\"!=typeof window?window:void 0,u=l||{},c=u.MutationObserver||u.WebKitMutationObserver,h=\"undefined\"==typeof self&&void 0!==t&&\"[object process]\"==={}.toString.call(t),f=\"undefined\"!=typeof Uint8ClampedArray&&\"undefined\"!=typeof importScripts&&\"undefined\"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(g,1)}}var d=new Array(1e3);function g(){for(var t=0;t<i;t+=2){(0,d[t])(d[t+1]),d[t]=void 0,d[t+1]=void 0}i=0}var v,m,y,x,b=void 0;function _(t,e){var r=arguments,n=this,i=new this.constructor(A);void 0===i[M]&&V(i);var a,o=n._state;return o?(a=r[o-1],s(function(){return N(o,i,a,n._result)})):O(n,i,t,e),i}function w(t){if(t&&\"object\"==typeof t&&t.constructor===this)return t;var e=new this(A);return z(e,t),e}h?b=function(){return t.nextTick(g)}:c?(m=0,y=new c(g),x=document.createTextNode(\"\"),y.observe(x,{characterData:!0}),b=function(){x.data=m=++m%2}):f?((v=new MessageChannel).port1.onmessage=g,b=function(){return v.port2.postMessage(0)}):b=void 0===l&&\"function\"==typeof require?function(){try{var t=require(\"vertx\");return a=t.runOnLoop||t.runOnContext,function(){a(g)}}catch(t){return p()}}():p();var M=Math.random().toString(36).substring(16);function A(){}var k=void 0,T=1,S=2,E=new F;function C(t){try{return t.then}catch(t){return E.error=t,E}}function L(t,e,n){e.constructor===t.constructor&&n===_&&e.constructor.resolve===w?function(t,e){e._state===T?I(t,e._result):e._state===S?D(t,e._result):O(e,void 0,function(e){return z(t,e)},function(e){return D(t,e)})}(t,e):n===E?D(t,E.error):void 0===n?I(t,e):r(n)?function(t,e,r){s(function(t){var n=!1,i=function(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}(r,e,function(r){n||(n=!0,e!==r?z(t,r):I(t,r))},function(e){n||(n=!0,D(t,e))},t._label);!n&&i&&(n=!0,D(t,i))},t)}(t,e,n):I(t,e)}function z(t,e){var r;t===e?D(t,new TypeError(\"You cannot resolve a promise with itself\")):\"function\"==typeof(r=e)||\"object\"==typeof r&&null!==r?L(t,e,C(e)):I(t,e)}function P(t){t._onerror&&t._onerror(t._result),R(t)}function I(t,e){t._state===k&&(t._result=e,t._state=T,0!==t._subscribers.length&&s(R,t))}function D(t,e){t._state===k&&(t._state=S,t._result=e,s(P,t))}function O(t,e,r,n){var i=t._subscribers,a=i.length;t._onerror=null,i[a]=e,i[a+T]=r,i[a+S]=n,0===a&&t._state&&s(R,t)}function R(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,i=void 0,a=t._result,o=0;o<e.length;o+=3)n=e[o],i=e[o+r],n?N(r,n,i,a):i(a);t._subscribers.length=0}}function F(){this.error=null}var B=new F;function N(t,e,n,i){var a=r(n),o=void 0,s=void 0,l=void 0,u=void 0;if(a){if((o=function(t,e){try{return t(e)}catch(t){return B.error=t,B}}(n,i))===B?(u=!0,s=o.error,o=null):l=!0,e===o)return void D(e,new TypeError(\"A promises callback cannot return that same promise.\"))}else o=i,l=!0;e._state!==k||(a&&l?z(e,o):u?D(e,s):t===T?I(e,o):t===S&&D(e,o))}var j=0;function V(t){t[M]=j++,t._state=void 0,t._result=void 0,t._subscribers=[]}function U(t,e){this._instanceConstructor=t,this.promise=new t(A),this.promise[M]||V(this.promise),n(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?I(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&I(this.promise,this._result))):D(this.promise,new Error(\"Array Methods must be provided an Array\"))}function q(t){this[M]=j++,this._result=this._state=void 0,this._subscribers=[],A!==t&&(\"function\"!=typeof t&&function(){throw new TypeError(\"You must pass a resolver function as the first argument to the promise constructor\")}(),this instanceof q?function(t,e){try{e(function(e){z(t,e)},function(e){D(t,e)})}catch(e){D(t,e)}}(this,t):function(){throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\")}())}function H(){var t=void 0;if(void 0!==e)t=e;else if(\"undefined\"!=typeof self)t=self;else try{t=Function(\"return this\")()}catch(t){throw new Error(\"polyfill failed because global object is unavailable in this environment\")}var r=t.Promise;if(r){var n=null;try{n=Object.prototype.toString.call(r.resolve())}catch(t){}if(\"[object Promise]\"===n&&!r.cast)return}t.Promise=q}return U.prototype._enumerate=function(){for(var t=this.length,e=this._input,r=0;this._state===k&&r<t;r++)this._eachEntry(e[r],r)},U.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===w){var i=C(t);if(i===_&&t._state!==k)this._settledAt(t._state,e,t._result);else if(\"function\"!=typeof i)this._remaining--,this._result[e]=t;else if(r===q){var a=new r(A);L(a,t,i),this._willSettleAt(a,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},U.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===k&&(this._remaining--,t===S?D(n,r):this._result[e]=r),0===this._remaining&&I(n,this._result)},U.prototype._willSettleAt=function(t,e){var r=this;O(t,void 0,function(t){return r._settledAt(T,e,t)},function(t){return r._settledAt(S,e,t)})},q.all=function(t){return new U(this,t).promise},q.race=function(t){var e=this;return n(t)?new e(function(r,n){for(var i=t.length,a=0;a<i;a++)e.resolve(t[a]).then(r,n)}):new e(function(t,e){return e(new TypeError(\"You must pass an array to race.\"))})},q.resolve=w,q.reject=function(t){var e=new this(A);return D(e,t),e},q._setScheduler=function(t){o=t},q._setAsap=function(t){s=t},q._asap=s,q.prototype={constructor:q,then:_,catch:function(t){return this.then(null,t)}},H(),q.polyfill=H,q.Promise=q,q})}).call(this,Pp,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{}),Xp=Xp.exports;var Zp=[{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}],Jp={_isLinkedToArray:\"annotation\",visible:{valType:\"boolean\",dflt:!0,editType:\"calcIfAutorange+arraydraw\"},text:{valType:\"string\",editType:\"calcIfAutorange+arraydraw\"},textangle:{valType:\"angle\",dflt:0,editType:\"calcIfAutorange+arraydraw\"},font:T({editType:\"calcIfAutorange+arraydraw\",colorEditType:\"arraydraw\"}),width:{valType:\"number\",min:1,dflt:null,editType:\"calcIfAutorange+arraydraw\"},height:{valType:\"number\",min:1,dflt:null,editType:\"calcIfAutorange+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:\"calcIfAutorange+arraydraw\"},borderwidth:{valType:\"number\",min:0,dflt:1,editType:\"calcIfAutorange+arraydraw\"},showarrow:{valType:\"boolean\",dflt:!0,editType:\"calcIfAutorange+arraydraw\"},arrowcolor:{valType:\"color\",editType:\"arraydraw\"},arrowhead:{valType:\"integer\",min:0,max:Zp.length,dflt:1,editType:\"arraydraw\"},startarrowhead:{valType:\"integer\",min:0,max:Zp.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:\"calcIfAutorange+arraydraw\"},startarrowsize:{valType:\"number\",min:.3,dflt:1,editType:\"calcIfAutorange+arraydraw\"},arrowwidth:{valType:\"number\",min:.1,editType:\"calcIfAutorange+arraydraw\"},standoff:{valType:\"number\",min:0,dflt:0,editType:\"calcIfAutorange+arraydraw\"},startstandoff:{valType:\"number\",min:0,dflt:0,editType:\"calcIfAutorange+arraydraw\"},ax:{valType:\"any\",editType:\"calcIfAutorange+arraydraw\"},ay:{valType:\"any\",editType:\"calcIfAutorange+arraydraw\"},axref:{valType:\"enumerated\",dflt:\"pixel\",values:[\"pixel\",Te.idRegex.x.toString()],editType:\"calc\"},ayref:{valType:\"enumerated\",dflt:\"pixel\",values:[\"pixel\",Te.idRegex.y.toString()],editType:\"calc\"},xref:{valType:\"enumerated\",values:[\"paper\",Te.idRegex.x.toString()],editType:\"calc\"},x:{valType:\"any\",editType:\"calcIfAutorange+arraydraw\"},xanchor:{valType:\"enumerated\",values:[\"auto\",\"left\",\"center\",\"right\"],dflt:\"auto\",editType:\"calcIfAutorange+arraydraw\"},xshift:{valType:\"number\",dflt:0,editType:\"calcIfAutorange+arraydraw\"},yref:{valType:\"enumerated\",values:[\"paper\",Te.idRegex.y.toString()],editType:\"calc\"},y:{valType:\"any\",editType:\"calcIfAutorange+arraydraw\"},yanchor:{valType:\"enumerated\",values:[\"auto\",\"top\",\"middle\",\"bottom\"],dflt:\"auto\",editType:\"calcIfAutorange+arraydraw\"},yshift:{valType:\"number\",dflt:0,editType:\"calcIfAutorange+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:T({editType:\"arraydraw\"}),editType:\"arraydraw\"},captureevents:{valType:\"boolean\",editType:\"arraydraw\"},editType:\"calc\",_deprecated:{ref:{valType:\"string\",editType:\"calc\"}}},Kp=function(t,r,n){var i,a,o,s,l=t.node(),u=Zp[n.arrowhead||0],c=Zp[n.startarrowhead||0],h=(n.arrowwidth||1)*(n.arrowsize||1),f=(n.arrowwidth||1)*(n.startarrowsize||1),p=r.indexOf(\"start\")>=0,d=r.indexOf(\"end\")>=0,g=u.backoff*h+n.standoff,v=c.backoff*f+n.startstandoff;if(\"line\"===l.nodeName){i={x:+t.attr(\"x1\"),y:+t.attr(\"y1\")},a={x:+t.attr(\"x2\"),y:+t.attr(\"y2\")};var m=i.x-a.x,y=i.y-a.y;if(s=(o=Math.atan2(y,m))+Math.PI,g&&v&&g+v>Math.sqrt(m*m+y*y))return void C();if(g){if(g*g>m*m+y*y)return void C();var x=g*Math.cos(o),b=g*Math.sin(o);a.x+=x,a.y+=b,t.attr({x2:a.x,y2:a.y})}if(v){if(v*v>m*m+y*y)return void C();var _=v*Math.cos(o),w=v*Math.sin(o);i.x-=_,i.y-=w,t.attr({x1:i.x,y1:i.y})}}else if(\"path\"===l.nodeName){var M=l.getTotalLength(),A=\"\";if(M<g+v)return void C();var k=l.getPointAtLength(0),T=l.getPointAtLength(.1);o=Math.atan2(k.y-T.y,k.x-T.x),i=l.getPointAtLength(Math.min(v,M)),A=\"0px,\"+v+\"px,\";var S=l.getPointAtLength(M),E=l.getPointAtLength(M-.1);s=Math.atan2(S.y-E.y,S.x-E.x),a=l.getPointAtLength(Math.max(0,M-g)),A+=M-(A?v+g:g)+\"px,\"+M+\"px\",t.style(\"stroke-dasharray\",A)}function C(){t.style(\"stroke-dasharray\",\"0px,100px\")}function L(r,i,a,o){r.path&&(r.noRotate&&(a=0),e.select(l.parentNode).append(\"path\").attr({class:t.attr(\"class\"),d:r.path,transform:\"translate(\"+i.x+\",\"+i.y+\")\"+(a?\"rotate(\"+180*a/Math.PI+\")\":\"\")+\"scale(\"+o+\")\"}).style({fill:Oe.rgb(n.arrowcolor),\"stroke-width\":0}))}p&&L(c,i,o,f),d&&L(u,a,s,h)},Qp={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(\".annotation\").remove();for(var r=0;r<e.annotations.length;r++)e.annotations[r].visible&&$p(t,r);return _n.previousPromises(t)},drawOne:$p,drawRaw:td};function $p(t,e){var r=t._fullLayout.annotations[e]||{};td(t,r,e,!1,ri.getFromId(t,r.xref),ri.getFromId(t,r.yref))}function td(t,r,n,i,a,o){var s,l,u=t._fullLayout,c=t._fullLayout._size,h=t._context.edits;i?(s=\"annotation-\"+i,l=i+\".annotations[\"+n+\"]\"):(s=\"annotation\",l=\"annotations[\"+n+\"]\"),u._infolayer.selectAll(\".\"+s+'[data-index=\"'+n+'\"]').remove();var f=\"clip\"+u._uid+\"_ann\"+n;if(r._input&&!1!==r.visible){var p={x:{},y:{}},d=+r.textangle||0,g=u._infolayer.append(\"g\").classed(s,!0).attr(\"data-index\",String(n)).style(\"opacity\",r.opacity),v=g.append(\"g\").classed(\"annotation-text-g\",!0),m=h[r.showarrow?\"annotationTail\":\"annotationPosition\"],y=r.captureevents||h.annotationText||m,x=v.append(\"g\").style(\"pointer-events\",y?\"all\":null).call(Ka,\"default\").on(\"click\",function(){t._dragging=!1;var a={index:n,annotation:r._input,fullAnnotation:r,event:e.event};i&&(a.subplotId=i),t.emit(\"plotly_clickannotation\",a)});r.hovertext&&x.on(\"mouseover\",function(){var e=r.hoverlabel,n=e.font,i=this.getBoundingClientRect(),a=t.getBoundingClientRect();yo.loneHover({x0:i.left-a.left,x1:i.right-a.left,y:(i.top+i.bottom)/2-a.top,text:r.hovertext,color:e.bgcolor,borderColor:e.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:u._hoverlayer.node(),outerContainer:u._paper.node(),gd:t})}).on(\"mouseout\",function(){yo.loneUnhover(u._hoverlayer.node())});var b=r.borderwidth,_=r.borderpad,w=b+_,M=x.append(\"rect\").attr(\"class\",\"bg\").style(\"stroke-width\",b+\"px\").call(Oe.stroke,r.bordercolor).call(Oe.fill,r.bgcolor),A=r.width||r.height,k=u._topclips.selectAll(\"#\"+f).data(A?[0]:[]);k.enter().append(\"clipPath\").classed(\"annclip\",!0).attr(\"id\",f).append(\"rect\"),k.exit().remove();var T=r.font,S=x.append(\"text\").classed(\"annotation-text\",!0).text(r.text);h.annotationText?S.call(er.makeEditable,{delegate:x,gd:t}).call(E).on(\"edit\",function(e){r.text=e,this.call(E);var n={};n[l+\".text\"]=r.text,a&&a.autorange&&(n[a._name+\".autorange\"]=!0),o&&o.autorange&&(n[o._name+\".autorange\"]=!0),P.call(\"relayout\",t,n)}):S.call(E)}else e.selectAll(\"#\"+f).remove();function E(e){return e.call(Sr.font,T).attr({\"text-anchor\":{left:\"start\",right:\"end\"}[r.align]||\"middle\"}),er.convertToTspans(e,t,C),e}function C(){var e=S.selectAll(\"a\");1===e.size()&&e.text()===S.text()&&x.insert(\"a\",\":first-child\").attr({\"xlink:xlink:href\":e.attr(\"xlink:href\"),\"xlink:xlink:show\":e.attr(\"xlink:show\")}).style({cursor:\"pointer\"}).node().appendChild(M.node());var n=x.select(\".annotation-text-math-group\"),s=!n.empty(),y=Sr.bBox((s?n:S).node()),_=y.width,T=y.height,E=r.width||_,C=r.height||T,L=Math.round(E+2*w),z=Math.round(C+2*w);function I(t,e){return\"auto\"===e&&(e=t<1/3?\"left\":t>2/3?\"right\":\"center\"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}r._w=E,r._h=C;for(var D=!1,O=[\"x\",\"y\"],R=0;R<O.length;R++){var F,B,N,j,V,U=O[R],q=r[U+\"ref\"]||U,H=r[\"a\"+U+\"ref\"],G={x:a,y:o}[U],W=(d+(\"x\"===U?0:-90))*Math.PI/180,Y=L*Math.cos(W),X=z*Math.sin(W),Z=Math.abs(Y)+Math.abs(X),J=r[U+\"anchor\"],K=r[U+\"shift\"]*(\"x\"===U?1:-1),Q=p[U];if(G){var $=G.r2fraction(r[U]);if((t._dragging||!G.autorange)&&($<0||$>1)&&(H===q?(($=G.r2fraction(r[\"a\"+U]))<0||$>1)&&(D=!0):D=!0,D))continue;F=G._offset+G.r2p(r[U]),j=.5}else\"x\"===U?(N=r[U],F=c.l+c.w*N):(N=1-r[U],F=c.t+c.h*N),j=r.showarrow?.5:N;if(r.showarrow){Q.head=F;var tt=r[\"a\"+U];V=Y*I(.5,r.xanchor)-X*I(.5,r.yanchor),H===q?(Q.tail=G._offset+G.r2p(tt),B=V):(Q.tail=F+tt,B=V+tt),Q.text=Q.tail+V;var et=u[\"x\"===U?\"width\":\"height\"];if(\"paper\"===q&&(Q.head=ne.constrain(Q.head,1,et-1)),\"pixel\"===H){var rt=-Math.max(Q.tail-3,Q.text),nt=Math.min(Q.tail+3,Q.text)-et;rt>0?(Q.tail+=rt,Q.text+=rt):nt>0&&(Q.tail-=nt,Q.text-=nt)}Q.tail+=K,Q.head+=K}else B=V=Z*I(j,J),Q.text=F+V;Q.text+=K,V+=K,B+=K,r[\"_\"+U+\"padplus\"]=Z/2+B,r[\"_\"+U+\"padminus\"]=Z/2-B,r[\"_\"+U+\"size\"]=Z,r[\"_\"+U+\"shift\"]=V}if(D)x.remove();else{var it=0,at=0;if(\"left\"!==r.align&&(it=(E-_)*(\"center\"===r.align?.5:1)),\"top\"!==r.valign&&(at=(C-T)*(\"middle\"===r.valign?.5:1)),s)n.select(\"svg\").attr({x:w+it-1,y:w+at}).call(Sr.setClipUrl,A?f:null);else{var ot=w+at-y.top,st=w+it-y.left;S.call(er.positionText,st,ot).call(Sr.setClipUrl,A?f:null)}k.select(\"rect\").call(Sr.setRect,w,w,E,C),M.call(Sr.setRect,b/2,b/2,L-b,z-b),x.call(Sr.setTranslate,Math.round(p.x.text-L/2),Math.round(p.y.text-z/2)),v.attr({transform:\"rotate(\"+d+\",\"+p.x.text+\",\"+p.y.text+\")\"});var lt,ut,ct=function(e,n){g.selectAll(\".annotation-arrow-g\").remove();var s=p.x.head,u=p.y.head,f=p.x.tail+e,m=p.y.tail+n,y=p.x.text+e,b=p.y.text+n,_=ne.rotationXYMatrix(d,y,b),w=ne.apply2DTransform(_),A=ne.apply2DTransform2(_),k=+M.attr(\"width\"),T=+M.attr(\"height\"),S=y-.5*k,E=S+k,C=b-.5*T,L=C+T,z=[[S,C,S,L],[S,L,E,L],[E,L,E,C],[E,C,S,C]].map(A);if(!z.reduce(function(t,e){return t^!!ne.segmentsIntersect(s,u,s+1e6,u+1e6,e[0],e[1],e[2],e[3])},!1)){z.forEach(function(t){var e=ne.segmentsIntersect(f,m,s,u,t[0],t[1],t[2],t[3]);e&&(f=e.x,m=e.y)});var I=r.arrowwidth,D=r.arrowcolor,O=r.arrowside,R=g.append(\"g\").style({opacity:Oe.opacity(D)}).classed(\"annotation-arrow-g\",!0),F=R.append(\"path\").attr(\"d\",\"M\"+f+\",\"+m+\"L\"+s+\",\"+u).style(\"stroke-width\",I+\"px\").call(Oe.stroke,Oe.rgb(D));if(Kp(F,O,r),h.annotationPosition&&F.node().parentNode&&!i){var B=s,N=u;if(r.standoff){var j=Math.sqrt(Math.pow(s-f,2)+Math.pow(u-m,2));B+=r.standoff*(f-s)/j,N+=r.standoff*(m-u)/j}var V,U,q,H=R.append(\"path\").classed(\"annotation-arrow\",!0).classed(\"anndrag\",!0).attr({d:\"M3,3H-3V-3H3ZM0,0L\"+(f-B)+\",\"+(m-N),transform:\"translate(\"+B+\",\"+N+\")\"}).style(\"stroke-width\",I+6+\"px\").call(Oe.stroke,\"rgba(0,0,0,0)\").call(Oe.fill,\"rgba(0,0,0,0)\");Ua.init({element:H.node(),gd:t,prepFn:function(){var t=Sr.getTranslate(x);U=t.x,q=t.y,V={},a&&a.autorange&&(V[a._name+\".autorange\"]=!0),o&&o.autorange&&(V[o._name+\".autorange\"]=!0)},moveFn:function(t,e){var n=w(U,q),i=n[0]+t,s=n[1]+e;x.call(Sr.setTranslate,i,s),V[l+\".x\"]=a?a.p2r(a.r2p(r.x)+t):r.x+t/c.w,V[l+\".y\"]=o?o.p2r(o.r2p(r.y)+e):r.y-e/c.h,r.axref===r.xref&&(V[l+\".ax\"]=a.p2r(a.r2p(r.ax)+t)),r.ayref===r.yref&&(V[l+\".ay\"]=o.p2r(o.r2p(r.ay)+e)),R.attr(\"transform\",\"translate(\"+t+\",\"+e+\")\"),v.attr({transform:\"rotate(\"+d+\",\"+i+\",\"+s+\")\"})},doneFn:function(){P.call(\"relayout\",t,V);var e=document.querySelector(\".js-notes-box-panel\");e&&e.redraw(e.selectedObj)}})}}};if(r.showarrow&&ct(0,0),m)Ua.init({element:x.node(),gd:t,prepFn:function(){ut=v.attr(\"transform\"),lt={}},moveFn:function(t,e){var n=\"pointer\";if(r.showarrow)r.axref===r.xref?lt[l+\".ax\"]=a.p2r(a.r2p(r.ax)+t):lt[l+\".ax\"]=r.ax+t,r.ayref===r.yref?lt[l+\".ay\"]=o.p2r(o.r2p(r.ay)+e):lt[l+\".ay\"]=r.ay+e,ct(t,e);else{if(i)return;if(a)lt[l+\".x\"]=a.p2r(a.r2p(r.x)+t);else{var s=r._xsize/c.w,u=r.x+(r._xshift-r.xshift)/c.w-s/2;lt[l+\".x\"]=Ua.align(u+t/c.w,s,0,1,r.xanchor)}if(o)lt[l+\".y\"]=o.p2r(o.r2p(r.y)+e);else{var h=r._ysize/c.h,f=r.y-(r._yshift+r.yshift)/c.h-h/2;lt[l+\".y\"]=Ua.align(f-e/c.h,h,0,1,r.yanchor)}a&&o||(n=Ua.getCursor(a?.5:lt[l+\".x\"],o?.5:lt[l+\".y\"],r.xanchor,r.yanchor))}v.attr({transform:\"translate(\"+t+\",\"+e+\")\"+ut}),Ka(x,n)},doneFn:function(){Ka(x),P.call(\"relayout\",t,lt);var e=document.querySelector(\".js-notes-box-panel\");e&&e.redraw(e.selectedObj)}})}}}var ed=Qp.draw;function rd(t){var e=t._fullLayout;ne.filterVisible(e.annotations).forEach(function(e){var r,n,i,a,o=ri.getFromId(t,e.xref),s=ri.getFromId(t,e.yref),l=3*e.arrowsize*e.arrowwidth||0,u=3*e.startarrowsize*e.arrowwidth||0;o&&o.autorange&&(r=l+e.xshift,n=l-e.xshift,i=u+e.xshift,a=u-e.xshift,e.axref===e.xref?(ri.expand(o,[o.r2c(e.x)],{ppadplus:r,ppadminus:n}),ri.expand(o,[o.r2c(e.ax)],{ppadplus:Math.max(e._xpadplus,i),ppadminus:Math.max(e._xpadminus,a)})):(i=e.ax?i+e.ax:i,a=e.ax?a-e.ax:a,ri.expand(o,[o.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,r,i),ppadminus:Math.max(e._xpadminus,n,a)}))),s&&s.autorange&&(r=l-e.yshift,n=l+e.yshift,i=u-e.yshift,a=u+e.yshift,e.ayref===e.yref?(ri.expand(s,[s.r2c(e.y)],{ppadplus:r,ppadminus:n}),ri.expand(s,[s.r2c(e.ay)],{ppadplus:Math.max(e._ypadplus,i),ppadminus:Math.max(e._ypadminus,a)})):(i=e.ay?i+e.ay:i,a=e.ay?a-e.ay:a,ri.expand(s,[s.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,r,i),ppadminus:Math.max(e._ypadminus,n,a)})))})}var nd={hasClickToShow:function(t,e){var r=id(t,e);return r.on.length>0||r.explicitOff.length>0},onClick:function(t,e){var r,n=id(t,e),i=n.on,a=n.off.concat(n.explicitOff),o={};if(!i.length&&!a.length)return;for(r=0;r<i.length;r++)o[\"annotations[\"+i[r]+\"].visible\"]=!0;for(r=0;r<a.length;r++)o[\"annotations[\"+a[r]+\"].visible\"]=!1;return P.call(\"update\",t,{},o)}};function id(t,e){var r,n,i,a,o,s,l,u=t._fullLayout.annotations,c=[],h=[],f=[],p=(e||[]).length;for(r=0;r<u.length;r++)if(a=(i=u[r]).clicktoshow){for(n=0;n<p;n++)if(s=(o=e[n]).xaxis,l=o.yaxis,s._id===i.xref&&l._id===i.yref&&s.d2r(o.x)===ad(i._xclick,s)&&l.d2r(o.y)===ad(i._yclick,l)){(i.visible?\"onout\"===a?h:f:c).push(r);break}n===p&&i.visible&&\"onout\"===a&&h.push(r)}return{on:c,off:h,explicitOff:f}}function ad(t,e){return\"log\"===e.type?e.l2r(t):e.d2r(t)}var od=function(t,e,r,n){n(\"opacity\");var i=n(\"bgcolor\"),a=n(\"bordercolor\"),o=Oe.opacity(a);n(\"borderpad\");var s=n(\"borderwidth\"),l=n(\"showarrow\");if(n(\"text\",l?\" \":r._dfltTitle.annotation),n(\"textangle\"),ne.coerceFont(n,\"font\",r.font),n(\"width\"),n(\"align\"),n(\"height\")&&n(\"valign\"),l){var u,c,h=n(\"arrowside\");-1!==h.indexOf(\"end\")&&(u=n(\"arrowhead\"),c=n(\"arrowsize\")),-1!==h.indexOf(\"start\")&&(n(\"startarrowhead\",u),n(\"startarrowsize\",c)),n(\"arrowcolor\",o?e.bordercolor:Oe.defaultLine),n(\"arrowwidth\",2*(o&&s||1)),n(\"standoff\"),n(\"startstandoff\")}var f=n(\"hovertext\"),p=r.hoverlabel||{};if(f){var d=n(\"hoverlabel.bgcolor\",p.bgcolor||(Oe.opacity(i)?Oe.rgb(i):Oe.defaultLine)),g=n(\"hoverlabel.bordercolor\",p.bordercolor||Oe.contrast(d));ne.coerceFont(n,\"hoverlabel.font\",{family:p.font.family,size:p.font.size,color:p.font.color||g})}n(\"captureevents\",!!f)},sd=function(t,e,r,n,i){function a(r,n){return ne.coerce(t,e,Jp,r,n)}n=n||{};var o=a(\"visible\",!(i=i||{}).itemIsNotPlainObject),s=a(\"clicktoshow\");if(!o&&!s)return e;od(t,e,r,a);for(var l=e.showarrow,u=[\"x\",\"y\"],c=[-10,-30],h={_fullLayout:r},f=0;f<2;f++){var p=u[f],d=ri.coerceRef(t,e,h,p,\"\",\"paper\");if(ri.coercePosition(e,h,a,d,p,.5),l){var g=\"a\"+p,v=ri.coerceRef(t,e,h,g,\"pixel\");\"pixel\"!==v&&v!==d&&(v=e[g]=\"pixel\");var m=\"pixel\"===v?c[f]:.4;ri.coercePosition(e,h,a,v,g,m)}a(p+\"anchor\"),a(p+\"shift\")}if(ne.noneOrAll(t,e,[\"x\",\"y\"]),l&&ne.noneOrAll(t,e,[\"ax\",\"ay\"]),s){var y=a(\"xclick\"),x=a(\"yclick\");e._xclick=void 0===y?e.x:ri.cleanPosition(y,h,e.xref),e._yclick=void 0===x?e.y:ri.cleanPosition(x,h,e.yref)}return e},ld=function(t,e,r){var n,i=r.name,a=e[i],o=ne.isArrayOrTypedArray(t[i])?t[i]:[],s=e[i]=[];for(n=0;n<o.length;n++){var l=o[n],u={},c={};ne.isPlainObject(l)||(c.itemIsNotPlainObject=!0,l={}),r.handleItemDefaults(l,u,e,r,c),u._input=l,u._index=n,s.push(u)}if(ne.isArrayOrTypedArray(a)){var h=Math.min(a.length,s.length);for(n=0;n<h;n++)ne.relinkPrivateKeys(s[n],a[n])}},ud=function(t){return function(e,r){var n=e[t];if(Array.isArray(n))for(var i=P.subplotsRegistry.cartesian,a=i.idRegex,o=r._subplots,s=o.xaxis,l=o.yaxis,u=o.cartesian,c=r._has(\"cartesian\")||r._has(\"gl2d\"),h=0;h<n.length;h++){var f=n[h];if(ne.isPlainObject(f)){var p=f.xref,d=f.yref,g=a.x.test(p),v=a.y.test(d);if(g||v){c||ne.pushUnique(r._basePlotModules,i);var m=!1;g&&-1===s.indexOf(p)&&(s.push(p),m=!0),v&&-1===l.indexOf(d)&&(l.push(d),m=!0),m&&g&&v&&u.push(p+d)}}}}},cd={moduleType:\"component\",name:\"annotations\",layoutAttributes:Jp,supplyLayoutDefaults:function(t,e){ld(t,e,{name:\"annotations\",handleItemDefaults:sd})},includeBasePlot:ud(\"annotations\"),calcAutorange:function(t){var e=t._fullLayout,r=ne.filterVisible(e.annotations);if(r.length&&t._fullData.length){var n={};for(var i in r.forEach(function(t){n[t.xref]=1,n[t.yref]=1}),n){var a=ri.getFromId(t,i);if(a&&a.autorange)return ne.syncOrAsync([ed,rd],t)}}},draw:Qp.draw,drawOne:Qp.drawOne,drawRaw:Qp.drawRaw,hasClickToShow:nd.hasClickToShow,onClick:nd.onClick,convertCoords:function(t,e,n,i){e=e||{};var a=\"log\"===n&&\"linear\"===e.type,o=\"linear\"===n&&\"log\"===e.type;if(a||o)for(var s,l,u=t._fullLayout.annotations,c=e._id.charAt(0),h=0;h<u.length;h++)s=u[h],l=\"annotations[\"+h+\"].\",s[c+\"ref\"]===e._id&&f(c),s[\"a\"+c+\"ref\"]===e._id&&f(\"a\"+c);function f(t){var n=s[t],o=null;o=a?re(n,e.range):Math.pow(10,n),r(o)||(o=null),i(l+t,o)}}},hd=(0,ye.overrideAll)({_isLinkedToArray:\"annotation\",visible:Jp.visible,x:{valType:\"any\"},y:{valType:\"any\"},z:{valType:\"any\"},ax:{valType:\"number\"},ay:{valType:\"number\"},xanchor:Jp.xanchor,xshift:Jp.xshift,yanchor:Jp.yanchor,yshift:Jp.yshift,text:Jp.text,textangle:Jp.textangle,font:Jp.font,width:Jp.width,height:Jp.height,opacity:Jp.opacity,align:Jp.align,valign:Jp.valign,bgcolor:Jp.bgcolor,bordercolor:Jp.bordercolor,borderpad:Jp.borderpad,borderwidth:Jp.borderwidth,showarrow:Jp.showarrow,arrowcolor:Jp.arrowcolor,arrowhead:Jp.arrowhead,startarrowhead:Jp.startarrowhead,arrowside:Jp.arrowside,arrowsize:Jp.arrowsize,startarrowsize:Jp.startarrowsize,arrowwidth:Jp.arrowwidth,standoff:Jp.standoff,startstandoff:Jp.startstandoff,hovertext:Jp.hovertext,hoverlabel:Jp.hoverlabel,captureevents:Jp.captureevents},\"calc\",\"from-root\");function fd(t,e){var r=e.fullSceneLayout.domain,n=e.fullLayout._size,i={pdata:null,type:\"linear\",autorange:!1,range:[-1/0,1/0]};t._xa={},ne.extendFlat(t._xa,i),ri.setConvert(t._xa),t._xa._offset=n.l+r.x[0]*n.w,t._xa.l2p=function(){return.5*(1+t._pdata[0]/t._pdata[3])*n.w*(r.x[1]-r.x[0])},t._ya={},ne.extendFlat(t._ya,i),ri.setConvert(t._ya),t._ya._offset=n.t+(1-r.y[1])*n.h,t._ya.l2p=function(){return.5*(1-t._pdata[1]/t._pdata[3])*n.h*(r.y[1]-r.y[0])}}function pd(t,e,r,n,i){function a(r,n){return ne.coerce(t,e,hd,r,n)}function o(t){var n=t+\"axis\",i={_fullLayout:{}};return i._fullLayout[n]=r[n],ri.coercePosition(e,i,a,t,t,.5)}return a(\"visible\",!i.itemIsNotPlainObject)?(od(t,e,n.fullLayout,a),o(\"x\"),o(\"y\"),o(\"z\"),ne.noneOrAll(t,e,[\"x\",\"y\",\"z\"]),e.xref=\"x\",e.yref=\"y\",e.zref=\"z\",a(\"xanchor\"),a(\"yanchor\"),a(\"xshift\"),a(\"yshift\"),e.showarrow&&(e.axref=\"pixel\",e.ayref=\"pixel\",a(\"ax\",-10),a(\"ay\",-30),ne.noneOrAll(t,e,[\"ax\",\"ay\"])),e):e}function dd(t,e){var r,n,i=[0,0,0,0];for(r=0;r<4;++r)for(n=0;n<4;++n)i[n]+=t[4*r+n]*e[r];return i}var gd=function(t,e){return dd(t.projection,dd(t.view,dd(t.model,[e[0],e[1],e[2],1])))},vd=Qp.drawRaw,md=[\"x\",\"y\",\"z\"],yd={moduleType:\"component\",name:\"annotations3d\",schema:{subplots:{scene:{annotations:hd}}},layoutAttributes:hd,handleDefaults:function(t,e,r){ld(t,e,{name:\"annotations\",handleItemDefaults:pd,fullLayout:r.fullLayout})},includeBasePlot:function(t,e){var r=P.subplotsRegistry.gl3d;if(!r)return;for(var n=r.attrRegex,i=Object.keys(t),a=0;a<i.length;a++){var o=i[a];n.test(o)&&(t[o].annotations||[]).length&&(ne.pushUnique(e._basePlotModules,r),ne.pushUnique(e._subplots.gl3d,o))}},convert:function(t){for(var e=t.fullSceneLayout.annotations,r=0;r<e.length;r++)fd(e[r],t);t.fullLayout._infolayer.selectAll(\".annotation-\"+t.id).remove()},draw:function(t){for(var e=t.fullSceneLayout,r=t.dataScale,n=e.annotations,i=0;i<n.length;i++){for(var a=n[i],o=!1,s=0;s<3;s++){var l=md[s],u=a[l],c=e[l+\"axis\"].r2fraction(u);if(c<0||c>1){o=!0;break}}o?t.fullLayout._infolayer.select(\".annotation-\"+t.id+'[data-index=\"'+i+'\"]').remove():(a._pdata=gd(t.glplot.cameraParams,[e.xaxis.r2l(a.x)*r[0],e.yaxis.r2l(a.y)*r[1],e.zaxis.r2l(a.z)*r[2]]),vd(t.graphDiv,a,i,t.id,a._xa,a._ya))}}};var xd={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\"}}},bd=function(t){var e=t.type,r=t.symmetric;if(\"data\"===e){var n=t.array||[];if(r)return function(t,e){var r=+n[e];return[r,r]};var i=t.arrayminus||[];return function(t,e){var r=+n[e],a=+i[e];return isNaN(r)&&isNaN(a)?[NaN,NaN]:[a||0,r||0]}}var a=_d(e,t.value),o=_d(e,t.valueminus);return r||void 0===t.valueminus?function(t){var e=a(t);return[e,e]}:function(t){return[o(t),a(t)]}};function _d(t,e){return\"percent\"===t?function(t){return Math.abs(t*e/100)}:\"constant\"===t?function(){return Math.abs(e)}:\"sqrt\"===t?function(t){return Math.sqrt(Math.abs(t))}:void 0}var wd=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var n=e[r],i=n[0].trace;if(P.traceIs(i,\"errorBarsOK\")){var a=ri.getFromId(t,i.xaxis),o=ri.getFromId(t,i.yaxis);Md(n,i,a,\"x\"),Md(n,i,o,\"y\")}}};function Md(t,e,n,i){var a=e[\"error_\"+i]||{},o=[];if(a.visible&&-1!==[\"linear\",\"log\"].indexOf(n.type)){for(var s=bd(a),l=0;l<t.length;l++){var u=t[l],c=u[i];if(r(n.c2l(c))){var h=s(c,l);if(r(h[0])&&r(h[1])){var f=u[i+\"s\"]=c-h[0],p=u[i+\"h\"]=c+h[1];o.push(f,p)}}}ri.expand(n,o,{padded:!0})}}var Ad=ye.overrideAll,kd={error_x:ne.extendFlat({},xd),error_y:ne.extendFlat({},xd)};delete kd.error_x.copy_zstyle,delete kd.error_y.copy_zstyle,delete kd.error_y.copy_ystyle;var Td={error_x:ne.extendFlat({},xd),error_y:ne.extendFlat({},xd),error_z:ne.extendFlat({},xd)};delete Td.error_x.copy_ystyle,delete Td.error_y.copy_ystyle,delete Td.error_z.copy_ystyle,delete Td.error_z.copy_zstyle;var Sd={moduleType:\"component\",name:\"errorbars\",schema:{traces:{scatter:kd,bar:kd,histogram:kd,scatter3d:Ad(Td,\"calc\",\"nested\"),scattergl:Ad(kd,\"calc\",\"nested\")}},supplyDefaults:function(t,e,n,i){var a=\"error_\"+i.axis,o=e[a]={},s=t[a]||{};function l(t,e){return ne.coerce(s,o,xd,t,e)}if(!1!==l(\"visible\",void 0!==s.array||void 0!==s.value||\"sqrt\"===s.type)){var u=l(\"type\",\"array\"in s?\"data\":\"percent\"),c=!0;\"sqrt\"!==u&&(c=l(\"symmetric\",!((\"data\"===u?\"arrayminus\":\"valueminus\")in s))),\"data\"===u?(l(\"array\"),l(\"traceref\"),c||(l(\"arrayminus\"),l(\"tracerefminus\"))):\"percent\"!==u&&\"constant\"!==u||(l(\"value\"),c||l(\"valueminus\"));var h=\"copy_\"+i.inherit+\"style\";i.inherit&&(e[\"error_\"+i.inherit]||{}).visible&&l(h,!(s.color||r(s.thickness)||r(s.width))),i.inherit&&o[h]||(l(\"color\",n),l(\"thickness\"),l(\"width\",P.traceIs(e,\"gl3d\")?0:4))}},calc:wd,calcFromTrace:function(t,e){for(var r=t.x||[],n=t.y||[],i=r.length||n.length,a=new Array(i),o=0;o<i;o++)a[o]={x:r[o],y:n[o]};return a[0].trace=t,wd({calcdata:[a],_fullLayout:e}),a},plot:function(t,n,i){var a=n.xaxis,o=n.yaxis,s=i&&i.duration>0;t.each(function(t){var l,u=t[0].trace,c=u.error_x||{},h=u.error_y||{};u.ids&&(l=function(t){return t.id});var f=Tr.hasMarkers(u)&&u.marker.maxdisplayed>0;h.visible||c.visible||(t=[]);var p=e.select(this).selectAll(\"g.errorbar\").data(t,l);if(p.exit().remove(),t.length){c.visible||p.selectAll(\"path.xerror\").remove(),h.visible||p.selectAll(\"path.yerror\").remove(),p.style(\"opacity\",1);var d=p.enter().append(\"g\").classed(\"errorbar\",!0);s&&d.style(\"opacity\",0).transition().duration(i.duration).style(\"opacity\",1),Sr.setClipUrl(p,n.layerClipId),p.each(function(t){var n=e.select(this),l=function(t,e,n){var i={x:e.c2p(t.x),y:n.c2p(t.y)};return void 0!==t.yh&&(i.yh=n.c2p(t.yh),i.ys=n.c2p(t.ys),r(i.ys)||(i.noYS=!0,i.ys=n.c2p(t.ys,!0))),void 0!==t.xh&&(i.xh=e.c2p(t.xh),i.xs=e.c2p(t.xs),r(i.xs)||(i.noXS=!0,i.xs=e.c2p(t.xs,!0))),i}(t,a,o);if(!f||t.vis){var u,p=n.select(\"path.yerror\");if(h.visible&&r(l.x)&&r(l.yh)&&r(l.ys)){var d=h.width;u=\"M\"+(l.x-d)+\",\"+l.yh+\"h\"+2*d+\"m-\"+d+\",0V\"+l.ys,l.noYS||(u+=\"m-\"+d+\",0h\"+2*d),p.size()?s&&(p=p.transition().duration(i.duration).ease(i.easing)):p=n.append(\"path\").style(\"vector-effect\",\"non-scaling-stroke\").classed(\"yerror\",!0),p.attr(\"d\",u)}else p.remove();var g=n.select(\"path.xerror\");if(c.visible&&r(l.y)&&r(l.xh)&&r(l.xs)){var v=(c.copy_ystyle?h:c).width;u=\"M\"+l.xh+\",\"+(l.y-v)+\"v\"+2*v+\"m0,-\"+v+\"H\"+l.xs,l.noXS||(u+=\"m0,-\"+v+\"v\"+2*v),g.size()?s&&(g=g.transition().duration(i.duration).ease(i.easing)):g=n.append(\"path\").style(\"vector-effect\",\"non-scaling-stroke\").classed(\"xerror\",!0),g.attr(\"d\",u)}else g.remove()}})}})},style:function(t){t.each(function(t){var r=t[0].trace,n=r.error_y||{},i=r.error_x||{},a=e.select(this);a.selectAll(\"path.yerror\").style(\"stroke-width\",n.thickness+\"px\").call(Oe.stroke,n.color),i.copy_ystyle&&(i=n),a.selectAll(\"path.xerror\").style(\"stroke-width\",i.thickness+\"px\").call(Oe.stroke,i.color)})},hoverInfo:function(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys));(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}};var Ed=tt.counter,Cd=qc.attributes,Ld=Te.idRegex,zd={rows:{valType:\"integer\",min:1,editType:\"plot\"},roworder:{valType:\"enumerated\",values:[\"top to bottom\",\"bottom to top\"],dflt:\"top to bottom\",editType:\"plot\"},columns:{valType:\"integer\",min:1,editType:\"plot\"},subplots:{valType:\"info_array\",freeLength:!0,dimensions:2,items:{valType:\"enumerated\",values:[Ed(\"xy\").toString(),\"\"],editType:\"plot\"},editType:\"plot\"},xaxes:{valType:\"info_array\",freeLength:!0,items:{valType:\"enumerated\",values:[Ld.x.toString(),\"\"],editType:\"plot\"},editType:\"plot\"},yaxes:{valType:\"info_array\",freeLength:!0,items:{valType:\"enumerated\",values:[Ld.y.toString(),\"\"],editType:\"plot\"},editType:\"plot\"},pattern:{valType:\"enumerated\",values:[\"independent\",\"coupled\"],dflt:\"coupled\",editType:\"plot\"},xgap:{valType:\"number\",min:0,max:1,editType:\"plot\"},ygap:{valType:\"number\",min:0,max:1,editType:\"plot\"},domain:Cd({name:\"grid\",editType:\"plot\",noGridCell:!0},{}),xside:{valType:\"enumerated\",values:[\"bottom\",\"bottom plot\",\"top plot\",\"top\"],dflt:\"bottom plot\",editType:\"ticks\"},yside:{valType:\"enumerated\",values:[\"left\",\"left plot\",\"right plot\",\"right\"],dflt:\"left plot\",editType:\"ticks\"},editType:\"plot\"};function Pd(t,e,r,n,i){var a=e(t+\"gap\",r),o=e(\"domain.\"+t);e(t+\"side\");for(var s=new Array(n),l=o[0],u=(o[1]-l)/(n-a),c=u*(1-a),h=0;h<n;h++){var f=l+u*h;s[i?n-1-h:h]=[f,f+c]}return s}function Id(t,e,r,n,i){var a,o=new Array(r);function s(t,r){-1!==e.indexOf(r)&&void 0===n[r]?(o[t]=r,n[r]=t):o[t]=\"\"}if(Array.isArray(t))for(a=0;a<r;a++)s(a,t[a]);else for(s(0,i),a=1;a<r;a++)s(a,i+(a+1));return o}var Dd={moduleType:\"component\",name:\"grid\",schema:{layout:{grid:zd}},layoutAttributes:zd,sizeDefaults:function(t,e){var r=t.grid;if(r){var n,i,a=Array.isArray(r.subplots)&&Array.isArray(r.subplots[0]),o=Array.isArray(r.xaxes),s=Array.isArray(r.yaxes);a?(n=r.subplots.length,i=r.subplots[0].length):(s&&(n=r.yaxes.length),o&&(i=r.xaxes.length));var l=e.grid={},u=f(\"rows\",n),c=f(\"columns\",i);if(u*c>1){a||o||s||\"independent\"===f(\"pattern\")&&(a=!0),l._hasSubplotGrid=a;var h=\"top to bottom\"===f(\"roworder\");l._domains={x:Pd(\"x\",f,a?.2:.1,c),y:Pd(\"y\",f,a?.3:.1,u,h)}}}function f(t,e){return ne.coerce(r,l,zd,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,u,c=t.grid,h=e._subplots,f=r._hasSubplotGrid,p=r.rows,d=r.columns,g=\"independent\"===r.pattern,v=r._axisMap={};if(f){var m=c.subplots||[];l=r.subplots=new Array(p);var y=1;for(n=0;n<p;n++){var x=l[n]=new Array(d),b=m[n]||[];for(i=0;i<d;i++)if(g?(s=1===y?\"xy\":\"x\"+y+\"y\"+y,y++):s=b[i],x[i]=\"\",-1!==h.cartesian.indexOf(s)){if(u=s.indexOf(\"y\"),a=s.slice(0,u),o=s.slice(u),void 0!==v[a]&&v[a]!==i||void 0!==v[o]&&v[o]!==n)continue;x[i]=s,v[a]=i,v[o]=n}}}else r.xaxes=Id(c.xaxes,h.xaxis,d,v,\"x\"),r.yaxes=Id(c.yaxes,h.yaxis,p,v,\"y\");var _=r._anchors={},w=\"top to bottom\"===r.roworder;for(var M in v){var A,k,T,S=M.charAt(0),E=r[S+\"side\"];if(E.length<8)_[M]=\"free\";else if(\"x\"===S){if(\"t\"===E.charAt(0)===w?(A=0,k=1,T=p):(A=p-1,k=-1,T=-1),f){var C=v[M];for(n=A;n!==T;n+=k)if((s=l[n][C])&&(u=s.indexOf(\"y\"),s.slice(0,u)===M)){_[M]=s.slice(u);break}}else for(n=A;n!==T;n+=k)if(o=r.yaxes[n],-1!==h.cartesian.indexOf(M+o)){_[M]=o;break}}else if(\"l\"===E.charAt(0)?(A=0,k=1,T=d):(A=d-1,k=-1,T=-1),f){var L=v[M];for(n=A;n!==T;n+=k)if((s=l[L][n])&&(u=s.indexOf(\"y\"),s.slice(u)===M)){_[M]=s.slice(0,u);break}}else for(n=A;n!==T;n+=k)if(a=r.xaxes[n],-1!==h.cartesian.indexOf(a+M)){_[M]=a;break}}}}},Od={_isLinkedToArray:\"image\",visible:{valType:\"boolean\",dflt:!0,editType:\"arraydraw\"},source:{valType:\"string\",editType:\"arraydraw\"},layer:{valType:\"enumerated\",values:[\"below\",\"above\"],dflt:\"above\",editType:\"arraydraw\"},sizex:{valType:\"number\",dflt:0,editType:\"arraydraw\"},sizey:{valType:\"number\",dflt:0,editType:\"arraydraw\"},sizing:{valType:\"enumerated\",values:[\"fill\",\"contain\",\"stretch\"],dflt:\"contain\",editType:\"arraydraw\"},opacity:{valType:\"number\",min:0,max:1,dflt:1,editType:\"arraydraw\"},x:{valType:\"any\",dflt:0,editType:\"arraydraw\"},y:{valType:\"any\",dflt:0,editType:\"arraydraw\"},xanchor:{valType:\"enumerated\",values:[\"left\",\"center\",\"right\"],dflt:\"left\",editType:\"arraydraw\"},yanchor:{valType:\"enumerated\",values:[\"top\",\"middle\",\"bottom\"],dflt:\"top\",editType:\"arraydraw\"},xref:{valType:\"enumerated\",values:[\"paper\",Te.idRegex.x.toString()],dflt:\"paper\",editType:\"arraydraw\"},yref:{valType:\"enumerated\",values:[\"paper\",Te.idRegex.y.toString()],dflt:\"paper\",editType:\"arraydraw\"},editType:\"arraydraw\"},Rd=\"images\";function Fd(t,e,r){function n(r,n){return ne.coerce(t,e,Od,r,n)}if(!n(\"visible\",!!n(\"source\")))return e;n(\"layer\"),n(\"xanchor\"),n(\"yanchor\"),n(\"sizex\"),n(\"sizey\"),n(\"sizing\"),n(\"opacity\");for(var i={_fullLayout:r},a=[\"x\",\"y\"],o=0;o<2;o++){var s=a[o],l=ri.coerceRef(t,e,i,s,\"paper\");ri.coercePosition(e,i,n,l,s,0)}return e}var Bd={moduleType:\"component\",name:\"images\",layoutAttributes:Od,supplyLayoutDefaults:function(t,e){ld(t,e,{name:Rd,handleItemDefaults:Fd})},includeBasePlot:ud(\"images\"),draw:function(t){var r,n,i=t._fullLayout,a=[],o={},s=[];for(n=0;n<i.images.length;n++){var l=i.images[n];if(l.visible)if(\"below\"===l.layer&&\"paper\"!==l.xref&&\"paper\"!==l.yref){r=l.xref+l.yref;var u=i._plots[r];if(!u){s.push(l);continue}u.mainplot&&(r=u.mainplot.id),o[r]||(o[r]=[]),o[r].push(l)}else\"above\"===l.layer?a.push(l):s.push(l)}var c={x:{left:{sizing:\"xMin\",offset:0},center:{sizing:\"xMid\",offset:-.5},right:{sizing:\"xMax\",offset:-1}},y:{top:{sizing:\"YMin\",offset:0},middle:{sizing:\"YMid\",offset:-.5},bottom:{sizing:\"YMax\",offset:-1}}};function h(r){var n=e.select(this);if(!this.img||this.img.src!==r.source){n.attr(\"xmlns\",$e.svg);var i=new Promise(function(t){var e=new Image;function i(){n.remove(),t()}this.img=e,e.setAttribute(\"crossOrigin\",\"anonymous\"),e.onerror=i,e.onload=function(){var e=document.createElement(\"canvas\");e.width=this.width,e.height=this.height,e.getContext(\"2d\").drawImage(this,0,0);var r=e.toDataURL(\"image/png\");n.attr(\"xlink:href\",r),t()},n.on(\"error\",i),e.src=r.source}.bind(this));t._promises.push(i)}}function f(r){var n=e.select(this),a=ri.getFromId(t,r.xref),o=ri.getFromId(t,r.yref),s=i._size,l=a?Math.abs(a.l2p(r.sizex)-a.l2p(0)):r.sizex*s.w,u=o?Math.abs(o.l2p(r.sizey)-o.l2p(0)):r.sizey*s.h,h=l*c.x[r.xanchor].offset,f=u*c.y[r.yanchor].offset,p=c.x[r.xanchor].sizing+c.y[r.yanchor].sizing,d=(a?a.r2p(r.x)+a._offset:r.x*s.w+s.l)+h,g=(o?o.r2p(r.y)+o._offset:s.h-r.y*s.h+s.t)+f;switch(r.sizing){case\"fill\":p+=\" slice\";break;case\"stretch\":p=\"none\"}n.attr({x:d,y:g,width:l,height:u,preserveAspectRatio:p,opacity:r.opacity});var v=(a?a._id:\"\")+(o?o._id:\"\");n.call(Sr.setClipUrl,v?\"clip\"+i._uid+v:null)}var p=i._imageLowerLayer.selectAll(\"image\").data(s),d=i._imageUpperLayer.selectAll(\"image\").data(a);p.enter().append(\"image\"),d.enter().append(\"image\"),p.exit().remove(),d.exit().remove(),p.each(function(t){h.bind(this)(t),f.bind(this)(t)}),d.each(function(t){h.bind(this)(t),f.bind(this)(t)});var g=Object.keys(i._plots);for(n=0;n<g.length;n++){r=g[n];var v=i._plots[r];if(v.imagelayer){var m=v.imagelayer.selectAll(\"image\").data(o[r]||[]);m.enter().append(\"image\"),m.exit().remove(),m.each(function(t){h.bind(this)(t),f.bind(this)(t)})}}},convertCoords:function(t,e,n,i){e=e||{};var a=\"log\"===n&&\"linear\"===e.type,o=\"linear\"===n&&\"log\"===e.type;if(a||o)for(var s,l,u=t._fullLayout.images,c=e._id.charAt(0),h=0;h<u.length;h++)if(l=\"images[\"+h+\"].\",(s=u[h])[c+\"ref\"]===e._id){var f=s[c],p=s[\"size\"+c],d=null,g=null;if(a){d=re(f,e.range);var v=p/Math.pow(10,d)/2;g=2*Math.log(v+Math.sqrt(1+v*v))/Math.LN10}else g=(d=Math.pow(10,f))*(Math.pow(10,p/2)-Math.pow(10,-p/2));r(d)?r(g)||(g=null):(d=null,g=null),i(l+c,d),i(l+\"size\"+c,g)}}},Nd={bgcolor:{valType:\"color\",editType:\"legend\"},bordercolor:{valType:\"color\",dflt:C.defaultLine,editType:\"legend\"},borderwidth:{valType:\"number\",min:0,dflt:0,editType:\"legend\"},font:T({editType:\"legend\"}),orientation:{valType:\"enumerated\",values:[\"v\",\"h\"],dflt:\"v\",editType:\"legend\"},traceorder:{valType:\"flaglist\",flags:[\"reversed\",\"grouped\"],extras:[\"normal\"],editType:\"legend\"},tracegroupgap:{valType:\"number\",min:0,dflt:10,editType:\"legend\"},x:{valType:\"number\",min:-2,max:3,dflt:1.02,editType:\"legend\"},xanchor:{valType:\"enumerated\",values:[\"auto\",\"left\",\"center\",\"right\"],dflt:\"left\",editType:\"legend\"},y:{valType:\"number\",min:-2,max:3,dflt:1,editType:\"legend\"},yanchor:{valType:\"enumerated\",values:[\"auto\",\"top\",\"middle\",\"bottom\"],dflt:\"auto\",editType:\"legend\"},editType:\"legend\"},jd={legendGetsTrace:function(t){return t.visible&&void 0!==t.showlegend},isGrouped:function(t){return-1!==(t.traceorder||\"\").indexOf(\"grouped\")},isVertical:function(t){return\"h\"!==t.orientation},isReversed:function(t){return-1!==(t.traceorder||\"\").indexOf(\"reversed\")}},Vd={isRightAnchor:function(t){return\"right\"===t.xanchor||\"auto\"===t.xanchor&&t.x>=2/3},isCenterAnchor:function(t){return\"center\"===t.xanchor||\"auto\"===t.xanchor&&t.x>1/3&&t.x<2/3},isBottomAnchor:function(t){return\"bottom\"===t.yanchor||\"auto\"===t.yanchor&&t.y<=1/3},isMiddleAnchor:function(t){return\"middle\"===t.yanchor||\"auto\"===t.yanchor&&t.y>1/3&&t.y<2/3}},Ud={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:\"#808BA4\",scrollBarMargin:4},qd=!0,Hd=function(t,e,r){if(!e._dragged&&!e._editing){var n,i,a,o,s,l=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],u=t.data()[0][0],c=e._fullData,h=u.trace,f=h.legendgroup,p={},d=[],g=[],v=[];if(1===r&&qd&&e.data&&e._context.showTips?(ne.notifier(ne._(e,\"Double-click on legend to isolate one trace\"),\"long\"),qd=!1):qd=!1,P.traceIs(h,\"pie\")){var m=u.label,y=l.indexOf(m);1===r?-1===y?l.push(m):l.splice(y,1):2===r&&(l=[],e.calcdata[0].forEach(function(t){m!==t.label&&l.push(t.label)}),e._fullLayout.hiddenlabels&&e._fullLayout.hiddenlabels.length===l.length&&-1===y&&(l=[])),P.call(\"relayout\",e,\"hiddenlabels\",l)}else{var x,b=f&&f.length,_=[];if(b)for(n=0;n<c.length;n++)(x=c[n]).visible&&x.legendgroup===f&&_.push(n);if(1===r){var w;switch(h.visible){case!0:w=\"legendonly\";break;case!1:w=!1;break;case\"legendonly\":w=!0}if(b)for(n=0;n<c.length;n++)!1!==c[n].visible&&c[n].legendgroup===f&&C(c[n],w);else C(h,w)}else if(2===r){var M,A,k=!0;for(n=0;n<c.length;n++)if(!(c[n]===h)&&!(M=b&&c[n].legendgroup===f)&&!0===c[n].visible&&!P.traceIs(c[n],\"notLegendIsolatable\")){k=!1;break}for(n=0;n<c.length;n++)if(!1!==c[n].visible&&!P.traceIs(c[n],\"notLegendIsolatable\"))switch(h.visible){case\"legendonly\":C(c[n],!0);break;case!0:A=!!k||\"legendonly\",M=c[n]===h||b&&c[n].legendgroup===f,C(c[n],!!M||A)}}for(n=0;n<g.length;n++)if(a=g[n]){var T=a.constructUpdate(),S=Object.keys(T);for(i=0;i<S.length;i++)o=S[i],(p[o]=p[o]||[])[v[n]]=T[o]}for(s=Object.keys(p),n=0;n<s.length;n++)for(o=s[n],i=0;i<d.length;i++)p[o].hasOwnProperty(i)||(p[o][i]=void 0);P.call(\"restyle\",e,p,d)}}function E(t,e,r){var n=d.indexOf(t),i=p[e];return i||(i=p[e]=[]),-1===d.indexOf(t)&&(d.push(t),n=d.length-1),i[n]=r,n}function C(t,e){var r=t._fullInput;if(P.hasTransform(r,\"groupby\")){var n=g[r.index];if(!n){var i=P.getTransformIndices(r,\"groupby\"),a=i[i.length-1];n=ne.keyedContainer(r,\"transforms[\"+a+\"].styles\",\"target\",\"value.visible\"),g[r.index]=n}var o=n.get(t._group);void 0===o&&(o=!0),!1!==o&&n.set(t._group,e),v[r.index]=E(r.index,\"visible\",!1!==r.visible)}else{var s=!1!==r.visible&&e;E(r.index,\"visible\",s)}}},Gd={formatPiePercent:function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(\".\")&&(r=r.replace(/[.]?0+$/,\"\")),ne.numSeparate(r,e)+\"%\"},formatPieValue:function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(\".\")&&(r=r.replace(/[.]?0+$/,\"\")),ne.numSeparate(r,e)},getFirstFilled:function(t,e){if(Array.isArray(t))for(var r=0;r<e.length;r++){var n=t[e[r]];if(n||0===n)return n}},castOption:function(t,e){return Array.isArray(t)?Gd.getFirstFilled(t,e):t||void 0}},Wd=Gd.castOption,Yd=function(t,e,r){var n=r.marker.line,i=Wd(n.color,e.pts)||Oe.defaultLine,a=Wd(n.width,e.pts)||0;t.style({\"stroke-width\":a}).call(Oe.fill,e.color).call(Oe.stroke,i)},Xd=function(t,r){t.each(function(t){var r=e.select(this).selectAll(\"g.layers\").data([0]);r.enter().append(\"g\").classed(\"layers\",!0),r.style(\"opacity\",t[0].trace.opacity),r.selectAll(\"g.legendfill\").data([t]).enter().append(\"g\").classed(\"legendfill\",!0),r.selectAll(\"g.legendlines\").data([t]).enter().append(\"g\").classed(\"legendlines\",!0);var n=r.selectAll(\"g.legendsymbols\").data([t]);n.enter().append(\"g\").classed(\"legendsymbols\",!0),n.selectAll(\"g.legendpoints\").data([t]).enter().append(\"g\").classed(\"legendpoints\",!0)}).each(function(t){var r=t[0].trace,n=r.marker||{},i=n.line||{},a=e.select(this).select(\"g.legendpoints\").selectAll(\"path.legendbar\").data(P.traceIs(r,\"bar\")?[t]:[]);a.enter().append(\"path\").classed(\"legendbar\",!0).attr(\"d\",\"M6,6H-6V-6H6Z\").attr(\"transform\",\"translate(20,0)\"),a.exit().remove(),a.each(function(t){var r=e.select(this),a=t[0],o=(a.mlw+1||i.width+1)-1;r.style(\"stroke-width\",o+\"px\").call(Oe.fill,a.mc||n.color),o&&r.call(Oe.stroke,a.mlc||i.color)})}).each(function(t){var r=t[0].trace,n=e.select(this).select(\"g.legendpoints\").selectAll(\"path.legendbox\").data(P.traceIs(r,\"box-violin\")&&r.visible?[t]:[]);n.enter().append(\"path\").classed(\"legendbox\",!0).attr(\"d\",\"M6,6H-6V-6H6Z\").attr(\"transform\",\"translate(20,0)\"),n.exit().remove(),n.each(function(){var t=r.line.width,n=e.select(this);n.style(\"stroke-width\",t+\"px\").call(Oe.fill,r.fillcolor),t&&n.call(Oe.stroke,r.line.color)})}).each(function(t){var r=t[0].trace,n=e.select(this).select(\"g.legendpoints\").selectAll(\"path.legendpie\").data(P.traceIs(r,\"pie\")&&r.visible?[t]:[]);n.enter().append(\"path\").classed(\"legendpie\",!0).attr(\"d\",\"M6,6H-6V-6H6Z\").attr(\"transform\",\"translate(20,0)\"),n.exit().remove(),n.size()&&n.call(Yd,t[0],r)}).each(function(t){var r=t[0].trace,n=r.visible&&r.fill&&\"none\"!==r.fill,i=Tr.hasLines(r),a=r.contours;a&&\"constraint\"===a.type&&(i=a.showlines,n=\"=\"!==a._operation);var o=e.select(this).select(\".legendfill\").selectAll(\"path\").data(n?[t]:[]);o.enter().append(\"path\").classed(\"js-fill\",!0),o.exit().remove(),o.attr(\"d\",\"M5,0h30v6h-30z\").call(Sr.fillGroupStyle);var s=e.select(this).select(\".legendlines\").selectAll(\"path\").data(i?[t]:[]);s.enter().append(\"path\").classed(\"js-line\",!0).attr(\"d\",\"M5,0h30\"),s.exit().remove(),s.call(Sr.lineGroupStyle)}).each(function(t){var n,i,a=t[0],o=a.trace,s=Tr.hasMarkers(o),l=Tr.hasText(o),u=Tr.hasLines(o);function c(t,e,r){var n=ne.nestedProperty(o,t).get(),i=Array.isArray(n)&&e?e(n):n;if(r){if(i<r[0])return r[0];if(i>r[1])return r[1]}return i}function h(t){return t[0]}if(s||l||u){var f={},p={};s&&(f.mc=c(\"marker.color\",h),f.mo=c(\"marker.opacity\",ne.mean,[.2,1]),f.ms=c(\"marker.size\",ne.mean,[2,16]),f.mlc=c(\"marker.line.color\",h),f.mlw=c(\"marker.line.width\",ne.mean,[0,5]),p.marker={sizeref:1,sizemin:1,sizemode:\"diameter\"}),u&&(p.line={width:c(\"line.width\",h,[0,10])}),l&&(f.tx=\"Aa\",f.tp=c(\"textposition\",h),f.ts=10,f.tc=c(\"textfont.color\",h),f.tf=c(\"textfont.family\",h)),n=[ne.minExtend(a,f)],i=ne.minExtend(o,p)}var d=e.select(this).select(\"g.legendpoints\"),g=d.selectAll(\"path.scatterpts\").data(s?n:[]);g.enter().append(\"path\").classed(\"scatterpts\",!0).attr(\"transform\",\"translate(20,0)\"),g.exit().remove(),g.call(Sr.pointStyle,i,r),s&&(n[0].mrc=3);var v=d.selectAll(\"g.pointtext\").data(l?n:[]);v.enter().append(\"g\").classed(\"pointtext\",!0).append(\"text\").attr(\"transform\",\"translate(20,0)\"),v.exit().remove(),v.selectAll(\"text\").call(Sr.textPointStyle,i,r)})},Zd=Qe.LINE_SPACING,Jd=Qe.FROM_TL,Kd=Qe.FROM_BR,Qd=f.DBLCLICKDELAY;function $d(t,e){var r=t.data()[0][0],n=e._fullLayout,i=r.trace,a=P.traceIs(i,\"pie\"),o=i.index,s=a?r.label:i.name,l=t.selectAll(\"text.legendtext\").data([0]);function u(r){er.convertToTspans(r,e,function(){!function(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,i,a=t.select(\"g[class*=math-group]\"),o=a.node(),s=e._fullLayout.legend.font.size*Zd;if(o){var l=Sr.bBox(o);n=l.height,i=l.width,Sr.setTranslate(a,0,n/4)}else{var u=t.select(\".legendtext\"),c=er.lineCount(u),h=u.node();n=s*c,i=h?Sr.bBox(h).width:0;var f=s*(.3+(1-c)/2);er.positionText(u,40,f)}n=Math.max(n,16)+3,r.height=n,r.width=i}(t,e)})}l.enter().append(\"text\").classed(\"legendtext\",!0),l.attr(\"text-anchor\",\"start\").classed(\"user-select-none\",!0).call(Sr.font,n.legend.font).text(s),e._context.edits.legendText&&!a?l.call(er.makeEditable,{gd:e}).call(u).on(\"edit\",function(t){this.text(t).call(u);var n,i=t;this.text()||(t=\" \");var a=r.trace._fullInput||{},s={};if(-1!==[\"ohlc\",\"candlestick\"].indexOf(a.type))s[(n=r.trace.transforms)[n.length-1].direction+\".name\"]=t;else if(P.hasTransform(a,\"groupby\")){var l=P.getTransformIndices(a,\"groupby\"),c=l[l.length-1],h=ne.keyedContainer(a,\"transforms[\"+c+\"].styles\",\"target\",\"value.name\");\"\"===i?h.remove(r.trace._group):h.set(r.trace._group,t),s=h.constructUpdate()}else s.name=t;return P.call(\"restyle\",e,s,o)}):u(l)}function tg(t,e){var r,n=1,i=t.selectAll(\"rect\").data([0]);i.enter().append(\"rect\").classed(\"legendtoggle\",!0).style(\"cursor\",\"pointer\").attr(\"pointer-events\",\"all\").call(Oe.fill,\"rgba(0,0,0,0)\"),i.on(\"mousedown\",function(){(r=(new Date).getTime())-e._legendMouseDownTime<Qd?n+=1:(n=1,e._legendMouseDownTime=r)}),i.on(\"mouseup\",function(){if(!e._dragged&&!e._editing){var r=e._fullLayout.legend;(new Date).getTime()-e._legendMouseDownTime>Qd&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){Hd(t,e,n)},Qd):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,Hd(t,e,n))}})}function eg(t,r,n){var i=t._fullLayout,a=i.legend,o=a.borderwidth,s=jd.isGrouped(a),l=0;if(a._width=0,a._height=0,jd.isVertical(a))s&&r.each(function(t,e){Sr.setTranslate(this,0,e*a.tracegroupgap)}),n.each(function(t){var e=t[0],r=e.height,n=e.width;Sr.setTranslate(this,o,5+o+a._height+r/2),a._height+=r,a._width=Math.max(a._width,n)}),a._width+=45+2*o,a._height+=10+2*o,s&&(a._height+=(a._lgroupsLength-1)*a.tracegroupgap),l=40;else if(s){for(var u=[a._width],c=r.data(),h=0,f=c.length;h<f;h++){var p=c[h].map(function(t){return t[0].width}),d=40+Math.max.apply(null,p);a._width+=a.tracegroupgap+d,u.push(a._width)}r.each(function(t,e){Sr.setTranslate(this,u[e],0)}),r.each(function(){var t=0;e.select(this).selectAll(\"g.traces\").each(function(e){var r=e[0].height;Sr.setTranslate(this,0,5+o+t+r/2),t+=r}),a._height=Math.max(a._height,t)}),a._height+=10+2*o,a._width+=2*o}else{var g,v=0,m=0,y=0,x=0,b=0,_=a.tracegroupgap||5;n.each(function(t){y=Math.max(40+t[0].width,y),b+=40+t[0].width+_}),g=i.width-(i.margin.r+i.margin.l)>o+b-_,n.each(function(t){var e=t[0],r=g?40+t[0].width:y;o+x+_+r>i.width-(i.margin.r+i.margin.l)&&(x=0,v+=m,a._height=a._height+m,m=0),Sr.setTranslate(this,o+x,5+o+e.height/2+v),a._width+=_+r,a._height=Math.max(a._height,e.height),x+=_+r,m=Math.max(e.height,m)}),a._width+=2*o,a._height+=10+2*o}a._width=Math.ceil(a._width),a._height=Math.ceil(a._height),n.each(function(r){var n=r[0],i=e.select(this).select(\".legendtoggle\");Sr.setRect(i,0,-n.height/2,(t._context.edits.legendText?0:a._width)+l,n.height)})}function rg(t){var e=t._fullLayout.legend,r=\"left\";Vd.isRightAnchor(e)?r=\"right\":Vd.isCenterAnchor(e)&&(r=\"center\");var n=\"top\";Vd.isBottomAnchor(e)?n=\"bottom\":Vd.isMiddleAnchor(e)&&(n=\"middle\"),_n.autoMargin(t,\"legend\",{x:e.x,y:e.y,l:e._width*Jd[r],r:e._width*Kd[r],b:e._height*Kd[n],t:e._height*Jd[n]})}var ng={moduleType:\"component\",name:\"legend\",layoutAttributes:Nd,supplyLayoutDefaults:function(t,e,r){for(var n,i,a,o,s=t.legend||{},l={},u=0,c=\"normal\",h=0;h<r.length;h++){var f=r[h];jd.legendGetsTrace(f)&&(u++,P.traceIs(f,\"pie\")&&u++),(P.traceIs(f,\"bar\")&&\"stack\"===e.barmode||-1!==[\"tonextx\",\"tonexty\"].indexOf(f.fill))&&(c=jd.isGrouped({traceorder:c})?\"grouped+reversed\":\"reversed\"),void 0!==f.legendgroup&&\"\"!==f.legendgroup&&(c=jd.isReversed({traceorder:c})?\"reversed+grouped\":\"grouped\")}function p(t,e){return ne.coerce(s,l,Nd,t,e)}if(!1!==ne.coerce(t,e,z,\"showlegend\",u>1)){if(e.legend=l,p(\"bgcolor\",e.paper_bgcolor),p(\"bordercolor\"),p(\"borderwidth\"),ne.coerceFont(p,\"font\",e.font),p(\"orientation\"),\"h\"===l.orientation){var d=t.xaxis;d&&d.rangeslider&&d.rangeslider.visible?(n=0,a=\"left\",i=1.1,o=\"bottom\"):(n=0,a=\"left\",i=-.1,o=\"top\")}p(\"traceorder\",c),jd.isGrouped(e.legend)&&p(\"tracegroupgap\"),p(\"x\",n),p(\"xanchor\",a),p(\"y\",i),p(\"yanchor\",o),ne.noneOrAll(s,l,[\"x\",\"y\"])}},draw:function(t){var r=t._fullLayout,n=\"legend\"+r._uid;if(r._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var i=r.legend,a=r.showlegend&&function(t,e){var r,n,i={},a=[],o=!1,s={},l=0;function u(t,r){if(\"\"!==t&&jd.isGrouped(e))-1===a.indexOf(t)?(a.push(t),o=!0,i[t]=[[r]]):i[t].push([r]);else{var n=\"~~i\"+l;a.push(n),i[n]=[[r]],l++}}for(r=0;r<t.length;r++){var c=t[r],h=c[0],f=h.trace,p=f.legendgroup;if(jd.legendGetsTrace(f)&&f.showlegend)if(P.traceIs(f,\"pie\"))for(s[p]||(s[p]={}),n=0;n<c.length;n++){var d=c[n].label;s[p][d]||(u(p,{label:d,color:c[n].color,i:c[n].i,trace:f}),s[p][d]=!0)}else u(p,h)}if(!a.length)return[];var g,v,m=a.length;if(o&&jd.isGrouped(e))for(v=new Array(m),r=0;r<m;r++)g=i[a[r]],v[r]=jd.isReversed(e)?g.reverse():g;else{for(v=[new Array(m)],r=0;r<m;r++)g=i[a[r]][0],v[0][jd.isReversed(e)?m-r-1:r]=g;m=1}return e._lgroupsLength=m,v}(t.calcdata,i),o=r.hiddenlabels||[];if(!r.showlegend||!a.length)return r._infolayer.selectAll(\".legend\").remove(),r._topdefs.select(\"#\"+n).remove(),void _n.autoMargin(t,\"legend\");var s=r._infolayer.selectAll(\"g.legend\").data([0]);s.enter().append(\"g\").attr({class:\"legend\",\"pointer-events\":\"all\"});var l=r._topdefs.selectAll(\"#\"+n).data([0]);l.enter().append(\"clipPath\").attr(\"id\",n).append(\"rect\");var u=s.selectAll(\"rect.bg\").data([0]);u.enter().append(\"rect\").attr({class:\"bg\",\"shape-rendering\":\"crispEdges\"}),u.call(Oe.stroke,i.bordercolor).call(Oe.fill,i.bgcolor).style(\"stroke-width\",i.borderwidth+\"px\");var c=s.selectAll(\"g.scrollbox\").data([0]);c.enter().append(\"g\").attr(\"class\",\"scrollbox\");var h=s.selectAll(\"rect.scrollbar\").data([0]);h.enter().append(\"rect\").attr({class:\"scrollbar\",rx:20,ry:3,width:0,height:0}).call(Oe.fill,\"#808BA4\");var f=c.selectAll(\"g.groups\").data(a);f.enter().append(\"g\").attr(\"class\",\"groups\"),f.exit().remove();var p=f.selectAll(\"g.traces\").data(ne.identity);p.enter().append(\"g\").attr(\"class\",\"traces\"),p.exit().remove(),p.call(Xd,t).style(\"opacity\",function(t){var e=t[0].trace;return P.traceIs(e,\"pie\")?-1!==o.indexOf(t[0].label)?.5:1:\"legendonly\"===e.visible?.5:1}).each(function(){e.select(this).call($d,t).call(tg,t)}),0!==s.enter().size()&&(eg(t,f,p),rg(t));var d=r.width,g=r.height;eg(t,f,p),i._height>g?function(t){var e=t._fullLayout.legend,r=\"left\";Vd.isRightAnchor(e)?r=\"right\":Vd.isCenterAnchor(e)&&(r=\"center\"),_n.autoMargin(t,\"legend\",{x:e.x,y:.5,l:e._width*Jd[r],r:e._width*Kd[r],b:0,t:0})}(t):rg(t);var v=r._size,m=v.l+v.w*i.x,y=v.t+v.h*(1-i.y);Vd.isRightAnchor(i)?m-=i._width:Vd.isCenterAnchor(i)&&(m-=i._width/2),Vd.isBottomAnchor(i)?y-=i._height:Vd.isMiddleAnchor(i)&&(y-=i._height/2);var x=i._width,b=v.w;x>b?(m=v.l,x=b):(m+x>d&&(m=d-x),m<0&&(m=0),x=Math.min(d-m,i._width));var _,w,M,A,k=i._height,T=v.h;if(k>T?(y=v.t,k=T):(y+k>g&&(y=g-k),y<0&&(y=0),k=Math.min(g-y,i._height)),Sr.setTranslate(s,m,y),h.on(\".drag\",null),s.on(\"wheel\",null),i._height<=k||t._context.staticPlot)u.attr({width:x-i.borderwidth,height:k-i.borderwidth,x:i.borderwidth/2,y:i.borderwidth/2}),Sr.setTranslate(c,0,0),l.select(\"rect\").attr({width:x-2*i.borderwidth,height:k-2*i.borderwidth,x:i.borderwidth,y:i.borderwidth}),Sr.setClipUrl(c,n),Sr.setRect(h,0,0,0,0),delete i._scrollY;else{var S,E,C=Math.max(Ud.scrollBarMinHeight,k*k/i._height),L=k-C-2*Ud.scrollBarMargin,z=i._height-k,I=L/z,D=Math.min(i._scrollY||0,z);u.attr({width:x-2*i.borderwidth+Ud.scrollBarWidth+Ud.scrollBarMargin,height:k-i.borderwidth,x:i.borderwidth/2,y:i.borderwidth/2}),l.select(\"rect\").attr({width:x-2*i.borderwidth+Ud.scrollBarWidth+Ud.scrollBarMargin,height:k-2*i.borderwidth,x:i.borderwidth,y:i.borderwidth+D}),Sr.setClipUrl(c,n),R(D,C,I),s.on(\"wheel\",function(){R(D=ne.constrain(i._scrollY+e.event.deltaY/L*z,0,z),C,I),0!==D&&D!==z&&e.event.preventDefault()});var O=e.behavior.drag().on(\"dragstart\",function(){S=e.event.sourceEvent.clientY,E=D}).on(\"drag\",function(){var t=e.event.sourceEvent;2===t.buttons||t.ctrlKey||R(D=ne.constrain((t.clientY-S)/I+E,0,z),C,I)});h.call(O)}t._context.edits.legendPosition&&(s.classed(\"cursor-move\",!0),Ua.init({element:s.node(),gd:t,prepFn:function(){var t=Sr.getTranslate(s);M=t.x,A=t.y},moveFn:function(t,e){var r=M+t,n=A+e;Sr.setTranslate(s,r,n),_=Ua.align(r,0,v.l,v.l+v.w,i.xanchor),w=Ua.align(n,0,v.t+v.h,v.t,i.yanchor)},doneFn:function(){void 0!==_&&void 0!==w&&P.call(\"relayout\",t,{\"legend.x\":_,\"legend.y\":w})},clickFn:function(e,n){var i=r._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&&(1===e?s._clickTimeout=setTimeout(function(){Hd(i,t,e)},Qd):2===e&&(s._clickTimeout&&clearTimeout(s._clickTimeout),Hd(i,t,e)))}}))}function R(e,r,n){i._scrollY=t._fullLayout.legend._scrollY=e,Sr.setTranslate(c,0,-e),Sr.setRect(h,x,Ud.scrollBarMargin+e*n,Ud.scrollBarWidth,r),l.select(\"rect\").attr({y:i.borderwidth+e})}},style:Xd},ig={step:{valType:\"enumerated\",values:[\"month\",\"year\",\"day\",\"hour\",\"minute\",\"second\",\"all\"],dflt:\"month\",editType:\"plot\"},stepmode:{valType:\"enumerated\",values:[\"backward\",\"todate\"],dflt:\"backward\",editType:\"plot\"},count:{valType:\"number\",min:0,dflt:1,editType:\"plot\"},label:{valType:\"string\",editType:\"plot\"},editType:\"plot\"},ag=m.extendFlat,og={visible:{valType:\"boolean\",editType:\"plot\"},buttons:ig=ag(ig,{_isLinkedToArray:\"button\"}),x:{valType:\"number\",min:-2,max:3,editType:\"plot\"},xanchor:{valType:\"enumerated\",values:[\"auto\",\"left\",\"center\",\"right\"],dflt:\"left\",editType:\"plot\"},y:{valType:\"number\",min:-2,max:3,editType:\"plot\"},yanchor:{valType:\"enumerated\",values:[\"auto\",\"top\",\"middle\",\"bottom\"],dflt:\"bottom\",editType:\"plot\"},font:T({editType:\"plot\"}),bgcolor:{valType:\"color\",dflt:C.lightLine,editType:\"plot\"},activecolor:{valType:\"color\",editType:\"plot\"},bordercolor:{valType:\"color\",dflt:C.defaultLine,editType:\"plot\"},borderwidth:{valType:\"number\",min:0,dflt:0,editType:\"plot\"},editType:\"plot\"},sg={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10};var lg=function(t,r){var n=t._name,i={};if(\"all\"===r.step)i[n+\".autorange\"]=!0;else{var a=function(t,r){var n,i=t.range,a=new Date(t.r2l(i[1])),o=r.step,s=r.count;switch(r.stepmode){case\"backward\":n=t.l2r(+e.time[o].utc.offset(a,-s));break;case\"todate\":var l=e.time[o].utc.offset(a,-s);n=t.l2r(+e.time[o].utc.ceil(l))}var u=i[1];return[n,u]}(t,r);i[n+\".range[0]\"]=a[0],i[n+\".range[1]\"]=a[1]}return i};var ug=Qe.LINE_SPACING,cg=Qe.FROM_TL,hg=Qe.FROM_BR;function fg(t){return t._id}function pg(t,e,r){var n=t.selectAll(\"rect\").data([0]);n.enter().append(\"rect\").classed(\"selector-rect\",!0),n.attr(\"shape-rendering\",\"crispEdges\"),n.attr({rx:sg.rx,ry:sg.ry}),n.call(Oe.stroke,e.bordercolor).call(Oe.fill,function(t,e){return e._isActive||e._isHovered?t.activecolor:t.bgcolor}(e,r)).style(\"stroke-width\",e.borderwidth+\"px\")}function dg(t,e,r,n){var i,a=t.selectAll(\"text\").data([0]);a.enter().append(\"text\").classed(\"selector-text\",!0).classed(\"user-select-none\",!0),a.attr(\"text-anchor\",\"middle\"),a.call(Sr.font,e.font).text((i=r,i.label?i.label:\"all\"===i.step?\"all\":i.count+i.step.charAt(0))).call(function(t){er.convertToTspans(t,n)})}var gg={moduleType:\"component\",name:\"rangeselector\",schema:{subplots:{xaxis:{rangeselector:og}}},layoutAttributes:og,handleDefaults:function(t,e,r,n,i){var a=t.rangeselector||{},o=e.rangeselector={};function s(t,e){return ne.coerce(a,o,og,t,e)}if(s(\"visible\",function(t,e,r){var n,i,a=t.buttons||[],o=e.buttons=[];function s(t,e){return ne.coerce(n,i,ig,t,e)}for(var l=0;l<a.length;l++)if(n=a[l],i={},ne.isPlainObject(n)){var u=s(\"step\");\"all\"!==u&&(!r||\"gregorian\"===r||\"month\"!==u&&\"year\"!==u?s(\"stepmode\"):i.stepmode=\"backward\",s(\"count\")),s(\"label\"),i._index=l,o.push(i)}return o}(a,o,i).length>0)){var l=function(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),i=0,a=0;a<n.length;a++){var o=e[n[a]].domain;o&&(i=Math.max(o[1],i))}return[t.domain[0],i+sg.yPad]}(e,r,n);s(\"x\",l[0]),s(\"y\",l[1]),ne.noneOrAll(t,e,[\"x\",\"y\"]),s(\"xanchor\"),s(\"yanchor\"),ne.coerceFont(s,\"font\",r.font);var u=s(\"bgcolor\");s(\"activecolor\",Oe.contrast(u,sg.lightAmount,sg.darkAmount)),s(\"bordercolor\"),s(\"borderwidth\")}},draw:function(t){var r=t._fullLayout._infolayer.selectAll(\".rangeselector\").data(function(t){for(var e=gn.list(t,\"x\",!0),r=[],n=0;n<e.length;n++){var i=e[n];i.rangeselector&&i.rangeselector.visible&&r.push(i)}return r}(t),fg);r.enter().append(\"g\").classed(\"rangeselector\",!0),r.exit().remove(),r.style({cursor:\"pointer\",\"pointer-events\":\"all\"}),r.each(function(r){var n=e.select(this),i=r,a=i.rangeselector,o=n.selectAll(\"g.button\").data(a.buttons);o.enter().append(\"g\").classed(\"button\",!0),o.exit().remove(),o.each(function(r){var n=e.select(this),o=lg(i,r);r._isActive=function(t,e,r){if(\"all\"===e.step)return!0===t.autorange;var n=Object.keys(r);return t.range[0]===r[n[0]]&&t.range[1]===r[n[1]]}(i,r,o),n.call(pg,a,r),n.call(dg,a,r,t),n.on(\"click\",function(){t._dragged||P.call(\"relayout\",t,o)}),n.on(\"mouseover\",function(){r._isHovered=!0,n.call(pg,a,r)}),n.on(\"mouseout\",function(){r._isHovered=!1,n.call(pg,a,r)})}),function(t,r,n,i,a){var o=0,s=0,l=n.borderwidth;r.each(function(){var t=e.select(this),r=t.select(\".selector-text\"),i=n.font.size*ug,a=Math.max(i*er.lineCount(r),16)+3;s=Math.max(s,a)}),r.each(function(){var t=e.select(this),r=t.select(\".selector-rect\"),i=t.select(\".selector-text\"),a=i.node()&&Sr.bBox(i.node()).width,u=n.font.size*ug,c=er.lineCount(i),h=Math.max(a+10,sg.minButtonWidth);t.attr(\"transform\",\"translate(\"+(l+o)+\",\"+l+\")\"),r.attr({x:0,y:0,width:h,height:s}),er.positionText(i,h/2,s/2-(c-1)*u/2+3),o+=h+5});var u=t._fullLayout._size,c=u.l+u.w*n.x,h=u.t+u.h*(1-n.y),f=\"left\";Vd.isRightAnchor(n)&&(c-=o,f=\"right\"),Vd.isCenterAnchor(n)&&(c-=o/2,f=\"center\");var p=\"top\";Vd.isBottomAnchor(n)&&(h-=s,p=\"bottom\"),Vd.isMiddleAnchor(n)&&(h-=s/2,p=\"middle\"),o=Math.ceil(o),s=Math.ceil(s),c=Math.round(c),h=Math.round(h),_n.autoMargin(t,i+\"-range-selector\",{x:n.x,y:n.y,l:o*cg[f],r:o*hg[f],b:s*hg[p],t:s*cg[p]}),a.attr(\"transform\",\"translate(\"+c+\",\"+h+\")\")}(t,o,a,i._name,n)})}},vg={bgcolor:{valType:\"color\",dflt:C.background,editType:\"plot\"},bordercolor:{valType:\"color\",dflt:C.defaultLine,editType:\"plot\"},borderwidth:{valType:\"integer\",dflt:0,min:0,editType:\"plot\"},autorange:{valType:\"boolean\",dflt:!0,editType:\"calc\",impliedEdits:{\"range[0]\":void 0,\"range[1]\":void 0}},range:{valType:\"info_array\",items:[{valType:\"any\",editType:\"calc\",impliedEdits:{\"^autorange\":!1}},{valType:\"any\",editType:\"calc\",impliedEdits:{\"^autorange\":!1}}],editType:\"calc\",impliedEdits:{autorange:!1}},thickness:{valType:\"number\",dflt:.15,min:0,max:1,editType:\"plot\"},visible:{valType:\"boolean\",dflt:!0,editType:\"calc\"},editType:\"calc\"},mg={name:\"rangeslider\",containerClassName:\"rangeslider-container\",bgClassName:\"rangeslider-bg\",rangePlotClassName:\"rangeslider-rangeplot\",maskMinClassName:\"rangeslider-mask-min\",maskMaxClassName:\"rangeslider-mask-max\",slideBoxClassName:\"rangeslider-slidebox\",grabberMinClassName:\"rangeslider-grabber-min\",grabAreaMinClassName:\"rangeslider-grabarea-min\",handleMinClassName:\"rangeslider-handle-min\",grabberMaxClassName:\"rangeslider-grabber-max\",grabAreaMaxClassName:\"rangeslider-grabarea-max\",handleMaxClassName:\"rangeslider-handle-max\",maskMinOppAxisClassName:\"rangeslider-mask-min-opp-axis\",maskMaxOppAxisClassName:\"rangeslider-mask-max-opp-axis\",maskColor:\"rgba(0,0,0,0.4)\",maskOppAxisColor:\"rgba(0,0,0,0.2)\",slideBoxFill:\"transparent\",slideBoxCursor:\"ew-resize\",grabAreaFill:\"transparent\",grabAreaCursor:\"col-resize\",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15},yg=gn.list,xg=Fn,bg={_isSubplotObj:!0,rangemode:{valType:\"enumerated\",values:[\"auto\",\"fixed\",\"match\"],dflt:\"match\",editType:\"calc\"},range:{valType:\"info_array\",items:[{valType:\"any\",editType:\"plot\"},{valType:\"any\",editType:\"plot\"}],editType:\"plot\"},editType:\"calc\"};function _g(t,e,r,n){var i=t.selectAll(\"rect.\"+mg.bgClassName).data([0]);i.enter().append(\"rect\").classed(mg.bgClassName,!0).attr({x:0,y:0,\"shape-rendering\":\"crispEdges\"});var a=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,o=-n._offsetShift,s=Sr.crispRound(e,n.borderwidth);i.attr({width:n._width+a,height:n._height+a,transform:\"translate(\"+o+\",\"+o+\")\",fill:n.bgcolor,stroke:n.bordercolor,\"stroke-width\":s})}function wg(t,e,r,n){var i=e._fullLayout._topdefs.selectAll(\"#\"+n._clipId).data([0]);i.enter().append(\"clipPath\").attr(\"id\",n._clipId).append(\"rect\").attr({x:0,y:0}),i.select(\"rect\").attr({width:n._width,height:n._height})}function Mg(t,r,n,i){var a,o=ri.getSubplots(r,n),s=r.calcdata,l=t.selectAll(\"g.\"+mg.rangePlotClassName).data(o,ne.identity);l.enter().append(\"g\").attr(\"class\",function(t){return mg.rangePlotClassName+\" \"+t}).call(Sr.setClipUrl,i._clipId),l.order(),l.exit().remove(),l.each(function(t,o){var l=e.select(this),u=0===o,c=ri.getFromId(r,t,\"y\"),h=c._name,f=i[h],p={data:[],layout:{xaxis:{type:n.type,domain:[0,1],range:i.range.slice(),calendar:n.calendar},width:i._width,height:i._height,margin:{t:0,b:0,l:0,r:0}},_context:r._context};p.layout[h]={type:c.type,domain:[0,1],range:\"match\"!==f.rangemode?f.range.slice():c.range.slice(),calendar:c.calendar},_n.supplyDefaults(p);var d={id:t,plotgroup:l,xaxis:p._fullLayout.xaxis,yaxis:p._fullLayout[h]};u?a=d:(d.mainplot=\"xy\",d.mainplotinfo=a),ua.rangePlot(r,d,function(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n],a=i[0].trace;a.xaxis+a.yaxis===e&&r.push(i)}return r}(s,t))})}function Ag(t,e,r,n,i){var a=t.selectAll(\"rect.\"+mg.maskMinClassName).data([0]);a.enter().append(\"rect\").classed(mg.maskMinClassName,!0).attr({x:0,y:0}).attr(\"shape-rendering\",\"crispEdges\"),a.attr(\"height\",n._height).call(Oe.fill,mg.maskColor);var o=t.selectAll(\"rect.\"+mg.maskMaxClassName).data([0]);if(o.enter().append(\"rect\").classed(mg.maskMaxClassName,!0).attr(\"y\",0).attr(\"shape-rendering\",\"crispEdges\"),o.attr(\"height\",n._height).call(Oe.fill,mg.maskColor),\"match\"!==i.rangemode){var s=t.selectAll(\"rect.\"+mg.maskMinOppAxisClassName).data([0]);s.enter().append(\"rect\").classed(mg.maskMinOppAxisClassName,!0).attr(\"y\",0).attr(\"shape-rendering\",\"crispEdges\"),s.attr(\"width\",n._width).call(Oe.fill,mg.maskOppAxisColor);var l=t.selectAll(\"rect.\"+mg.maskMaxOppAxisClassName).data([0]);l.enter().append(\"rect\").classed(mg.maskMaxOppAxisClassName,!0).attr(\"y\",0).attr(\"shape-rendering\",\"crispEdges\"),l.attr(\"width\",n._width).style(\"border-top\",mg.maskOppBorder).call(Oe.fill,mg.maskOppAxisColor)}}function kg(t,e,r,n){if(!e._context.staticPlot){var i=t.selectAll(\"rect.\"+mg.slideBoxClassName).data([0]);i.enter().append(\"rect\").classed(mg.slideBoxClassName,!0).attr(\"y\",0).attr(\"cursor\",mg.slideBoxCursor).attr(\"shape-rendering\",\"crispEdges\"),i.attr({height:n._height,fill:mg.slideBoxFill})}}function Tg(t,e,r,n){var i=t.selectAll(\"g.\"+mg.grabberMinClassName).data([0]);i.enter().append(\"g\").classed(mg.grabberMinClassName,!0);var a=t.selectAll(\"g.\"+mg.grabberMaxClassName).data([0]);a.enter().append(\"g\").classed(mg.grabberMaxClassName,!0);var o={x:0,width:mg.handleWidth,rx:mg.handleRadius,fill:Oe.background,stroke:Oe.defaultLine,\"stroke-width\":mg.handleStrokeWidth,\"shape-rendering\":\"crispEdges\"},s={y:Math.round(n._height/4),height:Math.round(n._height/2)},l=i.selectAll(\"rect.\"+mg.handleMinClassName).data([0]);l.enter().append(\"rect\").classed(mg.handleMinClassName,!0).attr(o),l.attr(s);var u=a.selectAll(\"rect.\"+mg.handleMaxClassName).data([0]);if(u.enter().append(\"rect\").classed(mg.handleMaxClassName,!0).attr(o),u.attr(s),!e._context.staticPlot){var c={width:mg.grabAreaWidth,x:0,y:0,fill:mg.grabAreaFill,cursor:mg.grabAreaCursor},h=i.selectAll(\"rect.\"+mg.grabAreaMinClassName).data([0]);h.enter().append(\"rect\").classed(mg.grabAreaMinClassName,!0).attr(c),h.attr(\"height\",n._height);var f=a.selectAll(\"rect.\"+mg.grabAreaMaxClassName).data([0]);f.enter().append(\"rect\").classed(mg.grabAreaMaxClassName,!0).attr(c),f.attr(\"height\",n._height)}}var Sg={moduleType:\"component\",name:\"rangeslider\",schema:{subplots:{xaxis:{rangeslider:ne.extendFlat({},vg,{yaxis:bg})}}},layoutAttributes:vg,handleDefaults:function(t,e,r){if(t[r].rangeslider){ne.isPlainObject(t[r].rangeslider)||(t[r].rangeslider={});var n=t[r].rangeslider,i=e[r],a=i.rangeslider={};if(v(\"visible\")){v(\"bgcolor\",e.plot_bgcolor),v(\"bordercolor\"),v(\"borderwidth\"),v(\"thickness\"),i._rangesliderAutorange=v(\"autorange\",!i.isValidRange(n.range)),v(\"range\");var o=e._subplots;if(o)for(var s=o.cartesian.filter(function(t){return t.substr(0,t.indexOf(\"y\"))===gn.name2id(r)}).map(function(t){return t.substr(t.indexOf(\"y\"),t.length)}),l=ne.simpleMap(s,gn.id2name),u=0;u<l.length;u++){var c,h=l[u],f=n[h]||{},p=a[h]={},d=e[h];f.range&&d.isValidRange(f.range)&&(c=\"fixed\");var g=m(f,p,\"rangemode\",c);\"match\"!==g&&m(f,p,\"range\",d.range.slice()),d._rangesliderAutorange=\"auto\"===g}a._input=n}}function v(t,e){return ne.coerce(n,a,vg,t,e)}function m(t,e,r,n){return ne.coerce(t,e,bg,r,n)}},calcAutorange:function(t){for(var e=yg(t,\"x\",!0),r=0;r<e.length;r++){var n=e[r],i=n[mg.name];i&&i.visible&&i.autorange&&n._min.length&&n._max.length&&(i._input.autorange=!0,i._input.range=i.range=xg(n))}},draw:function(t){var r=t._fullLayout,n=function(t){var e=ri.list({_fullLayout:t},\"x\",!0),r=mg.name,n=[];if(t._has(\"gl2d\"))return n;for(var i=0;i<e.length;i++){var a=e[i];a[r]&&a[r].visible&&n.push(a)}return n}(r);var i=r._infolayer.selectAll(\"g.\"+mg.containerClassName).data(n,function(t){return t._name});i.enter().append(\"g\").classed(mg.containerClassName,!0).attr(\"pointer-events\",\"all\"),i.exit().each(function(t){var n=e.select(this),i=t[mg.name];n.remove(),r._topdefs.select(\"#\"+i._clipId).remove()}),i.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var i=r[n];-1!==i.indexOf(mg.name)&&_n.autoMargin(t,i)}}(t),0!==n.length&&i.each(function(n){var i=e.select(this),a=n[mg.name],o=r[ri.id2name(n.anchor)],s=a[ri.id2name(n.anchor)];if(a.range){var l=a.range,u=n.range;l[0]=n.l2r(Math.min(n.r2l(l[0]),n.r2l(u[0]))),l[1]=n.l2r(Math.max(n.r2l(l[1]),n.r2l(u[1]))),a._input.range=l.slice()}n.cleanRange(\"rangeslider.range\");for(var c=r.margin,h=r._size,f=n.domain,p=(n._boundingBox||{}).height||0,d=1/0,g=ri.getSubplots(t,n),v=0;v<g.length;v++){var m=ri.getFromId(t,g[v].substr(g[v].indexOf(\"y\")));d=Math.min(d,m.domain[0])}a._id=mg.name+n._id,a._clipId=a._id+\"-\"+r._uid,a._width=h.w*(f[1]-f[0]),a._height=(r.height-c.b-c.t)*a.thickness,a._offsetShift=Math.floor(a.borderwidth/2);var y=Math.round(c.l+h.w*f[0]),x=Math.round(h.t+h.h*(1-d)+p+a._offsetShift+mg.extraPad);i.attr(\"transform\",\"translate(\"+y+\",\"+x+\")\");var b=n.r2l(a.range[0]),_=n.r2l(a.range[1]),w=_-b;if(a.p2d=function(t){return t/a._width*w+b},a.d2p=function(t){return(t-b)/w*a._width},a._rl=[b,_],\"match\"!==s.rangemode){var M=o.r2l(s.range[0]),A=o.r2l(s.range[1])-M;a.d2pOppAxis=function(t){return(t-M)/A*a._height}}i.call(_g,t,n,a).call(wg,t,n,a).call(Mg,t,n,a).call(Ag,t,n,a,s).call(kg,t,n,a).call(Tg,t,n,a),function(t,r,n,i){var a=t.select(\"rect.\"+mg.slideBoxClassName).node(),o=t.select(\"rect.\"+mg.grabAreaMinClassName).node(),s=t.select(\"rect.\"+mg.grabAreaMaxClassName).node();t.on(\"mousedown\",function(){var l=e.event,u=l.target,c=l.clientX,h=c-t.node().getBoundingClientRect().left,f=i.d2p(n._rl[0]),p=i.d2p(n._rl[1]),d=Ua.coverSlip();function g(t){var l,g,v,m=+t.clientX-c;switch(u){case a:v=\"ew-resize\",l=f+m,g=p+m;break;case o:v=\"col-resize\",l=f+m,g=p;break;case s:v=\"col-resize\",l=f,g=p+m;break;default:v=\"ew-resize\",l=h,g=h+m}if(g<l){var y=g;g=l,l=y}i._pixelMin=l,i._pixelMax=g,Ka(e.select(d),v),function(t,e,r,n){function i(t){return r.l2r(ne.constrain(t,n._rl[0],n._rl[1]))}var a=i(n.p2d(n._pixelMin)),o=i(n.p2d(n._pixelMax));window.requestAnimationFrame(function(){P.call(\"relayout\",e,r._name+\".range\",[a,o])})}(0,r,n,i)}d.addEventListener(\"mousemove\",g),d.addEventListener(\"mouseup\",function t(){d.removeEventListener(\"mousemove\",g),d.removeEventListener(\"mouseup\",t),ne.removeElement(d)})})}(i,t,n,a),function(t,e,r,n,i,a){var o=mg.handleWidth/2;function s(t){return ne.constrain(t,0,n._width)}function l(t){return ne.constrain(t,0,n._height)}function u(t){return ne.constrain(t,-o,n._width+o)}var c=s(n.d2p(r._rl[0])),h=s(n.d2p(r._rl[1]));if(t.select(\"rect.\"+mg.slideBoxClassName).attr(\"x\",c).attr(\"width\",h-c),t.select(\"rect.\"+mg.maskMinClassName).attr(\"width\",c),t.select(\"rect.\"+mg.maskMaxClassName).attr(\"x\",h).attr(\"width\",n._width-h),\"match\"!==a.rangemode){var f=n._height-l(n.d2pOppAxis(i._rl[1])),p=n._height-l(n.d2pOppAxis(i._rl[0]));t.select(\"rect.\"+mg.maskMinOppAxisClassName).attr(\"x\",c).attr(\"height\",f).attr(\"width\",h-c),t.select(\"rect.\"+mg.maskMaxOppAxisClassName).attr(\"x\",c).attr(\"y\",p).attr(\"height\",n._height-p).attr(\"width\",h-c),t.select(\"rect.\"+mg.slideBoxClassName).attr(\"y\",f).attr(\"height\",p-f)}var d=Math.round(u(c-o))-.5,g=Math.round(u(h-o))+.5;t.select(\"g.\"+mg.grabberMinClassName).attr(\"transform\",\"translate(\"+d+\",0.5)\"),t.select(\"g.\"+mg.grabberMaxClassName).attr(\"transform\",\"translate(\"+g+\",0.5)\")}(i,0,n,a,o,s),\"bottom\"===n.side&&Dn.draw(t,n._id+\"title\",{propContainer:n,propName:n._name+\".title\",placeholder:r._dfltTitle.x,attributes:{x:n._offset+n._length/2,y:x+a._height+a._offsetShift+10+1.5*n.titlefont.size,\"text-anchor\":\"middle\"}}),_n.autoMargin(t,a._id,{x:f[0],y:d,l:0,r:0,t:0,b:a._height+c.b+p,pad:mg.extraPad+2*a._offsetShift})})}},Eg=Zr.line,Cg=Ae.dash,Lg=m.extendFlat,zg={_isLinkedToArray:\"shape\",visible:{valType:\"boolean\",dflt:!0,editType:\"calcIfAutorange+arraydraw\"},type:{valType:\"enumerated\",values:[\"circle\",\"rect\",\"path\",\"line\"],editType:\"calcIfAutorange+arraydraw\"},layer:{valType:\"enumerated\",values:[\"below\",\"above\"],dflt:\"above\",editType:\"arraydraw\"},xref:Lg({},Jp.xref,{}),x0:{valType:\"any\",editType:\"calcIfAutorange+arraydraw\"},x1:{valType:\"any\",editType:\"calcIfAutorange+arraydraw\"},yref:Lg({},Jp.yref,{}),y0:{valType:\"any\",editType:\"calcIfAutorange+arraydraw\"},y1:{valType:\"any\",editType:\"calcIfAutorange+arraydraw\"},path:{valType:\"string\",editType:\"calcIfAutorange+arraydraw\"},opacity:{valType:\"number\",min:0,max:1,dflt:1,editType:\"arraydraw\"},line:{color:Lg({},Eg.color,{editType:\"arraydraw\"}),width:Lg({},Eg.width,{editType:\"calcIfAutorange+arraydraw\"}),dash:Lg({},Cg,{editType:\"arraydraw\"}),editType:\"calcIfAutorange+arraydraw\"},fillcolor:{valType:\"color\",dflt:\"rgba(0,0,0,0)\",editType:\"arraydraw\"},editType:\"arraydraw\"},Pg={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}},Ig={rangeToShapePosition:function(t){return\"log\"===t.type?t.r2d:function(t){return t}},shapePositionToRange:function(t){return\"log\"===t.type?t.d2r:function(t){return t}},decodeDate:function(t){return function(e){return e.replace&&(e=e.replace(\"_\",\" \")),t(e)}},encodeDate:function(t){return function(e){return t(e).replace(\" \",\"_\")}},getDataToPixel:function(t,e,r){var n,i=t._fullLayout._size;if(e){var a=Ig.shapePositionToRange(e);n=function(t){return e._offset+e.r2p(a(t,!0))},\"date\"===e.type&&(n=Ig.decodeDate(n))}else n=r?function(t){return i.t+i.h*(1-t)}:function(t){return i.l+i.w*t};return n},getPixelToData:function(t,e,r){var n,i=t._fullLayout._size;if(e){var a=Ig.rangeToShapePosition(e);n=function(t){return a(e.p2r(t-e._offset))}}else n=r?function(t){return 1-(t-i.t)/i.h}:function(t){return(t-i.l)/i.w};return n}};function Dg(t,e,r,n,i){var a=\"category\"===t.type?t.r2c:t.d2c;if(void 0!==e)return[a(e),a(r)];if(n){var o,s,l,u,c=1/0,h=-1/0,f=n.match(Pg.segmentRE);for(\"date\"===t.type&&(a=Ig.decodeDate(a)),o=0;o<f.length;o++)void 0!==(s=i[f[o].charAt(0)].drawn)&&(!(l=f[o].substr(1).match(Pg.paramRE))||l.length<s||((u=a(l[s]))<c&&(c=u),u>h&&(h=u)));return h>=c?[c,h]:void 0}}var Og=function(t,e,r,n,i){function a(r,n){return ne.coerce(t,e,zg,r,n)}if(n=n||{},!a(\"visible\",!(i=i||{}).itemIsNotPlainObject))return e;a(\"layer\"),a(\"opacity\"),a(\"fillcolor\"),a(\"line.color\"),a(\"line.width\"),a(\"line.dash\");for(var o=a(\"type\",t.path?\"path\":\"rect\"),s=[\"x\",\"y\"],l=0;l<2;l++){var u=s[l],c={_fullLayout:r},h=ri.coerceRef(t,e,c,u,\"\",\"paper\");if(\"path\"!==o){var f,p,d;\"paper\"!==h?(f=ri.getFromId(c,h),d=Ig.rangeToShapePosition(f),p=Ig.shapePositionToRange(f)):p=d=ne.identity;var g=u+\"0\",v=u+\"1\",m=t[g],y=t[v];t[g]=p(t[g],!0),t[v]=p(t[v],!0),ri.coercePosition(e,c,a,h,g,.25),ri.coercePosition(e,c,a,h,v,.75),e[g]=d(e[g]),e[v]=d(e[v]),t[g]=m,t[v]=y}}return\"path\"===o?a(\"path\"):ne.noneOrAll(t,e,[\"x0\",\"x1\",\"y0\",\"y1\"]),e},Rg={draw:function(t){var e=t._fullLayout;e._shapeUpperLayer.selectAll(\"path\").remove(),e._shapeLowerLayer.selectAll(\"path\").remove(),e._shapeSubplotLayers.selectAll(\"path\").remove();for(var r=0;r<e.shapes.length;r++)e.shapes[r].visible&&Fg(t,r)},drawOne:Fg};function Fg(t,e){t._fullLayout._paperdiv.selectAll('.shapelayer [data-index=\"'+e+'\"]').remove();var r=(t.layout.shapes||[])[e],n=t._fullLayout.shapes[e];if(r&&!1!==n.visible)if(\"below\"!==n.layer)a(t._fullLayout._shapeUpperLayer);else if(\"paper\"===n.xref||\"paper\"===n.yref)a(t._fullLayout._shapeLowerLayer);else{var i=t._fullLayout._plots[n.xref+n.yref];if(i)a((i.mainplotinfo||i).shapelayer);else a(t._fullLayout._shapeLowerLayer)}function a(r){var i={\"data-index\":e,\"fill-rule\":\"evenodd\",d:Bg(t,n)},a=n.line.width?n.line.color:\"rgba(0,0,0,0)\",o=r.append(\"path\").attr(i).style(\"opacity\",n.opacity).call(Oe.stroke,a).call(Oe.fill,n.fillcolor).call(Sr.dashLine,n.line.dash,n.line.width),s=(n.xref+n.yref).replace(/paper/g,\"\");o.call(Sr.setClipUrl,s?\"clip\"+t._fullLayout._uid+s:null),t._context.edits.shapePosition&&function(t,e,r,n){var i,a,o,s,l,u,c,h,f,p,d,g,v,m,y,x,b,_,w,M,A,k,T,S,E,C,L,z,I,D,O=10,R=10,F={element:e.node(),gd:t,prepFn:function(e){S=ri.getFromId(t,r.xref),E=ri.getFromId(t,r.yref),C=Ig.getDataToPixel(t,S),L=Ig.getDataToPixel(t,E,!0),z=Ig.getPixelToData(t,S),I=Ig.getPixelToData(t,E,!0);var P=\"shapes[\"+n+\"]\";\"path\"===r.type?(k=r.path,T=P+\".path\"):(a=C(r.x0),o=L(r.y0),s=C(r.x1),l=L(r.y1),u=P+\".x0\",c=P+\".y0\",h=P+\".x1\",f=P+\".y1\");a<s?(g=a,x=P+\".x0\",M=\"x0\",v=s,b=P+\".x1\",A=\"x1\"):(g=s,x=P+\".x1\",M=\"x1\",v=a,b=P+\".x0\",A=\"x0\");o<l?(p=o,m=P+\".y0\",_=\"y0\",d=l,y=P+\".y1\",w=\"y1\"):(p=l,m=P+\".y1\",_=\"y1\",d=o,y=P+\".y0\",w=\"y0\");i={},N(e),F.moveFn=\"move\"===D?j:V},doneFn:function(){Ka(e),P.call(\"relayout\",t,i)}},B=F.element.getBoundingClientRect();function N(t){var r=B.right-B.left,n=B.bottom-B.top,i=t.clientX-B.left,a=t.clientY-B.top,o=r>O&&n>R&&!t.shiftKey?Ua.getCursor(i/r,1-a/n):\"move\";Ka(e,o),D=o.split(\"-\")[0]}function j(n,p){if(\"path\"===r.type){var d=function(t){return z(C(t)+n)};S&&\"date\"===S.type&&(d=Ig.encodeDate(d));var g=function(t){return I(L(t)+p)};E&&\"date\"===E.type&&(g=Ig.encodeDate(g)),r.path=Ng(k,d,g),i[T]=r.path}else i[u]=r.x0=z(a+n),i[c]=r.y0=I(o+p),i[h]=r.x1=z(s+n),i[f]=r.y1=I(l+p);e.attr(\"d\",Bg(t,r))}function V(n,a){if(\"path\"===r.type){var o=function(t){return z(C(t)+n)};S&&\"date\"===S.type&&(o=Ig.encodeDate(o));var s=function(t){return I(L(t)+a)};E&&\"date\"===E.type&&(s=Ig.encodeDate(s)),r.path=Ng(k,o,s),i[T]=r.path}else{var l=~D.indexOf(\"n\")?p+a:p,u=~D.indexOf(\"s\")?d+a:d,c=~D.indexOf(\"w\")?g+n:g,h=~D.indexOf(\"e\")?v+n:v;u-l>R&&(i[m]=r[_]=I(l),i[y]=r[w]=I(u)),h-c>O&&(i[x]=r[M]=z(c),i[b]=r[A]=z(h))}e.attr(\"d\",Bg(t,r))}Ua.init(F),e.node().onmousemove=N}(t,o,n,e)}}function Bg(t,e){var r,n,i,a,o=e.type,s=ri.getFromId(t,e.xref),l=ri.getFromId(t,e.yref),u=t._fullLayout._size;if(s?(r=Ig.shapePositionToRange(s),n=function(t){return s._offset+s.r2p(r(t,!0))}):n=function(t){return u.l+u.w*t},l?(i=Ig.shapePositionToRange(l),a=function(t){return l._offset+l.r2p(i(t,!0))}):a=function(t){return u.t+u.h*(1-t)},\"path\"===o)return s&&\"date\"===s.type&&(n=Ig.decodeDate(n)),l&&\"date\"===l.type&&(a=Ig.decodeDate(a)),function(t,e,r){return t.replace(Pg.segmentRE,function(t){var n=0,i=t.charAt(0),a=Pg.paramIsX[i],o=Pg.paramIsY[i],s=Pg.numParams[i],l=t.substr(1).replace(Pg.paramRE,function(t){return a[n]?t=e(t):o[n]&&(t=r(t)),++n>s&&(t=\"X\"),t});return n>s&&(l=l.replace(/[\\s,]*X.*/,\"\"),ne.log(\"Ignoring extra params in segment \"+t)),i+l})}(e.path,n,a);var c=n(e.x0),h=n(e.x1),f=a(e.y0),p=a(e.y1);if(\"line\"===o)return\"M\"+c+\",\"+f+\"L\"+h+\",\"+p;if(\"rect\"===o)return\"M\"+c+\",\"+f+\"H\"+h+\"V\"+p+\"H\"+c+\"Z\";var d=(c+h)/2,g=(f+p)/2,v=Math.abs(d-c),m=Math.abs(g-f),y=\"A\"+v+\",\"+m,x=d+v+\",\"+g;return\"M\"+x+y+\" 0 1,1 \"+(d+\",\"+(g-m))+y+\" 0 0,1 \"+x+\"Z\"}function Ng(t,e,r){return t.replace(Pg.segmentRE,function(t){var n=0,i=t.charAt(0),a=Pg.paramIsX[i],o=Pg.paramIsY[i],s=Pg.numParams[i];return i+t.substr(1).replace(Pg.paramRE,function(t){return n>=s?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}var jg={moduleType:\"component\",name:\"shapes\",layoutAttributes:zg,supplyLayoutDefaults:function(t,e){ld(t,e,{name:\"shapes\",handleItemDefaults:Og})},includeBasePlot:ud(\"shapes\"),calcAutorange:function(t){var e=t._fullLayout,r=ne.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var n=0;n<r.length;n++){var i,a,o=r[n],s=o.line.width/2;\"paper\"!==o.xref&&(a=Dg(i=ri.getFromId(t,o.xref),o.x0,o.x1,o.path,Pg.paramIsX))&&ri.expand(i,a,{ppad:s}),\"paper\"!==o.yref&&(a=Dg(i=ri.getFromId(t,o.yref),o.y0,o.y1,o.path,Pg.paramIsY))&&ri.expand(i,a,{ppad:s})}},draw:Rg.draw,drawOne:Rg.drawOne},Vg={name:\"sliders\",containerClassName:\"slider-container\",groupClassName:\"slider-group\",inputAreaClass:\"slider-input-area\",railRectClass:\"slider-rail-rect\",railTouchRectClass:\"slider-rail-touch-rect\",gripRectClass:\"slider-grip-rect\",tickRectClass:\"slider-tick-rect\",inputProxyClass:\"slider-input-proxy\",labelsClass:\"slider-labels\",labelGroupClass:\"slider-label-group\",labelClass:\"slider-label\",currentValueClass:\"slider-current-value\",railHeight:5,menuIndexAttrName:\"slider-active-index\",autoMarginIdRoot:\"slider-\",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:\"#bec8d9\",railBgColor:\"#f8fafc\",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:\"#bec8d9\",gripBgColor:\"#f6f8fa\",gripBgActiveColor:\"#dbdde0\",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:\"#333\",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:\"#333\",minorTickLength:4,currentValuePadding:8,currentValueInset:0},Ug={t:{valType:\"number\",dflt:0,editType:\"arraydraw\"},r:{valType:\"number\",dflt:0,editType:\"arraydraw\"},b:{valType:\"number\",dflt:0,editType:\"arraydraw\"},l:{valType:\"number\",dflt:0,editType:\"arraydraw\"},editType:\"arraydraw\"},qg=m.extendDeepAll,Hg=(0,ye.overrideAll)({_isLinkedToArray:\"slider\",visible:{valType:\"boolean\",dflt:!0},active:{valType:\"number\",min:0,dflt:0},steps:{_isLinkedToArray:\"step\",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\"},value:{valType:\"string\"},execute:{valType:\"boolean\",dflt:!0}},lenmode:{valType:\"enumerated\",values:[\"fraction\",\"pixels\"],dflt:\"fraction\"},len:{valType:\"number\",min:0,dflt:1},x:{valType:\"number\",min:-2,max:3,dflt:0},pad:qg({},Ug,{},{t:{dflt:20}}),xanchor:{valType:\"enumerated\",values:[\"auto\",\"left\",\"center\",\"right\"],dflt:\"left\"},y:{valType:\"number\",min:-2,max:3,dflt:0},yanchor:{valType:\"enumerated\",values:[\"auto\",\"top\",\"middle\",\"bottom\"],dflt:\"top\"},transition:{duration:{valType:\"number\",min:0,dflt:150},easing:{valType:\"enumerated\",values:we.transition.easing.values,dflt:\"cubic-in-out\"}},currentvalue:{visible:{valType:\"boolean\",dflt:!0},xanchor:{valType:\"enumerated\",values:[\"left\",\"center\",\"right\"],dflt:\"left\"},offset:{valType:\"number\",dflt:10},prefix:{valType:\"string\"},suffix:{valType:\"string\"},font:T({})},font:T({}),activebgcolor:{valType:\"color\",dflt:Vg.gripBgActiveColor},bgcolor:{valType:\"color\",dflt:Vg.railBgColor},bordercolor:{valType:\"color\",dflt:Vg.railBorderColor},borderwidth:{valType:\"number\",min:0,dflt:Vg.railBorderWidth},ticklen:{valType:\"number\",min:0,dflt:Vg.tickLength},tickcolor:{valType:\"color\",dflt:Vg.tickColor},tickwidth:{valType:\"number\",min:0,dflt:1},minorticklen:{valType:\"number\",min:0,dflt:Vg.minorTickLength}},\"arraydraw\",\"from-root\"),Gg=Vg.name,Wg=Hg.steps;function Yg(t,e,r){function n(r,n){return ne.coerce(t,e,Hg,r,n)}n(\"visible\",function(t,e){var r,n,i=t.steps||[],a=e.steps=[];function o(t,e){return ne.coerce(r,n,Wg,t,e)}for(var s=0;s<i.length;s++)r=i[s],n={},o(\"method\"),ne.isPlainObject(r)&&(\"skip\"===n.method||Array.isArray(r.args))&&(o(\"args\"),o(\"label\",\"step-\"+s),o(\"value\",n.label),o(\"execute\"),a.push(n));return a}(t,e).length>0)&&(n(\"active\"),n(\"x\"),n(\"y\"),ne.noneOrAll(t,e,[\"x\",\"y\"]),n(\"xanchor\"),n(\"yanchor\"),n(\"len\"),n(\"lenmode\"),n(\"pad.t\"),n(\"pad.r\"),n(\"pad.b\"),n(\"pad.l\"),ne.coerceFont(n,\"font\",r.font),n(\"currentvalue.visible\")&&(n(\"currentvalue.xanchor\"),n(\"currentvalue.prefix\"),n(\"currentvalue.suffix\"),n(\"currentvalue.offset\"),ne.coerceFont(n,\"currentvalue.font\",e.font)),n(\"transition.duration\"),n(\"transition.easing\"),n(\"bgcolor\"),n(\"activebgcolor\"),n(\"bordercolor\"),n(\"borderwidth\"),n(\"ticklen\"),n(\"tickwidth\"),n(\"tickcolor\"),n(\"minorticklen\"))}var Xg=Qe.LINE_SPACING,Zg=Qe.FROM_TL,Jg=Qe.FROM_BR;function Kg(t){return t._index}function Qg(t,r){var n=Sr.tester.selectAll(\"g.\"+Vg.labelGroupClass).data(r.steps);n.enter().append(\"g\").classed(Vg.labelGroupClass,!0);var i=0,a=0;n.each(function(t){var n=ev(e.select(this),{step:t},r).node();if(n){var o=Sr.bBox(n);a=Math.max(a,o.height),i=Math.max(i,o.width)}}),n.remove();var o=r._dims={};o.inputAreaWidth=Math.max(Vg.railWidth,Vg.gripHeight);var s=t._fullLayout._size;o.lx=s.l+s.w*r.x,o.ly=s.t+s.h*(1-r.y),\"fraction\"===r.lenmode?o.outerLength=Math.round(s.w*r.len):o.outerLength=r.len,o.inputAreaStart=0,o.inputAreaLength=Math.round(o.outerLength-r.pad.l-r.pad.r);var l=(o.inputAreaLength-2*Vg.stepInset)/(r.steps.length-1),u=i+Vg.labelPadding;if(o.labelStride=Math.max(1,Math.ceil(u/l)),o.labelHeight=a,o.currentValueMaxWidth=0,o.currentValueHeight=0,o.currentValueTotalHeight=0,o.currentValueMaxLines=1,r.currentvalue.visible){var c=Sr.tester.append(\"g\");n.each(function(t){var e=$g(c,r,t.label),n=e.node()&&Sr.bBox(e.node())||{width:0,height:0},i=er.lineCount(e);o.currentValueMaxWidth=Math.max(o.currentValueMaxWidth,Math.ceil(n.width)),o.currentValueHeight=Math.max(o.currentValueHeight,Math.ceil(n.height)),o.currentValueMaxLines=Math.max(o.currentValueMaxLines,i)}),o.currentValueTotalHeight=o.currentValueHeight+r.currentvalue.offset,c.remove()}o.height=o.currentValueTotalHeight+Vg.tickOffset+r.ticklen+Vg.labelOffset+o.labelHeight+r.pad.t+r.pad.b;var h=\"left\";Vd.isRightAnchor(r)&&(o.lx-=o.outerLength,h=\"right\"),Vd.isCenterAnchor(r)&&(o.lx-=o.outerLength/2,h=\"center\");var f=\"top\";Vd.isBottomAnchor(r)&&(o.ly-=o.height,f=\"bottom\"),Vd.isMiddleAnchor(r)&&(o.ly-=o.height/2,f=\"middle\"),o.outerLength=Math.ceil(o.outerLength),o.height=Math.ceil(o.height),o.lx=Math.round(o.lx),o.ly=Math.round(o.ly),_n.autoMargin(t,Vg.autoMarginIdRoot+r._index,{x:r.x,y:r.y,l:o.outerLength*Zg[h],r:o.outerLength*Jg[h],b:o.height*Jg[f],t:o.height*Zg[f]})}function $g(t,e,r){if(e.currentvalue.visible){var n,i,a=t.selectAll(\"text\").data([0]),o=e._dims;switch(e.currentvalue.xanchor){case\"right\":n=o.inputAreaLength-Vg.currentValueInset-o.currentValueMaxWidth,i=\"left\";break;case\"center\":n=.5*o.inputAreaLength,i=\"middle\";break;default:n=Vg.currentValueInset,i=\"left\"}a.enter().append(\"text\").classed(Vg.labelClass,!0).classed(\"user-select-none\",!0).attr({\"text-anchor\":i,\"data-notex\":1});var s=e.currentvalue.prefix?e.currentvalue.prefix:\"\";if(\"string\"==typeof r)s+=r;else s+=e.steps[e.active].label;e.currentvalue.suffix&&(s+=e.currentvalue.suffix),a.call(Sr.font,e.currentvalue.font).text(s).call(er.convertToTspans,e._gd);var l=er.lineCount(a),u=(o.currentValueMaxLines+1-l)*e.currentvalue.font.size*Xg;return er.positionText(a,n,u),a}}function tv(t,e,r){var n=t.selectAll(\"rect.\"+Vg.gripRectClass).data([0]);n.enter().append(\"rect\").classed(Vg.gripRectClass,!0).call(av,e,t,r).style(\"pointer-events\",\"all\"),n.attr({width:Vg.gripWidth,height:Vg.gripHeight,rx:Vg.gripRadius,ry:Vg.gripRadius}).call(Oe.stroke,r.bordercolor).call(Oe.fill,r.bgcolor).style(\"stroke-width\",r.borderwidth+\"px\")}function ev(t,e,r){var n=t.selectAll(\"text\").data([0]);return n.enter().append(\"text\").classed(Vg.labelClass,!0).classed(\"user-select-none\",!0).attr({\"text-anchor\":\"middle\",\"data-notex\":1}),n.call(Sr.font,r.font).text(e.step.label).call(er.convertToTspans,r._gd),n}function rv(t,r){var n=t.selectAll(\"g.\"+Vg.labelsClass).data([0]),i=r._dims;n.enter().append(\"g\").classed(Vg.labelsClass,!0);var a=n.selectAll(\"g.\"+Vg.labelGroupClass).data(i.labelSteps);a.enter().append(\"g\").classed(Vg.labelGroupClass,!0),a.exit().remove(),a.each(function(t){var n=e.select(this);n.call(ev,t,r),Sr.setTranslate(n,lv(r,t.fraction),Vg.tickOffset+r.ticklen+r.font.size*Xg+Vg.labelOffset+i.currentValueTotalHeight)})}function nv(t,e,r,n,i){var a=Math.round(n*(r.steps.length-1));a!==r.active&&iv(t,e,r,a,!0,i)}function iv(t,e,r,n,i,a){var o=r.active;r._input.active=r.active=n;var s=r.steps[r.active];e.call(sv,r,r.active/(r.steps.length-1),a),e.call($g,r),t.emit(\"plotly_sliderchange\",{slider:r,step:r.steps[r.active],interaction:i,previousActive:o}),s&&s.method&&i&&(e._nextMethod?(e._nextMethod.step=s,e._nextMethod.doCallback=i,e._nextMethod.doTransition=a):(e._nextMethod={step:s,doCallback:i,doTransition:a},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&_n.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function av(t,r,n){var i=n.node(),a=e.select(r);function o(){return n.data()[0]}t.on(\"mousedown\",function(){var t=o();r.emit(\"plotly_sliderstart\",{slider:t});var s=n.select(\".\"+Vg.gripRectClass);e.event.stopPropagation(),e.event.preventDefault(),s.call(Oe.fill,t.activebgcolor);var l=uv(t,e.mouse(i)[0]);nv(r,n,t,l,!0),t._dragging=!0,a.on(\"mousemove\",function(){var t=o(),a=uv(t,e.mouse(i)[0]);nv(r,n,t,a,!1)}),a.on(\"mouseup\",function(){var t=o();t._dragging=!1,s.call(Oe.fill,t.bgcolor),a.on(\"mouseup\",null),a.on(\"mousemove\",null),r.emit(\"plotly_sliderend\",{slider:t,step:t.steps[t.active]})})})}function ov(t,r){var n=t.selectAll(\"rect.\"+Vg.tickRectClass).data(r.steps),i=r._dims;n.enter().append(\"rect\").classed(Vg.tickRectClass,!0),n.exit().remove(),n.attr({width:r.tickwidth+\"px\",\"shape-rendering\":\"crispEdges\"}),n.each(function(t,n){var a=n%i.labelStride==0,o=e.select(this);o.attr({height:a?r.ticklen:r.minorticklen}).call(Oe.fill,r.tickcolor),Sr.setTranslate(o,lv(r,n/(r.steps.length-1))-.5*r.tickwidth,(a?Vg.tickOffset:Vg.minorTickOffset)+i.currentValueTotalHeight)})}function sv(t,e,r,n){var i=t.select(\"rect.\"+Vg.gripRectClass),a=lv(e,r);if(!e._invokingCommand){var o=i;n&&e.transition.duration>0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr(\"transform\",\"translate(\"+(a-.5*Vg.gripWidth)+\",\"+e._dims.currentValueTotalHeight+\")\")}}function lv(t,e){var r=t._dims;return r.inputAreaStart+Vg.stepInset+(r.inputAreaLength-2*Vg.stepInset)*Math.min(1,Math.max(0,e))}function uv(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-Vg.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*Vg.stepInset-2*r.inputAreaStart)))}function cv(t,e,r){var n=t.selectAll(\"rect.\"+Vg.railTouchRectClass).data([0]),i=r._dims;n.enter().append(\"rect\").classed(Vg.railTouchRectClass,!0).call(av,e,t,r).style(\"pointer-events\",\"all\"),n.attr({width:i.inputAreaLength,height:Math.max(i.inputAreaWidth,Vg.tickOffset+r.ticklen+i.labelHeight)}).call(Oe.fill,r.bgcolor).attr(\"opacity\",0),Sr.setTranslate(n,0,i.currentValueTotalHeight)}function hv(t,e){var r=t.selectAll(\"rect.\"+Vg.railRectClass).data([0]),n=e._dims;r.enter().append(\"rect\").classed(Vg.railRectClass,!0);var i=n.inputAreaLength-2*Vg.railInset;r.attr({width:i,height:Vg.railWidth,rx:Vg.railRadius,ry:Vg.railRadius,\"shape-rendering\":\"crispEdges\"}).call(Oe.stroke,e.bordercolor).call(Oe.fill,e.bgcolor).style(\"stroke-width\",e.borderwidth+\"px\"),Sr.setTranslate(r,Vg.railInset,.5*(n.inputAreaWidth-Vg.railWidth)+n.currentValueTotalHeight)}var fv={moduleType:\"component\",name:Vg.name,layoutAttributes:Hg,supplyLayoutDefaults:function(t,e){ld(t,e,{name:Gg,handleItemDefaults:Yg})},draw:function(t){var r=t._fullLayout,n=function(t,e){for(var r=t[Vg.name],n=[],i=0;i<r.length;i++){var a=r[i];a.visible&&a.steps.length&&(a._gd=e,n.push(a))}return n}(r,t),i=r._infolayer.selectAll(\"g.\"+Vg.containerClassName).data(n.length>0?[0]:[]);if(i.enter().append(\"g\").classed(Vg.containerClassName,!0).style(\"cursor\",\"ew-resize\"),i.exit().remove(),i.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var i=r[n];-1!==i.indexOf(Vg.autoMarginIdRoot)&&_n.autoMargin(t,i)}}(t),0!==n.length){var a=i.selectAll(\"g.\"+Vg.groupClassName).data(n,Kg);a.enter().append(\"g\").classed(Vg.groupClassName,!0),a.exit().each(function(r){e.select(this).remove(),r._commandObserver.remove(),delete r._commandObserver,_n.autoMargin(t,Vg.autoMarginIdRoot+r._index)});for(var o=0;o<n.length;o++){var s=n[o];Qg(t,s)}a.each(function(r){if(!(r.steps.length<2)){var n=e.select(this);!function(t){var e=t._dims;e.labelSteps=[];for(var r=t.steps.length,n=0;n<r;n+=e.labelStride)e.labelSteps.push({fraction:n/(r-1),step:t.steps[n]})}(r),_n.manageCommandObserver(t,r,r.steps,function(e){var r=n.data()[0];r.active!==e.index&&(r._dragging||iv(t,n,r,e.index,!1,!0))}),function(t,e,r){r.active>=r.steps.length&&(r.active=0),e.call($g,r).call(hv,r).call(rv,r).call(ov,r).call(cv,t,r).call(tv,t,r);var n=r._dims;Sr.setTranslate(e,n.lx+r.pad.l,n.ly+r.pad.t),e.call(sv,r,r.active/(r.steps.length-1),!1),e.call($g,r)}(t,e.select(this),r)}})}}},pv=m.extendFlat,dv=(0,ye.overrideAll)({_isLinkedToArray:\"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:{_isLinkedToArray:\"button\",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}},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:pv({},Ug,{}),font:T({}),bgcolor:{valType:\"color\"},bordercolor:{valType:\"color\",dflt:C.borderLine},borderwidth:{valType:\"number\",min:0,dflt:1,editType:\"arraydraw\"}},\"arraydraw\",\"from-root\"),gv={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:\"\\u25c4\",right:\"\\u25ba\",up:\"\\u25b2\",down:\"\\u25bc\"}},vv=gv.name,mv=dv.buttons;function yv(t,e,r){function n(r,n){return ne.coerce(t,e,dv,r,n)}n(\"visible\",function(t,e){var r,n,i=t.buttons||[],a=e.buttons=[];function o(t,e){return ne.coerce(r,n,mv,t,e)}for(var s=0;s<i.length;s++)r=i[s],n={},o(\"method\"),ne.isPlainObject(r)&&(\"skip\"===n.method||Array.isArray(r.args))&&(o(\"args\"),o(\"label\"),o(\"execute\"),n._index=s,a.push(n));return a}(t,e).length>0)&&(n(\"active\"),n(\"direction\"),n(\"type\"),n(\"showactive\"),n(\"x\"),n(\"y\"),ne.noneOrAll(t,e,[\"x\",\"y\"]),n(\"xanchor\"),n(\"yanchor\"),n(\"pad.t\"),n(\"pad.r\"),n(\"pad.b\"),n(\"pad.l\"),ne.coerceFont(n,\"font\",r.font),n(\"bgcolor\",r.paper_bgcolor),n(\"bordercolor\"),n(\"borderwidth\"))}var xv=bv;function bv(t,e,r){this.gd=t,this.container=e,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll(\"rect.scrollbox-bg\").data([0]),this.bg.exit().on(\".drag\",null).on(\"wheel\",null).remove(),this.bg.enter().append(\"rect\").classed(\"scrollbox-bg\",!0).style(\"pointer-events\",\"all\").attr({opacity:0,x:0,y:0,width:0,height:0})}bv.barWidth=2,bv.barLength=20,bv.barRadius=2,bv.barPad=1,bv.barColor=\"#808BA4\",bv.prototype.enable=function(t,r,n){var i=this.gd._fullLayout,a=i.width,o=i.height;this.position=t;var s,l,u,c,h=this.position.l,f=this.position.w,p=this.position.t,d=this.position.h,g=this.position.direction,v=\"down\"===g,m=\"left\"===g,y=\"up\"===g,x=f,b=d;v||m||\"right\"===g||y||(this.position.direction=\"down\",v=!0),v||y?(l=(s=h)+x,v?(u=p,b=(c=Math.min(u+b,o))-u):b=(c=p+b)-(u=Math.max(c-b,0))):(c=(u=p)+b,m?x=(l=h+x)-(s=Math.max(l-x,0)):(s=h,x=(l=Math.min(s+x,a))-s)),this._box={l:s,t:u,w:x,h:b};var _=f>x,w=bv.barLength+2*bv.barPad,M=bv.barWidth+2*bv.barPad,A=h,k=p+d;k+M>o&&(k=o-M);var T=this.container.selectAll(\"rect.scrollbar-horizontal\").data(_?[0]:[]);T.exit().on(\".drag\",null).remove(),T.enter().append(\"rect\").classed(\"scrollbar-horizontal\",!0).call(Oe.fill,bv.barColor),_?(this.hbar=T.attr({rx:bv.barRadius,ry:bv.barRadius,x:A,y:k,width:w,height:M}),this._hbarXMin=A+w/2,this._hbarTranslateMax=x-w):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var S=d>b,E=bv.barWidth+2*bv.barPad,C=bv.barLength+2*bv.barPad,L=h+f,z=p;L+E>a&&(L=a-E);var P=this.container.selectAll(\"rect.scrollbar-vertical\").data(S?[0]:[]);P.exit().on(\".drag\",null).remove(),P.enter().append(\"rect\").classed(\"scrollbar-vertical\",!0).call(Oe.fill,bv.barColor),S?(this.vbar=P.attr({rx:bv.barRadius,ry:bv.barRadius,x:L,y:z,width:E,height:C}),this._vbarYMin=z+C/2,this._vbarTranslateMax=b-C):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var I=this.id,D=s-.5,O=S?l+E+.5:l+.5,R=u-.5,F=_?c+M+.5:c+.5,B=i._topdefs.selectAll(\"#\"+I).data(_||S?[0]:[]);if(B.exit().remove(),B.enter().append(\"clipPath\").attr(\"id\",I).append(\"rect\"),_||S?(this._clipRect=B.select(\"rect\").attr({x:Math.floor(D),y:Math.floor(R),width:Math.ceil(O)-Math.floor(D),height:Math.ceil(F)-Math.floor(R)}),this.container.call(Sr.setClipUrl,I),this.bg.attr({x:h,y:p,width:f,height:d})):(this.bg.attr({width:0,height:0}),this.container.on(\"wheel\",null).on(\".drag\",null).call(Sr.setClipUrl,null),delete this._clipRect),_||S){var N=e.behavior.drag().on(\"dragstart\",function(){e.event.sourceEvent.preventDefault()}).on(\"drag\",this._onBoxDrag.bind(this));this.container.on(\"wheel\",null).on(\"wheel\",this._onBoxWheel.bind(this)).on(\".drag\",null).call(N);var j=e.behavior.drag().on(\"dragstart\",function(){e.event.sourceEvent.preventDefault(),e.event.sourceEvent.stopPropagation()}).on(\"drag\",this._onBarDrag.bind(this));_&&this.hbar.on(\".drag\",null).call(j),S&&this.vbar.on(\".drag\",null).call(j)}this.setTranslate(r,n)},bv.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on(\"wheel\",null).on(\".drag\",null).call(Sr.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)},bv.prototype._onBoxDrag=function(){var t=this.translateX,r=this.translateY;this.hbar&&(t-=e.event.dx),this.vbar&&(r-=e.event.dy),this.setTranslate(t,r)},bv.prototype._onBoxWheel=function(){var t=this.translateX,r=this.translateY;this.hbar&&(t+=e.event.deltaY),this.vbar&&(r+=e.event.deltaY),this.setTranslate(t,r)},bv.prototype._onBarDrag=function(){var t=this.translateX,r=this.translateY;if(this.hbar){var n=t+this._hbarXMin,i=n+this._hbarTranslateMax;t=(ne.constrain(e.event.x,n,i)-n)/(i-n)*(this.position.w-this._box.w)}if(this.vbar){var a=r+this._vbarYMin,o=a+this._vbarTranslateMax;r=(ne.constrain(e.event.y,a,o)-a)/(o-a)*(this.position.h-this._box.h)}this.setTranslate(t,r)},bv.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=ne.constrain(t||0,0,r),e=ne.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(Sr.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(Sr.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var a=e/n;this.vbar.call(Sr.setTranslate,t,e+a*this._vbarTranslateMax)}};var _v=Qe.LINE_SPACING;function wv(t){return t._index}function Mv(t,e){return+t.attr(gv.menuIndexAttrName)===e._index}function Av(t,e,r,n,i,a,o,s){e._input.active=e.active=o,\"buttons\"===e.type?Tv(t,n,null,null,e):\"dropdown\"===e.type&&(i.attr(gv.menuIndexAttrName,\"-1\"),kv(t,n,i,a,e),s||Tv(t,n,i,a,e))}function kv(t,e,r,n,i){var a=e.selectAll(\"g.\"+gv.headerClassName).data([0]),o=i._dims;a.enter().append(\"g\").classed(gv.headerClassName,!0).style(\"pointer-events\",\"all\");var s=i.active,l=i.buttons[s]||gv.blankHeaderOpts,u={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},c={width:o.headerWidth,height:o.headerHeight};a.call(Sv,i,l,t).call(Dv,i,u,c);var h=e.selectAll(\"text.\"+gv.headerArrowClassName).data([0]);h.enter().append(\"text\").classed(gv.headerArrowClassName,!0).classed(\"user-select-none\",!0).attr(\"text-anchor\",\"end\").call(Sr.font,i.font).text(gv.arrowSymbol[i.direction]),h.attr({x:o.headerWidth-gv.arrowOffsetX+i.pad.l,y:o.headerHeight/2+gv.textOffsetY+i.pad.t}),a.on(\"click\",function(){r.call(Ov),r.attr(gv.menuIndexAttrName,Mv(r,i)?-1:String(i._index)),Tv(t,e,r,n,i)}),a.on(\"mouseover\",function(){a.call(zv)}),a.on(\"mouseout\",function(){a.call(Pv,i)}),Sr.setTranslate(e,o.lx,o.ly)}function Tv(t,r,n,i,a){n||(n=r).attr(\"pointer-events\",\"all\");var o=function(t){return-1==+t.attr(gv.menuIndexAttrName)}(n)&&\"buttons\"!==a.type?[]:a.buttons,s=\"dropdown\"===a.type?gv.dropdownButtonClassName:gv.buttonClassName,l=n.selectAll(\"g.\"+s).data(o),u=l.enter().append(\"g\").classed(s,!0),c=l.exit();\"dropdown\"===a.type?(u.attr(\"opacity\",\"0\").transition().attr(\"opacity\",\"1\"),c.transition().attr(\"opacity\",\"0\").remove()):c.remove();var h=0,f=0,p=a._dims,d=-1!==[\"up\",\"down\"].indexOf(a.direction);\"dropdown\"===a.type&&(d?f=p.headerHeight+gv.gapButtonHeader:h=p.headerWidth+gv.gapButtonHeader),\"dropdown\"===a.type&&\"up\"===a.direction&&(f=-gv.gapButtonHeader+gv.gapButton-p.openHeight),\"dropdown\"===a.type&&\"left\"===a.direction&&(h=-gv.gapButtonHeader+gv.gapButton-p.openWidth);var g={x:p.lx+h+a.pad.l,y:p.ly+f+a.pad.t,yPad:gv.gapButton,xPad:gv.gapButton,index:0},v={l:g.x+a.borderwidth,t:g.y+a.borderwidth};l.each(function(o,s){var u=e.select(this);u.call(Sv,a,o,t).call(Dv,a,g),u.on(\"click\",function(){e.event.defaultPrevented||(Av(t,a,0,r,n,i,s),o.execute&&_n.executeAPICommand(t,o.method,o.args),t.emit(\"plotly_buttonclicked\",{menu:a,button:o,active:a.active}))}),u.on(\"mouseover\",function(){u.call(zv)}),u.on(\"mouseout\",function(){u.call(Pv,a),l.call(Lv,a)})}),l.call(Lv,a),d?(v.w=Math.max(p.openWidth,p.headerWidth),v.h=g.y-v.t):(v.w=g.x-v.l,v.h=Math.max(p.openHeight,p.headerHeight)),v.direction=a.direction,i&&(l.size()?function(t,e,r,n,i,a){var o,s,l,u=i.direction,c=\"up\"===u||\"down\"===u,h=i._dims,f=i.active;if(c)for(s=0,l=0;l<f;l++)s+=h.heights[l]+gv.gapButton;else for(o=0,l=0;l<f;l++)o+=h.widths[l]+gv.gapButton;n.enable(a,o,s),n.hbar&&n.hbar.attr(\"opacity\",\"0\").transition().attr(\"opacity\",\"1\");n.vbar&&n.vbar.attr(\"opacity\",\"0\").transition().attr(\"opacity\",\"1\")}(0,0,0,i,a,v):function(t){var e=!!t.hbar,r=!!t.vbar;e&&t.hbar.transition().attr(\"opacity\",\"0\").each(\"end\",function(){e=!1,r||t.disable()});r&&t.vbar.transition().attr(\"opacity\",\"0\").each(\"end\",function(){r=!1,e||t.disable()})}(i))}function Sv(t,e,r,n){t.call(Ev,e).call(Cv,e,r,n)}function Ev(t,e){var r=t.selectAll(\"rect\").data([0]);r.enter().append(\"rect\").classed(gv.itemRectClassName,!0).attr({rx:gv.rx,ry:gv.ry,\"shape-rendering\":\"crispEdges\"}),r.call(Oe.stroke,e.bordercolor).call(Oe.fill,e.bgcolor).style(\"stroke-width\",e.borderwidth+\"px\")}function Cv(t,e,r,n){var i=t.selectAll(\"text\").data([0]);i.enter().append(\"text\").classed(gv.itemTextClassName,!0).classed(\"user-select-none\",!0).attr({\"text-anchor\":\"start\",\"data-notex\":1}),i.call(Sr.font,e.font).text(r.label).call(er.convertToTspans,n)}function Lv(t,r){var n=r.active;t.each(function(t,i){var a=e.select(this);i===n&&r.showactive&&a.select(\"rect.\"+gv.itemRectClassName).call(Oe.fill,gv.activeColor)})}function zv(t){t.select(\"rect.\"+gv.itemRectClassName).call(Oe.fill,gv.hoverColor)}function Pv(t,e){t.select(\"rect.\"+gv.itemRectClassName).call(Oe.fill,e.bgcolor)}function Iv(t,r){var n=r._dims={width1:0,height1:0,heights:[],widths:[],totalWidth:0,totalHeight:0,openWidth:0,openHeight:0,lx:0,ly:0},i=Sr.tester.selectAll(\"g.\"+gv.dropdownButtonClassName).data(r.buttons);i.enter().append(\"g\").classed(gv.dropdownButtonClassName,!0);var a=-1!==[\"up\",\"down\"].indexOf(r.direction);i.each(function(i,o){var s=e.select(this);s.call(Sv,r,i,t);var l=s.select(\".\"+gv.itemTextClassName),u=l.node()&&Sr.bBox(l.node()).width,c=Math.max(u+gv.textPadX,gv.minWidth),h=r.font.size*_v,f=er.lineCount(l),p=Math.max(h*f,gv.minHeight)+gv.textOffsetY;p=Math.ceil(p),c=Math.ceil(c),n.widths[o]=c,n.heights[o]=p,n.height1=Math.max(n.height1,p),n.width1=Math.max(n.width1,c),a?(n.totalWidth=Math.max(n.totalWidth,c),n.openWidth=n.totalWidth,n.totalHeight+=p+gv.gapButton,n.openHeight+=p+gv.gapButton):(n.totalWidth+=c+gv.gapButton,n.openWidth+=c+gv.gapButton,n.totalHeight=Math.max(n.totalHeight,p),n.openHeight=n.totalHeight)}),a?n.totalHeight-=gv.gapButton:n.totalWidth-=gv.gapButton,n.headerWidth=n.width1+gv.arrowPadX,n.headerHeight=n.height1,\"dropdown\"===r.type&&(a?(n.width1+=gv.arrowPadX,n.totalHeight=n.height1):n.totalWidth=n.width1,n.totalWidth+=gv.arrowPadX),i.remove();var o=n.totalWidth+r.pad.l+r.pad.r,s=n.totalHeight+r.pad.t+r.pad.b,l=t._fullLayout._size;n.lx=l.l+l.w*r.x,n.ly=l.t+l.h*(1-r.y);var u=\"left\";Vd.isRightAnchor(r)&&(n.lx-=o,u=\"right\"),Vd.isCenterAnchor(r)&&(n.lx-=o/2,u=\"center\");var c=\"top\";Vd.isBottomAnchor(r)&&(n.ly-=s,c=\"bottom\"),Vd.isMiddleAnchor(r)&&(n.ly-=s/2,c=\"middle\"),n.totalWidth=Math.ceil(n.totalWidth),n.totalHeight=Math.ceil(n.totalHeight),n.lx=Math.round(n.lx),n.ly=Math.round(n.ly),_n.autoMargin(t,gv.autoMarginIdRoot+r._index,{x:r.x,y:r.y,l:o*({right:1,center:.5}[u]||0),r:o*({left:1,center:.5}[u]||0),b:s*({top:1,middle:.5}[c]||0),t:s*({bottom:1,middle:.5}[c]||0)})}function Dv(t,e,r,n){n=n||{};var i=t.select(\".\"+gv.itemRectClassName),a=t.select(\".\"+gv.itemTextClassName),o=e.borderwidth,s=r.index,l=e._dims;Sr.setTranslate(t,o+r.x,o+r.y);var u=-1!==[\"up\",\"down\"].indexOf(e.direction),c=n.height||(u?l.heights[s]:l.height1);i.attr({x:0,y:0,width:n.width||(u?l.width1:l.widths[s]),height:c});var h=e.font.size*_v,f=(er.lineCount(a)-1)*h/2;er.positionText(a,gv.textOffsetX,c/2-f+gv.textOffsetY),u?r.y+=l.heights[s]+r.yPad:r.x+=l.widths[s]+r.xPad,r.index++}function Ov(t){t.selectAll(\"g.\"+gv.dropdownButtonClassName).remove()}var Rv={moduleType:\"component\",name:gv.name,layoutAttributes:dv,supplyLayoutDefaults:function(t,e){ld(t,e,{name:vv,handleItemDefaults:yv})},draw:function(t){var r=t._fullLayout,n=function(t){for(var e=t[gv.name],r=[],n=0;n<e.length;n++){var i=e[n];i.visible&&r.push(i)}return r}(r),i=r._menulayer.selectAll(\"g.\"+gv.containerClassName).data(n.length>0?[0]:[]);if(i.enter().append(\"g\").classed(gv.containerClassName,!0).style(\"cursor\",\"pointer\"),i.exit().remove(),i.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var i=r[n];-1!==i.indexOf(gv.autoMarginIdRoot)&&_n.autoMargin(t,i)}}(t),0!==n.length){var a=i.selectAll(\"g.\"+gv.headerGroupClassName).data(n,wv);a.enter().append(\"g\").classed(gv.headerGroupClassName,!0);var o=i.selectAll(\"g.\"+gv.dropdownButtonGroupClassName).data([0]);o.enter().append(\"g\").classed(gv.dropdownButtonGroupClassName,!0).style(\"pointer-events\",\"all\");for(var s=0;s<n.length;s++){var l=n[s];Iv(t,l)}var u=\"updatemenus\"+r._uid,c=new xv(t,o,u);a.enter().size()&&(o.node().parentNode.appendChild(o.node()),o.call(Ov).attr(gv.menuIndexAttrName,\"-1\")),a.exit().each(function(r){e.select(this).remove(),o.call(Ov).attr(gv.menuIndexAttrName,\"-1\"),_n.autoMargin(t,gv.autoMarginIdRoot+r._index)}),a.each(function(r){var n=e.select(this),i=\"dropdown\"===r.type?o:null;_n.manageCommandObserver(t,r,r.buttons,function(e){Av(t,r,r.buttons[e.index],n,i,c,e.index,!0)}),\"dropdown\"===r.type?(kv(t,n,o,c,r),Mv(o,r)&&Tv(t,n,o,c,r)):Tv(t,n,null,null,r)})}}},Fv={};\"undefined\"!=typeof MathJax?(Fv.MathJax=!0,MathJax.Hub.Config({messageStyle:\"none\",skipStartupTypeset:!0,displayAlign:\"left\",tex2jax:{inlineMath:[[\"$\",\"$\"],[\"\\\\(\",\"\\\\)\"]]}}),MathJax.Hub.Configured()):Fv.MathJax=!1;var Bv={add:function(t,e,r,n,i){var a,o;t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},o=t.undoQueue.index,t.autoplay?t.undoQueue.inSequence||(t.autoplay=!1):(!t.undoQueue.sequence||t.undoQueue.beginSequence?(a={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(o,t.undoQueue.queue.length-o,a),t.undoQueue.index+=1):a=t.undoQueue.queue[o-1],t.undoQueue.beginSequence=!1,a&&(a.undo.calls.unshift(e),a.undo.args.unshift(r),a.redo.calls.push(n),a.redo.args.push(i)),t.undoQueue.queue.length>b.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<e.undo.calls.length;r++)Bv.plotDo(t,e.undo.calls[r],e.undo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1}},redo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.redo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index>=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.redo.calls.length;r++)Bv.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}}};Bv.plotDo=function(t,e,r){t.autoplay=!0,r=function(t,e){for(var r,n=[],i=0;i<e.length;i++)r=e[i],n[i]=r===t?r:\"object\"==typeof r?Array.isArray(r)?ne.extendDeep([],r):ne.extendDeepAll({},r):r;return n}(t,r),e.apply(null,r)};var Nv=Bv,jv=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,u=r*o,c=n*o,h=n*s,f=i*o,p=i*s,d=i*l,g=a*o,v=a*s,m=a*l;return t[0]=1-h-d,t[1]=c+m,t[2]=f-v,t[3]=0,t[4]=c-m,t[5]=1-u-d,t[6]=p+g,t[7]=0,t[8]=f+v,t[9]=p-g,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};var Vv={},Uv=gn.cleanId,qv=gn.getFromTrace;function Hv(t,e){var r=t[e],n=e.charAt(0);r&&\"paper\"!==r&&(t[e]=Uv(r,n))}function Gv(t){var e=\"middle\",r=\"center\";return-1!==t.indexOf(\"top\")?e=\"top\":-1!==t.indexOf(\"bottom\")&&(e=\"bottom\"),-1!==t.indexOf(\"left\")?r=\"left\":-1!==t.indexOf(\"right\")&&(r=\"right\"),e+\" \"+r}function Wv(t,e){return e in t&&\"object\"==typeof t[e]&&0===Object.keys(t[e]).length}Vv.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&ne.log(\"Clearing previous rejected promises from queue.\"),t._promises=[]},Vv.cleanLayout=function(t){var e,r;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 n=(_n.subplotsRegistry.cartesian||{}).attrRegex,i=(_n.subplotsRegistry.gl3d||{}).attrRegex,a=Object.keys(t);for(e=0;e<a.length;e++){var o=a[e];if(n&&n.test(o)){var s=t[o];s.anchor&&\"free\"!==s.anchor&&(s.anchor=Uv(s.anchor)),s.overlaying&&(s.overlaying=Uv(s.overlaying)),s.type||(s.isdate?s.type=\"date\":s.islog?s.type=\"log\":!1===s.isdate&&!1===s.islog&&(s.type=\"linear\")),\"withzero\"!==s.autorange&&\"tozero\"!==s.autorange||(s.autorange=!0,s.rangemode=\"tozero\"),delete s.islog,delete s.isdate,delete s.categories,Wv(s,\"domain\")&&delete s.domain,void 0!==s.autotick&&(void 0===s.tickmode&&(s.tickmode=s.autotick?\"auto\":\"linear\"),delete s.autotick)}else if(i&&i.test(o)){var l=t[o],u=l.cameraposition;if(Array.isArray(u)&&4===u[0].length){var c=u[0],h=u[1],f=u[2],p=jv([],c),d=[];for(r=0;r<3;++r)d[r]=h[r]+f*p[2+4*r];l.camera={eye:{x:d[0],y:d[1],z:d[2]},center:{x:h[0],y:h[1],z:h[2]},up:{x:p[1],y:p[5],z:p[9]}},delete l.cameraposition}}}var g=Array.isArray(t.annotations)?t.annotations.length:0;for(e=0;e<g;e++){var v=t.annotations[e];ne.isPlainObject(v)&&(v.ref&&(\"paper\"===v.ref?(v.xref=\"paper\",v.yref=\"paper\"):\"data\"===v.ref&&(v.xref=\"x\",v.yref=\"y\"),delete v.ref),Hv(v,\"xref\"),Hv(v,\"yref\"))}var m=Array.isArray(t.shapes)?t.shapes.length:0;for(e=0;e<m;e++){var y=t.shapes[e];ne.isPlainObject(y)&&(Hv(y,\"xref\"),Hv(y,\"yref\"))}var x=t.legend;return x&&(x.x>3?(x.x=1.02,x.xanchor=\"left\"):x.x<-2&&(x.x=-.02,x.xanchor=\"right\"),x.y>3?(x.y=1.02,x.yanchor=\"bottom\"):x.y<-2&&(x.y=-.02,x.yanchor=\"top\")),\"rotate\"===t.dragmode&&(t.dragmode=\"orbit\"),Oe.clean(t),t},Vv.cleanData=function(t,e){for(var r=[],n=t.concat(Array.isArray(e)?e:[]).filter(function(t){return\"uid\"in t}).map(function(t){return t.uid}),i=0;i<t.length;i++){var a,o=t[i];if(!(\"uid\"in o)||-1!==r.indexOf(o.uid)){var s;for(a=0;a<100&&(s=ne.randstr(n),-1!==r.indexOf(s));a++);o.uid=ne.randstr(n),n.push(o.uid)}if(r.push(o.uid),\"histogramy\"===o.type&&\"xbins\"in o&&!(\"ybins\"in o)&&(o.ybins=o.xbins,delete o.xbins),o.error_y&&\"opacity\"in o.error_y){var l=Oe.defaults,u=o.error_y.color||(P.traceIs(o,\"bar\")?Oe.defaultLine:l[i%l.length]);o.error_y.color=Oe.addOpacity(Oe.rgb(u),Oe.opacity(u)*o.error_y.opacity),delete o.error_y.opacity}if(\"bardir\"in o&&(\"h\"!==o.bardir||!P.traceIs(o,\"bar\")&&\"histogram\"!==o.type.substr(0,9)||(o.orientation=\"h\",Vv.swapXYData(o)),delete o.bardir),\"histogramy\"===o.type&&Vv.swapXYData(o),\"histogramx\"!==o.type&&\"histogramy\"!==o.type||(o.type=\"histogram\"),\"scl\"in o&&(o.colorscale=o.scl,delete o.scl),\"reversescl\"in o&&(o.reversescale=o.reversescl,delete o.reversescl),o.xaxis&&(o.xaxis=Uv(o.xaxis,\"x\")),o.yaxis&&(o.yaxis=Uv(o.yaxis,\"y\")),P.traceIs(o,\"gl3d\")&&o.scene&&(o.scene=_n.subplotsRegistry.gl3d.cleanId(o.scene)),!P.traceIs(o,\"pie\")&&!P.traceIs(o,\"bar\"))if(Array.isArray(o.textposition))for(a=0;a<o.textposition.length;a++)o.textposition[a]=Gv(o.textposition[a]);else o.textposition&&(o.textposition=Gv(o.textposition));if(P.traceIs(o,\"2dMap\")&&(\"YIGnBu\"===o.colorscale&&(o.colorscale=\"YlGnBu\"),\"YIOrRd\"===o.colorscale&&(o.colorscale=\"YlOrRd\")),P.traceIs(o,\"markerColorscale\")&&o.marker){var c=o.marker;\"YIGnBu\"===c.colorscale&&(c.colorscale=\"YlGnBu\"),\"YIOrRd\"===c.colorscale&&(c.colorscale=\"YlOrRd\")}if(\"surface\"===o.type&&ne.isPlainObject(o.contours)){var h=[\"x\",\"y\",\"z\"];for(a=0;a<h.length;a++){var f=o.contours[h[a]];ne.isPlainObject(f)&&(f.highlightColor&&(f.highlightcolor=f.highlightColor,delete f.highlightColor),f.highlightWidth&&(f.highlightwidth=f.highlightWidth,delete f.highlightWidth))}}if(Array.isArray(o.transforms)){var p=o.transforms;for(a=0;a<p.length;a++){var d=p[a];if(ne.isPlainObject(d))switch(d.type){case\"filter\":d.filtersrc&&(d.target=d.filtersrc,delete d.filtersrc),d.calendar&&(d.valuecalendar||(d.valuecalendar=d.calendar),delete d.calendar);break;case\"groupby\":if(d.styles=d.styles||d.style,d.styles&&!Array.isArray(d.styles)){var g=d.styles,v=Object.keys(g);d.styles=[];for(var m=0;m<v.length;m++)d.styles.push({target:v[m],value:g[v[m]]})}}}}Wv(o,\"line\")&&delete o.line,\"marker\"in o&&(Wv(o.marker,\"line\")&&delete o.marker.line,Wv(o,\"marker\")&&delete o.marker),Oe.clean(o)}},Vv.swapXYData=function(t){var e;if(ne.swapAttrs(t,[\"?\",\"?0\",\"d?\",\"?bins\",\"nbins?\",\"autobin?\",\"?src\",\"error_?\"]),Array.isArray(t.z)&&Array.isArray(t.z[0])&&(t.transpose?delete t.transpose:t.transpose=!0),t.error_x&&t.error_y){var r=t.error_y,n=\"copy_ystyle\"in r?r.copy_ystyle:!(r.color||r.thickness||r.width);ne.swapAttrs(t,[\"error_?.copy_ystyle\"]),n&&ne.swapAttrs(t,[\"error_?.color\",\"error_?.thickness\",\"error_?.width\"])}if(\"string\"==typeof t.hoverinfo){var i=t.hoverinfo.split(\"+\");for(e=0;e<i.length;e++)\"x\"===i[e]?i[e]=\"y\":\"y\"===i[e]&&(i[e]=\"x\");t.hoverinfo=i.join(\"+\")}},Vv.coerceTraceIndices=function(t,e){return r(e)?[e]:Array.isArray(e)&&e.length?e:t.data.map(function(t,e){return e})},Vv.manageArrayContainers=function(t,e,n){var i=t.obj,a=t.parts,o=a.length,s=a[o-1],l=r(s);if(l&&null===e){var u=a.slice(0,o-1).join(\".\");ne.nestedProperty(i,u).get().splice(s,1)}else l&&void 0===t.get()?(void 0===t.get()&&(n[t.astr]=null),t.set(e)):t.set(e)};var Yv=/(\\.[^\\[\\]\\.]+|\\[[^\\[\\]\\.]+\\])$/;function Xv(t){var e=t.search(Yv);if(e>0)return t.substr(0,e)}Vv.hasParent=function(t,e){for(var r=Xv(e);r;){if(r in t)return!0;r=Xv(r)}return!1};var Zv=[\"x\",\"y\",\"z\"];Vv.clearAxisTypes=function(t,e,r){for(var n=0;n<e.length;n++)for(var i=t._fullData[n],a=0;a<3;a++){var o=qv(t,i,Zv[a]);if(o&&\"log\"!==o.type){var s=o._name,l=o._id.substr(1);if(\"scene\"===l.substr(0,5)){if(void 0!==r[l])continue;s=l+\".\"+s}var u=s+\".type\";void 0===r[s]&&void 0===r[u]&&ne.nestedProperty(t.layout,u).set(null)}}},Vv.clearAxisAutomargins=function(t){for(var e=Object.keys(t._fullLayout._pushmargin),r=0;r<e.length;r++)-1!==e[r].indexOf(\"automargin\")&&delete t._fullLayout._pushmargin[e[r]]};var Jv={},Kv=Wt.sorterAsc;Jv.containerArrayMatch=H;var Qv=Jv.isAddVal=function(t){return\"add\"===t||v(t)},$v=Jv.isRemoveVal=function(t){return null===t||\"remove\"===t};Jv.applyContainerArrayChanges=function(t,e,r,n){var i=e.astr,a=P.getComponentMethod(i,\"supplyLayoutDefaults\"),o=P.getComponentMethod(i,\"draw\"),s=P.getComponentMethod(i,\"drawOne\"),l=n.replot||n.recalc||a===A||o===A,u=t.layout,c=t._fullLayout;if(r[\"\"]){Object.keys(r).length>1&&_.warn(\"Full array edits are incompatible with other edits\",i);var h=r[\"\"][\"\"];if($v(h))e.set(null);else{if(!Array.isArray(h))return _.warn(\"Unrecognized full array edit value\",i,h),!0;e.set(h)}return!l&&(a(u,c),o(t),!0)}var f,p,d,g,v,m,y,x=Object.keys(r).map(Number).sort(Kv),b=e.get(),w=b||[],M=W(c,i).get(),k=[],T=-1,S=w.length;for(f=0;f<x.length;f++)if(g=r[d=x[f]],v=Object.keys(g),m=g[\"\"],y=Qv(m),d<0||d>w.length-(y?0:1))_.warn(\"index out of range\",i,d);else if(void 0!==m)v.length>1&&_.warn(\"Insertion & removal are incompatible with edits to the same index.\",i,d),$v(m)?k.push(d):y?(\"add\"===m&&(m={}),w.splice(d,0,m),M&&M.splice(d,0,{})):_.warn(\"Unrecognized full object edit value\",i,d,m),-1===T&&(T=d);else for(p=0;p<v.length;p++)W(w[d],v[p]).set(g[v[p]]);for(f=k.length-1;f>=0;f--)w.splice(k[f],1),M&&M.splice(k[f],1);if(w.length?b||e.set(w):e.set(null),l)return!1;if(a(u,c),s!==A){var E;if(-1===T)E=x;else{for(S=Math.max(w.length,S),E=[],f=0;f<x.length&&!((d=x[f])>=T);f++)E.push(d);for(f=T;f<S;f++)E.push(f)}for(f=0;f<E.length;f++)s(t,E[f])}else o(t);return!0};var tm={},em=ne._,rm=tm={};function nm(t,e){var r,n,i=e.currentTarget,a=i.getAttribute(\"data-attr\"),o=i.getAttribute(\"data-val\")||!0,s=t._fullLayout,l={},u=gn.list(t,null,!0),c=\"on\";if(\"zoom\"===a){var h,f=\"in\"===o?.5:2,p=(1+f)/2,d=(1-f)/2;for(n=0;n<u.length;n++)if(!(r=u[n]).fixedrange)if(h=r._name,\"auto\"===o)l[h+\".autorange\"]=!0;else if(\"reset\"===o){if(void 0===r._rangeInitial)l[h+\".autorange\"]=!0;else{var g=r._rangeInitial.slice();l[h+\".range[0]\"]=g[0],l[h+\".range[1]\"]=g[1]}void 0!==r._showSpikeInitial&&(l[h+\".showspikes\"]=r._showSpikeInitial,\"on\"!==c||r._showSpikeInitial||(c=\"off\"))}else{var v=[r.r2l(r.range[0]),r.r2l(r.range[1])],m=[p*v[0]+d*v[1],p*v[1]+d*v[0]];l[h+\".range[0]\"]=r.l2r(m[0]),l[h+\".range[1]\"]=r.l2r(m[1])}s._cartesianSpikesEnabled=c}else{if(\"hovermode\"!==a||\"x\"!==o&&\"y\"!==o){if(\"hovermode\"===a&&\"closest\"===o){for(n=0;n<u.length;n++)r=u[n],\"on\"!==c||r.showspikes||(c=\"off\");s._cartesianSpikesEnabled=c}}else o=s._isHoriz?\"y\":\"x\",i.setAttribute(\"data-val\",o);l[a]=o}P.call(\"relayout\",t,l)}function im(t,e){for(var r=e.currentTarget,n=r.getAttribute(\"data-attr\"),i=r.getAttribute(\"data-val\")||!0,a=t._fullLayout._subplots.gl3d,o={},s=n.split(\".\"),l=0;l<a.length;l++)o[a[l]+\".\"+s[1]]=i;var u=\"pan\"===i?i:\"zoom\";o.dragmode=u,P.call(\"relayout\",t,o)}function am(t,e){for(var r=e.currentTarget.getAttribute(\"data-attr\"),n=t._fullLayout,i=n._subplots.gl3d,a={},o=0;o<i.length;o++){var s=i[o],l=s+\".camera\",u=n[s]._scene;\"resetDefault\"===r?a[l]=null:\"resetLastSave\"===r&&(a[l]=ne.extendDeep({},u.cameraInitial))}P.call(\"relayout\",t,a)}function om(t,e){var r=e.currentTarget,n=r._previousVal||!1,i=t.layout,a=t._fullLayout,o=a._subplots.gl3d,s=[\"xaxis\",\"yaxis\",\"zaxis\"],l=[\"showspikes\",\"spikesides\",\"spikethickness\",\"spikecolor\"],u={},c={},h={};if(n)h=ne.extendDeep(i,n),r._previousVal=null;else{h={\"allaxes.showspikes\":!1};for(var f=0;f<o.length;f++){var p=o[f],d=a[p],g=u[p]={};g.hovermode=d.hovermode,h[p+\".hovermode\"]=!1;for(var v=0;v<3;v++){var m=s[v];c=g[m]={};for(var y=0;y<l.length;y++){var x=l[y];c[x]=d[m][x]}}}r._previousVal=ne.extendDeep({},u)}P.call(\"relayout\",t,h)}function sm(t,e){for(var r=e.currentTarget,n=r.getAttribute(\"data-attr\"),i=r.getAttribute(\"data-val\")||!0,a=t._fullLayout,o=a._subplots.geo,s=0;s<o.length;s++){var l=o[s],u=a[l];if(\"zoom\"===n){var c=u.projection.scale,h=\"in\"===i?2*c:.5*c;P.call(\"relayout\",t,l+\".projection.scale\",h)}else\"reset\"===n&&um(t,\"geo\")}}function lm(t){var e,r=t._fullLayout;e=r._has(\"cartesian\")?r._isHoriz?\"y\":\"x\":\"closest\";var n=!t._fullLayout.hovermode&&e;P.call(\"relayout\",t,\"hovermode\",n)}function um(t,e){for(var r=t._fullLayout,n=r._subplots[e],i={},a=0;a<n.length;a++)for(var o=n[a],s=r[o]._subplot.viewInitial,l=Object.keys(s),u=0;u<l.length;u++){var c=l[u];i[o+\".\"+c]=s[c]}P.call(\"relayout\",t,i)}function cm(t){this.container=t.container,this.element=document.createElement(\"div\"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}rm.toImage={name:\"toImage\",title:function(t){return em(t,\"Download plot as a png\")},icon:Op.camera,click:function(t){var e=\"png\";ne.notifier(em(t,\"Taking snapshot - this may take a few seconds\"),\"long\"),ne.isIE()&&(ne.notifier(em(t,\"IE only supports svg. Changing format to svg.\"),\"long\"),e=\"svg\"),P.call(\"downloadImage\",t,{format:e}).then(function(e){ne.notifier(em(t,\"Snapshot succeeded\")+\" - \"+e,\"long\")}).catch(function(){ne.notifier(em(t,\"Sorry, there was a problem downloading your snapshot!\"),\"long\")})}},rm.sendDataToCloud={name:\"sendDataToCloud\",title:function(t){return em(t,\"Edit in Chart Studio\")},icon:Op.disk,click:function(t){_n.sendDataToCloud(t)}},rm.zoom2d={name:\"zoom2d\",title:function(t){return em(t,\"Zoom\")},attr:\"dragmode\",val:\"zoom\",icon:Op.zoombox,click:nm},rm.pan2d={name:\"pan2d\",title:function(t){return em(t,\"Pan\")},attr:\"dragmode\",val:\"pan\",icon:Op.pan,click:nm},rm.select2d={name:\"select2d\",title:function(t){return em(t,\"Box Select\")},attr:\"dragmode\",val:\"select\",icon:Op.selectbox,click:nm},rm.lasso2d={name:\"lasso2d\",title:function(t){return em(t,\"Lasso Select\")},attr:\"dragmode\",val:\"lasso\",icon:Op.lasso,click:nm},rm.zoomIn2d={name:\"zoomIn2d\",title:function(t){return em(t,\"Zoom in\")},attr:\"zoom\",val:\"in\",icon:Op.zoom_plus,click:nm},rm.zoomOut2d={name:\"zoomOut2d\",title:function(t){return em(t,\"Zoom out\")},attr:\"zoom\",val:\"out\",icon:Op.zoom_minus,click:nm},rm.autoScale2d={name:\"autoScale2d\",title:function(t){return em(t,\"Autoscale\")},attr:\"zoom\",val:\"auto\",icon:Op.autoscale,click:nm},rm.resetScale2d={name:\"resetScale2d\",title:function(t){return em(t,\"Reset axes\")},attr:\"zoom\",val:\"reset\",icon:Op.home,click:nm},rm.hoverClosestCartesian={name:\"hoverClosestCartesian\",title:function(t){return em(t,\"Show closest data on hover\")},attr:\"hovermode\",val:\"closest\",icon:Op.tooltip_basic,gravity:\"ne\",click:nm},rm.hoverCompareCartesian={name:\"hoverCompareCartesian\",title:function(t){return em(t,\"Compare data on hover\")},attr:\"hovermode\",val:function(t){return t._fullLayout._isHoriz?\"y\":\"x\"},icon:Op.tooltip_compare,gravity:\"ne\",click:nm},rm.zoom3d={name:\"zoom3d\",title:function(t){return em(t,\"Zoom\")},attr:\"scene.dragmode\",val:\"zoom\",icon:Op.zoombox,click:im},rm.pan3d={name:\"pan3d\",title:function(t){return em(t,\"Pan\")},attr:\"scene.dragmode\",val:\"pan\",icon:Op.pan,click:im},rm.orbitRotation={name:\"orbitRotation\",title:function(t){return em(t,\"Orbital rotation\")},attr:\"scene.dragmode\",val:\"orbit\",icon:Op[\"3d_rotate\"],click:im},rm.tableRotation={name:\"tableRotation\",title:function(t){return em(t,\"Turntable rotation\")},attr:\"scene.dragmode\",val:\"turntable\",icon:Op[\"z-axis\"],click:im},rm.resetCameraDefault3d={name:\"resetCameraDefault3d\",title:function(t){return em(t,\"Reset camera to default\")},attr:\"resetDefault\",icon:Op.home,click:am},rm.resetCameraLastSave3d={name:\"resetCameraLastSave3d\",title:function(t){return em(t,\"Reset camera to last save\")},attr:\"resetLastSave\",icon:Op.movie,click:am},rm.hoverClosest3d={name:\"hoverClosest3d\",title:function(t){return em(t,\"Toggle show closest data on hover\")},attr:\"hovermode\",val:null,toggle:!0,icon:Op.tooltip_basic,gravity:\"ne\",click:om},rm.zoomInGeo={name:\"zoomInGeo\",title:function(t){return em(t,\"Zoom in\")},attr:\"zoom\",val:\"in\",icon:Op.zoom_plus,click:sm},rm.zoomOutGeo={name:\"zoomOutGeo\",title:function(t){return em(t,\"Zoom out\")},attr:\"zoom\",val:\"out\",icon:Op.zoom_minus,click:sm},rm.resetGeo={name:\"resetGeo\",title:function(t){return em(t,\"Reset\")},attr:\"reset\",val:null,icon:Op.autoscale,click:sm},rm.hoverClosestGeo={name:\"hoverClosestGeo\",title:function(t){return em(t,\"Toggle show closest data on hover\")},attr:\"hovermode\",val:null,toggle:!0,icon:Op.tooltip_basic,gravity:\"ne\",click:lm},rm.hoverClosestGl2d={name:\"hoverClosestGl2d\",title:function(t){return em(t,\"Toggle show closest data on hover\")},attr:\"hovermode\",val:null,toggle:!0,icon:Op.tooltip_basic,gravity:\"ne\",click:lm},rm.hoverClosestPie={name:\"hoverClosestPie\",title:function(t){return em(t,\"Toggle show closest data on hover\")},attr:\"hovermode\",val:\"closest\",icon:Op.tooltip_basic,gravity:\"ne\",click:lm},rm.toggleHover={name:\"toggleHover\",title:function(t){return em(t,\"Toggle show closest data on hover\")},attr:\"hovermode\",val:null,toggle:!0,icon:Op.tooltip_basic,gravity:\"ne\",click:function(t,e){lm(t),om(t,e)}},rm.resetViews={name:\"resetViews\",title:function(t){return em(t,\"Reset views\")},icon:Op.home,click:function(t,e){var r=e.currentTarget;r.setAttribute(\"data-attr\",\"zoom\"),r.setAttribute(\"data-val\",\"reset\"),nm(t,e),r.setAttribute(\"data-attr\",\"resetLastSave\"),am(t,e),um(t,\"geo\"),um(t,\"mapbox\")}},rm.toggleSpikelines={name:\"toggleSpikelines\",title:function(t){return em(t,\"Toggle Spike Lines\")},icon:Op.spikeline,attr:\"_cartesianSpikesEnabled\",val:\"on\",click:function(t){var e=t._fullLayout;e._cartesianSpikesEnabled=\"on\"===e._cartesianSpikesEnabled?\"off\":\"on\";var r=function(t){for(var e,r,n=t._fullLayout,i=gn.list(t,null,!0),a={},o=0;o<i.length;o++)e=i[o],r=e._name,a[r+\".showspikes\"]=\"on\"===n._cartesianSpikesEnabled||e._showSpikeInitial;return a}(t);P.call(\"relayout\",t,r)}},rm.resetViewMapbox={name:\"resetViewMapbox\",title:function(t){return em(t,\"Reset view\")},attr:\"reset\",icon:Op.home,click:function(t){um(t,\"mapbox\")}};var hm=cm.prototype;hm.update=function(t,e){this.graphInfo=t;var r=this.graphInfo._context;\"hover\"===r.displayModeBar?this.element.className=\"modebar modebar--hover\":this.element.className=\"modebar\";var n=!this.hasButtons(e),i=this.hasLogo!==r.displaylogo;(n||i)&&(this.removeAllButtons(),this.updateButtons(e),r.displaylogo&&(this.element.appendChild(this.getLogo()),this.hasLogo=!0)),this.updateActiveButton()},hm.updateButtons=function(t){var e=this;this.buttons=t,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(t){var r=e.createGroup();t.forEach(function(t){var n=t.name;if(!n)throw new Error(\"must provide button 'name' in button config\");if(-1!==e.buttonsNames.indexOf(n))throw new Error(\"button name '\"+n+\"' is taken\");e.buttonsNames.push(n);var i=e.createButton(t);e.buttonElements.push(i),r.appendChild(i)}),e.element.appendChild(r)})},hm.createGroup=function(){var t=document.createElement(\"div\");return t.className=\"modebar-group\",t},hm.createButton=function(t){var r=this,n=document.createElement(\"a\");n.setAttribute(\"rel\",\"tooltip\"),n.className=\"modebar-btn\";var i=t.title;void 0===i?i=t.name:\"function\"==typeof i&&(i=i(this.graphInfo)),(i||0===i)&&n.setAttribute(\"data-title\",i),void 0!==t.attr&&n.setAttribute(\"data-attr\",t.attr);var a=t.val;if(void 0!==a&&(\"function\"==typeof a&&(a=a(this.graphInfo)),n.setAttribute(\"data-val\",a)),\"function\"!=typeof t.click)throw new Error(\"must provide button 'click' function in button config\");return n.addEventListener(\"click\",function(e){t.click(r.graphInfo,e),r.updateActiveButton(e.currentTarget)}),n.setAttribute(\"data-toggle\",t.toggle||!1),t.toggle&&e.select(n).classed(\"active\",!0),n.appendChild(this.createIcon(t.icon||Op.question,t.name)),n.setAttribute(\"data-gravity\",t.gravity||\"n\"),n},hm.createIcon=function(t,e){var r=t.ascent-t.descent,n=\"http://www.w3.org/2000/svg\",i=document.createElementNS(n,\"svg\"),a=document.createElementNS(n,\"path\");i.setAttribute(\"height\",\"1em\"),i.setAttribute(\"width\",t.width/r+\"em\"),i.setAttribute(\"viewBox\",[0,0,t.width,r].join(\" \"));var o=\"toggleSpikelines\"===e?\"matrix(1.5 0 0 -1.5 0 \"+t.ascent+\")\":\"matrix(1 0 0 -1 0 \"+t.ascent+\")\";return a.setAttribute(\"d\",t.path),a.setAttribute(\"transform\",o),i.appendChild(a),i},hm.updateActiveButton=function(t){var r=this.graphInfo._fullLayout,n=void 0!==t?t.getAttribute(\"data-attr\"):null;this.buttonElements.forEach(function(t){var i=t.getAttribute(\"data-val\")||!0,a=t.getAttribute(\"data-attr\"),o=\"true\"===t.getAttribute(\"data-toggle\"),s=e.select(t);if(o)a===n&&s.classed(\"active\",!s.classed(\"active\"));else{var l=null===a?a:ne.nestedProperty(r,a).get();s.classed(\"active\",l===i)}})},hm.hasButtons=function(t){var e=this.buttons;if(!e)return!1;if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;n++)if(t[r][n].name!==e[r][n].name)return!1}return!0},hm.getLogo=function(){var t=this.createGroup(),e=document.createElement(\"a\");return e.href=\"https://plot.ly/\",e.target=\"_blank\",e.setAttribute(\"data-title\",ne._(this.graphInfo,\"Produced with Plotly\")),e.className=\"modebar-btn plotlyjsicon modebar-btn--logo\",e.appendChild(this.createIcon(Op.plotlylogo)),t.appendChild(e),t},hm.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},hm.destroy=function(){ne.removeElement(this.container.querySelector(\".modebar\"))};var fm=function(t,r){var n=t._fullLayout,i=new cm({graphInfo:t,container:n._paperdiv.node(),buttons:r});return n._privateplot&&e.select(i.element).append(\"span\").classed(\"badge-private float--left\",!0).text(\"PRIVATE\"),i};var pm={};pm.manage=function(t){var e=t._fullLayout,r=t._context,n=e._modeBar;if(r.displayModeBar){if(!Array.isArray(r.modeBarButtonsToRemove))throw new Error([\"*modeBarButtonsToRemove* configuration options\",\"must be an array.\"].join(\" \"));if(!Array.isArray(r.modeBarButtonsToAdd))throw new Error([\"*modeBarButtonsToAdd* configuration options\",\"must be an array.\"].join(\" \"));var i,a=r.modeBarButtons;i=Array.isArray(a)&&a.length?function(t){for(var e=0;e<t.length;e++)for(var r=t[e],n=0;n<r.length;n++){var i=r[n];if(\"string\"==typeof i){if(void 0===tm[i])throw new Error([\"*modeBarButtons* configuration options\",\"invalid button name\"].join(\" \"));t[e][n]=tm[i]}}return t}(a):function(t,e,r){var n=t._fullLayout,i=t._fullData,a=n._has(\"cartesian\"),o=n._has(\"gl3d\"),s=n._has(\"geo\"),l=n._has(\"pie\"),u=n._has(\"gl2d\"),c=n._has(\"ternary\"),h=n._has(\"mapbox\"),f=n._has(\"polar\"),p=function(t){for(var e=gn.list({_fullLayout:t},null,!0),r=0;r<e.length;r++)if(!e[r].fixedrange)return!1;return!0}(n),d=[];function g(t){if(t.length){for(var r=[],n=0;n<t.length;n++){var i=t[n];-1===e.indexOf(i)&&r.push(tm[i])}d.push(r)}}g([\"toImage\",\"sendDataToCloud\"]);var v=[],m=[],y=[],x=[];return(a||u||l||c)+s+o+h+f>1?(m=[\"toggleHover\"],y=[\"resetViews\"]):s?(v=[\"zoomInGeo\",\"zoomOutGeo\"],m=[\"hoverClosestGeo\"],y=[\"resetGeo\"]):o?(m=[\"hoverClosest3d\"],y=[\"resetCameraDefault3d\",\"resetCameraLastSave3d\"]):h?(m=[\"toggleHover\"],y=[\"resetViewMapbox\"]):m=u?[\"hoverClosestGl2d\"]:l?[\"hoverClosestPie\"]:[\"toggleHover\"],a&&(m=[\"toggleSpikelines\",\"hoverClosestCartesian\",\"hoverCompareCartesian\"]),!a&&!u||p||(v=[\"zoomIn2d\",\"zoomOut2d\",\"autoScale2d\"],\"resetViews\"!==y[0]&&(y=[\"resetScale2d\"])),o?x=[\"zoom3d\",\"pan3d\",\"orbitRotation\",\"tableRotation\"]:(a||u)&&!p||c?x=[\"zoom2d\",\"pan2d\"]:h||s?x=[\"pan2d\"]:f&&(x=[\"zoom2d\"]),function(t){for(var e=!1,r=0;r<t.length&&!e;r++){var n=t[r];n._module&&n._module.selectPoints&&(P.traceIs(n,\"scatter-like\")?(Tr.hasMarkers(n)||Tr.hasText(n))&&(e=!0):P.traceIs(n,\"box-violin\")&&\"all\"!==n.boxpoints&&\"all\"!==n.points||(e=!0))}return e}(i)&&x.push(\"select2d\",\"lasso2d\"),g(x),g(v.concat(y)),g(m),function(t,e){if(e.length)if(Array.isArray(e[0]))for(var r=0;r<e.length;r++)t.push(e[r]);else t.push(e);return t}(d,r)}(t,r.modeBarButtonsToRemove,r.modeBarButtonsToAdd),n?n.update(t,i):e._modeBar=fm(t,i)}else n&&(n.destroy(),delete e._modeBar)};var dm=Qe.FROM_BL,gm=function(t,e,r){void 0===r&&(r=dm[t.constraintoward||\"center\"]);var n=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=n[0]+(n[1]-n[0])*r;t.range=t._input.range=[t.l2r(i+(n[0]-i)*e),t.l2r(i+(n[1]-i)*e)]},vm=Qe.FROM_TL,mm=ri.doTicks,ym=gn.getFromId,xm=Te.MINDRAG,bm=Te.MINZOOM,_m=!0;function wm(t,e,r,n){var i=t.draglayer.selectAll(\".\"+r).data([0]);return i.enter().append(e).classed(\"drag\",!0).classed(r,!0).style({fill:\"transparent\",\"stroke-width\":0}).attr(\"data-subplot\",t.id),i.call(Ka,n),i.node()}function Mm(t,r,n,i,a,o,s){var l=wm(t,\"rect\",r,n);return e.select(l).call(Sr.setRect,i,a,o,s),l}function Am(t,e){for(var r=0;r<t.length;r++)if(!t[r].fixedrange)return e;return\"\"}function km(t,e,r,n,i){var a,o,s,l;for(a=0;a<t.length;a++)(o=t[a]).fixedrange||(s=o._rl[0],l=o._rl[1]-s,o.range=[o.l2r(s+l*e),o.l2r(s+l*r)],n[o._name+\".range[0]\"]=o.range[0],n[o._name+\".range[1]\"]=o.range[1]);if(i&&i.length){var u=(e+(1-r))/2;km(i,u,1-u,n)}}function Tm(t,e){for(var r=0;r<t.length;r++){var n=t[r];n.fixedrange||(n.range=[n.l2r(n._rl[0]-e/n._m),n.l2r(n._rl[1]-e/n._m)])}}function Sm(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function Em(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 Cm(t,e,r){return t.append(\"path\").attr(\"class\",\"zoombox-corners\").style({fill:Oe.background,stroke:Oe.defaultLine,\"stroke-width\":1,opacity:0}).attr(\"transform\",\"translate(\"+e+\", \"+r+\")\").attr(\"d\",\"M0,0Z\")}function Lm(t){t.selectAll(\".select-outline\").remove()}function zm(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\"),Pm(t,e,i,a)}function Pm(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 Im(t){e.select(t).selectAll(\".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners\").remove()}function Dm(t){_m&&t.data&&t._context.showTips&&(ne.notifier(ne._(t,\"Double-click to zoom back out\"),\"long\"),_m=!1)}function Om(t){return\"lasso\"===t||\"select\"===t}function Rm(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,bm)/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 Fm(t,e){if(Ea){var r=void 0!==t.onwheel?\"wheel\":\"mousewheel\";t._onwheel&&t.removeEventListener(r,t._onwheel),t._onwheel=e,t.addEventListener(r,e,{passive:!1})}else void 0!==t.onwheel?t.onwheel=e:void 0!==t.onmousewheel&&(t.onmousewheel=e)}var Bm={makeDragBox:function(t,r,n,i,a,o,l,u){var c,h,f,p,d,g,v,m,y,x,b,_,w,M=t._fullLayout,A=t._fullLayout._zoomlayer,k=l+u===\"nsew\",T=1===(l+u).length;function S(){h=[r.xaxis],f=[r.yaxis];var e=h[0],n=f[0];g=e._length,v=n._length;var i,a,o=M._axisConstraintGroups,s=[e._id],A=[n._id];c=[r].concat(l&&u?r.overlays:[]);for(var k=1;k<c.length;k++){var T=c[k].xaxis,S=c[k].yaxis;-1===h.indexOf(T)&&(h.push(T),s.push(T._id)),-1===f.indexOf(S)&&(f.push(S),A.push(S._id))}m=Am(h,u),y=Am(f,l),i=y+m,a=M.dragmode,x=i?\"nsew\"===i?\"pan\"===a?\"move\":\"crosshair\":i.toLowerCase()+\"-resize\":\"pointer\",p=e._offset,d=n._offset;var E=function(t,e,r){var n,i,a,o,s,l,u=!1,c={},h={};for(n=0;n<t.length;n++){for(o=t[n],i=0;i<e.length;i++)if(o[e[i]]){for(s in o)-1===(\"x\"===s.charAt(0)?e:r).indexOf(s)&&(c[s]=1);for(a=0;a<r.length;a++)o[r[a]]&&(u=!0)}for(i=0;i<r.length;i++)if(o[r[i]])for(l in o)-1===(\"x\"===l.charAt(0)?e:r).indexOf(l)&&(h[l]=1)}return u&&(ne.extendFlat(c,h),h={}),{x:c,y:h,xy:u}}(o,s,A);for(var C in b=E.xy,_=[],E.x)_.push(ym(t,C));for(var L in w=[],E.y)w.push(ym(t,L))}S();var E=Mm(r,l+u+\"drag\",x,n,i,a,o),C=!y&&!m;if(C&&!k)return E.onmousedown=null,E.style.pointerEvents=\"none\",E;var L,z,I,D,O,R,F,B,N,j={element:E,gd:t,plotinfo:r,prepFn:function(e,r,n){var i=t._fullLayout.dragmode;C||(k?e.shiftKey?\"pan\"===i?i=\"zoom\":Om(i)||(i=\"pan\"):e.ctrlKey&&(i=\"pan\"):i=\"pan\"),j.minDrag=\"lasso\"===i?1:void 0,Om(i)?(j.xaxes=h,j.yaxes=f,_c(e,r,n,j,i)):C?Lm(A):\"zoom\"===i?(j.moveFn=U,j.doneFn=q,j.minDrag=1,function(e,r,n){var i=E.getBoundingClientRect();L=r-i.left,z=n-i.top,I={l:L,r:L,w:0,t:z,b:z,h:0},D=t._hmpixcount?t._hmlumcount/t._hmpixcount:s(t._fullLayout.plot_bgcolor).getLuminance(),R=!1,F=\"xy\",B=Em(A,D,p,d,O=\"M0,0H\"+g+\"V\"+v+\"H0V0\"),N=Cm(A,p,d),Lm(A)}(0,r,n)):\"pan\"===i&&(j.moveFn=X,j.doneFn=J,Lm(A))},clickFn:function(n,i){if(Im(t),2!==n||T||function(){if(!t._transitioningWithDuration){var e,r,n,i=t._context.doubleClick,a=(m?h:[]).concat(y?f:[]),o={};if(\"reset+autosize\"===i)for(i=\"autosize\",r=0;r<a.length;r++)if((e=a[r])._rangeInitial&&(e.range[0]!==e._rangeInitial[0]||e.range[1]!==e._rangeInitial[1])||!e._rangeInitial&&!e.autorange){i=\"reset\";break}if(\"autosize\"===i)for(r=0;r<a.length;r++)(e=a[r]).fixedrange||(o[e._name+\".autorange\"]=!0);else if(\"reset\"===i)for((m||b)&&(a=a.concat(_)),y&&!b&&(a=a.concat(w)),b&&(m?y||(a=a.concat(f)):a=a.concat(h)),r=0;r<a.length;r++)(e=a[r])._rangeInitial?(n=e._rangeInitial,o[e._name+\".range[0]\"]=n[0],o[e._name+\".range[1]\"]=n[1]):o[e._name+\".autorange\"]=!0;t.emit(\"plotly_doubleclick\",null),P.call(\"relayout\",t,o)}}(),k)yo.click(t,i,r.id);else if(1===n&&T){var a=l?f[0]:h[0],o=\"s\"===l||\"w\"===u?0:1,s=a._name+\".range[\"+o+\"]\",c=function(t,r){var n,i=t.range[r],a=Math.abs(i-t.range[1-r]);return\"date\"===t.type?i:\"log\"===t.type?(n=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,e.format(\".\"+n+\"g\")(Math.pow(10,i))):(n=Math.floor(Math.log(Math.abs(i))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,e.format(\".\"+String(n)+\"g\")(i))}(a,o),p=\"left\",d=\"middle\";if(a.fixedrange)return;l?(d=\"n\"===l?\"top\":\"bottom\",\"right\"===a.side&&(p=\"right\")):\"e\"===u&&(p=\"right\"),t._context.showAxisRangeEntryBoxes&&e.select(E).call(er.makeEditable,{gd:t,immediate:!0,background:M.paper_bgcolor,text:String(c),fill:a.tickfont?a.tickfont.color:\"#444\",horizontalAlign:p,verticalAlign:d}).on(\"edit\",function(e){var r=a.d2r(e);void 0!==r&&P.call(\"relayout\",t,s,r)})}}};Ua.init(j);var V={};function U(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(g,e+L)),i=Math.max(0,Math.min(v,r+z)),a=Math.abs(n-L),o=Math.abs(i-z);function s(){F=\"\",I.r=I.l,I.t=I.b,N.attr(\"d\",\"M0,0Z\")}I.l=Math.min(L,n),I.r=Math.max(L,n),I.t=Math.min(z,i),I.b=Math.max(z,i),b?a>bm||o>bm?(F=\"xy\",a/g>o/v?(o=a*v/g,z>i?I.t=z-o:I.b=z+o):(a=o*g/v,L>n?I.l=L-a:I.r=L+a),N.attr(\"d\",Rm(I))):s():!y||o<Math.min(Math.max(.6*a,xm),bm)?a<xm?s():(I.t=0,I.b=v,F=\"x\",N.attr(\"d\",function(t,e){return\"M\"+(t.l-.5)+\",\"+(e-bm-.5)+\"h-3v\"+(2*bm+1)+\"h3ZM\"+(t.r+.5)+\",\"+(e-bm-.5)+\"h3v\"+(2*bm+1)+\"h-3Z\"}(I,z))):!m||a<Math.min(.6*o,bm)?(I.l=0,I.r=g,F=\"y\",N.attr(\"d\",function(t,e){return\"M\"+(e-bm-.5)+\",\"+(t.t-.5)+\"v-3h\"+(2*bm+1)+\"v3ZM\"+(e-bm-.5)+\",\"+(t.b+.5)+\"v3h\"+(2*bm+1)+\"v-3Z\"}(I,L))):(F=\"xy\",N.attr(\"d\",Rm(I))),I.w=I.r-I.l,I.h=I.b-I.t,zm(B,N,I,O,R,D),R=!0}function q(){if(Math.min(I.h,I.w)<2*xm)return Im(t);\"xy\"!==F&&\"x\"!==F||km(h,I.l/g,I.r/g,V,_),\"xy\"!==F&&\"y\"!==F||km(f,(v-I.b)/v,(v-I.t)/v,V,w),Im(t),J(),Dm(t)}var H=[0,0,g,v],G=null,W=Te.REDRAWDELAY,Y=r.mainplot?M._plots[r.mainplot]:r;function X(e,r){if(!t._transitioningWithDuration){if(S(),\"ew\"===m||\"ns\"===y)return m&&Tm(h,e),y&&Tm(f,r),K([m?-e:0,y?-r:0,g,v]),void Z(y,m);if(b&&m&&y){var n=\"w\"===m==(\"n\"===y)?1:-1,i=(e/g+n*r/v)/2;e=i*g,r=n*i*v}\"w\"===m?e=l(h,0,e):\"e\"===m?e=l(h,1,-e):m||(e=0),\"n\"===y?r=l(f,1,r):\"s\"===y?r=l(f,0,-r):y||(r=0);var a=\"w\"===m?e:0,o=\"n\"===y?r:0;if(b){var s;if(!m&&1===y.length){for(s=0;s<h.length;s++)h[s].range=h[s]._r.slice(),gm(h[s],1-r/v);a=(e=r*g/v)/2}if(!y&&1===m.length){for(s=0;s<f.length;s++)f[s].range=f[s]._r.slice(),gm(f[s],1-e/g);o=(r=e*v/g)/2}}K([a,o,g-e,v-r]),Z(y,m)}function l(t,e,r){for(var n,i,a=1-e,o=0;o<t.length;o++){var s=t[o];if(!s.fixedrange){n=s,i=s._rl[a]+(s._rl[e]-s._rl[a])/Sm(r/s._length);var l=s.l2r(i);!1!==l&&void 0!==l&&(s.range[e]=l)}}return n._length*(n._rl[e]-i)/(n._rl[e]-n._rl[a])}}function Z(e,r){var n,i=[];function a(t){for(n=0;n<t.length;n++)t[n].fixedrange||i.push(t[n]._id)}for((r||b)&&(a(h),a(_)),(e||b)&&(a(f),a(w)),V={},n=0;n<i.length;n++){var o=i[n];mm(t,o,!0);var s=ym(t,o);V[s._name+\".range[0]\"]=s.range[0],V[s._name+\".range[1]\"]=s.range[1]}function l(a,o,s){for(n=0;n<a.length;n++){var l=a[n];if((r&&-1!==i.indexOf(l.xref)||e&&-1!==i.indexOf(l.yref))&&(o(t,n),s))return}}l(M.annotations||[],P.getComponentMethod(\"annotations\",\"drawOne\")),l(M.shapes||[],P.getComponentMethod(\"shapes\",\"drawOne\")),l(M.images||[],P.getComponentMethod(\"images\",\"draw\"),!0)}function J(){K([0,0,g,v]),ne.syncOrAsync([_n.previousPromises,function(){P.call(\"relayout\",t,V)}],t)}function K(t){var e,r,n,i,a,o=M._plots,s=Object.keys(o),c=t[2]/h[0]._length,p=t[3]/f[0]._length,d=u||b,g=l||b;function v(t){return t.fixedrange?0:d&&-1!==_.indexOf(t)?c:g&&-1!==(b?_:w).indexOf(t)?p:0}function m(t,e){return e?(t.range=t._r.slice(),gm(t,e),y(t,e)):0}function y(t,e){return t._length*(1-e)*vm[t.constraintoward||\"middle\"]}for(M._glcanvas&&M._glcanvas.size()&&M._glcanvas.each(function(t){t.regl&&t.regl.clear({color:!0})}),e=0;e<s.length;e++){var x=o[s[e]],A=x.xaxis,k=x.yaxis,T=d&&!A.fixedrange&&-1!==h.indexOf(A),S=g&&!k.fixedrange&&-1!==f.indexOf(k);if(x._scene&&x._scene.update){var E=ne.simpleMap(A.range,A.r2l),C=ne.simpleMap(k.range,k.r2l);x._scene.update({range:[E[0],C[0],E[1],C[1]]})}if(T?(r=c,i=u?t[0]:y(A,r)):i=m(A,r=v(A)),S?(n=p,a=l?t[1]:y(k,n)):a=m(k,n=v(k)),r||n){r||(r=1),n||(n=1);var L=A._offset-i/r,z=k._offset-a/n;M._defs.select(\"#\"+x.clipId+\"> rect\").call(Sr.setTranslate,i,a).call(Sr.setScale,r,n);var P=x.plot.selectAll(\".scatterlayer .trace, .boxlayer .trace, .violinlayer .trace\");x.plot.call(Sr.setTranslate,L,z).call(Sr.setScale,1/r,1/n),P.selectAll(\".point\").call(Sr.setPointGroupScale,r,n),P.selectAll(\".textpoint\").call(Sr.setTextPointsScale,r,n),P.call(Sr.hideOutsideRangePoints,x),x.plot.selectAll(\".barlayer .trace\").call(Sr.hideOutsideRangePoints,x,\".bartext\")}}}return l.length*u.length!=1&&Fm(E,function(e){if(t._context.scrollZoom||M._enablescrollzoom){if(null===G&&Lm(A),t._transitioningWithDuration)return e.preventDefault(),void e.stopPropagation();var r=t.querySelector(\".plotly\");if(S(),!(r.scrollHeight-r.clientHeight>10||r.scrollWidth-r.clientWidth>10)){clearTimeout(G);var n=-e.deltaY;if(isFinite(n)||(n=e.wheelDelta/10),isFinite(n)){var i,a=Math.exp(-Math.min(Math.max(n,-20),20)/200),o=Y.draglayer.select(\".nsewdrag\").node().getBoundingClientRect(),s=(e.clientX-o.left)/o.width,c=(o.bottom-e.clientY)/o.height;if(u||b){for(u||(s=.5),i=0;i<h.length;i++)p(h[i],s,a);H[2]*=a,H[0]+=H[2]*s*(1/a-1)}if(l||b){for(l||(c=.5),i=0;i<f.length;i++)p(f[i],c,a);H[3]*=a,H[1]+=H[3]*(1-c)*(1/a-1)}K(H),Z(l,u),G=setTimeout(function(){H=[0,0,g,v],J()},W),e.preventDefault()}else ne.log(\"Did not find wheel motion attributes: \",e)}}function p(t,e,r){if(!t.fixedrange){var n=ne.simpleMap(t.range,t.r2l),i=n[0]+(n[1]-n[0])*e;t.range=n.map(function(e){return t.l2r(i+(e-i)*r)})}}}),E},makeDragger:wm,makeRectDragger:Mm,makeZoombox:Em,makeCorners:Cm,updateZoombox:zm,xyCorners:Rm,transitionZoombox:Pm,removeZoombox:Im,clearSelect:Lm,showDoubleClickNotifier:Dm,attachWheelEventHandler:Fm},Nm=Bm.makeDragBox,jm=function(t){var r=t._fullLayout;if(t._context.staticPlot)e.select(t).selectAll(\".drag\").remove();else if(r._has(\"cartesian\")||r._has(\"gl2d\")){Object.keys(r._plots||{}).sort(function(t,e){if((r._plots[t].mainplot&&!0)===(r._plots[e].mainplot&&!0)){var n=t.split(\"y\"),i=e.split(\"y\");return n[0]===i[0]?Number(n[1]||1)-Number(i[1]||1):Number(n[0]||1)-Number(i[0]||1)}return r._plots[t].mainplot?1:-1}).forEach(function(e){var n=r._plots[e],i=n.xaxis,a=n.yaxis,o=Te.DRAGGERSIZE;if(!n.mainplot){var s=Nm(t,n,i._offset,a._offset,i._length,a._length,\"ns\",\"ew\");s.onmousemove=function(r){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===e&&yo.hover(t,r,e)},yo.hover(t,r,e),t._fullLayout._lasthover=s,t._fullLayout._hoversubplot=e},s.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,Ua.unhover(t,e))},t._context.showAxisDragHandles&&(Nm(t,n,i._offset-o,a._offset-o,o,o,\"n\",\"w\"),Nm(t,n,i._offset+i._length,a._offset-o,o,o,\"n\",\"e\"),Nm(t,n,i._offset-o,a._offset+a._length,o,o,\"s\",\"w\"),Nm(t,n,i._offset+i._length,a._offset+a._length,o,o,\"s\",\"e\"))}if(t._context.showAxisDragHandles){if(e===i._mainSubplot){var l=i._mainLinePosition;\"top\"===i.side&&(l-=o),Nm(t,n,i._offset+.1*i._length,l,.8*i._length,o,\"\",\"ew\"),Nm(t,n,i._offset,l,.1*i._length,o,\"\",\"w\"),Nm(t,n,i._offset+.9*i._length,l,.1*i._length,o,\"\",\"e\")}if(e===a._mainSubplot){var u=a._mainLinePosition;\"right\"!==a.side&&(u-=o),Nm(t,n,u,a._offset+.1*a._length,o,.8*a._length,\"ns\",\"\"),Nm(t,n,u,a._offset+.9*a._length,o,.1*a._length,\"s\",\"\"),Nm(t,n,u,a._offset,o,.1*a._length,\"n\",\"\")}}});var n=r._hoverlayer.node();n.onmousemove=function(e){e.target=r._lasthover,yo.hover(t,e,r._hoversubplot)},n.onclick=function(e){e.target=r._lasthover,yo.click(t,e)},n.onmousedown=function(t){r._lasthover.onmousedown(t)}}},Vm={};function Um(t,e){return(t.ticks||t.showline)&&(e===t._mainSubplot||\"all\"===t.mirror||\"allticks\"===t.mirror)}function qm(t,e,r){if(!r.showline||!r._lw)return!1;if(\"all\"===r.mirror||\"allticks\"===r.mirror)return!0;var n=r._anchorAxis;if(!n)return!1;var i=Qe.FROM_BL[e];return r.side===e?n.domain[i]===t.domain[i]:r.mirror&&n.domain[1-i]===t.domain[1-i]}function Hm(t,e,r,n){if(qm(t,e,r))return r._lw;for(var i=0;i<n.length;i++){var a=n[i];if(a._mainAxis===r._mainAxis&&qm(t,e,a))return a._lw}return 0}Vm.layoutStyles=function(t){return ne.syncOrAsync([_n.doAutoMargin,Vm.lsInner],t)},Vm.lsInner=function(t){var r,n=t._fullLayout,i=n._size,a=i.p,o=ri.list(t),s=n._has(\"cartesian\");function l(t,e,r){var n=t._lw/2;return\"x\"===t._id.charAt(0)?e?\"top\"===r?e._offset-a-n:e._offset+e._length+a+n:i.t+i.h*(1-(t.position||0))+n%1:e?\"right\"===r?e._offset+e._length+a+n:e._offset-a-n:i.l+i.w*(t.position||0)+n%1}for(r=0;r<o.length;r++){var u=o[r];u.setScale();var c=u._anchorAxis;u._linepositions={},u._lw=Sr.crispRound(t,u.linewidth,1),u._mainLinePosition=l(u,c,u.side),u._mainMirrorPosition=u.mirror&&c?l(u,c,Qe.OPPOSITE_SIDE[u.side]):null}n._paperdiv.style({width:n.width+\"px\",height:n.height+\"px\"}).selectAll(\".main-svg\").call(Sr.setSize,n.width,n.height),t._context.setBackground(t,n.paper_bgcolor);var h=n._paper.selectAll(\"g.subplot\"),f=[],p=[];h.each(function(t){var e=n._plots[t];if(e.mainplot)return e.bg&&e.bg.remove(),void(e.bg=void 0);var r=e.xaxis.domain,i=e.yaxis.domain,a=[];!function(t,e,r){for(var n=0;n<r.length;n++){var i=r[n][0],a=r[n][1];if(!(i[0]>=t[1]||i[1]<=t[0])&&a[0]<e[1]&&a[1]>e[0])return!0}return!1}(r,i,p)?(f.push(t),p.push([r,i])):a=[0];var o=e.plotgroup.selectAll(\".bg\").data(a);o.enter().append(\"rect\").classed(\"bg\",!0),o.exit().remove(),o.each(function(){e.bg=o;var t=e.plotgroup.node();t.insertBefore(this,t.childNodes[0])})});var d=n._bgLayer.selectAll(\".bg\").data(f);return d.enter().append(\"rect\").classed(\"bg\",!0),d.exit().remove(),d.each(function(t){n._plots[t].bg=e.select(this)}),h.each(function(t){var e=n._plots[t],i=e.xaxis,u=e.yaxis;e.bg&&s&&e.bg.call(Sr.setRect,i._offset-a,u._offset-a,i._length+2*a,u._length+2*a).call(Oe.fill,n.plot_bgcolor).style(\"stroke-width\",0),e.clipId=\"clip\"+n._uid+t+\"plot\";var c,h,f=n._clips.selectAll(\"#\"+e.clipId).data([0]);for(f.enter().append(\"clipPath\").attr({class:\"plotclip\",id:e.clipId}).append(\"rect\"),f.selectAll(\"rect\").attr({width:i._length,height:u._length}),Sr.setTranslate(e.plot,i._offset,u._offset),e._hasClipOnAxisFalse?(c=null,h=e.clipId):(c=e.clipId,h=null),Sr.setClipUrl(e.plot,c),r=0;r<Te.traceLayerClasses.length;r++){var p=Te.traceLayerClasses[r];\"scatterlayer\"!==p&&\"barlayer\"!==p&&e.plot.selectAll(\"g.\"+p).call(Sr.setClipUrl,h)}if(e.layerClipId=h,s){var d,g,v,m,y,x,b,_,w,M,A,k,T,S=\"M0,0\";Um(i,t)&&(y=Hm(i,\"left\",u,o),d=i._offset-(y?a+y:0),x=Hm(i,\"right\",u,o),g=i._offset+i._length+(x?a+x:0),v=l(i,u,\"bottom\"),m=l(i,u,\"top\"),(T=!i._anchorAxis||t!==i._mainSubplot)&&i.ticks&&\"allticks\"===i.mirror&&(i._linepositions[t]=[v,m]),S=z(i,C,function(t){return\"M\"+i._offset+\",\"+t+\"h\"+i._length}),T&&i.showline&&(\"all\"===i.mirror||\"allticks\"===i.mirror)&&(S+=C(v)+C(m)),e.xlines.style(\"stroke-width\",i._lw+\"px\").call(Oe.stroke,i.showline?i.linecolor:\"rgba(0,0,0,0)\")),e.xlines.attr(\"d\",S);var E=\"M0,0\";Um(u,t)&&(A=Hm(u,\"bottom\",i,o),b=u._offset+u._length+(A?a:0),k=Hm(u,\"top\",i,o),_=u._offset-(k?a:0),w=l(u,i,\"left\"),M=l(u,i,\"right\"),(T=!u._anchorAxis||t!==i._mainSubplot)&&u.ticks&&\"allticks\"===u.mirror&&(u._linepositions[t]=[w,M]),E=z(u,L,function(t){return\"M\"+t+\",\"+u._offset+\"v\"+u._length}),T&&u.showline&&(\"all\"===u.mirror||\"allticks\"===u.mirror)&&(E+=L(w)+L(M)),e.ylines.style(\"stroke-width\",u._lw+\"px\").call(Oe.stroke,u.showline?u.linecolor:\"rgba(0,0,0,0)\")),e.ylines.attr(\"d\",E)}function C(t){return\"M\"+d+\",\"+t+\"H\"+g}function L(t){return\"M\"+t+\",\"+_+\"V\"+b}function z(e,r,n){if(!e.showline||t!==e._mainSubplot)return\"\";if(!e._anchorAxis)return n(e._mainLinePosition);var i=r(e._mainLinePosition);return e.mirror&&(i+=r(e._mainMirrorPosition)),i}}),ri.makeClipPaths(t),Vm.drawMainTitle(t),pm.manage(t),t._promises.length&&Promise.all(t._promises)},Vm.drawMainTitle=function(t){var e=t._fullLayout;Dn.draw(t,\"gtitle\",{propContainer:e,propName:\"title\",placeholder:e._dfltTitle.plot,attributes:{x:e.width/2,y:e._size.t/2,\"text-anchor\":\"middle\"}})},Vm.doTraceStyle=function(t){for(var e=0;e<t.calcdata.length;e++){var r=t.calcdata[e],n=(((r[0]||{}).trace||{})._module||{}).arraysToCalcdata;n&&n(r,r[0].trace)}return _n.style(t),P.getComponentMethod(\"legend\",\"draw\")(t),_n.previousPromises(t)},Vm.doColorBars=function(t){for(var e=0;e<t.calcdata.length;e++){var r=t.calcdata[e][0];if((r.t||{}).cb){var n=r.trace,i=r.t.cb;P.traceIs(n,\"contour\")&&i.line({width:!1!==n.contours.showlines?n.line.width:0,dash:n.line.dash,color:\"line\"===n.contours.coloring?i._opts.line.color:n.line.color}),P.traceIs(n,\"markerColorscale\")?i.options(n.marker.colorbar)():i.options(n.colorbar)()}}return _n.previousPromises(t)},Vm.layoutReplot=function(t){var e=t.layout;return t.layout=void 0,P.call(\"plot\",t,\"\",e)},Vm.doLegend=function(t){return P.getComponentMethod(\"legend\",\"draw\")(t),_n.previousPromises(t)},Vm.doTicksRelayout=function(t){return ri.doTicks(t,\"redraw\"),Vm.drawMainTitle(t),_n.previousPromises(t)},Vm.doModeBar=function(t){var e=t._fullLayout;pm.manage(t),jm(t);for(var r=0;r<e._basePlotModules.length;r++){var n=e._basePlotModules[r].updateFx;n&&n(e)}return _n.previousPromises(t)},Vm.doCamera=function(t){for(var e=t._fullLayout,r=e._subplots.gl3d,n=0;n<r.length;n++){var i=e[r[n]];i._scene.setCamera(i.camera)}};var Gm={},Wm=gn.id2name,Ym=Bn,Xm=t.ALMOST_EQUAL,Zm=Qe.FROM_BL;function Jm(t,e){var r=t._inputDomain,n=Zm[t.constraintoward],i=r[0]+(r[1]-r[0])*n;t.domain=t._input.domain=[i+(r[0]-i)/e,i+(r[1]-i)/e]}Gm.enforce=function(t){var e,r,n,i,a,o,s,l=t._fullLayout,u=l._axisConstraintGroups||[];for(e=0;e<u.length;e++){var c=u[e],h=Object.keys(c),f=1/0,p=0,d=1/0,g={},v={},m=!1;for(r=0;r<h.length;r++)v[n=h[r]]=i=l[Wm(n)],i._inputDomain?i.domain=i._inputDomain.slice():i._inputDomain=i.domain.slice(),i._inputRange||(i._inputRange=i.range.slice()),i.setScale(),g[n]=a=Math.abs(i._m)/c[n],f=Math.min(f,a),\"domain\"!==i.constrain&&i._constraintShrinkable||(d=Math.min(d,a)),delete i._constraintShrinkable,p=Math.max(p,a),\"domain\"===i.constrain&&(m=!0);if(!(f>Xm*p)||m)for(r=0;r<h.length;r++)if(a=g[n=h[r]],o=(i=v[n]).constrain,a!==d||\"domain\"===o)if(s=a/d,\"range\"===o)gm(i,s);else{var y=i._inputDomain,x=(i.domain[1]-i.domain[0])/(y[1]-y[0]),b=(i.r2l(i.range[1])-i.r2l(i.range[0]))/(i.r2l(i._inputRange[1])-i.r2l(i._inputRange[0]));if((s/=x)*b<1){i.domain=i._input.domain=y.slice(),gm(i,s);continue}if(b<1&&(i.range=i._input.range=i._inputRange.slice(),s*=b),i.autorange&&i._min.length&&i._max.length){var _=i.r2l(i.range[0]),w=i.r2l(i.range[1]),M=(_+w)/2,A=M,k=M,T=Math.abs(w-M),S=M-T*s*1.0001,E=M+T*s*1.0001,C=Ym(i);Jm(i,s),i.setScale();var L,z,P=Math.abs(i._m);for(z=0;z<i._min.length;z++)(L=i._min[z].val-C(i._min[z])/P)>S&&L<A&&(A=L);for(z=0;z<i._max.length;z++)(L=i._max[z].val+C(i._max[z])/P)<E&&L>k&&(k=L);s/=(k-A)/(2*T),A=i.l2r(A),k=i.l2r(k),i.range=i._input.range=_<w?[A,k]:[k,A]}Jm(i,s)}}},Gm.clean=function(t,e){if(e._inputDomain){for(var r=!1,n=e._id,i=t._fullLayout._axisConstraintGroups,a=0;a<i.length;a++)if(i[a][n]){r=!0;break}r&&\"domain\"===e.constrain||(e._input.domain=e.domain=e._inputDomain,delete e._inputDomain)}};var Km={},Qm=ne.extendDeepAll,$m=Qe.MID_SHIFT,ty=Km={version:\"0.2.2\"};ty.Axis=function(){var t,r,n,i,a={data:[],layout:{}},o={},s={},l=e.dispatch(\"hover\"),u={};return u.render=function(o){return function(o){r=o||r;var l=a.data,u=a.layout;(\"string\"==typeof r||r.nodeName)&&(r=e.select(r)),r.datum(l).each(function(r,a){var o=r.slice();s={data:ty.util.cloneJson(o),layout:ty.util.cloneJson(u)};var l=0;o.forEach(function(t,r){t.color||(t.color=u.defaultColorRange[l],l=(l+1)%u.defaultColorRange.length),t.strokeColor||(t.strokeColor=\"LinePlot\"===t.geometry?t.color:e.rgb(t.color).darker().toString()),s.data[r].color=t.color,s.data[r].strokeColor=t.strokeColor,s.data[r].strokeDash=t.strokeDash,s.data[r].strokeSize=t.strokeSize});var c=o.filter(function(t,e){var r=t.visible;return void 0===r||!0===r}),h=!1,f=c.map(function(t,e){return h=h||void 0!==t.groupId,t});if(h){var p=[],d=e.nest().key(function(t,e){return void 0!==t.groupId?t.groupId:\"unstacked\"}).entries(f).map(function(t,e){if(\"unstacked\"===t.key)return t.values;var r=t.values[0].r.map(function(t,e){return 0});return t.values.forEach(function(t,e,n){t.yStack=[r],p.push(r),r=ty.util.sumArrays(t.r,r)}),t.values});c=e.merge(d)}c.forEach(function(t,e){t.t=Array.isArray(t.t[0])?t.t:[t.t],t.r=Array.isArray(t.r[0])?t.r:[t.r]});var g=Math.min(u.width-u.margin.left-u.margin.right,u.height-u.margin.top-u.margin.bottom)/2;g=Math.max(10,g);var v,m=[u.margin.left+g,u.margin.top+g];v=h?[0,e.max(ty.util.sumArrays(ty.util.arrayLast(c).r[0],ty.util.arrayLast(p)))]:e.extent(ty.util.flattenArray(c.map(function(t,e){return t.r}))),u.radialAxis.domain!=ty.DATAEXTENT&&(v[0]=0),n=e.scale.linear().domain(u.radialAxis.domain!=ty.DATAEXTENT&&u.radialAxis.domain?u.radialAxis.domain:v).range([0,g]),s.layout.radialAxis.domain=n.domain();var y,x=ty.util.flattenArray(c.map(function(t,e){return t.t})),b=\"string\"==typeof x[0];b&&(x=ty.util.deduplicate(x),y=x.slice(),x=e.range(x.length),c=c.map(function(t,e){var r=t;return t.t=[x],h&&(r.yStack=t.yStack),r}));var _=c.filter(function(t,e){return\"LinePlot\"===t.geometry||\"DotPlot\"===t.geometry}).length===c.length,w=null===u.needsEndSpacing?b||!_:u.needsEndSpacing,M=u.angularAxis.domain&&u.angularAxis.domain!=ty.DATAEXTENT&&!b&&u.angularAxis.domain[0]>=0?u.angularAxis.domain:e.extent(x),A=Math.abs(x[1]-x[0]);_&&!b&&(A=0);var k=M.slice();w&&b&&(k[1]+=A);var T=u.angularAxis.ticksCount||4;T>8&&(T=T/(T/8)+T%8),u.angularAxis.ticksStep&&(T=(k[1]-k[0])/T);var S=u.angularAxis.ticksStep||(k[1]-k[0])/(T*(u.minorTicks+1));y&&(S=Math.max(Math.round(S),1)),k[2]||(k[2]=S);var E=e.range.apply(this,k);if(E=E.map(function(t,e){return parseFloat(t.toPrecision(12))}),i=e.scale.linear().domain(k.slice(0,2)).range(\"clockwise\"===u.direction?[0,360]:[360,0]),s.layout.angularAxis.domain=i.domain(),s.layout.angularAxis.endPadding=w?A:0,void 0===(t=e.select(this).select(\"svg.chart-root\"))||t.empty()){var C=(new DOMParser).parseFromString(\"<svg xmlns='http://www.w3.org/2000/svg' class='chart-root'>' + '<g class='outer-group'>' + '<g class='chart-group'>' + '<circle class='background-circle'></circle>' + '<g class='geometry-group'></g>' + '<g class='radial axis-group'>' + '<circle class='outside-circle'></circle>' + '</g>' + '<g class='angular axis-group'></g>' + '<g class='guides-group'><line></line><circle r='0'></circle></g>' + '</g>' + '<g class='legend-group'></g>' + '<g class='tooltips-group'></g>' + '<g class='title-group'><text></text></g>' + '</g>' + '</svg>\",\"application/xml\"),L=this.appendChild(this.ownerDocument.importNode(C.documentElement,!0));t=e.select(L)}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,P=t.select(\".chart-group\"),I={fill:\"none\",stroke:u.tickColor},D={\"font-size\":u.font.size,\"font-family\":u.font.family,fill:u.font.color,\"text-shadow\":[\"-1px 0px\",\"1px -1px\",\"-1px 1px\",\"1px 1px\"].map(function(t,e){return\" \"+t+\" 0 \"+u.font.outlineColor}).join(\",\")};if(u.showLegend){z=t.select(\".legend-group\").attr({transform:\"translate(\"+[g,u.margin.top]+\")\"}).style({display:\"block\"});var O=c.map(function(t,e){var r=ty.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});ty.Legend().config({data:c.map(function(t,e){return t.name||\"Element\"+e}),legendConfig:Qm({},ty.Legend.defaultConfig().legendConfig,{container:z,elements:O,reverseOrder:u.legend.reverseOrder})})();var R=z.node().getBBox();g=Math.min(u.width-R.width-u.margin.left-u.margin.right,u.height-u.margin.top-u.margin.bottom)/2,g=Math.max(10,g),m=[u.margin.left+g,u.margin.top+g],n.range([0,g]),s.layout.radialAxis.domain=n.domain(),z.attr(\"transform\",\"translate(\"+[m[0]+g,m[1]-g]+\")\")}else z=t.select(\".legend-group\").style({display:\"none\"});t.attr({width:u.width,height:u.height}).style({opacity:u.opacity}),P.attr(\"transform\",\"translate(\"+m+\")\").style({cursor:\"crosshair\"});var F=[(u.width-(u.margin.left+u.margin.right+2*g+(R?R.width:0)))/2,(u.height-(u.margin.top+u.margin.bottom+2*g))/2];if(F[0]=Math.max(0,F[0]),F[1]=Math.max(0,F[1]),t.select(\".outer-group\").attr(\"transform\",\"translate(\"+F+\")\"),u.title){var B=t.select(\"g.title-group text\").style(D).text(u.title),N=B.node().getBBox();B.attr({x:m[0]-N.width/2,y:m[1]-g-20})}var j=t.select(\".radial.axis-group\");if(u.radialAxis.gridLinesVisible){var V=j.selectAll(\"circle.grid-circle\").data(n.ticks(5));V.enter().append(\"circle\").attr({class:\"grid-circle\"}).style(I),V.attr(\"r\",n),V.exit().remove()}j.select(\"circle.outside-circle\").attr({r:g}).style(I);var U=t.select(\"circle.background-circle\").attr({r:g}).style({fill:u.backgroundColor,stroke:u.stroke});function q(t,e){return i(t)%360+u.orientation}if(u.radialAxis.visible){var H=e.svg.axis().scale(n).ticks(5).tickSize(5);j.call(H).attr({transform:\"rotate(\"+u.radialAxis.orientation+\")\"}),j.selectAll(\".domain\").style(I),j.selectAll(\"g>text\").text(function(t,e){return this.textContent+u.radialAxis.ticksSuffix}).style(D).style({\"text-anchor\":\"start\"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return\"horizontal\"===u.radialAxis.tickOrientation?\"rotate(\"+-u.radialAxis.orientation+\") translate(\"+[0,D[\"font-size\"]]+\")\":\"translate(\"+[0,D[\"font-size\"]]+\")\"}}),j.selectAll(\"g>line\").style({stroke:\"black\"})}var G=t.select(\".angular.axis-group\").selectAll(\"g.angular-tick\").data(E),W=G.enter().append(\"g\").classed(\"angular-tick\",!0);G.attr({transform:function(t,e){return\"rotate(\"+q(t)+\")\"}}).style({display:u.angularAxis.visible?\"block\":\"none\"}),G.exit().remove(),W.append(\"line\").classed(\"grid-line\",!0).classed(\"major\",function(t,e){return e%(u.minorTicks+1)==0}).classed(\"minor\",function(t,e){return!(e%(u.minorTicks+1)==0)}).style(I),W.selectAll(\".minor\").style({stroke:u.minorTickColor}),G.select(\"line.grid-line\").attr({x1:u.tickLength?g-u.tickLength:0,x2:g}).style({display:u.angularAxis.gridLinesVisible?\"block\":\"none\"}),W.append(\"text\").classed(\"axis-text\",!0).style(D);var Y=G.select(\"text.axis-text\").attr({x:g+u.labelOffset,dy:$m+\"em\",transform:function(t,e){var r=q(t),n=g+u.labelOffset,i=u.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:u.angularAxis.labelsVisible?\"block\":\"none\"}).text(function(t,e){return e%(u.minorTicks+1)!=0?\"\":y?y[t]+u.angularAxis.ticksSuffix:t+u.angularAxis.ticksSuffix}).style(D);u.angularAxis.rewriteTicks&&Y.text(function(t,e){return e%(u.minorTicks+1)!=0?\"\":u.angularAxis.rewriteTicks(this.textContent,e)});var X=e.max(P.selectAll(\".angular-tick text\")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));z.attr({transform:\"translate(\"+[g+X,u.margin.top]+\")\"});var Z=t.select(\"g.geometry-group\").selectAll(\"g\").size()>0,J=t.select(\"g.geometry-group\").selectAll(\"g.geometry\").data(c);if(J.enter().append(\"g\").attr({class:function(t,e){return\"geometry geometry\"+e}}),J.exit().remove(),c[0]||Z){var K=[];c.forEach(function(t,e){var r={};r.radialScale=n,r.angularScale=i,r.container=J.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=u.orientation,r.direction=u.direction,r.index=e,K.push({data:t,geometryConfig:r})});var Q=[];e.nest().key(function(t,e){return void 0!==t.data.groupId||\"unstacked\"}).entries(K).forEach(function(t,e){\"unstacked\"===t.key?Q=Q.concat(t.values.map(function(t,e){return[t]})):Q.push(t.values)}),Q.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 Qm(ty[r].defaultConfig(),t)});ty[r]().config(n)()})}var $,tt,et=t.select(\".guides-group\"),rt=t.select(\".tooltips-group\"),nt=ty.tooltipPanel().config({container:rt,fontSize:8})(),it=ty.tooltipPanel().config({container:rt,fontSize:8})(),at=ty.tooltipPanel().config({container:rt,hasTick:!0})();if(!b){var ot=et.select(\"line\").attr({x1:0,y1:0,y2:0}).style({stroke:\"grey\",\"pointer-events\":\"none\"});P.on(\"mousemove.angular-guide\",function(t,e){var r=ty.util.getMousePos(U).angle;ot.attr({x2:-g,transform:\"rotate(\"+r+\")\"}).style({opacity:.5});var n=(r+180+360-u.orientation)%360;$=i.invert(n);var a=ty.util.convertToCartesian(g+12,r+180);nt.text(ty.util.round($)).move([a[0]+m[0],a[1]+m[1]])}).on(\"mouseout.angular-guide\",function(t,e){et.select(\"line\").style({opacity:0})})}var st=et.select(\"circle\").style({stroke:\"grey\",fill:\"none\"});P.on(\"mousemove.radial-guide\",function(t,e){var r=ty.util.getMousePos(U).radius;st.attr({r:r}).style({opacity:.5}),tt=n.invert(ty.util.getMousePos(U).radius);var i=ty.util.convertToCartesian(r,u.radialAxis.orientation);it.text(ty.util.round(tt)).move([i[0]+m[0],i[1]+m[1]])}).on(\"mouseout.radial-guide\",function(t,e){st.style({opacity:0}),at.hide(),nt.hide(),it.hide()}),t.selectAll(\".geometry-group .mark\").on(\"mouseover.tooltip\",function(r,n){var i=e.select(this),a=this.style.fill,o=\"black\",s=this.style.opacity||1;if(i.attr({\"data-opacity\":s}),a&&\"none\"!==a){i.attr({\"data-fill\":a}),o=e.hsl(a).darker().toString(),i.style({fill:o,opacity:1});var l={t:ty.util.round(r[0]),r:ty.util.round(r[1])};b&&(l.t=y[r[0]]);var u=\"t: \"+l.t+\", r: \"+l.r,c=this.getBoundingClientRect(),h=t.node().getBoundingClientRect(),f=[c.left+c.width/2-F[0]-h.left,c.top+c.height/2-F[1]-h.top];at.config({color:o}).text(u),at.move(f)}else a=this.style.stroke||\"black\",i.attr({\"data-stroke\":a}),o=e.hsl(a).darker().toString(),i.style({stroke:o,opacity:1})}).on(\"mousemove.tooltip\",function(t,r){if(0!=e.event.which)return!1;e.select(this).attr(\"data-fill\")&&at.show()}).on(\"mouseout.tooltip\",function(t,r){at.hide();var n=e.select(this),i=n.attr(\"data-fill\");i?n.style({fill:i,opacity:n.attr(\"data-opacity\")}):n.style({stroke:n.attr(\"data-stroke\"),opacity:n.attr(\"data-opacity\")})})})}(o),this},u.config=function(t){if(!arguments.length)return a;var e=ty.util.cloneJson(t);return e.data.forEach(function(t,e){a.data[e]||(a.data[e]={}),Qm(a.data[e],ty.Axis.defaultConfig().data[0]),Qm(a.data[e],t)}),Qm(a.layout,ty.Axis.defaultConfig().layout),Qm(a.layout,e.layout),this},u.getLiveConfig=function(){return s},u.getinputConfig=function(){return o},u.radialScale=function(t){return n},u.angularScale=function(t){return i},u.svg=function(){return t},e.rebind(u,l,\"on\"),u},ty.Axis.defaultConfig=function(t,r){return{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:e.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}}},ty.util={},ty.DATAEXTENT=\"dataExtent\",ty.AREA=\"AreaChart\",ty.LINE=\"LinePlot\",ty.DOT=\"DotPlot\",ty.BAR=\"BarChart\",ty.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},ty.util._extend=function(t,e){for(var r in t)e[r]=t[r]},ty.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},ty.util.dataFromEquation2=function(t,r){var n=r||6;return e.range(0,360+n,n).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},ty.util.dataFromEquation=function(t,r,n){var i=r||6,a=[],o=[];e.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 n&&(s.name=n),s},ty.util.ensureArray=function(t,r){if(void 0===t)return null;var n=[].concat(t);return e.range(r).map(function(t,e){return n[e]||n[0]})},ty.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=ty.util.ensureArray(t[e],r)}),t},ty.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},ty.util.validateKeys=function(t,e){\"string\"==typeof e&&(e=e.split(\".\"));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},ty.util.sumArrays=function(t,r){return e.zip(t,r).map(function(t,r){return e.sum(t)})},ty.util.arrayLast=function(t){return t[t.length-1]},ty.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},ty.util.flattenArray=function(t){for(var e=[];!ty.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},ty.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},ty.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},ty.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},ty.util.getMousePos=function(t){var r=e.mouse(t.node()),n=r[0],i=r[1],a={};return a.x=n,a.y=i,a.pos=r,a.angle=180*(Math.atan2(i,n)+Math.PI)/Math.PI,a.radius=Math.sqrt(n*n+i*i),a},ty.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i<a;i++)(e=t[i])in r?(r[e]++,n[e]=r[e]):r[e]=1;return n},ty.util.duplicates=function(t){return Object.keys(ty.util.duplicatesCount(t))},ty.util.translator=function(t,e,r,n){if(n){var i=r.slice();r=e,e=i}var a=e.reduce(function(t,e){if(void 0!==t)return t[e]},t);void 0!==a&&(e.reduce(function(t,r,n){if(void 0!==t)return n===e.length-1&&delete t[r],t[r]},t),r.reduce(function(t,e,n){return void 0===t[e]&&(t[e]={}),n===r.length-1&&(t[e]=a),t[e]},t))},ty.PolyChart=function(){var t=[ty.PolyChart.defaultConfig()],r=e.dispatch(\"hover\"),n={solid:\"none\",dash:[5,2],dot:[2,5]};function i(){var r=t[0].geometryConfig,i=r.container;\"string\"==typeof i&&(i=e.select(i)),i.datum(t).each(function(t,i){var a=!!t[0].data.yStack,o=t.map(function(t,r){return a?e.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):e.zip(t.data.t[0],t.data.r[0])}),s=r.angularScale,l=r.radialScale.domain()[0],u={bar:function(n,i,a){var o=t[a].data,l=r.radialScale(n[1])-r.radialScale(0),u=r.radialScale(n[2]||0),c=o.barWidth;e.select(this).attr({class:\"mark bar\",d:\"M\"+[[l+u,-c/2],[l+u,c/2],[u,c/2],[u,-c/2]].join(\"L\")+\"Z\",transform:function(t,e){return\"rotate(\"+(r.orientation+s(t[0]))+\")\"}})}};u.dot=function(n,i,a){var o=n[2]?[n[0],n[1]+n[2]]:n,s=e.svg.symbol().size(t[a].data.dotSize).type(t[a].data.dotType)(n,i);e.select(this).attr({class:\"mark dot\",d:s,transform:function(t,e){var n,i,a,s=(n=function(t,e){var n=r.radialScale(t[1]),i=(r.angularScale(t[0])+r.orientation)*Math.PI/180;return{r:n,t:i}}(o),i=n.r*Math.cos(n.t),a=n.r*Math.sin(n.t),{x:i,y:a});return\"translate(\"+[s.x,s.y]+\")\"}})};var c=e.svg.line.radial().interpolate(t[0].data.lineInterpolation).radius(function(t){return r.radialScale(t[1])}).angle(function(t){return r.angularScale(t[0])*Math.PI/180});u.line=function(n,i,a){var s=n[2]?o[a].map(function(t,e){return[t[0],t[1]+t[2]]}):o[a];if(e.select(this).each(u.dot).style({opacity:function(e,r){return+t[a].data.dotVisible},fill:d.stroke(n,i,a)}).attr({class:\"mark dot\"}),!(i>0)){var l=e.select(this.parentNode).selectAll(\"path.line\").data([0]);l.enter().insert(\"path\"),l.attr({class:\"line\",d:c(s),transform:function(t,e){return\"rotate(\"+(r.orientation+90)+\")\"},\"pointer-events\":\"none\"}).style({fill:function(t,e){return d.fill(n,i,a)},\"fill-opacity\":0,stroke:function(t,e){return d.stroke(n,i,a)},\"stroke-width\":function(t,e){return d[\"stroke-width\"](n,i,a)},\"stroke-dasharray\":function(t,e){return d[\"stroke-dasharray\"](n,i,a)},opacity:function(t,e){return d.opacity(n,i,a)},display:function(t,e){return d.display(n,i,a)}})}};var h=r.angularScale.range(),f=Math.abs(h[1]-h[0])/o[0].length*Math.PI/180,p=e.svg.arc().startAngle(function(t){return-f/2}).endAngle(function(t){return f/2}).innerRadius(function(t){return r.radialScale(l+(t[2]||0))}).outerRadius(function(t){return r.radialScale(l+(t[2]||0))+r.radialScale(t[1])});u.arc=function(t,n,i){e.select(this).attr({class:\"mark arc\",d:p,transform:function(t,e){return\"rotate(\"+(r.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,r,i){return n[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\"}},g=e.select(this).selectAll(\"g.layer\").data(o);g.enter().append(\"g\").attr({class:\"layer\"});var v=g.selectAll(\"path.mark\").data(function(t,e){return t});v.enter().append(\"path\").attr({class:\"mark\"}),v.style(d).each(u[r.geometryType]),v.exit().remove(),g.exit().remove()})}return i.config=function(e){return arguments.length?(e.forEach(function(e,r){t[r]||(t[r]={}),Qm(t[r],ty.PolyChart.defaultConfig()),Qm(t[r],e)}),this):t},i.getColorScale=function(){},e.rebind(i,r,\"on\"),i},ty.PolyChart.defaultConfig=function(){return{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:e.scale.category20()}}},ty.BarChart=function(){return ty.PolyChart()},ty.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:\"bar\"}}},ty.AreaChart=function(){return ty.PolyChart()},ty.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:\"arc\"}}},ty.DotPlot=function(){return ty.PolyChart()},ty.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:\"dot\",dotType:\"circle\"}}},ty.LinePlot=function(){return ty.PolyChart()},ty.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:\"line\"}}},ty.Legend=function(){var t=ty.Legend.defaultConfig(),r=e.dispatch(\"hover\");function n(){var r=t.legendConfig,i=t.data.map(function(t,e){return[].concat(t).map(function(t,n){var i=Qm({},r.elements[e]);return i.name=t,i.color=[].concat(r.elements[e].color)[n],i})}),a=e.merge(i);a=a.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(a=a.reverse());var o=r.container;(\"string\"==typeof o||o.nodeName)&&(o=e.select(o));var s=a.map(function(t,e){return t.color}),l=r.fontSize,u=null==r.isContinuous?\"number\"==typeof a[0]:r.isContinuous,c=u?r.height:l*a.length,h=o.classed(\"legend-group\",!0).selectAll(\"svg\").data([0]),f=h.enter().append(\"svg\").attr({width:300,height:c+l,xmlns:\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",version:\"1.1\"});f.append(\"g\").classed(\"legend-axis\",!0),f.append(\"g\").classed(\"legend-marks\",!0);var p=e.range(a.length),d=e.scale[u?\"linear\":\"ordinal\"]().domain(p).range(s),g=e.scale[u?\"linear\":\"ordinal\"]().domain(p)[u?\"range\":\"rangePoints\"]([0,c]);if(u){var v=h.select(\".legend-marks\").append(\"defs\").append(\"linearGradient\").attr({id:\"grad1\",x1:\"0%\",y1:\"0%\",x2:\"0%\",y2:\"100%\"}).selectAll(\"stop\").data(s);v.enter().append(\"stop\"),v.attr({offset:function(t,e){return e/(s.length-1)*100+\"%\"}}).style({\"stop-color\":function(t,e){return t}}),h.append(\"rect\").classed(\"legend-mark\",!0).attr({height:r.height,width:r.colorBandWidth,fill:\"url(#grad1)\"})}else{var m=h.select(\".legend-marks\").selectAll(\"path.legend-mark\").data(a);m.enter().append(\"path\").classed(\"legend-mark\",!0),m.attr({transform:function(t,e){return\"translate(\"+[l/2,g(e)+l/2]+\")\"},d:function(t,r){var n,i,a,o=t.symbol;return a=3*(i=l),\"line\"===(n=o)?\"M\"+[[-i/2,-i/12],[i/2,-i/12],[i/2,i/12],[-i/2,i/12]]+\"Z\":-1!=e.svg.symbolTypes.indexOf(n)?e.svg.symbol().type(n).size(a)():e.svg.symbol().type(\"square\").size(a)()},fill:function(t,e){return d(e)}}),m.exit().remove()}var y=e.svg.axis().scale(g).orient(\"right\"),x=h.select(\"g.legend-axis\").attr({transform:\"translate(\"+[u?r.colorBandWidth:l,l/2]+\")\"}).call(y);return x.selectAll(\".domain\").style({fill:\"none\",stroke:\"none\"}),x.selectAll(\"line\").style({fill:\"none\",stroke:u?r.textColor:\"none\"}),x.selectAll(\"text\").style({fill:r.textColor,\"font-size\":r.fontSize}).text(function(t,e){return a[e].name}),n}return n.config=function(e){return arguments.length?(Qm(t,e),this):t},e.rebind(n,r,\"on\"),n},ty.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}}},ty.tooltipPanel=function(){var t,r,n,i={container:null,hasTick:!1,fontSize:12,color:\"white\",padding:5},a=\"tooltip-\"+ty.tooltipPanel.uid++,o=10,s=function(){var e=(t=i.container.selectAll(\"g.\"+a).data([0])).enter().append(\"g\").classed(a,!0).style({\"pointer-events\":\"none\",display:\"none\"});return n=e.append(\"path\").style({fill:\"white\",\"fill-opacity\":.9}).attr({d:\"M0 0\"}),r=e.append(\"text\").attr({dx:i.padding+o,dy:.3*+i.fontSize}),s};return s.text=function(a){var l=e.hsl(i.color).l,u=l>=.5?\"#aaa\":\"white\",c=l>=.5?\"black\":\"white\",h=a||\"\";r.style({fill:c,\"font-size\":i.fontSize+\"px\"}).text(h);var f=i.padding,p=r.node().getBBox(),d={fill:i.color,stroke:u,\"stroke-width\":\"2px\"},g=p.width+2*f+o,v=p.height+2*f;return n.attr({d:\"M\"+[[o,-v/2],[o,-v/4],[i.hasTick?0:o,0],[o,v/4],[o,v/2],[g,v/2],[g,-v/2]].join(\"L\")+\"Z\"}).style(d),t.attr({transform:\"translate(\"+[o,-v/2+2*f]+\")\"}),t.style({display:\"block\"}),s},s.move=function(e){if(t)return t.attr({transform:\"translate(\"+[e[0],e[1]]+\")\"}).style({display:\"block\"}),s},s.hide=function(){if(t)return t.style({display:\"none\"}),s},s.show=function(){if(t)return t.style({display:\"block\"}),s},s.config=function(t){return Qm(i,t),s},s},ty.tooltipPanel.uid=1,ty.adapter={},ty.adapter.plotly=function(){var t={convert:function(t,r){var n={};if(t.data&&(n.data=t.data.map(function(t,e){var n=Qm({},t);return[[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\"]]].forEach(function(t,e){ty.util.translator.apply(null,t.concat(r))}),r||delete n.marker,r&&delete n.groupId,r?(\"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}),!r&&t.layout&&\"stack\"===t.layout.barmode)){var i=ty.util.duplicates(n.data.map(function(t,e){return t.geometry}));n.data.forEach(function(t,e){var r=i.indexOf(t.geometry);-1!=r&&(n.data[e].groupId=r)})}if(t.layout){var a=Qm({},t.layout);if([[a,[\"plot_bgcolor\"],[\"backgroundColor\"]],[a,[\"showlegend\"],[\"showLegend\"]],[a,[\"radialaxis\"],[\"radialAxis\"]],[a,[\"angularaxis\"],[\"angularAxis\"]],[a.angularaxis,[\"showline\"],[\"gridLinesVisible\"]],[a.angularaxis,[\"showticklabels\"],[\"labelsVisible\"]],[a.angularaxis,[\"nticks\"],[\"ticksCount\"]],[a.angularaxis,[\"tickorientation\"],[\"tickOrientation\"]],[a.angularaxis,[\"ticksuffix\"],[\"ticksSuffix\"]],[a.angularaxis,[\"range\"],[\"domain\"]],[a.angularaxis,[\"endpadding\"],[\"endPadding\"]],[a.radialaxis,[\"showline\"],[\"gridLinesVisible\"]],[a.radialaxis,[\"tickorientation\"],[\"tickOrientation\"]],[a.radialaxis,[\"ticksuffix\"],[\"ticksSuffix\"]],[a.radialaxis,[\"range\"],[\"domain\"]],[a.angularAxis,[\"showline\"],[\"gridLinesVisible\"]],[a.angularAxis,[\"showticklabels\"],[\"labelsVisible\"]],[a.angularAxis,[\"nticks\"],[\"ticksCount\"]],[a.angularAxis,[\"tickorientation\"],[\"tickOrientation\"]],[a.angularAxis,[\"ticksuffix\"],[\"ticksSuffix\"]],[a.angularAxis,[\"range\"],[\"domain\"]],[a.angularAxis,[\"endpadding\"],[\"endPadding\"]],[a.radialAxis,[\"showline\"],[\"gridLinesVisible\"]],[a.radialAxis,[\"tickorientation\"],[\"tickOrientation\"]],[a.radialAxis,[\"ticksuffix\"],[\"ticksSuffix\"]],[a.radialAxis,[\"range\"],[\"domain\"]],[a.font,[\"outlinecolor\"],[\"outlineColor\"]],[a.legend,[\"traceorder\"],[\"reverseOrder\"]],[a,[\"labeloffset\"],[\"labelOffset\"]],[a,[\"defaultcolorrange\"],[\"defaultColorRange\"]]].forEach(function(t,e){ty.util.translator.apply(null,t.concat(r))}),r?(void 0!==a.tickLength&&(a.angularaxis.ticklen=a.tickLength,delete a.tickLength),a.tickColor&&(a.angularaxis.tickcolor=a.tickColor,delete a.tickColor)):(a.angularAxis&&void 0!==a.angularAxis.ticklen&&(a.tickLength=a.angularAxis.ticklen),a.angularAxis&&void 0!==a.angularAxis.tickcolor&&(a.tickColor=a.angularAxis.tickcolor)),a.legend&&\"boolean\"!=typeof a.legend.reverseOrder&&(a.legend.reverseOrder=\"normal\"!=a.legend.reverseOrder),a.legend&&\"boolean\"==typeof a.legend.traceorder&&(a.legend.traceorder=a.legend.traceorder?\"reversed\":\"normal\",delete a.legend.reverseOrder),a.margin&&void 0!==a.margin.t){var o=[\"t\",\"r\",\"b\",\"l\",\"pad\"],s=[\"top\",\"right\",\"bottom\",\"left\",\"pad\"],l={};e.entries(a.margin).forEach(function(t,e){l[s[o.indexOf(t.key)]]=t.value}),a.margin=l}r&&(delete a.needsEndSpacing,delete a.minorTickColor,delete a.minorTicks,delete a.angularaxis.ticksCount,delete a.angularaxis.ticksCount,delete a.angularaxis.ticksStep,delete a.angularaxis.rewriteTicks,delete a.angularaxis.nticks,delete a.radialaxis.ticksCount,delete a.radialaxis.ticksCount,delete a.radialaxis.ticksStep,delete a.radialaxis.rewriteTicks,delete a.radialaxis.nticks),n.layout=a}return n}};return t};var ey,ry=ne.extendDeepAll,ny=ey={};ny.framework=function(t){var r,n,i,a,o,s=new 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<e.length-1},getCommands:function(){return e},getPreviousCommand:function(){return e[r-1]},getIndex:function(){return r}}};function l(n,s){return s&&(o=s),e.select(e.select(o).node().parentNode).selectAll(\".svg-container>*:not(.chart-root)\").remove(),r=r?ry(r,n):n,i||(i=Km.Axis()),a=Km.adapter.plotly().convert(r),i.config(a).render(o),t.data=r.data,t.layout=r.layout,ny.fillLayout(t),r}return l.isPolar=!0,l.svg=function(){return i.svg()},l.getConfig=function(){return r},l.getLiveConfig=function(){return Km.adapter.plotly().convert(i.getLiveConfig(),!0)},l.getLiveScales=function(){return{t:i.angularScale(),r:i.radialScale()}},l.setUndoPoint=function(){var t,e,i=this,a=Km.util.cloneJson(r);t=a,e=n,s.add({undo:function(){e&&i(e)},redo:function(){i(t)}}),n=Km.util.cloneJson(a)},l.undo=function(){s.undo()},l.redo=function(){s.redo()},l},ny.fillLayout=function(t){var r=e.select(t).selectAll(\".plot-container\"),n=r.selectAll(\".svg-container\"),i=t.framework&&t.framework.svg&&t.framework.svg(),a={width:800,height:600,paper_bgcolor:Oe.background,_container:r,_paperdiv:n,_paper:i};t._fullLayout=ry(a,t.layout)};var iy={};(iy=Km).manager=ey;var ay={},oy=Gm.enforce,sy=Gm.clean,ly=Nn,uy=0;function cy(t,e){try{t._fullLayout._paper.style(\"background\",e)}catch(t){ne.error(t)}}function hy(t,e){cy(t,Oe.combine(e,\"white\"))}function fy(t,e){t._context||(t._context=ne.extendDeep({},b));var r,n,i,a=t._context;if(e){for(n=Object.keys(e),r=0;r<n.length;r++)\"editable\"!==(i=n[r])&&\"edits\"!==i&&i in a&&(\"setBackground\"===i&&\"opaque\"===e[i]?a[i]=hy:a[i]=e[i]);e.plot3dPixelRatio&&!a.plotGlPixelRatio&&(a.plotGlPixelRatio=a.plot3dPixelRatio);var o=e.editable;if(void 0!==o)for(a.editable=o,n=Object.keys(a.edits),r=0;r<n.length;r++)a.edits[n[r]]=o;if(e.edits)for(n=Object.keys(e.edits),r=0;r<n.length;r++)(i=n[r])in a.edits&&(a.edits[i]=e.edits[i])}a.staticPlot&&(a.editable=!1,a.edits={},a.autosizable=!1,a.scrollZoom=!1,a.doubleClick=!1,a.showTips=!1,a.showLink=!1,a.displayModeBar=!1),\"hover\"!==a.displayModeBar||Sa||(a.displayModeBar=!0),\"transparent\"!==a.setBackground&&\"function\"==typeof a.setBackground||(a.setBackground=cy)}function py(t,e){var r,n,i=e+1,a=[];for(r=0;r<t.length;r++)(n=t[r])<0?a.push(i+n):a.push(n);return a}function dy(t,e,r){var n,i;for(n=0;n<e.length;n++){if((i=e[n])!==parseInt(i,10))throw new Error(\"all values in \"+r+\" must be integers\");if(i>=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 gy(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]),dy(t,e,\"currentIndices\"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&dy(t,r,\"newIndices\"),void 0!==r&&e.length!==r.length)throw new Error(\"current and new indices must be of equal length.\")}function vy(t,e,n,i,a){!function(t,e,r,n){var i=ne.isPlainObject(n);if(!Array.isArray(t.data))throw new Error(\"gd.data must be an array\");if(!ne.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 dy(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,n,i);for(var o=function(t,e,n,i){var a,o,s,l,u,c=ne.isPlainObject(i),h=[];for(var f in Array.isArray(n)||(n=[n]),n=py(n,t.data.length-1),e)for(var p=0;p<n.length;p++){if(a=t.data[n[p]],o=(s=ne.nestedProperty(a,f)).get(),l=e[f][p],!ne.isArrayOrTypedArray(l))throw new Error(\"attribute: \"+f+\" index: \"+p+\" must be an array\");if(!ne.isArrayOrTypedArray(o))throw new Error(\"cannot extend missing or non-array attribute: \"+f);if(o.constructor!==l.constructor)throw new Error(\"cannot extend array with an array of a different type: \"+f);u=c?i[f][p]:i,r(u)||(u=-1),h.push({prop:s,target:o,insert:l,maxp:Math.floor(u)})}return h}(t,e,n,i),s={},l={},u=0;u<o.length;u++){var c=o[u].prop,h=o[u].maxp,f=a(o[u].target,o[u].insert,h);c.set(f[0]),Array.isArray(s[c.astr])||(s[c.astr]=[]),s[c.astr].push(f[1]),Array.isArray(l[c.astr])||(l[c.astr]=[]),l[c.astr].push(o[u].target.length)}return{update:s,maxPoints:l}}function my(t,e){var r=new t.constructor(t.length+e.length);return r.set(t),r.set(e,t.length),r}function yy(t){return void 0===t?null:t}function xy(t,e,r){var n,i,a=t._fullLayout,o=t._fullData,s=t.data,l=ye.traceFlags(),u={},c={};function h(){return r.map(function(){})}function f(t){var e=ri.id2name(t);-1===i.indexOf(e)&&i.push(e)}function p(t){return\"LAYOUT\"+t+\".autorange\"}function d(t){return\"LAYOUT\"+t+\".range\"}function g(n,i,a){var o;Array.isArray(n)?n.forEach(function(t){g(t,i,a)}):n in e||Vv.hasParent(e,n)||(o=\"LAYOUT\"===n.substr(0,6)?ne.nestedProperty(t.layout,n.replace(\"LAYOUT\",\"\")):ne.nestedProperty(s[r[a]],n),n in c||(c[n]=h()),void 0===c[n][a]&&(c[n][a]=yy(o.get())),void 0!==i&&o.set(i))}for(var v in e){if(Vv.hasParent(e,v))throw new Error(\"cannot set \"+v+\"and a parent attribute simultaneously\");var m,y,x,b,_,w,M=e[v];if(u[v]=M,\"LAYOUT\"!==v.substr(0,6)){for(c[v]=h(),n=0;n<r.length;n++)if(m=s[r[n]],y=o[r[n]],b=(x=ne.nestedProperty(m,v)).get(),void 0!==(_=Array.isArray(M)?M[n%M.length]:M)){if((w=nn.getTraceValObject(y,x.parts))&&w.impliedEdits&&null!==_)for(var A in w.impliedEdits)g(ne.relativeAttr(v,A),w.impliedEdits[A],n);else if(\"colorbar.thicknessmode\"===v&&x.get()!==_&&-1!==[\"fraction\",\"pixels\"].indexOf(_)&&y.colorbar){var k=-1!==[\"top\",\"bottom\"].indexOf(y.colorbar.orient)?a.height-a.margin.t-a.margin.b:a.width-a.margin.l-a.margin.r;g(\"colorbar.thickness\",y.colorbar.thickness*(\"fraction\"===_?1/k:k),n)}else if(\"colorbar.lenmode\"===v&&x.get()!==_&&-1!==[\"fraction\",\"pixels\"].indexOf(_)&&y.colorbar){var T=-1!==[\"top\",\"bottom\"].indexOf(y.colorbar.orient)?a.width-a.margin.l-a.margin.r:a.height-a.margin.t-a.margin.b;g(\"colorbar.len\",y.colorbar.len*(\"fraction\"===_?1/T:T),n)}else\"colorbar.tick0\"!==v&&\"colorbar.dtick\"!==v||g(\"colorbar.tickmode\",\"linear\",n);if(\"type\"===v&&\"pie\"===_!=(\"pie\"===b)){var S=\"x\",E=\"y\";\"bar\"!==_&&\"bar\"!==b||\"h\"!==m.orientation||(S=\"y\",E=\"x\"),ne.swapAttrs(m,[\"?\",\"?src\"],\"labels\",S),ne.swapAttrs(m,[\"d?\",\"?0\"],\"label\",S),ne.swapAttrs(m,[\"?\",\"?src\"],\"values\",E),\"pie\"===b?(ne.nestedProperty(m,\"marker.color\").set(ne.nestedProperty(m,\"marker.colors\").get()),a._pielayer.selectAll(\"g.trace\").remove()):P.traceIs(m,\"cartesian\")&&ne.nestedProperty(m,\"marker.colors\").set(ne.nestedProperty(m,\"marker.color\").get())}c[v][n]=yy(b);if(-1!==[\"swapxy\",\"swapxyaxes\",\"orientation\",\"orientationaxes\"].indexOf(v)){if(\"orientation\"===v){x.set(_);var C=m.x&&!m.y?\"h\":\"v\";if((x.get()||C)===y.orientation)continue}else\"orientationaxes\"===v&&(m.orientation={v:\"h\",h:\"v\"}[y.orientation]);Vv.swapXYData(m),l.calc=l.clearAxisTypes=!0}else-1!==_n.dataArrayContainers.indexOf(x.parts[0])?(Vv.manageArrayContainers(x,_,c),l.calc=!0):(w?w.arrayOk&&(ne.isArrayOrTypedArray(_)||ne.isArrayOrTypedArray(b))?l.calc=!0:ye.update(l,w):l.calc=!0,x.set(_))}if(-1!==[\"swapxyaxes\",\"orientationaxes\"].indexOf(v)&&ri.swap(t,r),\"orientationaxes\"===v){var L=ne.nestedProperty(t.layout,\"hovermode\");\"x\"===L.get()?L.set(\"y\"):\"y\"===L.get()&&L.set(\"x\")}if(-1!==[\"orientation\",\"type\"].indexOf(v)){for(i=[],n=0;n<r.length;n++){var z=s[r[n]];P.traceIs(z,\"cartesian\")&&(f(z.xaxis||\"x\"),f(z.yaxis||\"y\"),\"type\"===v&&g([\"autobinx\",\"autobiny\"],!0,n))}g(i.map(p),!0,0),g(i.map(d),[0,1],0)}}else x=ne.nestedProperty(t.layout,v.replace(\"LAYOUT\",\"\")),c[v]=[yy(x.get())],x.set(Array.isArray(M)?M[0]:M),l.calc=!0}var I=!1,D=ri.list(t);for(n=0;n<D.length;n++)if(D[n].autorange){I=!0;break}return(l.calc||l.calcIfAutorange&&I)&&(l.clearCalc=!0),(l.calc||l.plot||l.calcIfAutorange)&&(l.fullReplot=!0),{flags:l,undoit:c,redoit:u,traces:r,eventData:ne.extendDeepNoArrays([],[u,r])}}function by(t,e){var r,n,i,a=t.layout,o=t._fullLayout,s=Object.keys(e),l=ri.list(t),u={};for(n=0;n<s.length;n++)if(0===s[n].indexOf(\"allaxes\")){for(i=0;i<l.length;i++){var c=l[i]._id.substr(1),h=-1!==c.indexOf(\"scene\")?c+\".\":\"\",f=s[n].replace(\"allaxes\",h+l[i]._name);e[f]||(e[f]=e[s[n]])}delete e[s[n]]}var p=ye.layoutFlags(),d={},g={};function v(t,r){if(Array.isArray(t))t.forEach(function(t){v(t,r)});else if(!(t in e||Vv.hasParent(e,t))){var n=ne.nestedProperty(a,t);t in g||(g[t]=yy(n.get())),void 0!==r&&n.set(r)}}var m,y={};function x(t){var e=ri.name2id(t.split(\".\")[0]);return y[e]=1,e}for(var b in e){if(Vv.hasParent(e,b))throw new Error(\"cannot set \"+b+\"and a parent attribute simultaneously\");for(var _=ne.nestedProperty(a,b),w=e[b],M=_.parts.length,A=M-1;A>0&&\"string\"!=typeof _.parts[M-1];)A--;var k=_.parts[A],T=_.parts[A-1]+\".\"+k,S=_.parts.slice(0,A).join(\".\"),E=ne.nestedProperty(t.layout,S).get(),C=ne.nestedProperty(o,S).get(),L=_.get();if(void 0!==w){d[b]=w,g[b]=\"reverse\"===k?w:yy(L);var z=nn.getLayoutValObject(o,_.parts);if(z&&z.impliedEdits&&null!==w)for(var I in z.impliedEdits)v(ne.relativeAttr(b,I),z.impliedEdits[I]);if(-1!==[\"width\",\"height\"].indexOf(b)&&null===w)o[b]=t._initialAutoSize[b];else if(T.match(/^[xyz]axis[0-9]*\\.range(\\[[0|1]\\])?$/))x(T),ne.nestedProperty(o,S+\"._inputRange\").set(null);else if(T.match(/^[xyz]axis[0-9]*\\.autorange$/)){x(T),ne.nestedProperty(o,S+\"._inputRange\").set(null);var D=ne.nestedProperty(o,S).get();D._inputDomain&&(D._input.domain=D._inputDomain.slice())}else T.match(/^[xyz]axis[0-9]*\\.domain(\\[[0|1]\\])?$/)&&ne.nestedProperty(o,S+\"._inputDomain\").set(null);if(\"type\"===k){var O=E,R=\"linear\"===C.type&&\"log\"===w,F=\"log\"===C.type&&\"linear\"===w;if(R||F){if(O&&O.range)if(C.autorange)R&&(O.range=O.range[1]>O.range[0]?[1,2]:[2,1]);else{var B=O.range[0],N=O.range[1];R?(B<=0&&N<=0&&v(S+\".autorange\",!0),B<=0?B=N/1e6:N<=0&&(N=B/1e6),v(S+\".range[0]\",Math.log(B)/Math.LN10),v(S+\".range[1]\",Math.log(N)/Math.LN10)):(v(S+\".range[0]\",Math.pow(10,B)),v(S+\".range[1]\",Math.pow(10,N)))}else v(S+\".autorange\",!0);Array.isArray(o._subplots.polar)&&o._subplots.polar.length&&o[_.parts[0]]&&\"radialaxis\"===_.parts[1]&&delete o[_.parts[0]]._subplot.viewInitial[\"radialaxis.range\"],P.getComponentMethod(\"annotations\",\"convertCoords\")(t,C,w,v),P.getComponentMethod(\"images\",\"convertCoords\")(t,C,w,v)}else v(S+\".autorange\",!0),v(S+\".range\",null);ne.nestedProperty(o,S+\"._inputRange\").set(null)}else if(k.match(Te.AX_NAME_PATTERN)){var j=ne.nestedProperty(o,b).get(),V=(w||{}).type;V&&\"-\"!==V||(V=\"linear\"),P.getComponentMethod(\"annotations\",\"convertCoords\")(t,j,V,v),P.getComponentMethod(\"images\",\"convertCoords\")(t,j,V,v)}var U=Jv.containerArrayMatch(b);if(U){r=U.array,n=U.index;var q=U.property,H=(ne.nestedProperty(a,r)||[])[n]||{},G=H,W=z||{editType:\"calc\"},Y=-1!==W.editType.indexOf(\"calcIfAutorange\");\"\"===n?(Y?p.calc=!0:ye.update(p,W),Y=!1):\"\"===q&&(G=w,Jv.isAddVal(w)?g[b]=null:Jv.isRemoveVal(w)?(g[b]=H,G=H):ne.warn(\"unrecognized full object value\",e)),Y&&(wy(t,G,\"x\")||wy(t,G,\"y\"))?p.calc=!0:ye.update(p,W),u[r]||(u[r]={});var X=u[r][n];X||(X=u[r][n]={}),X[q]=w,delete e[b]}else\"reverse\"===k?(E.range?E.range.reverse():(v(S+\".autorange\",!0),E.range=[1,0]),C.autorange?p.calc=!0:p.plot=!0):(o._has(\"scatter-like\")&&o._has(\"regl\")&&\"dragmode\"===b&&(\"lasso\"===w||\"select\"===w)&&\"lasso\"!==L&&\"select\"!==L?p.plot=!0:z?ye.update(p,z):p.calc=!0,_.set(w))}}for(r in u){Jv.applyContainerArrayChanges(t,ne.nestedProperty(a,r),u[r],p)||(p.plot=!0)}var Z=o._axisConstraintGroups||[];for(m in y)for(n=0;n<Z.length;n++){var J=Z[n];if(J[m])for(var K in p.calc=!0,J)y[K]||(ri.getFromId(t,K)._constraintShrinkable=!0)}return(_y(t)||e.height||e.width)&&(p.plot=!0),(p.plot||p.calc)&&(p.layoutReplot=!0),{flags:p,undoit:g,redoit:d,eventData:ne.extendDeep({},d)}}function _y(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&_n.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function wy(t,e,r){if(!ne.isPlainObject(e))return!1;var n=e[r+\"ref\"]||r,i=ri.getFromId(t,n);return i||n.charAt(0)!==r||(i=ri.getFromId(t,r)),(i||{}).autorange}function My(t,e,r,n){var i,a,o=n.getValObject,s=n.flags,l=n.immutable,u=n.inArray,c=n.arrayIndex,h=n.gd,f=n.autoranged;function p(){var t=i.editType;-1!==t.indexOf(\"calcIfAutorange\")&&(f||void 0===f&&(wy(h,e,\"x\")||wy(h,e,\"y\")))?s.calc=!0:u&&-1!==t.indexOf(\"arraydraw\")?ne.pushUnique(s.arrays[u],c):ye.update(s,i)}function d(t){return\"data_array\"===t.valType||t.arrayOk}var g=e._fullInput,v=t._fullInput;for(a in g&&g!==e&&(e=g),v&&v!==t&&(t=v),t){if(s.calc)return;var m=t[a],y=e[a];if(\"_\"!==a.charAt(0)&&\"function\"!=typeof m&&m!==y){if(\"tick0\"===a||\"dtick\"===a){var x=e.tickmode;if(\"auto\"===x||\"array\"===x||!x)continue}if((\"range\"!==a||!e.autorange)&&(\"zmin\"!==a&&\"zmax\"!==a||\"contourcarpet\"!==e.type)){var b=r.concat(a);if(i=o(b)){var _,w=i.valType,M=d(i),A=Array.isArray(m),k=Array.isArray(y);if(A&&k){var T=\"_input_\"+a,S=t[T],E=e[T];if(Array.isArray(S)&&S===E)continue}if(void 0===y)M&&A?s.calc=!0:p();else if(i._isLinkedToArray){var C=[],L=!1;u||(s.arrays[a]=C);var z=Math.min(m.length,y.length),P=Math.max(m.length,y.length);if(z!==P){if(\"arraydraw\"!==i.editType){p();continue}L=!0}for(_=0;_<z;_++)My(m[_],y[_],b.concat(_),ne.extendFlat({inArray:a,arrayIndex:_},n));if(L)for(_=z;_<P;_++)C.push(_)}else!w&&ne.isPlainObject(m)?My(m,y,b,n):M?A&&k?l&&(s.calc=!0):A!==k?s.calc=!0:p():A&&k&&m.length===y.length&&String(m)===String(y)||p()}}}}for(a in e)if(!(a in t||\"_\"===a.charAt(0)||\"function\"==typeof e[a])){if(d(i=o(r.concat(a)))&&Array.isArray(e[a]))return void(s.calc=!0);p()}}function Ay(t){var r=e.select(t),n=t._fullLayout;if(n._container=r.selectAll(\".plot-container\").data([0]),n._container.enter().insert(\"div\",\":first-child\").classed(\"plot-container\",!0).classed(\"plotly\",!0),n._paperdiv=n._container.selectAll(\".svg-container\").data([0]),n._paperdiv.enter().append(\"div\").classed(\"svg-container\",!0).style(\"position\",\"relative\"),n._glcontainer=n._paperdiv.selectAll(\".gl-container\").data([{}]),n._glcontainer.enter().append(\"div\").classed(\"gl-container\",!0),n._glcanvas=null,n._paperdiv.selectAll(\".main-svg\").remove(),n._paper=n._paperdiv.insert(\"svg\",\":first-child\").classed(\"main-svg\",!0),n._toppaper=n._paperdiv.append(\"svg\").classed(\"main-svg\",!0),!n._uid){var i=[];e.selectAll(\"defs\").each(function(){this.id&&i.push(this.id.split(\"-\")[1])}),n._uid=ne.randstr(i)}n._paperdiv.selectAll(\".main-svg\").attr($e.svgAttrs),n._defs=n._paper.append(\"defs\").attr(\"id\",\"defs-\"+n._uid),n._clips=n._defs.append(\"g\").classed(\"clips\",!0),n._topdefs=n._toppaper.append(\"defs\").attr(\"id\",\"topdefs-\"+n._uid),n._topclips=n._topdefs.append(\"g\").classed(\"clips\",!0),n._bgLayer=n._paper.append(\"g\").classed(\"bglayer\",!0),n._draggers=n._paper.append(\"g\").classed(\"draglayer\",!0);var a=n._paper.append(\"g\").classed(\"layer-below\",!0);n._imageLowerLayer=a.append(\"g\").classed(\"imagelayer\",!0),n._shapeLowerLayer=a.append(\"g\").classed(\"shapelayer\",!0),n._cartesianlayer=n._paper.append(\"g\").classed(\"cartesianlayer\",!0),n._polarlayer=n._paper.append(\"g\").classed(\"polarlayer\",!0),n._ternarylayer=n._paper.append(\"g\").classed(\"ternarylayer\",!0),n._geolayer=n._paper.append(\"g\").classed(\"geolayer\",!0),n._pielayer=n._paper.append(\"g\").classed(\"pielayer\",!0),n._glimages=n._paper.append(\"g\").classed(\"glimages\",!0);var o=n._toppaper.append(\"g\").classed(\"layer-above\",!0);n._imageUpperLayer=o.append(\"g\").classed(\"imagelayer\",!0),n._shapeUpperLayer=o.append(\"g\").classed(\"shapelayer\",!0),n._infolayer=n._toppaper.append(\"g\").classed(\"infolayer\",!0),n._menulayer=n._toppaper.append(\"g\").classed(\"menulayer\",!0),n._zoomlayer=n._toppaper.append(\"g\").classed(\"zoomlayer\",!0),n._hoverlayer=n._toppaper.append(\"g\").classed(\"hoverlayer\",!0),t.emit(\"plotly_framework\")}ay.plot=function(t,r,n,i){var a;if(t=ne.getGraphDiv(t),ja.init(t),ne.isPlainObject(r)){var o=r;r=o.data,n=o.layout,i=o.config,a=o.frames}if(!1===ja.triggerHandler(t,\"plotly_beforeplot\",[r,n,i]))return Promise.reject();r||n||ne.isPlotDiv(t)||ne.warn(\"Calling Plotly.plot as if redrawing but this container doesn't yet have a plot.\",t),fy(t,i),n||(n={}),e.select(t).classed(\"js-plotly-plot\",!0),Sr.makeTester(),Array.isArray(t._promises)||(t._promises=[]);var s=0===(t.data||[]).length&&Array.isArray(r);if(Array.isArray(r)&&(Vv.cleanData(r,t.data),s?t.data=r:t.data.push.apply(t.data,r),t.empty=!1),t.layout&&!s||(t.layout=Vv.cleanLayout(n)),t._dragging&&!t._transitioning)return t._replotPending=!0,Promise.reject();t._replotPending=!1,_n.supplyDefaults(t);var l=t._fullLayout,u=l._has(\"cartesian\");if(!l._has(\"polar\")&&r&&r[0]&&r[0].r)return ne.log(\"Legacy polar charts are deprecated!\"),function(t,r,n){var i=e.select(t).selectAll(\".plot-container\").data([0]);i.enter().insert(\"div\",\":first-child\").classed(\"plot-container plotly\",!0);var a=i.selectAll(\".svg-container\").data([0]);a.enter().append(\"div\").classed(\"svg-container\",!0).style(\"position\",\"relative\"),a.html(\"\"),r&&(t.data=r);n&&(t.layout=n);iy.manager.fillLayout(t),a.style({width:t._fullLayout.width+\"px\",height:t._fullLayout.height+\"px\"}),t.framework=iy.manager.framework(t),t.framework({data:t.data,layout:t.layout},a.node()),t.framework.setUndoPoint();var o=t.framework.svg(),s=1,l=t._fullLayout.title;\"\"!==l&&l||(s=0);var u=function(){this.call(er.convertToTspans,t)},c=o.select(\".title-group text\").call(u);if(t._context.edits.titleText){var h=ne._(t,\"Click to enter Plot title\");l&&l!==h||(s=.2,c.attr({\"data-unformatted\":h}).text(h).style({opacity:s}).on(\"mouseover.opacity\",function(){e.select(this).transition().duration(100).style(\"opacity\",1)}).on(\"mouseout.opacity\",function(){e.select(this).transition().duration(1e3).style(\"opacity\",0)}));var f=function(){this.call(er.makeEditable,{gd:t}).on(\"edit\",function(e){t.framework({layout:{title:e}}),this.text(e).call(u),this.call(f)}).on(\"cancel\",function(){var t=this.attr(\"data-unformatted\");this.text(t).call(u)})};c.call(f)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),_n.addLinks(t),Promise.resolve()}(t,r,n);l._replotting=!0,s&&Ay(t),t.framework!==Ay&&(t.framework=Ay,Ay(t)),Sr.initGradients(t),s&&ri.saveShowSpikeInitial(t);var c=!t.calcdata||t.calcdata.length!==(t._fullData||[]).length;c&&_n.doCalcdata(t);for(var h=0;h<t.calcdata.length;h++)t.calcdata[h][0].trace=t._fullData[h];var f=JSON.stringify(l._size);function p(){var e,r,n,i=t.calcdata;for(P.getComponentMethod(\"legend\",\"draw\")(t),P.getComponentMethod(\"rangeselector\",\"draw\")(t),P.getComponentMethod(\"sliders\",\"draw\")(t),P.getComponentMethod(\"updatemenus\",\"draw\")(t),e=0;e<i.length;e++)!0===(n=(r=i[e])[0].trace).visible&&n._module.colorbar?n._module.colorbar(t,r):_n.autoMargin(t,\"cb\"+n.uid);return _n.doAutoMargin(t),_n.previousPromises(t)}function d(){if(!t._transitioning){for(var e=ri.list(t,\"\",!0),r=0;r<e.length;r++){var n=e[r];sy(t,n),ly(n)}oy(t),s&&ri.saveRangeInitial(t)}}var g=[_n.previousPromises,function(){if(a)return ay.addFrames(t,a)},function(){for(var e=l._basePlotModules,r=0;r<e.length;r++)e[r].drawFramework&&e[r].drawFramework(t);return!l._glcanvas&&l._has(\"gl\")&&(l._glcanvas=l._glcontainer.selectAll(\".gl-canvas\").data([{key:\"contextLayer\",context:!0,pick:!1},{key:\"focusLayer\",context:!1,pick:!1},{key:\"pickLayer\",context:!1,pick:!0}],function(t){return t.key}),l._glcanvas.enter().append(\"canvas\").attr(\"class\",function(t){return\"gl-canvas gl-canvas-\"+t.key.replace(\"Layer\",\"\")}).style({position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",overflow:\"visible\",\"pointer-events\":\"none\"})),l._glcanvas&&l._glcanvas.attr(\"width\",l.width).attr(\"height\",l.height),ne.syncOrAsync([Vm.layoutStyles],t)},p,function(){if(JSON.stringify(l._size)!==f)return ne.syncOrAsync([p,Vm.layoutStyles],t)}];u&&g.push(function(){if(c){var e,r,n,i=l._subplots.cartesian,a=l._modules,o=[];for(n=0;n<a.length;n++)ne.pushUnique(o,a[n].setPositions);if(o.length)for(r=0;r<i.length;r++)for(e=l._plots[i[r]],n=0;n<o.length;n++)o[n](t,e);return P.getComponentMethod(\"errorbars\",\"calc\")(t),ne.syncOrAsync([P.getComponentMethod(\"shapes\",\"calcAutorange\"),P.getComponentMethod(\"annotations\",\"calcAutorange\"),d,P.getComponentMethod(\"rangeslider\",\"calcAutorange\")],t)}d()}),g.push(Vm.layoutStyles),u&&g.push(function(){return ri.doTicks(t,\"redraw\")}),g.push(function(){var e,r=t.calcdata,n=l._infolayer.selectAll(\"g.rangeslider-container\");for(e=0;e<r.length;e++){var i=r[e][0].trace,a=!0===i.visible,o=i.uid;if(!a||!P.traceIs(i,\"2dMap\")){var s=\".hm\"+o+\",.contour\"+o+\",#clip\"+o;l._paper.selectAll(s).remove(),n.selectAll(s).remove()}a&&i._module.colorbar||l._infolayer.selectAll(\".cb\"+o).remove()}var u=l._basePlotModules;for(e=0;e<u.length;e++)u[e].plot(t);var c=l._paper.selectAll(\".layer-subplot\");return l._shapeSubplotLayers=c.selectAll(\".shapelayer\"),_n.style(t),P.getComponentMethod(\"shapes\",\"draw\")(t),P.getComponentMethod(\"annotations\",\"draw\")(t),_n.addLinks(t),l._replotting=!1,_n.previousPromises(t)},function(){P.getComponentMethod(\"shapes\",\"draw\")(t),P.getComponentMethod(\"images\",\"draw\")(t),P.getComponentMethod(\"annotations\",\"draw\")(t),P.getComponentMethod(\"legend\",\"draw\")(t),P.getComponentMethod(\"rangeslider\",\"draw\")(t),P.getComponentMethod(\"rangeselector\",\"draw\")(t),P.getComponentMethod(\"sliders\",\"draw\")(t),P.getComponentMethod(\"updatemenus\",\"draw\")(t)},jm,_n.rehover,_n.previousPromises);var v=ne.syncOrAsync(g,t);return v&&v.then||(v=Promise.resolve()),v.then(function(){return t.emit(\"plotly_afterplot\"),t})},ay.setPlotConfig=function(t){return ne.extendFlat(b,t)},ay.redraw=function(t){if(t=ne.getGraphDiv(t),!ne.isPlotDiv(t))throw new Error(\"This element is not a Plotly plot: \"+t);return Vv.cleanData(t.data,t.data),Vv.cleanLayout(t.layout),t.calcdata=void 0,ay.plot(t).then(function(){return t.emit(\"plotly_redraw\"),t})},ay.newPlot=function(t,e,r,n){return t=ne.getGraphDiv(t),_n.cleanPlot([],{},t._fullData||{},t._fullLayout||{}),_n.purge(t),ay.plot(t,e,r,n)},ay.extendTraces=function t(e,r,n,i){var a=vy(e=ne.getGraphDiv(e),r,n,i,function(t,e,r){var n,i;if(ne.isTypedArray(t))if(r<0){var a=new t.constructor(0),o=my(t,e);r<0?(n=o,i=a):(n=a,i=o)}else if(n=new t.constructor(r),i=new t.constructor(t.length+e.length-r),r===e.length)n.set(e),i.set(t);else if(r<e.length){var s=e.length-r;n.set(e.subarray(s)),i.set(t),i.set(e.subarray(0,s),t.length)}else{var l=r-e.length,u=t.length-l;n.set(t.subarray(u)),n.set(e,l),i.set(t.subarray(0,u))}else n=t.concat(e),i=r>=0&&r<n.length?n.splice(0,n.length-r):[];return[n,i]}),o=ay.redraw(e),s=[e,a.update,n,a.maxPoints];return Nv.add(e,ay.prependTraces,s,t,arguments),o},ay.prependTraces=function t(e,r,n,i){var a=vy(e=ne.getGraphDiv(e),r,n,i,function(t,e,r){var n,i;if(ne.isTypedArray(t))if(r<=0){var a=new t.constructor(0),o=my(e,t);r<0?(n=o,i=a):(n=a,i=o)}else if(n=new t.constructor(r),i=new t.constructor(t.length+e.length-r),r===e.length)n.set(e),i.set(t);else if(r<e.length){var s=e.length-r;n.set(e.subarray(0,s)),i.set(e.subarray(s)),i.set(t,s)}else{var l=r-e.length;n.set(e),n.set(t.subarray(0,l),e.length),i.set(t.subarray(l))}else n=e.concat(t),i=r>=0&&r<n.length?n.splice(r,n.length):[];return[n,i]}),o=ay.redraw(e),s=[e,a.update,n,a.maxPoints];return Nv.add(e,ay.extendTraces,s,t,arguments),o},ay.addTraces=function t(e,r,n){e=ne.getGraphDiv(e);var i,a,o=[],s=ay.deleteTraces,l=t,u=[e,o],c=[e,r];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<e.length;n++)if(\"object\"!=typeof(i=e[n])||Array.isArray(i)||null===i)throw new Error(\"all values in traces array must be non-array objects\");if(void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&r.length!==e.length)throw new Error(\"if indices is specified, traces.length must equal indices.length\")}(e,r,n),Array.isArray(r)||(r=[r]),r=r.map(function(t){return ne.extendFlat({},t)}),Vv.cleanData(r,e.data),i=0;i<r.length;i++)e.data.push(r[i]);for(i=0;i<r.length;i++)o.push(-r.length+i);if(void 0===n)return a=ay.redraw(e),Nv.add(e,s,u,l,c),a;Array.isArray(n)||(n=[n]);try{gy(e,o,n)}catch(t){throw e.data.splice(e.data.length-r.length,r.length),t}return Nv.startSequence(e),Nv.add(e,s,u,l,c),a=ay.moveTraces(e,o,n),Nv.stopSequence(e),a},ay.deleteTraces=function t(e,r){e=ne.getGraphDiv(e);var n,i,a=[],o=ay.addTraces,s=t,l=[e,a,r],u=[e,r];if(void 0===r)throw new Error(\"indices must be an integer or array of integers.\");for(Array.isArray(r)||(r=[r]),dy(e,r,\"indices\"),(r=py(r,e.data.length-1)).sort(ne.sorterDes),n=0;n<r.length;n+=1)i=e.data.splice(r[n],1)[0],a.push(i);var c=ay.redraw(e);return Nv.add(e,o,l,s,u),c},ay.moveTraces=function t(e,r,n){var i,a=[],o=[],s=t,l=t,u=[e=ne.getGraphDiv(e),n,r],c=[e,r,n];if(gy(e,r,n),r=Array.isArray(r)?r:[r],void 0===n)for(n=[],i=0;i<r.length;i++)n.push(-r.length+i);for(n=Array.isArray(n)?n:[n],r=py(r,e.data.length-1),n=py(n,e.data.length-1),i=0;i<e.data.length;i++)-1===r.indexOf(i)&&a.push(e.data[i]);for(i=0;i<r.length;i++)o.push({newIndex:n[i],trace:e.data[r[i]]});for(o.sort(function(t,e){return t.newIndex-e.newIndex}),i=0;i<o.length;i+=1)a.splice(o[i].newIndex,0,o[i].trace);e.data=a;var h=ay.redraw(e);return Nv.add(e,s,u,l,c),h},ay.restyle=function t(e,r,n,i){e=ne.getGraphDiv(e),Vv.clearPromiseQueue(e);var a={};if(\"string\"==typeof r)a[r]=n;else{if(!ne.isPlainObject(r))return ne.warn(\"Restyle fail.\",r,n,i),Promise.reject();a=ne.extendFlat({},r),void 0===i&&(i=n)}Object.keys(a).length&&(e.changed=!0);var o=Vv.coerceTraceIndices(e,i),s=xy(e,a,o),l=s.flags;l.clearCalc&&(e.calcdata=void 0),l.clearAxisTypes&&Vv.clearAxisTypes(e,o,{});var u=[];l.fullReplot?u.push(ay.plot):(u.push(_n.previousPromises),_n.supplyDefaults(e),l.style&&u.push(Vm.doTraceStyle),l.colorbars&&u.push(Vm.doColorBars)),u.push(_n.rehover),Nv.add(e,t,[e,s.undoit,s.traces],t,[e,s.redoit,s.traces]);var c=ne.syncOrAsync(u,e);return c&&c.then||(c=Promise.resolve()),c.then(function(){return e.emit(\"plotly_restyle\",s.eventData),e})},ay.relayout=function t(e,r,n){if(e=ne.getGraphDiv(e),Vv.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);var i={};if(\"string\"==typeof r)i[r]=n;else{if(!ne.isPlainObject(r))return ne.warn(\"Relayout fail.\",r,n),Promise.reject();i=ne.extendFlat({},r)}Object.keys(i).length&&(e.changed=!0);var a=by(e,i),o=a.flags;o.calc&&(e.calcdata=void 0),o.margins&&Vv.clearAxisAutomargins(e);var s=[_n.previousPromises];o.layoutReplot?s.push(Vm.layoutReplot):Object.keys(i).length&&(_n.supplyDefaults(e),o.legend&&s.push(Vm.doLegend),o.layoutstyle&&s.push(Vm.layoutStyles),o.ticks&&s.push(Vm.doTicksRelayout),o.modebar&&s.push(Vm.doModeBar),o.camera&&s.push(Vm.doCamera)),s.push(_n.rehover),Nv.add(e,t,[e,a.undoit],t,[e,a.redoit]);var l=ne.syncOrAsync(s,e);return l&&l.then||(l=Promise.resolve(e)),l.then(function(){return e.emit(\"plotly_relayout\",a.eventData),e})},ay.update=function t(e,r,n,i){if(e=ne.getGraphDiv(e),Vv.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);ne.isPlainObject(r)||(r={}),ne.isPlainObject(n)||(n={}),Object.keys(r).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var a=Vv.coerceTraceIndices(e,i),o=xy(e,ne.extendFlat({},r),a),s=o.flags,l=by(e,ne.extendFlat({},n)),u=l.flags;(s.clearCalc||u.calc)&&(e.calcdata=void 0),s.clearAxisTypes&&Vv.clearAxisTypes(e,a,n),u.margins&&Vv.clearAxisAutomargins(e);var c=[];if(s.fullReplot&&u.layoutReplot){var h=e.data,f=e.layout;e.data=void 0,e.layout=void 0,c.push(function(){return ay.plot(e,h,f)})}else s.fullReplot?c.push(ay.plot):u.layoutReplot?c.push(Vm.layoutReplot):(c.push(_n.previousPromises),_n.supplyDefaults(e),s.style&&c.push(Vm.doTraceStyle),s.colorbars&&c.push(Vm.doColorBars),u.legend&&c.push(Vm.doLegend),u.layoutstyle&&c.push(Vm.layoutStyles),u.ticks&&c.push(Vm.doTicksRelayout),u.modebar&&c.push(Vm.doModeBar),u.camera&&c.push(Vm.doCamera));c.push(_n.rehover),Nv.add(e,t,[e,o.undoit,l.undoit,o.traces],t,[e,o.redoit,l.redoit,o.traces]);var p=ne.syncOrAsync(c,e);return p&&p.then||(p=Promise.resolve(e)),p.then(function(){return e.emit(\"plotly_update\",{data:o.eventData,layout:l.eventData}),e})},ay.react=function(t,e,r,n){var i,a;var o=(t=ne.getGraphDiv(t))._fullData,s=t._fullLayout;if(ne.isPlotDiv(t)&&o&&s){if(ne.isPlainObject(e)){var l=e;e=l.data,r=l.layout,n=l.config,i=l.frames}var u=!1;if(n){var c=ne.extendDeep({},t._context);t._context=void 0,fy(t,n),u=function t(e,r){var n;for(n in e){var i=e[n],a=r[n];if(i!==a)if(ne.isPlainObject(i)&&ne.isPlainObject(a)){if(t(i,a))return!0}else{if(!Array.isArray(i)||!Array.isArray(a))return!0;if(i.length!==a.length)return!0;for(var o=0;o<i.length;o++)if(i[o]!==a[o]){if(!ne.isPlainObject(i[o])||!ne.isPlainObject(a[o]))return!0;if(t(i[o],a[o]))return!0}}}}(c,t._context)}t.data=e||[],Vv.cleanData(t.data,[]),t.layout=r||{},Vv.cleanLayout(t.layout),_n.supplyDefaults(t);var h=t._fullData,f=t._fullLayout,p=void 0===f.datarevision,d=function(t,e,r,n){if(e.length!==r.length)return{fullReplot:!0,clearCalc:!0};var i,a,o=ye.traceFlags();o.arrays={};var s={getValObject:function(t){return nn.getTraceValObject(a,t)},flags:o,immutable:n,gd:t};for(i=0;i<e.length;i++)a=r[i],s.autoranged=!!a.xaxis&&(ri.getFromId(t,a.xaxis).autorange||ri.getFromId(t,a.yaxis).autorange),My(e[i],a,[],s);(o.calc||o.plot||o.calcIfAutorange)&&(o.fullReplot=!0);return o}(t,o,h,p),g=function(t,e,r,n){var i=ye.layoutFlags();i.arrays={},My(e,r,[],{getValObject:function(t){return nn.getLayoutValObject(r,t)},flags:i,immutable:n,gd:t}),(i.plot||i.calc)&&(i.layoutReplot=!0);return i}(t,s,f,p);_y(t)&&(g.layoutReplot=!0),(d.calc||g.calc)&&(t.calcdata=void 0),g.margins&&Vv.clearAxisAutomargins(t);var v=[];if(i&&(t._transitionData={},_n.createTransitionData(t),v.push(function(){return ay.addFrames(t,i)})),d.fullReplot||g.layoutReplot||u)t._fullLayout._skipDefaults=!0,v.push(ay.plot);else{for(var m in g.arrays){var y=g.arrays[m];if(y.length){var x=P.getComponentMethod(m,\"drawOne\");if(x!==ne.noop)for(var b=0;b<y.length;b++)x(t,y[b]);else{var _=P.getComponentMethod(m,\"draw\");if(_===ne.noop)throw new Error(\"cannot draw components: \"+m);_(t)}}}v.push(_n.previousPromises),d.style&&v.push(Vm.doTraceStyle),d.colorbars&&v.push(Vm.doColorBars),g.legend&&v.push(Vm.doLegend),g.layoutstyle&&v.push(Vm.layoutStyles),g.ticks&&v.push(Vm.doTicksRelayout),g.modebar&&v.push(Vm.doModeBar),g.camera&&v.push(Vm.doCamera)}v.push(_n.rehover),(a=ne.syncOrAsync(v,t))&&a.then||(a=Promise.resolve(t))}else a=ay.newPlot(t,e,r,n);return a.then(function(){return t.emit(\"plotly_react\",{data:e,layout:r}),t})},ay.animate=function(t,e,r){if(t=ne.getGraphDiv(t),!ne.isPlotDiv(t))throw new Error(\"This element is not a Plotly plot: \"+t+\". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/\");var n=t._transitionData;n._frameQueue||(n._frameQueue=[]);var i=(r=_n.supplyAnimationDefaults(r)).transition,a=r.frame;function o(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function s(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function l(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,u){function c(){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,_n.transition(t,e.frame.data,e.frame.layout,Vv.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 h(){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&&c()};e()}var f,p,d=0;function g(t){return Array.isArray(i)?d>=i.length?t.transitionOpts=i[d]:t.transitionOpts=i[0]:t.transitionOpts=i,d++,t}var v=[],m=void 0===e||null===e,y=Array.isArray(e);if(!m&&!y&&ne.isPlainObject(e))v.push({type:\"object\",data:g(ne.extendFlat({},e))});else if(m||-1!==[\"string\",\"number\"].indexOf(typeof e))for(f=0;f<n._frames.length;f++)(p=n._frames[f])&&(m||String(p.group)===String(e))&&v.push({type:\"byname\",name:String(p.name),data:g({name:p.name})});else if(y)for(f=0;f<e.length;f++){var x=e[f];-1!==[\"number\",\"string\"].indexOf(typeof x)?(x=String(x),v.push({type:\"byname\",name:x,data:g({name:x})})):ne.isPlainObject(x)&&v.push({type:\"object\",data:g(ne.extendFlat({},x))})}for(f=0;f<v.length;f++)if(\"byname\"===(p=v[f]).type&&!n._frameHash[p.data.name])return ne.warn('animate failure: frame not found: \"'+p.data.name+'\"'),void u();-1!==[\"next\",\"immediate\"].indexOf(r.mode)&&function(){if(0!==n._frameQueue.length){for(;n._frameQueue.length;){var e=n._frameQueue.pop();e.onInterrupt&&e.onInterrupt()}t.emit(\"plotly_animationinterrupted\",[])}}(),\"reverse\"===r.direction&&v.reverse();var b=t._fullLayout._currentFrame;if(b&&r.fromcurrent){var _=-1;for(f=0;f<v.length;f++)if(\"byname\"===(p=v[f]).type&&p.name===b){_=f;break}if(_>0&&_<v.length-1){var w=[];for(f=0;f<v.length;f++)p=v[f],(\"byname\"!==v[f].type||f>_)&&w.push(p);v=w}}v.length>0?function(e){if(0!==e.length){for(var i=0;i<e.length;i++){var c;c=\"byname\"===e[i].type?_n.computeFrame(t,e[i].name):e[i].data;var f=s(i),p=o(i);p.duration=Math.min(p.duration,f.duration);var d={frame:c,name:e[i].name,frameOpts:f,transitionOpts:p};i===e.length-1&&(d.onComplete=l(a,2),d.onInterrupt=u),n._frameQueue.push(d)}\"immediate\"===r.mode&&(n._lastFrameAt=-1/0),n._animationRaf||h()}}(v):(t.emit(\"plotly_animated\"),a())})},ay.addFrames=function(t,e,r){if(t=ne.getGraphDiv(t),null===e||void 0===e)return Promise.resolve();if(!ne.isPlotDiv(t))throw new Error(\"This element is not a Plotly plot: \"+t+\". It's likely that you've failed to create a plot before adding frames. For more details, see https://plot.ly/javascript/animations/\");var n,i,a,o,s=t._transitionData._frames,l=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error(\"addFrames failure: frameList must be an Array of frame definitions\"+e);var u=s.length+2*e.length,c=[],h={};for(n=e.length-1;n>=0;n--)if(ne.isPlainObject(e[n])){var f=e[n].name,p=(l[f]||h[f]||{}).name,d=e[n].name,g=l[p]||h[p];p&&d&&\"number\"==typeof d&&g&&uy<5&&(uy++,ne.warn('addFrames: overwriting frame \"'+(l[p]||h[p]).name+'\" with a frame whose name of type \"number\" also equates to \"'+p+'\". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===uy&&ne.warn(\"addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.\")),h[f]={name:f},c.push({frame:_n.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:u+n})}c.sort(function(t,e){return t.index>e.index?-1:t.index<e.index?1:0});var v=[],m=[],y=s.length;for(n=c.length-1;n>=0;n--){if(\"number\"==typeof(i=c[n].frame).name&&ne.warn(\"Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings\"),!i.name)for(;l[i.name=\"frame \"+t._transitionData._counter++];);if(l[i.name]){for(a=0;a<s.length&&(s[a]||{}).name!==i.name;a++);v.push({type:\"replace\",index:a,value:i}),m.unshift({type:\"replace\",index:a,value:s[a]})}else o=Math.max(0,Math.min(c[n].index,y)),v.push({type:\"insert\",index:o,value:i}),m.unshift({type:\"delete\",index:o}),y++}var x=_n.modifyFrames,b=_n.modifyFrames,_=[t,m],w=[t,v];return Nv&&Nv.add(t,x,_,b,w),_n.modifyFrames(t,v)},ay.deleteFrames=function(t,e){if(t=ne.getGraphDiv(t),!ne.isPlotDiv(t))throw new Error(\"This element is not a Plotly plot: \"+t);var r,n,i=t._transitionData._frames,a=[],o=[];if(!e)for(e=[],r=0;r<i.length;r++)e.push(r);for((e=e.slice(0)).sort(),r=e.length-1;r>=0;r--)n=e[r],a.push({type:\"delete\",index:n}),o.unshift({type:\"insert\",index:n,value:i[n]});var s=_n.modifyFrames,l=_n.modifyFrames,u=[t,o],c=[t,a];return Nv&&Nv.add(t,s,u,l,c),_n.modifyFrames(t,a)},ay.purge=function(t){var e=(t=ne.getGraphDiv(t))._fullLayout||{},r=t._fullData||[];return _n.cleanPlot([],{},r,e),_n.purge(t),ja.purge(t),e._container&&e._container.remove(),delete t._context,t};var ky={getDelay:function(t){return t._has&&(t._has(\"gl3d\")||t._has(\"gl2d\")||t._has(\"mapbox\"))?500:0},getRedrawFunc:function(t){var e=t._fullLayout||{};if(!(!(e._has&&e._has(\"polar\"))&&t.data&&t.data[0]&&t.data[0].r))return function(){(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()})}}},Ty=Da.EventEmitter;var Sy=function(t){var e=t.emitter||new Ty,r=new Promise(function(n,i){var a=window.Image,o=t.svg,s=t.format||\"png\";if(ne.isIE()&&\"svg\"!==s){var l=new Error(\"Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.\");return i(l),t.promise?r:e.emit(\"error\",l)}var u=t.canvas,c=t.scale||1,h=c*(t.width||300),f=c*(t.height||150),p=u.getContext(\"2d\"),d=new a,g=\"data:image/svg+xml,\"+encodeURIComponent(o);u.width=h,u.height=f,d.onload=function(){var r;switch(\"svg\"!==s&&p.drawImage(d,0,0,h,f),s){case\"jpeg\":r=u.toDataURL(\"image/jpeg\");break;case\"png\":r=u.toDataURL(\"image/png\");break;case\"webp\":r=u.toDataURL(\"image/webp\");break;case\"svg\":r=g;break;default:var a=\"Image format is not jpeg, png, svg or webp.\";if(i(new Error(a)),!t.promise)return e.emit(\"error\",a)}n(r),t.promise||e.emit(\"success\",r)},d.onerror=function(r){if(i(r),!t.promise)return e.emit(\"error\",r)},d.src=g});return t.promise?r:e},Ey=/\"/g,Cy=new RegExp('(\"TOBESTRIPPED)|(TOBESTRIPPED\")',\"g\");var Ly=function(t,r,n){var i,a=t._fullLayout,o=a._paper,s=a._toppaper,l=a.width,u=a.height;o.insert(\"rect\",\":first-child\").call(Sr.setRect,0,0,l,u).call(Oe.fill,a.paper_bgcolor);var c=a._basePlotModules||[];for(i=0;i<c.length;i++){var h=c[i];h.toSVG&&h.toSVG(t)}if(s){var f=s.node().childNodes,p=Array.prototype.slice.call(f);for(i=0;i<p.length;i++){var d=p[i];d.childNodes.length&&o.node().appendChild(d)}}a._draggers&&a._draggers.remove(),o.node().style.background=\"\",o.selectAll(\"text\").attr({\"data-unformatted\":null,\"data-math\":null}).each(function(){var t=e.select(this);if(\"hidden\"!==this.style.visibility&&\"none\"!==this.style.display){t.style({visibility:null,display:null});var r=this.style.fontFamily;r&&-1!==r.indexOf('\"')&&t.style(\"font-family\",r.replace(Ey,\"TOBESTRIPPED\"))}else t.remove()}),o.selectAll(\".point,.scatterpts\").each(function(){var t=e.select(this),r=this.style.fill;r&&-1!==r.indexOf(\"url(\")&&t.style(\"fill\",r.replace(Ey,\"TOBESTRIPPED\"))}),\"pdf\"!==r&&\"eps\"!==r||o.selectAll(\"#MathJax_SVG_glyphs path\").attr(\"stroke-width\",0),o.node().setAttributeNS($e.xmlns,\"xmlns\",$e.svg),o.node().setAttributeNS($e.xmlns,\"xmlns:xlink\",$e.xlink),\"svg\"===r&&n&&(o.attr(\"width\",n*l),o.attr(\"height\",n*u),o.attr(\"viewBox\",\"0 0 \"+l+\" \"+u));var g=(new window.XMLSerializer).serializeToString(o.node());return g=function(t){var r=e.select(\"body\").append(\"div\").style({display:\"none\"}).html(\"\"),n=t.replace(/(&[^;]*;)/gi,function(t){return\"<\"===t?\"<\":\"&rt;\"===t?\">\":-1!==t.indexOf(\"<\")||-1!==t.indexOf(\">\")?\"\":r.html(t).text()});return r.remove(),n}(g),g=(g=g.replace(/&(?!\\w+;|\\#[0-9]+;| \\#x[0-9A-F]+;)/g,\"&\")).replace(Cy,\"'\"),ne.isIE()&&(g=(g=(g=g.replace(/\"/gi,\"'\")).replace(/(\\('#)([^']*)('\\))/gi,'(\"#$2\")')).replace(/(\\\\')/gi,'\"')),g},zy={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}},Py=/^data:image\\/\\w+;base64,/;var Iy=function(t,e){var r,n,i;function a(t){return!(t in e)||ne.validate(e[t],zy[t])}if(e=e||{},ne.isPlainObject(t)?(r=t.data||[],n=t.layout||{},i=t.config||{}):(t=ne.getGraphDiv(t),r=ne.extendDeep([],t.data),n=ne.extendDeep({},t.layout),i=t._context),!a(\"width\")||!a(\"height\"))throw new Error(\"Height and width should be pixel values.\");if(!a(\"format\"))throw new Error(\"Image format is not jpeg, png, svg or webp.\");var o={};function s(t,r){return ne.coerce(e,o,zy,t,r)}var l=s(\"format\"),u=s(\"width\"),c=s(\"height\"),h=s(\"scale\"),f=s(\"setBackground\"),p=s(\"imageDataOnly\"),d=document.createElement(\"div\");d.style.position=\"absolute\",d.style.left=\"-5000px\",document.body.appendChild(d);var g=ne.extendFlat({},n);u&&(g.width=u),c&&(g.height=c);var v=ne.extendFlat({},i,{staticPlot:!0,setBackground:f}),m=ky.getRedrawFunc(d);function y(){return new Promise(function(t){setTimeout(t,ky.getDelay(d._fullLayout))})}function x(){return new Promise(function(t,e){var r=Ly(d,l,h),n=d._fullLayout.width,i=d._fullLayout.height;if(ay.purge(d),document.body.removeChild(d),\"svg\"===l)return t(p?r:\"data:image/svg+xml,\"+encodeURIComponent(r));var a=document.createElement(\"canvas\");a.id=ne.randstr(),Sy({format:l,width:n,height:i,scale:h,canvas:a,svg:r,promise:!0}).then(t).catch(e)})}return new Promise(function(t,e){ay.plot(d,r,g,v).then(m).then(y).then(x).then(function(e){t(function(t){return p?t.replace(Py,\"\"):t}(e))}).catch(function(t){e(t)})})},Dy=ne.isPlainObject,Oy=Array.isArray,Ry=ne.isArrayOrTypedArray;function Fy(t,e,r,n,i,a){a=a||[];for(var o=Object.keys(t),s=0;s<o.length;s++){var l=o[s];if(\"transforms\"!==l){var u=a.slice();u.push(l);var c=t[l],h=e[l],f=Uy(r,l),p=\"info_array\"===(f||{}).valType,d=\"colorscale\"===(f||{}).valType,g=(f||{}).items;if(Vy(r,l))if(Dy(c)&&Dy(h))Fy(c,h,f,n,i,u);else if(p&&Oy(c)){c.length>h.length&&n.push(jy(\"unused\",i,u.concat(h.length)));var v,m,y,x,b,_=h.length,w=Array.isArray(g);if(w&&(_=Math.min(_,g.length)),2===f.dimensions)for(m=0;m<_;m++)if(Oy(c[m])){c[m].length>h[m].length&&n.push(jy(\"unused\",i,u.concat(m,h[m].length)));var M=h[m].length;for(v=0;v<(w?Math.min(M,g[m].length):M);v++)y=w?g[m][v]:g,x=c[m][v],b=h[m][v],ne.validate(x,y)?b!==x&&b!==+x&&n.push(jy(\"dynamic\",i,u.concat(m,v),x,b)):n.push(jy(\"value\",i,u.concat(m,v),x))}else n.push(jy(\"array\",i,u.concat(m),c[m]));else for(m=0;m<_;m++)y=w?g[m]:g,x=c[m],b=h[m],ne.validate(x,y)?b!==x&&b!==+x&&n.push(jy(\"dynamic\",i,u.concat(m),x,b)):n.push(jy(\"value\",i,u.concat(m),x))}else if(f.items&&!p&&Oy(c)){var A,k,T=g[Object.keys(g)[0]],S=[];for(A=0;A<h.length;A++){var E=h[A]._index||A;(k=u.slice()).push(E),Dy(c[E])&&Dy(h[A])&&(S.push(E),Fy(c[E],h[A],T,n,i,k))}for(A=0;A<c.length;A++)(k=u.slice()).push(A),Dy(c[A])?-1===S.indexOf(A)&&n.push(jy(\"unused\",i,k)):n.push(jy(\"object\",i,k,c[A]))}else!Dy(c)&&Dy(h)?n.push(jy(\"object\",i,u,c)):Ry(c)||!Ry(h)||p||d?l in e?ne.validate(c,f)?\"enumerated\"===f.valType&&(f.coerceNumber&&c!==+h||c!==h)&&n.push(jy(\"dynamic\",i,u,c,h)):n.push(jy(\"value\",i,u,c)):n.push(jy(\"unused\",i,u,c)):n.push(jy(\"array\",i,u,c));else n.push(jy(\"schema\",i,u))}}return n}var By={object:function(t,e){return(\"layout\"===t&&\"\"===e?\"The layout argument\":\"data\"===t[0]&&\"\"===e?\"Trace \"+t[1]+\" in the data argument\":Ny(t)+\"key \"+e)+\" must be linked to an object container\"},array:function(t,e){return(\"data\"===t?\"The data argument\":Ny(t)+\"key \"+e)+\" must be linked to an array container\"},schema:function(t,e){return Ny(t)+\"key \"+e+\" is not part of the schema\"},unused:function(t,e,r){var n=Dy(r)?\"container\":\"key\";return Ny(t)+n+\" \"+e+\" did not get coerced\"},dynamic:function(t,e,r,n){return[Ny(t)+\"key\",e,\"(set to '\"+r+\"')\",\"got reset to\",\"'\"+n+\"'\",\"during defaults.\"].join(\" \")},invisible:function(t){return\"Trace \"+t[1]+\" got defaulted to be not visible\"},value:function(t,e,r){return[Ny(t)+\"key \"+e,\"is set to an invalid value (\"+r+\")\"].join(\" \")}};function Ny(t){return Oy(t)?\"In data trace \"+t[1]+\", \":\"In \"+t+\", \"}function jy(t,e,r,n,i){var a,o;r=r||\"\",Oy(e)?(a=e[0],o=e[1]):(a=e,o=null);var s=function(t){if(!Oy(t))return String(t);for(var e=\"\",r=0;r<t.length;r++){var n=t[r];\"number\"==typeof n?e=e.substr(0,e.length-1)+\"[\"+n+\"]\":e+=n,r<t.length-1&&(e+=\".\")}return e}(r),l=By[t](e,s,n,i);return ne.log(l),{code:t,container:a,trace:o,path:r,astr:s,msg:l}}function Vy(t,e){var r=Hy(e),n=r.keyMinusId,i=r.id;return!!(n in t&&t[n]._isSubplotObj&&i)||e in t}function Uy(t,e){return t[Hy(e).keyMinusId]}var qy=ne.counterRegex(\"([a-z]+)\");function Hy(t){var e=t.match(qy);return{keyMinusId:e&&e[1],id:e&&e[2]}}var Gy=function(t,e){var r=document.createElement(\"a\"),n=\"download\"in r,i=/Version\\/[\\d\\.]+.*Safari/.test(navigator.userAgent);return new Promise(function(a,o){if(\"undefined\"!=typeof navigator&&/MSIE [1-9]\\./.test(navigator.userAgent)&&o(new Error(\"IE < 10 unsupported\")),i&&(document.location.href=\"data:application/octet-stream\"+t.slice(t.search(/[,;]/)),a(e)),e||(e=\"download\"),n&&(r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r),a(e)),\"undefined\"!=typeof navigator&&navigator.msSaveBlob){var s=t.split(/^data:image\\/svg\\+xml,/)[1],l=decodeURIComponent(s);navigator.msSaveBlob(new Blob([l]),e),a(e)}o(new Error(\"download error\"))})};var Wy=function(t,e){return(e=e||{}).format=e.format||\"png\",new Promise(function(r,n){t._snapshotInProgress&&n(new Error(\"Snapshotting already in progress.\")),ne.isIE()&&\"svg\"!==e.format&&n(new Error(\"Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.\")),t._snapshotInProgress=!0;var i=Iy(t,e),a=e.filename||t.fn||\"newplot\";a+=\".\"+e.format,i.then(function(e){return t._snapshotInProgress=!1,Gy(e,a)}).then(function(t){r(t)}).catch(function(e){t._snapshotInProgress=!1,n(e)})})},Yy={};Yy.plot=ay.plot,Yy.newPlot=ay.newPlot,Yy.restyle=ay.restyle,Yy.relayout=ay.relayout,Yy.redraw=ay.redraw,Yy.update=ay.update,Yy.react=ay.react,Yy.extendTraces=ay.extendTraces,Yy.prependTraces=ay.prependTraces,Yy.addTraces=ay.addTraces,Yy.deleteTraces=ay.deleteTraces,Yy.moveTraces=ay.moveTraces,Yy.purge=ay.purge,Yy.addFrames=ay.addFrames,Yy.deleteFrames=ay.deleteFrames,Yy.animate=ay.animate,Yy.setPlotConfig=ay.setPlotConfig,Yy.toImage=Iy,Yy.validate=function(t,e){var r,n,i=nn.get(),a=[],o={_context:ne.extendFlat({},b)};Oy(t)?(o.data=ne.extendDeep([],t),r=t):(o.data=[],r=[],a.push(jy(\"array\",\"data\"))),Dy(e)?(o.layout=ne.extendDeep({},e),n=e):(o.layout={},n={},arguments.length>1&&a.push(jy(\"object\",\"layout\"))),_n.supplyDefaults(o);for(var s=o._fullData,l=r.length,u=0;u<l;u++){var c=r[u],h=[\"data\",u];if(Dy(c)){var f=s[u],p=f.type,d=i.traces[p].attributes;d.type={valType:\"enumerated\",values:[p]},!1===f.visible&&!1!==c.visible&&a.push(jy(\"invisible\",h)),Fy(c,f,d,a,h);var g=c.transforms,v=f.transforms;if(g){Oy(g)||a.push(jy(\"array\",h,[\"transforms\"])),h.push(\"transforms\");for(var m=0;m<g.length;m++){var y=[\"transforms\",m],x=g[m].type;if(Dy(g[m])){var _=i.transforms[x]?i.transforms[x].attributes:{};_.type={valType:\"enumerated\",values:Object.keys(i.transforms)},Fy(g[m],v[m],_,a,h,y)}else a.push(jy(\"object\",h,y))}}}else a.push(jy(\"object\",h))}return Fy(n,o._fullLayout,function(t,e){for(var r=0;r<e.length;r++){var n=e[r].type,i=t.traces[n].layoutAttributes;i&&ne.extendFlat(t.layout.layoutAttributes,i)}return t.layout.layoutAttributes}(i,s),a,\"layout\"),0===a.length?void 0:a},Yy.downloadImage=Wy;var Xy=ne.extendFlat,Zy=ne.extendDeep;function Jy(t){var e;switch(t){case\"themes__thumb\":e={autosize:!0,width:150,height:150,title:\"\",showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case\"thumbnail\":e={title:\"\",hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:\"\",margin:{l:1,r:1,t:1,b:1,pad |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment