-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathplotly-basic.min.js
7 lines (7 loc) · 750 KB
/
plotly-basic.min.js
1
2
3
4
5
6
7
/**
* plotly.js (basic - minified) v1.38.3
* Copyright 2012-2018, Plotly, Inc.
* All rights reserved.
* Licensed under the MIT license
*/
!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(){return function(){return function t(e,r,n){function a(o,l){if(!r[o]){if(!e[o]){var s="function"==typeof require&&require;if(!l&&s)return s(o,!0);if(i)return i(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[o]={exports:{}};e[o][0].call(u.exports,function(t){var r=e[o][1][t];return a(r||t)},u,u.exports,t,e,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o<n.length;o++)a(n[o]);return a}}()({1:[function(t,e,r){"use strict";var n=t("../src/lib"),a={"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 .cursor-grab":"cursor:-webkit-grab;cursor:grab;","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 i in a){var o=i.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,a[i])}},{"../src/lib":163}],2:[function(t,e,r){"use strict";e.exports={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}}},{}],3:[function(t,e,r){"use strict";e.exports=t("../src/traces/bar")},{"../src/traces/bar":259}],4:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":148}],5:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./bar"),t("./pie")]),e.exports=n},{"./bar":3,"./core":4,"./pie":6}],6:[function(t,e,r){"use strict";e.exports=t("../src/traces/pie")},{"../src/traces/pie":274}],7:[function(t,e,r){!function(){var t={version:"3.5.17"},r=[].slice,n=function(t){return r.call(t)},a=this.document;function i(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(a)try{n(a.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}),a)try{a.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var l=this.Element.prototype,s=l.setAttribute,c=l.setAttributeNS,u=this.CSSStyleDeclaration.prototype,f=u.setProperty;l.setAttribute=function(t,e){s.call(this,t,e+"")},l.setAttributeNS=function(t,e,r){c.call(this,t,e,r+"")},u.setProperty=function(t,e,r){f.call(this,t,e+"",r)}}function d(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function p(t){return null===t?NaN:+t}function h(t){return!isNaN(t)}function g(t){return{left:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n<a;){var i=n+a>>>1;t(e[i],r)<0?n=i+1:a=i}return n},right:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n<a;){var i=n+a>>>1;t(e[i],r)>0?a=i:n=i+1}return n}}}t.ascending=d,t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.min=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a<i;)if(null!=(n=t[a])&&n>=n){r=n;break}for(;++a<i;)null!=(n=t[a])&&r>n&&(r=n)}else{for(;++a<i;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=n;break}for(;++a<i;)null!=(n=e.call(t,t[a],a))&&r>n&&(r=n)}return r},t.max=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a<i;)if(null!=(n=t[a])&&n>=n){r=n;break}for(;++a<i;)null!=(n=t[a])&&n>r&&(r=n)}else{for(;++a<i;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=n;break}for(;++a<i;)null!=(n=e.call(t,t[a],a))&&n>r&&(r=n)}return r},t.extent=function(t,e){var r,n,a,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(n=t[i])&&n>=n){r=a=n;break}for(;++i<o;)null!=(n=t[i])&&(r>n&&(r=n),a<n&&(a=n))}else{for(;++i<o;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=a=n;break}for(;++i<o;)null!=(n=e.call(t,t[i],i))&&(r>n&&(r=n),a<n&&(a=n))}return[r,a]},t.sum=function(t,e){var r,n=0,a=t.length,i=-1;if(1===arguments.length)for(;++i<a;)h(r=+t[i])&&(n+=r);else for(;++i<a;)h(r=+e.call(t,t[i],i))&&(n+=r);return n},t.mean=function(t,e){var r,n=0,a=t.length,i=-1,o=a;if(1===arguments.length)for(;++i<a;)h(r=p(t[i]))?n+=r:--o;else for(;++i<a;)h(r=p(e.call(t,t[i],i)))?n+=r:--o;if(o)return n/o},t.quantile=function(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),a=+t[n-1],i=r-n;return i?a+i*(t[n]-a):a},t.median=function(e,r){var n,a=[],i=e.length,o=-1;if(1===arguments.length)for(;++o<i;)h(n=p(e[o]))&&a.push(n);else for(;++o<i;)h(n=p(r.call(e,e[o],o)))&&a.push(n);if(a.length)return t.quantile(a.sort(d),.5)},t.variance=function(t,e){var r,n,a=t.length,i=0,o=0,l=-1,s=0;if(1===arguments.length)for(;++l<a;)h(r=p(t[l]))&&(o+=(n=r-i)*(r-(i+=n/++s)));else for(;++l<a;)h(r=p(e.call(t,t[l],l)))&&(o+=(n=r-i)*(r-(i+=n/++s)));if(s>1)return o/(s-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var v=g(d);function y(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 d(t(e),r)}:t)},t.shuffle=function(t,e,r){(i=arguments.length)<3&&(r=t.length,i<2&&(e=0));for(var n,a,i=r-e;i;)a=Math.random()*i--|0,n=t[i+e],t[i+e]=t[a+e],t[a+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],a=new Array(r<0?0:r);e<r;)a[e]=[n,n=t[++e]];return a},t.transpose=function(e){if(!(i=e.length))return[];for(var r=-1,n=t.min(e,y),a=new Array(n);++r<n;)for(var i,o=-1,l=a[r]=new Array(i);++o<i;)l[o]=e[o][r];return a},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,a=t.length,i=-1,o=0;++i<a;)o+=t[i].length;for(r=new Array(o);--a>=0;)for(e=(n=t[a]).length;--e>=0;)r[--o]=n[e];return r};var m=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,a=[],i=function(t){var e=1;for(;t*e%1;)e*=10;return e}(m(r)),o=-1;if(t*=i,e*=i,(r*=i)<0)for(;(n=t+r*++o)>e;)a.push(n/i);else for(;(n=t+r*++o)<e;)a.push(n/i);return a},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,a=-1,i=t.length;if(1===arguments.length)for(;++a<i;)r.set(a,t[a]);else for(;++a<i;)r.set(e.call(t,n=t[a],a),n)}else for(var o in t)r.set(o,t[o]);return r};var _="__proto__",w="\0";function k(t){return(t+="")===_||t[0]===w?w+t:t}function M(t){return(t+="")[0]===w?t.slice(1):t}function A(t){return k(t)in this._}function T(t){return(t=k(t))in this._&&delete this._[t]}function L(){var t=[];for(var e in this._)t.push(M(e));return t}function S(){var t=0;for(var e in this._)++t;return t}function C(){for(var t in this._)return!1;return!0}function O(){this._=Object.create(null)}function P(t){return t}function z(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function D(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=E.length;r<n;++r){var a=E[r]+e;if(a in t)return a}}x(b,{has:A,get:function(t){return this._[k(t)]},set:function(t,e){return this._[k(t)]=e},remove:T,keys:L,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:M(e),value:this._[e]});return t},size:S,empty:C,forEach:function(t){for(var e in this._)t.call(this,M(e),this._[e])}}),t.nest=function(){var e,r,n={},a=[],i=[];function o(t,i,l){if(l>=a.length)return r?r.call(n,i):e?i.sort(e):i;for(var s,c,u,f,d=-1,p=i.length,h=a[l++],g=new b;++d<p;)(f=g.get(s=h(c=i[d])))?f.push(c):g.set(s,[c]);return t?(c=t(),u=function(e,r){c.set(e,o(t,r,l))}):(c={},u=function(e,r){c[e]=o(t,r,l)}),g.forEach(u),c}return n.map=function(t,e){return o(e,t,0)},n.entries=function(e){return function t(e,r){if(r>=a.length)return e;var n=[],o=i[r++];return e.forEach(function(e,a){n.push({key:e,values:t(a,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 a.push(t),n},n.sortKeys=function(t){return i[a.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 O;if(t)for(var r=0,n=t.length;r<n;++r)e.add(t[r]);return e},x(O,{has:A,add:function(t){return this._[k(t+="")]=!0,t},remove:T,values:L,size:S,empty:C,forEach:function(t){for(var e in this._)t.call(this,M(e))}}),t.behavior={},t.rebind=function(t,e){for(var r,n=1,a=arguments.length;++n<a;)t[r=arguments[n]]=z(t,e,e[r]);return t};var E=["webkit","ms","moz","Moz","o","O"];function N(){}function R(){}function I(t){var e=[],r=new b;function n(){for(var r,n=e,a=-1,i=n.length;++a<i;)(r=n[a].on)&&r.apply(this,arguments);return t}return n.on=function(n,a){var i,o=r.get(n);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,i=e.indexOf(o)).concat(e.slice(i+1)),r.remove(n)),a&&e.push(r.set(n,{on:a})),t)},n}function F(){t.event.preventDefault()}function j(){for(var e,r=t.event;e=r.sourceEvent;)r=e;return r}function B(e){for(var r=new R,n=0,a=arguments.length;++n<a;)r[arguments[n]]=I(r);return r.of=function(n,a){return function(i){try{var o=i.sourceEvent=t.event;i.target=e,t.event=i,r[i.type].apply(n,a)}finally{t.event=o}}},r}t.dispatch=function(){for(var t=new R,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=I(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(H,"\\$&")};var H=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,q={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function V(t){return q(t,X),t}var U=function(t,e){return e.querySelector(t)},G=function(t,e){return e.querySelectorAll(t)},Y=function(t,e){var r=t.matches||t[D(t,"matchesSelector")];return(Y=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(U=function(t,e){return Sizzle(t,e)[0]||null},G=Sizzle,Y=Sizzle.matchesSelector),t.selection=function(){return t.select(a.documentElement)};var X=t.selection.prototype=[];function Z(t){return"function"==typeof t?t:function(){return U(t,this)}}function W(t){return"function"==typeof t?t:function(){return G(t,this)}}X.select=function(t){var e,r,n,a,i=[];t=Z(t);for(var o=-1,l=this.length;++o<l;){i.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var s=-1,c=n.length;++s<c;)(a=n[s])?(e.push(r=t.call(a,a.__data__,s,o)),r&&"__data__"in a&&(r.__data__=a.__data__)):e.push(null)}return V(i)},X.selectAll=function(t){var e,r,a=[];t=W(t);for(var i=-1,o=this.length;++i<o;)for(var l=this[i],s=-1,c=l.length;++s<c;)(r=l[s])&&(a.push(e=n(t.call(r,r.__data__,s,i))),e.parentNode=r);return V(a)};var Q="http://www.w3.org/1999/xhtml",J={svg:"http://www.w3.org/2000/svg",xhtml:Q,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function $(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 K(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,a=e.apply(this,arguments);++n<r;)t[n](this,a)}:function(){for(var n=-1;++n<r;)t[n](this,e)}}function nt(t){var e=tt(t);return function(r,n){if(a=r.classList)return n?a.add(t):a.remove(t);var a=r.getAttribute("class")||"";n?(e.lastIndex=0,e.test(a)||r.setAttribute("class",K(a+" "+t))):r.setAttribute("class",K(a.replace(e," ")))}}function at(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 it(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===Q&&t.documentElement.namespaceURI===Q?t.createElement(e):t.createElementNS(r,e)}}function lt(){var t=this.parentNode;t&&t.removeChild(this)}function st(t){return{__data__:t}}function ct(t){return function(){return Y(this,t)}}function ut(t,e){for(var r=0,n=t.length;r<n;r++)for(var a,i=t[r],o=0,l=i.length;o<l;o++)(a=i[o])&&e(a,o,r);return t}function ft(t){return q(t,dt),t}t.ns={prefix:J,qualify:function(t){var e=t.indexOf(":"),r=t;return e>=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),J.hasOwnProperty(r)?{space:J[r],local:t}:t}},X.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($(r,e[r]));return this}return this.each($(e,r))},X.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=et(t)).length,a=-1;if(e=r.classList){for(;++a<n;)if(!e.contains(t[a]))return!1}else for(e=r.getAttribute("class");++a<n;)if(!tt(t[a]).test(e))return!1;return!0}for(e in t)this.each(rt(e,t[e]));return this}return this.each(rt(t,e))},X.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(at(r,t[r],e));return this}if(n<2){var a=this.node();return o(a).getComputedStyle(a,null).getPropertyValue(t)}r=""}return this.each(at(t,e,r))},X.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(it(e,t[e]));return this}return this.each(it(t,e))},X.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},X.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},X.append=function(t){return t=ot(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},X.insert=function(t,e){return t=ot(t),e=Z(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},X.remove=function(){return this.each(lt)},X.data=function(t,e){var r,n,a=-1,i=this.length;if(!arguments.length){for(t=new Array(i=(r=this[0]).length);++a<i;)(n=r[a])&&(t[a]=n.__data__);return t}function o(t,r){var n,a,i,o=t.length,u=r.length,f=Math.min(o,u),d=new Array(u),p=new Array(u),h=new Array(o);if(e){var g,v=new b,y=new Array(o);for(n=-1;++n<o;)(a=t[n])&&(v.has(g=e.call(a,a.__data__,n))?h[n]=a:v.set(g,a),y[n]=g);for(n=-1;++n<u;)(a=v.get(g=e.call(r,i=r[n],n)))?!0!==a&&(d[n]=a,a.__data__=i):p[n]=st(i),v.set(g,!0);for(n=-1;++n<o;)n in y&&!0!==v.get(y[n])&&(h[n]=t[n])}else{for(n=-1;++n<f;)a=t[n],i=r[n],a?(a.__data__=i,d[n]=a):p[n]=st(i);for(;n<u;++n)p[n]=st(r[n]);for(;n<o;++n)h[n]=t[n]}p.update=d,p.parentNode=d.parentNode=h.parentNode=t.parentNode,l.push(p),s.push(d),c.push(h)}var l=ft([]),s=V([]),c=V([]);if("function"==typeof t)for(;++a<i;)o(r=this[a],t.call(r,r.parentNode.__data__,a));else for(;++a<i;)o(r=this[a],t);return s.enter=function(){return l},s.exit=function(){return c},s},X.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},X.filter=function(t){var e,r,n,a=[];"function"!=typeof t&&(t=ct(t));for(var i=0,o=this.length;i<o;i++){a.push(e=[]),e.parentNode=(r=this[i]).parentNode;for(var l=0,s=r.length;l<s;l++)(n=r[l])&&t.call(n,n.__data__,l,i)&&e.push(n)}return V(a)},X.order=function(){for(var t=-1,e=this.length;++t<e;)for(var r,n=this[t],a=n.length-1,i=n[a];--a>=0;)(r=n[a])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},X.sort=function(t){t=function(t){arguments.length||(t=d);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()},X.each=function(t){return ut(this,function(e,r,n){t.call(e,e.__data__,r,n)})},X.call=function(t){var e=n(arguments);return t.apply(e[0]=this,e),this},X.empty=function(){return!this.node()},X.node=function(){for(var t=0,e=this.length;t<e;t++)for(var r=this[t],n=0,a=r.length;n<a;n++){var i=r[n];if(i)return i}return null},X.size=function(){var t=0;return ut(this,function(){++t}),t};var dt=[];function pt(e,r,a){var i="__on"+e,o=e.indexOf("."),l=gt;o>0&&(e=e.slice(0,o));var s=ht.get(e);function c(){var t=this[i];t&&(this.removeEventListener(e,t,t.$),delete this[i])}return s&&(e=s,l=vt),o?r?function(){var t=l(r,n(arguments));c.call(this),this.addEventListener(e,this[i]=t,t.$=a),t._=r}:c:r?N:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var a in this)if(r=a.match(n)){var i=this[a];this.removeEventListener(r[1],i,i.$),delete this[a]}}}t.selection.enter=ft,t.selection.enter.prototype=dt,dt.append=X.append,dt.empty=X.empty,dt.node=X.node,dt.call=X.call,dt.size=X.size,dt.select=function(t){for(var e,r,n,a,i,o=[],l=-1,s=this.length;++l<s;){n=(a=this[l]).update,o.push(e=[]),e.parentNode=a.parentNode;for(var c=-1,u=a.length;++c<u;)(i=a[c])?(e.push(n[c]=r=t.call(a.parentNode,i.__data__,c,l)),r.__data__=i.__data__):e.push(null)}return V(o)},dt.insert=function(t,e){var r,n,a;return arguments.length<2&&(r=this,e=function(t,e,i){var o,l=r[i].update,s=l.length;for(i!=a&&(a=i,n=0),e>=n&&(n=e+1);!(o=l[n])&&++n<s;);return o}),X.insert.call(this,t,e)},t.select=function(t){var e;return"string"==typeof t?(e=[U(t,a)]).parentNode=a.documentElement:(e=[t]).parentNode=i(t),V([e])},t.selectAll=function(t){var e;return"string"==typeof t?(e=n(G(t,a))).parentNode=a.documentElement:(e=n(t)).parentNode=null,V([e])},X.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 ht=t.map({mouseenter:"mouseover",mouseleave:"mouseout"});function gt(e,r){return function(n){var a=t.event;t.event=n,r[0]=this.__data__;try{e.apply(this,r)}finally{t.event=a}}}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)}}a&&ht.forEach(function(t){"on"+t in a&&ht.remove(t)});var yt,mt=0;function xt(e){var r=".dragsuppress-"+ ++mt,n="click"+r,a=t.select(o(e)).on("touchmove"+r,F).on("dragstart"+r,F).on("selectstart"+r,F);if(null==yt&&(yt=!("onselectstart"in e)&&D(e.style,"userSelect")),yt){var l=i(e).style,s=l[yt];l[yt]="none"}return function(t){if(a.on(r,null),yt&&(l[yt]=s),t){var e=function(){a.on(n,null)};a.on(n,function(){F(),e()},!0),setTimeout(e,0)}}}t.mouse=function(t){return _t(t,j())};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 a=n.createSVGPoint();if(bt<0){var i=o(e);if(i.scrollX||i.scrollY){var l=(n=t.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();bt=!(l.f||l.e),n.remove()}}return bt?(a.x=r.pageX,a.y=r.pageY):(a.x=r.clientX,a.y=r.clientY),[(a=a.matrixTransform(e.getScreenCTM().inverse())).x,a.y]}var s=e.getBoundingClientRect();return[r.clientX-s.left-e.clientLeft,r.clientY-s.top-e.clientTop]}function wt(){return t.event.changedTouches[0].identifier}t.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=j().changedTouches),e)for(var n,a=0,i=e.length;a<i;++a)if((n=e[a]).identifier===r)return _t(t,n)},t.behavior.drag=function(){var e=B(i,"drag","dragstart","dragend"),r=null,n=l(N,t.mouse,o,"mousemove","mouseup"),a=l(wt,t.touch,P,"touchmove","touchend");function i(){this.on("mousedown.drag",n).on("touchstart.drag",a)}function l(n,a,i,o,l){return function(){var s,c=t.event.target.correspondingElement||t.event.target,u=this.parentNode,f=e.of(this,arguments),d=0,p=n(),h=".drag"+(null==p?"":"-"+p),g=t.select(i(c)).on(o+h,function(){var t,e,r=a(u,p);if(!r)return;t=r[0]-y[0],e=r[1]-y[1],d|=t|e,y=r,f({type:"drag",x:r[0]+s[0],y:r[1]+s[1],dx:t,dy:e})}).on(l+h,function(){if(!a(u,p))return;g.on(o+h,null).on(l+h,null),v(d),f({type:"dragend"})}),v=xt(c),y=a(u,p);s=r?[(s=r.apply(this,arguments)).x-y[0],s.y-y[1]]:[0,0],f({type:"dragstart"})}}return i.origin=function(t){return arguments.length?(r=t,i):r},t.rebind(i,e,"on")},t.touches=function(t,e){return arguments.length<2&&(e=j().touches),e?n(e).map(function(e){var r=_t(t,e);return r.identifier=e.identifier,r}):[]};var kt=1e-6,Mt=kt*kt,At=Math.PI,Tt=2*At,Lt=Tt-kt,St=At/2,Ct=At/180,Ot=180/At;function Pt(t){return t>0?1:t<0?-1:0}function zt(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function Dt(t){return t>1?0:t<-1?At:Math.acos(t)}function Et(t){return t>1?St:t<-1?-St:Math.asin(t)}function Nt(t){return((t=Math.exp(t))+1/t)/2}function Rt(t){return(t=Math.sin(t/2))*t}var It=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,a=t[0],i=t[1],o=t[2],l=e[0],s=e[1],c=e[2],u=l-a,f=s-i,d=u*u+f*f;if(d<Mt)n=Math.log(c/o)/It,r=function(t){return[a+t*u,i+t*f,o*Math.exp(It*t*n)]};else{var p=Math.sqrt(d),h=(c*c-o*o+4*d)/(2*o*2*p),g=(c*c-o*o-4*d)/(2*c*2*p),v=Math.log(Math.sqrt(h*h+1)-h),y=Math.log(Math.sqrt(g*g+1)-g);n=(y-v)/It,r=function(t){var e,r=t*n,l=Nt(v),s=o/(2*p)*(l*(e=It*r+v,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(v));return[a+s*u,i+s*f,o*l/Nt(It*r+v)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,i,l,s,c,u,f,d={x:0,y:0,k:1},p=[960,500],h=Bt,g=250,v=0,y="mousedown.zoom",m="mousemove.zoom",x="mouseup.zoom",b="touchstart.zoom",_=B(w,"zoomstart","zoom","zoomend");function w(t){t.on(y,P).on(jt+".zoom",D).on("dblclick.zoom",E).on(b,z)}function k(t){return[(t[0]-d.x)/d.k,(t[1]-d.y)/d.k]}function M(t){d.k=Math.max(h[0],Math.min(h[1],t))}function A(t,e){e=function(t){return[t[0]*d.k+d.x,t[1]*d.k+d.y]}(e),d.x+=t[0]-e[0],d.y+=t[1]-e[1]}function T(e,n,a,i){e.__chart__={x:d.x,y:d.y,k:d.k},M(Math.pow(2,i)),A(r=n,a),e=t.select(e),g>0&&(e=e.transition().duration(g)),e.call(w.event)}function L(){c&&c.domain(s.range().map(function(t){return(t-d.x)/d.k}).map(s.invert)),f&&f.domain(u.range().map(function(t){return(t-d.y)/d.k}).map(u.invert))}function S(t){v++||t({type:"zoomstart"})}function C(t){L(),t({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function O(t){--v||(t({type:"zoomend"}),r=null)}function P(){var e=this,r=_.of(e,arguments),n=0,a=t.select(o(e)).on(m,function(){n=1,A(t.mouse(e),i),C(r)}).on(x,function(){a.on(m,null).on(x,null),l(n),O(r)}),i=k(t.mouse(e)),l=xt(e);fl.call(e),S(r)}function z(){var e,r=this,n=_.of(r,arguments),a={},i=0,o=".zoom-"+t.event.changedTouches[0].identifier,s="touchmove"+o,c="touchend"+o,u=[],f=t.select(r),p=xt(r);function h(){var n=t.touches(r);return e=d.k,n.forEach(function(t){t.identifier in a&&(a[t.identifier]=k(t))}),n}function g(){var e=t.event.target;t.select(e).on(s,v).on(c,m),u.push(e);for(var n=t.event.changedTouches,o=0,f=n.length;o<f;++o)a[n[o].identifier]=null;var p=h(),g=Date.now();if(1===p.length){if(g-l<500){var y=p[0];T(r,y,a[y.identifier],Math.floor(Math.log(d.k)/Math.LN2)+1),F()}l=g}else if(p.length>1){y=p[0];var x=p[1],b=y[0]-x[0],_=y[1]-x[1];i=b*b+_*_}}function v(){var o,s,c,u,f=t.touches(r);fl.call(r);for(var d=0,p=f.length;d<p;++d,u=null)if(c=f[d],u=a[c.identifier]){if(s)break;o=c,s=u}if(u){var h=(h=c[0]-o[0])*h+(h=c[1]-o[1])*h,g=i&&Math.sqrt(h/i);o=[(o[0]+c[0])/2,(o[1]+c[1])/2],s=[(s[0]+u[0])/2,(s[1]+u[1])/2],M(g*e)}l=null,A(o,s),C(n)}function m(){if(t.event.touches.length){for(var e=t.event.changedTouches,r=0,i=e.length;r<i;++r)delete a[e[r].identifier];for(var l in a)return void h()}t.selectAll(u).on(o,null),f.on(y,P).on(b,z),p(),O(n)}g(),S(n),f.on(y,null).on(b,g)}function D(){var a=_.of(this,arguments);i?clearTimeout(i):(fl.call(this),e=k(r=n||t.mouse(this)),S(a)),i=setTimeout(function(){i=null,O(a)},50),F(),M(Math.pow(2,.002*Ft())*d.k),A(r,e),C(a)}function E(){var e=t.mouse(this),r=Math.log(d.k)/Math.LN2;T(this,e,k(e),t.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}return jt||(jt="onwheel"in a?(Ft=function(){return-t.event.deltaY*(t.event.deltaMode?120:1)},"wheel"):"onmousewheel"in a?(Ft=function(){return t.event.wheelDelta},"mousewheel"):(Ft=function(){return-t.event.detail},"MozMousePixelScroll")),w.event=function(e){e.each(function(){var e=_.of(this,arguments),n=d;hl?t.select(this).transition().each("start.zoom",function(){d=this.__chart__||{x:0,y:0,k:1},S(e)}).tween("zoom:zoom",function(){var a=p[0],i=p[1],o=r?r[0]:a/2,l=r?r[1]:i/2,s=t.interpolateZoom([(o-d.x)/d.k,(l-d.y)/d.k,a/d.k],[(o-n.x)/n.k,(l-n.y)/n.k,a/n.k]);return function(t){var r=s(t),n=a/r[2];this.__chart__=d={x:o-r[0]*n,y:l-r[1]*n,k:n},C(e)}}).each("interrupt.zoom",function(){O(e)}).each("end.zoom",function(){O(e)}):(this.__chart__=d,S(e),C(e),O(e))})},w.translate=function(t){return arguments.length?(d={x:+t[0],y:+t[1],k:d.k},L(),w):[d.x,d.y]},w.scale=function(t){return arguments.length?(d={x:d.x,y:d.y,k:null},M(+t),L(),w):d.k},w.scaleExtent=function(t){return arguments.length?(h=null==t?Bt:[+t[0],+t[1]],w):h},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?(c=t,s=t.copy(),d={x:0,y:0,k:1},w):c},w.y=function(t){return arguments.length?(f=t,u=t.copy(),d={x:0,y:0,k:1},w):f},t.rebind(w,_,"on")};var Ft,jt,Bt=[0,1/0];function Ht(){}function qt(t,e,r){return this instanceof qt?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof qt?new qt(t.h,t.s,t.l):ue(""+t,fe,qt):new qt(t,e,r)}t.color=Ht,Ht.prototype.toString=function(){return this.rgb()+""},t.hsl=qt;var Vt=qt.prototype=new Ht;function Ut(t,e,r){var n,a;function i(t){return Math.round(255*function(t){return t>360?t-=360:t<0&&(t+=360),t<60?n+(a-n)*t/60:t<180?a:t<240?n+(a-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)-(a=r<=.5?r*(1+e):r+e-r*e),new ie(i(t+120),i(t),i(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 Zt?e.l:(e=de((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Gt(e,r,n)}Vt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new qt(this.h,this.s,this.l/t)},Vt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new qt(this.h,this.s,t*this.l)},Vt.rgb=function(){return Ut(this.h,this.s,this.l)},t.hcl=Gt;var Yt=Gt.prototype=new Ht;function Xt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Zt(r,Math.cos(t*=Ct)*e,Math.sin(t)*e)}function Zt(t,e,r){return this instanceof Zt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Zt?new Zt(t.l,t.a,t.b):t instanceof Gt?Xt(t.h,t.c,t.l):de((t=ie(t)).r,t.g,t.b):new Zt(t,e,r)}Yt.brighter=function(t){return new Gt(this.h,this.c,Math.min(100,this.l+Wt*(arguments.length?t:1)))},Yt.darker=function(t){return new Gt(this.h,this.c,Math.max(0,this.l-Wt*(arguments.length?t:1)))},Yt.rgb=function(){return Xt(this.h,this.c,this.l).rgb()},t.lab=Zt;var Wt=18,Qt=.95047,Jt=1,$t=1.08883,Kt=Zt.prototype=new Ht;function te(t,e,r){var n=(t+16)/116,a=n+e/500,i=n-r/200;return new ie(ae(3.2404542*(a=re(a)*Qt)-1.5371385*(n=re(n)*Jt)-.4985314*(i=re(i)*$t)),ae(-.969266*a+1.8760108*n+.041556*i),ae(.0556434*a-.2040259*n+1.0572252*i))}function ee(t,e,r){return t>0?new Gt(Math.atan2(r,e)*Ot,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 ae(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ie(t,e,r){return this instanceof ie?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ie?new ie(t.r,t.g,t.b):ue(""+t,ie,Ut):new ie(t,e,r)}function oe(t){return new ie(t>>16,t>>8&255,255&t)}function le(t){return oe(t)+""}Kt.brighter=function(t){return new Zt(Math.min(100,this.l+Wt*(arguments.length?t:1)),this.a,this.b)},Kt.darker=function(t){return new Zt(Math.max(0,this.l-Wt*(arguments.length?t:1)),this.a,this.b)},Kt.rgb=function(){return te(this.l,this.a,this.b)},t.rgb=ie;var se=ie.prototype=new Ht;function ce(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ue(t,e,r){var n,a,i,o=0,l=0,s=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(he(a[0]),he(a[1]),he(a[2]))}return(i=ge.get(t))?e(i.r,i.g,i.b):(null==t||"#"!==t.charAt(0)||isNaN(i=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&i)>>4,o|=o>>4,l=240&i,l|=l>>4,s=15&i,s|=s<<4):7===t.length&&(o=(16711680&i)>>16,l=(65280&i)>>8,s=255&i)),e(o,l,s))}function fe(t,e,r){var n,a,i=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),l=o-i,s=(o+i)/2;return l?(a=s<.5?l/(o+i):l/(2-o-i),n=t==o?(e-r)/l+(e<r?6:0):e==o?(r-t)/l+2:(t-e)/l+4,n*=60):(n=NaN,a=s>0&&s<1?0:n),new qt(n,a,s)}function de(t,e,r){var n=ne((.4124564*(t=pe(t))+.3575761*(e=pe(e))+.1804375*(r=pe(r)))/Qt),a=ne((.2126729*t+.7151522*e+.072175*r)/Jt);return Zt(116*a-16,500*(n-a),200*(a-ne((.0193339*t+.119192*e+.9503041*r)/$t)))}function pe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function he(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}se.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,a=30;return e||r||n?(e&&e<a&&(e=a),r&&r<a&&(r=a),n&&n<a&&(n=a),new ie(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new ie(a,a,a)},se.darker=function(t){return new ie((t=Math.pow(.7,arguments.length?t:1))*this.r,t*this.g,t*this.b)},se.hsl=function(){return fe(this.r,this.g,this.b)},se.toString=function(){return"#"+ce(this.r)+ce(this.g)+ce(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 ye(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),me(e,r,t,n)}}function me(e,r,a,i){var o={},l=t.dispatch("beforesend","progress","load","error"),s={},c=new XMLHttpRequest,u=null;function f(){var t,e=c.status;if(!e&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(c)||e>=200&&e<300||304===e){try{t=a.call(o,c)}catch(t){return void l.error.call(o,t)}l.load.call(o,t)}else l.error.call(o,c)}return!this.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(e)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=f:c.onreadystatechange=function(){c.readyState>3&&f()},c.onprogress=function(e){var r=t.event;t.event=e;try{l.progress.call(o,c)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(u=t,o):u},o.response=function(t){return a=t,o},["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}}),o.send=function(t,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),c.open(t,e,!0),null==r||"accept"in s||(s.accept=r+",*/*"),c.setRequestHeader)for(var i in s)c.setRequestHeader(i,s[i]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=a&&o.on("error",a).on("load",function(t){a(null,t)}),l.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},t.rebind(o,l,"on"),null==i?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(i))}ge.forEach(function(t,e){ge.set(t,oe(e))}),t.functor=ve,t.xhr=ye(P),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function a(t,r,n){arguments.length<3&&(n=r,r=null);var a=me(t,e,null==r?i:o(r),n);return a.row=function(t){return arguments.length?a.response(null==(r=t)?i:o(t)):r},a}function i(t){return a.parse(t.responseText)}function o(t){return function(e){return a.parse(e.responseText,t)}}function l(e){return e.map(s).join(t)}function s(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return a.parse=function(t,e){var r;return a.parseRows(t,function(t,n){if(r)return r(t,n-1);var a=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");r=e?function(t,r){return e(a(t),r)}:a})},a.parseRows=function(t,e){var r,a,i={},o={},l=[],s=t.length,c=0,u=0;function f(){if(c>=s)return o;if(a)return a=!1,i;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++<s;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}return c=r+2,13===(l=t.charCodeAt(r+1))?(a=!0,10===t.charCodeAt(r+2)&&++c):10===l&&(a=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;c<s;){var l,u=1;if(10===(l=t.charCodeAt(c++)))a=!0;else if(13===l)a=!0,10===t.charCodeAt(c)&&(++c,++u);else if(l!==n)continue;return t.slice(e,c-u)}return t.slice(e)}for(;(r=f())!==o;){for(var d=[];r!==i&&r!==o;)d.push(r),r=f();e&&null==(d=e(d,u++))||l.push(d)}return l},a.format=function(e){if(Array.isArray(e[0]))return a.formatRows(e);var r=new O,n=[];return e.forEach(function(t){for(var e in t)r.has(e)||n.push(r.add(e))}),[n.map(s).join(t)].concat(e.map(function(e){return n.map(function(t){return s(e[t])}).join(t)})).join("\n")},a.formatRows=function(t){return t.map(l).join("\n")},a},t.csv=t.dsv(",","text/csv"),t.tsv=t.dsv("\t","text/tab-separated-values");var xe,be,_e,we,ke=this[D(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};function Me(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var a={c:t,t:r+e,n:null};return be?be.n=a:xe=a,be=a,_e||(we=clearTimeout(we),_e=1,ke(Ae)),a}function Ae(){var t=Te(),e=Le()-t;e>24?(isFinite(e)&&(clearTimeout(we),we=setTimeout(Ae,e)),_e=0):(_e=1,ke(Ae))}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 Le(){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 Se(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}t.timer=function(){Me.apply(this,arguments)},t.timer.flush=function(){Te(),Le()},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*m(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,Se(e,r))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Ce[8+n/3]};var Oe=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Pe=t.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(e,r){return(e=t.round(e,Se(e,r))).toFixed(Math.max(0,Math.min(20,Se(e*(1+1e-15),r))))}});function ze(t){return t+""}var De=t.time={},Ee=Date;function Ne(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Ne.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 Ie(t,e,r){function n(e){var r=t(e),n=i(r,1);return e-r<n-e?r:n}function a(r){return e(r=t(new Ee(r-1)),1),r}function i(t,r){return e(t=new Ee(+t),r),t}function o(t,n,i){var o=a(t),l=[];if(i>1)for(;o<n;)r(o)%i||l.push(new Date(+o)),e(o,1);else for(;o<n;)l.push(new Date(+o)),e(o,1);return l}t.floor=t,t.round=n,t.ceil=a,t.offset=i,t.range=o;var l=t.utc=Fe(t);return l.floor=l,l.round=Fe(n),l.ceil=Fe(a),l.offset=Fe(i),l.range=function(t,e,r){try{Ee=Ne;var n=new Ne;return n._=t,o(n,e,r)}finally{Ee=Date}},t}function Fe(t){return function(e,r){try{Ee=Ne;var n=new Ne;return n._=e,t(n,r)._}finally{Ee=Date}}}De.year=Ie(function(t){return(t=De.day(t)).setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),De.years=De.year.range,De.years.utc=De.year.utc.range,De.day=Ie(function(t){var e=new Ee(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}),De.days=De.day.range,De.days.utc=De.day.utc.range,De.dayOfYear=function(t){var e=De.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=De[t]=Ie(function(t){return(t=De.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=De.year(t).getDay();return Math.floor((De.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});De[t+"s"]=r.range,De[t+"s"].utc=r.utc.range,De[t+"OfYear"]=function(t){var r=De.year(t).getDay();return Math.floor((De.dayOfYear(t)+(r+e)%7)/7)}}),De.week=De.sunday,De.weeks=De.sunday.range,De.weeks.utc=De.sunday.utc.range,De.weekOfYear=De.sundayOfYear;var je={"-":"",_:" ",0:"0"},Be=/^\s*\d+/,He=/^%/;function qe(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(e)+a:a)}function Ve(e){return new RegExp("^(?:"+e.map(t.requote).join("|")+")","i")}function Ue(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){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Ye(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function Xe(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function Ze(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function We(t,e,r){Be.lastIndex=0;var n,a=Be.exec(e.slice(r,r+2));return a?(t.y=(n=+a[0])+(n>68?1900:2e3),r+a[0].length):-1}function Qe(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Je(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function $e(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Ke(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function tr(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function er(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function rr(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function nr(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function ar(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=m(e)/60|0,a=m(e)%60;return r+qe(n,"0",2)+qe(a,"0",2)}function ir(t,e,r){He.lastIndex=0;var n=He.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,a=e.grouping,i=e.currency,o=a&&n?function(t,e){for(var r=t.length,i=[],o=0,l=a[0],s=0;r>0&&l>0&&(s+l+1>e&&(l=Math.max(1,e-s)),i.push(t.substring(r-=l,r+l)),!((s+=l+1)>e));)l=a[o=(o+1)%a.length];return i.reverse().join(n)}:P;return function(e){var n=Oe.exec(e),a=n[1]||" ",l=n[2]||">",s=n[3]||"-",c=n[4]||"",u=n[5],f=+n[6],d=n[7],p=n[8],h=n[9],g=1,v="",y="",m=!1,x=!0;switch(p&&(p=+p.substring(1)),(u||"0"===a&&"="===l)&&(u=a="0",l="="),h){case"n":d=!0,h="g";break;case"%":g=100,y="%",h="f";break;case"p":g=100,y="%",h="r";break;case"b":case"o":case"x":case"X":"#"===c&&(v="0"+h.toLowerCase());case"c":x=!1;case"d":m=!0,p=0;break;case"s":g=-1,h="r"}"$"===c&&(v=i[0],y=i[1]),"r"!=h||p||(h="g"),null!=p&&("g"==h?p=Math.max(1,Math.min(21,p)):"e"!=h&&"f"!=h||(p=Math.max(0,Math.min(20,p)))),h=Pe.get(h)||ze;var b=u&&d;return function(e){var n=y;if(m&&e%1)return"";var i=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===s?"":s;if(g<0){var c=t.formatPrefix(e,p);e=c.scale(e),n=c.symbol+y}else e*=g;var _,w,k=(e=h(e,p)).lastIndexOf(".");if(k<0){var M=x?e.lastIndexOf("e"):-1;M<0?(_=e,w=""):(_=e.substring(0,M),w=e.substring(M))}else _=e.substring(0,k),w=r+e.substring(k+1);!u&&d&&(_=o(_,1/0));var A=v.length+_.length+w.length+(b?0:i.length),T=A<f?new Array(A=f-A+1).join(a):"";return b&&(_=o(T+_,T.length?f-w.length:1/0)),i+=v,e=_+w,("<"===l?i+e+T:">"===l?T+i+e:"^"===l?T.substring(0,A>>=1)+i+e+T.substring(A):i+(b?e:T+e))+n}}}(e),timeFormat:function(e){var r=e.dateTime,n=e.date,a=e.time,i=e.periods,o=e.days,l=e.shortDays,s=e.months,c=e.shortMonths;function u(t){var e=t.length;function r(r){for(var n,a,i,o=[],l=-1,s=0;++l<e;)37===t.charCodeAt(l)&&(o.push(t.slice(s,l)),null!=(a=je[n=t.charAt(++l)])&&(n=t.charAt(++l)),(i=_[n])&&(n=i(r,null==a?"e"===n?" ":"0":a)),o.push(n),s=l+1);return o.push(t.slice(s,l)),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(f(r,t,e,0)!=e.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var n=null!=r.Z&&Ee!==Ne,a=new(n?Ne:Ee);return"j"in r?a.setFullYear(r.y,0,r.j):"W"in r||"U"in r?("w"in r||(r.w="W"in r?1:0),a.setFullYear(r.y,0,1),a.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(a.getDay()+5)%7:r.w+7*r.U-(a.getDay()+6)%7)):a.setFullYear(r.y,r.m,r.d),a.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),n?a._:a},r.toString=function(){return t},r}function f(t,e,r,n){for(var a,i,o,l=0,s=e.length,c=r.length;l<s;){if(n>=c)return-1;if(37===(a=e.charCodeAt(l++))){if(o=e.charAt(l++),!(i=w[o in je?e.charAt(l++):o])||(n=i(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}u.utc=function(t){var e=u(t);function r(t){try{var r=new(Ee=Ne);return r._=t,e(r)}finally{Ee=Date}}return r.parse=function(t){try{Ee=Ne;var r=e.parse(t);return r&&r._}finally{Ee=Date}},r.toString=e.toString,r},u.multi=u.utc.multi=or;var d=t.map(),p=Ve(o),h=Ue(o),g=Ve(l),v=Ue(l),y=Ve(s),m=Ue(s),x=Ve(c),b=Ue(c);i.forEach(function(t,e){d.set(t.toLowerCase(),e)});var _={a:function(t){return l[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:u(r),d:function(t,e){return qe(t.getDate(),e,2)},e:function(t,e){return qe(t.getDate(),e,2)},H:function(t,e){return qe(t.getHours(),e,2)},I:function(t,e){return qe(t.getHours()%12||12,e,2)},j:function(t,e){return qe(1+De.dayOfYear(t),e,3)},L:function(t,e){return qe(t.getMilliseconds(),e,3)},m:function(t,e){return qe(t.getMonth()+1,e,2)},M:function(t,e){return qe(t.getMinutes(),e,2)},p:function(t){return i[+(t.getHours()>=12)]},S:function(t,e){return qe(t.getSeconds(),e,2)},U:function(t,e){return qe(De.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return qe(De.mondayOfYear(t),e,2)},x:u(n),X:u(a),y:function(t,e){return qe(t.getFullYear()%100,e,2)},Y:function(t,e){return qe(t.getFullYear()%1e4,e,4)},Z:ar,"%":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=h.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){y.lastIndex=0;var n=y.exec(e.slice(r));return n?(t.m=m.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,r){return f(t,_.c.toString(),e,r)},d:$e,e:$e,H:tr,I:tr,j:Ke,L:nr,m:Je,M:er,p:function(t,e,r){var n=d.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:rr,U:Ye,w:Ge,W:Xe,x:function(t,e,r){return f(t,_.x.toString(),e,r)},X:function(t,e,r){return f(t,_.X.toString(),e,r)},y:We,Y:Ze,Z:Qe,"%":ir};return u}(e)}};var lr=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 sr(){}t.format=lr.numberFormat,t.geo={},sr.prototype={s:0,t:0,add:function(t){ur(t,this.t,cr),ur(cr.s,this.s,this),this.s?this.t+=cr.t:this.s=cr.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var cr=new sr;function ur(t,e,r){var n=r.s=t+e,a=n-t,i=n-a;r.t=t-i+(e-a)}function fr(t,e){t&&pr.hasOwnProperty(t.type)&&pr[t.type](t,e)}t.geo.stream=function(t,e){t&&dr.hasOwnProperty(t.type)?dr[t.type](t,e):fr(t,e)};var dr={Feature:function(t,e){fr(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,a=r.length;++n<a;)fr(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,a=r.length;++n<a;)t=r[n],e.point(t[0],t[1],t[2])},LineString:function(t,e){hr(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)hr(r[n],e,0)},Polygon:function(t,e){gr(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)gr(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,a=r.length;++n<a;)fr(r[n],e)}};function hr(t,e,r){var n,a=-1,i=t.length-r;for(e.lineStart();++a<i;)n=t[a],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;)hr(t[r],e,1);e.polygonEnd()}t.geo.area=function(e){return vr=0,t.geo.stream(e,Cr),vr};var vr,yr,mr,xr,br,_r,wr,kr,Mr,Ar,Tr,Lr,Sr=new sr,Cr={sphere:function(){vr+=4*At},point:N,lineStart:N,lineEnd:N,polygonStart:function(){Sr.reset(),Cr.lineStart=Or},polygonEnd:function(){var t=2*Sr;vr+=t<0?4*At+t:t,Cr.lineStart=Cr.lineEnd=Cr.point=N}};function Or(){var t,e,r,n,a;function i(t,e){e=e*Ct/2+At/4;var i=(t*=Ct)-r,o=i>=0?1:-1,l=o*i,s=Math.cos(e),c=Math.sin(e),u=a*c,f=n*s+u*Math.cos(l),d=u*o*Math.sin(l);Sr.add(Math.atan2(d,f)),r=t,n=s,a=c}Cr.point=function(o,l){Cr.point=i,r=(t=o)*Ct,n=Math.cos(l=(e=l)*Ct/2+At/4),a=Math.sin(l)},Cr.lineEnd=function(){i(t,e)}}function Pr(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 zr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Dr(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 Er(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Nr(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 Ir(t){return[Math.atan2(t[1],t[0]),Et(t[2])]}function Fr(t,e){return m(t[0]-e[0])<kt&&m(t[1]-e[1])<kt}t.geo.bounds=function(){var e,r,n,a,i,o,l,s,c,u,f,d={point:p,lineStart:g,lineEnd:v,polygonStart:function(){d.point=y,d.lineStart=x,d.lineEnd=b,c=0,Cr.polygonStart()},polygonEnd:function(){Cr.polygonEnd(),d.point=p,d.lineStart=g,d.lineEnd=v,Sr<0?(e=-(n=180),r=-(a=90)):c>kt?a=90:c<-kt&&(r=-90),f[0]=e,f[1]=n}};function p(t,i){u.push(f=[e=t,n=t]),i<r&&(r=i),i>a&&(a=i)}function h(t,o){var l=Pr([t*Ct,o*Ct]);if(s){var c=Dr(s,l),u=Dr([c[1],-c[0],0],c);Rr(u),u=Ir(u);var f=t-i,d=f>0?1:-1,h=u[0]*Ot*d,g=m(f)>180;if(g^(d*i<h&&h<d*t))(v=u[1]*Ot)>a&&(a=v);else if(g^(d*i<(h=(h+360)%360-180)&&h<d*t)){var v;(v=-u[1]*Ot)<r&&(r=v)}else o<r&&(r=o),o>a&&(a=o);g?t<i?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t):n>=e?(t<e&&(e=t),t>n&&(n=t)):t>i?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t)}else p(t,o);s=l,i=t}function g(){d.point=h}function v(){f[0]=e,f[1]=n,d.point=p,s=null}function y(t,e){if(s){var r=t-i;c+=m(r)>180?r+(r>0?360:-360):r}else o=t,l=e;Cr.point(t,e),h(t,e)}function x(){Cr.lineStart()}function b(){y(o,l),Cr.lineEnd(),m(c)>kt&&(e=-(n=180)),f[0]=e,f[1]=n,s=null}function _(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function k(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}return function(i){if(a=n=-(e=r=1/0),u=[],t.geo.stream(i,d),c=u.length){u.sort(w);for(var o=1,l=[g=u[0]];o<c;++o)k((p=u[o])[0],g)||k(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])):l.push(g=p);for(var s,c,p,h=-1/0,g=(o=0,l[c=l.length-1]);o<=c;g=p,++o)p=l[o],(s=_(g[1],p[0]))>h&&(h=s,e=p[0],n=g[1])}return u=f=null,e===1/0||r===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,r],[n,a]]}}(),t.geo.centroid=function(e){yr=mr=xr=br=_r=wr=kr=Mr=Ar=Tr=Lr=0,t.geo.stream(e,jr);var r=Ar,n=Tr,a=Lr,i=r*r+n*n+a*a;return i<Mt&&(r=wr,n=kr,a=Mr,mr<kt&&(r=xr,n=br,a=_r),(i=r*r+n*n+a*a)<Mt)?[NaN,NaN]:[Math.atan2(n,r)*Ot,Et(a/Math.sqrt(i))*Ot]};var jr={sphere:N,point:Br,lineStart:qr,lineEnd:Vr,polygonStart:function(){jr.lineStart=Ur},polygonEnd:function(){jr.lineStart=qr}};function Br(t,e){t*=Ct;var r=Math.cos(e*=Ct);Hr(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function Hr(t,e,r){xr+=(t-xr)/++yr,br+=(e-br)/yr,_r+=(r-_r)/yr}function qr(){var t,e,r;function n(n,a){n*=Ct;var i=Math.cos(a*=Ct),o=i*Math.cos(n),l=i*Math.sin(n),s=Math.sin(a),c=Math.atan2(Math.sqrt((c=e*s-r*l)*c+(c=r*o-t*s)*c+(c=t*l-e*o)*c),t*o+e*l+r*s);mr+=c,wr+=c*(t+(t=o)),kr+=c*(e+(e=l)),Mr+=c*(r+(r=s)),Hr(t,e,r)}jr.point=function(a,i){a*=Ct;var o=Math.cos(i*=Ct);t=o*Math.cos(a),e=o*Math.sin(a),r=Math.sin(i),jr.point=n,Hr(t,e,r)}}function Vr(){jr.point=Br}function Ur(){var t,e,r,n,a;function i(t,e){t*=Ct;var i=Math.cos(e*=Ct),o=i*Math.cos(t),l=i*Math.sin(t),s=Math.sin(e),c=n*s-a*l,u=a*o-r*s,f=r*l-n*o,d=Math.sqrt(c*c+u*u+f*f),p=r*o+n*l+a*s,h=d&&-Dt(p)/d,g=Math.atan2(d,p);Ar+=h*c,Tr+=h*u,Lr+=h*f,mr+=g,wr+=g*(r+(r=o)),kr+=g*(n+(n=l)),Mr+=g*(a+(a=s)),Hr(r,n,a)}jr.point=function(o,l){t=o,e=l,jr.point=i,o*=Ct;var s=Math.cos(l*=Ct);r=s*Math.cos(o),n=s*Math.sin(o),a=Math.sin(l),Hr(r,n,a)},jr.lineEnd=function(){i(t,e),jr.lineEnd=Vr,jr.point=Br}}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 Yr(){return!0}function Xr(t,e,r,n,a){var i=[],o=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,r=t[0],n=t[e];if(Fr(r,n)){a.lineStart();for(var l=0;l<e;++l)a.point((r=t[l])[0],r[1]);a.lineEnd()}else{var s=new Wr(r,t,null,!0),c=new Wr(r,null,s,!1);s.o=c,i.push(s),o.push(c),s=new Wr(n,t,null,!1),c=new Wr(n,null,s,!0),s.o=c,i.push(s),o.push(c)}}}),o.sort(e),Zr(i),Zr(o),i.length){for(var l=0,s=r,c=o.length;l<c;++l)o[l].e=s=!s;for(var u,f,d=i[0];;){for(var p=d,h=!0;p.v;)if((p=p.n)===d)return;u=p.z,a.lineStart();do{if(p.v=p.o.v=!0,p.e){if(h)for(l=0,c=u.length;l<c;++l)a.point((f=u[l])[0],f[1]);else n(p.x,p.n.x,1,a);p=p.n}else{if(h)for(l=(u=p.p.z).length-1;l>=0;--l)a.point((f=u[l])[0],f[1]);else n(p.x,p.p.x,-1,a);p=p.p}u=(p=p.o).z,h=!h}while(!p.v);a.lineEnd()}}}function Zr(t){if(e=t.length){for(var e,r,n=0,a=t[0];++n<e;)a.n=r=t[n],r.p=a,a=r;a.n=r=t[0],r.p=a}}function Wr(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 Qr(e,r,n,a){return function(i,o){var l,s=r(o),c=i.invert(a[0],a[1]),u={point:f,lineStart:p,lineEnd:h,polygonStart:function(){u.point=b,u.lineStart=_,u.lineEnd=w,l=[],g=[]},polygonEnd:function(){u.point=f,u.lineStart=p,u.lineEnd=h,l=t.merge(l);var e=function(t,e){var r=t[0],n=t[1],a=[Math.sin(r),-Math.cos(r),0],i=0,o=0;Sr.reset();for(var l=0,s=e.length;l<s;++l){var c=e[l],u=c.length;if(u)for(var f=c[0],d=f[0],p=f[1]/2+At/4,h=Math.sin(p),g=Math.cos(p),v=1;;){v===u&&(v=0);var y=(t=c[v])[0],m=t[1]/2+At/4,x=Math.sin(m),b=Math.cos(m),_=y-d,w=_>=0?1:-1,k=w*_,M=k>At,A=h*x;if(Sr.add(Math.atan2(A*w*Math.sin(k),g*b+A*Math.cos(k))),i+=M?_+w*Tt:_,M^d>=r^y>=r){var T=Dr(Pr(f),Pr(t));Rr(T);var L=Dr(a,T);Rr(L);var S=(M^_>=0?-1:1)*Et(L[2]);(n>S||n===S&&(T[0]||T[1]))&&(o+=M^_>=0?1:-1)}if(!v++)break;d=y,h=x,g=b,f=t}}return(i<-kt||i<kt&&Sr<-kt)^1&o}(c,g);l.length?(x||(o.polygonStart(),x=!0),Xr(l,Kr,e,n,o)):e&&(x||(o.polygonStart(),x=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),x&&(o.polygonEnd(),x=!1),l=g=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function f(t,r){var n=i(t,r);e(t=n[0],r=n[1])&&o.point(t,r)}function d(t,e){var r=i(t,e);s.point(r[0],r[1])}function p(){u.point=d,s.lineStart()}function h(){u.point=f,s.lineEnd()}var g,v,y=$r(),m=r(y),x=!1;function b(t,e){v.push([t,e]);var r=i(t,e);m.point(r[0],r[1])}function _(){m.lineStart(),v=[]}function w(){b(v[0][0],v[0][1]),m.lineEnd();var t,e=m.clean(),r=y.buffer(),n=r.length;if(v.pop(),g.push(v),v=null,n)if(1&e){var a,i=-1;if((n=(t=r[0]).length-1)>0){for(x||(o.polygonStart(),x=!0),o.lineStart();++i<n;)o.point((a=t[i])[0],a[1]);o.lineEnd()}}else n>1&&2&e&&r.push(r.pop().concat(r.shift())),l.push(r.filter(Jr))}return u}}function Jr(t){return t.length>1}function $r(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:N,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Kr(t,e){return((t=t.x)[0]<0?t[1]-St-kt:St-t[1])-((e=e.x)[0]<0?e[1]-St-kt:St-e[1])}var tn=Qr(Yr,function(t){var e,r=NaN,n=NaN,a=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(i,o){var l=i>0?At:-At,s=m(i-r);m(s-At)<kt?(t.point(r,n=(n+o)/2>0?St:-St),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(l,n),t.point(i,n),e=0):a!==l&&s>=At&&(m(r-a)<kt&&(r-=a*kt),m(i-l)<kt&&(i-=l*kt),n=function(t,e,r,n){var a,i,o=Math.sin(t-r);return m(o)>kt?Math.atan((Math.sin(e)*(i=Math.cos(n))*Math.sin(r)-Math.sin(n)*(a=Math.cos(e))*Math.sin(t))/(a*i*o)):(e+n)/2}(r,n,i,o),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(l,n),e=0),t.point(r=i,n=o),a=l},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}},function(t,e,r,n){var a;if(null==t)a=r*St,n.point(-At,a),n.point(0,a),n.point(At,a),n.point(At,0),n.point(At,-a),n.point(0,-a),n.point(-At,-a),n.point(-At,0),n.point(-At,a);else if(m(t[0]-e[0])>kt){var i=t[0]<e[0]?At:-At;a=r*i/2,n.point(-i,a),n.point(0,a),n.point(i,a)}else n.point(e[0],e[1])},[-At,-At/2]);function en(t,e,r,n){return function(a){var i,o=a.a,l=a.b,s=o.x,c=o.y,u=0,f=1,d=l.x-s,p=l.y-c;if(i=t-s,d||!(i>0)){if(i/=d,d<0){if(i<u)return;i<f&&(f=i)}else if(d>0){if(i>f)return;i>u&&(u=i)}if(i=r-s,d||!(i<0)){if(i/=d,d<0){if(i>f)return;i>u&&(u=i)}else if(d>0){if(i<u)return;i<f&&(f=i)}if(i=e-c,p||!(i>0)){if(i/=p,p<0){if(i<u)return;i<f&&(f=i)}else if(p>0){if(i>f)return;i>u&&(u=i)}if(i=n-c,p||!(i<0)){if(i/=p,p<0){if(i>f)return;i>u&&(u=i)}else if(p>0){if(i<u)return;i<f&&(f=i)}return u>0&&(a.a={x:s+u*d,y:c+u*p}),f<1&&(a.b={x:s+f*d,y:c+f*p}),a}}}}}}var rn=1e9;function nn(e,r,n,a){return function(s){var c,u,f,d,p,h,g,v,y,m,x,b=s,_=$r(),w=en(e,r,n,a),k={point:T,lineStart:function(){k.point=L,u&&u.push(f=[]);m=!0,y=!1,g=v=NaN},lineEnd:function(){c&&(L(d,p),h&&y&&_.rejoin(),c.push(_.buffer()));k.point=T,y&&s.lineEnd()},polygonStart:function(){s=_,c=[],u=[],x=!0},polygonEnd:function(){s=b,c=t.merge(c);var r=function(t){for(var e=0,r=u.length,n=t[1],a=0;a<r;++a)for(var i,o=1,l=u[a],s=l.length,c=l[0];o<s;++o)i=l[o],c[1]<=n?i[1]>n&&zt(c,i,t)>0&&++e:i[1]<=n&&zt(c,i,t)<0&&--e,c=i;return 0!==e}([e,a]),n=x&&r,i=c.length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),M(null,null,1,s),s.lineEnd()),i&&Xr(c,o,r,M,s),s.polygonEnd()),c=u=f=null}};function M(t,o,s,c){var u=0,f=0;if(null==t||(u=i(t,s))!==(f=i(o,s))||l(t,o)<0^s>0)do{c.point(0===u||3===u?e:n,u>1?a:r)}while((u=(u+s+4)%4)!==f);else c.point(o[0],o[1])}function A(t,i){return e<=t&&t<=n&&r<=i&&i<=a}function T(t,e){A(t,e)&&s.point(t,e)}function L(t,e){var r=A(t=Math.max(-rn,Math.min(rn,t)),e=Math.max(-rn,Math.min(rn,e)));if(u&&f.push([t,e]),m)d=t,p=e,h=r,m=!1,r&&(s.lineStart(),s.point(t,e));else if(r&&y)s.point(t,e);else{var n={a:{x:g,y:v},b:{x:t,y:e}};w(n)?(y||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),x=!1):r&&(s.lineStart(),s.point(t,e),x=!1)}g=t,v=e,y=r}return k};function i(t,a){return m(t[0]-e)<kt?a>0?0:3:m(t[0]-n)<kt?a>0?2:1:m(t[1]-r)<kt?a>0?1:0:a>0?3:2}function o(t,e){return l(t.x,e.x)}function l(t,e){var r=i(t,1),n=i(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=At/3,n=Cn(t),a=n(e,r);return a.parallels=function(t){return arguments.length?n(e=t[0]*At/180,r=t[1]*At/180):[e/At*180,r/At*180]},a}function on(t,e){var r=Math.sin(t),n=(r+Math.sin(e))/2,a=1+r*(2*n-r),i=Math.sqrt(a)/n;function o(t,e){var r=Math.sqrt(a-2*n*Math.sin(e))/n;return[r*Math.sin(t*=n),i-r*Math.cos(t)]}return o.invert=function(t,e){var r=i-e;return[Math.atan2(t,r)/n,Et((a-(t*t+r*r)*n*n)/(2*n))]},o}t.geo.clipExtent=function(){var t,e,r,n,a,i,o={stream:function(t){return a&&(a.valid=!1),(a=i(t)).valid=!0,a},extent:function(l){return arguments.length?(i=nn(t=+l[0][0],e=+l[0][1],r=+l[1][0],n=+l[1][1]),a&&(a.valid=!1,a=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,a,i=t.geo.albers(),o=t.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=t.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(t,r){e=[t,r]}};function c(t){var i=t[0],o=t[1];return e=null,r(i,o),e||(n(i,o),e)||a(i,o),e}return c.invert=function(t){var e=i.scale(),r=i.translate(),n=(t[0]-r[0])/e,a=(t[1]-r[1])/e;return(a>=.12&&a<.234&&n>=-.425&&n<-.214?o:a>=.166&&a<.234&&n>=-.214&&n<-.115?l:i).invert(t)},c.stream=function(t){var e=i.stream(t),r=o.stream(t),n=l.stream(t);return{point:function(t,a){e.point(t,a),r.point(t,a),n.point(t,a)},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()}}},c.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),l.precision(t),c):i.precision()},c.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),l.scale(t),c.translate(i.translate())):i.scale()},c.translate=function(t){if(!arguments.length)return i.translate();var e=i.scale(),u=+t[0],f=+t[1];return r=i.translate(t).clipExtent([[u-.455*e,f-.238*e],[u+.455*e,f+.238*e]]).stream(s).point,n=o.translate([u-.307*e,f+.201*e]).clipExtent([[u-.425*e+kt,f+.12*e+kt],[u-.214*e-kt,f+.234*e-kt]]).stream(s).point,a=l.translate([u-.205*e,f+.212*e]).clipExtent([[u-.214*e+kt,f+.166*e+kt],[u-.115*e-kt,f+.234*e-kt]]).stream(s).point,c},c.scale(1070)};var ln,sn,cn,un,fn,dn,pn={point:N,lineStart:N,lineEnd:N,polygonStart:function(){sn=0,pn.lineStart=hn},polygonEnd:function(){pn.lineStart=pn.lineEnd=pn.point=N,ln+=m(sn/2)}};function hn(){var t,e,r,n;function a(t,e){sn+=n*t-r*e,r=t,n=e}pn.point=function(i,o){pn.point=a,t=r=i,e=n=o},pn.lineEnd=function(){a(t,e)}}var gn={point:function(t,e){t<cn&&(cn=t);t>fn&&(fn=t);e<un&&(un=e);e>dn&&(dn=e)},lineStart:N,lineEnd:N,polygonStart:N,polygonEnd:N};function vn(){var t=yn(4.5),e=[],r={point:n,lineStart:function(){r.point=a},lineEnd:o,polygonStart:function(){r.lineEnd=l},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(e){return t=yn(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 a(t,n){e.push("M",t,",",n),r.point=i}function i(t,r){e.push("L",t,",",r)}function o(){r.point=n}function l(){e.push("Z")}return r}function yn(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,xn={point:bn,lineStart:_n,lineEnd:wn,polygonStart:function(){xn.lineStart=kn},polygonEnd:function(){xn.point=bn,xn.lineStart=_n,xn.lineEnd=wn}};function bn(t,e){xr+=t,br+=e,++_r}function _n(){var t,e;function r(r,n){var a=r-t,i=n-e,o=Math.sqrt(a*a+i*i);wr+=o*(t+r)/2,kr+=o*(e+n)/2,Mr+=o,bn(t=r,e=n)}xn.point=function(n,a){xn.point=r,bn(t=n,e=a)}}function wn(){xn.point=bn}function kn(){var t,e,r,n;function a(t,e){var a=t-r,i=e-n,o=Math.sqrt(a*a+i*i);wr+=o*(r+t)/2,kr+=o*(n+e)/2,Mr+=o,Ar+=(o=n*t-r*e)*(r+t),Tr+=o*(n+e),Lr+=3*o,bn(r=t,n=e)}xn.point=function(i,o){xn.point=a,bn(t=r=i,e=n=o)},xn.lineEnd=function(){a(t,e)}}function Mn(t){var e=4.5,r={point:n,lineStart:function(){r.point=a},lineEnd:o,polygonStart:function(){r.lineEnd=l},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(t){return e=t,r},result:N};function n(r,n){t.moveTo(r+e,n),t.arc(r,n,e,0,Tt)}function a(e,n){t.moveTo(e,n),r.point=i}function i(e,r){t.lineTo(e,r)}function o(){r.point=n}function l(){t.closePath()}return r}function An(t){var e=.5,r=Math.cos(30*Ct),n=16;function a(e){return(n?function(e){var r,a,o,l,s,c,u,f,d,p,h,g,v={point:y,lineStart:m,lineEnd:b,polygonStart:function(){e.polygonStart(),v.lineStart=_},polygonEnd:function(){e.polygonEnd(),v.lineStart=m}};function y(r,n){r=t(r,n),e.point(r[0],r[1])}function m(){f=NaN,v.point=x,e.lineStart()}function x(r,a){var o=Pr([r,a]),l=t(r,a);i(f,d,u,p,h,g,f=l[0],d=l[1],u=r,p=o[0],h=o[1],g=o[2],n,e),e.point(f,d)}function b(){v.point=y,e.lineEnd()}function _(){m(),v.point=w,v.lineEnd=k}function w(t,e){x(r=t,e),a=f,o=d,l=p,s=h,c=g,v.point=x}function k(){i(f,d,u,p,h,g,a,o,r,l,s,c,n,e),v.lineEnd=b,b()}return v}:function(e){return Ln(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})})(e)}function i(n,a,o,l,s,c,u,f,d,p,h,g,v,y){var x=u-n,b=f-a,_=x*x+b*b;if(_>4*e&&v--){var w=l+p,k=s+h,M=c+g,A=Math.sqrt(w*w+k*k+M*M),T=Math.asin(M/=A),L=m(m(M)-1)<kt||m(o-d)<kt?(o+d)/2:Math.atan2(k,w),S=t(L,T),C=S[0],O=S[1],P=C-n,z=O-a,D=b*P-x*z;(D*D/_>e||m((x*P+b*z)/_-.5)>.3||l*p+s*h+c*g<r)&&(i(n,a,o,l,s,c,C,O,L,w/=A,k/=A,M,v,y),y.point(C,O),i(C,O,L,w,k,M,u,f,d,p,h,g,v,y))}}return a.precision=function(t){return arguments.length?(n=(e=t*t)>0&&16,a):Math.sqrt(e)},a}function Tn(t){this.stream=t}function Ln(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Sn(t){return Cn(function(){return t})()}function Cn(e){var r,n,a,i,o,l,s=An(function(t,e){return[(t=r(t,e))[0]*c+i,o-t[1]*c]}),c=150,u=480,f=250,d=0,p=0,h=0,g=0,v=0,y=tn,x=P,b=null,_=null;function w(t){return[(t=a(t[0]*Ct,t[1]*Ct))[0]*c+i,o-t[1]*c]}function k(t){return(t=a.invert((t[0]-i)/c,(o-t[1])/c))&&[t[0]*Ot,t[1]*Ot]}function M(){a=Gr(n=Dn(h,g,v),r);var t=r(d,p);return i=u-t[0]*c,o=f+t[1]*c,A()}function A(){return l&&(l.valid=!1,l=null),w}return w.stream=function(t){return l&&(l.valid=!1),(l=On(y(n,s(x(t))))).valid=!0,l},w.clipAngle=function(t){return arguments.length?(y=null==t?(b=t,tn):function(t){var e=Math.cos(t),r=e>0,n=m(e)>kt;return Qr(a,function(t){var e,l,s,c,u;return{lineStart:function(){c=s=!1,u=1},point:function(f,d){var p,h=[f,d],g=a(f,d),v=r?g?0:o(f,d):g?o(f+(f<0?At:-At),d):0;if(!e&&(c=s=g)&&t.lineStart(),g!==s&&(p=i(e,h),(Fr(e,p)||Fr(h,p))&&(h[0]+=kt,h[1]+=kt,g=a(h[0],h[1]))),g!==s)u=0,g?(t.lineStart(),p=i(h,e),t.point(p[0],p[1])):(p=i(e,h),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(n&&e&&r^g){var y;v&l||!(y=i(h,e,!0))||(u=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!g||e&&Fr(e,h)||t.point(h[0],h[1]),e=h,s=g,l=v},lineEnd:function(){s&&t.lineEnd(),e=null},clean:function(){return u|(c&&s)<<1}}},In(t,6*Ct),r?[0,-t]:[-At,t-At]);function a(t,r){return Math.cos(t)*Math.cos(r)>e}function i(t,r,n){var a=[1,0,0],i=Dr(Pr(t),Pr(r)),o=zr(i,i),l=i[0],s=o-l*l;if(!s)return!n&&t;var c=e*o/s,u=-e*l/s,f=Dr(a,i),d=Nr(a,c);Er(d,Nr(i,u));var p=f,h=zr(d,p),g=zr(p,p),v=h*h-g*(zr(d,d)-1);if(!(v<0)){var y=Math.sqrt(v),x=Nr(p,(-h-y)/g);if(Er(x,d),x=Ir(x),!n)return x;var b,_=t[0],w=r[0],k=t[1],M=r[1];w<_&&(b=_,_=w,w=b);var A=w-_,T=m(A-At)<kt;if(!T&&M<k&&(b=k,k=M,M=b),T||A<kt?T?k+M>0^x[1]<(m(x[0]-_)<kt?k:M):k<=x[1]&&x[1]<=M:A>At^(_<=x[0]&&x[0]<=w)){var L=Nr(p,(-h+y)/g);return Er(L,d),[x,Ir(L)]}}}function o(e,n){var a=r?t:At-t,i=0;return e<-a?i|=1:e>a&&(i|=2),n<-a?i|=4:n>a&&(i|=8),i}}((b=+t)*Ct),A()):b},w.clipExtent=function(t){return arguments.length?(_=t,x=t?nn(t[0][0],t[0][1],t[1][0],t[1][1]):P,A()):_},w.scale=function(t){return arguments.length?(c=+t,M()):c},w.translate=function(t){return arguments.length?(u=+t[0],f=+t[1],M()):[u,f]},w.center=function(t){return arguments.length?(d=t[0]%360*Ct,p=t[1]%360*Ct,M()):[d*Ot,p*Ot]},w.rotate=function(t){return arguments.length?(h=t[0]%360*Ct,g=t[1]%360*Ct,v=t.length>2?t[2]%360*Ct:0,M()):[h*Ot,g*Ot,v*Ot]},t.rebind(w,s,"precision"),function(){return r=e.apply(this,arguments),w.invert=r.invert&&k,M()}}function On(t){return Ln(t,function(e,r){t.point(e*Ct,r*Ct)})}function Pn(t,e){return[t,e]}function zn(t,e){return[t>At?t-Tt:t<-At?t+Tt:t,e]}function Dn(t,e,r){return t?e||r?Gr(Nn(t),Rn(e,r)):Nn(t):e||r?Rn(e,r):zn}function En(t){return function(e,r){return[(e+=t)>At?e-Tt:e<-At?e+Tt:e,r]}}function Nn(t){var e=En(t);return e.invert=En(-t),e}function Rn(t,e){var r=Math.cos(t),n=Math.sin(t),a=Math.cos(e),i=Math.sin(e);function o(t,e){var o=Math.cos(e),l=Math.cos(t)*o,s=Math.sin(t)*o,c=Math.sin(e),u=c*r+l*n;return[Math.atan2(s*a-u*i,l*r-c*n),Et(u*a+s*i)]}return o.invert=function(t,e){var o=Math.cos(e),l=Math.cos(t)*o,s=Math.sin(t)*o,c=Math.sin(e),u=c*a-s*i;return[Math.atan2(s*a+c*i,l*r+u*n),Et(u*r-l*n)]},o}function In(t,e){var r=Math.cos(t),n=Math.sin(t);return function(a,i,o,l){var s=o*e;null!=a?(a=Fn(r,a),i=Fn(r,i),(o>0?a<i:a>i)&&(a+=o*Tt)):(a=t+o*Tt,i=t-.5*s);for(var c,u=a;o>0?u>i:u<i;u-=s)l.point((c=Ir([r,-n*Math.cos(u),-n*Math.sin(u)]))[0],c[1])}}function Fn(t,e){var r=Pr(e);r[0]-=t,Rr(r);var n=Dt(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-kt)%(2*Math.PI)}function jn(e,r,n){var a=t.range(e,r-kt,n).concat(r);return function(t){return a.map(function(e){return[t,e]})}}function Bn(e,r,n){var a=t.range(e,r-kt,n).concat(r);return function(t){return a.map(function(e){return[e,t]})}}function Hn(t){return t.source}function qn(t){return t.target}t.geo.path=function(){var e,r,n,a,i,o=4.5;function l(e){return e&&("function"==typeof o&&a.pointRadius(+o.apply(this,arguments)),i&&i.valid||(i=n(a)),t.geo.stream(e,i)),a.result()}function s(){return i=null,l}return l.area=function(e){return ln=0,t.geo.stream(e,n(pn)),ln},l.centroid=function(e){return xr=br=_r=wr=kr=Mr=Ar=Tr=Lr=0,t.geo.stream(e,n(xn)),Lr?[Ar/Lr,Tr/Lr]:Mr?[wr/Mr,kr/Mr]:_r?[xr/_r,br/_r]:[NaN,NaN]},l.bounds=function(e){return fn=dn=-(cn=un=1/0),t.geo.stream(e,n(gn)),[[cn,un],[fn,dn]]},l.projection=function(t){return arguments.length?(n=(e=t)?t.stream||(r=t,a=An(function(t,e){return r([t*Ot,e*Ot])}),function(t){return On(a(t))}):P,s()):e;var r,a},l.context=function(t){return arguments.length?(a=null==(r=t)?new vn:new Mn(t),"function"!=typeof o&&a.pointRadius(o),s()):r},l.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(a.pointRadius(+t),+t),l):o},l.projection(t.geo.albersUsa()).context(null)},t.geo.transform=function(t){return{stream:function(e){var r=new Tn(e);for(var n in t)r[n]=t[n];return r}}},Tn.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=Sn,t.geo.projectionMutator=Cn,(t.geo.equirectangular=function(){return Sn(Pn)}).raw=Pn.invert=Pn,t.geo.rotation=function(t){function e(e){return(e=t(e[0]*Ct,e[1]*Ct))[0]*=Ot,e[1]*=Ot,e}return t=Dn(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]*=Ot,e[1]*=Ot,e},e},zn.invert=Pn,t.geo.circle=function(){var t,e,r=[0,0],n=6;function a(){var t="function"==typeof r?r.apply(this,arguments):r,n=Dn(-t[0]*Ct,-t[1]*Ct,0).invert,a=[];return e(null,null,1,{point:function(t,e){a.push(t=n(t,e)),t[0]*=Ot,t[1]*=Ot}}),{type:"Polygon",coordinates:[a]}}return a.origin=function(t){return arguments.length?(r=t,a):r},a.angle=function(r){return arguments.length?(e=In((t=+r)*Ct,n*Ct),a):t},a.precision=function(r){return arguments.length?(e=In(t*Ct,(n=+r)*Ct),a):n},a.angle(90)},t.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Ct,a=t[1]*Ct,i=e[1]*Ct,o=Math.sin(n),l=Math.cos(n),s=Math.sin(a),c=Math.cos(a),u=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((r=f*o)*r+(r=c*u-s*f*l)*r),s*u+c*f*l)},t.geo.graticule=function(){var e,r,n,a,i,o,l,s,c,u,f,d,p=10,h=p,g=90,v=360,y=2.5;function x(){return{type:"MultiLineString",coordinates:b()}}function b(){return t.range(Math.ceil(a/g)*g,n,g).map(f).concat(t.range(Math.ceil(s/v)*v,l,v).map(d)).concat(t.range(Math.ceil(r/p)*p,e,p).filter(function(t){return m(t%g)>kt}).map(c)).concat(t.range(Math.ceil(o/h)*h,i,h).filter(function(t){return m(t%v)>kt}).map(u))}return x.lines=function(){return b().map(function(t){return{type:"LineString",coordinates:t}})},x.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(l).slice(1),f(n).reverse().slice(1),d(s).reverse().slice(1))]}},x.extent=function(t){return arguments.length?x.majorExtent(t).minorExtent(t):x.minorExtent()},x.majorExtent=function(t){return arguments.length?(a=+t[0][0],n=+t[1][0],s=+t[0][1],l=+t[1][1],a>n&&(t=a,a=n,n=t),s>l&&(t=s,s=l,l=t),x.precision(y)):[[a,s],[n,l]]},x.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],i=+t[1][1],r>e&&(t=r,r=e,e=t),o>i&&(t=o,o=i,i=t),x.precision(y)):[[r,o],[e,i]]},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],h=+t[1],x):[p,h]},x.precision=function(t){return arguments.length?(y=+t,c=jn(o,i,90),u=Bn(r,e,y),f=jn(s,l,90),d=Bn(a,n,y),x):y},x.majorExtent([[-180,-90+kt],[180,90-kt]]).minorExtent([[-180,-80-kt],[180,80+kt]])},t.geo.greatArc=function(){var e,r,n=Hn,a=qn;function i(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||a.apply(this,arguments)]}}return i.distance=function(){return t.geo.distance(e||n.apply(this,arguments),r||a.apply(this,arguments))},i.source=function(t){return arguments.length?(n=t,e="function"==typeof t?null:t,i):n},i.target=function(t){return arguments.length?(a=t,r="function"==typeof t?null:t,i):a},i.precision=function(){return arguments.length?i:0},i},t.geo.interpolate=function(t,e){return r=t[0]*Ct,n=t[1]*Ct,a=e[0]*Ct,i=e[1]*Ct,o=Math.cos(n),l=Math.sin(n),s=Math.cos(i),c=Math.sin(i),u=o*Math.cos(r),f=o*Math.sin(r),d=s*Math.cos(a),p=s*Math.sin(a),h=2*Math.asin(Math.sqrt(Rt(i-n)+o*s*Rt(a-r))),g=1/Math.sin(h),(v=h?function(t){var e=Math.sin(t*=h)*g,r=Math.sin(h-t)*g,n=r*u+e*d,a=r*f+e*p,i=r*l+e*c;return[Math.atan2(a,n)*Ot,Math.atan2(i,Math.sqrt(n*n+a*a))*Ot]}:function(){return[r*Ot,n*Ot]}).distance=h,v;var r,n,a,i,o,l,s,c,u,f,d,p,h,g,v},t.geo.length=function(e){return mn=0,t.geo.stream(e,Vn),mn};var Vn={sphere:N,point:N,lineStart:function(){var t,e,r;function n(n,a){var i=Math.sin(a*=Ct),o=Math.cos(a),l=m((n*=Ct)-t),s=Math.cos(l);mn+=Math.atan2(Math.sqrt((l=o*Math.sin(l))*l+(l=r*i-e*o*s)*l),e*i+r*o*s),t=n,e=i,r=o}Vn.point=function(a,i){t=a*Ct,e=Math.sin(i*=Ct),r=Math.cos(i),Vn.point=n},Vn.lineEnd=function(){Vn.point=Vn.lineEnd=N}},lineEnd:N,polygonStart:N,polygonEnd:N};function Un(t,e){function r(e,r){var n=Math.cos(e),a=Math.cos(r),i=t(n*a);return[i*a*Math.sin(e),i*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),a=e(n),i=Math.sin(a),o=Math.cos(a);return[Math.atan2(t*i,n*o),Math.asin(n&&r*i/n)]},r}var Gn=Un(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(t.geo.azimuthalEqualArea=function(){return Sn(Gn)}).raw=Gn;var Yn=Un(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},P);function Xn(t,e){var r=Math.cos(t),n=function(t){return Math.tan(At/4+t/2)},a=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(n(e)/n(t)),i=r*Math.pow(n(t),a)/a;if(!a)return Qn;function o(t,e){i>0?e<-St+kt&&(e=-St+kt):e>St-kt&&(e=St-kt);var r=i/Math.pow(n(e),a);return[r*Math.sin(a*t),i-r*Math.cos(a*t)]}return o.invert=function(t,e){var r=i-e,n=Pt(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(i/n,1/a))-St]},o}function Zn(t,e){var r=Math.cos(t),n=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),a=r/n+t;if(m(n)<kt)return Pn;function i(t,e){var r=a-e;return[r*Math.sin(n*t),a-r*Math.cos(n*t)]}return i.invert=function(t,e){var r=a-e;return[Math.atan2(t,r)/n,a-Pt(n)*Math.sqrt(t*t+r*r)]},i}(t.geo.azimuthalEquidistant=function(){return Sn(Yn)}).raw=Yn,(t.geo.conicConformal=function(){return an(Xn)}).raw=Xn,(t.geo.conicEquidistant=function(){return an(Zn)}).raw=Zn;var Wn=Un(function(t){return 1/t},Math.atan);function Qn(t,e){return[t,Math.log(Math.tan(At/4+e/2))]}function Jn(t){var e,r=Sn(t),n=r.scale,a=r.translate,i=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=a.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.clipExtent=function(t){var o=i.apply(r,arguments);if(o===r){if(e=null==t){var l=At*n(),s=a();i([[s[0]-l,s[1]-l],[s[0]+l,s[1]+l]])}}else e&&(o=null);return o},r.clipExtent(null)}(t.geo.gnomonic=function(){return Sn(Wn)}).raw=Wn,Qn.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-St]},(t.geo.mercator=function(){return Jn(Qn)}).raw=Qn;var $n=Un(function(){return 1},Math.asin);(t.geo.orthographic=function(){return Sn($n)}).raw=$n;var Kn=Un(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});function ta(t,e){return[Math.log(Math.tan(At/4+e/2)),-t]}function ea(t){return t[0]}function ra(t){return t[1]}function na(t){for(var e=t.length,r=[0,1],n=2,a=2;a<e;a++){for(;n>1&&zt(t[r[n-2]],t[r[n-1]],t[a])<=0;)--n;r[n++]=a}return r.slice(0,n)}function aa(t,e){return t[0]-e[0]||t[1]-e[1]}(t.geo.stereographic=function(){return Sn(Kn)}).raw=Kn,ta.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-St]},(t.geo.transverseMercator=function(){var t=Jn(ta),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=ta,t.geom={},t.geom.hull=function(t){var e=ea,r=ra;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,a=ve(e),i=ve(r),o=t.length,l=[],s=[];for(n=0;n<o;n++)l.push([+a.call(this,t[n],n),+i.call(this,t[n],n),n]);for(l.sort(aa),n=0;n<o;n++)s.push([l[n][0],-l[n][1]]);var c=na(l),u=na(s),f=u[0]===c[0],d=u[u.length-1]===c[c.length-1],p=[];for(n=c.length-1;n>=0;--n)p.push(t[l[c[n]][2]]);for(n=+f;n<u.length-d;++n)p.push(t[l[u[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 q(t,ia),t};var ia=t.geom.polygon.prototype=[];function oa(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function la(t,e,r,n){var a=t[0],i=r[0],o=e[0]-a,l=n[0]-i,s=t[1],c=r[1],u=e[1]-s,f=n[1]-c,d=(l*(s-c)-f*(a-i))/(f*o-l*u);return[a+d*o,s+d*u]}function sa(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}ia.area=function(){for(var t,e=-1,r=this.length,n=this[r-1],a=0;++e<r;)t=n,n=this[e],a+=t[1]*n[0]-t[0]*n[1];return.5*a},ia.centroid=function(t){var e,r,n=-1,a=this.length,i=0,o=0,l=this[a-1];for(arguments.length||(t=-1/(6*this.area()));++n<a;)e=l,l=this[n],r=e[0]*l[1]-l[0]*e[1],i+=(e[0]+l[0])*r,o+=(e[1]+l[1])*r;return[i*t,o*t]},ia.clip=function(t){for(var e,r,n,a,i,o,l=sa(t),s=-1,c=this.length-sa(this),u=this[c-1];++s<c;){for(e=t.slice(),t.length=0,a=this[s],i=e[(n=e.length-l)-1],r=-1;++r<n;)oa(o=e[r],u,a)?(oa(i,u,a)||t.push(la(i,o,u,a)),t.push(o)):oa(i,u,a)&&t.push(la(i,o,u,a)),i=o;l&&t.push(t[0]),u=a}return t};var ca,ua,fa,da,pa,ha=[],ga=[];function va(){Ea(this),this.edge=this.site=this.circle=null}function ya(t){var e=ha.pop()||new va;return e.site=t,e}function ma(t){La(t),fa.remove(t),ha.push(t),Ea(t)}function xa(t){var e=t.circle,r=e.x,n=e.cy,a={x:r,y:n},i=t.P,o=t.N,l=[t];ma(t);for(var s=i;s.circle&&m(r-s.circle.x)<kt&&m(n-s.circle.cy)<kt;)i=s.P,l.unshift(s),ma(s),s=i;l.unshift(s),La(s);for(var c=o;c.circle&&m(r-c.circle.x)<kt&&m(n-c.circle.cy)<kt;)o=c.N,l.push(c),ma(c),c=o;l.push(c),La(c);var u,f=l.length;for(u=1;u<f;++u)c=l[u],s=l[u-1],Pa(c.edge,s.site,c.site,a);s=l[0],(c=l[f-1]).edge=Oa(s.site,c.site,null,a),Ta(s),Ta(c)}function ba(t){for(var e,r,n,a,i=t.x,o=t.y,l=fa._;l;)if((n=_a(l,o)-i)>kt)l=l.L;else{if(!((a=i-wa(l,o))>kt)){n>-kt?(e=l.P,r=l):a>-kt?(e=l,r=l.N):e=r=l;break}if(!l.R){e=l;break}l=l.R}var s=ya(t);if(fa.insert(e,s),e||r){if(e===r)return La(e),r=ya(e.site),fa.insert(s,r),s.edge=r.edge=Oa(e.site,s.site),Ta(e),void Ta(r);if(r){La(e),La(r);var c=e.site,u=c.x,f=c.y,d=t.x-u,p=t.y-f,h=r.site,g=h.x-u,v=h.y-f,y=2*(d*v-p*g),m=d*d+p*p,x=g*g+v*v,b={x:(v*m-p*x)/y+u,y:(d*x-g*m)/y+f};Pa(r.edge,c,h,b),s.edge=Oa(c,t,null,b),r.edge=Oa(t,h,null,b),Ta(e),Ta(r)}else s.edge=Oa(e.site,s.site)}}function _a(t,e){var r=t.site,n=r.x,a=r.y,i=a-e;if(!i)return n;var o=t.P;if(!o)return-1/0;var l=(r=o.site).x,s=r.y,c=s-e;if(!c)return l;var u=l-n,f=1/i-1/c,d=u/c;return f?(-d+Math.sqrt(d*d-2*f*(u*u/(-2*c)-s+c/2+a-i/2)))/f+n:(n+l)/2}function wa(t,e){var r=t.N;if(r)return _a(r,e);var n=t.site;return n.y===e?n.x:1/0}function ka(t){this.site=t,this.edges=[]}function Ma(t,e){return e.angle-t.angle}function Aa(){Ea(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ta(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,a=t.site,i=r.site;if(n!==i){var o=a.x,l=a.y,s=n.x-o,c=n.y-l,u=i.x-o,f=2*(s*(v=i.y-l)-c*u);if(!(f>=-Mt)){var d=s*s+c*c,p=u*u+v*v,h=(v*d-c*p)/f,g=(s*p-u*d)/f,v=g+l,y=ga.pop()||new Aa;y.arc=t,y.site=a,y.x=h+o,y.y=v+Math.sqrt(h*h+g*g),y.cy=v,t.circle=y;for(var m=null,x=pa._;x;)if(y.y<x.y||y.y===x.y&&y.x<=x.x){if(!x.L){m=x.P;break}x=x.L}else{if(!x.R){m=x;break}x=x.R}pa.insert(m,y),m||(da=y)}}}}function La(t){var e=t.circle;e&&(e.P||(da=e.N),pa.remove(e),ga.push(e),Ea(e),t.circle=null)}function Sa(t,e){var r=t.b;if(r)return!0;var n,a,i=t.a,o=e[0][0],l=e[1][0],s=e[0][1],c=e[1][1],u=t.l,f=t.r,d=u.x,p=u.y,h=f.x,g=f.y,v=(d+h)/2,y=(p+g)/2;if(g===p){if(v<o||v>=l)return;if(d>h){if(i){if(i.y>=c)return}else i={x:v,y:s};r={x:v,y:c}}else{if(i){if(i.y<s)return}else i={x:v,y:c};r={x:v,y:s}}}else if(a=y-(n=(d-h)/(g-p))*v,n<-1||n>1)if(d>h){if(i){if(i.y>=c)return}else i={x:(s-a)/n,y:s};r={x:(c-a)/n,y:c}}else{if(i){if(i.y<s)return}else i={x:(c-a)/n,y:c};r={x:(s-a)/n,y:s}}else if(p<g){if(i){if(i.x>=l)return}else i={x:o,y:n*o+a};r={x:l,y:n*l+a}}else{if(i){if(i.x<o)return}else i={x:l,y:n*l+a};r={x:o,y:n*o+a}}return t.a=i,t.b=r,!0}function Ca(t,e){this.l=t,this.r=e,this.a=this.b=null}function Oa(t,e,r,n){var a=new Ca(t,e);return ca.push(a),r&&Pa(a,t,e,r),n&&Pa(a,e,t,n),ua[t.i].edges.push(new za(a,t,e)),ua[e.i].edges.push(new za(a,e,t)),a}function Pa(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 za(t,e,r){var n=t.a,a=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(a.x-n.x,n.y-a.y):Math.atan2(n.x-a.x,a.y-n.y)}function Da(){this._=null}function Ea(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Na(t,e){var r=e,n=e.R,a=r.U;a?a.L===r?a.L=n:a.R=n:t._=n,n.U=a,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function Ra(t,e){var r=e,n=e.L,a=r.U;a?a.L===r?a.L=n:a.R=n:t._=n,n.U=a,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function Ia(t){for(;t.L;)t=t.L;return t}function Fa(t,e){var r,n,a,i=t.sort(ja).pop();for(ca=[],ua=new Array(t.length),fa=new Da,pa=new Da;;)if(a=da,i&&(!a||i.y<a.y||i.y===a.y&&i.x<a.x))i.x===r&&i.y===n||(ua[i.i]=new ka(i),ba(i),r=i.x,n=i.y),i=t.pop();else{if(!a)break;xa(a.arc)}e&&(function(t){for(var e,r=ca,n=en(t[0][0],t[0][1],t[1][0],t[1][1]),a=r.length;a--;)(!Sa(e=r[a],t)||!n(e)||m(e.a.x-e.b.x)<kt&&m(e.a.y-e.b.y)<kt)&&(e.a=e.b=null,r.splice(a,1))}(e),function(t){for(var e,r,n,a,i,o,l,s,c,u,f=t[0][0],d=t[1][0],p=t[0][1],h=t[1][1],g=ua,v=g.length;v--;)if((i=g[v])&&i.prepare())for(s=(l=i.edges).length,o=0;o<s;)n=(u=l[o].end()).x,a=u.y,e=(c=l[++o%s].start()).x,r=c.y,(m(n-e)>kt||m(a-r)>kt)&&(l.splice(o,0,new za((y=i.site,x=u,b=m(n-f)<kt&&h-a>kt?{x:f,y:m(e-f)<kt?r:h}:m(a-h)<kt&&d-n>kt?{x:m(r-h)<kt?e:d,y:h}:m(n-d)<kt&&a-p>kt?{x:d,y:m(e-d)<kt?r:p}:m(a-p)<kt&&n-f>kt?{x:m(r-p)<kt?e:f,y:p}:null,_=void 0,_=new Ca(y,null),_.a=x,_.b=b,ca.push(_),_),i.site,null)),++s);var y,x,b,_}(e));var o={cells:ua,edges:ca};return fa=pa=ca=ua=null,o}function ja(t,e){return e.y-t.y||e.x-t.x}ka.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(Ma),e.length},za.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}},Da.prototype={insert:function(t,e){var r,n,a;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=Ia(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?(a=n.R)&&a.C?(r.C=a.C=!1,n.C=!0,t=n):(t===r.R&&(Na(this,r),r=(t=r).U),r.C=!1,n.C=!0,Ra(this,n)):(a=n.L)&&a.C?(r.C=a.C=!1,n.C=!0,t=n):(t===r.L&&(Ra(this,r),r=(t=r).U),r.C=!1,n.C=!0,Na(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,a=t.U,i=t.L,o=t.R;if(r=i?o?Ia(o):i:o,a?a.L===t?a.L=r:a.R=r:this._=r,i&&o?(n=r.C,r.C=t.C,r.L=i,i.U=r,r!==o?(a=r.U,r.U=t.U,t=r.R,a.L=t,r.R=o,o.U=r):(r.U=a,a=r,t=r.R)):(n=t.C,t=r),t&&(t.U=a),!n)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===a.L){if((e=a.R).C&&(e.C=!1,a.C=!0,Na(this,a),e=a.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,Ra(this,e),e=a.R),e.C=a.C,a.C=e.R.C=!1,Na(this,a),t=this._;break}}else if((e=a.L).C&&(e.C=!1,a.C=!0,Ra(this,a),e=a.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,Na(this,e),e=a.L),e.C=a.C,a.C=e.L.C=!1,Ra(this,a),t=this._;break}e.C=!0,t=a,a=a.U}while(!t.C);t&&(t.C=!1)}}},t.geom.voronoi=function(t){var e=ea,r=ra,n=e,a=r,i=Ba;if(t)return o(t);function o(t){var e=new Array(t.length),r=i[0][0],n=i[0][1],a=i[1][0],o=i[1][1];return Fa(l(t),i).cells.forEach(function(i,l){var s=i.edges,c=i.site;(e[l]=s.length?s.map(function(t){var e=t.start();return[e.x,e.y]}):c.x>=r&&c.x<=a&&c.y>=n&&c.y<=o?[[r,o],[a,o],[a,n],[r,n]]:[]).point=t[l]}),e}function l(t){return t.map(function(t,e){return{x:Math.round(n(t,e)/kt)*kt,y:Math.round(a(t,e)/kt)*kt,i:e}})}return o.links=function(t){return Fa(l(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 Fa(l(t)).cells.forEach(function(r,n){for(var a,i,o,l,s=r.site,c=r.edges.sort(Ma),u=-1,f=c.length,d=c[f-1].edge,p=d.l===s?d.r:d.l;++u<f;)d,a=p,p=(d=c[u].edge).l===s?d.r:d.l,n<a.i&&n<p.i&&(o=a,l=p,((i=s).x-l.x)*(o.y-i.y)-(i.x-o.x)*(l.y-i.y)<0)&&e.push([t[n],t[a.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?(a=ve(r=t),o):r},o.clipExtent=function(t){return arguments.length?(i=null==t?Ba:t,o):i===Ba?null:i},o.size=function(t){return arguments.length?o.clipExtent(t&&[[0,0],t]):i===Ba?null:i&&i[1]},o};var Ba=[[-1e6,-1e6],[1e6,1e6]];function Ha(t){return t.x}function qa(t){return t.y}function Va(e,r){e=t.rgb(e),r=t.rgb(r);var n=e.r,a=e.g,i=e.b,o=r.r-n,l=r.g-a,s=r.b-i;return function(t){return"#"+ce(Math.round(n+o*t))+ce(Math.round(a+l*t))+ce(Math.round(i+s*t))}}function Ua(t,e){var r,n={},a={};for(r in t)r in e?n[r]=Wa(t[r],e[r]):a[r]=t[r];for(r in e)r in t||(a[r]=e[r]);return function(t){for(r in n)a[r]=n[r](t);return a}}function Ga(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Ya(t,e){var r,n,a,i=Xa.lastIndex=Za.lastIndex=0,o=-1,l=[],s=[];for(t+="",e+="";(r=Xa.exec(t))&&(n=Za.exec(e));)(a=n.index)>i&&(a=e.slice(i,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(n=n[0])?l[o]?l[o]+=n:l[++o]=n:(l[++o]=null,s.push({i:o,x:Ga(r,n)})),i=Za.lastIndex;return i<e.length&&(a=e.slice(i),l[o]?l[o]+=a:l[++o]=a),l.length<2?s[0]?(e=s[0].x,function(t){return e(t)+""}):function(){return e}:(e=s.length,function(t){for(var r,n=0;n<e;++n)l[(r=s[n]).i]=r.x(t);return l.join("")})}t.geom.delaunay=function(e){return t.geom.voronoi().triangles(e)},t.geom.quadtree=function(t,e,r,n,a){var i,o=ea,l=ra;if(i=arguments.length)return o=Ha,l=qa,3===i&&(a=r,n=e,r=e=0),s(t);function s(t){var s,c,u,f,d,p,h,g,v,y=ve(o),x=ve(l);if(null!=e)p=e,h=r,g=n,v=a;else if(g=v=-(p=h=1/0),c=[],u=[],d=t.length,i)for(f=0;f<d;++f)(s=t[f]).x<p&&(p=s.x),s.y<h&&(h=s.y),s.x>g&&(g=s.x),s.y>v&&(v=s.y),c.push(s.x),u.push(s.y);else for(f=0;f<d;++f){var b=+y(s=t[f],f),_=+x(s,f);b<p&&(p=b),_<h&&(h=_),b>g&&(g=b),_>v&&(v=_),c.push(b),u.push(_)}var w=g-p,k=v-h;function M(t,e,r,n,a,i,o,l){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var s=t.x,c=t.y;if(null!=s)if(m(s-r)+m(c-n)<.01)A(t,e,r,n,a,i,o,l);else{var u=t.point;t.x=t.y=t.point=null,A(t,u,s,c,a,i,o,l),A(t,e,r,n,a,i,o,l)}else t.x=r,t.y=n,t.point=e}else A(t,e,r,n,a,i,o,l)}function A(t,e,r,n,a,i,o,l){var s=.5*(a+o),c=.5*(i+l),u=r>=s,f=n>=c,d=f<<1|u;t.leaf=!1,u?a=s:o=s,f?i=c:l=c,M(t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){M(T,t,+y(t,++f),+x(t,f),p,h,g,v)}}),e,r,n,a,i,o,l)}w>k?v=h+w:g=p+k;var T={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){M(T,t,+y(t,++f),+x(t,f),p,h,g,v)}};if(T.visit=function(t){!function t(e,r,n,a,i,o){if(!e(r,n,a,i,o)){var l=.5*(n+i),s=.5*(a+o),c=r.nodes;c[0]&&t(e,c[0],n,a,l,s),c[1]&&t(e,c[1],l,a,i,s),c[2]&&t(e,c[2],n,s,l,o),c[3]&&t(e,c[3],l,s,i,o)}}(t,T,p,h,g,v)},T.find=function(t){return function(t,e,r,n,a,i,o){var l,s=1/0;return function t(c,u,f,d,p){if(!(u>i||f>o||d<n||p<a)){if(h=c.point){var h,g=e-c.x,v=r-c.y,y=g*g+v*v;if(y<s){var m=Math.sqrt(s=y);n=e-m,a=r-m,i=e+m,o=r+m,l=h}}for(var x=c.nodes,b=.5*(u+d),_=.5*(f+p),w=(r>=_)<<1|e>=b,k=w+4;w<k;++w)if(c=x[3&w])switch(3&w){case 0:t(c,u,f,b,_);break;case 1:t(c,b,f,d,_);break;case 2:t(c,u,_,b,p);break;case 3:t(c,b,_,d,p)}}}(t,n,a,i,o),l}(T,t[0],t[1],p,h,g,v)},f=-1,null==e){for(;++f<d;)M(T,t[f],c[f],u[f],p,h,g,v);--f}else t.forEach(T.add);return c=u=t=s=null,T}return s.x=function(t){return arguments.length?(o=t,s):o},s.y=function(t){return arguments.length?(l=t,s):l},s.extent=function(t){return arguments.length?(null==t?e=r=n=a=null:(e=+t[0][0],r=+t[0][1],n=+t[1][0],a=+t[1][1]),s):null==e?null:[[e,r],[n,a]]},s.size=function(t){return arguments.length?(null==t?e=r=n=a=null:(e=r=0,n=+t[0],a=+t[1]),s):null==e?null:[n-e,a-r]},s},t.interpolateRgb=Va,t.interpolateObject=Ua,t.interpolateNumber=Ga,t.interpolateString=Ya;var Xa=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Za=new RegExp(Xa.source,"g");function Wa(e,r){for(var n,a=t.interpolators.length;--a>=0&&!(n=t.interpolators[a](e,r)););return n}function Qa(t,e){var r,n=[],a=[],i=t.length,o=e.length,l=Math.min(t.length,e.length);for(r=0;r<l;++r)n.push(Wa(t[r],e[r]));for(;r<i;++r)a[r]=t[r];for(;r<o;++r)a[r]=e[r];return function(t){for(r=0;r<l;++r)a[r]=n[r](t);return a}}t.interpolate=Wa,t.interpolators=[function(t,e){var r=typeof e;return("string"===r?ge.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?Va:Ya:e instanceof Ht?Va:Array.isArray(e)?Qa:"object"===r&&isNaN(e)?Ua:Ga)(t,e)}],t.interpolateArray=Qa;var Ja=function(){return P},$a=t.map({linear:Ja,poly:function(t){return function(e){return Math.pow(e,t)}},quad:function(){return ri},cubic:function(){return ni},sin:function(){return ii},exp:function(){return oi},circle:function(){return li},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 si}}),Ka=t.map({in:P,out:ti,"in-out":ei,"out-in":function(t){return ei(ti(t))}});function ti(t){return function(e){return 1-t(1-e)}}function ei(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function ri(t){return t*t}function ni(t){return t*t*t}function ai(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 ii(t){return 1-Math.cos(t*St)}function oi(t){return Math.pow(2,10*(t-1))}function li(t){return 1-Math.sqrt(1-t*t)}function si(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 ci(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function ui(t){var e,r,n,a=[t.a,t.b],i=[t.c,t.d],o=di(a),l=fi(a,i),s=di(((e=i)[0]+=(n=-l)*(r=a)[0],e[1]+=n*r[1],e))||0;a[0]*i[1]<i[0]*a[1]&&(a[0]*=-1,a[1]*=-1,o*=-1,l*=-1),this.rotate=(o?Math.atan2(a[1],a[0]):Math.atan2(-i[0],i[1]))*Ot,this.translate=[t.e,t.f],this.scale=[o,s],this.skew=s?Math.atan2(l,s)*Ot:0}function fi(t,e){return t[0]*e[0]+t[1]*e[1]}function di(t){var e=Math.sqrt(fi(t,t));return e&&(t[0]/=e,t[1]/=e),e}t.ease=function(t){var e,n=t.indexOf("-"),a=n>=0?t.slice(0,n):t,i=n>=0?t.slice(n+1):"in";return a=$a.get(a)||Ja,i=Ka.get(i)||P,e=i(a.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,a=e.c,i=e.l,o=r.h-n,l=r.c-a,s=r.l-i;isNaN(l)&&(l=0,a=isNaN(a)?r.c:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Xt(n+o*t,a+l*t,i+s*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,a=e.s,i=e.l,o=r.h-n,l=r.s-a,s=r.l-i;isNaN(l)&&(l=0,a=isNaN(a)?r.s:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Ut(n+o*t,a+l*t,i+s*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,a=e.a,i=e.b,o=r.l-n,l=r.a-a,s=r.b-i;return function(t){return te(n+o*t,a+l*t,i+s*t)+""}},t.interpolateRound=ci,t.transform=function(e){var r=a.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 ui(e?e.matrix:pi)})(e)},ui.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var pi={a:1,b:0,c:0,d:1,e:0,f:0};function hi(t){return t.length?t.pop()+",":""}function gi(e,r){var n=[],a=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:Ga(t[0],e[0])},{i:a-2,x:Ga(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,a),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(hi(r)+"rotate(",null,")")-2,x:Ga(t,e)})):e&&r.push(hi(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,a),function(t,e,r,n){t!==e?n.push({i:r.push(hi(r)+"skewX(",null,")")-2,x:Ga(t,e)}):e&&r.push(hi(r)+"skewX("+e+")")}(e.skew,r.skew,n,a),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push(hi(r)+"scale(",null,",",null,")");n.push({i:a-4,x:Ga(t[0],e[0])},{i:a-2,x:Ga(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(hi(r)+"scale("+e+")")}(e.scale,r.scale,n,a),e=r=null,function(t){for(var e,r=-1,i=a.length;++r<i;)n[(e=a[r]).i]=e.x(t);return n.join("")}}function vi(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function yi(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function mi(t){for(var e=t.source,r=t.target,n=function(t,e){if(t===e)return t;var r=xi(t),n=xi(e),a=r.pop(),i=n.pop(),o=null;for(;a===i;)o=a,a=r.pop(),i=n.pop();return o}(e,r),a=[e];e!==n;)e=e.parent,a.push(e);for(var i=a.length;r!==n;)a.splice(i,0,r),r=r.parent;return a}function xi(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function bi(t){t.fixed|=2}function _i(t){t.fixed&=-7}function wi(t){t.fixed|=4,t.px=t.x,t.py=t.y}function ki(t){t.fixed&=-5}t.interpolateTransform=gi,t.layout={},t.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(mi(t[r]));return e}},t.layout.chord=function(){var e,r,n,a,i,o,l,s={},c=0;function u(){var s,u,d,p,h,g={},v=[],y=t.range(a),m=[];for(e=[],r=[],s=0,p=-1;++p<a;){for(u=0,h=-1;++h<a;)u+=n[p][h];v.push(u),m.push(t.range(a)),s+=u}for(i&&y.sort(function(t,e){return i(v[t],v[e])}),o&&m.forEach(function(t,e){t.sort(function(t,r){return o(n[e][t],n[e][r])})}),s=(Tt-c*a)/s,u=0,p=-1;++p<a;){for(d=u,h=-1;++h<a;){var x=y[p],b=m[x][h],_=n[x][b],w=u,k=u+=_*s;g[x+"-"+b]={index:x,subindex:b,startAngle:w,endAngle:k,value:_}}r[x]={index:x,startAngle:d,endAngle:u,value:v[x]},u+=c}for(p=-1;++p<a;)for(h=p-1;++h<a;){var M=g[p+"-"+h],A=g[h+"-"+p];(M.value||A.value)&&e.push(M.value<A.value?{source:A,target:M}:{source:M,target:A})}l&&f()}function f(){e.sort(function(t,e){return l((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}return s.matrix=function(t){return arguments.length?(a=(n=t)&&n.length,e=r=null,s):n},s.padding=function(t){return arguments.length?(c=t,e=r=null,s):c},s.sortGroups=function(t){return arguments.length?(i=t,e=r=null,s):i},s.sortSubgroups=function(t){return arguments.length?(o=t,e=null,s):o},s.sortChords=function(t){return arguments.length?(l=t,e&&f(),s):l},s.chords=function(){return e||u(),e},s.groups=function(){return r||u(),r},s},t.layout.force=function(){var e,r,n,a,i,o,l={},s=t.dispatch("start","tick","end"),c=[1,1],u=.9,f=Mi,d=Ai,p=-30,h=Ti,g=.1,v=.64,y=[],m=[];function x(t){return function(e,r,n,a){if(e.point!==t){var i=e.cx-t.x,o=e.cy-t.y,l=a-r,s=i*i+o*o;if(l*l/v<s){if(s<h){var c=e.charge/s;t.px-=i*c,t.py-=o*c}return!0}if(e.point&&s&&s<h){c=e.pointCharge/s;t.px-=i*c,t.py-=o*c}}return!e.charge}}function b(e){e.px=t.event.x,e.py=t.event.y,l.resume()}return l.tick=function(){if((n*=.99)<.005)return e=null,s.end({type:"end",alpha:n=0}),!0;var r,l,f,d,h,v,b,_,w,k=y.length,M=m.length;for(l=0;l<M;++l)d=(f=m[l]).source,(v=(_=(h=f.target).x-d.x)*_+(w=h.y-d.y)*w)&&(_*=v=n*i[l]*((v=Math.sqrt(v))-a[l])/v,w*=v,h.x-=_*(b=d.weight+h.weight?d.weight/(d.weight+h.weight):.5),h.y-=w*b,d.x+=_*(b=1-b),d.y+=w*b);if((b=n*g)&&(_=c[0]/2,w=c[1]/2,l=-1,b))for(;++l<k;)(f=y[l]).x+=(_-f.x)*b,f.y+=(w-f.y)*b;if(p)for(!function t(e,r,n){var a=0,i=0;e.charge=0;if(!e.leaf)for(var o,l=e.nodes,s=l.length,c=-1;++c<s;)null!=(o=l[c])&&(t(o,r,n),e.charge+=o.charge,a+=o.charge*o.cx,i+=o.charge*o.cy);if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var u=r*n[e.point.index];e.charge+=e.pointCharge=u,a+=u*e.point.x,i+=u*e.point.y}e.cx=a/e.charge;e.cy=i/e.charge}(r=t.geom.quadtree(y),n,o),l=-1;++l<k;)(f=y[l]).fixed||r.visit(x(f));for(l=-1;++l<k;)(f=y[l]).fixed?(f.x=f.px,f.y=f.py):(f.x-=(f.px-(f.px=f.x))*u,f.y-=(f.py-(f.py=f.y))*u);s.tick({type:"tick",alpha:n})},l.nodes=function(t){return arguments.length?(y=t,l):y},l.links=function(t){return arguments.length?(m=t,l):m},l.size=function(t){return arguments.length?(c=t,l):c},l.linkDistance=function(t){return arguments.length?(f="function"==typeof t?t:+t,l):f},l.distance=l.linkDistance,l.linkStrength=function(t){return arguments.length?(d="function"==typeof t?t:+t,l):d},l.friction=function(t){return arguments.length?(u=+t,l):u},l.charge=function(t){return arguments.length?(p="function"==typeof t?t:+t,l):p},l.chargeDistance=function(t){return arguments.length?(h=t*t,l):Math.sqrt(h)},l.gravity=function(t){return arguments.length?(g=+t,l):g},l.theta=function(t){return arguments.length?(v=t*t,l):Math.sqrt(v)},l.alpha=function(t){return arguments.length?(t=+t,n?t>0?n=t:(e.c=null,e.t=NaN,e=null,s.end({type:"end",alpha:n=0})):t>0&&(s.start({type:"start",alpha:n=t}),e=Me(l.tick)),l):n},l.start=function(){var t,e,r,n=y.length,s=m.length,u=c[0],h=c[1];for(t=0;t<n;++t)(r=y[t]).index=t,r.weight=0;for(t=0;t<s;++t)"number"==typeof(r=m[t]).source&&(r.source=y[r.source]),"number"==typeof r.target&&(r.target=y[r.target]),++r.source.weight,++r.target.weight;for(t=0;t<n;++t)r=y[t],isNaN(r.x)&&(r.x=g("x",u)),isNaN(r.y)&&(r.y=g("y",h)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(a=[],"function"==typeof f)for(t=0;t<s;++t)a[t]=+f.call(this,m[t],t);else for(t=0;t<s;++t)a[t]=f;if(i=[],"function"==typeof d)for(t=0;t<s;++t)i[t]=+d.call(this,m[t],t);else for(t=0;t<s;++t)i[t]=d;if(o=[],"function"==typeof p)for(t=0;t<n;++t)o[t]=+p.call(this,y[t],t);else for(t=0;t<n;++t)o[t]=p;function g(r,a){if(!e){for(e=new Array(n),c=0;c<n;++c)e[c]=[];for(c=0;c<s;++c){var i=m[c];e[i.source.index].push(i.target),e[i.target.index].push(i.source)}}for(var o,l=e[t],c=-1,u=l.length;++c<u;)if(!isNaN(o=l[c][r]))return o;return Math.random()*a}return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){if(r||(r=t.behavior.drag().origin(P).on("dragstart.force",bi).on("drag.force",b).on("dragend.force",_i)),!arguments.length)return r;this.on("mouseover.force",wi).on("mouseout.force",ki).call(r)},t.rebind(l,s,"on")};var Mi=20,Ai=1,Ti=1/0;function Li(e,r){return t.rebind(e,r,"sort","children","value"),e.nodes=e,e.links=Di,e}function Si(t,e){for(var r=[t];null!=(t=r.pop());)if(e(t),(a=t.children)&&(n=a.length))for(var n,a;--n>=0;)r.push(a[n])}function Ci(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(i=t.children)&&(a=i.length))for(var a,i,o=-1;++o<a;)r.push(i[o]);for(;null!=(t=n.pop());)e(t)}function Oi(t){return t.children}function Pi(t){return t.value}function zi(t,e){return e.value-t.value}function Di(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=zi,e=Oi,r=Pi;function n(a){var i,o=[a],l=[];for(a.depth=0;null!=(i=o.pop());)if(l.push(i),(c=e.call(n,i,i.depth))&&(s=c.length)){for(var s,c,u;--s>=0;)o.push(u=c[s]),u.parent=i,u.depth=i.depth+1;r&&(i.value=0),i.children=c}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return Ci(a,function(e){var n,a;t&&(n=e.children)&&n.sort(t),r&&(a=e.parent)&&(a.value+=e.value)}),l}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&&(Si(t,function(t){t.children&&(t.value=0)}),Ci(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 a=e.call(this,t,n);return function t(e,r,n,a){var i=e.children;if(e.x=r,e.y=e.depth*a,e.dx=n,e.dy=a,i&&(o=i.length)){var o,l,s,c=-1;for(n=e.value?n/e.value:0;++c<o;)t(l=i[c],r,s=l.value*n,a),r+=s}}(a[0],0,r[0],r[1]/function t(e){var r=e.children,n=0;if(r&&(a=r.length))for(var a,i=-1;++i<a;)n=Math.max(n,t(r[i]));return 1+n}(a[0])),a}return n.size=function(t){return arguments.length?(r=t,n):r},Li(n,e)},t.layout.pie=function(){var e=Number,r=Ei,n=0,a=Tt,i=0;function o(l){var s,c=l.length,u=l.map(function(t,r){return+e.call(o,t,r)}),f=+("function"==typeof n?n.apply(this,arguments):n),d=("function"==typeof a?a.apply(this,arguments):a)-f,p=Math.min(Math.abs(d)/c,+("function"==typeof i?i.apply(this,arguments):i)),h=p*(d<0?-1:1),g=t.sum(u),v=g?(d-c*h)/g:0,y=t.range(c),m=[];return null!=r&&y.sort(r===Ei?function(t,e){return u[e]-u[t]}:function(t,e){return r(l[t],l[e])}),y.forEach(function(t){m[t]={data:l[t],value:s=u[t],startAngle:f,endAngle:f+=s*v+h,padAngle:p}}),m}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?(a=t,o):a},o.padAngle=function(t){return arguments.length?(i=t,o):i},o};var Ei={};function Ni(t){return t.x}function Ri(t){return t.y}function Ii(t,e,r){t.y0=e,t.y=r}t.layout.stack=function(){var e=P,r=Bi,n=Hi,a=Ii,i=Ni,o=Ri;function l(s,c){if(!(p=s.length))return s;var u=s.map(function(t,r){return e.call(l,t,r)}),f=u.map(function(t){return t.map(function(t,e){return[i.call(l,t,e),o.call(l,t,e)]})}),d=r.call(l,f,c);u=t.permute(u,d),f=t.permute(f,d);var p,h,g,v,y=n.call(l,f,c),m=u[0].length;for(g=0;g<m;++g)for(a.call(l,u[0][g],v=y[g],f[0][g][1]),h=1;h<p;++h)a.call(l,u[h][g],v+=f[h-1][g][1],f[h][g][1]);return s}return l.values=function(t){return arguments.length?(e=t,l):e},l.order=function(t){return arguments.length?(r="function"==typeof t?t:Fi.get(t)||Bi,l):r},l.offset=function(t){return arguments.length?(n="function"==typeof t?t:ji.get(t)||Hi,l):n},l.x=function(t){return arguments.length?(i=t,l):i},l.y=function(t){return arguments.length?(o=t,l):o},l.out=function(t){return arguments.length?(a=t,l):a},l};var Fi=t.map({"inside-out":function(e){var r,n,a=e.length,i=e.map(qi),o=e.map(Vi),l=t.range(a).sort(function(t,e){return i[t]-i[e]}),s=0,c=0,u=[],f=[];for(r=0;r<a;++r)n=l[r],s<c?(s+=o[n],u.push(n)):(c+=o[n],f.push(n));return f.reverse().concat(u)},reverse:function(e){return t.range(e.length).reverse()},default:Bi}),ji=t.map({silhouette:function(t){var e,r,n,a=t.length,i=t[0].length,o=[],l=0,s=[];for(r=0;r<i;++r){for(e=0,n=0;e<a;e++)n+=t[e][r][1];n>l&&(l=n),o.push(n)}for(r=0;r<i;++r)s[r]=(l-o[r])/2;return s},wiggle:function(t){var e,r,n,a,i,o,l,s,c,u=t.length,f=t[0],d=f.length,p=[];for(p[0]=s=c=0,r=1;r<d;++r){for(e=0,a=0;e<u;++e)a+=t[e][r][1];for(e=0,i=0,l=f[r][0]-f[r-1][0];e<u;++e){for(n=0,o=(t[e][r][1]-t[e][r-1][1])/(2*l);n<e;++n)o+=(t[n][r][1]-t[n][r-1][1])/l;i+=o*t[e][r][1]}p[r]=s-=a?i/a*l:0,s<c&&(c=s)}for(r=0;r<d;++r)p[r]-=c;return p},expand:function(t){var e,r,n,a=t.length,i=t[0].length,o=1/a,l=[];for(r=0;r<i;++r){for(e=0,n=0;e<a;e++)n+=t[e][r][1];if(n)for(e=0;e<a;e++)t[e][r][1]/=n;else for(e=0;e<a;e++)t[e][r][1]=o}for(r=0;r<i;++r)l[r]=0;return l},zero:Hi});function Bi(e){return t.range(e.length)}function Hi(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function qi(t){for(var e,r=1,n=0,a=t[0][1],i=t.length;r<i;++r)(e=t[r][1])>a&&(n=r,a=e);return n}function Vi(t){return t.reduce(Ui,0)}function Ui(t,e){return t+e[1]}function Gi(t,e){return Yi(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Yi(t,e){for(var r=-1,n=+t[0],a=(t[1]-n)/e,i=[];++r<=e;)i[r]=a*r+n;return i}function Xi(e){return[t.min(e),t.max(e)]}function Zi(t,e){return t.value-e.value}function Wi(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Qi(t,e){t._pack_next=e,e._pack_prev=t}function Ji(t,e){var r=e.x-t.x,n=e.y-t.y,a=t.r+e.r;return.999*a*a>r*r+n*n}function $i(t){if((e=t.children)&&(s=e.length)){var e,r,n,a,i,o,l,s,c=1/0,u=-1/0,f=1/0,d=-1/0;if(e.forEach(Ki),(r=e[0]).x=-r.r,r.y=0,x(r),s>1&&((n=e[1]).x=n.r,n.y=0,x(n),s>2))for(eo(r,n,a=e[2]),x(a),Wi(r,a),r._pack_prev=a,Wi(a,n),n=r._pack_next,i=3;i<s;i++){eo(r,n,a=e[i]);var p=0,h=1,g=1;for(o=n._pack_next;o!==n;o=o._pack_next,h++)if(Ji(o,a)){p=1;break}if(1==p)for(l=r._pack_prev;l!==o._pack_prev&&!Ji(l,a);l=l._pack_prev,g++);p?(h<g||h==g&&n.r<r.r?Qi(r,n=o):Qi(r=l,n),i--):(Wi(r,a),n=a,x(a))}var v=(c+u)/2,y=(f+d)/2,m=0;for(i=0;i<s;i++)(a=e[i]).x-=v,a.y-=y,m=Math.max(m,a.r+Math.sqrt(a.x*a.x+a.y*a.y));t.r=m,e.forEach(to)}function x(t){c=Math.min(t.x-t.r,c),u=Math.max(t.x+t.r,u),f=Math.min(t.y-t.r,f),d=Math.max(t.y+t.r,d)}}function Ki(t){t._pack_next=t._pack_prev=t}function to(t){delete t._pack_next,delete t._pack_prev}function eo(t,e,r){var n=t.r+r.r,a=e.x-t.x,i=e.y-t.y;if(n&&(a||i)){var o=e.r+r.r,l=a*a+i*i,s=.5+((n*=n)-(o*=o))/(2*l),c=Math.sqrt(Math.max(0,2*o*(n+l)-(n-=l)*n-o*o))/(2*l);r.x=t.x+s*a+c*i,r.y=t.y+s*i-c*a}else r.x=t.x+n,r.y=t.y}function ro(t,e){return t.parent==e.parent?1:2}function no(t){var e=t.children;return e.length?e[0]:t.t}function ao(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function io(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 oo(t,e,r){return t.a.parent===e.parent?t.a:r}function lo(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function so(t,e){var r=t.x+e[3],n=t.y+e[0],a=t.dx-e[1]-e[3],i=t.dy-e[0]-e[2];return a<0&&(r+=a/2,a=0),i<0&&(n+=i/2,i=0),{x:r,y:n,dx:a,dy:i}}function co(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function uo(t){return t.rangeExtent?t.rangeExtent():co(t.range())}function fo(t,e,r,n){var a=r(t[0],t[1]),i=n(e[0],e[1]);return function(t){return i(a(t))}}function po(t,e){var r,n=0,a=t.length-1,i=t[n],o=t[a];return o<i&&(r=n,n=a,a=r,r=i,i=o,o=r),t[n]=e.floor(i),t[a]=e.ceil(o),t}function ho(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:go}t.layout.histogram=function(){var e=!0,r=Number,n=Xi,a=Gi;function i(i,o){for(var l,s,c=[],u=i.map(r,this),f=n.call(this,u,o),d=a.call(this,f,u,o),p=(o=-1,u.length),h=d.length-1,g=e?1:1/p;++o<h;)(l=c[o]=[]).dx=d[o+1]-(l.x=d[o]),l.y=0;if(h>0)for(o=-1;++o<p;)(s=u[o])>=f[0]&&s<=f[1]&&((l=c[t.bisect(d,s,1,h)-1]).y+=g,l.push(i[o]));return c}return i.value=function(t){return arguments.length?(r=t,i):r},i.range=function(t){return arguments.length?(n=ve(t),i):n},i.bins=function(t){return arguments.length?(a="number"==typeof t?function(e){return Yi(e,t)}:ve(t),i):a},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(Zi),n=0,a=[1,1];function i(t,i){var o=r.call(this,t,i),l=o[0],s=a[0],c=a[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(l.x=l.y=0,Ci(l,function(t){t.r=+u(t.value)}),Ci(l,$i),n){var f=n*(e?1:Math.max(2*l.r/s,2*l.r/c))/2;Ci(l,function(t){t.r+=f}),Ci(l,$i),Ci(l,function(t){t.r-=f})}return function t(e,r,n,a){var i=e.children;e.x=r+=a*e.x;e.y=n+=a*e.y;e.r*=a;if(i)for(var o=-1,l=i.length;++o<l;)t(i[o],r,n,a)}(l,s/2,c/2,e?1:1/Math.max(2*l.r/s,2*l.r/c)),o}return i.size=function(t){return arguments.length?(a=t,i):a},i.radius=function(t){return arguments.length?(e=null==t||"function"==typeof t?t:+t,i):e},i.padding=function(t){return arguments.length?(n=+t,i):n},Li(i,r)},t.layout.tree=function(){var e=t.layout.hierarchy().sort(null).value(null),r=ro,n=[1,1],a=null;function i(t,i){var c=e.call(this,t,i),u=c[0],f=function(t){var e,r={A:null,children:[t]},n=[r];for(;null!=(e=n.pop());)for(var a,i=e.children,o=0,l=i.length;o<l;++o)n.push((i[o]=a={_:i[o],parent:e,children:(a=i[o].children)&&a.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=a);return r.children[0]}(u);if(Ci(f,o),f.parent.m=-f.z,Si(f,l),a)Si(u,s);else{var d=u,p=u,h=u;Si(u,function(t){t.x<d.x&&(d=t),t.x>p.x&&(p=t),t.depth>h.depth&&(h=t)});var g=r(d,p)/2-d.x,v=n[0]/(p.x+r(p,d)/2+g),y=n[1]/(h.depth||1);Si(u,function(t){t.x=(t.x+g)*v,t.y=t.depth*y})}return c}function o(t){var e=t.children,n=t.parent.children,a=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,a=t.children,i=a.length;for(;--i>=0;)(e=a[i]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var i=(e[0].z+e[e.length-1].z)/2;a?(t.z=a.z+r(t._,a._),t.m=t.z-i):t.z=i}else a&&(t.z=a.z+r(t._,a._));t.parent.A=function(t,e,n){if(e){for(var a,i=t,o=t,l=e,s=i.parent.children[0],c=i.m,u=o.m,f=l.m,d=s.m;l=ao(l),i=no(i),l&&i;)s=no(s),(o=ao(o)).a=t,(a=l.z+f-i.z-c+r(l._,i._))>0&&(io(oo(l,t,n),t,a),c+=a,u+=a),f+=l.m,c+=i.m,d+=s.m,u+=o.m;l&&!ao(o)&&(o.t=l,o.m+=f-u),i&&!no(s)&&(s.t=i,s.m+=c-d,n=t)}return n}(t,a,t.parent.A||n[0])}function l(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=n[0],t.y=t.depth*n[1]}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t)?s:null,i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null==(n=t)?null:s,i):a?n:null},Li(i,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=ro,n=[1,1],a=!1;function i(i,o){var l,s=e.call(this,i,o),c=s[0],u=0;Ci(c,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=l?u+=r(e,l):0,e.y=0,l=e)});var f=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(c),d=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(c),p=f.x-r(f,d)/2,h=d.x+r(d,f)/2;return Ci(c,a?function(t){t.x=(t.x-c.x)*n[0],t.y=(c.y-t.y)*n[1]}:function(t){t.x=(t.x-p)/(h-p)*n[0],t.y=(1-(c.y?t.y/c.y:1))*n[1]}),s}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t),i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null!=(n=t),i):a?n:null},Li(i,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=lo,l=!1,s="squarify",c=.5*(1+Math.sqrt(5));function u(t,e){for(var r,n,a=-1,i=t.length;++a<i;)n=(r=t[a]).value*(e<0?0:e),r.area=isNaN(n)||n<=0?0:n}function f(t){var e=t.children;if(e&&e.length){var r,n,a,i=o(t),l=[],c=e.slice(),d=1/0,g="slice"===s?i.dx:"dice"===s?i.dy:"slice-dice"===s?1&t.depth?i.dy:i.dx:Math.min(i.dx,i.dy);for(u(c,i.dx*i.dy/t.value),l.area=0;(a=c.length)>0;)l.push(r=c[a-1]),l.area+=r.area,"squarify"!==s||(n=p(l,g))<=d?(c.pop(),d=n):(l.area-=l.pop().area,h(l,g,i,!1),g=Math.min(i.dx,i.dy),l.length=l.area=0,d=1/0);l.length&&(h(l,g,i,!0),l.length=l.area=0),e.forEach(f)}}function d(t){var e=t.children;if(e&&e.length){var r,n=o(t),a=e.slice(),i=[];for(u(a,n.dx*n.dy/t.value),i.area=0;r=a.pop();)i.push(r),i.area+=r.area,null!=r.z&&(h(i,r.z?n.dx:n.dy,n,!a.length),i.length=i.area=0);e.forEach(d)}}function p(t,e){for(var r,n=t.area,a=0,i=1/0,o=-1,l=t.length;++o<l;)(r=t[o].area)&&(r<i&&(i=r),r>a&&(a=r));return e*=e,(n*=n)?Math.max(e*a*c/n,n/(e*i*c)):1/0}function h(t,e,r,a){var i,o=-1,l=t.length,s=r.x,c=r.y,u=e?n(t.area/e):0;if(e==r.dx){for((a||u>r.dy)&&(u=r.dy);++o<l;)(i=t[o]).x=s,i.y=c,i.dy=u,s+=i.dx=Math.min(r.x+r.dx-s,u?n(i.area/u):0);i.z=!0,i.dx+=r.x+r.dx-s,r.y+=u,r.dy-=u}else{for((a||u>r.dx)&&(u=r.dx);++o<l;)(i=t[o]).x=s,i.y=c,i.dx=u,c+=i.dy=Math.min(r.y+r.dy-c,u?n(i.area/u):0);i.z=!1,i.dy+=r.y+r.dy-c,r.x+=u,r.dx-=u}}function g(t){var n=e||r(t),i=n[0];return i.x=i.y=0,i.value?(i.dx=a[0],i.dy=a[1]):i.dx=i.dy=0,e&&r.revalue(i),u([i],i.dx*i.dy/i.value),(e?d:f)(i),l&&(e=n),n}return g.size=function(t){return arguments.length?(a=t,g):a},g.padding=function(t){if(!arguments.length)return i;function e(e){return so(e,t)}var r;return o=null==(i=t)?lo:"function"==(r=typeof t)?function(e){var r=t.call(g,e,e.depth);return null==r?lo(e):so(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?(l=t,e=null,g):l},g.ratio=function(t){return arguments.length?(c=t,g):c},g.mode=function(t){return arguments.length?(s=t+"",g):s},Li(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,a;do{a=(r=2*Math.random()-1)*r+(n=2*Math.random()-1)*n}while(!a||a>1);return t+e*r*Math.sqrt(-2*Math.log(a)/a)}},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 go={floor:P,ceil:P};function vo(e,r,n,a){var i=[],o=[],l=0,s=Math.min(e.length,r.length)-1;for(e[s]<e[0]&&(e=e.slice().reverse(),r=r.slice().reverse());++l<=s;)i.push(n(e[l-1],e[l])),o.push(a(r[l-1],r[l]));return function(r){var n=t.bisect(e,r,1,s)-1;return o[n](i[n](r))}}function yo(e,r){return t.rebind(e,r,"range","rangeRound","interpolate","clamp")}function mo(t,e){return po(t,ho(xo(t,e)[2])),po(t,ho(xo(t,e)[2])),t}function xo(t,e){null==e&&(e=10);var r=co(t),n=r[1]-r[0],a=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),i=e/n*a;return i<=.15?a*=10:i<=.35?a*=5:i<=.75&&(a*=2),r[0]=Math.ceil(r[0]/a)*a,r[1]=Math.floor(r[1]/a)*a+.5*a,r[2]=a,r}function bo(e,r){return t.range.apply(t,xo(e,r))}function _o(e,r,n){var a=xo(e,r);if(n){var i=Oe.exec(n);if(i.shift(),"s"===i[8]){var o=t.formatPrefix(Math.max(m(a[0]),m(a[1])));return i[7]||(i[7]="."+ko(o.scale(a[2]))),i[8]="f",n=t.format(i.join("")),function(t){return n(o.scale(t))+o.symbol}}i[7]||(i[7]="."+function(t,e){var r=ko(e[2]);return t in wo?Math.abs(r-ko(Math.max(m(e[0]),m(e[1]))))+ +("e"!==t):r-2*("%"===t)}(i[8],a)),n=i.join("")}else n=",."+ko(a[2])+"f";return t.format(n)}t.scale.linear=function(){return function t(e,r,n,a){var i,o;function l(){var t=Math.min(e.length,r.length)>2?vo:fo,l=a?yi:vi;return i=t(e,r,l,n),o=t(r,e,l,Wa),s}function s(t){return i(t)}s.invert=function(t){return o(t)};s.domain=function(t){return arguments.length?(e=t.map(Number),l()):e};s.range=function(t){return arguments.length?(r=t,l()):r};s.rangeRound=function(t){return s.range(t).interpolate(ci)};s.clamp=function(t){return arguments.length?(a=t,l()):a};s.interpolate=function(t){return arguments.length?(n=t,l()):n};s.ticks=function(t){return bo(e,t)};s.tickFormat=function(t,r){return _o(e,t,r)};s.nice=function(t){return mo(e,t),l()};s.copy=function(){return t(e,r,n,a)};return l()}([0,1],[0,1],Wa,!1)};var wo={s:1,g:1,p:1,r:1,e:1};function ko(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}t.scale.log=function(){return function e(r,n,a,i){function o(t){return(a?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function l(t){return a?Math.pow(n,t):-Math.pow(n,-t)}function s(t){return r(o(t))}s.invert=function(t){return l(r.invert(t))};s.domain=function(t){return arguments.length?(a=t[0]>=0,r.domain((i=t.map(Number)).map(o)),s):i};s.base=function(t){return arguments.length?(n=+t,r.domain(i.map(o)),s):n};s.nice=function(){var t=po(i.map(o),a?Math:Ao);return r.domain(t),i=t.map(l),s};s.ticks=function(){var t=co(i),e=[],r=t[0],s=t[1],c=Math.floor(o(r)),u=Math.ceil(o(s)),f=n%1?2:n;if(isFinite(u-c)){if(a){for(;c<u;c++)for(var d=1;d<f;d++)e.push(l(c)*d);e.push(l(c))}else for(e.push(l(c));c++<u;)for(var d=f-1;d>0;d--)e.push(l(c)*d);for(c=0;e[c]<r;c++);for(u=e.length;e[u-1]>s;u--);e=e.slice(c,u)}return e};s.tickFormat=function(e,r){if(!arguments.length)return Mo;arguments.length<2?r=Mo:"function"!=typeof r&&(r=t.format(r));var a=Math.max(1,n*e/s.ticks().length);return function(t){var e=t/l(Math.round(o(t)));return e*n<n-.5&&(e*=n),e<=a?r(t):""}};s.copy=function(){return e(r.copy(),n,a,i)};return yo(s,r)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var Mo=t.format(".0e"),Ao={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function To(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 a=To(r),i=To(1/r);function o(t){return e(a(t))}o.invert=function(t){return i(e.invert(t))};o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(a)),o):n};o.ticks=function(t){return bo(n,t)};o.tickFormat=function(t,e){return _o(n,t,e)};o.nice=function(t){return o.domain(mo(n,t))};o.exponent=function(t){return arguments.length?(a=To(r=t),i=To(1/r),e.domain(n.map(a)),o):r};o.copy=function(){return t(e.copy(),r,n)};return yo(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 a,i,o;function l(t){return i[((a.get(t)||("range"===n.t?a.set(t,r.push(t)):NaN))-1)%i.length]}function s(e,n){return t.range(r.length).map(function(t){return e+n*t})}l.domain=function(t){if(!arguments.length)return r;r=[],a=new b;for(var e,i=-1,o=t.length;++i<o;)a.has(e=t[i])||a.set(e,r.push(e));return l[n.t].apply(l,n.a)};l.range=function(t){return arguments.length?(i=t,o=0,n={t:"range",a:arguments},l):i};l.rangePoints=function(t,e){arguments.length<2&&(e=0);var a=t[0],c=t[1],u=r.length<2?(a=(a+c)/2,0):(c-a)/(r.length-1+e);return i=s(a+u*e/2,u),o=0,n={t:"rangePoints",a:arguments},l};l.rangeRoundPoints=function(t,e){arguments.length<2&&(e=0);var a=t[0],c=t[1],u=r.length<2?(a=c=Math.round((a+c)/2),0):(c-a)/(r.length-1+e)|0;return i=s(a+Math.round(u*e/2+(c-a-(r.length-1+e)*u)/2),u),o=0,n={t:"rangeRoundPoints",a:arguments},l};l.rangeBands=function(t,e,a){arguments.length<2&&(e=0),arguments.length<3&&(a=e);var c=t[1]<t[0],u=t[c-0],f=t[1-c],d=(f-u)/(r.length-e+2*a);return i=s(u+d*a,d),c&&i.reverse(),o=d*(1-e),n={t:"rangeBands",a:arguments},l};l.rangeRoundBands=function(t,e,a){arguments.length<2&&(e=0),arguments.length<3&&(a=e);var c=t[1]<t[0],u=t[c-0],f=t[1-c],d=Math.floor((f-u)/(r.length-e+2*a));return i=s(u+Math.round((f-u-(r.length-e)*d)/2),d),c&&i.reverse(),o=Math.round(d*(1-e)),n={t:"rangeRoundBands",a:arguments},l};l.rangeBand=function(){return o};l.rangeExtent=function(){return co(n.a[0])};l.copy=function(){return e(r,n)};return l.domain(r)}([],{t:"range",a:[[]]})},t.scale.category10=function(){return t.scale.ordinal().range(Lo)},t.scale.category20=function(){return t.scale.ordinal().range(So)},t.scale.category20b=function(){return t.scale.ordinal().range(Co)},t.scale.category20c=function(){return t.scale.ordinal().range(Oo)};var Lo=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(le),So=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(le),Co=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(le),Oo=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(le);function Po(){return 0}t.scale.quantile=function(){return function e(r,n){var a;function i(){var e=0,i=n.length;for(a=[];++e<i;)a[e-1]=t.quantile(r,e/i);return o}function o(e){if(!isNaN(e=+e))return n[t.bisect(a,e)]}o.domain=function(t){return arguments.length?(r=t.map(p).filter(h).sort(d),i()):r};o.range=function(t){return arguments.length?(n=t,i()):n};o.quantiles=function(){return a};o.invertExtent=function(t){return(t=n.indexOf(t))<0?[NaN,NaN]:[t>0?a[t-1]:r[0],t<a.length?a[t]:r[r.length-1]]};o.copy=function(){return e(r,n)};return i()}([],[])},t.scale.quantize=function(){return function t(e,r,n){var a,i;function o(t){return n[Math.max(0,Math.min(i,Math.floor(a*(t-e))))]}function l(){return a=n.length/(r-e),i=n.length-1,o}o.domain=function(t){return arguments.length?(e=+t[0],r=+t[t.length-1],l()):[e,r]};o.range=function(t){return arguments.length?(n=t,l()):n};o.invertExtent=function(t){return[t=(t=n.indexOf(t))<0?NaN:t/a+e,t+1/a]};o.copy=function(){return t(e,r,n)};return l()}(0,1,[0,1])},t.scale.threshold=function(){return function e(r,n){function a(e){if(e<=e)return n[t.bisect(r,e)]}a.domain=function(t){return arguments.length?(r=t,a):r};a.range=function(t){return arguments.length?(n=t,a):n};a.invertExtent=function(t){return t=n.indexOf(t),[r[t-1],r[t]]};a.copy=function(){return e(r,n)};return a}([.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 bo(e,t)};r.tickFormat=function(t,r){return _o(e,t,r)};r.copy=function(){return t(e)};return r}([0,1])},t.svg={},t.svg.arc=function(){var t=Do,e=Eo,r=Po,n=zo,a=No,i=Ro,o=Io;function l(){var l=Math.max(0,+t.apply(this,arguments)),c=Math.max(0,+e.apply(this,arguments)),u=a.apply(this,arguments)-St,f=i.apply(this,arguments)-St,d=Math.abs(f-u),p=u>f?0:1;if(c<l&&(h=c,c=l,l=h),d>=Lt)return s(c,p)+(l?s(l,1-p):"")+"Z";var h,g,v,y,m,x,b,_,w,k,M,A,T=0,L=0,S=[];if((y=(+o.apply(this,arguments)||0)/2)&&(v=n===zo?Math.sqrt(l*l+c*c):+n.apply(this,arguments),p||(L*=-1),c&&(L=Et(v/c*Math.sin(y))),l&&(T=Et(v/l*Math.sin(y)))),c){m=c*Math.cos(u+L),x=c*Math.sin(u+L),b=c*Math.cos(f-L),_=c*Math.sin(f-L);var C=Math.abs(f-u-2*L)<=At?0:1;if(L&&Fo(m,x,b,_)===p^C){var O=(u+f)/2;m=c*Math.cos(O),x=c*Math.sin(O),b=_=null}}else m=x=0;if(l){w=l*Math.cos(f-T),k=l*Math.sin(f-T),M=l*Math.cos(u+T),A=l*Math.sin(u+T);var P=Math.abs(u-f+2*T)<=At?0:1;if(T&&Fo(w,k,M,A)===1-p^P){var z=(u+f)/2;w=l*Math.cos(z),k=l*Math.sin(z),M=A=null}}else w=k=0;if(d>kt&&(h=Math.min(Math.abs(c-l)/2,+r.apply(this,arguments)))>.001){g=l<c^p?0:1;var D=h,E=h;if(d<At){var N=null==M?[w,k]:null==b?[m,x]:la([m,x],[M,A],[b,_],[w,k]),R=m-N[0],I=x-N[1],F=b-N[0],j=_-N[1],B=1/Math.sin(Math.acos((R*F+I*j)/(Math.sqrt(R*R+I*I)*Math.sqrt(F*F+j*j)))/2),H=Math.sqrt(N[0]*N[0]+N[1]*N[1]);E=Math.min(h,(l-H)/(B-1)),D=Math.min(h,(c-H)/(B+1))}if(null!=b){var q=jo(null==M?[w,k]:[M,A],[m,x],c,D,p),V=jo([b,_],[w,k],c,D,p);h===D?S.push("M",q[0],"A",D,",",D," 0 0,",g," ",q[1],"A",c,",",c," 0 ",1-p^Fo(q[1][0],q[1][1],V[1][0],V[1][1]),",",p," ",V[1],"A",D,",",D," 0 0,",g," ",V[0]):S.push("M",q[0],"A",D,",",D," 0 1,",g," ",V[0])}else S.push("M",m,",",x);if(null!=M){var U=jo([m,x],[M,A],l,-E,p),G=jo([w,k],null==b?[m,x]:[b,_],l,-E,p);h===E?S.push("L",G[0],"A",E,",",E," 0 0,",g," ",G[1],"A",l,",",l," 0 ",p^Fo(G[1][0],G[1][1],U[1][0],U[1][1]),",",1-p," ",U[1],"A",E,",",E," 0 0,",g," ",U[0]):S.push("L",G[0],"A",E,",",E," 0 0,",g," ",U[0])}else S.push("L",w,",",k)}else S.push("M",m,",",x),null!=b&&S.push("A",c,",",c," 0 ",C,",",p," ",b,",",_),S.push("L",w,",",k),null!=M&&S.push("A",l,",",l," 0 ",P,",",1-p," ",M,",",A);return S.push("Z"),S.join("")}function s(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}return l.innerRadius=function(e){return arguments.length?(t=ve(e),l):t},l.outerRadius=function(t){return arguments.length?(e=ve(t),l):e},l.cornerRadius=function(t){return arguments.length?(r=ve(t),l):r},l.padRadius=function(t){return arguments.length?(n=t==zo?zo:ve(t),l):n},l.startAngle=function(t){return arguments.length?(a=ve(t),l):a},l.endAngle=function(t){return arguments.length?(i=ve(t),l):i},l.padAngle=function(t){return arguments.length?(o=ve(t),l):o},l.centroid=function(){var r=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+a.apply(this,arguments)+ +i.apply(this,arguments))/2-St;return[Math.cos(n)*r,Math.sin(n)*r]},l};var zo="auto";function Do(t){return t.innerRadius}function Eo(t){return t.outerRadius}function No(t){return t.startAngle}function Ro(t){return t.endAngle}function Io(t){return t&&t.padAngle}function Fo(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function jo(t,e,r,n,a){var i=t[0]-e[0],o=t[1]-e[1],l=(a?n:-n)/Math.sqrt(i*i+o*o),s=l*o,c=-l*i,u=t[0]+s,f=t[1]+c,d=e[0]+s,p=e[1]+c,h=(u+d)/2,g=(f+p)/2,v=d-u,y=p-f,m=v*v+y*y,x=r-n,b=u*p-d*f,_=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*m-b*b)),w=(b*y-v*_)/m,k=(-b*v-y*_)/m,M=(b*y+v*_)/m,A=(-b*v+y*_)/m,T=w-h,L=k-g,S=M-h,C=A-g;return T*T+L*L>S*S+C*C&&(w=M,k=A),[[w-s,k-c],[w*r/x,k*r/x]]}function Bo(t){var e=ea,r=ra,n=Yr,a=qo,i=a.key,o=.7;function l(i){var l,s=[],c=[],u=-1,f=i.length,d=ve(e),p=ve(r);function h(){s.push("M",a(t(c),o))}for(;++u<f;)n.call(this,l=i[u],u)?c.push([+d.call(this,l,u),+p.call(this,l,u)]):c.length&&(h(),c=[]);return c.length&&h(),s.length?s.join(""):null}return l.x=function(t){return arguments.length?(e=t,l):e},l.y=function(t){return arguments.length?(r=t,l):r},l.defined=function(t){return arguments.length?(n=t,l):n},l.interpolate=function(t){return arguments.length?(i="function"==typeof t?a=t:(a=Ho.get(t)||qo).key,l):i},l.tension=function(t){return arguments.length?(o=t,l):o},l}t.svg.line=function(){return Bo(P)};var Ho=t.map({linear:qo,"linear-closed":Vo,step:function(t){var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];for(;++e<r;)a.push("H",(n[0]+(n=t[e])[0])/2,"V",n[1]);r>1&&a.push("H",n[0]);return a.join("")},"step-before":Uo,"step-after":Go,basis:Zo,"basis-open":function(t){if(t.length<4)return qo(t);var e,r=[],n=-1,a=t.length,i=[0],o=[0];for(;++n<3;)e=t[n],i.push(e[0]),o.push(e[1]);r.push(Wo($o,i)+","+Wo($o,o)),--n;for(;++n<a;)e=t[n],i.shift(),i.push(e[0]),o.shift(),o.push(e[1]),Ko(r,i,o);return r.join("")},"basis-closed":function(t){var e,r,n=-1,a=t.length,i=a+4,o=[],l=[];for(;++n<4;)r=t[n%a],o.push(r[0]),l.push(r[1]);e=[Wo($o,o),",",Wo($o,l)],--n;for(;++n<i;)r=t[n%a],o.shift(),o.push(r[0]),l.shift(),l.push(r[1]),Ko(e,o,l);return e.join("")},bundle:function(t,e){var r=t.length-1;if(r)for(var n,a,i=t[0][0],o=t[0][1],l=t[r][0]-i,s=t[r][1]-o,c=-1;++c<=r;)n=t[c],a=c/r,n[0]=e*n[0]+(1-e)*(i+a*l),n[1]=e*n[1]+(1-e)*(o+a*s);return Zo(t)},cardinal:function(t,e){return t.length<3?qo(t):t[0]+Yo(t,Xo(t,e))},"cardinal-open":function(t,e){return t.length<4?qo(t):t[1]+Yo(t.slice(1,-1),Xo(t,e))},"cardinal-closed":function(t,e){return t.length<3?Vo(t):t[0]+Yo((t.push(t[0]),t),Xo([t[t.length-2]].concat(t,[t[1]]),e))},monotone:function(t){return t.length<3?qo(t):t[0]+Yo(t,function(t){var e,r,n,a,i=[],o=function(t){var e=0,r=t.length-1,n=[],a=t[0],i=t[1],o=n[0]=tl(a,i);for(;++e<r;)n[e]=(o+(o=tl(a=i,i=t[e+1])))/2;return n[e]=o,n}(t),l=-1,s=t.length-1;for(;++l<s;)e=tl(t[l],t[l+1]),m(e)<kt?o[l]=o[l+1]=0:(r=o[l]/e,n=o[l+1]/e,(a=r*r+n*n)>9&&(a=3*e/Math.sqrt(a),o[l]=a*r,o[l+1]=a*n));l=-1;for(;++l<=s;)a=(t[Math.min(s,l+1)][0]-t[Math.max(0,l-1)][0])/(6*(1+o[l]*o[l])),i.push([a||0,o[l]*a||0]);return i}(t))}});function qo(t){return t.length>1?t.join("L"):t+"Z"}function Vo(t){return t.join("L")+"Z"}function Uo(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("V",(n=t[e])[1],"H",n[0]);return a.join("")}function Go(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("H",(n=t[e])[0],"V",n[1]);return a.join("")}function Yo(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return qo(t);var r=t.length!=e.length,n="",a=t[0],i=t[1],o=e[0],l=o,s=1;if(r&&(n+="Q"+(i[0]-2*o[0]/3)+","+(i[1]-2*o[1]/3)+","+i[0]+","+i[1],a=t[1],s=2),e.length>1){l=e[1],i=t[s],s++,n+="C"+(a[0]+o[0])+","+(a[1]+o[1])+","+(i[0]-l[0])+","+(i[1]-l[1])+","+i[0]+","+i[1];for(var c=2;c<e.length;c++,s++)i=t[s],l=e[c],n+="S"+(i[0]-l[0])+","+(i[1]-l[1])+","+i[0]+","+i[1]}if(r){var u=t[s];n+="Q"+(i[0]+2*l[0]/3)+","+(i[1]+2*l[1]/3)+","+u[0]+","+u[1]}return n}function Xo(t,e){for(var r,n=[],a=(1-e)/2,i=t[0],o=t[1],l=1,s=t.length;++l<s;)r=i,i=o,o=t[l],n.push([a*(o[0]-r[0]),a*(o[1]-r[1])]);return n}function Zo(t){if(t.length<3)return qo(t);var e=1,r=t.length,n=t[0],a=n[0],i=n[1],o=[a,a,a,(n=t[1])[0]],l=[i,i,i,n[1]],s=[a,",",i,"L",Wo($o,o),",",Wo($o,l)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),l.shift(),l.push(n[1]),Ko(s,o,l);return t.pop(),s.push("L",n),s.join("")}function Wo(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}Ho.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Qo=[0,2/3,1/3,0],Jo=[0,1/3,2/3,0],$o=[0,1/6,2/3,1/6];function Ko(t,e,r){t.push("C",Wo(Qo,e),",",Wo(Qo,r),",",Wo(Jo,e),",",Wo(Jo,r),",",Wo($o,e),",",Wo($o,r))}function tl(t,e){return(e[1]-t[1])/(e[0]-t[0])}function el(t){for(var e,r,n,a=-1,i=t.length;++a<i;)r=(e=t[a])[0],n=e[1]-St,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function rl(t){var e=ea,r=ea,n=0,a=ra,i=Yr,o=qo,l=o.key,s=o,c="L",u=.7;function f(l){var f,d,p,h=[],g=[],v=[],y=-1,m=l.length,x=ve(e),b=ve(n),_=e===r?function(){return d}:ve(r),w=n===a?function(){return p}:ve(a);function k(){h.push("M",o(t(v),u),c,s(t(g.reverse()),u),"Z")}for(;++y<m;)i.call(this,f=l[y],y)?(g.push([d=+x.call(this,f,y),p=+b.call(this,f,y)]),v.push([+_.call(this,f,y),+w.call(this,f,y)])):g.length&&(k(),g=[],v=[]);return g.length&&k(),h.length?h.join(""):null}return f.x=function(t){return arguments.length?(e=r=t,f):r},f.x0=function(t){return arguments.length?(e=t,f):e},f.x1=function(t){return arguments.length?(r=t,f):r},f.y=function(t){return arguments.length?(n=a=t,f):a},f.y0=function(t){return arguments.length?(n=t,f):n},f.y1=function(t){return arguments.length?(a=t,f):a},f.defined=function(t){return arguments.length?(i=t,f):i},f.interpolate=function(t){return arguments.length?(l="function"==typeof t?o=t:(o=Ho.get(t)||qo).key,s=o.reverse||o,c=o.closed?"M":"L",f):l},f.tension=function(t){return arguments.length?(u=t,f):u},f}function nl(t){return t.radius}function al(t){return[t.x,t.y]}function il(){return 64}function ol(){return"circle"}function ll(t){var e=Math.sqrt(t/At);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=Bo(el);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},Uo.reverse=Go,Go.reverse=Uo,t.svg.area=function(){return rl(P)},t.svg.area.radial=function(){var t=rl(el);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=Hn,e=qn,r=nl,n=No,a=Ro;function i(r,n){var a,i,c=o(this,t,r,n),u=o(this,e,r,n);return"M"+c.p0+l(c.r,c.p1,c.a1-c.a0)+(i=u,(a=c).a0==i.a0&&a.a1==i.a1?s(c.r,c.p1,c.r,c.p0):s(c.r,c.p1,u.r,u.p0)+l(u.r,u.p1,u.a1-u.a0)+s(u.r,u.p1,c.r,c.p0))+"Z"}function o(t,e,i,o){var l=e.call(t,i,o),s=r.call(t,l,o),c=n.call(t,l,o)-St,u=a.call(t,l,o)-St;return{r:s,a0:c,a1:u,p0:[s*Math.cos(c),s*Math.sin(c)],p1:[s*Math.cos(u),s*Math.sin(u)]}}function l(t,e,r){return"A"+t+","+t+" 0 "+ +(r>At)+",1 "+e}function s(t,e,r,n){return"Q 0,0 "+n}return i.radius=function(t){return arguments.length?(r=ve(t),i):r},i.source=function(e){return arguments.length?(t=ve(e),i):t},i.target=function(t){return arguments.length?(e=ve(t),i):e},i.startAngle=function(t){return arguments.length?(n=ve(t),i):n},i.endAngle=function(t){return arguments.length?(a=ve(t),i):a},i},t.svg.diagonal=function(){var t=Hn,e=qn,r=al;function n(n,a){var i=t.call(this,n,a),o=e.call(this,n,a),l=(i.y+o.y)/2,s=[i,{x:i.x,y:l},{x:o.x,y:l},o];return"M"+(s=s.map(r))[0]+"C"+s[1]+" "+s[2]+" "+s[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=al,n=e.projection;return e.projection=function(t){return arguments.length?n(function(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-St;return[r*Math.cos(n),r*Math.sin(n)]}}(r=t)):r},e},t.svg.symbol=function(){var t=ol,e=il;function r(r,n){return(sl.get(t.call(this,r,n))||ll)(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 sl=t.map({circle:ll,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*ul)),r=e*ul;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/cl),r=e*cl/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/cl),r=e*cl/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=sl.keys();var cl=Math.sqrt(3),ul=Math.tan(30*Ct);X.transition=function(t){for(var e,r,n=hl||++yl,a=bl(t),i=[],o=gl||{time:Date.now(),ease:ai,delay:0,duration:250},l=-1,s=this.length;++l<s;){i.push(e=[]);for(var c=this[l],u=-1,f=c.length;++u<f;)(r=c[u])&&_l(r,u,a,n,o),e.push(r)}return pl(i,a,n)},X.interrupt=function(t){return this.each(null==t?fl:dl(bl(t)))};var fl=dl(bl());function dl(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 pl(t,e,r){return q(t,vl),t.namespace=e,t.id=r,t}var hl,gl,vl=[],yl=0;function ml(t,e,r,n){var a=t.id,i=t.namespace;return ut(t,"function"==typeof r?function(t,o,l){t[i][a].tween.set(e,n(r.call(t,t.__data__,o,l)))}:(r=n(r),function(t){t[i][a].tween.set(e,r)}))}function xl(t){return null==t&&(t=""),function(){this.textContent=t}}function bl(t){return null==t?"__transition__":"__transition_"+t+"__"}function _l(t,e,r,n,a){var i,o,l,s,c,u=t[r]||(t[r]={active:0,count:0}),f=u[n];function d(r){var a=u.active,d=u[a];for(var h in d&&(d.timer.c=null,d.timer.t=NaN,--u.count,delete u[a],d.event&&d.event.interrupt.call(t,t.__data__,d.index)),u)if(+h<n){var g=u[h];g.timer.c=null,g.timer.t=NaN,--u.count,delete u[h]}o.c=p,Me(function(){return o.c&&p(r||1)&&(o.c=null,o.t=NaN),1},0,i),u.active=n,f.event&&f.event.start.call(t,t.__data__,e),c=[],f.tween.forEach(function(r,n){(n=n.call(t,t.__data__,e))&&c.push(n)}),s=f.ease,l=f.duration}function p(a){for(var i=a/l,o=s(i),d=c.length;d>0;)c[--d].call(t,o);if(i>=1)return f.event&&f.event.end.call(t,t.__data__,e),--u.count?delete u[n]:delete t[r],1}f||(i=a.time,o=Me(function(t){var e=f.delay;if(o.t=e+i,e<=t)return d(t-e);o.c=d},0,i),f=u[n]={tween:new b,time:i,timer:o,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++u.count)}vl.call=X.call,vl.empty=X.empty,vl.node=X.node,vl.size=X.size,t.transition=function(e,r){return e&&e.transition?hl?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=vl,vl.select=function(t){var e,r,n,a=this.id,i=this.namespace,o=[];t=Z(t);for(var l=-1,s=this.length;++l<s;){o.push(e=[]);for(var c=this[l],u=-1,f=c.length;++u<f;)(n=c[u])&&(r=t.call(n,n.__data__,u,l))?("__data__"in n&&(r.__data__=n.__data__),_l(r,u,i,a,n[i][a]),e.push(r)):e.push(null)}return pl(o,i,a)},vl.selectAll=function(t){var e,r,n,a,i,o=this.id,l=this.namespace,s=[];t=W(t);for(var c=-1,u=this.length;++c<u;)for(var f=this[c],d=-1,p=f.length;++d<p;)if(n=f[d]){i=n[l][o],r=t.call(n,n.__data__,d,c),s.push(e=[]);for(var h=-1,g=r.length;++h<g;)(a=r[h])&&_l(a,h,l,o,i),e.push(a)}return pl(s,l,o)},vl.filter=function(t){var e,r,n=[];"function"!=typeof t&&(t=ct(t));for(var a=0,i=this.length;a<i;a++){n.push(e=[]);for(var o,l=0,s=(o=this[a]).length;l<s;l++)(r=o[l])&&t.call(r,r.__data__,l,a)&&e.push(r)}return pl(n,this.namespace,this.id)},vl.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):ut(this,null==e?function(e){e[n][r].tween.remove(t)}:function(a){a[n][r].tween.set(t,e)})},vl.attr=function(e,r){if(arguments.length<2){for(r in e)this.attr(r,e[r]);return this}var n="transform"==e?gi:Wa,a=t.ns.qualify(e);function i(){this.removeAttribute(a)}function o(){this.removeAttributeNS(a.space,a.local)}return ml(this,"attr."+e,r,a.local?function(t){return null==t?o:(t+="",function(){var e,r=this.getAttributeNS(a.space,a.local);return r!==t&&(e=n(r,t),function(t){this.setAttributeNS(a.space,a.local,e(t))})})}:function(t){return null==t?i:(t+="",function(){var e,r=this.getAttribute(a);return r!==t&&(e=n(r,t),function(t){this.setAttribute(a,e(t))})})})},vl.attrTween=function(e,r){var n=t.ns.qualify(e);return this.tween("attr."+e,n.local?function(t,e){var a=r.call(this,t,e,this.getAttributeNS(n.space,n.local));return a&&function(t){this.setAttributeNS(n.space,n.local,a(t))}}:function(t,e){var a=r.call(this,t,e,this.getAttribute(n));return a&&function(t){this.setAttribute(n,a(t))}})},vl.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 a(){this.style.removeProperty(t)}return ml(this,"style."+t,e,function(e){return null==e?a:(e+="",function(){var n,a=o(this).getComputedStyle(this,null).getPropertyValue(t);return a!==e&&(n=Wa(a,e),function(e){this.style.setProperty(t,n(e),r)})})})},vl.styleTween=function(t,e,r){return arguments.length<3&&(r=""),this.tween("style."+t,function(n,a){var i=e.call(this,n,a,o(this).getComputedStyle(this,null).getPropertyValue(t));return i&&function(e){this.style.setProperty(t,i(e),r)}})},vl.text=function(t){return ml(this,"text",t,xl)},vl.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},vl.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)),ut(this,function(t){t[n][r].ease=e}))},vl.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:ut(this,"function"==typeof t?function(n,a,i){n[r][e].delay=+t.call(n,n.__data__,a,i)}:(t=+t,function(n){n[r][e].delay=t}))},vl.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:ut(this,"function"==typeof t?function(n,a,i){n[r][e].duration=Math.max(1,t.call(n,n.__data__,a,i))}:(t=Math.max(1,t),function(n){n[r][e].duration=t}))},vl.each=function(e,r){var n=this.id,a=this.namespace;if(arguments.length<2){var i=gl,o=hl;try{hl=n,ut(this,function(t,r,i){gl=t[a][n],e.call(t,t.__data__,r,i)})}finally{gl=i,hl=o}}else ut(this,function(i){var o=i[a][n];(o.event||(o.event=t.dispatch("start","end","interrupt"))).on(e,r)});return this},vl.transition=function(){for(var t,e,r,n=this.id,a=++yl,i=this.namespace,o=[],l=0,s=this.length;l<s;l++){o.push(t=[]);for(var c,u=0,f=(c=this[l]).length;u<f;u++)(e=c[u])&&_l(e,u,i,a,{time:(r=e[i][n]).time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration}),t.push(e)}return pl(o,i,a)},t.svg.axis=function(){var e,r=t.scale.linear(),a=wl,i=6,o=6,l=3,s=[10],c=null;function u(n){n.each(function(){var n,u=t.select(this),f=this.__chart__||r,d=this.__chart__=r.copy(),p=null==c?d.ticks?d.ticks.apply(d,s):d.domain():c,h=null==e?d.tickFormat?d.tickFormat.apply(d,s):P:e,g=u.selectAll(".tick").data(p,d),v=g.enter().insert("g",".domain").attr("class","tick").style("opacity",kt),y=t.transition(g.exit()).style("opacity",kt).remove(),m=t.transition(g.order()).style("opacity",1),x=Math.max(i,0)+l,b=uo(d),_=u.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),t.transition(_));v.append("line"),v.append("text");var k,M,A,T,L=v.select("line"),S=m.select("line"),C=g.select("text").text(h),O=v.select("text"),z=m.select("text"),D="top"===a||"left"===a?-1:1;if("bottom"===a||"top"===a?(n=Ml,k="x",A="y",M="x2",T="y2",C.attr("dy",D<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+b[0]+","+D*o+"V0H"+b[1]+"V"+D*o)):(n=Al,k="y",A="x",M="y2",T="x2",C.attr("dy",".32em").style("text-anchor",D<0?"end":"start"),w.attr("d","M"+D*o+","+b[0]+"H0V"+b[1]+"H"+D*o)),L.attr(T,D*i),O.attr(A,D*x),S.attr(M,0).attr(T,D*i),z.attr(k,0).attr(A,D*x),d.rangeBand){var E=d,N=E.rangeBand()/2;f=d=function(t){return E(t)+N}}else f.rangeBand?f=d:y.call(n,d,f);v.call(n,f,d),m.call(n,d,d)})}return u.scale=function(t){return arguments.length?(r=t,u):r},u.orient=function(t){return arguments.length?(a=t in kl?t+"":wl,u):a},u.ticks=function(){return arguments.length?(s=n(arguments),u):s},u.tickValues=function(t){return arguments.length?(c=t,u):c},u.tickFormat=function(t){return arguments.length?(e=t,u):e},u.tickSize=function(t){var e=arguments.length;return e?(i=+t,o=+arguments[e-1],u):i},u.innerTickSize=function(t){return arguments.length?(i=+t,u):i},u.outerTickSize=function(t){return arguments.length?(o=+t,u):o},u.tickPadding=function(t){return arguments.length?(l=+t,u):l},u.tickSubdivide=function(){return arguments.length&&u},u};var wl="bottom",kl={top:1,right:1,bottom:1,left:1};function Ml(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function Al(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=B(d,"brushstart","brush","brushend"),a=null,i=null,l=[0,0],s=[0,0],c=!0,u=!0,f=Ll[0];function d(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(f,P);n.exit().remove(),n.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Tl[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",d.empty()?"none":null);var o,l=t.transition(e),s=t.transition(r);a&&(o=uo(a),s.attr("x",o[0]).attr("width",o[1]-o[0]),h(l)),i&&(o=uo(i),s.attr("y",o[0]).attr("height",o[1]-o[0]),g(l)),p(l)})}function p(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+l[+/e$/.test(t)]+","+s[+/^s/.test(t)]+")"})}function h(t){t.select(".extent").attr("x",l[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",l[1]-l[0])}function g(t){t.select(".extent").attr("y",s[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function v(){var f,v,y=this,m=t.select(t.event.target),x=n.of(y,arguments),b=t.select(y),_=m.datum(),w=!/^(n|s)$/.test(_)&&a,k=!/^(e|w)$/.test(_)&&i,M=m.classed("extent"),A=xt(y),T=t.mouse(y),L=t.select(o(y)).on("keydown.brush",function(){32==t.event.keyCode&&(M||(f=null,T[0]-=l[1],T[1]-=s[1],M=2),F())}).on("keyup.brush",function(){32==t.event.keyCode&&2==M&&(T[0]+=l[1],T[1]+=s[1],M=0,F())});if(t.event.changedTouches?L.on("touchmove.brush",O).on("touchend.brush",z):L.on("mousemove.brush",O).on("mouseup.brush",z),b.interrupt().selectAll("*").interrupt(),M)T[0]=l[0]-T[0],T[1]=s[0]-T[1];else if(_){var S=+/w$/.test(_),C=+/^n/.test(_);v=[l[1-S]-T[0],s[1-C]-T[1]],T[0]=l[S],T[1]=s[C]}else t.event.altKey&&(f=T.slice());function O(){var e=t.mouse(y),r=!1;v&&(e[0]+=v[0],e[1]+=v[1]),M||(t.event.altKey?(f||(f=[(l[0]+l[1])/2,(s[0]+s[1])/2]),T[0]=l[+(e[0]<f[0])],T[1]=s[+(e[1]<f[1])]):f=null),w&&P(e,a,0)&&(h(b),r=!0),k&&P(e,i,1)&&(g(b),r=!0),r&&(p(b),x({type:"brush",mode:M?"move":"resize"}))}function P(t,n,a){var i,o,d=uo(n),p=d[0],h=d[1],g=T[a],v=a?s:l,y=v[1]-v[0];if(M&&(p-=g,h-=y+g),i=(a?u:c)?Math.max(p,Math.min(h,t[a])):t[a],M?o=(i+=g)+y:(f&&(g=Math.max(p,Math.min(h,2*f[a]-i))),g<i?(o=i,i=g):o=g),v[0]!=i||v[1]!=o)return a?r=null:e=null,v[0]=i,v[1]=o,!0}function z(){O(),b.style("pointer-events","all").selectAll(".resize").style("display",d.empty()?"none":null),t.select("body").style("cursor",null),L.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),A(),x({type:"brushend"})}b.style("pointer-events","none").selectAll(".resize").style("display",null),t.select("body").style("cursor",m.style("cursor")),x({type:"brushstart"}),O()}return d.event=function(a){a.each(function(){var a=n.of(this,arguments),i={x:l,y:s,i:e,j:r},o=this.__chart__||i;this.__chart__=i,hl?t.select(this).transition().each("start.brush",function(){e=o.i,r=o.j,l=o.x,s=o.y,a({type:"brushstart"})}).tween("brush:brush",function(){var t=Qa(l,i.x),n=Qa(s,i.y);return e=r=null,function(e){l=i.x=t(e),s=i.y=n(e),a({type:"brush",mode:"resize"})}}).each("end.brush",function(){e=i.i,r=i.j,a({type:"brush",mode:"resize"}),a({type:"brushend"})}):(a({type:"brushstart"}),a({type:"brush",mode:"resize"}),a({type:"brushend"}))})},d.x=function(t){return arguments.length?(f=Ll[!(a=t)<<1|!i],d):a},d.y=function(t){return arguments.length?(f=Ll[!a<<1|!(i=t)],d):i},d.clamp=function(t){return arguments.length?(a&&i?(c=!!t[0],u=!!t[1]):a?c=!!t:i&&(u=!!t),d):a&&i?[c,u]:a?c:i?u:null},d.extent=function(t){var n,o,c,u,f;return arguments.length?(a&&(n=t[0],o=t[1],i&&(n=n[0],o=o[0]),e=[n,o],a.invert&&(n=a(n),o=a(o)),o<n&&(f=n,n=o,o=f),n==l[0]&&o==l[1]||(l=[n,o])),i&&(c=t[0],u=t[1],a&&(c=c[1],u=u[1]),r=[c,u],i.invert&&(c=i(c),u=i(u)),u<c&&(f=c,c=u,u=f),c==s[0]&&u==s[1]||(s=[c,u])),d):(a&&(e?(n=e[0],o=e[1]):(n=l[0],o=l[1],a.invert&&(n=a.invert(n),o=a.invert(o)),o<n&&(f=n,n=o,o=f))),i&&(r?(c=r[0],u=r[1]):(c=s[0],u=s[1],i.invert&&(c=i.invert(c),u=i.invert(u)),u<c&&(f=c,c=u,u=f))),a&&i?[[n,c],[o,u]]:a?[n,o]:i&&[c,u])},d.clear=function(){return d.empty()||(l=[0,0],s=[0,0],e=r=null),d},d.empty=function(){return!!a&&l[0]==l[1]||!!i&&s[0]==s[1]},t.rebind(d,n,"on")};var Tl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ll=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Sl=De.format=lr.timeFormat,Cl=Sl.utc,Ol=Cl("%Y-%m-%dT%H:%M:%S.%LZ");function Pl(t){return t.toISOString()}function zl(e,r,n){function a(t){return e(t)}function i(e,n){var a=(e[1]-e[0])/n,i=t.bisect(El,a);return i==El.length?[r.year,xo(e.map(function(t){return t/31536e6}),n)[2]]:i?r[a/El[i-1]<El[i]/a?i-1:i]:[Il,xo(e,n)[2]]}return a.invert=function(t){return Dl(e.invert(t))},a.domain=function(t){return arguments.length?(e.domain(t),a):e.domain().map(Dl)},a.nice=function(t,e){var r=a.domain(),n=co(r),o=null==t?i(n,10):"number"==typeof t&&i(n,t);function l(r){return!isNaN(r)&&!t.range(r,Dl(+r+1),e).length}return o&&(t=o[0],e=o[1]),a.domain(po(r,e>1?{floor:function(e){for(;l(e=t.floor(e));)e=Dl(e-1);return e},ceil:function(e){for(;l(e=t.ceil(e));)e=Dl(+e+1);return e}}:t))},a.ticks=function(t,e){var r=co(a.domain()),n=null==t?i(r,10):"number"==typeof t?i(r,t):!t.range&&[{range:t},e];return n&&(t=n[0],e=n[1]),t.range(r[0],Dl(+r[1]+1),e<1?1:e)},a.tickFormat=function(){return n},a.copy=function(){return zl(e.copy(),r,n)},yo(a,e)}function Dl(t){return new Date(t)}Sl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Pl:Ol,Pl.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Pl.toString=Ol.toString,De.second=Ie(function(t){return new Ee(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),De.seconds=De.second.range,De.seconds.utc=De.second.utc.range,De.minute=Ie(function(t){return new Ee(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),De.minutes=De.minute.range,De.minutes.utc=De.minute.utc.range,De.hour=Ie(function(t){var e=t.getTimezoneOffset()/60;return new Ee(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),De.hours=De.hour.range,De.hours.utc=De.hour.utc.range,De.month=Ie(function(t){return(t=De.day(t)).setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),De.months=De.month.range,De.months.utc=De.month.utc.range;var El=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Nl=[[De.second,1],[De.second,5],[De.second,15],[De.second,30],[De.minute,1],[De.minute,5],[De.minute,15],[De.minute,30],[De.hour,1],[De.hour,3],[De.hour,6],[De.hour,12],[De.day,1],[De.day,2],[De.week,1],[De.month,1],[De.month,3],[De.year,1]],Rl=Sl.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",Yr]]),Il={range:function(e,r,n){return t.range(Math.ceil(e/n)*n,+r,n).map(Dl)},floor:P,ceil:P};Nl.year=De.year,De.scale=function(){return zl(t.scale.linear(),Nl,Rl)};var Fl=Nl.map(function(t){return[t[0].utc,t[1]]}),jl=Cl.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",Yr]]);function Bl(t){return JSON.parse(t.responseText)}function Hl(t){var e=a.createRange();return e.selectNode(a.body),e.createContextualFragment(t.responseText)}Fl.year=De.year.utc,De.scale.utc=function(){return zl(t.scale.linear(),Fl,jl)},t.text=ye(function(t){return t.responseText}),t.json=function(t,e){return me(t,"application/json",Bl,e)},t.html=function(t,e){return me(t,"text/html",Hl,e)},t.xml=ye(function(t){return t.responseXML}),"object"==typeof e&&e.exports?e.exports=t:this.d3=t}()},{}],8:[function(t,e,r){(function(n,a){!function(t,n){"object"==typeof r&&void 0!==e?e.exports=n():t.ES6Promise=n()}(this,function(){"use strict";function e(t){return"function"==typeof t}var r=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,o=void 0,l=void 0,s=function(t,e){g[i]=t,g[i+1]=e,2===(i+=2)&&(l?l(v):_())};var c="undefined"!=typeof window?window:void 0,u=c||{},f=u.MutationObserver||u.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==n&&"[object process]"==={}.toString.call(n),p="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var t=setTimeout;return function(){return t(v,1)}}var g=new Array(1e3);function v(){for(var t=0;t<i;t+=2){(0,g[t])(g[t+1]),g[t]=void 0,g[t+1]=void 0}i=0}var y,m,x,b,_=void 0;function w(t,e){var r=arguments,n=this,a=new this.constructor(A);void 0===a[M]&&q(a);var i,o=n._state;return o?(i=r[o-1],s(function(){return B(o,a,i,n._result)})):R(n,a,t,e),a}function k(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(A);return z(e,t),e}d?_=function(){return n.nextTick(v)}:f?(m=0,x=new f(v),b=document.createTextNode(""),x.observe(b,{characterData:!0}),_=function(){b.data=m=++m%2}):p?((y=new MessageChannel).port1.onmessage=v,_=function(){return y.port2.postMessage(0)}):_=void 0===c&&"function"==typeof t?function(){try{var e=t("vertx");return o=e.runOnLoop||e.runOnContext,function(){o(v)}}catch(t){return h()}}():h();var M=Math.random().toString(36).substring(16);function A(){}var T=void 0,L=1,S=2,C=new F;function O(t){try{return t.then}catch(t){return C.error=t,C}}function P(t,r,n){r.constructor===t.constructor&&n===w&&r.constructor.resolve===k?function(t,e){e._state===L?E(t,e._result):e._state===S?N(t,e._result):R(e,void 0,function(e){return z(t,e)},function(e){return N(t,e)})}(t,r):n===C?N(t,C.error):void 0===n?E(t,r):e(n)?function(t,e,r){s(function(t){var n=!1,a=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):E(t,r))},function(e){n||(n=!0,N(t,e))},t._label);!n&&a&&(n=!0,N(t,a))},t)}(t,r,n):E(t,r)}function z(t,e){var r;t===e?N(t,new TypeError("You cannot resolve a promise with itself")):"function"==typeof(r=e)||"object"==typeof r&&null!==r?P(t,e,O(e)):E(t,e)}function D(t){t._onerror&&t._onerror(t._result),I(t)}function E(t,e){t._state===T&&(t._result=e,t._state=L,0!==t._subscribers.length&&s(I,t))}function N(t,e){t._state===T&&(t._state=S,t._result=e,s(D,t))}function R(t,e,r,n){var a=t._subscribers,i=a.length;t._onerror=null,a[i]=e,a[i+L]=r,a[i+S]=n,0===i&&t._state&&s(I,t)}function I(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,a=void 0,i=t._result,o=0;o<e.length;o+=3)n=e[o],a=e[o+r],n?B(r,n,a,i):a(i);t._subscribers.length=0}}function F(){this.error=null}var j=new F;function B(t,r,n,a){var i=e(n),o=void 0,l=void 0,s=void 0,c=void 0;if(i){if((o=function(t,e){try{return t(e)}catch(t){return j.error=t,j}}(n,a))===j?(c=!0,l=o.error,o=null):s=!0,r===o)return void N(r,new TypeError("A promises callback cannot return that same promise."))}else o=a,s=!0;r._state!==T||(i&&s?z(r,o):c?N(r,l):t===L?E(r,o):t===S&&N(r,o))}var H=0;function q(t){t[M]=H++,t._state=void 0,t._result=void 0,t._subscribers=[]}function V(t,e){this._instanceConstructor=t,this.promise=new t(A),this.promise[M]||q(this.promise),r(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?E(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&E(this.promise,this._result))):N(this.promise,new Error("Array Methods must be provided an Array"))}function U(t){this[M]=H++,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 U?function(t,e){try{e(function(e){z(t,e)},function(e){N(t,e)})}catch(e){N(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 G(){var t=void 0;if(void 0!==a)t=a;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 e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=U}return V.prototype._enumerate=function(){for(var t=this.length,e=this._input,r=0;this._state===T&&r<t;r++)this._eachEntry(e[r],r)},V.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===k){var a=O(t);if(a===w&&t._state!==T)this._settledAt(t._state,e,t._result);else if("function"!=typeof a)this._remaining--,this._result[e]=t;else if(r===U){var i=new r(A);P(i,t,a),this._willSettleAt(i,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},V.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===T&&(this._remaining--,t===S?N(n,r):this._result[e]=r),0===this._remaining&&E(n,this._result)},V.prototype._willSettleAt=function(t,e){var r=this;R(t,void 0,function(t){return r._settledAt(L,e,t)},function(t){return r._settledAt(S,e,t)})},U.all=function(t){return new V(this,t).promise},U.race=function(t){var e=this;return r(t)?new e(function(r,n){for(var a=t.length,i=0;i<a;i++)e.resolve(t[i]).then(r,n)}):new e(function(t,e){return e(new TypeError("You must pass an array to race."))})},U.resolve=k,U.reject=function(t){var e=new this(A);return N(e,t),e},U._setScheduler=function(t){l=t},U._setAsap=function(t){s=t},U._asap=s,U.prototype={constructor:U,then:w,catch:function(t){return this.then(null,t)}},G(),U.polyfill=G,U.Promise=U,U})}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:24}],9:[function(t,e,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function a(t){return"function"==typeof t}function i(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.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},n.prototype.emit=function(t){var e,r,n,l,s,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var u=new Error('Uncaught, unspecified "error" event. ('+e+")");throw u.context=e,u}if(o(r=this._events[t]))return!1;if(a(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:l=Array.prototype.slice.call(arguments,1),r.apply(this,l)}else if(i(r))for(l=Array.prototype.slice.call(arguments,1),n=(c=r.slice()).length,s=0;s<n;s++)c[s].apply(this,l);return!0},n.prototype.addListener=function(t,e){var r;if(!a(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,a(e.listener)?e.listener:e),this._events[t]?i(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,i(this._events[t])&&!this._events[t].warned&&(r=o(this._maxListeners)?n.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},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){if(!a(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},n.prototype.removeListener=function(t,e){var r,n,o,l;if(!a(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(o=(r=this._events[t]).length,n=-1,r===e||a(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(i(r)){for(l=o;l-- >0;)if(r[l]===e||r[l].listener&&r[l].listener===e){n=l;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},n.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(a(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},n.prototype.listeners=function(t){return this._events&&this._events[t]?a(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(a(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],10:[function(t,e,r){"use strict";e.exports=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}},{}],11:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=r+r,l=n+n,s=a+a,c=r*o,u=n*o,f=n*l,d=a*o,p=a*l,h=a*s,g=i*o,v=i*l,y=i*s;return t[0]=1-f-h,t[1]=u+y,t[2]=d-v,t[3]=0,t[4]=u-y,t[5]=1-c-h,t[6]=p+g,t[7]=0,t[8]=d+v,t[9]=p-g,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],12:[function(t,e,r){(function(r){"use strict";var n,a=t("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:a,e.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":14}],13:[function(t,e,r){"use strict";var n=t("is-browser");e.exports=n&&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}()},{"is-browser":14}],14:[function(t,e,r){e.exports=!0},{}],15:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var a=t.clientX||0,i=t.clientY||0,o=(l=e,l===window||l===document||l===document.body?n:l.getBoundingClientRect());var l;return r[0]=a-o.left,r[1]=i-o.top,r}},{}],16:[function(t,e,r){var n,a=t("./lib/build-log"),i=t("./lib/epsilon"),o=t("./lib/intersecter"),l=t("./lib/segment-chainer"),s=t("./lib/segment-selector"),c=t("./lib/geojson"),u=!1,f=i();function d(t,e,r){var a=n.segments(t),i=n.segments(e),o=r(n.combine(a,i));return n.polygon(o)}n={buildLog:function(t){return!0===t?u=a():!1===t&&(u=!1),!1!==u&&u.list},epsilon:function(t){return f.epsilon(t)},segments:function(t){var e=o(!0,f,u);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:o(!1,f,u).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:s.union(t.combined,u),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:s.intersect(t.combined,u),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:s.difference(t.combined,u),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:s.differenceRev(t.combined,u),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:s.xor(t.combined,u),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:l(t.segments,f,u),inverted:t.inverted}},polygonFromGeoJSON:function(t){return c.toPolygon(n,t)},polygonToGeoJSON:function(t){return c.fromPolygon(n,f,t)},union:function(t,e){return d(t,e,n.selectUnion)},intersect:function(t,e){return d(t,e,n.selectIntersect)},difference:function(t,e){return d(t,e,n.selectDifference)},differenceRev:function(t,e){return d(t,e,n.selectDifferenceRev)},xor:function(t,e){return d(t,e,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),e.exports=n},{"./lib/build-log":17,"./lib/epsilon":18,"./lib/geojson":19,"./lib/intersecter":20,"./lib/segment-chainer":22,"./lib/segment-selector":23}],17:[function(t,e,r){e.exports=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")}}}},{}],18:[function(t,e,r){e.exports=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 a=r[0],i=r[1],o=n[0],l=n[1],s=e[0];return(o-a)*(e[1]-i)-(l-i)*(s-a)>=-t},pointBetween:function(e,r,n){var a=e[1]-r[1],i=n[0]-r[0],o=e[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s<t||s-(i*i+l*l)>-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 a=e[0]-r[0],i=e[1]-r[1],o=r[0]-n[0],l=r[1]-n[1];return Math.abs(a*l-o*i)<t},linesIntersect:function(e,r,n,a){var i=r[0]-e[0],o=r[1]-e[1],l=a[0]-n[0],s=a[1]-n[1],c=i*s-o*l;if(Math.abs(c)<t)return!1;var u=e[0]-n[0],f=e[1]-n[1],d=(l*f-s*u)/c,p=(i*f-o*u)/c,h={alongA:0,alongB:0,pt:[e[0]+d*i,e[1]+d*o]};return h.alongA=d<=-t?-2:d<t?-1:d-1<=-t?0:d-1<t?1:2,h.alongB=p<=-t?-2:p<t?-1:p-1<=-t?0:p-1<t?1:2,h},pointInsideRegion:function(e,r){for(var n=e[0],a=e[1],i=r[r.length-1][0],o=r[r.length-1][1],l=!1,s=0;s<r.length;s++){var c=r[s][0],u=r[s][1];u-a>t!=o-a>t&&(i-c)*(a-u)/(o-u)+c-n>t&&(l=!l),i=c,o=u}return l}};return e}},{}],19:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),a=1;a<e.length;a++)n=t.selectDifference(t.combine(n,r(e[a])));return n}if("Polygon"===e.type)return t.polygon(r(e.coordinates));if("MultiPolygon"===e.type){for(var n=t.segments({inverted:!1,regions:[]}),a=0;a<e.coordinates.length;a++)n=t.selectUnion(t.combine(n,r(e.coordinates[a])));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 a(t){return{region:t,children:[]}}r=t.polygon(t.segments(r));var i=a(null);function o(t,e){for(var r=0;r<t.children.length;r++){if(n(e,(l=t.children[r]).region))return void o(l,e)}var i=a(e);for(r=0;r<t.children.length;r++){var l;n((l=t.children[r]).region,e)&&(i.children.push(l),t.children.splice(r,1),r--)}t.children.push(i)}for(var l=0;l<r.regions.length;l++){var s=r.regions[l];s.length<3||o(i,s)}function c(t,e){for(var r=0,n=t[t.length-1][0],a=t[t.length-1][1],i=[],o=0;o<t.length;o++){var l=t[o][0],s=t[o][1];i.push([l,s]),r+=s*n-l*a,n=l,a=s}return r<0!==e&&i.reverse(),i.push([i[0][0],i[0][1]]),i}var u=[];function f(t){var e=[c(t.region,!1)];u.push(e);for(var r=0;r<t.children.length;r++)e.push(d(t.children[r]))}function d(t){for(var e=0;e<t.children.length;e++)f(t.children[e]);return c(t.region,!0)}for(l=0;l<i.children.length;l++)f(i.children[l]);return u.length<=0?{type:"Polygon",coordinates:[]}:1==u.length?{type:"Polygon",coordinates:u[0]}:{type:"MultiPolygon",coordinates:u}}};e.exports=n},{}],20:[function(t,e,r){var n=t("./linked-list");e.exports=function(t,e,r){function a(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=n.create();function o(t,r){i.insertBefore(t,function(n){return function(t,r,n,a,i,o){var l=e.pointsCompare(r,i);return 0!==l?l:e.pointsSame(n,o)?0:t!==a?t?1:-1:e.pointAboveOrOnLine(n,a?i:o,a?o:i)?1:-1}(t.isStart,t.pt,r,n.isStart,n.pt,n.other.pt)<0})}function l(t,e){var r=function(t,e){var r=n.node({isStart:!0,pt:t.start,seg:t,primary:e,other:null,status:null});return o(r,t.end),r}(t,e);return function(t,e,r){var a=n.node({isStart:!1,pt:e.end,seg:e,primary:r,other:t,status:null});t.other=a,o(a,t.pt)}(r,t,e),r}function s(t,e){var n=a(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,o(t.other,t.pt)}(t,e),l(n,t.primary)}function c(a,o){var l=n.create();function c(t){return l.findTransition(function(r){var n,a,i,o,l,s;return n=t,a=r.ev,i=n.seg.start,o=n.seg.end,l=a.seg.start,s=a.seg.end,(e.pointsCollinear(i,l,s)?e.pointsCollinear(o,l,s)?1:e.pointAboveOrOnLine(o,l,s)?1:-1:e.pointAboveOrOnLine(i,l,s)?1:-1)>0})}function u(t,n){var a=t.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=e.linesIntersect(o,l,c,u);if(!1===f){if(!e.pointsCollinear(o,l,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(l,c))return!1;var d=e.pointsSame(o,c),p=e.pointsSame(l,u);if(d&&p)return n;var h=!d&&e.pointBetween(o,c,u),g=!p&&e.pointBetween(l,c,u);if(d)return g?s(n,l):s(t,u),n;h&&(p||(g?s(n,l):s(t,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(t,c):0===f.alongB?s(t,f.pt):1===f.alongB&&s(t,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,g=p.after?p.after.ev:null;function v(){if(h){var t=u(d,h);if(t)return t}return!!g&&u(d,g)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!g&&g.seg);var y,m,x=v();if(x)t?(m=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(x.seg.myFill.above=!x.seg.myFill.above):x.seg.otherFill=d.seg.myFill,r&&r.segmentUpdate(x.seg),d.other.remove(),d.remove();if(i.getHead()!==d){r&&r.rewind(d.seg);continue}t?(m=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=g?g.seg.myFill.above:a,d.seg.myFill.above=m?!d.seg.myFill.below:d.seg.myFill.below):null===d.seg.otherFill&&(y=g?d.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:y,below:y}),r&&r.status(d.seg,!!h&&h.seg,!!g&&g.seg),d.other.status=p.insert(n.node({ev:d}))}else{var b=d.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,a,i,o=t[t.length-1],s=0;s<t.length;s++){n=o,o=t[s];var c=e.pointsCompare(n,o);0!==c&&l((a=c<0?n:o,i=c<0?o:n,{id:r?r.segmentId():-1,start:a,end:i,myFill:{above:null,below:null},otherFill:null}),!0)}},calculate:function(t){return c(t,!1)}}:{calculate:function(t,e,r,n){return t.forEach(function(t){l(a(t.start,t.end,t),!0)}),r.forEach(function(t){l(a(t.start,t.end,t),!1)}),c(e,n)}}}},{"./linked-list":21}],21:[function(t,e,r){e.exports={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,a=t.root.next;null!==a;){if(r(a))return e.prev=a.prev,e.next=a,a.prev.next=e,void(a.prev=e);n=a,a=a.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}}},{}],22:[function(t,e,r){e.exports=function(t,e,r){var n=[],a=[];return t.forEach(function(t){var i=t.start,o=t.end;if(e.pointsSame(i,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 l={index:0,matches_head:!1,matches_pt1:!1},s={index:0,matches_head:!1,matches_pt1:!1},c=l,u=0;u<n.length;u++){var f=(v=n[u])[0],d=(v[1],v[v.length-1]);if(v[v.length-2],e.pointsSame(f,i)){if(M(u,!0,!0))break}else if(e.pointsSame(f,o)){if(M(u,!0,!1))break}else if(e.pointsSame(d,i)){if(M(u,!1,!0))break}else if(e.pointsSame(d,o)&&M(u,!1,!1))break}if(c===l)return n.push([i,o]),void(r&&r.chainNew(i,o));if(c===s){r&&r.chainMatch(l.index);var p=l.index,h=l.matches_pt1?o:i,g=l.matches_head,v=n[p],y=g?v[0]:v[v.length-1],m=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(m,y,h)&&(g?(r&&r.chainRemoveHead(l.index,h),v.shift()):(r&&r.chainRemoveTail(l.index,h),v.pop()),y=m),e.pointsSame(x,h)?(n.splice(p,1),e.pointsCollinear(b,x,y)&&(g?(r&&r.chainRemoveTail(l.index,y),v.pop()):(r&&r.chainRemoveHead(l.index,y),v.shift())),r&&r.chainClose(l.index),void a.push(v)):void(g?(r&&r.chainAddHead(l.index,h),v.unshift(h)):(r&&r.chainAddTail(l.index,h),v.push(h)))}var _=l.index,w=s.index;r&&r.chainConnect(_,w);var k=n[_].length<n[w].length;l.matches_head?s.matches_head?k?(A(_),T(_,w)):(A(w),T(w,_)):T(w,_):s.matches_head?T(_,w):k?(A(_),T(w,_)):(A(w),T(_,w))}function M(t,e,r){return c.index=t,c.matches_head=e,c.matches_pt1=r,c===l?(c=s,!1):(c=null,!0)}function A(t){r&&r.chainReverse(t),n[t].reverse()}function T(t,a){var i=n[t],o=n[a],l=i[i.length-1],s=i[i.length-2],c=o[0],u=o[1];e.pointsCollinear(s,l,c)&&(r&&r.chainRemoveTail(t,l),i.pop(),l=s),e.pointsCollinear(l,c,u)&&(r&&r.chainRemoveHead(a,c),o.shift()),r&&r.chainJoin(t,a),n[t]=i.concat(o),n.splice(a,1)}}),a}},{}],23:[function(t,e,r){function n(t,e,r){var n=[];return t.forEach(function(t){var a=(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[a]&&n.push({id:r?r.segmentId():-1,start:t.start,end:t.end,myFill:{above:1===e[a],below:2===e[a]},otherFill:null})}),r&&r.selected(n),n}var a={union:function(t,e){return n(t,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],e)},intersect:function(t,e){return n(t,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],e)},difference:function(t,e){return n(t,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],e)},differenceRev:function(t,e){return n(t,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],e)},xor:function(t,e){return n(t,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],e)}};e.exports=a},{}],24:[function(t,e,r){var n,a,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{a="function"==typeof clearTimeout?clearTimeout:l}catch(t){a=l}}();var c,u=[],f=!1,d=-1;function p(){f&&c&&(f=!1,c.length?u=c.concat(u):d=-1,u.length&&h())}function h(){if(!f){var t=s(p);f=!0;for(var e=u.length;e;){for(c=u,u=[];++d<e;)c&&c[d].run();d=-1,e=u.length}c=null,f=!1,function(t){if(a===clearTimeout)return clearTimeout(t);if((a===l||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(t);try{a(t)}catch(e){try{return a.call(null,t)}catch(e){return a.call(this,t)}}}(t)}}function g(t,e){this.fun=t,this.array=e}function v(){}i.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];u.push(new g(t,e)),1!==u.length||f||s(h)},g.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],25:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,a=0,i=t.round,o=t.min,l=t.max,s=t.random;function c(e,s){if(s=s||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,s);var u=function(e){var a={r:0,g:0,b:0},i=1,s=null,c=null,u=null,f=!1,d=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,a=!1;if(L[t])t=L[t],a=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=B.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=B.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=B.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=B.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=B.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=B.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=B.hex8.exec(t))return{r:z(e[1]),g:z(e[2]),b:z(e[3]),a:R(e[4]),format:a?"name":"hex8"};if(e=B.hex6.exec(t))return{r:z(e[1]),g:z(e[2]),b:z(e[3]),format:a?"name":"hex"};if(e=B.hex4.exec(t))return{r:z(e[1]+""+e[1]),g:z(e[2]+""+e[2]),b:z(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:a?"name":"hex8"};if(e=B.hex3.exec(t))return{r:z(e[1]+""+e[1]),g:z(e[2]+""+e[2]),b:z(e[3]+""+e[3]),format:a?"name":"hex"};return!1}(e));"object"==typeof e&&(H(e.r)&&H(e.g)&&H(e.b)?(p=e.r,h=e.g,g=e.b,a={r:255*O(p,255),g:255*O(h,255),b:255*O(g,255)},f=!0,d="%"===String(e.r).substr(-1)?"prgb":"rgb"):H(e.h)&&H(e.s)&&H(e.v)?(s=E(e.s),c=E(e.v),a=function(e,r,n){e=6*O(e,360),r=O(r,100),n=O(n,100);var a=t.floor(e),i=e-a,o=n*(1-r),l=n*(1-i*r),s=n*(1-(1-i)*r),c=a%6;return{r:255*[n,l,o,o,s,n][c],g:255*[s,n,n,l,o,o][c],b:255*[o,o,s,n,n,l][c]}}(e.h,s,c),f=!0,d="hsv"):H(e.h)&&H(e.s)&&H(e.l)&&(s=E(e.s),u=E(e.l),a=function(t,e,r){var n,a,i;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=O(t,360),e=O(e,100),r=O(r,100),0===e)n=a=i=r;else{var l=r<.5?r*(1+e):r+e-r*e,s=2*r-l;n=o(s,l,t+1/3),a=o(s,l,t),i=o(s,l,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(e.h,s,u),f=!0,d="hsl"),e.hasOwnProperty("a")&&(i=e.a));var p,h,g;return i=C(i),{ok:f,format:e.format||d,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.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=u.ok,this._tc_id=a++}function u(t,e,r){t=O(t,255),e=O(e,255),r=O(r,255);var n,a,i=l(t,e,r),s=o(t,e,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case t:n=(e-r)/u+(e<r?6:0);break;case e:n=(r-t)/u+2;break;case r:n=(t-e)/u+4}n/=6}return{h:n,s:a,l:c}}function f(t,e,r){t=O(t,255),e=O(e,255),r=O(r,255);var n,a,i=l(t,e,r),s=o(t,e,r),c=i,u=i-s;if(a=0===i?0:u/i,i==s)n=0;else{switch(i){case t:n=(e-r)/u+(e<r?6:0);break;case e:n=(r-t)/u+2;break;case r:n=(t-e)/u+4}n/=6}return{h:n,s:a,v:c}}function d(t,e,r,n){var a=[D(i(t).toString(16)),D(i(e).toString(16)),D(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[D(N(n)),D(i(t).toString(16)),D(i(e).toString(16)),D(i(r).toString(16))].join("")}function h(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.s-=e/100,r.s=P(r.s),c(r)}function g(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.s+=e/100,r.s=P(r.s),c(r)}function v(t){return c(t).desaturate(100)}function y(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.l+=e/100,r.l=P(r.l),c(r)}function m(t,e){e=0===e?0:e||10;var r=c(t).toRgb();return r.r=l(0,o(255,r.r-i(-e/100*255))),r.g=l(0,o(255,r.g-i(-e/100*255))),r.b=l(0,o(255,r.b-i(-e/100*255))),c(r)}function x(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.l-=e/100,r.l=P(r.l),c(r)}function b(t,e){var r=c(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,c(r)}function _(t){var e=c(t).toHsl();return e.h=(e.h+180)%360,c(e)}function w(t){var e=c(t).toHsl(),r=e.h;return[c(t),c({h:(r+120)%360,s:e.s,l:e.l}),c({h:(r+240)%360,s:e.s,l:e.l})]}function k(t){var e=c(t).toHsl(),r=e.h;return[c(t),c({h:(r+90)%360,s:e.s,l:e.l}),c({h:(r+180)%360,s:e.s,l:e.l}),c({h:(r+270)%360,s:e.s,l:e.l})]}function M(t){var e=c(t).toHsl(),r=e.h;return[c(t),c({h:(r+72)%360,s:e.s,l:e.l}),c({h:(r+216)%360,s:e.s,l:e.l})]}function A(t,e,r){e=e||6,r=r||30;var n=c(t).toHsl(),a=360/r,i=[c(t)];for(n.h=(n.h-(a*e>>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(c(n));return i}function T(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/e;e--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.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,a=this.toRgb();return e=a.r/255,r=a.g/255,n=a.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=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=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=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=u(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 d(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=[D(i(t).toString(16)),D(i(e).toString(16)),D(i(r).toString(16)),D(N(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*O(this._r,255))+"%",g:i(100*O(this._g,255))+"%",b:i(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%)":"rgba("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[d(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 a=c(t);r="#"+p(a._r,a._g,a._b,a._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 c(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(y,arguments)},brighten:function(){return this._applyModification(m,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,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(A,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(T,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},c.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:E(t[n]));t=r}return c(t,e)},c.equals=function(t,e){return!(!t||!e)&&c(t).toRgbString()==c(e).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),a=c(e).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(e,r){var n=c(e),a=c(r);return(t.max(n.getLuminance(),a.getLuminance())+.05)/(t.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,a,i=c.readability(t,e);switch(a=!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":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(t,e,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;u<e.length;u++)(n=c.readability(t,e[u]))>s&&(s=n,l=c(e[u]));return c.isReadable(t,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],r))};var L=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=c.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(L);function C(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function O(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,l(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function P(t){return o(1,l(0,t))}function z(t){return parseInt(t,16)}function D(t){return 1==t.length?"0"+t:""+t}function E(t){return t<=1&&(t=100*t+"%"),t}function N(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return z(t)/255}var I,F,j,B=(F="[\\s|\\(]+("+(I="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+I+")[,|\\s]+("+I+")\\s*\\)?",j="[\\s|\\(]+("+I+")[,|\\s]+("+I+")[,|\\s]+("+I+")[,|\\s]+("+I+")\\s*\\)?",{CSS_UNIT:new RegExp(I),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+j),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 H(t){return!!B.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],26:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./common_defaults"),o=t("./attributes");e.exports=function(t,e,r,l,s){function c(r,a){return n.coerce(t,e,o,r,a)}l=l||{};var u=c("visible",!(s=s||{}).itemIsNotPlainObject),f=c("clicktoshow");if(!u&&!f)return e;i(t,e,r,c);for(var d=e.showarrow,p=["x","y"],h=[-10,-30],g={_fullLayout:r},v=0;v<2;v++){var y=p[v],m=a.coerceRef(t,e,g,y,"","paper");if(a.coercePosition(e,g,c,m,y,.5),d){var x="a"+y,b=a.coerceRef(t,e,g,x,"pixel");"pixel"!==b&&b!==m&&(b=e[x]="pixel");var _="pixel"===b?h[v]:.4;a.coercePosition(e,g,c,b,x,_)}c(y+"anchor"),c(y+"shift")}if(n.noneOrAll(t,e,["x","y"]),d&&n.noneOrAll(t,e,["ax","ay"]),f){var w=c("xclick"),k=c("yclick");e._xclick=void 0===w?e.x:a.cleanPosition(w,g,e.xref),e._yclick=void 0===k?e.y:a.cleanPosition(k,g,e.yref)}return e}},{"../../lib":163,"../../plots/cartesian/axes":205,"./attributes":28,"./common_defaults":31}],27:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],28:[function(t,e,r){"use strict";var n=t("./arrow_paths"),a=t("../../plots/font_attributes"),i=t("../../plots/cartesian/constants");e.exports={_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:a({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:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"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",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.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",i.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:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}}},{"../../plots/cartesian/constants":210,"../../plots/font_attributes":231,"./arrow_paths":27}],29:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach(function(e){var r,n,i,o,l=a.getFromId(t,e.xref),s=a.getFromId(t,e.yref),c=3*e.arrowsize*e.arrowwidth||0,u=3*e.startarrowsize*e.arrowwidth||0;l&&l.autorange&&(r=c+e.xshift,n=c-e.xshift,i=u+e.xshift,o=u-e.xshift,e.axref===e.xref?(a.expand(l,[l.r2c(e.x)],{ppadplus:r,ppadminus:n}),a.expand(l,[l.r2c(e.ax)],{ppadplus:Math.max(e._xpadplus,i),ppadminus:Math.max(e._xpadminus,o)})):(i=e.ax?i+e.ax:i,o=e.ax?o-e.ax:o,a.expand(l,[l.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,r,i),ppadminus:Math.max(e._xpadminus,n,o)}))),s&&s.autorange&&(r=c-e.yshift,n=c+e.yshift,i=u-e.yshift,o=u+e.yshift,e.ayref===e.yref?(a.expand(s,[s.r2c(e.y)],{ppadplus:r,ppadminus:n}),a.expand(s,[s.r2c(e.ay)],{ppadplus:Math.max(e._ypadplus,i),ppadminus:Math.max(e._ypadminus,o)})):(i=e.ay?i+e.ay:i,o=e.ay?o-e.ay:o,a.expand(s,[s.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,r,i),ppadminus:Math.max(e._ypadminus,n,o)})))})}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.annotations);if(r.length&&t._fullData.length){var l={};for(var s in r.forEach(function(t){l[t.xref]=1,l[t.yref]=1}),l){var c=a.getFromId(t,s);if(c&&c.autorange)return n.syncOrAsync([i,o],t)}}}},{"../../lib":163,"../../plots/cartesian/axes":205,"./draw":34}],30:[function(t,e,r){"use strict";var n=t("../../registry");function a(t,e){var r,n,a,o,l,s,c,u=t._fullLayout.annotations,f=[],d=[],p=[],h=(e||[]).length;for(r=0;r<u.length;r++)if(o=(a=u[r]).clicktoshow){for(n=0;n<h;n++)if(s=(l=e[n]).xaxis,c=l.yaxis,s._id===a.xref&&c._id===a.yref&&s.d2r(l.x)===i(a._xclick,s)&&c.d2r(l.y)===i(a._yclick,c)){(a.visible?"onout"===o?d:p:f).push(r);break}n===h&&a.visible&&"onout"===o&&d.push(r)}return{on:f,off:d,explicitOff:p}}function i(t,e){return"log"===e.type?e.l2r(t):e.d2r(t)}e.exports={hasClickToShow:function(t,e){var r=a(t,e);return r.on.length>0||r.explicitOff.length>0},onClick:function(t,e){var r,i=a(t,e),o=i.on,l=i.off.concat(i.explicitOff),s={};if(!o.length&&!l.length)return;for(r=0;r<o.length;r++)s["annotations["+o[r]+"].visible"]=!0;for(r=0;r<l.length;r++)s["annotations["+l[r]+"].visible"]=!1;return n.call("update",t,{},s)}}},{"../../registry":245}],31:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color");e.exports=function(t,e,r,i){i("opacity");var o=i("bgcolor"),l=i("bordercolor"),s=a.opacity(l);i("borderpad");var c=i("borderwidth"),u=i("showarrow");if(i("text",u?" ":r._dfltTitle.annotation),i("textangle"),n.coerceFont(i,"font",r.font),i("width"),i("align"),i("height")&&i("valign"),u){var f,d,p=i("arrowside");-1!==p.indexOf("end")&&(f=i("arrowhead"),d=i("arrowsize")),-1!==p.indexOf("start")&&(i("startarrowhead",f),i("startarrowsize",d)),i("arrowcolor",s?e.bordercolor:a.defaultLine),i("arrowwidth",2*(s&&c||1)),i("standoff"),i("startstandoff")}var h=i("hovertext"),g=r.hoverlabel||{};if(h){var v=i("hoverlabel.bgcolor",g.bgcolor||(a.opacity(o)?a.rgb(o):a.defaultLine)),y=i("hoverlabel.bordercolor",g.bordercolor||a.contrast(v));n.coerceFont(i,"hoverlabel.font",{family:g.font.family,size:g.font.size,color:g.font.color||y})}i("captureevents",!!h)}},{"../../lib":163,"../color":43}],32:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib/to_log_range");e.exports=function(t,e,r,i){e=e||{};var o="log"===r&&"linear"===e.type,l="linear"===r&&"log"===e.type;if(o||l)for(var s,c,u=t._fullLayout.annotations,f=e._id.charAt(0),d=0;d<u.length;d++)s=u[d],c="annotations["+d+"].",s[f+"ref"]===e._id&&p(f),s["a"+f+"ref"]===e._id&&p("a"+f);function p(t){var r=s[t],l=null;l=o?a(r,e.range):Math.pow(10,r),n(l)||(l=null),i(c+t,l)}}},{"../../lib/to_log_range":186,"fast-isnumeric":10}],33:[function(t,e,r){"use strict";var n=t("../../plots/array_container_defaults"),a=t("./annotation_defaults");e.exports=function(t,e){n(t,e,{name:"annotations",handleItemDefaults:a})}},{"../../plots/array_container_defaults":201,"./annotation_defaults":26}],34:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../plots/plots"),o=t("../../lib"),l=t("../../plots/cartesian/axes"),s=t("../color"),c=t("../drawing"),u=t("../fx"),f=t("../../lib/svg_text_utils"),d=t("../../lib/setcursor"),p=t("../dragelement"),h=t("./draw_arrow_head");function g(t,e){var r=t._fullLayout.annotations[e]||{};v(t,r,e,!1,l.getFromId(t,r.xref),l.getFromId(t,r.yref))}function v(t,e,r,i,l,g){var v,y,m=t._fullLayout,x=t._fullLayout._size,b=t._context.edits;i?(v="annotation-"+i,y=i+".annotations["+r+"]"):(v="annotation",y="annotations["+r+"]"),m._infolayer.selectAll("."+v+'[data-index="'+r+'"]').remove();var _="clip"+m._uid+"_ann"+r;if(e._input&&!1!==e.visible){var w={x:{},y:{}},k=+e.textangle||0,M=m._infolayer.append("g").classed(v,!0).attr("data-index",String(r)).style("opacity",e.opacity),A=M.append("g").classed("annotation-text-g",!0),T=b[e.showarrow?"annotationTail":"annotationPosition"],L=e.captureevents||b.annotationText||T,S=A.append("g").style("pointer-events",L?"all":null).call(d,"pointer").on("click",function(){t._dragging=!1;var a={index:r,annotation:e._input,fullAnnotation:e,event:n.event};i&&(a.subplotId=i),t.emit("plotly_clickannotation",a)});e.hovertext&&S.on("mouseover",function(){var r=e.hoverlabel,n=r.font,a=this.getBoundingClientRect(),i=t.getBoundingClientRect();u.loneHover({x0:a.left-i.left,x1:a.right-i.left,y:(a.top+a.bottom)/2-i.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:m._hoverlayer.node(),outerContainer:m._paper.node(),gd:t})}).on("mouseout",function(){u.loneUnhover(m._hoverlayer.node())});var C=e.borderwidth,O=e.borderpad,P=C+O,z=S.append("rect").attr("class","bg").style("stroke-width",C+"px").call(s.stroke,e.bordercolor).call(s.fill,e.bgcolor),D=e.width||e.height,E=m._topclips.selectAll("#"+_).data(D?[0]:[]);E.enter().append("clipPath").classed("annclip",!0).attr("id",_).append("rect"),E.exit().remove();var N=e.font,R=S.append("text").classed("annotation-text",!0).text(e.text);b.annotationText?R.call(f.makeEditable,{delegate:S,gd:t}).call(I).on("edit",function(r){e.text=r,this.call(I);var n={};n[y+".text"]=e.text,l&&l.autorange&&(n[l._name+".autorange"]=!0),g&&g.autorange&&(n[g._name+".autorange"]=!0),a.call("relayout",t,n)}):R.call(I)}else n.selectAll("#"+_).remove();function I(r){return r.call(c.font,N).attr({"text-anchor":{left:"start",right:"end"}[e.align]||"middle"}),f.convertToTspans(r,t,F),r}function F(){var r=R.selectAll("a");1===r.size()&&r.text()===R.text()&&S.insert("a",":first-child").attr({"xlink:xlink:href":r.attr("xlink:href"),"xlink:xlink:show":r.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(z.node());var n=S.select(".annotation-text-math-group"),u=!n.empty(),v=c.bBox((u?n:R).node()),L=v.width,O=v.height,N=e.width||L,I=e.height||O,F=Math.round(N+2*P),j=Math.round(I+2*P);function B(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]}e._w=N,e._h=I;for(var H=!1,q=["x","y"],V=0;V<q.length;V++){var U,G,Y,X,Z,W=q[V],Q=e[W+"ref"]||W,J=e["a"+W+"ref"],$={x:l,y:g}[W],K=(k+("x"===W?0:-90))*Math.PI/180,tt=F*Math.cos(K),et=j*Math.sin(K),rt=Math.abs(tt)+Math.abs(et),nt=e[W+"anchor"],at=e[W+"shift"]*("x"===W?1:-1),it=w[W];if($){var ot=$.r2fraction(e[W]);if((t._dragging||!$.autorange)&&(ot<0||ot>1)&&(J===Q?((ot=$.r2fraction(e["a"+W]))<0||ot>1)&&(H=!0):H=!0,H))continue;U=$._offset+$.r2p(e[W]),X=.5}else"x"===W?(Y=e[W],U=x.l+x.w*Y):(Y=1-e[W],U=x.t+x.h*Y),X=e.showarrow?.5:Y;if(e.showarrow){it.head=U;var lt=e["a"+W];Z=tt*B(.5,e.xanchor)-et*B(.5,e.yanchor),J===Q?(it.tail=$._offset+$.r2p(lt),G=Z):(it.tail=U+lt,G=Z+lt),it.text=it.tail+Z;var st=m["x"===W?"width":"height"];if("paper"===Q&&(it.head=o.constrain(it.head,1,st-1)),"pixel"===J){var ct=-Math.max(it.tail-3,it.text),ut=Math.min(it.tail+3,it.text)-st;ct>0?(it.tail+=ct,it.text+=ct):ut>0&&(it.tail-=ut,it.text-=ut)}it.tail+=at,it.head+=at}else G=Z=rt*B(X,nt),it.text=U+Z;it.text+=at,Z+=at,G+=at,e["_"+W+"padplus"]=rt/2+G,e["_"+W+"padminus"]=rt/2-G,e["_"+W+"size"]=rt,e["_"+W+"shift"]=Z}if(H)S.remove();else{var ft=0,dt=0;if("left"!==e.align&&(ft=(N-L)*("center"===e.align?.5:1)),"top"!==e.valign&&(dt=(I-O)*("middle"===e.valign?.5:1)),u)n.select("svg").attr({x:P+ft-1,y:P+dt}).call(c.setClipUrl,D?_:null);else{var pt=P+dt-v.top,ht=P+ft-v.left;R.call(f.positionText,ht,pt).call(c.setClipUrl,D?_:null)}E.select("rect").call(c.setRect,P,P,N,I),z.call(c.setRect,C/2,C/2,F-C,j-C),S.call(c.setTranslate,Math.round(w.x.text-F/2),Math.round(w.y.text-j/2)),A.attr({transform:"rotate("+k+","+w.x.text+","+w.y.text+")"});var gt,vt,yt=function(r,n){M.selectAll(".annotation-arrow-g").remove();var u=w.x.head,f=w.y.head,d=w.x.tail+r,v=w.y.tail+n,m=w.x.text+r,_=w.y.text+n,T=o.rotationXYMatrix(k,m,_),L=o.apply2DTransform(T),C=o.apply2DTransform2(T),O=+z.attr("width"),P=+z.attr("height"),D=m-.5*O,E=D+O,N=_-.5*P,R=N+P,I=[[D,N,D,R],[D,R,E,R],[E,R,E,N],[E,N,D,N]].map(C);if(!I.reduce(function(t,e){return t^!!o.segmentsIntersect(u,f,u+1e6,f+1e6,e[0],e[1],e[2],e[3])},!1)){I.forEach(function(t){var e=o.segmentsIntersect(d,v,u,f,t[0],t[1],t[2],t[3]);e&&(d=e.x,v=e.y)});var F=e.arrowwidth,j=e.arrowcolor,B=e.arrowside,H=M.append("g").style({opacity:s.opacity(j)}).classed("annotation-arrow-g",!0),q=H.append("path").attr("d","M"+d+","+v+"L"+u+","+f).style("stroke-width",F+"px").call(s.stroke,s.rgb(j));if(h(q,B,e),b.annotationPosition&&q.node().parentNode&&!i){var V=u,U=f;if(e.standoff){var G=Math.sqrt(Math.pow(u-d,2)+Math.pow(f-v,2));V+=e.standoff*(d-u)/G,U+=e.standoff*(v-f)/G}var Y,X,Z,W=H.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-V)+","+(v-U),transform:"translate("+V+","+U+")"}).style("stroke-width",F+6+"px").call(s.stroke,"rgba(0,0,0,0)").call(s.fill,"rgba(0,0,0,0)");p.init({element:W.node(),gd:t,prepFn:function(){var t=c.getTranslate(S);X=t.x,Z=t.y,Y={},l&&l.autorange&&(Y[l._name+".autorange"]=!0),g&&g.autorange&&(Y[g._name+".autorange"]=!0)},moveFn:function(t,r){var n=L(X,Z),a=n[0]+t,i=n[1]+r;S.call(c.setTranslate,a,i),Y[y+".x"]=l?l.p2r(l.r2p(e.x)+t):e.x+t/x.w,Y[y+".y"]=g?g.p2r(g.r2p(e.y)+r):e.y-r/x.h,e.axref===e.xref&&(Y[y+".ax"]=l.p2r(l.r2p(e.ax)+t)),e.ayref===e.yref&&(Y[y+".ay"]=g.p2r(g.r2p(e.ay)+r)),H.attr("transform","translate("+t+","+r+")"),A.attr({transform:"rotate("+k+","+a+","+i+")"})},doneFn:function(){a.call("relayout",t,Y);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&yt(0,0),T)p.init({element:S.node(),gd:t,prepFn:function(){vt=A.attr("transform"),gt={}},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?gt[y+".ax"]=l.p2r(l.r2p(e.ax)+t):gt[y+".ax"]=e.ax+t,e.ayref===e.yref?gt[y+".ay"]=g.p2r(g.r2p(e.ay)+r):gt[y+".ay"]=e.ay+r,yt(t,r);else{if(i)return;if(l)gt[y+".x"]=l.p2r(l.r2p(e.x)+t);else{var a=e._xsize/x.w,o=e.x+(e._xshift-e.xshift)/x.w-a/2;gt[y+".x"]=p.align(o+t/x.w,a,0,1,e.xanchor)}if(g)gt[y+".y"]=g.p2r(g.r2p(e.y)+r);else{var s=e._ysize/x.h,c=e.y-(e._yshift+e.yshift)/x.h-s/2;gt[y+".y"]=p.align(c-r/x.h,s,0,1,e.yanchor)}l&&g||(n=p.getCursor(l?.5:gt[y+".x"],g?.5:gt[y+".y"],e.xanchor,e.yanchor))}A.attr({transform:"translate("+t+","+r+")"+vt}),d(S,n)},doneFn:function(){d(S),a.call("relayout",t,gt);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={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&&g(t,r);return i.previousPromises(t)},drawOne:g,drawRaw:v}},{"../../lib":163,"../../lib/setcursor":182,"../../lib/svg_text_utils":184,"../../plots/cartesian/axes":205,"../../plots/plots":237,"../../registry":245,"../color":43,"../dragelement":65,"../drawing":68,"../fx":85,"./draw_arrow_head":35,d3:7}],35:[function(t,e,r){"use strict";var n=t("d3"),a=t("../color"),i=t("./arrow_paths");e.exports=function(t,e,r){var o,l,s,c,u=t.node(),f=i[r.arrowhead||0],d=i[r.startarrowhead||0],p=(r.arrowwidth||1)*(r.arrowsize||1),h=(r.arrowwidth||1)*(r.startarrowsize||1),g=e.indexOf("start")>=0,v=e.indexOf("end")>=0,y=f.backoff*p+r.standoff,m=d.backoff*h+r.startstandoff;if("line"===u.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},l={x:+t.attr("x2"),y:+t.attr("y2")};var x=o.x-l.x,b=o.y-l.y;if(c=(s=Math.atan2(b,x))+Math.PI,y&&m&&y+m>Math.sqrt(x*x+b*b))return void P();if(y){if(y*y>x*x+b*b)return void P();var _=y*Math.cos(s),w=y*Math.sin(s);l.x+=_,l.y+=w,t.attr({x2:l.x,y2:l.y})}if(m){if(m*m>x*x+b*b)return void P();var k=m*Math.cos(s),M=m*Math.sin(s);o.x-=k,o.y-=M,t.attr({x1:o.x,y1:o.y})}}else if("path"===u.nodeName){var A=u.getTotalLength(),T="";if(A<y+m)return void P();var L=u.getPointAtLength(0),S=u.getPointAtLength(.1);s=Math.atan2(L.y-S.y,L.x-S.x),o=u.getPointAtLength(Math.min(m,A)),T="0px,"+m+"px,";var C=u.getPointAtLength(A),O=u.getPointAtLength(A-.1);c=Math.atan2(C.y-O.y,C.x-O.x),l=u.getPointAtLength(Math.max(0,A-y)),T+=A-(T?m+y:y)+"px,"+A+"px",t.style("stroke-dasharray",T)}function P(){t.style("stroke-dasharray","0px,100px")}function z(e,i,o,l){e.path&&(e.noRotate&&(o=0),n.select(u.parentNode).append("path").attr({class:t.attr("class"),d:e.path,transform:"translate("+i.x+","+i.y+")"+(o?"rotate("+180*o/Math.PI+")":"")+"scale("+l+")"}).style({fill:a.rgb(r.arrowcolor),"stroke-width":0}))}g&&z(d,o,s,h),v&&z(f,l,c,p)}},{"../color":43,"./arrow_paths":27,d3:7}],36:[function(t,e,r){"use strict";var n=t("./draw"),a=t("./click");e.exports={moduleType:"component",name:"annotations",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("annotations"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne,drawRaw:n.drawRaw,hasClickToShow:a.hasClickToShow,onClick:a.onClick,convertCoords:t("./convert_coords")}},{"../../plots/cartesian/include_components":215,"./attributes":28,"./calc_autorange":29,"./click":30,"./convert_coords":32,"./defaults":33,"./draw":34}],37:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),a=t("../../plot_api/edit_types").overrideAll;e.exports=a({_isLinkedToArray:"annotation",visible:n.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:n.xanchor,xshift:n.xshift,yanchor:n.yanchor,yshift:n.yshift,text:n.text,textangle:n.textangle,font:n.font,width:n.width,height:n.height,opacity:n.opacity,align:n.align,valign:n.valign,bgcolor:n.bgcolor,bordercolor:n.bordercolor,borderpad:n.borderpad,borderwidth:n.borderwidth,showarrow:n.showarrow,arrowcolor:n.arrowcolor,arrowhead:n.arrowhead,startarrowhead:n.startarrowhead,arrowside:n.arrowside,arrowsize:n.arrowsize,startarrowsize:n.startarrowsize,arrowwidth:n.arrowwidth,standoff:n.standoff,startstandoff:n.startstandoff,hovertext:n.hovertext,hoverlabel:n.hoverlabel,captureevents:n.captureevents},"calc","from-root")},{"../../plot_api/edit_types":190,"../annotations/attributes":28}],38:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes");function i(t,e){var r=e.fullSceneLayout.domain,i=e.fullLayout._size,o={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};t._xa={},n.extendFlat(t._xa,o),a.setConvert(t._xa),t._xa._offset=i.l+r.x[0]*i.w,t._xa.l2p=function(){return.5*(1+t._pdata[0]/t._pdata[3])*i.w*(r.x[1]-r.x[0])},t._ya={},n.extendFlat(t._ya,o),a.setConvert(t._ya),t._ya._offset=i.t+(1-r.y[1])*i.h,t._ya.l2p=function(){return.5*(1-t._pdata[1]/t._pdata[3])*i.h*(r.y[1]-r.y[0])}}e.exports=function(t){for(var e=t.fullSceneLayout.annotations,r=0;r<e.length;r++)i(e[r],t);t.fullLayout._infolayer.selectAll(".annotation-"+t.id).remove()}},{"../../lib":163,"../../plots/cartesian/axes":205}],39:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),o=t("../annotations/common_defaults"),l=t("./attributes");function s(t,e,r,i,s){function c(r,a){return n.coerce(t,e,l,r,a)}function u(t){var n=t+"axis",i={_fullLayout:{}};return i._fullLayout[n]=r[n],a.coercePosition(e,i,c,t,t,.5)}return c("visible",!s.itemIsNotPlainObject)?(o(t,e,i.fullLayout,c),u("x"),u("y"),u("z"),n.noneOrAll(t,e,["x","y","z"]),e.xref="x",e.yref="y",e.zref="z",c("xanchor"),c("yanchor"),c("xshift"),c("yshift"),e.showarrow&&(e.axref="pixel",e.ayref="pixel",c("ax",-10),c("ay",-30),n.noneOrAll(t,e,["ax","ay"])),e):e}e.exports=function(t,e,r){i(t,e,{name:"annotations",handleItemDefaults:s,fullLayout:r.fullLayout})}},{"../../lib":163,"../../plots/array_container_defaults":201,"../../plots/cartesian/axes":205,"../annotations/common_defaults":31,"./attributes":37}],40:[function(t,e,r){"use strict";var n=t("../annotations/draw").drawRaw,a=t("../../plots/gl3d/project"),i=["x","y","z"];e.exports=function(t){for(var e=t.fullSceneLayout,r=t.dataScale,o=e.annotations,l=0;l<o.length;l++){for(var s=o[l],c=!1,u=0;u<3;u++){var f=i[u],d=s[f],p=e[f+"axis"].r2fraction(d);if(p<0||p>1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+l+'"]').remove():(s._pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(s.x)*r[0],e.yaxis.r2l(s.y)*r[1],e.zaxis.r2l(s.z)*r[2]]),n(t.graphDiv,s,l,t.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":234,"../annotations/draw":34}],41:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(t),l=0;l<o.length;l++){var s=o[l];i.test(s)&&(t[s].annotations||[]).length&&(a.pushUnique(e._basePlotModules,r),a.pushUnique(e._subplots.gl3d,s))}},convert:t("./convert"),draw:t("./draw")}},{"../../lib":163,"../../registry":245,"./attributes":37,"./convert":38,"./defaults":39,"./draw":40}],42:[function(t,e,r){"use strict";r.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],r.defaultLine="#444",r.lightLine="#eee",r.background="#fff",r.borderLine="#BEC8D9",r.lightFraction=1e3/11},{}],43:[function(t,e,r){"use strict";var n=t("tinycolor2"),a=t("fast-isnumeric"),i=e.exports={},o=t("./attributes");i.defaults=o.defaults;var l=i.defaultLine=o.defaultLine;i.lightLine=o.lightLine;var s=i.background=o.background;function c(t){if(a(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var n=r[1].trim().split(/\s*[\s,]\s*/),i="a"===e.charAt(3)&&4===n.length;if(!i&&3!==n.length)return t;for(var o=0;o<n.length;o++){if(!n[o].length)return t;if(n[o]=Number(n[o]),!(n[o]>=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}i.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},i.rgb=function(t){return i.tinyRGB(n(t))},i.opacity=function(t){return t?n(t).getAlpha():0},i.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},i.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var a=n(e||s).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={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 n(o).toRgbString()},i.contrast=function(t,e,r){var a=n(t);return 1!==a.getAlpha()&&(a=n(i.combine(t,s))),(a.isDark()?e?a.lighten(e):s:r?a.darken(r):l).toString()},i.stroke=function(t,e){var r=n(e);t.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(t,e){var r=n(e);t.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(t){if(t&&"object"==typeof t){var e,r,n,a,o=Object.keys(t);for(e=0;e<o.length;e++)if(a=t[n=o[e]],"color"===n.substr(n.length-5))if(Array.isArray(a))for(r=0;r<a.length;r++)a[r]=c(a[r]);else t[n]=c(a);else if("colorscale"===n.substr(n.length-10)&&Array.isArray(a))for(r=0;r<a.length;r++)Array.isArray(a[r])&&(a[r][1]=c(a[r][1]));else if(Array.isArray(a)){var l=a[0];if(!Array.isArray(l)&&l&&"object"==typeof l)for(r=0;r<a.length;r++)i.clean(a[r])}else a&&"object"==typeof a&&i.clean(a)}}},{"./attributes":42,"fast-isnumeric":10,tinycolor2:25}],44:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/layout_attributes"),a=t("../../plots/font_attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll;e.exports=o({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:n.linecolor,outlinewidth:n.linewidth,bordercolor:n.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:n.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:i({},n.ticks,{dflt:""}),ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,tickfont:a({}),tickangle:n.tickangle,tickformat:n.tickformat,tickformatstops:n.tickformatstops,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,separatethousands:n.separatethousands,exponentformat:n.exponentformat,showexponent:n.showexponent,title:{valType:"string"},titlefont:a({}),titleside:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}},"colorbars","from-root")},{"../../lib/extend":157,"../../plot_api/edit_types":190,"../../plots/cartesian/layout_attributes":217,"../../plots/font_attributes":231}],45:[function(t,e,r){"use strict";e.exports={cn:{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"}}},{}],46:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/tick_value_defaults"),i=t("../../plots/cartesian/tick_mark_defaults"),o=t("../../plots/cartesian/tick_label_defaults"),l=t("./attributes");e.exports=function(t,e,r){var s=e.colorbar={},c=t.colorbar||{};function u(t,e){return n.coerce(c,s,l,t,e)}var f=u("thicknessmode");u("thickness","fraction"===f?30/(r.width-r.margin.l-r.margin.r):30);var d=u("lenmode");u("len","fraction"===d?1:r.height-r.margin.t-r.margin.b),u("x"),u("xanchor"),u("xpad"),u("y"),u("yanchor"),u("ypad"),n.noneOrAll(c,s,["x","y"]),u("outlinecolor"),u("outlinewidth"),u("bordercolor"),u("borderwidth"),u("bgcolor"),a(c,s,u,"linear");var p={outerTicks:!1,font:r.font};o(c,s,u,"linear",p),i(c,s,u,"linear",p),u("title",r._dfltTitle.colorbar),n.coerceFont(u,"titlefont",r.font),u("titleside")}},{"../../lib":163,"../../plots/cartesian/tick_label_defaults":224,"../../plots/cartesian/tick_mark_defaults":225,"../../plots/cartesian/tick_value_defaults":226,"./attributes":44}],47:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("../../plots/plots"),o=t("../../registry"),l=t("../../plots/cartesian/axes"),s=t("../dragelement"),c=t("../../lib"),u=t("../../lib/extend").extendFlat,f=t("../../lib/setcursor"),d=t("../drawing"),p=t("../color"),h=t("../titles"),g=t("../../lib/svg_text_utils"),v=t("../../constants/alignment").LINE_SPACING,y=t("../../plots/cartesian/axis_defaults"),m=t("../../plots/cartesian/position_defaults"),x=t("../../plots/cartesian/layout_attributes"),b=t("./attributes"),_=t("./constants").cn;e.exports=function(t,e){var r={};function w(){var b=t._fullLayout,M=b._size;if("function"==typeof r.fillcolor||"function"==typeof r.line.color){var A,T,L=n.extent(("function"==typeof r.fillcolor?r.fillcolor:r.line.color).domain()),S=[],C=[],O="function"==typeof r.line.color?r.line.color:function(){return r.line.color},P="function"==typeof r.fillcolor?r.fillcolor:function(){return r.fillcolor},z=r.levels.end+r.levels.size/100,D=r.levels.size,E=1.001*L[0]-.001*L[1],N=1.001*L[1]-.001*L[0];for(T=0;T<1e5&&(A=r.levels.start+T*D,!(D>0?A>=z:A<=z));T++)A>E&&A<N&&S.push(A);if("function"==typeof r.fillcolor)if(r.filllevels)for(z=r.filllevels.end+r.filllevels.size/100,D=r.filllevels.size,T=0;T<1e5&&(A=r.filllevels.start+T*D,!(D>0?A>=z:A<=z));T++)A>L[0]&&A<L[1]&&C.push(A);else(C=S.map(function(t){return t-r.levels.size/2})).push(C[C.length-1]+r.levels.size);else r.fillcolor&&"string"==typeof r.fillcolor&&(C=[0]);r.levels.size<0&&(S.reverse(),C.reverse());var R,I=b.height-b.margin.t-b.margin.b,F=b.width-b.margin.l-b.margin.r,j=Math.round(r.thickness*("fraction"===r.thicknessmode?F:1)),B=j/M.w,H=Math.round(r.len*("fraction"===r.lenmode?I:1)),q=H/M.h,V=r.xpad/M.w,U=(r.borderwidth+r.outlinewidth)/2,G=r.ypad/M.h,Y=Math.round(r.x*M.w+r.xpad),X=r.x-B*({middle:.5,right:1}[r.xanchor]||0),Z=r.y+q*(({top:-.5,bottom:.5}[r.yanchor]||0)-.5),W=Math.round(M.h*(1-Z)),Q=W-H,J={type:"linear",range:L,tickmode:r.tickmode,nticks:r.nticks,tick0:r.tick0,dtick:r.dtick,tickvals:r.tickvals,ticktext:r.ticktext,ticks:r.ticks,ticklen:r.ticklen,tickwidth:r.tickwidth,tickcolor:r.tickcolor,showticklabels:r.showticklabels,tickfont:r.tickfont,tickangle:r.tickangle,tickformat:r.tickformat,exponentformat:r.exponentformat,separatethousands:r.separatethousands,showexponent:r.showexponent,showtickprefix:r.showtickprefix,tickprefix:r.tickprefix,showticksuffix:r.showticksuffix,ticksuffix:r.ticksuffix,title:r.title,titlefont:r.titlefont,showline:!0,anchor:"free",position:1},$={type:"linear",_id:"y"+e},K={letter:"y",font:b.font,noHover:!0,calendar:b.calendar};if(y(J,$,ht,K,b),m(J,$,ht,K),$.position=r.x+V+B,w.axis=$,-1!==["top","bottom"].indexOf(r.titleside)&&($.titleside=r.titleside,$.titlex=r.x+V,$.titley=Z+("top"===r.titleside?q-G:G)),r.line.color&&"auto"===r.tickmode){$.tickmode="linear",$.tick0=r.levels.start;var tt=r.levels.size,et=c.constrain((W-Q)/50,4,15)+1,rt=(L[1]-L[0])/((r.nticks||et)*tt);if(rt>1){var nt=Math.pow(10,Math.floor(Math.log(rt)/Math.LN10));tt*=nt*c.roundUp(rt/nt,[2,5,10]),(Math.abs(r.levels.start)/r.levels.size+1e-6)%1<2e-6&&($.tick0=0)}$.dtick=tt}$.domain=[Z+G,Z+q-G],$.setScale();var at=c.ensureSingle(b._infolayer,"g",e,function(t){t.classed(_.colorbar,!0).each(function(){var t=n.select(this);t.append("rect").classed(_.cbbg,!0),t.append("g").classed(_.cbfills,!0),t.append("g").classed(_.cblines,!0),t.append("g").classed(_.cbaxis,!0).classed(_.crisp,!0),t.append("g").classed(_.cbtitleunshift,!0).append("g").classed(_.cbtitle,!0),t.append("rect").classed(_.cboutline,!0),t.select(".cbtitle").datum(0)})});at.attr("transform","translate("+Math.round(M.l)+","+Math.round(M.t)+")");var it=at.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(M.l)+",-"+Math.round(M.t)+")");$._axislayer=at.select(".cbaxis");var ot=0;if(-1!==["top","bottom"].indexOf(r.titleside)){var lt,st=M.l+(r.x+V)*M.w,ct=$.titlefont.size;lt="top"===r.titleside?(1-(Z+q-G))*M.h+M.t+3+.75*ct:(1-(Z+G))*M.h+M.t-3-.25*ct,gt($._id+"title",{attributes:{x:st,y:lt,"text-anchor":"start"}})}var ut,ft,dt,pt=c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(r.titleside)){var e=at.select(".cbtitle"),i=e.select("text"),o=[-r.outlinewidth/2,r.outlinewidth/2],s=e.select(".h"+$._id+"title-math-group").node(),u=15.6;if(i.node()&&(u=parseInt(i.node().style.fontSize,10)*v),s?(ot=d.bBox(s).height)>u&&(o[1]-=(ot-u)/2):i.node()&&!i.classed(_.jsPlaceholder)&&(ot=d.bBox(i.node()).height),ot){if(ot+=5,"top"===r.titleside)$.domain[1]-=ot/M.h,o[1]*=-1;else{$.domain[0]+=ot/M.h;var f=g.lineCount(i);o[1]+=(1-f)*u}e.attr("transform","translate("+o+")"),$.setScale()}}at.selectAll(".cbfills,.cblines").attr("transform","translate(0,"+Math.round(M.h*(1-$.domain[1]))+")"),$._axislayer.attr("transform","translate(0,"+Math.round(-M.t)+")");var p=at.select(".cbfills").selectAll("rect.cbfill").data(C);p.enter().append("rect").classed(_.cbfill,!0).style("stroke","none"),p.exit().remove(),p.each(function(t,e){var r=[0===e?L[0]:(C[e]+C[e-1])/2,e===C.length-1?L[1]:(C[e]+C[e+1])/2].map($.c2p).map(Math.round);e!==C.length-1&&(r[1]+=r[1]>r[0]?1:-1);var i=P(t).replace("e-",""),o=a(i).toHexString();n.select(this).attr({x:Y,width:Math.max(j,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:o})});var h=at.select(".cblines").selectAll("path.cbline").data(r.line.color&&r.line.width?S:[]);return h.enter().append("path").classed(_.cbline,!0),h.exit().remove(),h.each(function(t){n.select(this).attr("d","M"+Y+","+(Math.round($.c2p(t))+r.line.width/2%1)+"h"+j).call(d.lineGroupStyle,r.line.width,O(t),r.line.dash)}),$._axislayer.selectAll("g."+$._id+"tick,path").remove(),$._pos=Y+j+(r.outlinewidth||0)/2-("outside"===r.ticks?1:0),$.side="right",c.syncOrAsync([function(){return l.doTicksSingle(t,$,!0)},function(){if(-1===["top","bottom"].indexOf(r.titleside)){var e=$.titlefont.size,a=$._offset+$._length/2,i=M.l+($.position||0)*M.w+("right"===$.side?10+e*($.showticklabels?1:.5):-10-e*($.showticklabels?.5:0));gt("h"+$._id+"title",{avoid:{selection:n.select(t).selectAll("g."+$._id+"tick"),side:r.titleside,offsetLeft:M.l,offsetTop:0,maxShift:b.width},attributes:{x:i,y:a,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])},i.previousPromises,function(){var n=j+r.outlinewidth/2+d.bBox($._axislayer.node()).width;if((R=it.select("text")).node()&&!R.classed(_.jsPlaceholder)){var a,o=it.select(".h"+$._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(r.titleside)?d.bBox(o).width:d.bBox(it.node()).right-Y-M.l,n=Math.max(n,a)}var l=2*r.xpad+n+r.borderwidth+r.outlinewidth/2,s=W-Q;at.select(".cbbg").attr({x:Y-r.xpad-(r.borderwidth+r.outlinewidth)/2,y:Q-U,width:Math.max(l,2),height:Math.max(s+2*U,2)}).call(p.fill,r.bgcolor).call(p.stroke,r.bordercolor).style({"stroke-width":r.borderwidth}),at.selectAll(".cboutline").attr({x:Y,y:Q+r.ypad+("top"===r.titleside?ot:0),width:Math.max(j,2),height:Math.max(s-2*r.ypad-ot,2)}).call(p.stroke,r.outlinecolor).style({fill:"None","stroke-width":r.outlinewidth});var c=({center:.5,right:1}[r.xanchor]||0)*l;at.attr("transform","translate("+(M.l-c)+","+M.t+")"),i.autoMargin(t,e,{x:r.x,y:r.y,l:l*({right:1,center:.5}[r.xanchor]||0),r:l*({left:1,center:.5}[r.xanchor]||0),t:s*({bottom:1,middle:.5}[r.yanchor]||0),b:s*({top:1,middle:.5}[r.yanchor]||0)})}],t);if(pt&&pt.then&&(t._promises||[]).push(pt),t._context.edits.colorbarPosition)s.init({element:at.node(),gd:t,prepFn:function(){ut=at.attr("transform"),f(at)},moveFn:function(t,e){at.attr("transform",ut+" translate("+t+","+e+")"),ft=s.align(X+t/M.w,B,0,1,r.xanchor),dt=s.align(Z-e/M.h,q,0,1,r.yanchor);var n=s.getCursor(ft,dt,r.xanchor,r.yanchor);f(at,n)},doneFn:function(){f(at),void 0!==ft&&void 0!==dt&&o.call("restyle",t,{"colorbar.x":ft,"colorbar.y":dt},k().index)}});return pt}function ht(t,e){return c.coerce(J,$,x,t,e)}function gt(e,r){var n,a=k();n=o.traceIs(a,"markerColorscale")?"marker.colorbar.title":"colorbar.title";var i={propContainer:$,propName:n,traceIndex:a.index,placeholder:b._dfltTitle.colorbar,containerGroup:at.select(".cbtitle")},l="h"===e.charAt(0)?e.substr(1):"h"+e;at.selectAll("."+l+",."+l+"-math-group").remove(),h.draw(t,e,u(i,r||{}))}b._infolayer.selectAll("g."+e).remove()}function k(){var r,n,a=e.substr(2);for(r=0;r<t._fullData.length;r++)if((n=t._fullData[r]).uid===a)return n}return Object.keys(b).forEach(function(t){r[t]=null}),r.fillcolor=null,r.line={color:null,width:null,dash:null},r.levels={start:null,end:null,size:null},r.filllevels=null,Object.keys(r).forEach(function(t){w[t]=function(e){return arguments.length?(r[t]=c.isPlainObject(r[t])?c.extendFlat(r[t],e):e,w):r[t]}}),w.options=function(t){return Object.keys(t).forEach(function(e){"function"==typeof w[e]&&w[e](t[e])}),w},w._opts=r,w}},{"../../constants/alignment":143,"../../lib":163,"../../lib/extend":157,"../../lib/setcursor":182,"../../lib/svg_text_utils":184,"../../plots/cartesian/axes":205,"../../plots/cartesian/axis_defaults":207,"../../plots/cartesian/layout_attributes":217,"../../plots/cartesian/position_defaults":220,"../../plots/plots":237,"../../registry":245,"../color":43,"../dragelement":65,"../drawing":68,"../titles":136,"./attributes":44,"./constants":45,d3:7,tinycolor2:25}],48:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":163}],49:[function(t,e,r){"use strict";e.exports={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"}}},{}],50:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./scales"),i=t("./flip_scale");e.exports=function(t,e,r,o){var l=t,s=t._input,c=t._fullInput,u=t.updateStyle;function f(e,n,a){void 0===a&&(a=n),u?u(t._input,r?r+"."+e:e,n):s[e]=n,l[e]=a,c&&t!==t._fullInput&&(u?u(t._fullInput,r?r+"."+e:e,a):c[e]=a)}r&&(l=n.nestedProperty(l,r).get(),s=n.nestedProperty(s,r).get(),c=n.nestedProperty(c,r).get()||{});var d=o+"auto",p=o+"min",h=o+"max",g=l[d],v=l[p],y=l[h],m=l.colorscale;!1===g&&void 0!==v||(v=n.aggNums(Math.min,null,e)),!1===g&&void 0!==y||(y=n.aggNums(Math.max,null,e)),v===y&&(v-=.5,y+=.5),f(p,v),f(h,y),f(d,!1!==g||void 0===v&&void 0===y),l.autocolorscale&&(f("colorscale",m=v*y<0?a.RdBu:v>=0?a.Reds:a.Blues,l.reversescale?i(m):m),s.autocolorscale||f("autocolorscale",!1))}},{"../../lib":163,"./flip_scale":55,"./scales":62}],51:[function(t,e,r){"use strict";var n=t("./attributes"),a=t("../../lib/extend").extendFlat;t("./scales.js");e.exports=function(t,e,r){return{color:{valType:"color",arrayOk:!0,editType:e||"style"},colorscale:a({},n.colorscale,{}),cauto:a({},n.zauto,{impliedEdits:{cmin:void 0,cmax:void 0}}),cmax:a({},n.zmax,{editType:e||n.zmax.editType,impliedEdits:{cauto:!1}}),cmin:a({},n.zmin,{editType:e||n.zmin.editType,impliedEdits:{cauto:!1}}),autocolorscale:a({},n.autocolorscale,{dflt:!1===r?r:n.autocolorscale.dflt}),reversescale:a({},n.reversescale,{})}}},{"../../lib/extend":157,"./attributes":49,"./scales.js":62}],52:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":62}],53:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),l=t("./is_valid_scale"),s=t("./flip_scale");e.exports=function(t,e,r,c,u){var f,d=u.prefix,p=u.cLetter,h=d.slice(0,d.length-1),g=d?a.nestedProperty(t,h).get()||{}:t,v=d?a.nestedProperty(e,h).get()||{}:e,y=g[p+"min"],m=g[p+"max"],x=g.colorscale;c(d+p+"auto",!(n(y)&&n(m)&&y<m)),c(d+p+"min"),c(d+p+"max"),void 0!==x&&(f=!l(x)),c(d+"autocolorscale",f);var b,_=c(d+"colorscale");(c(d+"reversescale")&&(v.colorscale=s(_)),"marker.line."!==d)&&(d&&(b=i(g)),c(d+"showscale",b)&&o(g,v,r))}},{"../../lib":163,"../colorbar/defaults":46,"../colorbar/has_colorbar":48,"./flip_scale":55,"./is_valid_scale":59,"fast-isnumeric":10}],54:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n=t.length,a=new Array(n),i=new Array(n),o=0;o<n;o++){var l=t[o];a[o]=e+l[0]*(r-e),i[o]=l[1]}return{domain:a,range:i}}},{}],55:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=new Array(r),a=r-1,i=0;a>=0;a--,i++)e=t[a],n[i]=[1-e[0],e[1]];return n}},{}],56:[function(t,e,r){"use strict";var n=t("./scales"),a=t("./default_scale"),i=t("./is_valid_scale_array");e.exports=function(t,e){if(e||(e=a),!t)return e;function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return"string"==typeof t&&(r(),"string"==typeof t&&r()),i(t)?t:e}},{"./default_scale":52,"./is_valid_scale_array":60,"./scales":62}],57:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("./is_valid_scale");e.exports=function(t,e){var r=e?a.nestedProperty(t,e).get()||{}:t,o=r.color,l=!1;if(a.isArrayOrTypedArray(o))for(var s=0;s<o.length;s++)if(n(o[s])){l=!0;break}return a.isPlainObject(r)&&(l||!0===r.showscale||n(r.cmin)&&n(r.cmax)||i(r.colorscale)||a.isPlainObject(r.colorbar))}},{"../../lib":163,"./is_valid_scale":59,"fast-isnumeric":10}],58:[function(t,e,r){"use strict";r.scales=t("./scales"),r.defaultScale=t("./default_scale"),r.attributes=t("./attributes"),r.handleDefaults=t("./defaults"),r.calc=t("./calc"),r.hasColorscale=t("./has_colorscale"),r.isValidScale=t("./is_valid_scale"),r.getScale=t("./get_scale"),r.flipScale=t("./flip_scale"),r.extractScale=t("./extract_scale"),r.makeColorScaleFunc=t("./make_color_scale_func")},{"./attributes":49,"./calc":50,"./default_scale":52,"./defaults":53,"./extract_scale":54,"./flip_scale":55,"./get_scale":56,"./has_colorscale":57,"./is_valid_scale":59,"./make_color_scale_func":61,"./scales":62}],59:[function(t,e,r){"use strict";var n=t("./scales"),a=t("./is_valid_scale_array");e.exports=function(t){return void 0!==n[t]||a(t)}},{"./is_valid_scale_array":60,"./scales":62}],60:[function(t,e,r){"use strict";var n=t("tinycolor2");e.exports=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 a=t[r];if(2!==a.length||+a[0]<e||!n(a[1]).isValid())return!1;e=+a[0]}return!0}},{tinycolor2:25}],61:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("fast-isnumeric"),o=t("../color");function l(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return a(e).toRgbString()}e.exports=function(t,e){e=e||{};for(var r=t.domain,s=t.range,c=s.length,u=new Array(c),f=0;f<c;f++){var d=a(s[f]).toRgb();u[f]=[d.r,d.g,d.b,d.a]}var p,h=n.scale.linear().domain(r).range(u).clamp(!0),g=e.noNumericCheck,v=e.returnArray;return(p=g&&v?h:g?function(t){return l(h(t))}:v?function(t){return i(t)?h(t):a(t).isValid()?t:o.defaultLine}:function(t){return i(t)?l(h(t)):a(t).isValid()?t:o.defaultLine}).domain=h.domain,p.range=function(){return s},p}},{"../color":43,d3:7,"fast-isnumeric":10,tinycolor2:25}],62:[function(t,e,r){"use strict";e.exports={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)"]]}},{}],63:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,a){var i=(t-r)/(n-r),o=i+e/(n-r),l=(i+o)/2;return"left"===a||"bottom"===a?i:"center"===a||"middle"===a?l:"right"===a||"top"===a?o:i<2/3-l?i:o>4/3-l?o:l}},{}],64:[function(t,e,r){"use strict";var n=t("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,i){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":163}],65:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),a=t("has-hover"),i=t("has-passive-events"),o=t("../../registry"),l=t("../../lib"),s=t("../../plots/cartesian/constants"),c=t("../../constants/interactions"),u=e.exports={};u.align=t("./align"),u.getCursor=t("./cursor");var f=t("./unhover");function d(){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 p(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}u.unhover=f.wrapped,u.unhoverRaw=f.raw,u.init=function(t){var e,r,n,f,h,g,v,y,m=t.gd,x=1,b=c.DBLCLICKDELAY,_=t.element;m._mouseDownTime||(m._mouseDownTime=0),_.style.pointerEvents="all",_.onmousedown=k,i?(_._ontouchstart&&_.removeEventListener("touchstart",_._ontouchstart),_._ontouchstart=k,_.addEventListener("touchstart",k,{passive:!1})):_.ontouchstart=k;var w=t.clampFn||function(t,e,r){return Math.abs(t)<r&&(t=0),Math.abs(e)<r&&(e=0),[t,e]};function k(i){i.preventDefault(),m._dragged=!1,m._dragging=!0;var o=p(i);e=o[0],r=o[1],v=i.target,g=i,y=2===i.buttons||i.ctrlKey,(n=(new Date).getTime())-m._mouseDownTime<b?x+=1:(x=1,m._mouseDownTime=n),t.prepFn&&t.prepFn(i,e,r),a&&!y?(h=d()).style.cursor=window.getComputedStyle(_).cursor:a||(h=document,f=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(_).cursor),document.addEventListener("mousemove",M),document.addEventListener("mouseup",A),document.addEventListener("touchmove",M),document.addEventListener("touchend",A)}function M(n){n.preventDefault();var a=p(n),i=t.minDrag||s.MINDRAG,o=w(a[0]-e,a[1]-r,i),l=o[0],c=o[1];(l||c)&&(m._dragged=!0,u.unhover(m)),m._dragged&&t.moveFn&&!y&&t.moveFn(l,c)}function A(e){if(document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",A),document.removeEventListener("touchmove",M),document.removeEventListener("touchend",A),e.preventDefault(),a?l.removeElement(h):f&&(h.documentElement.style.cursor=f,f=null),m._dragging){if(m._dragging=!1,(new Date).getTime()-m._mouseDownTime>b&&(x=Math.max(x-1,1)),m._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(x,g),!y){var r;try{r=new MouseEvent("click",e)}catch(t){var n=p(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}v.dispatchEvent(r)}!function(t){t._dragging=!1,t._replotPending&&o.call("plot",t)}(m),m._dragged=!1}else m._dragged=!1}},u.coverSlip=d},{"../../constants/interactions":144,"../../lib":163,"../../plots/cartesian/constants":210,"../../registry":245,"./align":63,"./cursor":64,"./unhover":66,"has-hover":12,"has-passive-events":13,"mouse-event-offset":15}],66:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=t("../../lib/throttle"),i=t("../../lib/get_graph_div"),o=t("../fx/constants"),l=e.exports={};l.wrapped=function(t,e,r){(t=i(t))._fullLayout&&a.clear(t._fullLayout._uid+o.HOVERID),l.raw(t,e,r)},l.raw=function(t,e){var r=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/events":156,"../../lib/get_graph_div":161,"../../lib/throttle":185,"../fx/constants":80}],67:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],68:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("tinycolor2"),o=t("../../registry"),l=t("../color"),s=t("../colorscale"),c=t("../../lib"),u=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),d=t("../../constants/alignment").LINE_SPACING,p=t("../../constants/interactions").DESELECTDIM,h=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),v=e.exports={};v.font=function(t,e,r,n){c.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(l.fill,n)},v.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},v.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},v.setRect=function(t,e,r,n,a){t.call(v.setPosition,e,r).call(v.setSize,n,a)},v.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),o=n.c2p(t.y);return!!(a(i)&&a(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",o):e.attr("transform","translate("+i+","+o+")"),!0)},v.translatePoints=function(t,e,r){t.each(function(t){var a=n.select(this);v.translatePoint(t,a,e,r)})},v.hideOutsideRangePoint=function(t,e,r,n,a,i){e.attr("display",r.isPtWithinRange(t,a)&&n.isPtWithinRange(t,i)?null:"none")},v.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each(function(e){var i=e[0].trace,o=i.xcalendar,l=i.ycalendar,s="bar"===i.type?".bartext":".point,.textpoint";t.selectAll(s).each(function(t){v.hideOutsideRangePoint(t,n.select(this),r,a,o,l)})})}},v.crispRound=function(t,e,r){return e&&a(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},v.singleLineStyle=function(t,e,r,n,a){e.style("fill","none");var i=(((t||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";l.stroke(e,n||i.color),v.dashLine(e,s,o)},v.lineGroupStyle=function(t,e,r,a){t.style("fill","none").each(function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,s=a||i.dash||"";n.select(this).call(l.stroke,r||i.color).call(v.dashLine,s,o)})},v.dashLine=function(t,e,r){r=+r||0,e=v.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},v.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},v.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(l.fill,e)},v.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=n.select(this);try{r.call(l.fill,e[0].trace.fillcolor)}catch(e){c.error(e,t),r.remove()}})};var y=t("./symbol_defs");v.symbolNames=[],v.symbolFuncs=[],v.symbolNeedLines={},v.symbolNoDot={},v.symbolNoFill={},v.symbolList=[],Object.keys(y).forEach(function(t){var e=y[t];v.symbolList=v.symbolList.concat([e.n,t,e.n+100,t+"-open"]),v.symbolNames[e.n]=t,v.symbolFuncs[e.n]=e.f,e.needLine&&(v.symbolNeedLines[e.n]=!0),e.noDot?v.symbolNoDot[e.n]=!0:v.symbolList=v.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"]),e.noFill&&(v.symbolNoFill[e.n]=!0)});var m=v.symbolNames.length,x="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";function b(t,e){var r=t%100;return v.symbolFuncs[r](e)+(t>=200?x:"")}v.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=v.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=m||t>=400?0:Math.floor(Math.max(t,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0};v.gradient=function(t,e,r,a,o,s){var u=e._fullLayout._defs.select(".gradients").selectAll("#"+r).data([a+o+s],c.identity);u.exit().remove(),u.enter().append("radial"===a?"radialGradient":"linearGradient").each(function(){var t=n.select(this);"horizontal"===a?t.attr(_):"vertical"===a&&t.attr(w),t.attr("id",r);var e=i(o),c=i(s);t.append("stop").attr({offset:"0%","stop-color":l.tinyRGB(c),"stop-opacity":c.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":l.tinyRGB(e),"stop-opacity":e.getAlpha()})}),t.style({fill:"url(#"+r+")","fill-opacity":null})},v.initGradients=function(t){c.ensureSingle(t._fullLayout._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove()},v.pointStyle=function(t,e,r){if(t.size()){var a=v.makePointStyleFns(e);t.each(function(t){v.singlePointStyle(t,n.select(this),e,a,r)})}},v.singlePointStyle=function(t,e,r,n,a){var i=r.marker,o=i.line;if(e.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(t):void 0===t.mo?i.opacity:t.mo),n.ms2mrc){var s;s="various"===t.ms||"various"===i.size?3:n.ms2mrc(t.ms),t.mrc=s,n.selectedSizeFn&&(s=t.mrc=n.selectedSizeFn(t));var u=v.symbolNumber(t.mx||i.symbol)||0;t.om=u%200>=100,e.attr("d",b(u,s))}var f,d,p,h=!1;if(t.so?(p=o.outlierwidth,d=o.outliercolor,f=i.outliercolor):(p=(t.mlw+1||o.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,d="mlc"in t?t.mlcc=n.lineScale(t.mlc):c.isArrayOrTypedArray(o.color)?l.defaultLine:o.color,c.isArrayOrTypedArray(i.color)&&(f=l.defaultLine,h=!0),f="mc"in t?t.mcc=n.markerScale(t.mc):i.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(t))),t.om)e.call(l.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",p+"px");var g=i.gradient,y=t.mgt;if(y?h=!0:y=g&&g.type,y&&"none"!==y){var m=t.mgc;m?h=!0:m=g.color;var x="g"+a._fullLayout._uid+"-"+r.uid;h&&(x+="-"+t.i),e.call(v.gradient,a,x,y,f,m)}else e.call(l.fill,f);p&&e.call(l.stroke,d)}},v.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=v.tryColorscale(r,""),e.lineScale=v.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=h.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&c.extendFlat(e,v.makeSelectedPointStyleFns(t)),e},v.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},i=r.marker||{},l=n.marker||{},s=a.opacity,u=i.opacity,f=l.opacity,d=void 0!==u,h=void 0!==f;(c.isArrayOrTypedArray(s)||d||h)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?d?u:e:h?f:p*e});var g=a.color,v=i.color,y=l.color;(v||y)&&(e.selectedColorFn=function(t){var e=t.mcc||g;return t.selected?v||e:y||e});var m=a.size,x=i.size,b=l.size,_=void 0!==x,w=void 0!==b;return o.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||m/2;return t.selected?_?x/2:e:w?b/2:e}),e},v.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,c=i.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?c||e:u||(c?e:l.addOpacity(e,p))},e},v.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=v.makeSelectedPointStyleFns(e),a=e.marker||{},i=[];r.selectedOpacityFn&&i.push(function(t,e){t.style("opacity",r.selectedOpacityFn(e))}),r.selectedColorFn&&i.push(function(t,e){l.fill(t,r.selectedColorFn(e))}),r.selectedSizeFn&&i.push(function(t,e){var n=e.mx||a.symbol||0,i=r.selectedSizeFn(e);t.attr("d",b(v.symbolNumber(n),i)),e.mrc2=i}),i.length&&t.each(function(t){for(var e=n.select(this),r=0;r<i.length;r++)i[r](e,t)})}},v.tryColorscale=function(t,e){var r=e?c.nestedProperty(t,e).get():t,n=r.colorscale,a=r.color;return n&&c.isArrayOrTypedArray(a)?s.makeColorScaleFunc(s.extractScale(n,r.cmin,r.cmax)):c.identity};var k={start:1,end:-1,middle:0,bottom:1,top:-1};function M(t,e,r,a){var i=n.select(t.node().parentNode),o=-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle",l=-1!==e.indexOf("left")?"end":-1!==e.indexOf("right")?"start":"middle",s=a?a/.8+1:0,c=(u.lineCount(t)-1)*d+1,f=k[l]*s,p=.75*r+k[o]*s+(k[o]-1)*c*r/2;t.attr("text-anchor",l),i.attr("transform","translate("+f+","+p+")")}function A(t,e){var r=t.ts||e.textfont.size;return a(r)&&r>0?r:0}v.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var i=v.makeSelectedTextStyleFns(e);a=i.selectedTextColorFn}t.each(function(t){var i=n.select(this),o=c.extractOption(t,e,"tx","text");if(o||0===o){var l=t.tp||e.textposition,s=A(t,e),f=a?a(t):t.tc||e.textfont.color;i.call(v.font,t.tf||e.textfont.family,s,f).text(o).call(u.convertToTspans,r).call(M,l,s,t.mrc)}else i.remove()})}},v.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=v.makeSelectedTextStyleFns(e);t.each(function(t){var a=n.select(this),i=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=A(t,e);l.fill(a,i),M(a,o,s,t.mrc2||t.mrc)})}};var T=.5;function L(t,e,r,a){var i=t[0]-e[0],o=t[1]-e[1],l=r[0]-e[0],s=r[1]-e[1],c=Math.pow(i*i+o*o,T/2),u=Math.pow(l*l+s*s,T/2),f=(u*u*i-c*c*l)*a,d=(u*u*o-c*c*s)*a,p=3*u*(c+u),h=3*c*(c+u);return[[n.round(e[0]+(p&&f/p),2),n.round(e[1]+(p&&d/p),2)],[n.round(e[0]-(h&&f/h),2),n.round(e[1]-(h&&d/h),2)]]}v.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],a=[];for(r=1;r<t.length-1;r++)a.push(L(t[r-1],t[r],t[r+1],e));for(n+="Q"+a[0][0]+" "+t[1],r=2;r<t.length-1;r++)n+="C"+a[r-2][1]+" "+a[r-1][0]+" "+t[r];return n+="Q"+a[t.length-3][1]+" "+t[t.length-1]},v.smoothclosed=function(t,e){if(t.length<3)return"M"+t.join("L")+"Z";var r,n="M"+t[0],a=t.length-1,i=[L(t[a],t[0],t[1],e)];for(r=1;r<a;r++)i.push(L(t[r-1],t[r],t[r+1],e));for(i.push(L(t[a-1],t[a],t[0],e)),r=1;r<=a;r++)n+="C"+i[r-1][1]+" "+i[r][0]+" "+t[r];return n+="C"+i[a][1]+" "+i[0][0]+" "+t[0]+"Z"};var S={hv:function(t,e){return"H"+n.round(e[0],2)+"V"+n.round(e[1],2)},vh:function(t,e){return"V"+n.round(e[1],2)+"H"+n.round(e[0],2)},hvh:function(t,e){return"H"+n.round((t[0]+e[0])/2,2)+"V"+n.round(e[1],2)+"H"+n.round(e[0],2)},vhv:function(t,e){return"V"+n.round((t[1]+e[1])/2,2)+"H"+n.round(e[0],2)+"V"+n.round(e[1],2)}},C=function(t,e){return"L"+n.round(e[0],2)+","+n.round(e[1],2)};v.steps=function(t){var e=S[t]||C;return function(t){for(var r="M"+n.round(t[0][0],2)+","+n.round(t[0][1],2),a=1;a<t.length;a++)r+=e(t[a-1],t[a]);return r}},v.makeTester=function(){var t=c.ensureSingleById(n.select("body"),"svg","js-plotly-tester",function(t){t.attr(f.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),e=c.ensureSingle(t,"path","js-reference-point",function(t){t.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});v.tester=t,v.testref=e},v.savedBBoxes={};var O=0;function P(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}v.bBox=function(t,e,r){var a,i,o;if(r||(r=P(t)),r){if(a=v.savedBBoxes[r])return c.extendFlat({},a)}else if(1===t.childNodes.length){var l=t.childNodes[0];if(r=P(l)){var s=+l.getAttribute("x")||0,f=+l.getAttribute("y")||0,d=l.getAttribute("transform");if(!d){var p=v.bBox(l,!1,r);return s&&(p.left+=s,p.right+=s),f&&(p.top+=f,p.bottom+=f),p}if(r+="~"+s+"~"+f+"~"+d,a=v.savedBBoxes[r])return c.extendFlat({},a)}}e?i=t:(o=v.tester.node(),i=t.cloneNode(!0),o.appendChild(i)),n.select(i).attr("transform",null).call(u.positionText,0,0);var h=i.getBoundingClientRect(),g=v.testref.node().getBoundingClientRect();e||o.removeChild(i);var y={height:h.height,width:h.width,left:h.left-g.left,top:h.top-g.top,right:h.right-g.left,bottom:h.bottom-g.top};return O>=1e4&&(v.savedBBoxes={},O=0),r&&(v.savedBBoxes[r]=y),O++,c.extendFlat({},y)},v.setClipUrl=function(t,e){if(e){if(void 0===v.baseUrl){var r=n.select("base");r.size()&&r.attr("href")?v.baseUrl=window.location.href.split("#")[0]:v.baseUrl=""}t.attr("clip-path","url("+v.baseUrl+"#"+e+")")}else t.attr("clip-path",null)},v.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}},v.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=" translate("+e+", "+r+")").trim(),t[a]("transform",i),i},v.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}},v.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+=" scale("+e+", "+r+")").trim(),t[a]("transform",i),i};var z=/\s*sc.*/;v.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":" scale("+e+","+r+")";t.each(function(){var t=(this.getAttribute("transform")||"").replace(z,"");t=(t+=n).trim(),this.setAttribute("transform",t)})}};var D=/translate\([^)]*\)\s*$/;v.setTextPointsScale=function(t,e,r){t&&t.each(function(){var t,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(D);t=1===e&&1===r?[]:["translate("+o+","+l+")","scale("+e+","+r+")","translate("+-o+","+-l+")"],s&&t.push(s),a.attr("transform",t.join(" "))}})}},{"../../constants/alignment":143,"../../constants/interactions":144,"../../constants/xmlns_namespaces":147,"../../lib":163,"../../lib/svg_text_utils":184,"../../registry":245,"../../traces/scatter/make_bubble_size_func":298,"../../traces/scatter/subtypes":303,"../color":43,"../colorscale":58,"./symbol_defs":69,d3:7,"fast-isnumeric":10,tinycolor2:25}],69:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,a="l"+e+",-"+e,i="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),a=n.round(-t,2),i=n.round(-.309*t,2);return"M"+e+","+i+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+e+"L-"+a+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+e+",0L"+r+",-"+a+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),a=n.round(.951*e,2),i=n.round(.363*e,2),o=n.round(.588*e,2),l=n.round(-e,2),s=n.round(-.309*e,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*e,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),a=n.round(.76*t,2);return"M-"+a+",0l-"+r+",-"+e+"h"+a+"l"+r+",-"+e+"l"+r+","+e+"h"+a+"l-"+r+","+e+"l"+r+","+e+"h-"+a+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+a+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+a+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+a+"-"+e+","+e+a+e+","+e+a+e+",-"+e+a+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+a+"0,"+e+a+e+",0"+a+"0,-"+e+a+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0,noFill:!0}}},{d3:7}],70:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],71:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../plots/cartesian/axes"),o=t("./compute_error");function l(t,e,r,a){var l=e["error_"+a]||{},s=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=o(l),u=0;u<t.length;u++){var f=t[u],d=f[a];if(n(r.c2l(d))){var p=c(d,u);if(n(p[0])&&n(p[1])){var h=f[a+"s"]=d-p[0],g=f[a+"h"]=d+p[1];s.push(h,g)}}}i.expand(r,s,{padded:!0})}}e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var n=e[r],o=n[0].trace;if(a.traceIs(o,"errorBarsOK")){var s=i.getFromId(t,o.xaxis),c=i.getFromId(t,o.yaxis);l(n,o,s,"x"),l(n,o,c,"y")}}}},{"../../plots/cartesian/axes":205,"../../registry":245,"./compute_error":72,"fast-isnumeric":10}],72:[function(t,e,r){"use strict";function n(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}e.exports=function(t){var e=t.type,r=t.symmetric;if("data"===e){var a=t.array||[];if(r)return function(t,e){var r=+a[e];return[r,r]};var i=t.arrayminus||[];return function(t,e){var r=+a[e],n=+i[e];return isNaN(r)&&isNaN(n)?[NaN,NaN]:[n||0,r||0]}}var o=n(e,t.value),l=n(e,t.valueminus);return r||void 0===t.valueminus?function(t){var e=o(t);return[e,e]}:function(t){return[l(t),o(t)]}}},{}],73:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../lib"),o=t("./attributes");e.exports=function(t,e,r,l){var s="error_"+l.axis,c=e[s]={},u=t[s]||{};function f(t,e){return i.coerce(u,c,o,t,e)}if(!1!==f("visible",void 0!==u.array||void 0!==u.value||"sqrt"===u.type)){var d=f("type","array"in u?"data":"percent"),p=!0;"sqrt"!==d&&(p=f("symmetric",!(("data"===d?"arrayminus":"valueminus")in u))),"data"===d?(f("array"),f("traceref"),p||(f("arrayminus"),f("tracerefminus"))):"percent"!==d&&"constant"!==d||(f("value"),p||f("valueminus"));var h="copy_"+l.inherit+"style";if(l.inherit)(e["error_"+l.inherit]||{}).visible&&f(h,!(u.color||n(u.thickness)||n(u.width)));l.inherit&&c[h]||(f("color",r),f("thickness"),f("width",a.traceIs(e,"gl3d")?0:4))}}},{"../../lib":163,"../../registry":245,"./attributes":70,"fast-isnumeric":10}],74:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plot_api/edit_types").overrideAll,i=t("./attributes"),o={error_x:n.extendFlat({},i),error_y:n.extendFlat({},i)};delete o.error_x.copy_zstyle,delete o.error_y.copy_zstyle,delete o.error_y.copy_ystyle;var l={error_x:n.extendFlat({},i),error_y:n.extendFlat({},i),error_z:n.extendFlat({},i)};delete l.error_x.copy_ystyle,delete l.error_y.copy_ystyle,delete l.error_z.copy_ystyle,delete l.error_z.copy_zstyle,e.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:o,bar:o,histogram:o,scatter3d:a(l,"calc","nested"),scattergl:a(o,"calc","nested")}},supplyDefaults:t("./defaults"),calc:t("./calc"),makeComputeError:t("./compute_error"),plot:t("./plot"),style:t("./style"),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))}}},{"../../lib":163,"../../plot_api/edit_types":190,"./attributes":70,"./calc":71,"./compute_error":72,"./defaults":73,"./plot":75,"./style":76}],75:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../drawing"),o=t("../../traces/scatter/subtypes");e.exports=function(t,e,r){var l=e.xaxis,s=e.yaxis,c=r&&r.duration>0;t.each(function(t){var u,f=t[0].trace,d=f.error_x||{},p=f.error_y||{};f.ids&&(u=function(t){return t.id});var h=o.hasMarkers(f)&&f.marker.maxdisplayed>0;p.visible||d.visible||(t=[]);var g=n.select(this).selectAll("g.errorbar").data(t,u);if(g.exit().remove(),t.length){d.visible||g.selectAll("path.xerror").remove(),p.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var v=g.enter().append("g").classed("errorbar",!0);c&&v.style("opacity",0).transition().duration(r.duration).style("opacity",1),i.setClipUrl(g,e.layerClipId),g.each(function(t){var e=n.select(this),i=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0)));void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),a(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,s);if(!h||t.vis){var o,u=e.select("path.yerror");if(p.visible&&a(i.x)&&a(i.yh)&&a(i.ys)){var f=p.width;o="M"+(i.x-f)+","+i.yh+"h"+2*f+"m-"+f+",0V"+i.ys,i.noYS||(o+="m-"+f+",0h"+2*f),!u.size()?u=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(u=u.transition().duration(r.duration).ease(r.easing)),u.attr("d",o)}else u.remove();var g=e.select("path.xerror");if(d.visible&&a(i.y)&&a(i.xh)&&a(i.xs)){var v=(d.copy_ystyle?p:d).width;o="M"+i.xh+","+(i.y-v)+"v"+2*v+"m0,-"+v+"H"+i.xs,i.noXS||(o+="m0,-"+v+"v"+2*v),!g.size()?g=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(g=g.transition().duration(r.duration).ease(r.easing)),g.attr("d",o)}else g.remove()}})}})}},{"../../traces/scatter/subtypes":303,"../drawing":68,d3:7,"fast-isnumeric":10}],76:[function(t,e,r){"use strict";var n=t("d3"),a=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},i=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)})}},{"../color":43,d3:7}],77:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0,editType:"none"},bordercolor:{valType:"color",arrayOk:!0,editType:"none"},font:n({arrayOk:!0,editType:"none"}),namelength:{valType:"integer",min:-1,arrayOk:!0,editType:"none"},editType:"calc"}}},{"../../plots/font_attributes":231}],78:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry");function i(t,e,r,a){a=a||n.identity,Array.isArray(t)&&(e[0][r]=a(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var l=0;l<e.length;l++){var s=e[l],c=s[0].trace;if(!a.traceIs(c,"pie")){var u=a.traceIs(c,"2dMap")?i:n.fillArray;u(c.hoverinfo,s,"hi",o(c)),c.hoverlabel&&(u(c.hoverlabel.bgcolor,s,"hbg"),u(c.hoverlabel.bordercolor,s,"hbc"),u(c.hoverlabel.font.size,s,"hts"),u(c.hoverlabel.font.color,s,"htc"),u(c.hoverlabel.font.family,s,"htf"),u(c.hoverlabel.namelength,s,"hnl"))}}}},{"../../lib":163,"../../registry":245}],79:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./hover").hover;e.exports=function(t,e,r){var i=n.getComponentMethod("annotations","onClick")(t,t._hoverdata);function o(){t.emit("plotly_click",{points:t._hoverdata,event:e})}void 0!==r&&a(t,e,r,!0),t._hoverdata&&e&&e.target&&(i&&i.then?i.then(o):o(),e.stopImmediatePropagation&&e.stopImmediatePropagation())}},{"../../registry":245,"./hover":83}],80:[function(t,e,r){"use strict";e.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}},{}],81:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("./hoverlabel_defaults");e.exports=function(t,e,r,o){i(t,e,function(r,i){return n.coerce(t,e,a,r,i)},o.hoverlabel)}},{"../../lib":163,"./attributes":77,"./hoverlabel_defaults":84}],82:[function(t,e,r){"use strict";var n=t("../../lib");r.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},r.isTraceInSubplots=function(t,e){if("splom"===t.type){for(var n=t.xaxes||[],a=t.yaxes||[],i=0;i<n.length;i++)for(var o=0;o<a.length;o++)if(-1!==e.indexOf(n[i]+a[o]))return!0;return!1}return-1!==e.indexOf(r.getSubplot(t))},r.flat=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=e;return r},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},r.getDistanceFunction=function(t,e,n,a){return"closest"===t?a||r.quadrature(e,n):"x"===t?e:n},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 a=e(t[n]);a<=r.distance&&(r.index=n,r.distance=a)}return r},r.inbox=function(t,e,r){return t*e<0||0===t?r:1/0},r.quadrature=function(t,e){return function(r){var n=t(r),a=e(r);return Math.sqrt(n*n+a*a)}},r.makeEventData=function(t,e,n){var a="index"in t?t.index:t.pointNumber,i={data:e._input,fullData:e,curveNumber:e.index,pointNumber:a};if(e._indexToPoints){var o=e._indexToPoints[a];1===o.length?i.pointIndex=o[0]:i.pointIndices=o}else i.pointIndex=a;return e._module.eventData?i=e._module.eventData(i,t,e,n,a):("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)),r.appendArrayPointValue(i,e,a),i},r.appendArrayPointValue=function(t,e,r){var a=e._arrayAttrs;if(a)for(var l=0;l<a.length;l++){var s=a[l],c=i(s);if(void 0===t[c]){var u=o(n.nestedProperty(e,s).get(),r);void 0!==u&&(t[c]=u)}}},r.appendArrayMultiPointValues=function(t,e,r){var a=e._arrayAttrs;if(a)for(var l=0;l<a.length;l++){var s=a[l],c=i(s);if(void 0===t[c]){for(var u=n.nestedProperty(e,s).get(),f=new Array(r.length),d=0;d<r.length;d++)f[d]=o(u,r[d]);t[c]=f}}};var a={ids:"id",locations:"location",labels:"label",values:"value","marker.colors":"color"};function i(t){return a[t]||t}function o(t,e){return Array.isArray(e)?Array.isArray(t)&&Array.isArray(t[e[0]])?t[e[0]][e[1]]:void 0:t[e]}},{"../../lib":163}],83:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("tinycolor2"),o=t("../../lib"),l=t("../../lib/events"),s=t("../../lib/svg_text_utils"),c=t("../../lib/override_cursor"),u=t("../drawing"),f=t("../color"),d=t("../dragelement"),p=t("../../plots/cartesian/axes"),h=t("../../registry"),g=t("./helpers"),v=t("./constants"),y=v.YANGLE,m=Math.PI*y/180,x=1/Math.sin(m),b=Math.cos(m),_=Math.sin(m),w=v.HOVERARROWSIZE,k=v.HOVERTEXTPAD;function M(t,e,r){var a=e.hovermode,i=e.rotateLabels,l=e.bgColor,c=e.container,d=e.outerContainer,p=e.commonLabelOpts||{},h=e.fontFamily||v.HOVERFONT,g=e.fontSize||v.HOVERFONTSIZE,m=t[0],x=m.xa,b=m.ya,_="y"===a?"yLabel":"xLabel",M=m[_],A=(String(M)||"").split(" ")[0],T=d.node().getBoundingClientRect(),L=T.top,S=T.width,C=T.height,O=void 0!==M&&m.distance<=e.hoverdistance&&("x"===a||"y"===a);if(O){var P,z,D=!0;for(P=0;P<t.length;P++){D&&void 0===t[P].zLabel&&(D=!1),z=t[P].hoverinfo||t[P].trace.hoverinfo;var E=Array.isArray(z)?z:z.split("+");if(-1===E.indexOf("all")&&-1===E.indexOf(a)){O=!1;break}}D&&(O=!1)}var N=c.selectAll("g.axistext").data(O?[0]:[]);N.enter().append("g").classed("axistext",!0),N.exit().remove(),N.each(function(){var e=n.select(this),i=o.ensureSingle(e,"path","",function(t){t.style({"stroke-width":"1px"})}),l=o.ensureSingle(e,"text","",function(t){t.attr("data-notex",1)}),c=p.bgcolor||f.defaultLine,d=p.bordercolor||f.contrast(c);i.style({fill:c,stroke:d}),l.text(M).call(u.font,p.font.family||h,p.font.size||g,p.font.color||f.background).call(s.positionText,0,0).call(s.convertToTspans,r),e.attr("transform","");var v=l.node().getBoundingClientRect();if("x"===a){l.attr("text-anchor","middle").call(s.positionText,0,"top"===x.side?L-v.bottom-w-k:L-v.top+w+k);var y="top"===x.side?"-":"";i.attr("d","M0,0L"+w+","+y+w+"H"+(k+v.width/2)+"v"+y+(2*k+v.height)+"H-"+(k+v.width/2)+"V"+y+w+"H-"+w+"Z"),e.attr("transform","translate("+(x._offset+(m.x0+m.x1)/2)+","+(b._offset+("top"===x.side?0:b._length))+")")}else{l.attr("text-anchor","right"===b.side?"start":"end").call(s.positionText,("right"===b.side?1:-1)*(k+w),L-v.top-v.height/2);var T="right"===b.side?"":"-";i.attr("d","M0,0L"+T+w+","+w+"V"+(k+v.height/2)+"h"+T+(2*k+v.width)+"V-"+(k+v.height/2)+"H"+T+w+"V-"+w+"Z"),e.attr("transform","translate("+(x._offset+("right"===b.side?x._length:0))+","+(b._offset+(m.y0+m.y1)/2)+")")}t=t.filter(function(t){return void 0!==t.zLabelVal||(t[_]||"").split(" ")[0]===A})});var R=c.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 R.enter().append("g").classed("hovertext",!0).each(function(){var t=n.select(this);t.append("rect").call(f.fill,f.addOpacity(l,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(u.font,h,g)}),R.exit().remove(),R.each(function(t){var e=n.select(this).attr("transform",""),o="",c="",d=f.opacity(t.color)?t.color:f.defaultLine,p=f.combine(d,l),v=t.borderColor||f.contrast(p);if(void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name){o=s.plainText(t.name||"");var m=Math.round(t.nameLength);m>-1&&o.length>m&&(o=m>3?o.substr(0,m-3)+"...":o.substr(0,m))}void 0!==t.zLabel?(void 0!==t.xLabel&&(c+="x: "+t.xLabel+"<br>"),void 0!==t.yLabel&&(c+="y: "+t.yLabel+"<br>"),c+=(c?"z: ":"")+t.zLabel):O&&t[a+"Label"]===M?c=t[("x"===a?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(c=t.yLabel):c=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(c+=(c?"<br>":"")+t.text),void 0!==t.extraText&&(c+=(c?"<br>":"")+t.extraText),""===c&&(""===o&&e.remove(),c=o);var x=e.select("text.nums").call(u.font,t.fontFamily||h,t.fontSize||g,t.fontColor||v).text(c).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r),b=e.select("text.name"),_=0;o&&o!==c?(b.call(u.font,t.fontFamily||h,t.fontSize||g,p).text(o).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r),_=b.node().getBoundingClientRect().width+2*k):(b.remove(),e.select("rect").remove()),e.select("path").style({fill:p,stroke:v});var A,T,P=x.node().getBoundingClientRect(),z=t.xa._offset+(t.x0+t.x1)/2,D=t.ya._offset+(t.y0+t.y1)/2,E=Math.abs(t.x1-t.x0),N=Math.abs(t.y1-t.y0),R=P.width+w+k+_;t.ty0=L-P.top,t.bx=P.width+2*k,t.by=P.height+2*k,t.anchor="start",t.txwidth=P.width,t.tx2width=_,t.offset=0,i?(t.pos=z,A=D+N/2+R<=C,T=D-N/2-R>=0,"top"!==t.idealAlign&&A||!T?A?(D+=N/2,t.anchor="start"):t.anchor="middle":(D-=N/2,t.anchor="end")):(t.pos=D,A=z+E/2+R<=S,T=z-E/2-R>=0,"left"!==t.idealAlign&&A||!T?A?(z+=E/2,t.anchor="start"):t.anchor="middle":(z-=E/2,t.anchor="end")),x.attr("text-anchor",t.anchor),_&&b.attr("text-anchor",t.anchor),e.attr("transform","translate("+z+","+D+")"+(i?"rotate("+y+")":""))}),R}function A(t,e){t.each(function(t){var r=n.select(this);if(t.del)r.remove();else{var a="end"===t.anchor?-1:1,i=r.select("text.nums"),o={start:1,end:-1,middle:0}[t.anchor],l=o*(w+k),c=l+o*(t.txwidth+k),f=0,d=t.offset;"middle"===t.anchor&&(l-=t.tx2width/2,c+=t.txwidth/2+k),e&&(d*=-_,f=t.offset*b),r.select("path").attr("d","middle"===t.anchor?"M-"+(t.bx/2+t.tx2width/2)+","+(d-t.by/2)+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(a*w+f)+","+(w+d)+"v"+(t.by/2-w)+"h"+a*t.bx+"v-"+t.by+"H"+(a*w+f)+"V"+(d-w)+"Z"),i.call(s.positionText,l+f,d+t.ty0-t.by/2+k),t.tx2width&&(r.select("text.name").call(s.positionText,c+o*k+f,d+t.ty0-t.by/2+k),r.select("rect").call(u.setRect,c+(o-1)*t.tx2width/2+f,d-t.by/2-1,t.tx2width,t.by+2))}})}function T(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],i=t.cd[r]||{},l=Array.isArray(r)?function(t,e){return o.castOption(a,r,t)||o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(i,n,t,e)};function s(e,r,n){var a=l(r,n);a&&(t[e]=a)}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=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:p.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:p.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var c=p.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+c+" / -"+p.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+c,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var u=p.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+u+" / -"+p.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+u,"y"===e&&(t.distance+=1)}var f=t.hoverinfo||t.trace.hoverinfo;return"all"!==f&&(-1===(f=Array.isArray(f)?f:f.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===f.indexOf("y")&&(t.yLabel=void 0),-1===f.indexOf("z")&&(t.zLabel=void 0),-1===f.indexOf("text")&&(t.text=void 0),-1===f.indexOf("name")&&(t.name=void 0)),t}function L(t,e){var r,n,a=e.container,o=e.fullLayout,l=e.event,s=!!t.hLinePoint,c=!!t.vLinePoint;if(a.selectAll(".spikeline").remove(),c||s){var d=f.combine(o.plot_bgcolor,o.paper_bgcolor);if(s){var p,h,g=t.hLinePoint;r=g&&g.xa,"cursor"===(n=g&&g.ya).spikesnap?(p=l.pointerX,h=l.pointerY):(p=r._offset+g.x,h=n._offset+g.y);var v,y,m=i.readability(g.color,d)<1.5?f.contrast(d):g.color,x=n.spikemode,b=n.spikethickness,_=n.spikecolor||m,w=n._boundingBox,k=(w.left+w.right)/2<p?w.right:w.left;-1===x.indexOf("toaxis")&&-1===x.indexOf("across")||(-1!==x.indexOf("toaxis")&&(v=k,y=p),-1!==x.indexOf("across")&&(v=n._counterSpan[0],y=n._counterSpan[1]),a.insert("line",":first-child").attr({x1:v,x2:y,y1:h,y2:h,"stroke-width":b,stroke:_,"stroke-dasharray":u.dashStyle(n.spikedash,b)}).classed("spikeline",!0).classed("crisp",!0),a.insert("line",":first-child").attr({x1:v,x2:y,y1:h,y2:h,"stroke-width":b+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)),-1!==x.indexOf("marker")&&a.insert("circle",":first-child").attr({cx:k+("right"!==n.side?b:-b),cy:h,r:b,fill:_}).classed("spikeline",!0)}if(c){var M,A,T=t.vLinePoint;r=T&&T.xa,n=T&&T.ya,"cursor"===r.spikesnap?(M=l.pointerX,A=l.pointerY):(M=r._offset+T.x,A=n._offset+T.y);var L,S,C=i.readability(T.color,d)<1.5?f.contrast(d):T.color,O=r.spikemode,P=r.spikethickness,z=r.spikecolor||C,D=r._boundingBox,E=(D.top+D.bottom)/2<A?D.bottom:D.top;-1===O.indexOf("toaxis")&&-1===O.indexOf("across")||(-1!==O.indexOf("toaxis")&&(L=E,S=A),-1!==O.indexOf("across")&&(L=r._counterSpan[0],S=r._counterSpan[1]),a.insert("line",":first-child").attr({x1:M,x2:M,y1:L,y2:S,"stroke-width":P,stroke:z,"stroke-dasharray":u.dashStyle(r.spikedash,P)}).classed("spikeline",!0).classed("crisp",!0),a.insert("line",":first-child").attr({x1:M,x2:M,y1:L,y2:S,"stroke-width":P+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)),-1!==O.indexOf("marker")&&a.insert("circle",":first-child").attr({cx:M,cy:E-("top"!==r.side?P:-P),r:P,fill:z}).classed("spikeline",!0)}}}function S(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}r.hover=function(t,e,r,i){t=o.getGraphDiv(t),o.throttle(t._fullLayout._uid+v.HOVERID,v.HOVERMINTIME,function(){!function(t,e,r,i){r||(r="xy");var s=Array.isArray(r)?r:[r],u=t._fullLayout,v=u._plots||[],y=v[r],m=u._has("cartesian");if(y){var b=y.overlays.map(function(t){return t.id});s=s.concat(b)}for(var _=s.length,w=new Array(_),k=new Array(_),C=!1,O=0;O<_;O++){var P=s[O],z=v[P];if(z)C=!0,w[O]=p.getFromId(t,z.xaxis._id),k[O]=p.getFromId(t,z.yaxis._id);else{var D=u[P]._subplot;w[O]=D.xaxis,k[O]=D.yaxis}}var E=e.hovermode||u.hovermode;E&&!C&&(E="closest");if(-1===["x","y","closest"].indexOf(E)||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return d.unhoverRaw(t,e);var N,R,I,F,j,B,H,q,V,U,G,Y,X,Z=-1===u.hoverdistance?1/0:u.hoverdistance,W=-1===u.spikedistance?1/0:u.spikedistance,Q=[],J=[],$={hLinePoint:null,vLinePoint:null};if(Array.isArray(e))for(E="array",I=0;I<e.length;I++)"skip"!==(j=t.calcdata[e[I].curveNumber||0])[0].trace.hoverinfo&&J.push(j);else{for(F=0;F<t.calcdata.length;F++)j=t.calcdata[F],"skip"!==(B=j[0].trace).hoverinfo&&g.isTraceInSubplots(B,s)&&J.push(j);var K,tt,et=!e.target;if(et)K="xpx"in e?e.xpx:w[0]._length/2,tt="ypx"in e?e.ypx:k[0]._length/2;else{if(!1===l.triggerHandler(t,"plotly_beforehover",e))return;var rt=e.target.getBoundingClientRect();if(K=e.clientX-rt.left,tt=e.clientY-rt.top,K<0||K>w[0]._length||tt<0||tt>k[0]._length)return d.unhoverRaw(t,e)}if(e.pointerX=K+w[0]._offset,e.pointerY=tt+k[0]._offset,N="xval"in e?g.flat(s,e.xval):g.p2c(w,K),R="yval"in e?g.flat(s,e.yval):g.p2c(k,tt),!a(N[0])||!a(R[0]))return o.warn("Fx.hover failed",e,t),d.unhoverRaw(t,e)}var nt=1/0;for(F=0;F<J.length;F++)if((j=J[F])&&j[0]&&j[0].trace&&!0===j[0].trace.visible&&(B=j[0].trace,-1===["carpet","contourcarpet"].indexOf(B._module.name))){if("splom"===B.type?H=s[q=0]:(H=g.getSubplot(B),q=s.indexOf(H)),V=E,Y={cd:j,trace:B,xa:w[q],ya:k[q],maxHoverDistance:Z,maxSpikeDistance:W,index:!1,distance:Math.min(nt,Z),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:f.defaultLine,name:B.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},u[H]&&(Y.subplot=u[H]._subplot),X=Q.length,"array"===V){var at=e[F];"pointNumber"in at?(Y.index=at.pointNumber,V="closest"):(V="","xval"in at&&(U=at.xval,V="x"),"yval"in at&&(G=at.yval,V=V?"closest":"y"))}else U=N[q],G=R[q];if(0!==Z)if(B._module&&B._module.hoverPoints){var it=B._module.hoverPoints(Y,U,G,V,u._hoverlayer);if(it)for(var ot,lt=0;lt<it.length;lt++)ot=it[lt],a(ot.x0)&&a(ot.y0)&&Q.push(T(ot,E))}else o.log("Unrecognized trace type in hover:",B);if("closest"===E&&Q.length>X&&(Q.splice(0,X),nt=Q[0].distance),m&&0!==W&&0===Q.length){Y.distance=W,Y.index=!1;var st=B._module.hoverPoints(Y,U,G,"closest",u._hoverlayer);if(st&&(st=st.filter(function(t){return t.spikeDistance<=W})),st&&st.length){var ct,ut=st.filter(function(t){return t.xa.showspikes});if(ut.length){var ft=ut[0];a(ft.x0)&&a(ft.y0)&&(ct=gt(ft),(!$.vLinePoint||$.vLinePoint.spikeDistance>ct.spikeDistance)&&($.vLinePoint=ct))}var dt=st.filter(function(t){return t.ya.showspikes});if(dt.length){var pt=dt[0];a(pt.x0)&&a(pt.y0)&&(ct=gt(pt),(!$.hLinePoint||$.hLinePoint.spikeDistance>ct.spikeDistance)&&($.hLinePoint=ct))}}}}function ht(t,e){for(var r,n=null,a=1/0,i=0;i<t.length;i++)(r=t[i].spikeDistance)<a&&r<=e&&(n=t[i],a=r);return n}function gt(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 vt={fullLayout:u,container:u._hoverlayer,outerContainer:u._paperdiv,event:e},yt=t._spikepoints,mt={vLinePoint:$.vLinePoint,hLinePoint:$.hLinePoint};if(t._spikepoints=mt,m&&0!==W&&0!==Q.length){var xt=Q.filter(function(t){return t.ya.showspikes}),bt=ht(xt,W);$.hLinePoint=gt(bt);var _t=Q.filter(function(t){return t.xa.showspikes}),wt=ht(_t,W);$.vLinePoint=gt(wt)}if(0===Q.length){var kt=d.unhoverRaw(t,e);return!m||null===$.hLinePoint&&null===$.vLinePoint||S(yt)&&L($,vt),kt}m&&S(yt)&&L($,vt);Q.sort(function(t,e){return t.distance-e.distance});var Mt=t._hoverdata,At=[];for(I=0;I<Q.length;I++){var Tt=Q[I];At.push(g.makeEventData(Tt,Tt.trace,Tt.cd))}t._hoverdata=At;var Lt="y"===E&&J.length>1,St=f.combine(u.plot_bgcolor||f.background,u.paper_bgcolor),Ct={hovermode:E,rotateLabels:Lt,bgColor:St,container:u._hoverlayer,outerContainer:u._paperdiv,commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance},Ot=M(Q,Ct,t);if(function(t,e,r){var n,a,i,o,l,s,c,u=0,f=t.map(function(t,n){var a=t[e];return[{i:n,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===a._id.charAt(0)?x:1)/2,pmin:0,pmax:"x"===a._id.charAt(0)?r.width:r.height}]}).sort(function(t,e){return t[0].posref-e[0].posref});function d(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=i;n=!1}if(n){var c=0;for(o=0;o<t.length;o++)(s=t[o]).pos+s.dp+s.size>e.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)(s=t[o]).pos>e.pmax-1&&(s.del=!0,c--);for(o=0;o<t.length&&!(c<=0);o++)if((s=t[o]).pos<e.pmin+1)for(s.del=!0,c--,i=2*s.size,l=t.length-1;l>=0;l--)t[l].dp-=i;for(o=t.length-1;o>=0&&!(c<=0);o--)(s=t[o]).pos+s.dp+s.size>e.pmax&&(s.del=!0,c--)}}}for(;!n&&u<=t.length;){for(u++,n=!0,o=0;o<f.length-1;){var p=f[o],h=f[o+1],g=p[p.length-1],v=h[0];if((a=g.pos+g.dp+g.size-v.pos-v.dp+v.size)>.01&&g.pmin===v.pmin&&g.pmax===v.pmax){for(l=h.length-1;l>=0;l--)h[l].dp+=a;for(p.push.apply(p,h),f.splice(o+1,1),c=0,l=p.length-1;l>=0;l--)c+=p[l].dp;for(i=c/p.length,l=p.length-1;l>=0;l--)p[l].dp-=i;n=!1}else o++}f.forEach(d)}for(o=f.length-1;o>=0;o--){var y=f[o];for(l=y.length-1;l>=0;l--){var m=y[l],b=t[m.i];b.offset=m.dp,b.del=m.del}}}(Q,Lt?"xa":"ya",u),A(Ot,Lt),e.target&&e.target.tagName){var Pt=h.getComponentMethod("annotations","hasClickToShow")(t,At);c(n.select(e.target),Pt?"pointer":"")}if(!e.target||i||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=t._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber))return!0}return!1}(t,0,Mt))return;Mt&&t.emit("plotly_unhover",{event:e,points:Mt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:w,yaxes:k,xvals:N,yvals:R})}(t,e,r,i)})},r.loneHover=function(t,e){var r={color:t.color||f.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},a=n.select(e.container),i=e.outerContainer?n.select(e.outerContainer):a,o={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||f.background,container:a,outerContainer:i},l=M([r],o,e.gd);return A(l,o.rotateLabels),l.node()}},{"../../lib":163,"../../lib/events":156,"../../lib/override_cursor":174,"../../lib/svg_text_utils":184,"../../plots/cartesian/axes":205,"../../registry":245,"../color":43,"../dragelement":65,"../drawing":68,"./constants":80,"./helpers":82,d3:7,"fast-isnumeric":10,tinycolor2:25}],84:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a){r("hoverlabel.bgcolor",(a=a||{}).bgcolor),r("hoverlabel.bordercolor",a.bordercolor),r("hoverlabel.namelength",a.namelength),n.coerceFont(r,"hoverlabel.font",a.font)}},{"../../lib":163}],85:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../dragelement"),o=t("./helpers"),l=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:l},attributes:t("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return a.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return a.castOption(t,r,"hoverinfo",function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)})},hover:t("./hover").hover,unhover:i.unhover,loneHover:t("./hover").loneHover,loneUnhover:function(t){var e=a.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":163,"../dragelement":65,"./attributes":77,"./calc":78,"./click":79,"./constants":80,"./defaults":81,"./helpers":82,"./hover":83,"./layout_attributes":86,"./layout_defaults":87,"./layout_global_defaults":88,d3:7}],86:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,e.exports={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:a,namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":231,"./constants":80}],87:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){function i(r,i){return n.coerce(t,e,a,r,i)}var o;"select"===i("dragmode")&&i("selectdirection"),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),o=e._isHoriz?"y":"x"):o="closest",i("hovermode",o)&&(i("hoverdistance"),i("spikedistance"));var l=e._has("mapbox"),s=e._has("geo"),c=e._basePlotModules.length;"zoom"===e.dragmode&&((l||s)&&1===c||l&&s&&2===c)&&(e.dragmode="pan")}},{"../../lib":163,"./layout_attributes":86}],88:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./hoverlabel_defaults"),i=t("./layout_attributes");e.exports=function(t,e){a(t,e,function(r,a){return n.coerce(t,e,i,r,a)})}},{"../../lib":163,"./hoverlabel_defaults":84,"./layout_attributes":86}],89:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../lib/regex").counter,i=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,l={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:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.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:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function s(t,e,r){var n=e[r+"axes"],a=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function c(t,e,r,n,a,i){var o=e(t+"gap",r),l=e("domain."+t);e(t+"side",n);for(var s=new Array(a),c=l[0],u=(l[1]-c)/(a-o),f=u*(1-o),d=0;d<a;d++){var p=c+u*d;s[i?a-1-d:d]=[p,p+f]}return s}function u(t,e,r,n,a){var i,o=new Array(r);function l(t,r){-1!==e.indexOf(r)&&void 0===n[r]?(o[t]=r,n[r]=t):o[t]=""}if(Array.isArray(t))for(i=0;i<r;i++)l(i,t[i]);else for(l(0,a),i=1;i<r;i++)l(i,a+(i+1));return o}e.exports={moduleType:"component",name:"grid",schema:{layout:{grid:l}},layoutAttributes:l,sizeDefaults:function(t,e){var r=t.grid||{},a=s(e,r,"x"),i=s(e,r,"y");if(t.grid||a||i){var o,u,f=Array.isArray(r.subplots)&&Array.isArray(r.subplots[0]),d=Array.isArray(a),p=Array.isArray(i),h=d&&a!==r.xaxes&&p&&i!==r.yaxes;f?(o=r.subplots.length,u=r.subplots[0].length):(p&&(o=i.length),d&&(u=a.length));var g={},v=k("rows",o),y=k("columns",u);if(v*y>1){f||d||p||"independent"===k("pattern")&&(f=!0),g._hasSubplotGrid=f;var m,x,b="top to bottom"===k("roworder"),_=f?.2:.1,w=f?.3:.1;h&&e._splomGridDflt&&(m=e._splomGridDflt.xside,x=e._splomGridDflt.yside),g._domains={x:c("x",k,_,m,y),y:c("y",k,w,x,v,b)},e.grid=g}}function k(t,e){return n.coerce(r,g,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,a,i,o,l,c,f,d=t.grid||{},p=e._subplots,h=r._hasSubplotGrid,g=r.rows,v=r.columns,y="independent"===r.pattern,m=r._axisMap={};if(h){var x=d.subplots||[];c=r.subplots=new Array(g);var b=1;for(n=0;n<g;n++){var _=c[n]=new Array(v),w=x[n]||[];for(a=0;a<v;a++)if(y?(l=1===b?"xy":"x"+b+"y"+b,b++):l=w[a],_[a]="",-1!==p.cartesian.indexOf(l)){if(f=l.indexOf("y"),i=l.slice(0,f),o=l.slice(f),void 0!==m[i]&&m[i]!==a||void 0!==m[o]&&m[o]!==n)continue;_[a]=l,m[i]=a,m[o]=n}}}else{var k=s(e,d,"x"),M=s(e,d,"y");r.xaxes=u(k,p.xaxis,v,m,"x"),r.yaxes=u(M,p.yaxis,g,m,"y")}var A=r._anchors={},T="top to bottom"===r.roworder;for(var L in m){var S,C,O,P=L.charAt(0),z=r[P+"side"];if(z.length<8)A[L]="free";else if("x"===P){if("t"===z.charAt(0)===T?(S=0,C=1,O=g):(S=g-1,C=-1,O=-1),h){var D=m[L];for(n=S;n!==O;n+=C)if((l=c[n][D])&&(f=l.indexOf("y"),l.slice(0,f)===L)){A[L]=l.slice(f);break}}else for(n=S;n!==O;n+=C)if(o=r.yaxes[n],-1!==p.cartesian.indexOf(L+o)){A[L]=o;break}}else if("l"===z.charAt(0)?(S=0,C=1,O=v):(S=v-1,C=-1,O=-1),h){var E=m[L];for(n=S;n!==O;n+=C)if((l=c[E][n])&&(f=l.indexOf("y"),l.slice(f)===L)){A[L]=l.slice(0,f);break}}else for(n=S;n!==O;n+=C)if(i=r.xaxes[n],-1!==p.cartesian.indexOf(i+L)){A[L]=i;break}}}}}},{"../../lib":163,"../../lib/regex":178,"../../plots/cartesian/constants":210,"../../plots/domain":230}],90:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/constants");e.exports={_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",n.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",n.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"}},{"../../plots/cartesian/constants":210}],91:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib/to_log_range");e.exports=function(t,e,r,i){e=e||{};var o="log"===r&&"linear"===e.type,l="linear"===r&&"log"===e.type;if(o||l)for(var s,c,u=t._fullLayout.images,f=e._id.charAt(0),d=0;d<u.length;d++)if(c="images["+d+"].",(s=u[d])[f+"ref"]===e._id){var p=s[f],h=s["size"+f],g=null,v=null;if(o){g=a(p,e.range);var y=h/Math.pow(10,g)/2;v=2*Math.log(y+Math.sqrt(1+y*y))/Math.LN10}else v=(g=Math.pow(10,p))*(Math.pow(10,h/2)-Math.pow(10,-h/2));n(g)?n(v)||(v=null):(g=null,v=null),i(c+f,g),i(c+"size"+f,v)}}},{"../../lib/to_log_range":186,"fast-isnumeric":10}],92:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),o=t("./attributes");function l(t,e,r){function i(r,a){return n.coerce(t,e,o,r,a)}var l=i("source");if(!i("visible",!!l))return e;i("layer"),i("xanchor"),i("yanchor"),i("sizex"),i("sizey"),i("sizing"),i("opacity");for(var s={_fullLayout:r},c=["x","y"],u=0;u<2;u++){var f=c[u],d=a.coerceRef(t,e,s,f,"paper");a.coercePosition(e,s,i,d,f,0)}return e}e.exports=function(t,e){i(t,e,{name:"images",handleItemDefaults:l})}},{"../../lib":163,"../../plots/array_container_defaults":201,"../../plots/cartesian/axes":205,"./attributes":90}],93:[function(t,e,r){"use strict";var n=t("d3"),a=t("../drawing"),i=t("../../plots/cartesian/axes"),o=t("../../constants/xmlns_namespaces");e.exports=function(t){var e,r,l=t._fullLayout,s=[],c={},u=[];for(r=0;r<l.images.length;r++){var f=l.images[r];if(f.visible)if("below"===f.layer&&"paper"!==f.xref&&"paper"!==f.yref){e=f.xref+f.yref;var d=l._plots[e];if(!d){u.push(f);continue}d.mainplot&&(e=d.mainplot.id),c[e]||(c[e]=[]),c[e].push(f)}else"above"===f.layer?s.push(f):u.push(f)}var p={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(e){var r=n.select(this);if(!this.img||this.img.src!==e.source){r.attr("xmlns",o.svg);var a=new Promise(function(t){var n=new Image;function a(){r.remove(),t()}this.img=n,n.setAttribute("crossOrigin","anonymous"),n.onerror=a,n.onload=function(){var e=document.createElement("canvas");e.width=this.width,e.height=this.height,e.getContext("2d").drawImage(this,0,0);var n=e.toDataURL("image/png");r.attr("xlink:href",n),t()},r.on("error",a),n.src=e.source}.bind(this));t._promises.push(a)}}function g(e){var r=n.select(this),o=i.getFromId(t,e.xref),s=i.getFromId(t,e.yref),c=l._size,u=o?Math.abs(o.l2p(e.sizex)-o.l2p(0)):e.sizex*c.w,f=s?Math.abs(s.l2p(e.sizey)-s.l2p(0)):e.sizey*c.h,d=u*p.x[e.xanchor].offset,h=f*p.y[e.yanchor].offset,g=p.x[e.xanchor].sizing+p.y[e.yanchor].sizing,v=(o?o.r2p(e.x)+o._offset:e.x*c.w+c.l)+d,y=(s?s.r2p(e.y)+s._offset:c.h-e.y*c.h+c.t)+h;switch(e.sizing){case"fill":g+=" slice";break;case"stretch":g="none"}r.attr({x:v,y:y,width:u,height:f,preserveAspectRatio:g,opacity:e.opacity});var m=(o?o._id:"")+(s?s._id:"");r.call(a.setClipUrl,m?"clip"+l._uid+m:null)}var v=l._imageLowerLayer.selectAll("image").data(u),y=l._imageUpperLayer.selectAll("image").data(s);v.enter().append("image"),y.enter().append("image"),v.exit().remove(),y.exit().remove(),v.each(function(t){h.bind(this)(t),g.bind(this)(t)}),y.each(function(t){h.bind(this)(t),g.bind(this)(t)});var m=Object.keys(l._plots);for(r=0;r<m.length;r++){e=m[r];var x=l._plots[e];if(x.imagelayer){var b=x.imagelayer.selectAll("image").data(c[e]||[]);b.enter().append("image"),b.exit().remove(),b.each(function(t){h.bind(this)(t),g.bind(this)(t)})}}}},{"../../constants/xmlns_namespaces":147,"../../plots/cartesian/axes":205,"../drawing":68,d3:7}],94:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"images",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("images"),draw:t("./draw"),convertCoords:t("./convert_coords")}},{"../../plots/cartesian/include_components":215,"./attributes":90,"./convert_coords":91,"./defaults":92,"./draw":93}],95:[function(t,e,r){"use strict";r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],96:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:a.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({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"}},{"../../plots/font_attributes":231,"../color/attributes":42}],97:[function(t,e,r){"use strict";e.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],98:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("./attributes"),o=t("../../plots/layout_attributes"),l=t("./helpers");e.exports=function(t,e,r){for(var s,c,u,f,d=t.legend||{},p={},h=0,g="normal",v=0;v<r.length;v++){var y=r[v];l.legendGetsTrace(y)&&(h++,n.traceIs(y,"pie")&&h++),(n.traceIs(y,"bar")&&"stack"===e.barmode||-1!==["tonextx","tonexty"].indexOf(y.fill))&&(g=l.isGrouped({traceorder:g})?"grouped+reversed":"reversed"),void 0!==y.legendgroup&&""!==y.legendgroup&&(g=l.isReversed({traceorder:g})?"reversed+grouped":"grouped")}function m(t,e){return a.coerce(d,p,i,t,e)}if(!1!==a.coerce(t,e,o,"showlegend",h>1)){if(e.legend=p,m("bgcolor",e.paper_bgcolor),m("bordercolor"),m("borderwidth"),a.coerceFont(m,"font",e.font),m("orientation"),"h"===p.orientation){var x=t.xaxis;x&&x.rangeslider&&x.rangeslider.visible?(s=0,u="left",c=1.1,f="bottom"):(s=0,u="left",c=-.1,f="top")}m("traceorder",g),l.isGrouped(e.legend)&&m("tracegroupgap"),m("x",s),m("xanchor",u),m("y",c),m("yanchor",f),a.noneOrAll(d,p,["x","y"])}}},{"../../lib":163,"../../plots/layout_attributes":235,"../../registry":245,"./attributes":96,"./helpers":102}],99:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../registry"),l=t("../../lib/events"),s=t("../dragelement"),c=t("../drawing"),u=t("../color"),f=t("../../lib/svg_text_utils"),d=t("./handle_click"),p=t("./constants"),h=t("../../constants/interactions"),g=t("../../constants/alignment"),v=g.LINE_SPACING,y=g.FROM_TL,m=g.FROM_BR,x=t("./get_legend_data"),b=t("./style"),_=t("./helpers"),w=t("./anchor_utils"),k=h.DBLCLICKDELAY;function M(t,e,r,n,a){var i=r.data()[0][0].trace,o={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(i._group&&(o.group=i._group),"pie"===i.type&&(o.label=r.datum()[0].label),!1!==l.triggerHandler(t,"plotly_legendclick",o))if(1===n)e._clickTimeout=setTimeout(function(){d(r,t,n)},k);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==l.triggerHandler(t,"plotly_legenddoubleclick",o)&&d(r,t,n)}}function A(t,e,r){var n=t.data()[0][0],i=e._fullLayout,l=n.trace,s=o.traceIs(l,"pie"),u=l.index,d=s?n.label:l.name,p=e._context.edits.legendText&&!s,h=a.ensureSingle(t,"text","legendtext");function g(r){f.convertToTspans(r,e,function(){!function(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,a,i=t.select("g[class*=math-group]"),o=i.node(),l=e._fullLayout.legend.font.size*v;if(o){var s=c.bBox(o);n=s.height,a=s.width,c.setTranslate(i,0,n/4)}else{var u=t.select(".legendtext"),d=f.lineCount(u),p=u.node();n=l*d,a=p?c.bBox(p).width:0;var h=l*(.3+(1-d)/2);f.positionText(u,40,h)}n=Math.max(n,16)+3,r.height=n,r.width=a}(t,e)})}h.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,i.legend.font).text(p?T(d,r):d),p?h.call(f.makeEditable,{gd:e,text:d}).call(g).on("edit",function(t){this.text(T(t,r)).call(g);var i=n.trace._fullInput||{},l={};if(o.hasTransform(i,"groupby")){var s=o.getTransformIndices(i,"groupby"),c=s[s.length-1],f=a.keyedContainer(i,"transforms["+c+"].styles","target","value.name");f.set(n.trace._group,t),l=f.constructUpdate()}else l.name=t;return o.call("restyle",e,l,u)}):g(h)}function T(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function L(t,e){var r,i=1,o=a.ensureSingle(t,"rect","legendtoggle",function(t){t.style("cursor","pointer").attr("pointer-events","all").call(u.fill,"rgba(0,0,0,0)")});o.on("mousedown",function(){(r=(new Date).getTime())-e._legendMouseDownTime<k?i+=1:(i=1,e._legendMouseDownTime=r)}),o.on("mouseup",function(){if(!e._dragged&&!e._editing){var r=e._fullLayout.legend;(new Date).getTime()-e._legendMouseDownTime>k&&(i=Math.max(i-1,1)),M(e,r,t,i,n.event)}})}function S(t,e,r){var a=t._fullLayout,i=a.legend,o=i.borderwidth,l=_.isGrouped(i),s=0;if(i._width=0,i._height=0,_.isVertical(i))l&&e.each(function(t,e){c.setTranslate(this,0,e*i.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;c.setTranslate(this,o,5+o+i._height+r/2),i._height+=r,i._width=Math.max(i._width,n)}),i._width+=45+2*o,i._height+=10+2*o,l&&(i._height+=(i._lgroupsLength-1)*i.tracegroupgap),s=40;else if(l){for(var u=[i._width],f=e.data(),d=0,p=f.length;d<p;d++){var h=f[d].map(function(t){return t[0].width}),g=40+Math.max.apply(null,h);i._width+=i.tracegroupgap+g,u.push(i._width)}e.each(function(t,e){c.setTranslate(this,u[e],0)}),e.each(function(){var t=n.select(this).selectAll("g.traces"),e=0;t.each(function(t){var r=t[0].height;c.setTranslate(this,0,5+o+e+r/2),e+=r}),i._height=Math.max(i._height,e)}),i._height+=10+2*o,i._width+=2*o}else{var v,y=0,m=0,x=0,b=0,w=0,k=i.tracegroupgap||5;r.each(function(t){x=Math.max(40+t[0].width,x),w+=40+t[0].width+k}),v=a.width-(a.margin.r+a.margin.l)>o+w-k,r.each(function(t){var e=t[0],r=v?40+t[0].width:x;o+b+k+r>a.width-(a.margin.r+a.margin.l)&&(b=0,y+=m,i._height=i._height+m,m=0),c.setTranslate(this,o+b,5+o+e.height/2+y),i._width+=k+r,i._height=Math.max(i._height,e.height),b+=k+r,m=Math.max(e.height,m)}),i._width+=2*o,i._height+=10+2*o}i._width=Math.ceil(i._width),i._height=Math.ceil(i._height),r.each(function(e){var r=e[0],a=n.select(this).select(".legendtoggle");c.setRect(a,0,-r.height/2,(t._context.edits.legendText?0:i._width)+s,r.height)})}function C(t){var e=t._fullLayout.legend,r="left";w.isRightAnchor(e)?r="right":w.isCenterAnchor(e)&&(r="center");var n="top";w.isBottomAnchor(e)?n="bottom":w.isMiddleAnchor(e)&&(n="middle"),i.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*y[r],r:e._width*m[r],b:e._height*m[n],t:e._height*y[n]})}e.exports=function(t){var e=t._fullLayout,r="legend"+e._uid;if(e._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var l=e.legend,f=e.showlegend&&x(t.calcdata,l),d=e.hiddenlabels||[];if(!e.showlegend||!f.length)return e._infolayer.selectAll(".legend").remove(),e._topdefs.select("#"+r).remove(),void i.autoMargin(t,"legend");for(var h=0,g=0;g<f.length;g++)for(var v=0;v<f[g].length;v++){var _=f[g][v][0],k=_.trace,T=o.traceIs(k,"pie")?_.label:k.name;h=Math.max(h,T&&T.length||0)}var O=!1,P=a.ensureSingle(e._infolayer,"g","legend",function(t){t.attr("pointer-events","all"),O=!0}),z=a.ensureSingleById(e._topdefs,"clipPath",r,function(t){t.append("rect")}),D=a.ensureSingle(P,"rect","bg",function(t){t.attr("shape-rendering","crispEdges")});D.call(u.stroke,l.bordercolor).call(u.fill,l.bgcolor).style("stroke-width",l.borderwidth+"px");var E=a.ensureSingle(P,"g","scrollbox"),N=a.ensureSingle(P,"rect","scrollbar",function(t){t.attr({rx:20,ry:3,width:0,height:0}).call(u.fill,"#808BA4")}),R=E.selectAll("g.groups").data(f);R.enter().append("g").attr("class","groups"),R.exit().remove();var I=R.selectAll("g.traces").data(a.identity);I.enter().append("g").attr("class","traces"),I.exit().remove(),I.call(b,t).style("opacity",function(t){var e=t[0].trace;return o.traceIs(e,"pie")?-1!==d.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){n.select(this).call(A,t,h).call(L,t)}),O&&(S(t,R,I),C(t));var F=e.width,j=e.height;S(t,R,I),l._height>j?function(t){var e=t._fullLayout.legend,r="left";w.isRightAnchor(e)?r="right":w.isCenterAnchor(e)&&(r="center");i.autoMargin(t,"legend",{x:e.x,y:.5,l:e._width*y[r],r:e._width*m[r],b:0,t:0})}(t):C(t);var B=e._size,H=B.l+B.w*l.x,q=B.t+B.h*(1-l.y);w.isRightAnchor(l)?H-=l._width:w.isCenterAnchor(l)&&(H-=l._width/2),w.isBottomAnchor(l)?q-=l._height:w.isMiddleAnchor(l)&&(q-=l._height/2);var V=l._width,U=B.w;V>U?(H=B.l,V=U):(H+V>F&&(H=F-V),H<0&&(H=0),V=Math.min(F-H,l._width));var G,Y,X,Z,W=l._height,Q=B.h;if(W>Q?(q=B.t,W=Q):(q+W>j&&(q=j-W),q<0&&(q=0),W=Math.min(j-q,l._height)),c.setTranslate(P,H,q),N.on(".drag",null),P.on("wheel",null),l._height<=W||t._context.staticPlot)D.attr({width:V-l.borderwidth,height:W-l.borderwidth,x:l.borderwidth/2,y:l.borderwidth/2}),c.setTranslate(E,0,0),z.select("rect").attr({width:V-2*l.borderwidth,height:W-2*l.borderwidth,x:l.borderwidth,y:l.borderwidth}),c.setClipUrl(E,r),c.setRect(N,0,0,0,0),delete l._scrollY;else{var J,$,K=Math.max(p.scrollBarMinHeight,W*W/l._height),tt=W-K-2*p.scrollBarMargin,et=l._height-W,rt=tt/et,nt=Math.min(l._scrollY||0,et);D.attr({width:V-2*l.borderwidth+p.scrollBarWidth+p.scrollBarMargin,height:W-l.borderwidth,x:l.borderwidth/2,y:l.borderwidth/2}),z.select("rect").attr({width:V-2*l.borderwidth+p.scrollBarWidth+p.scrollBarMargin,height:W-2*l.borderwidth,x:l.borderwidth,y:l.borderwidth+nt}),c.setClipUrl(E,r),it(nt,K,rt),P.on("wheel",function(){it(nt=a.constrain(l._scrollY+n.event.deltaY/tt*et,0,et),K,rt),0!==nt&&nt!==et&&n.event.preventDefault()});var at=n.behavior.drag().on("dragstart",function(){J=n.event.sourceEvent.clientY,$=nt}).on("drag",function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||it(nt=a.constrain((t.clientY-J)/rt+$,0,et),K,rt)});N.call(at)}if(t._context.edits.legendPosition)P.classed("cursor-move",!0),s.init({element:P.node(),gd:t,prepFn:function(){var t=c.getTranslate(P);X=t.x,Z=t.y},moveFn:function(t,e){var r=X+t,n=Z+e;c.setTranslate(P,r,n),G=s.align(r,0,B.l,B.l+B.w,l.xanchor),Y=s.align(n,0,B.t+B.h,B.t,l.yanchor)},doneFn:function(){void 0!==G&&void 0!==Y&&o.call("relayout",t,{"legend.x":G,"legend.y":Y})},clickFn:function(r,n){var a=e._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom});a.size()>0&&M(t,P,a,r,n)}})}function it(e,r,n){l._scrollY=t._fullLayout.legend._scrollY=e,c.setTranslate(E,0,-e),c.setRect(N,V,p.scrollBarMargin+e*n,p.scrollBarWidth,r),z.select("rect").attr({y:l.borderwidth+e})}}},{"../../constants/alignment":143,"../../constants/interactions":144,"../../lib":163,"../../lib/events":156,"../../lib/svg_text_utils":184,"../../plots/plots":237,"../../registry":245,"../color":43,"../dragelement":65,"../drawing":68,"./anchor_utils":95,"./constants":97,"./get_legend_data":100,"./handle_click":101,"./helpers":102,"./style":104,d3:7}],100:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var r,i,o={},l=[],s=!1,c={},u=0;function f(t,r){if(""!==t&&a.isGrouped(e))-1===l.indexOf(t)?(l.push(t),s=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+u;l.push(n),o[n]=[[r]],u++}}for(r=0;r<t.length;r++){var d=t[r],p=d[0],h=p.trace,g=h.legendgroup;if(a.legendGetsTrace(h)&&h.showlegend)if(n.traceIs(h,"pie"))for(c[g]||(c[g]={}),i=0;i<d.length;i++){var v=d[i].label;c[g][v]||(f(g,{label:v,color:d[i].color,i:d[i].i,trace:h}),c[g][v]=!0)}else f(g,p)}if(!l.length)return[];var y,m,x=l.length;if(s&&a.isGrouped(e))for(m=new Array(x),r=0;r<x;r++)y=o[l[r]],m[r]=a.isReversed(e)?y.reverse():y;else{for(m=[new Array(x)],r=0;r<x;r++)y=o[l[r]][0],m[0][a.isReversed(e)?x-r-1:r]=y;x=1}return e._lgroupsLength=x,m}},{"../../registry":245,"./helpers":102}],101:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=!0;e.exports=function(t,e,r){if(!e._dragged&&!e._editing){var o,l,s,c,u,f=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],d=t.data()[0][0],p=e._fullData,h=d.trace,g=h.legendgroup,v={},y=[],m=[],x=[];if(1===r&&i&&e.data&&e._context.showTips?(n.notifier(n._(e,"Double-click on legend to isolate one trace"),"long"),i=!1):i=!1,a.traceIs(h,"pie")){var b=d.label,_=f.indexOf(b);1===r?-1===_?f.push(b):f.splice(_,1):2===r&&(f=[],e.calcdata[0].forEach(function(t){b!==t.label&&f.push(t.label)}),e._fullLayout.hiddenlabels&&e._fullLayout.hiddenlabels.length===f.length&&-1===_&&(f=[])),a.call("relayout",e,"hiddenlabels",f)}else{var w,k=g&&g.length,M=[];if(k)for(o=0;o<p.length;o++)(w=p[o]).visible&&w.legendgroup===g&&M.push(o);if(1===r){var A;switch(h.visible){case!0:A="legendonly";break;case!1:A=!1;break;case"legendonly":A=!0}if(k)for(o=0;o<p.length;o++)!1!==p[o].visible&&p[o].legendgroup===g&&z(p[o],A);else z(h,A)}else if(2===r){var T,L,S=!0;for(o=0;o<p.length;o++)if(!(p[o]===h)&&!(T=k&&p[o].legendgroup===g)&&!0===p[o].visible&&!a.traceIs(p[o],"notLegendIsolatable")){S=!1;break}for(o=0;o<p.length;o++)if(!1!==p[o].visible&&!a.traceIs(p[o],"notLegendIsolatable"))switch(h.visible){case"legendonly":z(p[o],!0);break;case!0:L=!!S||"legendonly",T=p[o]===h||k&&p[o].legendgroup===g,z(p[o],!!T||L)}}for(o=0;o<m.length;o++)if(s=m[o]){var C=s.constructUpdate(),O=Object.keys(C);for(l=0;l<O.length;l++)c=O[l],(v[c]=v[c]||[])[x[o]]=C[c]}for(u=Object.keys(v),o=0;o<u.length;o++)for(c=u[o],l=0;l<y.length;l++)v[c].hasOwnProperty(l)||(v[c][l]=void 0);a.call("restyle",e,v,y)}}function P(t,e,r){var n=y.indexOf(t),a=v[e];return a||(a=v[e]=[]),-1===y.indexOf(t)&&(y.push(t),n=y.length-1),a[n]=r,n}function z(t,e){var r=t._fullInput;if(a.hasTransform(r,"groupby")){var i=m[r.index];if(!i){var o=a.getTransformIndices(r,"groupby"),l=o[o.length-1];i=n.keyedContainer(r,"transforms["+l+"].styles","target","value.visible"),m[r.index]=i}var s=i.get(t._group);void 0===s&&(s=!0),!1!==s&&i.set(t._group,e),x[r.index]=P(r.index,"visible",!1!==r.visible)}else{var c=!1!==r.visible&&e;P(r.index,"visible",c)}}}},{"../../lib":163,"../../registry":245}],102:[function(t,e,r){"use strict";r.legendGetsTrace=function(t){return t.visible&&void 0!==t.showlegend},r.isGrouped=function(t){return-1!==(t.traceorder||"").indexOf("grouped")},r.isVertical=function(t){return"h"!==t.orientation},r.isReversed=function(t){return-1!==(t.traceorder||"").indexOf("reversed")}},{}],103:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"legend",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw"),style:t("./style")}},{"./attributes":96,"./defaults":98,"./draw":99,"./style":104}],104:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=t("../drawing"),l=t("../color"),s=t("../../traces/scatter/subtypes"),c=t("../../traces/pie/style_one");e.exports=function(t,e){t.each(function(t){var e=n.select(this),r=i.ensureSingle(e,"g","layers");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 a=r.selectAll("g.legendsymbols").data([t]);a.enter().append("g").classed("legendsymbols",!0),a.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(function(t){var e=t[0].trace,r=e.marker||{},i=r.line||{},o=n.select(this).select("g.legendpoints").selectAll("path.legendbar").data(a.traceIs(e,"bar")?[t]:[]);o.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),o.exit().remove(),o.each(function(t){var e=n.select(this),a=t[0],o=(a.mlw+1||i.width+1)-1;e.style("stroke-width",o+"px").call(l.fill,a.mc||r.color),o&&e.call(l.stroke,a.mlc||i.color)})}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(a.traceIs(e,"box-violin")&&e.visible?[t]:[]);r.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.each(function(){var t=e.line.width,r=n.select(this);r.style("stroke-width",t+"px").call(l.fill,e.fillcolor),t&&l.stroke(r,e.line.color)})}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendpie").data(a.traceIs(e,"pie")&&e.visible?[t]:[]);r.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.size()&&r.call(c,t[0],e)}).each(function(t){var e=t[0].trace,r=e.visible&&e.fill&&"none"!==e.fill,a=s.hasLines(e),i=e.contours;i&&"constraint"===i.type&&(a=i.showlines,r="="!==i._operation);var l=n.select(this).select(".legendfill").selectAll("path").data(r?[t]:[]);l.enter().append("path").classed("js-fill",!0),l.exit().remove(),l.attr("d","M5,0h30v6h-30z").call(o.fillGroupStyle);var c=n.select(this).select(".legendlines").selectAll("path").data(a?[t]:[]);c.enter().append("path").classed("js-line",!0).attr("d","M5,0h30"),c.exit().remove(),c.call(o.lineGroupStyle)}).each(function(t){var r,a,l=t[0],c=l.trace,u=s.hasMarkers(c),f=s.hasText(c),d=s.hasLines(c);function p(t,e,r){var n=i.nestedProperty(c,t).get(),a=Array.isArray(n)&&e?e(n):n;if(r){if(a<r[0])return r[0];if(a>r[1])return r[1]}return a}function h(t){return t[0]}if(u||f||d){var g={},v={};u&&(g.mc=p("marker.color",h),g.mo=p("marker.opacity",i.mean,[.2,1]),g.ms=p("marker.size",i.mean,[2,16]),g.mlc=p("marker.line.color",h),g.mlw=p("marker.line.width",i.mean,[0,5]),v.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),d&&(v.line={width:p("line.width",h,[0,10])}),f&&(g.tx="Aa",g.tp=p("textposition",h),g.ts=10,g.tc=p("textfont.color",h),g.tf=p("textfont.family",h)),r=[i.minExtend(l,g)],(a=i.minExtend(c,v)).selectedpoints=null}var y=n.select(this).select("g.legendpoints"),m=y.selectAll("path.scatterpts").data(u?r:[]);m.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),m.exit().remove(),m.call(o.pointStyle,a,e),u&&(r[0].mrc=3);var x=y.selectAll("g.pointtext").data(f?r:[]);x.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),x.exit().remove(),x.selectAll("text").call(o.textPointStyle,a,e)}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data("candlestick"===e.type&&e.visible?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(t,r){var a=e[r?"increasing":"decreasing"],i=a.line.width,o=n.select(this);o.style("stroke-width",i+"px").call(l.fill,a.fillcolor),i&&l.stroke(o,a.line.color)})}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data("ohlc"===e.type&&e.visible?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(t,r){var a=e[r?"increasing":"decreasing"],i=a.line.width,s=n.select(this);s.style("fill","none").call(o.dashLine,a.line.dash,i),i&&l.stroke(s,a.line.color)})})}},{"../../lib":163,"../../registry":245,"../../traces/pie/style_one":279,"../../traces/scatter/subtypes":303,"../color":43,"../drawing":68,d3:7}],105:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/plots"),i=t("../../plots/cartesian/axis_ids"),o=t("../../lib"),l=t("../../../build/ploticon"),s=o._,c=e.exports={};function u(t,e){var r,a,o=e.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},f=i.list(t,null,!0),d="on";if("zoom"===l){var p,h="in"===s?.5:2,g=(1+h)/2,v=(1-h)/2;for(a=0;a<f.length;a++)if(!(r=f[a]).fixedrange)if(p=r._name,"auto"===s)u[p+".autorange"]=!0;else if("reset"===s){if(void 0===r._rangeInitial)u[p+".autorange"]=!0;else{var y=r._rangeInitial.slice();u[p+".range[0]"]=y[0],u[p+".range[1]"]=y[1]}void 0!==r._showSpikeInitial&&(u[p+".showspikes"]=r._showSpikeInitial,"on"!==d||r._showSpikeInitial||(d="off"))}else{var m=[r.r2l(r.range[0]),r.r2l(r.range[1])],x=[g*m[0]+v*m[1],g*m[1]+v*m[0]];u[p+".range[0]"]=r.l2r(x[0]),u[p+".range[1]"]=r.l2r(x[1])}c._cartesianSpikesEnabled=d}else{if("hovermode"!==l||"x"!==s&&"y"!==s){if("hovermode"===l&&"closest"===s){for(a=0;a<f.length;a++)r=f[a],"on"!==d||r.showspikes||(d="off");c._cartesianSpikesEnabled=d}}else s=c._isHoriz?"y":"x",o.setAttribute("data-val",s);u[l]=s}n.call("relayout",t,u)}function f(t,e){for(var r=e.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,o=t._fullLayout._subplots.gl3d,l={},s=a.split("."),c=0;c<o.length;c++)l[o[c]+"."+s[1]]=i;var u="pan"===i?i:"zoom";l.dragmode=u,n.call("relayout",t,l)}function d(t,e){for(var r=e.currentTarget.getAttribute("data-attr"),a=t._fullLayout,i=a._subplots.gl3d,l={},s=0;s<i.length;s++){var c=i[s],u=c+".camera",f=a[c]._scene;"resetDefault"===r?l[u]=null:"resetLastSave"===r&&(l[u]=o.extendDeep({},f.cameraInitial))}n.call("relayout",t,l)}function p(t,e){var r=e.currentTarget,a=r._previousVal||!1,i=t.layout,l=t._fullLayout,s=l._subplots.gl3d,c=["xaxis","yaxis","zaxis"],u=["showspikes","spikesides","spikethickness","spikecolor"],f={},d={},p={};if(a)p=o.extendDeep(i,a),r._previousVal=null;else{p={"allaxes.showspikes":!1};for(var h=0;h<s.length;h++){var g=s[h],v=l[g],y=f[g]={};y.hovermode=v.hovermode,p[g+".hovermode"]=!1;for(var m=0;m<3;m++){var x=c[m];d=y[x]={};for(var b=0;b<u.length;b++){var _=u[b];d[_]=v[x][_]}}}r._previousVal=o.extendDeep({},f)}n.call("relayout",t,p)}function h(t,e){for(var r=e.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,o=t._fullLayout,l=o._subplots.geo,s=0;s<l.length;s++){var c=l[s],u=o[c];if("zoom"===a){var f=u.projection.scale,d="in"===i?2*f:.5*f;n.call("relayout",t,c+".projection.scale",d)}else"reset"===a&&v(t,"geo")}}function g(t){var e,r=t._fullLayout;e=r._has("cartesian")?r._isHoriz?"y":"x":"closest";var a=!t._fullLayout.hovermode&&e;n.call("relayout",t,"hovermode",a)}function v(t,e){for(var r=t._fullLayout,a=r._subplots[e],i={},o=0;o<a.length;o++)for(var l=a[o],s=r[l]._subplot.viewInitial,c=Object.keys(s),u=0;u<c.length;u++){var f=c[u];i[l+"."+f]=s[f]}n.call("relayout",t,i)}c.toImage={name:"toImage",title:function(t){var e=(t._context.toImageButtonOptions||{}).format||"png";return s(t,"png"===e?"Download plot as a png":"Download plot")},icon:l.camera,click:function(t){var e=t._context.toImageButtonOptions,r={format:e.format||"png"};o.notifier(s(t,"Taking snapshot - this may take a few seconds"),"long"),"svg"!==r.format&&o.isIE()&&(o.notifier(s(t,"IE only supports svg. Changing format to svg."),"long"),r.format="svg"),["filename","width","height","scale"].forEach(function(t){e[t]&&(r[t]=e[t])}),n.call("downloadImage",t,r).then(function(e){o.notifier(s(t,"Snapshot succeeded")+" - "+e,"long")}).catch(function(){o.notifier(s(t,"Sorry, there was a problem downloading your snapshot!"),"long")})}},c.sendDataToCloud={name:"sendDataToCloud",title:function(t){return s(t,"Edit in Chart Studio")},icon:l.disk,click:function(t){a.sendDataToCloud(t)}},c.zoom2d={name:"zoom2d",title:function(t){return s(t,"Zoom")},attr:"dragmode",val:"zoom",icon:l.zoombox,click:u},c.pan2d={name:"pan2d",title:function(t){return s(t,"Pan")},attr:"dragmode",val:"pan",icon:l.pan,click:u},c.select2d={name:"select2d",title:function(t){return s(t,"Box Select")},attr:"dragmode",val:"select",icon:l.selectbox,click:u},c.lasso2d={name:"lasso2d",title:function(t){return s(t,"Lasso Select")},attr:"dragmode",val:"lasso",icon:l.lasso,click:u},c.zoomIn2d={name:"zoomIn2d",title:function(t){return s(t,"Zoom in")},attr:"zoom",val:"in",icon:l.zoom_plus,click:u},c.zoomOut2d={name:"zoomOut2d",title:function(t){return s(t,"Zoom out")},attr:"zoom",val:"out",icon:l.zoom_minus,click:u},c.autoScale2d={name:"autoScale2d",title:function(t){return s(t,"Autoscale")},attr:"zoom",val:"auto",icon:l.autoscale,click:u},c.resetScale2d={name:"resetScale2d",title:function(t){return s(t,"Reset axes")},attr:"zoom",val:"reset",icon:l.home,click:u},c.hoverClosestCartesian={name:"hoverClosestCartesian",title:function(t){return s(t,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:l.tooltip_basic,gravity:"ne",click:u},c.hoverCompareCartesian={name:"hoverCompareCartesian",title:function(t){return s(t,"Compare data on hover")},attr:"hovermode",val:function(t){return t._fullLayout._isHoriz?"y":"x"},icon:l.tooltip_compare,gravity:"ne",click:u},c.zoom3d={name:"zoom3d",title:function(t){return s(t,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:l.zoombox,click:f},c.pan3d={name:"pan3d",title:function(t){return s(t,"Pan")},attr:"scene.dragmode",val:"pan",icon:l.pan,click:f},c.orbitRotation={name:"orbitRotation",title:function(t){return s(t,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:l["3d_rotate"],click:f},c.tableRotation={name:"tableRotation",title:function(t){return s(t,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:l["z-axis"],click:f},c.resetCameraDefault3d={name:"resetCameraDefault3d",title:function(t){return s(t,"Reset camera to default")},attr:"resetDefault",icon:l.home,click:d},c.resetCameraLastSave3d={name:"resetCameraLastSave3d",title:function(t){return s(t,"Reset camera to last save")},attr:"resetLastSave",icon:l.movie,click:d},c.hoverClosest3d={name:"hoverClosest3d",title:function(t){return s(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:l.tooltip_basic,gravity:"ne",click:p},c.zoomInGeo={name:"zoomInGeo",title:function(t){return s(t,"Zoom in")},attr:"zoom",val:"in",icon:l.zoom_plus,click:h},c.zoomOutGeo={name:"zoomOutGeo",title:function(t){return s(t,"Zoom out")},attr:"zoom",val:"out",icon:l.zoom_minus,click:h},c.resetGeo={name:"resetGeo",title:function(t){return s(t,"Reset")},attr:"reset",val:null,icon:l.autoscale,click:h},c.hoverClosestGeo={name:"hoverClosestGeo",title:function(t){return s(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:l.tooltip_basic,gravity:"ne",click:g},c.hoverClosestGl2d={name:"hoverClosestGl2d",title:function(t){return s(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:l.tooltip_basic,gravity:"ne",click:g},c.hoverClosestPie={name:"hoverClosestPie",title:function(t){return s(t,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:l.tooltip_basic,gravity:"ne",click:g},c.toggleHover={name:"toggleHover",title:function(t){return s(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:l.tooltip_basic,gravity:"ne",click:function(t,e){g(t),p(t,e)}},c.resetViews={name:"resetViews",title:function(t){return s(t,"Reset views")},icon:l.home,click:function(t,e){var r=e.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),u(t,e),r.setAttribute("data-attr","resetLastSave"),d(t,e),v(t,"geo"),v(t,"mapbox")}},c.toggleSpikelines={name:"toggleSpikelines",title:function(t){return s(t,"Toggle Spike Lines")},icon:l.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,a=i.list(t,null,!0),o={},l=0;l<a.length;l++)e=a[l],r=e._name,o[r+".showspikes"]="on"===n._cartesianSpikesEnabled||e._showSpikeInitial;return o}(t);n.call("relayout",t,r)}},c.resetViewMapbox={name:"resetViewMapbox",title:function(t){return s(t,"Reset view")},attr:"reset",icon:l.home,click:function(t){v(t,"mapbox")}}},{"../../../build/ploticon":2,"../../lib":163,"../../plots/cartesian/axis_ids":208,"../../plots/plots":237,"../../registry":245}],106:[function(t,e,r){"use strict";r.manage=t("./manage")},{"./manage":107}],107:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axis_ids"),a=t("../../traces/scatter/subtypes"),i=t("../../registry"),o=t("./modebar"),l=t("./buttons");e.exports=function(t){var e=t._fullLayout,r=t._context,s=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 c,u=r.modeBarButtons;c=Array.isArray(u)&&u.length?function(t){for(var e=0;e<t.length;e++)for(var r=t[e],n=0;n<r.length;n++){var a=r[n];if("string"==typeof a){if(void 0===l[a])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));t[e][n]=l[a]}}return t}(u):function(t,e,r){var o=t._fullLayout,s=t._fullData,c=o._has("cartesian"),u=o._has("gl3d"),f=o._has("geo"),d=o._has("pie"),p=o._has("gl2d"),h=o._has("ternary"),g=o._has("mapbox"),v=o._has("polar"),y=function(t){for(var e=n.list({_fullLayout:t},null,!0),r=0;r<e.length;r++)if(!e[r].fixedrange)return!1;return!0}(o),m=[];function x(t){if(t.length){for(var r=[],n=0;n<t.length;n++){var a=t[n];-1===e.indexOf(a)&&r.push(l[a])}m.push(r)}}x(["toImage","sendDataToCloud"]);var b=[],_=[],w=[],k=[];(c||p||d||h)+f+u+g+v>1?(_=["toggleHover"],w=["resetViews"]):f?(b=["zoomInGeo","zoomOutGeo"],_=["hoverClosestGeo"],w=["resetGeo"]):u?(_=["hoverClosest3d"],w=["resetCameraDefault3d","resetCameraLastSave3d"]):g?(_=["toggleHover"],w=["resetViewMapbox"]):_=p?["hoverClosestGl2d"]:d?["hoverClosestPie"]:["toggleHover"];c&&(_=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);!c&&!p||y||(b=["zoomIn2d","zoomOut2d","autoScale2d"],"resetViews"!==w[0]&&(w=["resetScale2d"]));u?k=["zoom3d","pan3d","orbitRotation","tableRotation"]:(c||p)&&!y||h?k=["zoom2d","pan2d"]:g||f?k=["pan2d"]:v&&(k=["zoom2d"]);(function(t){for(var e=!1,r=0;r<t.length&&!e;r++){var n=t[r];n._module&&n._module.selectPoints&&(i.traceIs(n,"scatter-like")?(a.hasMarkers(n)||a.hasText(n))&&(e=!0):i.traceIs(n,"box-violin")&&"all"!==n.boxpoints&&"all"!==n.points||(e=!0))}return e})(s)&&k.push("select2d","lasso2d");return x(k),x(b.concat(w)),x(_),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}(m,r)}(t,r.modeBarButtonsToRemove,r.modeBarButtonsToAdd),s?s.update(t,c):e._modeBar=o(t,c)}else s&&(s.destroy(),delete e._modeBar)}},{"../../plots/cartesian/axis_ids":208,"../../registry":245,"../../traces/scatter/subtypes":303,"./buttons":105,"./modebar":108}],108:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../../build/ploticon");function o(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}var l=o.prototype;l.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),a=this.hasLogo!==r.displaylogo,i=this.locale!==r.locale;this.locale=r.locale,(n||a||i)&&(this.removeAllButtons(),this.updateButtons(e),r.displaylogo&&(this.element.appendChild(this.getLogo()),this.hasLogo=!0)),this.updateActiveButton()},l.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 a=e.createButton(t);e.buttonElements.push(a),r.appendChild(a)}),e.element.appendChild(r)})},l.createGroup=function(){var t=document.createElement("div");return t.className="modebar-group",t},l.createButton=function(t){var e=this,r=document.createElement("a");r.setAttribute("rel","tooltip"),r.className="modebar-btn";var a=t.title;void 0===a?a=t.name:"function"==typeof a&&(a=a(this.graphInfo)),(a||0===a)&&r.setAttribute("data-title",a),void 0!==t.attr&&r.setAttribute("data-attr",t.attr);var o=t.val;if(void 0!==o&&("function"==typeof o&&(o=o(this.graphInfo)),r.setAttribute("data-val",o)),"function"!=typeof t.click)throw new Error("must provide button 'click' function in button config");return r.addEventListener("click",function(r){t.click(e.graphInfo,r),e.updateActiveButton(r.currentTarget)}),r.setAttribute("data-toggle",t.toggle||!1),t.toggle&&n.select(r).classed("active",!0),r.appendChild(this.createIcon(t.icon||i.question,t.name)),r.setAttribute("data-gravity",t.gravity||"n"),r},l.createIcon=function(t,e){var r=t.ascent-t.descent,n="http://www.w3.org/2000/svg",a=document.createElementNS(n,"svg"),i=document.createElementNS(n,"path");a.setAttribute("height","1em"),a.setAttribute("width",t.width/r+"em"),a.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 i.setAttribute("d",t.path),i.setAttribute("transform",o),a.appendChild(i),a},l.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,r=void 0!==t?t.getAttribute("data-attr"):null;this.buttonElements.forEach(function(t){var i=t.getAttribute("data-val")||!0,o=t.getAttribute("data-attr"),l="true"===t.getAttribute("data-toggle"),s=n.select(t);if(l)o===r&&s.classed("active",!s.classed("active"));else{var c=null===o?o:a.nestedProperty(e,o).get();s.classed("active",c===i)}})},l.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},l.getLogo=function(){var t=this.createGroup(),e=document.createElement("a");return e.href="https://plot.ly/",e.target="_blank",e.setAttribute("data-title",a._(this.graphInfo,"Produced with Plotly")),e.className="modebar-btn plotlyjsicon modebar-btn--logo",e.appendChild(this.createIcon(i.plotlylogo)),t.appendChild(e),t},l.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},l.destroy=function(){a.removeElement(this.container.querySelector(".modebar"))},e.exports=function(t,e){var r=t._fullLayout,a=new o({graphInfo:t,container:r._paperdiv.node(),buttons:e});return r._privateplot&&n.select(a.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),a}},{"../../../build/ploticon":2,"../../lib":163,d3:7}],109:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("./button_attributes");o=i(o,{_isLinkedToArray:"button"}),e.exports={visible:{valType:"boolean",editType:"plot"},buttons:o,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:n({editType:"plot"}),bgcolor:{valType:"color",dflt:a.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:a.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}},{"../../lib/extend":157,"../../plots/font_attributes":231,"../color/attributes":42,"./button_attributes":110}],110:[function(t,e,r){"use strict";e.exports={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"}},{}],111:[function(t,e,r){"use strict";e.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},{}],112:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),i=t("./attributes"),o=t("./button_attributes"),l=t("./constants");e.exports=function(t,e,r,s,c){var u=t.rangeselector||{},f=e.rangeselector={};function d(t,e){return n.coerce(u,f,i,t,e)}var p=function(t,e,r){var a,i,l=t.buttons||[],s=e.buttons=[];function c(t,e){return n.coerce(a,i,o,t,e)}for(var u=0;u<l.length;u++)if(a=l[u],i={},n.isPlainObject(a)){var f=c("step");"all"!==f&&(!r||"gregorian"===r||"month"!==f&&"year"!==f?c("stepmode"):i.stepmode="backward",c("count")),c("label"),i._index=u,s.push(i)}return s}(u,f,c);if(d("visible",p.length>0)){var h=function(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),a=0,i=0;i<n.length;i++){var o=e[n[i]].domain;o&&(a=Math.max(o[1],a))}return[t.domain[0],a+l.yPad]}(e,r,s);d("x",h[0]),d("y",h[1]),n.noneOrAll(t,e,["x","y"]),d("xanchor"),d("yanchor"),n.coerceFont(d,"font",r.font);var g=d("bgcolor");d("activecolor",a.contrast(g,l.lightAmount,l.darkAmount)),d("bordercolor"),d("borderwidth")}}},{"../../lib":163,"../color":43,"./attributes":109,"./button_attributes":110,"./constants":111}],113:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../plots/plots"),o=t("../color"),l=t("../drawing"),s=t("../../lib"),c=t("../../lib/svg_text_utils"),u=t("../../plots/cartesian/axis_ids"),f=t("../legend/anchor_utils"),d=t("../../constants/alignment"),p=d.LINE_SPACING,h=d.FROM_TL,g=d.FROM_BR,v=t("./constants"),y=t("./get_update_object");function m(t){return t._id}function x(t,e,r){var n=s.ensureSingle(t,"rect","selector-rect",function(t){t.attr("shape-rendering","crispEdges")});n.attr({rx:v.rx,ry:v.ry}),n.call(o.stroke,e.bordercolor).call(o.fill,function(t,e){return e._isActive||e._isHovered?t.activecolor:t.bgcolor}(e,r)).style("stroke-width",e.borderwidth+"px")}function b(t,e,r,n){var a;s.ensureSingle(t,"text","selector-text",function(t){t.classed("user-select-none",!0).attr("text-anchor","middle")}).call(l.font,e.font).text((a=r,a.label?a.label:"all"===a.step?"all":a.count+a.step.charAt(0))).call(function(t){c.convertToTspans(t,n)})}e.exports=function(t){var e=t._fullLayout._infolayer.selectAll(".rangeselector").data(function(t){for(var e=u.list(t,"x",!0),r=[],n=0;n<e.length;n++){var a=e[n];a.rangeselector&&a.rangeselector.visible&&r.push(a)}return r}(t),m);e.enter().append("g").classed("rangeselector",!0),e.exit().remove(),e.style({cursor:"pointer","pointer-events":"all"}),e.each(function(e){var r=n.select(this),o=e,s=o.rangeselector,u=r.selectAll("g.button").data(s.buttons);u.enter().append("g").classed("button",!0),u.exit().remove(),u.each(function(e){var r=n.select(this),i=y(o,e);e._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]]}(o,e,i),r.call(x,s,e),r.call(b,s,e,t),r.on("click",function(){t._dragged||a.call("relayout",t,i)}),r.on("mouseover",function(){e._isHovered=!0,r.call(x,s,e)}),r.on("mouseout",function(){e._isHovered=!1,r.call(x,s,e)})}),function(t,e,r,a,o){var s=0,u=0,d=r.borderwidth;e.each(function(){var t=n.select(this),e=t.select(".selector-text"),a=r.font.size*p,i=Math.max(a*c.lineCount(e),16)+3;u=Math.max(u,i)}),e.each(function(){var t=n.select(this),e=t.select(".selector-rect"),a=t.select(".selector-text"),i=a.node()&&l.bBox(a.node()).width,o=r.font.size*p,f=c.lineCount(a),h=Math.max(i+10,v.minButtonWidth);t.attr("transform","translate("+(d+s)+","+d+")"),e.attr({x:0,y:0,width:h,height:u}),c.positionText(a,h/2,u/2-(f-1)*o/2+3),s+=h+5});var y=t._fullLayout._size,m=y.l+y.w*r.x,x=y.t+y.h*(1-r.y),b="left";f.isRightAnchor(r)&&(m-=s,b="right");f.isCenterAnchor(r)&&(m-=s/2,b="center");var _="top";f.isBottomAnchor(r)&&(x-=u,_="bottom");f.isMiddleAnchor(r)&&(x-=u/2,_="middle");s=Math.ceil(s),u=Math.ceil(u),m=Math.round(m),x=Math.round(x),i.autoMargin(t,a+"-range-selector",{x:r.x,y:r.y,l:s*h[b],r:s*g[b],b:u*g[_],t:u*h[_]}),o.attr("transform","translate("+m+","+x+")")}(t,u,s,o._name,r)})}},{"../../constants/alignment":143,"../../lib":163,"../../lib/svg_text_utils":184,"../../plots/cartesian/axis_ids":208,"../../plots/plots":237,"../../registry":245,"../color":43,"../drawing":68,"../legend/anchor_utils":95,"./constants":111,"./get_update_object":114,d3:7}],114:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t,e){var r=t._name,a={};if("all"===e.step)a[r+".autorange"]=!0;else{var i=function(t,e){var r,a=t.range,i=new Date(t.r2l(a[1])),o=e.step,l=e.count;switch(e.stepmode){case"backward":r=t.l2r(+n.time[o].utc.offset(i,-l));break;case"todate":var s=n.time[o].utc.offset(i,-l);r=t.l2r(+n.time[o].utc.ceil(s))}var c=a[1];return[r,c]}(t,e);a[r+".range[0]"]=i[0],a[r+".range[1]"]=i[1]}return a}},{d3:7}],115:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":109,"./defaults":112,"./draw":113}],116:[function(t,e,r){"use strict";var n=t("../color/attributes");e.exports={bgcolor:{valType:"color",dflt:n.background,editType:"plot"},bordercolor:{valType:"color",dflt:n.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"}},{"../color/attributes":42}],117:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axis_ids").list,a=t("../../plots/cartesian/autorange").getAutoRange,i=t("./constants");e.exports=function(t){for(var e=n(t,"x",!0),r=0;r<e.length;r++){var o=e[r],l=o[i.name];l&&l.visible&&l.autorange&&o._min.length&&o._max.length&&(l._input.autorange=!0,l._input.range=l.range=a(o))}}},{"../../plots/cartesian/autorange":204,"../../plots/cartesian/axis_ids":208,"./constants":118}],118:[function(t,e,r){"use strict";e.exports={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}},{}],119:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("./oppaxis_attributes"),o=t("../../plots/cartesian/axis_ids");e.exports=function(t,e,r){var l=t[r],s=e[r];if(l.rangeslider||e._requestRangeslider[s._id]){n.isPlainObject(l.rangeslider)||(l.rangeslider={});var c=l.rangeslider,u=s.rangeslider={};if(_("visible")){_("bgcolor",e.plot_bgcolor),_("bordercolor"),_("borderwidth"),_("thickness"),s._rangesliderAutorange=_("autorange",!s.isValidRange(c.range)),_("range");var f=e._subplots;if(f)for(var d=f.cartesian.filter(function(t){return t.substr(0,t.indexOf("y"))===o.name2id(r)}).map(function(t){return t.substr(t.indexOf("y"),t.length)}),p=n.simpleMap(d,o.id2name),h=0;h<p.length;h++){var g,v=p[h],y=c[v]||{},m=u[v]={},x=e[v];y.range&&x.isValidRange(y.range)&&(g="fixed");var b=w(y,m,"rangemode",g);"match"!==b&&w(y,m,"range",x.range.slice()),x._rangesliderAutorange="auto"===b}u._input=c}}function _(t,e){return n.coerce(c,u,a,t,e)}function w(t,e,r,a){return n.coerce(t,e,i,r,a)}}},{"../../lib":163,"../../plots/cartesian/axis_ids":208,"./attributes":116,"./oppaxis_attributes":122}],120:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../plots/plots"),o=t("../../lib"),l=t("../drawing"),s=t("../color"),c=t("../titles"),u=t("../../plots/cartesian"),f=t("../../plots/cartesian/axes"),d=t("../dragelement"),p=t("../../lib/setcursor"),h=t("./constants");function g(t,e,r,n){var a=o.ensureSingle(t,"rect",h.bgClassName,function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})}),i=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,s=-n._offsetShift,c=l.crispRound(e,n.borderwidth);a.attr({width:n._width+i,height:n._height+i,transform:"translate("+s+","+s+")",fill:n.bgcolor,stroke:n.bordercolor,"stroke-width":c})}function v(t,e,r,n){var a=e._fullLayout;o.ensureSingleById(a._topdefs,"clipPath",n._clipId,function(t){t.append("rect").attr({x:0,y:0})}).select("rect").attr({width:n._width,height:n._height})}function y(t,e,r,a){var s,c=f.getSubplots(e,r),d=e.calcdata,p=t.selectAll("g."+h.rangePlotClassName).data(c,o.identity);p.enter().append("g").attr("class",function(t){return h.rangePlotClassName+" "+t}).call(l.setClipUrl,a._clipId),p.order(),p.exit().remove(),p.each(function(t,o){var l=n.select(this),c=0===o,p=f.getFromId(e,t,"y"),h=p._name,g=a[h],v={data:[],layout:{xaxis:{type:r.type,domain:[0,1],range:a.range.slice(),calendar:r.calendar},width:a._width,height:a._height,margin:{t:0,b:0,l:0,r:0}},_context:e._context};v.layout[h]={type:p.type,domain:[0,1],range:"match"!==g.rangemode?g.range.slice():p.range.slice(),calendar:p.calendar},i.supplyDefaults(v);var y={id:t,plotgroup:l,xaxis:v._fullLayout.xaxis,yaxis:v._fullLayout[h],isRangePlot:!0};c?s=y:(y.mainplot="xy",y.mainplotinfo=s),u.rangePlot(e,y,function(t,e){for(var r=[],n=0;n<t.length;n++){var a=t[n],i=a[0].trace;i.xaxis+i.yaxis===e&&r.push(a)}return r}(d,t))})}function m(t,e,r,n,a){(o.ensureSingle(t,"rect",h.maskMinClassName,function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})}).attr("height",n._height).call(s.fill,h.maskColor),o.ensureSingle(t,"rect",h.maskMaxClassName,function(t){t.attr({y:0,"shape-rendering":"crispEdges"})}).attr("height",n._height).call(s.fill,h.maskColor),"match"!==a.rangemode)&&(o.ensureSingle(t,"rect",h.maskMinOppAxisClassName,function(t){t.attr({y:0,"shape-rendering":"crispEdges"})}).attr("width",n._width).call(s.fill,h.maskOppAxisColor),o.ensureSingle(t,"rect",h.maskMaxOppAxisClassName,function(t){t.attr({y:0,"shape-rendering":"crispEdges"})}).attr("width",n._width).style("border-top",h.maskOppBorder).call(s.fill,h.maskOppAxisColor))}function x(t,e,r,n){e._context.staticPlot||o.ensureSingle(t,"rect",h.slideBoxClassName,function(t){t.attr({y:0,cursor:h.slideBoxCursor,"shape-rendering":"crispEdges"})}).attr({height:n._height,fill:h.slideBoxFill})}function b(t,e,r,n){var a=o.ensureSingle(t,"g",h.grabberMinClassName),i=o.ensureSingle(t,"g",h.grabberMaxClassName),l={x:0,width:h.handleWidth,rx:h.handleRadius,fill:s.background,stroke:s.defaultLine,"stroke-width":h.handleStrokeWidth,"shape-rendering":"crispEdges"},c={y:Math.round(n._height/4),height:Math.round(n._height/2)};if(o.ensureSingle(a,"rect",h.handleMinClassName,function(t){t.attr(l)}).attr(c),o.ensureSingle(i,"rect",h.handleMaxClassName,function(t){t.attr(l)}).attr(c),!e._context.staticPlot){var u={width:h.grabAreaWidth,x:0,y:0,fill:h.grabAreaFill,cursor:h.grabAreaCursor};o.ensureSingle(a,"rect",h.grabAreaMinClassName,function(t){t.attr(u)}).attr("height",n._height),o.ensureSingle(i,"rect",h.grabAreaMaxClassName,function(t){t.attr(u)}).attr("height",n._height)}}e.exports=function(t){var e=t._fullLayout,r=function(t){var e=f.list({_fullLayout:t},"x",!0),r=h.name,n=[];if(t._has("gl2d"))return n;for(var a=0;a<e.length;a++){var i=e[a];i[r]&&i[r].visible&&n.push(i)}return n}(e);var l=e._infolayer.selectAll("g."+h.containerClassName).data(r,function(t){return t._name});l.enter().append("g").classed(h.containerClassName,!0).attr("pointer-events","all"),l.exit().each(function(t){var r=n.select(this),a=t[h.name];r.remove(),e._topdefs.select("#"+a._clipId).remove()}),l.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var a=r[n];-1!==a.indexOf(h.name)&&i.autoMargin(t,a)}}(t),0!==r.length&&l.each(function(r){var l=n.select(this),s=r[h.name],u=e[f.id2name(r.anchor)],_=s[f.id2name(r.anchor)];if(s.range){var w=s.range,k=r.range;w[0]=r.l2r(Math.min(r.r2l(w[0]),r.r2l(k[0]))),w[1]=r.l2r(Math.max(r.r2l(w[1]),r.r2l(k[1]))),s._input.range=w.slice()}r.cleanRange("rangeslider.range");for(var M=e.margin,A=e._size,T=r.domain,L=(r._boundingBox||{}).height||0,S=1/0,C=f.getSubplots(t,r),O=0;O<C.length;O++){var P=f.getFromId(t,C[O].substr(C[O].indexOf("y")));S=Math.min(S,P.domain[0])}s._id=h.name+r._id,s._clipId=s._id+"-"+e._uid,s._width=A.w*(T[1]-T[0]),s._height=(e.height-M.b-M.t)*s.thickness,s._offsetShift=Math.floor(s.borderwidth/2);var z=Math.round(M.l+A.w*T[0]),D=Math.round(A.t+A.h*(1-S)+L+s._offsetShift+h.extraPad);l.attr("transform","translate("+z+","+D+")");var E=r.r2l(s.range[0]),N=r.r2l(s.range[1]),R=N-E;if(s.p2d=function(t){return t/s._width*R+E},s.d2p=function(t){return(t-E)/R*s._width},s._rl=[E,N],"match"!==_.rangemode){var I=u.r2l(_.range[0]),F=u.r2l(_.range[1])-I;s.d2pOppAxis=function(t){return(t-I)/F*s._height}}l.call(g,t,r,s).call(v,t,r,s).call(y,t,r,s).call(m,t,r,s,_).call(x,t,r,s).call(b,t,r,s),function(t,e,r,i){var l=t.select("rect."+h.slideBoxClassName).node(),s=t.select("rect."+h.grabAreaMinClassName).node(),c=t.select("rect."+h.grabAreaMaxClassName).node();t.on("mousedown",function(){var u=n.event,f=u.target,h=u.clientX,g=h-t.node().getBoundingClientRect().left,v=i.d2p(r._rl[0]),y=i.d2p(r._rl[1]),m=d.coverSlip();function x(t){var u,d,x,b=+t.clientX-h;switch(f){case l:x="ew-resize",u=v+b,d=y+b;break;case s:x="col-resize",u=v+b,d=y;break;case c:x="col-resize",u=v,d=y+b;break;default:x="ew-resize",u=g,d=g+b}if(d<u){var _=d;d=u,u=_}i._pixelMin=u,i._pixelMax=d,p(n.select(m),x),function(t,e,r,n){function i(t){return r.l2r(o.constrain(t,n._rl[0],n._rl[1]))}var l=i(n.p2d(n._pixelMin)),s=i(n.p2d(n._pixelMax));window.requestAnimationFrame(function(){a.call("relayout",e,r._name+".range",[l,s])})}(0,e,r,i)}m.addEventListener("mousemove",x),m.addEventListener("mouseup",function t(){m.removeEventListener("mousemove",x);m.removeEventListener("mouseup",t);o.removeElement(m)})})}(l,t,r,s),function(t,e,r,n,a,i){var l=h.handleWidth/2;function s(t){return o.constrain(t,0,n._width)}function c(t){return o.constrain(t,0,n._height)}function u(t){return o.constrain(t,-l,n._width+l)}var f=s(n.d2p(r._rl[0])),d=s(n.d2p(r._rl[1]));if(t.select("rect."+h.slideBoxClassName).attr("x",f).attr("width",d-f),t.select("rect."+h.maskMinClassName).attr("width",f),t.select("rect."+h.maskMaxClassName).attr("x",d).attr("width",n._width-d),"match"!==i.rangemode){var p=n._height-c(n.d2pOppAxis(a._rl[1])),g=n._height-c(n.d2pOppAxis(a._rl[0]));t.select("rect."+h.maskMinOppAxisClassName).attr("x",f).attr("height",p).attr("width",d-f),t.select("rect."+h.maskMaxOppAxisClassName).attr("x",f).attr("y",g).attr("height",n._height-g).attr("width",d-f),t.select("rect."+h.slideBoxClassName).attr("y",p).attr("height",g-p)}var v=Math.round(u(f-l))-.5,y=Math.round(u(d-l))+.5;t.select("g."+h.grabberMinClassName).attr("transform","translate("+v+",0.5)"),t.select("g."+h.grabberMaxClassName).attr("transform","translate("+y+",0.5)")}(l,0,r,s,u,_),"bottom"===r.side&&c.draw(t,r._id+"title",{propContainer:r,propName:r._name+".title",placeholder:e._dfltTitle.x,attributes:{x:r._offset+r._length/2,y:D+s._height+s._offsetShift+10+1.5*r.titlefont.size,"text-anchor":"middle"}}),i.autoMargin(t,s._id,{x:T[0],y:S,l:0,r:0,t:0,b:s._height+M.b+L,pad:h.extraPad+2*s._offsetShift})})}},{"../../lib":163,"../../lib/setcursor":182,"../../plots/cartesian":216,"../../plots/cartesian/axes":205,"../../plots/plots":237,"../../registry":245,"../color":43,"../dragelement":65,"../drawing":68,"../titles":136,"./constants":118,d3:7}],121:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("./oppaxis_attributes");e.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:n.extendFlat({},a,{yaxis:i})}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:t("./draw")}},{"../../lib":163,"./attributes":116,"./calc_autorange":117,"./defaults":119,"./draw":120,"./oppaxis_attributes":122}],122:[function(t,e,r){"use strict";e.exports={_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"}},{}],123:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),a=t("../../traces/scatter/attributes").line,i=t("../drawing/attributes").dash,o=t("../../lib/extend").extendFlat;e.exports={_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:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calcIfAutorange+arraydraw"},xanchor:{valType:"any",editType:"calcIfAutorange+arraydraw"},x0:{valType:"any",editType:"calcIfAutorange+arraydraw"},x1:{valType:"any",editType:"calcIfAutorange+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calcIfAutorange+arraydraw"},yanchor:{valType:"any",editType:"calcIfAutorange+arraydraw"},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:o({},a.color,{editType:"arraydraw"}),width:o({},a.width,{editType:"calcIfAutorange+arraydraw"}),dash:o({},i,{editType:"arraydraw"}),editType:"calcIfAutorange+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},editType:"arraydraw"}},{"../../lib/extend":157,"../../traces/scatter/attributes":281,"../annotations/attributes":28,"../drawing/attributes":67}],124:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./constants"),o=t("./helpers");function l(t){return c(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function s(t){return c(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function c(t,e,r,a,l,s){var c=t/2,u=s;if("pixel"===e){var f=l?o.extractPathCoords(l,s?i.paramIsY:i.paramIsX):[r,a],d=n.aggNums(Math.max,null,f),p=n.aggNums(Math.min,null,f),h=p<0?Math.abs(p)+c:c,g=d>0?d+c:c;return{ppad:c,ppadplus:u?h:g,ppadminus:u?g:h}}return{ppad:c}}function u(t,e,r,n,a){var l="category"===t.type?t.r2c:t.d2c;if(void 0!==e)return[l(e),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===t.type&&(l=o.decodeDate(l)),s=0;s<h.length;s++)void 0!==(c=a[h[s].charAt(0)].drawn)&&(!(u=h[s].substr(1).match(i.paramRE))||u.length<c||((f=l(u[c]))<d&&(d=f),f>p&&(p=f)));return p>=d?[d,p]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;o<r.length;o++){var c,f,d=r[o];if("paper"!==d.xref){var p="pixel"===d.xsizemode?d.xanchor:d.x0,h="pixel"===d.xsizemode?d.xanchor:d.x1;(f=u(c=a.getFromId(t,d.xref),p,h,d.path,i.paramIsX))&&a.expand(c,f,l(d))}if("paper"!==d.yref){var g="pixel"===d.ysizemode?d.yanchor:d.y0,v="pixel"===d.ysizemode?d.yanchor:d.y1;(f=u(c=a.getFromId(t,d.yref),g,v,d.path,i.paramIsY))&&a.expand(c,f,s(d))}}}},{"../../lib":163,"../../plots/cartesian/axes":205,"./constants":125,"./helpers":128}],125:[function(t,e,r){"use strict";e.exports={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}}},{}],126:[function(t,e,r){"use strict";var n=t("../../plots/array_container_defaults"),a=t("./shape_defaults");e.exports=function(t,e){n(t,e,{name:"shapes",handleItemDefaults:a})}},{"../../plots/array_container_defaults":201,"./shape_defaults":130}],127:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../color"),l=t("../drawing"),s=t("../dragelement"),c=t("../../lib/setcursor"),u=t("./constants"),f=t("./helpers");function d(t,e){t._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+e+'"]').remove();var r=(t.layout.shapes||[])[e],d=t._fullLayout.shapes[e];if(r&&!1!==d.visible)if("below"!==d.layer)y(t._fullLayout._shapeUpperLayer);else if("paper"===d.xref||"paper"===d.yref)y(t._fullLayout._shapeLowerLayer);else{var v=t._fullLayout._plots[d.xref+d.yref];if(v)y((v.mainplotinfo||v).shapelayer);else y(t._fullLayout._shapeLowerLayer)}function y(r){var v={"data-index":e,"fill-rule":"evenodd",d:h(t,d)},y=d.line.width?d.line.color:"rgba(0,0,0,0)",m=r.append("path").attr(v).style("opacity",d.opacity).call(o.stroke,y).call(o.fill,d.fillcolor).call(l.dashLine,d.line.dash,d.line.width);p(m,t,d),t._context.edits.shapePosition&&function(t,e,r,o,d){var v,y,m,x,b,_,w,k,M,A,T,L,S,C,O,P,z,D,E,N,R,I,F,j,B,H,q,V,U=10,G=10,Y="pixel"===r.xsizemode,X="pixel"===r.ysizemode,Z="line"===r.type,W="path"===r.type,Q=i.getFromId(t,r.xref),J=i.getFromId(t,r.yref),$=f.getDataToPixel(t,Q),K=f.getDataToPixel(t,J,!0),tt=f.getPixelToData(t,Q),et=f.getPixelToData(t,J,!0),rt=Z?function(){var t=Math.max(r.line.width,10),n=d.append("g").attr("data-index",o);n.append("path").attr("d",e.attr("d")).style({cursor:"move","stroke-width":t,"stroke-opacity":"0"});var a={"fill-opacity":"0"},i=t/2>10?t/2:10;return n.append("circle").attr({"data-line-point":"start-point",cx:Y?$(r.xanchor)+r.x0:$(r.x0),cy:X?K(r.yanchor)-r.y0:K(r.y0),r:i}).style(a).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:Y?$(r.xanchor)+r.x1:$(r.x1),cy:X?K(r.yanchor)-r.y1:K(r.y1),r:i}).style(a).classed("cursor-grab",!0),n}():e,nt={element:rt.node(),gd:t,prepFn:function(n){var a="shapes["+o+"]";Y&&(_=$(r.xanchor),L=a+".xanchor");X&&(w=K(r.yanchor),S=a+".yanchor");"path"===r.type?(H=r.path,q=a+".path"):(y=Y?r.x0:$(r.x0),m=X?r.y0:K(r.y0),x=Y?r.x1:$(r.x1),b=X?r.y1:K(r.y1),k=a+".x0",M=a+".y0",A=a+".x1",T=a+".y1");y<x?(P=y,N=a+".x0",j="x0",z=x,R=a+".x1",B="x1"):(P=x,N=a+".x1",j="x1",z=y,R=a+".x0",B="x0");!X&&m<b||X&&m>b?(C=m,D=a+".y0",I="y0",O=b,E=a+".y1",F="y1"):(C=b,D=a+".y1",I="y1",O=m,E=a+".y0",F="y0");v={},at(n),lt(d,r),function(t,e,r){var n=e.xref,a=e.yref,o=i.getFromId(r,n),s=i.getFromId(r,a),c="";"paper"===n||o.autorange||(c+=n);"paper"===a||s.autorange||(c+=a);t.call(l.setClipUrl,c?"clip"+r._fullLayout._uid+c:null)}(e,r,t),nt.moveFn="move"===V?it:ot},doneFn:function(){c(e),st(d),p(e,t,r),n.call("relayout",t,v)},clickFn:function(){st(d)}};function at(t){if(Z)V="path"===t.target.tagName?"move":"start-point"===t.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var r=nt.element.getBoundingClientRect(),n=r.right-r.left,a=r.bottom-r.top,i=t.clientX-r.left,o=t.clientY-r.top,l=!W&&n>U&&a>G&&!t.shiftKey?s.getCursor(i/n,1-o/a):"move";c(e,l),V=l.split("-")[0]}}function it(n,a){if("path"===r.type){var i=function(t){return t},o=i,l=i;Y?v[L]=r.xanchor=tt(_+n):(o=function(t){return tt($(t)+n)},Q&&"date"===Q.type&&(o=f.encodeDate(o))),X?v[S]=r.yanchor=et(w+a):(l=function(t){return et(K(t)+a)},J&&"date"===J.type&&(l=f.encodeDate(l))),r.path=g(H,o,l),v[q]=r.path}else Y?v[L]=r.xanchor=tt(_+n):(v[k]=r.x0=tt(y+n),v[A]=r.x1=tt(x+n)),X?v[S]=r.yanchor=et(w+a):(v[M]=r.y0=et(m+a),v[T]=r.y1=et(b+a));e.attr("d",h(t,r)),lt(d,r)}function ot(n,a){if(W){var i=function(t){return t},o=i,l=i;Y?v[L]=r.xanchor=tt(_+n):(o=function(t){return tt($(t)+n)},Q&&"date"===Q.type&&(o=f.encodeDate(o))),X?v[S]=r.yanchor=et(w+a):(l=function(t){return et(K(t)+a)},J&&"date"===J.type&&(l=f.encodeDate(l))),r.path=g(H,o,l),v[q]=r.path}else if(Z){if("resize-over-start-point"===V){var s=y+n,c=X?m-a:m+a;v[k]=r.x0=Y?s:tt(s),v[M]=r.y0=X?c:et(c)}else if("resize-over-end-point"===V){var u=x+n,p=X?b-a:b+a;v[A]=r.x1=Y?u:tt(u),v[T]=r.y1=X?p:et(p)}}else{var rt=~V.indexOf("n")?C+a:C,nt=~V.indexOf("s")?O+a:O,at=~V.indexOf("w")?P+n:P,it=~V.indexOf("e")?z+n:z;~V.indexOf("n")&&X&&(rt=C-a),~V.indexOf("s")&&X&&(nt=O-a),(!X&&nt-rt>G||X&&rt-nt>G)&&(v[D]=r[I]=X?rt:et(rt),v[E]=r[F]=X?nt:et(nt)),it-at>U&&(v[N]=r[j]=Y?at:tt(at),v[R]=r[B]=Y?it:tt(it))}e.attr("d",h(t,r)),lt(d,r)}function lt(t,e){(Y||X)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=$(Y?e.xanchor:a.midRange(r?[e.x0,e.x1]:f.extractPathCoords(e.path,u.paramIsX))),o=K(X?e.yanchor:a.midRange(r?[e.y0,e.y1]:f.extractPathCoords(e.path,u.paramIsY)));if(i=f.roundPositionForSharpStrokeRendering(i,1),o=f.roundPositionForSharpStrokeRendering(o,1),Y&&X){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(Y){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function st(t){t.selectAll(".visual-cue").remove()}s.init(nt),rt.node().onmousemove=at}(t,m,d,e,r)}}function p(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"");t.call(l.setClipUrl,n?"clip"+e._fullLayout._uid+n:null)}function h(t,e){var r,n,o,l,s,c,d,p,h=e.type,g=i.getFromId(t,e.xref),v=i.getFromId(t,e.yref),y=t._fullLayout._size;if(g?(r=f.shapePositionToRange(g),n=function(t){return g._offset+g.r2p(r(t,!0))}):n=function(t){return y.l+y.w*t},v?(o=f.shapePositionToRange(v),l=function(t){return v._offset+v.r2p(o(t,!0))}):l=function(t){return y.t+y.h*(1-t)},"path"===h)return g&&"date"===g.type&&(n=f.decodeDate(n)),v&&"date"===v.type&&(l=f.decodeDate(l)),function(t,e,r){var n=t.path,i=t.xsizemode,o=t.ysizemode,l=t.xanchor,s=t.yanchor;return n.replace(u.segmentRE,function(t){var n=0,c=t.charAt(0),f=u.paramIsX[c],d=u.paramIsY[c],p=u.numParams[c],h=t.substr(1).replace(u.paramRE,function(t){return f[n]?t="pixel"===i?e(l)+Number(t):e(t):d[n]&&(t="pixel"===o?r(s)-Number(t):r(t)),++n>p&&(t="X"),t});return n>p&&(h=h.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+t)),c+h})}(e,n,l);if("pixel"===e.xsizemode){var m=n(e.xanchor);s=m+e.x0,c=m+e.x1}else s=n(e.x0),c=n(e.x1);if("pixel"===e.ysizemode){var x=l(e.yanchor);d=x-e.y0,p=x-e.y1}else d=l(e.y0),p=l(e.y1);if("line"===h)return"M"+s+","+d+"L"+c+","+p;if("rect"===h)return"M"+s+","+d+"H"+c+"V"+p+"H"+s+"Z";var b=(s+c)/2,_=(d+p)/2,w=Math.abs(b-s),k=Math.abs(_-d),M="A"+w+","+k,A=b+w+","+_;return"M"+A+M+" 0 1,1 "+(b+","+(_-k))+M+" 0 0,1 "+A+"Z"}function g(t,e,r){return t.replace(u.segmentRE,function(t){var n=0,a=t.charAt(0),i=u.paramIsX[a],o=u.paramIsY[a],l=u.numParams[a];return a+t.substr(1).replace(u.paramRE,function(t){return n>=l?t:(i[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}e.exports={draw:function(t){var e=t._fullLayout;for(var r in e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._plots){var n=e._plots[r].shapelayer;n&&n.selectAll("path").remove()}for(var a=0;a<e.shapes.length;a++)e.shapes[a].visible&&d(t,a)},drawOne:d}},{"../../lib":163,"../../lib/setcursor":182,"../../plots/cartesian/axes":205,"../../registry":245,"../color":43,"../dragelement":65,"../drawing":68,"./constants":125,"./helpers":128}],128:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../lib");r.rangeToShapePosition=function(t){return"log"===t.type?t.r2d:function(t){return t}},r.shapePositionToRange=function(t){return"log"===t.type?t.d2r:function(t){return t}},r.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},r.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},r.extractPathCoords=function(t,e){var r=[];return t.match(n.segmentRE).forEach(function(t){var i=e[t.charAt(0)].drawn;if(void 0!==i){var o=t.substr(1).match(n.paramRE);!o||o.length<i||r.push(a.cleanNumber(o[i]))}}),r},r.getDataToPixel=function(t,e,n){var a,i=t._fullLayout._size;if(e){var o=r.shapePositionToRange(e);a=function(t){return e._offset+e.r2p(o(t,!0))},"date"===e.type&&(a=r.decodeDate(a))}else a=n?function(t){return i.t+i.h*(1-t)}:function(t){return i.l+i.w*t};return a},r.getPixelToData=function(t,e,n){var a,i=t._fullLayout._size;if(e){var o=r.rangeToShapePosition(e);a=function(t){return o(e.p2r(t-e._offset))}}else a=n?function(t){return 1-(t-i.t)/i.h}:function(t){return(t-i.l)/i.w};return a},r.roundPositionForSharpStrokeRendering=function(t,e){var r=1===Math.round(e%2),n=Math.round(t);return r?n+.5:n}},{"../../lib":163,"./constants":125}],129:[function(t,e,r){"use strict";var n=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("shapes"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"../../plots/cartesian/include_components":215,"./attributes":123,"./calc_autorange":124,"./defaults":126,"./draw":127}],130:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./attributes"),o=t("./helpers");e.exports=function(t,e,r,l,s){function c(r,a){return n.coerce(t,e,i,r,a)}if(l=l||{},!c("visible",!(s=s||{}).itemIsNotPlainObject))return e;c("layer"),c("opacity"),c("fillcolor"),c("line.color"),c("line.width"),c("line.dash");for(var u=c("type",t.path?"path":"rect"),f=c("xsizemode"),d=c("ysizemode"),p=["x","y"],h=0;h<2;h++){var g,v,y,m=p[h],x=m+"anchor",b="x"===m?f:d,_={_fullLayout:r},w=a.coerceRef(t,e,_,m,"","paper");if("paper"!==w?(g=a.getFromId(_,w),y=o.rangeToShapePosition(g),v=o.shapePositionToRange(g)):v=y=n.identity,"path"!==u){var k=m+"0",M=m+"1",A=t[k],T=t[M];t[k]=v(t[k],!0),t[M]=v(t[M],!0),"pixel"===b?(c(k,0),c(M,10)):(a.coercePosition(e,_,c,w,k,.25),a.coercePosition(e,_,c,w,M,.75)),e[k]=y(e[k]),e[M]=y(e[M]),t[k]=A,t[M]=T}if("pixel"===b){var L=t[x];t[x]=v(t[x],!0),a.coercePosition(e,_,c,w,x,.25),e[x]=y(e[x]),t[x]=L}}return"path"===u?c("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"]),e}},{"../../lib":163,"../../plots/cartesian/axes":205,"./attributes":123,"./helpers":128}],131:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../../plots/pad_attributes"),i=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/animation_attributes"),s=t("./constants");e.exports=o({_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:i({},a,{},{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:l.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:n({})},font:n({}),activebgcolor:{valType:"color",dflt:s.gripBgActiveColor},bgcolor:{valType:"color",dflt:s.railBgColor},bordercolor:{valType:"color",dflt:s.railBorderColor},borderwidth:{valType:"number",min:0,dflt:s.railBorderWidth},ticklen:{valType:"number",min:0,dflt:s.tickLength},tickcolor:{valType:"color",dflt:s.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:s.minorTickLength}},"arraydraw","from-root")},{"../../lib/extend":157,"../../plot_api/edit_types":190,"../../plots/animation_attributes":200,"../../plots/font_attributes":231,"../../plots/pad_attributes":236,"./constants":132}],132:[function(t,e,r){"use strict";e.exports={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}},{}],133:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,l=i.steps;function s(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}var o=function(t,e){var r,a,i=t.steps||[],o=e.steps=[];function s(t,e){return n.coerce(r,a,l,t,e)}for(var c=0;c<i.length;c++)r=i[c],a={},s("method"),n.isPlainObject(r)&&("skip"===a.method||Array.isArray(r.args))&&(s("args"),s("label","step-"+c),s("value",a.label),s("execute"),o.push(a));return o}(t,e);a("visible",o.length>0)&&(a("active"),a("x"),a("y"),n.noneOrAll(t,e,["x","y"]),a("xanchor"),a("yanchor"),a("len"),a("lenmode"),a("pad.t"),a("pad.r"),a("pad.b"),a("pad.l"),n.coerceFont(a,"font",r.font),a("currentvalue.visible")&&(a("currentvalue.xanchor"),a("currentvalue.prefix"),a("currentvalue.suffix"),a("currentvalue.offset"),n.coerceFont(a,"currentvalue.font",e.font)),a("transition.duration"),a("transition.easing"),a("bgcolor"),a("activebgcolor"),a("bordercolor"),a("borderwidth"),a("ticklen"),a("tickwidth"),a("tickcolor"),a("minorticklen"))}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:s})}},{"../../lib":163,"../../plots/array_container_defaults":201,"./attributes":131,"./constants":132}],134:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),l=t("../../lib"),s=t("../../lib/svg_text_utils"),c=t("../legend/anchor_utils"),u=t("./constants"),f=t("../../constants/alignment"),d=f.LINE_SPACING,p=f.FROM_TL,h=f.FROM_BR;function g(t){return t._index}function v(t,e){var r=o.tester.selectAll("g."+u.labelGroupClass).data(e.steps);r.enter().append("g").classed(u.labelGroupClass,!0);var i=0,l=0;r.each(function(t){var r=x(n.select(this),{step:t},e).node();if(r){var a=o.bBox(r);l=Math.max(l,a.height),i=Math.max(i,a.width)}}),r.remove();var f=e._dims={};f.inputAreaWidth=Math.max(u.railWidth,u.gripHeight);var d=t._fullLayout._size;f.lx=d.l+d.w*e.x,f.ly=d.t+d.h*(1-e.y),"fraction"===e.lenmode?f.outerLength=Math.round(d.w*e.len):f.outerLength=e.len,f.inputAreaStart=0,f.inputAreaLength=Math.round(f.outerLength-e.pad.l-e.pad.r);var g=(f.inputAreaLength-2*u.stepInset)/(e.steps.length-1),v=i+u.labelPadding;if(f.labelStride=Math.max(1,Math.ceil(v/g)),f.labelHeight=l,f.currentValueMaxWidth=0,f.currentValueHeight=0,f.currentValueTotalHeight=0,f.currentValueMaxLines=1,e.currentvalue.visible){var m=o.tester.append("g");r.each(function(t){var r=y(m,e,t.label),n=r.node()&&o.bBox(r.node())||{width:0,height:0},a=s.lineCount(r);f.currentValueMaxWidth=Math.max(f.currentValueMaxWidth,Math.ceil(n.width)),f.currentValueHeight=Math.max(f.currentValueHeight,Math.ceil(n.height)),f.currentValueMaxLines=Math.max(f.currentValueMaxLines,a)}),f.currentValueTotalHeight=f.currentValueHeight+e.currentvalue.offset,m.remove()}f.height=f.currentValueTotalHeight+u.tickOffset+e.ticklen+u.labelOffset+f.labelHeight+e.pad.t+e.pad.b;var b="left";c.isRightAnchor(e)&&(f.lx-=f.outerLength,b="right"),c.isCenterAnchor(e)&&(f.lx-=f.outerLength/2,b="center");var _="top";c.isBottomAnchor(e)&&(f.ly-=f.height,_="bottom"),c.isMiddleAnchor(e)&&(f.ly-=f.height/2,_="middle"),f.outerLength=Math.ceil(f.outerLength),f.height=Math.ceil(f.height),f.lx=Math.round(f.lx),f.ly=Math.round(f.ly),a.autoMargin(t,u.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:f.outerLength*p[b],r:f.outerLength*h[b],b:f.height*h[_],t:f.height*p[_]})}function y(t,e,r){if(e.currentvalue.visible){var n,a,i=e._dims;switch(e.currentvalue.xanchor){case"right":n=i.inputAreaLength-u.currentValueInset-i.currentValueMaxWidth,a="left";break;case"center":n=.5*i.inputAreaLength,a="middle";break;default:n=u.currentValueInset,a="left"}var c=l.ensureSingle(t,"text",u.labelClass,function(t){t.classed("user-select-none",!0).attr({"text-anchor":a,"data-notex":1})}),f=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)f+=r;else f+=e.steps[e.active].label;e.currentvalue.suffix&&(f+=e.currentvalue.suffix),c.call(o.font,e.currentvalue.font).text(f).call(s.convertToTspans,e._gd);var p=s.lineCount(c),h=(i.currentValueMaxLines+1-p)*e.currentvalue.font.size*d;return s.positionText(c,n,h),c}}function m(t,e,r){l.ensureSingle(t,"rect",u.gripRectClass,function(n){n.call(k,e,t,r).style("pointer-events","all")}).attr({width:u.gripWidth,height:u.gripHeight,rx:u.gripRadius,ry:u.gripRadius}).call(i.stroke,r.bordercolor).call(i.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function x(t,e,r){var n=l.ensureSingle(t,"text",u.labelClass,function(t){t.classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1})});return n.call(o.font,r.font).text(e.step.label).call(s.convertToTspans,r._gd),n}function b(t,e){var r=l.ensureSingle(t,"g",u.labelsClass),a=e._dims,i=r.selectAll("g."+u.labelGroupClass).data(a.labelSteps);i.enter().append("g").classed(u.labelGroupClass,!0),i.exit().remove(),i.each(function(t){var r=n.select(this);r.call(x,t,e),o.setTranslate(r,T(e,t.fraction),u.tickOffset+e.ticklen+e.font.size*d+u.labelOffset+a.currentValueTotalHeight)})}function _(t,e,r,n,a){var i=Math.round(n*(r.steps.length-1));i!==r.active&&w(t,e,r,i,!0,a)}function w(t,e,r,n,i,o){var l=r.active;r._input.active=r.active=n;var s=r.steps[r.active];e.call(A,r,r.active/(r.steps.length-1),o),e.call(y,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:i,previousActive:l}),s&&s.method&&i&&(e._nextMethod?(e._nextMethod.step=s,e._nextMethod.doCallback=i,e._nextMethod.doTransition=o):(e._nextMethod={step:s,doCallback:i,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&a.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function k(t,e,r){var a=r.node(),o=n.select(e);function l(){return r.data()[0]}t.on("mousedown",function(){var t=l();e.emit("plotly_sliderstart",{slider:t});var s=r.select("."+u.gripRectClass);n.event.stopPropagation(),n.event.preventDefault(),s.call(i.fill,t.activebgcolor);var c=L(t,n.mouse(a)[0]);_(e,r,t,c,!0),t._dragging=!0,o.on("mousemove",function(){var t=l(),i=L(t,n.mouse(a)[0]);_(e,r,t,i,!1)}),o.on("mouseup",function(){var t=l();t._dragging=!1,s.call(i.fill,t.bgcolor),o.on("mouseup",null),o.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function M(t,e){var r=t.selectAll("rect."+u.tickRectClass).data(e.steps),a=e._dims;r.enter().append("rect").classed(u.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var l=r%a.labelStride==0,s=n.select(this);s.attr({height:l?e.ticklen:e.minorticklen}).call(i.fill,e.tickcolor),o.setTranslate(s,T(e,r/(e.steps.length-1))-.5*e.tickwidth,(l?u.tickOffset:u.minorTickOffset)+a.currentValueTotalHeight)})}function A(t,e,r,n){var a=t.select("rect."+u.gripRectClass),i=T(e,r);if(!e._invokingCommand){var o=a;n&&e.transition.duration>0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(i-.5*u.gripWidth)+","+e._dims.currentValueTotalHeight+")")}}function T(t,e){var r=t._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,e))}function L(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function S(t,e,r){var n=r._dims,a=l.ensureSingle(t,"rect",u.railTouchRectClass,function(n){n.call(k,e,t,r).style("pointer-events","all")});a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function C(t,e){var r=e._dims,n=r.inputAreaLength-2*u.railInset,a=l.ensureSingle(t,"rect",u.railRectClass);a.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(a,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[u.name],n=[],a=0;a<r.length;a++){var i=r[a];i.visible&&i.steps.length&&(i._gd=e,n.push(i))}return n}(e,t),i=e._infolayer.selectAll("g."+u.containerClassName).data(r.length>0?[0]:[]);if(i.enter().append("g").classed(u.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(u.autoMarginIdRoot)&&a.autoMargin(t,i)}}(t),0!==r.length){var l=i.selectAll("g."+u.groupClassName).data(r,g);l.enter().append("g").classed(u.groupClassName,!0),l.exit().each(function(e){n.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,a.autoMargin(t,u.autoMarginIdRoot+e._index)});for(var s=0;s<r.length;s++){var c=r[s];v(t,c)}l.each(function(e){if(!(e.steps.length<2)){var r=n.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]})}(e),a.manageCommandObserver(t,e,e.steps,function(e){var n=r.data()[0];n.active!==e.index&&(n._dragging||w(t,r,n,e.index,!1,!0))}),function(t,e,r){r.active>=r.steps.length&&(r.active=0);e.call(y,r).call(C,r).call(b,r).call(M,r).call(S,t,r).call(m,t,r);var n=r._dims;o.setTranslate(e,n.lx+r.pad.l,n.ly+r.pad.t),e.call(A,r,r.active/(r.steps.length-1),!1),e.call(y,r)}(t,n.select(this),e)}})}}},{"../../constants/alignment":143,"../../lib":163,"../../lib/svg_text_utils":184,"../../plots/plots":237,"../color":43,"../drawing":68,"../legend/anchor_utils":95,"./constants":132,d3:7}],135:[function(t,e,r){"use strict";var n=t("./constants");e.exports={moduleType:"component",name:n.name,layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":131,"./constants":132,"./defaults":133,"./draw":134}],136:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),l=t("../../lib"),s=t("../drawing"),c=t("../color"),u=t("../../lib/svg_text_utils"),f=t("../../constants/interactions");e.exports={draw:function(t,e,r){var p,h=r.propContainer,g=r.propName,v=r.placeholder,y=r.traceIndex,m=r.avoid||{},x=r.attributes,b=r.transform,_=r.containerGroup,w=t._fullLayout,k=h.titlefont||{},M=k.family,A=k.size,T=k.color,L=1,S=!1,C=(h.title||"").trim();"title"===g?p="titleText":-1!==g.indexOf("axis")?p="axisTitleText":g.indexOf(!0)&&(p="colorbarTitleText");var O=t._context.edits[p];""===C?L=0:C.replace(d," % ")===v.replace(d," % ")&&(L=.2,S=!0,O||(C=""));var P=C||O;_||(_=l.ensureSingle(w._infolayer,"g","g-"+e));var z=_.selectAll("text").data(P?[0]:[]);if(z.enter().append("text"),z.text(C).attr("class",e),z.exit().remove(),!P)return _;function D(t){l.syncOrAsync([E,N],t)}function E(e){var r;return b?(r="",b.rotate&&(r+="rotate("+[b.rotate,x.x,x.y]+")"),b.offset&&(r+="translate(0, "+b.offset+")")):r=null,e.attr("transform",r),e.style({"font-family":M,"font-size":n.round(A,2)+"px",fill:c.rgb(T),opacity:L*c.opacity(T),"font-weight":i.fontWeight}).attr(x).call(u.convertToTspans,t),i.previousPromises(t)}function N(t){var e=n.select(t.node().parentNode);if(m&&m.selection&&m.side&&C){e.attr("transform",null);var r=0,i={left:"right",right:"left",top:"bottom",bottom:"top"}[m.side],o=-1!==["left","top"].indexOf(m.side)?-1:1,c=a(m.pad)?m.pad:2,u=s.bBox(e.node()),f={left:0,top:0,right:w.width,bottom:w.height},d=m.maxShift||(f[m.side]-u[m.side])*("left"===m.side||"top"===m.side?-1:1);if(d<0)r=d;else{var p=m.offsetLeft||0,h=m.offsetTop||0;u.left-=p,u.right-=p,u.top-=h,u.bottom-=h,m.selection.each(function(){var t=s.bBox(this);l.bBoxIntersect(u,t,c)&&(r=Math.max(r,o*(t[m.side]-u[i])+c))}),r=Math.min(d,r)}if(r>0||d<0){var g={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[m.side];e.attr("transform","translate("+g+")")}}}z.call(D),O&&(C?z.on(".opacity",null):(L=0,S=!0,z.text(v).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})),z.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==y?o.call("restyle",t,g,e,y):o.call("relayout",t,g,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(D)}).on("input",function(t){this.text(t||" ").call(u.positionText,x.x,x.y)}));return z.classed("js-placeholder",S),_}};var d=/ [XY][0-9]* /},{"../../constants/interactions":144,"../../lib":163,"../../lib/svg_text_utils":184,"../../plots/plots":237,"../../registry":245,"../color":43,"../drawing":68,d3:7,"fast-isnumeric":10}],137:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/pad_attributes");e.exports=o({_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:i({},l,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":157,"../../plot_api/edit_types":190,"../../plots/font_attributes":231,"../../plots/pad_attributes":236,"../color/attributes":42}],138:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],139:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,l=i.buttons;function s(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}var o=function(t,e){var r,a,i=t.buttons||[],o=e.buttons=[];function s(t,e){return n.coerce(r,a,l,t,e)}for(var c=0;c<i.length;c++)r=i[c],a={},s("method"),n.isPlainObject(r)&&("skip"===a.method||Array.isArray(r.args))&&(s("args"),s("label"),s("execute"),a._index=c,o.push(a));return o}(t,e);a("visible",o.length>0)&&(a("active"),a("direction"),a("type"),a("showactive"),a("x"),a("y"),n.noneOrAll(t,e,["x","y"]),a("xanchor"),a("yanchor"),a("pad.t"),a("pad.r"),a("pad.b"),a("pad.l"),n.coerceFont(a,"font",r.font),a("bgcolor",r.paper_bgcolor),a("bordercolor"),a("borderwidth"))}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:s})}},{"../../lib":163,"../../plots/array_container_defaults":201,"./attributes":137,"./constants":138}],140:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),l=t("../../lib"),s=t("../../lib/svg_text_utils"),c=t("../legend/anchor_utils"),u=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),d=t("./scrollbox");function p(t){return t._index}function h(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function g(t,e,r,n,a,i,o,l){e._input.active=e.active=o,"buttons"===e.type?y(t,n,null,null,e):"dropdown"===e.type&&(a.attr(f.menuIndexAttrName,"-1"),v(t,n,a,i,e),l||y(t,n,a,i,e))}function v(t,e,r,n,a){var i=l.ensureSingle(e,"g",f.headerClassName,function(t){t.style("pointer-events","all")}),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(m,a,u,t).call(A,a,d,p),l.ensureSingle(e,"text",f.headerArrowClassName,function(t){t.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])}).attr({x:s.headerWidth-f.arrowOffsetX+a.pad.l,y:s.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",function(){r.call(T),r.attr(f.menuIndexAttrName,h(r,a)?-1:String(a._index)),y(t,e,r,n,a)}),i.on("mouseover",function(){i.call(w)}),i.on("mouseout",function(){i.call(k,a)}),o.setTranslate(e,s.lx,s.ly)}function y(t,e,r,i,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,s="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,c=r.selectAll("g."+s).data(l),u=c.enter().append("g").classed(s,!0),d=c.exit();"dropdown"===o.type?(u.attr("opacity","0").transition().attr("opacity","1"),d.transition().attr("opacity","0").remove()):d.remove();var p=0,h=0,v=o._dims,y=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(y?h=v.headerHeight+f.gapButtonHeader:p=v.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-v.openHeight),"dropdown"===o.type&&"left"===o.direction&&(p=-f.gapButtonHeader+f.gapButton-v.openWidth);var x={x:v.lx+p+o.pad.l,y:v.ly+h+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},b={l:x.x+o.borderwidth,t:x.y+o.borderwidth};c.each(function(l,s){var u=n.select(this);u.call(m,o,l,t).call(A,o,x),u.on("click",function(){n.event.defaultPrevented||(g(t,o,0,e,r,i,s),l.execute&&a.executeAPICommand(t,l.method,l.args),t.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))}),u.on("mouseover",function(){u.call(w)}),u.on("mouseout",function(){u.call(k,o),c.call(_,o)})}),c.call(_,o),y?(b.w=Math.max(v.openWidth,v.headerWidth),b.h=x.y-b.t):(b.w=x.x-b.l,b.h=Math.max(v.openHeight,v.headerHeight)),b.direction=o.direction,i&&(c.size()?function(t,e,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s<p;s++)l+=d.heights[s]+f.gapButton;else for(o=0,s=0;s<p;s++)o+=d.widths[s]+f.gapButton;n.enable(i,o,l),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,o,b):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 m(t,e,r,n){t.call(x,e).call(b,e,r,n)}function x(t,e){l.ensureSingle(t,"rect",f.itemRectClassName,function(t){t.attr({rx:f.rx,ry:f.ry,"shape-rendering":"crispEdges"})}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px")}function b(t,e,r,n){l.ensureSingle(t,"text",f.itemTextClassName,function(t){t.classed("user-select-none",!0).attr({"text-anchor":"start","data-notex":1})}).call(o.font,e.font).text(r.label).call(s.convertToTspans,n)}function _(t,e){var r=e.active;t.each(function(t,a){var o=n.select(this);a===r&&e.showactive&&o.select("rect."+f.itemRectClassName).call(i.fill,f.activeColor)})}function w(t){t.select("rect."+f.itemRectClassName).call(i.fill,f.hoverColor)}function k(t,e){t.select("rect."+f.itemRectClassName).call(i.fill,e.bgcolor)}function M(t,e){var r=e._dims={width1:0,height1:0,heights:[],widths:[],totalWidth:0,totalHeight:0,openWidth:0,openHeight:0,lx:0,ly:0},i=o.tester.selectAll("g."+f.dropdownButtonClassName).data(e.buttons);i.enter().append("g").classed(f.dropdownButtonClassName,!0);var l=-1!==["up","down"].indexOf(e.direction);i.each(function(a,i){var c=n.select(this);c.call(m,e,a,t);var d=c.select("."+f.itemTextClassName),p=d.node()&&o.bBox(d.node()).width,h=Math.max(p+f.textPadX,f.minWidth),g=e.font.size*u,v=s.lineCount(d),y=Math.max(g*v,f.minHeight)+f.textOffsetY;y=Math.ceil(y),h=Math.ceil(h),r.widths[i]=h,r.heights[i]=y,r.height1=Math.max(r.height1,y),r.width1=Math.max(r.width1,h),l?(r.totalWidth=Math.max(r.totalWidth,h),r.openWidth=r.totalWidth,r.totalHeight+=y+f.gapButton,r.openHeight+=y+f.gapButton):(r.totalWidth+=h+f.gapButton,r.openWidth+=h+f.gapButton,r.totalHeight=Math.max(r.totalHeight,y),r.openHeight=r.totalHeight)}),l?r.totalHeight-=f.gapButton:r.totalWidth-=f.gapButton,r.headerWidth=r.width1+f.arrowPadX,r.headerHeight=r.height1,"dropdown"===e.type&&(l?(r.width1+=f.arrowPadX,r.totalHeight=r.height1):r.totalWidth=r.width1,r.totalWidth+=f.arrowPadX),i.remove();var d=r.totalWidth+e.pad.l+e.pad.r,p=r.totalHeight+e.pad.t+e.pad.b,h=t._fullLayout._size;r.lx=h.l+h.w*e.x,r.ly=h.t+h.h*(1-e.y);var g="left";c.isRightAnchor(e)&&(r.lx-=d,g="right"),c.isCenterAnchor(e)&&(r.lx-=d/2,g="center");var v="top";c.isBottomAnchor(e)&&(r.ly-=p,v="bottom"),c.isMiddleAnchor(e)&&(r.ly-=p/2,v="middle"),r.totalWidth=Math.ceil(r.totalWidth),r.totalHeight=Math.ceil(r.totalHeight),r.lx=Math.round(r.lx),r.ly=Math.round(r.ly),a.autoMargin(t,f.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:d*({right:1,center:.5}[g]||0),r:d*({left:1,center:.5}[g]||0),b:p*({top:1,middle:.5}[v]||0),t:p*({bottom:1,middle:.5}[v]||0)})}function A(t,e,r,n){n=n||{};var a=t.select("."+f.itemRectClassName),i=t.select("."+f.itemTextClassName),l=e.borderwidth,c=r.index,d=e._dims;o.setTranslate(t,l+r.x,l+r.y);var p=-1!==["up","down"].indexOf(e.direction),h=n.height||(p?d.heights[c]:d.height1);a.attr({x:0,y:0,width:n.width||(p?d.width1:d.widths[c]),height:h});var g=e.font.size*u,v=(s.lineCount(i)-1)*g/2;s.positionText(i,f.textOffsetX,h/2-v+f.textOffsetY),p?r.y+=d.heights[c]+r.yPad:r.x+=d.widths[c]+r.xPad,r.index++}function T(t){t.selectAll("g."+f.dropdownButtonClassName).remove()}e.exports=function(t){var e=t._fullLayout,r=function(t){for(var e=t[f.name],r=[],n=0;n<e.length;n++){var a=e[n];a.visible&&r.push(a)}return r}(e),i=e._menulayer.selectAll("g."+f.containerClassName).data(r.length>0?[0]:[]);if(i.enter().append("g").classed(f.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(f.autoMarginIdRoot)&&a.autoMargin(t,i)}}(t),0!==r.length){var o=i.selectAll("g."+f.headerGroupClassName).data(r,p);o.enter().append("g").classed(f.headerGroupClassName,!0);for(var s=l.ensureSingle(i,"g",f.dropdownButtonGroupClassName,function(t){t.style("pointer-events","all")}),c=0;c<r.length;c++){var u=r[c];M(t,u)}var m="updatemenus"+e._uid,x=new d(t,s,m);o.enter().size()&&(s.node().parentNode.appendChild(s.node()),s.call(T).attr(f.menuIndexAttrName,"-1")),o.exit().each(function(e){n.select(this).remove(),s.call(T).attr(f.menuIndexAttrName,"-1"),a.autoMargin(t,f.autoMarginIdRoot+e._index)}),o.each(function(e){var r=n.select(this),i="dropdown"===e.type?s:null;a.manageCommandObserver(t,e,e.buttons,function(n){g(t,e,e.buttons[n.index],r,i,x,n.index,!0)}),"dropdown"===e.type?(v(t,r,s,x,e),h(s,e)&&y(t,r,s,x,e)):y(t,r,null,null,e)})}}},{"../../constants/alignment":143,"../../lib":163,"../../lib/svg_text_utils":184,"../../plots/plots":237,"../color":43,"../drawing":68,"../legend/anchor_utils":95,"./constants":138,"./scrollbox":142,d3:7}],141:[function(t,e,r){arguments[4][135][0].apply(r,arguments)},{"./attributes":137,"./constants":138,"./defaults":139,"./draw":140,dup:135}],142:[function(t,e,r){"use strict";e.exports=l;var n=t("d3"),a=t("../color"),i=t("../drawing"),o=t("../../lib");function l(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})}l.barWidth=2,l.barLength=20,l.barRadius=2,l.barPad=1,l.barColor="#808BA4",l.prototype.enable=function(t,e,r){var o=this.gd._fullLayout,s=o.width,c=o.height;this.position=t;var u,f,d,p,h=this.position.l,g=this.position.w,v=this.position.t,y=this.position.h,m=this.position.direction,x="down"===m,b="left"===m,_="up"===m,w=g,k=y;x||b||"right"===m||_||(this.position.direction="down",x=!0),x||_?(f=(u=h)+w,x?(d=v,k=(p=Math.min(d+k,c))-d):k=(p=v+k)-(d=Math.max(p-k,0))):(p=(d=v)+k,b?w=(f=h+w)-(u=Math.max(f-w,0)):(u=h,w=(f=Math.min(u+w,s))-u)),this._box={l:u,t:d,w:w,h:k};var M=g>w,A=l.barLength+2*l.barPad,T=l.barWidth+2*l.barPad,L=h,S=v+y;S+T>c&&(S=c-T);var C=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),M?(this.hbar=C.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:A,height:T}),this._hbarXMin=L+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=y>k,P=l.barWidth+2*l.barPad,z=l.barLength+2*l.barPad,D=h+g,E=v;D+P>s&&(D=s-P);var N=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);N.exit().on(".drag",null).remove(),N.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),O?(this.vbar=N.attr({rx:l.barRadius,ry:l.barRadius,x:D,y:E,width:P,height:z}),this._vbarYMin=E+z/2,this._vbarTranslateMax=k-z):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,I=u-.5,F=O?f+P+.5:f+.5,j=d-.5,B=M?p+T+.5:p+.5,H=o._topdefs.selectAll("#"+R).data(M||O?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",R).append("rect"),M||O?(this._clipRect=H.select("rect").attr({x:Math.floor(I),y:Math.floor(j),width:Math.ceil(F)-Math.floor(I),height:Math.ceil(B)-Math.floor(j)}),this.container.call(i.setClipUrl,R),this.bg.attr({x:h,y:v,width:g,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),M||O){var q=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(q);var V=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(V),O&&this.vbar.on(".drag",null).call(V)}this.setTranslate(e,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.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)},l.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},l.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},l.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,a=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,l=i+this._vbarTranslateMax;e=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},l.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.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 a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var l=e/n;this.vbar.call(i.setTranslate,t,e+l*this._vbarTranslateMax)}}},{"../../lib":163,"../color":43,"../drawing":68,d3:7}],143:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],144:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],145:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],146:[function(t,e,r){"use strict";e.exports={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"}}},{}],147:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],148:[function(t,e,r){"use strict";r.version="1.38.3",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config");for(var n=t("./registry"),a=r.register=n.register,i=t("./plot_api"),o=Object.keys(i),l=0;l<o.length;l++){var s=o[l];r[s]=i[s],a({moduleType:"apiMethod",name:s,fn:i[s]})}a(t("./traces/scatter")),a([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector"),t("./components/grid"),t("./components/errorbars")]),a([t("./locale-en"),t("./locale-en-us")]),r.Icons=t("../build/ploticon"),r.Plots=t("./plots/plots"),r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":36,"./components/annotations3d":41,"./components/errorbars":74,"./components/fx":85,"./components/grid":89,"./components/images":94,"./components/legend":103,"./components/rangeselector":115,"./components/rangeslider":121,"./components/shapes":129,"./components/sliders":135,"./components/updatemenus":141,"./fonts/mathjax_config":149,"./lib/queue":177,"./locale-en":188,"./locale-en-us":187,"./plot_api":192,"./plot_api/plot_schema":196,"./plots/plots":237,"./registry":245,"./snapshot":250,"./traces/scatter":293,d3:7,"es6-promise":8}],149:[function(t,e,r){"use strict";"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],150:[function(t,e,r){"use strict";var n=Math.PI;r.deg2rad=function(t){return t/180*n},r.rad2deg=function(t){return t/n*180},r.wrap360=function(t){var e=t%360;return e<0?e+360:e},r.wrap180=function(t){return Math.abs(t)>180&&(t-=360*Math.round(t/360)),t}},{}],151:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../constants/numerical").BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(i,"")),n(t)?Number(t):a}},{"../constants/numerical":145,"fast-isnumeric":10}],152:[function(t,e,r){"use strict";e.exports=function(t){var e=t._fullLayout;e._glcanvas&&e._glcanvas.size()&&e._glcanvas.each(function(t){t.regl&&t.regl.clear({color:!0,depth:!0})})}},{}],153:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),l=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),s=t("./regex").counter,c=t("../constants/interactions").DESELECTDIM,u=t("./angles").wrap180,f=t("./is_array").isArrayOrTypedArray;r.valObjectMeta={data_array:{coerceFunction:function(t,e,r){f(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 a=String(r[n]);if("/"===a.charAt(0)&&"/"===a.charAt(a.length-1)){if(new RegExp(a.substr(1,a.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,r,a){!n(t)||void 0!==a.min&&t<a.min||void 0!==a.max&&t>a.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&t<a.min||void 0!==a.max&&t>a.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every(function(t){return a(t).isValid()})?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(u(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var a=n.regex||s(r);"string"==typeof t&&a.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!s(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var a=t.split("+"),i=0;i<a.length;){var o=a[i];-1===n.flags.indexOf(o)||a.indexOf(o)<i?a.splice(i,1):i++}a.length?e.set(a.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,n,a){function i(t,e,n){var a,i={set:function(t){a=t}};return void 0===n&&(n=e.dflt),r.valObjectMeta[e.valType].coerceFunction(t,i,n,e),a}var o=2===a.dimensions||"1-2"===a.dimensions&&Array.isArray(t)&&Array.isArray(t[0]);if(Array.isArray(t)){var l,s,c,u,f,d,p=a.items,h=[],g=Array.isArray(p),v=g&&o&&Array.isArray(p[0]),y=o&&g&&!v,m=g&&!y?p.length:t.length;if(n=Array.isArray(n)?n:[],o)for(l=0;l<m;l++)for(h[l]=[],c=Array.isArray(t[l])?t[l]:[],f=y?p.length:g?p[l].length:c.length,s=0;s<f;s++)u=y?p[s]:g?p[l][s]:p,void 0!==(d=i(c[s],u,(n[l]||[])[s]))&&(h[l][s]=d);else for(l=0;l<m;l++)void 0!==(d=i(t[l],g?p[l]:p,n[l]))&&(h[l]=d);e.set(h)}else e.set(n)},validateFunction:function(t,e){if(!Array.isArray(t))return!1;var n=e.items,a=Array.isArray(n),i=2===e.dimensions;if(!e.freeLength&&t.length!==n.length)return!1;for(var o=0;o<t.length;o++)if(i){if(!Array.isArray(t[o])||!e.freeLength&&t[o].length!==n[o].length)return!1;for(var l=0;l<t[o].length;l++)if(!r.validate(t[o][l],a?n[o][l]:n))return!1}else if(!r.validate(t[o],a?n[o]:n))return!1;return!0}}},r.coerce=function(t,e,n,a,i){var o=l(n,a).get(),s=l(t,a),c=l(e,a),u=s.get();return void 0===i&&(i=o.dflt),o.arrayOk&&f(u)?(c.set(u),u):(r.valObjectMeta[o.valType].coerceFunction(u,c,i,o),c.get())},r.coerce2=function(t,e,n,a,i){var o=l(t,a),s=r.coerce(t,e,n,a,i),c=o.get();return null!=c&&s},r.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},r.coerceHoverinfo=function(t,e,n){var a,o=e._module.attributes,l=o.hoverinfo?o:i,s=l.hoverinfo;if(1===n._dataLength){var c="all"===s.dflt?s.flags.slice():s.dflt.split("+");c.splice(c.indexOf("name"),1),a=c.join("+")}return r.coerce(t,e,l,"hoverinfo",a)},r.coerceSelectionMarkerOpacity=function(t,e){if(t.marker){var r,n,a=t.marker.opacity;if(void 0!==a)f(a)||t.selected||t.unselected||(r=a,n=c*a),e("selected.marker.opacity",r),e("unselected.marker.opacity",n)}},r.validate=function(t,e){var n=r.valObjectMeta[e.valType];if(e.arrayOk&&f(t))return!0;if(n.validateFunction)return n.validateFunction(t,e);var a={},i=a,o={set:function(t){i=t}};return n.coerceFunction(t,o,a,e),i!==a}},{"../components/colorscale/get_scale":56,"../components/colorscale/scales":62,"../constants/interactions":144,"../plots/attributes":202,"./angles":150,"./is_array":164,"./nested_property":171,"./regex":178,"fast-isnumeric":10,tinycolor2:25}],154:[function(t,e,r){"use strict";var n,a,i=t("d3"),o=t("fast-isnumeric"),l=t("./loggers"),s=t("./mod"),c=t("../constants/numerical"),u=c.BADNUM,f=c.ONEDAY,d=c.ONEHOUR,p=c.ONEMIN,h=c.ONESEC,g=c.EPOCHJD,v=t("../registry"),y=i.time.format.utc,m=/^\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,x=/^\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,b=(new Date).getFullYear()-70;function _(t){return t&&v.componentsRegistry.calendars&&"string"==typeof t&&"gregorian"!==t}function w(t,e){return String(t+Math.pow(10,e)).substr(1)}r.dateTick0=function(t,e){return _(t)?e?v.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:v.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return _(t)?v.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime},r.dateTime2ms=function(t,e){if(r.isJSDate(t))return(t=Number(t)-t.getTimezoneOffset()*p)>=n&&t<=a?t:u;if("string"!=typeof t&&"number"!=typeof t)return u;t=String(t);var i=_(e),o=t.charAt(0);!i||"G"!==o&&"g"!==o||(t=t.substr(1),e="");var l=i&&"chinese"===e.substr(0,7),s=t.match(l?x:m);if(!s)return u;var c=s[1],y=s[3]||"1",w=Number(s[5]||1),k=Number(s[7]||0),M=Number(s[9]||0),A=Number(s[11]||0);if(i){if(2===c.length)return u;var T;c=Number(c);try{var L=v.getComponentMethod("calendars","getCal")(e);if(l){var S="i"===y.charAt(y.length-1);y=parseInt(y,10),T=L.newDate(c,L.toMonthIndex(c,y,S),w)}else T=L.newDate(c,Number(y),w)}catch(t){return u}return T?(T.toJD()-g)*f+k*d+M*p+A*h:u}c=2===c.length?(Number(c)+2e3-b)%100+b:Number(c),y-=1;var C=new Date(Date.UTC(2e3,y,w,k,M));return C.setUTCFullYear(c),C.getUTCMonth()!==y?u:C.getUTCDate()!==w?u:C.getTime()+A*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==u};var k=90*f,M=3*d,A=5*p;function T(t,e,r,n,a){if((e||r||n||a)&&(t+=" "+w(e,2)+":"+w(r,2),(n||a)&&(t+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;t+="."+w(a,i)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=a))return u;e||(e=0);var i,o,l,c,m,x,b=Math.floor(10*s(t+.05,1)),w=Math.round(t-b/10);if(_(r)){var L=Math.floor(w/f)+g,S=Math.floor(s(t,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(t){i=y("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e<k?Math.floor(S/d):0,l=e<k?Math.floor(S%d/p):0,c=e<M?Math.floor(S%p/h):0,m=e<A?S%h*10+b:0}else x=new Date(w),i=y("%Y-%m-%d")(x),o=e<k?x.getUTCHours():0,l=e<k?x.getUTCMinutes():0,c=e<M?x.getUTCSeconds():0,m=e<A?10*x.getUTCMilliseconds()+b:0;return T(i,o,l,c,m)},r.ms2DateTimeLocal=function(t){if(!(t>=n+f&&t<=a-f))return u;var e=Math.floor(10*s(t+.05,1)),r=new Date(Math.round(t-e/10));return T(i.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(r.isJSDate(t)||"number"==typeof t){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return l.error("unrecognized date",t),e;return t};var L=/%\d?f/g;function S(t,e,r,n){t=t.replace(L,function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"});var a=new Date(Math.floor(e+.05));if(_(n))try{t=v.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,a,i){if(a=_(a)&&a,!e)if("y"===r)e=i.year;else if("m"===r)e=i.month;else{if("d"!==r)return function(t,e){var r=s(t+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==e){o(e)||(e=0);var a=(100+Math.min(s(t/h,60),C[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+S(i.dayMonthYear,t,n,a);e=i.dayMonth+"\n"+i.year}return S(e,t,n,a)};var O=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=s(t,f);if(t=Math.round(t-n),r)try{var a=Math.round(t/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return e%12?i.add(o,e,"m"):i.add(o,e/12,"y"),(o.toJD()-g)*f+n}catch(e){l.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+O);return c.setUTCMonth(c.getUTCMonth()+e)+n-O},r.findExactDates=function(t,e){for(var r,n,a=0,i=0,l=0,s=0,c=_(e)&&v.getComponentMethod("calendars","getCal")(e),u=0;u<t.length;u++)if(n=t[u],o(n)){if(!(n%f))if(c)try{1===(r=c.fromJD(n/f+g)).day()?1===r.month()?a++:i++:l++}catch(t){}else 1===(r=new Date(n)).getUTCDate()?0===r.getUTCMonth()?a++:i++:l++}else s++;l+=i+=a;var d=t.length-s;return{exactYears:a/d,exactMonths:i/d,exactDays:l/d}}},{"../constants/numerical":145,"../registry":245,"./loggers":168,"./mod":170,d3:7,"fast-isnumeric":10}],155:[function(t,e,r){"use strict";e.exports=function(t,e){return Array.isArray(t)||(t=[]),t.length=e,t}},{}],156:[function(t,e,r){"use strict";var n=t("events").EventEmitter,a={init:function(t){if(t._ev instanceof n)return t;var e=new n,r=new n;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,a){"undefined"!=typeof jQuery&&jQuery(t).trigger(n,a),e.emit(n,a),r.emit(n,a)},t},triggerHandler:function(t,e,r){var n,a;"undefined"!=typeof jQuery&&(n=jQuery(t).triggerHandler(e,r));var i=t._ev;if(!i)return n;var o,l=i._events[e];if(!l)return n;function s(t){return t.listener?(i.removeListener(e,t.listener),t.fired?void 0:(t.fired=!0,t.listener.apply(i,[r]))):t.apply(i,[r])}for(l=Array.isArray(l)?l:[l],o=0;o<l.length-1;o++)s(l[o]);return a=s(l[o]),void 0!==n?n:a},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}};e.exports=a},{events:9}],157:[function(t,e,r){"use strict";var n=t("./is_plain_object.js"),a=Array.isArray;function i(t,e,r,o){var l,s,c,u,f,d,p=t[0],h=t.length;if(2===h&&a(p)&&a(t[1])&&0===p.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],p))return p;p.splice(0,p.length)}for(var g=1;g<h;g++)for(s in l=t[g])c=p[s],u=l[s],o&&a(u)?p[s]=u:e&&u&&(n(u)||(f=a(u)))?(f?(f=!1,d=c&&a(c)?c:[]):d=c&&n(c)?c:{},p[s]=i([d,u],e,r,o)):(void 0!==u||r)&&(p[s]=u);return p}r.extendFlat=function(){return i(arguments,!1,!1,!1)},r.extendDeep=function(){return i(arguments,!0,!1,!1)},r.extendDeepAll=function(){return i(arguments,!0,!0,!1)},r.extendDeepNoArrays=function(){return i(arguments,!0,!1,!0)}},{"./is_plain_object.js":165}],158:[function(t,e,r){"use strict";e.exports=function(t){for(var e={},r=[],n=0,a=0;a<t.length;a++){var i=t[a];1!==e[i]&&(e[i]=1,r[n++]=i)}return r}},{}],159:[function(t,e,r){"use strict";function n(t){return!0===t.visible}function a(t){return!0===t[0].trace.visible}e.exports=function(t){for(var e,r=(e=t,Array.isArray(e)&&Array.isArray(e[0])&&e[0][0]&&e[0][0].trace?a:n),i=[],o=0;o<t.length;o++){var l=t[o];r(l)&&i.push(l)}return i}},{}],160:[function(t,e,r){"use strict";var n,a,i,o=t("./mod");function l(t,e,r,n,a,i,o,l){var s=r-t,c=a-t,u=o-a,f=n-e,d=i-e,p=l-i,h=s*p-u*f;if(0===h)return null;var g=(c*p-u*d)/h,v=(c*f-s*d)/h;return v<0||v>1||g<0||g>1?null:{x:t+s*g,y:e+f*g}}function s(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,l=a-e;return o*o+l*l}var s=n*e-a*t;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(t,e,r,n,a,i,o,c){if(l(t,e,r,n,a,i,o,c))return 0;var u=r-t,f=n-e,d=o-a,p=c-i,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-t,i-e),s(u,f,h,o-t,c-e),s(d,p,g,t-a,e-i),s(d,p,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(t,e,r,l){if(t===a&&l===i||(n={},a=t,i=l),n[r])return n[r];var s=t.getPointAtLength(o(r-l/2,e)),c=t.getPointAtLength(o(r+l/2,e)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=t.getPointAtLength(o(r,e)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(t,e,r){var n,a,i=e.left,o=e.right,l=e.top,s=e.bottom,c=0,u=t.getTotalLength(),f=u;function d(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(a=r);var c=r.x<i?i-r.x:r.x>o?r.x-o:0,f=r.y<l?l-r.y:r.y>s?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var a,i,o,l=(n=n||{}).pathLength||t.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f<c;){if(a=(d+p)/2,o=(i=t.getPointAtLength(a))[r]-e,Math.abs(o)<s)return i;u*o>0?p=a:d=a,f++}return i}},{"./mod":170}],161:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null==t)throw new Error("DOM element provided is null or undefined");return t}},{}],162:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],163:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../constants/numerical"),o=i.FP_SAFE,l=i.BADNUM,s=e.exports={};s.nestedProperty=t("./nested_property"),s.keyedContainer=t("./keyed_container"),s.relativeAttr=t("./relative_attr"),s.isPlainObject=t("./is_plain_object"),s.mod=t("./mod"),s.toLogRange=t("./to_log_range"),s.relinkPrivateKeys=t("./relink_private"),s.ensureArray=t("./ensure_array");var c=t("./is_array");s.isTypedArray=c.isTypedArray,s.isArrayOrTypedArray=c.isArrayOrTypedArray,s.isArray1D=c.isArray1D;var u=t("./coerce");s.valObjectMeta=u.valObjectMeta,s.coerce=u.coerce,s.coerce2=u.coerce2,s.coerceFont=u.coerceFont,s.coerceHoverinfo=u.coerceHoverinfo,s.coerceSelectionMarkerOpacity=u.coerceSelectionMarkerOpacity,s.validate=u.validate;var f=t("./dates");s.dateTime2ms=f.dateTime2ms,s.isDateTime=f.isDateTime,s.ms2DateTime=f.ms2DateTime,s.ms2DateTimeLocal=f.ms2DateTimeLocal,s.cleanDate=f.cleanDate,s.isJSDate=f.isJSDate,s.formatDate=f.formatDate,s.incrementMonth=f.incrementMonth,s.dateTick0=f.dateTick0,s.dfltRange=f.dfltRange,s.findExactDates=f.findExactDates,s.MIN_MS=f.MIN_MS,s.MAX_MS=f.MAX_MS;var d=t("./search");s.findBin=d.findBin,s.sorterAsc=d.sorterAsc,s.sorterDes=d.sorterDes,s.distinctVals=d.distinctVals,s.roundUp=d.roundUp;var p=t("./stats");s.aggNums=p.aggNums,s.len=p.len,s.mean=p.mean,s.midRange=p.midRange,s.variance=p.variance,s.stdev=p.stdev,s.interp=p.interp;var h=t("./matrix");s.init2dArray=h.init2dArray,s.transposeRagged=h.transposeRagged,s.dot=h.dot,s.translationMatrix=h.translationMatrix,s.rotationMatrix=h.rotationMatrix,s.rotationXYMatrix=h.rotationXYMatrix,s.apply2DTransform=h.apply2DTransform,s.apply2DTransform2=h.apply2DTransform2;var g=t("./angles");s.deg2rad=g.deg2rad,s.rad2deg=g.rad2deg,s.wrap360=g.wrap360,s.wrap180=g.wrap180;var v=t("./geometry2d");s.segmentsIntersect=v.segmentsIntersect,s.segmentDistance=v.segmentDistance,s.getTextLocation=v.getTextLocation,s.clearLocationCache=v.clearLocationCache,s.getVisibleSegment=v.getVisibleSegment,s.findPointOnPath=v.findPointOnPath;var y=t("./extend");s.extendFlat=y.extendFlat,s.extendDeep=y.extendDeep,s.extendDeepAll=y.extendDeepAll,s.extendDeepNoArrays=y.extendDeepNoArrays;var m=t("./loggers");s.log=m.log,s.warn=m.warn,s.error=m.error;var x=t("./regex");s.counterRegex=x.counter;var b=t("./throttle");function _(t){var e={};for(var r in t)for(var n=t[r],a=0;a<n.length;a++)e[n[a]]=+r;return e}s.throttle=b.throttle,s.throttleDone=b.done,s.clearThrottle=b.clear,s.getGraphDiv=t("./get_graph_div"),s._=t("./localize"),s.notifier=t("./notifier"),s.filterUnique=t("./filter_unique"),s.filterVisible=t("./filter_visible"),s.pushUnique=t("./push_unique"),s.cleanNumber=t("./clean_number"),s.ensureNumber=function(t){return a(t)?(t=Number(t))<-o||t>o?l:a(t)?Number(t):l:l},s.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&(a(t)&&t>=0&&t%1==0)},s.noop=t("./noop"),s.identity=t("./identity"),s.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var a=0;a<e.length;a++){var i=e[a],o=s.nestedProperty(t,i.replace("?",r)),l=s.nestedProperty(t,i.replace("?",n)),c=o.get();o.set(l.get()),l.set(c)}},s.raiseToTop=function(t){t.parentNode.appendChild(t)},s.cancelTransition=function(t){return t.transition().duration(0)},s.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},s.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},s.simpleMap=function(t,e,r,n){for(var a=t.length,i=new Array(a),o=0;o<a;o++)i[o]=e(t[o],r,n);return i},s.randstr=function t(e,r,n){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var a,i,o=Math.log(Math.pow(2,r))/Math.log(n),l="";for(a=2;o===1/0;a*=2)o=Math.log(Math.pow(2,r/a))/Math.log(n)*a;var s=o-Math.floor(o);for(a=0;a<Math.floor(o);a++)l=Math.floor(Math.random()*n).toString(n)+l;s&&(i=Math.pow(n,s),l=Math.floor(Math.random()*i).toString(n)+l);var c=parseInt(l,n);return e&&e.indexOf(l)>-1||c!==1/0&&c>=Math.pow(2,r)?t(e,r,n):l},s.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},s.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,l=2*o,s=2*e-1,c=new Array(s),u=new Array(o);for(r=0;r<s;r++)c[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;r<o;r++){for(i=0,n=0;n<s;n++)(a=r+n+1-e)<-o?a-=l*Math.round(a/l):a>=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=t[a]*c[n];u[r]=i}return u},s.syncOrAsync=function(t,e,r){var n;function a(){return s.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(a).then(void 0,s.promiseError);return r&&r(e)},s.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},s.noneOrAll=function(t,e,r){if(t){var n,a=!1,i=!0;for(n=0;n<r.length;n++)null!=t[r[n]]?a=!0:i=!1;if(a&&!i)for(n=0;n<r.length;n++)t[r[n]]=e[r[n]]}},s.mergeArray=function(t,e,r){if(s.isArrayOrTypedArray(t))for(var n=Math.min(t.length,e.length),a=0;a<n;a++)e[a][r]=t[a]},s.fillArray=function(t,e,r,n){if(n=n||s.identity,s.isArrayOrTypedArray(t))for(var a=0;a<e.length;a++)e[a][r]=n(t[a])},s.castOption=function(t,e,r,n){n=n||s.identity;var a=s.nestedProperty(t,r).get();return s.isArrayOrTypedArray(a)?Array.isArray(e)&&s.isArrayOrTypedArray(a[e[0]])?n(a[e[0]][e[1]]):n(a[e]):a},s.extractOption=function(t,e,r,n){if(r in t)return t[r];var a=s.nestedProperty(e,n).get();return Array.isArray(a)?void 0:a},s.tagSelected=function(t,e,r){var n,a,i=e.selectedpoints,o=e._indexToPoints;o&&(n=_(o));for(var l=0;l<i.length;l++){var c=i[l];if(s.isIndex(c)){var u=n?n[c]:c,f=r?r[u]:u;void 0!==(a=f)&&a<t.length&&(t[f].selected=1)}}},s.selIndices2selPoints=function(t){var e=t.selectedpoints,r=t._indexToPoints;if(r){for(var n=_(r),a=[],i=0;i<e.length;i++){var o=e[i];if(s.isIndex(o)){var l=n[o];s.isIndex(l)&&a.push(l)}}return a}return e},s.getTargetArray=function(t,e){var r=e.target;if("string"==typeof r&&r){var n=s.nestedProperty(t,r).get();return!!Array.isArray(n)&&n}return!!Array.isArray(r)&&r},s.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,a,i,o=Object.keys(t);for(n=0;n<o.length;n++)i=t[a=o[n]],"_"!==a.charAt(0)&&"function"!=typeof i&&("module"===a?r[a]=i:Array.isArray(i)?r[a]=i.slice(0,3):r[a]=i&&"object"==typeof i?s.minExtend(t[a],e[a]):i);for(o=Object.keys(e),n=0;n<o.length;n++)"object"==typeof(i=e[a=o[n]])&&a in r&&"object"==typeof r[a]||(r[a]=i);return r},s.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},s.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r]))return!0;return!1},s.isPlotDiv=function(t){var e=n.select(t);return e.node()instanceof HTMLElement&&e.size()&&e.classed("js-plotly-plot")},s.removeElement=function(t){var e=t&&t.parentNode;e&&e.removeChild(t)},s.addStyleRule=function(t,e){if(!s.styleSheet){var r=document.createElement("style");r.appendChild(document.createTextNode("")),document.head.appendChild(r),s.styleSheet=r.sheet}var n=s.styleSheet;n.insertRule?n.insertRule(t+"{"+e+"}",0):n.addRule?n.addRule(t,e,0):s.warn("addStyleRule failed")},s.isIE=function(){return void 0!==window.navigator.msSaveBlob},s.isD3Selection=function(t){return t&&"function"==typeof t.classed},s.ensureSingle=function(t,e,r,n){var a=t.select(e+(r?"."+r:""));if(a.size())return a;var i=t.append(e).classed(r,!0);return n&&i.call(n),i},s.ensureSingleById=function(t,e,r,n){var a=t.select(e+"#"+r);if(a.size())return a;var i=t.append(e).attr("id",r);return n&&i.call(n),i},s.objectFromPath=function(t,e){for(var r,n=t.split("."),a=r={},i=0;i<n.length;i++){var o=n[i],l=null,s=n[i].match(/(.*)\[([0-9]+)\]/);s?(o=s[1],l=s[2],r=r[o]=[],i===n.length-1?r[l]=e:r[l]={},r=r[l]):(i===n.length-1?r[o]=e:r[o]={},r=r[o])}return a};var w=/^([^\[\.]+)\.(.+)?/,k=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;s.expandObjectPaths=function(t){var e,r,n,a,i,o,l;if("object"==typeof t&&!Array.isArray(t))for(r in t)t.hasOwnProperty(r)&&((e=r.match(w))?(a=t[r],n=e[1],delete t[r],t[n]=s.extendDeepNoArrays(t[n]||{},s.objectFromPath(r,s.expandObjectPaths(a))[n])):(e=r.match(k))?(a=t[r],n=e[1],i=parseInt(e[2]),delete t[r],t[n]=t[n]||[],"."===e[3]?(l=e[4],o=t[n][i]=t[n][i]||{},s.extendDeepNoArrays(o,s.objectFromPath(l,s.expandObjectPaths(a)))):t[n][i]=s.expandObjectPaths(a)):t[r]=s.expandObjectPaths(t[r]));return t},s.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})/,a=e.charAt(0),i=e.charAt(1),o=t.split("."),l=o[0],s=o.length>1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s};var M=/%{([^\s%{}]*)}/g,A=/^\w*$/;s.templateString=function(t,e){var r={};return t.replace(M,function(t,n){return A.test(n)?e[n]||"":(r[n]=r[n]||s.nestedProperty(e,n).get,r[n]()||"")})};s.subplotSort=function(t,e){for(var r=Math.min(t.length,e.length)+1,n=0,a=0,i=0;i<r;i++){var o=t.charCodeAt(i)||0,l=e.charCodeAt(i)||0,s=o>=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var T=2e9;s.seedPseudoRandom=function(){T=2e9},s.pseudoRandom=function(){var t=T;return T=(69069*T+1)%4294967296,Math.abs(T-t)<429496729?s.pseudoRandom():T/4294967296}},{"../constants/numerical":145,"./angles":150,"./clean_number":151,"./coerce":153,"./dates":154,"./ensure_array":155,"./extend":157,"./filter_unique":158,"./filter_visible":159,"./geometry2d":160,"./get_graph_div":161,"./identity":162,"./is_array":164,"./is_plain_object":165,"./keyed_container":166,"./localize":167,"./loggers":168,"./matrix":169,"./mod":170,"./nested_property":171,"./noop":172,"./notifier":173,"./push_unique":176,"./regex":178,"./relative_attr":179,"./relink_private":180,"./search":181,"./stats":183,"./throttle":185,"./to_log_range":186,d3:7,"fast-isnumeric":10}],164:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},a="undefined"==typeof DataView?function(){}:DataView;function i(t){return n.isView(t)&&!(t instanceof a)}function o(t){return Array.isArray(t)||i(t)}e.exports={isTypedArray:i,isArrayOrTypedArray:o,isArray1D:function(t){return!o(t[0])}}},{}],165:[function(t,e,r){"use strict";e.exports=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}},{}],166:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};e&&e.length?(s=n(t,e),l=s.get()):l=t,e=e||"";var u={};if(l)for(o=0;o<l.length;o++)u[l[o][r]]=o;var f=a.test(i),d={set:function(t,e){var a=null===e?4:0;if(!l){if(!s||4===a)return;l=[],s.set(l)}var o=u[t];if(void 0===o){if(4===a)return;a|=3,o=l.length,u[t]=o}else e!==(f?l[o][i]:n(l[o],i).get())&&(a|=2);var p=l[o]=l[o]||{};return p[r]=t,f?p[i]=e:n(p,i).set(e),null!==e&&(a&=-5),c[o]=c[o]|a,d},get:function(t){if(l){var e=u[t];return void 0===e?void 0:f?l[e][i]:n(l[e],i).get()}},rename:function(t,e){var n=u[t];return void 0===n?d:(c[n]=1|c[n],u[e]=n,delete u[t],l[n][r]=e,d)},remove:function(t){var e=u[t];if(void 0===e)return d;var a=l[e];if(Object.keys(a).length>2)return c[e]=2|c[e],d.set(t,null);if(f){for(o=e;o<l.length;o++)c[o]=3|c[o];for(o=e;o<l.length;o++)u[l[o][r]]--;l.splice(e,1),delete u[t]}else n(a,i).set(null),c[e]=6|c[e];return d},constructUpdate:function(){for(var t,a,o={},s=Object.keys(c),u=0;u<s.length;u++)a=s[u],t=e+"["+a+"]",l[a]?(1&c[a]&&(o[t+"."+r]=l[a][r]),2&c[a]&&(o[t+"."+i]=f?4&c[a]?null:l[a][i]:4&c[a]?null:n(l[a],i).get())):o[t]=null;return o}};return d}},{"./nested_property":171}],167:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t,e){for(var r=t._context.locale,a=0;a<2;a++){for(var i=t._context.locales,o=0;o<2;o++){var l=(i[r]||{}).dictionary;if(l){var s=l[e];if(s)return s}i=n.localeRegistry}var c=r.split("-")[0];if(c===r)break;r=c}return e}},{"../registry":245}],168:[function(t,e,r){"use strict";var n=t("../plot_api/plot_config"),a=e.exports={};function i(t,e){if(t.apply)t.apply(t,e);else for(var r=0;r<e.length;r++)t(e[r])}a.log=function(){if(n.logging>1){for(var t=["LOG:"],e=0;e<arguments.length;e++)t.push(arguments[e]);i(console.trace||console.log,t)}},a.warn=function(){if(n.logging>0){for(var t=["WARN:"],e=0;e<arguments.length;e++)t.push(arguments[e]);i(console.trace||console.log,t)}},a.error=function(){if(n.logging>0){for(var t=["ERROR:"],e=0;e<arguments.length;e++)t.push(arguments[e]);i(console.error,t)}}},{"../plot_api/plot_config":195}],169:[function(t,e,r){"use strict";r.init2dArray=function(t,e){for(var r=new Array(t),n=0;n<t;n++)r[n]=new Array(e);return r},r.transposeRagged=function(t){var e,r,n=0,a=t.length;for(e=0;e<a;e++)n=Math.max(n,t[e].length);var i=new Array(n);for(e=0;e<n;e++)for(i[e]=new Array(a),r=0;r<a;r++)i[e][r]=t[r][e];return i},r.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var n,a,i=t.length;if(t[0].length)for(n=new Array(i),a=0;a<i;a++)n[a]=r.dot(t[a],e);else if(e[0].length){var o=r.transposeRagged(e);for(n=new Array(o.length),a=0;a<o.length;a++)n[a]=r.dot(t,o[a])}else for(n=0,a=0;a<i;a++)n+=t[a]*e[a];return n},r.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},r.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]]},r.rotationXYMatrix=function(t,e,n){return r.dot(r.dot(r.translationMatrix(e,n),r.rotationMatrix(t)),r.translationMatrix(-e,-n))},r.apply2DTransform=function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var n=1===arguments.length?e[0]:[e[0],e[1]];return r.dot(t,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(t){var e=r.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}}},{}],170:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t%e;return r<0?r+e:r}},{}],171:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./is_array").isArrayOrTypedArray;e.exports=function(t,e){if(n(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,o,s=0,c=e.split(".");s<c.length;){if(r=String(c[s]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(r[1])c[s]=r[1];else{if(0!==s)throw"bad property string";c.splice(0,1)}for(i=r[2].substr(1,r[2].length-2).split("]["),o=0;o<i.length;o++)s++,c.splice(s,0,Number(i[o]))}s++}return"object"!=typeof t?function(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}(t,e,c):{set:l(t,c,e),get:function t(e,r){return function(){var n,i,o,l,s,c=e;for(l=0;l<r.length-1;l++){if(-1===(n=r[l])){for(i=!0,o=[],s=0;s<c.length;s++)o[s]=t(c[s],r.slice(l+1))(),o[s]!==o[0]&&(i=!1);return i?o[0]:o}if("number"==typeof n&&!a(c))return;if("object"!=typeof(c=c[n])||null===c)return}if("object"==typeof c&&null!==c&&null!==(o=c[r[l]]))return o}}(t,c),astr:e,parts:c,obj:t}};var i=/(^|\.)args\[/;function o(t,e){return void 0===t||null===t&&!e.match(i)}function l(t,e,r){return function(n){var i,l,f=t,d="",p=[[t,d]],h=o(n,r);for(l=0;l<e.length-1;l++){if("number"==typeof(i=e[l])&&!a(f))throw"array index but container is not an array";if(-1===i){if(h=!c(f,e.slice(l+1),n,r))break;return}if(!u(f,i,e[l+1],h))break;if("object"!=typeof(f=f[i])||null===f)throw"container is not an object";d=s(d,i),p.push([f,d])}if(h){if(l===e.length-1&&(delete f[e[l]],Array.isArray(f)&&+e[l]==f.length-1))for(;f.length&&void 0===f[f.length-1];)f.pop()}else f[e[l]]=n}}function s(t,e){var r=e;return n(e)?r="["+e+"]":t&&(r="."+e),t+r}function c(t,e,r,n){var i,s=a(r),c=!0,f=r,d=n.replace("-1",0),p=!s&&o(r,d),h=e[0];for(i=0;i<t.length;i++)d=n.replace("-1",i),s&&(p=o(f=r[i%r.length],d)),p&&(c=!1),u(t,i,h,p)&&l(t[i],e,n.replace("-1",i))(f);return c}function u(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}},{"./is_array":164,"fast-isnumeric":10}],172:[function(t,e,r){"use strict";e.exports=function(){}},{}],173:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=[];e.exports=function(t,e){if(-1===i.indexOf(t)){i.push(t);var r=1e3;a(e)?r=e:"long"===e&&(r=3e3);var o=n.select("body").selectAll(".plotly-notifier").data([0]);o.enter().append("div").classed("plotly-notifier",!0),o.selectAll(".notifier-note").data(i).enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(t){var e=n.select(this);e.append("button").classed("notifier-close",!0).html("×").on("click",function(){e.transition().call(l)});for(var a=e.append("p"),i=t.split(/<br\s*\/?>/g),o=0;o<i.length;o++)o&&a.append("br"),a.append("span").text(i[o]);e.transition().duration(700).style("opacity",1).transition().delay(r).call(l)})}function l(t){t.duration(700).style("opacity",0).each("end",function(t){var e=i.indexOf(t);-1!==e&&i.splice(e,1),n.select(this).remove()})}}},{d3:7,"fast-isnumeric":10}],174:[function(t,e,r){"use strict";var n=t("./setcursor"),a="data-savedcursor";e.exports=function(t,e){var r=t.attr(a);if(e){if(!r){for(var i=(t.attr("class")||"").split(" "),o=0;o<i.length;o++){var l=i[o];0===l.indexOf("cursor-")&&t.attr(a,l.substr(7)).classed(l,!1)}t.attr(a)||t.attr(a,"!!")}n(t,e)}else r&&(t.attr(a,null),"!!"===r?n(t):n(t,r))}},{"./setcursor":182}],175:[function(t,e,r){"use strict";var n=t("./matrix").dot,a=t("../constants/numerical").BADNUM,i=e.exports={};i.tester=function(t){if(Array.isArray(t[0][0]))return i.multitester(t);var e,r=t.slice(),n=r[0][0],o=n,l=r[0][1],s=l;for(r.push(r[0]),e=1;e<r.length;e++)n=Math.min(n,r[e][0]),o=Math.max(o,r[e][0]),l=Math.min(l,r[e][1]),s=Math.max(s,r[e][1]);var c,u=!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]&&(u=!0,c=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]&&(u=!0,c=function(t){return t[1]===r[0][1]}));var f=!0,d=r[0];for(e=1;e<r.length;e++)if(d[0]!==r[e][0]||d[1]!==r[e][1]){f=!1;break}return{xmin:n,xmax:o,ymin:l,ymax:s,pts:r,contains:u?function(t,e){var r=t[0],i=t[1];return!(r===a||r<n||r>o||i===a||i<l||i>s||e&&c(t))}:function(t,e){var i=t[0],c=t[1];if(i===a||i<n||i>o||c===a||c<l||c>s)return!1;var u,f,d,p,h,g=r.length,v=r[0][0],y=r[0][1],m=0;for(u=1;u<g;u++)if(f=v,d=y,v=r[u][0],y=r[u][1],!(i<(p=Math.min(f,v))||i>Math.max(f,v)||c>Math.max(d,y)))if(c<Math.min(d,y))i!==p&&m++;else{if(c===(h=v===f?c:d+(i-f)*(y-d)/(v-f)))return 1!==u||!e;c<=h&&i!==p&&m++}return m%2==1},isRect:u,degenerate:f}},i.multitester=function(t){for(var e=[],r=t[0][0][0],n=r,a=t[0][0][1],o=a,l=0;l<t.length;l++){var s=i.tester(t[l]);s.subtract=t[l].subtract,e.push(s),r=Math.min(r,s.xmin),n=Math.max(n,s.xmax),a=Math.min(a,s.ymin),o=Math.max(o,s.ymax)}return{xmin:r,xmax:n,ymin:a,ymax:o,pts:[],contains:function(t,r){for(var n=!1,a=0;a<e.length;a++)e[a].contains(t,r)&&(n=!1===e[a].subtract);return n},isRect:!1,degenerate:!1}};var o=i.isSegmentBent=function(t,e,r,a){var i,o,l,s=t[e],c=[t[r][0]-s[0],t[r][1]-s[1]],u=n(c,c),f=Math.sqrt(u),d=[-c[1]/f,c[0]/f];for(i=e+1;i<r;i++)if(o=[t[i][0]-s[0],t[i][1]-s[1]],(l=n(o,c))<0||l>u||Math.abs(n(o,d))>a)return!0;return!1};i.filter=function(t,e){var r=[t[0]],n=0,a=0;function i(i){t.push(i);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c<t.length;c++)(c===t.length-1||o(t,s,c+1,e))&&(r.push(t[c]),r.length<l-2&&(n=c,a=r.length-1),s=c)}t.length>1&&i(t.pop());return{addPt:i,raw:t,filtered:r}}},{"../constants/numerical":145,"./matrix":169}],176:[function(t,e,r){"use strict";e.exports=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}},{}],177:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plot_api/plot_config");var i={add:function(t,e,r,n,i){var o,l;t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},l=t.undoQueue.index,t.autoplay?t.undoQueue.inSequence||(t.autoplay=!1):(!t.undoQueue.sequence||t.undoQueue.beginSequence?(o={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(l,t.undoQueue.queue.length-l,o),t.undoQueue.index+=1):o=t.undoQueue.queue[l-1],t.undoQueue.beginSequence=!1,o&&(o.undo.calls.unshift(e),o.undo.args.unshift(r),o.redo.calls.push(n),o.redo.args.push(i)),t.undoQueue.queue.length>a.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++)i.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++)i.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}}};i.plotDo=function(t,e,r){t.autoplay=!0,r=function(t,e){for(var r,a=[],i=0;i<e.length;i++)r=e[i],a[i]=r===t?r:"object"==typeof r?Array.isArray(r)?n.extendDeep([],r):n.extendDeepAll({},r):r;return a}(t,r),e.apply(null,r)},e.exports=i},{"../lib":163,"../plot_api/plot_config":195}],178:[function(t,e,r){"use strict";r.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)}},{}],179:[function(t,e,r){"use strict";var n=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,a=/^[^\.\[\]]+$/;e.exports=function(t,e){for(;e;){var r=t.match(n);if(r)t=r[1];else{if(!t.match(a))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}},{}],180:[function(t,e,r){"use strict";var n=t("./is_array").isArrayOrTypedArray,a=t("./is_plain_object");e.exports=function t(e,r){for(var i in r){var o=r[i],l=e[i];if(l!==o)if("_"===i.charAt(0)||"function"==typeof o){if(i in e)continue;e[i]=o}else if(n(o)&&n(l)&&a(o[0])){if("customdata"===i||"ids"===i)continue;for(var s=Math.min(o.length,l.length),c=0;c<s;c++)l[c]!==o[c]&&a(o[c])&&a(l[c])&&t(l[c],o[c])}else a(o)&&a(l)&&(t(l,o),Object.keys(l).length||delete e[i])}}},{"./is_array":164,"./is_plain_object":165}],181:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./loggers");function i(t,e){return t<e}function o(t,e){return t<=e}function l(t,e){return t>e}function s(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var c,u,f=0,d=e.length,p=0,h=d>1?(e[d-1]-e[0])/(d-1):1;for(u=h>=0?r?i:o:r?s:l,t+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f<d&&p++<100;)u(e[c=Math.floor((f+d)/2)],t)?f=c+1:d=c;return p>90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,a=e[n]-e[0]||1,i=a/(n||1)/1e4,o=[e[0]],l=0;l<n;l++)e[l+1]>e[l]+i&&(a=Math.min(a,e[l+1]-e[l]),o.push(e[l+1]));return{vals:o,minDiff:a}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a<i&&o++<100;)e[n=c((a+i)/2)]<=t?a=n+l:i=n-s;return e[a]}},{"./loggers":168,"fast-isnumeric":10}],182:[function(t,e,r){"use strict";e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach(function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)}),e&&t.classed("cursor-"+e,!0)}},{}],183:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./is_array").isArrayOrTypedArray;r.aggNums=function(t,e,i,o){var l,s;if((!o||o>i.length)&&(o=i.length),n(e)||(e=!1),a(i[0])){for(s=new Array(o),l=0;l<o;l++)s[l]=r.aggNums(t,e,i[l]);i=s}for(l=0;l<o;l++)n(e)?n(i[l])&&(e=t(+e,+i[l])):e=i[l];return e},r.len=function(t){return r.aggNums(function(t){return t+1},0,t)},r.mean=function(t,e){return e||(e=r.len(t)),r.aggNums(function(t,e){return t+e},0,t)/e},r.midRange=function(t){if(void 0!==t&&0!==t.length)return(r.aggNums(Math.max,null,t)+r.aggNums(Math.min,null,t))/2},r.variance=function(t,e,a){return e||(e=r.len(t)),n(a)||(a=r.mean(t,e)),r.aggNums(function(t,e){return t+Math.pow(e-a,2)},0,t)/e},r.stdev=function(t,e,n){return Math.sqrt(r.variance(t,e,n))},r.interp=function(t,e){if(!n(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 r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./is_array":164,"fast-isnumeric":10}],184:[function(t,e,r){"use strict";var n=t("d3"),a=t("../lib"),i=t("../constants/xmlns_namespaces"),o=t("../constants/string_mappings"),l=t("../constants/alignment").LINE_SPACING;function s(t,e){return t.node().getBoundingClientRect()[e]}var c=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,o){var y=t.text(),C=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&y.match(c),O=n.select(t.node().parentNode);if(!O.empty()){var P=t.attr("class")?t.attr("class").split(" ")[0]:"text";return P+="-math",O.selectAll("svg."+P).remove(),O.selectAll("g."+P+"-group").remove(),t.style("display",null).attr({"data-unformatted":y,"data-math":"N"}),C?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),i={fontSize:r};!function(t,e,r){var i="math-output-"+a.randstr([],64),o=n.select("body").append("div").attr({id:i}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text((l=t,l.replace(u,"\\lt ").replace(f,"\\gt ")));var l;MathJax.Hub.Queue(["Typeset",MathJax.Hub,o.node()],function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(o.select(".MathJax_SVG").empty()||!o.select("svg").node())a.log("There was an error in the tex syntax.",t),r();else{var i=o.select("svg").node().getBoundingClientRect();r(o.select(".MathJax_SVG"),e,i)}o.remove()})}(C[2],i,function(n,a,i){O.selectAll("svg."+P).remove(),O.selectAll("g."+P+"-group").remove();var l=n&&n.select("svg");if(!l||!l.node())return z(),void e();var c=O.append("g").classed(P+"-group",!0).attr({"pointer-events":"none","data-unformatted":y,"data-math":"Y"});c.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild),l.attr({class:P,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=t.node().style.fill||"black";l.select("g").attr({fill:u,stroke:u});var f=s(l,"width"),d=s(l,"height"),p=+t.attr("x")-f*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],h=-(r||s(t,"height"))/4;"y"===P[0]?(c.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-f/2,h-d/2]+")"}),l.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===P[0]?l.attr({x:t.attr("x"),y:h-d/2}):"a"===P[0]?l.attr({x:0,y:h}):l.attr({x:p,y:+t.attr("y")+h-d/2}),o&&o.call(t,c),e(c)})})):z(),t}function z(){O.empty()||(P=t.attr("class")+"-math",O.select("svg."+P).remove()),t.text("").style("white-space","pre"),function(t,e){e=(r=e,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}(r,m)).replace(x," ");var r;var o,s=!1,c=[],u=-1;function f(){u++;var e=document.createElementNS(i.svg,"tspan");n.select(e).attr({class:"line",dy:u*l+"em"}),t.appendChild(e),o=e;var r=c;if(c=[{node:e}],r.length>1)for(var a=1;a<r.length;a++)y(r[a])}function y(t){var e,r=t.type,a={};if("a"===r){e="a";var l=t.target,s=t.href,u=t.popup;s&&(a={"xlink:xlink:show":"_blank"===l||"_"!==l.charAt(0)?"new":"replace",target:l,"xlink:xlink:href":s},u&&(a.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+u+'");return false;'))}else e="tspan";t.style&&(a.style=t.style);var f=document.createElementNS(i.svg,e);if("sup"===r||"sub"===r){C(o,g),o.appendChild(f);var d=document.createElementNS(i.svg,"tspan");C(d,g),n.select(d).attr("dy",h[r]),a.dy=p[r],o.appendChild(f),o.appendChild(d)}else o.appendChild(f);n.select(f).attr(a),o=t.node=f,c.push(t)}function C(t,e){t.appendChild(document.createTextNode(e))}function O(t){if(1!==c.length){var r=c.pop();t!==r.type&&a.log("Start tag <"+r.type+"> doesnt match end tag <"+t+">. Pretending it did match.",e),o=c[c.length-1].node}else a.log("Ignoring unexpected end tag </"+t+">.",e)}w.test(e)?f():(o=t,c=[{node:t}]);for(var P=e.split(b),z=0;z<P.length;z++){var D=P[z],E=D.match(_),N=E&&E[2].toLowerCase(),R=d[N];if("br"===N)f();else if(void 0===R)C(o,D);else if(E[1])O(N);else{var I=E[4],F={type:N},j=L(I,k);if(j?(j=j.replace(S,"$1 fill:"),R&&(j+=";"+R)):R&&(j=R),j&&(F.style=j),"a"===N){s=!0;var B=L(I,M);if(B){var H=document.createElement("a");H.href=B,-1!==v.indexOf(H.protocol)&&(F.href=encodeURI(decodeURI(B)),F.target=L(I,A)||"_blank",F.popup=L(I,T))}}y(F)}}return s}(t.node(),y)&&t.style("pointer-events","all"),r.positionText(t),o&&o.call(t)}};var u=/(<|<|<)/g,f=/(>|>|>)/g;var d={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"},p={sub:"0.3em",sup:"-0.6em"},h={sub:"-0.21em",sup:"0.42em"},g="\u200b",v=["http:","https:","mailto:","",void 0,":"],y=new RegExp("</?("+Object.keys(d).join("|")+")( [^>]*)?/?>","g"),m=Object.keys(o.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:o.entityToUnicode[t]}}),x=/(\r\n?|\n)/g,b=/(<[^<>]*>)/,_=/<(\/?)([^ >]*)(\s+(.*))?>/i,w=/<br(\s+.*)?>/i,k=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,M=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,A=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function L(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}var S=/(^|;)\s*color:/;function C(t,e,r){var n,a,i,o=r.horizontalAlign,l=r.verticalAlign||"top",s=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-n.height}:"middle"===l?function(){return s.top+(s.height-n.height)/2}:function(){return s.top},i="right"===o?function(){return s.right-n.width}:"center"===o?function(){return s.left+(s.width-n.width)/2}:function(){return s.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:i()-c.left+"px","z-index":1e3}),this}}r.plainText=function(t){return(t||"").replace(y," ")},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){var t=n.select(this);function a(e,r){return void 0===r?null===(r=t.attr(e))&&(t.attr(e,0),r=0):t.attr(e,r),r}var i=a("x",e),o=a("y",r);"text"===this.nodeName&&t.selectAll("tspan.line").attr({x:i,y:o})})},r.makeEditable=function(t,e){var r=e.gd,a=e.delegate,i=n.dispatch("edit","input","cancel"),o=a||t;if(t.style({"pointer-events":a?"none":"all"}),1!==t.size())throw new Error("boo");function l(){!function(){var a=n.select(r).select(".svg-container"),o=a.append("div"),l=t.node().style,c=parseFloat(l.fontSize||12),u=e.text;void 0===u&&(u=t.attr("data-unformatted"));o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":l.fontFamily||"Arial","font-size":c,color:e.fill||l.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-c/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(u).call(C(t,a,e)).on("blur",function(){r._editing=!1,t.text(this.textContent).style({opacity:1});var e,a=n.select(this).attr("class");(e=a?"."+a.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(e).style({opacity:0});var o=this.textContent;n.select(this).transition().duration(0).remove(),n.select(document).on("mouseup",null),i.edit.call(t,o)}).on("focus",function(){var t=this;r._editing=!0,n.select(document).on("mouseup",function(){if(n.event.target===t)return!1;document.activeElement===o.node()&&o.node().blur()})}).on("keyup",function(){27===n.event.which?(r._editing=!1,t.style({opacity:1}),n.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),i.cancel.call(t,this.textContent)):(i.input.call(t,this.textContent),n.select(this).call(C(t,a,e)))}).on("keydown",function(){13===n.event.which&&this.blur()}).call(s)}(),t.style({opacity:0});var a,l=o.attr("class");(a=l?"."+l.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(a).style({opacity:0})}function s(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}return e.immediate?l():o.on("click",l),n.rebind(t,i,"on")}},{"../constants/alignment":143,"../constants/string_mappings":146,"../constants/xmlns_namespaces":147,"../lib":163,d3:7}],185:[function(t,e,r){"use strict";var n={};function a(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}r.throttle=function(t,e,r){var i=n[t],o=Date.now();if(!i){for(var l in n)n[l].ts<o-6e4&&delete n[l];i=n[t]={ts:0,timer:null}}function s(){r(),i.ts=Date.now(),i.onDone&&(i.onDone(),i.onDone=null)}a(i),o>i.ts+e?s():i.timer=setTimeout(function(){s(),i.timer=null},e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)a(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],186:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":10}],187:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],188:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],189:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],l=0;l<i.length;l++)if((r=t.match(i[l]))&&0===r.index){e=r[0];break}if(e||(e=a[a.indexOf(o)]),!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:""}}},{"../registry":245}],190:[function(t,e,r){"use strict";var n=t("../lib"),a=n.extendFlat,i=n.isPlainObject,o={valType:"flaglist",extras:["none"],flags:["calc","calcIfAutorange","clearAxisTypes","plot","style","colorbars"]},l={valType:"flaglist",extras:["none"],flags:["calc","calcIfAutorange","plot","legend","ticks","axrange","margins","layoutstyle","modebar","camera","arraydraw"]},s=o.flags.slice().concat(["clearCalc","fullReplot"]),c=l.flags.slice().concat("layoutReplot");function u(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=!1;return e}function f(t,e,r){var n=a({},t);for(var o in n){var l=n[o];i(l)&&(n[o]=d(l,e,r,o))}return"from-root"===r&&(n.editType=e),n}function d(t,e,r,n){if(t.valType){var i=a({},t);if(i.editType=e,Array.isArray(t.items)){i.items=new Array(t.items.length);for(var o=0;o<t.items.length;o++)i.items[o]=d(t.items[o],e,"from-root")}return i}return f(t,e,"_"===n.charAt(0)?"nested":"from-root")}e.exports={traces:o,layout:l,traceFlags:function(){return u(s)},layoutFlags:function(){return u(c)},update:function(t,e){var r=e.editType;if(r&&"none"!==r)for(var n=r.split("+"),a=0;a<n.length;a++)t[n[a]]=!0},overrideAll:f}},{"../lib":163}],191:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("gl-mat4/fromQuat"),i=t("../registry"),o=t("../lib"),l=t("../plots/plots"),s=t("../plots/cartesian/axis_ids"),c=s.cleanId,u=s.getFromTrace,f=t("../components/color");function d(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=c(r,n))}function p(t){if(!o.isPlainObject(t))return!1;var e=t.name;return delete t.name,delete t.showlegend,("string"==typeof e||"number"==typeof e)&&String(e)}function h(t,e,r,n){if(r&&!n)return t;if(n&&!r)return e;if(!t.trim())return e;if(!e.trim())return t;var a,i=Math.min(t.length,e.length);for(a=0;a<i&&t.charAt(a)===e.charAt(a);a++);return t.substr(0,a).trim()}function g(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 v(t,e){return e in t&&"object"==typeof t[e]&&0===Object.keys(t[e]).length}r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.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=(l.subplotsRegistry.cartesian||{}).attrRegex,i=(l.subplotsRegistry.gl3d||{}).attrRegex,s=Object.keys(t);for(e=0;e<s.length;e++){var u=s[e];if(n&&n.test(u)){var p=t[u];p.anchor&&"free"!==p.anchor&&(p.anchor=c(p.anchor)),p.overlaying&&(p.overlaying=c(p.overlaying)),p.type||(p.isdate?p.type="date":p.islog?p.type="log":!1===p.isdate&&!1===p.islog&&(p.type="linear")),"withzero"!==p.autorange&&"tozero"!==p.autorange||(p.autorange=!0,p.rangemode="tozero"),delete p.islog,delete p.isdate,delete p.categories,v(p,"domain")&&delete p.domain,void 0!==p.autotick&&(void 0===p.tickmode&&(p.tickmode=p.autotick?"auto":"linear"),delete p.autotick)}else if(i&&i.test(u)){var h=t[u],g=h.cameraposition;if(Array.isArray(g)&&4===g[0].length){var y=g[0],m=g[1],x=g[2],b=a([],y),_=[];for(r=0;r<3;++r)_[r]=m[r]+x*b[2+4*r];h.camera={eye:{x:_[0],y:_[1],z:_[2]},center:{x:m[0],y:m[1],z:m[2]},up:{x:b[1],y:b[5],z:b[9]}},delete h.cameraposition}}}var w=Array.isArray(t.annotations)?t.annotations.length:0;for(e=0;e<w;e++){var k=t.annotations[e];o.isPlainObject(k)&&(k.ref&&("paper"===k.ref?(k.xref="paper",k.yref="paper"):"data"===k.ref&&(k.xref="x",k.yref="y"),delete k.ref),d(k,"xref"),d(k,"yref"))}var M=Array.isArray(t.shapes)?t.shapes.length:0;for(e=0;e<M;e++){var A=t.shapes[e];o.isPlainObject(A)&&(d(A,"xref"),d(A,"yref"))}var T=t.legend;return T&&(T.x>3?(T.x=1.02,T.xanchor="left"):T.x<-2&&(T.x=-.02,T.xanchor="right"),T.y>3?(T.y=1.02,T.yanchor="bottom"):T.y<-2&&(T.y=-.02,T.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),f.clean(t),t},r.cleanData=function(t,e){for(var n=[],a=t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid}),s=0;s<t.length;s++){var u,d=t[s];if(!("uid"in d)||-1!==n.indexOf(d.uid)){var y;for(u=0;u<100&&(y=o.randstr(a),-1!==n.indexOf(y));u++);d.uid=o.randstr(a),a.push(d.uid)}if(n.push(d.uid),"histogramy"===d.type&&"xbins"in d&&!("ybins"in d)&&(d.ybins=d.xbins,delete d.xbins),d.error_y&&"opacity"in d.error_y){var m=f.defaults,x=d.error_y.color||(i.traceIs(d,"bar")?f.defaultLine:m[s%m.length]);d.error_y.color=f.addOpacity(f.rgb(x),f.opacity(x)*d.error_y.opacity),delete d.error_y.opacity}if("bardir"in d&&("h"!==d.bardir||!i.traceIs(d,"bar")&&"histogram"!==d.type.substr(0,9)||(d.orientation="h",r.swapXYData(d)),delete d.bardir),"histogramy"===d.type&&r.swapXYData(d),"histogramx"!==d.type&&"histogramy"!==d.type||(d.type="histogram"),"scl"in d&&(d.colorscale=d.scl,delete d.scl),"reversescl"in d&&(d.reversescale=d.reversescl,delete d.reversescl),d.xaxis&&(d.xaxis=c(d.xaxis,"x")),d.yaxis&&(d.yaxis=c(d.yaxis,"y")),i.traceIs(d,"gl3d")&&d.scene&&(d.scene=l.subplotsRegistry.gl3d.cleanId(d.scene)),!i.traceIs(d,"pie")&&!i.traceIs(d,"bar"))if(Array.isArray(d.textposition))for(u=0;u<d.textposition.length;u++)d.textposition[u]=g(d.textposition[u]);else d.textposition&&(d.textposition=g(d.textposition));if(i.traceIs(d,"2dMap")&&("YIGnBu"===d.colorscale&&(d.colorscale="YlGnBu"),"YIOrRd"===d.colorscale&&(d.colorscale="YlOrRd")),i.traceIs(d,"markerColorscale")&&d.marker){var b=d.marker;"YIGnBu"===b.colorscale&&(b.colorscale="YlGnBu"),"YIOrRd"===b.colorscale&&(b.colorscale="YlOrRd")}if("surface"===d.type&&o.isPlainObject(d.contours)){var _=["x","y","z"];for(u=0;u<_.length;u++){var w=d.contours[_[u]];o.isPlainObject(w)&&(w.highlightColor&&(w.highlightcolor=w.highlightColor,delete w.highlightColor),w.highlightWidth&&(w.highlightwidth=w.highlightWidth,delete w.highlightWidth))}}if("candlestick"===d.type||"ohlc"===d.type){var k=!1!==(d.increasing||{}).showlegend,M=!1!==(d.decreasing||{}).showlegend,A=p(d.increasing),T=p(d.decreasing);if(!1!==A&&!1!==T){var L=h(A,T,k,M);L&&(d.name=L)}else!A&&!T||d.name||(d.name=A||T)}if(Array.isArray(d.transforms)){var S=d.transforms;for(u=0;u<S.length;u++){var C=S[u];if(o.isPlainObject(C))switch(C.type){case"filter":C.filtersrc&&(C.target=C.filtersrc,delete C.filtersrc),C.calendar&&(C.valuecalendar||(C.valuecalendar=C.calendar),delete C.calendar);break;case"groupby":if(C.styles=C.styles||C.style,C.styles&&!Array.isArray(C.styles)){var O=C.styles,P=Object.keys(O);C.styles=[];for(var z=0;z<P.length;z++)C.styles.push({target:P[z],value:O[P[z]]})}}}}v(d,"line")&&delete d.line,"marker"in d&&(v(d.marker,"line")&&delete d.marker.line,v(d,"marker")&&delete d.marker),f.clean(d)}},r.swapXYData=function(t){var e;if(o.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);o.swapAttrs(t,["error_?.copy_ystyle"]),n&&o.swapAttrs(t,["error_?.color","error_?.thickness","error_?.width"])}if("string"==typeof t.hoverinfo){var a=t.hoverinfo.split("+");for(e=0;e<a.length;e++)"x"===a[e]?a[e]="y":"y"===a[e]&&(a[e]="x");t.hoverinfo=a.join("+")}},r.coerceTraceIndices=function(t,e){return n(e)?[e]:Array.isArray(e)&&e.length?e:t.data.map(function(t,e){return e})},r.manageArrayContainers=function(t,e,r){var a=t.obj,i=t.parts,l=i.length,s=i[l-1],c=n(s);if(c&&null===e){var u=i.slice(0,l-1).join(".");o.nestedProperty(a,u).get().splice(s,1)}else c&&void 0===t.get()?(void 0===t.get()&&(r[t.astr]=null),t.set(e)):t.set(e)};var y=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function m(t){var e=t.search(y);if(e>0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=m(e);r;){if(r in t)return!0;r=m(r)}return!1};var x=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n<e.length;n++)for(var a=t._fullData[n],i=0;i<3;i++){var l=u(t,a,x[i]);if(l&&"log"!==l.type){var s=l._name,c=l._id.substr(1);if("scene"===c.substr(0,5)){if(void 0!==r[c])continue;s=c+"."+s}var f=s+".type";void 0===r[s]&&void 0===r[f]&&o.nestedProperty(t.layout,f).set(null)}}},r.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]]}},{"../components/color":43,"../lib":163,"../plots/cartesian/axis_ids":208,"../plots/plots":237,"../registry":245,"fast-isnumeric":10,"gl-mat4/fromQuat":11}],192:[function(t,e,r){"use strict";var n=t("./plot_api");r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r.react=n.react,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.setPlotConfig=n.setPlotConfig,r.toImage=t("./to_image"),r.validate=t("./validate"),r.downloadImage=t("../snapshot/download")},{"../snapshot/download":247,"./plot_api":194,"./to_image":198,"./validate":199}],193:[function(t,e,r){"use strict";var n=t("../lib/nested_property"),a=t("../lib/is_plain_object"),i=t("../lib/noop"),o=t("../lib/loggers"),l=t("../lib/search").sorterAsc,s=t("../registry");r.containerArrayMatch=t("./container_array_match");var c=r.isAddVal=function(t){return"add"===t||a(t)},u=r.isRemoveVal=function(t){return null===t||"remove"===t};r.applyContainerArrayChanges=function(t,e,r,a){var f=e.astr,d=s.getComponentMethod(f,"supplyLayoutDefaults"),p=s.getComponentMethod(f,"draw"),h=s.getComponentMethod(f,"drawOne"),g=a.replot||a.recalc||d===i||p===i,v=t.layout,y=t._fullLayout;if(r[""]){Object.keys(r).length>1&&o.warn("Full array edits are incompatible with other edits",f);var m=r[""][""];if(u(m))e.set(null);else{if(!Array.isArray(m))return o.warn("Unrecognized full array edit value",f,m),!0;e.set(m)}return!g&&(d(v,y),p(t),!0)}var x,b,_,w,k,M,A,T=Object.keys(r).map(Number).sort(l),L=e.get(),S=L||[],C=n(y,f).get(),O=[],P=-1,z=S.length;for(x=0;x<T.length;x++)if(w=r[_=T[x]],k=Object.keys(w),M=w[""],A=c(M),_<0||_>S.length-(A?0:1))o.warn("index out of range",f,_);else if(void 0!==M)k.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(M)?O.push(_):A?("add"===M&&(M={}),S.splice(_,0,M),C&&C.splice(_,0,{})):o.warn("Unrecognized full object edit value",f,_,M),-1===P&&(P=_);else for(b=0;b<k.length;b++)n(S[_],k[b]).set(w[k[b]]);for(x=O.length-1;x>=0;x--)S.splice(O[x],1),C&&C.splice(O[x],1);if(S.length?L||e.set(S):e.set(null),g)return!1;if(d(v,y),h!==i){var D;if(-1===P)D=T;else{for(z=Math.max(S.length,z),D=[],x=0;x<T.length&&!((_=T[x])>=P);x++)D.push(_);for(x=P;x<z;x++)D.push(x)}for(x=0;x<D.length;x++)h(t,D[x])}else p(t);return!0}},{"../lib/is_plain_object":165,"../lib/loggers":168,"../lib/nested_property":171,"../lib/noop":172,"../lib/search":181,"../registry":245,"./container_array_match":189}],194:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("has-hover"),o=t("../lib"),l=t("../lib/events"),s=t("../lib/queue"),c=t("../registry"),u=t("./plot_schema"),f=t("../plots/plots"),d=t("../plots/polar/legacy"),p=t("../plots/cartesian/axes"),h=t("../components/drawing"),g=t("../components/color"),v=t("../plots/cartesian/graph_interact").initInteractions,y=t("../constants/xmlns_namespaces"),m=t("../lib/svg_text_utils"),x=t("./plot_config"),b=t("./manage_arrays"),_=t("./helpers"),w=t("./subroutines"),k=t("./edit_types"),M=t("../plots/cartesian/constants").AX_NAME_PATTERN,A=0;function T(t,e){try{t._fullLayout._paper.style("background",e)}catch(t){o.error(t)}}function L(t,e){T(t,g.combine(e,"white"))}function S(t,e){t._context||(t._context=o.extendDeep({},x));var r,n,a,l=t._context;if(e){for(n=Object.keys(e),r=0;r<n.length;r++)"editable"!==(a=n[r])&&"edits"!==a&&a in l&&("setBackground"===a&&"opaque"===e[a]?l[a]=L:l[a]=e[a]);e.plot3dPixelRatio&&!l.plotGlPixelRatio&&(l.plotGlPixelRatio=l.plot3dPixelRatio);var s=e.editable;if(void 0!==s)for(l.editable=s,n=Object.keys(l.edits),r=0;r<n.length;r++)l.edits[n[r]]=s;if(e.edits)for(n=Object.keys(e.edits),r=0;r<n.length;r++)(a=n[r])in l.edits&&(l.edits[a]=e.edits[a])}l.staticPlot&&(l.editable=!1,l.edits={},l.autosizable=!1,l.scrollZoom=!1,l.doubleClick=!1,l.showTips=!1,l.showLink=!1,l.displayModeBar=!1),"hover"!==l.displayModeBar||i||(l.displayModeBar=!0),"transparent"!==l.setBackground&&"function"==typeof l.setBackground||(l.setBackground=T)}function C(t,e){var r,n,a=e+1,i=[];for(r=0;r<t.length;r++)(n=t[r])<0?i.push(a+n):i.push(n);return i}function O(t,e,r){var n,a;for(n=0;n<e.length;n++){if((a=e[n])!==parseInt(a,10))throw new Error("all values in "+r+" must be integers");if(a>=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function P(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]),O(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&O(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function z(t,e,r,n,i){!function(t,e,r,n){var a=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in O(t,r,"indices"),e){if(!Array.isArray(e[i])||e[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==e[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var i,l,s,c,u,f=o.isPlainObject(n),d=[];for(var p in Array.isArray(r)||(r=[r]),r=C(r,t.data.length-1),e)for(var h=0;h<r.length;h++){if(i=t.data[r[h]],l=(s=o.nestedProperty(i,p)).get(),c=e[p][h],!o.isArrayOrTypedArray(c))throw new Error("attribute: "+p+" index: "+h+" must be an array");if(!o.isArrayOrTypedArray(l))throw new Error("cannot extend missing or non-array attribute: "+p);if(l.constructor!==c.constructor)throw new Error("cannot extend array with an array of a different type: "+p);u=f?n[p][h]:n,a(u)||(u=-1),d.push({prop:s,target:l,insert:c,maxp:Math.floor(u)})}return d}(t,e,r,n),s={},c={},u=0;u<l.length;u++){var f=l[u].prop,d=l[u].maxp,p=i(l[u].target,l[u].insert,d);f.set(p[0]),Array.isArray(s[f.astr])||(s[f.astr]=[]),s[f.astr].push(p[1]),Array.isArray(c[f.astr])||(c[f.astr]=[]),c[f.astr].push(l[u].target.length)}return{update:s,maxPoints:c}}function D(t,e){var r=new t.constructor(t.length+e.length);return r.set(t),r.set(e,t.length),r}function E(t){return void 0===t?null:t}function N(t,e,r){var n,a,i=t._fullLayout,l=t._fullData,s=t.data,d=k.traceFlags(),h={},g={};function v(){return r.map(function(){})}function y(t){var e=p.id2name(t);-1===a.indexOf(e)&&a.push(e)}function m(t){return"LAYOUT"+t+".autorange"}function x(t){return"LAYOUT"+t+".range"}function b(n,a,i){var l;Array.isArray(n)?n.forEach(function(t){b(t,a,i)}):n in e||_.hasParent(e,n)||(l="LAYOUT"===n.substr(0,6)?o.nestedProperty(t.layout,n.replace("LAYOUT","")):o.nestedProperty(s[r[i]],n),n in g||(g[n]=v()),void 0===g[n][i]&&(g[n][i]=E(l.get())),void 0!==a&&l.set(a))}for(var w in e){if(_.hasParent(e,w))throw new Error("cannot set "+w+"and a parent attribute simultaneously");var M,A,T,L,S,C,O=e[w];if(h[w]=O,"LAYOUT"!==w.substr(0,6)){for(g[w]=v(),n=0;n<r.length;n++)if(M=s[r[n]],A=l[r[n]],L=(T=o.nestedProperty(M,w)).get(),void 0!==(S=Array.isArray(O)?O[n%O.length]:O)){if((C=u.getTraceValObject(A,T.parts))&&C.impliedEdits&&null!==S)for(var P in C.impliedEdits)b(o.relativeAttr(w,P),C.impliedEdits[P],n);else if("colorbar.thicknessmode"===w&&T.get()!==S&&-1!==["fraction","pixels"].indexOf(S)&&A.colorbar){var z=-1!==["top","bottom"].indexOf(A.colorbar.orient)?i.height-i.margin.t-i.margin.b:i.width-i.margin.l-i.margin.r;b("colorbar.thickness",A.colorbar.thickness*("fraction"===S?1/z:z),n)}else if("colorbar.lenmode"===w&&T.get()!==S&&-1!==["fraction","pixels"].indexOf(S)&&A.colorbar){var D=-1!==["top","bottom"].indexOf(A.colorbar.orient)?i.width-i.margin.l-i.margin.r:i.height-i.margin.t-i.margin.b;b("colorbar.len",A.colorbar.len*("fraction"===S?1/D:D),n)}else"colorbar.tick0"!==w&&"colorbar.dtick"!==w||b("colorbar.tickmode","linear",n);if("type"===w&&"pie"===S!=("pie"===L)){var N="x",R="y";"bar"!==S&&"bar"!==L||"h"!==M.orientation||(N="y",R="x"),o.swapAttrs(M,["?","?src"],"labels",N),o.swapAttrs(M,["d?","?0"],"label",N),o.swapAttrs(M,["?","?src"],"values",R),"pie"===L?(o.nestedProperty(M,"marker.color").set(o.nestedProperty(M,"marker.colors").get()),i._pielayer.selectAll("g.trace").remove()):c.traceIs(M,"cartesian")&&o.nestedProperty(M,"marker.colors").set(o.nestedProperty(M,"marker.color").get())}g[w][n]=E(L);if(-1!==["swapxy","swapxyaxes","orientation","orientationaxes"].indexOf(w)){if("orientation"===w){T.set(S);var I=M.x&&!M.y?"h":"v";if((T.get()||I)===A.orientation)continue}else"orientationaxes"===w&&(M.orientation={v:"h",h:"v"}[A.orientation]);_.swapXYData(M),d.calc=d.clearAxisTypes=!0}else-1!==f.dataArrayContainers.indexOf(T.parts[0])?(_.manageArrayContainers(T,S,g),d.calc=!0):(C?C.arrayOk&&(o.isArrayOrTypedArray(S)||o.isArrayOrTypedArray(L))?d.calc=!0:k.update(d,C):d.calc=!0,T.set(S))}if(-1!==["swapxyaxes","orientationaxes"].indexOf(w)&&p.swap(t,r),"orientationaxes"===w){var F=o.nestedProperty(t.layout,"hovermode");"x"===F.get()?F.set("y"):"y"===F.get()&&F.set("x")}if(-1!==["orientation","type"].indexOf(w)){for(a=[],n=0;n<r.length;n++){var j=s[r[n]];c.traceIs(j,"cartesian")&&(y(j.xaxis||"x"),y(j.yaxis||"y"),"type"===w&&b(["autobinx","autobiny"],!0,n))}b(a.map(m),!0,0),b(a.map(x),[0,1],0)}}else T=o.nestedProperty(t.layout,w.replace("LAYOUT","")),g[w]=[E(T.get())],T.set(Array.isArray(O)?O[0]:O),d.calc=!0}var B=!1,H=p.list(t);for(n=0;n<H.length;n++)if(H[n].autorange){B=!0;break}return(d.calc||d.calcIfAutorange&&B)&&(d.clearCalc=!0),(d.calc||d.plot||d.calcIfAutorange)&&(d.fullReplot=!0),{flags:d,undoit:g,redoit:h,traces:r,eventData:o.extendDeepNoArrays([],[h,r])}}r.plot=function(t,e,a,i){var s;if(t=o.getGraphDiv(t),l.init(t),o.isPlainObject(e)){var u=e;e=u.data,a=u.layout,i=u.config,s=u.frames}if(!1===l.triggerHandler(t,"plotly_beforeplot",[e,a,i]))return Promise.reject();e||a||o.isPlotDiv(t)||o.warn("Calling Plotly.plot as if redrawing but this container doesn't yet have a plot.",t),S(t,i),a||(a={}),n.select(t).classed("js-plotly-plot",!0),h.makeTester(),delete h.baseUrl,Array.isArray(t._promises)||(t._promises=[]);var g=0===(t.data||[]).length&&Array.isArray(e);if(Array.isArray(e)&&(_.cleanData(e,t.data),g?t.data=e:t.data.push.apply(t.data,e),t.empty=!1),t.layout&&!g||(t.layout=_.cleanLayout(a)),t._dragging&&!t._transitioning)return t._replotPending=!0,Promise.reject();t._replotPending=!1,f.supplyDefaults(t);var y=t._fullLayout,x=y._has("cartesian");if(!y._has("polar")&&e&&e[0]&&e[0].r)return o.log("Legacy polar charts are deprecated!"),function(t,e,r){var a=n.select(t).selectAll(".plot-container").data([0]);a.enter().insert("div",":first-child").classed("plot-container plotly",!0);var i=a.selectAll(".svg-container").data([0]);i.enter().append("div").classed("svg-container",!0).style("position","relative"),i.html(""),e&&(t.data=e);r&&(t.layout=r);d.manager.fillLayout(t),i.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=d.manager.framework(t),t.framework({data:t.data,layout:t.layout},i.node()),t.framework.setUndoPoint();var l=t.framework.svg(),s=1,c=t._fullLayout.title;""!==c&&c||(s=0);var u=function(){this.call(m.convertToTspans,t)},p=l.select(".title-group text").call(u);if(t._context.edits.titleText){var h=o._(t,"Click to enter Plot title");c&&c!==h||(s=.2,p.attr({"data-unformatted":h}).text(h).style({opacity:s}).on("mouseover.opacity",function(){n.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(1e3).style("opacity",0)}));var g=function(){this.call(m.makeEditable,{gd:t}).on("edit",function(e){t.framework({layout:{title:e}}),this.text(e).call(u),this.call(g)}).on("cancel",function(){var t=this.attr("data-unformatted");this.text(t).call(u)})};p.call(g)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),f.addLinks(t),Promise.resolve()}(t,e,a);y._replotting=!0,g&&V(t),t.framework!==V&&(t.framework=V,V(t)),h.initGradients(t),g&&p.saveShowSpikeInitial(t);var b=!t.calcdata||t.calcdata.length!==(t._fullData||[]).length;b&&f.doCalcdata(t);for(var k=0;k<t.calcdata.length;k++)t.calcdata[k][0].trace=t._fullData[k];var M=JSON.stringify(y._size);function A(){var e,r,n,a=t.calcdata;for(c.getComponentMethod("legend","draw")(t),c.getComponentMethod("rangeselector","draw")(t),c.getComponentMethod("sliders","draw")(t),c.getComponentMethod("updatemenus","draw")(t),e=0;e<a.length;e++)!0===(n=(r=a[e])[0].trace).visible&&n._module.colorbar?n._module.colorbar(t,r):f.autoMargin(t,"cb"+n.uid);return f.doAutoMargin(t),f.previousPromises(t)}function T(){t._transitioning||(w.doAutoRangeAndConstraints(t),g&&p.saveRangeInitial(t))}var L=[f.previousPromises,function(){if(s)return r.addFrames(t,s)},function(){for(var e=y._basePlotModules,r=0;r<e.length;r++)e[r].drawFramework&&e[r].drawFramework(t);return!y._glcanvas&&y._has("gl")&&(y._glcanvas=y._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}),y._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"})),y._glcanvas&&y._glcanvas.attr("width",y.width).attr("height",y.height),f.previousPromises(t)},A,function(){if(JSON.stringify(y._size)!==M)return o.syncOrAsync([A,w.layoutStyles],t)}];x&&L.push(function(){if(b){var e,r,n,a=y._subplots.cartesian,i=y._modules,l=[];for(n=0;n<i.length;n++)o.pushUnique(l,i[n].setPositions);if(l.length)for(r=0;r<a.length;r++)for(e=y._plots[a[r]],n=0;n<l.length;n++)l[n](t,e);return c.getComponentMethod("errorbars","calc")(t),o.syncOrAsync([c.getComponentMethod("shapes","calcAutorange"),c.getComponentMethod("annotations","calcAutorange"),T,c.getComponentMethod("rangeslider","calcAutorange")],t)}T()}),L.push(w.layoutStyles),x&&L.push(function(){return p.doTicks(t,g?"":"redraw")}),L.push(w.drawData,w.finalDraw,v,f.addLinks,f.rehover,f.previousPromises);var C=o.syncOrAsync(L,t);return C&&C.then||(C=Promise.resolve()),C.then(function(){return t.emit("plotly_afterplot"),t})},r.setPlotConfig=function(t){return o.extendFlat(x,t)},r.redraw=function(t){if(t=o.getGraphDiv(t),!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);return _.cleanData(t.data,t.data),_.cleanLayout(t.layout),t.calcdata=void 0,r.plot(t).then(function(){return t.emit("plotly_redraw"),t})},r.newPlot=function(t,e,n,a){return t=o.getGraphDiv(t),f.cleanPlot([],{},t._fullData||[],t._fullLayout||{},t.calcdata||[]),f.purge(t),r.plot(t,e,n,a)},r.extendTraces=function t(e,n,a,i){var l=z(e=o.getGraphDiv(e),n,a,i,function(t,e,r){var n,a;if(o.isTypedArray(t))if(r<0){var i=new t.constructor(0),l=D(t,e);r<0?(n=l,a=i):(n=i,a=l)}else if(n=new t.constructor(r),a=new t.constructor(t.length+e.length-r),r===e.length)n.set(e),a.set(t);else if(r<e.length){var s=e.length-r;n.set(e.subarray(s)),a.set(t),a.set(e.subarray(0,s),t.length)}else{var c=r-e.length,u=t.length-c;n.set(t.subarray(u)),n.set(e,c),a.set(t.subarray(0,u))}else n=t.concat(e),a=r>=0&&r<n.length?n.splice(0,n.length-r):[];return[n,a]}),c=r.redraw(e),u=[e,l.update,a,l.maxPoints];return s.add(e,r.prependTraces,u,t,arguments),c},r.prependTraces=function t(e,n,a,i){var l=z(e=o.getGraphDiv(e),n,a,i,function(t,e,r){var n,a;if(o.isTypedArray(t))if(r<=0){var i=new t.constructor(0),l=D(e,t);r<0?(n=l,a=i):(n=i,a=l)}else if(n=new t.constructor(r),a=new t.constructor(t.length+e.length-r),r===e.length)n.set(e),a.set(t);else if(r<e.length){var s=e.length-r;n.set(e.subarray(0,s)),a.set(e.subarray(s)),a.set(t,s)}else{var c=r-e.length;n.set(e),n.set(t.subarray(0,c),e.length),a.set(t.subarray(c))}else n=e.concat(t),a=r>=0&&r<n.length?n.splice(r,n.length):[];return[n,a]}),c=r.redraw(e),u=[e,l.update,a,l.maxPoints];return s.add(e,r.extendTraces,u,t,arguments),c},r.addTraces=function t(e,n,a){e=o.getGraphDiv(e);var i,l,c=[],u=r.deleteTraces,f=t,d=[e,c],p=[e,n];for(function(t,e,r){var n,a;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(a=e[n])||Array.isArray(a)||null===a)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,n,a),Array.isArray(n)||(n=[n]),n=n.map(function(t){return o.extendFlat({},t)}),_.cleanData(n,e.data),i=0;i<n.length;i++)e.data.push(n[i]);for(i=0;i<n.length;i++)c.push(-n.length+i);if(void 0===a)return l=r.redraw(e),s.add(e,u,d,f,p),l;Array.isArray(a)||(a=[a]);try{P(e,c,a)}catch(t){throw e.data.splice(e.data.length-n.length,n.length),t}return s.startSequence(e),s.add(e,u,d,f,p),l=r.moveTraces(e,c,a),s.stopSequence(e),l},r.deleteTraces=function t(e,n){e=o.getGraphDiv(e);var a,i,l=[],c=r.addTraces,u=t,f=[e,l,n],d=[e,n];if(void 0===n)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(n)||(n=[n]),O(e,n,"indices"),(n=C(n,e.data.length-1)).sort(o.sorterDes),a=0;a<n.length;a+=1)i=e.data.splice(n[a],1)[0],l.push(i);var p=r.redraw(e);return s.add(e,c,f,u,d),p},r.moveTraces=function t(e,n,a){var i,l=[],c=[],u=t,f=t,d=[e=o.getGraphDiv(e),a,n],p=[e,n,a];if(P(e,n,a),n=Array.isArray(n)?n:[n],void 0===a)for(a=[],i=0;i<n.length;i++)a.push(-n.length+i);for(a=Array.isArray(a)?a:[a],n=C(n,e.data.length-1),a=C(a,e.data.length-1),i=0;i<e.data.length;i++)-1===n.indexOf(i)&&l.push(e.data[i]);for(i=0;i<n.length;i++)c.push({newIndex:a[i],trace:e.data[n[i]]});for(c.sort(function(t,e){return t.newIndex-e.newIndex}),i=0;i<c.length;i+=1)l.splice(c[i].newIndex,0,c[i].trace);e.data=l;var h=r.redraw(e);return s.add(e,u,d,f,p),h},r.restyle=function t(e,n,a,i){e=o.getGraphDiv(e),_.clearPromiseQueue(e);var l={};if("string"==typeof n)l[n]=a;else{if(!o.isPlainObject(n))return o.warn("Restyle fail.",n,a,i),Promise.reject();l=o.extendFlat({},n),void 0===i&&(i=a)}Object.keys(l).length&&(e.changed=!0);var c=_.coerceTraceIndices(e,i),u=N(e,l,c),d=u.flags;d.clearCalc&&(e.calcdata=void 0),d.clearAxisTypes&&_.clearAxisTypes(e,c,{});var p=[];d.fullReplot?p.push(r.plot):(p.push(f.previousPromises),f.supplyDefaults(e),d.style&&p.push(w.doTraceStyle),d.colorbars&&p.push(w.doColorBars)),p.push(f.rehover),s.add(e,t,[e,u.undoit,u.traces],t,[e,u.redoit,u.traces]);var h=o.syncOrAsync(p,e);return h&&h.then||(h=Promise.resolve()),h.then(function(){return e.emit("plotly_restyle",u.eventData),e})},r.relayout=function t(e,r,n){if(e=o.getGraphDiv(e),_.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);var a={};if("string"==typeof r)a[r]=n;else{if(!o.isPlainObject(r))return o.warn("Relayout fail.",r,n),Promise.reject();a=o.extendFlat({},r)}Object.keys(a).length&&(e.changed=!0);var i=j(e,a),l=i.flags;l.calc&&(e.calcdata=void 0),l.margins&&_.clearAxisAutomargins(e);var c=[f.previousPromises];l.layoutReplot?c.push(w.layoutReplot):Object.keys(a).length&&(f.supplyDefaults(e),l.legend&&c.push(w.doLegend),l.layoutstyle&&c.push(w.layoutStyles),l.axrange&&c.push(function(t){return w.doTicksRelayout(t,i.rangesAltered)},w.drawData,w.finalDraw),l.ticks&&c.push(w.doTicksRelayout),l.modebar&&c.push(w.doModeBar),l.camera&&c.push(w.doCamera)),c.push(f.rehover),s.add(e,t,[e,i.undoit],t,[e,i.redoit]);var u=o.syncOrAsync(c,e);return u&&u.then||(u=Promise.resolve(e)),u.then(function(){return e.emit("plotly_relayout",i.eventData),e})};var R=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,I=/^[xyz]axis[0-9]*\.autorange$/,F=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function j(t,e){var r,n,a,i=t.layout,l=t._fullLayout,s=Object.keys(e),f=p.list(t),d={};for(n=0;n<s.length;n++)if(0===s[n].indexOf("allaxes")){for(a=0;a<f.length;a++){var h=f[a]._id.substr(1),g=-1!==h.indexOf("scene")?h+".":"",v=s[n].replace("allaxes",g+f[a]._name);e[v]||(e[v]=e[s[n]])}delete e[s[n]]}var y=k.layoutFlags(),m={},x={};function w(t,r){if(Array.isArray(t))t.forEach(function(t){w(t,r)});else if(!(t in e||_.hasParent(e,t))){var n=o.nestedProperty(i,t);t in x||(x[t]=E(n.get())),void 0!==r&&n.set(r)}}var A,T={};function L(t){var e=p.name2id(t.split(".")[0]);return T[e]=1,e}for(var S in e){if(_.hasParent(e,S))throw new Error("cannot set "+S+"and a parent attribute simultaneously");for(var C=o.nestedProperty(i,S),O=e[S],P=C.parts.length-1;P>0&&"string"!=typeof C.parts[P];)P--;var z=C.parts[P],D=C.parts[P-1]+"."+z,N=C.parts.slice(0,P).join("."),j=o.nestedProperty(t.layout,N).get(),q=o.nestedProperty(l,N).get(),V=C.get();if(void 0!==O){m[S]=O,x[S]="reverse"===z?O:E(V);var U=u.getLayoutValObject(l,C.parts);if(U&&U.impliedEdits&&null!==O)for(var G in U.impliedEdits)w(o.relativeAttr(S,G),U.impliedEdits[G]);if(-1!==["width","height"].indexOf(S)&&null===O)l[S]=t._initialAutoSize[S];else if(D.match(R))L(D),o.nestedProperty(l,N+"._inputRange").set(null);else if(D.match(I)){L(D),o.nestedProperty(l,N+"._inputRange").set(null);var Y=o.nestedProperty(l,N).get();Y._inputDomain&&(Y._input.domain=Y._inputDomain.slice())}else D.match(F)&&o.nestedProperty(l,N+"._inputDomain").set(null);if("type"===z){var X=j,Z="linear"===q.type&&"log"===O,W="log"===q.type&&"linear"===O;if(Z||W){if(X&&X.range)if(q.autorange)Z&&(X.range=X.range[1]>X.range[0]?[1,2]:[2,1]);else{var Q=X.range[0],J=X.range[1];Z?(Q<=0&&J<=0&&w(N+".autorange",!0),Q<=0?Q=J/1e6:J<=0&&(J=Q/1e6),w(N+".range[0]",Math.log(Q)/Math.LN10),w(N+".range[1]",Math.log(J)/Math.LN10)):(w(N+".range[0]",Math.pow(10,Q)),w(N+".range[1]",Math.pow(10,J)))}else w(N+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[C.parts[0]]&&"radialaxis"===C.parts[1]&&delete l[C.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,q,O,w),c.getComponentMethod("images","convertCoords")(t,q,O,w)}else w(N+".autorange",!0),w(N+".range",null);o.nestedProperty(l,N+"._inputRange").set(null)}else if(z.match(M)){var $=o.nestedProperty(l,S).get(),K=(O||{}).type;K&&"-"!==K||(K="linear"),c.getComponentMethod("annotations","convertCoords")(t,$,K,w),c.getComponentMethod("images","convertCoords")(t,$,K,w)}var tt=b.containerArrayMatch(S);if(tt){r=tt.array,n=tt.index;var et=tt.property,rt=(o.nestedProperty(i,r)||[])[n]||{},nt=rt,at=U||{editType:"calc"},it=-1!==at.editType.indexOf("calcIfAutorange");""===n?(it?y.calc=!0:k.update(y,at),it=!1):""===et&&(nt=O,b.isAddVal(O)?x[S]=null:b.isRemoveVal(O)?(x[S]=rt,nt=rt):o.warn("unrecognized full object value",e)),it&&(H(t,nt,"x")||H(t,nt,"y"))?y.calc=!0:k.update(y,at),d[r]||(d[r]={});var ot=d[r][n];ot||(ot=d[r][n]={}),ot[et]=O,delete e[S]}else"reverse"===z?(j.range?j.range.reverse():(w(N+".autorange",!0),j.range=[1,0]),q.autorange?y.calc=!0:y.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===S&&("lasso"===O||"select"===O)&&"lasso"!==V&&"select"!==V?y.plot=!0:U?k.update(y,U):y.calc=!0,C.set(O))}}for(r in d){b.applyContainerArrayChanges(t,o.nestedProperty(i,r),d[r],y)||(y.plot=!0)}var lt=l._axisConstraintGroups||[];for(A in T)for(n=0;n<lt.length;n++){var st=lt[n];if(st[A])for(var ct in y.calc=!0,st)T[ct]||(p.getFromId(t,ct)._constraintShrinkable=!0)}return(B(t)||e.height||e.width)&&(y.plot=!0),(y.plot||y.calc)&&(y.layoutReplot=!0),{flags:y,rangesAltered:T,undoit:x,redoit:m,eventData:o.extendDeep({},m)}}function B(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&f.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function H(t,e,r){if(!o.isPlainObject(e))return!1;var n=e[r+"ref"]||r,a=p.getFromId(t,n);return a||n.charAt(0)!==r||(a=p.getFromId(t,r)),(a||{}).autorange}function q(t,e,r,n){var a,i,l=n.getValObject,s=n.flags,c=n.immutable,u=n.inArray,f=n.arrayIndex,d=n.gd,p=n.autoranged;function h(){var t=a.editType;-1!==t.indexOf("calcIfAutorange")&&(p||void 0===p&&(H(d,e,"x")||H(d,e,"y")))?s.calc=!0:u&&-1!==t.indexOf("arraydraw")?o.pushUnique(s.arrays[u],f):k.update(s,a)}function g(t){return"data_array"===t.valType||t.arrayOk}for(i in t){if(s.calc)return;var v=t[i],y=e[i];if("_"!==i.charAt(0)&&"function"!=typeof v&&v!==y){if("tick0"===i||"dtick"===i){var m=e.tickmode;if("auto"===m||"array"===m||!m)continue}if(("range"!==i||!e.autorange)&&("zmin"!==i&&"zmax"!==i||"contourcarpet"!==e.type)){var x=r.concat(i);if((a=l(x))&&(!a._compareAsJSON||JSON.stringify(v)!==JSON.stringify(y))){var b,_=a.valType,w=g(a),M=Array.isArray(v),A=Array.isArray(y);if(M&&A){var T="_input_"+i,L=t[T],S=e[T];if(Array.isArray(L)&&L===S)continue}if(void 0===y)w&&M?s.calc=!0:h();else if(a._isLinkedToArray){var C=[],O=!1;u||(s.arrays[i]=C);var P=Math.min(v.length,y.length),z=Math.max(v.length,y.length);if(P!==z){if("arraydraw"!==a.editType){h();continue}O=!0}for(b=0;b<P;b++)q(v[b],y[b],x.concat(b),o.extendFlat({inArray:i,arrayIndex:b},n));if(O)for(b=P;b<z;b++)C.push(b)}else!_&&o.isPlainObject(v)?q(v,y,x,n):w?M&&A?c&&(s.calc=!0):M!==A?s.calc=!0:h():M&&A&&v.length===y.length&&String(v)===String(y)||h()}}}}for(i in e)if(!(i in t||"_"===i.charAt(0)||"function"==typeof e[i])){if(g(a=l(r.concat(i)))&&Array.isArray(e[i]))return void(s.calc=!0);h()}}function V(t){var e=n.select(t),r=t._fullLayout;if(r._container=e.selectAll(".plot-container").data([0]),r._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),r._paperdiv=r._container.selectAll(".svg-container").data([0]),r._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([{}]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._glcanvas=null,r._paperdiv.selectAll(".main-svg").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var a=[];n.selectAll("defs").each(function(){this.id&&a.push(this.id.split("-")[1])}),r._uid=o.randstr(a)}r._paperdiv.selectAll(".main-svg").attr(y.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._clips=r._defs.append("g").classed("clips",!0),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),r._topclips=r._topdefs.append("g").classed("clips",!0),r._bgLayer=r._paper.append("g").classed("bglayer",!0),r._draggers=r._paper.append("g").classed("draglayer",!0);var i=r._paper.append("g").classed("layer-below",!0);r._imageLowerLayer=i.append("g").classed("imagelayer",!0),r._shapeLowerLayer=i.append("g").classed("shapelayer",!0),r._cartesianlayer=r._paper.append("g").classed("cartesianlayer",!0),r._polarlayer=r._paper.append("g").classed("polarlayer",!0),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0),r._geolayer=r._paper.append("g").classed("geolayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0);var l=r._toppaper.append("g").classed("layer-above",!0);r._imageUpperLayer=l.append("g").classed("imagelayer",!0),r._shapeUpperLayer=l.append("g").classed("shapelayer",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._menulayer=r._toppaper.append("g").classed("menulayer",!0),r._zoomlayer=r._toppaper.append("g").classed("zoomlayer",!0),r._hoverlayer=r._toppaper.append("g").classed("hoverlayer",!0),t.emit("plotly_framework")}r.update=function t(e,n,a,i){if(e=o.getGraphDiv(e),_.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);o.isPlainObject(n)||(n={}),o.isPlainObject(a)||(a={}),Object.keys(n).length&&(e.changed=!0),Object.keys(a).length&&(e.changed=!0);var l=_.coerceTraceIndices(e,i),c=N(e,o.extendFlat({},n),l),u=c.flags,d=j(e,o.extendFlat({},a)),p=d.flags;(u.clearCalc||p.calc)&&(e.calcdata=void 0),u.clearAxisTypes&&_.clearAxisTypes(e,l,a),p.margins&&_.clearAxisAutomargins(e);var h=[];if(u.fullReplot&&p.layoutReplot){var g=e.data,v=e.layout;e.data=void 0,e.layout=void 0,h.push(function(){return r.plot(e,g,v)})}else u.fullReplot?h.push(r.plot):p.layoutReplot?h.push(w.layoutReplot):(h.push(f.previousPromises),f.supplyDefaults(e),u.style&&h.push(w.doTraceStyle),u.colorbars&&h.push(w.doColorBars),p.legend&&h.push(w.doLegend),p.layoutstyle&&h.push(w.layoutStyles),p.axrange&&h.push(function(t){return w.doTicksRelayout(t,d.rangesAltered)},w.drawData,w.finalDraw),p.ticks&&h.push(w.doTicksRelayout),p.modebar&&h.push(w.doModeBar),p.camera&&h.push(w.doCamera));h.push(f.rehover),s.add(e,t,[e,c.undoit,d.undoit,c.traces],t,[e,c.redoit,d.redoit,c.traces]);var y=o.syncOrAsync(h,e);return y&&y.then||(y=Promise.resolve(e)),y.then(function(){return e.emit("plotly_update",{data:c.eventData,layout:d.eventData}),e})},r.react=function(t,e,n,a){var i,l;var s=(t=o.getGraphDiv(t))._fullData,d=t._fullLayout;if(o.isPlotDiv(t)&&s&&d){if(o.isPlainObject(e)){var h=e;e=h.data,n=h.layout,a=h.config,i=h.frames}var g=!1;if(a){var v=o.extendDeep({},t._context);t._context=void 0,S(t,a),g=function t(e,r){var n;for(n in e){var a=e[n],i=r[n];if(a!==i)if(o.isPlainObject(a)&&o.isPlainObject(i)){if(t(a,i))return!0}else{if(!Array.isArray(a)||!Array.isArray(i))return!0;if(a.length!==i.length)return!0;for(var l=0;l<a.length;l++)if(a[l]!==i[l]){if(!o.isPlainObject(a[l])||!o.isPlainObject(i[l]))return!0;if(t(a[l],i[l]))return!0}}}}(v,t._context)}t.data=e||[],_.cleanData(t.data,[]),t.layout=n||{},_.cleanLayout(t.layout),f.supplyDefaults(t,{skipUpdateCalc:!0});var y=t._fullData,m=t._fullLayout,x=void 0===m.datarevision,b=function(t,e,r,n){if(e.length!==r.length)return{fullReplot:!0,calc:!0};var a,i,o=k.traceFlags();o.arrays={};var l={getValObject:function(t){return u.getTraceValObject(i,t)},flags:o,immutable:n,gd:t},s={};for(a=0;a<e.length;a++)i=r[a]._fullInput,s[i.uid]||(s[i.uid]=1,l.autoranged=!!i.xaxis&&(p.getFromId(t,i.xaxis).autorange||p.getFromId(t,i.yaxis).autorange),q(e[a]._fullInput,i,[],l));(o.calc||o.plot||o.calcIfAutorange)&&(o.fullReplot=!0);return o}(t,s,y,x),M=function(t,e,r,n){var a=k.layoutFlags();a.arrays={},q(e,r,[],{getValObject:function(t){return u.getLayoutValObject(r,t)},flags:a,immutable:n,gd:t}),(a.plot||a.calc)&&(a.layoutReplot=!0);return a}(t,d,m,x);B(t)&&(M.layoutReplot=!0),b.calc||M.calc?t.calcdata=void 0:f.supplyDefaultsUpdateCalc(t.calcdata,y),M.margins&&_.clearAxisAutomargins(t);var A=[];if(i&&(t._transitionData={},f.createTransitionData(t),A.push(function(){return r.addFrames(t,i)})),b.fullReplot||M.layoutReplot||g)t._fullLayout._skipDefaults=!0,A.push(r.plot);else{for(var T in M.arrays){var L=M.arrays[T];if(L.length){var C=c.getComponentMethod(T,"drawOne");if(C!==o.noop)for(var O=0;O<L.length;O++)C(t,L[O]);else{var P=c.getComponentMethod(T,"draw");if(P===o.noop)throw new Error("cannot draw components: "+T);P(t)}}}A.push(f.previousPromises),b.style&&A.push(w.doTraceStyle),b.colorbars&&A.push(w.doColorBars),M.legend&&A.push(w.doLegend),M.layoutstyle&&A.push(w.layoutStyles),M.axrange&&A.push(w.doTicksRelayout,w.drawData,w.finalDraw),M.ticks&&A.push(w.doTicksRelayout),M.modebar&&A.push(w.doModeBar),M.camera&&A.push(w.doCamera)}A.push(f.rehover),(l=o.syncOrAsync(A,t))&&l.then||(l=Promise.resolve(t))}else l=r.newPlot(t,e,n,a);return l.then(function(){return t.emit("plotly_react",{data:e,layout:n}),t})},r.animate=function(t,e,r){if(t=o.getGraphDiv(t),!o.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 a=(r=f.supplyAnimationDefaults(r)).transition,i=r.frame;function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function s(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function c(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise(function(i,u){function d(){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,f.transition(t,e.frame.data,e.frame.layout,_.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&d()};e()}var h,g,v=0;function y(t){return Array.isArray(a)?v>=a.length?t.transitionOpts=a[v]:t.transitionOpts=a[0]:t.transitionOpts=a,v++,t}var m=[],x=null==e,b=Array.isArray(e);if(!x&&!b&&o.isPlainObject(e))m.push({type:"object",data:y(o.extendFlat({},e))});else if(x||-1!==["string","number"].indexOf(typeof e))for(h=0;h<n._frames.length;h++)(g=n._frames[h])&&(x||String(g.group)===String(e))&&m.push({type:"byname",name:String(g.name),data:y({name:g.name})});else if(b)for(h=0;h<e.length;h++){var w=e[h];-1!==["number","string"].indexOf(typeof w)?(w=String(w),m.push({type:"byname",name:w,data:y({name:w})})):o.isPlainObject(w)&&m.push({type:"object",data:y(o.extendFlat({},w))})}for(h=0;h<m.length;h++)if("byname"===(g=m[h]).type&&!n._frameHash[g.data.name])return o.warn('animate failure: frame not found: "'+g.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&&m.reverse();var k=t._fullLayout._currentFrame;if(k&&r.fromcurrent){var M=-1;for(h=0;h<m.length;h++)if("byname"===(g=m[h]).type&&g.name===k){M=h;break}if(M>0&&M<m.length-1){var A=[];for(h=0;h<m.length;h++)g=m[h],("byname"!==m[h].type||h>M)&&A.push(g);m=A}}m.length>0?function(e){if(0!==e.length){for(var a=0;a<e.length;a++){var o;o="byname"===e[a].type?f.computeFrame(t,e[a].name):e[a].data;var d=s(a),h=l(a);h.duration=Math.min(h.duration,d.duration);var g={frame:o,name:e[a].name,frameOpts:d,transitionOpts:h};a===e.length-1&&(g.onComplete=c(i,2),g.onInterrupt=u),n._frameQueue.push(g)}"immediate"===r.mode&&(n._lastFrameAt=-1/0),n._animationRaf||p()}}(m):(t.emit("plotly_animated"),i())})},r.addFrames=function(t,e,r){if(t=o.getGraphDiv(t),null==e)return Promise.resolve();if(!o.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,a,i,l,c=t._transitionData._frames,u=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var d=c.length+2*e.length,p=[],h={};for(n=e.length-1;n>=0;n--)if(o.isPlainObject(e[n])){var g=e[n].name,v=(u[g]||h[g]||{}).name,y=e[n].name,m=u[v]||h[v];v&&y&&"number"==typeof y&&m&&A<5&&(A++,o.warn('addFrames: overwriting frame "'+(u[v]||h[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===A&&o.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[g]={name:g},p.push({frame:f.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:d+n})}p.sort(function(t,e){return t.index>e.index?-1:t.index<e.index?1:0});var x=[],b=[],_=c.length;for(n=p.length-1;n>=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+t._transitionData._counter++];);if(u[a.name]){for(i=0;i<c.length&&(c[i]||{}).name!==a.name;i++);x.push({type:"replace",index:i,value:a}),b.unshift({type:"replace",index:i,value:c[i]})}else l=Math.max(0,Math.min(p[n].index,_)),x.push({type:"insert",index:l,value:a}),b.unshift({type:"delete",index:l}),_++}var w=f.modifyFrames,k=f.modifyFrames,M=[t,b],T=[t,x];return s&&s.add(t,w,M,k,T),f.modifyFrames(t,x)},r.deleteFrames=function(t,e){if(t=o.getGraphDiv(t),!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);var r,n,a=t._transitionData._frames,i=[],l=[];if(!e)for(e=[],r=0;r<a.length;r++)e.push(r);for((e=e.slice(0)).sort(),r=e.length-1;r>=0;r--)n=e[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var c=f.modifyFrames,u=f.modifyFrames,d=[t,l],p=[t,i];return s&&s.add(t,c,d,u,p),f.modifyFrames(t,i)},r.purge=function(t){var e=(t=o.getGraphDiv(t))._fullLayout||{},r=t._fullData||[],n=t.calcdata||[];return f.cleanPlot([],{},r,e,n),f.purge(t),l.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":43,"../components/drawing":68,"../constants/xmlns_namespaces":147,"../lib":163,"../lib/events":156,"../lib/queue":177,"../lib/svg_text_utils":184,"../plots/cartesian/axes":205,"../plots/cartesian/constants":210,"../plots/cartesian/graph_interact":214,"../plots/plots":237,"../plots/polar/legacy":240,"../registry":245,"./edit_types":190,"./helpers":191,"./manage_arrays":193,"./plot_config":195,"./plot_schema":196,"./subroutines":197,d3:7,"fast-isnumeric":10,"has-hover":12}],195:[function(t,e,r){"use strict";e.exports={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,toImageButtonOptions:{},displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:1,globalTransforms:[],locale:"en-US",locales:{}}},{}],196:[function(t,e,r){"use strict";var n=t("../registry"),a=t("../lib"),i=t("../plots/attributes"),o=t("../plots/layout_attributes"),l=t("../plots/frame_attributes"),s=t("../plots/animation_attributes"),c=t("../plots/polar/legacy/area_attributes"),u=t("../plots/polar/legacy/axis_attributes"),f=t("./edit_types"),d=a.extendFlat,p=a.extendDeepAll,h=a.isPlainObject,g="_isSubplotObj",v="_isLinkedToArray",y=[g,v,"_arrayAttrRegexps","_deprecated"];function m(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(x(e[r]))r++;else if(r<e.length)return!1;for(;r<e.length;r++){var n=t[e[r]];if(!h(n))break;if(t=n,r===e.length-1)break;if(t._isLinkedToArray){if(!x(e[++r]))return!1}else if("info_array"===t.valType){var a=e[++r];if(!x(a))return!1;var i=t.items;if(Array.isArray(i)){if(a>=i.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!x(o))return!1;t=i[a][o]}else t=i[a]}else t=i}}return t}function x(t){return t===Math.round(t)&&t>=0}function b(t){return function(t){r.crawl(t,function(t,e,n){r.isValObject(t)?"data_array"===t.valType?(t.role="data",n[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(n[e+"src"]={valType:"string",editType:"none"}):h(t)&&(t.role="object")})}(t),function(t){r.crawl(t,function(t,e,r){if(!t)return;var n=t[v];if(!n)return;delete t[v],r[e]={items:{}},r[e].items[n]=t,r[e].role="object"})}(t),function(t){!function t(e){for(var r in e)if(h(e[r]))t(e[r]);else if(Array.isArray(e[r]))for(var n=0;n<e[r].length;n++)t(e[r][n]);else e[r]instanceof RegExp&&(e[r]=e[r].toString())}(t)}(t),t}function _(t,e,r){var n=a.nestedProperty(t,r),i=p({},e.layoutAttributes);i[g]=!0,n.set(i)}function w(t,e,r){var n=a.nestedProperty(t,r);n.set(p(n.get()||{},e))}r.IS_SUBPLOT_OBJ=g,r.IS_LINKED_TO_ARRAY=v,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=y,r.get=function(){var t={};n.allTypes.concat("area").forEach(function(e){t[e]=function(t){var e,r;"area"===t?(e={attributes:c},r={}):(e=n.modules[t]._module,r=e.basePlotModule);var a={type:null};p(a,i),p(a,e.attributes),r.attributes&&p(a,r.attributes);a.type=t;var o={meta:e.meta||{},attributes:b(a)};if(e.layoutAttributes){var l={};p(l,e.layoutAttributes),o.layoutAttributes=b(l)}return o}(e)});var e,r={};return Object.keys(n.transformsRegistry).forEach(function(t){r[t]=function(t){var e=n.transformsRegistry[t],r=p({},e.attributes);return Object.keys(n.componentsRegistry).forEach(function(e){var a=n.componentsRegistry[e];a.schema&&a.schema.transforms&&a.schema.transforms[t]&&Object.keys(a.schema.transforms[t]).forEach(function(e){w(r,a.schema.transforms[t][e],e)})}),{attributes:b(r)}}(t)}),{defs:{valObjects:a.valObjectMeta,metaKeys:y.concat(["description","role","editType","impliedEdits"]),editType:{traces:f.traces,layout:f.layout},impliedEdits:{}},traces:t,layout:function(){var t,e,r={};for(t in p(r,o),n.subplotsRegistry)if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var a=0;a<e.attr.length;a++)_(r,e,e.attr[a]);else{var i="subplot"===e.attr?e.name:e.attr;_(r,e,i)}for(t in r=function(t){return d(t,{radialaxis:u.radialaxis,angularaxis:u.angularaxis}),d(t,u.layout),t}(r),n.componentsRegistry){var l=(e=n.componentsRegistry[t]).schema;if(l&&(l.subplots||l.layout)){var s=l.subplots;if(s&&s.xaxis&&!s.yaxis)for(var c in s.xaxis)delete r.yaxis[c]}else e.layoutAttributes&&w(r,e.layoutAttributes,e.name)}return{layoutAttributes:b(r)}}(),transforms:r,frames:(e={frames:a.extendDeepAll({},l)},b(e),e.frames),animation:b(s)}},r.crawl=function(t,e,n,a){var i=n||0;a=a||"",Object.keys(t).forEach(function(n){var o=t[n];if(-1===y.indexOf(n)){var l=(a?a+".":"")+n;e(o,n,t,i,l),r.isValObject(o)||h(o)&&"impliedEdits"!==n&&r.crawl(o,e,i+1,l)}})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){var e,n,o=[],l=[],s=[];function c(t,r,i,c){l=l.slice(0,c).concat([r]),s=s.slice(0,c).concat([t&&t._isLinkedToArray]),t&&("data_array"===t.valType||!0===t.arrayOk)&&!("colorbar"===l[c-1]&&("ticktext"===r||"tickvals"===r))&&function t(e,r,i){var c=e[l[r]];var u=i+l[r];if(r===l.length-1)a.isArrayOrTypedArray(c)&&o.push(n+u);else if(s[r]){if(Array.isArray(c))for(var f=0;f<c.length;f++)a.isPlainObject(c[f])&&t(c[f],r+1,u+"["+f+"].")}else a.isPlainObject(c)&&t(c,r+1,u+".")}(e,0,"")}e=t,n="",r.crawl(i,c),t._module&&t._module.attributes&&r.crawl(t._module.attributes,c);var u=t.transforms;if(u)for(var f=0;f<u.length;f++){var d=u[f],p=d._module;p&&(n="transforms["+f+"].",e=d,r.crawl(p.attributes,c))}return o},r.getTraceValObject=function(t,e){var r,a,o=e[0],l=1;if("transforms"===o){if(1===e.length)return i.transforms;var s=t.transforms;if(!Array.isArray(s)||!s.length)return!1;var u=e[1];if(!x(u)||u>=s.length)return!1;a=(r=(n.transformsRegistry[s[u].type]||{}).attributes)&&r[e[2]],l=3}else if("area"===t.type)a=c[o];else{var f=t._module;if(f||(f=(n.modules[t.type||i.type.dflt]||{})._module),!f)return!1;if(!(a=(r=f.attributes)&&r[o])){var d=f.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return m(a,e,l)},r.getLayoutValObject=function(t,e){return m(function(t,e){var r,a,i,l,s=t._basePlotModules;if(s){var c;for(r=0;r<s.length;r++){if((i=s[r]).attrRegex&&i.attrRegex.test(e)){if(i.layoutAttrOverrides)return i.layoutAttrOverrides;!c&&i.layoutAttributes&&(c=i.layoutAttributes)}var f=i.baseLayoutAttrOverrides;if(f&&e in f)return f[e]}if(c)return c}var d=t._modules;if(d)for(r=0;r<d.length;r++)if((l=d[r].layoutAttributes)&&e in l)return l[e];for(a in n.componentsRegistry)if(!(i=n.componentsRegistry[a]).schema&&e===i.name)return i.layoutAttributes;if(e in o)return o[e];if("radialaxis"===e||"angularaxis"===e)return u[e];return u.layout[e]||!1}(t,e[0]),e,1)}},{"../lib":163,"../plots/animation_attributes":200,"../plots/attributes":202,"../plots/frame_attributes":232,"../plots/layout_attributes":235,"../plots/polar/legacy/area_attributes":238,"../plots/polar/legacy/axis_attributes":239,"../registry":245,"./edit_types":190}],197:[function(t,e,r){"use strict";var n=t("d3"),a=t("../registry"),i=t("../plots/plots"),o=t("../lib"),l=t("../lib/clear_gl_canvases"),s=t("../components/color"),c=t("../components/drawing"),u=t("../components/titles"),f=t("../components/modebar"),d=t("../plots/cartesian/axes"),p=t("../constants/alignment"),h=t("../plots/cartesian/constraints"),g=h.enforce,v=h.clean,y=t("../plots/cartesian/autorange").doAutoRange;function m(t,e){var r=e._subplots,n=r.cartesian.concat(r.gl2d||[]),a={_fullLayout:e},i="x"===t._id.charAt(0),o=t._mainAxis._anchorAxis,l="",s="",c="";if(o&&(c=o._mainAxis._id,l=i?t._id+c:c+t._id),!l||!e._plots[l]){l="";for(var u=0;u<n.length;u++){var f=n[u],p=f.indexOf("y"),h=i?f.substr(0,p):f.substr(p),g=i?f.substr(p):f.substr(0,p);if(h===t._id){s||(s=f);var v=d.getFromId(a,g);if(c&&v.overlaying===c){l=f;break}}}}return l||s}function x(t,e){return(t.ticks||t.showline)&&(e===t._mainSubplot||"all"===t.mirror||"allticks"===t.mirror)}function b(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 a=p.FROM_BL[e];return r.side===e?n.domain[a]===t.domain[a]:r.mirror&&n.domain[1-a]===t.domain[1-a]}function _(t,e,r,n){if(b(t,e,r))return r._lw;for(var a=0;a<n.length;a++){var i=n[a];if(i._mainAxis===r._mainAxis&&b(t,e,i))return i._lw}return 0}r.layoutStyles=function(t){return o.syncOrAsync([i.doAutoMargin,r.lsInner],t)},r.lsInner=function(t){var e,a=t._fullLayout,i=a._size,l=i.p,u=d.list(t,"",!0),h=a._has("cartesian");function g(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-l-n:e._offset+e._length+l+n:i.t+i.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+l+n:e._offset-l-n:i.l+i.w*(t.position||0)+n%1}for(e=0;e<u.length;e++){var v=u[e];v.setScale();var y=v._anchorAxis;v._linepositions={},v._lw=c.crispRound(t,v.linewidth,1),v._mainLinePosition=g(v,y,v.side),v._mainMirrorPosition=v.mirror&&y?g(v,y,p.OPPOSITE_SIDE[v.side]):null,v._mainSubplot=m(v,a)}a._paperdiv.style({width:a.width+"px",height:a.height+"px"}).selectAll(".main-svg").call(c.setSize,a.width,a.height),t._context.setBackground(t,a.paper_bgcolor);var b=a._paper.selectAll("g.subplot"),w=[],k=[];b.each(function(t){var e=a._plots[t];if(e.mainplot)return e.bg&&e.bg.remove(),void(e.bg=void 0);var r=e.xaxis.domain,n=e.yaxis.domain,i=e.plotgroup;if(function(t,e,r){for(var n=0;n<r.length;n++){var a=r[n][0],i=r[n][1];if(!(a[0]>=t[1]||a[1]<=t[0])&&i[0]<e[1]&&i[1]>e[0])return!0}return!1}(r,n,k)){var l=i.node(),s=e.bg=o.ensureSingle(i,"rect","bg");l.insertBefore(s.node(),l.childNodes[0])}else i.select("rect.bg").remove(),w.push(t),k.push([r,n])});var M=a._bgLayer.selectAll(".bg").data(w);return M.enter().append("rect").classed("bg",!0),M.exit().remove(),M.each(function(t){a._plots[t].bg=n.select(this)}),b.each(function(t){var e=a._plots[t],r=e.xaxis,n=e.yaxis;e.bg&&h&&e.bg.call(c.setRect,r._offset-l,n._offset-l,r._length+2*l,n._length+2*l).call(s.fill,a.plot_bgcolor).style("stroke-width",0);var i,f,d=e.clipId="clip"+a._uid+t+"plot",p=o.ensureSingleById(a._clips,"clipPath",d,function(t){t.classed("plotclip",!0).append("rect")});if(e.clipRect=p.select("rect").attr({width:r._length,height:n._length}),c.setTranslate(e.plot,r._offset,n._offset),e._hasClipOnAxisFalse?(i=null,f=d):(i=d,f=null),c.setClipUrl(e.plot,i),e.layerClipId=f,h){var v,y,m,b,w,k,M,A,T,L,S,C,O,P="M0,0";x(r,t)&&(w=_(r,"left",n,u),v=r._offset-(w?l+w:0),k=_(r,"right",n,u),y=r._offset+r._length+(k?l+k:0),m=g(r,n,"bottom"),b=g(r,n,"top"),(O=!r._anchorAxis||t!==r._mainSubplot)&&r.ticks&&"allticks"===r.mirror&&(r._linepositions[t]=[m,b]),P=N(r,D,function(t){return"M"+r._offset+","+t+"h"+r._length}),O&&r.showline&&("all"===r.mirror||"allticks"===r.mirror)&&(P+=D(m)+D(b)),e.xlines.style("stroke-width",r._lw+"px").call(s.stroke,r.showline?r.linecolor:"rgba(0,0,0,0)")),e.xlines.attr("d",P);var z="M0,0";x(n,t)&&(S=_(n,"bottom",r,u),M=n._offset+n._length+(S?l:0),C=_(n,"top",r,u),A=n._offset-(C?l:0),T=g(n,r,"left"),L=g(n,r,"right"),(O=!n._anchorAxis||t!==r._mainSubplot)&&n.ticks&&"allticks"===n.mirror&&(n._linepositions[t]=[T,L]),z=N(n,E,function(t){return"M"+t+","+n._offset+"v"+n._length}),O&&n.showline&&("all"===n.mirror||"allticks"===n.mirror)&&(z+=E(T)+E(L)),e.ylines.style("stroke-width",n._lw+"px").call(s.stroke,n.showline?n.linecolor:"rgba(0,0,0,0)")),e.ylines.attr("d",z)}function D(t){return"M"+v+","+t+"H"+y}function E(t){return"M"+t+","+A+"V"+M}function N(e,r,n){if(!e.showline||t!==e._mainSubplot)return"";if(!e._anchorAxis)return n(e._mainLinePosition);var a=r(e._mainLinePosition);return e.mirror&&(a+=r(e._mainMirrorPosition)),a}}),d.makeClipPaths(t),r.drawMainTitle(t),f.manage(t),t._promises.length&&Promise.all(t._promises)},r.drawMainTitle=function(t){var e=t._fullLayout;u.draw(t,"gtitle",{propContainer:e,propName:"title",placeholder:e._dfltTitle.plot,attributes:{x:e.width/2,y:e._size.t/2,"text-anchor":"middle"}})},r.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 i.style(t),a.getComponentMethod("legend","draw")(t),i.previousPromises(t)},r.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,o=r.t.cb;a.traceIs(n,"contour")&&o.line({width:!1!==n.contours.showlines?n.line.width:0,dash:n.line.dash,color:"line"===n.contours.coloring?o._opts.line.color:n.line.color}),a.traceIs(n,"markerColorscale")?o.options(n.marker.colorbar)():o.options(n.colorbar)()}}return i.previousPromises(t)},r.layoutReplot=function(t){var e=t.layout;return t.layout=void 0,a.call("plot",t,"",e)},r.doLegend=function(t){return a.getComponentMethod("legend","draw")(t),i.previousPromises(t)},r.doTicksRelayout=function(t,e){return e?d.doTicks(t,Object.keys(e),!0):d.doTicks(t,"redraw"),t._fullLayout._hasOnlyLargeSploms&&(l(t),a.subplotsRegistry.splom.plot(t)),r.drawMainTitle(t),i.previousPromises(t)},r.doModeBar=function(t){var e=t._fullLayout;f.manage(t);for(var r=0;r<e._basePlotModules.length;r++){var n=e._basePlotModules[r].updateFx;n&&n(e)}return i.previousPromises(t)},r.doCamera=function(t){for(var e=t._fullLayout,r=e._subplots.gl3d,n=0;n<r.length;n++){var a=e[r[n]];a._scene.setCamera(a.camera)}},r.drawData=function(t){var e,r=t._fullLayout,n=t.calcdata;for(e=0;e<n.length;e++){var o=n[e][0].trace;!0===o.visible&&o._module.colorbar||r._infolayer.select(".cb"+o.uid).remove()}l(t);var s=r._basePlotModules;for(e=0;e<s.length;e++)s[e].plot(t);return i.style(t),a.getComponentMethod("shapes","draw")(t),a.getComponentMethod("annotations","draw")(t),r._replotting=!1,i.previousPromises(t)},r.doAutoRangeAndConstraints=function(t){for(var e=d.list(t,"",!0),r=0;r<e.length;r++){var n=e[r];v(t,n),y(n)}g(t)},r.finalDraw=function(t){a.getComponentMethod("shapes","draw")(t),a.getComponentMethod("images","draw")(t),a.getComponentMethod("annotations","draw")(t),a.getComponentMethod("legend","draw")(t),a.getComponentMethod("rangeslider","draw")(t),a.getComponentMethod("rangeselector","draw")(t),a.getComponentMethod("sliders","draw")(t),a.getComponentMethod("updatemenus","draw")(t)}},{"../components/color":43,"../components/drawing":68,"../components/modebar":106,"../components/titles":136,"../constants/alignment":143,"../lib":163,"../lib/clear_gl_canvases":152,"../plots/cartesian/autorange":204,"../plots/cartesian/axes":205,"../plots/cartesian/constraints":212,"../plots/plots":237,"../registry":245,d3:7}],198:[function(t,e,r){"use strict";var n=t("./plot_api"),a=t("../lib"),i=t("../snapshot/helpers"),o=t("../snapshot/tosvg"),l=t("../snapshot/svgtoimg"),s={format:{valType:"enumerated",values:["png","jpeg","webp","svg"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}},c=/^data:image\/\w+;base64,/;e.exports=function(t,e){var r,u,f;function d(t){return!(t in e)||a.validate(e[t],s[t])}if(e=e||{},a.isPlainObject(t)?(r=t.data||[],u=t.layout||{},f=t.config||{}):(t=a.getGraphDiv(t),r=a.extendDeep([],t.data),u=a.extendDeep({},t.layout),f=t._context),!d("width")||!d("height"))throw new Error("Height and width should be pixel values.");if(!d("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var p={};function h(t,r){return a.coerce(e,p,s,t,r)}var g=h("format"),v=h("width"),y=h("height"),m=h("scale"),x=h("setBackground"),b=h("imageDataOnly"),_=document.createElement("div");_.style.position="absolute",_.style.left="-5000px",document.body.appendChild(_);var w=a.extendFlat({},u);v&&(w.width=v),y&&(w.height=y);var k=a.extendFlat({},f,{staticPlot:!0,setBackground:x}),M=i.getRedrawFunc(_);function A(){return new Promise(function(t){setTimeout(t,i.getDelay(_._fullLayout))})}function T(){return new Promise(function(t,e){var r=o(_,g,m),i=_._fullLayout.width,s=_._fullLayout.height;if(n.purge(_),document.body.removeChild(_),"svg"===g)return t(b?r:"data:image/svg+xml,"+encodeURIComponent(r));var c=document.createElement("canvas");c.id=a.randstr(),l({format:g,width:i,height:s,scale:m,canvas:c,svg:r,promise:!0}).then(t).catch(e)})}return new Promise(function(t,e){n.plot(_,r,w,k).then(M).then(A).then(T).then(function(e){t(function(t){return b?t.replace(c,""):t}(e))}).catch(function(t){e(t)})})}},{"../lib":163,"../snapshot/helpers":249,"../snapshot/svgtoimg":251,"../snapshot/tosvg":253,"./plot_api":194}],199:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/plots"),i=t("./plot_schema"),o=t("./plot_config"),l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,a,i,o){o=o||[];for(var f=Object.keys(t),d=0;d<f.length;d++){var v=f[d];if("transforms"!==v){var y=o.slice();y.push(v);var m=t[v],x=e[v],b=g(r,v),_="info_array"===(b||{}).valType,w="colorscale"===(b||{}).valType,k=(b||{}).items;if(h(r,v))if(l(m)&&l(x))u(m,x,b,a,i,y);else if(_&&s(m)){m.length>x.length&&a.push(p("unused",i,y.concat(x.length)));var M,A,T,L,S,C=x.length,O=Array.isArray(k);if(O&&(C=Math.min(C,k.length)),2===b.dimensions)for(A=0;A<C;A++)if(s(m[A])){m[A].length>x[A].length&&a.push(p("unused",i,y.concat(A,x[A].length)));var P=x[A].length;for(M=0;M<(O?Math.min(P,k[A].length):P);M++)T=O?k[A][M]:k,L=m[A][M],S=x[A][M],n.validate(L,T)?S!==L&&S!==+L&&a.push(p("dynamic",i,y.concat(A,M),L,S)):a.push(p("value",i,y.concat(A,M),L))}else a.push(p("array",i,y.concat(A),m[A]));else for(A=0;A<C;A++)T=O?k[A]:k,L=m[A],S=x[A],n.validate(L,T)?S!==L&&S!==+L&&a.push(p("dynamic",i,y.concat(A),L,S)):a.push(p("value",i,y.concat(A),L))}else if(b.items&&!_&&s(m)){var z,D,E=k[Object.keys(k)[0]],N=[];for(z=0;z<x.length;z++){var R=x[z]._index||z;(D=y.slice()).push(R),l(m[R])&&l(x[z])&&(N.push(R),u(m[R],x[z],E,a,i,D))}for(z=0;z<m.length;z++)(D=y.slice()).push(z),l(m[z])?-1===N.indexOf(z)&&a.push(p("unused",i,D)):a.push(p("object",i,D,m[z]))}else!l(m)&&l(x)?a.push(p("object",i,y,m)):c(m)||!c(x)||_||w?v in e?n.validate(m,b)?"enumerated"===b.valType&&(b.coerceNumber&&m!==+x||m!==x)&&a.push(p("dynamic",i,y,m,x)):a.push(p("value",i,y,m)):a.push(p("unused",i,y,m)):a.push(p("array",i,y,m));else a.push(p("schema",i,y))}}return a}e.exports=function(t,e){var r,c,f=i.get(),d=[],h={_context:n.extendFlat({},o)};s(t)?(h.data=n.extendDeep([],t),r=t):(h.data=[],r=[],d.push(p("array","data"))),l(e)?(h.layout=n.extendDeep({},e),c=e):(h.layout={},c={},arguments.length>1&&d.push(p("object","layout"))),a.supplyDefaults(h);for(var g=h._fullData,v=r.length,y=0;y<v;y++){var m=r[y],x=["data",y];if(l(m)){var b=g[y],_=b.type,w=f.traces[_].attributes;w.type={valType:"enumerated",values:[_]},!1===b.visible&&!1!==m.visible&&d.push(p("invisible",x)),u(m,b,w,d,x);var k=m.transforms,M=b.transforms;if(k){s(k)||d.push(p("array",x,["transforms"])),x.push("transforms");for(var A=0;A<k.length;A++){var T=["transforms",A],L=k[A].type;if(l(k[A])){var S=f.transforms[L]?f.transforms[L].attributes:{};S.type={valType:"enumerated",values:Object.keys(f.transforms)},u(k[A],M[A],S,d,x,T)}else d.push(p("object",x,T))}}}else d.push(p("object",x))}return u(c,h._fullLayout,function(t,e){for(var r=0;r<e.length;r++){var a=e[r].type,i=t.traces[a].layoutAttributes;i&&n.extendFlat(t.layout.layoutAttributes,i)}return t.layout.layoutAttributes}(f,g),d,"layout"),0===d.length?void 0:d};var f={object:function(t,e){return("layout"===t&&""===e?"The layout argument":"data"===t[0]&&""===e?"Trace "+t[1]+" in the data argument":d(t)+"key "+e)+" must be linked to an object container"},array:function(t,e){return("data"===t?"The data argument":d(t)+"key "+e)+" must be linked to an array container"},schema:function(t,e){return d(t)+"key "+e+" is not part of the schema"},unused:function(t,e,r){var n=l(r)?"container":"key";return d(t)+n+" "+e+" did not get coerced"},dynamic:function(t,e,r,n){return[d(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[d(t)+"key "+e,"is set to an invalid value ("+r+")"].join(" ")}};function d(t){return s(t)?"In data trace "+t[1]+", ":"In "+t+", "}function p(t,e,r,a,i){var o,l;r=r||"",s(e)?(o=e[0],l=e[1]):(o=e,l=null);var c=function(t){if(!s(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),u=f[t](e,c,a,i);return n.log(u),{code:t,container:o,trace:l,path:r,astr:c,msg:u}}function h(t,e){var r=y(e),n=r.keyMinusId,a=r.id;return!!(n in t&&t[n]._isSubplotObj&&a)||e in t}function g(t,e){return t[y(e).keyMinusId]}var v=n.counterRegex("([a-z]+)");function y(t){var e=t.match(v);return{keyMinusId:e&&e[1],id:e&&e[2]}}},{"../lib":163,"../plots/plots":237,"./plot_config":195,"./plot_schema":196}],200:[function(t,e,r){"use strict";e.exports={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"]}}}},{}],201:[function(t,e,r){"use strict";var n=t("../lib");e.exports=function(t,e,r){var a,i=r.name,o=e[i],l=n.isArrayOrTypedArray(t[i])?t[i]:[],s=e[i]=[];for(a=0;a<l.length;a++){var c=l[a],u={},f={};n.isPlainObject(c)||(f.itemIsNotPlainObject=!0,c={}),r.handleItemDefaults(c,u,e,r,f),u._input=c,u._index=a,s.push(u)}if(n.isArrayOrTypedArray(o)){var d=Math.min(o.length,s.length);for(a=0;a<d;a++)n.relinkPrivateKeys(s[a],o[a])}}},{"../lib":163}],202:[function(t,e,r){"use strict";var n=t("../components/fx/attributes");e.exports={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:n.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},transforms:{_isLinkedToArray:"transform",editType:"calc"}}},{"../components/fx/attributes":77}],203:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],204:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").FP_SAFE;function o(t){var e,r,n,i,o,s,c,u,f=[],d=t._min[0].val,p=t._max[0].val,h=0,g=!1,v=l(t);for(e=1;e<t._min.length&&d===p;e++)d=Math.min(d,t._min[e].val);for(e=1;e<t._max.length&&d===p;e++)p=Math.max(p,t._max[e].val);if(t.range){var y=a.simpleMap(t.range,t.r2l);g=y[1]<y[0]}for("reversed"===t.autorange&&(g=!0,t.autorange=!0),e=0;e<t._min.length;e++)for(n=t._min[e],r=0;r<t._max.length;r++)u=(i=t._max[r]).val-n.val,c=t._length-v(n)-v(i),u>0&&c>0&&u/c>h&&(o=n,s=i,h=u/c);if(d===p){var m=d-1,x=d+1;f="tozero"===t.rangemode?d<0?[m,0]:[0,x]:"nonnegative"===t.rangemode?[Math.max(0,m),Math.max(0,x)]:[m,x]}else h&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(o.val>=0&&(o={val:0,pad:0}),s.val<=0&&(s={val:0,pad:0})):"nonnegative"===t.rangemode&&(o.val-h*v(o)<0&&(o={val:0,pad:0}),s.val<0&&(s={val:1,pad:0})),h=(s.val-o.val)/(t._length-v(o)-v(s))),f=[o.val-h*v(o),s.val+h*v(s)]);return f[0]===f[1]&&("tozero"===t.rangemode?f=f[0]<0?[f[0],0]:f[0]>0?[0,f[0]]:[0,1]:(f=[f[0]-1,f[0]+1],"nonnegative"===t.rangemode&&(f[0]=Math.max(0,f[0])))),g&&f.reverse(),a.simpleMap(f,t.l2r||Number)}function l(t){var e=t._length/20;return"domain"===t.constrain&&t._inputDomain&&(e*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(t){return t.pad+(t.extrapad?e:0)}}function s(t){return n(t)&&Math.abs(t)<i}function c(t,e){return t<=e}function u(t,e){return t>=e}e.exports={getAutoRange:o,makePadFn:l,doAutoRange:function(t){t._length||t.setScale();var e,r=t._min&&t._max&&t._min.length&&t._max.length;t.autorange&&r&&(t.range=o(t),t._r=t.range.slice(),t._rl=a.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?o(t):t._rangeInitial?t._rangeInitial.slice():t.range.slice()),(e=t._anchorAxis._input).rangeslider[t._name]=a.extendFlat({},n)}},expand:function(t,e,r){if(!function(t){return t.autorange||t._rangesliderAutorange}(t)||!e)return;t._min||(t._min=[]);t._max||(t._max=[]);r||(r={});t._m||t.setScale();var a,o,l,f,d,p,h,g,v,y,m,x,b=e.length,_=r.padded||!1,w=r.tozero&&("linear"===t.type||"-"===t.type),k="log"===t.type,M=!1;function A(t){if(Array.isArray(t))return M=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var T=A((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),L=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=A(r.vpadplus||r.vpad),C=A(r.vpadminus||r.vpad);if(!M){if(m=1/0,x=-1/0,k)for(a=0;a<b;a++)(f=e[a])<m&&f>0&&(m=f),f>x&&f<i&&(x=f);else for(a=0;a<b;a++)(f=e[a])<m&&f>-i&&(m=f),f>x&&f<i&&(x=f);e=[m,x],b=2}function O(r){if(d=e[r],n(d))for(g=T(r),v=L(r),m=d-C(r),x=d+S(r),k&&m<x/10&&(m=x/10),p=t.c2l(m),h=t.c2l(x),w&&(p=Math.min(0,p),h=Math.max(0,h)),l=0;l<2;l++){var a=l?h:p;if(s(a)){var i=l?t._max:t._min,b=l?g:v,M=l?u:c;for(y=!0,o=0;o<i.length&&y;o++){if(f=i[o],M(f.val,a)&&f.pad>=b&&(f.extrapad||!_)){y=!1;break}M(a,f.val)&&f.pad<=b&&(_||!f.extrapad)&&(i.splice(o,1),o--)}if(y){var A=w&&0===a;i.push({val:a,pad:A?0:b,extrapad:!A&&_})}}}}var P=Math.min(6,b);for(a=0;a<P;a++)O(a);for(a=b-1;a>=P;a--)O(a)}}},{"../../constants/numerical":145,"../../lib":163,"fast-isnumeric":10}],205:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),l=t("../../lib"),s=t("../../lib/svg_text_utils"),c=t("../../components/titles"),u=t("../../components/color"),f=t("../../components/drawing"),d=t("../../constants/numerical"),p=d.ONEAVGYEAR,h=d.ONEAVGMONTH,g=d.ONEDAY,v=d.ONEHOUR,y=d.ONEMIN,m=d.ONESEC,x=d.MINUS_SIGN,b=d.BADNUM,_=t("../../constants/alignment").MID_SHIFT,w=t("../../constants/alignment").LINE_SPACING,k=e.exports={};k.setConvert=t("./set_convert");var M=t("./axis_autotype"),A=t("./axis_ids");k.id2name=A.id2name,k.name2id=A.name2id,k.cleanId=A.cleanId,k.list=A.list,k.listIds=A.listIds,k.getFromId=A.getFromId,k.getFromTrace=A.getFromTrace;var T=t("./autorange");k.expand=T.expand,k.getAutoRange=T.getAutoRange,k.coerceRef=function(t,e,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||i),i||(i=a),u[c]={valType:"enumerated",values:s.concat(i?[i]:[]),dflt:a},l.coerce(t,e,u,c)},k.coercePosition=function(t,e,r,n,a,i){var o,s;if("paper"===n||"pixel"===n)o=l.ensureNumber,s=r(a,i);else{var c=k.getFromId(e,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}t[a]=o(s)},k.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?l.ensureNumber:k.getFromId(e,r).cleanPos)(t)};var L=k.getDataConversions=function(t,e,r,n){var a,i="x"===r||"y"===r||"z"===r?r:n;if(Array.isArray(i)){if(a={type:M(n),_categories:[]},k.setConvert(a),"category"===a.type)for(var o=0;o<n.length;o++)a.d2c(n[o])}else a=k.getFromTrace(t,e,i);return a?{d2c:a.d2c,c2d:a.c2d}:"ids"===i?{d2c:C,c2d:C}:{d2c:S,c2d:S}};function S(t){return+t}function C(t){return String(t)}k.getDataToCoordFunc=function(t,e,r,n){return L(t,e,r,n).d2c},k.counterLetter=function(t){var e=t.charAt(0);return"x"===e?"y":"y"===e?"x":void 0},k.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},k.saveRangeInitial=function(t,e){for(var r=k.list(t,"",!0),n=!1,a=0;a<r.length;a++){var i=r[a],o=void 0===i._rangeInitial,l=o||!(i.range[0]===i._rangeInitial[0]&&i.range[1]===i._rangeInitial[1]);(o&&!1===i.autorange||e&&l)&&(i._rangeInitial=i.range.slice(),n=!0)}return n},k.saveShowSpikeInitial=function(t,e){for(var r=k.list(t,"",!0),n=!1,a="on",i=0;i<r.length;i++){var o=r[i],l=void 0===o._showSpikeInitial,s=l||!(o.showspikes===o._showspikes);(l||e&&s)&&(o._showSpikeInitial=o.showspikes,n=!0),"on"!==a||o.showspikes||(a="off")}return t._fullLayout._cartesianSpikesEnabled=a,n},k.autoBin=function(t,e,r,n,i){var o,s,c=l.aggNums(Math.min,null,t),u=l.aggNums(Math.max,null,t);if(i||(i=e.calendar),"category"===e.type)return{start:c-.5,end:u+.5,size:1,_dataSpan:u-c};if(r)o=(u-c)/r;else{var f=l.distinctVals(t),d=Math.pow(10,Math.floor(Math.log(f.minDiff)/Math.LN10)),p=d*l.roundUp(f.minDiff/d,[.9,1.9,4.9,9.9],!0);o=Math.max(p,2*l.stdev(t)/Math.pow(t.length,n?.25:.4)),a(o)||(o=1)}s="log"===e.type?{type:"linear",range:[c,u]}:{type:e.type,range:l.simpleMap([c,u],e.c2r,0,i),calendar:i},k.setConvert(s),k.autoTicks(s,o);var h,v=k.tickIncrement(k.tickFirst(s),s.dtick,"reverse",i);if("number"==typeof s.dtick)h=(v=function(t,e,r,n,i){var o=0,l=0,s=0,c=0;function u(e){return(1+100*(e-t)/r.dtick)%100<2}for(var f=0;f<e.length;f++)e[f]%1==0?s++:a(e[f])||c++,u(e[f])&&o++,u(e[f]+r.dtick/2)&&l++;var d=e.length-c;if(s===d&&"date"!==r.type)r.dtick<1?t=n-.5*r.dtick:(t-=.5)+r.dtick<n&&(t+=r.dtick);else if(l<.1*d&&(o>.3*d||u(n)||u(i))){var p=r.dtick/2;t+=t+p<n?p:-p}return t}(v,t,s,c,u))+(1+Math.floor((u-v)/s.dtick))*s.dtick;else for("M"===s.dtick.charAt(0)&&(v=function(t,e,r,n,a){var i=l.findExactDates(e,a);if(i.exactDays>.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=k.tickIncrement(t,"M6","reverse")+1.5*g:i.exactMonths>.8?t=k.tickIncrement(t,"M1","reverse")+15.5*g:t-=g/2;var s=k.tickIncrement(t,r);if(s<=n)return s}return t}(v,t,s.dtick,c,i)),h=v,0;h<=u;)h=k.tickIncrement(h,s.dtick,!1,i),0;return{start:e.c2r(v,0,i),end:e.c2r(h,0,i),size:s.dtick,_dataSpan:u-c}},k.prepTicks=function(t){var e=l.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=l.constrain(t._length/r,4,9)+1),"radialaxis"===t._name&&(n*=2)),"array"===t.tickmode&&(n*=100),k.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),F(t)},k.calcTicks=function(t){k.prepTicks(t);var e=l.simpleMap(t.range,t.r2l);if("array"===t.tickmode)return function(t){var e,r,n=t.tickvals,a=t.ticktext,i=new Array(n.length),o=l.simpleMap(t.range,t.r2l),s=1.0001*o[0]-1e-4*o[1],c=1.0001*o[1]-1e-4*o[0],u=Math.min(s,c),f=Math.max(s,c),d=0;Array.isArray(a)||(a=[]);var p="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=p(n[r]))>u&&e<f&&(void 0===a[r]?i[d]=k.tickText(t,e):i[d]=j(t,e,String(a[r])),d++);d<n.length&&i.splice(d,n.length-d);return i}(t);t._tmin=k.tickFirst(t);var r=1.0001*e[0]-1e-4*e[1],n=1.0001*e[1]-1e-4*e[0],a=e[1]<e[0];if(t._tmin<r!==a)return[];var i=[];"category"===t.type&&(n=a?Math.max(-.5,n):Math.min(t._categories.length-.5,n));for(var o=null,s=Math.max(1e3,t._length||0),c=t._tmin;(a?c>=n:c<=n)&&!(i.length>s||c===o);c=k.tickIncrement(c,t.dtick,a,t.calendar))o=c,i.push(c);"angular"===t._id&&360===Math.abs(e[1]-e[0])&&i.pop(),t._tmax=i[i.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var u=new Array(i.length),f=0;f<i.length;f++)u[f]=k.tickText(t,i[f]);return t._inCalcTicks=!1,u};var O=[2,5,10],P=[1,2,3,6,12],z=[1,2,5,10,15,30],D=[1,2,3,7,14],E=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],N=[-.301,0,.301,.699,1],R=[15,30,45,90,180];function I(t,e,r){return e*l.roundUp(t/e,r)}function F(t){var e=t.dtick;if(t._tickexponent=0,a(e)||"string"==typeof e||(e=1),"category"===t.type&&(t._tickround=null),"date"===t.type){var r=t.r2l(t.tick0),n=t.l2r(r).replace(/(^-|i)/g,""),i=n.length;if("M"===String(e).charAt(0))i>10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=g&&i<=10||e>=15*g)t._tickround="d";else if(e>=y&&i<=16||e>=v)t._tickround="M";else if(e>=m&&i<=19||e>=y)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,o)-20}}else if(a(e)||"L"===e.charAt(0)){var l=t.range.map(t.r2d||Number);a(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(c)>3&&(H(t.exponentformat)&&!q(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function j(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}}k.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=l.dateTick0(t.calendar);var i=2*e;i>p?(e/=p,r=n(10),t.dtick="M"+12*I(e,r,O)):i>h?(e/=h,t.dtick="M"+I(e,1,P)):i>g?(t.dtick=I(e,g,D),t.tick0=l.dateTick0(t.calendar,!0)):i>v?t.dtick=I(e,v,P):i>y?t.dtick=I(e,y,z):i>m?t.dtick=I(e,m,z):(r=n(10),t.dtick=I(e,r,O))}else if("log"===t.type){t.tick0=0;var o=l.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,r=n(10),t.dtick="L"+I(e,r,O)}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,r=1,t.dtick=I(e,r,R)):(t.tick0=0,r=n(10),t.dtick=I(e,r,O));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var c=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(c)}},k.tickIncrement=function(t,e,r,i){var o=r?-1:1;if(a(e))return t+o*e;var s=e.charAt(0),c=o*Number(e.substr(1));if("M"===s)return l.incrementMonth(t,c,i);if("L"===s)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===s){var u="D2"===e?N:E,f=t+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(e)},k.tickFirst=function(t){var e=t.r2l||Number,r=l.simpleMap(t.range,e),i=r[1]<r[0],o=i?Math.floor:Math.ceil,s=1.0001*r[0]-1e-4*r[1],c=t.dtick,u=e(t.tick0);if(a(c)){var f=o((s-u)/c)*c+u;return"category"===t.type&&(f=l.constrain(f,0,t._categories.length-1)),f}var d=c.charAt(0),p=Number(c.substr(1));if("M"===d){for(var h,g,v,y=0,m=u;y<10;){if(((h=k.tickIncrement(m,c,i,t.calendar))-s)*(m-s)<=0)return i?Math.min(m,h):Math.max(m,h);g=(s-(m+h)/2)/(h-m),v=d+(Math.abs(Math.round(g))||1)*p,m=k.tickIncrement(m,v,g<0?!i:i,t.calendar),y++}return l.error("tickFirst did not converge",t),m}if("L"===d)return Math.log(o((Math.pow(10,s)-u)/p)*p+u)/Math.LN10;if("D"===d){var x="D2"===c?N:E,b=l.roundUp(l.mod(s,1),x,i);return Math.floor(s)+Math.log(n.round(Math.pow(10,b),1))/Math.LN10}throw"unrecognized dtick "+String(c)},k.tickText=function(t,e,r){var n,i,o=j(t,e),s="array"===t.tickmode,c=r||s,u="category"===t.type?t.d2l_noadd:t.d2l;if(s&&Array.isArray(t.ticktext)){var f=l.simpleMap(t.range,t.r2l),d=Math.abs(f[1]-f[0])/1e4;for(i=0;i<t.ticktext.length&&!(Math.abs(e-u(t.tickvals[i]))<d);i++);if(i<t.ticktext.length)return o.text=String(t.ticktext[i]),o}function p(n){var a;return void 0===n||(r?"none"===n:(a={first:t._tmin,last:t._tmax}[n],"all"!==n&&e!==a))}return n=r?"never":"none"!==t.exponentformat&&p(t.showexponent)?"hide":"","date"===t.type?function(t,e,r,n){var i=t._tickround,o=r&&t.hoverformat||k.getTickFormat(t);n&&(i=a(i)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[i]);var s,c=l.formatDate(e.x,o,i,t._dateFormat,t.calendar,t._extraFormat),u=c.indexOf("\n");-1!==u&&(s=c.substr(u+1),c=c.substr(0,u));n&&("00:00:00"===c||"00:00"===c?(c=s,s=""):8===c.length&&(c=c.replace(/:00$/,"")));s&&(r?"d"===i?c+=", "+s:c=s+(c?", "+c:""):t._inCalcTicks&&s===t._prevDateHead||(c+="<br>"+s,t._prevDateHead=s));e.text=c}(t,o,r,c):"log"===t.type?function(t,e,r,n,i){var o=t.dtick,s=e.x,c=t.tickformat;"never"===i&&(i="");!n||"string"==typeof o&&"L"===o.charAt(0)||(o="L3");if(c||"string"==typeof o&&"L"===o.charAt(0))e.text=V(Math.pow(10,s),t,i,n);else if(a(o)||"D"===o.charAt(0)&&l.mod(s+.01,1)<.1){var u=Math.round(s);-1!==["e","E","power"].indexOf(t.exponentformat)||H(t.exponentformat)&&q(u)?(e.text=0===u?1:1===u?"10":u>1?"10<sup>"+u+"</sup>":"10<sup>"+x+-u+"</sup>",e.fontSize*=1.25):(e.text=V(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,l.mod(s,1)))),e.fontSize*=.75}if("D1"===t.dtick){var f=String(e.text).charAt(0);"0"!==f&&"1"!==f||("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,c,n):"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,a){if("radians"!==t.thetaunit||r)e.text=V(e.x,t,a,n);else{var i=e.x/180;if(0===i)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,a=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)e.text=V(l.deg2rad(e.x),t,a,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=x+e.text)}}}}(t,o,r,c,n):function(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide");e.text=V(e.x,t,a,n)}(t,o,0,c,n),t.tickprefix&&!p(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!p(t.showticksuffix)&&(o.text+=t.ticksuffix),o},k.hoverLabelText=function(t,e,r){if(r!==b&&r!==e)return k.hoverLabelText(t,e)+" - "+k.hoverLabelText(t,r);var n="log"===t.type&&e<=0,a=k.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":x+a:a};var B=["f","p","n","\u03bc","m","","k","M","G","T"];function H(t){return"SI"===t||"B"===t}function q(t){return t>14||t<-15}function V(t,e,r,n){var i=t<0,o=e._tickround,s=r||e.exponentformat||"B",c=e._tickexponent,u=k.getTickFormat(e),f=e.separatethousands;if(n){var d={exponentformat:s,dtick:"none"===e.showexponent?e.dtick:a(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};F(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,x);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(t=Math.abs(t))<h)t="0",i=!1;else{if(t+=h,c&&(t*=Math.pow(10,-c),o+=c),0===o)t=String(Math.floor(t));else if(o<0){t=(t=String(Math.round(t))).substr(0,t.length+o);for(var g=o;g<0;g++)t+="0"}else{var v=(t=String(t)).indexOf(".")+1;v&&(t=t.substr(0,v+o).replace(/\.?0+$/,""))}t=l.numSeparate(t,e._separators,f)}c&&"hide"!==s&&(H(s)&&q(c)&&(s="power"),p=c<0?x+-c:"power"!==s?"+"+c:String(c),"e"===s?t+="e"+p:"E"===s?t+="E"+p:"power"===s?t+="\xd710<sup>"+p+"</sup>":"B"===s&&9===c?t+="B":H(s)&&(t+=B[c/3+5]));return i?x+t:t}function U(t,e){for(var r=0;r<e.length;r++)-1===t.indexOf(e[r])&&t.push(e[r])}function G(t,e,r){var n,a,i=[],o=[],s=t.layout;for(n=0;n<e.length;n++)i.push(k.getFromId(t,e[n]));for(n=0;n<r.length;n++)o.push(k.getFromId(t,r[n]));var c=Object.keys(i[0]),u=["anchor","domain","overlaying","position","side","tickangle"],f=["linear","log"];for(n=0;n<c.length;n++){var d=c[n],p=i[0][d],h=o[0][d],g=!0,v=!1,y=!1;if("_"!==d.charAt(0)&&"function"!=typeof p&&-1===u.indexOf(d)){for(a=1;a<i.length&&g;a++){var m=i[a][d];"type"===d&&-1!==f.indexOf(p)&&-1!==f.indexOf(m)&&p!==m?v=!0:m!==p&&(g=!1)}for(a=1;a<o.length&&g;a++){var x=o[a][d];"type"===d&&-1!==f.indexOf(h)&&-1!==f.indexOf(x)&&h!==x?y=!0:o[a][d]!==h&&(g=!1)}g&&(v&&(s[i[0]._name].type="linear"),y&&(s[o[0]._name].type="linear"),Y(s,d,i,o,t._fullLayout._dfltTitle))}}for(n=0;n<t._fullLayout.annotations.length;n++){var b=t._fullLayout.annotations[n];-1!==e.indexOf(b.xref)&&-1!==r.indexOf(b.yref)&&l.swapAttrs(s.annotations[n],["?"])}}function Y(t,e,r,n,a){var i,o=l.nestedProperty,s=o(t[r[0]._name],e).get(),c=o(t[n[0]._name],e).get();for("title"===e&&(s===a.x&&(s=a.y),c===a.y&&(c=a.x)),i=0;i<r.length;i++)o(t,r[i]._name+"."+e).set(c);for(i=0;i<n.length;i++)o(t,n[i]._name+"."+e).set(s)}k.getTickFormat=function(t){var e,r,n,a,i,o,l;function s(t){return"string"!=typeof t?t:Number(t.replace("M",""))*h}function c(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)),a=r.indexOf(e.charAt(0));return n===a?Number(t.replace(/(L|D)/g,""))-Number(e.replace(/(L|D)/g,"")):n-a}return"number"==typeof t?1:-1}function u(t,e){var r=null===e[0],n=null===e[1],a=c(t,e[0])>=0,i=c(t,e[1])<=0;return(r||a)&&(n||i)}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,a=t.tickformatstops[e].dtickrange,i=void 0,void 0,void 0,i=s||function(t){return t},o=a[0],l=a[1],(!o&&"number"!=typeof o||i(o)<=i(n))&&(!l&&"number"!=typeof l||i(l)>=i(n))){r=t.tickformatstops[e];break}break;case"log":for(e=0;e<t.tickformatstops.length;e++)if(u(t.dtick,t.tickformatstops[e].dtickrange)){r=t.tickformatstops[e];break}}return r?r.value:t.tickformat},k.getSubplots=function(t,e){var r=t._fullLayout._subplots,n=r.cartesian.concat(r.gl2d||[]),a=e?k.findSubplotsWithAxis(n,e):n;return a.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]}),a},k.findSubplotsWithAxis=function(t,e){for(var r=new RegExp("x"===e._id.charAt(0)?"^"+e._id+"y":e._id+"$"),n=[],a=0;a<t.length;a++){var i=t[a];r.test(i)&&n.push(i)}return n},k.makeClipPaths=function(t){var e=t._fullLayout;if(!e._hasOnlyLargeSploms){var r,a,i={_offset:0,_length:e.width,_id:""},o={_offset:0,_length:e.height,_id:""},l=k.list(t,"x",!0),s=k.list(t,"y",!0),c=[];for(r=0;r<l.length;r++)for(c.push({x:l[r],y:o}),a=0;a<s.length;a++)0===r&&c.push({x:i,y:s[a]}),c.push({x:l[r],y:s[a]});var u=e._clips.selectAll(".axesclip").data(c,function(t){return t.x._id+t.y._id});u.enter().append("clipPath").classed("axesclip",!0).attr("id",function(t){return"clip"+e._uid+t.x._id+t.y._id}).append("rect"),u.exit().remove(),u.each(function(t){n.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})})}},k.doTicks=function(t,e,r){var n=t._fullLayout;"redraw"===e&&n._paper.selectAll("g.subplot").each(function(t){var e=n._plots[t],r=e.xaxis,a=e.yaxis;e.xaxislayer.selectAll("."+r._id+"tick").remove(),e.yaxislayer.selectAll("."+a._id+"tick").remove(),e.gridlayer&&e.gridlayer.selectAll("path").remove(),e.zerolinelayer&&e.zerolinelayer.selectAll("path").remove(),n._infolayer.select(".g-"+r._id+"title").remove(),n._infolayer.select(".g-"+a._id+"title").remove()});var a=e&&"redraw"!==e?e:k.listIds(t);l.syncOrAsync(a.map(function(e){return function(){if(e){var n=k.doTicksSingle(t,e,r),a=k.getFromId(t,e);return a._r=a.range.slice(),a._rl=l.simpleMap(a._r,a.r2l),n}}}))},k.doTicksSingle=function(t,e,r){var d,p=t._fullLayout,h=!1;l.isPlainObject(e)?(d=e,h=!0):d=k.getFromId(t,e),d.setScale();var g,v,y,m,x,b,M=d._id,T=M.charAt(0),L=k.counterLetter(M),S=d._vals=k.calcTicks(d),C=function(t){return[t.text,t.x,d.mirror,t.font,t.fontSize,t.fontColor].join("_")},O=M+"tick",P=M+"grid",z=M+"zl",D=(d.linewidth||1)/2,E="outside"===d.ticks?d.ticklen:0,N=0,R=f.crispRound(t,d.gridwidth,1),I=f.crispRound(t,d.zerolinewidth,R),F=f.crispRound(t,d.tickwidth,1);if(d._counterangle&&"outside"===d.ticks){var j=d._counterangle*Math.PI/180;E=d.ticklen*Math.cos(j)+1,N=d.ticklen*Math.sin(j)}if(d.showticklabels&&("outside"===d.ticks||d.showline)&&(E+=.2*d.tickfont.size),"x"===T)g=["bottom","top"],v=d._transfn||function(t){return"translate("+(d._offset+d.l2p(t.x))+",0)"},y=function(t,e){if(d._counterangle){var r=d._counterangle*Math.PI/180;return"M0,"+t+"l"+Math.sin(r)*e+","+Math.cos(r)*e}return"M0,"+t+"v"+e};else if("y"===T)g=["left","right"],v=d._transfn||function(t){return"translate(0,"+(d._offset+d.l2p(t.x))+")"},y=function(t,e){if(d._counterangle){var r=d._counterangle*Math.PI/180;return"M"+t+",0l"+Math.cos(r)*e+","+-Math.sin(r)*e}return"M"+t+",0h"+e};else{if("angular"!==M)return void l.warn("Unrecognized doTicks axis:",M);g=["left","right"],v=d._transfn,y=function(t,e){return"M"+t+",0h"+e}}var B=d.side||g[0],H=[-1,1,B===g[1]?1:-1];if("inside"!==d.ticks==("x"===T)&&(H=H.map(function(t){return-t})),d.visible){d._tickFilter&&(S=S.filter(d._tickFilter));var q=S.filter(W);if("angular"===d._id&&(q=S),h){if(Q(d._axislayer,y(d._pos+D*H[2],H[2]*d.ticklen)),d._counteraxis)tt({gridlayer:d._gridlayer,zerolinelayer:d._zerolinelayer},d._counteraxis);return J(d._axislayer,d._pos)}if(p._has("cartesian")){m=k.getSubplots(t,d);var V={};m.map(function(t){var e=p._plots[t],r=e[L+"axis"],n=r._mainAxis._id;V[n]||(V[n]=1,tt(e,r,t))});var U=d._mainSubplot,G=p._plots[U],Y=[];if(d.ticks){var X=H[2],Z=y(d._mainLinePosition+D*X,X*d.ticklen);d._anchorAxis&&d.mirror&&!0!==d.mirror&&(Z+=y(d._mainMirrorPosition-D*X,-X*d.ticklen)),Q(G[T+"axislayer"],Z),Y=Object.keys(d._linepositions||{})}return Y.map(function(t){var e=p._plots[t][T+"axislayer"],r=d._linepositions[t]||[];function n(t){var e=H[t];return y(r[t]+D*e,e*d.ticklen)}Q(e,n(0)+n(1))}),J(G[T+"axislayer"],d._mainLinePosition)}}function W(t){var e=d.l2p(t.x);return e>1&&e<d._length-1}function Q(t,e){var r=t.selectAll("path."+O).data("inside"===d.ticks?q:S,C);e&&d.ticks?(r.enter().append("path").classed(O,1).classed("ticks",1).classed("crisp",1).call(u.stroke,d.tickcolor).style("stroke-width",F+"px").attr("d",e),r.attr("transform",v),r.exit().remove()):r.remove()}function J(e,r){if(x=e.selectAll("g."+O).data(S,C),!a(r))return x.remove(),void $();if(!d.showticklabels)return x.remove(),$(),void P();var o,c,u,h,g;"x"===T?(o=function(t){return t.dx+N*g},h=r+(E+D)*(g="bottom"===B?1:-1),c=function(t){return t.dy+h+t.fontSize*("bottom"===B?1:-.2)},u=function(t){return a(t)&&0!==t&&180!==t?t*g<0?"end":"start":"middle"}):"y"===T?(g="right"===B?1:-1,c=function(t){return t.dy+t.fontSize*_-N*g},o=function(t){return t.dx+r+(E+D+(90===Math.abs(d.tickangle)?t.fontSize/2:0))*g},u=function(t){return a(t)&&90===Math.abs(t)?"middle":"right"===B?"start":"end"}):"angular"===M&&(d._labelShift=N,d._labelStandoff=E,d._pad=D,o=d._labelx,c=d._labely,u=d._labelanchor);var y=0,k=0,A=[];function L(t,e){t.each(function(t){var r=u(e,t),i=n.select(this),l=i.select(".text-math-group"),d=v.call(i.node(),t)+(a(e)&&0!=+e?" rotate("+e+","+o(t)+","+(c(t)-t.fontSize/2)+")":""),p=function(t,e,r){var n=(t-1)*e;if("x"===T){if(r<-60||60<r)return-.5*n;if("top"===B)return-n}else{if((r*="left"===B?1:-1)<-30)return-n;if(r<30)return-.5*n}return 0}(s.lineCount(i),w*t.fontSize,a(e)?+e:0);if(p&&(d+=" translate(0, "+p+")"),l.empty())i.select("text").attr({transform:d,"text-anchor":r});else{var h=f.bBox(l.node()).width*{end:-.5,start:.5}[r];l.attr("transform",d+(h?"translate("+h+",0)":""))}})}function P(){if(d.showticklabels){var r=t.getBoundingClientRect(),n=e.node().getBoundingClientRect();d._boundingBox={width:n.width,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,bottom:n.bottom-r.top}}else{var a,i=p._size;"x"===T?(a="free"===d.anchor?i.t+i.h*(1-d.position):i.t+i.h*(1-d._anchorAxis.domain[{bottom:0,top:1}[d.side]]),d._boundingBox={top:a,bottom:a,left:d._offset,right:d._offset+d._length,width:d._length,height:0}):(a="free"===d.anchor?i.l+i.w*d.position:i.l+i.w*d._anchorAxis.domain[{left:0,right:1}[d.side]],d._boundingBox={left:a,right:a,bottom:d._offset+d._length,top:d._offset,height:d._length,width:0})}if(m){var o=d._counterSpan=[1/0,-1/0];for(b=0;b<m.length;b++){var l=p._plots[m[b]]["x"===T?"yaxis":"xaxis"];s(o,[l._offset,l._offset+l._length])}"free"===d.anchor&&s(o,"x"===T?[d._boundingBox.bottom,d._boundingBox.top]:[d._boundingBox.right,d._boundingBox.left])}function s(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.max(t[1],e[1])}}x.enter().append("g").classed(O,1).append("text").attr("text-anchor","middle").each(function(e){var r=n.select(this),a=t._promises.length;r.call(s.positionText,o(e),c(e)).call(f.font,e.font,e.fontSize,e.fontColor).text(e.text).call(s.convertToTspans,t),(a=t._promises[a])?A.push(t._promises.pop().then(function(){L(r,d.tickangle)})):L(r,d.tickangle)}),x.exit().remove(),x.each(function(t){y=Math.max(y,t.fontSize)}),"angular"===M&&x.each(function(t){n.select(this).select("text").call(s.positionText,o(t),c(t))}),L(x,d._lastangle||d.tickangle);var z=l.syncOrAsync([function(){return A.length&&Promise.all(A)},function(){if(L(x,d.tickangle),"x"===T&&!a(d.tickangle)&&("log"!==d.type||"D"!==String(d.dtick).charAt(0))){var t=[];for(x.each(function(e){var r=n.select(this),a=r.select(".text-math-group"),i=d.l2p(e.x);a.empty()&&(a=r.select("text"));var o=f.bBox(a.node());t.push({top:0,bottom:10,height:10,left:i-o.width/2,right:i+o.width/2+2,width:o.width+2})}),b=0;b<t.length-1;b++)if(l.bBoxIntersect(t[b],t[b+1])){k=30;break}k&&(Math.abs((S[S.length-1].x-S[0].x)*d._m)/(S.length-1)<2.5*y&&(k=90),L(x,k)),d._lastangle=k}return $(),M+" done"},P,function(){if(d.automargin&&("x"===T||"y"===T)){var e=d.side[0],r={x:0,y:0,r:0,l:0,t:0,b:0};"x"===T?(r.y="free"===d.anchor?d.position:d._anchorAxis.domain["t"===e?1:0],r[e]+=d._boundingBox.height):(r.x="free"===d.anchor?d.position:d._anchorAxis.domain["r"===e?1:0],r[e]+=d._boundingBox.width),d.title!==p._dfltTitle[T]&&(r[e]+=d.titlefont.size);var n=d._name+".automargin",a=p._pushmargin[n];(!a||a[e].size<r[e])&&i.autoMargin(t,n,r)}}]);return z&&z.then&&t._promises.push(z),z}function $(){if(!(r||d.rangeslider&&d.rangeslider.visible&&d._boundingBox&&"bottom"===d.side)){var e,n,a,i,o={selection:x,side:d.side},l=M.charAt(0),s=t._fullLayout._size,u=d.titlefont.size;if(x.size()){var h=f.getTranslate(x.node().parentNode);o.offsetLeft=h.x,o.offsetTop=h.y}var g=10+1.5*u+(d.linewidth?d.linewidth-1:0);"x"===l?(n="free"===d.anchor?{_offset:s.t+(1-(d.position||0))*s.h,_length:0}:A.getFromId(t,d.anchor),a=d._offset+d._length/2,i="top"===d.side?-g-u*(d.showticklabels?1:0):n._length+g+u*(d.showticklabels?1.5:.5),i+=n._offset,o.side||(o.side="bottom")):(n="free"===d.anchor?{_offset:s.l+(d.position||0)*s.w,_length:0}:A.getFromId(t,d.anchor),i=d._offset+d._length/2,a="right"===d.side?n._length+g+u*(d.showticklabels?1:.5):-g-u*(d.showticklabels?.5:0),a+=n._offset,e={rotate:"-90",offset:0},o.side||(o.side="left")),c.draw(t,M+"title",{propContainer:d,propName:d._name+".title",placeholder:p._dfltTitle[l],avoid:o,transform:e,attributes:{x:a,y:i,"text-anchor":"middle"}})}}function K(t,e){return!0===t.visible&&t.xaxis+t.yaxis===e&&(!(!o.traceIs(t,"bar")||t.orientation!=={x:"h",y:"v"}[T])||t.fill&&t.fill.charAt(t.fill.length-1)===T)}function tt(e,r,a){if(!p._hasOnlyLargeSploms){var i=e.gridlayer.selectAll("."+M),o=e.zerolinelayer,s=e["hidegrid"+T]?[]:q,c=d._gridpath||("x"===T?"M0,"+r._offset+"v":"M"+r._offset+",0h")+r._length,f=i.selectAll("path."+P).data(!1===d.showgrid?[]:s,C);if(f.enter().append("path").classed(P,1).classed("crisp",1).attr("d",c).each(function(t){d.zeroline&&("linear"===d.type||"-"===d.type)&&Math.abs(t.x)<d.dtick/100&&n.select(this).remove()}),f.attr("transform",v).call(u.stroke,d.gridcolor||"#ddd").style("stroke-width",R+"px"),"function"==typeof c&&f.attr("d",c),f.exit().remove(),o){for(var h=!1,g=0;g<t._fullData.length;g++)if(K(t._fullData[g],a)){h=!0;break}var y=l.simpleMap(d.range,d.r2l),m=y[0]*y[1]<=0&&d.zeroline&&("linear"===d.type||"-"===d.type)&&s.length&&(h||W({x:0})||!d.showline),x=o.selectAll("path."+z).data(m?[{x:0,id:M}]:[]);x.enter().append("path").classed(z,1).classed("zl",1).classed("crisp",1).attr("d",c).each(function(){o.selectAll("path").sort(function(t,e){return A.idSort(t.id,e.id)})}),x.attr("transform",v).call(u.stroke,d.zerolinecolor||u.defaultLine).style("stroke-width",I+"px"),x.exit().remove()}}}},k.swap=function(t,e){for(var r=function(t,e){var r,n,a=[];for(r=0;r<e.length;r++){var i=[],o=t._fullData[e[r]].xaxis,l=t._fullData[e[r]].yaxis;if(o&&l){for(n=0;n<a.length;n++)-1===a[n].x.indexOf(o)&&-1===a[n].y.indexOf(l)||i.push(n);if(i.length){var s,c=a[i[0]];if(i.length>1)for(n=1;n<i.length;n++)s=a[i[n]],U(c.x,s.x),U(c.y,s.y);U(c.x,[o]),U(c.y,[l])}else a.push({x:[o],y:[l]})}}return a}(t,e),n=0;n<r.length;n++)G(t,r[n].x,r[n].y)}},{"../../components/color":43,"../../components/drawing":68,"../../components/titles":136,"../../constants/alignment":143,"../../constants/numerical":145,"../../lib":163,"../../lib/svg_text_utils":184,"../../plots/plots":237,"../../registry":245,"./autorange":204,"./axis_autotype":206,"./axis_ids":208,"./set_convert":223,d3:7,"fast-isnumeric":10}],206:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e){return function(t,e){for(var r,i=0,o=0,l=Math.max(1,(t.length-1)/1e3),s=0;s<t.length;s+=l)r=t[Math.round(s)],a.isDateTime(r,e)&&(i+=1),n(r)&&(o+=1);return i>2*o}(t,e)?"date":function(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,o=0,l=0;l<t.length;l+=r)e=t[Math.round(l)],a.cleanNumber(e)!==i?n++:"string"==typeof e&&""!==e&&"None"!==e&&o++;return o>2*n}(t)?"category":function(t){if(!t)return!1;for(var e=0;e<t.length;e++)if(n(t[e]))return!0;return!1}(t)?"linear":"-"}},{"../../constants/numerical":145,"../../lib":163,"fast-isnumeric":10}],207:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("./layout_attributes"),o=t("./tick_value_defaults"),l=t("./tick_mark_defaults"),s=t("./tick_label_defaults"),c=t("./category_order_defaults"),u=t("./line_grid_defaults"),f=t("./set_convert");e.exports=function(t,e,r,d,p){var h=d.letter,g=e._id,v=d.font||{},y=r("visible",!d.cheateronly),m=e.type;"date"===m&&n.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",d.calendar);f(e,p);var x=r("autorange",!e.isValidRange(t.range));if(e._rangesliderAutorange=!1,x&&r("rangemode"),r("range"),e.cleanRange(),c(t,e,r,d),"category"===m||d.noHover||r("hoverformat"),!y)return e;var b=r("color"),_=b===t.color?b:v.color;return r("title",((p._splomAxes||{})[h]||{})[g]||p._dfltTitle[h]),a.coerceFont(r,"titlefont",{family:v.family,size:Math.round(1.2*v.size),color:_}),o(t,e,r,m),s(t,e,r,m,d),l(t,e,r,d),u(t,e,r,{dfltColor:b,bgColor:d.bgColor,showGrid:d.showGrid,attributes:i}),(e.showline||e.ticks)&&r("mirror"),d.automargin&&r("automargin"),e}},{"../../lib":163,"../../registry":245,"./category_order_defaults":209,"./layout_attributes":217,"./line_grid_defaults":219,"./set_convert":223,"./tick_label_defaults":224,"./tick_mark_defaults":225,"./tick_value_defaults":226}],208:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./constants");r.id2name=function(t){if("string"==typeof t&&t.match(a.AX_ID_PATTERN)){var e=t.substr(1);return"1"===e&&(e=""),t.charAt(0)+"axis"+e}},r.name2id=function(t){if(t.match(a.AX_NAME_PATTERN)){var e=t.substr(5);return"1"===e&&(e=""),t.charAt(0)+e}},r.cleanId=function(t,e){if(t.match(a.AX_ID_PATTERN)&&(!e||t.charAt(0)===e)){var r=t.substr(1).replace(/^0+/,"");return"1"===r&&(r=""),t.charAt(0)+r}},r.list=function(t,e,n){var a=t._fullLayout;if(!a)return[];var i,o=r.listIds(t,e),l=new Array(o.length);for(i=0;i<o.length;i++){var s=o[i];l[i]=a[s.charAt(0)+"axis"+s.substr(1)]}if(!n){var c=a._subplots.gl3d||[];for(i=0;i<c.length;i++){var u=a[c[i]];e?l.push(u[e+"axis"]):l.push(u.xaxis,u.yaxis,u.zaxis)}}return l},r.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)},r.getFromId=function(t,e,n){var a=t._fullLayout;return"x"===n?e=e.replace(/y[0-9]*/,""):"y"===n&&(e=e.replace(/x[0-9]*/,"")),a[r.id2name(e)]},r.getFromTrace=function(t,e,a){var i=t._fullLayout,o=null;if(n.traceIs(e,"gl3d")){var l=e.scene;"scene"===l.substr(0,5)&&(o=i[l][a+"axis"])}else o=r.getFromId(t,e[a+"axis"]||a);return o},r.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)}},{"../../registry":245,"./constants":210}],209:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var a,i=t.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=e.categoryorder="trace"),"trace"===s?e._initialCategories=[]:"array"===s?e._initialCategories=l.slice():(l=function(t,e){var r,n,a,i=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;n<e.data.length;n++){var l=e.data[n];l[i+"axis"]===t._id&&r.push(l)}for(n=0;n<r.length;n++){var s=r[n][i];for(a=0;a<s.length;a++){var c=s[a];null!=c&&(o[c]=1)}}return Object.keys(o)}(e,n).sort(),"category ascending"===s?e._initialCategories=l:"category descending"===s&&(e._initialCategories=l.reverse()))}}},{}],210:[function(t,e,r){"use strict";var n=t("../../lib/regex").counter;e.exports={idRegex:{x:n("x"),y:n("y")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("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:["heatmaplayer","contourcarpetlayer","contourlayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib/regex":178}],211:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./axis_ids").id2name;e.exports=function(t,e,r,i,o){var l=o._axisConstraintGroups,s=e._id,c=s.charAt(0);if(!e.fixedrange&&(r("constrain"),n.coerce(t,e,{constraintoward:{valType:"enumerated",values:"x"===c?["left","center","right"]:["bottom","middle","top"],dflt:"x"===c?"center":"middle"}},"constraintoward"),t.scaleanchor)){var u=function(t,e,r,n){var i,o,l,s,c=n[a(e)].type,u=[];for(o=0;o<r.length;o++)(l=r[o])!==e&&((s=n[a(l)]).type!==c||s.fixedrange||u.push(l));for(i=0;i<t.length;i++)if(t[i][e]){var f=t[i],d=[];for(o=0;o<u.length;o++)l=u[o],f[l]||d.push(l);return{linkableAxes:d,thisGroup:f}}return{linkableAxes:u,thisGroup:null}}(l,s,i,o),f=n.coerce(t,e,{scaleanchor:{valType:"enumerated",values:u.linkableAxes}},"scaleanchor");if(f){var d=r("scaleratio");d||(d=e.scaleratio=1),function(t,e,r,n,a){var i,o,l,s,c;null===e?((e={})[r]=1,c=t.length,t.push(e)):c=t.indexOf(e);var u=Object.keys(e);for(i=0;i<t.length;i++)if(l=t[i],i!==c&&l[n]){var f=l[n];for(o=0;o<u.length;o++)s=u[o],l[s]=f*a*e[s];return void t.splice(c,1)}if(1!==a)for(o=0;o<u.length;o++)e[u[o]]*=a;e[n]=1}(l,u.thisGroup,s,f,d)}else-1!==i.indexOf(t.scaleanchor)&&n.warn("ignored "+e._name+'.scaleanchor: "'+t.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because the targetaxis has fixed range.')}}},{"../../lib":163,"./axis_ids":208}],212:[function(t,e,r){"use strict";var n=t("./axis_ids").id2name,a=t("./scale_zoom"),i=t("./autorange").makePadFn,o=t("../../constants/numerical").ALMOST_EQUAL,l=t("../../constants/alignment").FROM_BL;function s(t,e){var r=t._inputDomain,n=l[t.constraintoward],a=r[0]+(r[1]-r[0])*n;t.domain=t._input.domain=[a+(r[0]-a)/e,a+(r[1]-a)/e]}r.enforce=function(t){var e,r,l,c,u,f,d,p=t._fullLayout,h=p._axisConstraintGroups||[];for(e=0;e<h.length;e++){var g=h[e],v=Object.keys(g),y=1/0,m=0,x=1/0,b={},_={},w=!1;for(r=0;r<v.length;r++)_[l=v[r]]=c=p[n(l)],c._inputDomain?c.domain=c._inputDomain.slice():c._inputDomain=c.domain.slice(),c._inputRange||(c._inputRange=c.range.slice()),c.setScale(),b[l]=u=Math.abs(c._m)/g[l],y=Math.min(y,u),"domain"!==c.constrain&&c._constraintShrinkable||(x=Math.min(x,u)),delete c._constraintShrinkable,m=Math.max(m,u),"domain"===c.constrain&&(w=!0);if(!(y>o*m)||w)for(r=0;r<v.length;r++)if(u=b[l=v[r]],f=(c=_[l]).constrain,u!==x||"domain"===f)if(d=u/x,"range"===f)a(c,d);else{var k=c._inputDomain,M=(c.domain[1]-c.domain[0])/(k[1]-k[0]),A=(c.r2l(c.range[1])-c.r2l(c.range[0]))/(c.r2l(c._inputRange[1])-c.r2l(c._inputRange[0]));if((d/=M)*A<1){c.domain=c._input.domain=k.slice(),a(c,d);continue}if(A<1&&(c.range=c._input.range=c._inputRange.slice(),d*=A),c.autorange&&c._min.length&&c._max.length){var T=c.r2l(c.range[0]),L=c.r2l(c.range[1]),S=(T+L)/2,C=S,O=S,P=Math.abs(L-S),z=S-P*d*1.0001,D=S+P*d*1.0001,E=i(c);s(c,d),c.setScale();var N,R,I=Math.abs(c._m);for(R=0;R<c._min.length;R++)(N=c._min[R].val-E(c._min[R])/I)>z&&N<C&&(C=N);for(R=0;R<c._max.length;R++)(N=c._max[R].val+E(c._max[R])/I)<D&&N>O&&(O=N);d/=(O-C)/(2*P),C=c.l2r(C),O=c.l2r(O),c.range=c._input.range=T<L?[C,O]:[O,C]}s(c,d)}}},r.clean=function(t,e){if(e._inputDomain){for(var r=!1,n=e._id,a=t._fullLayout._axisConstraintGroups,i=0;i<a.length;i++)if(a[i][n]){r=!0;break}r&&"domain"===e.constrain||(e._input.domain=e.domain=e._inputDomain,delete e._inputDomain)}}},{"../../constants/alignment":143,"../../constants/numerical":145,"./autorange":204,"./axis_ids":208,"./scale_zoom":221}],213:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("has-passive-events"),o=t("../../registry"),l=t("../../lib"),s=t("../../lib/svg_text_utils"),c=t("../../lib/clear_gl_canvases"),u=t("../../components/color"),f=t("../../components/drawing"),d=t("../../components/fx"),p=t("../../lib/setcursor"),h=t("../../components/dragelement"),g=t("../../constants/alignment").FROM_TL,v=t("../plots"),y=t("./axes").doTicksSingle,m=t("./axis_ids").getFromId,x=t("./select").prepSelect,b=t("./select").clearSelect,_=t("./scale_zoom"),w=t("./constants"),k=w.MINDRAG,M=w.MINZOOM,A=!0;function T(t,e,r,n){var a=l.ensureSingle(t.draglayer,e,r,function(e){e.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",t.id)});return a.call(p,n),a.node()}function L(t,e,r,a,i,o,l){var s=T(t,"rect",e,r);return n.select(s).call(f.setRect,a,i,o,l),s}function S(t,e){for(var r=0;r<t.length;r++)if(!t[r].fixedrange)return e;return""}function C(t,e,r,n,a){var i,o,l,s;for(i=0;i<t.length;i++)(o=t[i]).fixedrange||(l=o._rl[0],s=o._rl[1]-l,o.range=[o.l2r(l+s*e),o.l2r(l+s*r)],n[o._name+".range[0]"]=o.range[0],n[o._name+".range[1]"]=o.range[1]);if(a&&a.length){var c=(e+(1-r))/2;C(a,c,1-c,n)}}function O(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 P(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function z(t,e,r,n,a){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",a+"Z")}function D(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function E(t,e,r,n,a,i){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),N(t,e,a,i)}function N(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 R(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function I(t){A&&t.data&&t._context.showTips&&(l.notifier(l._(t,"Double-click to zoom back out"),"long"),A=!1)}function F(t){return"lasso"===t||"select"===t}function j(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,M)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function B(t,e){if(i){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)}function H(t){var e=[];for(var r in t)e.push(t[r]);return e}e.exports={makeDragBox:function(t,e,r,i,u,p,A,T){var N,q,V,U,G,Y,X,Z,W,Q,J,$,K,tt,et,rt,nt,at,it,ot,lt,st=t._fullLayout._zoomlayer,ct=A+T==="nsew",ut=1===(A+T).length;function ft(){if(N=e.xaxis,q=e.yaxis,W=N._length,Q=q._length,X=N._offset,Z=q._offset,(V={})[N._id]=N,(U={})[q._id]=q,A&&T)for(var r=e.overlays,n=0;n<r.length;n++){var a=r[n].xaxis;V[a._id]=a;var i=r[n].yaxis;U[i._id]=i}G=H(V),Y=H(U),$=S(G,T),K=S(Y,A),tt=!K&&!$,J=function(t,e,r){for(var n,a,i,o,s=t._fullLayout._axisConstraintGroups,c=!1,u={},f={},d=0;d<s.length;d++){var p=s[d];for(n in e)if(p[n]){for(i in p)("x"===i.charAt(0)?e:r)[i]||(u[i]=1);for(a in r)p[a]&&(c=!0)}for(a in r)if(p[a])for(o in p)("x"===o.charAt(0)?e:r)[o]||(f[o]=1)}c&&(l.extendFlat(u,f),f={});var h={},g=[];for(i in u){var v=m(t,i);g.push(v),h[v._id]=v}var y={},x=[];for(o in f){var b=m(t,o);x.push(b),y[b._id]=b}return{xaHash:h,yaHash:y,xaxes:g,yaxes:x,isSubplotConstrained:c}}(t,V,U),et=J.isSubplotConstrained,rt=T||et,nt=A||et;var o=t._fullLayout;at=o._has("scattergl"),it=o._hasOnlyLargeSploms,ot=it||o._has("splom"),lt=o._has("svg")}ft();var dt=function(t,e,r){return t?"nsew"===t?r?"":"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}(K+$,t._fullLayout.dragmode,ct),pt=L(e,A+T+"drag",dt,r,i,u,p);if(tt&&!ct)return pt.onmousedown=null,pt.style.pointerEvents="none",pt;var ht,gt,vt,yt,mt,xt,bt,_t,wt,kt,Mt={element:pt,gd:t,plotinfo:e};function At(){Mt.plotinfo.selection=!1,b(st)}function Tt(r,a){if(R(t),2!==r||ut||function(){if(!t._transitioningWithDuration){var e,r,n,a=t._context.doubleClick,i=($?G:[]).concat(K?Y:[]),l={};if("reset+autosize"===a)for(a="autosize",r=0;r<i.length;r++)if((e=i[r])._rangeInitial&&(e.range[0]!==e._rangeInitial[0]||e.range[1]!==e._rangeInitial[1])||!e._rangeInitial&&!e.autorange){a="reset";break}if("autosize"===a)for(r=0;r<i.length;r++)(e=i[r]).fixedrange||(l[e._name+".autorange"]=!0);else if("reset"===a)for(($||et)&&(i=i.concat(J.xaxes)),K&&!et&&(i=i.concat(J.yaxes)),et&&($?K||(i=i.concat(Y)):i=i.concat(G)),r=0;r<i.length;r++)(e=i[r])._rangeInitial?(n=e._rangeInitial,l[e._name+".range[0]"]=n[0],l[e._name+".range[1]"]=n[1]):l[e._name+".autorange"]=!0;t.emit("plotly_doubleclick",null),o.call("relayout",t,l)}}(),ct)d.click(t,a,e.id);else if(1===r&&ut){var i=A?q:N,l="s"===A||"w"===T?0:1,c=i._name+".range["+l+"]",u=function(t,e){var r,a=t.range[e],i=Math.abs(a-t.range[1-e]);return"date"===t.type?a:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,a))):(r=Math.floor(Math.log(Math.abs(a))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,n.format("."+String(r)+"g")(a))}(i,l),f="left",p="middle";if(i.fixedrange)return;A?(p="n"===A?"top":"bottom","right"===i.side&&(f="right")):"e"===T&&(f="right"),t._context.showAxisRangeEntryBoxes&&n.select(pt).call(s.makeEditable,{gd:t,immediate:!0,background:t._fullLayout.paper_bgcolor,text:String(u),fill:i.tickfont?i.tickfont.color:"#444",horizontalAlign:f,verticalAlign:p}).on("edit",function(e){var r=i.d2r(e);void 0!==r&&o.call("relayout",t,c,r)})}}Mt.prepFn=function(e,r,n){var i=t._fullLayout.dragmode;ft(),tt||(ct?e.shiftKey?"pan"===i?i="zoom":F(i)||(i="pan"):e.ctrlKey&&(i="pan"):i="pan"),Mt.minDrag="lasso"===i?1:void 0,F(i)?(Mt.xaxes=G,Mt.yaxes=Y,x(e,r,n,Mt,i)):(Mt.clickFn=Tt,At(),tt||("zoom"===i?(Mt.moveFn=St,Mt.doneFn=Ct,Mt.minDrag=1,function(e,r,n){var i=pt.getBoundingClientRect();ht=r-i.left,gt=n-i.top,vt={l:ht,r:ht,w:0,t:gt,b:gt,h:0},yt=t._hmpixcount?t._hmlumcount/t._hmpixcount:a(t._fullLayout.plot_bgcolor).getLuminance(),xt=!1,bt="xy",kt=!1,_t=z(st,yt,X,Z,mt="M0,0H"+W+"V"+Q+"H0V0"),wt=D(st,X,Z)}(0,r,n)):"pan"===i&&(Mt.moveFn=Rt,Mt.doneFn=Ft)))},h.init(Mt);var Lt={};function St(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(W,e+ht)),a=Math.max(0,Math.min(Q,r+gt)),i=Math.abs(n-ht),o=Math.abs(a-gt);function l(){bt="",vt.r=vt.l,vt.t=vt.b,wt.attr("d","M0,0Z")}vt.l=Math.min(ht,n),vt.r=Math.max(ht,n),vt.t=Math.min(gt,a),vt.b=Math.max(gt,a),et?i>M||o>M?(bt="xy",i/W>o/Q?(o=i*Q/W,gt>a?vt.t=gt-o:vt.b=gt+o):(i=o*W/Q,ht>n?vt.l=ht-i:vt.r=ht+i),wt.attr("d",j(vt))):l():!K||o<Math.min(Math.max(.6*i,k),M)?i<k?l():(vt.t=0,vt.b=Q,bt="x",wt.attr("d",function(t,e){return"M"+(t.l-.5)+","+(e-M-.5)+"h-3v"+(2*M+1)+"h3ZM"+(t.r+.5)+","+(e-M-.5)+"h3v"+(2*M+1)+"h-3Z"}(vt,gt))):!$||i<Math.min(.6*o,M)?(vt.l=0,vt.r=W,bt="y",wt.attr("d",function(t,e){return"M"+(e-M-.5)+","+(t.t-.5)+"v-3h"+(2*M+1)+"v3ZM"+(e-M-.5)+","+(t.b+.5)+"v3h"+(2*M+1)+"v-3Z"}(vt,ht))):(bt="xy",wt.attr("d",j(vt))),vt.w=vt.r-vt.l,vt.h=vt.b-vt.t,bt&&(kt=!0),t._dragged=kt,E(_t,wt,vt,mt,xt,yt),xt=!0}function Ct(){if(Math.min(vt.h,vt.w)<2*k)return R(t);"xy"!==bt&&"x"!==bt||C(G,vt.l/W,vt.r/W,Lt,J.xaxes),"xy"!==bt&&"y"!==bt||C(Y,(Q-vt.b)/Q,(Q-vt.t)/Q,Lt,J.yaxes),R(t),Ft(),I(t)}var Ot,Pt,zt=[0,0,W,Q],Dt=null,Et=w.REDRAWDELAY,Nt=e.mainplot?t._fullLayout._plots[e.mainplot]:e;function Rt(e,r){if(!t._transitioningWithDuration){if("ew"===$||"ns"===K)return $&&O(G,e),K&&O(Y,r),jt([$?-e:0,K?-r:0,W,Q]),void It(K,$);if(et&&$&&K){var n="w"===$==("n"===K)?1:-1,a=(e/W+n*r/Q)/2;e=a*W,r=n*a*Q}"w"===$?e=s(G,0,e):"e"===$?e=s(G,1,-e):$||(e=0),"n"===K?r=s(Y,1,r):"s"===K?r=s(Y,0,-r):K||(r=0);var i="w"===$?e:0,o="n"===K?r:0;if(et){var l;if(!$&&1===K.length){for(l=0;l<G.length;l++)G[l].range=G[l]._r.slice(),_(G[l],1-r/Q);i=(e=r*W/Q)/2}if(!K&&1===$.length){for(l=0;l<Y.length;l++)Y[l].range=Y[l]._r.slice(),_(Y[l],1-e/W);o=(r=e*Q/W)/2}}jt([i,o,W-e,Q-r]),It(K,$)}function s(t,e,r){for(var n,a,i=1-e,o=0;o<t.length;o++){var l=t[o];if(!l.fixedrange){n=l,a=l._rl[i]+(l._rl[e]-l._rl[i])/P(r/l._length);var s=l.l2r(a);!1!==s&&void 0!==s&&(l.range[e]=s)}}return n._length*(n._rl[e]-a)/(n._rl[e]-n._rl[i])}}function It(e,r){var n,a=[];function i(t){for(n=0;n<t.length;n++)t[n].fixedrange||a.push(t[n]._id)}for(rt&&(i(G),i(J.xaxes)),nt&&(i(Y),i(J.yaxes)),Lt={},n=0;n<a.length;n++){var l=a[n];y(t,l,!0);var s=m(t,l);Lt[s._name+".range[0]"]=s.range[0],Lt[s._name+".range[1]"]=s.range[1]}function c(i,o,l){for(n=0;n<i.length;n++){var s=i[n];if((r&&-1!==a.indexOf(s.xref)||e&&-1!==a.indexOf(s.yref))&&(o(t,n),l))return}}c(t._fullLayout.annotations||[],o.getComponentMethod("annotations","drawOne")),c(t._fullLayout.shapes||[],o.getComponentMethod("shapes","drawOne")),c(t._fullLayout.images||[],o.getComponentMethod("images","draw"),!0)}function Ft(){jt([0,0,W,Q]),l.syncOrAsync([v.previousPromises,function(){o.call("relayout",t,Lt)}],t)}function jt(e){var r,n,a,i,s=t._fullLayout,u=s._plots,d=s._subplots.cartesian;if((ot||at)&&c(t),!ot||(o.subplotsRegistry.splom.drag(t),!it)){if(at)for(r=0;r<d.length;r++){a=(n=u[d[r]]).xaxis,i=n.yaxis;var p=n._scene;if(p){var h=l.simpleMap(a.range,a.r2l),g=l.simpleMap(i.range,i.r2l);p.update({range:[h[0],g[0],h[1],g[1]]})}}if(lt){var v=e[2]/N._length,y=e[3]/q._length;for(r=0;r<d.length;r++){a=(n=u[d[r]]).xaxis,i=n.yaxis;var m,x,b,_,w=rt&&!a.fixedrange&&V[a._id],k=nt&&!i.fixedrange&&U[i._id];if(w?(m=v,b=T?e[0]:qt(a,m)):b=Ht(a,m=Bt(a,v,y)),k?(x=y,_=A?e[1]:qt(i,x)):_=Ht(i,x=Bt(i,v,y)),m||x){m||(m=1),x||(x=1);var M=a._offset-b/m,L=i._offset-_/x;n.clipRect.call(f.setTranslate,b,_).call(f.setScale,m,x),n.plot.call(f.setTranslate,M,L).call(f.setScale,1/m,1/x),m===Ot&&x===Pt||(f.setPointGroupScale(n.zoomScalePts,m,x),f.setTextPointsScale(n.zoomScaleTxt,m,x)),f.hideOutsideRangePoints(n.clipOnAxisFalseTraces,n),Ot=m,Pt=x}}}}}function Bt(t,e,r){return t.fixedrange?0:rt&&J.xaHash[t._id]?e:nt&&(et?J.xaHash:J.yaHash)[t._id]?r:0}function Ht(t,e){return e?(t.range=t._r.slice(),_(t,e),qt(t,e)):0}function qt(t,e){return t._length*(1-e)*g[t.constraintoward||"middle"]}return A.length*T.length!=1&&B(pt,function(e){if(t._context.scrollZoom||t._fullLayout._enablescrollzoom){if(At(),t._transitioningWithDuration)return e.preventDefault(),void e.stopPropagation();var r=t.querySelector(".plotly");if(ft(),!(r.scrollHeight-r.clientHeight>10||r.scrollWidth-r.clientWidth>10)){clearTimeout(Dt);var n=-e.deltaY;if(isFinite(n)||(n=e.wheelDelta/10),isFinite(n)){var a,i=Math.exp(-Math.min(Math.max(n,-20),20)/200),o=Nt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),s=(e.clientX-o.left)/o.width,c=(o.bottom-e.clientY)/o.height;if(rt){for(T||(s=.5),a=0;a<G.length;a++)u(G[a],s,i);zt[2]*=i,zt[0]+=zt[2]*s*(1/i-1)}if(nt){for(A||(c=.5),a=0;a<Y.length;a++)u(Y[a],c,i);zt[3]*=i,zt[1]+=zt[3]*(1-c)*(1/i-1)}jt(zt),It(A,T),Dt=setTimeout(function(){zt=[0,0,W,Q],Ft()},Et),e.preventDefault()}else l.log("Did not find wheel motion attributes: ",e)}}function u(t,e,r){if(!t.fixedrange){var n=l.simpleMap(t.range,t.r2l),a=n[0]+(n[1]-n[0])*e;t.range=n.map(function(e){return t.l2r(a+(e-a)*r)})}}}),pt},makeDragger:T,makeRectDragger:L,makeZoombox:z,makeCorners:D,updateZoombox:E,xyCorners:j,transitionZoombox:N,removeZoombox:R,showDoubleClickNotifier:I,attachWheelEventHandler:B}},{"../../components/color":43,"../../components/dragelement":65,"../../components/drawing":68,"../../components/fx":85,"../../constants/alignment":143,"../../lib":163,"../../lib/clear_gl_canvases":152,"../../lib/setcursor":182,"../../lib/svg_text_utils":184,"../../registry":245,"../plots":237,"./axes":205,"./axis_ids":208,"./constants":210,"./scale_zoom":221,"./select":222,d3:7,"has-passive-events":13,tinycolor2:25}],214:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/fx"),i=t("../../components/dragelement"),o=t("../../lib/setcursor"),l=t("./dragbox").makeDragBox,s=t("./constants").DRAGGERSIZE;r.initInteractions=function(t){var e=t._fullLayout;if(t._context.staticPlot)n.select(t).selectAll(".drag").remove();else if(e._has("cartesian")||e._has("gl2d")||e._has("splom")){Object.keys(e._plots||{}).sort(function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),a=r.split("y");return n[0]===a[0]?Number(n[1]||1)-Number(a[1]||1):Number(n[0]||1)-Number(a[0]||1)}return e._plots[t].mainplot?1:-1}).forEach(function(r){var n=e._plots[r],o=n.xaxis,c=n.yaxis;if(!n.mainplot){var u=l(t,n,o._offset,c._offset,o._length,c._length,"ns","ew");u.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&a.hover(t,e,r)},a.hover(t,e,r),t._fullLayout._lasthover=u,t._fullLayout._hoversubplot=r},u.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,i.unhover(t,e))},t._context.showAxisDragHandles&&(l(t,n,o._offset-s,c._offset-s,s,s,"n","w"),l(t,n,o._offset+o._length,c._offset-s,s,s,"n","e"),l(t,n,o._offset-s,c._offset+c._length,s,s,"s","w"),l(t,n,o._offset+o._length,c._offset+c._length,s,s,"s","e"))}if(t._context.showAxisDragHandles){if(r===o._mainSubplot){var f=o._mainLinePosition;"top"===o.side&&(f-=s),l(t,n,o._offset+.1*o._length,f,.8*o._length,s,"","ew"),l(t,n,o._offset,f,.1*o._length,s,"","w"),l(t,n,o._offset+.9*o._length,f,.1*o._length,s,"","e")}if(r===c._mainSubplot){var d=c._mainLinePosition;"right"!==c.side&&(d-=s),l(t,n,d,c._offset+.1*c._length,s,.8*c._length,"ns",""),l(t,n,d,c._offset+.9*c._length,s,.1*c._length,"s",""),l(t,n,d,c._offset,s,.1*c._length,"n","")}}});var o=e._hoverlayer.node();o.onmousemove=function(r){r.target=t._fullLayout._lasthover,a.hover(t,r,e._hoversubplot)},o.onclick=function(e){e.target=t._fullLayout._lasthover,a.click(t,e)},o.onmousedown=function(e){t._fullLayout._lasthover.onmousedown(e)},r.updateFx(e)}},r.updateFx=function(t){var e="pan"===t.dragmode?"move":"crosshair";o(t._draggers,e)}},{"../../components/dragelement":65,"../../components/fx":85,"../../lib/setcursor":182,"./constants":210,"./dragbox":213,d3:7}],215:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib");e.exports=function(t){return function(e,r){var i=e[t];if(Array.isArray(i))for(var o=n.subplotsRegistry.cartesian,l=o.idRegex,s=r._subplots,c=s.xaxis,u=s.yaxis,f=s.cartesian,d=r._has("cartesian")||r._has("gl2d"),p=0;p<i.length;p++){var h=i[p];if(a.isPlainObject(h)){var g=h.xref,v=h.yref,y=l.x.test(g),m=l.y.test(v);if(y||m){d||a.pushUnique(r._basePlotModules,o);var x=!1;y&&-1===c.indexOf(g)&&(c.push(g),x=!0),m&&-1===u.indexOf(v)&&(u.push(v),x=!0),x&&y&&m&&f.push(g+v)}}}}}},{"../../lib":163,"../../registry":245}],216:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=t("../plots"),l=t("../../components/drawing"),s=t("../get_data").getModuleCalcData,c=t("./axis_ids"),u=t("./constants"),f=t("../../constants/xmlns_namespaces"),d=i.ensureSingle;function p(t,e,r){return i.ensureSingle(t,e,r,function(t){t.datum(r)})}function h(t,e,r,i,o){for(var c,f,d,p=u.traceLayerClasses,h=t._fullLayout,g=h._modules,v=[],y=[],m=0;m<g.length;m++){var x=(c=g[m]).name,b=a.modules[x].categories;if(b.svg){var _=c.layerName||x+"layer",w=c.plot;d=(f=s(r,w))[0],r=f[1],d.length&&v.push({i:p.indexOf(_),className:_,plotMethod:w,cdModule:d}),b.zoomScale&&y.push("."+_)}}v.sort(function(t,e){return t.i-e.i});var k=e.plot.selectAll("g.mlayer").data(v,function(t){return t.className});if(k.enter().append("g").attr("class",function(t){return t.className}).classed("mlayer",!0),k.exit().remove(),k.order(),k.each(function(r){var a=n.select(this),s=r.className;r.plotMethod(t,e,r.cdModule,a,i,o),"scatterlayer"!==s&&"barlayer"!==s&&l.setClipUrl(a,e.layerClipId)}),h._has("scattergl")&&(c=a.getModule("scattergl"),d=s(r,c)[0],c.plot(t,e,d)),!t._context.staticPlot&&(e._hasClipOnAxisFalse&&(e.clipOnAxisFalseTraces=e.plot.selectAll(".scatterlayer, .barlayer").selectAll(".trace")),y.length)){var M=e.plot.selectAll(y.join(",")).selectAll(".trace");e.zoomScalePts=M.selectAll("path.point"),e.zoomScaleTxt=M.selectAll(".textpoint")}}function g(t,e){var r=e.plotgroup,n=e.id,a=u.layerValue2layerClass[e.xaxis.layer],i=u.layerValue2layerClass[e.yaxis.layer],o=t._fullLayout._hasOnlyLargeSploms;if(e.mainplot){var l=e.mainplotinfo,s=l.plotgroup,f=n+"-x",h=n+"-y";e.gridlayer=l.gridlayer,e.zerolinelayer=l.zerolinelayer,d(l.overlinesBelow,"path",f),d(l.overlinesBelow,"path",h),d(l.overaxesBelow,"g",f),d(l.overaxesBelow,"g",h),e.plot=d(l.overplot,"g",n),d(l.overlinesAbove,"path",f),d(l.overlinesAbove,"path",h),d(l.overaxesAbove,"g",f),d(l.overaxesAbove,"g",h),e.xlines=s.select(".overlines-"+a).select("."+f),e.ylines=s.select(".overlines-"+i).select("."+h),e.xaxislayer=s.select(".overaxes-"+a).select("."+f),e.yaxislayer=s.select(".overaxes-"+i).select("."+h)}else if(o)e.plot=d(r,"g","plot"),e.xlines=d(r,"path","xlines-above"),e.ylines=d(r,"path","ylines-above"),e.xaxislayer=d(r,"g","xaxislayer-above"),e.yaxislayer=d(r,"g","yaxislayer-above");else{var g=d(r,"g","layer-subplot");e.shapelayer=d(g,"g","shapelayer"),e.imagelayer=d(g,"g","imagelayer"),e.gridlayer=d(r,"g","gridlayer"),e.zerolinelayer=d(r,"g","zerolinelayer"),d(r,"path","xlines-below"),d(r,"path","ylines-below"),e.overlinesBelow=d(r,"g","overlines-below"),d(r,"g","xaxislayer-below"),d(r,"g","yaxislayer-below"),e.overaxesBelow=d(r,"g","overaxes-below"),e.plot=d(r,"g","plot"),e.overplot=d(r,"g","overplot"),e.xlines=d(r,"path","xlines-above"),e.ylines=d(r,"path","ylines-above"),e.overlinesAbove=d(r,"g","overlines-above"),d(r,"g","xaxislayer-above"),d(r,"g","yaxislayer-above"),e.overaxesAbove=d(r,"g","overaxes-above"),e.xlines=r.select(".xlines-"+a),e.ylines=r.select(".ylines-"+i),e.xaxislayer=r.select(".xaxislayer-"+a),e.yaxislayer=r.select(".yaxislayer-"+i)}o||(p(e.gridlayer,"g",e.xaxis._id),p(e.gridlayer,"g",e.yaxis._id),e.gridlayer.selectAll("g").sort(c.idSort)),e.xlines.style("fill","none").classed("crisp",!0),e.ylines.style("fill","none").classed("crisp",!0)}function v(t,e){if(t){var r={};for(var a in t.each(function(t){n.select(this).remove(),y(t,e),r[t]=!0}),e._plots)for(var i=e._plots[a].overlays||[],o=0;o<i.length;o++){var l=i[o];r[l.id]&&l.plot.selectAll(".trace").remove()}}}function y(t,e){e._draggers.selectAll("g."+t).remove(),e._defs.select("#clip"+e._uid+t+"plot").remove()}r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=u.idRegex,r.attrRegex=u.attrRegex,r.attributes=t("./attributes"),r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.transitionAxes=t("./transition_axes"),r.finalizeSubplots=function(t,e){var r,n,a,o=e._subplots,l=o.xaxis,s=o.yaxis,f=o.cartesian,d=f.concat(o.gl2d||[]),p={},h={};for(r=0;r<d.length;r++){var g=d[r].split("y");p[g[0]]=1,h["y"+g[1]]=1}for(r=0;r<l.length;r++)p[n=l[r]]||(a=(t[c.id2name(n)]||{}).anchor,u.idRegex.y.test(a)||(a="y"),f.push(n+a),d.push(n+a),h[a]||(h[a]=1,i.pushUnique(s,a)));for(r=0;r<s.length;r++)h[a=s[r]]||(n=(t[c.id2name(a)]||{}).anchor,u.idRegex.x.test(n)||(n="x"),f.push(n+a),d.push(n+a),p[n]||(p[n]=1,i.pushUnique(l,n)));if(!d.length){for(var v in n="",a="",t){if(u.attrRegex.test(v))"x"===v.charAt(0)?(!n||+v.substr(5)<+n.substr(5))&&(n=v):(!a||+v.substr(5)<+a.substr(5))&&(a=v)}n=n?c.name2id(n):"x",a=a?c.name2id(a):"y",l.push(n),s.push(a),f.push(n+a)}},r.plot=function(t,e,r,n){var a,i=t._fullLayout,o=i._subplots.cartesian,l=t.calcdata;if(!Array.isArray(e))for(e=[],a=0;a<l.length;a++)e.push(a);for(a=0;a<o.length;a++){for(var s,c=o[a],u=i._plots[c],f=[],d=0;d<l.length;d++){var p=l[d],g=p[0].trace;g.xaxis+g.yaxis===c&&((-1!==e.indexOf(g.index)||g.carpet)&&(s&&s[0].trace.xaxis+s[0].trace.yaxis===c&&-1!==["tonextx","tonexty","tonext"].indexOf(g.fill)&&-1===f.indexOf(s)&&f.push(s),f.push(p)),s=p)}h(t,u,f,r,n)}},r.clean=function(t,e,r,n){var a,i,o,l=n._plots||{},s=e._plots||{},u=n._subplots||{};if(n._hasOnlyLargeSploms&&!e._hasOnlyLargeSploms)for(o in l)(a=l[o]).plotgroup&&a.plotgroup.remove();var f=n._has&&n._has("gl"),d=e._has&&e._has("gl");if(f&&!d)for(o in l)(a=l[o])._scene&&a._scene.destroy();if(u.xaxis&&u.yaxis){var p=c.listIds({_fullLayout:n});for(i=0;i<p.length;i++){var h=p[i];e[c.id2name(h)]||n._infolayer.selectAll(".g-"+h+"title").remove()}}var g=n._has&&n._has("cartesian"),m=e._has&&e._has("cartesian");if(g&&!m)v(n._cartesianlayer.selectAll(".subplot"),n),n._defs.selectAll(".axesclip").remove(),delete n._axisConstraintGroups;else if(u.cartesian)for(i=0;i<u.cartesian.length;i++){var x=u.cartesian[i];if(!s[x]){var b="."+x+",."+x+"-x,."+x+"-y";n._cartesianlayer.selectAll(b).remove(),y(x,n)}}},r.drawFramework=function(t){var e=t._fullLayout,r=function(t){var e=t._fullLayout,r=[],n=[];for(var a in e._plots){var i=e._plots[a],o=i.xaxis._mainAxis,l=i.yaxis._mainAxis,s=o._id+l._id;s!==a&&e._plots[s]?(i.mainplot=s,i.mainplotinfo=e._plots[s],n.push(a)):(r.push(a),i.mainplot=void 0)}return r=r.concat(n)}(t),a=e._cartesianlayer.selectAll(".subplot").data(r,i.identity);a.enter().append("g").attr("class",function(t){return"subplot "+t}),a.order(),a.exit().call(v,e),a.each(function(r){var a=e._plots[r];(a.plotgroup=n.select(this),a.overlays=[],g(t,a),a.mainplot)&&e._plots[a.mainplot].overlays.push(a);a.draglayer=d(e._draggers,"g",r)})},r.rangePlot=function(t,e,r){g(t,e),h(t,e,r),o.style(t)},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter(function(t,e){return e===r.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus").each(function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:f.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.width,height:this.height})})},r.updateFx=t("./graph_interact").updateFx},{"../../components/drawing":68,"../../constants/xmlns_namespaces":147,"../../lib":163,"../../registry":245,"../get_data":233,"../plots":237,"./attributes":203,"./axis_ids":208,"./constants":210,"./graph_interact":214,"./layout_attributes":217,"./layout_defaults":218,"./transition_axes":227,d3:7}],217:[function(t,e,r){"use strict";var n=t("../font_attributes"),a=t("../../components/color/attributes"),i=t("../../components/drawing/attributes").dash,o=t("../../lib/extend").extendFlat,l=t("./constants");e.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:a.defaultLine,editType:"ticks"},title:{valType:"string",editType:"ticks+margins"},titlefont:n({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:"axrange+margins",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"axrange+margins",impliedEdits:{"^autorange":!1}}],editType:"axrange+margins",impliedEdits:{autorange:!1}},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},scaleanchor:{valType:"enumerated",values:[l.idRegex.x.toString(),l.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:a.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:o({},i,{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:n({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:a.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:{valType:"boolean",editType:"ticks"},gridcolor:{valType:"color",dflt:a.lightLine,editType:"ticks"},gridwidth:{valType:"number",min:0,dflt:1,editType:"ticks"},zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:a.defaultLine,editType:"ticks"},zerolinewidth:{valType:"number",dflt:1,editType:"ticks"},anchor:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"plot+margins"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot+margins"},overlaying:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.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"}}}},{"../../components/color/attributes":42,"../../components/drawing/attributes":67,"../../lib/extend":157,"../font_attributes":231,"./constants":210}],218:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../components/color"),o=t("../layout_attributes"),l=t("./layout_attributes"),s=t("./type_defaults"),c=t("./axis_defaults"),u=t("./constraint_defaults"),f=t("./position_defaults"),d=t("./axis_ids");e.exports=function(t,e,r){var p,h={},g={},v={},y={};for(p=0;p<r.length;p++){var m=r[p];if(n.traceIs(m,"cartesian")||n.traceIs(m,"gl2d")){var x=d.id2name(m.xaxis),b=d.id2name(m.yaxis);if(n.traceIs(m,"carpet")&&("carpet"!==m.type||m._cheater)||x&&(g[x]=1),"carpet"===m.type&&m._cheater&&x&&(h[x]=1),n.traceIs(m,"2dMap")&&(v[x]=!0,v[b]=!0),n.traceIs(m,"oriented"))y["h"===m.orientation?b:x]=!0}}var _=e._subplots,w=_.xaxis,k=_.yaxis,M=a.simpleMap(w,d.id2name),A=a.simpleMap(k,d.id2name),T=M.concat(A),L=i.background;w.length&&k.length&&(L=a.coerce(t,e,o,"plot_bgcolor"));var S,C,O,P,z=i.combine(L,e.paper_bgcolor);function D(t,e){return a.coerce(O,P,l,t,e)}function E(t,e){return a.coerce2(O,P,l,t,e)}function N(t){return"x"===t?k:w}var R={x:N("x"),y:N("y")};function I(e,r){for(var n="x"===e?M:A,a=[],i=0;i<n.length;i++){var o=n[i];o===r||(t[o]||{}).overlaying||a.push(d.name2id(o))}return a}for(p=0;p<T.length;p++){S=T[p],a.isPlainObject(t[S])||(t[S]={}),O=t[S],P=e[S]={},s(O,P,D,r,S);var F=I(C=S.charAt(0),S),j={letter:C,font:e.font,outerTicks:v[S],showGrid:!y[S],data:r,bgColor:z,calendar:e.calendar,automargin:!0,cheateronly:"x"===C&&h[S]&&!g[S]};c(O,P,D,j,e);var B=E("spikecolor"),H=E("spikethickness"),q=E("spikedash"),V=E("spikemode"),U=E("spikesnap");D("showspikes",!!(B||H||q||V||U))||(delete P.spikecolor,delete P.spikethickness,delete P.spikedash,delete P.spikemode,delete P.spikesnap);var G={letter:C,counterAxes:R[C],overlayableAxes:F,grid:e.grid};f(O,P,D,G),P._input=O}var Y=n.getComponentMethod("rangeslider","handleDefaults"),X=n.getComponentMethod("rangeselector","handleDefaults");for(p=0;p<M.length;p++)S=M[p],O=t[S],P=e[S],Y(t,e,S),"date"===P.type&&X(O,P,e,A,P.calendar),D("fixedrange");for(p=0;p<A.length;p++){S=A[p],O=t[S],P=e[S];var Z=e[d.id2name(P.anchor)];D("fixedrange",Z&&Z.rangeslider&&Z.rangeslider.visible)}e._axisConstraintGroups=[];var W=R.x.concat(R.y);for(p=0;p<T.length;p++)C=(S=T[p]).charAt(0),O=t[S],P=e[S],u(O,P,D,W,e)}},{"../../components/color":43,"../../lib":163,"../../registry":245,"../layout_attributes":235,"./axis_defaults":207,"./axis_ids":208,"./constraint_defaults":211,"./layout_attributes":217,"./position_defaults":220,"./type_defaults":228}],219:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,a=t("../../components/color/attributes").lightFraction,i=t("../../lib");e.exports=function(t,e,r,o){var l=(o=o||{}).dfltColor;function s(r,n){return i.coerce2(t,e,o.attributes,r,n)}var c=s("linecolor",l),u=s("linewidth");r("showline",o.showLine||!!c||!!u)||(delete e.linecolor,delete e.linewidth);var f=s("gridcolor",n(l,o.bgColor,o.blend||a).toRgbString()),d=s("gridwidth");if(r("showgrid",o.showGrid||!!f||!!d)||(delete e.gridcolor,delete e.gridwidth),!o.noZeroLine){var p=s("zerolinecolor",l),h=s("zerolinewidth");r("zeroline",o.showGrid||!!p||!!h)||(delete e.zerolinecolor,delete e.zerolinewidth)}}},{"../../components/color/attributes":42,"../../lib":163,tinycolor2:25}],220:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib");e.exports=function(t,e,r,i){var o,l,s,c,u=i.counterAxes||[],f=i.overlayableAxes||[],d=i.letter,p=i.grid;p&&(l=p._domains[d][p._axisMap[e._id]],o=p._anchors[e._id],l&&(s=p[d+"side"].split(" ")[0],c=p.domain[d]["right"===s||"top"===s?1:0])),l=l||[0,1],o=o||(n(t.position)?"free":u[0]||"free"),s=s||("x"===d?"bottom":"left"),c=c||0,"free"===a.coerce(t,e,{anchor:{valType:"enumerated",values:["free"].concat(u),dflt:o}},"anchor")&&r("position",c),a.coerce(t,e,{side:{valType:"enumerated",values:"x"===d?["bottom","top"]:["left","right"],dflt:s}},"side");var h=!1;if(f.length&&(h=a.coerce(t,e,{overlaying:{valType:"enumerated",values:[!1].concat(f),dflt:!1}},"overlaying")),!h){var g=r("domain",l);g[0]>g[1]-.01&&(e.domain=l),a.noneOrAll(t.domain,e.domain,l)}return r("layer"),e}},{"../../lib":163,"fast-isnumeric":10}],221:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)]}},{"../../constants/alignment":143}],222:[function(t,e,r){"use strict";var n=t("polybooljs"),a=t("../../registry"),i=t("../../components/color"),o=t("../../components/fx"),l=t("../../lib/polygon"),s=t("../../lib/throttle"),c=t("../../components/fx/helpers").makeEventData,u=t("./axis_ids").getFromId,f=t("../sort_modules").sortModules,d=t("./constants"),p=d.MINSELECT,h=l.filter,g=l.tester,v=l.multitester;function y(t){return t._id}function m(t,e,r){var n,i,o,l;if(r){var s=r.points||[];for(n=0;n<e.length;n++)(l=e[n].cd[0].trace).selectedpoints=[],l._input.selectedpoints=[];for(n=0;n<s.length;n++){var c=s[n],u=c.data,d=c.fullData;c.pointIndices?([].push.apply(u.selectedpoints,c.pointIndices),[].push.apply(d.selectedpoints,c.pointIndices)):(u.selectedpoints.push(c.pointIndex),d.selectedpoints.push(c.pointIndex))}}else for(n=0;n<e.length;n++)delete(l=e[n].cd[0].trace).selectedpoints,delete l._input.selectedpoints;var p={};for(n=0;n<e.length;n++){var h=(o=e[n])._module.name;p[h]?p[h].push(o):p[h]=[o]}var g=Object.keys(p).sort(f);for(n=0;n<g.length;n++){var v=p[g[n]],y=v.length,m=v[0],x=m.cd[0].trace,b=m._module,_=b.styleOnSelect||b.style;if(a.traceIs(x,"regl")){var w=new Array(y);for(i=0;i<y;i++)w[i]=v[i].cd;_(t,w)}else for(i=0;i<y;i++)_(t,v[i].cd)}}function x(t,e){if(Array.isArray(t))for(var r=e.cd,n=e.cd[0].trace,a=0;a<t.length;a++)t[a]=c(t[a],n,r);return t}function b(t){t.selectAll(".select-outline").remove()}e.exports={prepSelect:function(t,e,r,a,l){var c,f,_,w,k,M,A,T,L,S=a.gd,C=S._fullLayout,O=C._zoomlayer,P=a.element.getBoundingClientRect(),z=a.plotinfo,D=z.xaxis._offset,E=z.yaxis._offset,N=e-P.left,R=r-P.top,I=N,F=R,j="M"+N+","+R,B=a.xaxes[0]._length,H=a.yaxes[0]._length,q=a.xaxes.map(y),V=a.yaxes.map(y),U=a.xaxes.concat(a.yaxes),G=t.altKey,Y=C._lastSelectedSubplot&&C._lastSelectedSubplot===z.id;Y&&(t.shiftKey||t.altKey)&&z.selection&&z.selection.polygons&&!a.polygons?(a.polygons=z.selection.polygons,a.mergedPolygons=z.selection.mergedPolygons):(!t.shiftKey&&!t.altKey||(t.shiftKey||t.altKey)&&!z.selection)&&(z.selection={},z.selection.polygons=a.polygons=[],z.selection.mergedPolygons=a.mergedPolygons=[]),Y||(b(O),C._lastSelectedSubplot=z.id),"lasso"===l&&(c=h([[N,R]],d.BENDPX));var X=O.selectAll("path.select-outline-"+z.id).data([1,2]);X.enter().append("path").attr("class",function(t){return"select-outline select-outline-"+t+" select-outline-"+z.id}).attr("transform","translate("+D+", "+E+")").attr("d",j+"Z");var Z,W=O.append("path").attr("class","zoombox-corners").style({fill:i.background,stroke:i.defaultLine,"stroke-width":1}).attr("transform","translate("+D+", "+E+")").attr("d","M0,0Z"),Q=[],J=C._uid+d.SELECTID,$=[];for(k=0;k<S.calcdata.length;k++)if(!0===(A=(M=S.calcdata[k])[0].trace).visible&&A._module&&A._module.selectPoints)if(a.subplot)A.subplot!==a.subplot&&A.geo!==a.subplot||Q.push({_module:A._module,cd:M,xaxis:a.xaxes[0],yaxis:a.yaxes[0]});else if("splom"===A.type&&A._xaxes[q[0]]&&A._yaxes[V[0]])Q.push({_module:A._module,cd:M,xaxis:a.xaxes[0],yaxis:a.yaxes[0]});else{if(-1===q.indexOf(A.xaxis))continue;if(-1===V.indexOf(A.yaxis))continue;Q.push({_module:A._module,cd:M,xaxis:u(S,A.xaxis),yaxis:u(S,A.yaxis)})}function K(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return t.p2d(r[e])}}function tt(t,e){return t-e}Z=z.fillRangeItems?z.fillRangeItems:"select"===l?function(t,e){var r=t.range={};for(k=0;k<U.length;k++){var n=U[k],a=n._id.charAt(0);r[n._id]=[n.p2d(e[a+"min"]),n.p2d(e[a+"max"])].sort(tt)}}:function(t,e,r){var n=t.lassoPoints={};for(k=0;k<U.length;k++){var a=U[k];n[a._id]=r.filtered.map(K(a))}},a.moveFn=function(t,e){I=Math.max(0,Math.min(B,t+N)),F=Math.max(0,Math.min(H,e+R));var r=Math.abs(I-N),i=Math.abs(F-R);if("select"===l){var o=C.selectdirection;"h"===(o="any"===C.selectdirection?i<Math.min(.6*r,p)?"h":r<Math.min(.6*i,p)?"v":"d":C.selectdirection)?((w=[[N,0],[N,H],[I,H],[I,0]]).xmin=Math.min(N,I),w.xmax=Math.max(N,I),w.ymin=Math.min(0,H),w.ymax=Math.max(0,H),W.attr("d","M"+w.xmin+","+(R-p)+"h-4v"+2*p+"h4ZM"+(w.xmax-1)+","+(R-p)+"h4v"+2*p+"h-4Z")):"v"===o?((w=[[0,R],[0,F],[B,F],[B,R]]).xmin=Math.min(0,B),w.xmax=Math.max(0,B),w.ymin=Math.min(R,F),w.ymax=Math.max(R,F),W.attr("d","M"+(N-p)+","+w.ymin+"v-4h"+2*p+"v4ZM"+(N-p)+","+(w.ymax-1)+"v4h"+2*p+"v-4Z")):"d"===o&&((w=[[N,R],[N,F],[I,F],[I,R]]).xmin=Math.min(N,I),w.xmax=Math.max(N,I),w.ymin=Math.min(R,F),w.ymax=Math.max(R,F),W.attr("d","M0,0Z"))}else"lasso"===l&&(c.addPt([I,F]),w=c.filtered);a.polygons&&a.polygons.length?(_=function(t,e,r){return r?n.difference({regions:t,inverted:!1},{regions:[e],inverted:!1}).regions:n.union({regions:t,inverted:!1},{regions:[e],inverted:!1}).regions}(a.mergedPolygons,w,G),w.subtract=G,f=v(a.polygons.concat([w]))):(_=[w],f=g(w));var u=[];for(k=0;k<_.length;k++){var h=_[k];u.push(h.join("L")+"L"+h[0])}X.attr("d","M"+u.join("M")+"Z"),s.throttle(J,d.SELECTDELAY,function(){$=[];var t,e,r=[];for(k=0;k<Q.length;k++)if(e=(T=Q[k])._module.selectPoints(T,f),r.push(e),t=x(e,T),$.length)for(var n=0;n<t.length;n++)$.push(t[n]);else $=t;m(S,Q,L={points:$}),Z(L,w,c),a.gd.emit("plotly_selecting",L)})},a.clickFn=function(t,e){W.remove(),s.done(J).then(function(){if(s.clear(J),2===t){for(X.remove(),k=0;k<Q.length;k++)(T=Q[k])._module.selectPoints(T,!1);m(S,Q),S.emit("plotly_deselect",null)}else S.emit("plotly_selected",void 0);o.click(S,e)})},a.doneFn=function(){W.remove(),s.done(J).then(function(){s.clear(J),a.gd.emit("plotly_selected",L),w&&a.polygons&&(w.subtract=G,a.polygons.push(w),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,_))})}},clearSelect:b}},{"../../components/color":43,"../../components/fx":85,"../../components/fx/helpers":82,"../../lib/polygon":175,"../../lib/throttle":185,"../../registry":245,"../sort_modules":244,"./axis_ids":208,"./constants":210,polybooljs:16}],223:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=i.cleanNumber,l=i.ms2DateTime,s=i.dateTime2ms,c=i.ensureNumber,u=t("../../constants/numerical"),f=u.FP_SAFE,d=u.BADNUM,p=t("./constants"),h=t("./axis_ids");function g(t){return Math.pow(10,t)}e.exports=function(t,e){e=e||{};var r=(t._id||"x").charAt(0),u=10;function v(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],a=t.range[1];return.5*(n+a-3*u*Math.abs(n-a))}return d}function y(e,r,n){var i=s(e,n||t.calendar);if(i===d){if(!a(e))return d;i=s(new Date(+e))}return i}function m(e,r,n){return l(e,r,n||t.calendar)}function x(e){return t._categories[Math.round(e)]}function b(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(a(e))return+e}function _(e){return a(e)?n.round(t._b+t._m*e,2):d}function w(e){return(e-t._b)/t._m}t.c2l="log"===t.type?v:c,t.l2c="log"===t.type?g:c,t.l2p=_,t.p2l=w,t.c2p="log"===t.type?function(t,e){return _(v(t,e))}:_,t.p2c="log"===t.type?function(t){return g(w(t))}:w,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=o,t.c2d=t.c2r=t.l2d=t.l2r=c,t.d2p=t.r2p=function(e){return t.l2p(o(e))},t.p2d=t.p2r=w,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return v(o(t),e)},t.r2d=t.r2c=function(t){return g(o(t))},t.d2c=t.r2l=o,t.c2d=t.l2r=c,t.c2r=v,t.l2d=g,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return g(w(t))},t.r2p=function(e){return t.l2p(o(e))},t.p2r=w,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=y,t.c2d=t.c2r=t.l2d=t.l2r=m,t.d2p=t.r2p=function(e,r,n){return t.l2p(y(e,0,n))},t.p2d=t.p2r=function(t,e,r){return m(w(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,d,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=function(e){if(null!=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 d},t.r2d=t.c2d=t.l2d=x,t.d2r=t.d2l_noadd=b,t.r2c=function(e){var r=b(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=b,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return x(w(t))},t.r2p=t.d2p,t.p2r=w,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(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 o,l,s=i.nestedProperty(t,e).get();if(l=(l="date"===t.type?i.dfltRange(t.calendar):"y"===r?p.DFLTRANGEY:n.dfltRange||p.DFLTRANGEX).slice(),s&&2===s.length)for("date"===t.type&&(s[0]=i.cleanDate(s[0],d,t.calendar),s[1]=i.cleanDate(s[1],d,t.calendar)),o=0;o<2;o++)if("date"===t.type){if(!i.isDateTime(s[o],t.calendar)){t[e]=l;break}if(t.r2l(s[0])===t.r2l(s[1])){var c=i.constrain(t.r2l(s[0]),i.MIN_MS+1e3,i.MAX_MS-1e3);s[0]=t.l2r(c-1e3),s[1]=t.l2r(c+1e3);break}}else{if(!a(s[o])){if(!a(s[1-o])){t[e]=l;break}s[o]=s[1-o]*(o?10:.1)}if(s[o]<-f?s[o]=-f:s[o]>f&&(s[o]=f),s[0]===s[1]){var u=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=u,s[1]+=u}}else i.nestedProperty(t,e).set(l)},t.setScale=function(n){var a=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var i=h.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var o=n&&t._r?"_r":"range",l=t.calendar;t.cleanRange(o);var s=t.r2l(t[o][0],l),c=t.r2l(t[o][1],l);if("y"===r?(t._offset=a.t+(1-t.domain[1])*a.h,t._length=a.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-c),t._b=-t._m*c):(t._offset=a.l+t.domain[0]*a.w,t._length=a.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b))throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.makeCalcdata=function(e,r){var n,a,o,l,s=t.type,c="date"===s&&e[r+"calendar"];if(r in e){if(n=e[r],l=e._length||n.length,i.isTypedArray(n)&&("linear"===s||"log"===s)){if(l===n.length)return n;if(n.subarray)return n.subarray(0,l)}for(a=new Array(l),o=0;o<l;o++)a[o]=t.d2c(n[o],0,c)}else{var u=r+"0"in e?t.d2c(e[r+"0"],0,c):0,f=e["d"+r]?Number(e["d"+r]):1;for(n=e[{x:"y",y:"x"}[r]],l=e._length||n.length,a=new Array(l),o=0;o<l;o++)a[o]=u+o*f}return a},t.isValidRange=function(e){return Array.isArray(e)&&2===e.length&&a(t.r2l(e[0]))&&a(t.r2l(e[1]))},t.isPtWithinRange=function(e,n){var a=t.c2l(e[r],null,n),i=t.r2l(t.range[0]),o=t.r2l(t.range[1]);return i<o?i<=a&&a<=o:o<=a&&a<=i},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 k=e._d3locale;"date"===t.type&&(t._dateFormat=k?k.timeFormat.utc:n.time.format.utc,t._extraFormat=e._extraFormat),t._separators=e.separators,t._numFormat=k?k.numberFormat:n.format,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":145,"../../lib":163,"./axis_ids":208,"./constants":210,d3:7,"fast-isnumeric":10}],224:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r,i,o){var l=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",l),r("ticksuffix",o.tickSuffixDflt)&&r("showticksuffix",l),r("showticklabels")){var s=o.font||{},c=e.color===t.color?e.color:s.color;if(n.coerceFont(r,"tickfont",{family:s.family,size:s.size,color:c}),r("tickangle"),"category"!==i){var u=r("tickformat");!function(t,e){var r,i,o=t.tickformatstops,l=e.tickformatstops=[];if(!Array.isArray(o))return;function s(t,e){return n.coerce(r,i,a.tickformatstops,t,e)}for(var c=0;c<o.length;c++)r=o[c],i={},s("dtickrange"),s("value"),l.push(i)}(t,e),u||"date"===i||(r("showexponent",l),r("exponentformat"),r("separatethousands"))}}}},{"../../lib":163,"./layout_attributes":217}],225:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r,i){var o=n.coerce2(t,e,a,"ticklen"),l=n.coerce2(t,e,a,"tickwidth"),s=n.coerce2(t,e,a,"tickcolor",e.color);r("ticks",i.outerTicks||o||l||s?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":163,"./layout_attributes":217}],226:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r,o){var l="auto";"array"!==t.tickmode||"log"!==o&&"date"!==o||(t.tickmode="auto"),Array.isArray(t.tickvals)?l="array":t.dtick&&(l="linear");var s=r("tickmode",l);if("auto"===s)r("nticks");else if("linear"===s){var c="date"===o?i:1,u=r("dtick",c);if(n(u))e.dtick=u>0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),d=u.substr(1);((d=n(d)?Number(d):0)<=0||!("date"===o&&"M"===f&&d===Math.round(d)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===d||2===d)))&&(e.dtick=c)}var p="date"===o?a.dateTick0(e.calendar):0,h=r("tick0",p);"date"===o?e.tick0=a.cleanDate(h,p):n(h)&&"D1"!==u&&"D2"!==u?e.tick0=Number(h):e.tick0=p}else{void 0===r("tickvals")?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":145,"../../lib":163,"fast-isnumeric":10}],227:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../components/drawing"),o=t("./axes"),l=t("./constants").attrRegex;e.exports=function(t,e,r,s){var c=t._fullLayout,u=[];var f,d,p,h,g=function(t){var e,r,n,a,i={};for(e in t)if((r=e.split("."))[0].match(l)){var o=e.charAt(0),s=r[0];if(n=c[s],a={},Array.isArray(t[e])?a.to=t[e].slice(0):Array.isArray(t[e].range)&&(a.to=t[e].range.slice(0)),!a.to)continue;a.axisName=s,a.length=n._length,u.push(o),i[o]=a}return i}(e),v=Object.keys(g),y=function(t,e,r){var n,a,i,o=t._plots,l=[];for(n in o){var s=o[n];if(-1===l.indexOf(s)){var c=s.xaxis._id,u=s.yaxis._id,f=s.xaxis.range,d=s.yaxis.range;s.xaxis._r=s.xaxis.range.slice(),s.yaxis._r=s.yaxis.range.slice(),a=r[c]?r[c].to:f,i=r[u]?r[u].to:d,f[0]===a[0]&&f[1]===a[1]&&d[0]===i[0]&&d[1]===i[1]||-1===e.indexOf(c)&&-1===e.indexOf(u)||l.push(s)}}return l}(c,v,g);if(!y.length)return function(){function e(e,r,n){for(var a=0;a<e.length;a++)if(r(t,a),n)return}e(c.annotations||[],a.getComponentMethod("annotations","drawOne")),e(c.shapes||[],a.getComponentMethod("shapes","drawOne")),e(c.images||[],a.getComponentMethod("images","draw"),!0)}(),!1;function m(t){var e=t.xaxis,r=t.yaxis;c._defs.select("#"+t.clipId+"> rect").call(i.setTranslate,0,0).call(i.setScale,1,1),t.plot.call(i.setTranslate,e._offset,r._offset).call(i.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(i.setPointGroupScale,1,1),n.selectAll(".textpoint").call(i.setTextPointsScale,1,1),n.call(i.hideOutsideRangePoints,t)}function x(e,r){var n,l,s,u=g[e.xaxis._id],f=g[e.yaxis._id],d=[];if(u){l=(n=t._fullLayout[u.axisName])._r,s=u.to,d[0]=(l[0]*(1-r)+r*s[0]-l[0])/(l[1]-l[0])*e.xaxis._length;var p=l[1]-l[0],h=s[1]-s[0];n.range[0]=l[0]*(1-r)+r*s[0],n.range[1]=l[1]*(1-r)+r*s[1],d[2]=e.xaxis._length*(1-r+r*h/p)}else d[0]=0,d[2]=e.xaxis._length;if(f){l=(n=t._fullLayout[f.axisName])._r,s=f.to,d[1]=(l[1]*(1-r)+r*s[1]-l[1])/(l[0]-l[1])*e.yaxis._length;var v=l[1]-l[0],y=s[1]-s[0];n.range[0]=l[0]*(1-r)+r*s[0],n.range[1]=l[1]*(1-r)+r*s[1],d[3]=e.yaxis._length*(1-r+r*y/v)}else d[1]=0,d[3]=e.yaxis._length;!function(e,r){var n,i=[];for(i=[e._id,r._id],n=0;n<i.length;n++)o.doTicksSingle(t,i[n],!0);function l(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}}l(c.annotations||[],a.getComponentMethod("annotations","drawOne")),l(c.shapes||[],a.getComponentMethod("shapes","drawOne")),l(c.images||[],a.getComponentMethod("images","draw"),!0)}(e.xaxis,e.yaxis);var m=e.xaxis,x=e.yaxis,b=!!u,_=!!f,w=b?m._length/d[2]:1,k=_?x._length/d[3]:1,M=b?d[0]:0,A=_?d[1]:0,T=b?d[0]/d[2]*m._length:0,L=_?d[1]/d[3]*x._length:0,S=m._offset-T,C=x._offset-L;e.clipRect.call(i.setTranslate,M,A).call(i.setScale,1/w,1/k),e.plot.call(i.setTranslate,S,C).call(i.setScale,w,k),i.setPointGroupScale(e.zoomScalePts,1/w,1/k),i.setTextPointsScale(e.zoomScaleTxt,1/w,1/k)}s&&(f=s());var b=n.ease(r.easing);return t._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(h),h=null,function(){for(var e={},r=0;r<v.length;r++){var n=t._fullLayout[v[r]+"axis"];e[n._name+".range[0]"]=n.range[0],e[n._name+".range[1]"]=n.range[1],n.range=n._r.slice()}return a.call("relayout",t,e).then(function(){for(var t=0;t<y.length;t++)m(y[t])})}()}),d=Date.now(),h=window.requestAnimationFrame(function e(){p=Date.now();for(var n=Math.min(1,(p-d)/r.duration),i=b(n),o=0;o<y.length;o++)x(y[o],i);p-d>r.duration?(function(){for(var e={},r=0;r<v.length;r++){var n=t._fullLayout[g[v[r]].axisName],i=g[v[r]].to;e[n._name+".range[0]"]=i[0],e[n._name+".range[1]"]=i[1],n.range=i.slice()}f&&f(),a.call("relayout",t,e).then(function(){for(var t=0;t<y.length;t++)m(y[t])})}(),h=window.cancelAnimationFrame(e)):h=window.requestAnimationFrame(e)}),Promise.resolve()}},{"../../components/drawing":68,"../../registry":245,"./axes":205,"./constants":210,d3:7}],228:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./axis_autotype"),i=t("./axis_ids").name2id;function o(t){return{v:"x",h:"y"}[t.orientation||"v"]}function l(t,e){var r=o(t),a=n.traceIs(t,"box-violin"),i=n.traceIs(t._fullInput||{},"candlestick");return a&&!i&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s,c){c&&(e._name=c,e._id=i(c)),"-"===r("type")&&(!function(t,e){if("-"!==t.type)return;var r=t._id,i=r.charAt(0);-1!==r.indexOf("scene")&&(r=i);var s=function(t,e,r){for(var n=0;n<t.length;n++){var a=t[n];if("splom"===a.type&&a._length>0&&a["_"+r+"axes"][e])return a;if((a[r+"axis"]||r)===e){if(l(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(e,r,i);if(!s)return;if("histogram"===s.type&&i==={v:"y",h:"x"}[s.orientation||"v"])return void(t.type="linear");var c,u=i+"calendar",f=s[u];if(l(s,i)){var d=o(s),p=[];for(c=0;c<e.length;c++){var h=e[c];n.traceIs(h,"box-violin")&&(h[i+"axis"]||i)===r&&(void 0!==h[d]?p.push(h[d][0]):void 0!==h.name?p.push(h.name):p.push("text"),h[u]!==f&&(f=void 0))}t.type=a(p,f)}else if("splom"===s.type){var g=s.dimensions;for(c=0;c<g.length;c++){var v=g[c];if(v.visible){t.type=a(v.values,f);break}}}else t.type=a(s[i]||[s[i+"0"]],f)}(e,s),"-"===e.type?e.type="linear":t.type=e.type)}},{"../../registry":245,"./axis_autotype":206,"./axis_ids":208}],229:[function(t,e,r){"use strict";var n=t("../registry"),a=t("../lib");function i(t,e,r){var n,i,o,l=!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=a.nestedProperty(n,e.prop).get(),(o=r[e.type]=r[e.type]||{}).hasOwnProperty(e.prop)&&o[e.prop]!==i&&(l=!0),o[e.prop]=i,{changed:l,value:i}}function o(t,e){var r=[],n=e[0],i={};if("string"==typeof n)i[n]=e[1];else{if(!a.isPlainObject(n))return r;i=n}return s(i,function(t,e,n){r.push({type:"layout",prop:t,value:n})},"",0),r}function l(t,e){var r,n,i,o,l=[];if(n=e[0],i=e[1],r=e[2],o={},"string"==typeof n)o[n]=i;else{if(!a.isPlainObject(n))return l;o=n,void 0===r&&(r=i)}return void 0===r&&(r=null),s(o,function(e,n,a){var i;if(Array.isArray(a)){var o=Math.min(a.length,t.data.length);r&&(o=Math.min(o,r.length)),i=[];for(var s=0;s<o;s++)i[s]=r?r[s]:s}else i=r?r.slice(0):null;if(null===i)Array.isArray(a)&&(a=a[0]);else if(Array.isArray(i)){if(!Array.isArray(a)){var c=a;a=[];for(var u=0;u<i.length;u++)a[u]=c}a.length=Math.min(i.length,a.length)}l.push({type:"data",prop:e,traces:i,value:a})},"",0),l}function s(t,e,r,n){Object.keys(t).forEach(function(i){var o=t[i];if("_"!==i[0]){var l=r+(n>0?".":"")+i;a.isPlainObject(o)?s(o,e,l,n+1):e(l,i,o)}})}r.manageCommandObserver=function(t,e,n,o){var l={},s=!0;e&&e._commandObserver&&(l=e._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,n,l.lookupTable);if(e&&e._commandObserver){if(c)return l;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,l}if(c){i(t,c,l.cache),l.check=function(){if(s){var e=i(t,c,l.cache);return e.changed&&o&&void 0!==l.lookupTable[e.value]&&(l.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[e.value]})).then(l.enable,l.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f<u.length;f++)t._internalOn(u[f],l.check);l.remove=function(){for(var e=0;e<u.length;e++)t._removeInternalListener(u[e],l.check)}}else a.log("Unable to automatically bind plot updates to API command"),l.lookupTable={},l.remove=function(){};return l.disable=function(){s=!1},l.enable=function(){s=!0},e&&(e._commandObserver=l),l},r.hasSimpleAPICommandBindings=function(t,e,n){var a,i,o=e.length;for(a=0;a<o;a++){var l,s=e[a],c=s.method,u=s.args;if(Array.isArray(u)||(u=[]),!c)return!1;var f=r.computeAPICommandBindings(t,c,u);if(1!==f.length)return!1;if(i){if((l=f[0]).type!==i.type)return!1;if(l.prop!==i.prop)return!1;if(Array.isArray(i.traces)){if(!Array.isArray(l.traces))return!1;l.traces.sort();for(var d=0;d<i.traces.length;d++)if(i.traces[d]!==l.traces[d])return!1}else if(l.prop!==i.prop)return!1}else i=f[0],Array.isArray(i.traces)&&i.traces.sort();var p=(l=f[0]).value;if(Array.isArray(p)){if(1!==p.length)return!1;p=p[0]}n&&(n[p]=a)}return i},r.executeAPICommand=function(t,e,r){if("skip"===e)return Promise.resolve();var i=n.apiMethodRegistry[e],o=[t];Array.isArray(r)||(r=[]);for(var l=0;l<r.length;l++)o.push(r[l]);return i.apply(null,o).catch(function(t){return a.warn("API call to Plotly."+e+" rejected.",t),Promise.reject(t)})},r.computeAPICommandBindings=function(t,e,r){var n;switch(Array.isArray(r)||(r=[]),e){case"restyle":n=l(t,r);break;case"relayout":n=o(t,r);break;case"update":n=l(t,[r[0],r[2]]).concat(o(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}},{"../lib":163,"../registry":245}],230:[function(t,e,r){"use strict";var n=t("../lib/extend").extendFlat;r.attributes=function(t,e){e=e||{};var r={valType:"info_array",editType:(t=t||{}).editType,items:[{valType:"number",min:0,max:1,editType:t.editType},{valType:"number",min:0,max:1,editType:t.editType}],dflt:[0,1]},a=(t.name&&t.name,t.trace,e.description&&e.description,{x:n({},r,{}),y:n({},r,{}),editType:t.editType});return t.noGridCell||(a.row={valType:"integer",min:0,dflt:0,editType:t.editType},a.column={valType:"integer",min:0,dflt:0,editType:t.editType}),a},r.defaults=function(t,e,r,n){var a=n&&n.x||[0,1],i=n&&n.y||[0,1],o=e.grid;if(o){var l=r("domain.column");void 0!==l&&(l<o.columns?a=o._domains.x[l]:delete t.domain.column);var s=r("domain.row");void 0!==s&&(s<o.rows?i=o._domains.y[s]:delete t.domain.row)}r("domain.x",a),r("domain.y",i)}},{"../lib/extend":157}],231:[function(t,e,r){"use strict";e.exports=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}},{}],232:[function(t,e,r){"use strict";e.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}},{}],233:[function(t,e,r){"use strict";var n=t("../registry"),a=t("./cartesian/constants").SUBPLOT_PATTERN;r.getSubplotCalcData=function(t,e,r){var a=n.subplotsRegistry[e];if(!a)return[];for(var i=a.attr,o=[],l=0;l<t.length;l++){var s=t[l];s[0].trace[i]===r&&o.push(s)}return o},r.getModuleCalcData=function(t,e){var r,a=[],i=[];if(!(r="string"==typeof e?n.getModule(e).plot:"function"==typeof e?e:e.plot))return[a,t];for(var o=0;o<t.length;o++){var l=t[o],s=l[0].trace;!0===s.visible&&(s._module.plot===r?a.push(l):i.push(l))}return[a,i]},r.getSubplotData=function(t,e,r){if(!n.subplotsRegistry[e])return[];var i,o,l,s=n.subplotsRegistry[e].attr,c=[];if("gl2d"===e){var u=r.match(a);o="x"+u[1],l="y"+u[2]}for(var f=0;f<t.length;f++)i=t[f],"gl2d"===e&&n.traceIs(i,"gl2d")?i[s[0]]===o&&i[s[1]]===l&&c.push(i):i[s]===r&&c.push(i);return c},r.getUidsFromCalcData=function(t){for(var e={},r=0;r<t.length;r++){e[t[r][0].trace.uid]=1}return e}},{"../registry":245,"./cartesian/constants":210}],234:[function(t,e,r){"use strict";function n(t,e){var r,n,a=[0,0,0,0];for(r=0;r<4;++r)for(n=0;n<4;++n)a[n]+=t[4*r+n]*e[r];return a}e.exports=function(t,e){return n(t.projection,n(t.view,n(t.model,[e[0],e[1],e[2],1])))}},{}],235:[function(t,e,r){"use strict";var n=t("./font_attributes"),a=t("../components/color/attributes"),i=n({editType:"calc"});i.family.dflt='"Open Sans", verdana, arial, sans-serif',i.size.dflt=12,i.color.dflt=a.defaultLine,e.exports={font:i,title:{valType:"string",editType:"layoutstyle"},titlefont:n({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:a.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:a.background,editType:"layoutstyle"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:a.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"}}},{"../components/color/attributes":42,"./font_attributes":231}],236:[function(t,e,r){"use strict";e.exports={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"}},{}],237:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../registry"),o=t("../plot_api/plot_schema"),l=t("../lib"),s=t("../components/color"),c=t("../constants/numerical").BADNUM,u=t("../plots/cartesian/axis_ids"),f=t("./sort_modules").sortBasePlotModules,d=t("./animation_attributes"),p=t("./frame_attributes"),h=l.relinkPrivateKeys,g=l._,v=e.exports={};l.extendFlat(v,i),v.attributes=t("./attributes"),v.attributes.type.values=v.allTypes,v.fontAttrs=t("./font_attributes"),v.layoutAttributes=t("./layout_attributes"),v.fontWeight="normal";var y=v.transformsRegistry,m=t("./command");v.executeAPICommand=m.executeAPICommand,v.computeAPICommandBindings=m.computeAPICommandBindings,v.manageCommandObserver=m.manageCommandObserver,v.hasSimpleAPICommandBindings=m.hasSimpleAPICommandBindings,v.redrawText=function(t){if(!((t=l.getGraphDiv(t)).data&&t.data[0]&&t.data[0].r))return new Promise(function(e){setTimeout(function(){i.getComponentMethod("annotations","draw")(t),i.getComponentMethod("legend","draw")(t),(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()}),e(v.previousPromises(t))},300)})},v.resize=function(t){return t=l.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,i.call("relayout",t,{autosize:!0}).then(function(){t.changed=r,e(t)})}},100)})},v.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then(function(){t._promises=[]})},v.addLinks=function(t){if(t._context.showLink||t._context.showSources){var e=t._fullLayout,r=l.ensureSingle(e._paper,"text","js-plot-link-container",function(t){t.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:s.defaultLine,"pointer-events":"all"}).each(function(){var t=n.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)})}),a=r.node(),i={y:e._paper.attr("height")-9};document.body.contains(a)&&a.getComputedTextLength()>=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),c=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",function(){v.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(t,o),c.text(o.text()&&u.text()?" - ":"")}},v.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(t,!1,"keepdata"),a.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1};var x,b=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],_=["year","month","dayMonth","dayMonthYear"];function w(t,e){var r=t._context.locale,n=!1,a={};function o(t){for(var r=!0,i=0;i<e.length;i++){var o=e[i];a[o]||(t[o]?a[o]=t[o]:r=!1)}r&&(n=!0)}for(var l=0;l<2;l++){for(var s=t._context.locales,c=0;c<2;c++){var u=(s[r]||{}).format;if(u&&(o(u),n))break;s=i.localeRegistry}var f=r.split("-")[0];if(n||f===r)break;r=f}return n||o(i.localeRegistry.en.format),a}function k(t,e,r,n){for(var a=t.transforms,i=[t],o=0;o<a.length;o++){var l=a[o],s=y[l.type];s&&s.transform&&(i=s.transform(i,{transform:l,fullTrace:t,fullData:e,layout:r,fullLayout:n,transformIndex:o}))}return i}function M(t){for(var e=0;e<t.length;e++)t[e].clearCalc()}v.supplyDefaults=function(t,e){var r=e&&e.skipUpdateCalc,a=t._fullLayout||{};if(a._skipDefaults)delete a._skipDefaults;else{var o,s=t._fullLayout={},c=t.layout||{},d=t._fullData||[],p=t._fullData=[],y=t.data||[],m=t.calcdata||[],k=t._context||{};t._transitionData||v.createTransitionData(t),s._dfltTitle={plot:g(t,"Click to enter Plot title"),x:g(t,"Click to enter X axis title"),y:g(t,"Click to enter Y axis title"),colorbar:g(t,"Click to enter Colorscale title"),annotation:g(t,"new text")},s._traceWord=g(t,"trace");var M=w(t,b);if(s._mapboxAccessToken=k.mapboxAccessToken,a._initialAutoSizeIsDone){var A=a.width,T=a.height;v.supplyLayoutGlobalDefaults(c,s,M),c.width||(s.width=A),c.height||(s.height=T)}else{v.supplyLayoutGlobalDefaults(c,s,M);var L=!c.width||!c.height,S=s.autosize,C=k.autosizable;L&&(S||C)?v.plotAutoSize(t,c,s):L&&v.sanitizeMargins(t),!S&&L&&(c.width=s.width,c.height=s.height)}s._d3locale=function(t,e){return t.decimal=e.charAt(0),t.thousands=e.charAt(1),n.locale(t)}(M,s.separators),s._extraFormat=w(t,_),s._initialAutoSizeIsDone=!0,s._dataLength=y.length,s._modules=[],s._basePlotModules=[];var O=s._subplots=function(){var t,e,r={};if(!x){x=[];var n=i.subplotsRegistry;for(var a in n){var o=n[a],s=o.attr;if(s&&(x.push(a),Array.isArray(s)))for(e=0;e<s.length;e++)l.pushUnique(x,s[e])}}for(t=0;t<x.length;t++)r[x[t]]=[];return r}(),P=s._splomAxes={x:{},y:{}},z=s._splomSubplots={};s._splomGridDflt={},s._requestRangeslider={},s._globalTransforms=(t._context||{}).globalTransforms,v.supplyDataDefaults(y,p,c,s);var D=Object.keys(P.x),E=Object.keys(P.y);if(D.length>1&&E.length>1){for(i.getComponentMethod("grid","sizeDefaults")(c,s),o=0;o<D.length;o++)l.pushUnique(O.xaxis,D[o]);for(o=0;o<E.length;o++)l.pushUnique(O.yaxis,E[o]);for(var N in z)l.pushUnique(O.cartesian,N)}s._has=v._hasPlotType.bind(s);var R=s._modules;for(o=0;o<R.length;o++){var I=R[o];I.cleanData&&I.cleanData(p)}if(d.length===p.length)for(o=0;o<p.length;o++)h(p[o],d[o]);v.supplyLayoutModuleDefaults(c,s,p,t._transitionData),s._hasOnlyLargeSploms=1===s._basePlotModules.length&&"splom"===s._basePlotModules[0].name&&D.length>15&&E.length>15&&0===s.shapes.length&&0===s.images.length,s._hasCartesian=s._has("cartesian"),s._hasGeo=s._has("geo"),s._hasGL3D=s._has("gl3d"),s._hasGL2D=s._has("gl2d"),s._hasTernary=s._has("ternary"),s._hasPie=s._has("pie"),v.linkSubplots(p,s,d,a),v.cleanPlot(p,s,d,a,m),h(s,a),v.doAutoMargin(t);var F=u.list(t);for(o=0;o<F.length;o++){F[o].setScale()}r||m.length!==p.length||v.supplyDefaultsUpdateCalc(m,p),s._basePlotModules.sort(f)}},v.supplyDefaultsUpdateCalc=function(t,e){for(var r=0;r<e.length;r++){var n=e[r],a=t[r][0];if(a&&a.trace){var i=a.trace;if(i._hasCalcTransform){var o,s,c,u=i._arrayAttrs;for(o=0;o<u.length;o++)s=u[o],c=l.nestedProperty(i,s).get().slice(),l.nestedProperty(n,s).set(c)}a.trace=n}}},v.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=[])},v._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 a=n[e].name;if(a===t)return!0;var o=i.modules[a];if(o&&o.categories[t])return!0}return!1},v.cleanPlot=function(t,e,r,n,a){var i,o,l=n._basePlotModules||[];for(i=0;i<l.length;i++){var s=l[i];s.clean&&s.clean(t,e,r,n,a)}var c=n._has&&n._has("gl"),u=e._has&&e._has("gl");c&&!u&&void 0!==n._glcontainer&&(n._glcontainer.selectAll(".gl-canvas").remove(),n._glcanvas=null);var f=!!n._infolayer;t:for(i=0;i<r.length;i++){var d=r[i].uid;for(o=0;o<t.length;o++){if(d===t[o].uid)continue t}f&&n._infolayer.select(".cb"+d).remove()}n._zoomlayer&&n._zoomlayer.selectAll(".select-outline").remove()},v.linkSubplots=function(t,e,r,n){var a,i,o,l,s=n._plots||{},c=e._plots={},f=e._subplots,d={_fullData:t,_fullLayout:e},p=f.cartesian.concat(f.gl2d||[]);for(a=0;a<p.length;a++){var h,g=s[o=p[a]],v=u.getFromId(d,o,"x"),y=u.getFromId(d,o,"y");for(g?((h=c[o]=g).xaxis.layer!==v.layer&&(h.xlines.attr("d",null),h.xaxislayer.selectAll("*").remove()),h.yaxis.layer!==y.layer&&(h.ylines.attr("d",null),h.yaxislayer.selectAll("*").remove())):(h=c[o]={}).id=o,h.xaxis=v,h.yaxis=y,h._hasClipOnAxisFalse=!1,i=0;i<t.length;i++){var m=t[i];if(m.xaxis===h.xaxis._id&&m.yaxis===h.yaxis._id&&!1===m.cliponaxis){h._hasClipOnAxisFalse=!0;break}}}var x=u.list(d,null,!0);for(a=0;a<x.length;a++){var b=null;(l=x[a]).overlaying&&(b=u.getFromId(d,l.overlaying))&&b.overlaying&&(l.overlaying=!1,b=null),l._mainAxis=b||l,b&&(l.domain=b.domain.slice()),l._anchorAxis="free"===l.anchor?null:u.getFromId(d,l.anchor)}},v.clearExpandedTraceDefaultColors=function(t){var e,r,n;for(r=[],(e=t._module._colorAttrs)||(t._module._colorAttrs=e=[],o.crawl(t._module.attributes,function(t,n,a,i){r[i]=n,r.length=i+1,"color"===t.valType&&void 0===t.dflt&&e.push(r.join("."))})),n=0;n<e.length;n++){l.nestedProperty(t,"_input."+e[n]).get()||l.nestedProperty(t,e[n]).set(null)}},v.supplyDataDefaults=function(t,e,r,n){var a,o,s,c=n._modules,u=n._basePlotModules,f=0,d=0;function p(t){e.push(t);var r=t._module;r&&(!0===t.visible&&l.pushUnique(c,r),l.pushUnique(u,t._module.basePlotModule),f++,!1!==t._input.visible&&d++)}n._transformModules=[];var g={},y=[];for(a=0;a<t.length;a++){if(s=t[a],(o=v.supplyTraceDefaults(s,d,n,a)).index=a,o._input=s,o._expandedIndex=f,o.transforms&&o.transforms.length)for(var m=k(o,e,r,n),x=0;x<m.length;x++){var b=m[x],_=v.supplyTraceDefaults(b,f,n,a);h(_,b),b.uid=_.uid=o.uid+x,_.index=a,_._input=s,_._fullInput=o,_._expandedIndex=f,_._expandedInput=b,p(_)}else o._fullInput=o,o._expandedInput=o,p(o);i.traceIs(o,"carpetAxis")&&(g[o.carpet]=o),i.traceIs(o,"carpetDependent")&&y.push(a)}for(a=0;a<y.length;a++)if((o=e[y[a]]).visible){var w=g[o.carpet];o._carpet=w,w&&w.visible?(o.xaxis=w.xaxis,o.yaxis=w.yaxis):o.visible=!1}},v.supplyAnimationDefaults=function(t){var e;t=t||{};var r={};function n(e,n){return l.coerce(t||{},r,d,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]=v.supplyAnimationFrameDefaults(t.frame[e]||{});else r.frame=v.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(r.transition=[],e=0;e<t.transition.length;e++)r.transition[e]=v.supplyAnimationTransitionDefaults(t.transition[e]||{});else r.transition=v.supplyAnimationTransitionDefaults(t.transition||{});return r},v.supplyAnimationFrameDefaults=function(t){var e={};function r(r,n){return l.coerce(t||{},e,d.frame,r,n)}return r("duration"),r("redraw"),e},v.supplyAnimationTransitionDefaults=function(t){var e={};function r(r,n){return l.coerce(t||{},e,d.transition,r,n)}return r("duration"),r("easing"),e},v.supplyFrameDefaults=function(t){var e={};function r(r,n){return l.coerce(t,e,p,r,n)}return r("group"),r("name"),r("traces"),r("baseframe"),r("data"),r("layout"),e},v.supplyTraceDefaults=function(t,e,r,n){var a,o=r.colorway||s.defaults,c={},u=o[e%o.length];function f(e,r){return l.coerce(t,c,v.attributes,e,r)}var d=f("visible");f("type"),f("uid"),f("name",r._traceWord+" "+n);var p=v.getModule(c);if(c._module=p,p){var h=p.basePlotModule,g=h.attr,y=h.attributes;if(g&&y){var m=r._subplots,x="";if("gl2d"!==h.name||d){if(Array.isArray(g))for(a=0;a<g.length;a++){var b=g[a],_=l.coerce(t,c,y,b);m[b]&&l.pushUnique(m[b],_),x+=_}else x=l.coerce(t,c,y,g);m[h.name]&&l.pushUnique(m[h.name],x)}}}return d&&(f("customdata"),f("ids"),i.traceIs(c,"showLegend")&&(f("showlegend"),f("legendgroup")),i.getComponentMethod("fx","supplyDefaults")(t,c,u,r),p&&(p.supplyDefaults(t,c,u,r),l.coerceHoverinfo(t,c,r)),i.traceIs(c,"noOpacity")||f("opacity"),i.traceIs(c,"notLegendIsolatable")&&(c.visible=!!c.visible),p&&p.selectPoints&&f("selectedpoints"),v.supplyTransformDefaults(t,c,r)),c},v.supplyTransformDefaults=function(t,e,r){if(e._length||function(t){var e=t.transforms;if(Array.isArray(e)&&e.length)for(var r=0;r<e.length;r++){var n=y[e[r].type];if(n&&n.makesData)return!0}return!1}(t)){var n=r._globalTransforms||[],a=r._transformModules||[];if(Array.isArray(t.transforms)||0!==n.length)for(var i=t.transforms||[],o=n.concat(i),s=e.transforms=[],c=0;c<o.length;c++){var u,f=o[c],d=f.type,p=y[d],h=!(f._module&&f._module===p),g=p&&"function"==typeof p.transform;p||l.warn("Unrecognized transform type "+d+"."),p&&p.supplyDefaults&&(h||g)?((u=p.supplyDefaults(f,e,r,t)).type=d,u._module=p,l.pushUnique(a,p)):u=l.extendFlat({},f),s.push(u)}}},v.supplyLayoutGlobalDefaults=function(t,e,r){function n(r,n){return l.coerce(t,e,v.layoutAttributes,r,n)}var a=l.coerceFont(n,"font");n("title",e._dfltTitle.plot),l.coerceFont(n,"titlefont",{family:a.family,size:Math.round(1.4*a.size),color:a.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&&v.sanitizeMargins(e),i.getComponentMethod("grid","sizeDefaults")(t,e),n("paper_bgcolor"),n("separators",r.decimal+r.thousands),n("hidesources"),n("colorway"),n("datarevision"),i.getComponentMethod("calendars","handleDefaults")(t,e,"calendar"),i.getComponentMethod("fx","supplyLayoutGlobalDefaults")(t,e,n)},v.plotAutoSize=function(t,e,r){var n,i,o=t._context||{},s=o.frameMargins,c=l.isPlotDiv(t);if(c&&t.emit("plotly_autosize"),o.fillFrame)n=window.innerWidth,i=window.innerHeight,document.body.style.overflow="hidden";else if(a(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),f=u.left+u.right,d=u.bottom+u.top,p=1-2*s,h=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(p*(h.width-f)),i=Math.round(p*(h.height-d))}else{var g=c?window.getComputedStyle(t):{};n=parseFloat(g.width)||r.width,i=parseFloat(g.height)||r.height}var y=v.layoutAttributes.width.min,m=v.layoutAttributes.height.min;n<y&&(n=y),i<m&&(i=m);var x=!e.width&&Math.abs(r.width-n)>1,b=!e.height&&Math.abs(r.height-i)>1;(b||x)&&(x&&(r.width=n),b&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),v.sanitizeMargins(r)},v.supplyLayoutModuleDefaults=function(t,e,r,n){var a,o,s,c=i.componentsRegistry,u=e._basePlotModules,f=i.subplotsRegistry.cartesian;for(a in c)(s=c[a]).includeBasePlot&&s.includeBasePlot(t,e);for(var d in u.length||u.push(f),e._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[d].sort(l.subplotSort);for(o=0;o<u.length;o++)(s=u[o]).supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r);var p=e._modules;for(o=0;o<p.length;o++)(s=p[o]).supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r);var h=e._transformModules;for(o=0;o<h.length;o++)(s=h[o]).supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r,n);for(a in c)(s=c[a]).supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r)},v.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)),l.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()},v.style=function(t){var e,r=t._fullLayout._modules,n=[];for(e=0;e<r.length;e++){var a=r[e];a.style&&l.pushUnique(n,a.style)}for(e=0;e<n.length;e++)n[e](t)},v.sanitizeMargins=function(t){if(t&&t.margin){var e,r=t.width,n=t.height,a=t.margin,i=r-(a.l+a.r),o=n-(a.t+a.b);i<0&&(e=(r-1)/(a.l+a.r),a.l=Math.floor(e*a.l),a.r=Math.floor(e*a.r)),o<0&&(e=(n-1)/(a.t+a.b),a.t=Math.floor(e*a.t),a.b=Math.floor(e*a.b))}},v.autoMargin=function(t,e,r){var n=t._fullLayout;if(n._pushmargin||(n._pushmargin={}),!1!==n.margin.autoexpand){if(r){var a=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+a},r:{val:r.x,size:r.r+a},b:{val:r.y,size:r.b+a},t:{val:r.y,size:r.t+a}}}else delete n._pushmargin[e];n._replotting||v.doAutoMargin(t)}},v.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),o=Math.max(e.margin.l||0,0),l=Math.max(e.margin.r||0,0),s=Math.max(e.margin.t||0,0),c=Math.max(e.margin.b||0,0),u=e._pushmargin;if(!1!==e.margin.autoexpand)for(var f in u.base={l:{val:0,size:o},r:{val:1,size:l},t:{val:1,size:s},b:{val:0,size:c}},u){var d=u[f].l||{},p=u[f].b||{},h=d.val,g=d.size,v=p.val,y=p.size;for(var m in u){if(a(g)&&u[m].r){var x=u[m].r.val,b=u[m].r.size;if(x>h){var _=(g*x+(b-e.width)*h)/(x-h),w=(b*(1-h)+(g-e.width)*(1-x))/(x-h);_>=0&&w>=0&&_+w>o+l&&(o=_,l=w)}}if(a(y)&&u[m].t){var k=u[m].t.val,M=u[m].t.size;if(k>v){var A=(y*k+(M-e.height)*v)/(k-v),T=(M*(1-v)+(y-e.height)*(1-k))/(k-v);A>=0&&T>=0&&A+T>c+s&&(c=A,s=T)}}}}if(r.l=Math.round(o),r.r=Math.round(l),r.t=Math.round(s),r.b=Math.round(c),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return i.call("plot",t)},v.graphJson=function(t,e,r,n,a){(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&v.supplyDefaults(t);var i=a?t._fullData:t.data,o=a?t._fullLayout:t.layout,s=(t._transitionData||{})._frames;function c(t){if("function"==typeof t)return null;if(l.isPlainObject(t)){var e,n,a={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!l.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;a[e]=c(t[e])}return a}return Array.isArray(t)?t.map(c):l.isJSDate(t)?l.ms2DateTimeLocal(+t):t}var u={data:(i||[]).map(function(t){var r=c(t);return e&&delete r.fit,r})};return e||(u.layout=c(o)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),s&&(u.frames=c(s)),"object"===n?u:JSON.stringify(u)},v.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r<e.length;r++)switch((n=e[r]).type){case"replace":a=n.value;var l=(i[n.index]||{}).name,s=a.name;i[n.index]=o[s]=a,s!==l&&(delete o[l],o[s]=a);break;case"insert":o[(a=n.value).name]=a,i.splice(n.index,0,a);break;case"delete":delete o[(a=i[n.index]).name],i.splice(n.index,1)}return Promise.resolve()},v.computeFrame=function(t,e){var r,n,a,i,o=t._transitionData._frameHash;if(!e)throw new Error("computeFrame must be given a string frame name");var l=o[e.toString()];if(!l)return!1;for(var s=[l],c=[l.name];l.baseframe&&(l=o[l.baseframe.toString()])&&-1===c.indexOf(l.name);)s.push(l),c.push(l.name);for(var u={};l=s.pop();)if(l.layout&&(u.layout=v.extendLayout(u.layout,l.layout)),l.data){if(u.data||(u.data=[]),!(n=l.traces))for(n=[],r=0;r<l.data.length;r++)n[r]=r;for(u.traces||(u.traces=[]),r=0;r<l.data.length;r++)null!=(a=n[r])&&(-1===(i=u.traces.indexOf(a))&&(i=u.data.length,u.traces[i]=a),u.data[i]=v.extendTrace(u.data[i],l.data[r]))}return u},v.recomputeFrameHash=function(t){for(var e=t._transitionData._frameHash={},r=t._transitionData._frames,n=0;n<r.length;n++){var a=r[n];a&&a.name&&(e[a.name]=a)}},v.extendObjectWithContainers=function(t,e,r){var n,a,i,o,s,c,u,f=l.extendDeepNoArrays({},e||{}),d=l.expandObjectPaths(f),p={};if(r&&r.length)for(i=0;i<r.length;i++)void 0===(a=(n=l.nestedProperty(d,r[i])).get())?l.nestedProperty(p,r[i]).set(null):(n.set(null),l.nestedProperty(p,r[i]).set(a));if(t=l.extendDeepNoArrays(t||{},d),r&&r.length)for(i=0;i<r.length;i++)if(c=l.nestedProperty(p,r[i]).get()){for(u=(s=l.nestedProperty(t,r[i])).get(),Array.isArray(u)||(u=[],s.set(u)),o=0;o<c.length;o++){var h=c[o];u[o]=null===h?null:v.extendObjectWithContainers(u[o],h)}s.set(u)}return t},v.dataArrayContainers=["transforms","dimensions"],v.layoutArrayContainers=i.layoutArrayContainers,v.extendTrace=function(t,e){return v.extendObjectWithContainers(t,e,v.dataArrayContainers)},v.extendLayout=function(t,e){return v.extendObjectWithContainers(t,e,v.layoutArrayContainers)},v.transition=function(t,e,r,n,a,o){var s,c,u=Array.isArray(e)?e.length:0,f=n.slice(0,u),d=[];var p=!1;for(s=0;s<f.length;s++){c=f[s];t._fullData[c]._module}var h=[v.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<f.length;n++){var a=f[n],o=t._fullData[a]._module;o&&(o.animatable&&d.push(a),t.data[f[n]]=v.extendTrace(t.data[f[n]],e[n]))}var s=l.expandObjectPaths(l.extendDeepNoArrays({},r)),c=/^[xy]axis[0-9]*$/;for(var u in s)c.test(u)&&delete s[u].range;return v.extendLayout(t.layout,s),delete t.calcdata,v.supplyDefaults(t),v.doCalcdata(t),i.getComponentMethod("errorbars","calc")(t),Promise.resolve()},v.rehover,function(){return t.emit("plotly_transitioning",[]),new Promise(function(e){t._transitioning=!0,o.duration>0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){p=!0}),a.redraw&&t._transitionData._interruptCallbacks.push(function(){return i.call("redraw",t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var n,s,c=0,u=0;function f(){return c++,function(){var r;u++,p||u!==c||(r=e,t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(a.redraw)return i.call("redraw",t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(r)))}}var h=t._fullLayout._basePlotModules,g=!1;if(r)for(s=0;s<h.length;s++)if(h[s].transitionAxes){var v=l.expandObjectPaths(r);g=h[s].transitionAxes(t,v,o,f)||g}for(g?(n=l.extendFlat({},o)).duration=0:n=o,s=0;s<h.length;s++)h[s].plot(t,d,n,f);setTimeout(f())})}],g=l.syncOrAsync(h,t);return g&&g.then||(g=Promise.resolve()),g.then(function(){return t})},v.doCalcdata=function(t,e){var r,n,a,l,s=u.list(t),f=t._fullData,d=t._fullLayout,p=new Array(f.length),h=(t.calcdata||[]).slice(0);for(t.calcdata=p,t.firstscatter=!0,d._numBoxes=0,d._numViolins=0,d._violinScaleGroupStats={},t._hmpixcount=0,t._hmlumcount=0,d._piecolormap={},d._piecolorway=null,d._piedefaultcolorcount=0,a=0;a<f.length;a++)Array.isArray(e)&&-1===e.indexOf(a)&&(p[a]=h[a]);for(a=0;a<f.length;a++)(r=f[a])._arrayAttrs=o.findArrayAttributes(r);var g=d._subplots.polar||[];for(a=0;a<g.length;a++)s.push(d[g[a]].radialaxis,d[g[a]].angularaxis);M(s);var v=!1;for(a=0;a<f.length;a++)if(!0===(r=f[a]).visible&&r.transforms){if((n=r._module)&&n.calc){var m=n.calc(t,r);m[0]&&m[0].t&&m[0].t._scene&&delete m[0].t._scene.dirty}for(l=0;l<r.transforms.length;l++){var x=r.transforms[l];(n=y[x.type])&&n.calcTransform&&(r._hasCalcTransform=!0,v=!0,n.calcTransform(t,r,x))}}function b(e,a){if(r=f[e],!!(n=r._module).isContainer===a){var i=[];if(!0===r.visible){var o=r.transforms||[];for(l=o.length-1;l>=0;l--)if(o[l].enabled){r._indexToPoints=o[l]._indexToPoints;break}n&&n.calc&&(i=n.calc(t,r))}Array.isArray(i)&&i[0]||(i=[{x:c,y:c}]),i[0].t||(i[0].t={}),i[0].trace=r,p[e]=i}}for(v&&M(s),a=0;a<f.length;a++)b(a,!0);for(a=0;a<f.length;a++)b(a,!1);i.getComponentMethod("fx","calc")(t)},v.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},v.generalUpdatePerTraceModule=function(t,e,r,n){var a,i=e.traceHash,o={};for(a=0;a<r.length;a++){var s=r[a],c=s[0].trace;c.visible&&(o[c.type]=o[c.type]||[],o[c.type].push(s))}for(var u in i)if(!o[u]){var f=i[u][0];f[0].trace.visible=!1,o[u]=[f]}for(var d in o){var p=o[d];p[0][0].trace._module.plot(t,e,l.filterVisible(p),n)}e.traceHash=o}},{"../components/color":43,"../constants/numerical":145,"../lib":163,"../plot_api/plot_schema":196,"../plots/cartesian/axis_ids":208,"../registry":245,"./animation_attributes":200,"./attributes":202,"./command":229,"./font_attributes":231,"./frame_attributes":232,"./layout_attributes":235,"./sort_modules":244,d3:7,"fast-isnumeric":10}],238:[function(t,e,r){"use strict";var n=t("../../../traces/scatter/attributes"),a=n.marker;e.exports={r:n.r,t:n.t,marker:{color:a.color,size:a.size,symbol:a.symbol,opacity:a.opacity,editType:"calc"}}},{"../../../traces/scatter/attributes":281}],239:[function(t,e,r){"use strict";var n=t("../../cartesian/layout_attributes"),a=t("../../../lib/extend").extendFlat,i=t("../../../plot_api/edit_types").overrideAll,o=a({},n.domain,{});function l(t,e){return a({},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"}})}e.exports=i({radialaxis:l(0,{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:o,orientation:{valType:"number"}}),angularaxis:l(0,{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:o}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}},"plot","nested")},{"../../../lib/extend":157,"../../../plot_api/edit_types":190,"../../cartesian/layout_attributes":217}],240:[function(t,e,r){"use strict";(e.exports=t("./micropolar")).manager=t("./micropolar_manager")},{"./micropolar":241,"./micropolar_manager":242}],241:[function(t,e,r){var n=t("d3"),a=t("../../../lib").extendDeepAll,i=t("../../../constants/alignment").MID_SHIFT,o=e.exports={version:"0.2.2"};o.Axis=function(){var t,e,r,l,s={data:[],layout:{}},c={},u={},f=n.dispatch("hover"),d={};return d.render=function(c){return function(c){e=c||e;var f=s.data,d=s.layout;("string"==typeof e||e.nodeName)&&(e=n.select(e)),e.datum(f).each(function(e,s){var c=e.slice();u={data:o.util.cloneJson(c),layout:o.util.cloneJson(d)};var f=0;c.forEach(function(t,e){t.color||(t.color=d.defaultColorRange[f],f=(f+1)%d.defaultColorRange.length),t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:n.rgb(t.color).darker().toString()),u.data[e].color=t.color,u.data[e].strokeColor=t.strokeColor,u.data[e].strokeDash=t.strokeDash,u.data[e].strokeSize=t.strokeSize});var p=c.filter(function(t,e){var r=t.visible;return void 0===r||!0===r}),h=!1,g=p.map(function(t,e){return h=h||void 0!==t.groupId,t});if(h){var v=n.nest().key(function(t,e){return void 0!==t.groupId?t.groupId:"unstacked"}).entries(g),y=[],m=v.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],y.push(r),r=o.util.sumArrays(t.r,r)}),t.values});p=n.merge(m)}p.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 x=Math.min(d.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2;x=Math.max(10,x);var b,_=[d.margin.left+x,d.margin.top+x];b=h?[0,n.max(o.util.sumArrays(o.util.arrayLast(p).r[0],o.util.arrayLast(y)))]:n.extent(o.util.flattenArray(p.map(function(t,e){return t.r}))),d.radialAxis.domain!=o.DATAEXTENT&&(b[0]=0),r=n.scale.linear().domain(d.radialAxis.domain!=o.DATAEXTENT&&d.radialAxis.domain?d.radialAxis.domain:b).range([0,x]),u.layout.radialAxis.domain=r.domain();var w,k=o.util.flattenArray(p.map(function(t,e){return t.t})),M="string"==typeof k[0];M&&(k=o.util.deduplicate(k),w=k.slice(),k=n.range(k.length),p=p.map(function(t,e){var r=t;return t.t=[k],h&&(r.yStack=t.yStack),r}));var A=p.filter(function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry}).length===p.length,T=null===d.needsEndSpacing?M||!A:d.needsEndSpacing,L=d.angularAxis.domain&&d.angularAxis.domain!=o.DATAEXTENT&&!M&&d.angularAxis.domain[0]>=0?d.angularAxis.domain:n.extent(k),S=Math.abs(k[1]-k[0]);A&&!M&&(S=0);var C=L.slice();T&&M&&(C[1]+=S);var O=d.angularAxis.ticksCount||4;O>8&&(O=O/(O/8)+O%8),d.angularAxis.ticksStep&&(O=(C[1]-C[0])/O);var P=d.angularAxis.ticksStep||(C[1]-C[0])/(O*(d.minorTicks+1));w&&(P=Math.max(Math.round(P),1)),C[2]||(C[2]=P);var z=n.range.apply(this,C);if(z=z.map(function(t,e){return parseFloat(t.toPrecision(12))}),l=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=l.domain(),u.layout.angularAxis.endPadding=T?S:0,void 0===(t=n.select(this).select("svg.chart-root"))||t.empty()){var D=(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"),E=this.appendChild(this.ownerDocument.importNode(D.documentElement,!0));t=n.select(E)}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 N,R=t.select(".chart-group"),I={fill:"none",stroke:d.tickColor},F={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+d.font.outlineColor}).join(",")};if(d.showLegend){N=t.select(".legend-group").attr({transform:"translate("+[x,d.margin.top]+")"}).style({display:"block"});var j=p.map(function(t,e){var r=o.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});o.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:N,elements:j,reverseOrder:d.legend.reverseOrder})})();var B=N.node().getBBox();x=Math.min(d.width-B.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,x=Math.max(10,x),_=[d.margin.left+x,d.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),N.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else N=t.select(".legend-group").style({display:"none"});t.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),R.attr("transform","translate("+_+")").style({cursor:"crosshair"});var H=[(d.width-(d.margin.left+d.margin.right+2*x+(B?B.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*x))/2];if(H[0]=Math.max(0,H[0]),H[1]=Math.max(0,H[1]),t.select(".outer-group").attr("transform","translate("+H+")"),d.title){var q=t.select("g.title-group text").style(F).text(d.title),V=q.node().getBBox();q.attr({x:_[0]-V.width/2,y:_[1]-x-20})}var U=t.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var G=U.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(I),G.attr("r",r),G.exit().remove()}U.select("circle.outside-circle").attr({r:x}).style(I);var Y=t.select("circle.background-circle").attr({r:x}).style({fill:d.backgroundColor,stroke:d.stroke});function X(t,e){return l(t)%360+d.orientation}if(d.radialAxis.visible){var Z=n.svg.axis().scale(r).ticks(5).tickSize(5);U.call(Z).attr({transform:"rotate("+d.radialAxis.orientation+")"}),U.selectAll(".domain").style(I),U.selectAll("g>text").text(function(t,e){return this.textContent+d.radialAxis.ticksSuffix}).style(F).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,F["font-size"]]+")":"translate("+[0,F["font-size"]]+")"}}),U.selectAll("g>line").style({stroke:"black"})}var W=t.select(".angular.axis-group").selectAll("g.angular-tick").data(z),Q=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(t,e){return"rotate("+X(t)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),W.exit().remove(),Q.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(d.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(d.minorTicks+1)==0)}).style(I),Q.selectAll(".minor").style({stroke:d.minorTickColor}),W.select("line.grid-line").attr({x1:d.tickLength?x-d.tickLength:0,x2:x}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),Q.append("text").classed("axis-text",!0).style(F);var J=W.select("text.axis-text").attr({x:x+d.labelOffset,dy:i+"em",transform:function(t,e){var r=X(t),n=x+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(d.minorTicks+1)!=0?"":w?w[t]+d.angularAxis.ticksSuffix:t+d.angularAxis.ticksSuffix}).style(F);d.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,e)});var $=n.max(R.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));N.attr({transform:"translate("+[x+$,d.margin.top]+")"});var K=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(p);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),p[0]||K){var et=[];p.forEach(function(t,e){var n={};n.radialScale=r,n.angularScale=l,n.container=tt.filter(function(t,r){return r==e}),n.geometry=t.geometry,n.orientation=d.orientation,n.direction=d.direction,n.index=e,et.push({data:t,geometryConfig:n})});var rt=n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(et),nt=[];rt.forEach(function(t,e){"unstacked"===t.key?nt=nt.concat(t.values.map(function(t,e){return[t]})):nt.push(t.values)}),nt.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return a(o[r].defaultConfig(),t)});o[r]().config(n)()})}var at,it,ot=t.select(".guides-group"),lt=t.select(".tooltips-group"),st=o.tooltipPanel().config({container:lt,fontSize:8})(),ct=o.tooltipPanel().config({container:lt,fontSize:8})(),ut=o.tooltipPanel().config({container:lt,hasTick:!0})();if(!M){var ft=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});R.on("mousemove.angular-guide",function(t,e){var r=o.util.getMousePos(Y).angle;ft.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;at=l.invert(n);var a=o.util.convertToCartesian(x+12,r+180);st.text(o.util.round(at)).move([a[0]+_[0],a[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){ot.select("line").style({opacity:0})})}var dt=ot.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",function(t,e){var n=o.util.getMousePos(Y).radius;dt.attr({r:n}).style({opacity:.5}),it=r.invert(o.util.getMousePos(Y).radius);var a=o.util.convertToCartesian(n,d.radialAxis.orientation);ct.text(o.util.round(it)).move([a[0]+_[0],a[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){dt.style({opacity:0}),ut.hide(),st.hide(),ct.hide()}),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(e,r){var a=n.select(this),i=this.style.fill,l="black",s=this.style.opacity||1;if(a.attr({"data-opacity":s}),i&&"none"!==i){a.attr({"data-fill":i}),l=n.hsl(i).darker().toString(),a.style({fill:l,opacity:1});var c={t:o.util.round(e[0]),r:o.util.round(e[1])};M&&(c.t=w[e[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=t.node().getBoundingClientRect(),p=[f.left+f.width/2-H[0]-d.left,f.top+f.height/2-H[1]-d.top];ut.config({color:l}).text(u),ut.move(p)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),l=n.hsl(i).darker().toString(),a.style({stroke:l,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ut.show()}).on("mouseout.tooltip",function(t,e){ut.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})})}(c),this},d.config=function(t){if(!arguments.length)return s;var e=o.util.cloneJson(t);return e.data.forEach(function(t,e){s.data[e]||(s.data[e]={}),a(s.data[e],o.Axis.defaultConfig().data[0]),a(s.data[e],t)}),a(s.layout,o.Axis.defaultConfig().layout),a(s.layout,e.layout),this},d.getLiveConfig=function(){return u},d.getinputConfig=function(){return c},d.radialScale=function(t){return r},d.angularScale=function(t){return l},d.svg=function(){return t},n.rebind(d,f,"on"),d},o.Axis.defaultConfig=function(t,e){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:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},o.util.dataFromEquation=function(t,e,r){var a=e||6,i=[],o=[];n.range(0,360+a,a).forEach(function(e,r){var n=e*Math.PI/180,a=t(n);i.push(e),o.push(a)});var l={t:i,r:o};return r&&(l.name=r),l},o.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},o.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=o.util.ensureArray(t[e],r)}),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],a=e[1],i={};return i.x=r,i.y=a,i.pos=e,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},o.util.duplicatesCount=function(t){for(var e,r={},n={},a=0,i=t.length;a<i;a++)(e=t[a])in r?(r[e]++,n[e]=r[e]):r[e]=1;return n},o.util.duplicates=function(t){return Object.keys(o.util.duplicatesCount(t))},o.util.translator=function(t,e,r,n){if(n){var a=r.slice();r=e,e=a}var i=e.reduce(function(t,e){if(void 0!==t)return t[e]},t);void 0!==i&&(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]=i),t[e]},t))},o.PolyChart=function(){var t=[o.PolyChart.defaultConfig()],e=n.dispatch("hover"),r={solid:"none",dash:[5,2],dot:[2,5]};function i(){var e=t[0].geometryConfig,a=e.container;"string"==typeof a&&(a=n.select(a)),a.datum(t).each(function(t,a){var i=!!t[0].data.yStack,o=t.map(function(t,e){return i?n.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):n.zip(t.data.t[0],t.data.r[0])}),l=e.angularScale,s=e.radialScale.domain()[0],c={bar:function(r,a,i){var o=t[i].data,s=e.radialScale(r[1])-e.radialScale(0),c=e.radialScale(r[2]||0),u=o.barWidth;n.select(this).attr({class:"mark bar",d:"M"+[[s+c,-u/2],[s+c,u/2],[c,u/2],[c,-u/2]].join("L")+"Z",transform:function(t,r){return"rotate("+(e.orientation+l(t[0]))+")"}})}};c.dot=function(r,a,i){var o=r[2]?[r[0],r[1]+r[2]]:r,l=n.svg.symbol().size(t[i].data.dotSize).type(t[i].data.dotType)(r,a);n.select(this).attr({class:"mark dot",d:l,transform:function(t,r){var n,a,i,l=(n=function(t,r){var n=e.radialScale(t[1]),a=(e.angularScale(t[0])+e.orientation)*Math.PI/180;return{r:n,t:a}}(o),a=n.r*Math.cos(n.t),i=n.r*Math.sin(n.t),{x:a,y:i});return"translate("+[l.x,l.y]+")"}})};var u=n.svg.line.radial().interpolate(t[0].data.lineInterpolation).radius(function(t){return e.radialScale(t[1])}).angle(function(t){return e.angularScale(t[0])*Math.PI/180});c.line=function(r,a,i){var l=r[2]?o[i].map(function(t,e){return[t[0],t[1]+t[2]]}):o[i];if(n.select(this).each(c.dot).style({opacity:function(e,r){return+t[i].data.dotVisible},fill:h.stroke(r,a,i)}).attr({class:"mark dot"}),!(a>0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:u(l),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return h.fill(r,a,i)},"fill-opacity":0,stroke:function(t,e){return h.stroke(r,a,i)},"stroke-width":function(t,e){return h["stroke-width"](r,a,i)},"stroke-dasharray":function(t,e){return h["stroke-dasharray"](r,a,i)},opacity:function(t,e){return h.opacity(r,a,i)},display:function(t,e){return h.display(r,a,i)}})}};var f=e.angularScale.range(),d=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,p=n.svg.arc().startAngle(function(t){return-d/2}).endAngle(function(t){return d/2}).innerRadius(function(t){return e.radialScale(s+(t[2]||0))}).outerRadius(function(t){return e.radialScale(s+(t[2]||0))+e.radialScale(t[1])});c.arc=function(t,r,a){n.select(this).attr({class:"mark arc",d:p,transform:function(t,r){return"rotate("+(e.orientation+l(t[0])+90)+")"}})};var h={fill:function(e,r,n){return t[n].data.color},stroke:function(e,r,n){return t[n].data.strokeColor},"stroke-width":function(e,r,n){return t[n].data.strokeSize+"px"},"stroke-dasharray":function(e,n,a){return r[t[a].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=n.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(h).each(c[e.geometryType]),v.exit().remove(),g.exit().remove()})}return i.config=function(e){return arguments.length?(e.forEach(function(e,r){t[r]||(t[r]={}),a(t[r],o.PolyChart.defaultConfig()),a(t[r],e)}),this):t},i.getColorScale=function(){},n.rebind(i,e,"on"),i},o.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:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var t=o.Legend.defaultConfig(),e=n.dispatch("hover");function r(){var e=t.legendConfig,i=t.data.map(function(t,r){return[].concat(t).map(function(t,n){var i=a({},e.elements[r]);return i.name=t,i.color=[].concat(e.elements[r].color)[n],i})}),o=n.merge(i);o=o.filter(function(t,r){return e.elements[r]&&(e.elements[r].visibleInLegend||void 0===e.elements[r].visibleInLegend)}),e.reverseOrder&&(o=o.reverse());var l=e.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=o.map(function(t,e){return t.color}),c=e.fontSize,u=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,f=u?e.height:c*o.length,d=l.classed("legend-group",!0).selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var h=n.range(o.length),g=n.scale[u?"linear":"ordinal"]().domain(h).range(s),v=n.scale[u?"linear":"ordinal"]().domain(h)[u?"range":"rangePoints"]([0,f]);if(u){var y=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);y.enter().append("stop"),y.attr({offset:function(t,e){return e/(s.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),d.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var m=d.select(".legend-marks").selectAll("path.legend-mark").data(o);m.enter().append("path").classed("legend-mark",!0),m.attr({transform:function(t,e){return"translate("+[c/2,v(e)+c/2]+")"},d:function(t,e){var r,a,i,o=t.symbol;return i=3*(a=c),"line"===(r=o)?"M"+[[-a/2,-a/12],[a/2,-a/12],[a/2,a/12],[-a/2,a/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(i)():n.svg.symbol().type("square").size(i)()},fill:function(t,e){return g(e)}}),m.exit().remove()}var x=n.svg.axis().scale(v).orient("right"),b=d.select("g.legend-axis").attr({transform:"translate("+[u?e.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?e.textColor:"none"}),b.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text(function(t,e){return o[e].name}),r}return r.config=function(e){return arguments.length?(a(t,e),this):t},n.rebind(r,e,"on"),r},o.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}}},o.tooltipPanel=function(){var t,e,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},l="tooltip-"+o.tooltipPanel.uid++,s=10,c=function(){var n=(t=i.container.selectAll("g."+l).data([0])).enter().append("g").classed(l,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:i.padding+s,dy:.3*+i.fontSize}),c};return c.text=function(a){var o=n.hsl(i.color).l,l=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=a||"";e.style({fill:u,"font-size":i.fontSize+"px"}).text(f);var d=i.padding,p=e.node().getBBox(),h={fill:i.color,stroke:l,"stroke-width":"2px"},g=p.width+2*d+s,v=p.height+2*d;return r.attr({d:"M"+[[s,-v/2],[s,-v/4],[i.hasTick?0:s,0],[s,v/4],[s,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(h),t.attr({transform:"translate("+[s,-v/2+2*d]+")"}),t.style({display:"block"}),c},c.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(t)return t.style({display:"none"}),c},c.show=function(){if(t)return t.style({display:"block"}),c},c.config=function(t){return a(i,t),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={convert:function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=a({},t);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,r){o.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var i=o.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=i.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var l=a({},t.layout);if([[l,["plot_bgcolor"],["backgroundColor"]],[l,["showlegend"],["showLegend"]],[l,["radialaxis"],["radialAxis"]],[l,["angularaxis"],["angularAxis"]],[l.angularaxis,["showline"],["gridLinesVisible"]],[l.angularaxis,["showticklabels"],["labelsVisible"]],[l.angularaxis,["nticks"],["ticksCount"]],[l.angularaxis,["tickorientation"],["tickOrientation"]],[l.angularaxis,["ticksuffix"],["ticksSuffix"]],[l.angularaxis,["range"],["domain"]],[l.angularaxis,["endpadding"],["endPadding"]],[l.radialaxis,["showline"],["gridLinesVisible"]],[l.radialaxis,["tickorientation"],["tickOrientation"]],[l.radialaxis,["ticksuffix"],["ticksSuffix"]],[l.radialaxis,["range"],["domain"]],[l.angularAxis,["showline"],["gridLinesVisible"]],[l.angularAxis,["showticklabels"],["labelsVisible"]],[l.angularAxis,["nticks"],["ticksCount"]],[l.angularAxis,["tickorientation"],["tickOrientation"]],[l.angularAxis,["ticksuffix"],["ticksSuffix"]],[l.angularAxis,["range"],["domain"]],[l.angularAxis,["endpadding"],["endPadding"]],[l.radialAxis,["showline"],["gridLinesVisible"]],[l.radialAxis,["tickorientation"],["tickOrientation"]],[l.radialAxis,["ticksuffix"],["ticksSuffix"]],[l.radialAxis,["range"],["domain"]],[l.font,["outlinecolor"],["outlineColor"]],[l.legend,["traceorder"],["reverseOrder"]],[l,["labeloffset"],["labelOffset"]],[l,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e?(void 0!==l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&void 0!==l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&void 0!==l.angularAxis.tickcolor&&(l.tickColor=l.angularAxis.tickcolor)),l.legend&&"boolean"!=typeof l.legend.reverseOrder&&(l.legend.reverseOrder="normal"!=l.legend.reverseOrder),l.legend&&"boolean"==typeof l.legend.traceorder&&(l.legend.traceorder=l.legend.traceorder?"reversed":"normal",delete l.legend.reverseOrder),l.margin&&void 0!==l.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(l.margin).forEach(function(t,e){u[c[s.indexOf(t.key)]]=t.value}),l.margin=u}e&&(delete l.needsEndSpacing,delete l.minorTickColor,delete l.minorTicks,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksStep,delete l.angularaxis.rewriteTicks,delete l.angularaxis.nticks,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksStep,delete l.radialaxis.rewriteTicks,delete l.radialaxis.nticks),r.layout=l}return r}};return t}},{"../../../constants/alignment":143,"../../../lib":163,d3:7}],242:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../../lib"),i=t("../../../components/color"),o=t("./micropolar"),l=t("./undo_manager"),s=a.extendDeepAll,c=e.exports={};c.framework=function(t){var e,r,a,i,u,f=new l;function d(r,l){return l&&(u=l),n.select(n.select(u).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?s(e,r):r,a||(a=o.Axis()),i=o.adapter.plotly().convert(e),a.config(i).render(u),t.data=e.data,t.layout=e.layout,c.fillLayout(t),e}return d.isPolar=!0,d.svg=function(){return a.svg()},d.getConfig=function(){return e},d.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},d.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},d.setUndoPoint=function(){var t,n,a=this,i=o.util.cloneJson(e);t=i,n=r,f.add({undo:function(){n&&a(n)},redo:function(){a(t)}}),r=o.util.cloneJson(i)},d.undo=function(){f.undo()},d.redo=function(){f.redo()},d},c.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),a=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:i.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=s(o,t.layout)}},{"../../../components/color":43,"../../../lib":163,"./micropolar":241,"./undo_manager":243,d3:7}],243:[function(t,e,r){"use strict";e.exports=function(){var t,e=[],r=-1,n=!1;function a(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?(a(n,"undo"),r-=1,t&&t(n.undo),this):this},redo:function(){var n=e[r+1];return n?(a(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}}}},{}],244:[function(t,e,r){"use strict";function n(t,e){return"splom"===t?-1:"splom"===e?1:0}e.exports={sortBasePlotModules:function(t,e){return n(t.name,e.name)},sortModules:n}},{}],245:[function(t,e,r){"use strict";var n=t("./lib/loggers"),a=t("./lib/noop"),i=t("./lib/push_unique"),o=t("./lib/is_plain_object"),l=t("./lib/extend"),s=t("./plots/attributes"),c=t("./plots/layout_attributes"),u=l.extendFlat,f=l.extendDeepAll;function d(t){var e=t.name,a=t.categories,i=t.meta;if(r.modules[e])n.log("Type "+e+" already registered");else{r.subplotsRegistry[t.basePlotModule.name]||function(t){var e=t.name;if(r.subplotsRegistry[e])return void n.log("Plot type "+e+" already registered.");for(var a in v(t),r.subplotsRegistry[e]=t,r.componentsRegistry)x(a,t.name)}(t.basePlotModule);for(var o={},l=0;l<a.length;l++)o[a[l]]=!0,r.allCategories[a[l]]=!0;for(var s in r.modules[e]={_module:t,categories:o},i&&Object.keys(i).length&&(r.modules[e].meta=i),r.allTypes.push(e),r.componentsRegistry)y(s,e);t.layoutAttributes&&u(r.traceLayoutAttributes,t.layoutAttributes)}}function p(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");var e=t.name;for(var n in r.componentsRegistry[e]=t,t.layoutAttributes&&(t.layoutAttributes._isLinkedToArray&&i(r.layoutArrayContainers,e),v(t)),r.modules)y(e,n);for(var a in r.subplotsRegistry)x(e,a);for(var o in r.transformsRegistry)m(e,o);t.schema&&t.schema.layout&&f(c,t.schema.layout)}function h(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,a="function"==typeof t.transform,i="function"==typeof t.calcTransform;if(!a&&!i)throw new Error(e+" is missing a *transform* or *calcTransform* method.");for(var l in a&&i&&n.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),o(t.attributes)||n.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&n.log(e+" registered without a *supplyDefaults* method."),r.transformsRegistry[t.name]=t,r.componentsRegistry)m(l,t.name)}function g(t){var e=t.name,n=e.split("-")[0],a=t.dictionary,i=t.format,o=a&&Object.keys(a).length,l=i&&Object.keys(i).length,s=r.localeRegistry,c=s[e];if(c||(s[e]=c={}),n!==e){var u=s[n];u||(s[n]=u={}),o&&u.dictionary===c.dictionary&&(u.dictionary=a),l&&u.format===c.format&&(u.format=i)}o&&(c.dictionary=a),l&&(c.format=i)}function v(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n<e.length;n++)i(r.layoutArrayRegexes,e[n])}}function y(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.traces){var a=n.traces[e];a&&f(r.modules[e]._module.attributes,a)}}function m(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.transforms){var a=n.transforms[e];a&&f(r.transformsRegistry[e].attributes,a)}}function x(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.subplots){var a=r.subplotsRegistry[e],i=a.layoutAttributes,o="subplot"===a.attr?a.name:a.attr;Array.isArray(o)&&(o=o[0]);var l=n.subplots[o];i&&l&&f(i,l)}}function b(t){return"object"==typeof t&&(t=t.type),t}r.modules={},r.allCategories={},r.allTypes=[],r.subplotsRegistry={},r.transformsRegistry={},r.componentsRegistry={},r.layoutArrayContainers=[],r.layoutArrayRegexes=[],r.traceLayoutAttributes={},r.localeRegistry={},r.apiMethodRegistry={},r.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 n=t[e];if(!n)throw new Error("Invalid module was attempted to be registered!");switch(n.moduleType){case"trace":d(n);break;case"transform":h(n);break;case"component":p(n);break;case"locale":g(n);break;case"apiMethod":var a=n.name;r.apiMethodRegistry[a]=n.fn;break;default:throw new Error("Invalid module was attempted to be registered!")}}},r.getModule=function(t){var e=r.modules[b(t)];return!!e&&e._module},r.traceIs=function(t,e){if("various"===(t=b(t)))return!1;var a=r.modules[t];return a||(t&&"area"!==t&&n.log("Unrecognized trace type "+t+"."),a=r.modules[s.type.dflt]),!!a.categories[e]},r.getTransformIndices=function(t,e){for(var r=[],n=t.transforms||[],a=0;a<n.length;a++)n[a].type===e&&r.push(a);return r},r.hasTransform=function(t,e){for(var r=t.transforms||[],n=0;n<r.length;n++)if(r[n].type===e)return!0;return!1},r.getComponentMethod=function(t,e){var n=r.componentsRegistry[t];return n&&n[e]||a},r.call=function(){var t=arguments[0],e=[].slice.call(arguments,1);return r.apiMethodRegistry[t].apply(null,e)}},{"./lib/extend":157,"./lib/is_plain_object":165,"./lib/loggers":168,"./lib/noop":172,"./lib/push_unique":176,"./plots/attributes":202,"./plots/layout_attributes":235}],246:[function(t,e,r){"use strict";var n=t("../lib"),a=n.extendFlat,i=n.extendDeep;function o(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:0},annotations:[]};break;default:e={}}return e}e.exports=function(t,e){var r;t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var n,l=t.data,s=t.layout,c=i([],l),u=i({},s,o(e.tileClass)),f=t._context||{};if(e.width&&(u.width=e.width),e.height&&(u.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){u.annotations=[];var d=Object.keys(u);for(r=0;r<d.length;r++)n=d[r],["xaxis","yaxis","zaxis"].indexOf(n.slice(0,5))>-1&&(u[d[r]].title="");for(r=0;r<c.length;r++){var p=c[r];p.showscale=!1,p.marker&&(p.marker.showscale=!1),"pie"===p.type&&(p.textposition="none")}}if(Array.isArray(e.annotations))for(r=0;r<e.annotations.length;r++)u.annotations.push(e.annotations[r]);var h=Object.keys(u).filter(function(t){return t.match(/^scene\d*$/)});if(h.length){var g={};for("thumbnail"===e.tileClass&&(g={title:"",showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),r=0;r<h.length;r++){var v=u[h[r]];v.xaxis||(v.xaxis={}),v.yaxis||(v.yaxis={}),v.zaxis||(v.zaxis={}),a(v.xaxis,g),a(v.yaxis,g),a(v.zaxis,g),v._scene=null}}var y=document.createElement("div");e.tileClass&&(y.className=e.tileClass);var m={gd:y,td:y,layout:u,data:c,config:{staticPlot:void 0===e.staticPlot||e.staticPlot,plotGlPixelRatio:void 0===e.plotGlPixelRatio?2:e.plotGlPixelRatio,displaylogo:e.displaylogo||!1,showLink:e.showLink||!1,showTips:e.showTips||!1,mapboxAccessToken:f.mapboxAccessToken}};return"transparent"!==e.setBackground&&(m.config.setBackground=e.setBackground||"opaque"),m.gd.defaultLayout=o(e.tileClass),m}},{"../lib":163}],247:[function(t,e,r){"use strict";var n=t("../plot_api/to_image"),a=t("../lib"),i=t("./filesaver");e.exports=function(t,e){return(e=e||{}).format=e.format||"png",new Promise(function(r,o){t._snapshotInProgress&&o(new Error("Snapshotting already in progress.")),a.isIE()&&"svg"!==e.format&&o(new Error("Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.")),t._snapshotInProgress=!0;var l=n(t,e),s=e.filename||t.fn||"newplot";s+="."+e.format,l.then(function(e){return t._snapshotInProgress=!1,i(e,s)}).then(function(t){r(t)}).catch(function(e){t._snapshotInProgress=!1,o(e)})})}},{"../lib":163,"../plot_api/to_image":198,"./filesaver":248}],248:[function(t,e,r){"use strict";e.exports=function(t,e){var r=document.createElement("a"),n="download"in r,a=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent);return new Promise(function(i,o){if("undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent)&&o(new Error("IE < 10 unsupported")),a&&(document.location.href="data:application/octet-stream"+t.slice(t.search(/[,;]/)),i(e)),e||(e="download"),n&&(r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r),i(e)),"undefined"!=typeof navigator&&navigator.msSaveBlob){var l=t.split(/^data:image\/svg\+xml,/)[1],s=decodeURIComponent(l);navigator.msSaveBlob(new Blob([s]),e),i(e)}o(new Error("download error"))})}},{}],249:[function(t,e,r){"use strict";r.getDelay=function(t){return t._has&&(t._has("gl3d")||t._has("gl2d")||t._has("mapbox"))?500:0},r.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()})}}},{}],250:[function(t,e,r){"use strict";var n=t("./helpers"),a={getDelay:n.getDelay,getRedrawFunc:n.getRedrawFunc,clone:t("./cloneplot"),toSVG:t("./tosvg"),svgToImg:t("./svgtoimg"),toImage:t("./toimage"),downloadImage:t("./download")};e.exports=a},{"./cloneplot":246,"./download":247,"./helpers":249,"./svgtoimg":251,"./toimage":252,"./tosvg":253}],251:[function(t,e,r){"use strict";var n=t("../lib"),a=t("events").EventEmitter;e.exports=function(t){var e=t.emitter||new a,r=new Promise(function(a,i){var o=window.Image,l=t.svg,s=t.format||"png";if(n.isIE()&&"svg"!==s){var c=new Error("Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.");return i(c),t.promise?r:e.emit("error",c)}var u=t.canvas,f=t.scale||1,d=t.width||300,p=t.height||150,h=f*d,g=f*p,v=u.getContext("2d"),y=new o,m="data:image/svg+xml,"+encodeURIComponent(l);u.width=h,u.height=g,y.onload=function(){var r;switch("svg"!==s&&v.drawImage(y,0,0,h,g),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=m;break;default:var n="Image format is not jpeg, png, svg or webp.";if(i(new Error(n)),!t.promise)return e.emit("error",n)}a(r),t.promise||e.emit("success",r)},y.onerror=function(r){if(i(r),!t.promise)return e.emit("error",r)},y.src=m});return t.promise?r:e}},{"../lib":163,events:9}],252:[function(t,e,r){"use strict";var n=t("events").EventEmitter,a=t("../registry"),i=t("../lib"),o=t("./helpers"),l=t("./cloneplot"),s=t("./tosvg"),c=t("./svgtoimg");e.exports=function(t,e){var r=new n,u=l(t,{format:"png"}),f=u.gd;f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);var d=o.getRedrawFunc(f);return a.call("plot",f,u.data,u.layout,u.config).then(d).then(function(){var t=o.getDelay(f._fullLayout);setTimeout(function(){var t=s(f),n=document.createElement("canvas");n.id=i.randstr(),(r=c({format:e.format,width:f._fullLayout.width,height:f._fullLayout.height,canvas:n,emitter:r,svg:t})).clean=function(){f&&document.body.removeChild(f)}},t)}).catch(function(t){r.emit("error",t)}),r}},{"../lib":163,"../registry":245,"./cloneplot":246,"./helpers":249,"./svgtoimg":251,"./tosvg":253,events:9}],253:[function(t,e,r){"use strict";var n=t("d3"),a=t("../lib"),i=t("../components/drawing"),o=t("../components/color"),l=t("../constants/xmlns_namespaces"),s=/"/g,c=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,r){var u,f=t._fullLayout,d=f._paper,p=f._toppaper,h=f.width,g=f.height;d.insert("rect",":first-child").call(i.setRect,0,0,h,g).call(o.fill,f.paper_bgcolor);var v=f._basePlotModules||[];for(u=0;u<v.length;u++){var y=v[u];y.toSVG&&y.toSVG(t)}if(p){var m=p.node().childNodes,x=Array.prototype.slice.call(m);for(u=0;u<x.length;u++){var b=x[u];b.childNodes.length&&d.node().appendChild(b)}}f._draggers&&f._draggers.remove(),d.node().style.background="",d.selectAll("text").attr({"data-unformatted":null,"data-math":null}).each(function(){var t=n.select(this);if("hidden"!==this.style.visibility&&"none"!==this.style.display){t.style({visibility:null,display:null});var e=this.style.fontFamily;e&&-1!==e.indexOf('"')&&t.style("font-family",e.replace(s,"TOBESTRIPPED"))}else t.remove()}),d.selectAll(".point,.scatterpts").each(function(){var t=n.select(this),e=this.style.fill;e&&-1!==e.indexOf("url(")&&t.style("fill",e.replace(s,"TOBESTRIPPED"))}),"pdf"!==e&&"eps"!==e||d.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),d.node().setAttributeNS(l.xmlns,"xmlns",l.svg),d.node().setAttributeNS(l.xmlns,"xmlns:xlink",l.xlink),"svg"===e&&r&&(d.attr("width",r*h),d.attr("height",r*g),d.attr("viewBox","0 0 "+h+" "+g));var _=(new window.XMLSerializer).serializeToString(d.node());return _=function(t){var e=n.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"<"===t?"<":"&rt;"===t?">":-1!==t.indexOf("<")||-1!==t.indexOf(">")?"":e.html(t).text()});return e.remove(),r}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":43,"../components/drawing":68,"../constants/xmlns_namespaces":147,"../lib":163,d3:7}],254:[function(t,e,r){"use strict";var n=t("../../lib").mergeArray;e.exports=function(t,e){for(var r=0;r<t.length;r++)t[r].i=r;n(e.text,t,"tx"),n(e.hovertext,t,"htx");var a=e.marker;if(a){n(a.opacity,t,"mo"),n(a.color,t,"mc");var i=a.line;i&&(n(i.color,t,"mlc"),n(i.width,t,"mlw"))}}},{"../../lib":163}],255:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../components/colorscale/color_attributes"),i=t("../../components/colorbar/attributes"),o=t("../../plots/font_attributes"),l=t("../../lib/extend").extendFlat,s=o({editType:"calc",arrayOk:!0}),c=n.marker,u=l({},c.line.width,{dflt:0}),f=l({width:u,editType:"calc"},a("marker.line")),d=l({line:f,editType:"calc"},a("marker"),{showscale:c.showscale,colorbar:i,opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style"}});e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:n.text,hovertext:n.hovertext,textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"none",arrayOk:!0,editType:"calc"},textfont:l({},s,{}),insidetextfont:l({},s,{}),outsidetextfont:l({},s,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},cliponaxis:l({},n.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:d,selected:{marker:{opacity:n.selected.marker.opacity,color:n.selected.marker.color,editType:"style"},textfont:n.selected.textfont,editType:"style"},unselected:{marker:{opacity:n.unselected.marker.opacity,color:n.unselected.marker.color,editType:"style"},textfont:n.unselected.textfont,editType:"style"},r:n.r,t:n.t,_deprecated:{bardir:{valType:"enumerated",editType:"calc",values:["v","h"]}}}},{"../../components/colorbar/attributes":44,"../../components/colorscale/color_attributes":51,"../../lib/extend":157,"../../plots/font_attributes":231,"../scatter/attributes":281}],256:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib").isArrayOrTypedArray,i=t("../../plots/cartesian/axes"),o=t("../../components/colorscale/has_colorscale"),l=t("../../components/colorscale/calc"),s=t("./arrays_to_calcdata"),c=t("../scatter/calc_selection");e.exports=function(t,e){var r,u,f,d,p,h=i.getFromId(t,e.xaxis||"x"),g=i.getFromId(t,e.yaxis||"y");"h"===(e.orientation||(e.x&&!e.y?"h":"v"))?(r=h,f=h.makeCalcdata(e,"x"),u=g.makeCalcdata(e,"y"),p=e.xcalendar):(r=g,f=g.makeCalcdata(e,"y"),u=h.makeCalcdata(e,"x"),p=e.ycalendar);var v=Math.min(u.length,f.length),y=new Array(v);for(d=0;d<v;d++)y[d]={p:u[d],s:f[d]},e.ids&&(y[d].id=String(e.ids[d]));var m,x=e.base;if(a(x)){for(d=0;d<Math.min(x.length,y.length);d++)m=r.d2c(x[d],0,p),n(m)?(y[d].b=+m,y[d].hasB=1):y[d].b=0;for(;d<y.length;d++)y[d].b=0}else{m=r.d2c(x,0,p);var b=n(m);for(m=b?m:0,d=0;d<y.length;d++)y[d].b=m,b&&(y[d].hasB=1)}return o(e,"marker")&&l(e,e.marker.color,"marker","c"),o(e,"marker.line")&&l(e,e.marker.line.color,"marker.line","c"),s(y,e),c(y,e),y}},{"../../components/colorscale/calc":50,"../../components/colorscale/has_colorscale":57,"../../lib":163,"../../plots/cartesian/axes":205,"../scatter/calc_selection":283,"./arrays_to_calcdata":254,"fast-isnumeric":10}],257:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/color"),i=t("../../registry"),o=t("../scatter/xy_defaults"),l=t("../bar/style_defaults"),s=t("./attributes");e.exports=function(t,e,r,c){function u(r,a){return n.coerce(t,e,s,r,a)}var f=n.coerceFont;if(o(t,e,c,u)){u("orientation",e.x&&!e.y?"h":"v"),u("base"),u("offset"),u("width"),u("text"),u("hovertext");var d=u("textposition"),p=Array.isArray(d)||"auto"===d,h=p||"inside"===d,g=p||"outside"===d;if(h||g){var v=f(u,"textfont",c.font);h&&f(u,"insidetextfont",v),g&&f(u,"outsidetextfont",v),u("constraintext"),u("selected.textfont.color"),u("unselected.textfont.color"),u("cliponaxis")}l(t,e,u,r,c);var y=i.getComponentMethod("errorbars","supplyDefaults");y(t,e,a.defaultLine,{axis:"y"}),y(t,e,a.defaultLine,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,u)}else e.visible=!1}},{"../../components/color":43,"../../lib":163,"../../registry":245,"../bar/style_defaults":267,"../scatter/xy_defaults":305,"./attributes":255}],258:[function(t,e,r){"use strict";var n=t("../../components/fx"),a=t("../../registry"),i=t("../../components/color"),o=t("../scatter/fill_hover_text");e.exports=function(t,e,r,l){var s,c,u,f,d,p,h,g=t.cd,v=g[0].trace,y=g[0].t,m="closest"===l,x=t.maxHoverDistance,b=t.maxSpikeDistance;function _(t){return t[u]-t.w/2}function w(t){return t[u]+t.w/2}var k=m?_:function(t){return Math.min(_(t),t.p-y.bardelta/2)},M=m?w:function(t){return Math.max(w(t),t.p+y.bardelta/2)};function A(t,e){return n.inbox(t-s,e-s,x+Math.min(1,Math.abs(e-t)/h)-1)}function T(t){return A(k(t),M(t))}function L(t){return n.inbox(t.b-c,t[f]-c,x+(t[f]-c)/(t[f]-t.b)-1)}"h"===v.orientation?(s=r,c=e,u="y",f="x",d=L,p=T):(s=e,c=r,u="x",f="y",p=L,d=T);var S=t[u+"a"],C=t[f+"a"];h=Math.abs(S.r2c(S.range[1])-S.r2c(S.range[0]));var O=n.getDistanceFunction(l,d,p,function(t){return(d(t)+p(t))/2});if(n.getClosest(g,O,t),!1!==t.index){m||(k=function(t){return Math.min(_(t),t.p-y.bargroupwidth/2)},M=function(t){return Math.max(w(t),t.p+y.bargroupwidth/2)});var P=g[t.index],z=P.mcc||v.marker.color,D=P.mlcc||v.marker.line.color,E=P.mlw||v.marker.line.width;i.opacity(z)?t.color=z:i.opacity(D)&&E&&(t.color=D);var N=v.base?P.b+P.s:P.s;t[f+"0"]=t[f+"1"]=C.c2p(P[f],!0),t[f+"LabelVal"]=N;var R=y.extents[y.extents.round(P.p)];return t[u+"0"]=S.c2p(m?k(P):R[0],!0),t[u+"1"]=S.c2p(m?M(P):R[1],!0),t[u+"LabelVal"]=P.p,t.spikeDistance=(L(P)+function(t){return A(_(t),w(t))}(P))/2+b-x,t[u+"Spike"]=S.c2p(P.p,!0),o(P,v,t),a.getComponentMethod("errorbars","hoverInfo")(P,v,t),[t]}}},{"../../components/color":43,"../../components/fx":85,"../../registry":245,"../scatter/fill_hover_text":289}],259:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("./layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.calc=t("./calc"),n.setPositions=t("./set_positions"),n.colorbar=t("../scatter/colorbar"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.style=t("./style").style,n.styleOnSelect=t("./style").styleOnSelect,n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="bar",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","svg","bar","oriented","markerColorscale","errorBarsOK","showLegend","zoomScale"],n.meta={},e.exports=n},{"../../plots/cartesian":216,"../scatter/colorbar":285,"./arrays_to_calcdata":254,"./attributes":255,"./calc":256,"./defaults":257,"./hover":258,"./layout_attributes":260,"./layout_defaults":261,"./plot":262,"./select":263,"./set_positions":264,"./style":266}],260:[function(t,e,r){"use strict";e.exports={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"}}},{}],261:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/cartesian/axes"),i=t("../../lib"),o=t("./layout_attributes");e.exports=function(t,e,r){function l(r,n){return i.coerce(t,e,o,r,n)}for(var s=!1,c=!1,u=!1,f={},d=0;d<r.length;d++){var p=r[d];if(n.traceIs(p,"bar")){if(s=!0,"overlay"!==t.barmode&&"stack"!==t.barmode){var h=p.xaxis+p.yaxis;f[h]&&(u=!0),f[h]=!0}if(p.visible&&"histogram"===p.type)"category"!==a.getFromId({_fullLayout:e},p["v"===p.orientation?"xaxis":"yaxis"]).type&&(c=!0)}}s&&("overlay"!==l("barmode")&&l("barnorm"),l("bargap",c&&!u?0:.2),l("bargroupgap"))}},{"../../lib":163,"../../plots/cartesian/axes":205,"../../registry":245,"./layout_attributes":260}],262:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("tinycolor2"),o=t("../../lib"),l=t("../../lib/svg_text_utils"),s=t("../../components/color"),c=t("../../components/drawing"),u=t("../../registry"),f=t("./attributes"),d=f.text,p=f.textposition,h=f.textfont,g=f.insidetextfont,v=f.outsidetextfont,y=3;function m(t,e,r,n,a,i){var o;return a<1?o="scale("+a+") ":(a=1,o=""),"translate("+(r-a*t)+" "+(n-a*e)+")"+o+(i?"rotate("+i+" "+t+" "+e+") ":"")}function x(t,e,r,n){var o=b((e=e||{}).family,r),l=b(e.size,r),s=b(e.color,r);return{family:_(t.family,o,n.family),size:function(t,e,r){if(a(e)){e=+e;var n=t.min,i=t.max,o=void 0!==n&&e<n||void 0!==i&&e>i;if(!o)return e}return void 0!==r?r:t.dflt}(t.size,l,n.size),color:function(t,e,r){return i(e).isValid()?e:void 0!==r?r:t.dflt}(t.color,s,n.color)}}function b(t,e){var r;return Array.isArray(t)?e<t.length&&(r=t[e]):r=t,r}function _(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}e.exports=function(t,e,r,i){var f=e.xaxis,w=e.yaxis,k=t._fullLayout,M=i.selectAll("g.trace.bars").data(r,function(t){return t[0].trace.uid});M.enter().append("g").attr("class","trace bars").append("g").attr("class","points"),M.exit().remove(),M.order(),M.each(function(r){var i=r[0],u=i.t,M=i.trace,A=n.select(this);e.isRangePlot||(i.node3=A);var T=u.poffset,L=Array.isArray(T),S=A.select("g.points").selectAll("g.point").data(o.identity);S.enter().append("g").classed("point",!0),S.exit().remove(),S.each(function(i,u){var A,S,C,O,P=n.select(this),z=i.p+(L?T[u]:T),D=z+i.w,E=i.b,N=E+i.s;if("h"===M.orientation?(C=w.c2p(z,!0),O=w.c2p(D,!0),A=f.c2p(E,!0),S=f.c2p(N,!0),i.ct=[S,(C+O)/2]):(A=f.c2p(z,!0),S=f.c2p(D,!0),C=w.c2p(E,!0),O=w.c2p(N,!0),i.ct=[(A+S)/2,O]),a(A)&&a(S)&&a(C)&&a(O)&&A!==S&&C!==O){var R=(i.mlw+1||M.marker.line.width+1||(i.trace?i.trace.marker.line.width:0)+1)-1,I=n.round(R/2%1,2);if(!t._context.staticPlot){var F=s.opacity(i.mc||M.marker.color)<1||R>.01?j:function(t,e){return Math.abs(t-e)>=2?j(t):t>e?Math.ceil(t):Math.floor(t)};A=F(A,S),S=F(S,A),C=F(C,O),O=F(O,C)}o.ensureSingle(P,"path").style("vector-effect","non-scaling-stroke").attr("d","M"+A+","+C+"V"+O+"H"+S+"V"+C+"Z").call(c.setClipUrl,e.layerClipId),function(t,e,r,n,a,i,s,u){var f;function w(e,r,n){var a=o.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+f,transform:"","text-anchor":"middle","data-notex":1}).call(c.font,n).call(l.convertToTspans,t);return a}var k=r[0].trace,M=k.orientation,A=function(t,e){var r=b(t.text,e);return _(d,r)}(k,n);if(f=function(t,e){var r=b(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}(p,r)}(k,n),!A||"none"===f)return void e.select("text").remove();var T,L,S,C,O,P,z=function(t,e,r){return x(h,t.textfont,e,r)}(k,n,t._fullLayout.font),D=function(t,e,r){return x(g,t.insidetextfont,e,r)}(k,n,z),E=function(t,e,r){return x(v,t.outsidetextfont,e,r)}(k,n,z),N=t._fullLayout.barmode,R="relative"===N,I="stack"===N||R,F=r[n],j=!I||F._outmost,B=Math.abs(i-a)-2*y,H=Math.abs(u-s)-2*y;"outside"===f&&(j||(f="inside"));if("auto"===f)if(j){f="inside",T=w(e,A,D),L=c.bBox(T.node()),S=L.width,C=L.height;var q=S>0&&C>0,V=S<=B&&C<=H,U=S<=H&&C<=B,G="h"===M?B>=S*(H/C):H>=C*(B/S);q&&(V||U||G)?f="inside":(f="outside",T.remove(),T=null)}else f="inside";if(!T&&(T=w(e,A,"outside"===f?E:D),L=c.bBox(T.node()),S=L.width,C=L.height,S<=0||C<=0))return void T.remove();"outside"===f?(P="both"===k.constraintext||"outside"===k.constraintext,O=function(t,e,r,n,a,i,o){var l,s="h"===i?Math.abs(n-r):Math.abs(e-t);s>2*y&&(l=y);var c=1;o&&(c="h"===i?Math.min(1,s/a.height):Math.min(1,s/a.width));var u,f,d,p,h=(a.left+a.right)/2,g=(a.top+a.bottom)/2;u=c*a.width,f=c*a.height,"h"===i?e<t?(d=e-l-u/2,p=(r+n)/2):(d=e+l+u/2,p=(r+n)/2):n>r?(d=(t+e)/2,p=n+l+f/2):(d=(t+e)/2,p=n-l-f/2);return m(h,g,d,p,c,!1)}(a,i,s,u,L,M,P)):(P="both"===k.constraintext||"inside"===k.constraintext,O=function(t,e,r,n,a,i,o){var l,s,c,u,f,d,p,h=a.width,g=a.height,v=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=Math.abs(e-t),_=Math.abs(n-r);b>2*y&&_>2*y?(b-=2*(f=y),_-=2*f):f=0;h<=b&&g<=_?(d=!1,p=1):h<=_&&g<=b?(d=!0,p=1):h<g==b<_?(d=!1,p=o?Math.min(b/h,_/g):1):(d=!0,p=o?Math.min(_/h,b/g):1);d&&(d=90);d?(l=p*g,s=p*h):(l=p*h,s=p*g);"h"===i?e<t?(c=e+f+l/2,u=(r+n)/2):(c=e-f-l/2,u=(r+n)/2):n>r?(c=(t+e)/2,u=n-f-s/2):(c=(t+e)/2,u=n+f+s/2);return m(v,x,c,u,p,d)}(a,i,s,u,L,M,P));T.attr("transform",O)}(t,P,r,u,A,S,C,O),e.layerClipId&&c.hideOutsideRangePoint(r[u],P.select("text"),f,w,M.xcalendar,M.ycalendar)}else P.remove();function j(t){return 0===k.bargap&&0===k.bargroupgap?n.round(Math.round(t)-I,2):t}});var C=!1===r[0].trace.cliponaxis;c.setClipUrl(A,C?null:e.layerClipId)}),u.getComponentMethod("errorbars","plot")(M,e)}},{"../../components/color":43,"../../components/drawing":68,"../../lib":163,"../../lib/svg_text_utils":184,"../../registry":245,"./attributes":255,d3:7,"fast-isnumeric":10,tinycolor2:25}],263:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,a=t.xaxis,i=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 l=n[r];e.contains(l.ct)?(o.push({pointNumber:r,x:a.c2d(l.x),y:i.c2d(l.y)}),l.selected=1):l.selected=0}return o}},{}],264:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib").isArrayOrTypedArray,i=t("../../constants/numerical").BADNUM,o=t("../../registry"),l=t("../../plots/cartesian/axes"),s=t("./sieve.js");function c(t,e,r,a){if(a.length){var o,c,b,_,w=t._fullLayout.barmode,k="group"===w;if("overlay"===w)u(t,e,r,a);else if(k){for(o=[],c=[],b=0;b<a.length;b++)void 0===(_=a[b])[0].trace.offset?c.push(_):o.push(_);c.length&&function(t,e,r,n){var a=t._fullLayout.barnorm,i=new s(n,!1,!a);(function(t,e,r){var n,a,i,o,l=t._fullLayout,s=l.bargap,c=l.bargroupgap,u=r.positions,f=r.distinctPositions,g=r.minDiff,v=r.traces,y=u.length!==f.length,m=v.length,x=g*(1-s),b=y?x/m:x,_=b*(1-c);for(n=0;n<m;n++){a=v[n],i=a[0];var w=y?((2*n+1-m)*b-_)/2:-_/2;(o=i.t).barwidth=_,o.poffset=w,o.bargroupwidth=x,o.bardelta=g}r.binWidth=v[0][0].t.barwidth/100,d(r),p(t,e,r),h(t,e,r,y)})(t,e,i),a?(y(t,r,i),m(t,r,i)):v(t,r,i)}(t,e,r,c),o.length&&u(t,e,r,o)}else{for(o=[],c=[],b=0;b<a.length;b++)void 0===(_=a[b])[0].trace.base?c.push(_):o.push(_);c.length&&function(t,e,r,a){var o=t._fullLayout.barmode,c="stack"===o,u="relative"===o,d=t._fullLayout.barnorm,p=new s(a,u,!(d||c||u));f(t,e,p),function(t,e,r){var a,o,s,c,u=t._fullLayout.barnorm,f=x(e),d=r.traces,p=[null,null];for(a=0;a<d.length;a++)for(o=d[a],s=0;s<o.length;s++)if((c=o[s]).s!==i){var h=r.put(c.p,c.b+c.s),v=h+c.b+c.s;c.b=h,c[f]=v,u||(n(e.c2l(v))&&g(p,v),c.hasB&&n(e.c2l(h))&&g(p,h))}u||l.expand(e,p,{tozero:!0,padded:!0})}(t,r,p);for(var h=0;h<a.length;h++)for(var v=a[h],y=0;y<v.length;y++){var b=v[y];if(b.s!==i){var _=b.b+b.s===p.get(b.p,b.s);_&&(b._outmost=!0)}}d&&m(t,r,p)}(t,e,r,c),o.length&&u(t,e,r,o)}!function(t,e){var r,a,i,o=e._id.charAt(0),l={},s=1/0,c=-1/0;for(r=0;r<t.length;r++)for(i=t[r],a=0;a<i.length;a++){var u=i[a].p;n(u)&&(s=Math.min(s,u),c=Math.max(c,u))}var f=1e4/(c-s),d=l.round=function(t){return String(Math.round(f*(t-s)))};for(r=0;r<t.length;r++)for((i=t[r])[0].t.extents=l,a=0;a<i.length;a++){var p=i[a],h=p[o]-p.w/2;if(n(h)){var g=p[o]+p.w/2,v=d(p.p);l[v]?l[v]=[Math.min(h,l[v][0]),Math.max(g,l[v][1])]:l[v]=[h,g]}}}(a,e)}}function u(t,e,r,n){for(var a=t._fullLayout.barnorm,i=!a,o=0;o<n.length;o++){var l=n[o],c=new s([l],!1,i);f(t,e,c),a?(y(t,r,c),m(t,r,c)):v(t,r,c)}}function f(t,e,r){var n,a,i=t._fullLayout,o=i.bargap,l=i.bargroupgap,s=r.minDiff,c=r.traces,u=s*(1-o),f=u*(1-l),g=-f/2;for(n=0;n<c.length;n++)(a=c[n][0].t).barwidth=f,a.poffset=g,a.bargroupwidth=u,a.bardelta=s;r.binWidth=c[0][0].t.barwidth/100,d(r),p(t,e,r),h(t,e,r)}function d(t){var e,r,i,o,l,s,c=t.traces;for(e=0;e<c.length;e++){o=(i=(r=c[e])[0]).trace,s=i.t;var u,f=o.offset,d=s.poffset;if(a(f)){for(u=f.slice(0,r.length),l=0;l<u.length;l++)n(u[l])||(u[l]=d);for(l=u.length;l<r.length;l++)u.push(d);s.poffset=u}else void 0!==f&&(s.poffset=f);var p=o.width,h=s.barwidth;if(a(p)){var g=p.slice(0,r.length);for(l=0;l<g.length;l++)n(g[l])||(g[l]=h);for(l=g.length;l<r.length;l++)g.push(h);if(s.barwidth=g,void 0===f){for(u=[],l=0;l<r.length;l++)u.push(d+(h-g[l])/2);s.poffset=u}}else void 0!==p&&(s.barwidth=p,void 0===f&&(s.poffset=d+(h-p)/2))}}function p(t,e,r){for(var n=r.traces,a=x(e),i=0;i<n.length;i++)for(var o=n[i],l=o[0].t,s=l.poffset,c=Array.isArray(s),u=l.barwidth,f=Array.isArray(u),d=0;d<o.length;d++){var p=o[d],h=p.w=f?u[d]:u;p[a]=p.p+(c?s[d]:s)+h/2}}function h(t,e,r,n){var a=r.traces,i=r.distinctPositions,o=i[0],s=r.minDiff,c=s/2;l.minDtick(e,s,o,n);for(var u=Math.min.apply(Math,i)-c,f=Math.max.apply(Math,i)+c,d=0;d<a.length;d++){var p=a[d],h=p[0],g=h.trace;if(void 0!==g.width||void 0!==g.offset)for(var v=h.t,y=v.poffset,m=v.barwidth,x=Array.isArray(y),b=Array.isArray(m),_=0;_<p.length;_++){var w=p[_],k=x?y[_]:y,M=b?m[_]:m,A=w.p+k,T=A+M;u=Math.min(u,A),f=Math.max(f,T)}}l.expand(e,[u,f],{padded:!1})}function g(t,e){n(t[0])?t[0]=Math.min(t[0],e):t[0]=e,n(t[1])?t[1]=Math.max(t[1],e):t[1]=e}function v(t,e,r){for(var a=r.traces,i=x(e),o=[null,null],s=0;s<a.length;s++)for(var c=a[s],u=0;u<c.length;u++){var f=c[u],d=f.b,p=d+f.s;f[i]=p,n(e.c2l(p))&&g(o,p),f.hasB&&n(e.c2l(d))&&g(o,d)}l.expand(e,o,{tozero:!0,padded:!0})}function y(t,e,r){for(var n=r.traces,a=0;a<n.length;a++)for(var o=n[a],l=0;l<o.length;l++){var s=o[l];s.s!==i&&r.put(s.p,s.b+s.s)}}function m(t,e,r){var a=r.traces,o=x(e),s="fraction"===t._fullLayout.barnorm?1:100,c=s/1e9,u=e.l2c(e.c2l(0)),f="stack"===t._fullLayout.barmode?s:u,d=[u,f],p=!1;function h(t){n(e.c2l(t))&&(t<u-c||t>f+c||!n(u))&&(p=!0,g(d,t))}for(var v=0;v<a.length;v++)for(var y=a[v],m=0;m<y.length;m++){var b=y[m];if(b.s!==i){var _=Math.abs(s/r.get(b.p,b.s));b.b*=_,b.s*=_;var w=b.b,k=w+b.s;b[o]=k,h(k),b.hasB&&h(w)}}l.expand(e,d,{tozero:!0,padded:p})}function x(t){return t._id.charAt(0)}e.exports=function(t,e){var r,n=e.xaxis,a=e.yaxis,i=t._fullData,l=t.calcdata,s=[],u=[];for(r=0;r<i.length;r++){var f=i[r];!0===f.visible&&o.traceIs(f,"bar")&&f.xaxis===n._id&&f.yaxis===a._id&&("h"===f.orientation?s.push(l[r]):u.push(l[r]))}c(t,n,a,u),c(t,a,n,s)}},{"../../constants/numerical":145,"../../lib":163,"../../plots/cartesian/axes":205,"../../registry":245,"./sieve.js":265,"fast-isnumeric":10}],265:[function(t,e,r){"use strict";e.exports=i;var n=t("../../lib"),a=t("../../constants/numerical").BADNUM;function i(t,e,r){this.traces=t,this.separateNegativeValues=e,this.dontMergeOverlappingData=r;for(var i=1/0,o=[],l=0;l<t.length;l++){for(var s=t[l],c=0;c<s.length;c++){var u=s[c];u.p!==a&&o.push(u.p)}s[0]&&s[0].width1&&(i=Math.min(s[0].width1,i))}this.positions=o;var f=n.distinctVals(o);this.distinctPositions=f.vals,1===f.vals.length&&i!==1/0?this.minDiff=i:this.minDiff=Math.min(f.minDiff,i),this.binWidth=this.minDiff,this.bins={}}i.prototype.put=function(t,e){var r=this.getLabel(t,e),n=this.bins[r]||0;return this.bins[r]=n+e,n},i.prototype.get=function(t,e){var r=this.getLabel(t,e);return this.bins[r]||0},i.prototype.getLabel=function(t,e){return(e<0&&this.separateNegativeValues?"v":"^")+(this.dontMergeOverlappingData?t:Math.round(t/this.binWidth))}},{"../../constants/numerical":145,"../../lib":163}],266:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/drawing"),i=t("../../registry");function o(t,e,r){var i=t.selectAll("path"),o=t.selectAll("text");a.pointStyle(i,e,r),o.each(function(t){var r,i=n.select(this);function o(e){var n=r[e];return Array.isArray(n)?n[t.i]:n}i.classed("bartext-inside")?r=e.insidetextfont:i.classed("bartext-outside")&&(r=e.outsidetextfont),r||(r=e.textfont),a.font(i,o("family"),o("size"),o("color"))})}e.exports={style:function(t,e){var r=e?e[0].node3:n.select(t).selectAll("g.trace.bars"),a=r.size(),l=t._fullLayout;r.style("opacity",function(t){return t[0].trace.opacity}).each(function(t){("stack"===l.barmode&&a>1||0===l.bargap&&0===l.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),r.selectAll("g.points").each(function(e){o(n.select(this),e[0].trace,t)}),i.getComponentMethod("errorbars","style")(r)},styleOnSelect:function(t,e){var r=e[0].node3,n=e[0].trace;n.selectedpoints?(a.selectedPointStyle(r.selectAll("path"),n),a.selectedTextStyle(r.selectAll("text"),n)):o(r,n,t)}}},{"../../components/drawing":68,"../../registry":245,d3:7}],267:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,l){r("marker.color",o),a(t,"marker")&&i(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(t,"marker.line")&&i(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":43,"../../components/colorscale/defaults":53,"../../components/colorscale/has_colorscale":57}],268:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),a=t("../../plots/font_attributes"),i=t("../../plots/attributes"),o=t("../../plots/domain").attributes,l=t("../../lib/extend").extendFlat,s=a({editType:"calc",colorEditType:"style"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:l({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},textfont:l({},s,{}),insidetextfont:l({},s,{}),outsidetextfont:l({},s,{}),domain:o({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}},{"../../components/color/attributes":42,"../../lib/extend":157,"../../plots/attributes":202,"../../plots/domain":230,"../../plots/font_attributes":231}],269:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/get_data").getModuleCalcData;r.name="pie",r.plot=function(t){var e=n.getModule("pie"),r=a(t.calcdata,e)[0];r.length&&e.plot(t,r)},r.clean=function(t,e,r,n){var a=n._has&&n._has("pie"),i=e._has&&e._has("pie");a&&!i&&n._pielayer.selectAll("g.trace").remove()}},{"../../plots/get_data":233,"../../registry":245}],270:[function(t,e,r){"use strict";var n,a=t("fast-isnumeric"),i=t("../../lib").isArrayOrTypedArray,o=t("tinycolor2"),l=t("../../components/color"),s=t("./helpers");function c(t,e){if(!n){var r=l.defaults;n=u(r)}var a=e||n;return a[t%a.length]}function u(t){var e,r=t.slice();for(e=0;e<t.length;e++)r.push(o(t[e]).lighten(20).toHexString());for(e=0;e<t.length;e++)r.push(o(t[e]).darken(20).toHexString());return r}e.exports=function(t,e){var r,n,f,d,p,h=e.values,g=i(h)&&h.length,v=e.labels,y=e.marker.colors||[],m=[],x=t._fullLayout,b=x.colorway,_=x._piecolormap,w={},k=0,M=x.hiddenlabels||[];if(x._piecolorway||b===l.defaults||(x._piecolorway=u(b)),e.dlabel)for(v=new Array(h.length),r=0;r<h.length;r++)v[r]=String(e.label0+r*e.dlabel);function A(t,e){return!!t&&(!!(t=o(t)).isValid()&&(t=l.addOpacity(t,t.getAlpha()),_[e]||(_[e]=t),t))}var T=(g?h:v).length;for(r=0;r<T;r++){if(g){if(n=h[r],!a(n))continue;if((n=+n)<0)continue}else n=1;void 0!==(f=v[r])&&""!==f||(f=r);var L=w[f=String(f)];void 0===L?(w[f]=m.length,(d=-1!==M.indexOf(f))||(k+=n),m.push({v:n,label:f,color:A(y[r]),i:r,pts:[r],hidden:d})):((p=m[L]).v+=n,p.pts.push(r),p.hidden||(k+=n),!1===p.color&&y[r]&&(p.color=A(y[r],f)))}for(e.sort&&m.sort(function(t,e){return e.v-t.v}),r=0;r<m.length;r++)!1===(p=m[r]).color&&(_[p.label]?p.color=_[p.label]:(_[p.label]=p.color=c(x._piedefaultcolorcount,x._piecolorway),x._piedefaultcolorcount++));if(m[0]&&(m[0].vTotal=k),e.textinfo&&"none"!==e.textinfo){var S,C=-1!==e.textinfo.indexOf("label"),O=-1!==e.textinfo.indexOf("text"),P=-1!==e.textinfo.indexOf("value"),z=-1!==e.textinfo.indexOf("percent"),D=x.separators;for(r=0;r<m.length;r++){if(p=m[r],S=C?[p.label]:[],O){var E=s.getFirstFilled(e.text,p.pts);E&&S.push(E)}P&&S.push(s.formatPieValue(p.v,D)),z&&S.push(s.formatPiePercent(p.v/k,D)),p.text=S.join("<br>")}}return m}},{"../../components/color":43,"../../lib":163,"./helpers":273,"fast-isnumeric":10,tinycolor2:25}],271:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("../../plots/domain").defaults;e.exports=function(t,e,r,o){function l(r,i){return n.coerce(t,e,a,r,i)}var s,c=n.coerceFont,u=l("values"),f=n.isArrayOrTypedArray(u),d=l("labels");if(Array.isArray(d)&&(s=d.length,f&&(s=Math.min(s,u.length))),!Array.isArray(d)){if(!f)return void(e.visible=!1);s=u.length,l("label0"),l("dlabel")}if(s){e._length=s,l("marker.line.width")&&l("marker.line.color"),l("marker.colors"),l("scalegroup");var p=l("text"),h=l("textinfo",Array.isArray(p)?"text+percent":"percent");if(l("hovertext"),h&&"none"!==h){var g=l("textposition"),v=Array.isArray(g)||"auto"===g,y=v||"inside"===g,m=v||"outside"===g;if(y||m){var x=c(l,"textfont",o.font);y&&c(l,"insidetextfont",x),m&&c(l,"outsidetextfont",x)}}i(e,o,l),l("hole"),l("sort"),l("direction"),l("rotation"),l("pull")}else e.visible=!1}},{"../../lib":163,"../../plots/domain":230,"./attributes":268}],272:[function(t,e,r){"use strict";var n=t("../../components/fx/helpers").appendArrayMultiPointValues;e.exports=function(t,e){var r={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,v:t.v};return 1===t.pts.length&&(r.pointNumber=r.i=t.pts[0]),n(r,e,t.pts),r}},{"../../components/fx/helpers":82}],273:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)},r.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}},r.castOption=function(t,e){return Array.isArray(t)?r.getFirstFilled(t,e):t||void 0}},{"../../lib":163}],274:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.layoutAttributes=t("./layout_attributes"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.styleOne=t("./style_one"),n.moduleType="trace",n.name="pie",n.basePlotModule=t("./base_plot"),n.categories=["pie","showLegend"],n.meta={},e.exports=n},{"./attributes":268,"./base_plot":269,"./calc":270,"./defaults":271,"./layout_attributes":275,"./layout_defaults":276,"./plot":277,"./style":278,"./style_one":279}],275:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array",editType:"calc"}}},{}],276:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){var r,i;r="hiddenlabels",n.coerce(t,e,a,r,i)}},{"../../lib":163,"./layout_attributes":275}],277:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/fx"),i=t("../../components/color"),o=t("../../components/drawing"),l=t("../../lib"),s=t("../../lib/svg_text_utils"),c=t("./helpers"),u=t("./event_data");function f(t,e){if(t.v===e.vTotal&&!e.trace.hole)return 1;var r=Math.PI*Math.min(t.v/e.vTotal,.5);return Math.min(1/(1+1/Math.sin(r)),(1-e.trace.hole)/2)}function d(t,e){var r=e.pxmid[0],n=e.pxmid[1],a=t.width/2,i=t.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}e.exports=function(t,e){var r=t._fullLayout;!function(t,e){var r,n,a,i,o,l,s,c,u,f=[];for(a=0;a<t.length;a++){if(o=t[a][0],l=o.trace,r=e.w*(l.domain.x[1]-l.domain.x[0]),n=e.h*(l.domain.y[1]-l.domain.y[0]),s=l.pull,Array.isArray(s))for(s=0,i=0;i<l.pull.length;i++)l.pull[i]>s&&(s=l.pull[i]);o.r=Math.min(r,n)/(2+2*s),o.cx=e.l+e.w*(l.domain.x[1]+l.domain.x[0])/2,o.cy=e.t+e.h*(2-l.domain.y[1]-l.domain.y[0])/2,l.scalegroup&&-1===f.indexOf(l.scalegroup)&&f.push(l.scalegroup)}for(i=0;i<f.length;i++){for(u=1/0,c=f[i],a=0;a<t.length;a++)(o=t[a][0]).trace.scalegroup===c&&(u=Math.min(u,o.r*o.r/o.vTotal));for(a=0;a<t.length;a++)(o=t[a][0]).trace.scalegroup===c&&(o.r=Math.sqrt(u*o.vTotal))}}(e,r._size);var p=r._pielayer.selectAll("g.trace").data(e);p.enter().append("g").attr({"stroke-linejoin":"round",class:"trace"}),p.exit().remove(),p.order(),p.each(function(e){var p=n.select(this),h=e[0],g=h.trace;!function(t){var e,r,n,a=t[0],i=a.trace,o=i.rotation*Math.PI/180,l=2*Math.PI/a.vTotal,s="px0",c="px1";if("counterclockwise"===i.direction){for(e=0;e<t.length&&t[e].hidden;e++);if(e===t.length)return;o+=l*t[e].v,l*=-1,s="px1",c="px0"}function u(t){return[a.r*Math.sin(t),-a.r*Math.cos(t)]}for(n=u(o),e=0;e<t.length;e++)(r=t[e]).hidden||(r[s]=n,o+=l*r.v/2,r.pxmid=u(o),r.midangle=o,o+=l*r.v/2,n=u(o),r[c]=n,r.largeArc=r.v>a.vTotal/2?1:0)}(e),p.each(function(){var p=n.select(this).selectAll("g.slice").data(e);p.enter().append("g").classed("slice",!0),p.exit().remove();var v=[[[],[]],[[],[]]],y=!1;p.each(function(e){if(e.hidden)n.select(this).selectAll("path,g").remove();else{e.pointNumber=e.i,e.curveNumber=g.index,v[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var i=h.cx,p=h.cy,m=n.select(this),x=m.selectAll("path.surface").data([e]),b=!1,_=!1;if(x.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),m.select("path.textline").remove(),m.on("mouseover",function(){var o=t._fullLayout,l=t._fullData[g.index];if(!t._dragging&&!1!==o.hovermode){var s=l.hoverinfo;if(Array.isArray(s)&&(s=a.castHoverinfo({hoverinfo:[c.castOption(s,e.pts)],_module:g._module},o,0)),"all"===s&&(s="label+text+value+percent+name"),"none"!==s&&"skip"!==s&&s){var d=f(e,h),v=i+e.pxmid[0]*(1-d),y=p+e.pxmid[1]*(1-d),m=r.separators,x=[];if(-1!==s.indexOf("label")&&x.push(e.label),-1!==s.indexOf("text")){var w=c.castOption(l.hovertext||l.text,e.pts);w&&x.push(w)}-1!==s.indexOf("value")&&x.push(c.formatPieValue(e.v,m)),-1!==s.indexOf("percent")&&x.push(c.formatPiePercent(e.v/h.vTotal,m));var k=g.hoverlabel,M=k.font;a.loneHover({x0:v-d*h.r,x1:v+d*h.r,y:y,text:x.join("<br>"),name:-1!==s.indexOf("name")?l.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:c.castOption(k.bgcolor,e.pts)||e.color,borderColor:c.castOption(k.bordercolor,e.pts),fontFamily:c.castOption(M.family,e.pts),fontSize:c.castOption(M.size,e.pts),fontColor:c.castOption(M.color,e.pts)},{container:o._hoverlayer.node(),outerContainer:o._paper.node(),gd:t}),b=!0}t.emit("plotly_hover",{points:[u(e,l)],event:n.event}),_=!0}}).on("mouseout",function(r){var i=t._fullLayout,o=t._fullData[g.index];_&&(r.originalEvent=n.event,t.emit("plotly_unhover",{points:[u(e,o)],event:n.event}),_=!1),b&&(a.loneUnhover(i._hoverlayer.node()),b=!1)}).on("click",function(){var r=t._fullLayout,i=t._fullData[g.index];t._dragging||!1===r.hovermode||(t._hoverdata=[u(e,i)],a.click(t,n.event))}),g.pull){var w=+c.castOption(g.pull,e.pts)||0;w>0&&(i+=w*e.pxmid[0],p+=w*e.pxmid[1])}e.cxFinal=i,e.cyFinal=p;var k=g.hole;if(e.v===h.vTotal){var M="M"+(i+e.px0[0])+","+(p+e.px0[1])+C(e.px0,e.pxmid,!0,1)+C(e.pxmid,e.px0,!0,1)+"Z";k?x.attr("d","M"+(i+k*e.px0[0])+","+(p+k*e.px0[1])+C(e.px0,e.pxmid,!1,k)+C(e.pxmid,e.px0,!1,k)+"Z"+M):x.attr("d",M)}else{var A=C(e.px0,e.px1,!0,1);if(k){var T=1-k;x.attr("d","M"+(i+k*e.px1[0])+","+(p+k*e.px1[1])+C(e.px1,e.px0,!1,k)+"l"+T*e.px0[0]+","+T*e.px0[1]+A+"Z")}else x.attr("d","M"+i+","+p+"l"+e.px0[0]+","+e.px0[1]+A+"Z")}var L=c.castOption(g.textposition,e.pts),S=m.selectAll("g.slicetext").data(e.text&&"none"!==L?[0]:[]);S.enter().append("g").classed("slicetext",!0),S.exit().remove(),S.each(function(){var r=l.ensureSingle(n.select(this),"text","",function(t){t.attr("data-notex",1)});r.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(o.font,"outside"===L?g.outsidetextfont:g.insidetextfont).call(s.convertToTspans,t);var a,c=o.bBox(r.node());"outside"===L?a=d(c,e):(a=function(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),a=t.width/t.height,i=Math.PI*Math.min(e.v/r.vTotal,.5),o=1-r.trace.hole,l=f(e,r),s={scale:l*r.r*2/n,rCenter:1-l,rotate:0};if(s.scale>=1)return s;var c=a+1/(2*Math.tan(i)),u=r.r*Math.min(1/(Math.sqrt(c*c+.5)+c),o/(Math.sqrt(a*a+o/2)+a)),d={scale:2*u/t.height,rCenter:Math.cos(u/r.r)-u*a/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},p=1/a,h=p+1/(2*Math.tan(i)),g=r.r*Math.min(1/(Math.sqrt(h*h+.5)+h),o/(Math.sqrt(p*p+o/2)+p)),v={scale:2*g/t.width,rCenter:Math.cos(g/r.r)-g/a/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},y=v.scale>d.scale?v:d;return s.scale<1&&y.scale>s.scale?y:s}(c,e,h),"auto"===L&&a.scale<1&&(r.call(o.font,g.outsidetextfont),g.outsidetextfont.family===g.insidetextfont.family&&g.outsidetextfont.size===g.insidetextfont.size||(c=o.bBox(r.node())),a=d(c,e)));var u=i+e.pxmid[0]*a.rCenter+(a.x||0),v=p+e.pxmid[1]*a.rCenter+(a.y||0);a.outside&&(e.yLabelMin=v-c.height/2,e.yLabelMid=v,e.yLabelMax=v+c.height/2,e.labelExtraX=0,e.labelExtraY=0,y=!0),r.attr("transform","translate("+u+","+v+")"+(a.scale<1?"scale("+a.scale+")":"")+(a.rotate?"rotate("+a.rotate+")":"")+"translate("+-(c.left+c.right)/2+","+-(c.top+c.bottom)/2+")")})}function C(t,r,n,a){return"a"+a*h.r+","+a*h.r+" 0 "+e.largeArc+(n?" 1 ":" 0 ")+a*(r[0]-t[0])+","+a*(r[1]-t[1])}}),y&&function(t,e){var r,n,a,i,o,l,s,u,f,d,p,h,g;function v(t,e){return t.pxmid[1]-e.pxmid[1]}function y(t,e){return e.pxmid[1]-t.pxmid[1]}function m(t,r){r||(r={});var a,u,f,p,h,g,v=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),y=n?t.yLabelMin:t.yLabelMax,m=n?t.yLabelMax:t.yLabelMin,x=t.cyFinal+o(t.px0[1],t.px1[1]),b=v-y;if(b*s>0&&(t.labelExtraY=b),Array.isArray(e.pull))for(u=0;u<d.length;u++)(f=d[u])===t||(c.castOption(e.pull,t.pts)||0)>=(c.castOption(e.pull,f.pts)||0)||((t.pxmid[1]-f.pxmid[1])*s>0?(p=f.cyFinal+o(f.px0[1],f.px1[1]),(b=p-y-t.labelExtraY)*s>0&&(t.labelExtraY+=b)):(m+t.labelExtraY-x)*s>0&&(a=3*l*Math.abs(u-d.indexOf(t)),h=f.cxFinal+i(f.px0[0],f.px1[0]),(g=h+a-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*l>0&&(t.labelExtraX+=g)))}for(n=0;n<2;n++)for(a=n?v:y,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(u=t[n][r]).sort(a),f=t[1-n][r],d=f.concat(u),h=[],p=0;p<u.length;p++)void 0!==u[p].yLabelMid&&h.push(u[p]);for(g=!1,p=0;n&&p<f.length;p++)if(void 0!==f[p].yLabelMid){g=f[p];break}for(p=0;p<h.length;p++){var x=p&&h[p-1];g&&!p&&(x=g),m(h[p],x)}}}(v,g),p.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=n.select(this),r=e.select("g.slicetext text");r.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+r.attr("transform"));var a=t.cxFinal+t.pxmid[0],o="M"+a+","+(t.cyFinal+t.pxmid[1]),l=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var s=t.labelExtraX*t.pxmid[1]/t.pxmid[0],c=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(s)>Math.abs(c)?o+="l"+c*t.pxmid[0]/t.pxmid[1]+","+c+"H"+(a+t.labelExtraX+l):o+="l"+t.labelExtraX+","+s+"v"+(c-s)+"h"+l}else o+="V"+(t.yLabelMid+t.labelExtraY)+"h"+l;e.append("path").classed("textline",!0).call(i.stroke,g.outsidetextfont.color).attr({"stroke-width":Math.min(2,g.outsidetextfont.size/8),d:o,fill:"none"})}})})}),setTimeout(function(){p.selectAll("tspan").each(function(){var t=n.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":43,"../../components/drawing":68,"../../components/fx":85,"../../lib":163,"../../lib/svg_text_utils":184,"./event_data":272,"./helpers":273,d3:7}],278:[function(t,e,r){"use strict";var n=t("d3"),a=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each(function(t){n.select(this).call(a,t,e)})})}},{"./style_one":279,d3:7}],279:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("./helpers").castOption;e.exports=function(t,e,r){var i=r.marker.line,o=a(i.color,e.pts)||n.defaultLine,l=a(i.width,e.pts)||0;t.style({"stroke-width":l}).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":43,"./helpers":273}],280:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r<t.length;r++)t[r].i=r;n.mergeArray(e.text,t,"tx"),n.mergeArray(e.hovertext,t,"htx"),n.mergeArray(e.customdata,t,"data"),n.mergeArray(e.textposition,t,"tp"),e.textfont&&(n.mergeArray(e.textfont.size,t,"ts"),n.mergeArray(e.textfont.color,t,"tc"),n.mergeArray(e.textfont.family,t,"tf"));var a=e.marker;if(a){n.mergeArray(a.size,t,"ms"),n.mergeArray(a.opacity,t,"mo"),n.mergeArray(a.symbol,t,"mx"),n.mergeArray(a.color,t,"mc");var i=a.line;a.line&&(n.mergeArray(i.color,t,"mlc"),n.mergeArray(i.width,t,"mlw"));var o=a.gradient;o&&"none"!==o.type&&(n.mergeArray(o.type,t,"mgt"),n.mergeArray(o.color,t,"mgc"))}}},{"../../lib":163}],281:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),a=t("../../components/colorbar/attributes"),i=t("../../plots/font_attributes"),o=t("../../components/drawing/attributes").dash,l=t("../../components/drawing"),s=(t("./constants"),t("../../lib/extend").extendFlat);e.exports={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:s({},o,{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:s({symbol:{valType:"enumerated",values:l.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:a,line:s({width:{valType:"number",min:0,arrayOk:!0,editType:"style"},editType:"calc"},n("marker.line")),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"},n("marker")),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:i({editType:"calc",colorEditType:"style",arrayOk:!0}),r:{valType:"data_array",editType:"calc"},t:{valType:"data_array",editType:"calc"}}},{"../../components/colorbar/attributes":44,"../../components/colorscale/color_attributes":51,"../../components/drawing":68,"../../components/drawing/attributes":67,"../../lib/extend":157,"../../plots/font_attributes":231,"./constants":287}],282:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib").isArrayOrTypedArray,i=t("../../plots/cartesian/axes"),o=t("../../constants/numerical").BADNUM,l=t("./subtypes"),s=t("./colorscale_calc"),c=t("./arrays_to_calcdata"),u=t("./calc_selection");function f(t,e,r,n,a,o,s){var c=e._length;r._minDtick=0,n._minDtick=0;var u={padded:!0},f={padded:!0};s&&(u.ppad=f.ppad=s),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||a[0]===a[c-1]&&o[0]===o[c-1]?(e.error_y||{}).visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(l.hasMarkers(e)||l.hasText(e))||(u.padded=!1,u.ppad=0):u.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||a[0]===a[c-1]&&o[0]===o[c-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(f.padded=!1):f.tozero=!0,i.expand(r,a,u),i.expand(n,o,f)}function d(t,e){if(l.hasMarkers(t)){var r,n=t.marker,o=1.6*(t.marker.sizeref||1);if(r="area"===t.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/o),3)}:function(t){return Math.max((t||0)/o,3)},a(n.size)){var s={type:"linear"};i.setConvert(s);for(var c=s.makeCalcdata(t.marker,"size"),u=new Array(e),f=0;f<e;f++)u[f]=r(c[f]);return u}return r(n.size)}}e.exports={calc:function(t,e){var r=i.getFromId(t,e.xaxis||"x"),a=i.getFromId(t,e.yaxis||"y"),l=r.makeCalcdata(e,"x"),p=a.makeCalcdata(e,"y"),h=e._length,g=new Array(h);f(t,e,r,a,l,p,d(e,h));for(var v=0;v<h;v++)g[v]=n(l[v])&&n(p[v])?{x:l[v],y:p[v]}:{x:o,y:o},e.ids&&(g[v].id=String(e.ids[v]));return c(g,e),s(e),u(g,e),t.firstscatter=!1,g},calcMarkerSize:d,calcAxisExpansion:f}},{"../../constants/numerical":145,"../../lib":163,"../../plots/cartesian/axes":205,"./arrays_to_calcdata":280,"./calc_selection":283,"./colorscale_calc":286,"./subtypes":303,"fast-isnumeric":10}],283:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){n.isArrayOrTypedArray(e.selectedpoints)&&n.tagSelected(t,e)}},{"../../lib":163}],284:[function(t,e,r){"use strict";e.exports=function(t){for(var e=0;e<t.length;e++){var r=t[e];if("scatter"===r.type){var n=r.fill;if("none"!==n&&"toself"!==n&&(r.opacity=void 0,"tonexty"===n||"tonextx"===n))for(var a=e-1;a>=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],285:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../components/colorscale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,s=r.marker,c="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0!==s&&s.showscale){var u=s.color,f=s.cmin,d=s.cmax;n(f)||(f=a.aggNums(Math.min,null,u)),n(d)||(d=a.aggNums(Math.max,null,u));var p=e[0].t.cb=l(t,c),h=o.makeColorScaleFunc(o.extractScale(s.colorscale,f,d),{noNumericCheck:!0});p.fillcolor(h).filllevels({start:f,end:d,size:(d-f)/254}).options(s.colorbar)()}else i.autoMargin(t,c)}},{"../../components/colorbar/draw":47,"../../components/colorscale":58,"../../lib":163,"../../plots/plots":237,"fast-isnumeric":10}],286:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/calc"),i=t("./subtypes");e.exports=function(t){i.hasLines(t)&&n(t,"line")&&a(t,t.line.color,"line","c"),i.hasMarkers(t)&&(n(t,"marker")&&a(t,t.marker.color,"marker","c"),n(t,"marker.line")&&a(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":50,"../../components/colorscale/has_colorscale":57,"./subtypes":303}],287:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],288:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("./constants"),l=t("./subtypes"),s=t("./xy_defaults"),c=t("./marker_defaults"),u=t("./line_defaults"),f=t("./line_shape_defaults"),d=t("./text_defaults"),p=t("./fillcolor_defaults");e.exports=function(t,e,r,h){function g(r,a){return n.coerce(t,e,i,r,a)}var v=s(t,e,h,g),y=v<o.PTS_LINESONLY?"lines+markers":"lines";if(v){g("text"),g("hovertext"),g("mode",y),l.hasLines(e)&&(u(t,e,r,h,g),f(t,e,g),g("connectgaps"),g("line.simplify")),l.hasMarkers(e)&&c(t,e,r,h,g,{gradient:!0}),l.hasText(e)&&d(t,e,h,g);var m=[];(l.hasMarkers(e)||l.hasText(e))&&(g("cliponaxis"),g("marker.maxdisplayed"),m.push("points")),g("fill"),"none"!==e.fill&&(p(t,e,r,g),l.hasLines(e)||f(t,e,g)),"tonext"!==e.fill&&"toself"!==e.fill||m.push("fills"),g("hoveron",m.join("+")||"points");var x=a.getComponentMethod("errorbars","supplyDefaults");x(t,e,r,{axis:"y"}),x(t,e,r,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,g)}else e.visible=!1}},{"../../lib":163,"../../registry":245,"./attributes":281,"./constants":287,"./fillcolor_defaults":290,"./line_defaults":294,"./line_shape_defaults":296,"./marker_defaults":299,"./subtypes":303,"./text_defaults":304,"./xy_defaults":305}],289:[function(t,e,r){"use strict";var n=t("../../lib");function a(t){return t||0===t}e.exports=function(t,e,r){var i=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},o=n.extractOption(t,e,"htx","hovertext");if(a(o))return i(o);var l=n.extractOption(t,e,"tx","text");return a(l)?i(l):void 0}},{"../../lib":163}],290:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,i){var o=!1;if(e.marker){var l=e.marker.color,s=(e.marker.line||{}).color;l&&!a(l)?o=l:s&&!a(s)&&(o=s)}i("fillcolor",n.addOpacity((e.line||{}).color||o||r,.5))}},{"../../components/color":43,"../../lib":163}],291:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("./subtypes");e.exports=function(t,e){var r,i;if("lines"===t.mode)return(r=t.line.color)&&n.opacity(r)?r:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var o=e.mcc||(t.marker||{}).color,l=e.mlcc||((t.marker||{}).line||{}).color;return(i=o&&n.opacity(o)?o:l&&n.opacity(l)&&(e.mlw||((t.marker||{}).line||{}).width)?l:"")?n.opacity(i)<.3?n.addOpacity(i,.3):i:(r=(t.line||{}).color)&&n.opacity(r)&&a.hasLines(t)&&t.line.width?r:t.fillcolor}},{"../../components/color":43,"./subtypes":303}],292:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/fx"),i=t("../../registry"),o=t("./get_trace_color"),l=t("../../components/color"),s=t("./fill_hover_text");e.exports=function(t,e,r,c){var u=t.cd,f=u[0].trace,d=t.xa,p=t.ya,h=d.c2p(e),g=p.c2p(r),v=[h,g],y=f.hoveron||"",m=-1!==f.mode.indexOf("markers")?3:.5;if(-1!==y.indexOf("points")){var x=function(t){var e=Math.max(m,t.mrc||0),r=d.c2p(t.x)-h,n=p.c2p(t.y)-g;return Math.max(Math.sqrt(r*r+n*n)-e,1-m/e)},b=a.getDistanceFunction(c,function(t){var e=Math.max(3,t.mrc||0),r=1-1/e,n=Math.abs(d.c2p(t.x)-h);return n<e?r*n/e:n-e+r},function(t){var e=Math.max(3,t.mrc||0),r=1-1/e,n=Math.abs(p.c2p(t.y)-g);return n<e?r*n/e:n-e+r},x);if(a.getClosest(u,b,t),!1!==t.index){var _=u[t.index],w=d.c2p(_.x,!0),k=p.c2p(_.y,!0),M=_.mrc||1;return n.extendFlat(t,{color:o(f,_),x0:w-M,x1:w+M,xLabelVal:_.x,y0:k-M,y1:k+M,yLabelVal:_.y,spikeDistance:x(_)}),s(_,f,t),i.getComponentMethod("errorbars","hoverInfo")(_,f,t),[t]}}if(-1!==y.indexOf("fills")&&f._polygons){var A,T,L,S,C,O,P,z,D,E=f._polygons,N=[],R=!1,I=1/0,F=-1/0,j=1/0,B=-1/0;for(A=0;A<E.length;A++)(L=E[A]).contains(v)&&(R=!R,N.push(L),j=Math.min(j,L.ymin),B=Math.max(B,L.ymax));if(R){var H=((j=Math.max(j,0))+(B=Math.min(B,p._length)))/2;for(A=0;A<N.length;A++)for(S=N[A].pts,T=1;T<S.length;T++)(z=S[T-1][1])>H!=(D=S[T][1])>=H&&(O=S[T-1][0],P=S[T][0],D-z&&(C=O+(P-O)*(H-z)/(D-z),I=Math.min(I,C),F=Math.max(F,C)));I=Math.max(I,0),F=Math.min(F,d._length);var q=l.defaultLine;return l.opacity(f.fillcolor)?q=f.fillcolor:l.opacity((f.line||{}).color)&&(q=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:I,x1:F,y0:H,y1:H,color:q}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":43,"../../components/fx":85,"../../lib":163,"../../registry":245,"./fill_hover_text":289,"./get_trace_color":291}],293:[function(t,e,r){"use strict";var n={},a=t("./subtypes");n.hasLines=a.hasLines,n.hasMarkers=a.hasMarkers,n.hasText=a.hasText,n.isBubble=a.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.cleanData=t("./clean_data"),n.calc=t("./calc").calc,n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style").style,n.styleOnSelect=t("./style").styleOnSelect,n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.animatable=!0,n.moduleType="trace",n.name="scatter",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","svg","symbols","markerColorscale","errorBarsOK","showLegend","scatter-like","zoomScale"],n.meta={},e.exports=n},{"../../plots/cartesian":216,"./arrays_to_calcdata":280,"./attributes":281,"./calc":282,"./clean_data":284,"./colorbar":285,"./defaults":288,"./hover":292,"./plot":300,"./select":301,"./style":302,"./subtypes":303}],294:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,l,s){var c=(t.marker||{}).color;(l("line.color",r),a(t,"line"))?i(t,e,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":53,"../../components/colorscale/has_colorscale":57,"../../lib":163}],295:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,a=t("../../lib"),i=a.segmentsIntersect,o=a.constrain,l=t("./constants");e.exports=function(t,e){var r,s,c,u,f,d,p,h,g,v,y,m,x,b,_,w,k=e.xaxis,M=e.yaxis,A=e.simplify,T=e.connectGaps,L=e.baseTolerance,S=e.shape,C="linear"===S,O=[],P=l.minTolerance,z=new Array(t.length),D=0;function E(e){var r=t[e],a=k.c2p(r.x),i=M.c2p(r.y);return a===n||i===n?r.intoCenter||!1:[a,i]}function N(t){var e=t[0]/k._length,r=t[1]/M._length;return(1+l.toleranceGrowth*Math.max(0,-e,e-1,-r,r-1))*L}function R(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}A||(L=P=-1);var I,F,j,B,H,q,V,U=l.maxScreensAway,G=-k._length*U,Y=k._length*(1+U),X=-M._length*U,Z=M._length*(1+U),W=[[G,X,Y,X],[Y,X,Y,Z],[Y,Z,G,Z],[G,Z,G,X]];function Q(t){if(t[0]<G||t[0]>Y||t[1]<X||t[1]>Z)return[o(t[0],G,Y),o(t[1],X,Z)]}function J(t,e){return t[0]===e[0]&&(t[0]===G||t[0]===Y)||(t[1]===e[1]&&(t[1]===X||t[1]===Z)||void 0)}function $(t,e,r){return function(n,i){var o=Q(n),l=Q(i),s=[];if(o&&l&&J(o,l))return s;o&&s.push(o),l&&s.push(l);var c=2*a.constrain((n[t]+i[t])/2,e,r)-((o||n)[t]+(l||i)[t]);c&&((o&&l?c>0==o[t]>l[t]?o:l:o||l)[t]+=c);return s}}function K(t){var e=t[0],r=t[1],n=e===z[D-1][0],a=r===z[D-1][1];if(!n||!a)if(D>1){var i=e===z[D-2][0],o=r===z[D-2][1];n&&(e===G||e===Y)&&i?o?D--:z[D-1]=t:a&&(r===X||r===Z)&&o?i?D--:z[D-1]=t:z[D++]=t}else z[D++]=t}function tt(t){z[D-1][0]!==t[0]&&z[D-1][1]!==t[1]&&K([j,B]),K(t),H=null,j=B=0}function et(t){if(I=t[0]<G?G:t[0]>Y?Y:0,F=t[1]<X?X:t[1]>Z?Z:0,I||F){if(D)if(H){var e=V(H,t);e.length>1&&(tt(e[0]),z[D++]=e[1])}else q=V(z[D-1],t)[0],z[D++]=q;else z[D++]=[I||t[0],F||t[1]];var r=z[D-1];I&&F&&(r[0]!==I||r[1]!==F)?(H&&(j!==I&&B!==F?K(j&&B?(n=H,i=(a=t)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?G:Y,Z]:[o>0?Y:G,X]):[j||I,B||F]):j&&B&&K([j,B])),K([I,F])):j-I&&B-F&&K([I||j,F||B]),H=t,j=I,B=F}else H&&tt(V(H,t)[0]),z[D++]=t;var n,a,i,o}for("linear"===S||"spline"===S?V=function(t,e){for(var r=[],n=0,a=0;a<4;a++){var o=W[a],l=i(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);l&&(!n||Math.abs(l.x-r[0][0])>1||Math.abs(l.y-r[0][1])>1)&&(l=[l.x,l.y],n&&R(l,t)<R(r[0],t)?r.unshift(l):r.push(l),n++)}return r}:"hv"===S||"vh"===S?V=function(t,e){var r=[],n=Q(t),a=Q(e);return n&&a&&J(n,a)?r:(n&&r.push(n),a&&r.push(a),r)}:"hvh"===S?V=$(0,G,Y):"vhv"===S&&(V=$(1,X,Z)),r=0;r<t.length;r++)if(s=E(r)){for(D=0,H=null,et(s),r++;r<t.length;r++){if(!(u=E(r))){if(T)continue;break}if(C){if(!((v=R(u,s))<N(u)*P)){for(h=[(u[0]-s[0])/v,(u[1]-s[1])/v],f=s,y=v,m=b=_=0,p=!1,c=u,r++;r<t.length;r++){if(!(d=E(r))){if(T)continue;break}if(w=(g=[d[0]-s[0],d[1]-s[1]])[0]*h[1]-g[1]*h[0],b=Math.min(b,w),(_=Math.max(_,w))-b>N(d))break;c=d,(x=g[0]*h[0]+g[1]*h[1])>y?(y=x,u=d,p=!1):x<m&&(m=x,f=d,p=!0)}if(p?(et(u),c!==f&&et(f)):(f!==s&&et(f),c!==u&&et(u)),et(c),r>=t.length||!d)break;et(d),s=d}}else et(u)}H&&K([j||H[0],B||H[1]]),O.push(z.slice(0,D))}return O}},{"../../constants/numerical":145,"../../lib":163,"./constants":287}],296:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],297:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n,a,i=null;for(a=0;a<r.length;++a)!0===(n=r[a][0].trace).visible?(n._nexttrace=null,-1!==["tonextx","tonexty","tonext"].indexOf(n.fill)&&(n._prevtrace=i,i&&(i._nexttrace=n)),i=n):n._prevtrace=n._nexttrace=null}},{}],298:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t){var e=t.marker,r=e.sizeref||1,a=e.sizemin||0,i="area"===e.sizemode?function(t){return Math.sqrt(t/r)}:function(t){return t/r};return function(t){var e=i(t/2);return n(e)&&e>0?Math.max(e,a):0}}},{"fast-isnumeric":10}],299:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,l,s,c){var u=o.isBubble(t),f=(t.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(t,"marker")&&i(t,e,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:u?n.background:n.defaultLine),a(t,"marker.line")&&i(t,e,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":43,"../../components/colorscale/defaults":53,"../../components/colorscale/has_colorscale":57,"./subtypes":303}],300:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=t("../../components/drawing"),l=t("./subtypes"),s=t("./line_points"),c=t("./link_traces"),u=t("../../lib/polygon").tester;function f(t,e,r,c,f,d,p){var h,g;!function(t,e,r,a,o){var s=r.xaxis,c=r.yaxis,u=n.extent(i.simpleMap(s.range,s.r2c)),f=n.extent(i.simpleMap(c.range,c.r2c)),d=a[0].trace;if(!l.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]}),g=Math.ceil(h.length/p),v=0;o.forEach(function(t,r){var n=t[0].trace;l.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<e&&v++});var y=Math.round(v*g/3+Math.floor(v/3)*g/7.1);a.forEach(function(t){delete t.vis}),h.forEach(function(t,e){0===Math.round((e+y)%g)&&(t.vis=!0)})}(0,e,r,c,f);var v=!!p&&p.duration>0;function y(t){return v?t.transition():t}var m=r.xaxis,x=r.yaxis,b=c[0].trace,_=b.line,w=n.select(d);if(a.getComponentMethod("errorbars","plot")(w,r,p),!0===b.visible){var k,M;y(w).style("opacity",b.opacity);var A=b.fill.charAt(b.fill.length-1);"x"!==A&&"y"!==A&&(A=""),r.isRangePlot||(c[0].node3=w);var T="",L=[],S=b._prevtrace;S&&(T=S._prevRevpath||"",M=S._nextFill,L=S._polygons);var C,O,P,z,D,E,N,R,I,F="",j="",B=[],H=i.noop;if(k=b._ownFill,l.hasLines(b)||"none"!==b.fill){for(M&&M.datum(c),-1!==["hv","vh","hvh","vhv"].indexOf(_.shape)?(P=o.steps(_.shape),z=o.steps(_.shape.split("").reverse().join(""))):P=z="spline"===_.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?o.smoothclosed(t.slice(1),_.smoothing):o.smoothopen(t,_.smoothing)}:function(t){return"M"+t.join("L")},D=function(t){return z(t.reverse())},B=s(c,{xaxis:m,yaxis:x,connectGaps:b.connectgaps,baseTolerance:Math.max(_.width||1,3)/4,shape:_.shape,simplify:_.simplify}),I=b._polygons=new Array(B.length),g=0;g<B.length;g++)b._polygons[g]=u(B[g]);B.length&&(E=B[0][0],R=(N=B[B.length-1])[N.length-1]),H=function(t){return function(e){if(C=P(e),O=D(e),F?A?(F+="L"+C.substr(1),j=O+"L"+j.substr(1)):(F+="Z"+C,j=O+"Z"+j):(F=C,j=O),l.hasLines(b)&&e.length>1){var r=n.select(this);if(r.datum(c),t)y(r.style("opacity",0).attr("d",C).call(o.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",C),o.singleLineStyle(c,a)}}}}}var q=w.selectAll(".js-line").data(B);y(q.exit()).style("opacity",0).remove(),q.each(H(!1)),q.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(o.lineGroupStyle).each(H(!0)),o.setClipUrl(q,r.layerClipId),B.length?(k?E&&R&&(A?("y"===A?E[1]=R[1]=x.c2p(0,!0):"x"===A&&(E[0]=R[0]=m.c2p(0,!0)),y(k).attr("d","M"+R+"L"+E+"L"+F.substr(1)).call(o.singleFillStyle)):y(k).attr("d",F+"Z").call(o.singleFillStyle)):M&&("tonext"===b.fill.substr(0,6)&&F&&T?("tonext"===b.fill?y(M).attr("d",F+"Z"+T+"Z").call(o.singleFillStyle):y(M).attr("d",F+"L"+T.substr(1)+"Z").call(o.singleFillStyle),b._polygons=b._polygons.concat(L)):(U(M),b._polygons=null)),b._prevRevpath=j,b._prevPolygons=I):(k?U(k):M&&U(M),b._polygons=b._prevRevpath=b._prevPolygons=null);var V=w.selectAll(".points");h=V.data([c]),V.each(W),h.enter().append("g").classed("points",!0).each(W),h.exit().remove(),h.each(function(t){var e=!1===t[0].trace.cliponaxis;o.setClipUrl(n.select(this),e?null:r.layerClipId)})}function U(t){y(t).attr("d","M0,0Z")}function G(t){return t.filter(function(t){return t.vis})}function Y(t){return t.id}function X(t){if(t.ids)return Y}function Z(){return!1}function W(e){var a,s=e[0].trace,c=n.select(this),u=l.hasMarkers(s),f=l.hasText(s),d=X(s),p=Z,h=Z;u&&(p=s.marker.maxdisplayed||s._needsCull?G:i.identity),f&&(h=s.marker.maxdisplayed||s._needsCull?G:i.identity);var g,b=(a=c.selectAll("path.point").data(p,d)).enter().append("path").classed("point",!0);v&&b.call(o.pointStyle,s,t).call(o.translatePoints,m,x).style("opacity",0).transition().style("opacity",1),a.order(),u&&(g=o.makePointStyleFns(s)),a.each(function(e){var a=n.select(this),i=y(a);o.translatePoint(e,i,m,x)?(o.singlePointStyle(e,i,s,g,t),r.layerClipId&&o.hideOutsideRangePoint(e,i,m,x,s.xcalendar,s.ycalendar),s.customdata&&a.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()}),v?a.exit().transition().style("opacity",0).remove():a.exit().remove(),(a=c.selectAll("g").data(h,d)).enter().append("g").classed("textpoint",!0).append("text"),a.order(),a.each(function(t){var e=n.select(this),a=y(e.select("text"));o.translatePoint(t,a,m,x)?r.layerClipId&&o.hideOutsideRangePoint(t,e,m,x,s.xcalendar,s.ycalendar):e.remove()}),a.selectAll("text").call(o.textPointStyle,s,t).each(function(t){var e=m.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each(function(){y(n.select(this)).attr({x:e,y:r})})}),a.exit().remove()}}e.exports=function(t,e,r,a,i,l){var s,u,d,p,h=!i,g=!!i&&i.duration>0;for((d=a.selectAll("g.trace").data(r,function(t){return t[0].trace.uid})).enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),c(t,e,r),function(t,e,r){var a;e.selectAll("g.trace").each(function(t){var e=n.select(this);if((a=t[0].trace)._nexttrace){if(a._nextFill=e.select(".js-fill.js-tonext"),!a._nextFill.size()){var i=":first-child";e.select(".js-fill.js-tozero").size()&&(i+=" + *"),a._nextFill=e.insert("path",i).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),a._nextFill=null;a.fill&&("tozero"===a.fill.substr(0,6)||"toself"===a.fill||"to"===a.fill.substr(0,2)&&!a._prevtrace)?(a._ownFill=e.select(".js-fill.js-tozero"),a._ownFill.size()||(a._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),a._ownFill=null),e.selectAll(".js-fill").call(o.setClipUrl,r.layerClipId)})}(0,a,e),s=0,u={};s<r.length;s++)u[r[s][0].trace.uid]=s;(a.selectAll("g.trace").sort(function(t,e){return u[t[0].trace.uid]>u[e[0].trace.uid]?1:-1}),g)?(l&&(p=l()),n.transition().duration(i.duration).ease(i.easing).each("end",function(){p&&p()}).each("interrupt",function(){p&&p()}).each(function(){a.selectAll("g.trace").each(function(n,a){f(t,a,e,n,r,this,i)})})):a.selectAll("g.trace").each(function(n,a){f(t,a,e,n,r,this,i)});h&&d.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":68,"../../lib":163,"../../lib/polygon":175,"../../registry":245,"./line_points":295,"./link_traces":297,"./subtypes":303,d3:7}],301:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,a,i,o,l=t.cd,s=t.xaxis,c=t.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r<l.length;r++)l[r].selected=0;else for(r=0;r<l.length;r++)a=l[r],i=s.c2p(a.x),o=c.c2p(a.y),e.contains([i,o])?(u.push({pointNumber:r,x:s.c2d(a.x),y:c.c2d(a.y)}),a.selected=1):a.selected=0;return u}},{"./subtypes":303}],302:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/drawing"),i=t("../../registry");function o(t,e,r){a.pointStyle(t.selectAll("path.point"),e,r),a.textPointStyle(t.selectAll("text"),e,r)}e.exports={style:function(t,e){var r=e?e[0].node3:n.select(t).selectAll("g.trace.scatter");r.style("opacity",function(t){return t[0].trace.opacity}),r.selectAll("g.points").each(function(e){o(n.select(this),e.trace||e[0].trace,t)}),r.selectAll("g.trace path.js-line").call(a.lineGroupStyle),r.selectAll("g.trace path.js-fill").call(a.fillGroupStyle),i.getComponentMethod("errorbars","style")(r)},stylePoints:o,styleOnSelect:function(t,e){var r=e[0].node3,n=e[0].trace;n.selectedpoints?(a.selectedPointStyle(r.selectAll("path.point"),n),a.selectedTextStyle(r.selectAll("text"),n)):o(r,n,t)}}},{"../../components/drawing":68,"../../registry":245,d3:7}],303:[function(t,e,r){"use strict";var n=t("../../lib");e.exports={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")||"splom"===t.type)},hasText:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("text")},isBubble:function(t){return n.isPlainObject(t.marker)&&n.isArrayOrTypedArray(t.marker.size)}}},{"../../lib":163}],304:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a,i){i=i||{},a("textposition"),n.coerceFont(a,"textfont",r.font),i.noSelect||(a("selected.textfont.color"),a("unselected.textfont.color"))}},{"../../lib":163}],305:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,a){var i,o=a("x"),l=a("y");if(n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],r),o)l?i=Math.min(o.length,l.length):(i=o.length,a("y0"),a("dy"));else{if(!l)return 0;i=e.y.length,a("x0"),a("dx")}return e._length=i,i}},{"../../registry":245}]},{},[5])(5)});